Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
file input display image
function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function (e) { $('#demo-img').attr('src', e.target.result); } reader.readAsDataURL(input.files[0]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function display_img(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n $('.display_img')\n .attr('src', e.target.result)\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function showImage() {\n if (this.files && this.files[0]) {\n const obj = new FileReader();\n obj.onload = function(data) {\n const image = document.getElementById(\"image\");\n image.src = data.target.result;\n };\n obj.readAsDataURL(this.files[0]);\n }\n}", "function showMyImage(fileInput) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) { \n var file = files[i];\n var imageType = /image.*/; \n if (!file.type.match(imageType)) {\n continue;\n } \n var img=document.getElementById(\"thumbnil\"); \n img.file = file; \n var reader = new FileReader();\n reader.onload = (function(aImg) { \n return function(e) { \n aImg.src = e.target.result; \n }; \n })(img);\n reader.readAsDataURL(file);\n } \n }", "function preview(input){\n if(input.files && input.files[0]){\n var reader = new FileReader();\n reader.onload = function (e) {\n $(\"#div-img\").html(\"<img src='\"+e.target.result+\"' class='img-circle img_cambia'>\");\n }\n reader.readAsDataURL(input.files[0]);\n }\n }", "function showImage(input){\n if(input.files && input.files[0]){\n \n // Read the image to load it in \n var reader = new FileReader();\n\n // Call the onload function when the reader starts reading in the next line.\n reader.onload = function(e){\n $(\"#image\")\n .attr(\"src\",e.target.result)\n .Jcrop({\n // updateCoords will be called whenever the selector box is altered or moved(dragged).\n onChange: updateCoords,\n onSelect: updateCoords,\n\n // Set the width for the image which in turn will set the scale for the image automatically.\n boxWidth: 450, boxHeight: 400\n },function(){\n\n // Save the current jcrop instance for setting rotate variable in above functions.\n jcrop_api = this;\n }); \n\n };\n\n // Load the image to the image tag.\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readImage(input) {\n \n if (input.files && input.files[0]) {\n \n var reader = new FileReader;\n \n reader.onload = function (e) {\n $('#preview').show();\n $('#preview').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n}", "function readURL(input) {\n document.getElementById('image-selected').style.display = 'block';\n\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function (e) {\n //change label to show in form view of photos\n document.getElementById('file-inputed').style.display = 'block';\n //show image name in label tag\n $('#file-inputed')\n .text(document.getElementById(\"image-field\").files[0].name);\n //set image preview in image tag\n $('#image-selected')\n .attr('src', e.target.result)\n .width('100%')\n .height('auto')\n .attr('alt', input.files[0].name);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function showPreviewImage(input) {\n if (input.files && input.files[0] && (/\\.(gif|jpe?g|png|svg)$/i).test(input.files[0].name)) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n var stroke = $(input).closest('.admin-stroke');\n if (stroke.length == 0) { stroke = $(input).closest('.admin-stroke--no') }\n stroke.find('.js__image-preview').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function handleFileSelect() {\n var picture = document.getElementById('picture_input').files.item(0);\n displayPicturePreview(picture);\n }", "function readFileInput(input) {\n if (input.files && input.files[0]) {\n $( \".file-name-label\" ).html(`<i class=\"upload icon\"></i> ${input.files[0].name}`);\n \n var reader = new FileReader();\n reader.onload = function (e) {\n $('#upload-img-preview').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function showMyImage(fileInput, imagePreview) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var imageType = /image.*/;\n if (!file.type.match(imageType)) {\n continue;\n }\n var img = document.getElementById(imagePreview);\n img.file = file;\n var reader = new FileReader();\n reader.onload = (function (aImg) {\n return function (e) {\n aImg.src = e.target.result;\n };\n })(img);\n reader.readAsDataURL(file);\n }\n files = \"\";\n img = \"\";\n}", "function uploadPic() {\n\tfile = fileInput.files[0];\n\tconsole.log(file)\n\tlet fileData = new FileReader();\n\tconsole.log(fileData)\n\tfileData.readAsDataURL(file)\n\tfileData.onload = function displayPic () {\n\t\tlet fileURL = fileData.result;\n\t\timage.src = fileURL\n\t\tconsole.log(image.src)\n\t};\n\tpicLabel.style.display = \"none\"\nconsole.log(fileInput)\n\n}", "function updateImageDisplay() {\n var preview = document.querySelector('.preview'+fileKey);\n var input = document.getElementById('image_uploads'+fileKey);\n \n while(preview.firstChild) {\n preview.removeChild(preview.firstChild);\n }\n\n var curFiles = input.files;\n if(curFiles.length === 0) {\n\tvar para = document.createElement('p');\n para.textContent = 'Nenhum arquivo selecionado';\n preview.appendChild(para);\n } else {\n\t var listItem = document.createElement(\"div\");\n var para = document.createElement('p');\n\t \n if(validFileType(curFiles[0])) {\n var image = document.createElement('img');\n image.src = window.URL.createObjectURL(curFiles[0]);\n\t\t\n listItem.append(image);\n\t\t\n } else {\n para.textContent = 'O Arquivo ' + curFiles[0].name + ': Não é um tipo de arquivo válido.';\n\t\tlistItem.append(para);\n }\n\t \n\t preview.appendChild(listItem); // adiciona na div\n }\n}", "readPicture(event){this.clear();var file=event.target.files[0];// FileList object\nthis.currentFile=file;// Clear the selection in the file picker input.\nthis.imageInput.wrap('<form>').closest('form').get(0).reset();this.imageInput.unwrap();// Only process image files.\nif(file.type.match('image.*')){var reader=new FileReader;reader.onload=e=>this.displayPicture(e.target.result);// Read in the image file as a data URL.\nreader.readAsDataURL(file);this.disableUploadUi(false)}}", "function showAchPic(input){\n\tif(input.files && input.files[0]){\n\t\tvar reader = new FileReader();\n\n\t\treader.onload = function(e){\n\t\t\t$(\"#achPhotoPlaceHolder\").attr(\"src\",e.target.result);\t\n\t\t}\n\n\t\treader.readAsDataURL(input.files[0]);\n\t}\n}", "function display_image(selection) {\n $(\"#greyscale_btn\").attr(\"disabled\", false)\n $(\"#invert_btn\").attr(\"disabled\", false)\n $(\"#reset_btn\").attr(\"disabled\", false)\n $(\"#brightness\").attr(\"disabled\", false)\n\n if (selection.files && selection.files[0]) {\n let reader = new FileReader()\n reader.onload = (o) => {\n $('#upload')\n .attr('src', o.target.result) // Gives <img> a valid src\n .width(300)\n .height(300)\n }\n reader.readAsDataURL(selection.files[0])\n } else {\n alert(\"Error with image upload\")\n } // end if else\n}", "function displayImageText(){\n var fileValue = document.getElementById(\"filebtn\");\n var txt = \"\";\n if ('files' in fileValue) {\n if (fileValue.files.length == 0) {\n txt = \"\";\n } else {\n for (var i = 0; i < fileValue.files.length; i++) {\n txt += \"<br><strong>\" + (i+1) + \". File: </strong>\";\n var file = fileValue.files[i];\n if ('name' in file) {\n txt += file.name + \"<br>\";\n }\n if ('size' in file) {\n txt += \"Size: \" + file.size + \" bytes <br>\";\n }\n }\n }\n } \n else {\n if (fileValue.value == \"\") {\n txt += \"\";\n } else {\n txt += \"The files property is not supported by your browser!\";\n txt += \"<br>The path of the selected file: \" + fileValue.value; \n }\n }\n document.getElementById(\"imageVal\").innerHTML = txt;\n}", "function showImage() {\n var files = document.getElementById(\"file_upload\").files;\n var imageHolder = document.getElementById(\"user_pic\");\n\n\n if (window.File && window.FileReader) {\n if (!files[0].type.match(\"image.*\")) {\n alert(\"Selected file is not an image\");\n document.getElementById(\"file_upload\").value = \"\";\n return;\n }\n \n var reader = new FileReader();\n \n reader.onload = function() {\n imageHolder.src = reader.result;\n };\n \n reader.readAsDataURL(files[0]);\n }\n else\n alert(\"File API's are not supported by your browser\");\n}", "function show_image(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#profile_img_edit_profile_page').attr('src', e.target.result);\n\n // $('.profile_image').Jcrop({\n // // onselect: updateCoords,\n // bgOpacity: .4,\n // setSelect: [100, 100, 50, 50],\n // aspectRatio: 1/1\n // });\n };\n\n reader.readAsDataURL(input.files[0]);\n $('#save_changes').css({ \"visibility\": \"visible\" });\n }\n}", "function file_com_img(img){\n \n var files=$(img)[0].files;\n var filename= files[0].name;\n var extension=filename.substr(filename.lastIndexOf('.')+1);\n var allowed=[\"jpg\",\"png\",\"jpeg\"];\n \n if(allowed.lastIndexOf(extension)===-1){\n $.alert({\n title:'Error on file type!',\n content:'The file type selected is not of jpg , jpeg or png. Please select a valid image/photo',\n type:'red',\n typeAnimated:true,\n buttons:{\n ok:{\n text:'Ok',\n btnClass:'btn-red',\n action:function()\n {\n img.value=\"\";\n $('#label-span').html('Select photo/image');\n\t\t\t\t\t\t/*\n $('#upload_image_view').attr({src:\"assets/img/default-icon-1024.png\"}).show();\n $('#hidden_pre_div').hide();*/\n }\n }\n }\n });\n }else{\n if(img.files && img.files[0])\n {\n var filereader = new FileReader();\n filereader.onload=function(evt)\n {\n //Hide the default image/photo\n //$('#upload_image_view').hide();\n //Show the image selected and add an img element to the div element\n //$('#hidden_pre_div').show().html('<img src=\"'+evt.target.result+'\" width=\"200\" height=\"200\" />');\n //set label text\n $('#label-span').html(''+filename);\n\t\t\t \n };\n filereader.readAsDataURL(img.files[0]);\n }\n }\n}", "function displayDURL(file) {\n var reader = new FileReader();\n\n reader.onload = function(e) {\n var img = new Image();\n img.src = e.target.result;\n img.onload = function() {\n var dataUrl = e.target.result;\n logo.src = dataUrl;\n imgUrl.value = logo.src;\n };\n };\n reader.readAsDataURL(file);\n }", "function previewFile() {\n var forsworn;\n var elephant = document.getElementById('img');\n var preview = document.querySelector('img');\n var file = document.querySelector('input[type=file]').files[0];\n var reader = new FileReader();\n reader.onloadend = function () {\n preview.src = reader.result;\n }\n\n if (file) {\n reader.readAsDataURL(file);\n\n }\n else {\n preview.src = \"\";\n }\n}", "function showFile(file){\n let fileType = file.type;\n \n //? adding some valid image extensions in array\n let validExtensions = [\"image/jpeg\", \"imgae/jpg\", \"image/png\"]; \n\n if(validExtensions.includes(fileType)){\n //? if user selected file is an image file\n\n //? creating new FileReader object\n let fileReader = new FileReader(); \n\n fileReader.onload = () => {\n //? passing user file source is fileURL variable\n // console.log(fileReader)\n let fileURL = fileReader.result;\n // console.log(fileURL);\n\n //? creating an img tag and padding user selected file source inside src attribute\n let imgTag = `<img src=\"${fileURL}\" alt=\"\">`;\n dropArea.innerHTML = imgTag; \n }\n fileReader.readAsDataURL(file);\n dropArea.classList.add('active');\n }else{\n alert(\"This is an not Image File\")\n dropArea.classList.remove('active');\n }\n}", "function displayImage(event){ // display selected image function\n if(event.target.files.length > 0){// get the image src and append it to the preview which is the default image holder\n let src = URL.createObjectURL(event.target.files[0]);\n let preview = document.getElementById(\"document\");\n let cont = document.getElementById(\"picCont\")\n preview.src = src;\n preview.style.display = \"block\";\n picCont.style.display = \"none\";\n } \n }", "function ShowPreview(input) {\n var fileName = $('input[type=file]').val();\n //$(\"#hdfOldImageName\").val(\"\");\n $(\"#hdfImageName\").val(fileName);\n if (input.files && input.files[0]) {\n var ImageDir = new FileReader();\n ImageDir.onload = function (e) {\n $(\"#profileImage\").attr(\"src\", e.target.result);\n }\n ImageDir.readAsDataURL(input.files[0]);\n }\n\n var validator = $(\"#frm_Profile\").validate();\n validator.element(\"#hdfImageName\");\n}", "function readURLimg( input, eq ){\n\t // console.log( eq );\n\t if( input.files && input.files[0]){\n\t var reader = new FileReader();\n\n\t reader.onload = function(e){\n\t $('.neu-upload-cover-image img.img-cover-preview').eq(eq).attr('src', e.target.result );\n\t \n\t // $('.cm-upload-del').eq(eq).show();\n\t // $('.cm-uploader label').eq(eq).hide();\n\t // $('.cm-preview-wrapper').eq(eq).css('min-height', 100+'px');\n\t // $('.cm-preview-wrapper').eq(eq).css('height', 100+'px');\n\t }\n\t reader.readAsDataURL( input.files[0] );\n\t }\n\t }", "function loadImageBtnClick() {\n if (invisible_file_input) {\n invisible_file_input.accept = '.jpg,.jpeg,.png,.bmp';\n invisible_file_input.onchange = function (event) {\n for (var i = 0; i < event.currentTarget.files.length; i++) {\n // create image info\n var imageInfo = new ImageInfo();\n imageInfo.fileRef = event.currentTarget.files[i];\n imageInfo.loadFromFile();\n // add image info\n gImageInfoList.push(imageInfo);\n }\n imageInfoRegionsSelectorUpdate();\n selectImageNumberUpdate();\n // image number input\n //if (gImageInfoList.length > 0)\n // imageNumberInput.max = gImageInfoList.length - 1;\n }\n invisible_file_input.click();\n }\n}", "function visualizar() {\r\n\r\n\r\n var preview = document.getElementById('pic');\r\n var file = document.getElementById('flu_foto').files[0];\r\n var reader = new FileReader();\r\n\r\n reader.onloadend = function () {\r\n preview.src = reader.result;\r\n }\r\n\r\n\r\n if (file) {\r\n reader.readAsDataURL(file);\r\n\r\n } else {\r\n preview.src = \"\";\r\n }\r\n\r\n\r\n\r\n}", "function previewItemPicture(input) {\n if (input.files && input.files[0]) {\n let reader = new FileReader();\n reader.onload = function (e) {\n $('#itemPicturePreview').attr('src', e.target.result).fadeIn('slow');\n };\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function (e) {\n //id <img scr=\"#\"\n $('#imagePreview').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "function showMyImage(fileInput) {\n var files = fileInput.files;\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n var imageType = /image.*/;\n if (!file.type.match(imageType)) {\n continue;\n }\n var img = document.getElementById(\"companyProductImage\");\n img.file = file;\n var reader = new FileReader();\n reader.onload = (function (aImg) {\n return function (e) {\n aImg.src = e.target.result;\n };\n })(img);\n reader.readAsDataURL(file);\n console.log(\"image loaded\");\n\n generateColorCode();\n }\n}", "function readImage(input)\n { \n if (input.files && input.files[0])\n { \n var reader = new FileReader(); \n\t reader.onload = function (e) { \n $('#imageUpload').attr('src',e.target.result); // setting ur image here\t\t\n\t }; \t\t\t\t\t\t\t \n reader.readAsDataURL(input.files[0]); // Read in the image file as a data URL. \t\t\t} \t\t\n }\n }", "function visualizarImg() {\n\tvar preview = document.querySelectorAll('img').item(2);\n\tvar file = document.querySelector('input[type=file]').files[0];\n\tvar reader = new FileReader();\n\t\n\treader.onloadend = function() {\n\t\t// carrega em base64 a img\n\t\tpreview.src = reader.result;\n\t};\n\t\n\tif (file) {\n\t\treader.readAsDataURL(file);\n\t} else {\n\t\tpreview.src = \"\";\n\t}\n}", "function viewImage(input,viewId,image_width,image_height) \r\n\t{\r\n\r\n\t\tif (input.files && input.files[0]) {\r\n\t\t var reader = new FileReader();\r\n\t\r\n\t\t reader.onload = function (e) {\r\n\t\t $('#'+viewId)\r\n\t\t .attr('src', e.target.result)\r\n\t\t .width(image_width)\r\n\t\t .height(image_height);\r\n\t\t };\r\n\t\t reader.readAsDataURL(input.files[0]);\r\n\t\t}\r\n\t}", "handleFileChange(e) {\n this.setState({\n image:\n e.target\n .value /**URL.createObjectURL(e.target.files[0]) to display image before submit (for file uploads, not URLs) */,\n });\n }", "function displayBankLogo(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n $('#banklogoImage').attr('src', e.target.result);\n };\n reader.readAsDataURL(input.files[0]);\n var uploadedFilename = $('#bankLogo').val().split('/').pop().split('\\\\').pop();\n $('#logoUploadInput').val(uploadedFilename);\n }\n}", "previewFile() {\n var preview = document.getElementById('avatarBox');\n var file = document.querySelector('input[type=file]').files[0];\n var reader = new FileReader();\n\n reader.onload = function () {\n // changes the avatar icon to the file's image\n preview.src = reader.result;\n }\n\n if (file) {\n reader.readAsDataURL(file);\n }\n }", "function readImageURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#preview_img')\n .attr('src', e.target.result);\n document.getElementById('preview-figure').style.display = 'block';\n document.getElementById('preview_img').style.display = 'inline-block';\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function drawImage(input) {\n\t\tif (input.files && input.files[0]) {\n\t\t\tvar reader = new FileReader();\n\t\t\treader.onload = function(e) {\n\t\t\t\tvar parentofSelected = input.parentNode; \n\t\t\t\tparentofSelected.getElementsByTagName('img')[0].setAttribute('src', e.target.result);\n\t\t\t}\n\t\t\treader.readAsDataURL(input.files[0]);\n\t\t}\n\t}", "function showPreview(objFileInput) {\n if (objFileInput.files[0]) {\n var fileReader = new FileReader();\n fileReader.onload = function (e) {\n $('#blah').attr('src', e.target.result);\n\t\t\t$(\"#targetLayer\").html('<img src=\"'+e.target.result+'\" width=\"200px\" height=\"200px\" class=\"upload-preview\" />');\n\t\t\t$(\"#targetLayer\").css('opacity','0.7');\n\t\t\t$(\".icon-choose-image\").css('opacity','0.5');\n //ux para mostrar y ocultar\n $('.btnSubmit').show();\n }\n\t\tfileReader.readAsDataURL(objFileInput.files[0]);\n }\n}", "function readURL(input){\n if(input.files && input.files[0]){\n var reader = new FileReader();\n reader.onload = function(e){\n $('#showimages').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function upload(){\n var cc1=document.getElementById(\"c1\");\n var\n fileinput=document.getElementById(\"finput\");\n img = new SimpleImage(fileinput);\n img.drawTo(cc1);\n}", "function uploadImage(input) {\n const label = $('[data-js-label]');\n if (input.files && input.files[0]) {\n console.log(input.files[0]);\n if (input.files[0].size < MAX_FILE_UPLOAD_SIZE) {\n if (input.files[0].type === 'image/jpeg' || input.files[0].type === 'image/png') {\n label.text(input.files[0].name)\n var reader = new FileReader();\n reader.onload = function (e) {\n // Show logo if all conditions are true\n LOGO.show();\n $('.logo').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]); // convert to base64 string\n } else {\n alert('We only support JPF/PNG images');\n }\n } else {\n alert('File size should be less than 5 MB')\n }\n }\n}", "function readFile(input) {\n var previewZone = document.getElementById('file-preview-zone');\n\n //Sí no se selecciona imagen y ya hay una cargada en la vista previa la quitamos\n if (input.files.length == 0 && flag == true) {\n previewZone.removeChild(previewZone.firstChild);\n flag = false; //Indicamos que ya no hay imagen en la vista previa\n }\n\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var filePreview = document.createElement('img');\n\n filePreview.id = 'file-preview';\n filePreview.src = e.target.result;\n filePreview.classList.add('imagePreview');\n\n //Sí se selecciona otra imagen y ya hay una en la vista previa la quitamos para poder poner la nueva\n if (flag == true) {\n previewZone.removeChild(previewZone.firstChild);\n }\n\n previewZone.appendChild(filePreview);\n flag = true; //Indicamos que hay una imagen cargada en la vista previa\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n } //Fin de readFile", "function loadForegroundImage(){\n //get input from text input\n var fileinput = document.getElementById(\"foreinput\");\n fgcanvas = document.getElementById(\"canvf\");\n \n //create the selected image\n fgImage = new SimpleImage(fileinput);\n // show on the canvas\n fgImage.drawTo(fgcanvas);\n}", "function renderImage(file) {\n images.push(file);\n// generate a new FileReader object\n var reader = new FileReader();\n// inject an image with the src url\n reader.onload = function(event) {\n the_url = event.target.result\n $('#preview').html(\"<img src='\" + the_url + \"' />\")\n}// when the file is read it triggers the onload event above.\n reader.readAsDataURL(file);\n}", "function filePreview(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n var file = e.target;\n $(\"<span class=\\\"pip\\\">\" +\n \"<img class=\\\"mainImg\\\" src=\\\"\" + e.target.result + \"\\\" title=\\\"\" + file.name + \"\\\"/>\" +\n \"<span class=\\\"remove\\\">Изтрий</span>\" +\n \"</span>\").insertAfter(\"#file\");\n $(\".remove\").click(function(){\n $(this).parent(\".pip\").remove();\n });\n };\n reader.readAsDataURL(input.files[0]);\n }\n $('#images').css(\"margin-top\", 240);\n}", "function pathFile(event){\n imageLoad = URL.createObjectURL(event.target.files[0]);\n loadImage(imageLoad, img => {\n image(img, 0, 0);\n })\n}", "function imageUpload (){\n loader.style.display = \"block\";\n loader.innerHTML = \"reading file\";\n document.getElementById(\"file-input\").style.display = \"none\";\n var file = document.getElementById('upload-image').files[0];\n //using file reader to load the image.\n var reader = new FileReader();\n if(file){\n reader.readAsDataURL(file);\n }\n reader.onloadend = function () {\n loader.innerHTML = \"image loaded\";\n preview.src = reader.result;\n }\n}", "function previewImage(input)\n\t{\n\t\tif (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('.previewHolder').attr('src', e.target.result);\n $('.userPic img').attr('src', e.target.result);\n $('.menuBigPic img').attr('src', e.target.result);\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n\t}", "handleFile(evt) {\n const fileInput = this.shadowRoot.querySelector('[type=\"file\"]');\n const label = this.shadowRoot.querySelector(\"[data-js-label]\");\n let preview = this.shadowRoot.querySelector(\".file-preview img\");\n let reader = new FileReader(); // console.log(preview.src);\n\n reader.onload = function () {\n preview.src = reader.result;\n };\n\n reader.readAsDataURL(evt.target.files[0]);\n\n fileInput.onmouseout = function () {\n if (!fileInput.value) return;\n let value = fileInput.value.replace(/^.*[\\\\\\/]/, \"\"); // console.log(this.getFileExtension(value))\n // el.className += ' -chosen'\n\n label.innerText = value;\n };\n\n this.uploadFile(fileInput);\n }", "function handleImage(e){\n var reader = new FileReader();\n reader.onload = function(event){\n var img = new Image();\n img.onload = function(){\n if (imageLoaderCallback) {\n \timageLoaderCallback (img);\n }\n // clear the input element so that a new load on the same file will work\n e.target.value = \"\";\n }\n img.src = event.target.result;\n }\n reader.readAsDataURL(e.target.files[0]); \n}", "function placeNewImage(file) {6\n var reader = new FileReader();\n\n console.log(file);\n\n console.log(\"input file change\");\n\n reader.addEventListener(\"load\", function () {\n $(\"#upload_pane\").css(\"background-image\", 'url(\"' + reader.result + '\")');\n $(\"#upload_pane\").css(\"background-size\", \"contain\");\n $(\"#upload_pane\").css(\"background-repeat\", \"no-repeat\");\n $(\"#upload_pane\").css(\"background-position\", \"center\");\n $(\"input[type='submit']\").prop('disabled', false);\n $(\"#process_type\").val('image_parse');\n // $(\"input[name='process']\").val(\"Process\");\n\n $(\"#option_pane\").hide();\n $(\"#lbl_Choose\").hide();\n $(\"#divSmooth\").hide();\n\n $(\"#upload_pane\").hover(function () {\n $(\"#upload_pane .dragdrop\").toggle();\n });\n // \t\t\t$(\"#upload_pane .dragdrop\").hide(); \n }, false);\n\n if (file) {\n reader.readAsDataURL(file);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#imagepreview_templogo').prop('src', e.target.result).show();\n $('.temp_remove_act').show();\n };\n reader.readAsDataURL(input.files[0]);\n }\n}", "function showImgPreview(file, img) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n img.attr('src', reader.result).show();\n };\n reader.readAsDataURL(file);\n }", "function preview(file) {\n // reset display and path\n display.innerHTML = '';\n path.innerHTML = '';\n // Init FileReader\n const reader = new FileReader();\n if (file) {\n fileName = file.name;\n // Read data as URL\n reader.readAsDataURL(file);\n\n // Add image to display\n reader.addEventListener('load', () => {\n // crete image\n image = new Image();\n // set src\n image.src = reader.result;\n image.style.maxWidth = '100%';\n display.appendChild(image);\n\n // Add file link\n path.innerHTML = `<a href=\"${reader.result}\" download> Link to Download</a>`;\n });\n }\n reader.onload;\n}", "function showpreview(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#priestPreview').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n $('#the_user_img').css('background-image', \"url(\" + e.target.result + \")\");\n $('.the_user_img').css('opacity', \"1\");\n //$('#the_user_img').attr('src', e.target.result) .width(150)\n\n };\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function(e) {\n $('#studentimg').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input, imgElement) {\r\n\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function (e) {\r\n imgElement.attr('src', e.target.result);\r\n }\r\n imgElement.removeClass('hide');\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function preImage(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n\n $('#blah').attr('src', e.target.result);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#showImageUpload').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n}", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#uploadimg')\n .attr('src', e.target.result).width(200)\n .height(250);\n $('#uploadimg').css('display', 'block');\n\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n}", "function filePreview2(input) {\n if (input.files && input.files[0]) {\n\t\tvar reader = new FileReader();\t\t\n\t\treader.onload = function (e) {\n\t\t\t$('.newTripPhoto').attr('src', e.target.result);\n\t\t}\n\t\treader.readAsDataURL(input.files[0]);\n }\n}", "managePicture() {\n var preview = document.querySelector('img');\n var file = document.getElementById(\"recipe-pic\").files[0];\n var reader = new FileReader();\n \n reader.addEventListener(\"load\", function () {\n preview.src = reader.result;\n }, false);\n \n if (file) {\n reader.readAsDataURL(file);\n }\n }", "function uploadAndShowPicture(evt) {\n // Check for the various File API support.\n if (window.File && window.FileReader && window.FileList && window.Blob) {\n // Great success! All the File APIs are supported.\n var files = evt.target.files; // FileList object\n\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n if (!f.type.match('image.*')) {\n continue;\n }\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n // Render thumbnail.\n\n $('.canvas__background-image').css(\"background-image\", \"url(\"+e.target.result+\")\");\n uploadedImage = 1;\n return e.target.result;\n };\n })(f);\n\n // Read in the image file as a data URL.\n reader.readAsDataURL(f);\n }\n } else {\n console.log('The File APIs are not fully supported in this browser.');\n return undefined;\n }\n }", "previewFile(cb) {\n var file = document.querySelector('input[type=file]').files[0];\n let reader = new FileReader();\n try {\n if (file.type == 'image/jpeg' || file.type == \"image/gif\" || file.type == \"image/png\" || file.type == \"image/tiff\") {\n reader.onload = function () {\n let img = new Image();\n img.src = reader.result;\n img.onload = function () {\n cb(img);\n }\n }\n } else {\n throw \"not an image file\";\n }\n if (file) {\n reader.readAsDataURL(file);\n }\n } catch (error) {\n console.log(error);\n }\n }", "function clickFileItenAdmin(id) {\n var idchan = '#imgLog' + id;\n var idchankey = 'imgLog' + id;\n $(idchan).click();\n const imgFile = document.getElementById(idchankey);\n imgFile.addEventListener(\"change\", function () {\n const file = this.files[0];\n var tmppath = URL.createObjectURL(this.files[0]);\n var yave = '#ImganItenAdmin' + id;\n if (file) {\n const render = new FileReader();\n render.addEventListener(\"load\", function (event) {\n console.log(this.result);\n $(yave).attr(\"src\", this.result);\n $(yave).attr(\"value\", $(idchan).val());\n });\n render.readAsDataURL(file);\n }\n });\n}", "function showFile(src, width, height, alt) {\n\tvar img = document.createElement(\"img\");\n\timg.src = src;\n\timg.width = width;\n\timg.height = height;\n\timg.alt = file;\n}", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n\n // Loop through the FileList and render image files as thumbnails.\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files.\n console.log(f.type);\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n doc.name = theFile.name ;\n\t doc.content = e.target.result;\n\t switchToPanel('adjust');\n\t document.getElementById('span_filename').innerHTML = doc.name;\n };\n })(f);\n\n // Read in the file as Text -utf-8.\n reader.readAsText(f);\n }\n}", "function readURL(input) {\n\t\t if (input.files && input.files[0]) {\n\t\t var reader = new FileReader();\n\t\t reader.onload = function (e) {\n\t\t $('#img-in-modal').attr('src', e.target.result);\n\t\t }\n\t\t reader.readAsDataURL(input.files[0]);\n\t\t }\n\t\t}", "function filename()\n{ \n var fileName = document.getElementById(\"blog_image\").files[0].name;\n document.getElementById('image_label').innerText=fileName;\n}", "function imageLoader(event) {\n displayImage(event)\n previewFile()\n}", "function readURL(input) {\n\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#preview-image').attr('src', e.target.result);\n $('.preview-wrapper').css('background-color', '#fff');\n $('#remove-image').removeClass('element-hidden');\n }\n reader.readAsDataURL(input.files[0]);\n }\n\n }", "function showPicked(input) {\n const width = 400;\n\n const fileName = input.files[0].name;\n el(\"upload-label\").innerHTML = fileName;\n var reader = new FileReader();\n reader.onload = function(readerEvent) {\n el(\"image-picked\").src = readerEvent.target.result;\n el(\"image-picked\").className = \"\";\n\t \n var img = new Image();\n img.onload = function(imageEvent) {\n const elem = document.createElement('canvas');\n const scaleFactor = width / img.width;\n elem.width = width;\n elem.height = img.height * scaleFactor;\n const ctx = elem.getContext('2d');\n // img.width and img.height will contain the original dimensions\n ctx.drawImage(img, 0, 0, width, img.height * scaleFactor);\n const dataUrl = ctx.canvas.toDataURL(img, 'image/jpeg', 1);\n //el(\"resized-image\").className = \"\";\n el(\"resized-image\").src = dataUrl;\n //var resizedImage = dataURLToBlob(dataUrl);\n //el(\"resized-Image\") = resizedImage;\n //ctx.canvas.toBlob((blob) => {\n // const file = new File([blob], fileName, {\n // type: 'image/jpeg',\n // lastModified: Date.now()\n // });\n //}, 'image/jpeg', 1);\n }\n img.src = readerEvent.target.result;\n reader.onerror = error => console.log(error);\n\n };\n reader.readAsDataURL(input.files[0]);\n}", "function readURL(input,x) \n{\n let imagehold=x;\n if (input.files && input.files[0]) \n {\n let reader = new FileReader();\n\n reader.onload = function (e) \n {\n $('#'+imagehold).attr('src', e.target.result);\n };\n\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURLX(input, nb) {\n\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n $('#etiquette'+nb+' > img').attr('src', e.target.result);\n }\n\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readUrl(input){\n\tif(input.files && input.files[0]){\n\t\tvar reader = new FileReader();\n\t\treader.onload = function (e) {\n $('#imgUpload').attr('src', e.target.result).width(300).height(200);\n };\n reader.readAsDataURL(input.files[0]);\n\t}\n}", "function readURL(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function(e) {\r\n document.getElementById('imagePreview').src=e.target.result;\r\n }\r\n\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "function getFile(file) {\r\n const validEx = [\"image/png\", \"image/jpg\", \"image/jpeg\"];\r\n if (validEx.includes(file.type)) {\r\n const reader = new FileReader();\r\n reader.readAsDataURL(file);\r\n reader.onload = () => {\r\n let el = `<img name = \"img_file\" src = \"${reader.result}\" alt=\"\">`;\r\n drag_area.innerHTML = el;\r\n valid = true;\r\n };\r\n } else {\r\n alert(\"File not valid img\");\r\n valid = false;\r\n }\r\n}", "function previewFile() {\n var preview = document.querySelector('img');\n var file = document.querySelector('input[type=file]').files[0];\n var reader = new FileReader();\n\n reader.onloadend = function (ev) {\n preview.src = reader.result;\n signupInfo.avatar = { \"image\": reader.result }\n }\n reader.readAsDataURL(file);\n }", "function readURL(input) {\n\t if (input.files && input.files[0]) {\n\t var reader = new FileReader();\n\n\t reader.onload = function (e) {\n\t jQuery('#banner-image-edit').attr('src', e.target.result);\n\t }\n\n\t reader.readAsDataURL(input.files[0]);\n\t }\n\t}", "function imgChange1(e) {\n// var size = e.target.files[0].size;\n\tvar filePath=e.target.value;\n\tif(null!=filePath&&filePath!=''){\n\t\tvar arr=filePath.split(\".\");\n\t\t$(\"[name=fileType1]\").val(arr[1]);\n\t\tif(filePath.length>50){\n\t\t\tfilePath=\"...\"+filePath.substring(filePath.length-50, filePath.length);\n\t\t}\n\t\t$(\"[name=showJust1]\").val(filePath);\n\t\t$(\"[name=showJust1]\").attr(\"title\",e.target.value);\n//\t reader1.onload = (function (file) {\n//\t return function (event) {\n//\t \tvar img64Str=event.target.result;\n//\t var strs= new Array(); //定义一数组\n//\t\t\t\tstrs=img64Str.split(\",\"); //字符分割\n//\t\t\t\tvar imgMsg = strs[1];\n//\t\t\t\t$(\"[name=base641]\").val(imgMsg);\n//\t };\n//\t })(e.target.files[0]);\n//\t reader1.readAsDataURL(e.target.files[0]);\n\t}else{\n\t\t$(\"[name=showJust1]\").val(\"\");\n\t\t$(\"[name=fileType1]\").val(\"\");\n\t\t$(\"[name=showJust1]\").attr(\"title\",\"\");\n\t}\n}", "function getImage() {\n // Check if an image has been found in the input\n if (!fileInput.files[0]) throw new Error('Image not found');\n const file = fileInput.files[0];\n\n // Check if file is an image\n if (!acceptedImageTypes.includes(file.type)) {\n inputError.classList.add('show');\n throw Error('The uploaded file is not an image');\n } else inputError.classList.remove('show');\n\n // Get the data url form the image\n const reader = new FileReader();\n\n // When reader is ready display image\n reader.onload = function (event) {\n // Ge the data url\n const dataUrl = event.target.result;\n\n // Create image object\n const imageElement = new Image();\n imageElement.src = dataUrl;\n\n // When image object is loaded\n imageElement.onload = function () {\n // Set <img /> attributes\n image.setAttribute('src', this.src);\n image.setAttribute('height', this.height);\n image.setAttribute('width', this.width);\n\n // Classify image\n classifyImage();\n };\n\n // Add the image-loaded class to the body\n document.body.classList.add('image-loaded');\n };\n\n // Get data URL\n reader.readAsDataURL(file);\n}", "function handleFileSelect() {\n //Check File API support\n if (window.File && window.FileList && window.FileReader) {\n\n var files = event.target.files; //FileList object\n var output = document.getElementById(\"result\");\n\n for (var i = 0; i < files.length; i++) {\n var file = files[i];\n //Only pics\n if (!file.type.match('image')) continue;\n\n var picReader = new FileReader();\n picReader.addEventListener(\"load\", function (event) {\n var picFile = event.target;\n var li = document.createElement(\"li\");\n li.className ='list'\n\n li.innerHTML = \"<img class='thumbnail small_image' src='\" + picFile.result + \"'\" + \"title='\" + picFile.name + \"'/>\";\n\n output.insertBefore(li, null);\n\n });\n //Read the image\n picReader.readAsDataURL(file);\n }\n } else {\n console.log(\"Your browser does not support File API\");\n }\n}", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader()\n reader.onload = function(e) {\n $('#imagePreview').css(\n 'background-image',\n 'url(' + e.target.result + ')'\n )\n $('#imagePreview').hide()\n $('#imagePreview').fadeIn(650)\n }\n reader.readAsDataURL(input.files[0])\n }\n }", "function visFil(event){\n var utBilde = document.getElementById('bildePrew');\n utBilde.src = URL.createObjectURL(event.target.files[0]);\n}", "function imagePreviewToSelectedFile() {\n let reader = new FileReader();\n reader.onload = function (e) {\n let resultingImage = e.target.result;\n let imageElement = document.getElementById(\"currentImg\");\n imageElement.src = resultingImage;\n }\n reader.readAsDataURL(document.getElementById(\"picUpload\").files[0]);\n }", "onChange(e) {\n e.preventDefault();\n var fileInput = this.refs.fileInput;\n var targeImg = this.refs.targetImg;\n\n if (fileInput.files.length > 0) {\n $(this.refs.imageLink).spin({color: '#009688' });\n var reader = new FileReader();\n // when image is loaded, set the src of the image where you want to display it\n reader.onload = function (e) {\n targeImg.src = this.result;\n };\n reader.readAsDataURL(fileInput.files[0]);\n\n $('.spinner').remove();\n }\n }", "function readURL(input) {\n\t if (input.files && input.files[0]) {\n\t var reader = new FileReader();\n\t \n\t reader.onload = function (e) {\n\t $('#img-preview').attr('src', e.target.result);\n\t }\n\t reader.readAsDataURL(input.files[0]);\n\t }\n\t}", "function evaluateMimeType(mimeType) {\n if (mimeType === \"unknown\") {\n alert(\"Invalid file type - please load a valid image file.\");\n } else {\n console.log(mimeType); // log mimeType in console (review)\n\n//---------------- logic to show image ----------------\n\n if (document.getElementById(\"showPic\")) {\n $('#showPic').remove();\n }\n var file = input.files[0],\n url = URL.createObjectURL(file);\n img = document.createElement(\"img\");\n img.src = url;\n img.style = \"width:250px;height:250px\"\n div = document.createElement(\"div\");\n div.id = \"showPic\"\n div.appendChild(img);\n document.getElementById(\"showHere\").appendChild(div);\n }\n }", "function handleFileSelect(evt) {\n var files = evt.target.files; // FileList object\n\n // Loop through the FileList and render image files as thumbnails\n for (var i = 0, f; f = files[i]; i++) {\n\n // Only process image files\n if (!f.type.match('image.*')) {\n continue;\n }\n\n var reader = new FileReader();\n\n // Closure to capture the file information.\n reader.onload = (function(theFile) {\n return function(e) {\n // Render image\n document.getElementById('event_image_preview').src = e.target.result\n };\n })(f);\n\n // Read in the image file as a data URL\n reader.readAsDataURL(f);\n }\n}", "function readURL(input, img) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n\n reader.onload = function (e) {\n img.attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function (e) {\n $('#img').attr('src', e.target.result);\n }\n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL2(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function(e) {\n $('#fatherimg').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n reader.onload = function(e) {\n $('.image-upload-wrap').hide();\n $('.file-upload-image').attr('src', e.target.result);\n $('.file-upload-content').show();\n $('.image-title').html(input.files[0].name);\n };\n reader.readAsDataURL(input.files[0]);\n } else {removeUpload();}\n}", "function uploadImage() {\n const regex = /image.*/;\n let currentImg = document.querySelector('input[type=file]').files[0];\n let myReader = new FileReader();\n myReader.addEventListener(\"load\", function () {\n img.src = myReader.result;\n }, false);\n\n if (currentImg.type.match(regex)) {\n myReader.readAsDataURL(currentImg);\n showFileContent(currentImg);\n showDropIcon();\n } else {\n showErrorFile();\n hideDropIcon();\n }\n}", "function renderImage(file) {\n\n\t\t// generate a new FileReader object\n\t\tvar reader = new FileReader();\n\t\t// inject an image with the src url\n\t\treader.onload = function(event) {\n\t\t\ttemplate_xml = event.target.result;\n\t\t\t$(\"#preview-template-file\")\n\t\t\t\t.html(template_xml)\n\t\t\t\t.find(\":first-child\")\n\t\t\t\t\t.css({\"border\":\"solid lightGray thin\"});\n\n\t\t};\n\t\t// when the file is read it triggers the onload event above.\n\t\treader.readAsText(file);\n\t}", "function ShowImagePreview( files ){\n\n $(\"#imgSalida\").css('display', 'none');\n\n\n if( !( window.File && window.FileReader && window.FileList && window.Blob ) ){\n alert('Por favor Ingrese un archivo de Imagen');\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n if( typeof FileReader === \"undefined\" ){\n alert( \"El archivo no es una imagen por favor ingrese una\" );\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n var file = files[0];\n\n if( !( /image/i ).test( file.type ) ){\n alert( \"El archivo no es una imagen\" );\n document.getElementById(\"myForm\").reset();\n return false;\n }\n\n reader = new FileReader();\n reader.onload = function(event)\n { var img = new Image;\n img.onload = UpdatePreviewCanvas;\n img.src = event.target.result; }\n reader.readAsDataURL( file );\n}", "function readURL(input) {\n if (input.files && input.files[0]) {\n var reader = new FileReader();\n \n reader.onload = function(e) {\n $('.file-upload').find('img').attr('src', e.target.result);\n }\n \n reader.readAsDataURL(input.files[0]);\n }\n }" ]
[ "0.7873604", "0.76137674", "0.7537815", "0.7387745", "0.7329627", "0.73230183", "0.73168683", "0.7313166", "0.719928", "0.719796", "0.71181434", "0.71169096", "0.7093971", "0.70890105", "0.7072366", "0.70507735", "0.7035596", "0.7028494", "0.7017445", "0.7016131", "0.7000254", "0.69940126", "0.69853234", "0.69772774", "0.69653714", "0.6945817", "0.6942551", "0.6928726", "0.6916094", "0.6908698", "0.6889425", "0.6887864", "0.68866503", "0.68865937", "0.6886236", "0.68854123", "0.6883644", "0.6881056", "0.68752295", "0.6869771", "0.6864221", "0.6859257", "0.68435234", "0.6832442", "0.6828291", "0.6818204", "0.68063176", "0.6793368", "0.67927706", "0.6784908", "0.6784078", "0.6764368", "0.67570174", "0.67550784", "0.6751802", "0.674188", "0.67289484", "0.67189324", "0.6704359", "0.66940516", "0.6679158", "0.6675321", "0.6672864", "0.6672654", "0.6661255", "0.6658417", "0.6658227", "0.66421765", "0.66387296", "0.6637446", "0.66320276", "0.6618173", "0.6613364", "0.661301", "0.66092366", "0.66067284", "0.6605095", "0.660421", "0.6603967", "0.66029143", "0.6601406", "0.65961504", "0.6595506", "0.6590087", "0.65828973", "0.65807307", "0.6574349", "0.65718293", "0.6566858", "0.65619975", "0.6561732", "0.65612066", "0.65611", "0.6556773", "0.6556603", "0.6556082", "0.65529424", "0.65475845", "0.6544197", "0.6542935" ]
0.6667267
64
regex per la ricerca del nome dei prodotti
function escapeRegex(text) { return text.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regexVarII() {\n var re = /^(Mr|Mrs|Ms|Dr|Er)(\\.)([a-zA-Z]+$)/;\n return re;\n }", "function regExControleName (a){ \n if(/^(([a-zA-ZÀ-ÿ]+[\\s\\-]{1}[a-zA-ZÀ-ÿ]+)|([a-zA-ZÀ-ÿ]+))$/.test(a)){ \n return true;\n }else{ \n alert( `veuiller saisir que des lettres!!` );\n return false;\n }\n}", "function name_repl(match){\n name_ext.push(match)\n return \"\"\n }", "function regexVar() {\n \n const re = /^(Mr|Mrs|Dr|Er)\\.[A-Z|a-z]+$/ig\n \n return re;\n}", "function validateNameInNewTramite( cadena ) {\n var patron = /^[a-zñA-ZÑ\\s]*$/;\n if(cadena.search(patron))\n {\n vm.name = cadena.substring(0, cadena.length-1);\n }\n }", "function regexVar() {\n\n let re = /^(Mr\\.|Mrs\\.|Ms\\.|Dr\\.|Er\\.)\\s?[a-z|A-Z]+$/;\n \n \n return re;\n}", "function regExpLastName() {\n // Récupération des données saisies\n const lastNameValid = contact.lastName;\n // Injection du HTML\n const checklastName = document.querySelector(\"#lastNameErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^([A-Za-z]{3,20})?([-]{0,1})?([A-Za-z]{3,20})$/.test(lastNameValid)) {\n checklastName.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checklastName.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function validanombrearchivo(nombre, ext){\n var pattern = \"/\\\\b(^(((\\\\S)|(\\\\s))+)(\\\\.\"+ext+\")$)\\\\b/gi\";\n\treturn nombre.match(eval(pattern));\n}", "function generate_namespace_pattern(namespace_hash, name_of_NO) {\r\n\t\tvar source = [];\r\n\t\tfor ( var namespace in namespace_hash) {\r\n\t\t\tname_of_NO[namespace_hash[namespace]] = upper_case_initial(\r\n\t\t\t\t\tnamespace)\r\n\t\t\t// [[Mediawiki talk:]] → [[MediaWiki talk:]]\r\n\t\t\t.replace(/^Mediawiki/, 'MediaWiki');\r\n\t\t\tif (namespace)\r\n\t\t\t\tsource.push(namespace);\r\n\t\t}\r\n\r\n\t\t// namespace_pattern matched: [ , namespace, title ]\r\n\t\treturn new RegExp('^(' + source.join('|').replace(/ /g, '[ _]')\r\n\t\t\t\t+ '):(.+)$', 'i');\r\n\t}", "function verificaNome(nome) {\n const regex = new RegExp('^[ 0-9a-zA-Zàèìòùáéíóúâêîôûãõ\\b]+$');\n if (nome <= 0 || !regex.test(nome)) {\n erroNome();\n return true;\n }\n }", "captureNameChars() {\n const { chunk, i: start } = this;\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const c = this.getCode();\n if (c === EOC) {\n this.name += chunk.slice(start);\n return EOC;\n }\n // NL is not a name char so we don't have to test specifically for it.\n if (!isNameChar(c)) {\n this.name += chunk.slice(start, this.prevI);\n return c === NL_LIKE ? NL : c;\n }\n }\n }", "validateIntentName(name){\n var regex = /[a-zA-Z\\-0-9]+([_]|[-]|[a-zA-Z\\-0-9])*$/;\n return regex.test(name);\n }", "isNotNewDefense(str) {\n let match = /planifiée pour [A-Z]{1}[a-z]{1,}\\s[A-Z]{1}[a-z]{1,}/.exec(str)\n return match\n }", "formattedName() {\n let oneWord = /^[A-zА-яёЁ-]+$/;\n let twoWords = /^[A-zА-яёЁ-]+ [A-zА-яёЁ-]+$/;\n //let threeWords = /^(?:[A-zА-яёЁ]+ ){2}[A-zА-яёЁ]+$/;\n\n let field = this.$el.querySelector('.b-fields__name');\n this.$nextTick(() => {\n this.showSuggest = this.isTextOverflow(field);\n })\n\n this.name = this.capitalizeFirstLetter(this.name);\n\n return oneWord.test(this.name) \n ? this.name + ' Имя Отчество'\n : twoWords.test(this.name) \n ? this.name + ' Отчество' \n : this.name \n ? this.name \n : 'Фамилия Имя Отчество';\n }", "function regexp1(){\r\n var usrnam2 = document.getElementById(\"un2\").value;\r\n // i used i for capitalisation issue\r\n // upper case and lower case alphabets will be treated same \r\n var regx = /capg2021/i;\r\n\r\n if (regx.test(usrnam2)){\r\n return true ;\r\n }\r\n\r\n else{\r\n alert(\"invalid username \");\r\n return false ;\r\n }\r\n\r\n}", "function simple_form(name) {\n\t\treturn RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])');\n\t}", "function simple_form(name) {\n\t\treturn RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])');\n\t}", "function verifierNomOuPrenom(nomOuPrenom) {\n return /^[a-zA-Z]+(\\s*[a-zA-Z]+)*$/.test(nomOuPrenom);\n}", "function extractNames(paragraph){\n var start = paragraph.indexOf(\"(mother \") + \"(mother \".length;\n var end = paragraph.indexOf(\")\");\n console.log(start, end);\n return paragraph.slice(start, end);\n \n}", "function isValidVariable(name) {\n let regex = /[\\w][^\\s]/g;\n console.log(name.match(regex));\n if (name.match(regex)) {\n return 'ValidVaribale';\n } else {\n return 'Invalid Varibale';\n }\n}", "function prettifyName(profname) {\n return profname.replace(/\\w\\S*/g, function (txt) {\n return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();\n });\n }", "verificarPrioridade(texto, prioridade) {\n var regex = new RegExp('(#[1-3] [a-z])', 'i');\n if (regex.exec(texto)) {\n this.texto = texto.slice(2, texto.length);\n return texto.slice(1, 2);\n } else {\n return prioridade;\n }\n }", "function validateName(fields, data, errors) {\n var re = /^[a-zA-Záéíóäëiöúàèììù_ ]{2,}$/;\n if (!(re.test(data[\"nom\"].value)) || !(re.test(data[\"prenom\"].value))) {\n errors.push(\"Les noms et prénoms doivent contenir uniquement des\" +\n \" lettres, espaces, tirets et au minimum 2 caractères.\");\n }\n}", "function parseName(tag) {\n\tlet name = tag.name\n\tname = name.replace(/_/g, ' ');\n\tname = name.replace(/\\b\\w/g, l => l.toUpperCase());\n\treturn name;\n}", "nameCheck (text) {return(text.replace(\"/name\" , this.props.counter.name))}", "function panggilRegexp(value) {\n var ambilData = value.match(/[m-q]/ig);\n console.log(ambilData);\n}", "function validateSurnamesInNewTramite( cadena ) {\n var patron = /^[a-zñA-ZÑ\\s]*$/;\n if(cadena.search(patron))\n {\n vm.surnames = cadena.substring(0, cadena.length-1);\n }\n }", "function inName(name) {\n\t// trim the white space from outer edges of name and then split it into an array at the space.\n\tname = bio.name;\n\tconsole.log(name);\n\tname = name.trim().split(\" \");\n\tconsole.log(name);\n\t// uppercase whole last name (assuming no middle name)\n\tname[1] = name[1].toUpperCase();\n\t// make sure just first letter of first name is uppercase\n\tname[0] = name[0].slice(0,1).toUpperCase() + name[0].slice(1).toLowerCase();\n\t// return internationalized name\n\treturn name[0] + \" \" + name[1];\n}", "function regexVar(str) {\n\n\tlet re = new RegExp(/^([aeiou]).\\+1$/);\n\treturn re;\n\n}", "function regexVar() {\n let re = new RegExp(/^([aeiou]).+\\1$/);\n return re;\n}", "function cleanName(name) {\n\t\treturn name.replace(imgRegex, \"\").replace(\" \", \"_\");\n\t\t\n\t}", "function highlightNamesThatStartWithP() {\n\n}", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function checkNames(elt, regex) {\n if (elt.value.trim().length < 2 || elt.value.trim() === \"\" || !elt.value.match(regex)) {\n elt.parentElement.setAttribute('data-error-visible', 'true');\n elt.style.border = '2px solid #e54858';\n return false;\n } else {\n elt.parentElement.setAttribute('data-error-visible', 'false');\n elt.style.border = 'solid #279e7a 0.19rem';\n return true;\n }\n }", "function inName() {\n\tvar str = $('#name')[0].innerText;\n\tvar nameParts = str.split(' ');\n\tvar lastPart = nameParts.length - 1;\n\t// Initial cap for first name\n\tnameParts[0] = str.slice(0,1).toUpperCase() +\n\t\tnameParts[0].slice(1).toLowerCase();\n\t// All caps for last name\n\tnameParts[lastPart] = nameParts[lastPart].toUpperCase();\n\treturn nameParts.join(' ');\n}", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n const re = /^(Mr\\.|Mrs\\.|Ms\\.|Dr\\.|Er\\.)\\s?[A-Z|a-z]+$/;\n // var re = (/^(Mr\\.|Dr\\.|Er\\.|Ms\\.|Mrs\\.)\\s?[a-z|A-Z]+$/);\n /*\n * Do not remove the return statement\n */\n return re;\n}", "function parseAndDisplayName(name) {\n let fname, lname, pos1, pos2;\n pos1 = name.indexOf(\" \");\n pos2 = name.lastIndexOf(\" \");\n\n if (pos1 == -1) {\n console.log(\"Name : \" + name);\n console.log(\"Only Name : \" + name);\n } else if (pos1 == pos2) {\n fname = name.substr(0, pos1);\n lname = name.substr(pos1 + 1);\n console.log(\"Name :\" + fname + \" \" + lname);\n console.log(\"First name : \" + fname);\n console.log(\"Last name : \" + lname);\n } else {\n fname = name.substr(0, pos1);\n mname = name.substr(pos1 + 1, pos2 - pos1);\n lname = name.substr(pos2 + 1);\n console.log(\"Name :\" + fname + \" \" + mname + \" \" + lname);\n console.log(\"First name : \" + fname);\n console.log(\"Middle name : \" + mname);\n console.log(\"Last name : \" + lname);\n }\n}", "function validNick() {\n var regex = /^\\w*$/;\n console.log('Regex Test', regex.exec(playerNameInput.value));\n return playerNameInput.value !== \"\" && regex.exec(playerNameInput.value) !== null;\n}", "function formatComposerName (name) {\n let names = name.split(','); \n let match; \n\n // hackish way to remove spaces\n let firstname = names[1].trim().split(' ').filter(el => !!el).join(' '); \n let surname = (match = names[0].match(/\\[.*\\]/)) ? match[0].substr(1, match[0].length - 2) : names[0]; \n return names.length === 3 ? `${firstname} ${surname} II`.trim() : `${firstname} ${surname}`.trim(); \n}", "function validarName() {\n var text = $('#nombre').val();\n var exprText = new RegExp(\"^[^A-Za-z\\s]+\");\n // if (text.search(exprText)==true)\n if ((text !==\"\")&&(text.search(exprText))) \n {\n $(\"#ErrorName\").text(\"\");\n return true;\n }\n else {\n $(\"#ErrorName\").text(\"Error. Nombre Invalido\");\n $(\"#ErrorName\").css('color','#d32e12');\n return false;\n }\n}", "function getSpeciesName(mon) {\n\t//name is everything before the last ' @'\n\tconst parts = mon.split(' @');\n\tconst namePart = parts.slice(0, parts.length - 1)\n\t\t.reduce((acc, x) => acc + x);\n\t//check for nickname\n\tif(namePart[namePart.length-1] === ')') {\n\t\t//after the last '(', before the ')' after that\n\t\tconst speciesParts = namePart.split('(');\n\t\treturn speciesParts[speciesParts.length-1].split(')')[0]\n\t}\n\treturn namePart;\n}", "function isName(c) {\n return (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n '-_*.:#[]'.indexOf(c) >= 0;\n }", "function isValidName(el){\n\n var regex = new RegExp(/^([^0-9%+=/#@&|{}£^\\[\\]()*_°]*)$/);\n return regex.test($.trim(el.val()));\n\n}", "function isValidName(str) {\n var pattern = /^[a-zA-Z_\\.0-9\\s]{1,20}$/;\n return str.match(pattern); \n}", "function filtre_texte(txt) {\r\n tabObj = tabObjInit.filter(function (elm) {\r\n var pattern = new RegExp(\"(\" + txt + \")\", 'ig');\r\n if ( elm.Nom.match(pattern) ) {\r\n return true;\r\n } else {\r\n return false\r\n }\r\n });\r\n ecrit_liste(tabObj);\r\n}", "function nameOf_(formula) {\n var nameExtractRegex = new RegExp(\"^=?\\\\(\"+commentStart+\"(\"+varName+\")(?:\\\\([^\\\\)]*\\\\))?=\"+commentEnd+any+\"*\\\\)$\");\n nameExtractRegex.lastIndex = 0;\n var m = nameExtractRegex.exec(formula);\n if(m) {\n return m[1];\n }\n nameExtractRegex = new RegExp(\"^=?(\"+varName+\")@\"+any+\"*$\");\n nameExtractRegex.lastIndex = 0;\n var m = nameExtractRegex.exec(formula);\n if(m) {\n return m[1];\n }\n return LAST_NAME;// Default name undefined; // means no value\n}", "formatName(textField) {\n let scrubbedResult = textField\n // Capitalize first letter of string.\n //| ^ = beginning of output | . = 1st char of str |\n .replace(/^./g, x => x.toUpperCase())\n // Capitalize first letter of each word and removes spaces.\n //| \\ = matches | \\w = any alphanumeric | \\S = single char except white space\n //| * = preceeding expression 0 or more times | + = preceeding expression 1 or more times |\n .replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1);})\n .replace(/\\ +/g, x => '')\n // Remove appending file extensions like .js or .json.\n //| \\. = . in file extensions | $ = end of input |\n .replace(/\\..+$/, '');\n return scrubbedResult;\n }", "function simple_form(name) {\n return RegExp('(\\\\()' + name + '(?=[\\\\s\\\\)])')\n } // booleans and numbers", "function docuCharactersForNameField(field, rules, i, options) {\n var objRegExp = /^[^0-9][A-Za-z0-9 -./_%&#()[\\\\\\]]+$/;\n if (!objRegExp.test(field.val())) {\n //return options.allrules.validate2fields.alertText;\n return \"* Required a valid name\";\n }\n}", "function isValidName(nome) {\n return nome.trim() !== '' && nome.trim().length > 3\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function RegExpPattern(){\n\t//\n}", "function inName(name) {\n name = bio.name.trim().split(\" \");\n console.log(name);\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n\n return name[0] + \" \" + name[1];\n }", "function CheckUserName(userName){\r\n\tvar userNameRegEx = new RegExp(/^[a-z\\d](?:[a-z\\d]|-(?=[a-z\\d])){0,38}$/i);\r\n\treturn userNameRegEx.test(userName);\t\r\n}", "function inName(name) {\n name = bio.name.trim().split(\" \");\n name[1] = name[1].toUpperCase();\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n return name[0] + \" \" + name[1];\n}", "function pattern_suffix(identifier) {\n // name shouldn't be the prefix of a longer name\n if ( identifier[identifier.length-1] !== '\"' ) {\n return '\\\\b';\n } else {\n return '';\n }\n }", "function handleCommonDefnName(obj, defnValue) {\nvar returnVal = false;\nif(defnValue.search(\"[^A-Za-z0-9_-]\") != -1) {\n alert(\"Name only can contain Alphabets(A/a - Z/z) and Alpha Numeric(0-9) including underscore and Hyphan\");\n obj.value = '';\n returnVal = true;\n }\n return returnVal;\n}", "function handleCommonDefnName(obj, defnValue) {\nvar returnVal = false;\nif(defnValue.search(\"[^A-Za-z0-9_-]\") != -1) {\n alert(\"Name only can contain Alphabets(A/a - Z/z) and Alpha Numeric(0-9) including underscore and Hyphan\");\n obj.value = '';\n returnVal = true;\n }\n return returnVal;\n}", "function is_bad_name(b_name,p_caption,i)\n {\n var reg=/[-\\s\\'\\\"’]+/g,b_replace_reg=/\\s+[\\-\\|–]{1}.*$/g;\n var lower_b=b_name.toLowerCase().replace(reg,\"\"),lower_my=my_query.name.replace(/\\s(-|@|&|and)\\s.*$/).toLowerCase().replace(reg,\"\");\n if(lower_b.indexOf(lower_my)!==-1 || lower_my.indexOf(lower_b)!==-1) return false;\n b_name=b_name.replace(b_replace_reg,\"\");\n my_query.name=my_query.name.replace(\"’\",\"\\'\");\n console.log(\"b_name=\"+b_name+\", my_query.name=\"+my_query.name);\n if(MTP.matches_names(b_name,my_query.name)) return false;\n if(i===0 && b_name.toLowerCase().indexOf(my_query.name.split(\" \")[0].toLowerCase())!==-1) return false;\n return true;\n }", "function getNameDescription(name, desc) {\n var n = \"\";\n var d = \"\";\n if (name)\n n = andiUtility.normalizeOutput(name);\n if (desc) {\n d = andiUtility.normalizeOutput(desc);\n if (n === d) //matchingTest\n d = \"\";\n else\n d = \" \" + d; //add space\n }\n return n + d;\n }", "function splitName(input) {\n\t\treturn input.replace(/([a-z])([A-Z])/g, '$1 $2');\t\n\t}", "function regExpPrefix(re) {\n\t\t\tvar prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t\t\treturn (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t\t}", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function regExpPrefix(re) {\n\t var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n\t return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n\t }", "function multiPoss(str) {\n let charRegex = /[aeiou]/gi;\n return str.match(charRegex);\n}", "function quita_primer_nom(palabra) {\n return palabra.replace(\"MARIA\", \"\").replace(\"MA.\", \"\").replace(\"MA\", \"\").replace(\"JOSE\", \"\").replace(\"J\", \"\").replace(\"J.\", \"\").trim();\n}", "function inName(name) {\n name = name.split(\" \");\n name[0] = name[0].slice(0, 1).toUpperCase() + name[0].slice(1).toLowerCase();\n name[1] = name[1].toUpperCase();\n var internationalizedName = (name[0] + \" \" + name[1]);\n return internationalizedName;\n}", "function regexVar(s) {\n const re = new RegExp(/^(Mr|Mrs|Ms|Dr|Er)\\.\\s[a-zA-Z]+$/);\n let status = re.test(s);\n return status;\n}", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n\n let re = /^(a|e|i|o|u).*\\1$/;\n //or\n let re = /^(aeiou).*\\1$/;\n //^ makes sure first var is a vowel\n //.* makes it so it will require at least 3 vars\n //\\1 matches the first var (must end in same vowel, $ to end)\n \n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "isNameValid(name) {\n let workString = name;\n let regExpOnlySpaces = /\\S/;\n \n if(!workString.match(regExpOnlySpaces)){\n return false;\n }\n if(workString.length > 15 || workString.length < 5){\n return false;\n }\n \n return true;\n \n }", "function itItNameCheck(name) {\n // true at the first occurence of a vowel\n var vowelflag = false; // true at the first occurence of an X AFTER vowel\n // (to properly handle last names with X as consonant)\n var xflag = false;\n for(var i = 0; i < 3; i++){\n if (!vowelflag && /[AEIOU]/.test(name[i])) vowelflag = true;\n else if (!xflag && vowelflag && name[i] === 'X') xflag = true;\n else if (i > 0) {\n if (vowelflag && !xflag) {\n if (!/[AEIOU]/.test(name[i])) return false;\n }\n if (xflag) {\n if (!/X/.test(name[i])) return false;\n }\n }\n }\n return true;\n}", "function surnameStarts(myName) {\n\tfor (var i = 0; i <= myName.length - 1; i++) {\n\t\tif (myName[i] == \" \") {\n\t\t\treturn console.log(myName.slice(0, i));\n\t\t}\n\t}\n}", "function toIdentifier(name){\n\tvar parts = name.split(/\\W+/)\n\tparts = _.map(parts, function(part){\n\t\treturn part.replace(/^./, function(chr){ return chr.toUpperCase() })\n\t})\n\t\n\treturn parts.join('')\n}", "function nameValidater(projectName) {\n var regex = new RegExp('^[a-z\\-]+$');\n return (regex.test(projectName)) ? true : false;\n}", "function surnameStarts(myName) {\n\tfor (var i = 0; i <= myName.length - 1; i++) {\n\t\tif (myName[i] == \" \") {\n\t\t\treturn console.log(myName.slice(i, myName.length));\n\t\t}\n\t}\n}", "function validate_name(input_name) {\n\tvar re = /(?=.*[a-zA-Z ])^[a-zA-Z ]{5,100}$/;\n\treturn re.test(input_name);\n}", "setPersonName(name) {\n name = name.trim();\n const nameRegex = /^[a-zA-Z]{1,100}$/;\n\n if (!name.length || !name || (name.length > 100)) {\n throw new Error('Invalid name length');\n }\n\n if (name.match(nameRegex)) {\n return name;\n }\n throw new Error('Name includes symbols that are not allowed');\n }", "validName(name) {\n const validator = new RegExp(/^[a-zA-Z0-9]+$/);\n return validator.test(name);\n }", "function cleanFieldName_v1(name) {\n return name.replace(/[^A-Za-z0-9]+/g, '_');\n }", "function patternSuffix (identifier) {\n // name shouldn't be the prefix of a longer name\n if (identifier[identifier.length - 1] !== '\"') {\n return '\\\\b';\n } else {\n return '';\n }\n }", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n \n var re = /^([aeiou]).*\\1$/gi;\n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "function _extract_name(name) {\n // Using encodings, too hard. See Mail::Message::Field::Full.\n if (/=?.*?\\?=/.test(name)) return '';\n\n // trim whitespace\n name = name.trim();\n name = name.replace(/\\s+/, ' ');\n\n // Disregard numeric names (e.g. 123456.1234@compuserve.com)\n if (/^[\\d ]+$/.test(name)) return '';\n\n name = name.replace(/^\\((.*)\\)$/, '$1') // remove outermost parenthesis\n .replace(/^\"(.*)\"$/, '$1') // remove outer quotation marks\n .replace(/\\(.*?\\)/g, '') // remove minimal embedded comments\n .replace(/\\\\/g, '') // remove all escapes\n .replace(/^\"(.*)\"$/, '$1') // remove internal quotation marks\n .replace(/^([^\\s]+) ?, ?(.*)$/, '$2 $1') // reverse \"Last, First M.\" if applicable\n .replace(/,.*/, '');\n\n // Change casing only when the name contains only upper or only\n // lower cased characters.\n if (exports.isAllUpper(name) || exports.isAllLower(name)) {\n // console.log(\"Changing case of: \" + name);\n name = exports.nameCase(name);\n // console.log(\"Now: \" + name);\n }\n\n // some cleanup\n name = name.replace(/\\[[^\\]]*\\]/g, '').replace(/(^[\\s'\"]+|[\\s'\"]+$)/g, '').replace(/\\s{2,}/g, ' ');\n\n return name;\n}", "function _extract_name(name) {\n // Using encodings, too hard. See Mail::Message::Field::Full.\n if (/=?.*?\\?=/.test(name)) return '';\n\n // trim whitespace\n name = name.trim();\n name = name.replace(/\\s+/, ' ');\n\n // Disregard numeric names (e.g. 123456.1234@compuserve.com)\n if (/^[\\d ]+$/.test(name)) return '';\n\n name = name.replace(/^\\((.*)\\)$/, '$1') // remove outermost parenthesis\n .replace(/^\"(.*)\"$/, '$1') // remove outer quotation marks\n .replace(/\\(.*?\\)/g, '') // remove minimal embedded comments\n .replace(/\\\\/g, '') // remove all escapes\n .replace(/^\"(.*)\"$/, '$1') // remove internal quotation marks\n .replace(/^([^\\s]+) ?, ?(.*)$/, '$2 $1') // reverse \"Last, First M.\" if applicable\n .replace(/,.*/, '');\n\n // Change casing only when the name contains only upper or only\n // lower cased characters.\n if (exports.isAllUpper(name) || exports.isAllLower(name)) {\n // console.log(\"Changing case of: \" + name);\n name = exports.nameCase(name);\n // console.log(\"Now: \" + name);\n }\n\n // some cleanup\n name = name.replace(/\\[[^\\]]*\\]/g, '').replace(/(^[\\s'\"]+|[\\s'\"]+$)/g, '').replace(/\\s{2,}/g, ' ');\n\n return name;\n}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "parseIdentifierName() {\n let name = '';\n while (true) {\n const c = this.peek();\n if (isIdentifierStart(c) || isIdentifierContinue(c) || c === '$') {\n name += this.next();\n } else {\n break;\n }\n }\n return name;\n }", "function pattern_prefix(schema, identifier) {\n if ( schema ) {\n // to match a table name including schema prefix\n // name should not be part of another name, so we require\n // to start a at a word boundary\n if ( identifier[0] !== '\"' ) {\n return '\\\\b';\n } else {\n return '';\n }\n } else {\n // to match a table name without schema\n // name should not begin right after a dot (i.e. have a explicit schema)\n // nor be part of another name\n // since the pattern matches the first character of the table\n // it must be put back in the replacement text\n replacement = '$01'+replacement;\n return '([^\\.a-z0-9_]|^)';\n }\n }", "function classRegex(name) {\n return new RegExp(\"(^|\\\\s+)\" + name + \"(\\\\s+|$)\");\n }", "function isValidName(data) {\n var re = /^[a-zA-Z0-9_\\- ]*$/;\n\n return re.test(data);\n }", "function formato_nombre_apellido(campo,span){\n\tformato_aceptado= /^[a-zA-ZñÑáéíóú\\s]+$/;\n\t\n\tif(campo.value == ''){\n\t\tval = false;\n\t\tspan.style.color = 'red';\n\t\tspan.innerHTML = 'campo vacio';\n\t\t}else if(! campo.value.match(formato_aceptado) && campo.value != ''){\n\t\t\tval = false;\n\t\t\tspan.style.color ='blue';\n\t\t\tspan.innerHTML = 'Solo son validas letras';\n\t\t\t}else{\n\t\t\tspan.innerHTML = '';\n\t\t\t}\n}", "function parse_NameCmt(blob, length, opts) {\n if (opts.biff < 8) {\n blob.l += length;\n return;\n }\n\n var cchName = blob.read_shift(2);\n var cchComment = blob.read_shift(2);\n var name = parse_XLUnicodeStringNoCch(blob, cchName, opts);\n var comment = parse_XLUnicodeStringNoCch(blob, cchComment, opts);\n return [name, comment];\n }", "function limpiar_nombres(text) {\n var text = text.toLowerCase(); // a minusculas\n text = text.replace(/[áàäâå]/, 'a');\n text = text.replace(/[éèëê]/, 'e');\n text = text.replace(/[íìïî]/, 'i');\n text = text.replace(/[óòöô]/, 'o');\n text = text.replace(/[úùüû]/, 'u');\n text = text.replace(/[ýÿ]/, 'y');\n text = text.replace(/[^a-zA-ZñÑ\\s]/g, '');\n text = text.replace(/\\s{2,}/, ' ');\n text = text.toUpperCase();\n return text;\n}", "function validaNombre(nombre){\n var nombre1 = nombre.value; //asigno el valor de la variable nombre a una nueva variable\n var primeraLetra = nombre1.charAt(0); //asigno el valor de la primera letra a una variable nueva\n var patron=/[A-Z]/g; //se crea un patron\n \n if( nombre1==''||primeraLetra.match(patron)==null)//si el nombre esta vacio o no se encuentra una coincidencia de la primera letra con el patron devuelve el mensaje con setCustomValidity\n {\n nombre.setCustomValidity(\"Tiene que iniciar con mayuscula\");\n return false;\n }\n nombre.setCustomValidity(''); //se resetea el setCustomValidity en caso de haber ocurrido alguna ocurrencia en el if\n}", "function regExpPrefix(re) {\n var prefix = /^\\^((?:\\\\[^a-zA-Z0-9]|[^\\\\\\[\\]\\^$*+?.()|{}]+)*)/.exec(re.source);\n return (prefix != null) ? prefix[1].replace(/\\\\(.)/g, \"$1\") : '';\n }", "function getName(txt) {\n ind = txt.indexOf('h2');\n //console.log(\"starting index = \" + ind);\n end = txt.indexOf('h2', ind + 1);\n return txt.substring(ind + 3, end - 2);\n }", "function intlName(name) {\n\t\t\tvar names = name.trim().split(\" \");\n\t\t\treturn names[0][0].toUpperCase() + names[0].slice(1).toLowerCase() + \" \" + names[1].toUpperCase();\n\t\t}", "function validateName(namePattern, nameIn){\n if(namePattern.test(nameIn)){\n document.getElementById('nameValidate').className = \"form-control is-valid\";\n return true;\n }else{\n document.getElementById('nameValidate').className = \"form-control is-invalid\";\n return false;\n }\n}", "function Regexp() {}", "get inputBlockPattern() {\n return this.props.source === 'domain' ? /[^\\w\\s-.]/gi : /[^\\w\\s-]/gi\n }", "function name_reformat(placename) {\r\n\t// strip + sign from postcode string & convert to uppercase\r\n\tplacename = placename.replace(/\\+/g, ' '); \r\n\tvar regExp1 = /^[a-zA-Z\\s\\\\&\\\\'\\\\:\\\\/\\\\(\\\\)\\\\!\\\\,\\\\-]+$/; \r\n\t\r\n\tif(regExp1.test(placename) === false)\t\r\n\t{\t \r\n\t\t \r\n\t\t// to do\t \r\n\t\tplacename = \"error\";\r\n\t\treturn placename;\r\n\t}\r\n\telse {\r\n\t\t // postcode formatted correctly\r\n\t\t return placename;\r\n\t}\t \t\r\n}" ]
[ "0.6632051", "0.6234149", "0.6168827", "0.6119626", "0.60707146", "0.58405125", "0.5699214", "0.5652003", "0.56446403", "0.5627968", "0.562362", "0.5615079", "0.55968195", "0.55546296", "0.5537735", "0.55130035", "0.55130035", "0.54991126", "0.54923964", "0.5487662", "0.546901", "0.5464173", "0.54411155", "0.5422974", "0.54181576", "0.5414834", "0.5398785", "0.53796333", "0.5370293", "0.53697425", "0.53513867", "0.5328166", "0.5312973", "0.5312973", "0.52777064", "0.52775264", "0.5261027", "0.522924", "0.52254057", "0.5223827", "0.5214926", "0.5205331", "0.5200406", "0.5198297", "0.5190909", "0.51902115", "0.51621675", "0.5162062", "0.51533806", "0.5153036", "0.51528656", "0.51449704", "0.51449704", "0.5142874", "0.51422554", "0.5139571", "0.51363504", "0.511549", "0.51151264", "0.51151264", "0.5114473", "0.5104977", "0.51045716", "0.5102419", "0.5102324", "0.5102324", "0.5095878", "0.50907093", "0.50879663", "0.5080024", "0.50788444", "0.5075998", "0.5069473", "0.50694436", "0.50693154", "0.5067878", "0.50666845", "0.50581306", "0.5055219", "0.50531226", "0.5046067", "0.50408995", "0.5039574", "0.50327593", "0.50327593", "0.5031633", "0.50146085", "0.5012927", "0.5012015", "0.50113755", "0.50080544", "0.5004076", "0.49969473", "0.4989517", "0.49833658", "0.4978665", "0.49780926", "0.4976369", "0.49723718", "0.4970014", "0.49697855" ]
0.0
-1
Set current properties of this edge to given properties
setProperties(properties) { for (const [key, value] of properties.entries()) { switch(key) { case "type": this.type = value; break; case "startArrowHead": this.startArrowHead = value; break; case "endArrowHead": this.endArrowHead = value; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setTransitionProperties() {\n TransitionProperties.next = next;\n TransitionProperties.current = current;\n }", "function setTransitionProperties() {\n TransitionProperties.toState = toState;\n TransitionProperties.toParams = toParams;\n TransitionProperties.fromState = fromState;\n TransitionProperties.fromParams = fromParams;\n TransitionProperties.options = options;\n }", "setProperties(properties) {\n Object.assign(this, properties);\n }", "setProperties(properties) {\n Object.assign(this, properties);\n }", "set property(){}", "setProperties(properties) {\n this.checkTransactionStart();\n let before = clone(this.properties);\n for (let item in properties) {\n let val = properties[item];\n this.properties[item] = val;\n }\n this.emit('changeProperties', this.properties, before);\n return this.checkTransactionEnd();\n }", "function set_edges() {\n }", "setEdges(edges){\n this.edges = edges\n }", "function updateProperties() {\r\n $scope.properties = [];\r\n $scope.properties.push(new Property('Height', viewHeight, true));\r\n $scope.properties.push(new Property('Width', viewWidth, true));\r\n $scope.properties.push(new Property('X', viewX, true));\r\n $scope.properties.push(new Property('Y', viewY, true));\r\n $scope.properties.push(new Property('Parent', parent, false));\r\n }", "updateEdgePositions() {\n this.html\n .attr(\"x1\", this.x1)\n .attr(\"y1\", this.y1)\n .attr(\"x2\", this.x2)\n .attr(\"y2\", this.y2)\n }", "@action\n setProp(property, newVal) {\n this.set(property, newVal);\n }", "update(_changedProperties) {\n super.update();\n }", "setProperty(name, value) {\n const oldValue = this._properties[name];\n\n if (value !== oldValue) {\n this._properties[name] = value;\n\n this._conference.eventEmitter.emit(_JitsiConferenceEvents__WEBPACK_IMPORTED_MODULE_2__[\"PARTICIPANT_PROPERTY_CHANGED\"], this, name, oldValue, value);\n }\n }", "set properties(properties) {\n this._properties = pip_services3_commons_node_1.StringValueMap.fromValue(properties);\n }", "function applyProperties( target, properties ) {\n for( var key in properties ) {\n target.style[ key ] = properties[ key ];\n }\n }", "resetNewEdge(){\n this.newEdge1 = null;\n this.newEdge2 = null;\n }", "set props(p) {\n props = p;\n }", "function setProperties(newProperties)\n{\n var properties = PropertiesService.getDocumentProperties();\n \n properties.setProperties(JSON.parse(newProperties));\n}", "function applyProperties( target, properties ) {\n for( var key in properties ) {\n target.style[ key ] = properties[ key ];\n }\n }", "function resetProperties() {\n if (!isReset) {\n window.selectedNode = null;\n // Reset node color\n const modnodes = window.tracenodes.map(i => nodes.get(i));\n colorNodes(modnodes, 0);\n // Reset edge width and color\n const modedges = window.traceedges.map((i) => {\n const e = edges.get(i);\n e.color = getEdgeColor(nodes.get(e.to).level);\n return e;\n });\n edgesWidth(modedges, 1);\n window.tracenodes = [];\n window.traceedges = [];\n }\n}", "function setProps(thingy,proparray,value){\n for (var i=0; i<proparray.length; i++){ //loop through possible properties\n thingy.css(proparray[i],value)\n }\n}", "update(e){this._reflectingProperties!==void 0&&0<this._reflectingProperties.size&&(this._reflectingProperties.forEach((e,t)=>this._propertyToAttribute(t,this[t],e)),this._reflectingProperties=void 0)}", "update(_changedProperties) {\n if (this.__reflectingProperties !== void 0) {\n this.__reflectingProperties.forEach((v, k) => this.__propertyToAttribute(k, this[k], v));\n this.__reflectingProperties = void 0;\n }\n this.__markUpdated();\n }", "function applyProperties(target, properties) {\n for (var key in properties) {\n target.style[key] = properties[key];\n }\n }", "changeProp (propertyToSet, cssProp, context, val) {\n if (cssProp) {\n let cssObject = this.state.css;\n cssObject[cssProp] = val;\n this.setState({ css : cssObject });\n } else {\n this.setState({ [propertyToSet] : val });\n }\n }", "changeProp (propertyToSet, cssProp, context, val) {\n if (cssProp) {\n let cssObject = this.state.css;\n cssObject[cssProp] = val;\n this.setState({ css : cssObject });\n } else {\n this.setState({ [propertyToSet] : val });\n }\n }", "update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\n for (const [k, v] of this._reflectingProperties) {\n this._propertyToAttribute(k, this[k], v);\n }\n this._reflectingProperties = undefined;\n }\n }", "_mutateModel() {\n let model = this.get('model');\n let layerProperties = this.get('getLayerProperties')();\n\n for (let attr of Object.keys(layerProperties)) {\n model.set(attr, layerProperties[attr]);\n }\n }", "update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\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 }", "setAttributes(geometry, translations, values, originalValues) {\n geometry.addAttribute('translation', translations)\n geometry.addAttribute('size', values)\n geometry.addAttribute('originalsize', originalValues)\n }", "_setChannelProperties(options) {\n const nodeList = this._getInternalNodes();\n nodeList.forEach(node => {\n node.channelCount = options.channelCount;\n node.channelCountMode = options.channelCountMode;\n node.channelInterpretation = options.channelInterpretation;\n });\n }", "function saveDiagramProperties() {\n myDiagram.model.modelData.position = go.Point.stringify(myDiagram.position);\n}", "changeProp (propertyToSet, cssProp, context, val) {\n console.log(cssProp);\n console.log(val);\n if (cssProp) {\n let cssObject = this.state.css;\n cssObject[cssProp] = val;\n this.setState({ css : cssObject });\n } else {\n this.setState({ [propertyToSet] : val });\n }\n }", "function fv_helper_addProperties(props) {\n var key;\n\n if (this !== window) {\n for (key in props) {\n if (props.hasOwnProperty(key)) {\n Object.defineProperty(this, key, { value: props[key] });\n }\n }\n }\n}", "add(props) {\r\n\t\t\t\t\tthis.properties = this.properties.concat(props);\r\n\t\t\t\t\tthis.forceUpdateLocation = true;\r\n\t\t\t\t\treturn this;\r\n\t\t\t\t}", "setProperties(blobServiceProperties, options) {\n const operationArguments = {\n blobServiceProperties,\n options: coreHttp.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);\n }", "constructor() {\n\t this.properties = [];\n\t }", "properties(properties) {\n if (arguments.length === 0) {\n // Return the existing properties.\n const properties = {};\n for (const key of internal(this).properties.keys())\n properties[key] = this.property(key);\n return properties;\n } else {\n // Set new property values.\n for (const key in properties) {\n const value = properties[key];\n this.property(key, value);\n }\n return this;\n }\n }", "update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\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 }", "update(_changedProperties) {\n if (this._reflectingProperties !== undefined &&\n this._reflectingProperties.size > 0) {\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 }", "set(structure) {\r\n callBaseSet_1.callBaseSet(exports.PropertyAssignmentBase.prototype, this, structure);\r\n if (structure.initializer != null)\r\n this.setInitializer(structure.initializer);\r\n else if (structure.hasOwnProperty(\"initializer\"))\r\n return this.removeInitializer();\r\n return this;\r\n }", "setProperties(blobServiceProperties, options) {\n const operationArguments = {\n blobServiceProperties,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);\n }", "setProperties(blobServiceProperties, options) {\n const operationArguments = {\n blobServiceProperties,\n options: coreHttp__namespace.operationOptionsToRequestOptionsBase(options || {})\n };\n return this.client.sendOperationRequest(operationArguments, setPropertiesOperationSpec);\n }", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "function setObjectProperties(params, callback) {\n var objId = params.objId;\n var type = params.type;\n var properties = params.properties;\n if (!objId || !type || !properties || !properties.length) {\n return callback(\"Please specify objId, type, and properties array as {path:string,value:any}\");\n }\n if (!_model) {\n return callback(\"setObjectProperties: Director not initialised\");\n }\n _model.setObjectProperties({\n objId: objId,\n type: type,\n properties: properties\n }, function (err) {\n if (err) {\n return callback(err);\n }\n return callback(null);\n });\n }", "function clearProperties()\n {\n _edges = undefined;\n _edgeVectors = undefined;\n _matrix = undefined;\n }", "function applyProperties(target, properties) {\n for (var key in properties) {\n target.style[key] = properties[key];\n }\n}", "set propertyPath(value) {}", "update(_changedProperties){if(this._reflectingProperties!==void 0&&0<this._reflectingProperties.size){// Use forEach so this works even if for/of loops are compiled to for\n// loops expecting arrays\nthis._reflectingProperties.forEach((v,k)=>this._propertyToAttribute(k,this[k],v));this._reflectingProperties=void 0}}", "_applyInstanceProperties() {\n for (const [p, v] of this._instanceProperties) {\n this[p] = v;\n }\n this._instanceProperties = undefined;\n }", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key];}}}", "setProperties(properties) {\n let copied = _.clone(properties)\n copied['UserPoolName'] = this.userPoolName()\n this.properties = copied\n }", "updated(changedProperties) {\n if (super.updated) {\n super.updated(changedProperties);\n }\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"link\") {\n this.remoteLinkURL = this[propName];\n }\n /* notify example\n // notify\n if (propName == 'format') {\n this.dispatchEvent(\n new CustomEvent(`${propName}-changed`, {\n detail: {\n value: this[propName],\n }\n })\n );\n }\n */\n /* observer example\n if (propName == 'activeNode') {\n this._activeNodeChanged(this[propName], oldValue);\n }\n */\n /* computed example\n if (['id', 'selected'].includes(propName)) {\n this.__selectedChanged(this.selected, this.id);\n }\n */\n });\n }", "_upgradeProperty(prop) {\n if (this.hasOwnProperty(prop)) {\n let value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }", "_upgradeProperty(prop) {\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n delete this[prop];\n this[prop] = value;\n }\n }", "set(options) {\n\n if (\"point1\" in options) {\n var copyPoint = options[\"point1\"];\n this.point1.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"point2\" in options) {\n var copyPoint = options[\"point2\"];\n this.point2.set({x: copyPoint.getX(), y: copyPoint.getY()});\n }\n if (\"line\" in options) {\n var copyLine = options[\"line\"];\n this.point1.set({x: copyLine.getPoint1().getX(), y: copyLine.getPoint1().getY()});\n this.point1.set({x: copyLine.getPoint2().getX(), y: copyLine.getPoint2().getY()});\n }\n }", "setRoomProperties(dimensions, materials) {\n this.room.setProperties(dimensions, materials);\n }", "update(_changedProperties){if(this._reflectingProperties!==undefined&&this._reflectingProperties.size>0){// Use forEach so this works even if for/of loops are compiled to for\n// loops expecting arrays\nthis._reflectingProperties.forEach((v,k)=>this._propertyToAttribute(k,this[k],v));this._reflectingProperties=undefined;}this._markUpdated();}", "function set_properties(obj) {\r\n select_layer(obj);\r\n if (obj.type == \"i-text\") {\r\n fill_panel_toggle('enable');\r\n stroke_panel_toggle('enable');\r\n shadow_panel_toggle('enable');\r\n set_userinput_fill(obj.get('fill'));\r\n set_userinput_fontWeight(obj.get('fontWeight'));\r\n set_userinput_stroke(obj);\r\n set_userinput_shadow(obj);\r\n $(\"#font\").removeClass(\"disabledPanel\");\r\n $(\"#fill\").removeClass(\"disabledPanel\");\r\n }\r\n else if (obj.type == \"image\") {\r\n fill_panel_toggle('disable');\r\n stroke_panel_toggle('enable');\r\n shadow_panel_toggle('enable');\r\n // $(\"#font\").addClass(\"disabledPanel\");\r\n // $(\"#fill\").addClass(\"disabledPanel\");\r\n }\r\n}", "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 }", "addPropertySet() {\n if (this.repoPropertySetSelected) {\n this._savePropertySetValues(this.repoPropertySetSelected);\n }\n this.repoPropertySetSelected = '';\n this.propertyValuesOptions = [];\n }", "function set_properties(a, b, c) { if (b != \"choices\") { ds.set(active_element, b, a) } else { ds.set_option(active_element, a, c) } live_preview[b](a) }", "set property(value) {\n // now check if the property value has changed, which will depend\n // on the final Property type\n\n if (this.property === null && value !== null) {\n // this is the first time we are setting a value to the property\n this._changed = true;\n this._previousValue = {};\n\n } else if (this.property !== null && !this.isEqual(this.property, value)) {\n this._previousValue = super.property;\n this._changed = true;\n }\n\n // finally capture the current value in the base Prototype\n super.property = value;\n }", "setAudioProperties(minDistance, maxDistance, rolloff, algorithm, transitionTime) {\n this.minDistance = minDistance;\n this.maxDistance = maxDistance;\n this.rolloff = rolloff;\n this.algorithm = algorithm;\n this.transitionTime = transitionTime;\n }", "sendAllProperties() {\n this.sendProperty(this.featureName, this.currentValue);\n }", "function set_edges() {\n\n dragrect.style(\"stroke\", \"black\");\n\n // Edging goes top, right, bottom, left\n // As a rectangle has 4 sides, there are 2^4 = 16 cases to handle.\n\n\n var numRepeats = Math.floor(rect_geom.width / 4);\n var gap = rect_geom.width - 4 * numRepeats;\n var edge = \"2,2,\".repeat(numRepeats) + gap + \",0\";\n\n var dashArray = \"\";\n\n if (rect_geom.top_fixed){\n dashArray += edge;\n } else {\n dashArray += \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.right_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n if (rect_geom.bottom_fixed){\n dashArray += \",\" + edge;\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.width;\n }\n\n if (rect_geom.left_fixed){\n dashArray += \",\" + rect_geom.height + \",0\";\n } else {\n dashArray += \",\" + \"0,\" + rect_geom.height;\n }\n\n dragrect.style(\"stroke-dasharray\", dashArray);\n common_geom.update_formula();\n }", "_initDefinedProperties() {\n //initialise graph parameters\n this.width = this.getAttribute('width') || 300;\n this.height = this.getAttribute('height') || 300;\n this.drawXAxis = this.getAttribute('hide-x-axis') !== null ? false : true;\n this.drawYAxis = this.getAttribute('hide-y-axis') !== null ? false : true;\n this.drawOrigin = this.getAttribute('hide-origin') !== null ? false : true;\n this.drawGrid = this.getAttribute('show-grid') !== null ? true : false;\n //indicates that the x axis only should be measured in multiples of pi\n this.piUnits = this.getAttribute('pi-units') !== null ? true : false;\n //overrides the default unit-marking step sizes\n //if not set, will be defined after unitSize in _initDerivedProperties()\n this.stepX = this.getAttribute('step-x') ?\n this._parseNumberToRational(this.getAttribute('step-x')) : null;\n this.stepY = this.getAttribute('step-y') ?\n this._parseNumberToRational(this.getAttribute('step-y')) : null;\n this.drawXUnits = this.getAttribute('hide-x-units') !== null ? false : true;\n this.drawYUnits = this.getAttribute('hide-y-units') !== null ? false : true;\n\n this.range = {\n x: this._parseRange(this.getAttribute('range-x') || '(-10, 10)'),\n y: this._parseRange(this.getAttribute('range-y') || '(-10, 10)')\n }\n\n this.gutter = {\n left: parseInt(this.getAttribute('gutter-left')) || GUTTER_LEFT,\n right: parseInt(this.getAttribute('gutter-right')) || GUTTER_RIGHT,\n top: parseInt(this.getAttribute('gutter-top')) || GUTTER_TOP,\n bottom: parseInt(this.getAttribute('gutter-bottom')) || GUTTER_BOTTOM\n }\n }", "function ViewProperties()\n{\n\tthis.x=0;\n\tthis.y=0;\n\tthis.scale=1;\n\treturn this;\n}", "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 }", "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 }", "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 }", "setMergedAttributes() {\n\t\t\tconst { setAttributes } = this.props;\n\t\t\tsetAttributes( this.getMergedAttributes() );\n\t\t}", "function openproperties(){\n //post(\"openproperties\" + myNodeID + \" \" + myNodeTitle + \" \" + myNodeAddress + \" \" + myNodePropsFileName + \"\\n\");\n if(myNodeEnableProperties){\n\t\t//post(\"color \" + colr + \" \\n\");\n outlet(2, \"shroud\", \"bs.vpl.node.props\", myNodeID, myNodeTitle, myNodeAddress, myNodePropsFileName, myNodeColorOn);\n }\n}", "function setProps(event, linkTrackVars) {\n var eventAttributes = event.EventAttributes;\n for (var eventAttributeKey in eventAttributes) {\n if (eventAttributes.hasOwnProperty(eventAttributeKey)) {\n propsMapping.forEach(function(propMap) {\n if (propMap.map === eventAttributeKey) {\n appMeasurement[propMap.value] =\n eventAttributes[eventAttributeKey];\n if (linkTrackVars) {\n linkTrackVars.push(propMap.value);\n }\n }\n });\n }\n }\n }", "function assign_object_properties(obj, name, properties)\n\t{\n\t\t// set defaults (krpano hotspot like properties)\n\t\tif (properties === undefined)\tproperties = {};\n\t\tif (properties.name === undefined)\tproperties.name = name;\n\t\tif (properties.ath === undefined)\tproperties.ath = 0;\n\t\tif (properties.atv === undefined)\tproperties.atv = 0;\n\t\tif (properties.depth === undefined)\tproperties.depth = 1000;\n\t\tif (properties.scale === undefined)\tproperties.scale = 1;\n\t\tif (properties.rx === undefined)\tproperties.rx = 0;\n\t\tif (properties.ry === undefined)\tproperties.ry = 0;\n\t\tif (properties.rz === undefined)\tproperties.rz = 0;\n\t\tif (properties.rorder === undefined)\tproperties.rorder = \"YXZ\";\n\t\tif (properties.enabled === undefined)\tproperties.enabled = true;\n\t\tif (properties.capture === undefined)\tproperties.capture = true;\n\t\tif (properties.onover === undefined)\tproperties.onover = null;\n\t\tif (properties.onout === undefined)\tproperties.onout = null;\n\t\tif (properties.ondown === undefined)\tproperties.ondown = null;\n\t\tif (properties.onup === undefined)\tproperties.onup = null;\n\t\tif (properties.onclick === undefined)\tproperties.onclick = null;\n\t\tproperties.pressed = false;\n\t\tproperties.hovering = false;\n\n\t\tobj.properties = properties;\n\n\t\tupdate_object_properties(obj);\n\t}", "setPoint(editor, props) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var {\n selection\n } = editor;\n var {\n edge = 'both'\n } = options;\n\n if (!selection) {\n return;\n }\n\n if (edge === 'start') {\n edge = Range.isBackward(selection) ? 'focus' : 'anchor';\n }\n\n if (edge === 'end') {\n edge = Range.isBackward(selection) ? 'anchor' : 'focus';\n }\n\n var {\n anchor,\n focus\n } = selection;\n var point = edge === 'anchor' ? anchor : focus;\n Transforms.setSelection(editor, {\n [edge === 'anchor' ? 'anchor' : 'focus']: _objectSpread$1(_objectSpread$1({}, point), props)\n });\n }", "get edge () { return this._edge; }", "set( property ) { \n\n \n var currentClass = this,\n guard = this.guard();\n\n Object.keys(property).forEach(function(key) {\n if(!guard.includes(key))\n eval(`currentClass.${key} = property[[key]]`);\n }) \n }", "function setGeneralProperty(currentPath, currentValue, member) {\n orderServices.setOrderProperty({ path: currentPath, value: currentValue, member });\n }", "replaceProperties(replacedNode, newNode) {}", "setEdgeMetadata(node, port, node2, port2, metadata) {\n let edge = this.getEdge(node, port, node2, port2);\n if (!edge) { return; }\n\n this.checkTransactionStart();\n let before = clone(edge.metadata);\n if (!edge.metadata) { edge.metadata = {}; }\n\n for (let item in metadata) {\n let val = metadata[item];\n if (val != null) {\n edge.metadata[item] = val;\n } else {\n delete edge.metadata[item];\n }\n }\n\n this.emit('changeEdge', edge, before);\n return this.checkTransactionEnd();\n }", "function setProperties() {\n $scope.properties = null;\n $scope.emptySet = false;\n\n // console.log(Organization.current)\n\n var options = {\n token: Organization.current.token,\n map_id: Organization.current.display_map_id\n };\n\n\n Property.query(options).$promise\n .then(function (obj) {\n $scope.properties = obj;\n $scope.filteredProperties = obj;\n \n if(obj[0].address == 'empty_set') {\n $scope.emptySet = true;\n $scope.properties = []\n $scope.filteredProperties = []\n } else {\n setMap(obj);\n }\n\n })\n .catch(HandleError.newErr);\n }", "addEdge(edge = {}) {\n edge.weight = this.weighted && edge.hasOwnProperty('weight') ? edge.weight : 1;\n\n if (!this.adjacencyList.hasOwnProperty(edge.from)) {\n this.adjacencyList[edge.from] = {};\n }\n\n this.adjacencyList[edge.from][edge.to] = edge.weight;\n\n if (!this.direcred) {\n if (!this.adjacencyList.hasOwnProperty(edge.to)) {\n this.adjacencyList[edge.to] = {};\n }\n\n this.adjacencyList[edge.to][edge.from] = edge.weight;\n }\n\n this.addNode(edge.from);\n this.addNode(edge.to);\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "update(properties) {\r\n return this.patchCore({\r\n body: jsS(properties),\r\n });\r\n }", "function addProperties(current, parent, name) {\n\n if (current.name == null) {\n current.name = name;\n }\n current.parent = parent;\n\n if (current.restVerbs) {\n if (current.restVerbs.indexOf('c') > -1) {\n current.createRoute = createRoute;\n }\n if (current.restVerbs.indexOf('r') > -1) {\n current.readRoute = readRoute;\n }\n if (current.restVerbs.indexOf('u') > -1) {\n current.updateRoute = updateRoute;\n }\n if (current.restVerbs.indexOf('d') > -1) {\n current.deleteRoute = deleteRoute;\n }\n } else {\n current.readRoute = readRoute;\n }\n\n return current;\n\n }", "function addProperties() {\n function addProps(o1,o2) {\n o1 = typeof o1 === 'object' ? o1 : {};\n o2 = typeof o2 === 'object' ? o2 : {};\n Object.keys(o2).forEach(function(k) {\n o1[k] = o2[k];\n });\n return o1;\n }\n var args = Array.prototype.slice.call(arguments);\n var newObject = {};\n args.forEach(function(a) {\n addProps(newObject, a);\n });\n return newObject;\n }", "function setEdge(edge){\n\t\t$.ajax({\n\t\t\turl:'/api/?setedge='+edge.toString(),\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data.success==1){\n\t\t\t\t\t$('#setedge').removeClass('zero one two three four five').addClass(numtoname[data.edge]);\n\t\t\t\t\tlocation.reload();\n\t\t\t\t}else alert(\"Failed to set edge! \"+data.msg);\n\t\t\t},\n\t\t\terror:function(){\n\t\t\t\talert('Failed to set edge!');\n\t\t\t}\n\t\t});\n\t}", "function setUpNewEdge(source, target, sourceHandle, targetHandle) {\n\t\tlet newEdgeId = 'e' + source + '_' + sourceHandle + '-' + target;\n\t\tlet newEdge = {\n\t\t\tid: newEdgeId,\n\t\t\tsource: source,\n\t\t\ttarget: target,\n\t\t\tsourceHandle: sourceHandle,\n\t\t\ttargetHandle: targetHandle,\n\t\t\tclassName: newEdgeId,\n\n\t\t\ttype: props?.pathSettings,\n\t\t\tanimated: true,\n\n\t\t\tstyle: { stroke: '#fff', strokeWidth: '5px' },\n\t\t\tlabel: \"jank\",\n\t\t\tlabelStyle: { visibility: 'hidden' },\n\t\t\tlabelBgBorderRadius: '100%',\n\t\t\tlabelBgStyle: {\n\t\t\t\theight: '24.3594', fill: 'var(--color-mud_black)', stroke: 'white', strokeWidth: '3',\n\t\t\t\tvisibility: (props?.edgeGripSetting ? 'visible' : 'hidden')\n\t\t\t},\n\t\t};\n\n\t\treturn newEdge;\n\t}", "setPoint(editor, props, options) {\n var {\n selection\n } = editor;\n var {\n edge = 'both'\n } = options;\n\n if (!selection) {\n return;\n }\n\n if (edge === 'start') {\n edge = Range.isBackward(selection) ? 'focus' : 'anchor';\n }\n\n if (edge === 'end') {\n edge = Range.isBackward(selection) ? 'anchor' : 'focus';\n }\n\n var {\n anchor,\n focus\n } = selection;\n var point = edge === 'anchor' ? anchor : focus;\n Transforms.setSelection(editor, {\n [edge === 'anchor' ? 'anchor' : 'focus']: _objectSpread$7({}, point, {}, props)\n });\n }", "updated(changedProperties) {\n changedProperties.forEach((oldValue, propName) => {\n if (propName == \"trackIcon\") {\n this._trackIconChanged(this[propName], oldValue);\n }\n if ([\"id\", \"selected\"].includes(propName)) {\n this.__selectedChanged(this.selected, this.id);\n }\n });\n }", "newStyleProp(...args){\n let newProp = new StyleProperty(...args);\n this.addProperty(newProp);\n }", "function setStateOnPropertySet(opts) {\n\t var props = opts.properties;\n\t Object.keys(props).forEach(function (name) {\n\t var prop = props[name];\n\t var set = prop.set;\n\t var render = normalizePropertyRender(prop.render);\n\t prop.set = function (elem, data) {\n\t set && set(elem, data);\n\t if (render(elem, data)) {\n\t var deb = elem[$debounce];\n\t !deb && (deb = elem[$debounce] = debounce(skate.render, 1));\n\t deb(elem);\n\t }\n\t };\n\t });\n\t}", "set icalProperty (icalatt) {\n this.modify();\n this.id = icalatt.valueAsIcalString;\n this.mIsOrganizer = (icalatt.propertyName == \"ORGANIZER\");\n\n let promotedProps = { };\n for each (let prop in this.icalAttendeePropMap) {\n this[prop.cal] = icalatt.getParameter(prop.ics);\n // Don't copy these to the property bag.\n promotedProps[prop.ics] = true;\n }\n\n // Reset the property bag for the parameters, it will be re-initialized\n // from the ical property.\n this.mProperties = new calPropertyBag();\n\n for each (let [name, value] in cal.ical.paramIterator(icalatt)) {\n if (!promotedProps[name]) {\n this.setProperty(name, value);\n }\n }\n }", "newPropertiesSheet() {\n this.properties_sheet = new NetworkLoadBalancerProperties(this.artefact)\n }" ]
[ "0.6100874", "0.6052847", "0.60270846", "0.60270846", "0.59366655", "0.5885472", "0.57240963", "0.56944996", "0.566307", "0.55880666", "0.54899", "0.5487572", "0.5454063", "0.54103035", "0.54077095", "0.53778654", "0.5364762", "0.53610855", "0.53460854", "0.5340886", "0.5309421", "0.52835405", "0.52562207", "0.52273303", "0.5220844", "0.5220844", "0.5212701", "0.5202111", "0.5191908", "0.5185614", "0.5177306", "0.5171243", "0.517023", "0.5168573", "0.5160692", "0.5134053", "0.5132769", "0.5117516", "0.5111087", "0.5111087", "0.51104194", "0.5107318", "0.5107318", "0.5106867", "0.51047593", "0.5094312", "0.5091692", "0.50818247", "0.5080269", "0.50723284", "0.50717205", "0.5069861", "0.5050117", "0.5036963", "0.5016789", "0.501612", "0.49778417", "0.49645787", "0.49626532", "0.4956593", "0.4954679", "0.49343115", "0.49144092", "0.49111778", "0.48902377", "0.48763934", "0.48698688", "0.4869542", "0.48541942", "0.48541942", "0.48541942", "0.48537433", "0.48498842", "0.4848494", "0.48449346", "0.4841404", "0.4834592", "0.48321423", "0.48196653", "0.4819052", "0.48182216", "0.48169795", "0.4813665", "0.48073474", "0.48073474", "0.48073474", "0.48073474", "0.48073474", "0.48073474", "0.48073474", "0.48010272", "0.4800087", "0.4798908", "0.47873047", "0.47768918", "0.47766936", "0.4757785", "0.4753856", "0.47519428", "0.47515002" ]
0.61721617
0
Abstract Get bounds of this edge.
getBounds() { throw "Abstract method" }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get bounds() {}", "get bounds() { return this._bounds; }", "get bounds() {\n // Optimization to reduct calculations.\n // The result should be exactly the same if this is removed.\n if (this._bounds !== undefined) {\n return this._bounds;\n }\n\n if (this.$el == null) {\n return this.preAttachedBounds;\n }\n else {\n return Bounds.fromAttrs(this.$el.attrs);\n }\n }", "get boundsValue() {}", "getBounds() {\n return new Rectangle(new Point(this.x, this.y), new Vector(0, 0));\n }", "get localBounds() {}", "bounds() {\n const _bounds = new HRect(this.rect);\n _bounds.offsetTo(0, 0);\n return _bounds;\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "getBounds(){\n let rect = new Rectangle()\n\t\trect.setRect(this.x, this.y, this.size, this.size)\n\t\treturn rect\n }", "getBounds() {}", "get bounds() {\r\n\t\treturn {\r\n\t\t\tx: this.origin.x * (this.tileSize + this.spacing),\r\n\t\t\ty: this.origin.y * (this.tileSize + this.spacing),\r\n\t\t\tw: this.w * (this.tileSize + this.spacing) - this.spacing,\r\n\t\t\th: this.h * (this.tileSize + this.spacing) - this.spacing\r\n\t\t};\r\n\t}", "get bounds () {\n const xMin = Math.min.apply(null, this.pointArr.map(pt => pt.x))\n const yMin = Math.min.apply(null, this.pointArr.map(pt => pt.y))\n const xMax = Math.max.apply(null, this.pointArr.map(pt => pt.x))\n const yMax = Math.max.apply(null, this.pointArr.map(pt => pt.y))\n\n return {\n x: xMin,\n y: yMin,\n width: xMax - xMin,\n height: yMax - yMax\n }\n }", "function bounds() {\n return {\n start: conductor.displayStart(),\n end: conductor.displayEnd(),\n domain: conductor.domain().key\n };\n }", "getBounds() {\n const bounds = this.options.bounds\n ? L.latLngBounds(this.options.bounds)\n : this._clusters.getBounds()\n\n if (bounds.isValid()) {\n return toLngLatBounds(bounds)\n }\n }", "getWorldBounds() {\n const left = this.screenToWorldCoordinates(Vector.Zero).x;\n const top = this.screenToWorldCoordinates(Vector.Zero).y;\n const right = left + this.drawWidth;\n const bottom = top + this.drawHeight;\n return new BoundingBox(left, top, right, bottom);\n }", "getBoundingBox() {\n return new BoundingBox(this.x, this.y, this.width, this.height)\n }", "function Bounds()\n{\n /**\n * @member {number}\n * @default 0\n */\n this.minX = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.minY = Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxX = -Infinity;\n\n /**\n * @member {number}\n * @default 0\n */\n this.maxY = -Infinity;\n\n this.rect = null;\n}", "_calculateBounds() {\n this.calculateVertices();\n this._bounds.addVertexData(this.vertexData, 0, this.vertexData.length);\n }", "get boundingBox() {\n throw this._notImplemented(\"get boundingBox\");\n }", "function get_bounds(){\n\t\t\t\t\n\t\t\t\treturn {\n\t\t\t\t\t\n\t\t\t\t\tsw_lat : map.getBounds().getSouthWest().lat(),\n\t\t\t\t\t\n\t\t\t\t\tsw_lng : map.getBounds().getSouthWest().lng(),\n\t\t\t\t\t\n\t\t\t\t\tne_lat : map.getBounds().getNorthEast().lat(),\n\t\t\t\t\t\n\t\t\t\t\tne_lng : map.getBounds().getNorthEast().lng()\n\t\t\t\t\n\t\t\t\t};\n\t\t\t\n\t\t\t}", "get boundingBox() {\n }", "getBounds() {\n return this.state[CIRCLE].getBounds()\n }", "get upperBound(){\n\t\treturn -this.height /2;\n\t}", "get boundingRect() {\n return this.element.getBoundingClientRect();\n }", "function getBounds() {\n let body = d3.select('body');\n let bounds = body.node().getBoundingClientRect();\n\n let bound = {height: bounds.height, width: bounds.width, margin:\n {top: 50, right: 30, bottom: 30, left: 100}};\n\n bound.height -= 100; // because of header\n bound.width -= (bound.margin.left + bound.margin.right);\n bound.height -= (bound.margin.top + bound.margin.bottom);\n\n return bound;\n}", "bounds() {\n if(this.isEmpty()) return null;\n // maximum boundaries possible\n let min = Number.POSITIVE_INFINITY\n let max = Number.NEGATIVE_INFINITY\n\n return [min, max] = this.forEachNode( (currentNode) => {\n if(currentNode.value < min) min = currentNode.value;\n if(currentNode.value > max) max = currentNode.value;\n return [min, max]\n }, min, max)\n \n }", "getLatLngBounds() {\n let bounds = new google.maps.LatLngBounds();\n // If the flight is big just having the two end points will cut off part of the route\n for(let i = 0; i <= 1; i+= 0.1) {\n bounds.extend(this.getIntermediatePoint(i));\n }\n return bounds;\n }", "setBounds() {\n let x = this.position.getX();\n let y = this.position.getY();\n let s = Game.Settings().UnitSize;\n let hs = s / 2;\n\n //generate Individual Bounds\n this.bounds = new Bounds(x - hs, y - hs, x + hs, y + hs);\n }", "function BoundingBoxRect() { }", "function getMapBounds() {\r\n\t\t//return app.location.bounds;\r\n\t\treturn app.map.map.getBounds();\r\n\t}", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "function getBounds(features) {\n var bounds = { min: [999, 999], max: [-999, -999] };\n\n _.each(features, function(element) {\n var point = map.latLngToLayerPoint(element.LatLng);\n\n bounds.min[0] = Math.min(bounds.min[0], point.x);\n bounds.min[1] = Math.min(bounds.min[1], point.y);\n bounds.max[0] = Math.max(bounds.max[0], point.x);\n bounds.max[1] = Math.max(bounds.max[1], point.y);\n });\n\n return bounds;\n }", "function boundEdges(points, edges) {\n\t var bounds = new Array(edges.length)\n\t for(var i=0; i<edges.length; ++i) {\n\t var e = edges[i]\n\t var a = points[e[0]]\n\t var b = points[e[1]]\n\t bounds[i] = [\n\t Math.min(a[0], b[0]),\n\t Math.min(a[1], b[1]),\n\t Math.max(a[0], b[0]),\n\t Math.max(a[1], b[1]) ]\n\t }\n\t return bounds\n\t}", "function boundEdges(points, edges) {\n\t var bounds = new Array(edges.length)\n\t for(var i=0; i<edges.length; ++i) {\n\t var e = edges[i]\n\t var a = points[e[0]]\n\t var b = points[e[1]]\n\t bounds[i] = [\n\t Math.min(a[0], b[0]),\n\t Math.min(a[1], b[1]),\n\t Math.max(a[0], b[0]),\n\t Math.max(a[1], b[1]) ]\n\t }\n\t return bounds\n\t}", "getGameBoundaries() {\n\t\treturn {\n\t\t\tx1: 0,\n\t\t\ty1: 0,\n\t\t\tx2:\tthis.dimensions.w,\n\t\t\ty2: this.dimensions.h\n\t\t}\n\t}", "function getBoundingBox() {\n if (!bounds) return; // client does not want to restrict movement\n\n if (typeof bounds === 'boolean') {\n // for boolean type we use parent container bounds\n var ownerRect = owner.getBoundingClientRect();\n var sceneWidth = ownerRect.width;\n var sceneHeight = ownerRect.height;\n\n return {\n left: sceneWidth * boundsPadding,\n top: sceneHeight * boundsPadding,\n right: sceneWidth * (1 - boundsPadding),\n bottom: sceneHeight * (1 - boundsPadding)\n };\n }\n\n return bounds;\n }", "function getBounds(feature) {\n var bounds = { min: [999, 999], max: [-999, -999] };\n\n _.each(feature, function(path) {\n _.each(path, function(point) {\n point = map.latLngToLayerPoint(new L.LatLng(point.x, point.y));\n\n bounds.min[0] = Math.min(bounds.min[0], point.x);\n bounds.min[1] = Math.min(bounds.min[1], point.y);\n bounds.max[0] = Math.max(bounds.max[0], point.x);\n bounds.max[1] = Math.max(bounds.max[1], point.y);\n });\n });\n\n return bounds;\n }", "getMapInnerBounds() {\n const mb = this.getMap().getDiv().getBoundingClientRect();\n const mib = {\n top: mb.top + this._opts.edgeOffset.top,\n right: mb.right - this._opts.edgeOffset.right,\n bottom: mb.bottom - this._opts.edgeOffset.bottom,\n left: mb.left + this._opts.edgeOffset.left\n };\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function currentBounds() {\n var cntr = element ? element.parent() : null;\n var parent = cntr ? cntr.parent() : null;\n\n return parent ? self.clientRect(parent) : null;\n }", "getBoundingBox() {\n if (this.root instanceof SVGGraphicsElement) {\n return this.root.getBBox();\n }\n else {\n return null;\n }\n }", "function getBounds(bounds){\n\t var bbox = [];\n\t\n\t bbox.push(parseFloat(bounds.attrib[\"minlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"minlat\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlon\"]));\n\t bbox.push(parseFloat(bounds.attrib[\"maxlat\"]));\n\t\n\t return bbox;\n\t}", "function getMapBounds(){\n\tvar bounds = myMap.getBounds();\n\tvar nWlat = bounds.getNorthWest().lat;\n\tvar nWlon = bounds.getNorthWest().lng;\n\tvar sElat = bounds.getSouthEast().lat;\n\tvar sElon = bounds.getSouthEast().lng;\n\tvar boundArray = [nWlat,nWlon, sElat, sElon];\n\treturn boundArray\n}", "get boundingBox() {\n return this._boundingBox;\n }", "set bounds(value) {}", "function boundEdges(points, edges) {\n var bounds = new Array(edges.length)\n for(var i=0; i<edges.length; ++i) {\n var e = edges[i]\n var a = points[e[0]]\n var b = points[e[1]]\n bounds[i] = [\n Math.min(a[0], b[0]),\n Math.min(a[1], b[1]),\n Math.max(a[0], b[0]),\n Math.max(a[1], b[1]) ]\n }\n return bounds\n}", "getBoundingBox()\r\n\t{\r\n\t\tif ( this.vpos.length == 0 ) return null;\r\n\t\tvar min = [...this.vpos[0]];\r\n\t\tvar max = [...this.vpos[0]];\r\n\t\tfor ( var i=1; i<this.vpos.length; ++i ) \r\n\t\t{\r\n\t\t\tfor ( var j=0; j<3; ++j ) \r\n\t\t\t{\r\n\t\t\t\tif ( min[j] > this.vpos[i][j] ) min[j] = this.vpos[i][j];\r\n\t\t\t\tif ( max[j] < this.vpos[i][j] ) max[j] = this.vpos[i][j];\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn { min: min, max: max };\r\n\t}", "function BoundingBox() {\n var bounds = map.getBounds().getSouthWest().lng + \",\" + map.getBounds().getSouthWest().lat + \",\" + map.getBounds().getNorthEast().lng + \",\" + map.getBounds().getNorthEast().lat;\n return bounds;\n}", "getBoundingBox() {\n return this.box;\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get SUPPORT_RANGE_BOUNDS() {\n 'use strict';\n\n var value = testRangeBounds(document);\n Object.defineProperty(FEATURES, 'SUPPORT_RANGE_BOUNDS', { value: value });\n return value;\n }", "get localBounds() {\n return {\n x: this.x, //I changed this, it was \"x: 0,\"\n y: this.y, //I changed this, it was \"y: 0,\"\n width: this.width,\n height: this.height\n } \n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "async boundingBox() {\n const result = await this._getBoxModel();\n if (!result)\n return null;\n const quad = result.model.border;\n const x = Math.min(quad[0], quad[2], quad[4], quad[6]);\n const y = Math.min(quad[1], quad[3], quad[5], quad[7]);\n const width = Math.max(quad[0], quad[2], quad[4], quad[6]) - x;\n const height = Math.max(quad[1], quad[3], quad[5], quad[7]) - y;\n return { x, y, width, height };\n }", "clone() {\n return new Bound(this._topLeft.clone(), this._bottomRight.clone());\n }", "function et2_bounds(_top, _bottom)\n{\n\treturn {\n\t\t\"top\": _top,\n\t\t\"bottom\": _bottom\n\t};\n}", "function boundEdges (points, edges) {\n var bounds = new Array(edges.length)\n for (var i = 0; i < edges.length; ++i) {\n var e = edges[i]\n var a = points[e[0]]\n var b = points[e[1]]\n bounds[i] = [\n nextafter(Math.min(a[0], b[0]), -Infinity),\n nextafter(Math.min(a[1], b[1]), -Infinity),\n nextafter(Math.max(a[0], b[0]), Infinity),\n nextafter(Math.max(a[1], b[1]), Infinity)\n ]\n }\n return bounds\n}", "function getBounds(projection, rangeBox) {\n\t return d3.geo.path().projection(projection).bounds(rangeBox);\n\t}", "function getBounds(projection, rangeBox) {\n\t return d3.geo.path().projection(projection).bounds(rangeBox);\n\t}", "calculateBounds_() {\n const bounds = new google.maps.LatLngBounds(this.center_, this.center_);\n this.bounds_ = this.markerClusterer_.getExtendedBounds(bounds);\n }", "function getClippingBBox(bounds) {\n return [[bounds.xmin, bounds.ymin],\n [bounds.xmin, bounds.ymax],\n [bounds.xmax, bounds.ymax],\n [bounds.xmax, bounds.ymin]];\n }", "function currentBounds(){var cntr=element?element.parent():null;var parent=cntr?cntr.parent():null;return parent?self.clientRect(parent):null;}", "function getExtendedBounds(bnds){\n // get the coordinates for the sake of readability\n var swlat = bnds._southWest.lat;\n var swlng = bnds._southWest.lng;\n var nelat = bnds._northEast.lat;\n var nelng = bnds._northEast.lng;\n\n // Increase size of bounding box in each direction by 50%\n swlat = swlat - Math.abs(0.5*(swlat - nelat)) > -90 ? swlat - Math.abs(0.5*(swlat - nelat)) : -90;\n swlng = swlng - Math.abs(0.5*(swlng - nelng)) > -180 ? swlng - Math.abs(0.5*(swlng - nelng)) : -180;\n nelat = nelat + Math.abs(0.5*(swlat - nelat)) < 90 ? nelat + Math.abs(0.5*(swlat - nelat)) : 90;\n nelng = nelng + Math.abs(0.5*(swlng - nelng)) < 180 ? nelng + Math.abs(0.5*(swlng - nelng)) : 180;\n\n return L.latLngBounds(L.latLng(swlat, swlng), L.latLng(nelat, nelng));\n }", "getBounds(bounds) {\n if (this.objects !== undefined) {\n for (let i = 0; i < this.objects.length; i++) {\n this.objects[i].getBounds(bounds);\n }\n }\n }", "getBoundsRightX() {\n if (SharedElementHelpers.IsTextOrShapeElements(this)) {\n return this.content.width;\n }\n return this.content.width / 2;\n }", "function getBounds(coordArr) {\n\t\t\tlet leftBound;\n\t\t\tlet rightBound;\n\t\t\tlet upperBound;\n\t\t\tlet lowerBound;\n\t\t\tcoordArr.forEach((pt, i) => {\n\t\t\t\tconst { x, y } = pt;\n\t\t\t\tif (i === 0) {\n\t\t\t\t\t// Sets default values\n\t\t\t\t\tleftBound = rightBound = x;\n\t\t\t\t\tupperBound = lowerBound = y;\n\t\t\t\t} else {\n\t\t\t\t\tleftBound = Math.min(leftBound, x);\n\t\t\t\t\trightBound = Math.max(rightBound, x);\n\t\t\t\t\tupperBound = Math.min(upperBound, y);\n\t\t\t\t\tlowerBound = Math.max(lowerBound, y);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn {\n\t\t\t\tleftBound,\n\t\t\t\trightBound,\n\t\t\t\tupperBound,\n\t\t\t\tlowerBound\n\t\t\t};\n\t\t}", "getRange() {\n return this.range;\n }", "_calculateBounds() {\n this.finishPoly();\n var lb = this.geometry.bounds;\n this._bounds.addFrame(this.transform, lb.minX, lb.minY, lb.maxX, lb.maxY);\n }", "function Bounds2D ( top, right, bottom, left ) {\n this.top = top;\n this.right = right;\n this.bottom = bottom;\n this.left = left;\n }", "async boundingBox() {\n throw new Error('Not implemented');\n }", "async boundingBox() {\n throw new Error('Not implemented');\n }", "calculateBounds() {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n if (this.graphicsData.length) {\n var shape = null;\n var x = 0;\n var y = 0;\n var w = 0;\n var h = 0;\n for (var i = 0; i < this.graphicsData.length; i++) {\n var data = this.graphicsData[i];\n var type = data.type;\n var lineWidth = data.lineStyle ? data.lineStyle.width : 0;\n shape = data.shape;\n if (type === ShapeSettings_1.ShapeSettings.SHAPES.RECT || type === ShapeSettings_1.ShapeSettings.SHAPES.RREC) {\n x = shape.x - (lineWidth / 2);\n y = shape.y - (lineWidth / 2);\n w = shape.width + lineWidth;\n h = shape.height + lineWidth;\n minX = x < minX ? x : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y < minY ? y : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.CIRC) {\n x = shape.x;\n y = shape.y;\n w = shape.radius + (lineWidth / 2);\n h = shape.radius + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else if (type === ShapeSettings_1.ShapeSettings.SHAPES.ELIP) {\n x = shape.x;\n y = shape.y;\n w = shape.width + (lineWidth / 2);\n h = shape.height + (lineWidth / 2);\n minX = x - w < minX ? x - w : minX;\n maxX = x + w > maxX ? x + w : maxX;\n minY = y - h < minY ? y - h : minY;\n maxY = y + h > maxY ? y + h : maxY;\n }\n else {\n // POLY\n var points = shape.points;\n var x2 = 0;\n var y2 = 0;\n var dx = 0;\n var dy = 0;\n var rw = 0;\n var rh = 0;\n var cx = 0;\n var cy = 0;\n for (var j = 0; j + 2 < points.length; j += 2) {\n x = points[j];\n y = points[j + 1];\n x2 = points[j + 2];\n y2 = points[j + 3];\n dx = Math.abs(x2 - x);\n dy = Math.abs(y2 - y);\n h = lineWidth;\n w = Math.sqrt((dx * dx) + (dy * dy));\n if (w < 1e-9) {\n continue;\n }\n rw = ((h / w * dy) + dx) / 2;\n rh = ((h / w * dx) + dy) / 2;\n cx = (x2 + x) / 2;\n cy = (y2 + y) / 2;\n minX = cx - rw < minX ? cx - rw : minX;\n maxX = cx + rw > maxX ? cx + rw : maxX;\n minY = cy - rh < minY ? cy - rh : minY;\n maxY = cy + rh > maxY ? cy + rh : maxY;\n }\n }\n }\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var padding = this.boundsPadding;\n this._bounds.minX = minX - padding;\n this._bounds.maxX = maxX + padding;\n this._bounds.minY = minY - padding;\n this._bounds.maxY = maxY + padding;\n }", "get ipRange() {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }", "get ipRange() {\n if (this.ipRangeInner) {\n return {\n end: this.ipRangeInner.end,\n start: this.ipRangeInner.start,\n };\n }\n return undefined;\n }", "_calculateBounds() {\n // FILL IN//\n }", "function calculateBounds (geojson) {\n if(geojson.type){\n switch (geojson.type) {\n case 'Point':\n return [ geojson.coordinates[0], geojson.coordinates[1], geojson.coordinates[0], geojson.coordinates[1]];\n\n case 'MultiPoint':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'LineString':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'MultiLineString':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'Polygon':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'MultiPolygon':\n return calculateBoundsFromNestedArrayOfArrays(geojson.coordinates);\n\n case 'Feature':\n return geojson.geometry? calculateBounds(geojson.geometry) : null;\n\n case 'FeatureCollection':\n return calculateBoundsForFeatureCollection(geojson);\n\n case 'GeometryCollection':\n return calculateBoundsForGeometryCollection(geojson);\n\n default:\n throw new Error(\"Unknown type: \" + geojson.type);\n }\n }\n return null;\n }", "function calculateBounds (geojson) {\n if(geojson.type){\n switch (geojson.type) {\n case 'Point':\n return [ geojson.coordinates[0], geojson.coordinates[1], geojson.coordinates[0], geojson.coordinates[1]];\n\n case 'MultiPoint':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'LineString':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'MultiLineString':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'Polygon':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'MultiPolygon':\n return calculateBoundsFromNestedArrayOfArrays(geojson.coordinates);\n\n case 'Feature':\n return geojson.geometry? calculateBounds(geojson.geometry) : null;\n\n case 'FeatureCollection':\n return calculateBoundsForFeatureCollection(geojson);\n\n case 'GeometryCollection':\n return calculateBoundsForGeometryCollection(geojson);\n\n default:\n throw new Error(\"Unknown type: \" + geojson.type);\n }\n }\n return null;\n }", "function calculateBounds (geojson) {\n if(geojson.type){\n switch (geojson.type) {\n case 'Point':\n return [ geojson.coordinates[0], geojson.coordinates[1], geojson.coordinates[0], geojson.coordinates[1]];\n\n case 'MultiPoint':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'LineString':\n return calculateBoundsFromArray(geojson.coordinates);\n\n case 'MultiLineString':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'Polygon':\n return calculateBoundsFromNestedArrays(geojson.coordinates);\n\n case 'MultiPolygon':\n return calculateBoundsFromNestedArrayOfArrays(geojson.coordinates);\n\n case 'Feature':\n return geojson.geometry? calculateBounds(geojson.geometry) : null;\n\n case 'FeatureCollection':\n return calculateBoundsForFeatureCollection(geojson);\n\n case 'GeometryCollection':\n return calculateBoundsForGeometryCollection(geojson);\n\n default:\n throw new Error(\"Unknown type: \" + geojson.type);\n }\n }\n return null;\n }", "get boundingBox() { return GeoJsonUtils.getBoundingBox(this.item); }", "function getBoundingBox () {\n let boundingBox = map.getBounds()\n xmin = parseFloat(boundingBox._sw.lng)\n ymin = parseFloat(boundingBox._sw.lat)\n xmax = parseFloat(boundingBox._ne.lng)\n ymax = parseFloat(boundingBox._ne.lat)\n\n //console.log(`${xmin}, ${ymin}, ${xmax}, ${ymax}`)\n}", "getBoundingBox() {\n if (!this.preFormatted) {\n throw new Vex.RERR('UnformattedNote', \"Can't call getBoundingBox on an unformatted note.\");\n }\n\n const spacing = this.stave.getSpacingBetweenLines();\n const half_spacing = spacing / 2;\n const min_y = this.y - half_spacing;\n\n return new Flow.BoundingBox(this.getAbsoluteX(), min_y, this.width, spacing);\n }", "function getBounds(elem) {\n\t\tif (elem.find('.motion-path').length) {\n\t\t\telem.find('.motion-path').css({ 'display': 'none' })\n\t\t}\n\t\t\n\t\t//var bounds = elem.get(0).getBoundingClientRect();\n\t\tvar bounds = elem.get(0).getBBox();\n\t\t\n\t\tif (elem.find('.motion-path').length) {\n\t\t\telem.find('.motion-path').css({ 'display': '' })\n\t\t}\n\t\t\n\t\tif (elem.is('[data-width]')) {\n\t\t\tbounds.width = parseInt(elem.attr('data-width'));\n\t\t}\n\t\t\n\t\treturn bounds;\n\t}", "get size() {\n return this.ranges.length ? this.end - this.start : null;\n }", "function compute_bound(bbox) {\n var offset = 0.01;\n var southWest = new L.LatLng(bbox[0][0] - offset, bbox[0][1] - offset);\n var northEast = new L.LatLng(bbox[2][0] + offset, bbox[2][1] + offset);\n return new L.LatLngBounds(southWest, northEast);\n}", "getEdges() {\n return this.model.getEdges();\n }", "function getLayerBounds(lyr, arcs) {\n var bounds = null;\n if (lyr.geometry_type == 'point') {\n bounds = getPointBounds$1(lyr.shapes);\n } else if (lyr.geometry_type == 'polygon' || lyr.geometry_type == 'polyline') {\n bounds = getPathBounds(lyr.shapes, arcs);\n } else {\n // just return null if layer has no bounds\n // error(\"Layer is missing a valid geometry type\");\n }\n return bounds;\n }", "function extendsMapBounds() {\n var radius = distanceInMeter(map.getCenter(), map.getBounds().getNorthEast()),\n circle = new gm.Circle({\n center: map.getCenter(),\n radius: 1.25 * radius // + 25%\n });\n return circle.getBounds();\n }", "function extendsMapBounds() {\n var radius = distanceInMeter(map.getCenter(), map.getBounds().getNorthEast()),\n circle = new gm.Circle({\n center: map.getCenter(),\n radius: 1.25 * radius // + 25%\n });\n return circle.getBounds();\n }", "function extendsMapBounds() {\n var radius = distanceInMeter(map.getCenter(), map.getBounds().getNorthEast()),\n circle = new gm.Circle({\n center: map.getCenter(),\n radius: 1.25 * radius // + 25%\n });\n return circle.getBounds();\n }", "bbox() {\n var maxX = -Infinity;\n var maxY = -Infinity;\n var minX = Infinity;\n var minY = Infinity;\n this.forEach(function (el) {\n maxX = Math.max(el[0], maxX);\n maxY = Math.max(el[1], maxY);\n minX = Math.min(el[0], minX);\n minY = Math.min(el[1], minY);\n });\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n }", "getWebGLBoundingRect() {\n if(!this._matrices.modelViewProjection) {\n return this._boundingRect.document;\n }\n else if(!this._boundingRect.worldToDocument || this.alwaysDraw) {\n this._computeWebGLBoundingRect();\n }\n\n return this._boundingRect.worldToDocument;\n }", "getMapInnerBounds() {\n const mb = this.getMap()\n .getDiv()\n .getBoundingClientRect();\n\n let mib = {\n top: mb.top,\n right: mb.right,\n bottom: mb.bottom,\n left: mb.left\n };\n\n mib.width = mib.right - mib.left;\n mib.height = mib.bottom - mib.top;\n return mib;\n }", "function calculateBoundingBox() {\n return {\n top: -((strokeWidth + 1) / 2) + sourceRectYEntry,\n left: -(targetRect.left - (sourceRect.left + sourceRect.width)),\n width:\n (strokeWidth + 1) / 2 +\n (targetRect.left + targetRect.width / 2) -\n (sourceRect.left + sourceRect.width),\n height: (strokeWidth + 1) / 2 + Math.abs(sourceRectYEntry),\n };\n }", "function _getOutOfBoundsEdges(rect, boundingRect) {\n var outOfBounds = new Array();\n if (rect.top < boundingRect.top) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].top);\n }\n if (rect.bottom > boundingRect.bottom) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].bottom);\n }\n if (rect.left < boundingRect.left) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].left);\n }\n if (rect.right > boundingRect.right) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].right);\n }\n return outOfBounds;\n}", "function _getOutOfBoundsEdges(rect, boundingRect) {\n var outOfBounds = new Array();\n if (rect.top < boundingRect.top) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].top);\n }\n if (rect.bottom > boundingRect.bottom) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].bottom);\n }\n if (rect.left < boundingRect.left) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].left);\n }\n if (rect.right > boundingRect.right) {\n outOfBounds.push(_positioning_types__WEBPACK_IMPORTED_MODULE_3__[\"RectangleEdge\"].right);\n }\n return outOfBounds;\n}", "_getRange() {\n const that = this;\n\n if (that.logarithmicScale) {\n that._range = that._drawMax - that._drawMin;\n return;\n }\n\n if (that.scaleType === 'floatingPoint') {\n that._range = (that._drawMax - that._drawMin).toString();\n }\n else {\n that._range = new JQX.Utilities.BigNumber(that._drawMax).subtract(that._drawMin).toString();\n }\n }", "get rect() {\n\t\treturn this.rect$.slice(0, 4);\n\t}" ]
[ "0.81855094", "0.7830251", "0.76891845", "0.75247926", "0.742921", "0.7290647", "0.71162474", "0.70314974", "0.70314974", "0.7021087", "0.68655705", "0.67333686", "0.6725534", "0.6609773", "0.65945303", "0.65812236", "0.6570898", "0.6553765", "0.6548136", "0.64800644", "0.64695156", "0.6453327", "0.6445999", "0.6332814", "0.6317858", "0.62840235", "0.62282157", "0.62044275", "0.6176322", "0.61682343", "0.6158255", "0.6158255", "0.6158255", "0.6141944", "0.6108251", "0.6108251", "0.60641694", "0.60635877", "0.6061461", "0.60565954", "0.60370964", "0.60344434", "0.602859", "0.6008841", "0.5998324", "0.5981826", "0.59688556", "0.59540707", "0.59523517", "0.59502906", "0.5912345", "0.5912345", "0.5912345", "0.58762425", "0.58717203", "0.58717203", "0.58717203", "0.5865495", "0.5829669", "0.581712", "0.5787374", "0.5787374", "0.57830185", "0.5781655", "0.57519853", "0.57468724", "0.5741724", "0.57056934", "0.57017213", "0.5685358", "0.5665877", "0.56636745", "0.5660814", "0.5660814", "0.5637572", "0.5636461", "0.5636461", "0.56285495", "0.56208014", "0.56208014", "0.56208014", "0.561737", "0.56099284", "0.5588983", "0.5580834", "0.55690944", "0.5567078", "0.556448", "0.55521894", "0.554246", "0.554246", "0.554246", "0.55400896", "0.5527731", "0.55275387", "0.5515683", "0.55124533", "0.55124533", "0.5509416", "0.55056643" ]
0.7073846
7
Get two endpoints of this edge on the connected nodes
getConnectionPoints() { let startBound = this.startNode.getBounds() let endBound = this.endNode.getBounds() let startCenterX = (startBound.x + startBound.width) / 2 let startCenterY = (startBound.y + startBound.height) / 2 let endCenterX = (endBound.x + endBound.width) / 2 let endCenterY = (endBound.y + endBound.height) / 2 return [startNode.getConnectionPoint(endCenterX, endCenterY), endNode.getConnectionPoint(startCenterX, startCenterY)] }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function nextEdge(side1, side2) {\r\n return side1 + side2 - 1;\r\n}", "function nextEdge(side1, side2) {\n return side1 + side2 - 1;\n}", "function nextEdge(side1, side2) {\n return (side1+side2)-1;\n}", "endpoints() {\n if (isNaN(this.theta)) {\n console.log(\"NaN for \" + this.point);\n }\n\n if (this.pointDefines == \"start\") {\n throw new Error(\"UNIMPLEMENTED\");\n } else if (this.pointDefines == \"center\") {\n var r = this.length / 2;\n return [\n [this.point[0] + Math.cos(this.theta) * -r, this.point[1] + Math.sin(this.theta) * -r],\n [this.point[0] + Math.cos(this.theta) * r, this.point[1] + Math.sin(this.theta) * r]\n ];\n } else if (this.pointDefines == \"end\") {\n throw new Error(\"UNIMPLEMENTED\");\n } else {\n throw new Error(\"UNIMPLEMENTED\");\n }\n }", "function getWirePoints2(start, end) {\n\t\tpoints = [];\t\t\t\t\t\t// null the points array\n\t\tpoints.push(start.x, start.y);\t\t// push start.x, start.y\n\t\tpoints.push(start.x, end.y);\t\t// push start.x, end.y\n\t\tpoints.push(end.x, end.y);\t\t\t// push end.x, end.y\n\t\treturn points;\t\t\t\t\t\t// return the array\n\t}", "getEdge(node, port, node2, port2) {\n port = this.getPortName(port);\n port2 = this.getPortName(port2);\n for (let index = 0; index < this.edges.length; index++) {\n let edge = this.edges[index];\n if (!edge) { continue; }\n if (edge.from.node === node && edge.from.port === port) {\n if (edge.to.node === node2 && edge.to.port === port2) {\n return edge;\n }\n }\n }\n return null;\n }", "get endpoints() {\n return this.getListAttribute('endpoints');\n }", "getAdjacent() {\n return [\n new Coord([this.x + 1, this.y]), // RIGHT >\n new Coord([this.x - 1, this.y]), // LEFT >\n new Coord([this.x, this.y - 1]), // UP >\n new Coord([this.x, this.y + 1]), // DOWN >\n ];\n }", "function extractPathEdges(pathNodes){\r\n var pathEdges = [];\r\n\r\n pathNodes.forEach((pn, i) => {\r\n if (i < pathNodes.length - 1){\r\n pe = pn.outgoingEdges.find(x => x.endNode === pathNodes[i+1].id);\r\n pathEdges.push(pe);\r\n }\r\n });\r\n\r\n return pathEdges;\r\n}", "function getCoordinatesForEdge(v1,v2){\r\n\tvar output = [];\r\n\tvar shortestDist = Math.pow(10,10);\r\n\t$.each(v1.coordinates, function(index1, item1){\r\n\t\t$.each(v2.coordinates, function(index2, item2){\r\n\t\t\t\r\n\t\t\tvar dist = getDistance(item1,item2);\r\n\t\t\tif (dist < shortestDist){\r\n\t\t\t\tshortestDist = dist;\r\n\t\t\t\toutput[0] = {lat:item1.lat, lng:item1.lng};\r\n\t\t\t\toutput[2] = {lat:item2.lat, lng:item2.lng};\r\n\t\t\t}\r\n\t\t});\r\n\t});\r\n\toutput[1] = {lat:(output[0].lat+output[2].lat)/2, lng:(output[0].lng+output[2].lng)/2}; // Setting the center point on the edge to locate the popup.\r\n\treturn output;\r\n}", "static Edge(begin, end) {\n return new Edge({\n begin: begin,\n end: end\n });\n }", "function edgePathToPath(edges) {\n return edges.filter(isNotHidden).map(edgeToIPathSegment);\n}", "function getEdgeCostLocation(x1, y1, x2, y2) {\n var midx = (x1 + x2) / 2;\n var midy = (y1 + y2) / 2;\n var angle = Math.atan((x1 - x2) / (y2 - y1));\n var coords = {\n x: midx + 8 * Math.cos(angle),\n y: midy + 8 * Math.sin(angle)\n }\n return coords;\n}", "function getSimpleBendpoints(a, b, directions) {\n var xmid = round((b.x - a.x) / 2 + a.x), ymid = round((b.y - a.y) / 2 + a.y);\n // one point, right or left from a\n if (directions === 'h:v') {\n return [{ x: b.x, y: a.y }];\n }\n // one point, above or below a\n if (directions === 'v:h') {\n return [{ x: a.x, y: b.y }];\n }\n // vertical segment between a and b\n if (directions === 'h:h') {\n return [\n { x: xmid, y: a.y },\n { x: xmid, y: b.y }\n ];\n }\n // horizontal segment between a and b\n if (directions === 'v:v') {\n return [\n { x: a.x, y: ymid },\n { x: b.x, y: ymid }\n ];\n }\n throw new Error('invalid directions: can only handle varians of [hv]:[hv]');\n}", "getAllEdges() {\n let edges = [];\n\n for (let [from, edgeList] of this.outboundEdges) {\n for (let [type, toNodes] of edgeList) {\n for (let to of toNodes) {\n edges.push({\n from,\n to,\n type\n });\n }\n }\n }\n\n return edges;\n }", "function edge(a, b) {\n\t if (a.row > b.row) { var t = a; a = b; b = t; }\n\t return {\n\t x0: a.column,\n\t y0: a.row,\n\t x1: b.column,\n\t y1: b.row,\n\t dx: b.column - a.column,\n\t dy: b.row - a.row\n\t };\n\t}", "function edge(a, b) {\n\t if (a.row > b.row) { var t = a; a = b; b = t; }\n\t return {\n\t x0: a.column,\n\t y0: a.row,\n\t x1: b.column,\n\t y1: b.row,\n\t dx: b.column - a.column,\n\t dy: b.row - a.row\n\t };\n\t}", "function renderEndPointShapes(edge) {\n if(!edge){\n return;\n }\n\n var edge_pts = anchorPointUtilities.getAnchorsAsArray(edge);\n if(typeof edge_pts === 'undefined'){\n edge_pts = [];\n } \n var sourcePos = edge.sourceEndpoint();\n var targetPos = edge.targetEndpoint();\n\n // This function is called inside refreshDraws which is called\n // for updating Konva shapes on events, but sometimes these values\n // will be NaN and Konva will show warnings in console as a result\n // This is a check to eliminate those cases since if these values \n // are NaN nothing will be drawn anyway.\n if (!sourcePos.x || !targetPos.x) {\n return;\n }\n\n edge_pts.unshift(sourcePos.y);\n edge_pts.unshift(sourcePos.x);\n edge_pts.push(targetPos.x);\n edge_pts.push(targetPos.y); \n\n \n if(!edge_pts)\n return;\n\n var src = {\n x: edge_pts[0],\n y: edge_pts[1]\n }\n\n var target = {\n x: edge_pts[edge_pts.length-2],\n y: edge_pts[edge_pts.length-1]\n }\n\n var nextToSource = {\n x: edge_pts[2],\n y: edge_pts[3]\n }\n var nextToTarget = {\n x: edge_pts[edge_pts.length-4],\n y: edge_pts[edge_pts.length-3]\n }\n var length = getAnchorShapesLength(edge) * 0.65;\n \n renderEachEndPointShape(src, target, length,nextToSource,nextToTarget);\n \n }", "function edge(a, b) {\n if (a.row > b.row) { var t = a; a = b; b = t; }\n return {\n x0: a.column,\n y0: a.row,\n x1: b.column,\n y1: b.row,\n dx: b.column - a.column,\n dy: b.row - a.row\n };\n}", "drawEdge(edge, pt1, pt2) {\n // let fromNodeAct = this.getActivationAlpha(edge.source)\n // let toNodeAct = this.getActivationAlpha(edge.target);\n\n let gradient = this._ctx.createLinearGradient(pt1.x, pt1.y, pt2.x, pt2.y);\n gradient.addColorStop(0, this.getNodeColor(edge.source));\n gradient.addColorStop(1, this.getNodeColor(edge.target));\n\n //this._ctx.strokeStyle = REN.LINK_COLOR;\n this._ctx.strokeStyle = gradient;\n this._ctx.lineWidth = 1;\n this._ctx.beginPath();\n this._ctx.moveTo(pt1.x, pt1.y);\n this._ctx.lineTo(pt2.x, pt2.y);\n this._ctx.stroke();\n\n // draw arrow head \n var endRadians = Math.atan((pt2.y-pt1.y)/(pt2.x-pt1.x));\n endRadians+=( (pt2.x > pt1.x) ? 90 :- 90 ) * Math.PI / 180;\n this.drawArrowHead(pt2.x, pt2.y, endRadians);\n }", "function getSimpleBendpoints(a, b, directions) {\n\n var xmid = round$3((b.x - a.x) / 2 + a.x),\n ymid = round$3((b.y - a.y) / 2 + a.y);\n\n // one point, right or left from a\n if (directions === 'h:v') {\n return [ { x: b.x, y: a.y } ];\n }\n\n // one point, above or below a\n if (directions === 'v:h') {\n return [ { x: a.x, y: b.y } ];\n }\n\n // vertical segment between a and b\n if (directions === 'h:h') {\n return [\n { x: xmid, y: a.y },\n { x: xmid, y: b.y }\n ];\n }\n\n // horizontal segment between a and b\n if (directions === 'v:v') {\n return [\n { x: a.x, y: ymid },\n { x: b.x, y: ymid }\n ];\n }\n\n throw new Error('invalid directions: can only handle varians of [hv]:[hv]');\n}", "function neighboring(a, b) {\n //From https://stackoverflow.com/questions/8739072\n return edge_by_id[a.id + ',' + b.id] || edge_by_id[b.id + ',' + a.id];\n } //function neighboring", "function neighboring(a, b) {\n //From https://stackoverflow.com/questions/8739072\n return edge_by_id[a.id + ',' + b.id] || edge_by_id[b.id + ',' + a.id];\n } //function neighboring", "function getEndpoint(chainId) {\n return linkIsDetached(chainId) ? null : [nodeData.xx[chainId], nodeData.yy[chainId]];\n }", "function getWirePoints(start, end) {\n\t\tpoints = [];\t\t\t\t\t\t\t// null the points array\n\t\tpoints.push(start.x, start.y);\t\t\t// push start.x, start.y\n\t\tvar xMed = (points[0] + end.x) / 2;\t\t// comput the middle x\n\t\tpoints.push(xMed, start.y);\t\t\t\t// push middle.x, start.y\n\t\tpoints.push(xMed, end.y);\t\t\t\t// push middle.x, end.y\n\t\tpoints.push(end.x, end.y);\t\t\t\t// push end.x, end.y\n\t\treturn points;\t\t\t\t\t\t\t// return the array\n\t}", "function getadjacentpoints()\n\t{\n\t\tvar davoid = whereisthespace();\n\t\tvar y = davoid[0];\n\t\tvar x = y.split(\",\");\n\t\tvar xup = Number(x[0]) + 100;\n\t\tvar xdown = Number(x[0]) - 100;\n\t\tvar yup = Number(x[1]) + 100;\n\t\tvar ydown = Number(x[1]) - 100;\n\t\tvar adjpoints = [];\n\t\tif (xup < 301)\n\t\t{\n\t\t\tadjpoints.push(xup + \",\" + x[1]);\n\t\t}\n\t\tif (xdown > -1)\n\t\t{\n\t\t\tadjpoints.push(xdown + \",\" + x[1]);\n\t\t}\n\t\tif (yup < 301)\n\t\t{\n\t\t\tadjpoints.push(x[0] + \",\" + yup);\n\t\t}\n\t\tif (ydown > -1)\n\t\t{\n\t\t\tadjpoints.push(x[0] + \",\" + ydown);\n\t\t}\n\t\treturn adjpoints;\n\t}", "calculateRoute(startFeature, endFeature) {\n const getId = feature => {\n const payload = JSON.parse(feature.properties.althurayyaData)\n return payload.URI;\n }\n\n const start = getId(startFeature);\n const end = getId(endFeature);\n\n // Note that this returns the IDs of the *NODES* along the road, i.e.\n // we now need to look up the segments which connect these nodes\n const path = this._graph.findShortestPath(start, end);\n\n if (path) {\n // Sliding window across path, pairwise\n const segments = [];\n for (var i=1; i<path.length; i++) {\n segments.push(this.findSegment(path[i - 1], path[i]));\n }\n\n return segments;\n }\n }", "function getWaypoints(start, end){\r\n const waypoints = [];\r\n const dx = end.x - start.x;\r\n const dy = end.y - start.y;\r\n for(i = 0 ; i <= TICKS_PER_LINE; i++){\r\n const x = start.x + dx * i / TICKS_PER_LINE;\r\n const y = start.y + dy * i / TICKS_PER_LINE;\r\n waypoints.push({x: x, y: y});\r\n }\r\n return(waypoints);\r\n}", "edge_intersect(e1, e2){\n\t\treturn intersect(e1.x1,e1.y1,e1.x2,e1.y2,e2.x1,e1.y1,e2.x2,e2.y2);\n\t}", "function getneighbors(x,y) {\n let neighbors = [];\n //e\n neighbors.push((x + 1) + \",\" + y);\n //se\n neighbors.push((y%2 === 0 ? x + 1 : x) + \",\" + (y+1));\n //sw\n neighbors.push((y%2 !== 0 ? x - 1 : x) + \",\" + (y+1));\n //w\n neighbors.push((x - 1) + \",\" + y);\n //nw\n neighbors.push((y%2 !== 0 ? x - 1 : x) + \",\" + (y-1));\n //ne\n neighbors.push((y%2 === 0 ? x + 1 : x) + \",\" + (y-1));\n return neighbors;\n}", "calculateEndpoints(head = this.head, tail = this.tail) {\n const curve = new Curve(head, this.controlPt, tail);\n const incrementsArray = [0.001, 0.005, 0.01, 0.05];\n let increment = incrementsArray.pop();\n let t = 0;\n // let iterations = 0;\n while (increment && t < 0.5) {\n // iterations++;\n const pt = curve.bezier(t);\n if (this.tail.contains(pt)) {\n t += increment;\n } else {\n t -= increment;\n increment = incrementsArray.pop();\n t += increment || 0;\n }\n }\n // console.log('itertions: ' + iterations);\n this.endPt = curve.bezier(t);\n this.startPt = curve.bezier(1 - t);\n }", "function getEndpoint(start, end, max) {\n return (end<start+max && end>start) ? end : start+max;\n}", "isReachable(vertID1, vertID2, curr=null, path=[]) {\n if(curr == vertID1) {\n return [];\n }\n if(curr == vertID2) {\n path.push(curr);\n return path;\n }\n let result = [];\n curr = curr || vertID1;\n for(let edge of this.edgeList) {\n if(edge[0] == curr) {\n path.push(edge[0]);\n result.push(this.isReachable(vertID1, vertID2, edge[1], path));\n }\n }\n return result;\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + ',' + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a + ',' + b];\n }", "function neighboring(a, b) {\n\t return linkedByIndex[a.index + ',' + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + ',' + b.index];\n}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "function check_for_endpoints(){\n \t\tvar first_item = -1\n \t\t\t, end_item = -1;\n \t\tfor(var i=0; i<elements_array.length; i++){\n \t\t\tif(elements_array[i].type == 'START'){\n \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].connect_id == connections_array[x].source){\n \t\t\t\t\t\tfirst_item = connections_array[x].target; // 'START' item's target\n \t\t\t\t\t}\t\n \t\t\t\t}\n \t\t\t} else if(elements_array[i].type == 'END'){\n/* \t\t\t\tfor(var x=0; x<connections_array.length; x++){\n \t\t\t\t\tif(elements_array[i].id == connections_array[x].target){\n \t\t\t\t\t\tend_item = connections_array[x].source;\n \t\t\t\t\t}\t\n \t\t\t\t}*/\n \t\t\t\tend_item = elements_array[i].id; // 'END' item\n \t\t\t}\n \t\t}\n \t\treturn {first_id: first_item, end_id: end_item};\n \t}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n }", "next(e) { return this._edges.next(e); }", "function neighboring(a, b) {\n\t\t\t return linkedByIndex[a.index + \",\" + b.index];\n\t\t\t }", "function neighboring(a, b) {\n\t\t\t\t return linkedByIndex[a + \",\" + b];\n\t\t\t\t}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "function getInner(edges)\n{\n var edd=[];\n for(var i=0;i<edges.length;i++){edd.push(pointify(edges[i]))} //Fill edd with the point notation of the data from edges\n var arr = edd.sort((a,b)=>{return a[0]-b[0]}); //Sort to get the farthest left point\n var left = arr[0][0];\n var avg = (arr[1][1] + arr[2][1])/2; //Take the avg of nearby points to get the trend of height\n return [left+1,Math.round(avg)]; //return inner point as 1 pixel to the right of the leftist edge pixel and the height of the avg\n}", "function findEdgeToWayCrossCoords(n1, n2, way, graph) {\n var crossCoords = [];\n var nA, nB;\n var segment1 = [n1.loc, n2.loc];\n var segment2;\n\n var nodes = graph.childNodes(way);\n for (var j = 0; j < nodes.length - 1; j++) {\n nA = nodes[j];\n nB = nodes[j + 1];\n if (nA.id === n1.id || nA.id === n2.id ||\n nB.id === n1.id || nB.id === n2.id) {\n // n1 or n2 is a connection node; skip\n continue;\n }\n segment2 = [nA.loc, nB.loc];\n var point = geoLineIntersection(segment1, segment2);\n if (point) {\n crossCoords.push({ edge: [nA.id, nB.id], point: point });\n }\n }\n return crossCoords;\n }", "getOutgoingEdges(cell) {\n return this.model.getOutgoingEdges(cell);\n }", "function neighboring(a, b) {\n return linkedByIndex[a.index + \",\" + b.index];\n}", "function convertPath(start, end) {\n var arcIds = [],\n firstNodeId = -1,\n arcStartId;\n\n // Visit each point in the path, up to but not including the last point\n //\n for (var i = start; i < end; i++) {\n if (pointIsArcEndpoint(i)) {\n if (firstNodeId > -1) {\n arcIds.push(addEdge(arcStartId, i));\n } else {\n firstNodeId = i;\n }\n arcStartId = i;\n }\n }\n\n // Identify the final arc in the path\n //\n if (firstNodeId == -1) {\n // Not in an arc, i.e. no nodes have been found...\n // Assuming that path is either an island or is congruent with one or more rings\n arcIds.push(addRing(start, end));\n }\n else if (firstNodeId == start) {\n // path endpoint is a node;\n if (!pointIsArcEndpoint(end)) {\n error(\"Topology error\"); // TODO: better error handling\n }\n arcIds.push(addEdge(arcStartId, i));\n } else {\n // final arc wraps around\n arcIds.push(addEdge(arcStartId, end, start + 1, firstNodeId));\n }\n\n return arcIds;\n }", "drawEdges(){\n push();\n\n let x1 = this.getX();\n let y1 = this.getY();\n\n let neighborList = this.neighbors.iterator();\n\n strokeWeight(EDGE_WEIGHT);\n\n while(!neighborList.isEmpty()){\n let neighborVert = neighborList.currItem();\n\n let x2 = neighborVert.getX();\n let y2 = neighborVert.getY();\n\n //need to check if this or destination vertex is selected\n if(this.getSelected() || neighborVert.getSelected()){\n stroke(YELLOW);\n }\n else{\n stroke(0,0,0); //black\n }\n\n line(x1,y1,x2,y2);\n\n neighborList.next();\n }\n\n pop();\n }", "function findAdjacent(nodeName, vertices, edges) {\n \n}", "function Bendpoints(eventBus, canvas, interactionEvents, bendpointMove, connectionSegmentMove) {\n /**\n * Returns true if intersection point is inside middle region of segment, adjusted by\n * optional threshold\n */\n function isIntersectionMiddle(intersection, waypoints, treshold) {\n var idx = intersection.index,\n p = intersection.point,\n p0,\n p1,\n mid,\n aligned,\n xDelta,\n yDelta;\n\n if (idx <= 0 || intersection.bendpoint) {\n return false;\n }\n\n p0 = waypoints[idx - 1];\n p1 = waypoints[idx];\n mid = getMidPoint(p0, p1), aligned = pointsAligned(p0, p1);\n xDelta = Math.abs(p.x - mid.x);\n yDelta = Math.abs(p.y - mid.y);\n return aligned && xDelta <= treshold && yDelta <= treshold;\n }\n /**\n * Calculates the threshold from a connection's middle which fits the two-third-region\n */\n\n\n function calculateIntersectionThreshold(connection, intersection) {\n var waypoints = connection.waypoints,\n relevantSegment,\n alignment,\n segmentLength,\n threshold;\n\n if (intersection.index <= 0 || intersection.bendpoint) {\n return null;\n } // segment relative to connection intersection\n\n\n relevantSegment = {\n start: waypoints[intersection.index - 1],\n end: waypoints[intersection.index]\n };\n alignment = pointsAligned(relevantSegment.start, relevantSegment.end);\n\n if (!alignment) {\n return null;\n }\n\n if (alignment === 'h') {\n segmentLength = relevantSegment.end.x - relevantSegment.start.x;\n } else {\n segmentLength = relevantSegment.end.y - relevantSegment.start.y;\n } // calculate threshold relative to 2/3 of segment length\n\n\n threshold = calculateSegmentMoveRegion(segmentLength) / 2;\n return threshold;\n }\n\n function activateBendpointMove(event, connection) {\n var waypoints = connection.waypoints,\n intersection = getConnectionIntersection(canvas, waypoints, event),\n threshold;\n\n if (!intersection) {\n return;\n }\n\n threshold = calculateIntersectionThreshold(connection, intersection);\n\n if (isIntersectionMiddle(intersection, waypoints, threshold)) {\n connectionSegmentMove.start(event, connection, intersection.index);\n } else {\n bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);\n } // we've handled the event\n\n\n return true;\n }\n\n function bindInteractionEvents(node, eventName, element) {\n componentEvent.bind(node, eventName, function (event) {\n interactionEvents.triggerMouseEvent(eventName, event, element);\n event.stopPropagation();\n });\n }\n\n function getBendpointsContainer(element, create$1) {\n var layer = canvas.getLayer('overlays'),\n gfx = query('.djs-bendpoints[data-element-id=\"' + css_escape(element.id) + '\"]', layer);\n\n if (!gfx && create$1) {\n gfx = create('g');\n attr$1(gfx, {\n 'data-element-id': element.id\n });\n classes$1(gfx).add('djs-bendpoints');\n append(layer, gfx);\n bindInteractionEvents(gfx, 'mousedown', element);\n bindInteractionEvents(gfx, 'click', element);\n bindInteractionEvents(gfx, 'dblclick', element);\n }\n\n return gfx;\n }\n\n function getSegmentDragger(idx, parentGfx) {\n return query('.djs-segment-dragger[data-segment-idx=\"' + idx + '\"]', parentGfx);\n }\n\n function createBendpoints(gfx, connection) {\n connection.waypoints.forEach(function (p, idx) {\n var bendpoint = addBendpoint(gfx);\n append(gfx, bendpoint);\n translate(bendpoint, p.x, p.y);\n }); // add floating bendpoint\n\n addBendpoint(gfx, 'floating');\n }\n\n function createSegmentDraggers(gfx, connection) {\n var waypoints = connection.waypoints;\n var segmentStart, segmentEnd, segmentDraggerGfx;\n\n for (var i = 1; i < waypoints.length; i++) {\n segmentStart = waypoints[i - 1];\n segmentEnd = waypoints[i];\n\n if (pointsAligned(segmentStart, segmentEnd)) {\n segmentDraggerGfx = addSegmentDragger(gfx, segmentStart, segmentEnd);\n attr$1(segmentDraggerGfx, {\n 'data-segment-idx': i\n });\n bindInteractionEvents(segmentDraggerGfx, 'mousemove', connection);\n }\n }\n }\n\n function clearBendpoints(gfx) {\n forEach(all('.' + BENDPOINT_CLS, gfx), function (node) {\n remove$1(node);\n });\n }\n\n function clearSegmentDraggers(gfx) {\n forEach(all('.' + SEGMENT_DRAGGER_CLS, gfx), function (node) {\n remove$1(node);\n });\n }\n\n function addHandles(connection) {\n var gfx = getBendpointsContainer(connection);\n\n if (!gfx) {\n gfx = getBendpointsContainer(connection, true);\n createBendpoints(gfx, connection);\n createSegmentDraggers(gfx, connection);\n }\n\n return gfx;\n }\n\n function updateHandles(connection) {\n var gfx = getBendpointsContainer(connection);\n\n if (gfx) {\n clearSegmentDraggers(gfx);\n clearBendpoints(gfx);\n createSegmentDraggers(gfx, connection);\n createBendpoints(gfx, connection);\n }\n }\n\n function updateFloatingBendpointPosition(parentGfx, intersection) {\n var floating = query('.floating', parentGfx),\n point = intersection.point;\n\n if (!floating) {\n return;\n }\n\n translate(floating, point.x, point.y);\n }\n\n function updateSegmentDraggerPosition(parentGfx, intersection, waypoints) {\n var draggerGfx = getSegmentDragger(intersection.index, parentGfx),\n segmentStart = waypoints[intersection.index - 1],\n segmentEnd = waypoints[intersection.index],\n point = intersection.point,\n mid = getMidPoint(segmentStart, segmentEnd),\n alignment = pointsAligned(segmentStart, segmentEnd),\n draggerVisual,\n relativePosition;\n\n if (!draggerGfx) {\n return;\n }\n\n draggerVisual = getDraggerVisual(draggerGfx);\n relativePosition = {\n x: point.x - mid.x,\n y: point.y - mid.y\n };\n\n if (alignment === 'v') {\n // rotate position\n relativePosition = {\n x: relativePosition.y,\n y: relativePosition.x\n };\n }\n\n translate(draggerVisual, relativePosition.x, relativePosition.y);\n }\n\n eventBus.on('connection.changed', function (event) {\n updateHandles(event.element);\n });\n eventBus.on('connection.remove', function (event) {\n var gfx = getBendpointsContainer(event.element);\n\n if (gfx) {\n remove$1(gfx);\n }\n });\n eventBus.on('element.marker.update', function (event) {\n var element = event.element,\n bendpointsGfx;\n\n if (!element.waypoints) {\n return;\n }\n\n bendpointsGfx = addHandles(element);\n\n if (event.add) {\n classes$1(bendpointsGfx).add(event.marker);\n } else {\n classes$1(bendpointsGfx).remove(event.marker);\n }\n });\n eventBus.on('element.mousemove', function (event) {\n var element = event.element,\n waypoints = element.waypoints,\n bendpointsGfx,\n intersection;\n\n if (waypoints) {\n bendpointsGfx = getBendpointsContainer(element, true);\n intersection = getConnectionIntersection(canvas, waypoints, event.originalEvent);\n\n if (!intersection) {\n return;\n }\n\n updateFloatingBendpointPosition(bendpointsGfx, intersection);\n\n if (!intersection.bendpoint) {\n updateSegmentDraggerPosition(bendpointsGfx, intersection, waypoints);\n }\n }\n });\n eventBus.on('element.mousedown', function (event) {\n var originalEvent = event.originalEvent,\n element = event.element;\n\n if (!element.waypoints) {\n return;\n }\n\n return activateBendpointMove(originalEvent, element);\n });\n eventBus.on('selection.changed', function (event) {\n var newSelection = event.newSelection,\n primary = newSelection[0];\n\n if (primary && primary.waypoints) {\n addHandles(primary);\n }\n });\n eventBus.on('element.hover', function (event) {\n var element = event.element;\n\n if (element.waypoints) {\n addHandles(element);\n interactionEvents.registerEvent(event.gfx, 'mousemove', 'element.mousemove');\n }\n });\n eventBus.on('element.out', function (event) {\n interactionEvents.unregisterEvent(event.gfx, 'mousemove', 'element.mousemove');\n }); // update bendpoint container data attribute on element ID change\n\n eventBus.on('element.updateId', function (context) {\n var element = context.element,\n newId = context.newId;\n\n if (element.waypoints) {\n var bendpointContainer = getBendpointsContainer(element);\n\n if (bendpointContainer) {\n attr$1(bendpointContainer, {\n 'data-element-id': newId\n });\n }\n }\n }); // API\n\n this.addHandles = addHandles;\n this.updateHandles = updateHandles;\n this.getBendpointsContainer = getBendpointsContainer;\n this.getSegmentDragger = getSegmentDragger;\n }", "function makeEdge(num1, num2) {\n return {\n id: `${num1}_${num2}`,\n from: num1,\n to: num2,\n arrows: 'to',\n color: \"#cccccc\"\n }\n}", "edges(range) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n reverse = false\n } = options;\n var {\n anchor,\n focus\n } = range;\n return Range.isBackward(range) === reverse ? [anchor, focus] : [focus, anchor];\n }", "edges(range) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n reverse = false\n } = options;\n var {\n anchor,\n focus\n } = range;\n return Range.isBackward(range) === reverse ? [anchor, focus] : [focus, anchor];\n }", "function convertPath(start, end) {\n var arcIds = [],\n firstNodeId = -1,\n arcStartId;\n\n // Visit each point in the path, up to but not including the last point\n for (var i = start; i < end; i++) {\n if (pointIsArcEndpoint(i)) {\n if (firstNodeId > -1) {\n arcIds.push(addEdge(arcStartId, i));\n } else {\n firstNodeId = i;\n }\n arcStartId = i;\n }\n }\n\n // Identify the final arc in the path\n if (firstNodeId == -1) {\n // Not in an arc, i.e. no nodes have been found...\n // Assuming that path is either an island or is congruent with one or more rings\n arcIds.push(addRing(start, end));\n }\n else if (firstNodeId == start) {\n // path endpoint is a node;\n if (!pointIsArcEndpoint(end)) {\n error(\"Topology error\"); // TODO: better error handling\n }\n arcIds.push(addEdge(arcStartId, i));\n } else {\n // final arc wraps around\n arcIds.push(addSplitEdge(arcStartId, end, start + 1, firstNodeId));\n }\n return arcIds;\n }", "getEdges() {\n throw new Error(\"getEdges is Unimplemented\");\n return undefined;\n }", "getEdge(blob1, blob2) {\n const edge = this.edges.filter(function(edge) {\n return (edge.from === blob1 && edge.to === blob2) || (edge.from === blob2 && edge.to === blob1)\n })\n if (edge.length === 0) {\n return null\n }\n else {\n return edge[0]\n }\n }", "function addTwins(edges)\r\n{\r\n var twins = [];\r\n for (edge of edges){\r\n twins.push(edge);\r\n twins.push([edge[1], edge[0]]);\r\n }\r\n return twins;\r\n}", "function neighboring(a, b) {\n return linkedByIndex[`${a.index},${b.index}`];\n }", "getConnectionPoint(other){\n\t let centerX = this.x + this.size / 2\n let centerY = this.y + this.size / 2\n let dx = other.x - centerX\n let dy = other.y - centerY\n let distance = Math.sqrt(dx * dx + dy * dy)\n\t let newPoint = new Point()\n if (dx >= dy && dx >= -dy){\n\t\t newPoint.setPoint(this.x + this.size, centerY)\n\t\t return newPoint\n\t }\n if (dx < dy && dx >= -dy){\n\t\t newPoint.setPoint(centerX, this.y + this.size)\n\t\t return newPoint\n\t }\n if (dx >= dy && dx < -dy){\n\t\t newPoint.setPoint(centerX, this.y)\n\t\t return newPoint\n\t }\n\t newPoint.setPoint(this.x, centerY)\n\t return newPoint\n\t}", "function Bendpoints(eventBus, canvas, interactionEvents, bendpointMove, connectionSegmentMove) {\n\n function getConnectionIntersection(waypoints, event) {\n var localPosition = BendpointUtil.toCanvasCoordinates(canvas, event),\n intersection = getApproxIntersection(waypoints, localPosition);\n\n return intersection;\n }\n\n function isIntersectionMiddle(intersection, waypoints, treshold) {\n var idx = intersection.index,\n p = intersection.point,\n p0, p1, mid, aligned, xDelta, yDelta;\n\n if (idx <= 0 || intersection.bendpoint) {\n return false;\n }\n\n p0 = waypoints[idx - 1];\n p1 = waypoints[idx];\n mid = getMidPoint(p0, p1),\n aligned = pointsAligned(p0, p1);\n xDelta = Math.abs(p.x - mid.x);\n yDelta = Math.abs(p.y - mid.y);\n\n return aligned && xDelta <= treshold && yDelta <= treshold;\n }\n\n function activateBendpointMove(event, connection) {\n var waypoints = connection.waypoints,\n intersection = getConnectionIntersection(waypoints, event);\n\n if (!intersection) {\n return;\n }\n\n if (isIntersectionMiddle(intersection, waypoints, 10)) {\n connectionSegmentMove.start(event, connection, intersection.index);\n } else {\n bendpointMove.start(event, connection, intersection.index, !intersection.bendpoint);\n }\n }\n\n function getBendpointsContainer(element, create) {\n\n var layer = canvas.getLayer('overlays'),\n gfx = layer.select('.djs-bendpoints[data-element-id=' + element.id + ']');\n\n if (!gfx && create) {\n gfx = layer.group().addClass('djs-bendpoints').attr('data-element-id', element.id);\n\n domEvent.bind(gfx.node, 'mousedown', function(event) {\n activateBendpointMove(event, element);\n });\n }\n\n return gfx;\n }\n\n function createBendpoints(gfx, connection) {\n connection.waypoints.forEach(function(p, idx) {\n BendpointUtil.addBendpoint(gfx).translate(p.x, p.y);\n });\n\n // add floating bendpoint\n BendpointUtil.addBendpoint(gfx, 'floating');\n }\n\n function createSegmentDraggers(gfx, connection) {\n\n var waypoints = connection.waypoints;\n\n var segmentStart,\n segmentEnd;\n\n for (var i = 1; i < waypoints.length; i++) {\n\n segmentStart = waypoints[i - 1];\n segmentEnd = waypoints[i];\n\n if (pointsAligned(segmentStart, segmentEnd)) {\n BendpointUtil.addSegmentDragger(gfx, segmentStart, segmentEnd);\n }\n }\n }\n\n function clearBendpoints(gfx) {\n gfx.selectAll('.' + BENDPOINT_CLS).forEach(function(s) {\n s.remove();\n });\n }\n\n function clearSegmentDraggers(gfx) {\n gfx.selectAll('.' + SEGMENT_DRAGGER_CLS).forEach(function(s) {\n s.remove();\n });\n }\n\n function addHandles(connection) {\n\n var gfx = getBendpointsContainer(connection);\n\n if (!gfx) {\n gfx = getBendpointsContainer(connection, true);\n\n createBendpoints(gfx, connection);\n createSegmentDraggers(gfx, connection);\n }\n\n return gfx;\n }\n\n function updateHandles(connection) {\n\n var gfx = getBendpointsContainer(connection);\n\n if (gfx) {\n clearSegmentDraggers(gfx);\n clearBendpoints(gfx);\n createSegmentDraggers(gfx, connection);\n createBendpoints(gfx, connection);\n }\n }\n\n eventBus.on('connection.changed', function(event) {\n updateHandles(event.element);\n });\n\n eventBus.on('connection.remove', function(event) {\n var gfx = getBendpointsContainer(event.element);\n\n if (gfx) {\n gfx.remove();\n }\n });\n\n eventBus.on('element.marker.update', function(event) {\n\n var element = event.element,\n bendpointsGfx;\n\n if (!element.waypoints) {\n return;\n }\n\n bendpointsGfx = addHandles(element);\n bendpointsGfx[event.add ? 'addClass' : 'removeClass'](event.marker);\n });\n\n eventBus.on('element.mousemove', function(event) {\n\n var element = event.element,\n waypoints = element.waypoints,\n bendpointsGfx,\n floating,\n intersection;\n\n if (waypoints) {\n\n bendpointsGfx = getBendpointsContainer(element, true);\n floating = bendpointsGfx.select('.floating');\n\n if (!floating) {\n return;\n }\n\n intersection = getConnectionIntersection(waypoints, event.originalEvent);\n\n if (intersection) {\n floating.translate(intersection.point.x, intersection.point.y);\n }\n }\n });\n\n eventBus.on('element.mousedown', function(event) {\n\n var originalEvent = event.originalEvent,\n element = event.element,\n waypoints = element.waypoints;\n\n if (!waypoints) {\n return;\n }\n\n activateBendpointMove(originalEvent, element, waypoints);\n });\n\n eventBus.on('selection.changed', function(event) {\n var newSelection = event.newSelection,\n primary = newSelection[0];\n\n if (primary && primary.waypoints) {\n addHandles(primary);\n }\n });\n\n eventBus.on('element.hover', function(event) {\n var element = event.element;\n\n if (element.waypoints) {\n addHandles(element);\n interactionEvents.registerEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n }\n });\n\n eventBus.on('element.out', function(event) {\n interactionEvents.unregisterEvent(event.gfx.node, 'mousemove', 'element.mousemove');\n });\n}", "function process_edge(x, y){\n console.log(\"processed edge (\",x,\",\",y,\")\");\n}", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "addEdge(v1, v2) {\n v1.adjacent.add(v2);\n v2.adjacent.add(v1);\n }", "end(range) {\n var [, end] = Range.edges(range);\n return end;\n }", "end(range) {\n var [, end] = Range.edges(range);\n return end;\n }", "scanEdges(fromPosition, halfWidth, scanDirection) {\n let from1 = fromPosition.clone()\n from1.x -= halfWidth\n let from2 = fromPosition.clone()\n from2.x += halfWidth\n let interDown = this.getIntersections(from1, scanDirection.clone())\n let interDown2 = this.getIntersections(from2, scanDirection.clone())\n return interDown.concat(interDown2)\n }", "addEdge(from, to) {\n let edge = new Edge(from, to, this.options.directed);\n if (this.options.directed) {\n edge.root.setAttribute('marker-end', `url(#arrow)`);\n }\n this.root.prepend(edge.root);\n from.addEdge(edge);\n to.addEdge(edge);\n return edge;\n }", "getEdge(u) {\n let edges = [];\n this._edges.forEach((edge) => {\n if(edge[0] === u || edge[1] ===u) {\n const sortedEdge = edge[0] === u ? [edge[0], edge[1], edge[2]] : [edge[1], edge[0], edge[2]];\n edges.push(sortedEdge);\n }\n });\n\n return edges;\n }", "getConnectionPoint(other){\n\t let centerX = this.x + this.size / 2\n let centerY = this.y + this.size / 2\n let dx = other.x - centerX\n let dy = other.y - centerY\n let distance = Math.sqrt(dx * dx + dy * dy)\n\t let point = new Point()\n\t point.setPoint(other.x, other.y)\n if (distance === 0) return point\n else {\n\t\t let p = new Point()\n\t\t p.setPoint(centerX + dx * (this.size / 2) / distance, centerY + dy * (this.size / 2) / distance)\n\t\t return p\n\t }\n\t}", "function Connection2(startX, startY, stopX, stopY) {\n\n this.startX = startX;\n this.startY = startY;\n\tthis.stopX = stopX;\n\tthis.stopY = stopY;\n}", "function getEdgePerp(vectorA, vectorB) {\n let edge = Sub(vectorA, vectorB);\n let oldX = edge[0];\n edge[0] = edge[1];\n edge[1] = -oldX;\n return edge;\n}", "function addEdge(first,second){\n d.push(createEdge(first,second));\n}", "function GraphEdge(v1, v2, label, trav, via) {\n\n // v1 and v2 are the indices into the vertices array of\n // the edge's endpoints\n if (typeof v1 === 'string') {\n\tthis.v1 = parseInt(v1);\n\tthis.v2 = parseInt(v2);\n }\n else {\n\tthis.v1 = v1;\n\tthis.v2 = v2;\n }\n // edge label\n this.label = label;\n\n // traveler hex string\n this.travelerList = null;\n if (trav != null) {\n\t// parse the hex code into a list of travelers of this segment\n\tthis.travelerList = new Array();\n\t// the bits of the first hex character represent the travels\n\t// of the first 4 travelers (0-3), the next character represents\n\t// the travels of the next 4 travelers (4-7), etc.\n\tlet nextTrav = 0;\n\tfor (let pos = 0; pos < trav.length; pos++) {\n\t switch (trav[pos]) {\n\t case '1':\n\t\tthis.travelerList.push(nextTrav);\n\t\tbreak;\n\t case '2':\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tbreak;\n\t case '3':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tbreak;\n\t case '4':\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tbreak;\n\t case '5':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tbreak;\n\t case '6':\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tbreak;\n\t case '7':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tbreak;\n\t case '8':\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case '9':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'A':\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'B':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'C':\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'D':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'E':\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t case 'F':\n\t\tthis.travelerList.push(nextTrav);\n\t\tthis.travelerList.push(nextTrav+1);\n\t\tthis.travelerList.push(nextTrav+2);\n\t\tthis.travelerList.push(nextTrav+3);\n\t\tbreak;\n\t }\n\t nextTrav += 4;\n\t}\n }\n\n // array of shaping points (or null)\n this.via = via;\n\n return this;\n}", "function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if(ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n\n if(ptInt1) out.push(ptInt1);\n if(ptInt2) out.push(ptInt2);\n return out;\n }", "calculateEndpoints(slope) {\n const state = this.head;\n const p0 = state.ptAlongSlope(slope, -1 * state.radius / 2);\n const p1 = state.ptAlongSlope(slope, state.radius / 2);\n if (this.controlPt.y < state.y) {\n super.calculateEndpoints(p0, p1);\n } else {\n super.calculateEndpoints(p1, p0);\n }\n }", "function edges_indices(points) {\n if(points.length < 3) { console.error(\"need at least 3 points to triangulate\")\n\t\t\t return; }\n\n // project onto the 2D plane if required\n if(points[0].length == 3) points = project_plane(points)\n\n const center = compute_barycenter(points)\n const angles = points.map(p => Math.atan2(...v2_yx(v2_sub(p, center))))\n const indices = argsort(angles)\n\n // use along with gl.LINES\n let ret = []\n for(let i = 0; i < indices.length-1; ++i) {\n\tret = ret.concat(indices[i], indices[i+1])\n }\n ret = ret.concat(indices[indices.length-1], indices[0])\n return ret\n}", "function getHVEdgeIntersections(pt1, pt2) {\n var out = [];\n var ptInt1 = onlyConstrainedPoint(pt1);\n var ptInt2 = onlyConstrainedPoint(pt2);\n if (ptInt1 && ptInt2 && sameEdge(ptInt1, ptInt2)) return out;\n if (ptInt1) out.push(ptInt1);\n if (ptInt2) out.push(ptInt2);\n return out;\n }", "function endPoint(branch) {\r\n\tvar x = branch.x + branch.l * Math.sin(branch.a);\r\n\tvar y = branch.y - branch.l * Math.cos(branch.a);\r\n\treturn {x: x, y: y};\r\n}", "function generatePath(distance, startNode, endNode, graph){\n\n // Output path array.\n var output = [];\n\n var currentNode = endNode;\n\n // Add the end node to the start of the path.\n output.push(endNode);\n\n // Continue looping until we reach the current node.\n while (currentNode !== startNode){\n\n // Get vertex ID from the distance object.\n var vertexID = distance[currentNode].through;\n\n // Push the vertex ID to the array.\n output.push(vertexID);\n\n // Set the 'through' node as the new currentNode.\n currentNode = distance[currentNode].through;\n\n }\n\n // Return the array but reversed. (Since we employed a reverse iteration).\n return output.reverse();\n\n}", "function findPolylineEnds(ids, nodes, filter) {\n var ends = [];\n ids.forEach(function(arcId) {\n if (nodes.getConnectedArcs(arcId, filter).length === 0) {\n ends.push(~arcId); // arc points away from terminus\n }\n if (nodes.getConnectedArcs(~arcId, filter).length === 0) {\n ends.push(arcId);\n }\n });\n return ends;\n }", "function findEndpoints(contextId) {\n var answer = [];\n var contextFolder = Camel.getCamelContextFolder(workspace, contextId);\n if (contextFolder) {\n var endpoints = (contextFolder[\"children\"] || []).find(function (n) { return \"endpoints\" === n.title; });\n if (endpoints) {\n angular.forEach(endpoints.children, function (endpointFolder) {\n var entries = endpointFolder ? endpointFolder.entries : null;\n if (entries) {\n var endpointPath = entries[\"name\"];\n if (endpointPath) {\n var name = tidyJmxName(endpointPath);\n var link = Camel.linkToBrowseEndpointFullScreen(contextId, endpointPath);\n answer.push({\n contextId: contextId,\n path: endpointPath,\n name: name,\n tooltip: \"Endpoint\",\n link: link\n });\n }\n }\n });\n }\n }\n return answer;\n }", "edgeMultiply(other) {\n var from, k, to;\n for (to = k = 0; k <= 11; to = ++k) {\n from = other.ep[to];\n this.newEp[to] = this.ep[from];\n this.newEo[to] = (this.eo[from] + other.eo[to]) % 2;\n }\n [this.ep, this.newEp] = [this.newEp, this.ep];\n [this.eo, this.newEo] = [this.newEo, this.eo];\n return this;\n }" ]
[ "0.6389285", "0.63676345", "0.6340149", "0.62521285", "0.61468995", "0.60395706", "0.60263973", "0.6009545", "0.59150165", "0.5859681", "0.58456075", "0.57369953", "0.57300323", "0.5711641", "0.5696568", "0.5692356", "0.5692356", "0.5691076", "0.56648374", "0.56533456", "0.56285006", "0.5617657", "0.5617657", "0.5614053", "0.55904365", "0.5567537", "0.55305856", "0.5490207", "0.5488594", "0.5478044", "0.54704434", "0.5469141", "0.5464265", "0.5452201", "0.5443191", "0.5425675", "0.54174215", "0.54174215", "0.54174215", "0.54174215", "0.54165375", "0.54156244", "0.54156244", "0.5411994", "0.54108", "0.54085845", "0.54085845", "0.5407778", "0.5407425", "0.5404118", "0.5388963", "0.5382288", "0.53801095", "0.53801095", "0.53801095", "0.53801095", "0.5379621", "0.53716254", "0.53693134", "0.5367866", "0.53635925", "0.5362793", "0.53536844", "0.5349929", "0.5320104", "0.5318165", "0.5318165", "0.53024304", "0.52939546", "0.52915436", "0.529097", "0.5286161", "0.52860224", "0.52643746", "0.52536774", "0.5250511", "0.5250511", "0.5250511", "0.5250511", "0.5250511", "0.5250511", "0.5244433", "0.5244433", "0.5240052", "0.52345383", "0.5225422", "0.52238166", "0.5219984", "0.5210587", "0.52080137", "0.5185311", "0.51698637", "0.5159321", "0.515822", "0.5157392", "0.5151558", "0.51448727", "0.5135727", "0.5130724", "0.51280713" ]
0.6542258
0
Download offline will check the RESOURCES for all files not in the cache and populate them.
async function downloadOffline() { var resources = []; var contentCache = await caches.open(CACHE_NAME); var currentContent = {}; for (var request of await contentCache.keys()) { var key = request.url.substring(origin.length + 1); if (key == "") { key = "/"; } currentContent[key] = true; } for (var resourceKey in Object.keys(RESOURCES)) { if (!currentContent[resourceKey]) { resources.push(resourceKey); } } return contentCache.addAll(resources); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "downloadAds() {\n const adsString = JSON.stringify(this.ads);\n let adUrls = getUrls(adsString);\n adUrls = Array.from(adUrls)\n this.cacheAssets(adUrls);\n }", "function downloadAll() {\n\tAsync.eachLimit(\n\t\tdownloadList,\n\t\t4, // Lade bis zu 4 Dateien gleichzeitig\n\t\tfunction (file, callback) {\n\t\t\tvar overwrite = true;\n\t\t\tvar remoteFile = downloadPath+file.download.replace(/\\//g, '%2F');\n\t\t\tvar resultFile = resultPath+file.download;\n\n\t\t\t// Wenn die Datei schon existiert und neuer ist, als auf dem Server,\n\t\t\t// dann überschreibe die lokale Version nicht.\n\t\t\tif (FS.existsSync(resultFile)) {\n\t\t\t\tvar stat = FS.statSync(resultFile);\n\t\t\t\tif (file.time < stat.mtime) overwrite = false;\n\t\t\t}\n\n\t\t\tif (overwrite) {\n\t\t\t\tconsole.log('Downloading: '+file.download);\n\t\t\t\t\n\t\t\t\tensureFolder(resultFile);\n\n\t\t\t\tvar stream = Request(remoteFile);\n\t\t\t\tstream.pipe(FS.createWriteStream(resultFile))\n\t\t\t\tstream.on('end', callback);\n\t\t\t} else {\n\t\t\t\tsetTimeout(callback, 0);\n\t\t\t}\n\t\t},\n\t\tfunction (err) {\n\t\t\tif (err) console.error(err);\n\t\t\tconsole.log('Finished')\n\t\t}\n\t)\n}", "function precache() {\n return caches.open(restaurantsCache).then(function (cache) {\n return cache.addAll(cacheFiles);\n });\n}", "function updateStaticCache() {\n return caches.open(version)\n .then(function (cache) {\n return cache.addAll([\n offlineUrl,\n { routes }\n ]);\n });\n }", "async function preCache() {\n const cache = await caches.open(PRECACHE);\n await cache.addAll(urlsToCache);\n await self.skipWaiting();\n}", "function fetchResources(useCache, currentView) {\n // if useCache is not defined, default to true\n useCache = typeof useCache !== 'undefined' ? useCache : true;\n \n if (cache != undefined && useCache) {\n // get from cache\n return cache;\n } else {\n // do a fetch resource from source, rebuild cache\n cache = [];\n var len = sources.length;\n for (var i = 0; i < len; i++) {\n var resources = _fetchResourceSource(sources[i], currentView);\n cache = cache.concat(resources);\n }\n return cache;\n }\n }", "function updateStaticCache() {\n return caches.open(cacheName)\n .then( cache => { return cache.addAll(cacheFiles);});\n}", "function downloadAll(SubdirectoryPath, coverPath) {\n var SubdirectoryPath = SubdirectoryPath;\n var coverPath = coverPath;\n\n var fileTransfer = $cordovaFileTransfer.download(url, targetPath, {}, true);\n fileTransfer.then(function (result) {\n var progressTest = 0;\n\n var ZipPath = result.nativeURL;\n\n zip.unzip(ZipPath, SubdirectoryPath, function (res) {\n\n var dwnStatus = \"true\";\n\n var unzipSrc = SubdirectoryPath + 'index.html';\n //----------------------- Insert into Userassets for downloads in database =============\n\n // If magazine/book is updating\n if (isUpdating) {\n if (subtype == 'magazine') {\n var assetVal = 'Magazine';\n\n $rootScope.updateDataMags = angular.fromJson(localStorage.getItem('updateDataMags'));\n $rootScope.updateQueueMags = angular.fromJson(localStorage.getItem('updateQueueMags'));\n\n var index = $rootScope.updateDataMags.findIndex(function (item, i) {\n return item.asset_id === asset_id;\n });\n\n $rootScope.updateDataMags.splice(index, 1);\n $rootScope.updateQueueMags.splice($rootScope.updateQueueMags.indexOf(parseInt(asset_id)), 1);\n\n localStorage.setItem('updateQueueMags', angular.toJson($rootScope.updateQueueMags));\n localStorage.setItem('updateDataMags', angular.toJson($rootScope.updateDataMags));\n\n localStorage.setItem('updateProgressDivMags', false);\n } else {\n var assetVal = 'Book';\n\n $rootScope.updateDataBooks = angular.fromJson(localStorage.getItem('updateDataBooks'));\n $rootScope.updateQueueBooks = angular.fromJson(localStorage.getItem('updateQueueBooks'));\n\n var index = $rootScope.updateDataBooks.findIndex(function (item, i) {\n return item.asset_id === asset_id;\n });\n\n $rootScope.updateDataBooks.splice(index, 1);\n $rootScope.updateQueueBooks.splice($rootScope.updateQueueBooks.indexOf(parseInt(asset_id)), 1);\n\n localStorage.setItem('updateQueueBooks', angular.toJson($rootScope.updateQueueBooks));\n localStorage.setItem('updateDataBooks', angular.toJson($rootScope.updateDataBooks));\n\n localStorage.setItem('updateProgressDivBooks', false);\n }\n deleteOldEntry(usersUniqueID, subtype, assetTitle, oldData, unzipSrc, coverPath);\n }\n else {\n var asset_query = \"INSERT INTO userAssets (usersUniqueID, asset_id, sku, version, isPurchased, downloadStatus, downloadPath, coverPath, subtype) VALUES (?,?,?,?,?,?,?,?,?)\";\n $cordovaSQLite.execute(dbCon, asset_query, [usersUniqueID, asset_id, sku, version_no, \"true\", dwnStatus, unzipSrc, coverPath, subtype])\n .then(function (res) {\n // If magazine/book is not updating or downloading.\n $rootScope.pendingDownloads--;\n //-------------DOWNLOADING THE THUMBNAIL FOR MAGAZINE START------------------\n var newPath = SubdirectoryPath;\n if (subtype == 'magazine') {\n var assetVal = 'Magazine';\n\n $rootScope.downloadDataMags = angular.fromJson(localStorage.getItem('downloadDataMags'));\n $rootScope.downloadQueueMags = angular.fromJson(localStorage.getItem('downloadQueueMags'));\n\n var index = $rootScope.downloadDataMags.findIndex(function (item, i) {\n return item.asset_id === asset_id;\n });\n\n $rootScope.downloadDataMags.splice(index, 1);\n $rootScope.downloadQueueMags.splice($rootScope.downloadQueueMags.indexOf(parseInt(asset_id)), 1);\n\n localStorage.setItem('downloadQueueMags', angular.toJson($rootScope.downloadQueueMags));\n localStorage.setItem('downloadDataMags', angular.toJson($rootScope.downloadDataMags));\n } else {\n var assetVal = 'Book';\n\n $rootScope.downloadDataBooks = angular.fromJson(localStorage.getItem('downloadDataBooks'));\n $rootScope.downloadQueueBooks = angular.fromJson(localStorage.getItem('downloadQueueBooks'));\n\n var index = $rootScope.downloadDataBooks.findIndex(function (item, i) {\n return item.asset_id === asset_id;\n });\n\n $rootScope.downloadDataBooks.splice(index, 1);\n $rootScope.downloadQueueBooks.splice($rootScope.downloadQueueBooks.indexOf(parseInt(asset_id)), 1);\n\n localStorage.setItem('downloadQueueBooks', angular.toJson($rootScope.downloadQueueBooks));\n localStorage.setItem('downloadDataBooks', angular.toJson($rootScope.downloadDataBooks));\n }\n var currState = $state;\n var currentState = $state.current.name;\n\n var alertPopup = $ionicPopup.alert({\n title: ' <i class=\"icon ion-checkmark placeholder-icon\"></i>',\n template: assetVal + ' - \"' + assetTitle + '\" is successfully downloaded.',\n buttons: [{\n text: '<b>OK</b>',\n type: 'button-green',\n }]\n });\n alertPopup.then(function (res) {\n\n });\n\n setTimeout(function () {\n alertPopup.close();\n }, 5000);\n\n if ($rootScope.pendingDownloads == 0) {\n localStorage.setItem(\"showProgress\", 'false');\n }\n\n if (!isUpdating) {\n if ($location.path() == '/downloads') {\n $state.reload();\n }\n\n if (subtype == 'magazine') {\n $rootScope.no_of_magazine_updated = 1;\n localStorage.setItem('progressDivMags', false);\n $location.path('/downloads');\n } else if (subtype == 'book') {\n $rootScope.no_of_book_updated = 1;\n localStorage.setItem('progressDivBooks', false);\n $location.path('/downloads');\n }\n }\n\n //-------------DOWNLOADING THE THUMBNAIL FOR MAGAZINE END------------------\n\n }, function (err) {\n if (isUpdating) {\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_' + sku).then(function (result) {\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_cover_' + sku).then(function (res) { }, function (err) { });\n }, function (error) {\n\n });\n } else {\n handleErrorInDownload(subtype);\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_' + sku).then(function (result) {\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_cover_' + sku).then(function (res) { }, function (err) { });\n }, function (error) {\n\n });\n }\n });\n }\n });\n //----------------------- Updating Status of downloads in database ends=============\n\n\n }, function (error) // error while downloading--------------------\n {\n if (!isUpdating) {\n handleErrorInDownload(subtype);\n }\n\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_' + sku).then(function (result) {\n\n $cordovaFile.removeRecursively(cordova.file.dataDirectory + 'myDownloads/', subtype + '_cover_' + sku).then(function (res) {\n $rootScope.no_of_magazine_updated = 0;\n $rootScope.no_of_book_updated = 0;\n }, function (err) { });\n\n }, function (error) {\n\n });\n return;\n },\n function (progress) {\n fileTransfer = null;\n //--------------------- SHOWING DOWNLOAD PROGRESS TEST ENDS\n });\n\n\n }", "async function downloadFilesPatch(){\n for (let index = 0; index < patchFilesDownload.length; index++) {\n await downloadFile(patchFilesDownload[index]).then((result) => {\n unzipFile(result, path.join(directory.toString(), patchFilesDestination[index])).then(() => {\n store.set('patch', lastPatchToApply);\n }).catch(() => {\n store.set('patch', patchbefore);\n });\n });\n }\n}", "async function prepareCache() {\n const c = await caches.open(CACHE);\n await c.addAll(CACHEABLE);\n console.log('Cache prepared.');\n}", "function precache() {\n return caches.open(CACHE).then(cache => cache.addAll(CACHE_FILES));\n}", "function refreshTargetPackage(pkg, refreshDir){\n let pkg_url = 'https://'+ cdn_base_address + '/api/packages/';\n let package_url = {};\n package_url.url = pkg_url + pkg.name + '/';//replacePackage_url(pkg, cdn_base_address);\n package_url.type = TYPE_FILE;\n refresh_cache.push(package_url);\n\n let package_file = {};\n package_file.url = pkg_url + pkg.name;//pkg.latest.package_url.replace('pub.dartlang.org', cdn_base_address);\n package_file.type = TYPE_FILE;\n refresh_cache.push(package_file);\n\n let doc_url = 'https://'+ cdn_base_address + '/api/documentation/'\n let document_url = {};\n document_url.url = doc_url + pkg.name;//getDocument_url(pkg, cdn_base_address);\n document_url.type = TYPE_FILE;\n refresh_cache.push(document_url);\n\n //check publisher resource\n let options= {\n url: flutter_base_url + pkg.name + '/publisher',\n gzip: true,\n headers: {\n 'User-Agent' : 'pub.flutter-io.cn'\n }\n };\n // request.get(options, (err, response, body) => {\n // try {\n // let j = JSON.parse(body);\n // if (j.publisherId != null) {\n // let publisher_url = {};\n // publisher_url.url = cdn_publisher_resource_address + j.publisherId + '/packages';\n // publisher_url.type = TYPE_FILE;\n // // refresh_cache.push(publisher_url);\n // }\n // } catch (e) {\n // console.error(currentTimestamp() + 'failed to parse JSON, response-->' + res);\n // }\n // });\n\n //add browser resources\n let browser_package = {};\n browser_package.url = cdn_browser_resource_address + pkg.name;\n browser_package.type = TYPE_FILE;\n // refresh_cache.push(browser_package);\n refresh_cache_chuangcache_file.push(browser_package);\n\n let browser_package2 = {};\n browser_package2.url = cdn_browser_resource_address + pkg.name + '/';\n browser_package2.type = TYPE_FILE;\n // refresh_cache.push(browser_package2);\n refresh_cache_chuangcache_file.push(browser_package2);\n\n let browser_package_versions = {};\n browser_package_versions.url = cdn_browser_resource_address + pkg.name + '/versions';\n browser_package_versions.type = TYPE_FILE;\n // refresh_cache.push(browser_package_versions);\n refresh_cache_chuangcache_file.push(browser_package_versions);\n\n if (refresh_directory && refreshDir) {\n let browser_document = {};\n browser_document.url = cdn_browser_document_address + pkg.name + '/latest/';\n browser_document.type = TYPE_DIRECTORY;\n // refresh_cache.push(browser_document);\n refresh_cache_chuangcache_dir.push(browser_document);\n\n browser_document = {};\n browser_document.url = cdn_browser_document_address + pkg.name + '/p_limit/';\n browser_document.type = TYPE_DIRECTORY;\n // refresh_cache.push(browser_document);\n refresh_cache_chuangcache_dir.push(browser_document);\n }\n}", "fetch () {\n this._makeRequest('GET', resources);\n }", "function preloadUrls() {\n\tgetUrls()\n\n\t// If the queue is empty, bail\n\tif ( queue.length === 0 ) {\n\t\treturn\n\t}\n\n\t// grab the next 10 URLs and get the paths\n\tconst requestUrls = queue.slice( 0, 10 )\n\n\t// hack off the 10 items just placed in requestUrls.\n\tqueue = queue.slice( 10 )\n\n\t// fetch the data\n\tnew Promise( async ( res, rej ) => {\n\t\tconst data = await fetch( {\n\t\t\tpath: `/nicholas/v1/page-info?paths=${requestUrls.map( url => url.pathname )}`,\n\t\t} )\n\n\t\t// Loop through each dataset and set the cache from the request URL\n\t\tdata.forEach( ( datum, key ) => {\n\t\t\tsetTimeout( () => {\n\t\t\t\trequestUrls[key].updateCache( datum )\n\t\t\t}, 100 * key )\n\t\t} )\n\t} )\n}", "async prepareCache() {\n if(this.options.file.linkCache) {\n this.cacheFile = await this.addService('file', new this.CacheFileTransport(this.options.file.linkCache));\n }\n }", "function installStaticFiles() {\n\n\t//Open cache with cache name\n\treturn caches.open(CACHE).then(cache => {\n\t\t//Cache desirable files\n\t\tcache.addAll(installFilesDesirable);\n\n\t\t//Cache essential files\n\t\treturn cache.addAll(installFilesEssential);\n\t});\n}", "function cache() {\n // TODO: Cache to Redis if on server\n if (!client) {\n return;\n }clearTimeout(pending);\n var count = resources.length;\n pending = setTimeout(function () {\n if (count == resources.length) {\n log(\"cached\");\n var cachable = values(resources).filter(not(header(\"cache-control\", \"no-store\")));\n localStorage.ripple = freeze(objectify(cachable));\n }\n }, 2000);\n }", "async function download() {\n console.log(\"Downloading Files\");\n // initialises files data structure\n let files = [];\n // Sets the first file to look at\n let date = new Date('2020-01-22');\n date.setHours(6, 0, 0, 0)\n\n // Calculates millisecond date for today to compare against other dates\n let yesterday = new Date();\n yesterday.setDate(yesterday.getDate() - 1);\n\n // For testing purposes downloads and processes only two first files\n if (testing) yesterday = new Date('2020-01-24');\n\n // Runs though all the files until yesterday's file is reached\n while (date.valueOf() < yesterday.valueOf()) {\n // Returns the download date formatted as used in the url for files\n const downloadDate = dateObjToDownloadDate(date);\n const storageDate = dateObjToStorageDate(date);\n const filePath = source + '/' + downloadDate + '.csv';\n\n // Downloads the file content\n const fileData = await requestFile(filePath);\n if (typeof fileData !== 'undefined') {\n if (verbose) console.log(`File Downloaded: ${downloadDate}.csv`);\n // Pushes content and path to data structure\n files.push([downloadDate, fileData]);\n }\n // Increments to next day\n date.setDate(date.getDate() + 1);\n }\n\n // returns resulting file data structure\n return files;\n}", "function FileCache(options) {\n var self = this;\n // cordova-promise-fs\n this._fs = options.fs;\n if (!this._fs) {\n throw new Error('Missing required option \"fs\". Add an instance of cordova-promise-fs.');\n }\n // Use Promises from fs.\n Promise = this._fs.Promise;\n\n // 'mirror' mirrors files structure from \"serverRoot\" to \"localRoot\"\n // 'hash' creates a 1-deep filestructure, where the filenames are hashed server urls (with extension)\n this._mirrorMode = options.mode !== 'hash';\n this._retry = options.retry || [500, 1500, 8000];\n this._cacheBuster = !!options.cacheBuster;\n\n // normalize path\n this.localRoot = this._fs.normalize(options.localRoot || 'data');\n this.serverRoot = this._fs.normalize(options.serverRoot || '');\n\n // set internal variables\n this._downloading = []; // download promises\n this._added = []; // added files\n this._cached = {}; // cached files\n\n // list existing cache contents\n this.ready = this._fs.ensure(this.localRoot).then(function (entry) {\n self.localInternalURL = entry.toInternalURL ? entry.toInternalURL() : entry.toURL();\n self.localUrl = entry.toURL();\n return self.list();\n });\n }", "function initDownload(){\n\tvar initUrl = URLUtil.getFeedUrl();\n\tconsole.log(initUrl)\n\tdownloadAllFeeds([initUrl]);\t\n}", "function _downloadUrls (components, urls, opts, callback) {\n if (components && !Array.isArray(components)) {\n components = [components];\n }\n\n if (typeof urls === 'object') {\n urls = _.map(urls, function (v, k) {\n return (!components || components && !Array.isArray(components) || components && Array.isArray(components) && components.indexOf(k) !== -1) ? v : null;\n });\n urls = _.uniq(urls);\n }\n\n var destinationDir = opts.destination;\n var cacheDir = LOCAL_CACHE_DIR;\n\n function _extractZipToDestination (filename, cb) {\n var oldpath = LOCAL_CACHE_DIR + '/' + filename;\n extractZip(oldpath, { dir: destinationDir, defaultFileMode: parseInt('744', 8) }, cb);\n }\n\n var results = [];\n\n async.each(urls, function (url, cb) {\n if (!url) {\n return cb();\n }\n var filename = url.split('/').pop();\n var runningTotal = 0;\n var totalFilesize;\n\n if (typeof opts.tickerFn === 'function') {\n opts.tickerInterval = parseInt(opts.tickerInterval, 10);\n var tickerInterval = (typeof opts.tickerInterval !== NaN) ? opts.tickerInterval : 1000;\n var tickData = { filename: filename, progress: 0 };\n\n // Schedule next ticks\n var interval = setInterval(function () {\n if (totalFilesize && runningTotal == totalFilesize) {\n return clearInterval(interval);\n }\n tickData.progress = runningTotal;\n\n opts.tickerFn(tickData);\n }, tickerInterval);\n }\n\n // Check if file already downloaded in target directory\n try {\n fse.accessSync(destinationDir + '/' + filename);\n results.push({\n filename: filename,\n path: destinationDir,\n status: 'File exists',\n code: 'FILE_EXISTS'\n });\n clearInterval(interval);\n return cb();\n } catch (e) {\n // Check if the file is already cached\n try {\n fse.accessSync(LOCAL_CACHE_DIR + '/' + filename);\n results.push({\n filename: filename,\n path: destinationDir,\n status: 'File extracted to destination (archive found in cache)',\n code: 'DONE_FROM_CACHE'\n });\n clearInterval(interval);\n return _extractZipToDestination(filename, cb);\n } catch (e) {\n // Download the file and write in cache\n if (opts.quiet) clearInterval(interval);\n\n var cacheFileTempName = LOCAL_CACHE_DIR + '/' + filename + '.part';\n var cacheFileFinalName = LOCAL_CACHE_DIR + '/' + filename;\n\n request({url: url}, function (err, response, body) {\n totalFilesize = response.headers['content-length'];\n results.push({\n filename: filename,\n path: destinationDir,\n size: Math.floor(totalFilesize/1024/1024*1000)/1000 + 'MB',\n status: 'File extracted to destination (downloaded from \"' + url + '\")',\n code: 'DONE_CLEAN'\n });\n\n fse.renameSync(cacheFileTempName, cacheFileFinalName);\n _extractZipToDestination(filename, cb);\n })\n .on('data', function (data) {\n runningTotal += data.length;\n })\n .pipe(fse.createWriteStream(cacheFileTempName));\n }\n\n }\n\n }, function () {\n return callback(null, results);\n });\n\n}", "function updateStaticCache() {\n return caches.open(version + staticCacheName)\n .then(function(cache) {\n return cache.addAll([]);\n });\n }", "function fetchCoreFile(url) {\n return caches.open(swConfig.genCache)\n .then(cache => cache.match(url))\n .then(response => response ? response : Promise.reject());\n}", "load() {\n this._cache = {}\n return new Promise((resolve, reject) => {\n this._store.exists(this.filename, (err, exists) => {\n if (err || !exists) {\n return resolve()\n }\n\n this._lock(this.filename, (release) => {\n pull(\n this._store.read(this.filename),\n pull.collect(release((err, res) => {\n if (err) {\n return reject(err)\n }\n\n try {\n this._cache = JSON.parse(Buffer.concat(res).toString() || '{}')\n } catch(e) {\n return reject(e)\n }\n\n resolve()\n }))\n )\n })\n })\n })\n }", "function getCacheContents() {\n // Get every cache by name.\n return caches.keys()\n\n // Open each one.\n .then(cacheNames => Promise.all(cacheNames.map(cacheName => caches.open(cacheName))))\n\n .then(caches => {\n const requests = [];\n\n // Take each cache and get any requests is contains, and bounce each one down to its URL.\n return Promise.all(caches.map(cache => {\n return cache.keys()\n .then(reqs => {\n requests.push(...reqs.map(r => r.url));\n });\n })).then(_ => {\n return requests;\n });\n });\n}", "async cacheAll() {\n\t\tlet autoDirList = this.autoDirList;\n\n\t\tfor(let j=0, ln=autoDirList.length; j<ln; j++) {\n\t\t\tlet autoDir = autoDirList[j];\n\t\t\tlet modulePathList = await handyfs.readdirAsync(autoDir);\n\t\t\tlet moduleList = this.moduleList;\n\n\t\t\tfor(let i=0, ln=modulePathList.length; i<ln; i++) {\n\n\t\t\t\tlet mpath = path.resolve(path.join(autoDir, modulePathList[i]));\n\t\t\t\tlet type, moduleName;\n\t\t\t\t// is dir or file\n\t\t\t\tif(await handyfs.isdir(mpath)) {\n\t\t\t\t\ttype = '';\n\t\t\t\t\tmoduleName = path.basename(mpath);\n\t\t\t\t} else {\n\t\t\t\t\ttype = path.extname(mpath).slice(1);\n\t\t\t\t\tmoduleName = path.basename(mpath).slice(0, -(type.length+1));\n\t\t\t\t}\n\n\t\t\t\tmoduleList.set(moduleName, {\n\t\t\t\t\tmodule: null,\n\t\t\t\t\tpath: mpath,\n\t\t\t\t\ttype: type\n\t\t\t\t});\n\n\t\t\t}\n\t\t}\n\t}", "function getCache(){\n \n /** need to complete\n $.ajax({\n type: 'GET',\n url: rrotURL,\n dataType: \"json\",\n success: cacheToMap\n });\n */\n}", "async __downloadItems(event) {\n\n\t \thijackEvent(event);\n\n\t \ttry {\n\n\t await this.__showSpinner('Preparing downloads.');\n\n\t const {items} = event.detail;\n\n\t \tconst urls = items.map(({original, _tempUrl}) => \n\t \t\t\t\t\t\t\t \t original ? original : _tempUrl);\n\n\t \t// Will NOT download multiple files in Chrome when dev tools is open!!\n\t\t\t\tconst {default: multiDownload} = await import(\n\t\t\t\t\t/* webpackChunkName: 'multi-download' */ \n\t\t\t\t\t'multi-download'\n\t\t\t\t);\n\n\t // Show the spinner for at least 1sec, \n\t // but longer if downloading several files.\n\t await Promise.all([multiDownload(urls), wait(1000)]);\n\t }\n\t catch (error) {\n\t console.error(error);\n\t await warn('An error occured while trying to download your files.');\n\t }\n\t finally {\n\t this.__hideSpinner();\n\t }\t \n\t }", "async function cacheData() {\n try { \n const cache = await caches.open(CACHE_NAME);\n fetch(URL_API)\n .then(response => {\n if (!response) {\n throw Error('Could not retrieve data...');\n }\n return cache.put(URL_API, response);\n })\n } catch (error) {\n console.log('Failed to install cache', error);\n }\n}", "async loadCache() {\n const { latest, refreshCache, isOutdated, lastUpdate } = this\n\n if (!lastUpdate || isOutdated()) {\n await refreshCache()\n }\n\n return latest\n }", "_fetchManifest() {\n if (this.debug) {\n this.CACHE = {}\n return\n }\n\n const manifest_path = this.getManifestPath()\n\n process.on('SIGINT', this._deleteManifest)\n process.on('beforeExit', this._deleteManifest)\n\n if (fs.existsSync(manifest_path)) {\n try {\n this.CACHE = JSON.parse( fs.readFileSync(manifest_path).toString('utf8') ).ASSETS\n } catch(e) {\n this.CACHE = {}\n this._updateManifest()\n }\n } else {\n this.CACHE = {}\n this._updateManifest()\n }\n }", "function fetchFilesList(dir) {\n const now = new Date().toISOString()\n console.log(`${now} Caching file list`)\n const files = fs.readdirSync(dir)\n Array.prototype.push.apply(fileList, files)\n}", "lookupAvailableResources() {\n const done = this.async();\n const path = this.destinationPath('resources/api');\n _fsUtils.getSubDirectoryPaths(path).then((dirList) => {\n const pathRegex = new RegExp(`${path}/?`);\n this.availableResources = dirList.map((item) => {\n return item.replace(/^[a-zA-Z]*:/,'') // Handle windows drive letter\n .replace(/\\\\/g, '/') // Handle windows path separator\n .replace(pathRegex, '/');\n });\n done();\n }).catch((ex) => {\n this.env.error('Error listing existing API resources');\n done(ex);\n });\n }", "async getRecapRundownData(dateString) {\n try {\n this.debuglog('getRecapRundownData for ' + dateString)\n\n let cache_data\n let cache_name = 'recaprundown' + dateString\n let cache_file = path.join(this.CACHE_DIRECTORY, cache_name + '.json')\n let currentDate = new Date()\n if ( !fs.existsSync(cache_file) || !this.cache || !this.cache.recapRundown || !this.cache.recapRundown[dateString] || !this.cache.recapRundown[dateString].recapRundownCacheExpiry || (currentDate > new Date(this.cache.recapRundown[dateString].recapRundownCacheExpiry)) ) {\n let reqObj = {\n url: 'https://dapi.mlbinfra.com/v2/content/en-us/videos/mlb-tv-recap-rundown-' + dateString,\n headers: {\n 'Authorization': 'Bearer ' + await this.getLoginToken() || this.halt('missing loginToken'),\n 'User-Agent': USER_AGENT,\n 'Origin': 'https://www.mlb.com',\n 'Referer': 'https://www.mlb.com',\n 'Content-Type': 'application/json',\n 'Accept-Encoding': 'gzip, deflate, br'\n },\n gzip: true\n }\n var response = await this.httpGet(reqObj, false)\n if ( response && this.isValidJson(response) ) {\n this.debuglog(response)\n cache_data = JSON.parse(response)\n this.save_json_cache_file(cache_name, cache_data)\n\n // Default cache period is 5 minutes from now\n let fiveMinutesFromNow = new Date()\n fiveMinutesFromNow.setMinutes(fiveMinutesFromNow.getMinutes()+5)\n let cacheExpiry = fiveMinutesFromNow\n\n // finally save the setting\n this.setRecapRundownCacheExpiry(dateString, cacheExpiry)\n this.save_cache_data()\n } else {\n this.log('error : invalid json from url ' + reqObj.url)\n return\n }\n } else {\n this.debuglog('using cached Recap Rundown data')\n cache_data = this.readFileToJson(cache_file)\n }\n if (cache_data) {\n return cache_data\n }\n } catch(e) {\n this.log('getRecapRundownData error : ' + e.message)\n }\n }", "function precache() {\n return caches.open(CACHE).then(function (cache) {\n return cache.addAll([\n './index.html',\n '/assets/logo/project.svg',\n '/static/media/project.240f45f8.svg',\n './offline.html'\n ]);\n });\n}", "function _refreshData() {\n\n // Hide the app bars\n var navBar = document.getElementsByClassName(\"win-appbar\");\n for (var i = 0; i < navBar.length; i++) {\n navBar[i].winControl.hide();\n }\n\n var isInternetAvailable = App.Data.isInternetAvailable();\n var appData = Windows.Storage.ApplicationData.current;\n var today = new Date();\n var currentDateTime = new Date(today.toUTCString());\n if (lastRefreshDateTime) {\n var dateDiff = App.Data.dateTimeDiff(currentDateTime, lastRefreshDateTime);\n if (dateDiff.mins < 10 && !currentError) {\n App.Data.showTipMessage(\"Warning\", \"Don't refresh twice in 10 minutes.\", null, Dialog.Icon.Warning);\n return;\n }\n }\n if (!isInternetAvailable) {\n App.Data.showInternetNotAvailable();\n }\n else {\n // Clean the cache files \n appData.localFolder.createFolderAsync(\"Feeds\", Windows.Storage.CreationCollisionOption.replaceExisting).then(function () {\n\n // Re-binding the data source\n _bindingDataSource(true);\n }, function (error) {\n App.Data.showTipMessage(\"Refresh Error\", \"Download news failed, please retry 5 minutes latter.\", null, Dialog.Icon.Warning);\n _setVisiableForLoadingIndicator(false);\n }\n );\n }\n }", "async function downloadImages()\n{\n if ( !await fileExists( `${advTitle}/images` ) ) {\n await fs.mkdir( `${advTitle}/images` );\n }\n\n let imgPath = `${advTitle}/images`;\n for ( let image of myImages ) {\n if ( !await fileExists( `${imgPath}/${image.img}` ) ) {\n console.log( ` download: image ${image.base}` );\n if ( image.url.match( /^http/ ) ) {\n\tawait downloadFile( image.url, `${imgPath}/${image.base}` );\n\tawait convertWebp( `${imgPath}/${image.base}`, `${imgPath}/${image.img}` );\n } else {\n\t// simply copy\n\tlet fname = findFullPath( image.url );\n\tawait fs.copyFile( fname, `${imgPath}/${image.base}` );\n\tawait convertWebp( `${imgPath}/${image.base}`, `${imgPath}/${image.img}` );\n }\n }\n }\n}", "function downloadData() {\n regions.forEach((region) => {\n fetch(`${weatherApi.url}current.json?key=${weatherApi.key}&q=${region}`)\n .then((res) => res.json())\n .then((result) => {\n let io = result.current;\n localStorage.setItem(region, JSON.stringify(io));\n });\n });\n}", "function Cache_GetMissingFiles(aScriptsToDownload)\n{\n\t//helpers\n\tvar i, c, scripts;\n\t//build a current list of scripts\n\tvar aListOfScripts = {};\n\t//loop through the scripts\n\tfor (i = 0, scripts = document.scripts, c = scripts.length; i < c; i++)\n\t{\n\t\t//get the script src\n\t\tvar scriptSrc = scripts[i].src;\n\t\t//get last separator\n\t\tvar nLastSep = scriptSrc.lastIndexOf(\"/\");\n\t\t//valid?\n\t\tif (nLastSep != -1)\n\t\t{\n\t\t\t//keep only filename\n\t\t\tscriptSrc = scriptSrc.substring(nLastSep + 1);\n\t\t}\n\t\t//store it in the map\n\t\taListOfScripts[scriptSrc] = true;\n\t}\n\t//create a missing list\n\tvar missingScripts = [];\n\t//loop through file list\n\tfor (i = 0, c = aScriptsToDownload.length; i < c; i++)\n\t{\n\t\t//get script name\n\t\tvar newScript = aScriptsToDownload[i];\n\t\t//new script?\n\t\tif (!aListOfScripts[newScript] && newScript.match(/\\.js$/))\n\t\t{\n\t\t\t//add to list\n\t\t\tmissingScripts.push(newScript);\n\t\t}\n\t}\n\t//return the list\n\treturn missingScripts;\n}", "function getDownloadFiles() {\n $.ajax({\n url: window.location.pathname + '.json',\n dataType: 'json',\n contentType: 'application/json',\n error: function(response) {\n // Show error message if we don't get a response\n message.appendTo('.downloads-block');\n\n },\n success: function(response) {\n var downloads = response.downloads;\n // Check if the response has the file data\n if (fileHasLoaded(downloads)) {\n loader.remove();\n $('#other-downloads').removeClass('js-hidden');\n $('#excel-skipped').remove();\n $('#csv-item').remove();\n $('#excel-file').attr('aria-hidden', false);\n downloadReady.prependTo('#excel-file');\n addFilesToPage(response);\n } else {\n // Poll the server every 2 seconds up to a maximum of 60 attempts (2 minutes)\n if (count < 60) {\n count++;\n loader.removeClass('js-hidden');\n $('#excel-file').attr('aria-hidden', true);\n if (count === 2) {\n preparingAlert.prependTo(loader);\n }\n setTimeout(function() { getDownloadFiles(); }, 2000);\n } else {\n // Show an error message if the files aren't created after 60 attempts\n loader.remove();\n message.appendTo('.downloads-block');\n }\n }\n },\n });\n}", "function fetchData() {\n var requests = [];\n\n var datasets = App.manifest.get('data') || [];\n\n datasets.forEach(function(data) {\n var filename = data.src.slice(0, -5),\n model = new StormData();\n\n model.url = App.bundleManager.getResourceUrl('bundle/data/' + data.src);\n\n App.data[filename] = model;\n requests.push(model.fetch());\n });\n\n return $.when.apply($, requests);\n}", "function loadCaches() {\n geocaches = JSON.parse(localStorage.getItem('geocaches'));\n if (geocaches) {\n console.log(\"Got saved geocaches\");\n sendGeocaches();\n } else {\n console.log(\"No saved geocaches, so will get them\");\n // There are no saved geocaches, so get them\n getGeocaches();\n }\n}", "function updateStaticCache() {\n return caches.open(version + staticCacheName)\n .then(function (cache) {\n return cache.addAll(staticCacheList);\n });\n}", "function downloads() {\r\n return gulp.src(files.downloadsPath)\r\n .pipe(newer(files.downloadsPath))\r\n .pipe(gulp.dest('./build/assets/downloads'));\r\n}", "async fetch () {\n\t\tif (this.notFound.length === 0) {\n\t\t\treturn;\t// got 'em all from the cache ... yeehaw\n\t\t}\n\t\telse if (this.notFound.length === 1) {\n\t\t\t// single ID fetch is more efficient\n\t\t\treturn await this.fetchOne();\n\t\t}\n\t\telse {\n\t\t\treturn await this.fetchMany();\n\t\t}\n\t}", "function fetchData(){\n\n if(URLS.length == 0 ){\n storedata();\n\t return;\n }\n let url = URLS.shift()\n console.log(\"-----------------\");\n console.log(url);\n https.get(url,function(res){\n var response_data = \"\";\n res.setEncoding('utf8');\n res.on('data', function(chunk) {\n response_data += chunk;\n });\n res.on('end', function() {\n html_links = parseXml(response_data); // each individual url from sitemap.xml has html links which are fetched and stored in this variable.\n\t\t\n\t\tconsole.log(\"-------------html link length: \"+html_links.length);\n fetchHtml();\n \n });\n }).on('error',function(e){\n console.log(\"Error in fetching XML url: \"+e.message);\n fetchData(URLS.shift());\n });\n}", "async function networkFirst(req){\n const cache = await caches.open(staticCacheName)\n try{\n //storing new data from internet to local cache\n const fresh = await fetch(req)\n cache.put(req,fresh.clone())\n //clone = store\n return fresh\n }catch(e){\n const cached = await cache.match(req)\n return cached\n }\n}", "tryLoadOffline() {\n this.clearInternalState();\n if (this.loadOfflineCallback_)\n this.loadOfflineCallback_();\n }", "function fetch() {\n // Fetch, scrape & update all data (external source -> data/providers/*)\n let jobs = [];\n if (!argv.provider) {\n // Gather unique provider jobs\n jobs = config.sites[domain].jobs || []; // mind site-specific options\n } else {\n // Commandline-supplied provider(s) override\n argv.provider.split(/[, ]+/).forEach(prov => {\n jobs.push({\n provider: prov,\n options: config.providers[prov] || {}\n });\n });\n }\n return mergeStream(\n jobs.map(job => {\n return srcProvider(job)\n .pipe(gulp.dest('data/providers/' + job.provider))\n .on('error', onError);\n })\n );\n}", "function onSaveButtonClicked(){\n if ('caches' in window){\n caches.open('user-requested')\n .then(function(cache){\n cache.add('url') // the url to be cached;\n cache.add('images to be cached') //the item to be cached\n });\n }\n}", "function refetchEvents() {\n\t\treturn fetchEventSources(sources, 'reset');\n\t}", "function refetchEvents() {\n\t\treturn fetchEventSources(sources, 'reset');\n\t}", "function refetchEvents() {\n\t\treturn fetchEventSources(sources, 'reset');\n\t}", "function processDownload() {\n loadPlayList();\n}", "function offlineOnload() {\n var didFail = src.endsWith(\"-etc1.pvr\") && new DataView(request.response).getInt32(0) !== PVR_MAGIC_NUMBER;\n if (didFail) {\n error(new Error(\"Failed offline PVR get request: \" + request.status + \" - \" + request.statusText));\n } else {\n callback(request.response);\n }\n }", "function onLoadAllMyExs() {\n if (localStorage.getItem(\"cacheReset\") !== \"true\") {\n localStorage.setItem(\"exs\", \"\");\n localStorage.setItem(\"cacheReset\", true);\n } else {\n checkLocalExList();\n }\n}", "function requestDownloadLinks(callback) {\n var count = 0\n , downloads = []\n\n $.getJSON('/handler/lixian/get_lixian_status.php'/*, {mids : [ids]} NOUSE*/)\n .done(function (res) {\n $.each(res.data, function (i, task) {\n // check\n if (\n !$('#task_sel_' + task.mid).is(':checked') || // user selected\n task.file_size !== task.comp_size || // download finished\n task.dl_status !== TASK_STATUS['ST_UL_OK']\n ) return\n\n\n count++\n $.post('/handler/lixian/get_http_url.php', {\n hash: task.hash\n , filename: task.file_name\n //, g_tk : getACSRFToken(cookie.get('skey', 'qq.com'))\n //, browser : 'other'\n }, null, 'json')\n .done(function (res) {\n count--\n if (res && res.ret === 0) {\n // break speed limit\n // thanks @4023 https://userscripts.org/users/381599\n var url = res.data.com_url\n .replace('xflx.store.cd.qq.com:443', 'xfcd.ctfs.ftn.qq.com')\n .replace('xflx.sz.ftn.qq.com:80', 'sz.disk.ftn.qq.com')\n .replace('xflx.cd.ftn.qq.com:80', 'cd.ctfs.ftn.qq.com')\n .replace('xflxsrc.store.qq.com:443', 'xfxa.ctfs.ftn.qq.com')\n\n downloads.push({\n url: url\n , cookie: res.data.com_cookie\n , filename: task.file_name\n })\n }\n })\n .fail(function () {\n msg.show('获取失败', 2, 2000)\n })\n .always(function () {\n if (count === 0) {\n // sort according to filename\n downloads.sort(function (a, b) {\n return a.filename.localeCompare(b.filename)\n })\n callback(downloads)\n }\n })\n\n })\n })\n .fail(function () {\n msg.show('获取列表的接口坏了嘛?! 请联系脚本作者', 2, 2000)\n })\n }", "function OfflineDownload(config) {\n config = config || {};\n var context = this.context;\n var manifestLoader = config.manifestLoader;\n var mediaPlayerModel = config.mediaPlayerModel;\n var abrController = config.abrController;\n var playbackController = config.playbackController;\n var adapter = config.adapter;\n var dashMetrics = config.dashMetrics;\n var timelineConverter = config.timelineConverter;\n var offlineStoreController = config.offlineStoreController;\n var manifestId = config.id;\n var eventBus = config.eventBus;\n var errHandler = config.errHandler;\n var events = config.events;\n var errors = config.errors;\n var settings = config.settings;\n var debug = config.debug;\n var manifestUpdater = config.manifestUpdater;\n var baseURLController = config.baseURLController;\n var segmentBaseController = config.segmentBaseController;\n var constants = config.constants;\n var dashConstants = config.dashConstants;\n var urlUtils = config.urlUtils;\n\n var instance, logger, _manifestURL, _offlineURL, _xmlManifest, _streams, _manifest, _isDownloadingStatus, _isComposed, _representationsToUpdate, _indexDBManifestParser, _progressionById, _progression, _status;\n\n function setup() {\n logger = debug.getLogger(instance);\n manifestUpdater.initialize();\n _streams = [];\n _isDownloadingStatus = false;\n _isComposed = false;\n _progressionById = {};\n _progression = 0;\n _status = undefined;\n }\n\n function getId() {\n return manifestId;\n }\n\n function getOfflineUrl() {\n return _offlineURL;\n }\n\n function getManifestUrl() {\n return _manifestURL;\n }\n\n function getStatus() {\n return _status;\n }\n\n function setInitialState(state) {\n _offlineURL = state.url;\n _progression = state.progress;\n _manifestURL = state.originalUrl;\n _status = state.status;\n }\n /**\n * Download a stream, from url of manifest\n * @param {string} url\n * @instance\n */\n\n\n function downloadFromUrl(url) {\n _manifestURL = url;\n _offlineURL = \"\".concat(_constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_SCHEME, \"://\").concat(manifestId);\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_CREATED;\n setupOfflineEvents();\n var offlineManifest = {\n 'fragmentStore': manifestId,\n 'status': _status,\n 'manifestId': manifestId,\n 'url': _offlineURL,\n 'originalURL': url\n };\n return createOfflineManifest(offlineManifest);\n }\n\n function initDownload() {\n manifestLoader.load(_manifestURL);\n _isDownloadingStatus = true;\n }\n\n function setupOfflineEvents() {\n eventBus.on(events.MANIFEST_UPDATED, onManifestUpdated, instance);\n eventBus.on(events.ORIGINAL_MANIFEST_LOADED, onOriginalManifestLoaded, instance);\n setupIndexedDBEvents();\n }\n\n function setupIndexedDBEvents() {\n eventBus.on(events.ERROR, onError, instance);\n }\n\n function isDownloading() {\n return _isDownloadingStatus;\n }\n\n function onManifestUpdated(e) {\n if (_isComposed) {\n return;\n }\n\n if (!e.error) {\n try {\n _manifest = e.manifest;\n } catch (err) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: err.message,\n data: {\n id: manifestId,\n status: _status\n }\n });\n }\n }\n }\n\n function onDownloadingStarted(e) {\n if (e.id !== manifestId) {\n return;\n }\n\n if (!e.error && manifestId !== null) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_STARTED;\n offlineStoreController.setDownloadingStatus(manifestId, _status).then(function () {\n eventBus.trigger(events.OFFLINE_RECORD_STARTED, {\n id: manifestId,\n message: 'Downloading started for this stream !'\n });\n });\n } else {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: 'Cannot start download ',\n data: {\n id: manifestId,\n status: _status,\n error: e.error\n }\n });\n }\n }\n\n function OnStreamProgression(stream, downloaded, available) {\n _progressionById[stream.getStreamInfo().id] = {\n downloaded: downloaded,\n available: available\n };\n var segments = 0;\n var allSegments = 0;\n var waitForAllProgress;\n\n for (var property in _progressionById) {\n if (_progressionById.hasOwnProperty(property)) {\n if (_progressionById[property] === null) {\n waitForAllProgress = true;\n } else {\n segments += _progressionById[property].downloaded;\n allSegments += _progressionById[property].available;\n }\n }\n }\n\n if (!waitForAllProgress) {\n // all progression have been started, we can compute global progression\n _progression = segments / allSegments; // store progression\n\n offlineStoreController.getManifestById(manifestId).then(function (item) {\n item.progress = _progression;\n return updateOfflineManifest(item);\n });\n }\n }\n\n function onDownloadingFinished(e) {\n if (e.id !== manifestId) {\n return;\n }\n\n if (!e.error && manifestId !== null) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_FINISHED;\n offlineStoreController.setDownloadingStatus(manifestId, _status).then(function () {\n eventBus.trigger(events.OFFLINE_RECORD_FINISHED, {\n id: manifestId,\n message: 'Downloading has been successfully completed for this stream !'\n });\n resetDownload();\n });\n } else {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: 'Error finishing download ',\n data: {\n id: manifestId,\n status: _status,\n error: e.error\n }\n });\n }\n }\n\n function onManifestUpdateNeeded(e) {\n if (e.id !== manifestId) {\n return;\n }\n\n _representationsToUpdate = e.representations;\n\n if (_representationsToUpdate.length > 0) {\n _indexDBManifestParser.parse(_xmlManifest, _representationsToUpdate).then(function (parsedManifest) {\n if (parsedManifest !== null && manifestId !== null) {\n offlineStoreController.getManifestById(manifestId).then(function (item) {\n item.manifest = parsedManifest;\n return updateOfflineManifest(item);\n }).then(function () {\n for (var i = 0, ln = _streams.length; i < ln; i++) {\n _streams[i].startOfflineStreamProcessors();\n }\n });\n } else {\n throw 'falling parsing offline manifest';\n }\n })[\"catch\"](function (err) {\n throw err;\n });\n }\n }\n\n function composeStreams() {\n try {\n adapter.updatePeriods(_manifest);\n baseURLController.initialize(_manifest);\n var streamsInfo = adapter.getStreamsInfo();\n\n if (streamsInfo.length === 0) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: 'Cannot download - no streams',\n data: {\n id: manifestId,\n status: _status\n }\n });\n }\n\n for (var i = 0, ln = streamsInfo.length; i < ln; i++) {\n var streamInfo = streamsInfo[i];\n var stream = Object(_OfflineStream__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(context).create({\n id: manifestId,\n callbacks: {\n started: onDownloadingStarted,\n progression: OnStreamProgression,\n finished: onDownloadingFinished,\n updateManifestNeeded: onManifestUpdateNeeded\n },\n constants: constants,\n dashConstants: dashConstants,\n eventBus: eventBus,\n events: events,\n errors: errors,\n settings: settings,\n debug: debug,\n errHandler: errHandler,\n mediaPlayerModel: mediaPlayerModel,\n abrController: abrController,\n playbackController: playbackController,\n dashMetrics: dashMetrics,\n baseURLController: baseURLController,\n timelineConverter: timelineConverter,\n adapter: adapter,\n segmentBaseController: segmentBaseController,\n offlineStoreController: offlineStoreController\n });\n\n _streams.push(stream); // initialise stream and get downloadable representations\n\n\n stream.initialize(streamInfo);\n _progressionById[streamInfo.id] = null;\n }\n\n _isComposed = true;\n } catch (e) {\n logger.info(e);\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: e.message,\n data: {\n id: manifestId,\n status: _status,\n error: e.error\n }\n });\n }\n }\n\n function getMediaInfos() {\n _streams.forEach(function (stream) {\n stream.getMediaInfos();\n });\n }\n /**\n * Init databsse to store fragments\n * @param {number} manifestId\n * @instance\n */\n\n\n function createFragmentStore(manifestId) {\n return offlineStoreController.createFragmentStore(manifestId);\n }\n /**\n * Store in database the string representation of offline manifest (with only downloaded representations)\n * @param {object} offlineManifest\n * @instance\n */\n\n\n function createOfflineManifest(offlineManifest) {\n return offlineStoreController.createOfflineManifest(offlineManifest);\n }\n /**\n * Store in database the string representation of offline manifest (with only downloaded representations)\n * @param {object} offlineManifest\n * @instance\n */\n\n\n function updateOfflineManifest(offlineManifest) {\n return offlineStoreController.updateOfflineManifest(offlineManifest);\n }\n /**\n * Triggered when manifest is loaded from internet.\n * @param {Object[]} e\n */\n\n\n function onOriginalManifestLoaded(e) {\n // unregister form event\n eventBus.off(events.ORIGINAL_MANIFEST_LOADED, onOriginalManifestLoaded, instance);\n _xmlManifest = e.originalManifest;\n\n if (_manifest.type === dashConstants.DYNAMIC) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: 'Cannot handle DYNAMIC manifest',\n data: {\n id: manifestId,\n status: _status\n }\n });\n logger.error('Cannot handle DYNAMIC manifest');\n return;\n }\n\n if (_manifest.Period_asArray.length > 1) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: 'MultiPeriod manifest are not yet supported',\n data: {\n id: manifestId,\n status: _status\n }\n });\n logger.error('MultiPeriod manifest are not yet supported');\n return;\n } // save original manifest (for resume)\n // initialise offline streams\n\n\n composeStreams(_manifest); // get MediaInfos\n\n getMediaInfos();\n eventBus.trigger(events.STREAMS_COMPOSED);\n }\n\n function initializeAllMediasInfoList(selectedRepresentations) {\n for (var i = 0; i < _streams.length; i++) {\n _streams[i].initializeAllMediasInfoList(selectedRepresentations);\n }\n }\n\n function getSelectedRepresentations(mediaInfos) {\n var rep = {};\n rep[constants.VIDEO] = [];\n rep[constants.AUDIO] = [];\n rep[constants.TEXT] = []; // selectedRepresentations.video.forEach(item => {\n // ret[constants.VIDEO].push(item.id);\n // });\n // selectedRepresentations.audio.forEach(item => {\n // ret[constants.AUDIO].push(item.id);\n // });\n // selectedRepresentations.text.forEach(item => {\n // ret[item.type].push(item.id);\n // });\n\n mediaInfos.forEach(function (mediaInfo) {\n mediaInfo.bitrateList.forEach(function (bitrate) {\n rep[mediaInfo.type].push(bitrate.id);\n });\n });\n return rep;\n }\n\n function startDownload(mediaInfos) {\n try {\n var rep = getSelectedRepresentations(mediaInfos);\n offlineStoreController.saveSelectedRepresentations(manifestId, rep).then(function () {\n return createFragmentStore(manifestId);\n }).then(function () {\n return generateOfflineManifest(rep);\n }).then(function () {\n initializeAllMediasInfoList(rep);\n });\n } catch (err) {\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_ERROR;\n errHandler.error({\n code: _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].OFFLINE_ERROR,\n message: err.message,\n data: {\n id: manifestId,\n status: _status\n }\n });\n }\n }\n /**\n * Create the parser used to convert original manifest in offline manifest\n * Creates a JSON object that will be stored in database\n * @param {Object[]} selectedRepresentations\n * @instance\n */\n\n\n function generateOfflineManifest(selectedRepresentations) {\n _indexDBManifestParser = Object(_utils_OfflineIndexDBManifestParser__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(context).create({\n manifestId: manifestId,\n allMediaInfos: selectedRepresentations,\n debug: debug,\n dashConstants: dashConstants,\n constants: constants,\n urlUtils: urlUtils\n });\n return _indexDBManifestParser.parse(_xmlManifest).then(function (parsedManifest) {\n if (parsedManifest !== null) {\n return offlineStoreController.getManifestById(manifestId).then(function (item) {\n item.originalURL = _manifest.url;\n item.originalManifest = _xmlManifest;\n item.manifest = parsedManifest;\n return updateOfflineManifest(item);\n });\n } else {\n return Promise.reject('falling parsing offline manifest');\n }\n })[\"catch\"](function (err) {\n return Promise.reject(err);\n });\n }\n /**\n * Stops downloading of fragments\n * @instance\n */\n\n\n function stopDownload() {\n if (manifestId !== null && isDownloading()) {\n for (var i = 0, ln = _streams.length; i < ln; i++) {\n _streams[i].stopOfflineStreamProcessors();\n } // remove streams\n\n\n _streams = [];\n _isComposed = false;\n _status = _constants_OfflineConstants__WEBPACK_IMPORTED_MODULE_0__[\"default\"].OFFLINE_STATUS_STOPPED; // update status\n\n offlineStoreController.setDownloadingStatus(manifestId, _status).then(function () {\n eventBus.trigger(events.OFFLINE_RECORD_STOPPED, {\n sender: this,\n id: manifestId,\n status: _status,\n message: 'Downloading has been stopped for this stream !'\n });\n _isDownloadingStatus = false;\n });\n }\n }\n /**\n * Delete an offline manifest (and all of its data)\n * @instance\n */\n\n\n function deleteDownload() {\n stopDownload();\n }\n /**\n * Resume download of a stream\n * @instance\n */\n\n\n function resumeDownload() {\n if (isDownloading()) {\n return;\n }\n\n _isDownloadingStatus = true;\n var selectedRepresentations;\n offlineStoreController.getManifestById(manifestId).then(function (item) {\n var parser = Object(_dash_parser_DashParser__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(context).create({\n debug: debug\n });\n _manifest = parser.parse(item.originalManifest);\n composeStreams(_manifest);\n selectedRepresentations = item.selected;\n eventBus.trigger(events.STREAMS_COMPOSED);\n return createFragmentStore(manifestId);\n }).then(function () {\n initializeAllMediasInfoList(selectedRepresentations);\n });\n }\n /**\n * Compute the progression of download\n * @instance\n */\n\n\n function getDownloadProgression() {\n return Math.round(_progression * 100);\n }\n /**\n * Reset events listeners\n * @instance\n */\n\n\n function resetDownload() {\n for (var i = 0, ln = _streams.length; i < ln; i++) {\n _streams[i].reset();\n }\n\n _indexDBManifestParser = null;\n _isDownloadingStatus = false;\n _streams = [];\n eventBus.off(events.MANIFEST_UPDATED, onManifestUpdated, instance);\n eventBus.off(events.ORIGINAL_MANIFEST_LOADED, onOriginalManifestLoaded, instance);\n resetIndexedDBEvents();\n }\n\n function onError(e) {\n if (e.error.code === _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].INDEXEDDB_QUOTA_EXCEED_ERROR || e.error.code === _errors_OfflineErrors__WEBPACK_IMPORTED_MODULE_3__[\"default\"].INDEXEDDB_INVALID_STATE_ERROR) {\n stopDownload();\n }\n }\n\n function resetIndexedDBEvents() {\n eventBus.on(events.ERROR, onError, instance);\n }\n /**\n * Reset\n * @instance\n */\n\n\n function reset() {\n if (isDownloading()) {\n resetDownload();\n }\n\n baseURLController.reset();\n manifestUpdater.reset();\n }\n\n instance = {\n reset: reset,\n getId: getId,\n getOfflineUrl: getOfflineUrl,\n getManifestUrl: getManifestUrl,\n getStatus: getStatus,\n setInitialState: setInitialState,\n initDownload: initDownload,\n downloadFromUrl: downloadFromUrl,\n startDownload: startDownload,\n stopDownload: stopDownload,\n resumeDownload: resumeDownload,\n deleteDownload: deleteDownload,\n getDownloadProgression: getDownloadProgression,\n isDownloading: isDownloading,\n resetDownload: resetDownload\n };\n setup();\n return instance;\n}", "function useFallback() {\n return caches.match('offline.html');\n}" ]
[ "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.7769866", "0.606994", "0.6041046", "0.59732753", "0.5947098", "0.5918844", "0.59056634", "0.5892234", "0.5859714", "0.57820034", "0.5778483", "0.5768942", "0.5677773", "0.56757206", "0.5653438", "0.56486577", "0.5636278", "0.5627937", "0.5597585", "0.5583291", "0.5583081", "0.55823016", "0.5554271", "0.5543835", "0.5512721", "0.54995877", "0.5495928", "0.5463219", "0.5455577", "0.5441349", "0.5436563", "0.53964126", "0.5394258", "0.5378514", "0.5370983", "0.5368211", "0.53651977", "0.53437895", "0.5310902", "0.53082913", "0.5308083", "0.53076303", "0.5306666", "0.5306003", "0.5289631", "0.5288521", "0.5282939", "0.5280836", "0.5276417", "0.52756953", "0.5270022", "0.52699107", "0.52699107", "0.52699107", "0.5269218", "0.5258307", "0.52575964", "0.5255662", "0.5253477", "0.52478164" ]
0.7781333
8
Attempt to download the resource online before falling back to the offline cache.
function onlineFirst(event) { return event.respondWith( fetch(event.request).then((response) => { return caches.open(CACHE_NAME).then((cache) => { cache.put(event.request, response.clone()); return response; }); }).catch((error) => { return caches.open(CACHE_NAME).then((cache) => { return cache.match(event.request).then((response) => { if (response != null) { return response; } throw error; }); }); }) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey of Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "async function downloadOffline() {\n var resources = [];\n var contentCache = await caches.open(CACHE_NAME);\n var currentContent = {};\n for (var request of await contentCache.keys()) {\n var key = request.url.substring(origin.length + 1);\n if (key == \"\") {\n key = \"/\";\n }\n currentContent[key] = true;\n }\n for (var resourceKey in Object.keys(RESOURCES)) {\n if (!currentContent[resourceKey]) {\n resources.push(resourceKey);\n }\n }\n return contentCache.addAll(resources);\n}", "tryLoadOffline() {\n this.clearInternalState();\n if (this.loadOfflineCallback_)\n this.loadOfflineCallback_();\n }", "async function networkFirst(req){\n const cache = await caches.open(staticCacheName)\n try{\n //storing new data from internet to local cache\n const fresh = await fetch(req)\n cache.put(req,fresh.clone())\n //clone = store\n return fresh\n }catch(e){\n const cached = await cache.match(req)\n return cached\n }\n}", "async function networkAndCache(req) {\n const cache = await caches.open(cacheName);\n try {\n const fresh = await fetch(req);\n await cache.put(req, fresh.clone);\n return fresh;\n } catch(e) {\n const cached = await cache.match(req);\n return cached;\n }\n}", "function useFallback() {\n return caches.match('offline.html');\n}", "function offlineOnload() {\n var didFail = src.endsWith(\"-etc1.pvr\") && new DataView(request.response).getInt32(0) !== PVR_MAGIC_NUMBER;\n if (didFail) {\n error(new Error(\"Failed offline PVR get request: \" + request.status + \" - \" + request.statusText));\n } else {\n callback(request.response);\n }\n }", "function cacheElseNetwork (event) {\n return caches.match(event.request).then(response => {\n function fetchAndCache () {\n return fetch(event.request).then(response => {\n // Update cache.\n caches.open(VERSION).then(cache => cache.put(event.request, response.clone()));\n return response;\n });\n }\n\n // If not exist in cache, fetch.\n if (!response) { return fetchAndCache(); }\n\n // If exists in cache, return from cache while updating cache in background.\n fetchAndCache();\n return response;\n });\n}", "get offline() {\n return Services.io.offline;\n }", "static fetch(name, callback, onlyFresh=false) {\n if (typeof fetch !== 'undefined' && typeof caches !== 'undefined' && (window.location.protocol === \"https:\" || window.location.hostname === \"localhost\")) {\n caches.open(\"board/agenda\").then((cache) => {\n let fetched = undefined;\n Store.dispatch(Actions.clockIncrement());\n\n // construct request\n let request = new Request(`../api/${name}`, {\n method: \"get\",\n credentials: \"include\",\n headers: { Accept: \"application/json\" }\n });\n\n // dispatch request\n fetch(request).then((response) => {\n if (!response.ok) throw response.statusText;\n cache.put(request, response.clone());\n\n response.json().then(json => {\n if (fetched === undefined || JSON.stringify(fetched) !== JSON.stringify(json)) {\n if (fetched === undefined) Store.dispatch(Actions.clockDecrement());\n fetched = json;\n callback(null, json, true)\n }\n })\n .catch(error => {\n console.error(`fetch ${request.url}:\\n${error}`)\n })\n .finally(() => {\n if (fetched === undefined) Store.dispatch(Actions.clockDecrement());\n })\n });\n\n // check cache\n if (!onlyFresh) {\n cache.match(`../api/${name}`).then(response => {\n if (response && fetched === undefined) {\n try {\n response.json().then(json => {\n if (fetched === undefined) Store.dispatch(Actions.clockDecrement());\n if (json) {\n callback(null, json, false)\n fetched = json;\n }\n })\n } catch (error) {\n if (error.name !== 'SyntaxError') callback(error);\n }\n }\n })\n }\n })\n } else if (typeof XMLHttpRequest !== 'undefined') {\n // retrieve from the network only\n retrieve(name, \"json\", data => callback(null, data, true))\n }\n }", "async loadCache() {\n const { latest, refreshCache, isOutdated, lastUpdate } = this\n\n if (!lastUpdate || isOutdated()) {\n await refreshCache()\n }\n\n return latest\n }", "function go_offline()\n{\n\tif (server_info == null) {\n\t\tshow_error_page(\"Sorry, the system is down.\");\n\t\treturn;\n\t}\n\n\tif (!server_info.offline) {\n\t\tserver_info.offline = true;\n\t\t$('body').addClass('offline');\n\t}\n}", "function fromCache(request) {\n return caches.open(CACHE)\n .then(function (cache) {\n return cache.match(request).then(matching => {\n return matching || Promise.resolve(offlineResponse(request));\n });\n });\n}", "function cacheResource(url, callback){\n var cached = cache(url);\n \n function cacheAndCallback(data){\n if (data){\n cache(url, data);\n }\n callback(data);\n }\n \n if (cached){\n _('cacheResource: fetching from cache', url);\n callback(cached);\n }\n else {\n try{\n _('cacheResource: via ajaxRequest', url);\n ajaxRequest(url, function(data){\n if (data){\n cacheAndCallback(data);\n }\n else {\n proxy(url, cacheAndCallback);\n }\n });\n }\n catch(e){\n _('cacheResource: ajaxRequest failed', url);\n _('cacheResource: via proxy', url);\n proxy(url, cacheAndCallback);\n }\n }\n }", "function swFetch(event) {\n event.respondWith(caches.match(event.request).then(\n function cachesMatch(cachedResponse) {\n if (cachedResponse) {\n const newHeaders = new Headers(cachedResponse.headers);\n newHeaders.set('cache-control', 'no-cache');\n\n return new Response(cachedResponse.body, {\n status: cachedResponse.status,\n statusText: cachedResponse.statusText,\n headers: newHeaders,\n });\n }\n\n console.log('[Service Worker] Fallback (Fetch)', event.request.url);\n return fetch(event.request.clone());\n }\n ));\n}", "function connection_offline() {\n // Block.\n }", "static goOffline() {\n if (FirebaseUtils.isOnline) {\n FirebaseUtils.isOnline = false;\n database && database.goOffline();\n }\n }", "fetchCurrentWeather() {\n\t\tthis.fetchData(this.getUrl())\n\t\t\t.then(data => {\n\t\t\t\tif (!data) {\n\t\t\t\t\t// Did not receive usable new data.\n\t\t\t\t\t// Maybe this needs a better check?\n\t\t\t\t\tLog.error('No data');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tthis.setFetchedLocation(`${data.liveweer[0].plaats}, Netherlands`);\n\t\t\t\tconst currentWeather = this.generateWeatherObjectFromCurrentWeather(data.liveweer[0]);\n\t\t\t\tthis.setCurrentWeather(currentWeather);\n\t\t\t})\n\t\t\t.catch(function(request) {\n\t\t\t\tLog.error(\"Could not load data ... \", request);\n\t\t\t})\n\t\t\t.finally(() => this.updateAvailable())\n\t}", "get supportsOffline()\n\t{\n\t\treturn true;\n\t}", "function offline(ripple) {\n if (!_client2.default || !window.localStorage) return;\n log('creating');\n load(ripple);\n ripple.on('change.cache', (0, _debounce2.default)(1000)(cache(ripple)));\n return ripple;\n}", "function networkOrCache(request) {\n return fetch(request).then(function (response) {\n return response.ok ? response : fromCache(request);\n })\n .catch(function () {\n return fromCache(request);\n });\n}", "function refreshIsOnline()\n\t{\n\t\tif ( _this.hasRequestFailure || _this.isDeviceOffline ) {\n\t\t\t_this.isOnline = false;\n\t\t}\n\t\telse {\n\t\t\t_this.isOnline = true;\n\t\t}\n\n\t\t_this.isClientOffline = Environment.isClient && !_this.isOnline;\n\t}", "function cache() {\n // TODO: Cache to Redis if on server\n if (!client) {\n return;\n }clearTimeout(pending);\n var count = resources.length;\n pending = setTimeout(function () {\n if (count == resources.length) {\n log(\"cached\");\n var cachable = values(resources).filter(not(header(\"cache-control\", \"no-store\")));\n localStorage.ripple = freeze(objectify(cachable));\n }\n }, 2000);\n }" ]
[ "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6772447", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6762283", "0.6668851", "0.63781595", "0.62833613", "0.6244151", "0.62047726", "0.6137528", "0.6092156", "0.60730356", "0.5985051", "0.5920878", "0.58635086", "0.58296967", "0.58242977", "0.57865757", "0.57835335", "0.57623935", "0.5732791", "0.5709606", "0.5665565", "0.5636656", "0.562198" ]
0.6743336
79
Helper method for defining associations. This method is not a part of Sequelize lifecycle. The `models/index` file will call this method automatically.
static associate(models) { // define association here }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static associate(models) {\n // define association here\n // This is how Sequelize knows to create \"magic methods\"\n // These are functions that can automatically pull\n // related data.\n // For example: If I have a User object\n // I can call `await user.getContacts()` to get an\n // Array of this user's Contacts.\n Contact.belongsTo(models.User, {\n foreignKey: 'user_id'\n });\n Contact.belongsTo(models.User, {\n foreignKey: 'contact_id'\n });\n }", "static associate(models) {\n // define association here\n // this.hasMany(models.StepIngredient);\n this.belongsTo(models.Recipe);\n }", "static associate(models) {\n // define association here\n Ronda.hasMany(models.Partida,{foreignKey:'IdRonda',as:'partidas'})\n Ronda.belongsTo(models.Torneo,{foreignKey:'IdTorneo',as:'torneos'})\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate (models) {\n // define association here\n }", "static associate(models) {\n // define association here\n Nanny.belongsTo(models.Parent);\n Nanny.belongsTo(models.Agency);\n Nanny.belongsToMany(models.Child, { through: models.NannyChild });\n Nanny.belongsTo(models.Parent, {\n sourceKey: \"id\",\n foreignKey: \"ParentId\",\n });\n Nanny.belongsTo(models.Agency, {\n sourceKey: \"id\",\n foreignKey: \"AgencyId\",\n });\n }", "static associate(models) {\n Course.belongsTo(models.Category, {\n as: 'category',\n foreignKey: 'id_cat'\n });\n Course.belongsTo(models.User, {\n as: 'author',\n foreignKey: 'author_id'\n });\n Course.belongsToMany(models.User, {\n through: 'FollowedCourses',\n as: 'followers'\n });\n Course.hasMany(models.Article, {\n as: 'exercices',\n foreignKey: 'id_course'\n })\n // define association here\n }", "static associate(models) {\n // define association here\n this.belongsTo(models.deal);\n }" ]
[ "0.76413774", "0.75078297", "0.7312548", "0.7306819", "0.7306819", "0.7306819", "0.7294662", "0.72838104", "0.7278665" ]
0.0
-1
Pass the new task to parent component and clear text input
handleSubmit(e){ e.preventDefault(); this.props.addTask(this.state); this.setState({ taskInput: "" }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "handleAddTask() {\n this.props.addTask(this.state.input);\n this.setState({\n input: ''\n });\n }", "handleSubmit(e) {\n e.preventDefault();\n //not saving empty task\n if (this.state.toDoItem === '' || \n this.state.toDoItem == null ||\n this.state.toDoItem.trim() === '') {\n return;\n }\n const newTask = {\n id : this.counter,\n description : this.state.toDoItem,\n isDone : false\n }\n this.setState({toDoItem : ''});//clear the input\n this.counter++;\n this.props.onTaskAdded(newTask);//call the parents callback\n }", "function newTask() {\n td.addTask(document.getElementById(\"new-task-text\").value);\n document.getElementById(\"new-task-text\").value = \"\";\n}", "function updateText() {\n new_task = task.value;\n console.log(new_task);\n}", "addTodo(){\n //get input content\n let task = qs(\"#inputToDo\");\n //save todo\n saveTodo(task.value, $this.key);\n //render the new list with a saved context variable.\n $this.listTodos();\n //Clear the input for a new task to be added\n task.value = \"\";\n }", "addItem() {\n document.querySelector(\"#textfield1\").value = \"\"\n this.setState({ \n triggerAnimation: 'fadein', tasks: \n this.state.inputText \n }) \n }", "function handleWritting(e){\n newTask.value = e.currentTarget.value;\n}", "function editTask(event) {\n const taskInput = this.parentNode.parentNode.querySelector('input');\n const taskName = this.parentNode.parentNode.querySelector('span');\n if (event.key === 'Enter' && taskInput.value !== '') {\n taskName.textContent = sanitizeHTML(taskInput.value);\n const keyValue = taskInput.dataset.key\n manageTasksAjax(event, taskInput.value, keyValue,)\n\n\n taskInput.value = '';\n taskInput.classList.add('d-none');\n taskInput.classList.remove('active-input');\n taskName.classList.remove('d-none');\n\n\n }\n\n window.removeEventListener('keydown', editTask);\n\n}", "edit_apply(task_id, taskNewTitle) {\n Tasks\n .update({\n '_id': task_id\n }, {\n $set: {text: taskNewTitle},\n });\n\n\n this.task_to_change = \"\"; // reset input clicked (close input edit)\n }", "function getNewTask(ev) {\n ev.preventDefault()\n let task = createTask({name: ev.currentTarget.querySelector('input').value})\n ev.currentTarget.reset()\n return task\n}", "function handleAdd(){\n console.log('clicked on Submit button');\n\n let newTask = {\n task: $('#taskIn').val()\n }\n // run addTask with newTask variable\n addTask(newTask);\n\n // empty input task\n $('#taskIn').val('')\n} // end handleAdd", "function createTask(event){\nconst li = document.createElement('li');\nconst inputBox = document.getElementById('new-task-description');\nconst list = document.getElementById('tasks');\nli.innerHTML = inputBox.value;\nlist.appendChild(li);\nevent.target.reset()\n}", "function createTaskHandler() {\n // console.dir(inputElem);\n\n const { value } = inputElem;\n\n if (!value) {\n return;\n }\n\n // console.log(value);\n\n tasks.push({\n text: value,\n done: false,\n });\n inputElem.value = '';\n renderTasks(tasks);\n}", "createtask(event) {\n\t\tthis.setState({ text: event.target.value });\n\t}", "doTaskDone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.undoneTaskArr.splice(index - 1, 1);\n this.doneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListDone.appendChild(task.createDoneTask());\n target.remove();\n }", "function TaskNew(props) {\n function update(ev) {\n let tgt = $(ev.target);\n\n let data = {};\n data[tgt.attr('name')] = tgt.val();\n let action = {\n type: 'UPDATE_NEW_TASK_FORM',\n data: data\n };\n props.dispatch(action);\n }\n\n function submit(ev) {\n let data = {\n token: props.token.token,\n task_params: props.new_task_form\n };\n\n api.submit_task(data);\n props.dispatch({\n type: 'CLEAR_NEW_TASK_FORM'\n });\n }\n\n function clear(ev) {\n props.dispatch({\n type: 'CLEAR_NEW_TASK_FORM'\n });\n }\n\n let users = _.map(props.users, (uu) => <option key={uu.id} value={uu.id}>{uu.name}</option>);\n\n return <div>\n <h2>New Task</h2>\n <div className=\"card\">\n <div className=\"card-body\">\n <FormGroup>\n <Label for=\"user_id\">user:</Label>\n <Input type=\"select\" name=\"user_id\"\n value={props.new_task_form.user_id} onChange={update}>\n <option></option>\n {users}\n </Input>\n </FormGroup>\n <FormGroup>\n <Label for=\"title\">title:</Label>\n <Input name=\"title\" value={props.new_task_form.title}\n onChange={update} />\n </FormGroup>\n <FormGroup>\n <Label for=\"description\">description:</Label>\n <Input type=\"textarea\" name=\"description\"\n value={props.new_task_form.description} onChange={update} />\n </FormGroup>\n <Button onClick={submit} color=\"primary\">create task</Button>\n <Button onClick={clear} color=\"secondary\">clear form</Button>\n </div>\n </div>\n </div>;\n}", "function submitEditTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n for (let i = 0; i < allTasksFromMemory.length; i++) {\r\n if (allTasksFromMemory[i].id == currentlySelectedTask.id) {\r\n allTasksFromMemory[i].taskText = textInput.value;\r\n }\r\n }\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n\r\n currentlySelectedTask.querySelector(\".taskText\").innerHTML = textInput.value;\r\n\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "removeTask(e) {\n const index = e.target.parentNode.dataset.key;\n this.tasks.removeTask(index);\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "function newTask(e) {\n e.preventDefault();\n\n if(taskContent.trim() === \"\"){\n notifyError()\n return\n }\n\n const newTask = {\n content: taskContent,\n taskId: Math.random() * 10,\n checked: false,\n };\n\n setTasks([...tasks, newTask]);\n setTaskContent(\"\");\n }", "renderNewTaskSelection() {\n return (\n <form>\n <input type=\"text\" name=\"newTaskName\" value={this.state.newTaskName} onChange={this.handleNewTaskNameChange} />\n <button type=\"button\" onClick={this.handleAddNewTask}>Add New Task</button>\n </form>\n );\n }", "function endEdit(){\n // Reset task form and update UI\n displayTaskForm();\n updateUI()\n}", "function onAddTaskClicked(event) {\n // 2-1-1. Get what was typed in the text box on the form\n let taskName = newTaskInput.value; //Declear variable named 'taskName' to store the value of newTaskInput\n \n // 2-1-2. Update template as long and the input is not empty\n if (taskName != \"\") {\n \n // Update template\n let taskHTML = template.replace(\"<!-- TASK_NAME -->\", taskName);\n // Add to list: Insert HTML into DOM tree to update HTML\n todoListContainer.insertAdjacentHTML('beforeend', taskHTML);\n\n saveTask(taskName, false) //Not checked ?????\n }\n \n // 2-1-3. Clear the input box\n newTaskInput.value = \"\"; // clear the text box\n}", "addTask(e) {\n e.preventDefault();\n const value = this.addTaskForm.querySelector('input').value;\n if (value === '') return;\n this.tasks.createTask(new Task(value));\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "function add_task() {\n const task = NEW_TASK.value.trim();\n if (task !== '') {\n COMPLETE_ALL.checked = false;\n TASK_LIST.appendChild(create_task(task, false));\n }\n NEW_TASK.value = '';\n save();\n}", "function clearTasks(e) {\n taskList.innerHTML = \"\";\n}", "function clearAll() {\n taskTitleInput.value = \"\";\n newTaskDisplay.innerHTML = \"\";\n}", "function createNewTask(e) {\r\n if (e.key == \"Enter\") {\r\n\r\n if (e.target.className == \"textInput\") {\r\n // If the user press enter in the insert task input\r\n\r\n let d = new Date();\r\n let task = {\r\n id: -1,\r\n taskText: e.target.value,\r\n taskDate: `${d.getDate()}, ${months[d.getDay()]}`,\r\n isChecked: false\r\n }\r\n\r\n let groupID = e.currentTarget.dataset.groupId;\r\n\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.addTask(task)\r\n updateGroup(res)\r\n\r\n e.target.parentNode.append(renderOneTaskElement(task, groupID))\r\n e.target.value = \"\"\r\n rerenderGroupElement(res)\r\n })\r\n // ==========================================================\r\n\r\n\r\n } else if (e.target.className == \"taskText\") {\r\n // If the user press enter in the task input\r\n\r\n let taskID = e.target.parentNode.dataset.taskId;\r\n let groupID = e.currentTarget.dataset.groupId;\r\n\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.modifyTask(e.target.value, taskID);\r\n updateGroup(res)\r\n\r\n rerenderGroupElement(res)\r\n })\r\n // ==========================================================\r\n\r\n } else if (e.target.tagName == \"INPUT\") {\r\n // If the user press enter in the group title input\r\n let value = e.target.value\r\n let heading = document.createElement(\"h1\")\r\n heading.innerText = value;\r\n e.target.parentNode.classList.remove(\"edit\")\r\n\r\n\r\n groupID = e.target.parentNode.parentNode.id;\r\n // =========================================================\r\n getGroup(Number(groupID)).then((res) => {\r\n\r\n res.name = value\r\n updateGroup(res)\r\n\r\n rerenderGroupElement(res)\r\n e.target.replaceWith(heading)\r\n })\r\n // ==========================================================\r\n\r\n\r\n }\r\n }\r\n}", "doTaskUndone(target) {\n let index = [...target.parentElement.children].indexOf(target);\n this.doneTaskArr.splice(index - 1, 1);\n this.undoneTaskArr.push(target.children[0].value);\n this.taskToLocal(\"undoneTask\", this.undoneTaskArr);\n this.taskToLocal(\"doneTask\", this.doneTaskArr);\n const task = new Task(target.children[0].value);\n this.taskListUnDone.appendChild(task.createUndoneTask());\n target.remove();\n }", "static newTaskSubmit() {\n const newTaskData = document.querySelector('#newTaskData').elements;\n const name = newTaskData[0].value;\n const dueDate = newTaskData[2].value;\n const priority = () => {\n const radioHigh = document.querySelector('#radioTaskHigh')\n const radioMed = document.querySelector('#radioTaskMed')\n const radioLow = document.querySelector('#radioTaskLow')\n if (radioHigh.checked) return 3;\n else if (radioMed.checked) return 2;\n else if (radioLow.checked) return 1;\n }\n const notes = newTaskData[1].value;\n const _currentTask = new Task(currentProject.id, currentTask.id, `${name}`, `${notes}`, `${dueDate}`, +priority(), false);\n const overlay2 = document.querySelector('#overlay2');\n overlay2.style.display = 'none';\n currentProject.addTask(_currentTask);\n ProjectLibrary.getSharedInstance().saveProject(currentProject);\n DomOutput.loadTaskList(currentProject);\n document.querySelector('#newTaskData').reset();\n }", "function handleAddTask(e) {\n const taskName = taskNameRef.current.value\n if (taskName === '') return e.preventDefault()\n setTasks(prevTask => {\n return [...prevTask, { \n id: uuidv4(), \n name: taskName, \n complete: false\n }]\n })\n taskNameRef.current.value = null\n\n e.preventDefault()\n }", "function clearForm() {\n that.data = {\n taskDate: {}\n };\n }", "clearNewTodo() {\n\t\tthis.$newTodo.value = '';\n\t}", "newCommonTask () {\n\t\tconst { dispatch, auth } = this.props\n\t\tconst assignee = Users.getUserById(auth.user.id)\n\n\t\tREST.rm(`issues.json`, data => {\n\t\t\tdispatch(addIssue(data.issue))\n\t\t\tREST.gl(`projects/${systems.gitlab.projectId}/issues`, data => {\n\t\t\t\tthis.newWrapper.style.display= 'none'\n\t\t\t\tthis.newDescription.value = ''\n\t\t\t\tthis.newTitle.value = ''\n\t\t\t\tdispatch(addGitlabIssue(data))\n\t\t\t}, 'POST', {\n\t\t\t\tlabels: 'To Do,' + (assignee.ids.gl === 4 ? 'Frontend' : 'Backend'),\n\t\t\t\tassignee_id: assignee.ids.gl,\n\t\t\t\ttitle: `${data.issue.id} - ${this.newTitle.value}`,\n\t\t\t\tdescription: this.newDescription.value,\n\t\t\t})\n\t\t}, 'POST', {\n\t\t\tissue: {\n\t\t\t\tproject_id: systems.redmine.projectId,\n\t\t\t\tstatus_id: statuses.idle.rm,\n\t\t\t\tsubject: this.newTitle.value,\n\t\t\t\tdescription: this.newDescription.value,\n\t\t\t\tassigned_to_id: assignee.ids.rm,\n\t\t\t}\n\t\t})\n\t}", "function addTask() {\n console.log('addTask called')\n if (!!taskInputValue) { // makes sure that taskInputValue is not blank\n setToDoArray(toDoArray.concat(taskInputValue))\n setTaskInputValue('')\n }\n }", "clearTasks(){\n const taskList = document.getElementById(\"taskList\");\n taskList.innerHTML = '';\n }", "function completeTask()\n {\n var butId=this.id;\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n var ID = parent.id;\n var value = child.innerText;\n if (ID == \"taskList\")\n {\n // to move to completed\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n obj.taskCompletedArr.push(value);\n this.innerHTML=\"&#10227;\";\n }\n else \n {\n //to be sent to pending again\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n obj.taskListArr.push(value);\n this.innerHTML=\"&#10004\";\n }\n \n dataStorageUpdt();\n var target = (ID=='taskList')?document.getElementById('taskListCompleted'):document.getElementById('taskList');\n parent.removeChild(child);\n target.insertBefore(child, target.childNodes[0]);\n }", "function addTask() {\n // Create task\n let newTask;\n \n // Get task name from form\n taskName = $(\"#task-input\").val()\n\n // Add caracteristics to newTask\n newTask = new Task(taskName, false, tasks.length);\n\n // Add task to list of tasks\n tasks.push(newTask);\n\n // Reset value of field\n $(\"#task-input\").val(\"\")\n updateUI();\n\n}", "handleInputChange(e) {\n //always use setState to change the state of an element\n this.setState({\n task: e //setting the task the user enters to e for recording\n })\n }", "function editTask() {\n vm.task = {};\n jQuery('#editTaskModal').modal('hide');\n }", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "handleInputChange(event){\n // console.log('Some text changed', event.target.value);\n let newTask = event.target.value;\n let validateMsg = this.state.validateMsg;\n // console.log(newTask)\n\n this.setState({\n task: newTask\n });\n\n if(newTask.length != 0){\n validateMsg = \"\";\n this.setState({\n validateMsg: validateMsg\n });\n }\n }", "onChangeTask(e) {\n this.setState({\n task: e.target.value\n });\n }", "function renderTask() {\n // e.preventDefault();\n //creates task item\n const todos = document.createElement(\"li\");\n todos.classList.add(\"todos\");\n //creates checkbox\n const checkBox = document.createElement(\"input\");\n checkBox.classList.add(\"checkbox-list\");\n checkBox.setAttribute(\"type\", \"checkbox\");\n //creates list item\n const listItem = document.createElement(\"li\");\n listItem.classList.add(\"listItem\");\n listItem.innerHTML = inputValue.value;\n //creates X icon to delete item\n const xIcon = document.createElement(\"img\");\n xIcon.classList.add(\"xClose\");\n // xIcon.setAttribute(\"src\", \"../images/icon-cross.svg\");\n //EDIT BUTTON\n const EditBtnsWrapper = document.createElement(\"span\");\n EditBtnsWrapper.classList.add(\"EditBtnsWrapper\");\n //EDIT BUTTON\n const editButton = document.createElement(\"button\");\n editButton.innerHTML = '<i class=\"fas fa-paperclip\"></i> ';\n editButton.classList.add(\"edit-btn\");\n editButton.addEventListener(\"click\", () => {\n listItem.setAttribute(\"contentEditable\", true);\n listItem.focus();\n });\n //appends items to list\n EditBtnsWrapper.append(editButton, xIcon);\n todos.append(checkBox, listItem, EditBtnsWrapper);\n // todoList.appendChild(todos);\n todoList.insertBefore(todos, todoList.firstChild);\n\n inputValue.value = null;\n inputValue.focus();\n listItems++;\n itemsValue();\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "function reset() {\n processText(task.text);\n remark();\n }", "function addTask() {\n\n //creates copy of task object\n let taskCopy = Object.assign({}, task);\n\n //reads values from inputs\n let inputText = document.getElementById(\"task-entry-box\").value;\n let taskPosition = taskArr.length + 1;\n let i = taskArr.length;\n\n if(inputText === '')\n {\n alert('Please, write something!'); //shows message if text input is empty\n }\n else \n {\n //assign task object the values\n taskCopy.position = taskPosition;\n taskCopy.text = inputText;\n taskCopy.finished = 0; //new task unfinished by default\n\n //includes new task in task array\n taskArr.push(taskCopy);\n\n //Deletes 'no tasks' message when adding first task\n if(taskCopy.position === 1)\n {\n document.getElementById(\"tasks-container\").innerHTML = '';\n };\n \n //adds task to page\n addTaskToPage(i);\n\n //checks checkboxes because everytime a task is added, all checkboxes get unchecked\n checksCheckBoxes();\n\n //clears text input after adding task\n document.getElementById(\"task-entry-box\").value = '';\n };\n\n\n}", "submitButtonClicked() {\n document.getElementById(\"tasksFilter\").value = \"All Tasks\";\n if (editedTask) {\n editedTask = false;\n this.tasksList[s].name = taskForm.taskSubject.value;\n this.tasksList[s].description = taskForm.taskDescription.value;\n this.tasksList[s].assignee = taskForm.taskAssignee.value;\n this.tasksList[s].status = taskForm.taskStatus.value;\n this.tasksList[s].date = taskForm.taskDate.value;\n this.tasksList[s].time = taskForm.taskTime.value;\n this.refreshPage(this.tasksList);\n } else {\n this.addTask(\n taskForm.taskSubject.value,\n taskForm.taskDescription.value,\n taskForm.taskAssignee.value,\n taskForm.taskStatus.value,\n taskForm.taskDate.value,\n taskForm.taskTime.value\n );\n }\n }", "function createTaskElement(taskID, text) {\n const tasksContainer = document.getElementById('tasks');\n const box = document.createElement('div');\n box.classList.add('box', 'content');\n box.id = taskID;\n\n const task = document.createElement('p');\n task.classList.add('is-size-4');\n task.innerText = text;\n\n // allow users to edit existing tasks by clicking on them\n task.addEventListener('click', function() {\n const input = createInputElement('');\n input.classList.add('edit-input');\n input.value = task.innerText;\n\n input.addEventListener('keypress', (e) => { if (e.keyCode === 13) saveTaskEdit(); });\n input.addEventListener('blur', saveTaskEdit);\n\n function saveTaskEdit() {\n task.innerText = input.value;\n storeTask(box.id, input.value);\n input.replaceWith(task);\n }\n\n task.replaceWith(input);\n });\n\n const deleteButton = document.createElement('button');\n deleteButton.classList.add('btn-delete', 'is-hidden');\n deleteButton.innerHTML = '<i class=\"fas fa-lg fa-trash\"></i>';\n\n deleteButton.addEventListener('click', function() {\n deleteTask(box.id);\n tasksContainer.removeChild(box);\n });\n\n box.addEventListener('mouseover', function() {\n deleteButton.classList.remove('is-hidden');\n });\n\n box.addEventListener('mouseout', function() {\n deleteButton.classList.add('is-hidden');\n });\n\n box.append(deleteButton);\n box.append(task);\n\n tasksContainer.prepend(box);\n}", "function taskTextInput(){\n\t// If error was displayed and user is focusing/clicking on textfield input to take corrective action\n\tif (document.getElementById(\"errorMsgCont\").innerText !== \"\"){\n\t\tdocument.getElementById(\"errorMsgCont\").innerText = \"\";\n\t\tdocument.getElementById(\"taskTitle\").value = \"\";\n\t}\n}", "handleBlur() {\r\n const { task } = this.props;\r\n if (task.title !== this.state.title) {\r\n task.title = this.state.title;\r\n this.props.updateTask(task);\r\n }\r\n }", "function handleTaskInputChange(e) {\n setTodo({ ...todo, task: e.target.value });\n }", "updateTask() { \r\n\r\n }", "function createTask(todo, parent) {\n let column = createElement({ class: 'col-md-4' });\n let taskField = createElement({ class: 'task d-flex' });\n taskField.style.background = todo.color;\n\n // <p>{inputValue}</p>\n let taskText = createElement('p');\n taskText.innerHTML = todo.todo;\n taskField.appendChild(taskText);\n\n // <i class=\"far fa-times-circle ms-auto\" ></i>\n let taskDelete = createElement('i', {\n class: 'far fa-times-circle ms-auto',\n });\n taskDelete.addEventListener('click', () => {\n fetch(`${BASE_URL}/${todo.id}`, { method: 'DELETE' });\n parent.removeChild(column);\n });\n taskField.appendChild(taskDelete);\n\n let controlPanel = createTaskController(taskField, todo.id);\n controlPanel.style.display = 'none';\n taskField.appendChild(controlPanel);\n\n // When mouseover in taskField, controlPanel Show\n taskField.addEventListener('mouseover', () => {\n controlPanel.style.display = 'flex';\n });\n\n // When mouseout from taskField, controlPanel Hide\n taskField.addEventListener('mouseout', () => {\n controlPanel.style.display = 'none';\n });\n\n column.appendChild(taskField);\n parent.appendChild(column);\n}", "function clearTaskWindow() {\n $(\"#taskWindow .inputbox\").val(\"\");\n $(\"#taskWindow textarea\").val(\"\");\n\n //Update list of current backlog items \n createCurrentBacklogList();\n}", "function handleAddClick() {\n console.log('add button clicked');\n let newTask = {};\n //puts input fields into an object\n newTask.task = $('#taskIn').val();\n newTask.type = $('#homeOrWork').val();\n newTask.notes = $('#notesIn').val();\n addTask(newTask);\n $('#taskIn').val('');\n $('#notesIn').val('');\n}", "function inputTodo(){\n var taskInput;\n taskInput = document.getElementById(\"task-input\").value; //get text from inputbox\n if(taskInput ==''){ //check if input is blank\n document.getElementById(\"task-input\").placeholder = 'Task cannot be blank';\n }\n else{\n addToList(taskInput);\n document.getElementById(\"task-input\").value = ''; //clear the input box\n document.getElementById(\"task-input\").placeholder = ''; //remove 'task cannot be blank' message if it was displayed\n }\n}", "function editTask(self){\n clearInterval(timeVar);\n var neededId = getNeededId(self);\n sel = '#editor_' + neededId;\n StringToAppend = correctorForm({Id: neededId});\n $(sel).append(StringToAppend);\n $(\".corrector\").on(\"click\", function(){\n var submitCorrection = submitCorrectedData(this);\n del_sel = '#'+neededId;\n $(del_sel).remove();\n });\n}", "get template(){\n return `\n <div class=\"col-3 mt-3 p-3 border rounded bg-light tasks\" style=\"margin: 1em;\">\n <h1 class=\"text-left border-bottom\" id=\"name\">${this.name}<button class=\"btn btn-outline btn-danger\" onclick=\"app.listController.removeList('${this.id}')\">X</button></h1>\n\n \n ${this.drawTask()}\n \n <form style=\"margin-bottom: 1em;\" onsubmit=\"app.listController.createTask(event,'${this.id}')\">\n <div class=\"input-group mb-3\">\n <input id=\"task\" type=\"text\" class=\"form-control\" placeholder=\"Add Task\" aria-label=\"task\" aria-describedby=\"task-addon\">\n <div class=\"input-group-append\">\n <button class=\"btn btn-outline-secondary\" type=\"submit\">+</button>\n </div>\n </div>\n </form>\n </div>\n `;\n }", "submit_task(newTask) {\n this.error = false;\n this.error_message = \"\";\n this.success_message = \"\";\n if (!newTask) {\n // undefined input\n this.error = true;\n this.error_message = \"Task is undefined\"\n } else {\n if (newTask.length === 0) {\n // empty input\n this.error = true;\n this.error_message = \"Task is empty !\";\n } else {\n // INSERT\n let taskToAdd = {\n text: newTask,\n createdAt: new Date,\n owner: Meteor.userId(),\n username: Meteor.user().username\n };\n this.add_task(taskToAdd);\n this.newTask = \"\"; // reset task field to \"\"\n this.error = false; // reset error\n this.error_message = \"\"; // reset error message\n this.success_message = \"Added with success.\";\n }\n }\n }", "function prependTask(task) {\n $('.new-task-container').prepend(`\n <div id='${task.id}' class='new-task-article ${task.status}'>\n\t\t\t<div class=\"completed-btn-container\">\n\t\t\t\t<button class='completed-btn' type='button'>${task.status}</button>\n\t\t\t</div>\n\t <div class='text-wrapper'>\n\t\t\t\t<p class='new-task-header' role=\"textbox\" aria-multiline=\"true\" contenteditable>${task.title}</p>\n\t \t<button class='delete-image' type='button' name='button'></button>\n\t\t\t\t<p class='new-task-body' role=\"textbox\" aria-multiline=\"true\" contenteditable>${task.task}</p>\n\t\t\t</div>\n\t <section class='new-task-footer'>\n\t\t\t\t<button class='upvote-image' type='button' name='button'></button>\n\t\t\t\t<button class='downvote-image' type='button' name='button'></button>\n\t \t<h3 class='h3-footer'>priority: &nbsp;&nbsp; </h3><h3 class=\"priority-value\">${task.priority}</h3>\n\t </section>\n </div>\n `);\n $('.input-title').val('');\n $('.input-task').val('');\n}", "handleAddNewTask() {\n this.addNewTask(this.state.newTaskName);\n }", "function okEdit(){\n\n if(document.getElementById(\"edit-task-entry-box\").value === '')\n {\n alert('Please, write something!'); //shows message if text input is empty\n }\n else\n {\n //gets button id\n let id = idGlobal;\n\n //gets task position from button id\n let taskPosition = id.substr(id.length - 1); \n\n //changes task text propert to new text\n taskArr[taskPosition-1].text = document.getElementById(\"edit-task-entry-box\").value;\n\n //rewrites task list\n rewritesList();\n\n //rechecks boxes\n checksCheckBoxes();\n\n //rechanges the style of completed tasks\n ChangeStyle();\n\n //closes edit box\n closeEditBox();\n };\n\n}", "static clearFieldsCreate() {\n document.getElementById(\"input_task\").value = \"\";\n document.getElementById(\"input_description\").value = \"\";\n document.getElementById(\"input_work_time\").value = \"25\";\n document.getElementById(\"input_long_break\").value = \"15\";\n document.getElementById(\"input_short_break\").value = \"5\";\n\n //This is the word counter of the description field\n document.getElementById(\"cant_characters\").innerText = \"0/100\";\n\n ListBinding.fillStarCrateTask(1);\n }", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function clearFields(action) {\r\n taskInput.value = \"\";\r\n taskDate.value = \"\";\r\n\r\n // action parameter refers to the state of let result = 'ok' ||''.\r\n if (action){\r\n messageText.innerText = 'Task added succesfully in list.';\r\n messageText.classList.add('successMessage');\r\n messageText.classList.remove('errorMessage');\r\n taskInputContainer.classList.remove('expand');\r\n\r\n setTimeout(function () {\r\n message.classList.remove('show');\r\n }, 1500);\r\n\r\n } else {\r\n messageText.innerText = \"\";\r\n messageText.classList.remove('errorMessage', 'successMessage');\r\n taskInputContainer.classList.remove('expand');\r\n }\r\n}", "function addTask(e) {\n e.preventDefault();\n if (taskInput.value === \"\") {\n swal(\"Task can't be Empty, Please add a Task!\");\n } else {\n let noTaskToShow = document.querySelector(\".noTask-Msg\");\n if (noTaskToShow) {\n noTaskToShow.remove();\n }\n \n let newTaskContainer = document.createElement(\"div\");\n newTaskContainer.classList =\n \"displayed-tasks padding-10px flex-elements width-65 border-Rad\";\n\n let newAddedTask = document.createElement(\"div\");\n newAddedTask.classList = \"added-task borderRad wow slideInLeft\";\n\n let newTaskText = document.createTextNode(taskInput.value);\n\n let taskDeleteButton = document.createElement(\"i\");\n taskDeleteButton.classList = \"fas fa-trash delete wow slideInRight\";\n\n newAddedTask.appendChild(newTaskText);\n newTaskContainer.appendChild(newAddedTask);\n newTaskContainer.appendChild(taskDeleteButton);\n container.appendChild(newTaskContainer);\n saveToLocalStorage(taskInput.value);\n taskInput.value = \"\";\n taskInput.focus();\n\n}\n}", "function addTask(id, taskManager, projectName) {\n \n //content HTML parent\n const content = document.getElementById(\"content\");\n\n //the container\n const addNewTaskDiv = document.createElement(\"div\");\n addNewTaskDiv.id = \"add-new\";\n \n //contains the form with display-none\n const hiddenContainer = document.createElement(\"div\");\n hiddenContainer.classList.add(\"hidden-container\");\n hiddenContainer.style.display = \"none\";\n \n //contains submit and cancel btns\n const hiddenButtons = document.createElement(\"div\");\n hiddenButtons.classList.add(\"hidden-buttons\");\n hiddenButtons.style.display = \"flex\";\n \n //the form where user inputs task info\n const form = formConstructor(\"add-task\");\n hiddenContainer.appendChild(form);\n \n //add task btn\n const addNewBtn = btnConstructor(\"add-new-btn\", \"+\", \"block\");\n \n //on click display hidden form and hide add task btn\n addNewBtn.addEventListener('click',() => {\n\n toogleVisibility(hiddenContainer, \"block\");\n toogleVisibility(addNewBtn, \"none\");\n });\n addNewTaskDiv.appendChild(addNewBtn);\n \n //submit btn\n const submitBtn = btnConstructor(\"submit-btn\", \"Submit\", \"block\");\n \n //on click event triggers task creation logic\n submitBtn.addEventListener(\"click\", () => {\n //gets values from the input fields and returns and array\n const valuesArray = getValuesForm(\"add-task\");\n //if input != empty\n if(formValidation(valuesArray)) {\n \n taskItem(id, projectName); //create the DOM element \n const taskObj = new Task (id, valuesArray[0], valuesArray[1], valuesArray[2], valuesArray[3]); //create the coresponding object\n taskManager.set(`task-${id}`, taskObj); //map() stores the obj\n localStorage.setItem(nameForLocalStorage(projectName), JSON.stringify(Array.from(taskManager.entries())));//localy store map() with the projects name\n id ++;\n localStorage.setItem(\"id\", id); //localy store id\n setTask(taskObj); //fills the DOM element with the taskobj values\n clearForm(\"add-task\"); //clears form\n toogleVisibility(hiddenContainer, \"none\");\n toogleVisibility(addNewBtn, \"block\");\n document.getElementById(\"all-required\").style.display = \"none\";\n\n }else {\n\n document.getElementById(\"all-required\").style.display = \"block\";\n }\n });\n hiddenButtons.appendChild(submitBtn);\n \n //cancel button\n const cancelBtn = btnConstructor(\"cancel-btn\", \"Cancel\", \"block\");\n \n //cancels the form and hides it\n cancelBtn.addEventListener(\"click\", () => {\n\n document.getElementById(\"all-required\").style.display = \"none\";\n toogleVisibility(hiddenContainer,\"none\");\n toogleVisibility(addNewBtn, \"block\");\n clearForm(\"add-task\");\n });\n hiddenButtons.appendChild(cancelBtn);\n \n //append all elements to the DOM element\n hiddenContainer.appendChild(hiddenButtons);\n addNewTaskDiv.appendChild(hiddenContainer);\n content.appendChild(addNewTaskDiv);\n}", "onInput(e) {\n const task = e.target.value;\n this.autocompletion.suggest(task)\n this.currentPomodoro.changeTask(task);\n this.dispatch();\n }", "function addTask(e) {\n e.preventDefault();\n\n if (taskDescription.value === '') {\n popup.classList.add('show');\n } else {\n popup.classList.remove('show');\n appendListItem(taskDescription.value);\n taskDescription.value = '';\n }\n}", "function addTask(inputTask = document.getElementById(\"task-input\").elements[0].value, location = getLocation()) {\n var newCheck = document.createElement(\"input\");\n newCheck.setAttribute(\"type\", \"checkbox\")\n newCheck.setAttribute(\"value\", \"finished\")\n newCheck.addEventListener('change', function() {\n if (this.checked) {\n removeTasks(newCheck, newTask, newBreak);\n } else {\n console.log(\"error removing item\");\n }\n });\n\n var newTask = document.createElement(\"label\");\n newTask.setAttribute(\"id\", index)\n var node = document.createTextNode(\" \" + inputTask);\n newTask.appendChild(node);\n\n var newBreak = document.createElement(\"br\");\n\n var section = document.getElementById(location);\n section.appendChild(newCheck);\n section.appendChild(newTask);\n section.append(newBreak);\n\n //save task to local storage\n localStorage.setItem(index, inputTask + \"$*!\" + location);\n newIndex();\n\n document.getElementById('task').value=''; \n}", "function addTask(task){\n if(input.value === \"\") {\n return;\n } else {\n const text = input.value;\n const item = `<li><input type=\"checkbox\" class=\"complete_task\">${text}<label><input type=\"radio\" name=\"incomplete_task\"> </label>\n </li>`;\n const position = \"beforeend\";\n list.insertAdjacentHTML(position,item);\n id++;\n form.reset(); \n }\n}", "function editTask()\n {\n var parent = this.parentNode;\n var edited = prompt (\"Enter the new title..\");\n parent.firstChild.innerHTML=edited;\n }", "addTask() {\n\t\tif (taskTitle.value !== undefined && taskTitle.value !== '') {\n\t\t\t//This next line adds the newly defined goal to an array of goals created in this session\n\t\t\tnewTaskList.push(taskTitle.value);\n\t\t\tconsole.log(`New Task List: ${newTaskList}`); //Goals are stored correctly\n\t\t\tthis.addTaskDOM(taskTitle.value, false);\n\t\t\tfetch('/items', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t 'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t body: JSON.stringify({\n\t\t\t\t\t title: taskTitle.value, \n\t\t\t\t\t goal_id: userGoals.goals[userGoals.goalIndex].id\n\t\t\t\t\t})\n\t\t\t })\n\t\t\t .then(res => res.json())\n\t\t\t .then(res => {\n\t\t\t\t userGoals.goals[userGoals.goalIndex].items.push(res);\n\t\t\t\t this.setId(res.id);\n\t\t\t\t})\n\t\t\t .catch(error => console.error(error));\n\n\t\t\ttaskTitle.value = '';\n\t\t\t\n\t\t\tcloseTaskForm();\n\t\t}\n\t\telse{\n\t\t\talert('Please enter new tasktitle');\n\t\t}\n\t\t// this.edit();\n\t}", "function clearNewTaskRow(obj)\n{\n const kids = obj.children();\n const taskNameBox = $(kids[2]);\n const taskNameInput = $(taskNameBox.children()[1]);\n clearVal(taskNameInput);\n const spoon = kids.filter(\".spoon\");\n for (let i = 0; i < spoon.length; i++) {\n let spoonBox = $(spoon[i]);\n let spoonForm = $(spoonBox.children()[1]);\n setVal(spoonForm,\"blank\");\n }\n}", "handleEditTask (task_id, new_task_name) {\n this.model.editTask(task_id, new_task_name);\n }", "function addNewTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n // dio za kreiranje novog taska:\r\n let newLi = document.createElement(\"li\");\r\n let textNode = document.createTextNode(\"\");\r\n newLi.appendChild(textNode);\r\n newLi.classList.add(\"task\", \"unfinished\");\r\n\r\n //dole je novo\r\n newLi.innerHTML =\r\n '<img class=\"emptyCircle\" src=\"SVG/empty-circle.svg\" onclick=\"completeTask(this)\"/><img class=\"tickedCircle\" src=\"SVG/ticked-circle.svg\"/><div class=\"textPartofTask\"><p class=\"taskText\">' +\r\n textInput.value +\r\n '</p><p class=\"taskDate\"></p></div><div class=\"right-task-buttons\"><img src=\"SVG/edit-circle.svg\" class=\"right-hidden-button editCircle\" onclick=\"footerVisibilitySwitch(\\'edit\\',this)\"/><img src=\"SVG/thrash-circle.svg\" class=\"right-hidden-button thrashCircle\" onclick=\"deleteTask(this)\"/><img src=\"SVG/date-circle.svg\" class=\"right-hidden-button dateCircle\" onclick=\"showCalendar(this)\"/><img src=\"SVG/options-circle.svg\" class=\"optionsCircle\" onclick=\"expandRightButton(this)\"/></div>';\r\n\r\n newLi.setAttribute(\"id\", taskCounter);\r\n document.querySelector(\".allTasksUl\").appendChild(newLi);\r\n\r\n let attrib;\r\n if (allTasksFromMemory) {\r\n attrib = {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n };\r\n } else {\r\n attrib = [\r\n {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n },\r\n ];\r\n }\r\n\r\n if (allTasksFromMemory) {\r\n allTasksFromMemory.push(attrib);\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n } else {\r\n localStorage.setItem(\"tasks\", JSON.stringify(attrib));\r\n }\r\n\r\n //skrivanje footera i clear-anje input forme\r\n taskCounter++;\r\n localStorage.setItem(\"taskCounter\", taskCounter);\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function submitTask(title, detail, date){\n taskInput.current.value = \"\";\n detailInput.current.value = \"\";\n dateInput.current.value = \"\";\n const task = {\n author_id: currentUser._id,\n title: title,\n detail: detail,\n dueDate: date\n };\n API.submitTask(task)\n .then(response=>{\n console.log(response);\n getTasks();\n }).catch(err=>{\n console.log(err);\n });\n }", "function displayTask(title) {\n\n /* create task display box */\n var task = document.createElement('div');\n var taskDisplay = document.createElement('div');\n var taskH = document.createElement('h3');\n var deleteBtn = document.createElement('button');\n var clearFix = document.createElement('div');\n\n task.setAttribute('class','task panel panel-default');\n taskH.setAttribute('class', 'panel-body');\n\n taskH.textContent = title;\n deleteBtn.setAttribute('class','delete btn btn-danger');\n deleteBtn.textContent = 'Delete task';\n clearFix.setAttribute('class','clearfix');\n\n taskDisplay.appendChild(taskH);\n taskDisplay.appendChild(deleteBtn);\n taskDisplay.appendChild(clearFix);\n\n task.appendChild(taskDisplay);\n\n /* set up listener for the delete functionality */\n\n deleteBtn.addEventListener('click',function(e){\n evtTgt = e.target;\n evtTgt.parentNode.parentNode.parentNode.removeChild(evtTgt.parentNode.parentNode);\n browser.storage.local.remove(title);\n })\n\n /* create task edit box */\n var taskEdit = document.createElement('div');\n var taskTitleEdit = document.createElement('input');\n taskTitleEdit.setAttribute('class', 'taskHH');\n var clearFix2 = document.createElement('div');\n\n var updateBtn = document.createElement('button');\n var cancelBtn = document.createElement('button');\n\n updateBtn.setAttribute('class','update btn btn-success');\n updateBtn.textContent = 'Update task';\n cancelBtn.setAttribute('class','cancel btn btn-warning');\n cancelBtn.textContent = 'Cancel update';\n\n taskEdit.appendChild(taskTitleEdit);\n taskTitleEdit.value = title;\n taskEdit.appendChild(updateBtn);\n taskEdit.appendChild(cancelBtn);\n\n taskEdit.appendChild(clearFix2);\n clearFix2.setAttribute('class','clearfix');\n\n task.appendChild(taskEdit);\n\n taskContainer.appendChild(task);\n taskEdit.style.display = 'none';\n\n /* set up listeners for the update functionality */\n\n taskH.addEventListener('click',function(){\n taskDisplay.style.display = 'none';\n taskEdit.style.display = 'block';\n })\n\n cancelBtn.addEventListener('click',function(){\n taskDisplay.style.display = 'block';\n taskEdit.style.display = 'none';\n taskTitleEdit.value = title;\n })\n\n updateBtn.addEventListener('click',function(){\n if(taskTitleEdit.value !== title) {\n updateTask(title,taskTitleEdit.value);\n task.parentNode.removeChild(task);\n } \n });\n}", "function openTaskEditor() {\n const taskInput = this.parentNode.parentNode.querySelector('input');\n const taskName = this.parentNode.parentNode.querySelector('span');\n\n\n taskName.classList.add('d-none');\n\n taskInput.classList.remove('d-none');\n taskInput.classList.add('active-input');\n taskInput.value = taskName.textContent;\n\n\n window.addEventListener('keydown', editTask.bind(this));\n\n\n}", "function createNewTask(taskInput) {\n var newTask = document.createElement('li');\n var newTaskHeader = document.createElement('h1');\n var newTaskButtonDelete = document.createElement('button');\n var newTaskButtonComplete = document.createElement('button');\n\n newTaskButtonDelete.innerText = 'Delete';\n newTaskButtonDelete.classList.add('deleteTaskButton');\n newTaskButtonComplete.innerText = 'Complete';\n newTaskButtonComplete.classList.add('completeTaskButton');\n newTaskHeader.innerText = taskInput.value;\n newTask.appendChild(newTaskHeader);\n newTask.appendChild(newTaskButtonDelete);\n newTask.appendChild(newTaskButtonComplete);\n\n //cross out complete tasks on click of 'Complete' button\n newTaskButtonComplete.addEventListener('click',function(event) {\n\n //if it is not completed\n var taskText = this.parentElement.querySelector('h1');\n if (this.parentElement.className.indexOf('done') == -1) {\n taskText.style.textDecoration = 'line-through';\n taskText.style.color = 'grey';\n this.parentElement.classList.add('done');\n subtractCount();\n } else {\n taskText.style.textDecoration = 'none';\n taskText.style.color = 'initial';\n this.parentElement.classList.remove('done');\n addCount();\n }\n });\n\n //remove list item on click of 'Delete' button\n newTaskButtonDelete.addEventListener('click',function(event) {\n this.parentElement.parentElement.removeChild(this.parentElement);\n subtractCount();\n });\n\n addCount();\n\n return newTask;\n }", "function addTask(e){\n e.preventDefault();\n \n // 3. read what is inside the input / validate input\n const taskName = inputTask.value.trim();\n const taskDescr = inputDescription.value.trim();\n const taskDate = inputDate.value.trim();\n \n \n if (taskName.length > 0 && taskDescr.length > 0 && taskDate.length > 0) {\n const startBtn = el(\"button\", \"Start\", {className: \"green\"});\n const finishBtn = el(\"button\", \"Finish\", {className: \"orange\"});\n const deleteBtn = el(\"button\", \"Delete\", {className: \"red\"});\n \n const btnDiv = el(\"div\", [\n startBtn,\n deleteBtn,\n ], {className: \"flex\"});\n const task = el(\"article\", [\n el(\"h3\", taskName),\n el(\"p\", `description: ${taskDescr}`),\n el(\"p\", `Due Date: ${taskDate}`),\n btnDiv\n ])\n startBtn.addEventListener(\"click\", () => {\n progressDiv.appendChild(task);\n startBtn.remove();\n btnDiv.appendChild(finishBtn);\n })\n finishBtn.addEventListener(\"click\", () => {\n finishDiv.appendChild(task);\n btnDiv.remove();\n })\n deleteBtn.addEventListener(\"click\", () => {\n task.remove();\n })\n openDiv.appendChild(task);\n }\n }", "function addNewTask(e) {\n e.preventDefault();\n\n if (taskInput.value === '') {\n taskInput.style.borderColor = 'red';\n return;\n }\n\n const li = document.createElement('li');\n\n li.className = 'collection-item';\n\n li.appendChild(document.createTextNode(taskInput.value));\n\n const link = document.createElement('a');\n\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n\n li.appendChild(link);\n taskList.appendChild(li);\n taskInput.value = '';\n}", "removeTask () {\n\t\tthis.deleter.addEventListener('click', (e) => {\n\t\t\tfetch('/items/'+e.target.parentNode.parentNode.parentNode.childNodes[0].getAttribute('data-task'), {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\theaders: {\n\t\t\t\t'Accept': 'application/json',\n\t\t\t\t'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t\n\t\t\t})\n\t\t\t.then(res => res.text()) \n\t\t\t.then(res => console.log(res))\n\t\t\t.catch(error => console.error(error));\n\t\t\te.target.parentNode.parentNode.parentNode.remove();\n\t\t\tupdateProgess(numberOfCompletedTasks());\n\t\t});\n\n\t\t// We need to also remove tasks from the backend\n\t}", "function appendTaskClick() {\n\tvar value = document.getElementById(\"inputTask\").value; \n\tif (value) {\n\t\tdata.openTasks.push(value); //store in array \n\t \tdataObjectUpdated(); //update data storage \n\t \tcreateListElement(value); //display in DOM \n\t \ttask.value = \"\"; //clear input field \n\t}\n}", "handleSubmit(event) {\n console.log('A name was submitted: ' + this.state.taskName);\n event.preventDefault();\n this.props.addNewTask(this.state.taskName);\n this.setState({taskName: ''});\n }", "function createTask(e) {\n /* the data that is stored in allTasks variable is updated here with the localstorage */\n allTasks = JSON.parse(localStorage.getItem('data'));\n if (allTasks === null) {\n allTasks = [];\n }\n const newTask = {\n description: '',\n completed: false,\n index: allTasks.length + 1,\n };\n newTask.description = e;\n /* This procedure here verify if input text value contains nothing. */\n if (newTask.description === '') {\n document.getElementById('task').placeholder = 'this field cannot be blank';\n } else {\n allTasks.push(newTask);\n updateTasks(allTasks);\n }\n}", "handleNewTaskNameChange(e) {\n this.setState({newTaskName: e.target.value});\n }", "function deleteTask() {\n this.parentNode.parentNode.removeChild(this.parentNode);\n }", "function cancelTask() {\r\n\tvar parentdiv = $(event.target).parent(\"div\"); //div belonging to button clicked\r\n\tvar id = parentdiv.attr(\"id\").substring(4); //div id is always \"task###\" and we need the ###\r\n\r\n\tactiveTasks[id].traveling = -1;\r\n\tactiveTasks[id].repeat=0;\r\n\t$(parentdiv).find(\"button\").html(\"Returning home....\"); \r\n\t$(parentdiv).find(\"button\").prop('disabled', true);\r\n}", "function addTask(event) {\n event.preventDefault();\n\n let work = document.getElementById(\"work\").value;\n let time = document.getElementById(\"time\").value;\n\n var table = document.getElementById(\"table\");\n\n var row = table.insertRow(1);\n var cell0 = row.insertCell(0);\n var cell1 = row.insertCell(1);\n var cell2 = row.insertCell(2);\n var cell3 = row.insertCell(3);\n\n cell0.innerHTML = work;\n cell1.innerHTML = time;\n cell2.innerHTML = \"<button onclick=chDone(this) id=todo>&#x23F3</button>\";\n cell3.innerHTML = \"<button onclick=removeRow(this)>&#x274E</button>\";\n\n n++;\n work.value = time.value = null;\n document.getElementById(\"tasks\").innerHTML = n;\n}", "addTaskButtonAction(elementId) {\n let content = this.get('newTaskContent');\n // If there is some content, add the task\n if(content !== null && content !== undefined && content.length > 0) {\n this.actions.createTask.bind(this)(content);\n }\n // If no content just focus or refocus the bar\n else {\n this.actions.focusBar.bind(this)(elementId);\n }\n }", "add() {\n let selected = this.props.todo.selected;\n let input = document.getElementById('input-to-do');\n let val = input.value;\n\n if (val && !this.props.todo.editing) {\n this.props.addToDo(this.props.todo.todo, this.props.todo.totalToDos);\n input.value = '';\n } \n }", "function createNewTask(){\n var item = document.createElement('li'),\n listContent = document.createTextNode(inputValue.value);\n item.appendChild(listContent);\n //Preventing the Creation of an Empty Task\n if(inputValue.value ===''){\n alert(\"Please ADD a Task\");\n }else{\n taskContainer.prepend(item);\n document.getElementById(\"taskContents\").value = \"\";\n item.className = 'newitem';\n }\n //Creating a Clear button to Clear ALL Tasks\n function clearTasks(){\n item.parentNode.removeChild(item);\n }\n deleteButton.addEventListener('click', clearTasks);\n //Adding the Finished Tasks to the CompletedTask section\n function completeTask(){\n completedTaskContainer.prepend(item);\n }\n item.addEventListener('click', completeTask);\n function clearcompleteTasks(){\n completedTaskContainer.removeChild(item);\n }\n //Creating a Clear button to Clear Completed Tasks only\n deletecompleteButton.addEventListener('click', clearcompleteTasks);\n}", "function clearTasks(e) {\n const tasks = Array.from(taskList.children);\n if (tasks.length > 0){\n if (confirm('Clear all tasks?')) {\n tasks.forEach(function (task){\n task.remove();\n });\n }\n }\n taskInput.value = '';\n filter.value = '';\n localStorage.removeItem('tasks');\n\n e.preventDefault();\n}", "async clearInput(){\n await this.setState({\n newEmployee: \"\"\n });\n }", "function appendTask(value) {\n let newTask = taskTemplate(value);\n const {\n id,\n category\n } = value;\n let divClass = \"\";\n if (category == \"done\") {\n divClass = \".done\";\n $(divClass).append(newTask);\n $('#taskLabel' + id).css(\"text-decoration\", \"line-through\");\n $('#task' + id).attr(\"checked\", true);\n\n } else {\n divClass = \".todo\";\n $(divClass).append(newTask);\n }\n\n\n // Checks when the checkbox is changed and updates the task --> sends it to ToDo\n $('#task' + id).change(() => {\n if ('serviceWorker' in navigator && 'SyncManager' in window) {\n navigator.serviceWorker.getRegistration().then(registration => {\n registration.sync.register('needsSync');\n });\n\n }\n let category = $('#taskDiv' + id).parent().prop('className');\n changeTaskIsDone(value, category);\n\n });\n\n // Functions of the deleteIcon\n $('#deleteIcon' + id).click(() => {\n if ('serviceWorker' in navigator && 'SyncManager' in window) {\n navigator.serviceWorker.getRegistration().then(registration => {\n registration.sync.register('needsSync');\n });\n\n }\n\n deleteTask(id);\n });\n}", "function editTask(){\n document.getElementById('taskPopup').style.display = \"block\";\n var taskEdit = document.getElementById('taskEdit');\n taskEdit.focus();\n // Get the list inner text\n var targetItem = this.parentNode.parentNode;\n var targetParent = this.parentNode.parentNode.parentNode;\n var targetParentId = targetParent.id;\n var oldTask = targetItem.innerText;\n document.getElementById('taskEdit').value = oldTask;\n \n document.getElementById('done').addEventListener(\"click\", function(){\n var newTask = taskEdit.value;\n if(newTask){\n targetItem.innerText = newTask;\n appendButtons(targetItem);\n document.getElementById('taskPopup').style.display = \"none\";\n document.getElementById('item').focus();\n\n // Replace the content of the database with the edited content\n if(targetParentId ==\"outstanding\"){\n currentList.outstanding.splice(currentList.outstanding.indexOf(oldTask), 1,targetItem.innerText);\n localStorage.setItem(\"storedList\", JSON.stringify(currentList));\n }else{\n currentList.completed.splice(currentList.completed.indexOf(oldTask), 1, targetItem.innerText);\n localStorage.setItem(\"storedList\", JSON.stringify(currentList));\n }\n }\n \n });\n\n document.getElementById('cancel').addEventListener('click', function(){\n document.getElementById('taskPopup').style.display = \"none\";\n document.getElementById('item').focus();\n });\n\n\n}", "function addEmptyTask() {\n $(\"#taskList\").append(\n \"<task class=\\\"task\\\">\" +\n \"<text class=\\\"action\\\"></text> \" +\n \"<date class=\\\"action\\\"></date> \" +\n \"<button onclick='model.editTask(this)'>Edit</button> \" +\n \"<button onclick='model.deleteTask(this)'>Delete</button> \" +\n \"<label for=\\\"action\\\">Done</label> \" +\n \"<input class=\\\"checkBox\\\" onclick='model.updateTask(this)' type=\\\"checkbox\\\">\" +\n \"<br>\" +\n \"</task>\"\n );\n }", "function addToTasks() {\n\n //get value of the task and the description...\n var task = document.getElementById('task').value;\n var description = document.getElementById('description').value;\n\n var li = document.createElement(\"li\");\n var inputValue = \" Task: \" + task + \"\\nDescription: \" + description;//\n // console.log(f);\n var t = document.createTextNode(inputValue);\n li.appendChild(t);\n if (inputValue === '') {\n alert(\"Please type in a task!\");\n } else {\n document.getElementById(\"mytasks\").appendChild(li);\n }\n \n document.getElementById(\"task\").value = \"\";\n document.getElementById(\"description\").value = \"\";\n\n //add task and description to the added tasks section\n \n \n //console.log(task,description);\n // var x = document.getElementById(\"taskinfo\").firstChild;\n // console.log(x);\n // x.remove();\n\n // var y = document.getElementById(\"doneButton\").firstChild;\n // console.log(y);\n // y.remove();\n\n}", "handleTaskChange(event) {\n this.setState({title: event.target.value});\n }" ]
[ "0.6971168", "0.68635994", "0.6832812", "0.67408884", "0.6643608", "0.6583071", "0.6569322", "0.6560445", "0.65240586", "0.6503201", "0.648561", "0.64801806", "0.64697164", "0.6417042", "0.64090383", "0.6385186", "0.6384941", "0.63502544", "0.634172", "0.63192946", "0.6304765", "0.62942374", "0.6287197", "0.62701714", "0.62483734", "0.6242646", "0.6229018", "0.6224118", "0.6197262", "0.6189978", "0.6184203", "0.61424303", "0.61117977", "0.60817933", "0.60790753", "0.6077093", "0.6074815", "0.60625786", "0.6054873", "0.6038704", "0.6035299", "0.6034882", "0.60315645", "0.6024973", "0.60205364", "0.6016381", "0.6010659", "0.5986612", "0.5984422", "0.59822226", "0.5981043", "0.5951845", "0.59509826", "0.59484106", "0.5948204", "0.59464484", "0.59452015", "0.5941974", "0.5937004", "0.59300196", "0.59293133", "0.5927781", "0.5920016", "0.591825", "0.5911368", "0.5910697", "0.59058744", "0.59027207", "0.5891194", "0.58829015", "0.58794856", "0.58777666", "0.58763254", "0.5869228", "0.5866638", "0.5858351", "0.58540654", "0.5853473", "0.58534557", "0.585182", "0.5845267", "0.5841854", "0.58295554", "0.5823091", "0.58226687", "0.5806686", "0.5802752", "0.57950026", "0.57942027", "0.5791267", "0.5791127", "0.5787049", "0.5780176", "0.5778102", "0.5774292", "0.5773167", "0.5763359", "0.5763163", "0.57570255", "0.575623" ]
0.6557596
8
Maintain the input's state
handleChange(e){ let value = e.target.value; this.setState({ taskInput: value }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "update() {\n\t this.value = this.originalInputValue;\n\t }", "update() {\n\t if (this.originalInputValue === '') {\n\t this._reset();\n\t }\n\t }", "update() {\n if (this.originalInputValue === '') {\n this._reset();\n }\n }", "setInput(input) {\n this.input = input;\n this.setWindowState(0);\n }", "function backupInput() {\n lastInput = ELEMENTS.UPDATE_TEXTAREA.val();\n }", "handleInputChange() {\n this.setState({\n inputs: this._getInputs(),\n results: null,\n });\n }", "internalOnInput(event) {\n const me = this; // Keep the value synced with the inputValue at all times.\n\n me.inputting = true;\n me.value = me.input.value;\n me.inputting = false;\n me.trigger('input', {\n value: me.value,\n event\n });\n me.changeOnKeyStroke && me.changeOnKeyStroke(event); // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onInput\n }", "changeInput(e, input){\n const val = e.target.value;\n this.setState(prev => { // sets the state for that input to the value\n prev.inputs[input] = val;\n return prev;\n });\n }", "removeFromInput() {\n this._input = this._input.substring(0, this._input.length - 1);\n }", "onInputChange(event) {\n const currentValue = event.target.value;\n // bug - event.target.value will no longer exist inside setState\n // so have a variable to save it outside\n this.setState(() => ({ term: currentValue }));\n }", "onInput(e) {\n this.updateFilledState();\n }", "inputState() {\n var self = this;\n if (self.settings.controlInput) return;\n\n if (self.activeItems.length > 0 || !self.isFocused && this.settings.hidePlaceholder && self.items.length > 0) {\n self.setTextboxValue('');\n self.isInputHidden = true;\n addClasses(self.wrapper, 'input-hidden');\n } else {\n self.isInputHidden = false;\n removeClasses(self.wrapper, 'input-hidden');\n }\n }", "clearInputtedData() {\n this.inputtedData = {};\n }", "syncInputFieldValue() {\n const me = this,\n input = me.input;\n\n // If we are updating from internalOnInput, we must not update the input field\n if (input && !me.inputting) {\n // Subclasses may implement their own read only inputValue property.\n me.input.value = me.inputValue;\n\n // If it's being manipulated from the outside, highlight it\n if (!me.isConfiguring && !me.containsFocus && me.highlightExternalChange) {\n input.classList.remove('b-field-updated');\n me.clearTimeout('removeUpdatedCls');\n me.highlightChanged();\n }\n }\n me.updateEmpty();\n me.updateInvalid();\n }", "backupValue() {\n this.originalValue = this.textInputNode.value;\n }", "resetOnNextInput() {\n this._reset = true;\n }", "restoreValue() {\n this.textInputNode.value = this.originalValue;\n }", "onChangeInput() {\n this.setState({\n value: !this.state.value,\n manualChangeKey: !this.state.manualChangeKey,\n });\n }", "function resolve_input(state){\n var copy = copy_inputs();\n state[input_id] = copy[0] & ~copy[1];\n}", "clear() {\n this.input.clear();\n }", "function resetInput() {\n $scope.input.multiplicity = 'opt';\n delete $scope.input.newElementPath;\n delete $scope.input.definition;\n delete $scope.input.newNode\n $scope.input.newDatatype =$scope.dataTypes[0];\n }", "set Input(value) {\n this._input = value;\n }", "function inputChanged() {\n parseInput(this);\n getDataFromTable();\n }", "collectInput(value) {\n this.setState({\n input:value,\n })\n}", "internalOnInput(event) {\n const me = this;\n\n // Keep the value synced with the inputValue at all times.\n me.inputting = true;\n me.value = me.input.value;\n me.inputting = false;\n\n me.trigger('input', { value: me.value, event });\n\n me.changeOnKeyStroke && me.changeOnKeyStroke(event);\n\n // since Widget has Events mixed in configured with 'callOnFunctions' this will also call onInput\n }", "function userInputChanges(e) {\n setUserInput(e.target.value);\n }", "function initInput()\r\n{\r\n inputHead = null;\r\n inputTail = null;\r\n inputCurrent = null;\r\n inputLength = 0;\r\n lock = false;\r\n}", "get stateInput() {\n return this._state;\n }", "get stateInput() {\n return this._state;\n }", "_updateInput (input) {\n this.setState({ input })\n }", "function updateValue(){\n\n return inp.value = \"\";\n\n }", "setInputValue(event, row, col) {\n let {inputCheckingDummyData} = this.state;\n this.backupData[row][col] = event.target.value;\n\n inputCheckingDummyData[row][col] = event.target.value;\n\n this.setState({drawFlag: true});\n this.setState({inputCheckingDummyData: inputCheckingDummyData});\n }", "function refreshAndFocusInput(input) {\n input.value = null;\n input.focus();\n}", "function handleInput(e) {\n setInput(e.target.value);\n }", "handleInputChange(e) {\n const target = e.target;\n const value = target.value;\n const inputName = target.name;\n\n //Copy entry from state and then add changes\n let entryCopy = Object.assign({}, this.state.localEntry);\n entryCopy[inputName] = value;\n\n //Replace object in state with updated object\n this.setState ({\n localEntry: entryCopy\n })\n }", "changedInput() {\n\n\t\tlet {isValid, error} = this.state.wasInvalid ? this.validate() : this.state;\n\t\tlet onChange = this.props.onChange;\n\t\tif (onChange) {\n\t\t\tonChange(this.getValue(), isValid, error);\n\t\t}\n\t\tif (this.context.validationSchema) {\n\t\t\tlet value = this.getValue();\n\t\t\tif (this.state.isMultiSelect && value === '') {\n\t\t\t\tvalue = [];\n\t\t\t}\n\t\t\tif (this.shouldTypeBeNumberBySchemeDefinition(this.props.pointer)) {\n\t\t\t\tvalue = Number(value);\n\t\t\t}\n\t\t\tthis.context.validationParent.onValueChanged(this.props.pointer, value, isValid, error);\n\t\t}\n\t}", "onInput(event) {\n const input = event.target;\n // Let's wait for DOM to be updated\n nextTick().then(() => {\n this.$emit('update:modelValue', nullify(input.value));\n });\n }", "inputOnChange(e) {\n e.target.value = e.target.value;\n this.props.dispatch(updateStateText(e.target.value));\n }", "resetUserInput(){\n /*First we have to reset the saved inputs*/\n ResetUserInput();\n /*Then we have to tell react to update to the new values and after that completed the results should be recalculated*/\n this.setState({\n include: FilterUserInput.include,\n exclude: FilterUserInput.exclude,\n greater: FilterUserInput.greater,\n less: FilterUserInput.less,\n criteria: FilterUserInput.criteria,\n search: FilterUserInput.search,\n list: FilterUserInput.list\n }, this.reloadResult);\n }", "function takeInput(e) {\n e.preventDefault();\n inputVal = input.value \n input.value = ''\n getDataByApi()\n}", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "function startOperation() {\n updateInput = null; changes = []; textChanged = selectionChanged = false;\n }", "restoreOriginalState() {\n\n\t\tconst originalValueOffset = this.valueSize * 3;\n\t\tthis.binding.setValue( this.buffer, originalValueOffset );\n\n\t}", "updateInput(value) {\n this.setState({\n input: value \n })\n }", "handleInputChange(event) {\n let newState = {};\n newState[event.target.id] = event.target.value;\n this.setState(newState);\n }", "handleInputChange(e) {\n //always use setState to change the state of an element\n this.setState({\n task: e //setting the task the user enters to e for recording\n })\n }", "@action eventBinder() {\n var that = this;\n\n that.startPos = 0;\n that.endPos = 0;\n that.selection = '';\n that.lastchar = '\\n';\n that.previousValue = that.value;\n\n that.clearUndo();\n }", "handleInput(key, e) {\n \n /*Duplicating and updating the state */\n var state = Object.assign({}, this.state.newDish); \n state[key] = e.target.value;\n this.setState({newDish: state });\n }", "setLastUserInput(state, log) {\n state.lastUserInput = log;\n }", "function handleChange(e){\n setInput(e.target.value);\n }", "function MCH_InputChange(el_input) {\n console.log(\" ----- MCH_InputChange ----\")\n console.log(\" el_input\", el_input)\n mod_MCH_dict.has_changes = true;\n MCH_Hide_Inputboxes();\n }", "hideInput() {\n this.inputState();\n }", "onInputChange(event) {\n this.setState({ input: event.target.value });\n }", "function reset(input) {\n // YOUR SOLUTION HERE\n}", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "function Input() {}", "handleInput(event) {\n const target = event.target;\n const value = target.value;\n\n this.setState({\n input: value,\n output: this.formatAsTyped(value)\n });\n }", "_restoreInputValue(input, formattedVal) {\n // must blur for FF to reset value\n input.blur();\n input.value = formattedVal;\n this.toggleClass('validation-error', false, input);\n }", "updateUserInputVal(newValue) {\n this.setState({\n userInput: newValue\n })\n }", "handleInput(e) {\n if (this.props.onUpdate) { this.props.onUpdate(e.currentTarget.value) }\n }", "function input( v, state ){ \nvar newState = applsfn(v,state);\nreturn new State( applmfn(v,newState), newState ); \n}", "formStateRestoreCallback(state, mode) {\n this.value = state;\n this.onInput();\n }", "_inputPasteHandler() {\n const that = this;\n\n requestAnimationFrame(() => that.$.fireEvent('changing', { 'currentValue': that.$.input.value, 'validValue': that.value, 'radix': that._radixNumber }));\n }", "handleInput(e) {\n e.preventDefault()\n let name = e.target.name\n let newState = {}\n newState[name] = e.target.value\n this.setState(newState)\n }", "function updateInput( e ) {\r\n this.set( \"value\", e.newVal );\r\n }", "handleInputChange(key, e) {\n let newSelected = _.extend({}, this.state.releaseDocumentObject);\n newSelected[key] = e.target.value;\n\n // Update the state.\n this.setState({ releaseDocumentObject: newSelected });\n\n // Reset userSubmittedForm.\n this.setState({ userSubmittedForm: false });\n }", "onInputChange(e) {\n this.setState({\n input: e && e.target.value,\n });\n }", "onInputChange(e) {\n\n const newValue = {\n ...this.props.value,\n input: e.target.value\n };\n\n this.props.onChange({\n value: newValue\n });\n }", "valueChanged() {\n const inputEl = this.nativeInput;\n if (inputEl && inputEl.value !== this.value) {\n inputEl.value = this.value;\n }\n }", "handlePendingInput(input) {\n this.save(input);\n }", "handlePendingInput(input) {\n this.save(input);\n }", "function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "function resetInput(cm, typing) {\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "handleInput(oldState) {\n const { tr } = this;\n const { $cursor } = tr.selection;\n if ($cursor) {\n const { pos } = $cursor;\n const type = this.hasPlaceholder(oldState);\n const note = this.currentNote;\n if (!note && type) {\n const addedChars = charsAdded(oldState, tr);\n if (addedChars > 0) {\n const from = pos - addedChars;\n const to = pos;\n return this.addNotes([{ from, to, meta: { type } }], false, true);\n }\n }\n }\n\n return this;\n }", "onInputChange(event) {\n\t\treturn this.setState({ term: event.target.value });\n\t}", "function refreshInput(){\n document.getElementById('inputs').reset();\n}", "clearStates()\n {\n this.input.removeAllListeners('data');\n this.states = new Array();\n }", "function refresh(input) {\r\n\t\tupdateFromInput(input);\r\n\t}", "applyDelayedInputs() {\n if (!this.delayedInputs) {\n return;\n }\n let that = this;\n let delayed = this.delayedInputs.shift();\n if (delayed && delayed.length) {\n delayed.forEach(that.doInputLocal.bind(that));\n }\n this.delayedInputs.push([]);\n }", "handleInputChange(event){\n // console.log('Some text changed', event.target.value);\n let newTask = event.target.value;\n let validateMsg = this.state.validateMsg;\n // console.log(newTask)\n\n this.setState({\n task: newTask\n });\n\n if(newTask.length != 0){\n validateMsg = \"\";\n this.setState({\n validateMsg: validateMsg\n });\n }\n }", "function saveState () {\n if (self.searchTerm) {\n self.gridController.state[self.id] = self.searchTerm;\n } else {\n delete self.gridController.state[self.id];\n }\n }", "ManageInput(e){\n this.setState({\n currentItem:{\n text : e.target.value,\n key : Date.now()\n }\n })\n }", "function resetInput(cm, typing) {\r\n var minimal, selected, doc = cm.doc;\r\n if (cm.somethingSelected()) {\r\n cm.display.prevInput = \"\";\r\n var range = doc.sel.primary();\r\n minimal = hasCopyEvent &&\r\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\r\n var content = minimal ? \"-\" : selected || cm.getSelection();\r\n cm.display.input.value = content;\r\n if (cm.state.focused) selectInput(cm.display.input);\r\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\r\n } else if (!typing) {\r\n cm.display.prevInput = cm.display.input.value = \"\";\r\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\r\n }\r\n cm.display.inaccurateSelection = minimal;\r\n }", "function register_input(state){\n state[input_id] = input_flag_none;\n}", "get input() {\n\t\treturn this.__input;\n\t}", "function pleaseClear() {\n this.currentInput = \"\";\n console.log(\"Current input cleared\");\n console.log(\"Operator remains \" + this.operator + \" and memory remains \" + this.memory);\n this.displayCurrentInput();\n}", "undo(){\n let state = this.getState();\n for(let key in state) this[key] = state[key];\n }", "_iStateOnLeave() {\n this.touched = true;\n this.prefilled = !this._isEmpty();\n }", "function inputReady() {\n scores.add( new invaders.model.Score(newScore, scoreInput.input));\n that.models.remove(scoreInput);\n scoreInput = false;\n //scrores.putScores(); // save to server\n }", "_inputFocusHandler() {\n const that = this;\n\n if (that.spinButtons) {\n that.$.spinButtonsContainer.setAttribute('focus', '');\n }\n if (that.radixDisplay) {\n that.$.radixDisplayButton.setAttribute('focus', '');\n }\n if (that.showUnit) {\n that.$.unitDisplay.setAttribute('focus', '');\n }\n\n if (that.opened) {\n that._closeRadix();\n }\n\n that.setAttribute('focus', '');\n\n if (that.outputFormatString) {\n that.$.input.value = that._editableValue;\n }\n }", "input() {\n return this.input;\n }", "handleInput(e){\n // console.log(e.target.value, e.target.name); el valor, el name del input que se modifica\n const { value, name } = e.target;\n // Este evento nos permite alterar los valores de state\n this.setState({ // Cambiamos el dato del inicio\n [name]: value\n });\n console.log(this.state)\n }", "function InputState() {\n this.prefixRepeat = [];\n this.motionRepeat = [];\n\n this.operator = null;\n this.operatorArgs = null;\n this.motion = null;\n this.motionArgs = null;\n this.keyBuffer = []; // For matching multi-key commands.\n this.registerName = null; // Defaults to the unnamed register.\n }", "function InputState() {\n this.prefixRepeat = [];\n this.motionRepeat = [];\n\n this.operator = null;\n this.operatorArgs = null;\n this.motion = null;\n this.motionArgs = null;\n this.keyBuffer = []; // For matching multi-key commands.\n this.registerName = null; // Defaults to the unnamed register.\n }", "inputValueDidChange() {\n let value = parseInt(this.get('inputValue'), 10);\n this.set('value', isNaN(value) ? undefined : value);\n }", "function resetInput(cm, typing) {\n if (cm.display.contextMenuPending) return;\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }", "function resetInput(cm, typing) {\n if (cm.display.contextMenuPending) return;\n var minimal, selected, doc = cm.doc;\n if (cm.somethingSelected()) {\n cm.display.prevInput = \"\";\n var range = doc.sel.primary();\n minimal = hasCopyEvent &&\n (range.to().line - range.from().line > 100 || (selected = cm.getSelection()).length > 1000);\n var content = minimal ? \"-\" : selected || cm.getSelection();\n cm.display.input.value = content;\n if (cm.state.focused) selectInput(cm.display.input);\n if (ie && ie_version >= 9) cm.display.inputHasSelection = content;\n } else if (!typing) {\n cm.display.prevInput = cm.display.input.value = \"\";\n if (ie && ie_version >= 9) cm.display.inputHasSelection = null;\n }\n cm.display.inaccurateSelection = minimal;\n }" ]
[ "0.685485", "0.6784478", "0.6682718", "0.6661171", "0.6625464", "0.66195035", "0.6618487", "0.6459816", "0.64494205", "0.6446994", "0.64464784", "0.64404863", "0.6416027", "0.6390154", "0.6361348", "0.6342858", "0.6339924", "0.6317014", "0.62590057", "0.6246866", "0.624581", "0.6231719", "0.6218497", "0.6173746", "0.6169245", "0.6148192", "0.6130469", "0.6123192", "0.6123192", "0.6119123", "0.61066693", "0.6085034", "0.60683775", "0.6053566", "0.60504717", "0.60487354", "0.6044264", "0.60382146", "0.5992843", "0.5978151", "0.5976122", "0.5976122", "0.5976122", "0.5968334", "0.5964413", "0.5948858", "0.59459573", "0.5936581", "0.5934225", "0.59320295", "0.5923422", "0.5900814", "0.58957535", "0.58751124", "0.5867102", "0.58533734", "0.58533734", "0.58447194", "0.5836776", "0.5836409", "0.5832406", "0.5828576", "0.58274174", "0.58238626", "0.58085895", "0.5807111", "0.58067554", "0.57985777", "0.57823443", "0.5781505", "0.57811564", "0.5778145", "0.5778145", "0.577676", "0.577676", "0.577676", "0.577676", "0.5775793", "0.5769876", "0.5767611", "0.5748728", "0.57395166", "0.5736028", "0.572794", "0.5719925", "0.57167435", "0.5716612", "0.57091695", "0.5703734", "0.56993985", "0.5696424", "0.5693836", "0.5679288", "0.56687504", "0.56672746", "0.5667082", "0.56612253", "0.56612253", "0.5660277", "0.5659942", "0.5659942" ]
0.0
-1
You are given an oddlength array of integers, in which all of them are the same, except for one single number. Complete the method which accepts such an array, and returns that single different number. The input array will always be valid! (oddlength >= 3) Examples [1, 1, 2] ==> 2 [17, 17, 3, 17, 17, 17, 17] ==> 3
function stray(n) { n = n.sort((a, b) => a - b); return n[0] === n[1] ? n[n.length - 1] : n[0]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function doubleOddNumbers(arr) {}", "function solution (A) {\n const N = A.length\n\n if (N === 0) {\n // Empty A\n return A\n }\n\n if (N % 2 === 0 || N > 1000000) {\n // A does not contain an odd number of elements\n return A\n }\n\n if (A.find(x => (x < 1 || x > 1000000))) {\n // An A element is too small or too large\n return A\n }\n\n // Find unique elements\n const one = []\n\n for (let i = 0; i < A.length; i += 1) {\n const num = A[i]\n const index = one.indexOf(num)\n\n if (index === -1) {\n one.push(num)\n } else {\n one.splice(index, 1)\n }\n }\n // Find the unpaired number\n return one[0]\n}", "function findOdd(array) {\n let result;\n\n array.forEach(number => {\n if (array.filter(curValue => curValue === number).length % 2 === 1) {\n result = number;\n };\n });\n return result;\n}", "function findOdd(arr) {\n let n = 0;\n\n for (let i = 0; i < arr.length; i++) {\n let num = arr[i];\n n ^= num;\n }\n\n return n;\n}", "function findOdd(array) {\n //happy coding!\n for (let i = 0; i < array.length; i++) {\n let counter = 0;\n\n for (let j = 0; j < array.length; j++) {\n if (array[i] === array[j]) {\n counter++;\n }\n }\n\n if (counter % 2 !== 0) {\n return array[i];\n }\n }\n}", "function OddOccurrencesInArray(A) {\n var count, i;\n\n A.sort(function(x, y) {\n return x < y ? -1 : x > y ? 1 : 0;\n });\n \n for (i = 1, count = 1; i < A.length; i++) {\n if (A[i - 1] === A[i]) {\n count += 1;\n } else {\n if (count % 2 === 1) {\n return A[i - 1];\n } else {\n count = 1;\n }\n }\n }\n \n return A[A.length - 1];\n}", "function FirstNonRepeatingInt(arr) { \n //check if the 1st element is an integer and isn't repeated by the second element\n if(Number.isInteger(arr[0]) && arr[1] != arr[0]) {\n //if so, return the 0th index\n return arr[0];\n }\n let i =1;\n //loop through until nonrepeating int is found or until entire array is checked\n while(i<arr.length){\n //if it's an integer....\n if(Number.isInteger(arr[i])){\n //check the values before and after and if both are different...\n if(arr[i-1]!=arr[i] && arr[i+1] !=arr[i]){\n //return the current index\n return arr[i];\n }\n }\n //increment\n i++\n }\n //if through the entire array without an answer exit\n console.log('no non repeating integers')\n return(null);\n}", "function findOdd(A) {\n let unique = [...new Set(A)];\n\n let answer = null;\n\n unique.forEach(num => {\n if (A.filter(x => x === num).length % 2 !== 0) {\n return (answer = unique[unique.indexOf(num)]);\n }\n });\n\n return answer;\n}", "function missingNumberInArray(array) {\n var xorOfElements = array.reduce((a,b) => a ^ b);\n\n var xorOfRange ;\n for(var i = 0; i <= array[array.length - 1]; i++) {\n xorOfRange = xorOfRange ^ i;\n }\n\n return xorOfElements ^ xorOfRange;\n }", "function uniqueNumber(array) {\n const arr = array.filter((el, idx) => {\n if (array.indexOf(el) !== idx) return el;\n });\n const once = array.filter((el) => {\n if (!arr.includes(el)) return el;\n });\n return once.join();\n}", "function returnOdds(array) {\n}", "function findOdd(a) { \n for (var i = 0; i <a.length; i++ ){\n var current = a[i]; \n var result = 0;\n for (var y =0; y<a.length; y++){\n result = (current === a[y] ? result+1 : result); \n }\n console.log(current + \" -- \" + result);\n if (result % 2 == 1 || result == 1){\n return current;\n }\n }\n}", "function solution2(A) {\n let x1 = A[0]; // xor all elements in array\n let x2 = 1; // xor all elements from 1 to n+1 (n+1 since 1 number is missing)\n for (let i = 1; i < A.length; i++) {\n x1 ^= A[i];\n }\n for (let i = 2; i <= A.length + 1; i++) {\n x2 ^= i;\n }\n\n return x2 ^ x1;\n}", "function anyOddNumber(arr) {\n\t// Base case\n\tif (arr.length === 0) {\n\t\treturn false;\n\t}\n\tif (arr[0] % 2 === 1) {\n\t\treturn true;\n\t}\n\tconsole.log(\"arr:\", arr);\n\treturn anyOddNumber(arr.slice(1, arr.lenght));\n}", "function findOdd(arr) {\n let result = 0\n for(let i = 0; i < arr.length; i++) {\n for(let j = 0; j < arr.length; j++) {\n\n if(arr[i] === arr[j]) {\n result++\n }\n }\n if(result % 2 === 1) {\n return arr[i]\n }\n } \n}", "function findDuplicateUsingXOR(arr) {\n\n let xorOfArr = 0;\n\n for(let i =0; i< arr.length; i++){\n xorOfArr =xorOfArr ^ arr[i];\n }\n \n\n for (let i =0; i<= arr.length-2; i++){\n xorOfArr = xorOfArr ^ i;\n } \n \n return xorOfArr;\n}", "function returnFirstOddNumber(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tif (array[i] % 2 === 1) {\n\t\t\t\treturn array[i];\n\t\t\t}\n\t\t}\n\t}", "function oneAnother(arr){\nvar oddNumber = arr[0];\n\n\tif (arr.length < 2) {\n\t\tconsole.log(\"The array needs more numbers!\");\n\t} \n\n\telse {\n\t\tfor (var num = 0; num < arr.length; num++) {\n\t\t\tif (arr[num] % 2 == 0) {\n\t\t\t}\n\t\t\telse {\n\t\t\t\toddNumber = arr[num];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tconsole.log(arr[arr.length-2]);\n\treturn oddNumber;\n}", "function findOdd(numbers) {\n let count = 0;\n for(let i = 0; i < numbers.length; i++) {\n for(let j = 0; j < numbers.length; j++) {\n if (numbers[i] == numbers[j]) {\n count++;\n }\n }\n if (count % 2 != 0 ) {\n return numbers[i];\n }\n }\n }", "function oddNumbers(array) {\n var array = [];\n for(var i = 1; i < array.length; i++){\n if(i % 2 !== 0){\n array.push(i);\n }\n }\n return array;\n}", "function chekOddElements(array) {\n\n if (array.length % 2 == 1) {\n return true;\n }\n return false;\n\n}", "function findOdd(arr) {\n let obj = arr.reduce((a, c) => { !a[c] ? a[c] = 1 : a[c]++; return a }, {});\n let keys = Object.keys(obj);\n for (let i = 0; i < keys.length; i++) {\n if (obj[keys[i]] % 2 !== 0) return Number(keys[i]);\n }\n}", "function hasOdd(array) {\n var length = array.length;\n if (length % 2 == 1) {\n return true;\n } else return false;\n}", "function repeatedOnlyOnce(array) {\n \n}", "function collectOddValue(arr){\n let result = [];\n\n function helper(helperInput){\n if(helperInput.length === 0) return;\n\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0]);\n }\n\n helper(helperInput.slice(1));\n \n\n }\n\n helper(arr);\n\n}", "function findOdd(A) {\n let numbs = [];\n for (let i = 0; i < A.length; i++){\n if (!numbs.includes(A[i])){\n numbs.push(A[i])\n }\n }\n for(let z = 0; z < numbs.length; z++){\n let count = 0;\n for(let y = 0; y < A.length; y++){\n if (numbs[z] === A[y]){\n count += 1;\n }\n }\n if(count % 2 !== 0) return numbs[z]\n }\n \n}", "function findRepeats1(integers){\n\t// sort array in place. Takes O(n log n) time and O(1) space\n\tintegers.sort((a, b) => {\n\t\treturn a - b;\n\t});\n\n\tfor(let i = 0; i < integers.length; i++){\n\t\tif(integers[i] === integers[i - 1]){\n\t\t\treturn integers[i];\n\t\t}\n\t}\n\n\treturn 'Error no duplicates';\n}", "function findOdd(A) {\r\n let temp = A.map(String);\r\n let inc =0;\r\n for(let i = 0; i < temp.length ; i++){\r\n for(let j=0 ; j < temp.length ; j++){\r\n if(temp[i] == temp[j]){\r\n inc++;\r\n }\r\n }\r\n if(inc % 2 !==0){\r\n return parseInt(temp[i]);\r\n }\r\n }\r\n }", "function findOdd(A) {\n let count = 0;\n for (var i = 0; i < A.length; i++) {\n for (var j = 0; j < A.length; j++) {\n if (A[i] === A[j]) {\n count++;\n }\n }\n if (count % 2 != 0) {\n return A[i];\n }\n }\n}", "function doubleOddNumbers(arr) {\n\treturn arr.filter(function(val){\n\t\treturn val % 2 !== 0;\n\t}).map(function(val){\n\t\treturn val * 2;\n\t})\n}", "function doubleOddNumbers(arr) {\n\n var oddNumbers = arr.filter(function (value) {\n return value % 2 !== 0;\n });\n\n return oddNumbers.map(function (value) {\n return value * 2;\n });\n}", "function findOdd(A) {\n var n=0;\n var ans;\n while(n<A.length)\n {\n var indexes = [], i;\n for(i = 0; i < A.length; i++)\n if (A[i] === A[n])\n indexes.push(i);\n \n if(indexes.length%2===1)\n {\n ans=A[n];\n break;\n }\n n++;\n }\n return ans;\n}", "function findOddOneOut(wordArray) {\n let lengths = [];\n wordArray.forEach(word => {\n lengths.push(word.length); \n });\n \n let hasOneDistinct = false;\n let hasRestSame = false;\n lengths.forEach(length => {\n let numberOfInstances = lengths.filter(compareLength => compareLength === length).length;\n if (numberOfInstances === 1) {\n hasOneDistinct = true; \n } else if (numberOfInstances === wordArray.length - 1) {\n hasRestSame = true; \n }\n });\n \n return hasOneDistinct && hasRestSame;\n}", "function repeat(arr) {\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tfor (let j = i + 1; j < arr.length; j++) {\n\t\t\tif (arr[i] === arr[j]) {\n\t\t\t\treturn arr[i];\n\t\t\t}\n\t\t}\n\t}\n\treturn undefined;\n}", "function doubleOddNumbers(arr){\n return arr.filter(curVal => curVal%2 !==0).map(curVal => curVal*2);\n}", "function findDuplicate(arr) {\n \n \n}", "function removeEvenAndMultipliedOddNumbers(array) {\n return array.filter(o => o%2).map((o, i, arr) => o*arr.length)\n}", "function doubleOddNumbers(arr) {\n return arr.filter(function(val) {\n return val % 2 !== 0;\n }).map(function(val) {\n return val * 2;\n });\n }", "function func(array) {\n let length = array.length;\n let counter = 0;\n let repeatedArray = [], result = [];\n for (let i = 0; i < length; i++) {\n if (array[i] > 0) {\n repeatedArray = array.slice(i+1);\n counter = array[i];\n break;\n }\n }\n if (counter === 0) {\n return [];\n } else if (repeatedArray.length === 0) {\n return `[empty x ${counter}]`\n }\n\n for (let i = 0; i < counter; i++) {\n if (repeatedArray[i]) {\n result.push(repeatedArray[i])\n } else {\n result.push(repeatedArray[i%repeatedArray.length])\n }\n }\n return result\n}", "function findOdd(a) {\n a.sort((a,b)=> a-b)\n let count = a.lastIndexOf(a[0]) + 1\n return count %2 !== 0 ? a[0] : findOdd(a.splice(count))\n }", "function isUniform(array) {\n var mainNum = array[0];\n for(var i = 1; array[i] < array.length; i++){\n if(array[i] !== mainNum){ //array[i] !== mainNum ? return false;\n return false;\n }\n }\n return true;\n \n \n // array.forEach(function(num) {\n // if(num !== mainNum) {\n // return false;\n // } else {\n // return true;\n // }\n // }); \n}", "function findOdd(A) {\n var count = 0;\n for (let i = 0; i < A.length; i++) {\n for (let j = 0; j < A.length; j++) {\n if (A[i] === A[j]) {\n count++;\n }\n }\n if (count % 2 !== 0) {\n return A[i];\n }\n }\n return 0;\n }", "function onlyOddNumbers(arrayOfOddNumbers){\n var oddNumbers = [];\n for (let i = 0; i < arrayOfOddNumbers.length; i++) {\n if (isOdd(arrayOfOddNumbers[i])){\n // initial if argument arrayOfOddNumbers[i]%2 === 1, think it can work but have to figure it out this way\n oddNumbers.push(arrayOfOddNumbers[i]);\n }\n }\n return oddNumbers;\n}", "function collectOddValues(arr){\n \n let result = []\n\n function helper(helperInput){\n if(helperInput.length === 0) {\n return;\n }\n \n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n \n helper(helperInput.slice(1))\n }\n \n helper(arr)\n\n return result;\n\n}", "function findOdd(A) {\n var counter = 0;\n for(var i = 0; i < A.length; i++) {\n for(var j = 0; j < A.length; j++) {\n if(A[i] == A[j]) {\n counter++;\n }\n }\n if (counter % 2 !== 0) {\n return A[i];\n }\n }\n}", "function findOdd(A) {\n //happy coding!\n// store array and make a hash\n hashMap = {}\n// create a for loop for each element in array\n for (i=0;i<A.length;i++){\n if(hashMap[A[i]]){\n hashMap[A[i]]+=1\n }\n else{\n hashMap[A[i]] = 1\n }\n } \n return Object.keys(hashMap).find(key=> (key %2) !== 0)\n}", "function solution(A) {\n // write your code in JavaScript (Node.js 8.9.4)\n A = A.sort((a,b) => a - b);\n var arrayLength = A.length;\n var cur = A[0];\n var curlength = 1;\n for(var i = 1; i < arrayLength; i ++ ){\n if(cur == A[i]){\n curlength += 1;\n }else{\n if(curlength % 2 == 1){\n break;\n }else{\n cur = A[i];\n curlength = 1;\n }\n }\n }\n return cur;\n}", "function twoSingleNumber(arr) {\n let n1xn2 = 0;\n arr.forEach(num => {\n n1xn2 ^= num;\n })\n let rightMostNumber = 1;\n while((n1xn2&rightMostNumber) === 0) {\n rightMostNumber = rightMostNumber << 1;\n }\n console.log(rightMostNumber)\n \n let n1 = 0,\n n2 = 0;\n \n arr.forEach(num => {\n if((num & rightMostNumber) === 0) {\n n1 ^= num;\n } else {\n n2 ^= num;\n }\n })\n\n return [ n1, n2 ]\n}", "function solutionOdd(A) {\n let answer\n A.forEach(element => {\n if (A.indexOf(element) === A.lastIndexOf(element)) {\n answer = element\n }\n })\n return answer\n}", "function findOddNumber(inputArr){\n let arr = []\n for (const interator of inputArr){\n //console.log(interator);\n if (interator % 2 !== 00) {\n arr.push (interator)\n }\n }\n return arr\n}", "function collectOddValues(arr){\n \n let result = [];\n\n function helper(helperInput){\n if(helperInput.length === 0) {\n return;\n }\n \n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n \n helper(helperInput.slice(1))\n }\n \n helper(arr)\n\n return result;\n}", "function findOdd(A) {\n var occurrences = { };\n for (var i = 0; i < A.length; i++) {\n var num = A[i];\n occurrences[num] = occurrences[num] ? occurrences[num] + 1 : 1;\n }\n for (num in occurrences) {\n let count = occurrences[num]\n if (count % 2 == 1) {\n return parseInt(num)\n }\n }\n}", "function veryOdd(arrayOfNums) {\n let oddArray = [];\n\n for (let i = 0; i < arrayOfNums.length; i++){\n\n if(arrayOfNums[i] % 2){ // ODD b/c copiedArray[i] % 2 == 1, ie. TRUE\n oddArray.push(arrayOfNums[i]);\n }\n }\n \n return oddArray;\n}", "function collectOddValues(arr) {\n let result = [];\n function helper(helperInput) {\n if(helperInput.length === 0) {\n return;\n } \n if(helperInput[0] % 2 !== 0) {\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1));\n }\n helper(arr);\n return result;\n}", "function determineMissingVal(array){\n for(var i=0; i<array; i++)\n if(i + 1 !== i + 1){\n return (i + 1)\n }\n }", "function oddValues(arr){\n let result = []\n function helper(helperInput){\n if (helperInput.length === 0){\n return \n }\n if (helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n helper(helperInput.slice(1))\n }\n helper(arr)\n return result\n}", "function findUnique2(numbers) {\n numbers.sort();\n for (var i = 0; i < numbers.length; i += 2) {\n if (numbers[i] !== numbers[i + 1]) {\n return numbers[i];\n }\n }\n return undefined;\n}", "function onlyOdd(arr){\n //declare new var within function of empty array\n var newArray = []\n //create a loop for argument array\n for(let i=0;i<arr.length;i++){\n //if else to find odd numbers in array\n if(arr[i]%2!==0){\n newArray.push(arr[i])\n }\n }\n //returns NEW array w only odd numbers\n return newArray\n}", "function collectOddValues(arr){\n let result = [];\n\n// result is out of scope of helper so it wont reset\n\n function helper(helperInput){\n if(helperInput.length === 0){\n return\n }\n\n if(helperInput[0] % 2 !== 0){\n result.push(helperInput[0])\n }\n console.log(helperInput)\n \n helper(helperInput.slice(1))\n }\n\n helper(arr)\n\n return result\n}", "function returnFirstEvenNumber(array) {\n\t\tfor (let i = 0; i < array.length; i++) {\n\t\t\tif (array[i] % 2 === 0) {\n\t\t\t\treturn array[i];\n\t\t\t}\n\t\t}\n\t}", "function missingInt(array){\n array.sort()\n for (let i=0; i<=array.length; i++) {\n if(array[i] + 1 !== array[i+1]){\n return array[i] + 1\n }\n }\n}", "function getEvenNumber(array) {\n var newArray = [];\n for(var i = 0; i <= array.length - 1; i++) {\n if(array[i] % 2 === 0) {\n newArray.push(array[i]);\n }\n }\n return newArray;\n}", "function collectOddValues(arr) {\n let result = [];\n\n function helper(helperInput) {\n if (helperInput.length === 0) {\n return;\n }\n\n if (helperInput[0] % 2 !== 0) {\n result.push(helperInput[0]);\n }\n // calling recursively with an array with every item but the one we just tested\n helper(helperInput.slice(1));\n }\n\n helper(arr);\n\n return result;\n}", "function findOdd(arr) {\n let obj = {};\n\n for (let i = 0 ; i < arr.length; i++) {\n let num = arr[i];\n\n if (obj[num]) {\n delete(obj[num]);\n }\n else {\n obj[num] = true;\n }\n }\n\n let lastKeyStanding = Object.keys(obj)[0];\n return Number(lastKeyStanding);\n}", "function doubleOddNumbers(arr) {\n return arr\n .filter(function(val) {\n return val % 2 !== 0;\n }) \n .map(function(val) {\n return val * 2;\n }); \n}", "function oddOccurencesInArray(A) {\n\tA.sort(function(a, b) {\n\t\treturn a - b;\n\t});\n\n\tfor (var i=0; i<A.length; i+=2) {\n\t\tif (A[i] !== A[i+1] || i === A.length-1)\n\t\t\treturn A[i];\n\t}\n}", "function oddNumArray(arr) {\n var oddArray = [];\n for (var i = 0; i <= arr.length; i++) {\n if (i % 2 == 1) {\n oddArray.push(i);\n }\n }\n return oddArray;\n}", "function findOdd(arr) {\n return arr.find((item, index) => arr.filter(e => e === item).length % 2)\n}", "function unique(arrayEntered) {\n let sortedArray = arrayEntered.sort();\n let firstNum = sortedArray[0];\n let lastNum = sortedArray[sortedArray.length - 1];\n let baseNum = sortedArray[Math.ceil(sortedArray.length / 2)];\n return firstNum === baseNum ? lastNum : firstNum;\n}", "function removeDups(arr) {\n let output = [];\n for(let i = 0; i < arr.length; i++) {\n const num = arr[i];\n if(!output.includes(num)) {\n output.push(num)\n }\n }\n return output;\n}", "function oddOnesOut(array) {\n const tally = elementCount(array);\n const evensInArr = [];\n\n for(const key in tally) {\n if(tally[key] % 2 === 0) evensInArr.push(key);\n }\n\n return evensInArr;\n}", "function EvenOdd(arr){\n let result = arr[0];\n\n for(let i = 1; i <= arr.length - 1; i++){\n if(i % 2 == 0){\n result += arr[i];\n } else {\n result *= arr[i];\n }\n }\n \n return result;\n}", "function solve(arr) {\n if (arr.length < 2)\n return arr;\n let check = (a, b) => (a % 3 === 0 && a / 3 === b) || a * 2 === b, res = arr.splice(0, 1);\n while (arr.length > 0) {\n for (let i = 0; i < arr.length; i++) {\n if (check(res[res.length - 1], arr[i])) {\n res.push(arr.splice(i, 1)[0]);\n break;\n }\n if (check(arr[i], res[0])) {\n res.splice(0, 0, arr.splice(i, 1)[0]);\n break;\n }\n }\n }\n return res;\n}", "function repeats(arr){\n\nreturn arr\n//I'll filter the elements from the array that follows this condition: arr.indexOf(element) === arr.lastIndexOf(element)\n.filter(element => arr.indexOf(element) === arr.lastIndexOf(element))\n//I will sum all the filtered values\n.reduce((accumulator, currentValue) => accumulator + currentValue)\n\n}", "function findOdd(numberArr) {\n const numberDict = {};\n for (let i = 0; i < numberArr.length; i++) {\n const number = numberArr[i];\n numberDict[number] = numberDict[number] ? (numberDict[number] + 1) : 1;\n }\n let oddNumber = 0;\n for (let key in numberDict) {\n oddNumber = numberDict[key] % 2 ? key : oddNumber;\n };\n \n return parseInt(oddNumber);\n}", "function solve(a){\n var even = 0\n var odd = 0\n for ( let i = 0 ; i<a.length ; i++){\n if ( typeof(a[i]) === \"number\"){\n if (a[i] %2 ===0){\n even ++\n }else{\n odd ++\n }\n }\n }\n return (even-odd);\n }", "function collectOddValuesPure(arr) {\n let newArr = []; // this will be defined as a new array each time through which is ok here due to concatenating the arrays at the end\n if(arr.length === 0) return newArr;\n if(arr[0] % 2 !== 0){\n newArr.push(arr[0])\n }\n newArr = newArr.concat(collectOddValuesPure(arr.slice(1))); // every recursion will concat all the arrays with only odds\n return newArr;\n}", "function allOdd(arr){\n var num=[]\n for(var i=1; i<51; i++){\n if(i%2==1){\n num.push(i);\n }\n \n }\n return num;\n }", "function unique_one(arr){\n let newArr = [arr[0]];\n for(let i = 1; i < arr.length; i++){\n let flag = false;\n for(var j = 0; j < newArr.length; j++){\n if(arr[i] == newArr[j]){\n flag = true;\n break;\n }\n }\n if(!flag){\n newArr.push(arr[i]);\n }\n }\n return newArr;\n}", "function solution(a) {\r\n // write your code in JavaScript (Node.js 0.12)\r\n var i, l=a.length-1;\r\n var arr=[];\r\n do{ \r\n arr[a[l]-1] = a[l];\r\n \r\n l--; \r\n if(l===0)\r\n for(j=0;j<arr.length;j++)\r\n if(!arr[j])\r\n return j+1;\r\n \r\n }while(l>=0)\r\n}", "function solution(A){\n let hash = {};\n\n for (let i = 0; i < A.length; i++) {\n if (hash[A[i]] === undefined){\n hash[A[i]] = 1;\n } else if (hash[A[i]] != undefined){\n hash[A[i]]++;\n }\n }\n \n const pairs = Object.entries(hash);\n\n for (const [value,count] of pairs) {\n if (count % 2 != 0){\n return Number(value);\n }\n }\n}", "function findOdd(arr) {\n // Your code here\n}", "function oddElements(array) {\n let newArray = []\n for (i=0; i<array.length; i++) {\n if (array[i]*10 % 2 !==0) {\n newArray.push(array[i])\n }\n }\n return newArray;\n}", "function findOdd(A) {\n var len = A.length;\n var A_sort = A.slice().sort();\n\n var count = {};\n\n A_sort.forEach(function(i) {\n count[i] = (count[i] || 0) + 1;\n });\n for (var key in count) {\n if (count.hasOwnProperty(key)) {\n\n if (count[key] % 2 !== 0) {\n return Number(key);\n }\n }\n }\n}", "function findOdd(A) {\n let map = new Map();\n for (let i = 1; i <= A.length; i++) {\n if (A.length == 1) {\n return A[0];\n } else {\n map.set(A[i], A.filter(value => value == A[i]));\n }\n }\n for (let value of map) {\n if (value[1].length % 2 != 0) {\n return value[0];\n }\n }\n}", "function getOdds(array) {\n var returnOdds = [];\n\n for (var i = 0; i < array.length; i++) {\n if (array[i] % 2 == 1) {\n returnOdds.push(array[i]);\n }\n }\n return returnOdds;\n}", "function solution(A) {\n\n A.sort();\n for (let i = 0;i < A.length; i++) {\n let br = 1;\n while(A[i] === A[i + 1]) {\n i++;\n br++;\n }\n if(br%2 !== 0){\n return A[i];\n }\n }\n return A[A.length - 1];\n}", "function doubleOddNumbers(arr){\n let newValue = []\n let oddNums = []\n return arr.filter( (number, index) => {\n return index % 2 !== 0;\n })\n .map((value) => {\n return value * 2\n })\n // return newValue\n}", "function makeArrayofThreeNumbers(){\n oldArray[0] = newArray[0]; //take the previous and store it in old array to use for comparison\n oldArray[1] = newArray[1];\n oldArray[2] = newArray[2];\n\n newArray[0] = randNum(); //test that the new first doesnt match any of the old array numbers\n while (newArray[0] === oldArray[0] || newArray[0] === oldArray[1] || newArray[0] === oldArray[2]) {\n // console.log(newArray, 'broken value in first position of new array');\n newArray[0] = randNum(); //if duplicate, get random number again\n // console.log('fixed');\n }\n newArray[1] = randNum(); //fix this part\n while (newArray[1] === newArray[0] || newArray[1] === oldArray[0] || newArray[1] === oldArray[1] || newArray[1] === oldArray[2]) {\n newArray[1] = randNum(); //if duplicate, get random number again\n // console.log('caught dupes btw first and second numbers');\n }\n newArray[2] = randNum();\n while (newArray[2] === newArray[0] || newArray[2] === newArray[1] || newArray[2] === oldArray[0] || newArray[2] === oldArray[1] || newArray[2] === oldArray[2]) {\n newArray[2] = randNum(); //if duplicate, get random number again\n // console.log('caught dupes with the third number');\n }\n}", "function findOdd(A) {\n const counts = A.reduce((tracker, e) => {\n tracker[e] = tracker[e] ? tracker[e] + 1 : 1;\n //console.log(tracker[e])\n\n return tracker;\n }, {});\n\n for (key in counts) {\n if (counts[key] % 2)\n return parseInt(key);\n }\n\n return null;\n}", "function filterNonUnique(arr) {\n // arr is an array of values of any type\n\n \tlet new_array = []; \n\tarr.forEach(function(number){\n \t\n\t\t let counts = arr.filter(function(value){\n\t \treturn value === number;/*number is the number inside the original array*/\n\t\t}).length;/*how many times is that number occuring in the array*/\n\n\n\t\t if(counts < 2){ /*only push those with one counts into the new array*/\n\t\t\tnew_array.push(number);\n\t\t }\n\n\n\n\t});\n\n\n\n\n\n\n\n\treturn new_array;\n\n\n}", "function removeDuplication(arr){\n let arr2= []\n for(var i =0; i<arr.length; i++){\n if(typeof arr[i] != \"number\"){\n continue\n }else if(arr.indexOf(arr[i])==arr.lastIndexOf(arr[i])){\n arr2.push(arr[i])\n }\n }\n return arr2;\n}", "function maximumLengthEvenOddSubarray(arr){\n\n\tlet result = 1;\n\tlet current = 1;\n\n\tfor(let i=1;i<arr.length;i++){\n\n\t\tif(arr[i] % 2 == 0 && arr[i-1] % 2 != 0){\n\t\t\tcurrent = current + 1;\n\n\t\t\tif(current > result){\n\t\t\t\tresult = current;\n\t\t\t}\n\t\t}\n\t\telse if(arr[i] % 2 != 0 && arr[i-1] % 2 == 0){\n\t\t\tcurrent = current + 1;\n\n\t\t\tif(current > result){\n\t\t\t\tresult = current;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\tcurrent = 1;\n\t\t}\n\t}\n\treturn result;\n}", "function evenIndexOddLength (arr)\n{\n// debugger\n var c=-1;\n\n var output = arr.filter ( x => {\n c++; \n return ((x.length)%2===1 && c%2===0) } )\n\n return output\n}", "function findOutlier(arr){\n // if arr is mostly odds, oddCount should be 3 or 2\n const oddCount = Math.abs(arr[0] % 2) + Math.abs(arr[1] % 2) + Math.abs(arr[2] % 2);\n const remainder = oddCount >= 2 ? 1 : 0; // expected remainder of most elements of arr\n console.log(oddCount,remainder);\n for(let int of arr){\n if(Math.abs(int % 2) !== remainder) {return int;}\n }\n}", "function removeDuplicates(numArr) {\n var wrk = numArr.slice(0);\n var output = [];\n for (var i = 0; i < wrk.length; i++) {\n if (output.indexOf(wrk[i]) === -1) {\n output.push(wrk[i]);\n }\n }\n return output;\n }", "function deDupe(arr) {\n\tvar r = [];\n\to:for(var i = 0, n = arr.length; i < n; i++) {\n\t\tfor(var x = 0, y = r.length; x < y; x++) {\n\t\t\tif (r[x] == arr[i]) {\n\t\t\t\tcontinue o;\n\t\t\t}\n\t\t}\n\t\tr[r.length] = Number(arr[i]);\n\t}\n\treturn r;\n}", "function returnOdds(arr) {\n var oddArr = [];\n for (var i = 1; i <= arr; i += 2) {\n oddArr.push(i)\n };\n return oddArr\n}", "function repeats(arr){\n\n return arr\n //I'll map thru the array in order to get rid of repeated elements. A new array (unnamed) is created inside the function.\n //The unnamed array contains the elements that passed the terciary operator condition.\n //The result is an array with unique values and zeros.\n .map((element, index, array) => { return array.indexOf(element) === array.lastIndexOf(element) ? element : 0 })\n //I will sum all the unique values and the zeros from the unnamed array using reduce.\n //In arrow functions with simple syntax we don't need return.\n .reduce((accumulator, currentValue) => accumulator + currentValue)\n \n}", "function differentTheOnlyOneEvenOrOnlyOddNumber(){\n var diffNumber;\n // Modify the function\n \n return diffNumber;\n }", "function findOdd () {\n var odd = [];\n for (var i = 0; i < numbers.length; i++) {\n if (numbers[i] % 2 != 0) {\n odd.push(numbers[i]);\n }\n } return odd;\n}" ]
[ "0.7448977", "0.7037943", "0.70129853", "0.69723076", "0.6881864", "0.6853335", "0.6852994", "0.68240374", "0.68217665", "0.6784107", "0.6717896", "0.67043287", "0.67025167", "0.6680658", "0.6666755", "0.66442657", "0.6635107", "0.65713984", "0.65646994", "0.6556372", "0.65275407", "0.6522478", "0.65087473", "0.6505107", "0.65023184", "0.6494873", "0.6493281", "0.649327", "0.64835054", "0.6476187", "0.6475726", "0.64726186", "0.64541036", "0.6440812", "0.6440791", "0.6435823", "0.64260554", "0.64259577", "0.6425698", "0.6419449", "0.64175284", "0.6412161", "0.6408192", "0.64074856", "0.640448", "0.63935554", "0.63835585", "0.6380519", "0.63804644", "0.6379292", "0.63739634", "0.636209", "0.63464147", "0.6344558", "0.63354504", "0.6316266", "0.6314184", "0.63017684", "0.6300251", "0.62928164", "0.6292518", "0.6285669", "0.6278945", "0.6276602", "0.6270528", "0.6268272", "0.6257898", "0.62545735", "0.6246457", "0.62459713", "0.62442905", "0.62431264", "0.62358963", "0.6235671", "0.62340796", "0.62244904", "0.62239015", "0.6220448", "0.6216363", "0.62149364", "0.6212469", "0.6208588", "0.6201746", "0.61972356", "0.61932987", "0.6190944", "0.61908686", "0.61888814", "0.61827034", "0.6178777", "0.61773896", "0.61757934", "0.61754024", "0.61749434", "0.61748284", "0.6174605", "0.61740845", "0.6164865", "0.615856", "0.6157568", "0.6149603" ]
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { // reset the result textarea resultTextarea.value = ""; var matches = handleResponse.results; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i]; } if (matches.length == 0 || matches == undefined){ matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${ matches.length > 1 ? 'es' : '' } found`; } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = tabs[0];\n chrome.tabs.sendRequest(tab.id, {counter: 1}, function handler(response) {\n if (response.ret === 0) {\n console.log(response.data);\n setChildTextNode(\"resultsRequest\",\"complete!\");\n changeCSS(\"div_ics_download\",\"display\",\"block\");\n changeCSS(\"div_gmail_import\",\"display\",\"block\");\n }\n });\n });\n}", "function respond(request, tabId){\n\tchrome.tabs.sendMessage(tabId, {message: request}, function(response) {console.log(response.backMessage)})\n}", "function processResponse() {\n // readyState of 4 signifies request is complete\n if (xhr.readyState == 4) {\n // status of 200 signifies sucessful HTTP call\n if (xhr.status == 200) {\n pageChangeResponseHandler(xhr.responseText);\n }\n }\n }", "function processRequest(e){\n //fires 5 times bc fires everytime state changes, but only want when state is done so provide conditions\n // status provides it is okay too.\n if (xhr.readyState == 4 && xhr.status == 200){\n //parse json string for readable response.\n var response = JSON.parse(xhr.responseText);\n \n //print response in popup by sending message to popup with response(term) info.\n chrome.runtime.sendMessage(response);\n }\n }", "function callbackNativeResponse(data) {\n alert(data);\n hideProgress();\n console.log(\"callbackNativeResponse(): data = \" + data);\n}", "_activeResponseChanged(value){this.dispatchEvent(new CustomEvent(\"progress-response-loaded\",{bubbles:!0,cancelable:!0,composed:!0,detail:{response:value}}))}", "function handleResponse() {\n console.log('on handleResponse');\n var doc = req.responseText;\n\tif (!doc) {\n\t\tconsole.log('not_a_valid_url');\n\t\treturn;\n\t}\n //console.log(doc); \n \n if(doc.indexOf(\"cats_authenticationFailed(); Message:Invalid username or password.\") >= 0) {\n // goto login\n //console.log('goCATSLogin');\n chrome.tabs.create({ url: urlATS });\n }\n else {\n //success\n window.close();\n }\n}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function responseProcess(){\n\t\t\tif(logrequest.readyState == 4){\n\t\t\t\tif(logrequest.status == 200){\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function onBeforeRequestListener(details) {\n // *** Remember that tabId can be set to -1 ***\n var tab = tabs[details.tabId];\n\n // Respond to tab information\n}", "function callbackNativeResponse (data) {\n console.log(\"callbackNativeResponse(): data = \" + JSON.stringify(data));\n alert(JSON.stringify(data));\n Progress.hide();\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function callBack(){\n if(xhr.readyState == 4 && xhr.status == 200){\n //console.log(\"Funciono\")\n document.querySelector('main').innerHTML= xhr.response //Traigo informacion del servidor\n }\n }", "function callback(){\n // alert(obj.readyState+\" \"+obj.status)\n if(obj.readyState==4 && obj.status==200){\n alert(obj.responseText)\n }\n}", "function processResponse(){\n //\n }", "function getPageInfo(callback) \n { \n // Add the callback to the queue\n callbacks.push(callback); \n\n // Injects the content script into the current page \n chrome.tabs.executeScript(null, { file: \"content_script.js\" }); \n }", "function getSelection (tab) {\n alert(\"getSelection is running\");\n injectedMethod(tab, 'getSelectionText', function (response){\n responseString = response.data; \n })\n}", "function call_try(){\n var currentlocation = window.location;\n var url = \"try.py\" + currentlocation.search;\n request = new XMLHttpRequest();\n request.addEventListener('readystatechange', handle_response1, false);\n request.open('GET', url, true);\n request.send(null);\n}", "function responseHandler (app) {\n // Complete your fulfillment logic and send a response\n // DONE: Figure out how to grab the zipcode from dialogflow's post\n // app.tell(JSON.stringify(request.body.result.parameters.zip-code));\n app.tell()\n // TODO: Create a function that takes that and gets the shabbat time and responds accordingly\n\n }", "function getCurrentPageAsin(tabId) {\n\n chrome.tabs.sendRequest(tabId, {action: \"getAsin\"}, function(asin) {\n if(asin){\n chrome.storage.local.get(null, function (value) {\n if(value['login_email'] && value['login_pass']){\n var data = {\n 'ASIN': asin\n };\n var url = PROTOCOL + CHOBITOKU_URL +'/api/validateItem';\n send(url, data).success(function (res, dataType) {\n console.log(res);\n if (res['response_code'] === 100) {\n //save prodcut id\n setIcon(asin, true);\n }else{\n setIcon(null, false);\n }\n });\n }else{\n //login();\n }\n });\n }\n });\n}", "function getPageDetails(callback) {\n // Inject the content.js script (a content script to get current selection) into the current page\n chrome.tabs.executeScript(null, { file: 'content.js' });\n // Perform the callback when a message is received from the content script\n chrome.runtime.onMessage.addListener(function(message) {\n // Call the callback function\n callback(message);\n });\n}", "function getResults(){\n chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n chrome.tabs.sendMessage(tabs[0].id, { action: \"getEmailData\" }, function (response) {\n console.log(\"DONE\");\n });\n });\n}", "function reqListener() {\n\tconsole.log(this.responseText);\n}", "function injectedMethod (tab, method, callback) { \r\n console.log(method.status);\r\n if(method.status == \"complete\"){\r\n chrome.storage.local.get([\"power\", \"authentication\", \"subuserid\"], function(items){\r\n if(localStorage['power'] != 0){\r\n chrome.tabs.sendMessage(tab, {status: 'check'}, function(receive){\r\n if (receive){\r\n console.log(\"Already injected\");\r\n }\r\n else{\r\n if(localStorage['authentication'] == \"none\"){\r\n //localStorage.removeItem(\"subuserid\");\r\n localStorage[\"subuserid\"] = \"\";\r\n localStorage[\"subpriority\"] = -1;\r\n }\r\n else{\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"http://evora.m-iti.org/Subly/TStudy/getpriority.php?email=\" + localStorage[\"subuserid\"], true);\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState == this.DONE) {\r\n xhr.onreadystatechange = null;\r\n localStorage[\"subpriority\"] = xhr.responseText;\r\n }\r\n }\r\n xhr.send(); \r\n }\r\n chrome.tabs.executeScript(tab, { file: 'changecolor.js' }, function(){\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}", "onReadyStateChangeHandler() {\n let xhr = window.http;\n if (!xhr.isStateReady() || xhr.options === undefined)\n return;\n let handler = xhr.completionHandlers[xhr.options.url];\n if (handler === undefined)\n return;\n let result = undefined;\n let isJson = xhr.options === undefined ? undefined : xhr.options.isJson === undefined ? false : xhr.options.isJson;\n switch (isJson !== undefined && isJson === true && xhr.xmlHtpRequest.status !== 0) {\n case true:\n console.log(\"response \", xhr.xmlHtpRequest.responseText);\n result = JSON.parse(xhr.xmlHtpRequest.responseText);\n break;\n case false:\n result = xhr.xmlHtpRequest.responseText;\n break;\n }\n handler(result, xhr.xmlHtpRequest.status, this);\n delete xhr.completionHandlers[xhr.options.url];\n xhr.executeNextTask();\n }", "function processResponse() {\n console.log(\"cool\");\n}", "function alertContents() {\n \n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n console.log(\"The request was successful!\");\n window.location = 'index.php';\n } else {\n console.log('There was a problem with the request.');\n }\n }\n\n }", "async function gotCurrentTab(tabs) {\n let tab = tabs[0];\n let tabLoadSuccess = new CustomEvent(\"tabLoadSuccess\", {\n detail: {\n url: tab.url,\n title: tab.title,\n favicon: tab.favIconUrl\n }\n })\n APP_TOKEN = await browser.storage.sync.get(\"app_token\").then(saveAppToken)\n USER_KEY = await browser.storage.sync.get(\"user_key\").then(saveUserKey)\n URL = truncateUrl(tab.url),\n URL_FULL = tab.url,\n TITLE = tab.title,\n FAVICON = tab.favIconUrl\n\n let validation = await validatePushoverSettings().then()\n if (validation.status === 1) {\n console.log(validation)\n DEVICES = validation.devices\n document.dispatchEvent(tabLoadSuccess)\n } else {\n validationFailed();\n console.log('Validation Failed: '+validation.errors[0])\n }\n \n}", "function callback(response){\n }", "function accessContent(tab, data) {\n if(scriptInTab[tab.id] === undefined) {\n scriptInTab[tab.id] = true;\n var options = {\n tab : tab,\n callback: function(){ AvastWRC.bs.messageTab(tab, data); }\n };\n _.extend(options, AvastWRC.bal.getInjectLibs());\n AvastWRC.bs.inject(options);\n }\n else {\n AvastWRC.bs.messageTab(tab, data);\n }\n }", "function on_message(request, sender, sendResponse) {\n\n if (request.load_completed) {\n var state = bgpage.getState(tabid);\n build_popup(bgpage.get_tab_network_requests(tabid), tab_url,\n state);\n } else if (request.attach_error) {\n// showErr(\"Devtools is active - please close it\");\n showErr(request.attach_error);\n }\n}", "function reqListener () {\r\n console.log(this.responseText);\r\n}", "function complete(r){\n //alert(\"complete \"+r.responseText);\n}", "function onRequest(request, sender, callback) {\r\n chrome.pageAction.show(sender.tab.id);\r\n callback({});\r\n}", "function getAccessToken()\n{ \n let url = \"about:blank\"; \n chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { \n\n url = tab.url;\n console.log(\"url: \" + url);\n let code = url.split(\"code=\")[1];\n console.log(code);\n\n $.ajax(\n {\n method: \"POST\",\n url: \"https://accounts.spotify.com/api/token\",\n headers: {'Content-Type':'application/x-www-form-urlencoded'},\n data: {\n \"grant_type\": \"authorization_code\",\n \"code\": code,\n \"redirect_uri\": \"https://maximilianklackl.github.io/YoutubeToSpotifyChromeExtension/downloaded.html\",\n \"client_secret\": Secrets.client_secret,\n \"client_id\": Secrets.client_id,\n },\n success: function(response) {\n console.log(response);\n let accessToken = response.access_token;\n let refreshToken = response.refresh_token;\n \n setTokensInStorge(accessToken, refreshToken);\n },\n error: function(err){\n console.log(err);\n }\n }\n );\n });\n}", "function onDOMOperationResponse(response) {\n if (!response) {\n displayResult('Page isn\\'t ready (not the extension\\'s fault!) - try again in a few seconds. Refreshing could help too.',\n true); // reenable button\n return;\n }\n}", "function getOA(url,text,type){\n $.ajax({\n type: \"POST\",\n url: url\n}).done(function( data ) {\n\tlet itemArray;\n\tif(typeof data.data.availability[0] != 'undefined'){\n\tvar creating = browser.tabs.create({\n url:data.data.availability[0].url\n });\n\titemArray = [data.data.availability[0].url,\"\",type];}\n\telse {\n\titemArray = [\"No result\",\"\",type];\t\t\t\n\t}\n localStorage.setItem(text, JSON.stringify(itemArray));\n browser.runtime.reload();\n});\t\t\n}", "function getTab() {\r\n var userTabData = {\r\n userEmail: userEmail,\r\n uid: userID\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://files.dpanzer.net/files/script/animated-new-tabs/data.php\",\r\n data: userTabData,\r\n dataType: \"JSON\",\r\n success: function(response) {\r\n console.log(\"Synced Tab: \" + response.tabID);\r\n if (response.tabID == null) {\r\n console.log(\"No tab saved on server.\");\r\n chrome.storage.sync.get(\"setPage\", function(item) {\r\n if (item.setPage == null) {\r\n console.log(\"No tab set in extension.\");\r\n //var exURL = chrome.extension.getURL('dist/options.html');\r\n //var optionsUrl = exURL + \"?notab=true\"\r\n //chrome.tabs.create({\r\n //url: optionsUrl\r\n //});\r\n chrome.runtime.openOptionsPage()\r\n } else {\r\n syncTab();\r\n }\r\n });\r\n return;\r\n } else {\r\n chrome.storage.sync.set({\r\n \"setPage\": response.tabID\r\n });\r\n }\r\n }\r\n });\r\n refreshDB();\r\n}", "function response_from_helper (response) {\n if (response) {\n plugin_found_span.innerHTML = \"installed\";\n document.getElementById(\"helper-instructions\").style.color=\"black\";\n } else {\n plugin_found_span.innerHTML = (\"<b>missing or failing<b>\");\n document.getElementById(\"helper-instructions\").style.color=\"blue\";\n return;\n }\n\n if(response.hasOwnProperty('ok')){\n // I used to have the reload in the code for enableAutoUpdate or disableAutoUpdate.\n // But that intermittently caused the request to fail, because the reload refreshed\n // the javascript before the response came back. It actually started the helper,\n // but it closed the connection before the helper could read any bytes.\n // Be sure NOT to call reload on the response to 'status', because when the main\n // JavaScript body loads, *it* issues a 'status', and that creates an infinite loop.\n location.reload();\n } else if (response.hasOwnProperty('list_all')) {\n var t = response.list_all;\n populate_extension_list(t)\n } else if (response.hasOwnProperty('status_all')) {\n var t = response.status_all;\n if (t == \"disabled\") {\n status_span.textContent = \"disabled for all\";\n } else if (t == \"enabled\") {\n status_span.textContent = \"enabled for all\";\n } else {\n status_span.textContent = \"some enabled and some disabled\";\n }\n } else {\n alert (\"request failed\")\n }\n\n if (chrome.runtime.lastError) {\n alert (\"There was an error, it was:\" + chrome.runtime.lastError.message);\n }\n\n }", "function showResponseAlert(request) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n alert(request.responseText);\n }\n}", "function sendResponse(response) {\r\n chrome.windows.getCurrent(null, function (w) {\r\n let bg = chrome.extension.getBackgroundPage();\r\n bg.dialogUtils.setDialogResult(w.id, response)\r\n })\r\n}", "function callback(tabs) {\n\n //Get either the SaaS tenant ID or the Managed environment ID from local storage\n let currentTab = tabs[0]; \n tenant = getTenantId(currentTab.url, deploy); \n console.log(\"retrieving values for \" + tenant);\n\n //Using the ID above extract the values from local storage\n chrome.storage.local.get([tenant], function(result) {\n \n //If there are no values stored, then set the text fields to blank\n if(result[tenant] != undefined) {\n if (result[tenant].api_key == null && result[tenant].api_key == \"\") {\n document.getElementById(\"api_key\").value = \"\";\n } else {\n document.getElementById(\"api_key\").value = result[tenant].api_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tag_filter_key == null) {\n document.getElementById(\"tag_filter_key\").value = \".*\";\n } else {\n document.getElementById(\"tag_filter_key\").value = result[tenant].tag_filter_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tenant_color == null) {\n document.getElementById(\"tenant_color\").value = \"#000000\";\n } else {\n document.getElementById(\"tenant_color\").value = result[tenant].tenant_color;\n }\n }\n }); \n }", "function reqListener() {\n console.log(\"res\", this.responseText);\n }", "function getPlaylist() {\n chrome.tabs.getSelected(null, function (tab) {\n // Send a request to the content script.\n chrome.tabs.sendMessage(tab.id, {action: \"getDOM\"}, null, function (response) {\n\n var message = response.dom;\n setupDownloadLink(message);\n\n // debug code\n /*console.log(message);*/\n\n });\n });\n}", "function pyLoadPost(name) {\n\ntext_entry.show();\n\n//console.log(\"Send POST: \" + name);\n\nRequest({\n url: \"http://\" + require(\"sdk/simple-prefs\").prefs.pyLoadServer + \":\" + require(\"sdk/simple-prefs\").prefs.pyLoadPort + \"/json/add_package\",\n content: { add_name: name, add_links: tabs.activeTab.url, add_dest: require(\"sdk/simple-prefs\").prefs.toqueue }/*,\n onComplete: function (response) {\n console.log( response.text );\n }*/\n}).post();\n}", "function reqListener () {\n console.log(this.responseText);\n}", "function doAlertResponse(id, responseText){\n\tlogInfo(\"doAlertResponse fired with value: \" + responseText);\n \talert(trim(responseText));\n \tsetIdle();\n}", "function onTabUpdate() {\n chrome.tabs.query({active: true}, function(tab) {\n chrome.tabs.executeScript(null, {\n file: \"findScript.js\"\n }, function() {\n if (chrome.runtime.lastError)\n updateBadge(\"#FF0\");\n });\n });\n}", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "function callbackGetDataForIndicator(resp){\n\t//console.log(resp);\n}", "function getTab(callback) {\n\tlet tab;\n\tchrome.tabs.getAllInWindow(null, (tabs) => {\n\t\tlet tabsFiltered = tabs.filter(tab => tab.url === 'http://localhost:8080/');\n\t\tif (tabsFiltered.length) {\n\t\t\tcallback(tabsFiltered[0]);\n\t\t\treturn;\n\t\t} else {\n\t\t\ttabsFiltered = tabs.filter(tab => tab.url === 'https://audius.rockdapus.org/');\n\t\t\tif (tabsFiltered.length) {\n\t\t\t\tcallback(tabsFiltered[0]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcallback();\n\t});\n}", "function call_prepare( json ){\n\tchrome.tabs.executeScript( media.tab, { file: \"js/prepare.js\" }, function() {\n\t\tchrome.tabs.sendRequest( media.tab, json , function(response) {\n\t\t\tconsole.log( 'Call Prepare: Done' );\n\t\t\tif( response.error == false ){\n\t\t\t\tconsole.log( response.title, response.url );\n\t\t\t\tdo_download( response.url, response.title );\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdo_notif( 'images/error.png', 'There is something wrong', json.hd_link );\n\t\t\t}\n\t\t});\n\t});\n}", "function handleMessage(request, sender, sendResponse) {\n if (request.action == \"callback\") {\n\thandleResponse(request);\n\treturn;\n }\n \n if (request.action == \"getLinks\") {\n\tconsole.log(\"Message from the background script: \" + request.action);\n\t\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\t\t\n\tfunction callback(message) {\n\t\t//here, we have the result of the \"getStatus\" action, or of the original \"getLinks\" result if already computed\n\t\tvar status = statuses[message.tabId];\n\t\tif (status != null && status != undefined) {\n\t\t\tvar result = { \"action\": \"callback\", \"tabId\" : message.tabId, \"tabUrl\" : message.tabUrl, \"status\": status, \"expands\": expands[expandId] };\n\t\t\thandleMessage(result);\n\t\t\t//Send to popups a callback action. (it can raise an error if there is no popup though)\n\t\t\tbrowser.runtime.sendMessage(result);\n\t\t}\n\t};\n\t\n\tfunction storeNewStatus(message) {\n\t\t//here, we have the result of the \"getStatus\" action.\n\t\tstatuses[message.tabId] = message.status;\n\t\tcallback(message);\n\t};\n\t\n\tfunction handleError(error) {\n\t\t//console.log(`Error: ${error}`);\n\t\tstoreNewStatus( { \"tabId\" : request.tabId, \"status\": [] } );\n\t}\n\t \n\tvar status = statuses[request.tabId];\n\tif (status == null || status == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t\t\n\t} else if (request.kind != undefined && request.kind != null && status[kind] == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action });\n\t\t\n\t} else {\n\t\tcallback(request);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t}\n\t\n } else if (request.action == \"switchExpand\") {\n \n\tvar status = statuses[request.tabId];\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\tvar kind = request.kind;\n\tif (expands[expandId][kind] == null || expands[expandId][kind] == undefined) {\n\t\texpands[expandId][kind] = false;\n\t}\n\texpands[expandId][kind] = !expands[expandId][kind];\n\t\n\tsendResponse({\"response\": \"switched\", \"action\" : request.action, \"tabId\": request.tabId, \"tabUrl\" : request.tabUrl, \"kind\": request.kind, \"value\": expands[expandId][kind] });\n }\n}", "function addListener(expectedTabId, rootName) {\n chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {\n if (tabId !== expectedTabId) {\n // Another tab updated.\n return;\n }\n //console.log(\"Page Status: \" + changeInfo.status);\n if (changeInfo.status === \"loading\") {\n let currentMessage = document.getElementById(\"status\").textContent;\n if (!(currentMessage.includes(\"Getting\") ||\n currentMessage.includes(\"Refreshings\") ||\n currentMessage.includes(\"Trying\"))) {\n renderStatus(\"Getting Access \\u2026\");\n document.getElementById(\"status\").style.color = \"#fff\";\n }\n hide(document.getElementById(\"statusIcon\"));\n show(document.getElementById(\"loaderContainer1\"));\n } else if (changeInfo.status === \"complete\") {\n let url;\n \n // this line requires the \"tabs\" permision\n try { url = getUrlFromTab(tab); }\n catch (error) {\n console.log(\"CAUGHT-\" + error);\n renderUnknown(\"Can\\u2019t confirm access.\");\n return;\n }\n let loginCheck = url.includes(\"idp.mit.edu\");\n let redirectCheck = url.toLowerCase().includes(\"redirect\");\n let failCheck1 = url.includes(\"libproxy.mit.edu/login?url=\");\n let failCheck2 = url.includes(\"libproxy.mit.edu/menu\") && url.length < 30;\n let failCheck3 = url.includes(\"libproxy.mit.edu/connect?session\");\n if (loginCheck) {\n if (redirectCheck) {\n // an expected redirect\n //console.log(\"URL indicates redirect.\");\n } else {\n //console.log(\"URL indicates login.\");\n renderStatus(\"Provide your MIT credentials.\");\n closeLoader();\n presentIcon(\"lock\");\n }\n } else if (failCheck1 || failCheck2 || failCheck3) {\n //console.log(\"URL indicates failure.\");\n renderFailure(rootName + \" is not a supported proxy site.\"); \n } else if (successCheckUrl(url)) {\n //console.log(\"URL indicates success.\");\n renderSuccess();\n } else {\n //console.log(\"URL was unexpected.\");\n renderUnknown(\"Unexpected redirect.\");\n } \n }\n });\n}", "function handleResponse() {\r\n if (!alive) {\r\n openSingletonPage(chrome.extension.getURL('error.html'));\r\n }\r\n}", "function addNewTab(p1) {\n let _this = this;\n let prameters = \"&projectId=\" + p1.projectid + \"&categoryId=\" + p1.categoryid + \"&description=\" + p1.description + \"&parentId=\" + p1.parentid + \"&expiredate=\" + p1.expiredate;\n let handlerurl = funcList[\"addNewTab\"][\"interface\"] + prameters;\n\n $.ajax({\n // type: \"get\",\n async: true,\n url: handlerurl,\n dataType: 'jsonp',\n crossDomain: true,\n success: function (data) {\n _this.newtab.returnmessage = data.Message;\n if (data.Code === 0) {\n //console.log(\"success\");\n _this.newtab.categoryselected = -1;\n _this.newtab.desc = \"\";\n //refresh file tab data\n funcList[\"getFileTabs\"][\"func\"].call(_this, p1);\n document.getElementById(\"fileTabTitle\").click();\n } else {\n console.log(\"addNewTab\", \"failed\");\n }\n }\n });\n}", "function Mesibo_onHttpResponse(mod, cbdata, response, datalen) {\n\tvar rp_log = \" ----- Recieved http response ----\";\n\tmesibo_log(mod, rp_log, rp_log.length);\n\tmesibo_log(mod, response, datalen);\n\n\tp = JSON.parse(cbdata);\n\tmesibo_log(mod, rp_log, rp_log.length);\n\n\treturn MESIBO_RESULT_OK;\n}", "function onauthrequired_cb(details, my_callback) {\n console.log(\"APPU DEBUG: RequestID: \" + details.requestId);\n console.log(\"APPU DEBUG: URL: \" + details.url);\n console.log(\"APPU DEBUG: Method: \" + details.method);\n console.log(\"APPU DEBUG: FrameID: \" + details.frameId);\n console.log(\"APPU DEBUG: Parent FrameID: \" + details.parentFrameId);\n console.log(\"APPU DEBUG: Tab ID: \" + details.tabId);\n console.log(\"APPU DEBUG: Type: \" + details.type);\n console.log(\"APPU DEBUG: Timestamp: \" + details.timeStamp);\n console.log(\"APPU DEBUG: Scheme: \" + details.scheme);\n console.log(\"APPU DEBUG: Realm: \" + details.realm);\n console.log(\"APPU DEBUG: Challenger: \" + details.challenger);\n console.log(\"APPU DEBUG: ResponseHeaders: \" + details.responseHeaders);\n console.log(\"APPU DEBUG: StatusLine: \" + details.statusLine);\n}", "async function on_tab_activated(info)\n {\n update_in_tab(await browser.tabs.get(info.tabId));\n }", "function onGetTab(tab)\n{ \n // send message to content script\n chrome.tabs.getSelected(null, function(tab) {\n if (tab.url.indexOf(\"chrome://\") == 0)\n {\n var skype_plugin = window.parent.document.getElementById(\"skype_plugin_object\");\n if (skype_plugin != null)\n {\n skype_plugin.ShowOptionsDialog();\n }\n }\n else\n {\n chrome.tabs.sendRequest(tab.id, {action: \"ShowOptionsDialog\"}, function(response) {});\n }\n }); \n}", "function quit(err)\n{\n alert(err.responseText);\n}", "function handleUpdated(tabId, changeInfo, tabInfo) {\n //Request Running rules details from background script\n browser.runtime.sendMessage({event: \"Running-rules\"});\n}", "function setOutput()\n{\n\tif(httpObject.readyState == 4)\n\t\tparseJSON(httpObject.responseText);\n}", "function executeReturn( AJAX ) {\r\n// alert(\" executeReturn( AJAX )\")\r\n if (AJAX.readyState == 4) {\r\n if (AJAX.status == 200) {\r\n worker_stop(\"\");\r\n logger('AJAXRequest is complete: ' + AJAX.readyState + \"/\" + AJAX.status + \"/\" + AJAX.statusText);\r\n\t if ( AJAX.responseText ) {\r\n\t\t logger(AJAX.responseText);\r\n\t\t logger(\"-----------------------------------------------------------\");\r\n\t\t eval(AJAX.responseText);\r\n\t }\r\n\t}\r\n }\r\n}", "function loadURL() {\n \tconsole.log(\"in loadURL\");\n \tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function() {\n\t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t\tconsole.log(\"ready\");\n\t\t\t//callScript();\n\t\t}\n\t}\n\txhr.open(\"GET\", \"https://script.google.com/macros/d/1eydgiLo6PD4JB5Nfdv-rNP9L-vW43busr5fUBo6DZ9HEew5JnmRIQImH/edit?template=app\", true);\n\txhr.send();\n\t//callScript();\n }", "function callbackXHR() {\n \"use strict;\"\n\n if (g_polling_xhr.readyState == 4 && g_polling_xhr.status == 200) {\n // parse the response.\n var data = JSON.parse(g_polling_xhr.responseText);\n var errorCode = (undefined != data.error && 0 != data.error.length) ? data.error[0] : 0;\n var eventName = \"\";\n var newseq = 0;\n if (undefined != data.result && 0 != data.result.length) {\n newseq = data.result[0].seqNum;\n eventName = data.result[0].eventName;\n }\n\n // invoke event handler\n if (g_seqnum < newseq) {\n g_seqnum = newseq;\n MonitoringEventHandler(data);\n }\n\n g_polling_xhr.abort();\n\n // do XHR again\n // - 7 ... service not avalibable.\n if (eventName == \"terminated\") {\n // don't send XHR.\n // disable long press -> no save as photo when PartyShareApp was teminated.\n disable();\n } else if (errorCode == 7) {\n UITerminatePopUp(translationlist['64543'].replace(\"[%1]\", translationlist['80409']));\n } else {\n /* fix bug DM15GN1-2486, on Ipad/Phone, terminate popup doesnot display when close PhotoShare App by remote control */\n setTimeout(doXHR, 500);\n }\n }\n}", "function handleResponse(){\n\tif((request.status == 200)&&(request.readyState == 4)){\n\t\tvar jsonString = request.responseText;\n\t\treceiveJSON(jsonString);\n\t}\n}", "function onTabReady(tabId) {\n\t\tconsole.log('onTabReady(' + tabId + ')');\n\t\t// ask background for current song info\n\t\tchrome.runtime.sendMessage({\n\t\t\ttype: 'v2.getSong',\n\t\t\ttabId: tabId\n\t\t}, function(response) {\n\t\t\tonSongLoaded(tabId, response);\n\t\t});\n\t}", "function getTab() {\r\n chrome.tabs.query({}, function(tabs) {\r\n for (var i = 0; i < tabs.length; i++)\r\n {\r\n if(tabs[i].url.includes(\"ytmp3.cc\"))\r\n {\r\n chrome.tabs.update(tabs[i].id, {selected: true});\r\n chrome.tabs.executeScript(null, {file: \"/download.js\"});\r\n break;\r\n }\r\n }\r\n });\r\n}", "function cb_tabOnUpdated(id, info, tab) {\n\n //Checks if loading is complete\n if (tab.status !== \"complete\"){\n console.log(\"Not loaded\");\n return;\n }\n else\n {\n console.log(\"Loaded\");\n }\n \n if (tab.url.toLowerCase().indexOf(\"facebook.com\") === -1){\n console.log(\"Not Facebook\");\n return;\n }\n\n if(!tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icongrey.png'});\n }\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n }\n\n if (tab.url.toLowerCase().indexOf(\"facebook.com/buzzfeed\") !== -1){\n chrome.tabs.update(tab.id, {url: \"http://www.facebook.com/\"});\n }\n\n //Show PageAction\n chrome.pageAction.show(tab.id);\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n chrome.storage.sync.get(\"urlList\", function(data){\n urlList = data.urlList;\n if (typeof urlList === 'undefined') {\n urlList = default_urlList;\n }\n });\n chrome.tabs.executeScript(tab.id, {\"file\": \"js/buzzoff.js\"}, function() {\n chrome.tabs.sendMessage(tab.id, JSON.stringify(urlList));\n });\n }\n}", "onFinish() {}", "function SucceededCallback(result, eventArgs)\r\n{\r\n // Page element to display feedback.\r\n // var RsltElem = document.getElementById(\"ResultId\");\r\n // RsltElem.innerHTML = result;\r\n parseJson(result);\r\n}", "onSuccess() {}", "function onSuccess () {}", "function cjAjaxAddonCallback(AddonName, QueryString, Callback, CallbackArg) {\n var xmlHttp, url, pos;\n try {\n // Firefox, Opera 8.0+, Safari\n xmlHttp = new XMLHttpRequest();\n } catch (e) {\n // Internet Explorer\n try {\n xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n alert(\"Your browser does not support this function\");\n return false;\n }\n }\n }\n xmlHttp.onreadystatechange = function () {\n var serverResponse, sLen, i, scripts, sLen, srcArray, codeArray;\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n serverResponse = xmlHttp.responseText;\n var isSrcArray = new Array();\n var codeArray = new Array();\n var oldOnLoad = window.onload;\n if (serverResponse != \"\") {\n // remove embedded scripts\n var e = document.createElement(\"div\");\n if (e) {\n // create array of scripts to add\n // this is a workaround for an issue with ie\n // where the scripts collection is 0ed after the first eval\n window.onload = \"\";\n e.innerHTML = serverResponse;\n scripts = e.getElementsByTagName(\"script\");\n sLen = scripts.length;\n if (sLen > 0) {\n for (i = 0; i < sLen; i++) {\n if (scripts[i].src) {\n isSrcArray.push(true);\n codeArray.push(scripts[i].src);\n scripts[i].parentNode.removeChild(scripts[i]);\n } else {\n isSrcArray.push(false);\n codeArray.push(scripts[i].innerHTML);\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n }\n serverResponse = e.innerHTML;\n }\n }\n }\n // execute the callback which may save the response\n if (Callback) {\n Callback(serverResponse, CallbackArg);\n }\n // execute any scripts found if response\n for (i = 0; i < codeArray.length; i++) {\n if (isSrcArray[i]) {\n var s = document.createElement(\"script\");\n s.src = codeArray[i];\n s.type = \"text/javascript\";\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n } else {\n eval(codeArray[i]);\n }\n\n }\n if (window.onload) {\n window.onload();\n }\n\n }\n }\n // create LocalURL\n url = document.URL;\n pos = url.indexOf(\"#\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"?\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"://\");\n if (pos != -1) {\n pos = url.indexOf(\"/\", pos + 3);\n if (pos != -1) { url = url.substr(pos) }\n }\n url += \"?nocache=\" + Math.random()\n if (AddonName != \"\") { url += \"&remotemethodaddon=\" + AddonName; }\n if (QueryString != \"\") { url += \"&\" + QueryString; }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function onClickHandler(info, tab) {\n console.log(\"message\");\n console.log(message);\n\n var sText = info.selectionText;\n var url = \"http://localhost:3000/search/external?user_id=1&word=\" + encodeURIComponent(sText) + \"&example=\" + message; \n // window.open(url, '_blank');\n // console.log(\"1\");\n chrome.extension.getBackgroundPage().console.log('foo');\n\n // alert(info.getSelection().getRangeAt(0));\n // console.log(info.getSelection());\n   var sel = '';\n   if(window.getSelection){\n console.log(window.getSelection())\n   }\n   else if(document.getSelection){\n console.log(document.getSelection())\n   }\n   else if(document.selection){\n    console.log(document.selection.createRange())\n   }\n\n\n\n $.ajax({\n url: url,\n crossDomain:true,\n }).done(function() {\n });\n // alert(\"1\");\n\n // var xhr = new XMLHttpRequest();\n // xhr.onreadystatechange = handleStateChange; // Implemented elsewhere.\n // xhr.open(\"GET\", chrome.extension.getURL(url), true);\n // xhr.send();\n\n}", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function onScriptEventReceived(scriptEvent) {\r\n try {\r\n scriptEvent = JSON.parse(scriptEvent);\r\n } catch (error) {\r\n console.log(\"ERROR parsing scriptEvent: \" + error);\r\n return;\r\n }\r\n\r\n if (scriptEvent.app !== \"multiConVote\") {\r\n return;\r\n }\r\n\r\n \r\n switch (scriptEvent.method) {\r\n case \"initializeUI\":\r\n initializeUI(scriptEvent.myUsername, scriptEvent.voteData);\r\n selectTab(scriptEvent.activeTabName);\r\n break;\r\n\r\n case \"voteError\":\r\n voteError(scriptEvent.errorText);\r\n break;\r\n\r\n case \"voteSuccess\":\r\n voteSuccess(scriptEvent.usernameVotedFor);\r\n break;\r\n\r\n default:\r\n console.log(\"Unknown message from multiConApp_app.js: \" + JSON.stringify(scriptEvent));\r\n break;\r\n }\r\n}", "function onSuccessfulXHR(request_intent, xhr, response) {\n\n\t// $('#id_notification_pane').text(response);\n\n\tswitch (request_intent) {\n\tcase INTENT_INJECT_PAGE_NAVIGATION:\n\t\tdocument.getElementById(\"page_navigation\").innerHTML = response;\n\t\tbreak;\n\tcase INTENT_INSERT_SYSTEM_USER:\n\tcase INTENT_UPDATE_SYSTEM_USERS:\n\t\tresetFields();\n\t\tsetDefaultSaveType();\n\t\tpopulateSystemUsers();\n\t\tbreak;\n\tcase INTENT_TRASH_SYSTEM_USER:\n\tcase INTENT_ERASE_SYSTEM_USER:\n\tcase INTENT_RESTORE_SYSTEM_USER:\n\t\tpopulateSystemUsers();\n\tcase INTENT_QUERY_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_system_users').innerHTML = response;\n\t\t// $('#id_table_body_system_users').text(response);\n\t\tpopulateTrashedSystemUsers();\n\t\tbreak;\n\tcase INTENT_QUERY_DELETED_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_deleted_system_users').innerHTML = response;\n\t\tbreak;\n\tcase INTENT_STAGE_SELECTED_SYSTEM_USER_FOR_EDITING:\n\t\tstageSelectedSystemUserForEditing(response);\n\t\tbreak;\n\tdefault:\n\t\talert(\"Undefined callback for intent [\" + request_intent + \"]\");\n\t\tbreak;\n\t}\n}", "function onSuccess() {}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "sendPageReady() {}", "function executeScripts(tab) {\n chrome.tabs.get(tab, function(details) {\n chrome.storage.sync.get(['wanikanify_blackList'], function(items) {\n\n function isBlackListed(details, items) {\n var url = details.url;\n var blackList = items.wanikanify_blackList;\n if (blackList) {\n if (blackList.length == 0) {\n return false;\n } else {\n var matcher = new RegExp($.map(items.wanikanify_blackList, function(val) { return '('+val+')';}).join('|'));\n return matcher.test(url);\n }\n }\n return false;\n }\n\n\n if (!isBlackListed(details, items)) {\n chrome.tabs.executeScript(null, { file: \"js/jquery.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/replaceText.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/content.js\" }, function() {\n executed[tab] = \"jp\";\n });\n });\n });\n } else {\n console.log(\"Blacklisted\");\n }\n });\n });\n}", "function callBack(return_value) {\n var result = JSON.parse(return_value);\n var functionName = result.FunctionName;\n var parameter = result.Result;\n if (parameter.toString().toLowerCase() == 'ok') {\n notify(functionName + ' returned success');\n if (window.location.href.indexOf('fram.html')> -1){\n call_GET('readFlows');\n }\n } else if (parameter.toString().toLowerCase().indexOf(\"error\") > -1) {\n humaneAlert(\"Encountered an error:\" + parameter + \", please check server log for a more detailed report\");\n } else if (parameter.toString().toLowerCase() == 'reload') {\n location.reload();\n } else if (parameter.toString().toLowerCase() == 'silent') {\n return;\n } \n else {\n try {\n window[functionName](parameter);\n } catch (e) {\n humaneAlert(e + ' Function Name =' + functionName);\n }\n }\n}", "function httpResponseHandler() {\n if(xmlHttp.readyState == 4 && xmlHttp.status==200) {\n responseData = JSON.parse(xmlHttp.response);\n displayAdjectiveCloud(responseData['adjective_cloud']);\n }\n }", "function giveResponse(){\n check();\n}", "function callback(msg) {\n print(\"Server response - Msg -> \" + msg.data);\n print(\"\");\n var data = jQuery.parseJSON(msg.data);\n handle_event(data);\n}", "function callbackMakeBookingNow(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert('Réservation acceptée');\n reloadRoomListAvailableNow();\n } else {\n alert('Réservation refusée : ' + JSON.parse(apiResponse)['info']);\n }\n}", "function onClickHandler(info, tab) {\n console.log('info:',info.selectionText);\n console.log('tab:',tab);\n var newURL = \"http://olam.in/Dictionary/en_ml/\"+info.selectionText;\n chrome.tabs.create({ url: newURL },function(res){\n console.log('res:',res);\n chrome.tabs.getSelected(res.windowId, function(response){\n console.log('response:',response);\n })\n });\n \n // chrome.windows.create({'url': 'redirect.html','width':300,'height':300,'left':500,'top':200,'type': 'popup'}, function(window) {\n // chrome.runtime.sendMessage({ details: \"test messge\" }, function(response) {\n // console.log('response:',response);\n // });\n // });\n \n}", "function readyStateRecieved(eventHandler)\n{\n if (xhrObj.readyState == 4 && xhrObj.status == 200) //!< XHR has data loaded and server says OK\n {\n xhrResponse = xhrObj.responseText; //!< Response text recieved; store as response\n eventHandler(); //!< Execute the event handler\n }\n}", "function onFinish() {\n console.log('finished!');\n}", "function updateRequestCallback(result) {\n //if minigame does not exist alert player and close window\n if (result.ReturnValue == null || result.ReturnValue == false) {\n alertAndClose(result.Message);\n }\n }", "function handleSearchResponse(_event) {\r\n let xhr = _event.target;\r\n if (xhr.readyState == XMLHttpRequest.DONE) {\r\n alert(xhr.response);\r\n }\r\n }", "function getEventID(tab_url, selection, contextMenuClickFlag) {\n\n\n var current_tab_index = tab_url[0].index; // index is needed in order to open new tab next to previous tab\n console.log(\"Current Tab Index: \",current_tab_index);\n var string_url = new String(tab_url[0].url); // string URL\n // console.log(string_url);\n // var message_span = document.getElementById(\"message\"); // element that displays error messages\n var clipboard_text = getClipboardText(); // gets text from clipboard\n // Bools\n var check_clipboard_bool = checkIfURL(clipboard_text);\n var check_tab_url_bool = checkIfURL(string_url);\n // conditional statement that determines if user is on stubhub.com or not\n var check_if_on_sh_bool = (string_url.search(\"stubhub\") != -1) ? true : false;\n\n function process(strURL){\n var url = new URL(strURL);\n // get pathname eg \"/event/9564741\"\n var tab_pathname = new String(url.pathname);\n // split pathname into array\n var url_array = tab_pathname.split(\"/\");\n // there's two types of event URLs, check for both\n if(tab_pathname.search(\"priceanalysis\") != -1){\n var query = strURL.split(\"?\");\n query = query[1].split(\"=\");\n query = query[1].split(\"&\");\n eventID = query[0];\n getSellHubURL(eventID, current_tab_index);\n }\n\n else if(url_array[2] == \"event\"){\n var eventID = url_array[3]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n\n else {\n var eventID = url_array[2]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n }\n\n if(contextMenuClickFlag == false){\n // conditionals for various scenarios eg \"on events page, but also have link on clipboard\"\n if(check_tab_url_bool && !check_clipboard_bool){ // on events page, no link found (most common scenario)\n process(string_url);\n }\n else if(!check_tab_url_bool && check_clipboard_bool){ // not on events page, link found\n process(clipboard_text);\n \n }\n else if(check_tab_url_bool && check_clipboard_bool){ // yes/yes, events page takes precedence\n process(string_url);\n }\n else{ // no/no\n // if user is on stubhub, let them know to copy event address\n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n // else message.innerText = \"Visit StubHub Events\"\n }\n }\n else{\n var selection_url = selection.linkUrl;\n var selection_text_bool = typeof(selection.selectionText) == \"undefined\"\n console.log(\"selection_text\", selection_text_bool);\n var context_menu_url_bool = checkIfURL(selection_url);\n console.log(\"Context menu url: \", context_menu_url_bool);\n\n\n if(context_menu_url_bool){\n process(selection_url);\n }\n else if(!selection_text_bool){\n getGenerateSearchQueryURL(selection.selectionText, current_tab_index);\n }\n else if(!context_menu_url_bool && check_tab_url_bool){\n process(string_url);\n }\n else if(!context_menu_url_bool && !check_tab_url_bool && check_clipboard_bool){\n process(clipboard_text);\n }\n else{ \n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n }\n\n }\n\n}", "function reqListener () {\n //console.log(this.responseText);\n //console.log(this.responseText.split('\\n'));\n processSlideDeck(this.responseText.split('\\n'));\n //document.body.innerHTML=slideDeck;\n }", "function _handler(data, statusText, xhr) {\n if(xhr) {\n print2Console(\"RESPONSE\", xhr.status);\n } else {\n print2Console(\"RESPONSE\", data);\n }\n}", "async onFinished() {}", "function callbackEditBooking(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert(\"Réservation modifiée\");\n reloadMyBookings();\n } else {\n alert('Réservation non modifiée: ' + JSON.parse(apiResponse)['info']);\n }\n}", "done() {\n const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;\n AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);\n }" ]
[ "0.6489205", "0.64500654", "0.61856866", "0.6150769", "0.6064036", "0.60603017", "0.6057351", "0.6000076", "0.5987592", "0.5979499", "0.59670115", "0.59537065", "0.5947971", "0.59200096", "0.5915242", "0.5898453", "0.5849637", "0.5836895", "0.58346117", "0.5831618", "0.5826313", "0.57917875", "0.57910156", "0.5762928", "0.574337", "0.5720538", "0.5691217", "0.5688157", "0.56696546", "0.56561685", "0.56432575", "0.56375456", "0.56370836", "0.5628006", "0.5626947", "0.5624706", "0.5615067", "0.56140053", "0.560823", "0.5603827", "0.55970156", "0.5594254", "0.55932593", "0.55750364", "0.55597407", "0.55519825", "0.55498713", "0.55333066", "0.552495", "0.5521728", "0.5520822", "0.55135953", "0.55086243", "0.5499874", "0.5485651", "0.54776907", "0.54766417", "0.54761267", "0.54706043", "0.54692626", "0.5461363", "0.54497004", "0.5446035", "0.54408205", "0.54397297", "0.5431509", "0.54248375", "0.54180294", "0.54073757", "0.54067516", "0.54053706", "0.54016465", "0.5398464", "0.53953046", "0.5388261", "0.5388217", "0.5388063", "0.5388059", "0.5386638", "0.5379172", "0.5377978", "0.5375857", "0.5375857", "0.53742594", "0.53641677", "0.5353792", "0.5352622", "0.5352496", "0.5343897", "0.5342947", "0.5333164", "0.5331357", "0.5329081", "0.53288376", "0.53246766", "0.532061", "0.5312581", "0.53044164", "0.53025055", "0.53004986", "0.5299082" ]
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { try { var matches = handleResponse.results; if (handleResponse.selectedItemIndex > 0) { selectedItemIndex = handleResponse.selectedItemIndex storeCurrent(); return } selectedItemIndex = handleResponse.selectedItemIndex // reset the result textarea if (selectedItemIndex <= 0) { resultTextarea.value = ""; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i] + "\n"; } if (matches.length == 0 || matches == undefined) { matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`; } } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); } catch (ex) { window.eval(`console.error(ex)`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = tabs[0];\n chrome.tabs.sendRequest(tab.id, {counter: 1}, function handler(response) {\n if (response.ret === 0) {\n console.log(response.data);\n setChildTextNode(\"resultsRequest\",\"complete!\");\n changeCSS(\"div_ics_download\",\"display\",\"block\");\n changeCSS(\"div_gmail_import\",\"display\",\"block\");\n }\n });\n });\n}", "function respond(request, tabId){\n\tchrome.tabs.sendMessage(tabId, {message: request}, function(response) {console.log(response.backMessage)})\n}", "function processResponse() {\n // readyState of 4 signifies request is complete\n if (xhr.readyState == 4) {\n // status of 200 signifies sucessful HTTP call\n if (xhr.status == 200) {\n pageChangeResponseHandler(xhr.responseText);\n }\n }\n }", "function processRequest(e){\n //fires 5 times bc fires everytime state changes, but only want when state is done so provide conditions\n // status provides it is okay too.\n if (xhr.readyState == 4 && xhr.status == 200){\n //parse json string for readable response.\n var response = JSON.parse(xhr.responseText);\n \n //print response in popup by sending message to popup with response(term) info.\n chrome.runtime.sendMessage(response);\n }\n }", "function callbackNativeResponse(data) {\n alert(data);\n hideProgress();\n console.log(\"callbackNativeResponse(): data = \" + data);\n}", "_activeResponseChanged(value){this.dispatchEvent(new CustomEvent(\"progress-response-loaded\",{bubbles:!0,cancelable:!0,composed:!0,detail:{response:value}}))}", "function handleResponse() {\n console.log('on handleResponse');\n var doc = req.responseText;\n\tif (!doc) {\n\t\tconsole.log('not_a_valid_url');\n\t\treturn;\n\t}\n //console.log(doc); \n \n if(doc.indexOf(\"cats_authenticationFailed(); Message:Invalid username or password.\") >= 0) {\n // goto login\n //console.log('goCATSLogin');\n chrome.tabs.create({ url: urlATS });\n }\n else {\n //success\n window.close();\n }\n}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function responseProcess(){\n\t\t\tif(logrequest.readyState == 4){\n\t\t\t\tif(logrequest.status == 200){\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function onBeforeRequestListener(details) {\n // *** Remember that tabId can be set to -1 ***\n var tab = tabs[details.tabId];\n\n // Respond to tab information\n}", "function callbackNativeResponse (data) {\n console.log(\"callbackNativeResponse(): data = \" + JSON.stringify(data));\n alert(JSON.stringify(data));\n Progress.hide();\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function callBack(){\n if(xhr.readyState == 4 && xhr.status == 200){\n //console.log(\"Funciono\")\n document.querySelector('main').innerHTML= xhr.response //Traigo informacion del servidor\n }\n }", "function callback(){\n // alert(obj.readyState+\" \"+obj.status)\n if(obj.readyState==4 && obj.status==200){\n alert(obj.responseText)\n }\n}", "function processResponse(){\n //\n }", "function getPageInfo(callback) \n { \n // Add the callback to the queue\n callbacks.push(callback); \n\n // Injects the content script into the current page \n chrome.tabs.executeScript(null, { file: \"content_script.js\" }); \n }", "function getSelection (tab) {\n alert(\"getSelection is running\");\n injectedMethod(tab, 'getSelectionText', function (response){\n responseString = response.data; \n })\n}", "function call_try(){\n var currentlocation = window.location;\n var url = \"try.py\" + currentlocation.search;\n request = new XMLHttpRequest();\n request.addEventListener('readystatechange', handle_response1, false);\n request.open('GET', url, true);\n request.send(null);\n}", "function responseHandler (app) {\n // Complete your fulfillment logic and send a response\n // DONE: Figure out how to grab the zipcode from dialogflow's post\n // app.tell(JSON.stringify(request.body.result.parameters.zip-code));\n app.tell()\n // TODO: Create a function that takes that and gets the shabbat time and responds accordingly\n\n }", "function getCurrentPageAsin(tabId) {\n\n chrome.tabs.sendRequest(tabId, {action: \"getAsin\"}, function(asin) {\n if(asin){\n chrome.storage.local.get(null, function (value) {\n if(value['login_email'] && value['login_pass']){\n var data = {\n 'ASIN': asin\n };\n var url = PROTOCOL + CHOBITOKU_URL +'/api/validateItem';\n send(url, data).success(function (res, dataType) {\n console.log(res);\n if (res['response_code'] === 100) {\n //save prodcut id\n setIcon(asin, true);\n }else{\n setIcon(null, false);\n }\n });\n }else{\n //login();\n }\n });\n }\n });\n}", "function getResults(){\n chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n chrome.tabs.sendMessage(tabs[0].id, { action: \"getEmailData\" }, function (response) {\n console.log(\"DONE\");\n });\n });\n}", "function getPageDetails(callback) {\n // Inject the content.js script (a content script to get current selection) into the current page\n chrome.tabs.executeScript(null, { file: 'content.js' });\n // Perform the callback when a message is received from the content script\n chrome.runtime.onMessage.addListener(function(message) {\n // Call the callback function\n callback(message);\n });\n}", "function reqListener() {\n\tconsole.log(this.responseText);\n}", "function injectedMethod (tab, method, callback) { \r\n console.log(method.status);\r\n if(method.status == \"complete\"){\r\n chrome.storage.local.get([\"power\", \"authentication\", \"subuserid\"], function(items){\r\n if(localStorage['power'] != 0){\r\n chrome.tabs.sendMessage(tab, {status: 'check'}, function(receive){\r\n if (receive){\r\n console.log(\"Already injected\");\r\n }\r\n else{\r\n if(localStorage['authentication'] == \"none\"){\r\n //localStorage.removeItem(\"subuserid\");\r\n localStorage[\"subuserid\"] = \"\";\r\n localStorage[\"subpriority\"] = -1;\r\n }\r\n else{\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"http://evora.m-iti.org/Subly/TStudy/getpriority.php?email=\" + localStorage[\"subuserid\"], true);\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState == this.DONE) {\r\n xhr.onreadystatechange = null;\r\n localStorage[\"subpriority\"] = xhr.responseText;\r\n }\r\n }\r\n xhr.send(); \r\n }\r\n chrome.tabs.executeScript(tab, { file: 'changecolor.js' }, function(){\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}", "onReadyStateChangeHandler() {\n let xhr = window.http;\n if (!xhr.isStateReady() || xhr.options === undefined)\n return;\n let handler = xhr.completionHandlers[xhr.options.url];\n if (handler === undefined)\n return;\n let result = undefined;\n let isJson = xhr.options === undefined ? undefined : xhr.options.isJson === undefined ? false : xhr.options.isJson;\n switch (isJson !== undefined && isJson === true && xhr.xmlHtpRequest.status !== 0) {\n case true:\n console.log(\"response \", xhr.xmlHtpRequest.responseText);\n result = JSON.parse(xhr.xmlHtpRequest.responseText);\n break;\n case false:\n result = xhr.xmlHtpRequest.responseText;\n break;\n }\n handler(result, xhr.xmlHtpRequest.status, this);\n delete xhr.completionHandlers[xhr.options.url];\n xhr.executeNextTask();\n }", "function processResponse() {\n console.log(\"cool\");\n}", "function alertContents() {\n \n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n console.log(\"The request was successful!\");\n window.location = 'index.php';\n } else {\n console.log('There was a problem with the request.');\n }\n }\n\n }", "async function gotCurrentTab(tabs) {\n let tab = tabs[0];\n let tabLoadSuccess = new CustomEvent(\"tabLoadSuccess\", {\n detail: {\n url: tab.url,\n title: tab.title,\n favicon: tab.favIconUrl\n }\n })\n APP_TOKEN = await browser.storage.sync.get(\"app_token\").then(saveAppToken)\n USER_KEY = await browser.storage.sync.get(\"user_key\").then(saveUserKey)\n URL = truncateUrl(tab.url),\n URL_FULL = tab.url,\n TITLE = tab.title,\n FAVICON = tab.favIconUrl\n\n let validation = await validatePushoverSettings().then()\n if (validation.status === 1) {\n console.log(validation)\n DEVICES = validation.devices\n document.dispatchEvent(tabLoadSuccess)\n } else {\n validationFailed();\n console.log('Validation Failed: '+validation.errors[0])\n }\n \n}", "function callback(response){\n }", "function accessContent(tab, data) {\n if(scriptInTab[tab.id] === undefined) {\n scriptInTab[tab.id] = true;\n var options = {\n tab : tab,\n callback: function(){ AvastWRC.bs.messageTab(tab, data); }\n };\n _.extend(options, AvastWRC.bal.getInjectLibs());\n AvastWRC.bs.inject(options);\n }\n else {\n AvastWRC.bs.messageTab(tab, data);\n }\n }", "function on_message(request, sender, sendResponse) {\n\n if (request.load_completed) {\n var state = bgpage.getState(tabid);\n build_popup(bgpage.get_tab_network_requests(tabid), tab_url,\n state);\n } else if (request.attach_error) {\n// showErr(\"Devtools is active - please close it\");\n showErr(request.attach_error);\n }\n}", "function reqListener () {\r\n console.log(this.responseText);\r\n}", "function onRequest(request, sender, callback) {\r\n chrome.pageAction.show(sender.tab.id);\r\n callback({});\r\n}", "function complete(r){\n //alert(\"complete \"+r.responseText);\n}", "function getAccessToken()\n{ \n let url = \"about:blank\"; \n chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { \n\n url = tab.url;\n console.log(\"url: \" + url);\n let code = url.split(\"code=\")[1];\n console.log(code);\n\n $.ajax(\n {\n method: \"POST\",\n url: \"https://accounts.spotify.com/api/token\",\n headers: {'Content-Type':'application/x-www-form-urlencoded'},\n data: {\n \"grant_type\": \"authorization_code\",\n \"code\": code,\n \"redirect_uri\": \"https://maximilianklackl.github.io/YoutubeToSpotifyChromeExtension/downloaded.html\",\n \"client_secret\": Secrets.client_secret,\n \"client_id\": Secrets.client_id,\n },\n success: function(response) {\n console.log(response);\n let accessToken = response.access_token;\n let refreshToken = response.refresh_token;\n \n setTokensInStorge(accessToken, refreshToken);\n },\n error: function(err){\n console.log(err);\n }\n }\n );\n });\n}", "function getOA(url,text,type){\n $.ajax({\n type: \"POST\",\n url: url\n}).done(function( data ) {\n\tlet itemArray;\n\tif(typeof data.data.availability[0] != 'undefined'){\n\tvar creating = browser.tabs.create({\n url:data.data.availability[0].url\n });\n\titemArray = [data.data.availability[0].url,\"\",type];}\n\telse {\n\titemArray = [\"No result\",\"\",type];\t\t\t\n\t}\n localStorage.setItem(text, JSON.stringify(itemArray));\n browser.runtime.reload();\n});\t\t\n}", "function onDOMOperationResponse(response) {\n if (!response) {\n displayResult('Page isn\\'t ready (not the extension\\'s fault!) - try again in a few seconds. Refreshing could help too.',\n true); // reenable button\n return;\n }\n}", "function getTab() {\r\n var userTabData = {\r\n userEmail: userEmail,\r\n uid: userID\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://files.dpanzer.net/files/script/animated-new-tabs/data.php\",\r\n data: userTabData,\r\n dataType: \"JSON\",\r\n success: function(response) {\r\n console.log(\"Synced Tab: \" + response.tabID);\r\n if (response.tabID == null) {\r\n console.log(\"No tab saved on server.\");\r\n chrome.storage.sync.get(\"setPage\", function(item) {\r\n if (item.setPage == null) {\r\n console.log(\"No tab set in extension.\");\r\n //var exURL = chrome.extension.getURL('dist/options.html');\r\n //var optionsUrl = exURL + \"?notab=true\"\r\n //chrome.tabs.create({\r\n //url: optionsUrl\r\n //});\r\n chrome.runtime.openOptionsPage()\r\n } else {\r\n syncTab();\r\n }\r\n });\r\n return;\r\n } else {\r\n chrome.storage.sync.set({\r\n \"setPage\": response.tabID\r\n });\r\n }\r\n }\r\n });\r\n refreshDB();\r\n}", "function response_from_helper (response) {\n if (response) {\n plugin_found_span.innerHTML = \"installed\";\n document.getElementById(\"helper-instructions\").style.color=\"black\";\n } else {\n plugin_found_span.innerHTML = (\"<b>missing or failing<b>\");\n document.getElementById(\"helper-instructions\").style.color=\"blue\";\n return;\n }\n\n if(response.hasOwnProperty('ok')){\n // I used to have the reload in the code for enableAutoUpdate or disableAutoUpdate.\n // But that intermittently caused the request to fail, because the reload refreshed\n // the javascript before the response came back. It actually started the helper,\n // but it closed the connection before the helper could read any bytes.\n // Be sure NOT to call reload on the response to 'status', because when the main\n // JavaScript body loads, *it* issues a 'status', and that creates an infinite loop.\n location.reload();\n } else if (response.hasOwnProperty('list_all')) {\n var t = response.list_all;\n populate_extension_list(t)\n } else if (response.hasOwnProperty('status_all')) {\n var t = response.status_all;\n if (t == \"disabled\") {\n status_span.textContent = \"disabled for all\";\n } else if (t == \"enabled\") {\n status_span.textContent = \"enabled for all\";\n } else {\n status_span.textContent = \"some enabled and some disabled\";\n }\n } else {\n alert (\"request failed\")\n }\n\n if (chrome.runtime.lastError) {\n alert (\"There was an error, it was:\" + chrome.runtime.lastError.message);\n }\n\n }", "function showResponseAlert(request) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n alert(request.responseText);\n }\n}", "function callback(tabs) {\n\n //Get either the SaaS tenant ID or the Managed environment ID from local storage\n let currentTab = tabs[0]; \n tenant = getTenantId(currentTab.url, deploy); \n console.log(\"retrieving values for \" + tenant);\n\n //Using the ID above extract the values from local storage\n chrome.storage.local.get([tenant], function(result) {\n \n //If there are no values stored, then set the text fields to blank\n if(result[tenant] != undefined) {\n if (result[tenant].api_key == null && result[tenant].api_key == \"\") {\n document.getElementById(\"api_key\").value = \"\";\n } else {\n document.getElementById(\"api_key\").value = result[tenant].api_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tag_filter_key == null) {\n document.getElementById(\"tag_filter_key\").value = \".*\";\n } else {\n document.getElementById(\"tag_filter_key\").value = result[tenant].tag_filter_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tenant_color == null) {\n document.getElementById(\"tenant_color\").value = \"#000000\";\n } else {\n document.getElementById(\"tenant_color\").value = result[tenant].tenant_color;\n }\n }\n }); \n }", "function sendResponse(response) {\r\n chrome.windows.getCurrent(null, function (w) {\r\n let bg = chrome.extension.getBackgroundPage();\r\n bg.dialogUtils.setDialogResult(w.id, response)\r\n })\r\n}", "function reqListener() {\n console.log(\"res\", this.responseText);\n }", "function getPlaylist() {\n chrome.tabs.getSelected(null, function (tab) {\n // Send a request to the content script.\n chrome.tabs.sendMessage(tab.id, {action: \"getDOM\"}, null, function (response) {\n\n var message = response.dom;\n setupDownloadLink(message);\n\n // debug code\n /*console.log(message);*/\n\n });\n });\n}", "function pyLoadPost(name) {\n\ntext_entry.show();\n\n//console.log(\"Send POST: \" + name);\n\nRequest({\n url: \"http://\" + require(\"sdk/simple-prefs\").prefs.pyLoadServer + \":\" + require(\"sdk/simple-prefs\").prefs.pyLoadPort + \"/json/add_package\",\n content: { add_name: name, add_links: tabs.activeTab.url, add_dest: require(\"sdk/simple-prefs\").prefs.toqueue }/*,\n onComplete: function (response) {\n console.log( response.text );\n }*/\n}).post();\n}", "function reqListener () {\n console.log(this.responseText);\n}", "function doAlertResponse(id, responseText){\n\tlogInfo(\"doAlertResponse fired with value: \" + responseText);\n \talert(trim(responseText));\n \tsetIdle();\n}", "function onTabUpdate() {\n chrome.tabs.query({active: true}, function(tab) {\n chrome.tabs.executeScript(null, {\n file: \"findScript.js\"\n }, function() {\n if (chrome.runtime.lastError)\n updateBadge(\"#FF0\");\n });\n });\n}", "function callbackGetDataForIndicator(resp){\n\t//console.log(resp);\n}", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "function getTab(callback) {\n\tlet tab;\n\tchrome.tabs.getAllInWindow(null, (tabs) => {\n\t\tlet tabsFiltered = tabs.filter(tab => tab.url === 'http://localhost:8080/');\n\t\tif (tabsFiltered.length) {\n\t\t\tcallback(tabsFiltered[0]);\n\t\t\treturn;\n\t\t} else {\n\t\t\ttabsFiltered = tabs.filter(tab => tab.url === 'https://audius.rockdapus.org/');\n\t\t\tif (tabsFiltered.length) {\n\t\t\t\tcallback(tabsFiltered[0]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcallback();\n\t});\n}", "function call_prepare( json ){\n\tchrome.tabs.executeScript( media.tab, { file: \"js/prepare.js\" }, function() {\n\t\tchrome.tabs.sendRequest( media.tab, json , function(response) {\n\t\t\tconsole.log( 'Call Prepare: Done' );\n\t\t\tif( response.error == false ){\n\t\t\t\tconsole.log( response.title, response.url );\n\t\t\t\tdo_download( response.url, response.title );\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdo_notif( 'images/error.png', 'There is something wrong', json.hd_link );\n\t\t\t}\n\t\t});\n\t});\n}", "function handleMessage(request, sender, sendResponse) {\n if (request.action == \"callback\") {\n\thandleResponse(request);\n\treturn;\n }\n \n if (request.action == \"getLinks\") {\n\tconsole.log(\"Message from the background script: \" + request.action);\n\t\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\t\t\n\tfunction callback(message) {\n\t\t//here, we have the result of the \"getStatus\" action, or of the original \"getLinks\" result if already computed\n\t\tvar status = statuses[message.tabId];\n\t\tif (status != null && status != undefined) {\n\t\t\tvar result = { \"action\": \"callback\", \"tabId\" : message.tabId, \"tabUrl\" : message.tabUrl, \"status\": status, \"expands\": expands[expandId] };\n\t\t\thandleMessage(result);\n\t\t\t//Send to popups a callback action. (it can raise an error if there is no popup though)\n\t\t\tbrowser.runtime.sendMessage(result);\n\t\t}\n\t};\n\t\n\tfunction storeNewStatus(message) {\n\t\t//here, we have the result of the \"getStatus\" action.\n\t\tstatuses[message.tabId] = message.status;\n\t\tcallback(message);\n\t};\n\t\n\tfunction handleError(error) {\n\t\t//console.log(`Error: ${error}`);\n\t\tstoreNewStatus( { \"tabId\" : request.tabId, \"status\": [] } );\n\t}\n\t \n\tvar status = statuses[request.tabId];\n\tif (status == null || status == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t\t\n\t} else if (request.kind != undefined && request.kind != null && status[kind] == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action });\n\t\t\n\t} else {\n\t\tcallback(request);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t}\n\t\n } else if (request.action == \"switchExpand\") {\n \n\tvar status = statuses[request.tabId];\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\tvar kind = request.kind;\n\tif (expands[expandId][kind] == null || expands[expandId][kind] == undefined) {\n\t\texpands[expandId][kind] = false;\n\t}\n\texpands[expandId][kind] = !expands[expandId][kind];\n\t\n\tsendResponse({\"response\": \"switched\", \"action\" : request.action, \"tabId\": request.tabId, \"tabUrl\" : request.tabUrl, \"kind\": request.kind, \"value\": expands[expandId][kind] });\n }\n}", "function addListener(expectedTabId, rootName) {\n chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {\n if (tabId !== expectedTabId) {\n // Another tab updated.\n return;\n }\n //console.log(\"Page Status: \" + changeInfo.status);\n if (changeInfo.status === \"loading\") {\n let currentMessage = document.getElementById(\"status\").textContent;\n if (!(currentMessage.includes(\"Getting\") ||\n currentMessage.includes(\"Refreshings\") ||\n currentMessage.includes(\"Trying\"))) {\n renderStatus(\"Getting Access \\u2026\");\n document.getElementById(\"status\").style.color = \"#fff\";\n }\n hide(document.getElementById(\"statusIcon\"));\n show(document.getElementById(\"loaderContainer1\"));\n } else if (changeInfo.status === \"complete\") {\n let url;\n \n // this line requires the \"tabs\" permision\n try { url = getUrlFromTab(tab); }\n catch (error) {\n console.log(\"CAUGHT-\" + error);\n renderUnknown(\"Can\\u2019t confirm access.\");\n return;\n }\n let loginCheck = url.includes(\"idp.mit.edu\");\n let redirectCheck = url.toLowerCase().includes(\"redirect\");\n let failCheck1 = url.includes(\"libproxy.mit.edu/login?url=\");\n let failCheck2 = url.includes(\"libproxy.mit.edu/menu\") && url.length < 30;\n let failCheck3 = url.includes(\"libproxy.mit.edu/connect?session\");\n if (loginCheck) {\n if (redirectCheck) {\n // an expected redirect\n //console.log(\"URL indicates redirect.\");\n } else {\n //console.log(\"URL indicates login.\");\n renderStatus(\"Provide your MIT credentials.\");\n closeLoader();\n presentIcon(\"lock\");\n }\n } else if (failCheck1 || failCheck2 || failCheck3) {\n //console.log(\"URL indicates failure.\");\n renderFailure(rootName + \" is not a supported proxy site.\"); \n } else if (successCheckUrl(url)) {\n //console.log(\"URL indicates success.\");\n renderSuccess();\n } else {\n //console.log(\"URL was unexpected.\");\n renderUnknown(\"Unexpected redirect.\");\n } \n }\n });\n}", "function addNewTab(p1) {\n let _this = this;\n let prameters = \"&projectId=\" + p1.projectid + \"&categoryId=\" + p1.categoryid + \"&description=\" + p1.description + \"&parentId=\" + p1.parentid + \"&expiredate=\" + p1.expiredate;\n let handlerurl = funcList[\"addNewTab\"][\"interface\"] + prameters;\n\n $.ajax({\n // type: \"get\",\n async: true,\n url: handlerurl,\n dataType: 'jsonp',\n crossDomain: true,\n success: function (data) {\n _this.newtab.returnmessage = data.Message;\n if (data.Code === 0) {\n //console.log(\"success\");\n _this.newtab.categoryselected = -1;\n _this.newtab.desc = \"\";\n //refresh file tab data\n funcList[\"getFileTabs\"][\"func\"].call(_this, p1);\n document.getElementById(\"fileTabTitle\").click();\n } else {\n console.log(\"addNewTab\", \"failed\");\n }\n }\n });\n}", "function handleResponse() {\r\n if (!alive) {\r\n openSingletonPage(chrome.extension.getURL('error.html'));\r\n }\r\n}", "function Mesibo_onHttpResponse(mod, cbdata, response, datalen) {\n\tvar rp_log = \" ----- Recieved http response ----\";\n\tmesibo_log(mod, rp_log, rp_log.length);\n\tmesibo_log(mod, response, datalen);\n\n\tp = JSON.parse(cbdata);\n\tmesibo_log(mod, rp_log, rp_log.length);\n\n\treturn MESIBO_RESULT_OK;\n}", "function onauthrequired_cb(details, my_callback) {\n console.log(\"APPU DEBUG: RequestID: \" + details.requestId);\n console.log(\"APPU DEBUG: URL: \" + details.url);\n console.log(\"APPU DEBUG: Method: \" + details.method);\n console.log(\"APPU DEBUG: FrameID: \" + details.frameId);\n console.log(\"APPU DEBUG: Parent FrameID: \" + details.parentFrameId);\n console.log(\"APPU DEBUG: Tab ID: \" + details.tabId);\n console.log(\"APPU DEBUG: Type: \" + details.type);\n console.log(\"APPU DEBUG: Timestamp: \" + details.timeStamp);\n console.log(\"APPU DEBUG: Scheme: \" + details.scheme);\n console.log(\"APPU DEBUG: Realm: \" + details.realm);\n console.log(\"APPU DEBUG: Challenger: \" + details.challenger);\n console.log(\"APPU DEBUG: ResponseHeaders: \" + details.responseHeaders);\n console.log(\"APPU DEBUG: StatusLine: \" + details.statusLine);\n}", "async function on_tab_activated(info)\n {\n update_in_tab(await browser.tabs.get(info.tabId));\n }", "function onGetTab(tab)\n{ \n // send message to content script\n chrome.tabs.getSelected(null, function(tab) {\n if (tab.url.indexOf(\"chrome://\") == 0)\n {\n var skype_plugin = window.parent.document.getElementById(\"skype_plugin_object\");\n if (skype_plugin != null)\n {\n skype_plugin.ShowOptionsDialog();\n }\n }\n else\n {\n chrome.tabs.sendRequest(tab.id, {action: \"ShowOptionsDialog\"}, function(response) {});\n }\n }); \n}", "function quit(err)\n{\n alert(err.responseText);\n}", "function handleUpdated(tabId, changeInfo, tabInfo) {\n //Request Running rules details from background script\n browser.runtime.sendMessage({event: \"Running-rules\"});\n}", "function setOutput()\n{\n\tif(httpObject.readyState == 4)\n\t\tparseJSON(httpObject.responseText);\n}", "function executeReturn( AJAX ) {\r\n// alert(\" executeReturn( AJAX )\")\r\n if (AJAX.readyState == 4) {\r\n if (AJAX.status == 200) {\r\n worker_stop(\"\");\r\n logger('AJAXRequest is complete: ' + AJAX.readyState + \"/\" + AJAX.status + \"/\" + AJAX.statusText);\r\n\t if ( AJAX.responseText ) {\r\n\t\t logger(AJAX.responseText);\r\n\t\t logger(\"-----------------------------------------------------------\");\r\n\t\t eval(AJAX.responseText);\r\n\t }\r\n\t}\r\n }\r\n}", "function loadURL() {\n \tconsole.log(\"in loadURL\");\n \tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function() {\n\t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t\tconsole.log(\"ready\");\n\t\t\t//callScript();\n\t\t}\n\t}\n\txhr.open(\"GET\", \"https://script.google.com/macros/d/1eydgiLo6PD4JB5Nfdv-rNP9L-vW43busr5fUBo6DZ9HEew5JnmRIQImH/edit?template=app\", true);\n\txhr.send();\n\t//callScript();\n }", "function callbackXHR() {\n \"use strict;\"\n\n if (g_polling_xhr.readyState == 4 && g_polling_xhr.status == 200) {\n // parse the response.\n var data = JSON.parse(g_polling_xhr.responseText);\n var errorCode = (undefined != data.error && 0 != data.error.length) ? data.error[0] : 0;\n var eventName = \"\";\n var newseq = 0;\n if (undefined != data.result && 0 != data.result.length) {\n newseq = data.result[0].seqNum;\n eventName = data.result[0].eventName;\n }\n\n // invoke event handler\n if (g_seqnum < newseq) {\n g_seqnum = newseq;\n MonitoringEventHandler(data);\n }\n\n g_polling_xhr.abort();\n\n // do XHR again\n // - 7 ... service not avalibable.\n if (eventName == \"terminated\") {\n // don't send XHR.\n // disable long press -> no save as photo when PartyShareApp was teminated.\n disable();\n } else if (errorCode == 7) {\n UITerminatePopUp(translationlist['64543'].replace(\"[%1]\", translationlist['80409']));\n } else {\n /* fix bug DM15GN1-2486, on Ipad/Phone, terminate popup doesnot display when close PhotoShare App by remote control */\n setTimeout(doXHR, 500);\n }\n }\n}", "function handleResponse(){\n\tif((request.status == 200)&&(request.readyState == 4)){\n\t\tvar jsonString = request.responseText;\n\t\treceiveJSON(jsonString);\n\t}\n}", "function onTabReady(tabId) {\n\t\tconsole.log('onTabReady(' + tabId + ')');\n\t\t// ask background for current song info\n\t\tchrome.runtime.sendMessage({\n\t\t\ttype: 'v2.getSong',\n\t\t\ttabId: tabId\n\t\t}, function(response) {\n\t\t\tonSongLoaded(tabId, response);\n\t\t});\n\t}", "function getTab() {\r\n chrome.tabs.query({}, function(tabs) {\r\n for (var i = 0; i < tabs.length; i++)\r\n {\r\n if(tabs[i].url.includes(\"ytmp3.cc\"))\r\n {\r\n chrome.tabs.update(tabs[i].id, {selected: true});\r\n chrome.tabs.executeScript(null, {file: \"/download.js\"});\r\n break;\r\n }\r\n }\r\n });\r\n}", "function cb_tabOnUpdated(id, info, tab) {\n\n //Checks if loading is complete\n if (tab.status !== \"complete\"){\n console.log(\"Not loaded\");\n return;\n }\n else\n {\n console.log(\"Loaded\");\n }\n \n if (tab.url.toLowerCase().indexOf(\"facebook.com\") === -1){\n console.log(\"Not Facebook\");\n return;\n }\n\n if(!tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icongrey.png'});\n }\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n }\n\n if (tab.url.toLowerCase().indexOf(\"facebook.com/buzzfeed\") !== -1){\n chrome.tabs.update(tab.id, {url: \"http://www.facebook.com/\"});\n }\n\n //Show PageAction\n chrome.pageAction.show(tab.id);\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n chrome.storage.sync.get(\"urlList\", function(data){\n urlList = data.urlList;\n if (typeof urlList === 'undefined') {\n urlList = default_urlList;\n }\n });\n chrome.tabs.executeScript(tab.id, {\"file\": \"js/buzzoff.js\"}, function() {\n chrome.tabs.sendMessage(tab.id, JSON.stringify(urlList));\n });\n }\n}", "onFinish() {}", "function SucceededCallback(result, eventArgs)\r\n{\r\n // Page element to display feedback.\r\n // var RsltElem = document.getElementById(\"ResultId\");\r\n // RsltElem.innerHTML = result;\r\n parseJson(result);\r\n}", "onSuccess() {}", "function onClickHandler(info, tab) {\n console.log(\"message\");\n console.log(message);\n\n var sText = info.selectionText;\n var url = \"http://localhost:3000/search/external?user_id=1&word=\" + encodeURIComponent(sText) + \"&example=\" + message; \n // window.open(url, '_blank');\n // console.log(\"1\");\n chrome.extension.getBackgroundPage().console.log('foo');\n\n // alert(info.getSelection().getRangeAt(0));\n // console.log(info.getSelection());\n   var sel = '';\n   if(window.getSelection){\n console.log(window.getSelection())\n   }\n   else if(document.getSelection){\n console.log(document.getSelection())\n   }\n   else if(document.selection){\n    console.log(document.selection.createRange())\n   }\n\n\n\n $.ajax({\n url: url,\n crossDomain:true,\n }).done(function() {\n });\n // alert(\"1\");\n\n // var xhr = new XMLHttpRequest();\n // xhr.onreadystatechange = handleStateChange; // Implemented elsewhere.\n // xhr.open(\"GET\", chrome.extension.getURL(url), true);\n // xhr.send();\n\n}", "function cjAjaxAddonCallback(AddonName, QueryString, Callback, CallbackArg) {\n var xmlHttp, url, pos;\n try {\n // Firefox, Opera 8.0+, Safari\n xmlHttp = new XMLHttpRequest();\n } catch (e) {\n // Internet Explorer\n try {\n xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n alert(\"Your browser does not support this function\");\n return false;\n }\n }\n }\n xmlHttp.onreadystatechange = function () {\n var serverResponse, sLen, i, scripts, sLen, srcArray, codeArray;\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n serverResponse = xmlHttp.responseText;\n var isSrcArray = new Array();\n var codeArray = new Array();\n var oldOnLoad = window.onload;\n if (serverResponse != \"\") {\n // remove embedded scripts\n var e = document.createElement(\"div\");\n if (e) {\n // create array of scripts to add\n // this is a workaround for an issue with ie\n // where the scripts collection is 0ed after the first eval\n window.onload = \"\";\n e.innerHTML = serverResponse;\n scripts = e.getElementsByTagName(\"script\");\n sLen = scripts.length;\n if (sLen > 0) {\n for (i = 0; i < sLen; i++) {\n if (scripts[i].src) {\n isSrcArray.push(true);\n codeArray.push(scripts[i].src);\n scripts[i].parentNode.removeChild(scripts[i]);\n } else {\n isSrcArray.push(false);\n codeArray.push(scripts[i].innerHTML);\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n }\n serverResponse = e.innerHTML;\n }\n }\n }\n // execute the callback which may save the response\n if (Callback) {\n Callback(serverResponse, CallbackArg);\n }\n // execute any scripts found if response\n for (i = 0; i < codeArray.length; i++) {\n if (isSrcArray[i]) {\n var s = document.createElement(\"script\");\n s.src = codeArray[i];\n s.type = \"text/javascript\";\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n } else {\n eval(codeArray[i]);\n }\n\n }\n if (window.onload) {\n window.onload();\n }\n\n }\n }\n // create LocalURL\n url = document.URL;\n pos = url.indexOf(\"#\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"?\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"://\");\n if (pos != -1) {\n pos = url.indexOf(\"/\", pos + 3);\n if (pos != -1) { url = url.substr(pos) }\n }\n url += \"?nocache=\" + Math.random()\n if (AddonName != \"\") { url += \"&remotemethodaddon=\" + AddonName; }\n if (QueryString != \"\") { url += \"&\" + QueryString; }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function onSuccess () {}", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function onScriptEventReceived(scriptEvent) {\r\n try {\r\n scriptEvent = JSON.parse(scriptEvent);\r\n } catch (error) {\r\n console.log(\"ERROR parsing scriptEvent: \" + error);\r\n return;\r\n }\r\n\r\n if (scriptEvent.app !== \"multiConVote\") {\r\n return;\r\n }\r\n\r\n \r\n switch (scriptEvent.method) {\r\n case \"initializeUI\":\r\n initializeUI(scriptEvent.myUsername, scriptEvent.voteData);\r\n selectTab(scriptEvent.activeTabName);\r\n break;\r\n\r\n case \"voteError\":\r\n voteError(scriptEvent.errorText);\r\n break;\r\n\r\n case \"voteSuccess\":\r\n voteSuccess(scriptEvent.usernameVotedFor);\r\n break;\r\n\r\n default:\r\n console.log(\"Unknown message from multiConApp_app.js: \" + JSON.stringify(scriptEvent));\r\n break;\r\n }\r\n}", "function onSuccessfulXHR(request_intent, xhr, response) {\n\n\t// $('#id_notification_pane').text(response);\n\n\tswitch (request_intent) {\n\tcase INTENT_INJECT_PAGE_NAVIGATION:\n\t\tdocument.getElementById(\"page_navigation\").innerHTML = response;\n\t\tbreak;\n\tcase INTENT_INSERT_SYSTEM_USER:\n\tcase INTENT_UPDATE_SYSTEM_USERS:\n\t\tresetFields();\n\t\tsetDefaultSaveType();\n\t\tpopulateSystemUsers();\n\t\tbreak;\n\tcase INTENT_TRASH_SYSTEM_USER:\n\tcase INTENT_ERASE_SYSTEM_USER:\n\tcase INTENT_RESTORE_SYSTEM_USER:\n\t\tpopulateSystemUsers();\n\tcase INTENT_QUERY_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_system_users').innerHTML = response;\n\t\t// $('#id_table_body_system_users').text(response);\n\t\tpopulateTrashedSystemUsers();\n\t\tbreak;\n\tcase INTENT_QUERY_DELETED_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_deleted_system_users').innerHTML = response;\n\t\tbreak;\n\tcase INTENT_STAGE_SELECTED_SYSTEM_USER_FOR_EDITING:\n\t\tstageSelectedSystemUserForEditing(response);\n\t\tbreak;\n\tdefault:\n\t\talert(\"Undefined callback for intent [\" + request_intent + \"]\");\n\t\tbreak;\n\t}\n}", "function onSuccess() {}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "sendPageReady() {}", "function executeScripts(tab) {\n chrome.tabs.get(tab, function(details) {\n chrome.storage.sync.get(['wanikanify_blackList'], function(items) {\n\n function isBlackListed(details, items) {\n var url = details.url;\n var blackList = items.wanikanify_blackList;\n if (blackList) {\n if (blackList.length == 0) {\n return false;\n } else {\n var matcher = new RegExp($.map(items.wanikanify_blackList, function(val) { return '('+val+')';}).join('|'));\n return matcher.test(url);\n }\n }\n return false;\n }\n\n\n if (!isBlackListed(details, items)) {\n chrome.tabs.executeScript(null, { file: \"js/jquery.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/replaceText.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/content.js\" }, function() {\n executed[tab] = \"jp\";\n });\n });\n });\n } else {\n console.log(\"Blacklisted\");\n }\n });\n });\n}", "function callBack(return_value) {\n var result = JSON.parse(return_value);\n var functionName = result.FunctionName;\n var parameter = result.Result;\n if (parameter.toString().toLowerCase() == 'ok') {\n notify(functionName + ' returned success');\n if (window.location.href.indexOf('fram.html')> -1){\n call_GET('readFlows');\n }\n } else if (parameter.toString().toLowerCase().indexOf(\"error\") > -1) {\n humaneAlert(\"Encountered an error:\" + parameter + \", please check server log for a more detailed report\");\n } else if (parameter.toString().toLowerCase() == 'reload') {\n location.reload();\n } else if (parameter.toString().toLowerCase() == 'silent') {\n return;\n } \n else {\n try {\n window[functionName](parameter);\n } catch (e) {\n humaneAlert(e + ' Function Name =' + functionName);\n }\n }\n}", "function giveResponse(){\n check();\n}", "function httpResponseHandler() {\n if(xmlHttp.readyState == 4 && xmlHttp.status==200) {\n responseData = JSON.parse(xmlHttp.response);\n displayAdjectiveCloud(responseData['adjective_cloud']);\n }\n }", "function callbackMakeBookingNow(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert('Réservation acceptée');\n reloadRoomListAvailableNow();\n } else {\n alert('Réservation refusée : ' + JSON.parse(apiResponse)['info']);\n }\n}", "function callback(msg) {\n print(\"Server response - Msg -> \" + msg.data);\n print(\"\");\n var data = jQuery.parseJSON(msg.data);\n handle_event(data);\n}", "function onClickHandler(info, tab) {\n console.log('info:',info.selectionText);\n console.log('tab:',tab);\n var newURL = \"http://olam.in/Dictionary/en_ml/\"+info.selectionText;\n chrome.tabs.create({ url: newURL },function(res){\n console.log('res:',res);\n chrome.tabs.getSelected(res.windowId, function(response){\n console.log('response:',response);\n })\n });\n \n // chrome.windows.create({'url': 'redirect.html','width':300,'height':300,'left':500,'top':200,'type': 'popup'}, function(window) {\n // chrome.runtime.sendMessage({ details: \"test messge\" }, function(response) {\n // console.log('response:',response);\n // });\n // });\n \n}", "function readyStateRecieved(eventHandler)\n{\n if (xhrObj.readyState == 4 && xhrObj.status == 200) //!< XHR has data loaded and server says OK\n {\n xhrResponse = xhrObj.responseText; //!< Response text recieved; store as response\n eventHandler(); //!< Execute the event handler\n }\n}", "function updateRequestCallback(result) {\n //if minigame does not exist alert player and close window\n if (result.ReturnValue == null || result.ReturnValue == false) {\n alertAndClose(result.Message);\n }\n }", "function onFinish() {\n console.log('finished!');\n}", "function handleSearchResponse(_event) {\r\n let xhr = _event.target;\r\n if (xhr.readyState == XMLHttpRequest.DONE) {\r\n alert(xhr.response);\r\n }\r\n }", "function getEventID(tab_url, selection, contextMenuClickFlag) {\n\n\n var current_tab_index = tab_url[0].index; // index is needed in order to open new tab next to previous tab\n console.log(\"Current Tab Index: \",current_tab_index);\n var string_url = new String(tab_url[0].url); // string URL\n // console.log(string_url);\n // var message_span = document.getElementById(\"message\"); // element that displays error messages\n var clipboard_text = getClipboardText(); // gets text from clipboard\n // Bools\n var check_clipboard_bool = checkIfURL(clipboard_text);\n var check_tab_url_bool = checkIfURL(string_url);\n // conditional statement that determines if user is on stubhub.com or not\n var check_if_on_sh_bool = (string_url.search(\"stubhub\") != -1) ? true : false;\n\n function process(strURL){\n var url = new URL(strURL);\n // get pathname eg \"/event/9564741\"\n var tab_pathname = new String(url.pathname);\n // split pathname into array\n var url_array = tab_pathname.split(\"/\");\n // there's two types of event URLs, check for both\n if(tab_pathname.search(\"priceanalysis\") != -1){\n var query = strURL.split(\"?\");\n query = query[1].split(\"=\");\n query = query[1].split(\"&\");\n eventID = query[0];\n getSellHubURL(eventID, current_tab_index);\n }\n\n else if(url_array[2] == \"event\"){\n var eventID = url_array[3]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n\n else {\n var eventID = url_array[2]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n }\n\n if(contextMenuClickFlag == false){\n // conditionals for various scenarios eg \"on events page, but also have link on clipboard\"\n if(check_tab_url_bool && !check_clipboard_bool){ // on events page, no link found (most common scenario)\n process(string_url);\n }\n else if(!check_tab_url_bool && check_clipboard_bool){ // not on events page, link found\n process(clipboard_text);\n \n }\n else if(check_tab_url_bool && check_clipboard_bool){ // yes/yes, events page takes precedence\n process(string_url);\n }\n else{ // no/no\n // if user is on stubhub, let them know to copy event address\n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n // else message.innerText = \"Visit StubHub Events\"\n }\n }\n else{\n var selection_url = selection.linkUrl;\n var selection_text_bool = typeof(selection.selectionText) == \"undefined\"\n console.log(\"selection_text\", selection_text_bool);\n var context_menu_url_bool = checkIfURL(selection_url);\n console.log(\"Context menu url: \", context_menu_url_bool);\n\n\n if(context_menu_url_bool){\n process(selection_url);\n }\n else if(!selection_text_bool){\n getGenerateSearchQueryURL(selection.selectionText, current_tab_index);\n }\n else if(!context_menu_url_bool && check_tab_url_bool){\n process(string_url);\n }\n else if(!context_menu_url_bool && !check_tab_url_bool && check_clipboard_bool){\n process(clipboard_text);\n }\n else{ \n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n }\n\n }\n\n}", "function reqListener () {\n //console.log(this.responseText);\n //console.log(this.responseText.split('\\n'));\n processSlideDeck(this.responseText.split('\\n'));\n //document.body.innerHTML=slideDeck;\n }", "function _handler(data, statusText, xhr) {\n if(xhr) {\n print2Console(\"RESPONSE\", xhr.status);\n } else {\n print2Console(\"RESPONSE\", data);\n }\n}", "function callbackEditBooking(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert(\"Réservation modifiée\");\n reloadMyBookings();\n } else {\n alert('Réservation non modifiée: ' + JSON.parse(apiResponse)['info']);\n }\n}", "async onFinished() {}", "done() {\n const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;\n AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);\n }" ]
[ "0.648892", "0.6451841", "0.61868155", "0.61511195", "0.6065421", "0.6059933", "0.60576016", "0.60009533", "0.59871465", "0.59802985", "0.5968581", "0.5953474", "0.5948605", "0.59204245", "0.5915501", "0.58991325", "0.585046", "0.58371705", "0.5834777", "0.5832256", "0.58289593", "0.579238", "0.5792155", "0.576331", "0.5744758", "0.57217246", "0.5691664", "0.5688163", "0.5671188", "0.5655979", "0.56442535", "0.5638082", "0.56375915", "0.56289804", "0.5628545", "0.5626426", "0.56163585", "0.56153196", "0.56096864", "0.56045824", "0.55977684", "0.5595297", "0.5594909", "0.5575519", "0.55601263", "0.5552409", "0.5550314", "0.5532729", "0.55249524", "0.5522076", "0.55209297", "0.5515026", "0.551068", "0.5500731", "0.54869074", "0.5478045", "0.54778504", "0.5476425", "0.54720926", "0.54702926", "0.5462344", "0.5448269", "0.5445444", "0.5440986", "0.5439079", "0.54325515", "0.54249364", "0.5417953", "0.5409023", "0.5408315", "0.5406357", "0.54005796", "0.5397683", "0.5394565", "0.538848", "0.53882027", "0.53881514", "0.53880847", "0.53862464", "0.53804445", "0.5377809", "0.5375125", "0.5375125", "0.5374885", "0.53647584", "0.5353625", "0.5353135", "0.535281", "0.5344576", "0.5342608", "0.533385", "0.53317654", "0.53283054", "0.53275096", "0.5324834", "0.53229415", "0.53132355", "0.5304925", "0.530193", "0.53018075", "0.52988654" ]
0.0
-1
callback function when we get the response from the script on the tab
function getResponse(handleResponse, handleError) { try { var matches = handleResponse.results; if (handleResponse.selectedItemIndex != matches.length -1) { selectedItemIndex = handleResponse.selectedItemIndex; storeCurrent(); return } selectedItemIndex = handleResponse.selectedItemIndex // reset the result textarea resultTextarea.value = ""; for (var i = 0; i < matches.length; i++) { resultTextarea.value += matches[i] + "\n"; } if (matches.length == 0 || matches == undefined) { matchesCount.innerText = "No Matches Found"; } else { matchesCount.innerText = `${matches.length} match${matches.length > 1 ? 'es' : ''} found`; } // store current values in the storage so user doesn't have to type again when he comes back to popup storeCurrent(); } catch (ex) { window.eval(`console.error(ex)`); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function callbackOnExecuteScript() {\n console.log(\"tabID \" + tabId);\n chrome.tabs.sendMessage(tabId, message);\n }", "function extract_data() {\n setChildTextNode(\"resultsRequest\", \"running...\");\n chrome.tabs.query({active: true, currentWindow: true}, function(tabs) {\n var tab = tabs[0];\n chrome.tabs.sendRequest(tab.id, {counter: 1}, function handler(response) {\n if (response.ret === 0) {\n console.log(response.data);\n setChildTextNode(\"resultsRequest\",\"complete!\");\n changeCSS(\"div_ics_download\",\"display\",\"block\");\n changeCSS(\"div_gmail_import\",\"display\",\"block\");\n }\n });\n });\n}", "function respond(request, tabId){\n\tchrome.tabs.sendMessage(tabId, {message: request}, function(response) {console.log(response.backMessage)})\n}", "function processResponse() {\n // readyState of 4 signifies request is complete\n if (xhr.readyState == 4) {\n // status of 200 signifies sucessful HTTP call\n if (xhr.status == 200) {\n pageChangeResponseHandler(xhr.responseText);\n }\n }\n }", "function processRequest(e){\n //fires 5 times bc fires everytime state changes, but only want when state is done so provide conditions\n // status provides it is okay too.\n if (xhr.readyState == 4 && xhr.status == 200){\n //parse json string for readable response.\n var response = JSON.parse(xhr.responseText);\n \n //print response in popup by sending message to popup with response(term) info.\n chrome.runtime.sendMessage(response);\n }\n }", "function callbackNativeResponse(data) {\n alert(data);\n hideProgress();\n console.log(\"callbackNativeResponse(): data = \" + data);\n}", "_activeResponseChanged(value){this.dispatchEvent(new CustomEvent(\"progress-response-loaded\",{bubbles:!0,cancelable:!0,composed:!0,detail:{response:value}}))}", "function handleResponse() {\n console.log('on handleResponse');\n var doc = req.responseText;\n\tif (!doc) {\n\t\tconsole.log('not_a_valid_url');\n\t\treturn;\n\t}\n //console.log(doc); \n \n if(doc.indexOf(\"cats_authenticationFailed(); Message:Invalid username or password.\") >= 0) {\n // goto login\n //console.log('goCATSLogin');\n chrome.tabs.create({ url: urlATS });\n }\n else {\n //success\n window.close();\n }\n}", "function runScript() {\n\tconsole.time(\"index\");\n var job = tabs.activeTab.attach({\n \tcontentScriptFile: [self.data.url(\"models_50_wif/benign/CompositeBenignCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignCountsAB.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/benign/CompositeBenignTotal.js\"),\n\t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousTotal.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsA.js\"),\n \t\t\t\t\t\tself.data.url(\"models_50_wif/malicious/CompositeMaliciousCountsAB.js\"),\n self.data.url(\"CompositeWordTransform.js\"),\n \t\t\t\t\t\tself.data.url(\"DetectComposite.js\")]\n \n \n });\n \n job.port.on(\"script-response\", function(response) {\n\t\n\tconsole.log(response);\n });\n}", "function responseProcess(){\n\t\t\tif(logrequest.readyState == 4){\n\t\t\t\tif(logrequest.status == 200){\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\talert(logrequest.responseText);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function onBeforeRequestListener(details) {\n // *** Remember that tabId can be set to -1 ***\n var tab = tabs[details.tabId];\n\n // Respond to tab information\n}", "function callbackNativeResponse (data) {\n console.log(\"callbackNativeResponse(): data = \" + JSON.stringify(data));\n alert(JSON.stringify(data));\n Progress.hide();\n }", "function completeHandler(e) {\n console.log(\"received \" + e.responseCode + \" code\");\n var serverResponse = e.response;\n}", "function callBack(){\n if(xhr.readyState == 4 && xhr.status == 200){\n //console.log(\"Funciono\")\n document.querySelector('main').innerHTML= xhr.response //Traigo informacion del servidor\n }\n }", "function callback(){\n // alert(obj.readyState+\" \"+obj.status)\n if(obj.readyState==4 && obj.status==200){\n alert(obj.responseText)\n }\n}", "function processResponse(){\n //\n }", "function getPageInfo(callback) \n { \n // Add the callback to the queue\n callbacks.push(callback); \n\n // Injects the content script into the current page \n chrome.tabs.executeScript(null, { file: \"content_script.js\" }); \n }", "function getSelection (tab) {\n alert(\"getSelection is running\");\n injectedMethod(tab, 'getSelectionText', function (response){\n responseString = response.data; \n })\n}", "function call_try(){\n var currentlocation = window.location;\n var url = \"try.py\" + currentlocation.search;\n request = new XMLHttpRequest();\n request.addEventListener('readystatechange', handle_response1, false);\n request.open('GET', url, true);\n request.send(null);\n}", "function responseHandler (app) {\n // Complete your fulfillment logic and send a response\n // DONE: Figure out how to grab the zipcode from dialogflow's post\n // app.tell(JSON.stringify(request.body.result.parameters.zip-code));\n app.tell()\n // TODO: Create a function that takes that and gets the shabbat time and responds accordingly\n\n }", "function getCurrentPageAsin(tabId) {\n\n chrome.tabs.sendRequest(tabId, {action: \"getAsin\"}, function(asin) {\n if(asin){\n chrome.storage.local.get(null, function (value) {\n if(value['login_email'] && value['login_pass']){\n var data = {\n 'ASIN': asin\n };\n var url = PROTOCOL + CHOBITOKU_URL +'/api/validateItem';\n send(url, data).success(function (res, dataType) {\n console.log(res);\n if (res['response_code'] === 100) {\n //save prodcut id\n setIcon(asin, true);\n }else{\n setIcon(null, false);\n }\n });\n }else{\n //login();\n }\n });\n }\n });\n}", "function getPageDetails(callback) {\n // Inject the content.js script (a content script to get current selection) into the current page\n chrome.tabs.executeScript(null, { file: 'content.js' });\n // Perform the callback when a message is received from the content script\n chrome.runtime.onMessage.addListener(function(message) {\n // Call the callback function\n callback(message);\n });\n}", "function getResults(){\n chrome.tabs.query({ active: true, currentWindow: true }, function (tabs) {\n chrome.tabs.sendMessage(tabs[0].id, { action: \"getEmailData\" }, function (response) {\n console.log(\"DONE\");\n });\n });\n}", "function reqListener() {\n\tconsole.log(this.responseText);\n}", "function injectedMethod (tab, method, callback) { \r\n console.log(method.status);\r\n if(method.status == \"complete\"){\r\n chrome.storage.local.get([\"power\", \"authentication\", \"subuserid\"], function(items){\r\n if(localStorage['power'] != 0){\r\n chrome.tabs.sendMessage(tab, {status: 'check'}, function(receive){\r\n if (receive){\r\n console.log(\"Already injected\");\r\n }\r\n else{\r\n if(localStorage['authentication'] == \"none\"){\r\n //localStorage.removeItem(\"subuserid\");\r\n localStorage[\"subuserid\"] = \"\";\r\n localStorage[\"subpriority\"] = -1;\r\n }\r\n else{\r\n var xhr = new XMLHttpRequest();\r\n xhr.open(\"GET\", \"http://evora.m-iti.org/Subly/TStudy/getpriority.php?email=\" + localStorage[\"subuserid\"], true);\r\n xhr.onreadystatechange = function() {\r\n if (xhr.readyState == this.DONE) {\r\n xhr.onreadystatechange = null;\r\n localStorage[\"subpriority\"] = xhr.responseText;\r\n }\r\n }\r\n xhr.send(); \r\n }\r\n chrome.tabs.executeScript(tab, { file: 'changecolor.js' }, function(){\r\n });\r\n }\r\n });\r\n }\r\n });\r\n }\r\n}", "onReadyStateChangeHandler() {\n let xhr = window.http;\n if (!xhr.isStateReady() || xhr.options === undefined)\n return;\n let handler = xhr.completionHandlers[xhr.options.url];\n if (handler === undefined)\n return;\n let result = undefined;\n let isJson = xhr.options === undefined ? undefined : xhr.options.isJson === undefined ? false : xhr.options.isJson;\n switch (isJson !== undefined && isJson === true && xhr.xmlHtpRequest.status !== 0) {\n case true:\n console.log(\"response \", xhr.xmlHtpRequest.responseText);\n result = JSON.parse(xhr.xmlHtpRequest.responseText);\n break;\n case false:\n result = xhr.xmlHtpRequest.responseText;\n break;\n }\n handler(result, xhr.xmlHtpRequest.status, this);\n delete xhr.completionHandlers[xhr.options.url];\n xhr.executeNextTask();\n }", "function processResponse() {\n console.log(\"cool\");\n}", "function alertContents() {\n \n if (httpRequest.readyState === XMLHttpRequest.DONE) {\n if (httpRequest.status === 200) {\n console.log(\"The request was successful!\");\n window.location = 'index.php';\n } else {\n console.log('There was a problem with the request.');\n }\n }\n\n }", "async function gotCurrentTab(tabs) {\n let tab = tabs[0];\n let tabLoadSuccess = new CustomEvent(\"tabLoadSuccess\", {\n detail: {\n url: tab.url,\n title: tab.title,\n favicon: tab.favIconUrl\n }\n })\n APP_TOKEN = await browser.storage.sync.get(\"app_token\").then(saveAppToken)\n USER_KEY = await browser.storage.sync.get(\"user_key\").then(saveUserKey)\n URL = truncateUrl(tab.url),\n URL_FULL = tab.url,\n TITLE = tab.title,\n FAVICON = tab.favIconUrl\n\n let validation = await validatePushoverSettings().then()\n if (validation.status === 1) {\n console.log(validation)\n DEVICES = validation.devices\n document.dispatchEvent(tabLoadSuccess)\n } else {\n validationFailed();\n console.log('Validation Failed: '+validation.errors[0])\n }\n \n}", "function callback(response){\n }", "function accessContent(tab, data) {\n if(scriptInTab[tab.id] === undefined) {\n scriptInTab[tab.id] = true;\n var options = {\n tab : tab,\n callback: function(){ AvastWRC.bs.messageTab(tab, data); }\n };\n _.extend(options, AvastWRC.bal.getInjectLibs());\n AvastWRC.bs.inject(options);\n }\n else {\n AvastWRC.bs.messageTab(tab, data);\n }\n }", "function on_message(request, sender, sendResponse) {\n\n if (request.load_completed) {\n var state = bgpage.getState(tabid);\n build_popup(bgpage.get_tab_network_requests(tabid), tab_url,\n state);\n } else if (request.attach_error) {\n// showErr(\"Devtools is active - please close it\");\n showErr(request.attach_error);\n }\n}", "function reqListener () {\r\n console.log(this.responseText);\r\n}", "function complete(r){\n //alert(\"complete \"+r.responseText);\n}", "function onRequest(request, sender, callback) {\r\n chrome.pageAction.show(sender.tab.id);\r\n callback({});\r\n}", "function getAccessToken()\n{ \n let url = \"about:blank\"; \n chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) { \n\n url = tab.url;\n console.log(\"url: \" + url);\n let code = url.split(\"code=\")[1];\n console.log(code);\n\n $.ajax(\n {\n method: \"POST\",\n url: \"https://accounts.spotify.com/api/token\",\n headers: {'Content-Type':'application/x-www-form-urlencoded'},\n data: {\n \"grant_type\": \"authorization_code\",\n \"code\": code,\n \"redirect_uri\": \"https://maximilianklackl.github.io/YoutubeToSpotifyChromeExtension/downloaded.html\",\n \"client_secret\": Secrets.client_secret,\n \"client_id\": Secrets.client_id,\n },\n success: function(response) {\n console.log(response);\n let accessToken = response.access_token;\n let refreshToken = response.refresh_token;\n \n setTokensInStorge(accessToken, refreshToken);\n },\n error: function(err){\n console.log(err);\n }\n }\n );\n });\n}", "function onDOMOperationResponse(response) {\n if (!response) {\n displayResult('Page isn\\'t ready (not the extension\\'s fault!) - try again in a few seconds. Refreshing could help too.',\n true); // reenable button\n return;\n }\n}", "function getOA(url,text,type){\n $.ajax({\n type: \"POST\",\n url: url\n}).done(function( data ) {\n\tlet itemArray;\n\tif(typeof data.data.availability[0] != 'undefined'){\n\tvar creating = browser.tabs.create({\n url:data.data.availability[0].url\n });\n\titemArray = [data.data.availability[0].url,\"\",type];}\n\telse {\n\titemArray = [\"No result\",\"\",type];\t\t\t\n\t}\n localStorage.setItem(text, JSON.stringify(itemArray));\n browser.runtime.reload();\n});\t\t\n}", "function getTab() {\r\n var userTabData = {\r\n userEmail: userEmail,\r\n uid: userID\r\n };\r\n\r\n $.ajax({\r\n type: \"POST\",\r\n url: \"https://files.dpanzer.net/files/script/animated-new-tabs/data.php\",\r\n data: userTabData,\r\n dataType: \"JSON\",\r\n success: function(response) {\r\n console.log(\"Synced Tab: \" + response.tabID);\r\n if (response.tabID == null) {\r\n console.log(\"No tab saved on server.\");\r\n chrome.storage.sync.get(\"setPage\", function(item) {\r\n if (item.setPage == null) {\r\n console.log(\"No tab set in extension.\");\r\n //var exURL = chrome.extension.getURL('dist/options.html');\r\n //var optionsUrl = exURL + \"?notab=true\"\r\n //chrome.tabs.create({\r\n //url: optionsUrl\r\n //});\r\n chrome.runtime.openOptionsPage()\r\n } else {\r\n syncTab();\r\n }\r\n });\r\n return;\r\n } else {\r\n chrome.storage.sync.set({\r\n \"setPage\": response.tabID\r\n });\r\n }\r\n }\r\n });\r\n refreshDB();\r\n}", "function response_from_helper (response) {\n if (response) {\n plugin_found_span.innerHTML = \"installed\";\n document.getElementById(\"helper-instructions\").style.color=\"black\";\n } else {\n plugin_found_span.innerHTML = (\"<b>missing or failing<b>\");\n document.getElementById(\"helper-instructions\").style.color=\"blue\";\n return;\n }\n\n if(response.hasOwnProperty('ok')){\n // I used to have the reload in the code for enableAutoUpdate or disableAutoUpdate.\n // But that intermittently caused the request to fail, because the reload refreshed\n // the javascript before the response came back. It actually started the helper,\n // but it closed the connection before the helper could read any bytes.\n // Be sure NOT to call reload on the response to 'status', because when the main\n // JavaScript body loads, *it* issues a 'status', and that creates an infinite loop.\n location.reload();\n } else if (response.hasOwnProperty('list_all')) {\n var t = response.list_all;\n populate_extension_list(t)\n } else if (response.hasOwnProperty('status_all')) {\n var t = response.status_all;\n if (t == \"disabled\") {\n status_span.textContent = \"disabled for all\";\n } else if (t == \"enabled\") {\n status_span.textContent = \"enabled for all\";\n } else {\n status_span.textContent = \"some enabled and some disabled\";\n }\n } else {\n alert (\"request failed\")\n }\n\n if (chrome.runtime.lastError) {\n alert (\"There was an error, it was:\" + chrome.runtime.lastError.message);\n }\n\n }", "function showResponseAlert(request) {\n if ((request.readyState == 4) &&\n (request.status == 200)) {\n alert(request.responseText);\n }\n}", "function sendResponse(response) {\r\n chrome.windows.getCurrent(null, function (w) {\r\n let bg = chrome.extension.getBackgroundPage();\r\n bg.dialogUtils.setDialogResult(w.id, response)\r\n })\r\n}", "function callback(tabs) {\n\n //Get either the SaaS tenant ID or the Managed environment ID from local storage\n let currentTab = tabs[0]; \n tenant = getTenantId(currentTab.url, deploy); \n console.log(\"retrieving values for \" + tenant);\n\n //Using the ID above extract the values from local storage\n chrome.storage.local.get([tenant], function(result) {\n \n //If there are no values stored, then set the text fields to blank\n if(result[tenant] != undefined) {\n if (result[tenant].api_key == null && result[tenant].api_key == \"\") {\n document.getElementById(\"api_key\").value = \"\";\n } else {\n document.getElementById(\"api_key\").value = result[tenant].api_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tag_filter_key == null) {\n document.getElementById(\"tag_filter_key\").value = \".*\";\n } else {\n document.getElementById(\"tag_filter_key\").value = result[tenant].tag_filter_key;\n }\n\n if (result[tenant] == undefined && result[tenant].tenant_color == null) {\n document.getElementById(\"tenant_color\").value = \"#000000\";\n } else {\n document.getElementById(\"tenant_color\").value = result[tenant].tenant_color;\n }\n }\n }); \n }", "function reqListener() {\n console.log(\"res\", this.responseText);\n }", "function getPlaylist() {\n chrome.tabs.getSelected(null, function (tab) {\n // Send a request to the content script.\n chrome.tabs.sendMessage(tab.id, {action: \"getDOM\"}, null, function (response) {\n\n var message = response.dom;\n setupDownloadLink(message);\n\n // debug code\n /*console.log(message);*/\n\n });\n });\n}", "function pyLoadPost(name) {\n\ntext_entry.show();\n\n//console.log(\"Send POST: \" + name);\n\nRequest({\n url: \"http://\" + require(\"sdk/simple-prefs\").prefs.pyLoadServer + \":\" + require(\"sdk/simple-prefs\").prefs.pyLoadPort + \"/json/add_package\",\n content: { add_name: name, add_links: tabs.activeTab.url, add_dest: require(\"sdk/simple-prefs\").prefs.toqueue }/*,\n onComplete: function (response) {\n console.log( response.text );\n }*/\n}).post();\n}", "function reqListener () {\n console.log(this.responseText);\n}", "function doAlertResponse(id, responseText){\n\tlogInfo(\"doAlertResponse fired with value: \" + responseText);\n \talert(trim(responseText));\n \tsetIdle();\n}", "function onTabUpdate() {\n chrome.tabs.query({active: true}, function(tab) {\n chrome.tabs.executeScript(null, {\n file: \"findScript.js\"\n }, function() {\n if (chrome.runtime.lastError)\n updateBadge(\"#FF0\");\n });\n });\n}", "function my_callback(json_result) {\n console.log(\"Done\");\n }", "function callbackGetDataForIndicator(resp){\n\t//console.log(resp);\n}", "function getTab(callback) {\n\tlet tab;\n\tchrome.tabs.getAllInWindow(null, (tabs) => {\n\t\tlet tabsFiltered = tabs.filter(tab => tab.url === 'http://localhost:8080/');\n\t\tif (tabsFiltered.length) {\n\t\t\tcallback(tabsFiltered[0]);\n\t\t\treturn;\n\t\t} else {\n\t\t\ttabsFiltered = tabs.filter(tab => tab.url === 'https://audius.rockdapus.org/');\n\t\t\tif (tabsFiltered.length) {\n\t\t\t\tcallback(tabsFiltered[0]);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcallback();\n\t});\n}", "function call_prepare( json ){\n\tchrome.tabs.executeScript( media.tab, { file: \"js/prepare.js\" }, function() {\n\t\tchrome.tabs.sendRequest( media.tab, json , function(response) {\n\t\t\tconsole.log( 'Call Prepare: Done' );\n\t\t\tif( response.error == false ){\n\t\t\t\tconsole.log( response.title, response.url );\n\t\t\t\tdo_download( response.url, response.title );\n\t\t\t}\n\t\t\telse{\n\t\t\t\tdo_notif( 'images/error.png', 'There is something wrong', json.hd_link );\n\t\t\t}\n\t\t});\n\t});\n}", "function handleMessage(request, sender, sendResponse) {\n if (request.action == \"callback\") {\n\thandleResponse(request);\n\treturn;\n }\n \n if (request.action == \"getLinks\") {\n\tconsole.log(\"Message from the background script: \" + request.action);\n\t\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\t\t\n\tfunction callback(message) {\n\t\t//here, we have the result of the \"getStatus\" action, or of the original \"getLinks\" result if already computed\n\t\tvar status = statuses[message.tabId];\n\t\tif (status != null && status != undefined) {\n\t\t\tvar result = { \"action\": \"callback\", \"tabId\" : message.tabId, \"tabUrl\" : message.tabUrl, \"status\": status, \"expands\": expands[expandId] };\n\t\t\thandleMessage(result);\n\t\t\t//Send to popups a callback action. (it can raise an error if there is no popup though)\n\t\t\tbrowser.runtime.sendMessage(result);\n\t\t}\n\t};\n\t\n\tfunction storeNewStatus(message) {\n\t\t//here, we have the result of the \"getStatus\" action.\n\t\tstatuses[message.tabId] = message.status;\n\t\tcallback(message);\n\t};\n\t\n\tfunction handleError(error) {\n\t\t//console.log(`Error: ${error}`);\n\t\tstoreNewStatus( { \"tabId\" : request.tabId, \"status\": [] } );\n\t}\n\t \n\tvar status = statuses[request.tabId];\n\tif (status == null || status == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t\t\n\t} else if (request.kind != undefined && request.kind != null && status[kind] == undefined) {\n\t\tvar sending = browser.tabs.sendMessage(request.tabId, { \"action\": \"getStatus\", \"tabId\" : request.tabId, \"tabUrl\" : request.tabUrl, \"expands\": expands[expandId] } );\n\t\tsending.then(storeNewStatus, handleError);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action });\n\t\t\n\t} else {\n\t\tcallback(request);\n\t\tsendResponse({\"response\": \"wait\", \"action\" : request.action }); \n\t}\n\t\n } else if (request.action == \"switchExpand\") {\n \n\tvar status = statuses[request.tabId];\n\tvar expandId = url_domain(request.tabUrl);\n\tif (expands[expandId] == null || expands[expandId] == undefined) {\n\t\texpands[expandId] = {};\n\t}\n\tvar kind = request.kind;\n\tif (expands[expandId][kind] == null || expands[expandId][kind] == undefined) {\n\t\texpands[expandId][kind] = false;\n\t}\n\texpands[expandId][kind] = !expands[expandId][kind];\n\t\n\tsendResponse({\"response\": \"switched\", \"action\" : request.action, \"tabId\": request.tabId, \"tabUrl\" : request.tabUrl, \"kind\": request.kind, \"value\": expands[expandId][kind] });\n }\n}", "function addListener(expectedTabId, rootName) {\n chrome.tabs.onUpdated.addListener((tabId, changeInfo, tab) => {\n if (tabId !== expectedTabId) {\n // Another tab updated.\n return;\n }\n //console.log(\"Page Status: \" + changeInfo.status);\n if (changeInfo.status === \"loading\") {\n let currentMessage = document.getElementById(\"status\").textContent;\n if (!(currentMessage.includes(\"Getting\") ||\n currentMessage.includes(\"Refreshings\") ||\n currentMessage.includes(\"Trying\"))) {\n renderStatus(\"Getting Access \\u2026\");\n document.getElementById(\"status\").style.color = \"#fff\";\n }\n hide(document.getElementById(\"statusIcon\"));\n show(document.getElementById(\"loaderContainer1\"));\n } else if (changeInfo.status === \"complete\") {\n let url;\n \n // this line requires the \"tabs\" permision\n try { url = getUrlFromTab(tab); }\n catch (error) {\n console.log(\"CAUGHT-\" + error);\n renderUnknown(\"Can\\u2019t confirm access.\");\n return;\n }\n let loginCheck = url.includes(\"idp.mit.edu\");\n let redirectCheck = url.toLowerCase().includes(\"redirect\");\n let failCheck1 = url.includes(\"libproxy.mit.edu/login?url=\");\n let failCheck2 = url.includes(\"libproxy.mit.edu/menu\") && url.length < 30;\n let failCheck3 = url.includes(\"libproxy.mit.edu/connect?session\");\n if (loginCheck) {\n if (redirectCheck) {\n // an expected redirect\n //console.log(\"URL indicates redirect.\");\n } else {\n //console.log(\"URL indicates login.\");\n renderStatus(\"Provide your MIT credentials.\");\n closeLoader();\n presentIcon(\"lock\");\n }\n } else if (failCheck1 || failCheck2 || failCheck3) {\n //console.log(\"URL indicates failure.\");\n renderFailure(rootName + \" is not a supported proxy site.\"); \n } else if (successCheckUrl(url)) {\n //console.log(\"URL indicates success.\");\n renderSuccess();\n } else {\n //console.log(\"URL was unexpected.\");\n renderUnknown(\"Unexpected redirect.\");\n } \n }\n });\n}", "function handleResponse() {\r\n if (!alive) {\r\n openSingletonPage(chrome.extension.getURL('error.html'));\r\n }\r\n}", "function addNewTab(p1) {\n let _this = this;\n let prameters = \"&projectId=\" + p1.projectid + \"&categoryId=\" + p1.categoryid + \"&description=\" + p1.description + \"&parentId=\" + p1.parentid + \"&expiredate=\" + p1.expiredate;\n let handlerurl = funcList[\"addNewTab\"][\"interface\"] + prameters;\n\n $.ajax({\n // type: \"get\",\n async: true,\n url: handlerurl,\n dataType: 'jsonp',\n crossDomain: true,\n success: function (data) {\n _this.newtab.returnmessage = data.Message;\n if (data.Code === 0) {\n //console.log(\"success\");\n _this.newtab.categoryselected = -1;\n _this.newtab.desc = \"\";\n //refresh file tab data\n funcList[\"getFileTabs\"][\"func\"].call(_this, p1);\n document.getElementById(\"fileTabTitle\").click();\n } else {\n console.log(\"addNewTab\", \"failed\");\n }\n }\n });\n}", "function Mesibo_onHttpResponse(mod, cbdata, response, datalen) {\n\tvar rp_log = \" ----- Recieved http response ----\";\n\tmesibo_log(mod, rp_log, rp_log.length);\n\tmesibo_log(mod, response, datalen);\n\n\tp = JSON.parse(cbdata);\n\tmesibo_log(mod, rp_log, rp_log.length);\n\n\treturn MESIBO_RESULT_OK;\n}", "function onauthrequired_cb(details, my_callback) {\n console.log(\"APPU DEBUG: RequestID: \" + details.requestId);\n console.log(\"APPU DEBUG: URL: \" + details.url);\n console.log(\"APPU DEBUG: Method: \" + details.method);\n console.log(\"APPU DEBUG: FrameID: \" + details.frameId);\n console.log(\"APPU DEBUG: Parent FrameID: \" + details.parentFrameId);\n console.log(\"APPU DEBUG: Tab ID: \" + details.tabId);\n console.log(\"APPU DEBUG: Type: \" + details.type);\n console.log(\"APPU DEBUG: Timestamp: \" + details.timeStamp);\n console.log(\"APPU DEBUG: Scheme: \" + details.scheme);\n console.log(\"APPU DEBUG: Realm: \" + details.realm);\n console.log(\"APPU DEBUG: Challenger: \" + details.challenger);\n console.log(\"APPU DEBUG: ResponseHeaders: \" + details.responseHeaders);\n console.log(\"APPU DEBUG: StatusLine: \" + details.statusLine);\n}", "async function on_tab_activated(info)\n {\n update_in_tab(await browser.tabs.get(info.tabId));\n }", "function onGetTab(tab)\n{ \n // send message to content script\n chrome.tabs.getSelected(null, function(tab) {\n if (tab.url.indexOf(\"chrome://\") == 0)\n {\n var skype_plugin = window.parent.document.getElementById(\"skype_plugin_object\");\n if (skype_plugin != null)\n {\n skype_plugin.ShowOptionsDialog();\n }\n }\n else\n {\n chrome.tabs.sendRequest(tab.id, {action: \"ShowOptionsDialog\"}, function(response) {});\n }\n }); \n}", "function quit(err)\n{\n alert(err.responseText);\n}", "function handleUpdated(tabId, changeInfo, tabInfo) {\n //Request Running rules details from background script\n browser.runtime.sendMessage({event: \"Running-rules\"});\n}", "function setOutput()\n{\n\tif(httpObject.readyState == 4)\n\t\tparseJSON(httpObject.responseText);\n}", "function executeReturn( AJAX ) {\r\n// alert(\" executeReturn( AJAX )\")\r\n if (AJAX.readyState == 4) {\r\n if (AJAX.status == 200) {\r\n worker_stop(\"\");\r\n logger('AJAXRequest is complete: ' + AJAX.readyState + \"/\" + AJAX.status + \"/\" + AJAX.statusText);\r\n\t if ( AJAX.responseText ) {\r\n\t\t logger(AJAX.responseText);\r\n\t\t logger(\"-----------------------------------------------------------\");\r\n\t\t eval(AJAX.responseText);\r\n\t }\r\n\t}\r\n }\r\n}", "function loadURL() {\n \tconsole.log(\"in loadURL\");\n \tvar xhr = new XMLHttpRequest();\n\txhr.onreadystatechange = function() {\n\t\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\t\tconsole.log(\"ready\");\n\t\t\t//callScript();\n\t\t}\n\t}\n\txhr.open(\"GET\", \"https://script.google.com/macros/d/1eydgiLo6PD4JB5Nfdv-rNP9L-vW43busr5fUBo6DZ9HEew5JnmRIQImH/edit?template=app\", true);\n\txhr.send();\n\t//callScript();\n }", "function callbackXHR() {\n \"use strict;\"\n\n if (g_polling_xhr.readyState == 4 && g_polling_xhr.status == 200) {\n // parse the response.\n var data = JSON.parse(g_polling_xhr.responseText);\n var errorCode = (undefined != data.error && 0 != data.error.length) ? data.error[0] : 0;\n var eventName = \"\";\n var newseq = 0;\n if (undefined != data.result && 0 != data.result.length) {\n newseq = data.result[0].seqNum;\n eventName = data.result[0].eventName;\n }\n\n // invoke event handler\n if (g_seqnum < newseq) {\n g_seqnum = newseq;\n MonitoringEventHandler(data);\n }\n\n g_polling_xhr.abort();\n\n // do XHR again\n // - 7 ... service not avalibable.\n if (eventName == \"terminated\") {\n // don't send XHR.\n // disable long press -> no save as photo when PartyShareApp was teminated.\n disable();\n } else if (errorCode == 7) {\n UITerminatePopUp(translationlist['64543'].replace(\"[%1]\", translationlist['80409']));\n } else {\n /* fix bug DM15GN1-2486, on Ipad/Phone, terminate popup doesnot display when close PhotoShare App by remote control */\n setTimeout(doXHR, 500);\n }\n }\n}", "function handleResponse(){\n\tif((request.status == 200)&&(request.readyState == 4)){\n\t\tvar jsonString = request.responseText;\n\t\treceiveJSON(jsonString);\n\t}\n}", "function onTabReady(tabId) {\n\t\tconsole.log('onTabReady(' + tabId + ')');\n\t\t// ask background for current song info\n\t\tchrome.runtime.sendMessage({\n\t\t\ttype: 'v2.getSong',\n\t\t\ttabId: tabId\n\t\t}, function(response) {\n\t\t\tonSongLoaded(tabId, response);\n\t\t});\n\t}", "function getTab() {\r\n chrome.tabs.query({}, function(tabs) {\r\n for (var i = 0; i < tabs.length; i++)\r\n {\r\n if(tabs[i].url.includes(\"ytmp3.cc\"))\r\n {\r\n chrome.tabs.update(tabs[i].id, {selected: true});\r\n chrome.tabs.executeScript(null, {file: \"/download.js\"});\r\n break;\r\n }\r\n }\r\n });\r\n}", "function cb_tabOnUpdated(id, info, tab) {\n\n //Checks if loading is complete\n if (tab.status !== \"complete\"){\n console.log(\"Not loaded\");\n return;\n }\n else\n {\n console.log(\"Loaded\");\n }\n \n if (tab.url.toLowerCase().indexOf(\"facebook.com\") === -1){\n console.log(\"Not Facebook\");\n return;\n }\n\n if(!tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icongrey.png'});\n }\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n }\n\n if (tab.url.toLowerCase().indexOf(\"facebook.com/buzzfeed\") !== -1){\n chrome.tabs.update(tab.id, {url: \"http://www.facebook.com/\"});\n }\n\n //Show PageAction\n chrome.pageAction.show(tab.id);\n\n if(tempBool){ \n chrome.pageAction.setIcon({tabId: tab.id, path: 'images/icon.png'});\n chrome.storage.sync.get(\"urlList\", function(data){\n urlList = data.urlList;\n if (typeof urlList === 'undefined') {\n urlList = default_urlList;\n }\n });\n chrome.tabs.executeScript(tab.id, {\"file\": \"js/buzzoff.js\"}, function() {\n chrome.tabs.sendMessage(tab.id, JSON.stringify(urlList));\n });\n }\n}", "onFinish() {}", "function SucceededCallback(result, eventArgs)\r\n{\r\n // Page element to display feedback.\r\n // var RsltElem = document.getElementById(\"ResultId\");\r\n // RsltElem.innerHTML = result;\r\n parseJson(result);\r\n}", "onSuccess() {}", "function onSuccess () {}", "function cjAjaxAddonCallback(AddonName, QueryString, Callback, CallbackArg) {\n var xmlHttp, url, pos;\n try {\n // Firefox, Opera 8.0+, Safari\n xmlHttp = new XMLHttpRequest();\n } catch (e) {\n // Internet Explorer\n try {\n xmlHttp = new ActiveXObject(\"Msxml2.XMLHTTP\");\n } catch (e) {\n try {\n xmlHttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n } catch (e) {\n alert(\"Your browser does not support this function\");\n return false;\n }\n }\n }\n xmlHttp.onreadystatechange = function () {\n var serverResponse, sLen, i, scripts, sLen, srcArray, codeArray;\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {\n serverResponse = xmlHttp.responseText;\n var isSrcArray = new Array();\n var codeArray = new Array();\n var oldOnLoad = window.onload;\n if (serverResponse != \"\") {\n // remove embedded scripts\n var e = document.createElement(\"div\");\n if (e) {\n // create array of scripts to add\n // this is a workaround for an issue with ie\n // where the scripts collection is 0ed after the first eval\n window.onload = \"\";\n e.innerHTML = serverResponse;\n scripts = e.getElementsByTagName(\"script\");\n sLen = scripts.length;\n if (sLen > 0) {\n for (i = 0; i < sLen; i++) {\n if (scripts[i].src) {\n isSrcArray.push(true);\n codeArray.push(scripts[i].src);\n scripts[i].parentNode.removeChild(scripts[i]);\n } else {\n isSrcArray.push(false);\n codeArray.push(scripts[i].innerHTML);\n scripts[i].parentNode.removeChild(scripts[i]);\n }\n }\n serverResponse = e.innerHTML;\n }\n }\n }\n // execute the callback which may save the response\n if (Callback) {\n Callback(serverResponse, CallbackArg);\n }\n // execute any scripts found if response\n for (i = 0; i < codeArray.length; i++) {\n if (isSrcArray[i]) {\n var s = document.createElement(\"script\");\n s.src = codeArray[i];\n s.type = \"text/javascript\";\n document.getElementsByTagName(\"head\")[0].appendChild(s);\n } else {\n eval(codeArray[i]);\n }\n\n }\n if (window.onload) {\n window.onload();\n }\n\n }\n }\n // create LocalURL\n url = document.URL;\n pos = url.indexOf(\"#\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"?\");\n if (pos != -1) { url = url.substr(0, pos) }\n pos = url.indexOf(\"://\");\n if (pos != -1) {\n pos = url.indexOf(\"/\", pos + 3);\n if (pos != -1) { url = url.substr(pos) }\n }\n url += \"?nocache=\" + Math.random()\n if (AddonName != \"\") { url += \"&remotemethodaddon=\" + AddonName; }\n if (QueryString != \"\") { url += \"&\" + QueryString; }\n xmlHttp.open(\"GET\", url, true);\n xmlHttp.send(null);\n}", "function onClickHandler(info, tab) {\n console.log(\"message\");\n console.log(message);\n\n var sText = info.selectionText;\n var url = \"http://localhost:3000/search/external?user_id=1&word=\" + encodeURIComponent(sText) + \"&example=\" + message; \n // window.open(url, '_blank');\n // console.log(\"1\");\n chrome.extension.getBackgroundPage().console.log('foo');\n\n // alert(info.getSelection().getRangeAt(0));\n // console.log(info.getSelection());\n   var sel = '';\n   if(window.getSelection){\n console.log(window.getSelection())\n   }\n   else if(document.getSelection){\n console.log(document.getSelection())\n   }\n   else if(document.selection){\n    console.log(document.selection.createRange())\n   }\n\n\n\n $.ajax({\n url: url,\n crossDomain:true,\n }).done(function() {\n });\n // alert(\"1\");\n\n // var xhr = new XMLHttpRequest();\n // xhr.onreadystatechange = handleStateChange; // Implemented elsewhere.\n // xhr.open(\"GET\", chrome.extension.getURL(url), true);\n // xhr.send();\n\n}", "function updateContent() {\n function updateTab(tabs) {\n if (tabs[0]) {\n currentTab = tabs[0];\n console.log(\"updateTabs\");\n \n // executeScript(currentTab);\n loadFoundWords(currentTab);\n }\n }\n\n var gettingActiveTab = browser.tabs.query({active: true, currentWindow: true});\n gettingActiveTab.then(updateTab);\n}", "function onScriptEventReceived(scriptEvent) {\r\n try {\r\n scriptEvent = JSON.parse(scriptEvent);\r\n } catch (error) {\r\n console.log(\"ERROR parsing scriptEvent: \" + error);\r\n return;\r\n }\r\n\r\n if (scriptEvent.app !== \"multiConVote\") {\r\n return;\r\n }\r\n\r\n \r\n switch (scriptEvent.method) {\r\n case \"initializeUI\":\r\n initializeUI(scriptEvent.myUsername, scriptEvent.voteData);\r\n selectTab(scriptEvent.activeTabName);\r\n break;\r\n\r\n case \"voteError\":\r\n voteError(scriptEvent.errorText);\r\n break;\r\n\r\n case \"voteSuccess\":\r\n voteSuccess(scriptEvent.usernameVotedFor);\r\n break;\r\n\r\n default:\r\n console.log(\"Unknown message from multiConApp_app.js: \" + JSON.stringify(scriptEvent));\r\n break;\r\n }\r\n}", "function onSuccessfulXHR(request_intent, xhr, response) {\n\n\t// $('#id_notification_pane').text(response);\n\n\tswitch (request_intent) {\n\tcase INTENT_INJECT_PAGE_NAVIGATION:\n\t\tdocument.getElementById(\"page_navigation\").innerHTML = response;\n\t\tbreak;\n\tcase INTENT_INSERT_SYSTEM_USER:\n\tcase INTENT_UPDATE_SYSTEM_USERS:\n\t\tresetFields();\n\t\tsetDefaultSaveType();\n\t\tpopulateSystemUsers();\n\t\tbreak;\n\tcase INTENT_TRASH_SYSTEM_USER:\n\tcase INTENT_ERASE_SYSTEM_USER:\n\tcase INTENT_RESTORE_SYSTEM_USER:\n\t\tpopulateSystemUsers();\n\tcase INTENT_QUERY_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_system_users').innerHTML = response;\n\t\t// $('#id_table_body_system_users').text(response);\n\t\tpopulateTrashedSystemUsers();\n\t\tbreak;\n\tcase INTENT_QUERY_DELETED_SYSTEM_USERS:\n\t\tdocument.getElementById('id_table_body_deleted_system_users').innerHTML = response;\n\t\tbreak;\n\tcase INTENT_STAGE_SELECTED_SYSTEM_USER_FOR_EDITING:\n\t\tstageSelectedSystemUserForEditing(response);\n\t\tbreak;\n\tdefault:\n\t\talert(\"Undefined callback for intent [\" + request_intent + \"]\");\n\t\tbreak;\n\t}\n}", "function onSuccess() {}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "function onFinished(name, id, result) {\n // set a cookie to report the results...\n var cookie = name + \".\" + id + \".status=\" + result + \"; path=/\";\n document.cookie = cookie;\n\n // ...and POST the status back to the server\n postResult(name, result);\n}", "sendPageReady() {}", "function executeScripts(tab) {\n chrome.tabs.get(tab, function(details) {\n chrome.storage.sync.get(['wanikanify_blackList'], function(items) {\n\n function isBlackListed(details, items) {\n var url = details.url;\n var blackList = items.wanikanify_blackList;\n if (blackList) {\n if (blackList.length == 0) {\n return false;\n } else {\n var matcher = new RegExp($.map(items.wanikanify_blackList, function(val) { return '('+val+')';}).join('|'));\n return matcher.test(url);\n }\n }\n return false;\n }\n\n\n if (!isBlackListed(details, items)) {\n chrome.tabs.executeScript(null, { file: \"js/jquery.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/replaceText.js\" }, function() {\n chrome.tabs.executeScript(null, { file: \"js/content.js\" }, function() {\n executed[tab] = \"jp\";\n });\n });\n });\n } else {\n console.log(\"Blacklisted\");\n }\n });\n });\n}", "function callBack(return_value) {\n var result = JSON.parse(return_value);\n var functionName = result.FunctionName;\n var parameter = result.Result;\n if (parameter.toString().toLowerCase() == 'ok') {\n notify(functionName + ' returned success');\n if (window.location.href.indexOf('fram.html')> -1){\n call_GET('readFlows');\n }\n } else if (parameter.toString().toLowerCase().indexOf(\"error\") > -1) {\n humaneAlert(\"Encountered an error:\" + parameter + \", please check server log for a more detailed report\");\n } else if (parameter.toString().toLowerCase() == 'reload') {\n location.reload();\n } else if (parameter.toString().toLowerCase() == 'silent') {\n return;\n } \n else {\n try {\n window[functionName](parameter);\n } catch (e) {\n humaneAlert(e + ' Function Name =' + functionName);\n }\n }\n}", "function httpResponseHandler() {\n if(xmlHttp.readyState == 4 && xmlHttp.status==200) {\n responseData = JSON.parse(xmlHttp.response);\n displayAdjectiveCloud(responseData['adjective_cloud']);\n }\n }", "function giveResponse(){\n check();\n}", "function callback(msg) {\n print(\"Server response - Msg -> \" + msg.data);\n print(\"\");\n var data = jQuery.parseJSON(msg.data);\n handle_event(data);\n}", "function callbackMakeBookingNow(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert('Réservation acceptée');\n reloadRoomListAvailableNow();\n } else {\n alert('Réservation refusée : ' + JSON.parse(apiResponse)['info']);\n }\n}", "function onClickHandler(info, tab) {\n console.log('info:',info.selectionText);\n console.log('tab:',tab);\n var newURL = \"http://olam.in/Dictionary/en_ml/\"+info.selectionText;\n chrome.tabs.create({ url: newURL },function(res){\n console.log('res:',res);\n chrome.tabs.getSelected(res.windowId, function(response){\n console.log('response:',response);\n })\n });\n \n // chrome.windows.create({'url': 'redirect.html','width':300,'height':300,'left':500,'top':200,'type': 'popup'}, function(window) {\n // chrome.runtime.sendMessage({ details: \"test messge\" }, function(response) {\n // console.log('response:',response);\n // });\n // });\n \n}", "function readyStateRecieved(eventHandler)\n{\n if (xhrObj.readyState == 4 && xhrObj.status == 200) //!< XHR has data loaded and server says OK\n {\n xhrResponse = xhrObj.responseText; //!< Response text recieved; store as response\n eventHandler(); //!< Execute the event handler\n }\n}", "function onFinish() {\n console.log('finished!');\n}", "function updateRequestCallback(result) {\n //if minigame does not exist alert player and close window\n if (result.ReturnValue == null || result.ReturnValue == false) {\n alertAndClose(result.Message);\n }\n }", "function handleSearchResponse(_event) {\r\n let xhr = _event.target;\r\n if (xhr.readyState == XMLHttpRequest.DONE) {\r\n alert(xhr.response);\r\n }\r\n }", "function getEventID(tab_url, selection, contextMenuClickFlag) {\n\n\n var current_tab_index = tab_url[0].index; // index is needed in order to open new tab next to previous tab\n console.log(\"Current Tab Index: \",current_tab_index);\n var string_url = new String(tab_url[0].url); // string URL\n // console.log(string_url);\n // var message_span = document.getElementById(\"message\"); // element that displays error messages\n var clipboard_text = getClipboardText(); // gets text from clipboard\n // Bools\n var check_clipboard_bool = checkIfURL(clipboard_text);\n var check_tab_url_bool = checkIfURL(string_url);\n // conditional statement that determines if user is on stubhub.com or not\n var check_if_on_sh_bool = (string_url.search(\"stubhub\") != -1) ? true : false;\n\n function process(strURL){\n var url = new URL(strURL);\n // get pathname eg \"/event/9564741\"\n var tab_pathname = new String(url.pathname);\n // split pathname into array\n var url_array = tab_pathname.split(\"/\");\n // there's two types of event URLs, check for both\n if(tab_pathname.search(\"priceanalysis\") != -1){\n var query = strURL.split(\"?\");\n query = query[1].split(\"=\");\n query = query[1].split(\"&\");\n eventID = query[0];\n getSellHubURL(eventID, current_tab_index);\n }\n\n else if(url_array[2] == \"event\"){\n var eventID = url_array[3]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n\n else {\n var eventID = url_array[2]; // get ID\n getStubHubURL(eventID, current_tab_index);\n }\n }\n\n if(contextMenuClickFlag == false){\n // conditionals for various scenarios eg \"on events page, but also have link on clipboard\"\n if(check_tab_url_bool && !check_clipboard_bool){ // on events page, no link found (most common scenario)\n process(string_url);\n }\n else if(!check_tab_url_bool && check_clipboard_bool){ // not on events page, link found\n process(clipboard_text);\n \n }\n else if(check_tab_url_bool && check_clipboard_bool){ // yes/yes, events page takes precedence\n process(string_url);\n }\n else{ // no/no\n // if user is on stubhub, let them know to copy event address\n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n // else message.innerText = \"Visit StubHub Events\"\n }\n }\n else{\n var selection_url = selection.linkUrl;\n var selection_text_bool = typeof(selection.selectionText) == \"undefined\"\n console.log(\"selection_text\", selection_text_bool);\n var context_menu_url_bool = checkIfURL(selection_url);\n console.log(\"Context menu url: \", context_menu_url_bool);\n\n\n if(context_menu_url_bool){\n process(selection_url);\n }\n else if(!selection_text_bool){\n getGenerateSearchQueryURL(selection.selectionText, current_tab_index);\n }\n else if(!context_menu_url_bool && check_tab_url_bool){\n process(string_url);\n }\n else if(!context_menu_url_bool && !check_tab_url_bool && check_clipboard_bool){\n process(clipboard_text);\n }\n else{ \n if(!check_clipboard_bool){\n getGenerateSearchQueryURL(clipboard_text, current_tab_index);\n }\n }\n\n }\n\n}", "function reqListener () {\n //console.log(this.responseText);\n //console.log(this.responseText.split('\\n'));\n processSlideDeck(this.responseText.split('\\n'));\n //document.body.innerHTML=slideDeck;\n }", "function _handler(data, statusText, xhr) {\n if(xhr) {\n print2Console(\"RESPONSE\", xhr.status);\n } else {\n print2Console(\"RESPONSE\", data);\n }\n}", "async onFinished() {}", "function callbackEditBooking(apiResponse) {\n if (JSON.parse(apiResponse)['done'] === true) {\n alert(\"Réservation modifiée\");\n reloadMyBookings();\n } else {\n alert('Réservation non modifiée: ' + JSON.parse(apiResponse)['info']);\n }\n}", "done() {\n const eventData = EventData_1.EventData.createFromRequest(this.request.value, this.externalContext, Const_1.SUCCESS);\n //because some frameworks might decorate them over the context in the response\n const eventHandler = this.externalContext.getIf(Const_1.ON_EVENT).orElseLazy(() => this.internalContext.getIf(Const_1.ON_EVENT).value).orElse(Const_1.EMPTY_FUNC).value;\n AjaxImpl_1.Implementation.sendEvent(eventData, eventHandler);\n }" ]
[ "0.6489205", "0.64500654", "0.61856866", "0.6150769", "0.6064036", "0.60603017", "0.6057351", "0.6000076", "0.5987592", "0.5979499", "0.59670115", "0.59537065", "0.5947971", "0.59200096", "0.5915242", "0.5898453", "0.5849637", "0.5836895", "0.58346117", "0.5831618", "0.5826313", "0.57917875", "0.57910156", "0.5762928", "0.574337", "0.5720538", "0.5691217", "0.5688157", "0.56696546", "0.56561685", "0.56432575", "0.56375456", "0.56370836", "0.5628006", "0.5626947", "0.5624706", "0.5615067", "0.56140053", "0.560823", "0.5603827", "0.55970156", "0.5594254", "0.55932593", "0.55750364", "0.55597407", "0.55519825", "0.55498713", "0.55333066", "0.552495", "0.5521728", "0.5520822", "0.55135953", "0.55086243", "0.5499874", "0.5485651", "0.54776907", "0.54766417", "0.54761267", "0.54706043", "0.54692626", "0.5461363", "0.54497004", "0.5446035", "0.54408205", "0.54397297", "0.5431509", "0.54248375", "0.54180294", "0.54073757", "0.54067516", "0.54053706", "0.54016465", "0.5398464", "0.53953046", "0.5388261", "0.5388217", "0.5388063", "0.5388059", "0.5386638", "0.5379172", "0.5377978", "0.5375857", "0.5375857", "0.53742594", "0.53641677", "0.5353792", "0.5352622", "0.5352496", "0.5343897", "0.5342947", "0.5333164", "0.5331357", "0.5329081", "0.53288376", "0.53246766", "0.532061", "0.5312581", "0.53044164", "0.53025055", "0.53004986", "0.5299082" ]
0.0
-1
A function returns REGEX flags depending on user choices
function getFlags() { var flags = ""; // start with empty flags if (globalCheckbox.checked) { flags += "g"; } if (caseInsensitiveCheckbox.checked) { flags += "i"; } if (multilineCheckbox.checked) { flags += "m"; } return flags; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function regex( text, flags){\n\treturn nr(new RegExp( text, flags))\n}", "function regex(flags) {\n return function(source) {\n return new RegExp (source, flags);\n };\n }", "function makeRegex(text,searchType){\n\tvar regex;\n\tswitch(searchType){\n\t\tcase 'starts_with':\n\t\t\tregex = new RegExp(\"^\"+text,'gi');\n\t\t\tbreak;\n\t\tcase 'ends_with':\n\t\t\tregex = new RegExp(text+\"$\",'gi');\n\t\t\tbreak;\n\t\tcase 'contains':\n\t\t\tregex = new RegExp(text,'gi');\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tregex = 0;\n\t}\n\treturn regex;\n}", "function flagRegExp(rgx, modifiers) {\r\n var flags = (rgx + '').replace(/[\\s\\S]+\\//, '');\r\n modifiers.replace(/([-+!]?)(\\w)/g, function(index, op, flag) {\r\n index = flags.indexOf(flag)\r\n flags = op == '-' || (op == '!' && index >= 0)\r\n ? flags.replace(flag, '')\r\n : index < 0\r\n ? flags + flag\r\n : flags;\r\n });\r\n return new RegExp(rgx.source, flags);\r\n }", "function regexpFlags(regexp) {\n var flags = regexp.flags;\n if (flags === undefined) {\n flags = '';\n if (regexp.ignoreCase) {\n flags += 'i';\n }\n if (regexp.global) {\n flags += 'g';\n }\n if (regexp.multiline) {\n flags += 'm';\n }\n }\n return flags;\n}", "function RegExpPattern(){\n\t//\n}", "function RegExpconstructorcanalterflags() {\n return new RegExp(/./im, \"g\").global === true;\n}", "function Regexp() {}", "function create(pattern, options) {\n var flags = \"g\";\n flags += options & 1 ? \"i\" : \"\";\n flags += options & 2 ? \"m\" : \"\";\n return new RegExp(pattern, flags);\n}", "function selectRegex(userChoice) {\n let userInputRegex;\n switch (userChoice) {\n case \"boyles-calculation\":\n userInputRegex = boylesUserInputRegex;\n break;\n\n case \"charles-calculation\":\n userInputRegex = charlesUserInputRegex;\n break;\n case \"gaylusac-calculation\":\n userInputRegex = gaylusacUserInputRegex;\n break;\n case \"avogadro-calculation\":\n userInputRegex = avogadroUserInputRegex;\n break;\n\n case \"combined-calculation\":\n userInputRegex = combineUserInputRegex;\n break;\n case \"ideal-calculation\":\n userInputRegex = idealUserInputRegex;\n break;\n\n case \"dalton-calculation\":\n userInputRegex = daltonUserInputRegex;\n break;\n\n default:\n break;\n }\n return userInputRegex; //\n}", "toRegex() {\n }", "function testRegExp(pattern, flags) {\n // The BMP character to use as a replacement for astral symbols when\n // translating an ES6 \"u\"-flagged pattern to an ES5-compatible\n // approximation.\n // Note: replacing with '\\uFFFF' enables false positives in unlikely\n // scenarios. For example, `[\\u{1044f}-\\u{10440}]` is an invalid\n // pattern that would not be detected by this substitution.\n var astralSubstitute = '\\uFFFF',\n tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n tmp = tmp\n // Replace every Unicode escape sequence with the equivalent\n // BMP character or a constant ASCII code point in the case of\n // astral symbols. (See the above note on `astralSubstitute`\n // for more information.)\n .replace(/\\\\u\\{([0-9a-fA-F]+)\\}|\\\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {\n var codePoint = parseInt($1 || $2, 16);\n if (codePoint > 0x10FFFF) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n if (codePoint <= 0xFFFF) {\n return String.fromCharCode(codePoint);\n }\n return astralSubstitute;\n })\n // Replace each paired surrogate with a single ASCII symbol to\n // avoid throwing on regular expressions that are only valid in\n // combination with the \"u\" flag.\n .replace(\n /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n astralSubstitute\n );\n }\n\n // First, detect invalid regular expressions.\n try {\n RegExp(tmp);\n } catch (e) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n /* istanbul ignore next */\n return null;\n }\n }", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts with 'Mr.', 'Mrs.', 'Ms.', 'Dr.', or 'Er.', \n * followed by one or more letters.\n */\n const re = /^(Mr\\.|Mrs\\.|Ms\\.|Dr\\.|Er\\.)\\s?[A-Z|a-z]+$/;\n // var re = (/^(Mr\\.|Dr\\.|Er\\.|Ms\\.|Mrs\\.)\\s?[a-z|A-Z]+$/);\n /*\n * Do not remove the return statement\n */\n return re;\n}", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n \n var re = /^([aeiou]).*\\1$/gi;\n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "function make_a_matcher() {\n return /a/gi;\n}", "function regexVar() {\n \n const re = /^(Mr|Mrs|Dr|Er)\\.[A-Z|a-z]+$/ig\n \n return re;\n}", "function testRegExp(pattern, flags) {\n // The BMP character to use as a replacement for astral symbols when\n // translating an ES6 \"u\"-flagged pattern to an ES5-compatible\n // approximation.\n // Note: replacing with '\\uFFFF' enables false positives in unlikely\n // scenarios. For example, `[\\u{1044f}-\\u{10440}]` is an invalid\n // pattern that would not be detected by this substitution.\n var astralSubstitute = '\\uFFFF',\n tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n tmp = tmp\n // Replace every Unicode escape sequence with the equivalent\n // BMP character or a constant ASCII code point in the case of\n // astral symbols. (See the above note on `astralSubstitute`\n // for more information.)\n .replace(/\\\\u\\{([0-9a-fA-F]+)\\}|\\\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {\n var codePoint = parseInt($1 || $2, 16);\n if (codePoint > 0x10FFFF) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n if (codePoint <= 0xFFFF) {\n return String.fromCharCode(codePoint);\n }\n return astralSubstitute;\n })\n // Replace each paired surrogate with a single ASCII symbol to\n // avoid throwing on regular expressions that are only valid in\n // combination with the \"u\" flag.\n .replace(\n /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n astralSubstitute\n );\n }\n\n // First, detect invalid regular expressions.\n try {\n RegExp(tmp);\n } catch (e) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n /* istanbul ignore next */\n return null;\n }\n }", "function testRegExp(pattern, flags) {\n // The BMP character to use as a replacement for astral symbols when\n // translating an ES6 \"u\"-flagged pattern to an ES5-compatible\n // approximation.\n // Note: replacing with '\\uFFFF' enables false positives in unlikely\n // scenarios. For example, `[\\u{1044f}-\\u{10440}]` is an invalid\n // pattern that would not be detected by this substitution.\n var astralSubstitute = '\\uFFFF',\n tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n tmp = tmp\n // Replace every Unicode escape sequence with the equivalent\n // BMP character or a constant ASCII code point in the case of\n // astral symbols. (See the above note on `astralSubstitute`\n // for more information.)\n .replace(/\\\\u\\{([0-9a-fA-F]+)\\}|\\\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {\n var codePoint = parseInt($1 || $2, 16);\n if (codePoint > 0x10FFFF) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n if (codePoint <= 0xFFFF) {\n return String.fromCharCode(codePoint);\n }\n return astralSubstitute;\n })\n // Replace each paired surrogate with a single ASCII symbol to\n // avoid throwing on regular expressions that are only valid in\n // combination with the \"u\" flag.\n .replace(\n /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n astralSubstitute\n );\n }\n\n // First, detect invalid regular expressions.\n try {\n RegExp(tmp);\n } catch (e) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n /* istanbul ignore next */\n return null;\n }\n }", "function regexVar() {\n let re = new RegExp(/^([aeiou]).+\\1$/);\n return re;\n}", "function testRegExp(pattern, flags) {\n\t // The BMP character to use as a replacement for astral symbols when\n\t // translating an ES6 \"u\"-flagged pattern to an ES5-compatible\n\t // approximation.\n\t // Note: replacing with '\\uFFFF' enables false positives in unlikely\n\t // scenarios. For example, `[\\u{1044f}-\\u{10440}]` is an invalid\n\t // pattern that would not be detected by this substitution.\n\t var astralSubstitute = '\\uFFFF',\n\t tmp = pattern;\n\n\t if (flags.indexOf('u') >= 0) {\n\t tmp = tmp\n\t // Replace every Unicode escape sequence with the equivalent\n\t // BMP character or a constant ASCII code point in the case of\n\t // astral symbols. (See the above note on `astralSubstitute`\n\t // for more information.)\n\t .replace(/\\\\u\\{([0-9a-fA-F]+)\\}|\\\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {\n\t var codePoint = parseInt($1 || $2, 16);\n\t if (codePoint > 0x10FFFF) {\n\t throwUnexpectedToken(null, Messages.InvalidRegExp);\n\t }\n\t if (codePoint <= 0xFFFF) {\n\t return String.fromCharCode(codePoint);\n\t }\n\t return astralSubstitute;\n\t })\n\t // Replace each paired surrogate with a single ASCII symbol to\n\t // avoid throwing on regular expressions that are only valid in\n\t // combination with the \"u\" flag.\n\t .replace(\n\t /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n\t astralSubstitute\n\t );\n\t }\n\n\t // First, detect invalid regular expressions.\n\t try {\n\t RegExp(tmp);\n\t } catch (e) {\n\t throwUnexpectedToken(null, Messages.InvalidRegExp);\n\t }\n\n\t // Return a regular expression object for this pattern-flag pair, or\n\t // `null` in case the current environment doesn't support the flags it\n\t // uses.\n\t try {\n\t return new RegExp(pattern, flags);\n\t } catch (exception) {\n\t return null;\n\t }\n\t }", "function testRegExp(pattern, flags) {\n // The BMP character to use as a replacement for astral symbols when\n // translating an ES6 \"u\"-flagged pattern to an ES5-compatible\n // approximation.\n // Note: replacing with '\\uFFFF' enables false positives in unlikely\n // scenarios. For example, `[\\u{1044f}-\\u{10440}]` is an invalid\n // pattern that would not be detected by this substitution.\n var astralSubstitute = '\\uFFFF',\n tmp = pattern;\n\n if (flags.indexOf('u') >= 0) {\n tmp = tmp\n // Replace every Unicode escape sequence with the equivalent\n // BMP character or a constant ASCII code point in the case of\n // astral symbols. (See the above note on `astralSubstitute`\n // for more information.)\n .replace(/\\\\u\\{([0-9a-fA-F]+)\\}|\\\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {\n var codePoint = parseInt($1 || $2, 16);\n if (codePoint > 0x10FFFF) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n if (codePoint <= 0xFFFF) {\n return String.fromCharCode(codePoint);\n }\n return astralSubstitute;\n })\n // Replace each paired surrogate with a single ASCII symbol to\n // avoid throwing on regular expressions that are only valid in\n // combination with the \"u\" flag.\n .replace(\n /[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]/g,\n astralSubstitute\n );\n }\n\n // First, detect invalid regular expressions.\n try {\n RegExp(tmp);\n } catch (e) {\n throwUnexpectedToken(null, Messages.InvalidRegExp);\n }\n\n // Return a regular expression object for this pattern-flag pair, or\n // `null` in case the current environment doesn't support the flags it\n // uses.\n try {\n return new RegExp(pattern, flags);\n } catch (exception) {\n return null;\n }\n }", "function DefaultRegularExpression() \n{\n\n\t\t this.txt_isdisfact = /^\\d+$/ ;\n\n\t\t this.txt_isnotspace = /^[a-zA-Z][\\w-_.]*$/ ;\n\n\t\t this.txt_limit1_999 = /^0*[0-9]$|^0*[1-9][0-9]$|^0*[1-9][0-9][0-9]$/ ;\n\n\t\t this.txt_numeric = /[0-9][0-9]*/ ;\n\n\t\t this.txt_checkinteger = /[0-9]*/ ;\n\n\t\t this.limit0_100 = /^[0-9]$|^0*[1-9]\\d?$|^0*[1-9]\\d?\\\\.\\d?\\d?$|^0*100\\.0?0?$|^0*100$|^0*\\.\\d?[1-9]$|^0*\\.[1-9]\\d?$/ ;\n\n\t\t this.txt_isdigit = /(^\\d+$)|^$/ ;\n\n\t\t this.txt_location = /^[0-9]+$/ ;\n\n\t\t this.txt_iscustomerpassword = /^[a-zA-Z0-9_]{3,255}$/ ;\n\n\t\t this.txt_iszpercentage = /^0*[0-9]\\d?$|^0*[0-9]\\d?\\.\\d?\\d?$|^0*100\\.0?0?$|^0*100$|^0*\\.\\d?[0-9]$|^0*\\.[0-9]\\d?$/ ;\n\n\t\t this.txt_isnumber4digit = /^\\d{1,10}((\\.\\d{1,4}$)|$)/ ;\n\n\t\t this.txt_ispolicyname = /^[a-zA-Z][a-zA-Z0-9]{2,150}$/ ;\n\n\t\t this.txt_iscontactperson = /^[a-zA-Z0-9][a-zA-Z0-9]{2,100}$/ ;\n\n\t\t this.txt_limit1_30 = /^0*[1-9]$|^0*[1-2][0-9]$|^0*[3][0]$/ ;\n\n\t\t this.txt_ispassword = /^[a-zA-Z0-9_]{3,15}$/ ;\n\n\t\t this.txt_issysparamcurrency = /^\\d{1,10}((\\.\\d{1,2}$)|$)/ ;\n\n\t\t this.txt_daysafterbilldate = /^0*[0-9]$|^0*[1-2][0-8]$|^0*[1][9]$/ ;\n\n\t\t this.txt_alphanumeric = /^[\\w$-]+$/ ;\n\n\t\t this.txt_iscomma = /^( )*(\\w)+(,( )*(\\w)+)*$/ ;\n\n\t\t this.txt_isvalidipaddr = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/ ;\n\n\t\t this.txt_sysint = /^0*\\d+$/ ;\n\n\t\t this.txt_limit1_28 = /^0*[1-9]$|^0*[1-2][0-8]$/ ;\n\n\t\t this.txt_isday = /^0*[1-2]?\\d?\\d?$|^0*3[1-5]\\d?$|^0*36[1-5]$|^0*$/ ;\n\n\t\t this.txt_isfilerequired = /^[a-zA-Z0-9\\.:_\\x20\\-\\\\]+$/ ;\n\n\t\t this.txt_isemailforAlert = /^\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)*@\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)+$/ ;\n\n\t\t this.txt_isName = /^( )*(\\w)+(( )*(\\w)+)*$/ ;\n\n\t\t this.txt_checkname = /^[ a-zA-Z\\d\\\\/_]*$/ ;\n\n\t\t this.txt_stblogin = /^[0-9A-Za-z]+$/ ;\n\n\t\t this.txt_isinterestrate = /^\\d{0,3}(\\.\\d{0,2})?$/ ;\n\n\t\t this.txt_WSCAlpha = /^[a-zA-Z]*$/ ;\n\n\t\t this.txt_isnewusername = /^[a-zA-Z0-9][a-zA-Z0-9_@.-]{2,30}$/ ;\n\n\t\t this.txt_limit3_255 = /^([3-9]|[1-9][0-9]|1*[0-9][0-9]|2*[0-4][0-9]|25*[0-5])$/ ;\n\n\t\t this.txt_numberprefix2 = /^[0-9]+$/ ;\n\n\t\t this.txt_ishour = /^\\d+$/ ;\n\n\t\t this.txt_greaterthan_1 = /(^\\-1$)|(^\\d{1,10}((\\.\\d{1,2}$)|$))/ ;\n\n\t\t this.txt_limit0_99 = /^0*[0-9]$|^0*[1-9]\\d?$/ ;\n\n\t\t this.txt_isAlphanumeric = /[A-Za-z0-9]+/ ;\n\n\t\t this.txt_max20 = /^([^\\\\]{1,20})$/ ;\n\n\t\t this.txt_numberprefix3 = /^[0-7]+$/ ;\n\n\t\t this.txt_name = /^[0-9A-Za-z\\s\\.']+$/ ;\n\n\t\t this.txt_isusername = /^[a-zA-Z0-9_]{3,20}$/ ;\n\n\t\t this.txt_numeric19 = /^[1-9]\\d*$/ ;\n\n\t\t this.txt_ispincode = /[.]*/ ;\n\n\t\t this.txt_isexenum = /^0*[1-9]\\d*$/ ;\n\n\t\t this.txt_isphonenumber = /^[1-9]\\d{2}\\-\\s?\\d{3}\\-\\d{4}$/ ;\n\n\t\t this.txt_digits = /\\d/ ;\n\n\t\t this.txt_checkreason = /^[0-9A-Za-z ]+$/ ;\n\n\t\t this.txt_formaterror = /\\p{Punct}\\p{Punct}[0-9]\\p{Punct}/ ;\n\n\t\t this.txt_alphabetic = /([A-Z]|[a-z])([A-Z]|[a-z])*/ ;\n\n\t\t this.txt_max40 = /^([^\\\\]{1,40})$/ ;\n\n\t\t this.txt_isemail = /^\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)*@\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)+$/ ;\n\n\t\t this.txt_isspace = /^[a-zA-Z][\\w-_./ ][^\\\\]*$/ ;\n\n\t\t this.txt_isnzint = /^0*[1-9]\\d*$/ ;\n\n\t\t this.txt_limit_1_10 = /(^\\-1$)|(^[0-9]$)|(^10$)/ ;\n\n\t\t this.txt_amttrans = /(^\\d{1,10}((\\.\\d{1,2}$)|$))/ ;\n\n\t\t this.txt_exchangehours = /(^\\d+$)|(^\\d+\\.\\d+$)/ ;\n\n\t\t this.txt_limit1_15 = /^[1-9]$|^0*[1][0-5]$/ ;\n\n\t\t this.txt_limit1_10000 = /(^\\d{1,4}$)|(^10000$)/ ;\n\n\t\t this.txt_isnumber = /^\\d{1,10}((\\.\\d{1,4}$)|$)/ ;\n\n\t\t this.txt_allowallmax255 = /^([\\w]|[\\W]){1,255}$/ ;\n\n\t\t this.txt_isHexadecimal = /((0(x|X))?)([0-9A-Fa-f]+)/ ;\n\n\t\t this.txt_isvalidhomephone = /^[0-9][\\d,-]*$/ ;\n\n\t\t this.txt_numberprefix4 = /^[0-9A-Fa-f]+$/ ;\n\n\t\t this.txt_WSCAlphaNum = /^[a-zA-Z0-9]*$/ ;\n\n\t\t this.txt_max30 = /^([^\\\\]{1,30})$/ ;\n\n\t\t this.txt_isfirstalphabet = /^[a-zA-Z0-9][\\w-_./ ][^\\\\]*$/ ;\n\n\t\t this.txt_alphanumerical = /([A-Z]|[a-z]|[0-9])([A-Z]|[a-z]|[0-9])*/ ;\n\n\t\t this.txt_feedbackmsg = /\\w{1,}/ ;\n\n\t\t this.txt_limit1440 = /^(0*[0-9]$)|^(0*[1-9][0-9]$)|^(0*[1-9][0-9][0-9]$)|^(0*[0-1][0-4][0-3][0-9]$)|^0*1440$/ ;\n\n\t\t this.txt_issysparamemail = /^\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)*@\\w+(\\-\\w+)*(\\.\\w+(\\-\\w+)*)+$/ ;\n\n\t\t this.txt_floatamt = /^((\\d*(\\.\\d*)?)|((\\d*\\.)?\\d+))$/ ;\n\n\t\t this.txt_isBinary = /[0-1]+/ ;\n\n\t\t this.txt_isnotdot = /^[a-zA-Z][\\w-_]*$/ ;\n\n\t\t this.txt_nospace = /^\\s+$/ ;\n\n\t\t this.txt_limit1_48 = /^0*[1-9]$|^0*[1-4][0-8]$/ ;\n\n\t\t this.txt_isvalidname = /^[a-zA-Z0-9_. ]+$/ ;\n\n\t\t this.txt_checkval = /^\\d{1,3}((\\.\\d{1,2}$)|$)/ ;\n\n\t\t this.txt_allowallmax100 = /^([\\w]|[\\W]){1,100}$/ ;\n\n\t\t this.txt_entervalue = /^[0-9][0-9,]*[0-9]+$/ ;\n\n\t\t this.txt_ZerotoNineP = /[0-9]+/ ;\n\n\t\t this.txt_matcheid = /.+@.+\\.[a-z]+/ ;\n\n\t\t this.txt_limit1_4 = /^[1-4]$/ ;\n\n\t\t this.txt_isValidGrpName = /^[^\\x27\\x22\\x3e\\x3c]+$/ ;\n\n\t\t this.txt_isnzpercentage = /^0*[1-9]\\d?$|^0*[1-9]\\d?\\.\\d?\\d?$|^0*100\\.0?0?$|^0*100$|^0*\\.\\d?[1-9]$|^0*\\.[1-9]\\d?$/ ;\n\n\t\t this.txt_RTaxRate = /^\\d{0,2}(\\.\\d{0,2})?$/ ;\n\n\t\t this.txt_isconfname = /^[ a-zA-Z\\d_]*$/ ;\n\n\t\t this.txt_ischequeno = /^0*[1-9]\\d*$/ ;\n\n\t\t this.txt_isintrequired = /\\d/ ;\n\n\t\t this.txt_limitpackageexpire = /(^\\-1$)|(^\\d{1,10}$)/ ;\n\n\t\t this.txt_pinprefix = /^([A-Z]{4})$|([A-Z]{4}[,]{1})*([A-Z]{4})$/ ;\n\n\t\t this.txt_numberprefix = /^[0-9A-Za-z]+$/ ;\n\n\t\t this.txt_limit0_20 = /^0*[1-9]$|^0*[0-1][0-9]$|[0-2]0$/ ;\n\n\t\t this.txt_isinteger = /^\\d+$/ ;\n\n\t\t this.txt_path = /(^((\\.$)|(\\.\\.$)|(\\.(\\/|\\\\))|(\\.\\.(\\/|\\\\))|(\\b[a-zA-Z]:(\\/|\\\\))|(\\\\|\\/)))($|([A-Za-z_]\\w*)((((\\/|\\\\)[A-Za-z_]\\w*)*(\\/|\\\\|$))|$))$/ ;\n\n\t\t this.txt_isfloatrequired = /\\f/ ;\n\n\t\t this.txt_checkcurrency = /^\\d{0,10}((\\.\\d{1,4}$)|$)/ ;\n\n\t\t this.txt_limit0_3 = /^[0-3]$/ ;\n\n\t\t this.txt_smtpport = /^(([\\d]{1,4})|([0-5][\\d]{1,4})|(6[0-4][\\d]{1,3})|(65[0-4][\\d]{1,2})|(655[0-2][\\d]{1})|(6553[0-6]))$/ ;\n\n\t\t this.txt_isint = /^\\d+$/ ;\n\n\t\t this.txt_invalidpercent = /^((\\d+(\\.\\d*)?)|((\\d*\\.)?\\d+))$/ ;\n\n\t\t this.txt_isOctect = /[0-7]+/ ;\n\n\t\t this.txt_ispercentage = /^\\d{1,3}((\\.\\d{1,2}$)|$)/ ;\n\n\t\t this.txt_forsearch = /^[a-zA-Z%]*[\\w-_%./ ][^\\\\]*$/ ;\n\n\t\t this.txt_limit1_100000 = /^0*[123456789]{1}\\\\d{0,4}$|100000$/ ;\n\n\t\t this.txt_isminute = /^\\d+$/ ;\n\n\t\t this.txt_isnzcurrencyrate = /^0*[1-9]\\d{0,12}$|^0*[1-9]\\d{0,12}\\.\\d?\\d?|^0*\\.\\d?[1-9]$|^0*\\.[1-9]\\d?$/ ;\n\n\t\t this.txt_limit3_90 = /^0*[3-9]$|^0*[1-8][0-9]$|^0*[9][0]$/ ;\n\n\t\t this.txt_limit_1_12 = /(^\\-1$)|(^[1-9]$|^0*[1][0-2]$)/ ;\n\n\t\t this.txt_username = /^[a-zA-Z0-9\\_\\\\]+$/ ;\n\n\t\t this.txt_limit3_16 = /^0*[3-9]$|^0*[1][0-6]$/ ;\n\n\t\t this.txt_limit1_99999 = /^0*[1-9]$|^0*[1-9][0-9]$|^0*[1-9][0-9][0-9]$|^0*[1-9][0-9][0-9][0-9]$|^0*[1-9][0-9][0-9][0-9][0-9]$/ ;\n\n\t\t this.txt_limit0_9 = /^[1-9]$|^0*[1][0]$/ ;\n\n\t\t this.txt_numberprefix1 = /^[0-1]+$/ ;\n\n\t\t this.txt_WSCPwd = /^[0-9]*$/ ;\n\n\t\t this.txt_isznumber = /^0*[0-9]\\d{0,12}$|^0*[0-9]\\d{0,12}\\.\\d?\\d?|^0*\\.\\d?[0-9]$|^0*\\.[0-9]\\d?$/ ;\n\n\t\t this.txt_pulse = /^([0-9:;])*([0-9:;])$/ ;\n\n\t\t this.txt_limit1_100 = /^0*[1-9]$|^0*[1-9]\\d?$|^0*100$/ ;\n\n\t\t this.txt_validateuser = /(^[a-zA-Z0-9][a-zA-Z.\\p{Punct}/\\@-_0-9]{2,25})+$/ ;\n\n\t\t this.txt_minmaxdefault = /^\\d{1,3}((\\.\\d{1,2}$)|$)/ ;\n\n\t\t this.txt_isposnegint = /(^-?\\d\\d*$)/ ;\n\n\t\t this.txt_isnznumber = /^0*[1-9]\\d{0,12}$|^0*[1-9]\\d{0,12}\\.\\d?\\d?|^0*\\.\\d?[1-9]$|^0*\\.[1-9]\\d?$/ ;\n\n\t\t this.text_ischeckint = /^\\d+$/ ;\n\n\t\t this.txt_limit_1_10000 = /(^\\-1$)|(^\\d{1,4}((\\.\\d{1,2}$)|$))|(^10000(\\.[0]{1,2}$|$))/ ;\n\n\t\t this.txt_isnzday = /^0*[1-2]\\d?\\d?$|^0*[1-9]\\d?$|^0*[1-9]$|^0*3[1-5]\\d?$|^0*36[1-5]$/ ;\n\n\t\t this.txt_isvalidpincode = /^[0-9][0-9]{5}$/ ;\n\n\t\t this.txt_creditcardprefix = /^([^\\\\]{1,40})$/ ;\n\n\t\t this.txt_ZerotoNine = /[0-9]+/ ;\n\n\t\t this.txt_isvalidftpaddr = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)[.](25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/ ;\n\n\t\t this.txt_isvalidfaxnum = /^[0-9][\\d,-]*$/ ;\n\n\t\t this.txt_issysparamnumeric = /^\\d+$/ ;\n\n\t\t this.txt_validateusername = /(^[a-zA-Z0-9][a-zA-Z.\\p{Punct}/\\@-_0-9]{2,25})+$/ ;\n\n\t\t this.txt_mastername = /^[ @_#$a-zA-Z\\d]+$/ ;\n\n\t\t this.txt_limit0_200 = /^0*\\d{0,2}$|^0*1\\d{0,2}$|^0*200$/ ;\n\n\t\t this.txt_greaterthan_equalto_0 = /^\\d{1,10}((\\.\\d{1,2}$)|$)$/ ;\n\n\t\t this.txt_filetypecsv = /^(([a-zA-Z]:)|(\\\\[\\s-_]*\\w+)\\$?)*(\\\\(\\w[\\w\\s-_]*))+\\.(csv|CSV)$/ ;\n\n\t\t this.txt_filetype = /^(([a-zA-Z]:)|(\\\\[\\s-_]*\\w+)\\$?)*(\\\\(\\w[\\w\\s-_]*))+\\.(csv|CSV|txt|TXT|jpg|JPG|gif|GIF|doc|DOC|JPEG|jpeg)$/ ;\n\n\t\t this.txt_limit0_10000 = /(^\\d{1,4}((\\.\\d{1,2}$)|$))|(^10000(\\.[0]{1,2}$|$))/ ;\n\n\t\t this.txt_allowallmax20 = /^([\\w]|[\\W]){1,20}$/ ;\n\n\t\t this.txt_ispinprefix = /^([A-Z0-9]{0,5}[A-Z0-9]{1}[A-Z]{1}[,]{1})*([A-Z0-9]{0,5}[A-Z0-9]{1}[A-Z]{1})$/ ;\n\n\t\t this.txt_limit0_100 = /^0*[0-9]$|^0*[1-9]\\d?$|^0*100$/ ;\n\n\t\t this.txt_checkpinprefix = /^([A-Za-z0-9]{0,5}[A-Za-z0-9]{1}[A-Za-z]{1}[,]{1})*([A-Za-z0-9]{0,5}[A-Za-z0-9]{1}[A-Za-z]{1})$/ ;\n\n\t\t this.txt_limitRNG1_100000 = /^0*[1-9]$|^0*[1-9][0-9]$|^0*[1-9][0-9][0-9]$|^0*[1-9][0-9][0-9][0-9]$|^0*[1-9][0-9][0-9][0-9][0-9]$|^0*100000$/ ;\n\n\t\t this.txt_cpeid = /^[a-fA-F0-9]{1,8}$/ ;\n\n\tthis.getRegEx = getRegEx\n\t\n\tfunction getRegEx()\n\t{\n\t\tvar args = getRegEx.arguments;\n\t\t\n\t\tif(args[0] == 'RDisfact' )\n\t\t{\n\t\t\treturn this.txt_isdisfact;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNotSpace' )\n\t\t{\n\t\t\treturn this.txt_isnotspace;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_999' )\n\t\t{\n\t\t\treturn this.txt_limit1_999;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumeric' )\n\t\t{\n\t\t\treturn this.txt_numeric;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'Rcheckint' )\n\t\t{\n\t\t\treturn this.txt_checkinteger;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimitbtw0_100' )\n\t\t{\n\t\t\treturn this.limit0_100;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckDigit' )\n\t\t{\n\t\t\treturn this.txt_isdigit;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLocation' )\n\t\t{\n\t\t\treturn this.txt_location;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCustomerPassword' )\n\t\t{\n\t\t\treturn this.txt_iscustomerpassword;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'ZPercentage' )\n\t\t{\n\t\t\treturn this.txt_iszpercentage;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCurrency4Precision' )\n\t\t{\n\t\t\treturn this.txt_isnumber4digit;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPolicyName' )\n\t\t{\n\t\t\treturn this.txt_ispolicyname;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RName1' )\n\t\t{\n\t\t\treturn this.txt_iscontactperson;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_30' )\n\t\t{\n\t\t\treturn this.txt_limit1_30;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPassword' )\n\t\t{\n\t\t\treturn this.txt_ispassword;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSysParamCurrency' )\n\t\t{\n\t\t\treturn this.txt_issysparamcurrency;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RDaysOnAfterBillDate' )\n\t\t{\n\t\t\treturn this.txt_daysafterbilldate;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAlphaNumeic' )\n\t\t{\n\t\t\treturn this.txt_alphanumeric;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RComma' )\n\t\t{\n\t\t\treturn this.txt_iscomma;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RIPaddrCheck' )\n\t\t{\n\t\t\treturn this.txt_isvalidipaddr;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSysInt' )\n\t\t{\n\t\t\treturn this.txt_sysint;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_28' )\n\t\t{\n\t\t\treturn this.txt_limit1_28;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RDay' )\n\t\t{\n\t\t\treturn this.txt_isday;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFile' )\n\t\t{\n\t\t\treturn this.txt_isfilerequired;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'REmailforAlert' )\n\t\t{\n\t\t\treturn this.txt_isemailforAlert;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAccountName' )\n\t\t{\n\t\t\treturn this.txt_isName;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckName' )\n\t\t{\n\t\t\treturn this.txt_checkname;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckAlpNum' )\n\t\t{\n\t\t\treturn this.txt_stblogin;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RInterestRate' )\n\t\t{\n\t\t\treturn this.txt_isinterestrate;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'WSCCheckAlpha' )\n\t\t{\n\t\t\treturn this.txt_WSCAlpha;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNewUserName' )\n\t\t{\n\t\t\treturn this.txt_isnewusername;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit3_255' )\n\t\t{\n\t\t\treturn this.txt_limit3_255;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumberPrefix2' )\n\t\t{\n\t\t\treturn this.txt_numberprefix2;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RHour' )\n\t\t{\n\t\t\treturn this.txt_ishour;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RGreaterthan_1' )\n\t\t{\n\t\t\treturn this.txt_greaterthan_1;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_99' )\n\t\t{\n\t\t\treturn this.txt_limit0_99;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAlphanum' )\n\t\t{\n\t\t\treturn this.txt_isAlphanumeric;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RMax20' )\n\t\t{\n\t\t\treturn this.txt_max20;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumberPrefix3' )\n\t\t{\n\t\t\treturn this.txt_numberprefix3;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RName' )\n\t\t{\n\t\t\treturn this.txt_name;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RUser' )\n\t\t{\n\t\t\treturn this.txt_isusername;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'Rnumeric19' )\n\t\t{\n\t\t\treturn this.txt_numeric19;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPincode' )\n\t\t{\n\t\t\treturn this.txt_ispincode;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RExeNum' )\n\t\t{\n\t\t\treturn this.txt_isexenum;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPhone' )\n\t\t{\n\t\t\treturn this.txt_isphonenumber;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RDigits' )\n\t\t{\n\t\t\treturn this.txt_digits;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAlphaNumSpace' )\n\t\t{\n\t\t\treturn this.txt_checkreason;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFormaterror' )\n\t\t{\n\t\t\treturn this.txt_formaterror;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAlphabetic' )\n\t\t{\n\t\t\treturn this.txt_alphabetic;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RMax40' )\n\t\t{\n\t\t\treturn this.txt_max40;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'REmail' )\n\t\t{\n\t\t\treturn this.txt_isemail;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSpace' )\n\t\t{\n\t\t\treturn this.txt_isspace;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNZNum' )\n\t\t{\n\t\t\treturn this.txt_isnzint;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit_1_10' )\n\t\t{\n\t\t\treturn this.txt_limit_1_10;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAmtTransCheck' )\n\t\t{\n\t\t\treturn this.txt_amttrans;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RExchangeHours' )\n\t\t{\n\t\t\treturn this.txt_exchangehours;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_15' )\n\t\t{\n\t\t\treturn this.txt_limit1_15;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_10000' )\n\t\t{\n\t\t\treturn this.txt_limit1_10000;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCurrency' )\n\t\t{\n\t\t\treturn this.txt_isnumber;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAllowAllMax255' )\n\t\t{\n\t\t\treturn this.txt_allowallmax255;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RHexadecimal' )\n\t\t{\n\t\t\treturn this.txt_isHexadecimal;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RHomePhoneCheck' )\n\t\t{\n\t\t\treturn this.txt_isvalidhomephone;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumberPrefix4' )\n\t\t{\n\t\t\treturn this.txt_numberprefix4;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'WSCCheckAlphaNum' )\n\t\t{\n\t\t\treturn this.txt_WSCAlphaNum;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RMax30' )\n\t\t{\n\t\t\treturn this.txt_max30;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFirstAlphabetSpace' )\n\t\t{\n\t\t\treturn this.txt_isfirstalphabet;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAlphanum1' )\n\t\t{\n\t\t\treturn this.txt_alphanumerical;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFeedbackmsg' )\n\t\t{\n\t\t\treturn this.txt_feedbackmsg;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1440' )\n\t\t{\n\t\t\treturn this.txt_limit1440;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSysParamEmail' )\n\t\t{\n\t\t\treturn this.txt_issysparamemail;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFloatAmt' )\n\t\t{\n\t\t\treturn this.txt_floatamt;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RBinary' )\n\t\t{\n\t\t\treturn this.txt_isBinary;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNotDot' )\n\t\t{\n\t\t\treturn this.txt_isnotdot;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNoSpace' )\n\t\t{\n\t\t\treturn this.txt_nospace;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_48' )\n\t\t{\n\t\t\treturn this.txt_limit1_48;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckValidName' )\n\t\t{\n\t\t\treturn this.txt_isvalidname;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCompCheck' )\n\t\t{\n\t\t\treturn this.txt_checkval;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAllowAllMax100' )\n\t\t{\n\t\t\treturn this.txt_allowallmax100;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'REnterValue' )\n\t\t{\n\t\t\treturn this.txt_entervalue;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RZerotoNineP' )\n\t\t{\n\t\t\treturn this.txt_ZerotoNineP;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RMatchEid' )\n\t\t{\n\t\t\treturn this.txt_matcheid;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_4' )\n\t\t{\n\t\t\treturn this.txt_limit1_4;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RValidGrpName' )\n\t\t{\n\t\t\treturn this.txt_isValidGrpName;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNZPercentage' )\n\t\t{\n\t\t\treturn this.txt_isnzpercentage;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RTaxRate' )\n\t\t{\n\t\t\treturn this.txt_RTaxRate;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckConfName' )\n\t\t{\n\t\t\treturn this.txt_isconfname;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RChequeNo' )\n\t\t{\n\t\t\treturn this.txt_ischequeno;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RINTCHECK' )\n\t\t{\n\t\t\treturn this.txt_isintrequired;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimitPackageExpire' )\n\t\t{\n\t\t\treturn this.txt_limitpackageexpire;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPinPrefix' )\n\t\t{\n\t\t\treturn this.txt_pinprefix;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumberPrefix' )\n\t\t{\n\t\t\treturn this.txt_numberprefix;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_20' )\n\t\t{\n\t\t\treturn this.txt_limit0_20;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RInteger' )\n\t\t{\n\t\t\treturn this.txt_isinteger;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPath' )\n\t\t{\n\t\t\treturn this.txt_path;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFLOATCHECK' )\n\t\t{\n\t\t\treturn this.txt_isfloatrequired;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCurrencyRate' )\n\t\t{\n\t\t\treturn this.txt_checkcurrency;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_3' )\n\t\t{\n\t\t\treturn this.txt_limit0_3;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSmtpPort' )\n\t\t{\n\t\t\treturn this.txt_smtpport;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNum' )\n\t\t{\n\t\t\treturn this.txt_isint;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFLOAT' )\n\t\t{\n\t\t\treturn this.txt_invalidpercent;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'ROctect' )\n\t\t{\n\t\t\treturn this.txt_isOctect;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPercentage' )\n\t\t{\n\t\t\treturn this.txt_ispercentage;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSearch' )\n\t\t{\n\t\t\treturn this.txt_forsearch;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_100000' )\n\t\t{\n\t\t\treturn this.txt_limit1_100000;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RMinute' )\n\t\t{\n\t\t\treturn this.txt_isminute;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNZCurrency' )\n\t\t{\n\t\t\treturn this.txt_isnzcurrencyrate;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit3_90' )\n\t\t{\n\t\t\treturn this.txt_limit3_90;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_12' )\n\t\t{\n\t\t\treturn this.txt_limit_1_12;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RUserName' )\n\t\t{\n\t\t\treturn this.txt_username;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit3_16' )\n\t\t{\n\t\t\treturn this.txt_limit3_16;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_99999' )\n\t\t{\n\t\t\treturn this.txt_limit1_99999;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_9' )\n\t\t{\n\t\t\treturn this.txt_limit0_9;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNumberPrefix1' )\n\t\t{\n\t\t\treturn this.txt_numberprefix1;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'WSCCheckPwd' )\n\t\t{\n\t\t\treturn this.txt_WSCPwd;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RZCurrency' )\n\t\t{\n\t\t\treturn this.txt_isznumber;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPULSE' )\n\t\t{\n\t\t\treturn this.txt_pulse;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit1_100' )\n\t\t{\n\t\t\treturn this.txt_limit1_100;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RValidUser' )\n\t\t{\n\t\t\treturn this.txt_validateuser;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'Rminmaxdefault' )\n\t\t{\n\t\t\treturn this.txt_minmaxdefault;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPosNegNum' )\n\t\t{\n\t\t\treturn this.txt_isposnegint;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNZCurrency' )\n\t\t{\n\t\t\treturn this.txt_isnznumber;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCheckNumeric' )\n\t\t{\n\t\t\treturn this.text_ischeckint;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit_1_10000' )\n\t\t{\n\t\t\treturn this.txt_limit_1_10000;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RNZDay' )\n\t\t{\n\t\t\treturn this.txt_isnzday;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPinCodeCheck' )\n\t\t{\n\t\t\treturn this.txt_isvalidpincode;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCCPrefix' )\n\t\t{\n\t\t\treturn this.txt_creditcardprefix;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RZerotoNine' )\n\t\t{\n\t\t\treturn this.txt_ZerotoNine;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RIPaddrCheck' )\n\t\t{\n\t\t\treturn this.txt_isvalidftpaddr;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFaxPhoneCheck' )\n\t\t{\n\t\t\treturn this.txt_isvalidfaxnum;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RSysParamNum' )\n\t\t{\n\t\t\treturn this.txt_issysparamnumeric;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RValidUsernm' )\n\t\t{\n\t\t\treturn this.txt_validateusername;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RConfName' )\n\t\t{\n\t\t\treturn this.txt_mastername;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_200' )\n\t\t{\n\t\t\treturn this.txt_limit0_200;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RGreaterthan_equalto_0' )\n\t\t{\n\t\t\treturn this.txt_greaterthan_equalto_0;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFileTypeCSV' )\n\t\t{\n\t\t\treturn this.txt_filetypecsv;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RFileType' )\n\t\t{\n\t\t\treturn this.txt_filetype;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_10000' )\n\t\t{\n\t\t\treturn this.txt_limit0_10000;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RAllowAllMax20' )\n\t\t{\n\t\t\treturn this.txt_allowallmax20;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPinPrefixCheck' )\n\t\t{\n\t\t\treturn this.txt_ispinprefix;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimit0_100' )\n\t\t{\n\t\t\treturn this.txt_limit0_100;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RPINPrefix1' )\n\t\t{\n\t\t\treturn this.txt_checkpinprefix;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RLimitRNG1_100000' )\n\t\t{\n\t\t\treturn this.txt_limitRNG1_100000;\n\t\t}\t\n\t\t\n\t\tif(args[0] == 'RCpeIdRe' )\n\t\t{\n\t\t\treturn this.txt_cpeid;\n\t\t}\t\n\t\t\n\t}\n}", "function regexVar() {\n\n let re = /^(Mr\\.|Mrs\\.|Ms\\.|Dr\\.|Er\\.)\\s?[a-z|A-Z]+$/;\n \n \n return re;\n}", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n\n const re = new RegExp(/^([aeiou]).+\\1$/);\n /*\n * Do not remove the return statement\n */\n console.log(re.test('aeioua'));\n return re;\n}", "function matchAll(str, rgx, opt_fnMapper) {\r\n var arr, extras, matches = [];\r\n str.replace(rgx = rgx.global ? rgx : new RegExp(rgx.source, (rgx + '').replace(/[\\s\\S]+\\//g , 'g')), function() {\r\n arr = slice(arguments);\r\n extras = arr.splice(-2);\r\n arr.index = extras[0];\r\n arr.input = extras[1];\r\n arr.source = rgx;\r\n matches.push(opt_fnMapper ? opt_fnMapper.apply(arr, arr) : arr);\r\n });\r\n return arr ? matches : null;\r\n }", "function regexVar(str) {\n\n\tlet re = new RegExp(/^([aeiou]).\\+1$/);\n\treturn re;\n\n}", "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n}", "function fromRegex (r) {\n return function (o) { return typeof o === 'string' && r.test(o) }\n}", "function checkRegex(userInput, regex){\n if(regex.test(userInput)){\n return true;\n } \n else{\n return false;\n }\n}", "function regexVar() {\n /*\n * Declare a RegExp object variable named 're'\n * It must match a string that starts and ends with the same vowel (i.e., {a, e, i, o, u})\n */\n\n let re = /^(a|e|i|o|u).*\\1$/;\n //or\n let re = /^(aeiou).*\\1$/;\n //^ makes sure first var is a vowel\n //.* makes it so it will require at least 3 vars\n //\\1 matches the first var (must end in same vowel, $ to end)\n \n \n /*\n * Do not remove the return statement\n */\n return re;\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n var keys = [];\n var re = pathToRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function match(str, options) {\n const keys = [];\n const re = toRegexp(str, keys, options);\n return regexpToFunction(re, keys, options);\n}", "function FUNC_NAME(rx, S, lengthS, replaceValue\n#ifdef SUBSTITUTION\n , firstDollarIndex\n#endif\n )\n{\n // 21.2.5.2.2 RegExpBuiltinExec, step 4.\n var lastIndex = ToLength(rx.lastIndex);\n\n // 21.2.5.2.2 RegExpBuiltinExec, step 5.\n // Side-effects in step 4 can recompile the RegExp, so we need to read the\n // flags again and handle the case when global was enabled even though this\n // function is optimized for non-global RegExps.\n var flags = UnsafeGetInt32FromReservedSlot(rx, REGEXP_FLAGS_SLOT);\n\n // 21.2.5.2.2 RegExpBuiltinExec, steps 6-7.\n var globalOrSticky = !!(flags & (REGEXP_GLOBAL_FLAG | REGEXP_STICKY_FLAG));\n\n if (globalOrSticky) {\n // 21.2.5.2.2 RegExpBuiltinExec, step 12.a.\n if (lastIndex > lengthS) {\n if (globalOrSticky)\n rx.lastIndex = 0;\n\n // Steps 12-16.\n return S;\n }\n } else {\n // 21.2.5.2.2 RegExpBuiltinExec, step 8.\n lastIndex = 0;\n }\n\n#if !defined(SHORT_STRING)\n // Step 11.a.\n var result = RegExpMatcher(rx, S, lastIndex);\n\n // Step 11.b.\n if (result === null) {\n // 21.2.5.2.2 RegExpBuiltinExec, steps 12.a.i, 12.c.i.\n if (globalOrSticky)\n rx.lastIndex = 0;\n\n // Steps 12-16.\n return S;\n }\n#else\n // Step 11.a.\n var result = RegExpSearcher(rx, S, lastIndex);\n\n // Step 11.b.\n if (result === -1) {\n // 21.2.5.2.2 RegExpBuiltinExec, steps 12.a.i, 12.c.i.\n if (globalOrSticky)\n rx.lastIndex = 0;\n\n // Steps 12-16.\n return S;\n }\n#endif\n\n // Steps 11.c, 12-13.\n\n#if !defined(SHORT_STRING)\n // Steps 14.a-b.\n assert(result.length >= 1, \"RegExpMatcher doesn't return an empty array\");\n\n // Step 14.c.\n var matched = result[0];\n\n // Step 14.d.\n var matchLength = matched.length;\n\n // Step 14.e-f.\n var position = result.index;\n\n // Step 14.l.iii (reordered)\n // To set rx.lastIndex before RegExpGetFunctionalReplacement.\n var nextSourcePosition = position + matchLength;\n#else\n // Steps 14.a-d (skipped).\n\n // Step 14.e-f.\n var position = result & 0x7fff;\n\n // Step 14.l.iii (reordered)\n var nextSourcePosition = (result >> 15) & 0x7fff;\n#endif\n\n // 21.2.5.2.2 RegExpBuiltinExec, step 15.\n if (globalOrSticky)\n rx.lastIndex = nextSourcePosition;\n\n var replacement;\n // Steps g-j.\n#if defined(FUNCTIONAL)\n replacement = RegExpGetFunctionalReplacement(result, S, position, replaceValue);\n#elif defined(SUBSTITUTION)\n replacement = RegExpGetSubstitution(result, S, position, replaceValue, firstDollarIndex);\n#else\n replacement = replaceValue;\n#endif\n\n // Step 14.l.ii.\n var accumulatedResult = Substring(S, 0, position) + replacement;\n\n // Step 15.\n if (nextSourcePosition >= lengthS)\n return accumulatedResult;\n\n // Step 16.\n return accumulatedResult + Substring(S, nextSourcePosition, lengthS - nextSourcePosition);\n}", "function checkRegex() {\n var text = input.val();\n return text.match(settings.regex);\n }", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "function patternMatcher(pattern, string) {\n // Write your code here.\n}", "function makeMatcher(makeRegexpFn = pathToRegexp) {\n let cache = {};\n\n // obtains a cached regexp version of the pattern\n const getRegexp = pattern =>\n (cache[pattern]) || (cache[pattern] = makeRegexpFn(pattern));\n\n return (pattern, path) => {\n const { regexp, keys } = getRegexp(pattern || \"\");\n const out = regexp.exec(path);\n\n if (!out) return [false, null];\n\n // formats an object with matched params\n const params = keys.reduce((params, key, i) => {\n params[key.name] = out[i + 1];\n return params;\n }, {});\n\n return [true, params];\n };\n}", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "function quoteRegExp(str, opt_flagsOrMakeRegExp) {\r\n var ret = str.replace(/[[\\](){}.+*^$|\\\\?-]/g, '\\\\$&');\r\n return opt_flagsOrMakeRegExp === '' || opt_flagsOrMakeRegExp\r\n ? new RegExp(ret, opt_flagsOrMakeRegExp == true ? '' : opt_flagsOrMakeRegExp)\r\n : ret;\r\n }", "function joinTypes() {\r\n if( arguments.length < 3 ) {\r\n throw \"Minimum 3 arguments: boolean, id, id\";\r\n }\r\n\r\n var isFullRegex = arguments[0];\r\n var src = $.fn.restrictedTextField.types;\r\n var regex = new RegExp( isFullRegex ? src[arguments[1]].fullRegex : src[arguments[1]].partialRegex );\r\n\r\n for( var i = 2; i < arguments.length; i++ ) {\r\n regex = joinRegex( regex, (isFullRegex ? src[arguments[i]].fullRegex : src[arguments[i]].partialRegex) );\r\n }\r\n\r\n return regex;\r\n }", "function ___R$project$rome$$internal$js$parser$utils$regex_ts$validateRegexFlags(\n\t\tflags,\n\t\tonUnexpected,\n\t) {\n\t\tconst foundFlags = new Set();\n\t\tfor (let i = 0; i < flags.length; i++) {\n\t\t\tconst flag = flags[i];\n\n\t\t\tif (\n\t\t\t\t___R$$priv$project$rome$$internal$js$parser$utils$regex_ts$VALID_REGEX_FLAGS.includes(\n\t\t\t\t\tflag,\n\t\t\t\t)\n\t\t\t) {\n\t\t\t\tif (foundFlags.has(flag)) {\n\t\t\t\t\tonUnexpected(\n\t\t\t\t\t\t___R$project$rome$$internal$diagnostics$descriptions$index_ts$descriptions.REGEX_PARSER.DUPLICATE_FLAG,\n\t\t\t\t\t\ti,\n\t\t\t\t\t);\n\t\t\t\t} else {\n\t\t\t\t\tfoundFlags.add(flag);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tonUnexpected(\n\t\t\t\t\t___R$project$rome$$internal$diagnostics$descriptions$index_ts$descriptions.REGEX_PARSER.INVALID_FLAG,\n\t\t\t\t\ti,\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn foundFlags;\n\t}", "function createRegexPattern(text) {\n let finalRex = \"\";\n text.split(\",\").forEach(word => {\n word = word.trim();\n let searchRegex = word;\n if (word !== \"\" && word !== \" \") {\n searchRegex = searchRegex.replace(\".\", \"\\\\.\");\n searchRegex = searchRegex.replace(\"*\", \"\\\\w*(.+)?\");\n if (!word.startsWith(\"*\")) {\n searchRegex = \"^\" + searchRegex;\n }\n if (!word.endsWith(\"*\")) {\n searchRegex += \"$\";\n }\n if (!finalRex.includes(searchRegex)) {\n finalRex += searchRegex + \"|\";\n }\n }\n });\n finalRex = finalRex.substring(0, finalRex.length - 1);\n const regex = new RegExp(finalRex, \"gi\");\n return regex;\n}", "function allRE(RE) {\n return re(RE.flags)`^${RE}$`;\n }", "isAllowedStuff(stuff) {\n\n let preRegex = new RegExp('(.*)\\_')\n\n if (preRegex.exec(stuff)) { //0.19 Change everyhing to Filth_xxx\n if (preRegex.exec(stuff)[1] == \"Filth\" || preRegex.exec(stuff)[1] == \"Blueprint\")\n return false;\n }\n\n switch (stuff) {\n case \"Filth\":\n case \"Trash\":\n case \"AnimalFilth\":\n case \"Vomit\":\n case \"Blood\":\n case \"Slime\":\n case \"CorpseBile\":\n case \"RubbleBuilding\":\n case \"FilthDirt\":\n case \"FilthBlood\":\n case \"FilthAnimalFilth\":\n case \"FilthAsh\":\n case \"FilthCorpseBile\":\n case \"FilthVomit\":\n case \"FilthAmnioticFluid\":\n case \"FilthSlime\":\n case \"FilthBloodInsect\":\n case \"FilthFireFoam\":\n case \"FilthSand\":\n case \"Blight\":\n case \"PowerConduit\":\n case \"PowerConduitInvisible\": //COMMON MOD\n case \"sewagePipeStuff\": //MOD\n case \"SandbagRubble\":\n case \"Corpse_Leather\":\n case \"Centipede_Corpse\":\n case \"Scyther_Corpse\":\n case \"Corpse\":\n case \"Frame\":\n case \"Letter\":\n case \"Short\":\n case \"Blueprint\":\n case \"Blueprint_Install\":\n case \"Install\":\n case \"RectTrigger\":\n case \"RockRubble\":\n case \"RubbleRock\":\n case \"BuildingRubble\":\n case \"SlagRubble\":\n case \"Centipede\":\n case \"Scyther\":\n case \"Lancer\":\n case \"ActiveDropPod\":\n case \"Fire\":\n case \"Spark\":\n return false;\n break;\n case \"Human\":\n return false;\n break;\n default:\n return true\n }\n }", "function operators(){\n return /\\d/g;\n }", "toRegexp(arg) {\n switch (this.toType(arg)) {\n case \"regexp\":\n return arg;\n case \"string\":\n return new RegExp(arg);\n default:\n return \"any\";\n }\n }", "function getReg(method,str) {\n \n str = str || '';\n str = str.toString();\n\n var expressions = {\n 'startsWithRange' : '^[' + str + ']',\n 'startsWithChar' : '^' + str[0],\n 'startsWithWord' : '^' + str + '\\\\s',\n 'startsWithSpecialChar' : '^[' + str[0] + ']',\n 'endsWithRange' : '[' + str + ']$',\n 'endsWithChar' : str[0] + '$',\n 'endsWithWord' : '\\\\s' + str + '$',\n 'endsWithSpecialChar' : '[' + str[0] + ']$',\n 'containsRange' : '[' + str + ']',\n 'containsChar' : str[0],\n 'containsWord' : str,\n 'containsSpecialChar' : '[' + str[0] + ']',\n 'default' : '^' + str\n },\n exp;\n\n exp = expressions[method] || expressions['default'];\n return new RegExp(exp);\n\n}", "isRegExp() {\n return this.#patternList[this.#index] instanceof RegExp;\n }", "function evalRegex(field, value) {\n let regex = new RegExp(regexList[field]);\n return regex.test(value);\n}", "function controlFoodCodeFormat(str){\n var patternFoodCode = new RegExp(\"f[0-9]{3}$\");\n if(!patternFoodCode.test(str)){\n console.log(\"Il codice del cibo deve iniziare con 'f' e contenere 3 numeri\");\n abilitaButton();\n return false;\n }\n return true;\n}", "_anyMatch(string, regexps) {\n return regexps.reduce(\n (result, regexp) => {\n if (result) {\n return result;\n }\n return !!string.match(regexp);\n },\n false);\n }", "function toRegExp(val, def) {\n var exp = /^\\/.+\\/(g|i|m)?([m,i,u,y]{1,4})?/;\n var optsExp = /(g|i|m)?([m,i,u,y]{1,4})?$/;\n if (is_1.isRegExp(val))\n return val;\n if (!is_1.isValue(val) || !is_1.isString(val))\n return toDefault(null, def);\n function regExpFromStr() {\n var opts;\n if (exp.test(val)) {\n opts = optsExp.exec(val)[0];\n val = val.replace(/^\\//, '').replace(optsExp, '').replace(/\\/$/, '');\n }\n return new RegExp(val, opts);\n }\n return function_1.tryWrap(regExpFromStr)(def);\n}", "function buildRegEx(reMatchStrings) {\n return new RegExp(\n reMatchStrings\n .reduce(\n (re, fileType, i) => `${re}${i === 0 ? '' : '|' }(${fileType})`, ''\n )\n + ('$')\n );\n}", "function areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}", "function areSimilarRegExps(a, b) {\n return regexFlagsSupported ? a.source === b.source && a.flags === b.flags : RegExp.prototype.toString.call(a) === RegExp.prototype.toString.call(b);\n}", "isRegexp(arg) {\n return this.isType(arg, \"regexp\");\n }", "function isRegExpMatch(rgx, opt_str, opt_onlyCheckStart) {\r\n rgx = RegExp(rgx.source + '|([\\\\S\\\\s])', (rgx + '').replace(/[\\s\\S]+\\/|g/g, '') + 'g');\r\n function f(str, opt_checkStartOnly) {\r\n rgx.lastIndex = undefined;\r\n opt_checkStartOnly = 1 in arguments ? opt_checkStartOnly : opt_onlyCheckStart;\r\n var isMatch = false, match, keepGoing = 1;\r\n while ((match = rgx.exec(str)) && keepGoing) {\r\n isMatch = slice(match, -1)[0] == undefined;\r\n keepGoing = isMatch && !opt_checkStartOnly;\r\n }\r\n return isMatch;\r\n }\r\n return opt_str == undefined ? f : f(opt_str, opt_onlyCheckStart);\r\n }", "function matcher(regexp){\n return function(value){return regexp.test(value);};\n}", "function makeRegExp(str) {\r\n str = str.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&');\r\n return RegExp('^'+str+'$|^'+ str +'([ !?,\\.\\'\"])|([ !?,\\.\\'\"])'+ str +'([ !?,\\.\\'\"])|([ !?,\\.\\'\"])'+ str +'$', 'gm');\r\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function regexp(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if(Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* isEmptyValue */])(value)&&!rule.required){return callback();}__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].required(rule,value,source,errors,options);if(!Object(__WEBPACK_IMPORTED_MODULE_1__util__[\"e\"/* isEmptyValue */])(value)){__WEBPACK_IMPORTED_MODULE_0__rule___[\"a\"/* default */].type(rule,value,source,errors,options);}}callback(errors);}", "function generateTargetRegex(target) {\n const flagsre = /^(-[img]+\\s+)/i\n var m = target.match(flagsre);\n var flags = \"\";\n if (m) {\n flags = m[0].slice(1,-1);\n target = target.replace(flagsre, \"\");\n }\n return new RegExp(target, flags);\n}", "function flags(options) {\n return options && options.sensitive ? \"\" : \"i\";\n}", "function matches(regex) {\n var res = function (val) {\n regex.lastIndex = 0;\n return (0, isString_1.default)(val) && regex.test(val);\n };\n res.assert = (0, assert_1.default)(res);\n res.schema = 'matches(' + regex + ')';\n return res;\n}", "function getTokenizedExp(token, flag){\n var p = token + \"$\" + flag;\n return Exps[p] || (Exps[p] = RegExp(\"(?:^|\\\\s)\"+token+\"(?:$|\\\\s)\", flag));\n }", "function regexp(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(!(0,_util.isEmptyValue)(value)){_rule2[\"default\"].type(rule,value,source,errors,options);}}callback(errors);}", "function regexp(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(!(0,_util.isEmptyValue)(value)){_rule2[\"default\"].type(rule,value,source,errors,options);}}callback(errors);}", "function regexp(rule,value,callback,source,options){var errors=[];var validate=rule.required||!rule.required&&source.hasOwnProperty(rule.field);if(validate){if((0,_util.isEmptyValue)(value)&&!rule.required){return callback();}_rule2[\"default\"].required(rule,value,source,errors,options);if(!(0,_util.isEmptyValue)(value)){_rule2[\"default\"].type(rule,value,source,errors,options);}}callback(errors);}", "function containsCharacters(field, code) {\n let regEx;\n switch(code) {\n case 1 :\n // letters\n regEx = /(?=.*[a-zA-Z])/;\n return matchWithRegEx(regEx, field, 'Must contain at least one letter');\n case 2 :\n // letters and numbers\n regEx = /(?=.*\\d)(?=.*[a-zA-Z])/;\n return matchWithRegEx(regEx, field, 'Must contain one letter & one number');\n case 3 :\n // uppcase, lowercase and number\n regEx = /(?=.*\\d)(?=.*[a-z])(?=.*[A-Z])/;\n return matchWithRegEx(regEx, field, 'Must contain one uppercase letter, one lowercase & one number');\n case 4 :\n // uppercase, lowercase, number and special char\n regEx = /(?=.*\\d)(?=.*[a-z])(?=.[A-Z])(?=.*\\W)/;\n return matchWithRegEx(regEx, field, 'Must contain at least one uppercase letter, one lowercase, one number and one special character');\n case 5 :\n regEx = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return matchWithRegEx(regEx, field, 'Must contain a valid email address');\n default :\n // default return\n return false;\n }\n}", "regexSelector(pattern) {\n this.registerRegexInput(pattern);\n }", "function match(regex, userAgent) {\n\t return regex.test(userAgent);\n\t }", "function testModifierG(){\n var str = \"Visit Visit Visit !\";\n var pattern = /visit/ig;\n var res = str.match(pattern);\n console.log(res);\n \n}", "function is(node, flag) {\n\t return t.isLiteral(node) && node.regex && node.regex.flags.indexOf(flag) >= 0;\n\t}", "function is(node, flag) {\n\t return t.isLiteral(node) && node.regex && node.regex.flags.indexOf(flag) >= 0;\n\t}" ]
[ "0.6451156", "0.6443066", "0.63861513", "0.6315296", "0.62972987", "0.61596215", "0.60786945", "0.60277104", "0.5983477", "0.5976712", "0.5868753", "0.5815714", "0.58036554", "0.5798222", "0.5787266", "0.5777028", "0.5745256", "0.5745256", "0.57423306", "0.57413614", "0.5737804", "0.5694322", "0.56519794", "0.5650402", "0.5619846", "0.5598352", "0.55753106", "0.55753106", "0.5570998", "0.5567471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5531471", "0.5525125", "0.5503028", "0.5502818", "0.55017185", "0.54507715", "0.54507715", "0.54399395", "0.5439626", "0.5414409", "0.5409717", "0.5407371", "0.540384", "0.5364091", "0.53589094", "0.53567827", "0.5304312", "0.5295981", "0.5276949", "0.5254835", "0.52403015", "0.5233686", "0.5214916", "0.5202297", "0.5193682", "0.5190598", "0.5190598", "0.5177237", "0.5175887", "0.51624745", "0.516145", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51540136", "0.51508653", "0.5131572", "0.51298416", "0.51286066", "0.5128109", "0.51258063", "0.51258063", "0.51258063", "0.51220804", "0.51217914", "0.5106661", "0.51060987", "0.51035994", "0.51035994" ]
0.54602486
47
Update save model inputs
function updateSaveModal() { regexInput_modal.value = regexInput.value; templateInput_modal.value = templateInput.value; globalCheckbox_modal.checked = globalCheckbox.checked; caseInsensitiveCheckbox_modal.checked = caseInsensitiveCheckbox.checked; multilineCheckbox_modal.checked = multilineCheckbox.checked; IgnoreHTMLCheckbox_modal.checked = IgnoreHTMLCheckbox.checked; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "save() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "saveAndClose() {\n this._mutateModel();\n\n this._super(...arguments);\n }", "function save(model) {\n // who knows what this does\n }", "async doUpdate () {\n\t\tif (Object.keys(this.changes).length === 0) {\n\t\t\t// nothing to save\n\t\t\treturn;\n\t\t}\n\t\t// do the update\n\t\tconst op = { $set: this.changes };\n\t\tthis.updateOp = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.collection,\n\t\t\tid: this.existingModel.id\n\t\t}).save(op);\n\t\tObject.assign(this.existingModel.attributes, this.changes);\n}", "function save() {\n\t\tdocument.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n\t\tmyDiagram.isModified = false;\n\t}", "function save() {\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n }", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "onSaveUpdates() {\n\t\t\t\n\t\t\t// Some kind of bug here due to multiple components, this might be the best way around it\n\t\t\tif (!this._oODataModel.oMetadata) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tthis._setBusy(true);\n\n\t\t\t// Submit changes*/\n\t\t\tthis._oODataModel.submitChanges({\n\t\t\t\tsuccess: (oData) => {\n\t\t\t\t\tthis._setBusy(false);\n\t\t\t\t\tthis._handleBatchResponseAndReturnErrorFlag(oData);\n\t\t\t\t\tthis._resetODataModel();\n\t\t\t\t},\n\t\t\t\terror: this._handleSimpleODataError.bind(this)\n\t\t\t});\n\n\t\t}", "function save() {\r\n\t\tvar str = myDiagram.model.toJson();\r\n\t\tdocument.getElementById(\"mySavedModel\").value = str;\r\n\t }", "async update () {\n\t\tif (this.dontSaveIfExists) {\n\t\t\t// or don't bother if the derived class says so\n\t\t\tthis.model = this.existingModel;\n\t\t\treturn;\n\t\t}\n\t\tawait this.determineChanges();\n\t\tawait this.doUpdate();\n\t}", "function valuesUpdate() {\n var savedInputs = JSON.parse(localStorage.getItem(\"savedInputs\")) || [\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", ];\n for (let i = 0; i < input.length; i++) {\n const element = input[i];\n element.value = savedInputs[i];\n }\n\n}", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "updateToStore() {\r\n if (this.props.formSetValue)\r\n this.props.formSetValue(this.props.inputProps.name, this.fieldStatus.value, this.fieldStatus.valid, this.fieldStatus.dirty, this.fieldStatus.visited);\r\n }", "function updateModel() {\n scope.$apply(function () {\n \tngModel.$setViewValue(ck.getData());\n \t});\n \t}", "updateInputs() {\n for (let [key, value] of Object.entries(this.settings)) {\n if (typeof value !== 'object')\n $(`[name=${key}]`)\n .val(this.settings[key])\n else {\n const elm = $(`.key-input[data-setting=${key}]`)\n elm.toggleClass('focused', this.editingBind === key)\n elm.find('.label')\n .html(formatAction(value))\n }\n }\n localStorage['settings'] = JSON.stringify(this.settings)\n this.updateTimeSlider()\n }", "function save() {\n vm.parametersList.saveToStorage();\n init();\n }", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "function updateInputs() {\r\n Inputang.setAttribute('value', Inputang.value);\r\n Inputvel.setAttribute('value', Inputvel.value);\r\n }", "save() {\n this._requireSave = true;\n }", "function save() {\r\n document.getElementById('mySavedModel').value = myDiagram.model.toJson();\r\n myDiagram.isModified = false;\r\n}", "save() {}", "function save() {\n str = myDiagram.model.toJson();\n document.getElementById(\"mySavedModel\").value = str;\n }", "handlePendingInput(input) {\n this.save(input);\n }", "handlePendingInput(input) {\n this.save(input);\n }", "function handleUpdateModelData(dataObj) {\n //console.log('handleUpdateModelData', dataObj.payload);\n }", "save() {\n this.tf.push(lastElement(this.tf).clone());\n this.context.save();\n }", "save(){\n //\n }", "save(model) {\n return model.save();\n }", "_mutateModel() {\n let model = this.get('model');\n let layerProperties = this.get('getLayerProperties')();\n\n for (let attr of Object.keys(layerProperties)) {\n model.set(attr, layerProperties[attr]);\n }\n }", "update() {\n\t this.value = this.originalInputValue;\n\t }", "onClickSave() {\n SettingsHelper.setSettings(this.projectId, null, 'info', this.model)\n .then(() => {\n this.modal.hide();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "saveUpdatedSettings(event) {\n let inputElement = event.target;\n if (inputElement.getAttribute(\"type\") === \"number\") {\n if (inputElement.value.match(/[0-9]+/)) {\n inputElement.removeAttribute(\"invalidInput\");\n }\n else {\n inputElement.setAttribute(\"invalidInput\", \"true\");\n return;\n }\n }\n if (inputElement.getAttribute(\"type\") === \"checkbox\") {\n RoKA.Preferences.set(inputElement.id, inputElement.checked);\n }\n else {\n RoKA.Preferences.set(inputElement.id, inputElement.value);\n }\n }", "save() {\n }", "function updateModel() {\n if (_model && ctrlScope && _model.assign) {\n /* update the model value in the controller if the controller scope is available */\n _model.assign(ctrlScope, iScope._model_);\n }\n }", "async postSave () {\n\t}", "function editSave() {\n if (document.getElementById('edit_input').value == \"\") {\n DOM.Modal.Close('edit_modal');\n State.Reset();\n return;\n }\n // check whether we're editing or adding\n if (State.Adding.Get()) {\n // the temporary array is necessary, otherwise the array can't be read/written properly\n var tempTracks = [];\n var desiredLocation;\n // determine the array index where the track should be stored\n if (State.Adding.Above.Get()) {desiredLocation = State.Editing.Get()-1}\n if (State.Adding.Below.Get()) {desiredLocation = State.Editing.Get()}\n // if neither add above or add below is specified, it will simply be appended\n if(!State.Adding.Above.Get() && !State.Adding.Below.Get()) {desiredLocation = Data.Tracks.length}\n // iterate through the tracks array\n // shift all entries after the desired location down by one\n for (let i = 0; i < Data.Tracks.length; i++) {\n if (i >= desiredLocation) {\n tempTracks[i+1] = Data.Tracks[i];\n }\n // keep all entries before the desired location\n else {tempTracks[i] = Data.Tracks[i];}\n }\n // assign the added track to the \"now free\" index\n tempTracks[desiredLocation] = document.getElementById('edit_input').value;\n // apply the temporary array\n Data.Tracks = tempTracks;\n }\n // apply the edited value to the original value in the array\n else {\n Data.Tracks[State.Editing.Get()-1] = document.getElementById('edit_input').value;\n }\n // close the modal and reset all the flags\n DOM.Modal.Close('edit_modal');\n State.Reset();\n // refresh the UI\n DOM.UI.Update();\n}", "save () { if (this.name) saveValue(this.name, this.items); }", "function inputReady() {\n scores.add( new invaders.model.Score(newScore, scoreInput.input));\n that.models.remove(scoreInput);\n scoreInput = false;\n //scrores.putScores(); // save to server\n }", "function actuallySave() {\n var inputs = document.getElementsByTagName('input');\n var data = {\n details: details\n };\n var isDefault = true;\n for(var i = 0; i < inputs.length; ++i) {\n if(inputs[i].type == 'checkbox') {\n data[inputs[i].id] = inputs[i].checked;\n if(isDefault && inputs[i].checked != (DEFAULT_FALSE.indexOf(inputs[i].id) === -1)) {\n isDefault = false;\n }\n }\n else {\n data[inputs[i].id] = inputs[i].value;\n if(isDefault && inputs[i].value) {\n isDefault = false;\n }\n }\n }\n twitch.configuration.set('broadcaster', CONFIG_VERSION, JSON.stringify(data));\n document.getElementById(\"reset\").disabled = isDefault;\n if(saveCallTimeout) {\n clearTimeout(saveCallTimeout);\n }\n saveCallTimeout = undefined;\n hideUnsaved();\n }", "livelyPrepareSave() {\n // this.setAttribute(\"data-mydata\", this.get(\"#textField\").value);\n }", "update(){}", "update(){}", "update(){}", "function updatePosInfo(model) {\n $scope.loadingPosInfo = true;\n DynamicApiService.putMultiple($scope.masterEntityIdentifier, [model]).then(function (result) {\n tosterFactory.showCustomToast('New POS \"' + model.Description + '\" updated successfully.', 'success');\n cleanDisplayEntities('newModule'); getPosModules();\n }, function (reason) {\n $scope.loadingPosInfo = false;\n tosterFactory.showCustomToast($scope.slaveEntityIdentifier + ' entry failed to update.', 'fail');\n console.log('Fail Load'); console.log(reason);\n }, function (error) {\n $scope.loadingPosInfo = false;\n tosterFactory.showCustomToast($scope.slaveEntityIdentifier + ' entry failed to update.', 'error');\n console.log('Error Load'); console.log(error);\n });\n }", "updateInputs (inputs) {\n this.updateMoves() // Actualizamos la posicion/accion del personaje\n this.inputs = inputs // Seteamos los inputs\n this.calculateAcceleration() // Calculamos la nueva aceleracion del personaje\n }", "function _saveLocalEdit() {\n\n // get changed vars\n var columnList = [];\n\n // changed names\n columnList.push({ column: \"playername\", value: firstname });\n columnList.push({ column: \"coachname\", value: coachname });\n columnList.push({ column: \"clubname\", value: clubname });\n\n // changed video\n if (path != viewModel.get(\"videoPath\")) {\n columnList.push({ column: \"path\", value: viewModel.get(\"videoPath\") });\n }\n columnList.push({ column: \"thumbnail\", value: thumbnail });\n\n // changed types\n if (shotTypeIndex != viewModel.get(\"shotTypeIndex\")) {\n columnList.push({ column: \"shottype\", value: viewModel.get(\"shotTypeIndex\") });\n }\n if (ratingTypeIndex != viewModel.get(\"ratingTypeIndex\")) {\n columnList.push({ column: \"ratingtype\", value: viewModel.get(\"ratingTypeIndex\") });\n }\n\n // changed ids\n columnList.push({ column: \"playerid\", value: playerId });\n columnList.push({ column: \"coachid\", value: coachId });\n columnList.push({ column: \"clubid\", value: clubId });\n\n // changed date\n var dateCheck = viewModel.get(\"date\");\n var timeCheck = viewModel.get(\"time\");\n var dateTimeCheck = dateCheck + \" \" + timeCheck;\n var curDateTime = dateTimeObj.toDateString() + \" \" + dateTimeObj.toLocaleTimeString(\"en-US\");\n if (curDateTime != dateTimeCheck) {\n columnList.push({ column: \"date\", value: new Date(dateCheck + \" \" + timeCheck) });\n }\n\n // build query\n var query = \"UPDATE \" + LocalSave._tableName + \" SET \";\n var first = true;\n var valList = [];\n for (var i = 0; i < columnList.length; i++) {\n var item = columnList[i];\n if (!first) {\n query += \", \";\n }\n query += item.column + \"=?\";\n valList.push(item.value);\n first = false;\n }\n query += \" WHERE id=?;\";\n valList.push(shotId);\n\n // run query.\n var complete = new Promise(function (resolve, reject) {\n db.queryExec(query, valList,\n function (id) {\n console.log(\"Saved new shot with id \" + id);\n resolve(id);\n },\n function (err) {\n reject(err);\n });\n });\n\n // handle query after it has completed\n complete.then(\n function (val) {\n if (page.android) {\n var Toast = android.widget.Toast;\n Toast.makeText(application.android.context, \"Shot Saved\", Toast.LENGTH_SHORT).show();\n }\n // leave page\n frameModule.topmost().goBack();\n },\n function (err) {\n _unlockFunctionality();\n });\n}", "setModel(input) {\n if (input) {\n const isInitModel = this.initModel(input);\n this.data.push(isInitModel);\n }\n }", "_updateContentsModel(model) {\n const newModel = {\n path: model.path,\n name: model.name,\n type: model.type,\n content: undefined,\n writable: model.writable,\n created: model.created,\n last_modified: model.last_modified,\n mimetype: model.mimetype,\n format: model.format\n };\n const mod = this._contentsModel ? this._contentsModel.last_modified : null;\n this._contentsModel = newModel;\n this._ycontext.set('last_modified', newModel.last_modified);\n if (!mod || newModel.last_modified !== mod) {\n this._fileChanged.emit(newModel);\n }\n }", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "function updateGameModel(model) {\r\n initializeModel(model);\r\n}", "onSave() {\n log('saved');\n // Resolve the promise\n this.fulfillPromise('resolve', {model: this.view.model});\n\n // Destroy the view\n this.view.destroy();\n }", "function MUPS_Save(mode, el_input){\n console.log(\" ----- MUPS_Save ---- mode: \", mode);\n\n // --- get urls.url_user_allowedsections_upload\n const upload_dict = {\n mode: \"update\",\n user_pk: mod_MUPS_dict.user_pk,\n allowed_sections: mod_MUPS_dict.allowed_sections\n }\n const url_str = urls.url_user_allowedsections_upload;\n console.log(\" url_str: \", url_str);\n\n UploadChanges(upload_dict, url_str);\n\n // --- show modal\n $(\"#id_mod_userallowedsection\").modal(\"hide\");\n }", "changeBaseSave(i,event){\n this.savingThrowsModifier[1].saves[i].value = Number(event.target.value)\n }", "async save() {\n // Check if anything has changed or stop here.\n const originData = await loadDataObject(this.dataKey)\n\n if (this.data === originData) {\n console.log('Nothing changed here for ' + this.dataKey)\n return\n }\n\n // Convert the modified data for the backend.\n const convertedData = await convertNewData(\n this.dataKey,\n JSON.parse(JSON.stringify(this.data))\n )\n\n // Update the data on the backend.\n try {\n await ApiConnector.update(this.dataKey, convertedData)\n } catch (err) {\n // TODO: Show the error to the user.\n console.log('Message: ' + err.message)\n }\n }", "function editStudyInfoSave(e) {\r\n\r\n\t// console.log($('#editStudyInfoModal .form-control').serializeObject());\r\n\r\n\tvar newInfo = $('#editStudyInfoModal .form-control').serializeObject();\r\n\t// console.log(newInfo)\r\n\tvar study = $('#edit-study-page').data('editing');\r\n\r\n\t_.forEach(newInfo, function(item, key) {\r\n\t\tstudy[key] = item;\r\n\t});\r\n\r\n\t$('#edit-study-page').data('editing', study);\r\n\r\n\t$('#editStudyInfoModal').modal('hide');\r\n\r\n}", "__applyModelChanges() {\n this.buildLookupTable();\n this._applyDefaultSelection();\n }", "onRestore() {\n this._updateModels();\n }", "function update(updatedModel, force) {\n\t\t\tupdatedModel = updatedModel || this;\n\t\t\tforce = typeof force === 'boolean' ? force : false;\n\t\t\t\n\t\t\tif (force || !this.isEqual(updatedModel, false)) {\n\t\t\t\tthis.setData(updatedModel);\n\t\t\t\tthis.cacheCurrentState(false);\n\t\t\t}\n\t\t}", "clientInputSave(inputEvent) {\n\n // if no inputs have been stored for this step, create an array\n if (!this.recentInputs[inputEvent.input.step]) {\n this.recentInputs[inputEvent.input.step] = [];\n }\n this.recentInputs[inputEvent.input.step].push(inputEvent.input);\n }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "handleModelChange(model, value, opts) {\n this.setValue(value, opts);\n }", "function updateSaveData() {\n if (currentMode == \"event\") {\n let saveData = missionData.Completed.Remaining.map(m => m.Id).join(',');\n setLocal(\"event\", \"Completed\", saveData);\n setLocal(\"event\", \"Id\", EVENT_ID);\n setLocal(\"event\", \"Version\", EVENT_VERSION);\n } else {\n \n // Motherland\n let curRankCompletedIds = missionData.Completed.Remaining.map(m => m.Id);\n let saveData = [...curRankCompletedIds, ...missionData.OtherRankMissionIds].join(',');\n setLocal(\"main\", \"Completed\", saveData);\n }\n \n setLocal(currentMode, \"CompletionTimes\", JSON.stringify(missionCompletionTimes));\n}", "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "update(attributes) {\n console.log(attributes)\n\n self.attributes = Object.assign({}, self.attributes, attributes)\n self.persist()\n }", "function save() {\n saveDiagramProperties();\t// do this first, before writing to JSON\n document.getElementById(\"mySavedModel\").value = myDiagram.model.toJson();\n myDiagram.isModified = false;\n}", "onSaving() {\n var ptr = this;\n this.formView.applyValues();\n this.record.save(function () {\n ptr.onSaved();\n });\n this.saving.raise();\n }", "saveChanges() {\n this.emit(EVENTS.TodosUpdateItem, {\n id: this.props.id,\n text: this.state.input\n });\n\n this.setState({ isEditing: false });\n }", "save() {\n\t\tlet model = this.constructor.name;\n\n\t\treturn cache.fields( model )\n\t\t\t\t.then( ( f ) => {\n\t\t\t\t\tvalidator.validate( this, cache.validations( model ) );\n\t\t\t\t\treturn update( model, f.toSaveObject( this ) )\n\t\t\t\t\t\t.then( ( rows ) => rows ? this :\n\t\t\t\t\t\t\tinsert( model, f.toSaveObject( this ) ).then( ( rows ) => this ) )\n\t\t\t\t} );\n\t}", "function applyParams() {\n // Get the current values from the UI and set the values.\n PREF_OBJ.set();\n \n PREF_OBJ.save();\n window.close();\n}", "function updateModel(model_name) {\n\tinjection.config.model_name = model_name;\n\tinjection.config.model_path = injection.config.model_dir + \"/\" + model_name;\n\n\tinjection.refreshModel();\n\n\tgui.__folders['Geometric Properties'].updateDisplay()\n}", "function saveData() {\n\tstate.save();\n}", "_save() {\n\t\tconst version = this._editor.model.document.version;\n\n\t\t// Operation may not result in a model change, so the document's version can be the same.\n\t\tif ( version === this._lastDocumentVersion ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tthis._data = this._getData();\n\t\t\tthis._lastDocumentVersion = version;\n\t\t} catch ( err ) {\n\t\t\tconsole.error(\n\t\t\t\terr,\n\t\t\t\t'An error happened during restoring editor data. ' +\n\t\t\t\t'Editor will be restored from the previously saved data.'\n\t\t\t);\n\t\t}\n\t}", "updateModel(dir, value) {\n const ctrl = this.form.get(dir.path);\n ctrl.setValue(value);\n }", "function updateInput() {\n ipR.value = ToString(r, 3, true); // campo de entrada para radio (m)\n ipT.value = ToString(tPer, 3, true); // campo de entrada para duración (s) de ida y vuelta\n ipM.value = ToString(m, 3, true); // campo de entrada para masa (kg)\n}", "function updateOperation (operation, model) {\n model.operator = operation.operator;\n model.percentage = operation.percentage;\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n }", "_save() {\n const detail = this.serializeForm();\n this.dispatchEvent(new CustomEvent('save', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail\n }));\n }", "_save() {\n // fixme it's calling blur & create at same time\n this.props.onSave(this.state.value);\n }", "saveData() {\n if (this.s.unavailable()) {\n return;\n }\n\n for (const val of this.dispField.items) {\n this.s.set(val, this.dispField.checked(val));\n }\n\n this.s.set(\"unit\", this.unitField.get());\n this.s.set(\"format\", this.formatField.get());\n this.s.set(\"sort\", this.sortableField.toArray());\n }", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "setData(data){\r\n this.model.setData(data);\r\n }", "save(){\n\t\t// get the connector assign to this model\n\t\tlet connector = this.getConfig('connector');\n\t\tif(!connector){\n\t\t\tthrow new Error('Connector is not configured for this model')\n\t\t}\n\n\t\tlet key = this.getKey();\n\t\tif(this[key]){\n\t\t\t// for updating model\n\t\t\treturn connector.$update(this)\n\t\t} else {\n\t\t\t// for new model\n\t\t\treturn connector.$add(this);\n\t\t}\n\n\t}", "async preSave (options = {}) {\n\t\tif (this.existingModel) {\n\t\t\tthis.model = this.existingModel;\n\t\t\tif (this.dontSaveIfExists) {\n\t\t\t\t// we have a document that matches the input attributes, and there's no need\n\t\t\t\t// to make any changes, just pass it back to the client as-is\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tthis.attributes = Object.assign({}, this.existingModel.attributes, this.attributes, { id: this.existingModel.id });\n\t\t} else if (this.useId) {\n\t\t\tthis.attributes.id = this.useId;\n\t\t}\n\n\t\t// create a new model with the passed attributes, and let the model pre-save itself ...\n\t\t// this is where pre-save validation of the attributes happens\n\t\tthis.model = this.model || new this.modelClass(this.attributes);\n\t\ttry {\n\t\t\tawait this.model.preSave({ ...options, new: !this.existingModel });\n\t\t}\n\t\tcatch (error) {\n\t\t\tthrow this.errorHandler.error('validation', { info: error });\n\t\t}\n\t}", "function updateClick() {\n readInput();\n booking.id = updatedBookingId;\n updateInput();\n}", "save(params) {\n this.sendAction('save', params);\n }", "_applyModelType(value, old) {\n if (old) {\n this.getStateManager().setState(\"modelId\", 0);\n }\n // if (value) {\n // this.getStateManager().setState(\"modelType\", value);\n // } else {\n // this.getStateManager().removeState(\"modelType\");\n // }\n }", "function updateAll(){refreshSliderDimensions();ngModelRender();}", "function handleSave() {\n console.log('in handleSave');\n const updatedList = {\n id: trip.id,\n location: title,\n start_date: date,\n days: days,\n }\n console.log('Updated trip info:', updatedList);\n //update list to reflect changes by triggering events stemmed from update list reducer\n dispatch({ type: 'UPDATE_LIST', payload: updatedList })\n //reset edit mode to false\n setEditMode(false)\n // history.push('/user')\n }", "function inputUpdater () {\n possibleInputs = {\n previous: [imgArray[previousFirst], imgArray[previousSecond], imgArray[previousThird]],\n current: [imgArray[firstImageNumber], imgArray[secondImageNumber], imgArray[thirdImageNumber]],\n blank: [{name: 'click', path: './assets/blank.jpg'}, {name: 'an', path: './assets/blank.jpg'}, {name: 'image', path: './assets/blank.jpg'}]\n };\n}", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function update_input_value() {\n inputObject.init();\n var eles = document.getElementsByTagName('input');\n\n // update every non-null input\n for (let ele of eles) {\n if (ele.name != \"\" && ele.value != \"\"){\n var key = ele.name;\n var value = ele.value;\n if (ele.type === \"radio\" || ele.type === \"checkbox\") {\n if (ele.checked) {\n // console.log('KEY:'+ key + ' , VALUE:' + value);\n inputObject.update(key, value);\n }\n } else {\n inputObject.update(key, value);\n }\n }\n\n }\n}", "function resetAppFields() {\n$scope.inputs = []; \n$scope.savedFields = []; \n}", "function transformModel(options,data){var prop=options.model&&options.model.prop||'value';var event=options.model&&options.model.event||'input';(data.props||(data.props={}))[prop]=data.model.value;var on=data.on||(data.on={});if(isDef(on[event])){on[event]=[data.model.callback].concat(on[event]);}else{on[event]=data.model.callback;}}", "function transformModel(options,data){var prop=options.model&&options.model.prop||'value';var event=options.model&&options.model.event||'input';(data.props||(data.props={}))[prop]=data.model.value;var on=data.on||(data.on={});if(isDef(on[event])){on[event]=[data.model.callback].concat(on[event]);}else{on[event]=data.model.callback;}}", "async preSave () {\n\t\tawait this.getStream();\n\t\tawait this.getTeam();\n\t\tawait this.checkNameUnique();\n\t\tawait this.checkNameForProvider();\n\t\tawait this.getUsers();\n\t\tawait this.clearUnreads();\n\t\tthis.attributes.modifiedAt = Date.now();\n\t\tawait super.preSave();\n\t}", "updateSettings (saved) {\n this._saved = saved\n }", "_updateAvailableLayersModel(availableLayers, inputFields) {\n let _tempAvailableLayers = inputFields.map(input =>\n availableLayers.find(layer => input.value === layer.layerId)\n );\n\n // Set the available layers\n this._availableLayersModel.setLayers(_tempAvailableLayers);\n }" ]
[ "0.70475394", "0.6449124", "0.63459206", "0.6293932", "0.6222519", "0.61563414", "0.6123099", "0.61211646", "0.6061492", "0.6024969", "0.60214436", "0.6011942", "0.5996104", "0.5996104", "0.5978218", "0.5975524", "0.59657776", "0.5953566", "0.59368324", "0.5912318", "0.5906817", "0.5876788", "0.58578044", "0.58569324", "0.58569324", "0.5845321", "0.58216214", "0.57944626", "0.57883805", "0.578262", "0.5778177", "0.5770607", "0.5744899", "0.5723169", "0.570711", "0.570636", "0.57048076", "0.5662798", "0.5654345", "0.56493276", "0.56387085", "0.56361955", "0.56361955", "0.56361955", "0.56266296", "0.5624599", "0.5618783", "0.5617535", "0.55990547", "0.55816364", "0.5561204", "0.555947", "0.55594593", "0.5555651", "0.55530405", "0.5545617", "0.55383193", "0.5528847", "0.5521237", "0.55004245", "0.54991585", "0.54983735", "0.5493573", "0.5479832", "0.54783803", "0.5475714", "0.54439193", "0.5435389", "0.5422946", "0.54114836", "0.5408847", "0.54062665", "0.54056686", "0.5393822", "0.5387332", "0.5386353", "0.5385805", "0.5385805", "0.5385805", "0.53746724", "0.53727037", "0.5370941", "0.5368247", "0.53595454", "0.5352355", "0.5332779", "0.53262836", "0.5326104", "0.5319536", "0.53165483", "0.5316156", "0.5315246", "0.53090453", "0.53025264", "0.5298655", "0.52982616", "0.52982616", "0.52901775", "0.52852833", "0.52834207" ]
0.58771473
21
=== Storage functions === store current data for the next session if the user exits by mistake
function storeCurrent() { let currentData = { regexInput: regexInput.value, templateInput: templateInput.value, globalCheckbox: globalCheckbox.checked, caseInsensitiveCheckbox: caseInsensitiveCheckbox.checked, multilineCheckbox: multilineCheckbox.checked, IgnoreHTMLCheckbox: IgnoreHTMLCheckbox.checked, resultTextarea: resultTextarea.value, selectedItemIndex:selectedItemIndex, smallForm: smallFormCheckbox.checked }; let store = browser.storage.local.set({ currentData }); store.then(onError, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storedData() {\n localStorage.setItem(\"journalEntry\", newEvent);\n const storedInput = localStorage.getItem(\"journalEntry\");\n\n // if(storageInput) {\n\n // }\n}", "function save_data() {\r\n\tsessionStorage.setItem('pieces', JSON.stringify(Data.pieces))\r\n\tsessionStorage.setItem('stamps', JSON.stringify(Data.stamps))\r\n\tsessionStorage.setItem('categories', JSON.stringify(Data.categories))\r\n\tsessionStorage.setItem('tuto', JSON.stringify(Data.tuto))\r\n}", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function storesessiondata(){\n\tvar storagedata=JSON.stringify(sessiondata);\n\twindow.localStorage.setItem(cookiename, storagedata);\n}", "function storeState() {\n\n localStorage.setItem(STORAGE_KEY, JSON.stringify(data));\n }", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "function storeSession (data) {\n const now = new Date()\n const expirationDate = new Date(now.getTime() + data.expiresIn * 1000)\n localStorage.setItem('expirationDate', expirationDate)\n localStorage.setItem('expiresIn', data.expiresIn * 1000)\n localStorage.setItem('token', data.idToken)\n localStorage.setItem('userId', data.localId)\n localStorage.setItem('refreshToken', data.refreshToken)\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "storeSession(pathname, nextSessionData) {\n // We use pathname instead of key because the key is unique in the history.\n var sessionData = JSON.parse(sessionStorage.getItem(pathname));\n // Update the session data with the changes.\n sessionStorage.setItem(pathname, JSON.stringify(Object.assign({}, sessionData, nextSessionData)));\n }", "function persistData(data1, data2, data3) {\r\n\r\n// get form entries\r\n// var form = document.getElementById(\"userInput\"); \r\n var formdata1 = localStorage['myID'];\r\n var formdata2 = localStorage['myID2'];\r\n var formdata3 = localStorage['mySettings'];\r\n// set value if input was blank\r\n if (formdata1 === \"undefined\") { formdata1 = \"\" }; \r\n if (formdata2 === \"undefined\") { formdata2 = \"\" };\r\n if (formdata3 === \"undefined\") { formdata3 = \"\" };\r\n// check form entries on console\r\n console.log(\"data1 = \" + formdata1); \r\n console.log(\"data2 = \" + formdata2);\r\n console.log(\"data3 = \" + formdata3);\r\n// key, value pair into localStorage\r\n localStorage.setItem('formdata1Set', formdata1); \r\n localStorage.setItem('formdata2Set', formdata2); \r\n localStorage.setItem('formdata3Set', formdata3);\r\n// set the current time as the id to make it unique id\r\n var d = new Date();\r\n var new_id = d.getTime();\r\n localStorage.setItem('new_idSet', new_id);\r\n// proceed to next function\r\n startDB(); \r\n}", "function initializeDataStorage() {\n for(i = 0; i < ordered_plates.length; i++) {\n sessionStorage.setItem(ordered_plates[i].name, 0);\n }\n }", "function saveinStorage() {\n\tsessionStorage.setItem('idList', JSON.stringify(idList));\n\tsessionStorage.setItem('currentL', currentL);\n\tsessionStorage.setItem('currentR', currentR);\n\tsessionStorage.setItem('left', left);\n\tsessionStorage.setItem('right', right);\n\tsessionStorage.setItem('tempArr', JSON.stringify(tempArr));\n\tsessionStorage.setItem('position', position);\n}", "function saveSessionStorage(data) {\n sessionStorage.setItem(\"songID\", data);\n }", "function storeLocally(){\n var formName = document.getElementById('txtName').value;\n var formAge = document.getElementById('txtAge').value;\n sessionStorage.setItem(formName, formAge);\n\n var formOutput = formName + \": \" + formAge + \" y.o.\";\n\n appendObject (formOutput, \"P\", \"output\");\n}", "_updateStorage() {\n sessionStorage.setItem(`${this._storagePrefix}`, JSON.stringify(Object.entries(this._items).map(([, item]) => item.data)));\n }", "function storeEntry() {\n localStorage.setItem(\"event1\", entry1.text());\n localStorage.setItem(\"event2\", entry2.text());\n localStorage.setItem(\"event3\", entry3.text());\n localStorage.setItem(\"event4\", entry4.text());\n localStorage.setItem(\"event5\", entry5.text());\n }", "function storeChatData(){\n\t\n //Check for Session Storage support\n if (! window.sessionStorage){\n return\n }\n\t\n\tstoreChatStatus();\n\tstoreUserChatStatus();\n\tstoreConversations();\n}", "function storeData() {\n\t// This is a little bit of future proofing \n\tif (!submit.key) {\n\t\t// if there is no key, this is a new item and needs a new key\n\t\tvar id = \"ubuVers\" + Math.floor(Math.random()*10000001);\n\t} else {\n\t\t// set the id to the existing key we are editing\n\t\tid = submit.key;\n\t};\n\t\n // I like to give all my form elements their own id's to give myself access\n\t// outside of the form as well as simple access inside of it\n var ubuVersNumValue = ge('ubuVersNum').value,\n ubuVersNameValue = ge('ubuVersName').value,\n\t\tubuVersDict = {version: ubuVersNumValue, release: ubuVersNameValue};\n\t// log out those values as a double check\n console.log(ubuVersNumValue);\n console.log(ubuVersNameValue);\t\n\t\n\t// set the item in localstorage\n\t// note the stringify function\n\tlocalStorage.setItem(id, JSON.stringify(ubuVersDict));\n\t\n\t// log out the whole local storage\n\tconsole.log(localStorage);\n\tge('submit').value = 'Add';\n\n\n}", "function storeForm() {\n\t\t\n\t\t$( \".sessioninput\" ).each(function( index ) {\n\t\t\t\n\t\t\twindow.localStorage.setItem($(this).attr(\"name\"), $(this).val());\n\t\t\t\n\t\t});\n\t\t\n\t\t\n\t\tstartSession()\n\t}", "function storeUserData () {\n\t\tvar key,\n\t\tstorageData = {};\n\n\t\t// Loop thru user object and encode each name/value.\n\t\tfor (key in user) {\n\t\t\tif (user.hasOwnProperty(key)) {\n\t\t\t\tstorageData[(encryption.encode(key))] = encryption.encode(user[key]);\n\t\t\t}\n\t\t}\n\n\t\tIBM.common.util.storage.setItem(storage.key, storageData, 3600 * 24 * (user.information_level === \"basic\" ? storage.expireDaysBasic : storage.expireDaysDetailed));\n\t}", "function saveUserData() {\n localStorage.setItem('locallyStored', JSON.stringify(userData))\n}", "function storeData() {\n var foodObject = { //store data as an object that Results Page can use\n name: foodName,\n allergy: userAllergy,\n category: categoryInput,\n item: upcInput,\n searchResult: safeToEat,\n image: foodImg,\n }\n localStorage.setItem(foodName, JSON.stringify(foodObject));\n localStorage.setItem(\"lastKey\", foodName);\n resultsScreen(); //call function to redirect to the Results Screen after data is stored\n}", "function checkinData() {\n if (arrTemp.length != 3) {\n console.log(\"Oops! Looks like something went wrong. Please click Check-In to start over.\");\n console.error(\"Oops! Looks like something went wrong. Please click Check-In to start over.\");\n alert(\"Oops! Looks like something went wrong. Please click Check-In to start over.\");\n return;\n }\n //Using arrTemp, store data in sessionStorage\n sessionStorage.setItem('minutes', arrTemp.pop().value);\n sessionStorage.setItem('hours', arrTemp.pop().value);\n sessionStorage.setItem('xSmoked', arrTemp.pop().value);\n sessionStorage.setItem('count', 1);\n\n //store last-smoked as a date\n var date = new Date();\n date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours()-sessionStorage.getItem('hours'),\n date.getMinutes()-sessionStorage.getItem('minutes'), date.getSeconds(), date.getMilliseconds());\n sessionStorage.setItem('last-smoked', date);\n}", "function saveAuthData() {\n // Skip if the local storage is not available.\n if (!utils.storageAvailable('localStorage')) {\n return;\n }\n\n // Create the data object.\n var data = {\n authUserID: authUserID\n };\n\n // Save to the local storage.\n localStorage.setItem(authDataID, JSON.stringify(data));\n }", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "function fillStorage() {\n var local = {\n uid : uid,\n Time : timeLocal,\n Todos : todos\n }\n localStorage.clear();\n window.localStorage.setItem(`local`,JSON.stringify(local));\n mapping();\n}", "function fnSave(data){\n var key = Date.now();\n window.localStorage.setItem(key, data);\n }", "function storeData() {\n let storeDate = new Date();\n let month = storeDate.getMonth() + 1;\n let day = storeDate.getDate();\n let year = storeDate.getFullYear();\n\n let fullDate1 = month + \"/\" + day + \"/\" + year + \"/\" + 1;\n let fullDate2 = month + \"/\" + day + \"/\" + year + \"/\" + 2;\n let fullDate3 = month + \"/\" + day + \"/\" + year + \"/\" + 3;\n\n let moodObject = {\n mood: getMoodLevel,\n anxiety: getMotLevel,\n stress: getStrLevel,\n };\n\n if (localStorage.getItem(fullDate1) === null) {\n window.localStorage.setItem(fullDate1, JSON.stringify(moodObject));\n } else if (\n localStorage.getItem(fullDate1) !== null &&\n localStorage.getItem(fullDate2) === null\n ) {\n window.localStorage.setItem(fullDate2, JSON.stringify(moodObject));\n } else if (\n localStorage.getItem(fullDate1) !== null &&\n localStorage.getItem(fullDate2) !== null &&\n localStorage.getItem(fullDate3) === null\n ) {\n window.localStorage.setItem(fullDate3, JSON.stringify(moodObject));\n }\n else{\n showCapped = document.getElementById('moodCap');\n showCapped.textContent = \"Daily limit Reached. You have already checked in 3 times today.\";\n showCapped.style.display = 'block'; \n }\n}", "function saveData(){\n \n plan = $(`[data-time=\"${event.target.dataset.time}\"]`).val();\n\n timeBlock = $(this).attr(\"data-time\");\n\n var plannerData = JSON.parse(localStorage.getItem(\"plannerDataKey\"));\n\n for(i=0;i<plannerData.length;i++)\n {\n if(plannerData[i].time == timeBlock)\n {\n plannerData[i].currentPlan = plan;\n }\n \n }\n \n localStorage.setItem(\"plannerDataKey\", JSON.stringify(plannerData));\n}", "function init_setup(){\n // TODO: Manage active sessions over different windows\n var init_active = {};\n var last_open = {};\n var init_saved = [];\n\n sessionData = {\n active_session: init_active, \n saved_sessions: init_saved, \n previous_tabs: last_open,\n };\n console.log(JSON.stringify(sessionData));\n\n storage.set({'sessionData': JSON.stringify(sessionData)}, function() {\n console.log(\"Initial data successfully saved.\");\n });\n\n}", "function storeData(key){\n\tcheckValue();\n/* random keygen and gather data for unique local data */\n\tif (!key){\n\t\tvar id \t\t\t= Math.floor(Math.random()*9001);\n\t}else{\n\t\tid = key;\n\t}\n\t\n\tvar item\t\t= {};\n\t\titem.itype = [\"Item Type\", itemType.value];\n\t\titem.iname = [\"Item Name\", whatName.value];\n\t\titem.inumber= [\"How Many\", numberOf.value];\n\t\titem.ihand = [\"Carried By Hand\", handyVal];\n\t\titem.inotes = [\"Notes\", notes.value];\n\t\n/* stringify for local storage */\n\tlocalStorage.setItem (id, JSON.stringify(item)); \t\n\talert(\"Information Submitted\");\n}", "function savedData() {\n var storedDay = JSON.parse(localStorage.getItem(\"dayPlan\"));\n\n if (storedDay) {\n dayPlan = storedDay;\n };\n\n rememberReminders();\n showReminders();\n}", "persist() {\n localStorage.setItem(\n STORAGE_KEY + \"/\" + this.user.getId(),\n JSON.stringify(this.data)\n );\n }", "function saveStats(){\n sessionStorage.setItem('stats', JSON.stringify(stats));\n sessionStorage.setItem('statsinfo', JSON.stringify(statsinfo));\n}", "function saveUserData() {\n\tupdateSnakeStorage();\n\tsetLocalStorageItem(\"Snake\", SNAKE_STORAGE);\n}", "function populateStorage () {\n localStorage.setItem('prop1', 'red')\n localStorage.setItem('prop2', 'blue')\n localStorage.setItem('prop3', 'magenta')\n\n sessionStorage.setItem('prop4', 'cyan')\n sessionStorage.setItem('prop5', 'yellow')\n sessionStorage.setItem('prop6', 'black')\n }", "static saveSession() {\n if (typeof window === 'undefined') return\n window.sessionStorage.idCacheByUserId = JSON.stringify(idCacheByUserId)\n window.sessionStorage.itemCacheByUserId = JSON.stringify(itemCacheByUserId)\n window.sessionStorage.userCache = JSON.stringify(userCache)\n }", "_addSessionToStorage() {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(this._session));\n }", "function updateSessionStorage()\n{\n //save stickman to session as \"stk_man\"\n stk_man = new Stickman();\n sessionStorage.setItem(\"stk_man\", JSON.stringify(stk_man));\n\n //save History to session as \"hist\"\n sessionStorage.setItem(\"hist\", JSON.stringify(hist.toJSON()));\n\n}", "function storeData(data) {\n if (data) {\n \tif(!data.error)\n \tstate.stops[\"id\"+data.id.substring(6)] = data; \n else\n \twindow.alert(\"Bus stop does not exist\");\n }\n\n localStorage.setItem(\"stored\",JSON.stringify(Object.keys(state.stops)));\n displayData();\n}", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function saveSession(data) {\n localStorage.setItem('username', data.username);\n localStorage.setItem('id', data._id);\n localStorage.setItem('authtoken', data._kmd.authtoken);\n userLoggedIn();\n }", "function _save(){\n _dropOldEvents(); // remove expired events\n try{\n _storage_service.jStorage = JSON.stringify(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "nextSession() {\n // determine the next session\n const ind = allSessions.findIndex(n => n === this.state.session);\n const session = allSessions[(ind + 1) % allSessions.length];\n\n // put empty object in this session's localStorage if nothing exists there already\n const storageKeys = Object.keys(localStorage);\n if (!storageKeys.includes(session)) {\n localStorage.setItem(session, '{}');\n }\n\n // change the session\n this.setState({session: session});\n }", "function saveItemInStorage() {\r\n\t\tconst items = getItems();\r\n\t\titems.push({\r\n\t\t\t'id': items.length,\r\n\t\t\t'task': getTask(),\r\n\t\t\t'date': getDate(),\r\n\t\t\t'time': getTime(),\r\n\t\t\t'completed': false\r\n\t\t});\r\n\t\tsessionStorage.setItem('items', JSON.stringify(items)); // gives a string\r\n\t}", "function saveData() {\n if (localStorage != null && JSON != null) {\n localStorage[\"size\"] = JSON.stringify(size);\n localStorage[\"cartData\"] = JSON.stringify(cartData);\n }\n }", "function scoreStore(){\n localStorage.setItem($url, $currentScreen);\n }", "function saveData() {\n\t\tif(!key){\n\t\t\tvar id \t\t\t\t\t\t= Math.floor(Math.random()*1000001);\n\t\t}else{\n\t\t\tid = key;\n\t\t}\n\t\t\n\t\tgetRadioValue ();\n\t\tgetCheckbox();\n\t\tvar item\t\t\t\t\t\t= {};\n\t\t\t item.kname\t\t\t\t= [\"Kid's Name:\", $(\"kname\").value];\n\t\t\t item.pname\t\t\t\t= [\"Parent's Name:\", $(\"pname\").value];\n\t\t\t item.phone\t\t\t\t= [\"Phone #:\", $(\"phone\").value];\n\t\t\t item.email\t\t\t\t= [\"Email:\", $(\"email\").value];\n\t\t\t item.date\t\t\t\t= [\"Play Date:\", $(\"date\").value];\n\t\t\t item.sex\t\t\t\t= [\"Sex:\", sexValue];\n\t\t\t item.choice\t\t\t= [\"Best Time of Week:\", $(\"choice\").value];\n\t\t\t item.select\t\t\t= [\"Best Time of Day:\", $(\"dayTimes\").value];\n\t\t\t item.allergies\t\t= [\"Needs:\", hasAllergy];\n\t\t\t item.comments\t\t\t= [\"Notes:\", $(\"comments\").value];\n\t\t\t item.outgoing\t\t\t= [\"How Outgoing? 1-10:\", $(\"outgoing\").value];\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Saved!\");\n\t}", "function saveSessionValue(key, value){\n\tif(typeof(Storage) !== 'undefined') {\n\t\tlocalStorage.setItem(key, value);\n \t//window.localStorage.setItem(key, value);\n }\n}", "function saveToLocalStorage(e){\n sessionStorage.setItem('birds', `${birds.value}`);\n birds.value = '';\n \n sessionStorage.setItem('feeds', `${feeds.value}`);\n feeds.value = '';\n \n sessionStorage.setItem('water', `${water.value}`);\n water.value = '';\n \n sessionStorage.setItem('vaccination', `${vaccination.value}`);\n vaccination.value = ''; \n \n sessionStorage.setItem('drugs', `${drugs.value}`);\n drugs.value = '';\n \n sessionStorage.setItem('mortality', `${mortality.value}`);\n mortality.value = '';\n //show success message \n showSuccess();\n e.preventDefault();\n}", "_storeState() {\n storage.set(this.itemId, JSON.stringify({\n lastVisit: Date.now(),\n commentCount: this.itemDescendantCount,\n maxCommentId: this.maxCommentId\n }))\n }", "function persistLocalStorage() {\n _localStorage.setItem(_name, this.toJSON());\n }", "function storeLocal() {\n $.get(\"/api/commander\").then(function(results) {\n localStorage.setItem(\"mtgCommanders\", JSON.stringify(results));\n $.get(\"/api/league_data\").then(function(data) {\n localStorage.setItem(\"data\", JSON.stringify(data));\n window.location.replace(\"/setup\");\n });\n });\n }", "function loadSessionStorage()\n{\n //check if the history is in the session if so, load it\n if(sessionStorage.getItem(\"hist\") !== null)\n {\n var new_hist = JSON.parse(sessionStorage.getItem(\"hist\"));\n hist.loadJSON(new_hist);\n }\n\n //check if the stickman is in the session if so, load it\n if(sessionStorage.getItem(\"stk_man\") !== null)\n {\n var str = sessionStorage.getItem(\"stk_man\");\n var stk_man = JSON.parse(str);\n updateBody(stk_man);\n }\n}", "function startIndhold() {\n\n let data = sessionStorage.getItem(\"logind\")\n console.log(data); \n if (sessionStorage.logind == \"yes\") {\nconsole.log(\"yesyes\")\nhentData(indholdData, indholdHentet); \n} else {\nlocation.href = \"index.html\"\n}\n \n}", "function storeData (key) {\n\t\tif (!key) {\n\t\t\tvar id = Math.floor(Math.random()*1000000);\n\t\t} else {\n\t\t\tvar id = key;\n\t\t}\t\t\n\t\tgetSelectedRadio();\n\t\t\n\t\t//Form data into an object..\n\t\t//Object properties has array with label and value.\n\t\t\n\t\tvar item \t\t\t\t= {};\n\t\titem.group \t\t\t\t= [\"Group:\", $('groups').value];\n\t\titem.remindTitle \t\t= [\"Reminder Title:\", $('remindTitle').value];\n\t\titem.dueDate\t\t\t= [\"Due Date:\", $('due').value];\n\t\titem.priority\t\t\t= [\"Priority:\", priorityValue];\n\t\titem.recurrence\t\t\t= [\"Recurrence:\",$('recurrence').value];\n\t\titem.description\t\t= [\"Description:\", $('description').value];\n\t\t\n\t\t\n\t\t//Save to Local Storage\n\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\talert(\"Reminder is set!\");\n\t\t\n\t\twindow.location = 'index.html';\n\t\twindow.reload();\n\t}", "function setItem(key, data) {\n try {\n window.sessionStorage.setItem(key, data);\n }\n catch (e) {\n /* Eat the exception */\n }\n}", "function setItem(key, data) {\n try {\n window.sessionStorage.setItem(key, data);\n }\n catch (e) {\n /* Eat the exception */\n }\n}", "function _save(){\n try{\n _storage_service.jStorage = json_encode(_storage);\n // If userData is used as the storage engine, additional\n if(_storage_elm) {\n _storage_elm.setAttribute(\"jStorage\",_storage_service.jStorage);\n _storage_elm.save(\"jStorage\");\n }\n _storage_size = _storage_service.jStorage?String(_storage_service.jStorage).length:0;\n }catch(E7){/* probably cache is full, nothing is saved this way*/}\n }", "async function handleSession() {\n\t// ottiene il dato da localStorage\n\tconst sessionData = localStorage.getItem('mdb_session');\n\n\t// se sessionData è undefined\n\tif (!sessionData) {\n\t\t// crea una nuova sessione\n\t\tconst newSessionData = await getGuestSession();\n\n\t\tconsole.log(newSessionData, 'newSessionData');\n\n\t\t// se la chiamata getGuestSession ritorna un valore\n\t\tif (newSessionData) {\n\t\t\t// trasforma in stringa l'oggetto (localStorage può avere solo stringhe)\n\t\t\tconst sessionDataString = JSON.stringify(newSessionData);\n\n\t\t\t// aggiunge il valore nel localStorage\n\t\t\tlocalStorage.setItem('mdb_session', sessionDataString);\n\n\t\t\t// mostra il toastBaner per dare un feedback alll'utente\n\t\t\tshowToast('Hey! Adesso sei registrato come guest');\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t} else {\n\t\t// se sessionData ha un valore\n\n\t\t// trasforma la stringa ottenuta da localSotarge in oggetto o variabile primitiva\n\t\tconst parsedSessionData = JSON.parse(sessionData);\n\n\t\t/**\n\t\t * controlliamo che la sessione non sia scacduta\n\t\t *\n\t\t * la data di scadenza della sessione è contenuta\n\t\t * nell'oggetta della sessione sotto il nome \"expires_at\"\n\t\t *\n\t\t * utilizziamo Date per verificare se la data di scadenza è inferiore\n\t\t * alla data attuale nel momento in cui sta eseguendo questo codice.\n\t\t *\n\t\t * trasformiamo le due date con getTime() in un numero che corrisponde\n\t\t * ai millisecondi compresi tra la data usata e il 1 gennaio 1970\n\t\t * (è uno standard per avere una costante di riferimento)\n\t\t *\n\t\t */\n\t\tconst expiresDate = new Date(parsedSessionData.expires_at).getTime();\n\t\tconst nowDate = new Date().getTime();\n\n\t\t// se expiresDate in millisecondi è inferiore\n\t\t// a nowDate in millisecondi allora la sessione è scaduta\n\t\tif (expiresDate < nowDate) {\n\t\t\t// rimuoviamo i dati della sessione del localStorage\n\t\t\tlocalStorage.removeItem('mdb_session');\n\n\t\t\t// chiamiamo la funzione stessa per gestire la\n\t\t\t// creazione di una nuova sessione e l'inserimento nel localStorage\n\t\t\tawait handleSession();\n\n\t\t\treturn true;\n\t\t}\n\t\treturn true;\n\t}\n}", "function setStorage() \r\n\t{\r\n if (typeof(Storage) !== \"undefined\")\r\n\t\t{\r\n if (remember)\r\n\t\t\t{\r\n localStorage.setItem(\"member\", 'true');\r\n if (publicAddr)\r\n localStorage.setItem(\"address\", publicAddr);\r\n } else\r\n\t\t\t{\r\n localStorage.removeItem('member');\r\n localStorage.removeItem('address');\r\n }\r\n } \r\n }", "function storeData(storage, data){\n //check if browser supports storage\n if (typeof(Storage) !== \"undefined\") {\n window.localStorage.setItem(storage, JSON.stringify(data));\n }\n\n}", "function saveSession(){\n sessionStorage.setItem('timers', JSON.stringify(Timers));\n sessionStorage.setItem('settings', JSON.stringify(settingsDefaults));\n}", "function save() {\n \n try {\n if (typeof (localStorage) === 'undefined') {\n alert('Your browser does not support HTML5 localStorage. Try upgrading.');\n } else {\n try {\n window.localStorage.setItem(\"currency\", totalCurrency.toString());\n window.localStorage.setItem(\"cps\", CPS.toString());\n window.localStorage.setItem(\"inventory\", ko.toJSON(appView));\n window.localStorage.setItem(\"totalClicks\", appView.player.totalClicks());\n window.localStorage.setItem(\"totalMoneySpent\", appView.player.totalMoneySpent());\n } catch (e) {\n if (e === QUOTA_EXCEEDED_ERR) {\n alert('Quota exceeded!');\n }\n }\n }\n } catch (e) {\n window.status = e.message;\n }\n\n lastSave = new Date();\n}", "function store() {\n localStorage.setItem('name_1', name_1.value);\n localStorage.setItem('pw', pw.value);\n localStorage.setItem('email',email.value )\n}", "function storedata(username, jwt) {\r\n if(typeof(Storage) !== \"undefined\") {\r\n if (localStorage.jwt && localStorage.username) {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done')\r\n } else {\r\n localStorage.username =username;\r\n localStorage.jwt =jwt;\r\n // alert('done add')\r\n }\r\n } else {\r\n alert(\"Sorry, your browser does not support web storage...\");\r\n }\r\n }", "persistData()\n {\n // Convert the likes array to JSON so we\n // can persist it w/ localStorage (setItem() method takes only\n // string arguments!)\n localStorage.setItem('likes', JSON.stringify(this.likes));\n }", "function setLocalStorageData() {\n if ($.isEmptyObject(localStorage.inUse)) {\n //Set defaults\n localStorage.inUse = 'true';\n localStorage.sounds = 'true';\n localStorage.tracking = 'true';\n localStorage.logggedWorkouts = '[]';\n }\n if ($.isEmptyObject(localStorage.logggedWorkouts)) {\n localStorage.logggedWorkouts = '[]';\n $('#previousworkout-btn').hide();\n } else if (localStorage.logggedWorkouts === '[]') {\n $('#previousworkout-btn').hide();\n }\n if (localStorage.sounds === 'true') {\n $('#flip-alert').val('on');\n } else {\n $('#flip-alert').val('off');\n }\n if (localStorage.tracking === 'true') {\n $('#flip-track').val('on');\n } else {\n $('#flip-track').val('off');\n }\n }", "function storeFormEntry(e) {\n var key = e.target.getAttribute(\"id\");\n sessionStorage.setItem(key, e.target.value);\n}", "saveAllData(){\n localStorage.setItem(CYCLING_LS, JSON.stringify(this.allUserData))\n localStorage.setItem(CYCLING_TM, JSON.stringify(this.timestampData)) \n }", "function syncStorage () {\n // Save all data except the first two default and recent tabs\n $localStorage.tabs = STORAGE.slice(2);\n }", "function checkStorage(){\r\n\t\t\ttry {\r\n\t\t\t\t\tvar x = 'test-sessionStorage-' + Date.now();\r\n\t\t\t\t\tsessionStorage.setItem(x, x);\r\n\t\t\t\t\tvar y = sessionStorage.getItem(x);\r\n\t\t\t\t\tsessionStorage.removeItem(x);\r\n\t\t\t\t\tif (y !== x) {throw new Error();}\r\n\t\t\t\t\tdb = sessionStorage; // sessionStorage is fully functional!\r\n\t\t\t} catch (e) {\r\n\t\t\t\tdb = new MemoryStorage('GW-sessionStorage'); // fall back to a memory-based implementation\r\n\t\t\t}\r\n\t\t}", "function persistConfig(data) {\n localStorage.setItem(\"config\", data)\n }", "function storeEntry(obj) {\n\n // -------------------------------------------------------------JSON - Stringify Ex. 2||\n //Turn passed Object into a string for storage\n let strEntry = JSON.stringify(obj);\n\n //Push it on to the session users journal\n let key = obj.getType() + obj.getDate() + obj.getTime();\n \n sessionUser.journal[key] = strEntry;\n\n // -------------------------------------------------------------JSON - Stringify Ex. 3||\n sessionUserStr=JSON.stringify(sessionUser);\n \n //overide the stored useer.\n localStorage.setItem(sessionUser.getName()+sessionUser.getPin(), sessionUserStr);\n}", "saveSession () {\n this.storage.touch()\n }", "function clearUserData()\n {\n userData = userDataDefault;\n window.localStorage.setItem(localStorageName, JSON.stringify(userData));\n }", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "function save() {\n\t\tvar value, data = '';\n\n\t\t// localStorage can be disabled on WebKit/Gecko so make a dummy storage\n\t\tif (!hasOldIEDataSupport) {\n\t\t\treturn;\n\t\t}\n\n\t\tfor (var key in items) {\n\t\t\tvalue = items[key];\n\t\t\tdata += (data ? ',' : '') + key.length.toString(32) + ',' + key + ',' + value.length.toString(32) + ',' + value;\n\t\t}\n\n\t\tstorageElm.setAttribute(userDataKey, data);\n\n\t\ttry {\n\t\t\tstorageElm.save(userDataKey);\n\t\t} catch (ex) {\n\t\t\t// Ignore disk full\n\t\t}\n\n\t\tupdateKeys();\n\t}", "function saveAutocompleteToSessionCache(data){\n if(data['ext'] !== undefined){\n // Save extensions\n let itemKey = \"ext-\" + data['housenr'] + data['zipcode'];\n sessionStorage.setItem(itemKey, JSON.stringify(data['ext']));\n }else{\n // Save housnr\n let itemKey = \"housenr-\" + data['zipcode'];\n sessionStorage.setItem(itemKey, JSON.stringify(data['housenr']));\n }\n}", "function saveStorage(nextID) {\n //get current id of question\n var currentItem = localStorage.getItem('step'),\n currentEQ = checkCurrent();\n\n checkItem();\n if($('.slide').eq(currentEQ).hasClass('active')){\n var quizID = $('.slide').eq(nextID).attr('id');\n localStorage.setItem('step', quizID);\n }\n\n if(currentItem==null) {\n localStorage.setItem('step','start');\n }\n}", "function updateLocalStorage() {\n localStorage.setItem(\"sessions\", JSON.stringify(sessions));\n}", "function storecurrentDate() {\n savedSchedule = JSON.parse(localStorage.getItem(date));\n\n if (savedSchedule === null) {\n console.log('creating');\n dateObj['date'] = date;\n dateArr.push(dateObj);\n localStorage.setItem(date, JSON.stringify(dateArr));\n }\n }", "function store() {\n localStorage.setItem('name1', name1.value);\n localStorage.setItem('pw', pw.value);\n}", "function storeInformation() {\n localStorage.setItem('todaysTimes', JSON.stringify(todaysTimes));\n}", "function dataPersist(){\n let AllRowsInScope = $(\".description\");\n for(rowInScope of AllRowsInScope)\n {\n let keyValue = $(rowInScope).siblings(\"#hour\").text();\n keyValue = keyValue+=\"Task\";\n if(localStorage.getItem(keyValue) == null)\n {\n return;\n }\n if (keyValue != null){\n let val = localStorage.getItem(keyValue);\n $(rowInScope).val(val);\n } \n }\n}", "function Store () {\n return sessionStorage;\n}", "async writeToStorage() {\r\n const fetchedInfo = {\r\n fetchedUsername: this.state.fetchedUsername,\r\n fetchedPassword: this.state.fetchedPassword,\r\n };\r\n\r\n //Save the user info\r\n localStorage.setItem(\"fetchedInfo\", JSON.stringify(fetchedInfo));\r\n }", "async function handleSession() {\n const sessionData = localStorage.getItem(\"mdb_session\");\n\n if (!sessionData) {\n const newSessionData = await getGuestSession();\n\n if (newSessionData) {\n const sessionDataString = JSON.stringify(newSessionData);\n\n localStorage.setItem(\"mdb_session\", sessionDataString);\n showToastBanner();\n return true;\n }\n\n return false;\n } else {\n const parsedSessionData = JSON.parse(sessionData);\n\n if (isSessionExpired(parsedSessionData.expires_at)) {\n localStorage.removeItem(\"mdb_session\");\n await handleSession();\n return true;\n }\n }\n}", "function redesign(){\n $.each(sessionStorage, function(key, value){\n if (sessionStorage.hasOwnProperty(key)){\n var course = searchCourses(key);\n addCourseEntry(course);\n }\n });\n}", "function save(storage, name, value) {\n try {\n var key = propsPrefix + name;\n if (value == null) value = '';\n storage[key] = value;\n } catch(err) {\n console.log('Cannot access local/session storage:', err);\n }\n }", "function saveBopsAndHops() {\n localStorage.setItem(\"currentAlcohol\", JSON.stringify(alcohol));\n localStorage.setItem(\"currentArtist\", JSON.stringify(artist));\n}", "secondo(){\n localStorage.setItem('points_' + this.props.type + '_3', localStorage.getItem('points_' + this.props.type + '_2'));\n localStorage.setItem('time_' + this.props.type + '_3', localStorage.getItem('time_' + this.props.type + '_2'));\n localStorage.setItem('points_' + this.props.type + '_2', this.props.points);\n localStorage.setItem('time_' + this.props.type + '_2', this.props.time);\n }", "saveToSessionStorage() {\n Object.keys(this).forEach(key =>\n sessionStorage.setItem(key, JSON.stringify(this[key]))\n );\n setTimeout(() => sessionStorage.clear(), 200000);\n }", "function storingBottlesaAndState(){\n\n\t\tvar purchaseDetails = {\n\t\t\t\n\t\t\tbottleTotal: quantitySelected(),\n\t\t\tstateChosen: document.getElementById(\"selectStateOption\").value\n\t\t};\n\t\t\n\t\tvar json = JSON.stringify(purchaseDetails);\n\t\tlocalStorage.setItem(\"purchaseDetails\", json);\n\t} // End localStorage ", "function storeData(key){\n\t\t//if there is no key, this is a brand new item & we need a new key\n\t\tif(!(key)){\n\t\t\tvar id\t\t\t\t= Math.floor(Math.random()*1000000001);\n\t\t}else{\n\t\t\t//set the id to the existing key that we're editing in order to rewrite local storage\n\t\t\tid = key;\n\t\t}\n\t\t\n\t\t//Gather up all our form field values and store them in an object\n\t\t//Object properties contain array with form label and input values\n\n\t\tgetSelectedRadio();\n\t\tvar item\t\t\t= {};\n\t\t\titem.date\t\t= [\"Date: \", $('date').value];\n\t\t\titem.type\t\t= [\"Meal Type: \", $('type').value];\n\t\t\titem.group\t\t= [\"Food Group: \", groupValue];\n\t\t\titem.name\t\t= [\"Food Name: \", $('name').value];\n\t\t\titem.calories\t= [\"Calories: \", $('calories').value];\n\t\t\titem.notes\t\t= [\"Additional Notes: \", $('notes').value];\n\t\t//Save data to local storage\n\t\t\tlocalStorage.setItem(id, JSON.stringify(item));\n\t\t\talert(\"Meal Saved!\");\n\t\t\t\n\t}", "function setStorage(data)\n\t\t \t{\n\t\t \t\tvar data = JSON.stringify(data);\n\t\t \t\t//alert(\"SAVED\");\n\t\t \t\tlocalStorage.setItem('data',data);\n\t\t \t}", "function createSessionStorage() {\r\n // Get previous session storage\r\n var cartContents = JSON.parse(sessionStorage.getItem('cart-contents'));\r\n\r\n // Create empty array if storage is empty\r\n if (cartContents == null) {\r\n cartContents = []\r\n sessionStorage.setItem('cart-contents', JSON.stringify(cartContents));\r\n }\r\n}", "function store() {\n\n \n localStorage.setItem('mem', JSON.stringify(myLibrary));\n \n}", "function saveData() {\n try {\n var s_suite = getSelectedSuite();\n var s_case = getSelectedCase();\n var data = {\n data: storeAllTestSuites()\n };\n browser.storage.local.set(data);\n if (s_suite) {\n setSelectedSuite(s_suite.id);\n }\n if (s_case) {\n setSelectedCase(s_case.id);\n }\n } catch (e) {\n console.log(e);\n }\n backupData();\n}" ]
[ "0.72164243", "0.69078696", "0.69077885", "0.68588465", "0.68042034", "0.67897797", "0.6754741", "0.6673833", "0.6599614", "0.65931696", "0.6576787", "0.6572222", "0.65469", "0.6545906", "0.6539699", "0.6535965", "0.65321773", "0.65283936", "0.6527254", "0.6526677", "0.6500983", "0.64593077", "0.6449452", "0.6445858", "0.6427469", "0.64269197", "0.64137435", "0.64058524", "0.64039814", "0.6403555", "0.6394291", "0.6391029", "0.6384607", "0.6375155", "0.636394", "0.63499445", "0.63477254", "0.63451976", "0.6339204", "0.6325482", "0.6313675", "0.6313675", "0.6308681", "0.62987065", "0.6291957", "0.62851036", "0.6276605", "0.6273224", "0.6266548", "0.6265719", "0.6264028", "0.62625474", "0.6262325", "0.6260769", "0.6252269", "0.62354016", "0.6226807", "0.6226807", "0.62226963", "0.6218062", "0.6212896", "0.6212471", "0.6199805", "0.6198065", "0.6196011", "0.6195398", "0.6181059", "0.6179182", "0.61648655", "0.61616576", "0.6156668", "0.6155157", "0.61546594", "0.61538094", "0.614954", "0.6134483", "0.6131853", "0.6131853", "0.6131853", "0.6131452", "0.61313397", "0.6129377", "0.61291486", "0.61267316", "0.6125363", "0.6122616", "0.61224884", "0.61205715", "0.6119269", "0.61133236", "0.6109012", "0.6104786", "0.61036474", "0.6100804", "0.6095941", "0.60927737", "0.60923576", "0.6088626", "0.60782814", "0.60752136" ]
0.68700665
3
Get last user input, called when we start the script
function getCurrent() { let store = browser.storage.local.get({ currentData: { regexInput: "", templateInput: "", globalCheckbox: false, caseInsensitiveCheckbox: false, multilineCheckbox: false, IgnoreHTMLCheckbox: false, resultTextarea: "", selectedItemIndex:-1, smallForm: false, }, highlightColor: "yellow", highlightBorderColor: "magenta" }); store.then(function(results) { regexInput.value = results.currentData.regexInput; templateInput.value = results.currentData.templateInput; globalCheckbox.checked = results.currentData.globalCheckbox; caseInsensitiveCheckbox.checked = results.currentData.caseInsensitiveCheckbox; multilineCheckbox.checked = results.currentData.multilineCheckbox; IgnoreHTMLCheckbox.checked = results.currentData.IgnoreHTMLCheckbox; resultTextarea.value = results.currentData.resultTextarea; selectedItemIndex = results.currentData.selectedItemIndex; highlightColor = results.highlightColor; highlightBorderColor= results.highlightBorderColor, smallFormCheckbox.checked = results.currentData.smallForm; smallFormCheckboxChange("") updateSaveModal(); }, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setLastUserInput(state, log) {\n state.lastUserInput = log;\n }", "function readCommandLine() {\n var userInput = commandLine.value;\n return userInput;\n }", "function getCommandInput() {\n prompt.get(['command'], function (err, input) {\n if (err) {\n console.log(err);\n return 1;\n }\n\n console.log();\n processCmd(input.command);\n });\n }", "function getUserInput(){\r\n return readlineSync.question(\"Enter a string: \");\r\n}", "function getUserInput(){\r\n return readlineSync.question(\"Enter a string: \");\r\n}", "function retrieveInput() {\n prompt.start();\n\n prompt.get('CourseID', (err, result) => {\n if (err) {\n console.log('\\n\\nERROR: ', err.message);\n return;\n } else if (!parseInt(result.CourseID, 10)) {\n console.log('\\nERROR: Invalid input.');\n return;\n }\n\n checkFolders();\n runTool(result.CourseID);\n });\n}", "function LastName(){\n var name = prompt(\"Enter your last name?\")\n return name\n }", "getUserInput() {\n return null;\n }", "function getuserchoice(){\n var choice = readline.question('Choice: ');\n console.log('You have chosen option: ' + choice);\n return choice;\n}", "function readInput() {\n read({ prompt: '>' }, function (err, input) {\n if (err) {\n console.error(err);\n process.exit(1);\n }\n\n input = input.trim();\n\n if (input) {\n // support exit command for cli\n if (input.toLowerCase() === 'exit') {\n process.exit();\n }\n\n console.log(command.execute(input, 'cli', false));\n }\n\n readInput();\n });\n}", "get mostRecentInput() {\n return this._mostRecent;\n }", "function getuserselection(){\n var selection = readline.question('Choice: ');\n console.log('You have chosen option: ' + selection);\n return selection;\n}", "function getUseInput(callback) {\n var position = inputHistory.length,\n handler = function(e) {\n if (e.keyCode === 13) {\n $('body').unbind('keyup', handler);\n data = $('.userEntry').val();\n createNewLine(data);\n callback(data);\n \n //keep track of user input History\n if(inputHistory.length < maxHistory){\n inputHistory.push(data);\n } else {\n inputHistory.splice(0,1);\n inputHistory.push(data);\n }\n }\n \n //up arrow shows command line history towards past\n if(e.keyCode === 38){\n position--;\n if(position < 0){\n position = inputHistory.length - 1;\n }\n $('.userEntry').val(inputHistory[position]).keydown();\n }\n \n //down arrow shows command line history towards current\n if(e.keyCode === 40){\n position++;\n if(position > inputHistory.length - 1){\n position = 0;\n }\n $('.userEntry').val(inputHistory[position]).keydown();\n }\n };\n \n $('body').on('keyup', '.userEntry', handler);\n }", "lastNameInput()\n {\n let updatedLastName\n console.log(\"Enter your last name to upadate\")\n let uLastName=input.question()\n obPerson.setLastName(uLastName)\n updatedLastName=obPerson.getLastName()\n return updatedLastName\n\n }", "function getCommandInput()\n {\n var lastLine = $(_consoleSelector).val().split('\\n')[$(_consoleSelector).val().split('\\n').length-1];\n var lastLineSplit = lastLine.split(_promptSymbol);\n var command = \"\";\n var i; \n\n for(i =1; i < lastLineSplit.length; i ++)\n {\n command = command + \" \" + (i >= 2? _promptSymbol : \"\") + lastLineSplit[i]; \n }\n \n return command;\n }", "function Getstats()\n{\n if (input==0)\n {\n readline.question(\"\\n\\nPlease tell me your name. \", playername =>\n {\n console.log(\"\\nYou have chosen the name: %s. \", playername);\n playernamesw = 1;\n holdname = playername;\n health=100;\n mana=50;\n gold=10;\n playerlvl = 1;\n playerloc = [0, 0, 0];\n savedatasw = 1;\n input = 1;\n Save();\n Graphic2();\n Map();\n Hud();\n Commands();\n });\n }\n}", "function getUserName() {\n userName = prompt('Identify yourself user.');\n}", "function window_prompt(){\n if (window.stdin.length>0) {\n var str = window.stdin\n window.stdin = \"\"\n console.log(\"PROMPT[\"+str+\"]\")\n return str\n }\n return null\n}", "function initialPrompt() {\n //console.log(\"Let's play some scrabble! Enter a word:\");\n let userWord = input.question(\"Let's play some scrabble! Enter a word: \");\n\n return userWord;\n \n}", "function userInput() {\n debugger;\n userChoice = process.argv[2];\n userSearch = process.argv.splice(3).join(\" \");\n\n if (userChoice === undefined) {\n toDo();\n } else {\n checkingToDo();\n }\n}", "function initialPrompt(data) {\n wordTobeScored = input.question(\"Let's play some scrabble! Enter a word:\");\n //console.log(oldScrabbleScorer(wordTobeScored));\n return wordTobeScored;\n\n}", "function inputfunction(){\n var input=prompt(\"what is ur name\");\n return input;\n}", "function initialPrompt() {\n console.log(\"\\nLet's play some Scrabble!\");\n word = input.question(\"Enter a word to score:\");\n return word\n}", "function getUserInput() {\n const userInput = process.argv;\n var err = '';\n// handeling errors with switch and case\n switch (userInput.length) {\n case 4: return { user: userInput[2], repo: userInput[3]};\n break;\n default: err = 'Unknown user input - ';\n }\n console.log(err,'Please provide *ONLY* a username and repository:');\n console.log('node download_avatars.js <userName> <repositoryName>');\n process.exit();\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n return input.question(\"Enter a word to score:\");\n }", "get userInput() {\n return this._user;\n }", "function given_answer() {\n return userInput.value;\n}", "getUser(input) {\n let inputArray = input.split(' ');\n\n return inputArray[inputArray.length - 2];\n }", "function backupInput() {\n lastInput = ELEMENTS.UPDATE_TEXTAREA.val();\n }", "function name(){\n var name = prompt(\"Enter your name?\")\n console.log(name)\n}", "function getInput(){\n return prompt(\"Enter your score:\");\n}", "function runProgram(){\n\n userWord=initialPrompt();\n\n\n\n transformStyle=scoreStylePrompt();\n\n console.log(userWord);\n console.log(transformStyle);\n \n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble! \");\n\n let wordToScore = input.question(\"Enter a word to score:\");\n\n return wordToScore;\n}", "function captureInput() {\n query = inputField.val();\n requestAPI();\n }", "function initialPrompt() {\n // let enterWord = \"\";\n enterWord = input.question(\"Let's play some scrabble!\\nEnter a word to score: \"); //used the input syntax to ask a question \n\n // console.log(oldScrabbleScorer.enterWord); //for testing\n // console.log(oldScrabbleScorer(enterWord));\n return enterWord;\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n\n wordEntered = input.question(\"Enter a word to score: \");\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n return input.question(\"Enter a word to score: \"); \n}", "function initialPrompt() {\n let word = input.question(\"Let's play some scrabble! \\n \\n Enter a word to score:\");\n // console.log(oldScrabbleScorer(word)\n return word\n}", "function prompt() {\n console.log(\"Enter input as either:\");\n console.log(\"> 'timeout' [name] [seconds]\");\n console.log(\"> 'ban' [name]\");\n console.log(\"> 'remove' [name]\");\n console.log(\"> 'list'\")\n}", "function UserInput(callback) {\n var name = prompt('Please enter your name.');\n callback(name);\n}", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\");\n let word=input.question(\"\\nEnter a word to score:\");\n\n \n return word\n}", "function initialPrompt() {\n console.clear()\n let returnedWord =input.question(\"Let's play some scrabble! Enter a word:\");\n return (returnedWord)\n}", "function initialPrompt() {\n let userInput = null;\n let boolean = false;\n while (boolean == false) {\n userInput = input.question(\"Let's play some scrabble! \\nEnter a word to score: \");\n boolean = validateInput(userInput);\n }\n return userInput;\n}", "function promptThem() {\n\tvar userResponse = prompt(\"Type something:\");\n}", "function numberGet () {\n\tvar initialTemp = userInput.value;\n\treturn initialTemp;\n}", "function initialPrompt() {\n let word = input.question(\"\\nLet's play some scrabble! Enter a word: \");\n //console.log(oldScrabbleScorer(word));\n return word; //Pass word to next.\n}", "function shellWhereAmI(args)\n{\n _StdIn.putText(_UserLocation); \n}", "function lastSearch () {\n localStorage.setItem('lastSearch', userLocQuery.innerText); // Save user input in localStorage\n}", "function loadLastRun() {\n\t\treturn JSON.parse(localStorage.getItem(sLastKey) || \"{}\");\n\t}", "function getUserInput() {\n return inquirer.prompt([\n {\n type: \"input\",\n name: \"name\",\n message: \"Your name:\"\n },\n {\n type: \"input\",\n name: \"githubUsername\",\n message: \"Your GitHub username:\"\n },\n {\n type: \"input\",\n name: \"githubURL\",\n message: \"Your GitHub profile url:\"\n },\n {\n type: \"input\",\n name: \"email\",\n message: \"Your email address:\"\n },\n {\n type: \"input\",\n name: \"title\",\n message: \"Project title:\"\n },\n {\n type: \"input\",\n name: \"description\",\n message: \"Project description:\"\n },\n {\n type: \"input\",\n name: \"installation\",\n message: \"Project installation information:\"\n },\n {\n type: \"input\",\n name: \"usage\",\n message: \"Project usage information:\"\n },\n {\n type: \"list\",\n name: \"license\",\n message: \"Project license:\",\n choices: [\"MIT\", \"GNU_GPLv3\", \"Apache\", \"BSD_3clause\", \"ISC\", \"Artistic\", \"GNU_LGPLv3\", \"Unlicense\"]\n },\n {\n type: \"input\",\n name: \"contributing\",\n message: \"Information about contributing to this project:\"\n },\n {\n type: \"input\",\n name: \"tests\",\n message: \"Information about testing for this project:\"\n }\n ]);\n}", "function getInput(){\n prompt.get(['Organization'], function(err, result) {\n if(err) { return onErr(err); }\n var inputStream = result.Organization\n console.log('Input Stream: ' + inputStream);\n\n var input = inputStream.split('^');\n\n clearAll();\n\n console.log('Partner Name:' + input[4]);\n\n recordUser(inputStream);\n\n selectField(\"Partner Name\", input[4]);\n getInput();\n });\n}", "function _gettingInput(callback){\n\tvar time = {};\n\tprompt.start();\n\tprompt.addProperties(time, ['year', 'month', 'date'], function(err, rst){\n\t\tconsole.log('our year and month is now set as: ');\n\t\tconsole.log(' year: ' + rst.year);\n\t\tconsole.log(' month: ' + rst.month);\n\t\tconsole.log(' date: ' + rst.date)\n\t\tconsole.dir(time)\n\t\tlower = moment.utc(moment(new Date(time.year, parseInt(time.month) - 1, parseInt(time.date)))).valueOf();\n\t\tupper = moment.utc(moment(new Date(time.year, parseInt(time.month) - 1, parseInt(time.date) + 1))).valueOf();\n\t\tcallback(null);\n\t})\n}", "function listenForUserInput() {\n rl.question(\"Where to? \", function(input) {\n if (input !== null) {\n if (input === `new` ) newBookSearch();\n if (input === `list` ) readingListView();\n if (input === `main` ) mainMenu();\n if (input === `q` ) {\n console.log(\"\\nAdios!\\n\");\n process.exit();\n }\n let arr = ['new','list','main','q'];\n if (!arr.includes(input)) {\n console.log(`\\nNot an accepted directory key. Please try again.\\n`);\n listenForUserInput();\n } \n }\n });\n}", "getUserInput(options, withBackChoice = false) {\n return __awaiter(this, void 0, void 0, function* () {\n if (options.choices) {\n if (options.choices.length < 2) {\n // single choice to return:\n let choice = options.choices[0];\n choice = choice.value || choice;\n this.logAutoSelected(options, choice);\n return choice;\n }\n if (withBackChoice) {\n options.choices.push(TaskRunner_1.WIZARD_BACK_OPTION);\n }\n options.choices = this.addSeparators(options.choices);\n }\n const userInput = yield inquirer.prompt(options);\n const result = userInput[options.name];\n // post to GA everything but 'Back' user choice\n if (!withBackChoice || result !== TaskRunner_1.WIZARD_BACK_OPTION) {\n util_1.GoogleAnalytics.post({\n t: \"event\",\n ec: \"$ig wizard\",\n el: options.message,\n ea: `${options.name}: ${result}`\n });\n }\n else {\n util_1.GoogleAnalytics.post({\n t: \"event\",\n ec: \"$ig wizard\",\n el: result,\n ea: `Back from ${options.name}`\n });\n }\n return result;\n });\n }", "function lastQuestion(){\n inquirer.prompt([\n {\n type: \"list\",\n name: \"reply\",\n message: \"Would you like to Select another Action?\",\n choices: [\"Yes\", \"No\"]\n }\n ]).then(function(answer){\n if (answer.reply === \"Yes\"){\n getAllStations();\n } else {\n connection.end();\n }\n });\n}", "function getUserInput(){\n alert(input.value);\n}", "function getInput(promptString){\r\n\t//If the player looks up gold or inventory info, loop back and wait for desired input\r\n\twhile(true){\r\n\t\tvar input = prompt(promptString);\r\n\t\t\r\n\t\tif (input == 'Gold'){\r\n\t\t\tinfoPrompt('You have ' + gold + ' gold.');\r\n\t\t\r\n\t\t} else if (input == 'View Inventory'){\r\n\t\t\tinfoPrompt('You currently have ' + inventory + ' in your inventory.');\r\n\t\t\r\n\t\t} else if (input == 'Cheat'){\r\n\t\t\tcheat();\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\treturn input;\r\n\t\t}\r\n\t}\r\n\r\n}", "function getUserChoice () {\n var userChoice = document.getElementById(\"userInput\").value;\n alert(userChoice) //-> This confirmed that our user's input was store successfully to the variable userChoice by displaying input within browser window\n return userChoice;\n}", "function getInput(prompt) {\n return readlineSync.question(`${prompt}: `);\n}", "function getName() {\n var person = prompt(\"Enter your name\");\n return person;\n}", "function getName() {\n var person = prompt(\"Enter your name\");\n return person;\n}", "function initialPrompt() {\n word=input.question(\"Let's play some scrabble! Enter a word to score:\");\n}", "function getInput() {\n console.log(\"Please choose either 'rock', 'paper', or 'scissors'.\");\n return prompt();\n}", "function getInput() {\n console.log(\"Please choose either 'rock', 'paper', or 'scissors'.\");\n return prompt();\n}", "function userinput() {\n const questions = [\n {\n name: \"title\",\n type: \"input\",\n message: \"Please enter the title of your README\",\n },\n {\n name: \"description\",\n type: \"input\",\n message: \"Please enter a description for your README\",\n },\n \n {\n name: \"installation\",\n type: \"input\",\n message: \"Please enter a method of installation\",\n },\n {\n name: \"usage\",\n type: \"input\",\n message: \"Please specify usage\",\n },\n {\n name: \"license\",\n type: \"list\",\n message: \"Please enter license\",\n choices: [\"ISC\", \"MIT\"],\n },\n {\n name: \"contributing\",\n type: \"input\",\n message: \"Please enter contributing members\",\n },\n {\n name: \"tests\",\n type: \"input\",\n message: \"Please enter tests\",\n },\n {\n name: \"questions\",\n type: \"input\",\n message: \"Please enter questions\",\n },\n {\n name: \"githuburl\",\n type: \"input\",\n message: \"Please enter github username\",\n },\n {\n name: \"email\",\n type: \"input\",\n message: \"Please enter email\",\n },\n ];\n return inquirer.prompt(questions);\n }", "function initialPrompt() {\n console.log(\"Let's play some scrabble!\\n\");\n let userWord = input.question(\"Enter a word to score: \");\n return userWord.toLowerCase();\n}", "function shellWhoAmI(args)\n{\n _StdIn.putText(_UserName); \n}", "function askName() {\n var userName = prompt(\"Enter name\");\n}", "function Edit_GetUserInputChanges()\n{\n\t//default result\n\tvar result = null;\n\t//we have input\n\tif (this.InterpreterObject.HasUserInput)\n\t{\n\t\t//get it\n\t\tresult = new Array({ Property: __NEMESIS_PROPERTY_CAPTION, Value: this.value });\n\t}\n\t//return the result\n\treturn result;\n}", "function setUserInput (input) {\n user_input = input;\n }", "function readCommander(){\n\tstdin.pause();\n\tconsole.log(\"\");\n\t\t\n\tstdout.write(\"Eenter your commander:\");\n\tvar input_data = fs.readSync( stdin.fd, 1000, 0, \"utf8\");\n\tstdin.resume();\n\tvar commander = input_data[0].trim();\n\treturn commander;\n}", "function getInput() {\n let inArg = process.argv.slice(2);\n if (inArg.length != 1) {\n console.log(\"invalid number of arguments passed\");\n process.exit(2);\n }\n console.log(\"initial: \" + inArg[0]);\n charArr = inArg[0].split('');\n return charArr;\n \n}", "function getInput() {\n const input = process.argv.slice(2).sort((a,b) => {\n if(a[0] !== '-') return -1;\n if(b[0] !== '-') return 1;\n });\n return { input, command: input.shift() };\n}", "function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){\n my.html.input.value = inputText.substring(0, goodChars)\n updatePracticePane()\n } else if (inputCommandIs('qtpi')) {\n qtpi()\n }\n }", "function readInput() {\r\n\r\n let userStation = document.forms.search.station.value\r\n let userUntilDeparture = 0\r\n userUntilDeparture = document.forms.search.untilDeparture.value\r\n\r\n console.log(userStation)\r\n \r\n handleInput(userStation, userUntilDeparture)\r\n}", "function prompt() {\n rl.question(\"User>\", processCommand);\n}", "function saveInitialAndScore(){\n var userInput = document.getElementById(\"finalInput\").value;\n console.log(userInput);\n var lineInHistory = $(`<li><h4 class=\"string-in-history\"><span>${userInput}</span>&nbsp<span>${seconds}</span></h4></li>`);\n $(\"#historyList\").append(lineInHistory);\n // cleaningInputgroup();\n jumpToHistory(); \n }", "function getName() {\n\n\t\t$(\".submitBtn\").off();\n\t\t$(\"#initialsModal\").modal('show');\n\t\tsounds.woosh();\n\n\t\tsetTimeout(function() { \n\n\t\t\t$(\"#initial-input\").focus() ;\n\n\t\t}, 500);\n\n\t\t$(\"#initial-input\").keydown(function(event) {\n\n\t\t\tif (event.keyCode === 13) {\n\n\t\t\t\t$(\".saver\").click();\n\n\t\t\t}\n\n\t\t});\n\n\t\t$(\"#initial-input\").keydown(function(event) {\n\n\t\t\tif(event.keyCode == 16) {\n\n\t\t\t\treturn;\n\n\t\t\t}\n\n\t\t\tsounds.click();\n\n\t\t});\n\n\t\t$(\".saver\").click(sounds.scoreGong).click(logScore);\n\t\t$(\".submitBtn\").text(\"FINAL SCORE : \" + finalScore + \"% CLICK TO RETRY\").click(sounds.click).click(newGame);\n\n\t}", "function userName() {\r\n var name = prompt('What is your name?');\r\n\r\n alert('Hello ' + name + '! Welcome to my bio! How about a quiz?'); //returns greeting to user\r\n console.log('Your name is ' + name + '.');\r\n //beginning of the score keeping tally to be calculated at the end of the ?s\r\n var finalScore = 0;\r\n return name;\r\n}", "function prompt() {\n cli.rl.prompt();\n}", "function get_name(){\r\n name = prompt(\"Hello! Please enter your name.\"); // added new prompt for users to add their name.\r\n alert(name + \", welcome to Battleship game.\"); // added new alert greeting.\r\n return name;\r\n}", "function init() {\n promptUser();\n}", "function input(){\n\n serviceKeyPath = readline.question(\"Input Service key's absolute path : \");\n // db_list = readline.question(\"Input database list path : (bluelens-browser/db_list) \");\n // if(db_list.length == 0 ){db_list = \"bluelens-browser/db_list\";}\n var info = {'serviceKeyPath': serviceKeyPath, 'topPath' : process.cwd()};\n if(fs.existsSync(infoPath)===false){fs.mkdirSync(infoPath)};\n fs.writeFile(infoPath+\"blu-info.json\", JSON.stringify(info), function(err) {\n if(err) {\n return console.log(err);\n }\n console.log(\"save blu-info.json finish in ~/.blu directory\");\n process.exit(0);\n });\n}", "function getValueofInput () {\n\tif (username) {\n\tconsole.log(username.value);\n\t}\n}", "function userCity(callback){\n prompt.get(\"Enter your current city\", function(err, userInput){\n if(err){\n \n }\n else{\n var city = userInput[\"Enter your current city\"];\n callback(null, city);\n }\n });\n}", "function getUserName(){\n let userName = null;\n do {\n userName = prompt('What is your name?');\n console.log('User entered: ' + userName + ' for name.');\n if (userName) {break;}\n alert('Please enter a name!');\n } while (userName === null || userName === '');\n return userName;\n}", "function lastInteract() {\n var now = new Date().getTime();\n $(\"body\").data(\"lastInteract\", now); \n}", "function secondPrompt() {\r\n let inputToScore = input.question(\"\\nEnter a word to be scored, or 'Stop' to quit: \");\r\n return inputToScore.toLowerCase();\r\n}", "function populateMainSearch() {\n let lastSearch = user.lastRecipeSearched;\n mainSrchInput.val(lastSearch);\n return lastSearch;\n}", "get input() {\n\t\treturn this.__input;\n\t}", "function init() {\n const userResponse = promptUser();\n}", "function getPrompt() {\n rl.question('word ', (answer) => {\n console.log(pigLatin(answer));\n getPrompt();\n });\n}", "function init() {\n userPrompt();\n}", "function collectData(data) {\n var answer = prompt('what is your ' + data + '?');\n console.log(data + ' is ' + answer);\n return answer;\n}", "function promptUser()\n{\n return readline.question(\"Please enter the valid number of player (1-52)\");\n}", "function lastSearchedStr() {\n return localStorage[\"last_searched_str\"];\n}", "firstNameInput()\n {\n let updatedName, uname\n console.log(\"Enter name to update\")\n uname=input.question()\n obPerson.setName(uname)\n updatedName=obPerson.getName()\n return updatedName\n }", "function Commands()\n{\n input = 0;\n if (input != 2)\n {\n readline.question(\"Enter Command: \", input =>\n {\n if (input == save)\n {\n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n Save();\n input = 0;\n Map();\n Hud();\n console.log(\"\\n\\nGame saved.\\n\\n\");\n Commands();\n return;\n }\n \n if (input == load)\n {\n Load();\n input = 0;\n Map();\n Hud();\n console.log(\"\\n\\nGame loaded.\\n\\n\");\n Commands();\n\n return;\n }\n\n if (input == exit)\n {\n \n playerinfo.playername=playername;\n playerinfo.playerlvl=playerlvl;\n playerinfo.health=health;\n playerinfo.mana=mana;\n playerinfo.gold=gold;\n playerinfo.savecoord=savecoord;\n playerinfo.savedatasw=savedatasw;\n Save();\n console.log(\"\\n\\nGame saved. Exiting.\\n\\n\");\n process.exit();\n }\n\n else \n {\n Map();\n Hud();\n console.log(Red,\"You have entered an incorrect command. Please try again.\", Reset);\n Commands();\n }\n \n return;\n });\n return;\n };\n}", "function initialPrompt() {\n word = input.question(\"\\nLet's play some scrabble! Enter a word: \");\n\n word = word.toLowerCase();\n\n return word;\n}", "function saludoInteractivo(){\n var nombre = prompt(\"Ingrese su nombre\");\n console.log(\"Hola \"+nombre)\n}", "function getGuess() {\n \"use strict\";\n return prompt('Guess a letter, or click Cancel to stop playing.');\n}" ]
[ "0.67734796", "0.6524693", "0.6403255", "0.6395485", "0.6395485", "0.6227213", "0.6221293", "0.61659324", "0.6143708", "0.61336666", "0.60619575", "0.6057589", "0.6013684", "0.5946944", "0.59444785", "0.5932793", "0.5904025", "0.5903121", "0.58831954", "0.5877108", "0.5867934", "0.5821375", "0.58204806", "0.57792777", "0.57763875", "0.5767368", "0.5755173", "0.5745242", "0.5738815", "0.5720441", "0.5714318", "0.57004845", "0.5689426", "0.567582", "0.56707513", "0.56704956", "0.5662249", "0.56480277", "0.5645531", "0.564041", "0.56234586", "0.5621776", "0.5619953", "0.5608491", "0.559847", "0.5592828", "0.5582086", "0.55527526", "0.55500084", "0.5540227", "0.5538698", "0.5537078", "0.5524439", "0.55186546", "0.55062455", "0.5498592", "0.54871744", "0.5486485", "0.5485012", "0.54745114", "0.54745114", "0.5470395", "0.5464021", "0.5464021", "0.5460972", "0.54597664", "0.5454127", "0.5424298", "0.541767", "0.54012364", "0.5386199", "0.53804636", "0.537992", "0.53773105", "0.5371807", "0.5369028", "0.5368731", "0.5362383", "0.5327293", "0.5326425", "0.5322996", "0.5320738", "0.53207093", "0.5317929", "0.53130174", "0.53088266", "0.5292325", "0.5283437", "0.52763027", "0.52746934", "0.52743965", "0.5265664", "0.5259858", "0.5259831", "0.52525485", "0.5248934", "0.52466005", "0.52256113", "0.5210086", "0.52014846", "0.519942" ]
0.0
-1
add profile to the storage then update the profiles in the list
function addProfile(profile) { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; profiles.push(profile); let store = browser.storage.local.set({ profiles }); store.then(null, onError); displayProfiles(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static addProfileToStorage(profile) {\n let profiles;\n // When first profile is added or if there is no profiles key in local storage, assign empty array to profiles\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n // Get the existing profiles to the array\n profiles = JSON.parse(localStorage.getItem('profiles'));\n }\n // Adding new profile\n profiles.push(profile);\n console.log(profiles)\n localStorage.setItem('profiles', JSON.stringify(profiles));\n }", "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "updateProfile() {}", "set profile(value) {\n if (value) {\n this.set(PROFILE_STORAGE_KEY, JSON.stringify(value));\n } else {\n this.remove(PROFILE_STORAGE_KEY);\n }\n }", "function updateStorageData() {\n //Update total accumulated time on FB\n chrome.storage.local.get('totalTimeOnFB', results => {\n totalTimeOnFB = results.totalTimeOnFB + timeOnFB;\n chrome.storage.local.set({'totalTimeOnFB': totalTimeOnFB}, ()=>{\n \ttimeOnFB = 0;\n });\n });\n\n //Only update record in profile if last visited profile is not empty/undefined\n if(lastVisitedProfile.profileName != \"\" && lastVisitedProfile.profileName != undefined){\n updateRecord().then(()=>{\n \tchrome.storage.local.set({'records': records});\n });\n }\n}", "function updateProfile(info) {\n setProfile(info);\n }", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "function addProfileClicked ()\n{\n\tif(!project.STAProfiles){\n\t\tproject.STAProfiles=[];\n\t}\n\t//get data and add to json\n\tproject.STAProfiles.push(\n\t\t{\n\t\t\t'id':makeid(),\n\t\t\t'SSID':$('#SSIDText').val(),\n\t\t\t'SecurityKey':$('#SecurityText').val(),\n\t\t\t'SecurityType':$('#SecurityTypeSelect').val(),\n\t\t\t'ProfilePriority':$('#ProfilePriorityText').val()\n\t\t}\n\t);\n\t//reload the list\n\tloadDeviceRoleSettingsSTA();\n\t//save project\n\tsaveProjectAPI();\n}", "function addProfileToAList(profile) {\r\n var listItem = document.createElement(\"li\");\r\n listItem.innerHTML = '<a href=\"#\" class=\"profile\" storageID=\"' + profile.id + '\">' + profile.name + '</a>';\r\n profilesList.appendChild(listItem);\r\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "function saveProfile(profile) {\n }", "static setProfile(profileJSON) {\n // console.log(\"setProfile(profileJSON) -> profileJSON\", profileJSON);\n return store.save('CURRENT_PROFILE', profileJSON);\n }", "function update() {\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = $rootScope.account.profile;\n\n // NEW USER ACTION\n if (profile.newUser) {\n instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED);\n profile.newUser = false;\n }\n\n // UPDATE\n $rootScope.db.users.child(uid).update(profile);\n\n // NOTIFY\n BroadcastService.send(EVENTS.PROFILE_UPDATED, profile);\n }", "async function handleAddProfile(newProfileData) {\n const newProfile = await profileService.create(newProfileData);\n console.log(newProfile)\n history.push(\"/\");\n }", "function addProfiles(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Profiles.collection.insert(data);\n}", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function addProfiles(data) {\n console.log(` Adding: Profile ${data.firstName} for (${data.owner})`);\n Profiles.collection.insert(data);\n}", "static updateProfile(updateJSON) {\n // console.log(\"updateProfile(updateJSON) -> updateJSON\", updateJSON);\n return Store.getProfile()\n .then((currentJSON) => {\n for (var attr in updateJSON) {\n currentJSON[attr] = updateJSON[attr];\n }\n // console.log(\"updateProfile(updateJSON) -> currentJSON\", currentJSON);\n return store.save('CURRENT_PROFILE', currentJSON);\n });\n }", "function addNewProfile () {\n if (profileToAdd.direction === GAME_DIRECTION.LTR) {\n profileToAdd.x = - profileToAdd.width;\n }\n else {\n profileToAdd.x = this._width + profileToAdd.width;\n }\n\n profileToAdd.y = Math.round(Math.random() * this._height * 0.8);\n this._profiles.push(profileToAdd);\n }", "function setData(profile){\n \tgameData.data.player.profile.name = profile.name;\n \tgameData.data.player.profile.surname = profile.surname;\n \tgameData.data.player.profile.age = profile.age;\n \tgameData.data.player.profile.sex = profile.sex; \t\n \tgameData.data.player.profile.mobile = profile.mobile;\n \tgameData.saveLocal();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setData\");\n \tsetDataFromLocalStorage(); \t\n }", "submit(data) {\n if (Profiles.find().count() === 0) {\n this.createProfile(data);\n } else {\n this.updateProfile(data);\n }\n }", "static addServiceToFavourites(agent, service){\n let settings = JSON.parse(localStorage.getItem('userPreferences'));\n let newFav = {agent:agent, service:service};\n \n if (settings === null || settings === undefined) {\n this.initUeserPreferences();\n let initialized = JSON.parse(localStorage.getItem('userPreferences'));\n let updated = [];\n updated.push(newFav);\n initialized.favourites = updated;\n this.updateUserSettings(initialized)\n }\n else{\n if (this.containsObject(newFav, settings.favourites)) {\n return;\n }\n let readed = JSON.parse(localStorage.getItem('userPreferences')); \n let updated = readed.favourites\n updated.push(newFav);\n readed.favourites = updated;\n this.updateUserSettings(readed);\n }\n}", "function updateProfile (profileId, profile, db = connection) {\n return db('profiles')\n .where('id', profileId)\n .update({\n name: profile.name,\n description: profile.description\n })\n}", "function update(property, value, account) {\r\n const ctx = SP.ClientContext.get_current();\r\n\r\n SP.SOD.executeFunc('userprofile', 'SP.UserProfiles.PeopleManager', function() {\r\n const peopleManager = new SP.UserProfiles.PeopleManager(ctx);\r\n // save the value to the profile property as a compressed UTF16 string to keep within the 3600 character limit for user profile properties\r\n peopleManager.setSingleValueProfileProperty('i:0#.f|membership|' + account, property, Compression.compressToUTF16(JSON.stringify(value)));\r\n\r\n ctx.executeQueryAsync(\r\n function() {},\r\n function(sender, args) {\r\n console.log('Goldfish.Profile.Update Error while trying to save to the folowing profile property: ' + property + '. The error details are as follows: ' + args.get_message());\r\n }\r\n );\r\n });\r\n}", "storeData({ profile, attestations }) {\n const key = `${this.props.walletProxy}-profile-data`\n const data = localStore.get(key)\n\n if (hasDataExpired(data)) {\n return localStore.set(key, {\n timestamp: Date.now(),\n profile,\n attestations\n })\n }\n\n // Merge with old data and a new timestamp\n const newData = {\n ...data,\n timestamp: Date.now()\n }\n\n if (profile) {\n newData.profile = {\n ...data.profile,\n ...profile\n }\n }\n\n if (attestations) {\n newData.attestations = [\n ...(data.attestations || []),\n ...(attestations || [])\n ]\n }\n\n localStore.set(key, newData)\n }", "function add_user() {\n\tif (typeof(Storage) !== \"undefined\") {\n\t\t// get info from html and make profile object\n\t\tvar profile = {\n\t\t\tname: $(\"#firstname\")[0].value + \" \" +\n\t\t\t $(\"#middlename\")[0].value + \" \" + \n\t\t\t $(\"#lastname\")[0].value, \n\t\t\tbday: $(\"#birth\")[0].value,\n\t\t\tinterests: []\n\t\t};\n\t\t// update local storage\n\t\tlocalStorage.setItem(\"profile\", JSON.stringify(profile));\n\t}\n\telse {\n\t\tconsole.log(\"Local Storage Unsupported\")\n\t}\n\n}", "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "function saveUserProfile(userProfile) {\r\n\t \tself._userProfile = userProfile;\r\n\t \tlocalStorage.setItem('userProfile', JSON.stringify(userProfile));\r\n\t }", "static removeFromLocalStorage(id) {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach((profile, index) => {\n\n // console.log('profile -id:', typeof profile.id, 'current-id:', typeof id)\n if (profile.id === id) {\n profiles.splice(index, 1);\n }\n });\n localStorage.setItem('profiles', JSON.stringify(profiles));\n }", "function updateProfile(profile) {\n checkUser();\n UserId = userId;\n $.ajax({\n method: \"PUT\",\n url: \"/api/profile_data\",\n data: profile\n })\n .then(function () {\n window.location.href = \"/members\";\n });\n }", "async store({ request, response }) {\n\n /**\n * Create/save a new profile.\n */\n\n var dados = {}\n\n dados.rules = {\n user: {\n create: false,\n update: false,\n read: false,\n delete: false\n },\n person: {\n create: false,\n update: false,\n read: false,\n delete: false\n },\n arma: {\n create: false,\n update: false,\n read: false,\n delete: false\n },\n vehicle: {\n create: false,\n update: false,\n read: false,\n delete: false\n },\n profile: {\n create: false,\n update: false,\n read: false,\n delete: false\n }\n }\n\n const userId = request.body.userId\n\n const dadosReq = request.only(['profile', 'unidade', 'carteira', 'rules', 'restritivo', 'posicional'])\n\n _.merge(dados, dadosReq)\n\n const user = await User.find(userId)\n\n const profile = await Profile.findOrCreate(dados)\n\n await user.profile().attach(profile.id)\n\n profile.user = await profile.users().fetch()\n\n return (\n\n response.status(200),\n Message.messageOk('Profile cadastrado com sucesso')\n\n )\n\n }", "function create(){\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = instance.extract($rootScope.account.authData);\n\n // INITIALIZE\n $rootScope.db.users.child(uid).set(profile);\n $rootScope.account.profile = profile;\n }", "function updateProfile(webid, prefURI, account, dom) {\n if (dom) {\n var d = document.querySelector(\"webid-signup\");\n d.appendElement(d.$.profilestatus, '<p>Updating WebID profile...<core-icon id=\"profdone\" icon=\"done\" class=\"greencolor\" hidden></core-icon></p>');\n }\n\n var g = new $rdf.graph();\n var kb = new $rdf.graph();\n var f = new $rdf.fetcher(kb, TIMEOUT);\n var docURI = webid.slice(0, webid.indexOf('#'));\n\n f.nowOrWhenFetched(docURI,undefined,function(ok, body, xhr) {\n if (ok) {\n var triples = kb.statementsMatching(undefined, undefined, undefined, $rdf.sym(docURI));\n // add existing triples from profile\n triples.forEach(function(st) {\n g.addStatement(st);\n });\n // add link to preference file\n g.add($rdf.sym(webid), WS('preferencesFile'), $rdf.sym(prefURI));\n g.add($rdf.sym(webid), WS('storage'), $rdf.sym(account));\n var s = new $rdf.Serializer(g).toN3(g);\n\n // update profile\n var xhr = new XMLHttpRequest();\n xhr.open(\"PUT\", docURI, true);\n xhr.setRequestHeader(\"Content-Type\", \"text/turtle\");\n xhr.withCredentials = true;\n xhr.send(s);\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState == xhr.DONE) {\n if (xhr.status == 200 || xhr.status == 201) {\n if (dom) {\n d.$.profilestatus.querySelector('#profdone').hidden = false;\n d.$.alldone.hidden = false;\n window.scrollTo(0,document.body.scrollHeight);\n }\n } else {\n console.log(\"Could not write profile file \"+docURI+\" | HTTP status: \"+xhr.status);\n }\n }\n };\n }\n });\n}", "async create(profile) {\n if (!profile.id) profile.id = uniqid__WEBPACK_IMPORTED_MODULE_1___default()();\n profile.createdAt = new Date();\n profile.updatedAt = new Date();\n this.profiles[profile.id] = profile;\n return profile;\n }", "function attachProfileListener(store){\n const profileRef = firebaseApp.database().ref().child('users').child(currentUser().uid)\n\n profileRef.on('value', (snapshot) => {\n store.dispatch( updateProfileSuccess( snapshot.val() ) )\n })\n}", "function buildProfileList(uuid, profiles = {}) {\n const key = `skyblock_profiles:${uuid}`;\n redis.get(key, (err, res) => {\n if (err) {\n return logger.error(`Failed getting profile list hash from redis: ${err}`);\n }\n const p = JSON.parse(res) || {};\n // TODO - Mark old profiles\n const updateQueue = Object.keys(profiles).filter((id) => !(id in p));\n if (updateQueue.length === 0) return;\n async.each(updateQueue, (id, cb) => {\n buildProfile(uuid, id, false, (err, profile) => {\n p[id] = Object.assign(profiles[id], getStats(profile.members[uuid] || {}, profile.members));\n cb();\n });\n }, () => updateProfileList(key, p));\n });\n}", "createProfile (state, { name = 'New profile', host = null }) {\n for (let profile of state) {\n profile.active = false\n }\n\n state.push({\n id: uuid(),\n name,\n host,\n paired: false,\n active: true,\n apps: []\n })\n }", "function save_order_profile(profile_id)\n{\n\tif (profile_id === undefined)\n\t{\n\t\t//Save new \n\t}\n\telse \n\t{\n\t\t//Save into old profile_id\n\n\t}\n}", "function mergeProfile(req,userData){\r\n\r\n var profileSetter = new SetProfile();\r\n var tagGetter = new GetTags();\r\n var tagAdder = new AddNewTagInDB();\r\n\r\n for (key in req) {\r\n if (req[key]!=userData[key]){\r\n //If the the Key is a tag Share or a tag Discover,\r\n if (key == \"tags_share\" || key == \"tags_discover\"){\r\n //!\\\\ tags_share and tags_discover are differenciated by the variable key //!\\\\\r\n console.log(\"The \"+key+\" table will we updated according to this tab: \");\r\n tagsToEdit = tagsEditor(req[key],userData[key]);\r\n for (tag in tagsToEdit){\r\n if ((parseInt(tag)%2)==0){\r\n if (tagsToEdit[parseInt(tag)+1]==\"ADD\"){\r\n //Need to add the tag\r\n //Check if tag is in DB\r\n tagIsInTagsTable = tagGetter.getTagByName(tagsToEdit[tag].toUpperCase());\r\n if (tagIsInTagsTable == undefined){\r\n //if not add it\r\n tagAdder.addNewTagInDB(tagsToEdit[tag]);\r\n //And get its new ID\r\n concernedTag = tagGetter.getTagByName(tagsToEdit[tag]);\r\n //Add the tag in the table:\r\n profileSetter.setTag(userData.id,key,concernedTag.id,\"ADD\");\r\n }else{\r\n concernedTag = tagGetter.getTagInKey(userData.id,tagIsInTagsTable.id,key);\r\n //Add the tag in tag_key:\r\n if (concernedTag == undefined) {\r\n profileSetter.setTag(userData.id, key, tagIsInTagsTable.id, \"ADD\");\r\n } else {\r\n console.log(\"Tag \"+ concernedTag.tag + \" already found in table tags\");\r\n }\r\n }\r\n }else if (tagsToEdit[parseInt(tag)+1]==\"DEL\"){\r\n //Delete a tag\r\n tagToEdit = tagGetter.getTagByName(tagsToEdit[tag]);\r\n profileSetter.setTag(userData.id,key,tagToEdit.id,\"DEL\");\r\n }\r\n }\r\n }\r\n } else {\r\n //Update the user profile's concerned column\r\n console.log(\"USER \"+ userData.id +\" UPDATED \" + key + \" FROM \" + userData[key] + \" TO \" + req[key]);\r\n profileSetter.setProfile(userData.email,key,req[key]);\r\n console.log(\"USER \"+ userData.id +\" UPDATED \" + key + \" FROM \" + userData[key] + \" TO \" + req[key]);\r\n }\r\n }\r\n }\r\n}", "uploadProfileImage(callback=()=>{}) {\n const state = Store.getState().profile;\n if (!state.selectedImage) { callback(); return; }\n const imageFile = Backend.auth.user().email+\"-\"+Date.now()+\".jpg\";\n let previousImageFile = decodeURIComponent(state.image).split(\"/\").pop().split(\"?\").shift();\n Backend.storage.deleteFile(previousImageFile, () => {\n Store.changeProperty(\"profile.image\",Backend.storage.getFileUrl(imageFile));\n Backend.storage.putFile(imageFile,state.selectedImage,() => {\n callback();\n })\n })\n }", "function ProfileStorage(storage) {\n this.storage = storage;\n}", "[LOAD_PROFILE_INFO](context, payload) {\n context.commit(GET_PROFILE_INFO, payload); \n }", "function saveProfileInformation(){\n\tvar name = document.getElementById(\"profileName\").value;\n\tvar age = document.getElementById(\"userAge\").value;\n\tvar phoneNumber = document.getElementById(\"userPhone\").value;\n\tvar mailId = document.getElementById(\"userMail\").value;\n\tvar address = document.getElementById(\"userAddress\").value;\n\tvar profileImg = document.getElementById(\"userImg\").value;\n\tvalidateUserProfile(name, age, phoneNumber, mailId, address, profileImg);\n\tif (profileDataValid) {\n\t\tvar user = new User(name, age, phoneNumber, mailId, address, profileImg);\n\t\tlocalStorage.setItem(\"profileData\", JSON.stringify(user));\n\t}\n\telse{\n\t\talert(\"Error saving Data\");\n\t}\n}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function setProfile() {\n if (profileCheck.checked === true) {\n localStorage.setItem('profileCheck', 'true');\n } else {\n localStorage.setItem('profileCheck', 'false');\n }\n}", "function saveProfile(email, name, password, weight, height,gender,planName,bicepWorkout,tricepWorkout,chestWorkout,lBackWorkout,uBackWorkout,shoulderWorkout,trapWorkout,coreWorkout){\n var newProgramRef = programRef.push();\n newProgramRef.set({\n email: email,\n name: name,\n password: password,\n weight: weight,\n height: height,\n gender: gender,\n planName: planName,\n bicepWorkout: bicepWorkout,\n tricepWorkout: tricepWorkout,\n chestWorkout: chestWorkout,\n lBackWorkout: lBackWorkout,\n uBackWorkout: uBackWorkout,\n shoulderWorkout: shoulderWorkout,\n trapWorkout: trapWorkout,\n coreWorkout: coreWorkout\n });\n}", "function createAccount(account){\n var accounts = storage.getItemSync('accounts');\n\n //if accounts is undefined (use typeof)\n //set accounts = [];\n if(typeof accounts === 'undefined') {\n accounts = [];\n }\n\n accounts.push(account);\n storage.setItemSync('accounts', accounts);\n\n //push on new account\n\n //return account\n return account;\n\n}", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "function ProfileStorage(storage) {\n\t this.storage = storage;\n\t}", "function updateCurrentUserProfile() {\n\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles! Role will indicate what editing capabilites are available.\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function updateStorage() {\n // Ask the storage for the clients list and the information for this tab.\n chrome.storage.local.get([\"clients\", \"\" + tabId], function(items) {\n // Add the id for this tab to the clients list.\n if (items.clients == undefined) items.clients = [];\n if (items.clients.indexOf(\"\" + tabId) == -1)\n items.clients[items.clients.length] = \"\" + tabId;\n\n // Add the information object for this tab's player.\n if (items[tabId] == undefined) items[tabId] = {};\n\n items[tabId] = {\n // The name of this video (its the content of the meta-tag title).\n name : document.getElementsByName(\"title\")[0].content,\n // Ask the player for the volume, status & check if it is muted.\n volume : self.player.getVolume(),\n isMuted : self.player.isMuted(),\n status : self.player.getPlayerState(),\n playlist : playlist,\n url : window.location.href,\n };\n\n // Update the storage accordingly and recall this method in 1000ms.\n chrome.storage.local.set(items, function() {\n // window.setTimeout(updateStorage, 1000);\n });\n });\n\n }", "saveProfile( profile, callback ) {\n let data = {\n connectors: {}\n };\n // gather general settings\n for( let property in this) {\n //this[property] = ( property in data ? data[property] : this[property] );\n data[property] = this._getEncryptedValue( this[property].input, this[property].value );\n }\n // gather settings from each connector\n Engine.Connectors.forEach( ( connector ) => {\n data.connectors[connector.id] = {};\n for( let property in connector.config ) {\n data.connectors[connector.id][property] = this._getEncryptedValue( connector.config[property].input, connector.config[property].value );\n }\n });\n\n Engine.Storage.saveConfig( 'settings', data, 2 )\n .then( () => {\n document.dispatchEvent( new CustomEvent( EventListener.onSettingsChanged, { detail: this } ) );\n document.dispatchEvent( new CustomEvent( EventListener.onSettingsSaved, { detail: this } ) );\n if( typeof callback === typeof Function ) {\n callback( null );\n }\n } )\n .catch( error => {\n if( typeof callback === typeof Function ) {\n callback( error );\n }\n } );\n }", "function updateCurrentUserProfile() {\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles!\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function submitProfile(newProfile) {\n }", "function updateProfileAPISettings(network, id, appGaiaConfig, profile) {\n let needProfileUpdate = false;\n // go get the profile from the profile URL in the id\n const profilePromise = Promise.resolve().then(() => {\n if (profile === null || profile === undefined) {\n return utils_1.nameLookup(network, id.name)\n .catch((_e) => null);\n }\n else {\n return { profile: profile };\n }\n });\n return profilePromise.then((profileData) => {\n if (profileData) {\n profile = profileData.profile;\n }\n if (!profile) {\n // instantiate\n logger.debug(`Profile for ${id.name} is ${JSON.stringify(profile)}`);\n logger.debug(`Instantiating profile for ${id.name}`);\n needProfileUpdate = true;\n profile = {\n 'type': '@Person',\n 'account': [],\n 'api': {}\n };\n }\n // do we need to update the API settings in the profile?\n if (profile.api === null || profile.api === undefined) {\n needProfileUpdate = true;\n logger.debug(`Adding API settings to profile for ${id.name}`);\n profile.api = {\n gaiaHubConfig: {\n url_prefix: appGaiaConfig.url_prefix\n },\n gaiaHubUrl: appGaiaConfig.server\n };\n }\n if (!profile.hasOwnProperty('api') || !profile.api.hasOwnProperty('gaiaHubConfig') ||\n !profile.api.gaiaHubConfig.hasOwnProperty('url_prefix') || !profile.api.gaiaHubConfig.url_prefix ||\n !profile.api.hasOwnProperty('gaiaHubUrl') || !profile.api.gaiaHubUrl) {\n logger.debug(`Existing profile for ${id.name} is ${JSON.stringify(profile)}`);\n logger.debug(`Updating API settings to profile for ${id.name}`);\n profile.api = {\n gaiaHubConfig: {\n url_prefix: appGaiaConfig.url_prefix\n },\n gaiaHubUrl: appGaiaConfig.server\n };\n }\n return { profile, changed: needProfileUpdate };\n });\n}", "updateProfile(state, payload) {\n state[payload.key] = payload.value;\n }", "function storeProfile(profile) {\n return $http.post('/api/v1/signup/profile', profile)\n .then(response => {\n setUser(response.data.User);\n setSession(response.data.Session);\n\n return response.data;\n })\n .catch(err => {\n return exception.catcher('Failed store profile')(err);\n });\n }", "function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUsers.push(obj);\n\t//obj = {};\n}", "function changeProfilePic(file) {\r\n if (file.target.files[0].type == 'image/jpeg' || file.target.files[0].type == 'image/png') {\r\n const currentUserEmail = authentication.currentUser.email;\r\n const targetFile = file.target.files[0];\r\n const storageRef = storage.ref(USER_PROFILE_PICTURE_FOLDER + currentUserEmail + '.jpeg');\r\n const task = storageRef.put(targetFile);\r\n\r\n const profilePicUploadProgressContainer = document.getElementById('profile-pic-upload-progress-container');\r\n const profilePicUploadProgressBar = document.getElementById('profile-pic-upload-progress-bar');\r\n profilePicUploadProgressContainer.setAttribute('style', 'display: block');\r\n\r\n task.on('state_changed', function progress(snapshot) {\r\n const uploadPercentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\r\n profilePicUploadProgressBar.style.width = uploadPercentage + '%';\r\n }, function error(error) {\r\n displayErrorAlert(error.message);\r\n }, function complete() {\r\n savePicUrl();\r\n });\r\n } else {\r\n displayErrorAlert('Select Image File First');\r\n }\r\n}", "function _saveProfilePerson() {\n if (vm.item.personId === 0) {\n vm.item.personId = vm.item.userId;\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.postById(\"/api/profile/person/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n } else {\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.put(\"/api/profile/person/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n }\n }", "updateActiveProfile (state, { id, value }) {\n if (!state.profile[state.activeProfile]) return\n Vue.set(state.profile[state.activeProfile].princess, id, {...state.profile[state.activeProfile].princess[id], ...value})\n }", "saveProfilesWithoutTeam(profiles) {\n const oldProfileList = this.profiles_without_team;\n const oldProfileMap = {};\n for (let i = 0; i < oldProfileList.length; i++) {\n oldProfileMap[oldProfileList[i]] = this.getProfile(oldProfileList[i]);\n }\n\n const newProfileMap = Object.assign({}, oldProfileMap, profiles);\n const newProfileList = Object.keys(newProfileMap);\n\n newProfileList.sort((a, b) => {\n const aProfile = newProfileMap[a];\n const bProfile = newProfileMap[b];\n\n if (aProfile.username < bProfile.username) {\n return -1;\n }\n if (aProfile.username > bProfile.username) {\n return 1;\n }\n return 0;\n });\n\n this.profiles_without_team = newProfileList;\n this.saveProfiles(profiles);\n }", "function save() {\r\n const uname = context.user && context.user.username;\r\n const time = new Date().toLocaleTimeString();\r\n const searchValue = value.length > 0 ? value : \"\";\r\n const newData = { uname, searchValue, time };\r\n if (localStorage.getItem(\"data\") === null) {\r\n localStorage.setItem(\"data\", \"[]\");\r\n }\r\n\r\n var oldData = JSON.parse(localStorage.getItem(\"data\"));\r\n oldData.push(newData);\r\n\r\n localStorage.setItem(\"data\", JSON.stringify(oldData));\r\n }", "saveToStorage() {\r\n localStorage.setItem('accountList', JSON.stringify(this._accountList));\r\n localStorage.setItem('settings', JSON.stringify(this._settings));\r\n localStorage.setItem('lastAssignedID', JSON.stringify(this._lastAssignedID));\r\n }", "function updateProfileEntries(bios) {\n _.each(bios, updateProfileEntry);\n}", "function addProfiles(profileEntries)\n{\n \"use strict\";\n\n const profiles = jQuery.parseJSON(profileEntries);\n\n jQuery('#selectable-profiles').children().remove();\n\n jQuery.each(profiles, function (key, value) {\n\n const rowID = 'profile' + value.id;\n let row;\n\n // Element already exists\n if (!profiles.hasOwnProperty(key) || jQuery('#' + rowID).length)\n {\n return true;\n }\n\n row = '<tr id=\"' + rowID + '\">';\n\n row += '<td class=\"order nowrap center\" style=\"width: 1rem;\">';\n row += '<span class=\"sortable-handler inactive\" style=\"cursor: auto;\"><span class=\"icon-menu\"></span></span>';\n row += '</td>';\n\n row += '<td class=\"profile-data\" style=\"text-align: left\">';\n row += '<span class=\"check-span icon-checkbox-unchecked\" onclick=\"processProfileRow(\\'' + rowID + '\\')\"></span>';\n row += '<span class=\"profile-sort-name\">' + value.sortName + '</span>';\n row += '<span class=\"profile-display-name\" style=\"display: none;\">' + value.displayName + '</span>';\n row += '<span class=\"profile-id\" style=\"display: none;\">' + value.id + '</span>';\n row += '<span class=\"profile-link\" style=\"display: none;\">' + value.link + '</span>';\n row += '</td>';\n row += '</tr>';\n\n jQuery(row).appendTo('#selectable-profiles');\n });\n}", "function _updateClientProfile(message) {\n profile.set(message.data.profile.device_id, message.data);\n }", "function updateLocalStorage(){\n localStorageService.set(listKey, this.acListP);\n }", "async update(filter, data) {\n if (data['id']) delete data['id'];\n let selectedProfiles = await this.find(filter);\n\n for (let profile of selectedProfiles) {\n data['id'] = profile.id;\n profile = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.merge(profile, data);\n profile.updatedAt = new Date();\n this.profiles[profile.id] = profile;\n }\n\n return selectedProfiles;\n }", "function updateProfile(user,uid,sid,pid,supplement,amount,unit,frequency,frequency_unit,notes,img_01,img_02) {\n var updateSup = \"UPDATE `supplement` SET `name`='\" + supplement + \"' WHERE `id`=\" + sid + \";\";\n var updatePro = \"UPDATE `profile` \" +\n \"SET `amount`='\" + amount + \"', \" +\n \"`unit`='\" + unit + \"', \" +\n \"`frequency`='\" + frequency + \"', \" +\n \"`frequency_unit`='\" + frequency_unit + \"', \" +\n \"`img_01`='\" + img_01 + \"', \" +\n \"`img_02`='\" + img_02 + \"', \" +\n \"`notes`='\" + notes + \"' \" +\n \"WHERE `id`=\" + pid + \";\";\n alert(\"Profile ID: \" + pid);\n db.transaction(function(transaction) {\n transaction.executeSql(updateSup, [], null, errorHandler);\n });\n db.transaction(function(transaction) {\n transaction.executeSql(updatePro, [], null, errorHandler);\n });\n removeUserSupplementDOM();\n updateUserLists(uid,user);\n}", "submit() {\n const errors = this.validate();\n if (errors) {\n Store.changeProperty(\"profile.errors\",errors); return;\n } else Store.changeProperties({\"profile.errors\":{},\"activeScreen\":Screens.LOADING});\n const state = Store.getState().profile;\n async.series([\n (callback) => {\n if (state.password.length) Backend.auth.updatePassword(state.password,callback);\n else callback();\n },\n (callback) => this.uploadProfileImage(callback),\n (callback) => {\n const user = Backend.auth.user();\n const state = Store.getState().profile;\n if (user.displayName !== state.name || user.photoURL !== state.image) {\n Backend.auth.updateProfile({displayName: state.name,photoURL: state.image},callback);\n } else callback();\n }\n ], (error) => {\n if (error) {\n Store.changeProperties({\"profile.errors\": {\"general\": error},\"activeScreen\":Screens.PROFILE});\n } else {\n Store.changeProperty(\"activeScreen\",Screens.USERS_LIST);\n Signalling.sendUserProfile()\n }\n });\n }", "function updateProfile(uid, data, file_name) {\n return new Promise((resolve, reject) => {\n adminWebModel.updateProfile(uid, data, file_name).then((data) => {\n if (data) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n \n resolve({ code: code.OK, message: '', data: { 'token': token} })\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n}", "function pushNewProfileInLocal(id, al){\n\t// console.log(queriesT.al, 'url', localStorage.getItem('aUsrA'), 'local', sessionStorage.getItem('currentUserAlias'), 'session', \"newTests-workOk\");\n\tvar alternativeIdToSend = ($.isNumeric(sessionStorage.getItem('currentUserId'))) ? sessionStorage.getItem('currentUserId') : parseInt(sessionStorage.getItem('currentUserId'));\n\t\n\t// recording with an active user\n\tif(notNullNotUndefined(localStorage.getItem('aUsrA'))){\n\t\t// you want to check wether the active user is recorded and remove that record\n\t\t// if its not the active user profile, somebody else's not yet visited profile\n\t\t// record it\n\t\t// after that, or if the active user was not recorded, is necesary to record in API those visited profiles with the new one (if it wasn't the active user profile)\n\n\t\tdeletingActiveUserFromVisitedUsrs();\n\n\t\t// if you are not in the active user profile, record the present profile\n\t\tif(queriesT.al !== localStorage.getItem('aUsrA')){\n\t\t\t(id && al) ? visitedUsrs.push({al: al, id: id, usrState: 'active'}) : visitedUsrs.push({al: sessionStorage.getItem('currentUserAlias'), id: alternativeIdToSend, usrState: 'active'});\n\t\t}\n\n\t\n\t}else{\n\t// recording with a passive user\n\t\t(id && al) ? visitedUsrs.push({al: al, id: id, usrState: 'pasive'}) : visitedUsrs.push({al: sessionStorage.getItem('currentUserAlias'), id: alternativeIdToSend, usrState: 'pasive'});\n\t}\n\n\trecordInLocal();\n}", "setUserProfile(state, val) {\n state.userProfile = val\n }", "[PROFILE.FETCH_SUCCESS] (state, profile) {\n state.profile = buildProfile(profile)\n }", "async loadProfile() {\n console.log(this.session)\n try {\n this.loadingProfile = true;\n const profile = await this.getProfile();\n console.log(profile)\n if (profile) {\n this.profile = profile;\n saveOldUserData(profile);\n console.log(this.profile)\n }\n\n this.loadingProfile = false;\n //this.setupProfileData();\n } catch (error) {\n console.log(`Error: ${error}`);\n }\n\n }", "function addToLocalStorage(data) {\n let new_pokemon = {};\n new_pokemon.id = data.id;\n new_pokemon.sprite = data.sprite;\n new_pokemon.types = data.types;\n\n let team = []\n team = JSON.parse(localStorage.getItem(\"team\")) || []\n team.push(new_pokemon)\n localStorage.setItem(\"team\", JSON.stringify(team))\n $(\"#save-team\").show()\n}", "function saveChanges() {\n\n // Save it using the Chrome extension storage API.\n chrome.storage.sync.set({\n 'series_list': userSeriesList,\n 'inaktive_list': userInaktivSeriesList\n }, function() {\n //not really do anything anytime you save\n });\n}", "function ProfileList(props) {\n\n const History = useHistory();\n const [profileList, setProfileList] = useState([]);\n // const [profileHasLock, setprofileHasLock] = useState(false)\n\n useEffect(async () => {\n const profileData = await profileApi.getProfiles();\n setProfileList(profileData);\n }, []);\n\n const handleProfileClick = async (profileId) => {\n \n if (props.editMode) {\n localStorage.setItem(\"profileId\", profileId);\n const [profileObj, status] = await profileApi.getOneProfile()\n \n if (status === 404){\n console.log(\"profile not found\")\n }\n else if (status === 200) {\n localStorage.setItem(\"profile\", JSON.stringify(profileObj))\n }\n else {\n console.log(\"Unknown error\")\n }\n\n // handle routing\n History.push(`/profiles/edit`);\n window.location.reload();\n } else {\n // Route to Profile Browse Page <====== Resources Gate\n localStorage.setItem(\"profileId\", profileId);\n const [profileObj, status] = await profileApi.getOneProfile()\n \n if (status === 404){\n console.log(\"profile not found\")\n }\n else if (status === 200) {\n localStorage.setItem(\"profile\", JSON.stringify(profileObj))\n }\n else {\n console.log(\"Unknown error\")\n }\n History.push('/home')\n }\n };\n\n return (\n <div className=\"profile-list\">\n {profileList.map((profile) => (\n <ProfileCard\n handleProfileClick={handleProfileClick}\n id={profile.id}\n key={profile.id}\n profile={profile}\n editMode={props.editMode}\n profileHasLock={profile.pin_code == \"\" ? false : true}\n />\n ))}\n </div>\n );\n}", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "updateProgressInStorage(progress) {\n return this.userInStorage.then((user) => {\n user.progress = progress;\n return this.updateUserInStorage(user);\n })\n }", "syncWithWebStorage(){\n let userId = firebase.auth().currentUser.uid;\n firebase.database().ref('users/' + userId).once('value').then((snapshot) => {\n this.webStorage.setItem(userId, JSON.stringify(snapshot.val()));\n });\n }", "function updateProfileList(templateId) {\n\t\n\t// If the placeholder has been selected\n\tif(templateId == \"NONE\") {\n\t\t$('#profiles').html('<h6 class=\"infotext\">Profiles for the currently selected template will appear here.</h6>');\n\t\treturn;\n\t}\n\t\n\t// Now do a database lookup for profile names for this template.\n\t$(\"#profiles-loading\").show();\n\t$.ajax({\n method: 'get',\n url: '/tempss/api/profile/' + templateId + '/names',\n dataType: 'json',\n success: function(data){\n \tlog('Profile name data received from server: ' + data.profile_names);\n \tif(data.profile_names.length > 0) {\n\t \tvar htmlString = \"\";\n\t \tfor(var i = 0; i < data.profile_names.length; i++) {\n\t \t\tvar profileVisibilityIcon = \"\";\n\t \t\tif(data.profile_names[i].public == true) {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-user text-success no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Public profile\"></span>';\n\t \t\t}\n\t \t\telse {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-lock text-danger no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Private profile\"></span>';\n\t \t\t}\n\t \t\thtmlString += '<div class=\"profile-item\">' + \n\t \t\t profileVisibilityIcon +\n\t \t\t '<a class=\"profile-link\" href=\"#\"' + \n\t \t\t\t'data-pid=\"'+ data.profile_names[i].name + '\">' + data.profile_names[i].name +\n\t \t\t\t'</a><div style=\"float: right;\">';\n\t \t\t\tif(data.profile_names[i].owner) {\n\t \t\t\t\thtmlString += '<span class=\"glyphicon glyphicon-remove-sign delete-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Delete profile\"></span>';\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\thtmlString += '<span></span>';\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\thtmlString += '<span class=\"glyphicon glyphicon-floppy-save load-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Load profile into template\"></span>' +\n\t \t\t\t'</div></div>\\n';\n\t \t}\n\t \t$('#profiles').html(htmlString);\n\t \t$('.profile-item span[data-toggle=\"tooltip\"]').tooltip();\n \t}\n \telse {\n \t\t// If no profiles are available\n \t\t$('#profiles').html('<h6 class=\"infotext\">There are no profiles registered for the \"' + templateId + '\" template.</h6>');\n \t}\n $(\"#profiles-loading\").hide(0);\n },\n error: function() {\n $(\"#profiles-loading\").hide(0);\n $('#profiles').html('<h6 class=\"infotext\">Unable to get profiles for the \"' + templateId + '\" template.</h6>');\n }\n });\n}", "function updateStorage() {\n localStorage.setItem(\"budgetItems\", JSON.stringify(budgetItems));\n localStorage.setItem(\"lastID\", lastID);\n}", "function saveProfile() {\n //Clear any message\n document.getElementById(\"profileNotifications\").innerHTML = \"\";\n\n //Grab the current values in the profile inputs\n var fullname = $(\"#profileFullName\").val();\n var username = document.getElementById(\"profileUsername\").value;\n var password = document.getElementById(\"profilePassword\").value;\n var phone = document.getElementById(\"profilePhone\").value;\n var street = document.getElementById(\"profileStreet\").value;\n var city = document.getElementById(\"profileCity\").value;\n var state = document.getElementById(\"profileState\").value;\n var zip = document.getElementById(\"profileZip\").value;\n\n //Create new User from edited User info\n //Change to direct assignment\n var editedUser = new User(fullname, username, password, phone, street, city, state, zip);\n //Update sessionStorage.user\n sessionStorage.user = JSON.stringify(editedUser);\n //get current editedUsers from sessionStorage.usersArray\n var editedUsers = jsonParse('usersArray');\n\n //Search objects for matching username in array\n for (var i = 0; i < editedUsers.length; i++) {\n\n if (editedUser.username == editedUsers[i].username) {\n //var editedUserIndex = i;\n //remove current user object at position i and replace with editedUser \n editedUsers.splice(i, 1, editedUser);\n //Write updated array to sessionStorage\n sessionStorage.usersArray = JSON.stringify(editedUsers);\n //Display success message\n document.getElementById(\"profileNotifications\").innerHTML =\n \"<h3 class='show text-center' id='profileParaNotification'>Your profile has been updated!</h3>\";\n\n }\n else {\n //Insert \"oops\" code here\n }\n }\n}", "function loadCurrentProfile(e){\n let targetProfile = e.target.title;\n \n if(localStorage.getItem(targetProfile) !== null){\n let currentProfile = localStorage.getItem(targetProfile);\n localStorage.setItem(\"currentProfile\", JSON.stringify(currentProfile));\n }\n else{\n console.log(\"Error: profile not found\");\n }\n}", "SetUserData(user) {\n const countRef = this.afs.doc(`users/userCount`);\n const userRef = this.afs.doc(`users/${user.uid}`);\n const countData = {\n numberUsers: firebase__WEBPACK_IMPORTED_MODULE_2__[\"firestore\"].FieldValue.increment(1)\n };\n countRef.set(countData, {\n merge: true\n }).then(r => { });\n this.storage.ref('Users/Default_ProfilePicture/default_pic.png').getDownloadURL().toPromise().then(url => {\n this.defaultPhotoURL = url;\n const userData = {\n countId: ++this.userCount,\n uid: user.uid,\n email: user.email,\n description: this.description ? this.description : '',\n displayName: user.displayName ? user.displayName : this.firstname + ' ' + this.lastname,\n photoURL: this.providerId ? user.photoURL : this.defaultPhotoURL,\n emailVerified: user.emailVerified,\n job: this.job ? this.job : 'Project starter',\n firstname: this.firstname ? this.firstname : 'First Name',\n lastname: this.lastname ? this.lastname : 'Last Name'\n };\n if (typeof this.profilePicture !== 'undefined') {\n const uploadTask = firebase__WEBPACK_IMPORTED_MODULE_2__[\"storage\"]().ref(`Users/${user.uid}/profilePic/profilePic`).put(this.profilePicture);\n uploadTask.on('state_changed', (snapshot) => {\n }, (error) => {\n console.log(error);\n }, () => {\n uploadTask.snapshot.ref.getDownloadURL().then((url) => {\n firebase__WEBPACK_IMPORTED_MODULE_2__[\"auth\"]().currentUser.updateProfile({\n photoURL: url\n }).then(() => {\n this.afs.collection('users').doc(user.uid).update({\n photoURL: url,\n });\n });\n });\n });\n }\n userRef.set(userData, {\n merge: true\n }).then(r => { console.log(r); });\n });\n }", "async updateOne(filter, data) {\n if (data['id']) delete data['id'];\n let selectedProfile = await this.findOne(filter);\n selectedProfile = lodash__WEBPACK_IMPORTED_MODULE_0___default.a.merge(selectedProfile, data);\n this.profiles[selectedProfile.id] = selectedProfile;\n return selectedProfile;\n }", "static saveAccount (obj) {\n const array = accounts === undefined ? [] : accounts\n array.push(obj)\n localStorage.set('cashaccounts', array)\n }", "function _saveProfilePhone() {\n if (vm.item.phoneId === 0) {\n vm.item.phoneId = vm.item.userId;\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.postById(\"/api/profile/phone/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n } else {\n vm.item.userId = vm.item.id;\n vm.item.modifiedBy = vm.data.name;\n vm.genericService.put(\"/api/profile/phone/\", vm.item.userId, vm.item)\n .then(_serviceCallSuccess, _serviceCallError);\n }\n }", "async function editProfile(data) {\n let profile = await getProfile();\n Object.keys(data).forEach(key => {\n profile.data[key] = data[key];\n });\n const resp = await fetch(window.location.origin + '/profiles/update', {\n method: \"PUT\",\n mode: \"cors\",\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n redirect: \"follow\",\n body: JSON.stringify(profile.data)\n });\n return resp.json();\n}", "function loadNewProfile(event) {\n API.getProfile(event.target.id);\n window.location.reload();\n }", "function updatewallets() {\n //seclect the wallet from wallets array and update it\n var walletsArray = JSON.parse(localStorage.getItem(\"walletsArray\"));\n for (var i = 0; i < walletsArray.length; i++) {\n if (walletsArray[i].name == currentWallet.name) {\n walletsArray[i].amount = currentWallet.amount;\n }\n }\n // }\n localStorage.setItem(\"walletsArray\", JSON.stringify(walletsArray));\n}", "function update_users(callback){\n\tchrome.storage.local.get(\"posts\", function(result){\n\t\tresult = result[\"posts\"];\n\t\tresult = (result === undefined ? {} : result);\n\t\t\n\t\tlet objArray = Object.values(result);\n\t\t\n\t\tchrome.storage.local.get(\"users\", function(usersTable){\n\t\t\tusersTable = usersTable[\"users\"];\n\t\t\tusersTable = (usersTable === undefined ? {} : usersTable);\n\t\t\t\n\t\t\tlet usersArray = Object.values(usersTable);\n\t\t\t\n\t\t\tobjArray.forEach(function(value){\n\t\t\t\tlet userName = value[\"user\"];\n\t\t\t\tconsole.log(\"username: \" + userName);\n\t\t\t\tif (!userExists(userName, usersTable))\n\t\t\t\t\tusersTable[userName.toUpperCase()] = {name: userName, aliases: []};\t\n\t\t\t});\n\t\t\t\n\t\t\tchrome.storage.local.set({\"users\" : usersTable}, function() {\n\t\t console.log('Users Table Updated!');\n\t\t if (callback !== undefined) return callback();\n\t\t\t});\n\t\t});\n\t});\n}", "function addToStorage() {\n localStorage.setItem(\"Library\", JSON.stringify(myLibrary));\n}", "function Save_Data()\n{\n //handles setting profile's variable to entered name\n let tempName = name.value;\n if(tempName != \"\")\n {\n profile.name = tempName;\n }\n\n //sets profile's age to entered age\n let tempAge = Number(age.value);\n if ((tempAge != 0) && (tempAge != NaN))\n {\n profile.age = tempAge;\n }\n\n //sets profile's pet name to entered name\n let tempPetName = petName.value;\n if (tempName != \"\")\n {\n profile.petName = tempPetName;\n }\n\n //sets profile's favorite color to entered color\n let tempFavCol = favoriteColor.value;\n if (tempName != \"\")\n {\n profile.favoriteColor = tempFavCol;\n }\n\n //sets profile's favorite food to entered food\n let tempFavFood = favoriteFood.value;\n if (tempName != \"\")\n {\n profile.favoriteFood = tempFavFood;\n }\n\n //turns the profile object into json tet format and is displayed onto the page\n let json = JSON.stringify(profile);\n storage.textContent = json;\n}", "function loadMyProfile() {\n\t\t$scope.myProfile = JSON.parse(localStorage.getItem('ynan-profile'));\n\t}", "bewareStorageUpdate(collection, name, obj) {\n if (this.getServerInstance().sync_models.indexOf(name) == -1) {\n this.getServerInstance().authenticated_models.push(name);\n this.updateObjectInternal(collection, obj);\n } else {\n this.updateSpecificModel(collection, name);\n }\n }", "async function addExercise(data) {\n const profile = await getProfile();\n profile.data.exercises.push(data);\n const resp = await fetch(window.location.origin + '/profiles/update', {\n method: \"PUT\",\n mode: \"cors\",\n cache: \"no-cache\",\n credentials: \"same-origin\",\n headers: {\n \"Content-Type\": \"application/json\"\n },\n redirect: \"follow\",\n body: JSON.stringify(profile.data)\n });\n return resp.json();\n}", "function updateProfile() {\n\t\tif (newName.value!=\"\") {\n\t\t\tname.innerHTML = newName.value;\n\t\t}\n\t\tif (newEmail.value!=\"\") {\n\t\t\temail.innerHTML = newEmail.value;\n\t\t}\n\t\tif (newPhone.value!=\"\") {\n\t\t\tphone.innerHTML = newPhone.value;\n\t\t}\n\t\tif (newZipcode.value!=\"\") {\n\t\t\tzipcode.innerHTML = newZipcode.value;\n\t\t}\n\t\tif (newPassword.value!=\"\") {\n\t\t\tpassword.innerHTML = newPassword.value;\n\t\t}\n\t\tif (newPwconfirm.value!=\"\") {\n\t\t\tpwconfirm.innerHTML = newPwconfirm.value;\n\t\t}\n\n\t\tnewName.value = \"\";\n\t\tnewEmail.value = \"\";\n\t\tnewPhone.value = \"\";\n\t\tnewZipcode.value = \"\";\n\t\tnewPassword.value = \"\";\n\t\tnewPwconfirm.value = \"\";\n\t}" ]
[ "0.798796", "0.692687", "0.69028205", "0.68246216", "0.6731733", "0.65848434", "0.6579571", "0.651487", "0.6506095", "0.64843076", "0.6480021", "0.6432133", "0.63392556", "0.62683576", "0.6239034", "0.62026125", "0.619816", "0.6182858", "0.614194", "0.61022836", "0.6068736", "0.60270584", "0.59697175", "0.5962831", "0.5961384", "0.5931629", "0.5898647", "0.5892782", "0.5890034", "0.5879429", "0.5845879", "0.5820016", "0.5796908", "0.57730305", "0.5754698", "0.57462406", "0.5743006", "0.5741162", "0.5730932", "0.57248926", "0.5709752", "0.56779206", "0.56754977", "0.56576216", "0.5644447", "0.56394076", "0.56363064", "0.56356627", "0.56214386", "0.5607238", "0.5586506", "0.55837387", "0.55652267", "0.55442464", "0.55354685", "0.55351985", "0.55304587", "0.55282825", "0.552028", "0.5518574", "0.55153763", "0.550825", "0.5506705", "0.5499585", "0.5492124", "0.5486392", "0.54855525", "0.5482786", "0.54814404", "0.54748076", "0.5467518", "0.54672456", "0.5464097", "0.54616517", "0.5458685", "0.54537356", "0.54530257", "0.54518634", "0.54515177", "0.544217", "0.5440269", "0.5437132", "0.5424201", "0.54192233", "0.5418085", "0.5411475", "0.5399332", "0.5394222", "0.5390605", "0.53864664", "0.53751284", "0.53705496", "0.53645283", "0.53625816", "0.53563917", "0.5354005", "0.53521997", "0.5351669", "0.53501314", "0.5333925" ]
0.80723757
0
Get the profiles from storage then display them in the list
function displayProfiles() { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; for (var i = 0; i < profiles.length; i++) { addProfileToAList(profiles[i]); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "static getProfiles() {\r\n let profiles;\r\n if (localStorage.getItem('profiles') === null) {\r\n profiles = [];\r\n } else {\r\n profiles = JSON.parse(localStorage.getItem('profiles'));\r\n }\r\n return profiles;\r\n }", "static getProfilesFromLocalStorage() {\n let profiles;\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n profiles = JSON.parse(localStorage.getItem('profiles'));\n }\n return profiles;\n }", "async getAllProfiles() {\n const arrayProfiles = await this.store.getProfiles();\n return arrayProfiles;\n }", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdminSession,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_BANQUE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_ENTREPRISE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function getProfileData(){\n let headers = loadHeaders();\n callAPI(server + \"api/mdm/profiles/search\",headers,\"profilesData\"); //get main profiles list\n\n}", "function findProfiles() {}", "function getProfileData() {\n // obtener los datos del usuario al iniciar sesión\n IN.API.Raw(\"people/~:(first-name,last-name,id,num-connections,picture-url,location,positions,summary,public-profile-url)\").result(onSuccess).error(onError); \n }", "function getProfile(profileId) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n if (profileId == profiles[i].id) {\r\n regexInput.value = profiles[i].regex;\r\n templateInput.value = profiles[i].template;\r\n globalCheckbox.checked = profiles[i].globalFlag;\r\n caseInsensitiveCheckbox.checked = profiles[i].caseInsensitiveFlag;\r\n multilineCheckbox.checked = profiles[i].multilineFlag;\r\n IgnoreHTMLCheckbox.checked = profiles[i].IgnoreHTML ? true : false;\r\n break;\r\n }\r\n }\r\n }, onError);\r\n}", "function loadProfileInfo() {\n \n if ( localStorage.exsist ) {\n \n $('#create-list').hide(); // hide the red cover\n $('#profile-photo').attr('src', localStorage.myProfileImage);\n $('#title-of-list').html(localStorage.myProfileTitle);\n }else {\n resetProfileInfo();\n }\n \n}", "getProfile() {\n return JSON.parse(localStorage.getItem(PROFILE_KEY));\n }", "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onError);\r\n displayProfiles();\r\n });\r\n}", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "renderProfiles () {\n const profiles = phoneTap.getProfiles(people)\n\n for (let i = 0; profiles.length > i; i++) {\n const profileTemplate = profile(profiles[i])\n const profileModule = document.getElementById('profile-wrapper')\n profileModule.insertAdjacentHTML('beforeend', profileTemplate)\n }\n }", "get profiles() {\r\n return this.create(UserProfileQuery);\r\n }", "static addProfileToStorage(profile) {\n let profiles;\n // When first profile is added or if there is no profiles key in local storage, assign empty array to profiles\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n // Get the existing profiles to the array\n profiles = JSON.parse(localStorage.getItem('profiles'));\n }\n // Adding new profile\n profiles.push(profile);\n console.log(profiles)\n localStorage.setItem('profiles', JSON.stringify(profiles));\n }", "function loadMyProfile() {\n\t\t$scope.myProfile = JSON.parse(localStorage.getItem('ynan-profile'));\n\t}", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"positions:(title)\", \"educations\", \"first-name\", \"last-name\", \"industry\", \"picture-url\", \"public-profile-url\", \"email-address\").result(displayProfileData).error(onError);\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n}", "function getEachProfile(results, callback) {\n Profile.findOne({'_id': results.profileId}, {\n accessToken: 1,\n refreshToken: 1,\n channelId: 1,\n userId: 1,\n email: 1,\n name: 1,\n dataCenter: 1\n }, checkNullObject(callback));\n }", "static getProfile() {\n // Retrieves the profile data from localStorage\n const profile = localStorage.getItem('profile')\n return profile ? JSON.parse(localStorage.profile) : {}\n }", "function addProfileToAList(profile) {\r\n var listItem = document.createElement(\"li\");\r\n listItem.innerHTML = '<a href=\"#\" class=\"profile\" storageID=\"' + profile.id + '\">' + profile.name + '</a>';\r\n profilesList.appendChild(listItem);\r\n}", "loadProfile() {\n\t\tconst url = this.user.url;\n\t\treturn solid.fetch(url)\n\t\t\t.then(res => Promise.all([res.text(), res.headers.get('Content-Type')]))\n\t\t\t.then(([contents, contentType]) => loadProfile({ url, contents, contentType }))\n\t\t\t.then(profile => {\n\t\t\t\tObject.assign(this.user, profile);\n\t\t\t\tif (profile.accountName)\n\t\t\t\t\tthis.id = profile.accountName;\n\t\t\t\treturn profile;\n\t\t\t});\n\t}", "async function getProfie() {\n var tagline = await getTagline();\n var country = await getCountry();\n var profile = await getUrl();\n var featured = await getImages();\n res.render('pages/userProfile', {\n username: uname,\n icon: icon,\n tagline: tagline,\n country: country,\n link: profile,\n featured: featured,\n currentUser: currentUser\n });\n }", "function listAndDownloadProfiles(api, query) {\n return api_1.GET(api, '/profiles/', { query })\n}", "function getList(){\n\t\t// call ajax\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/get-user';\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tlet people = res['people'];\n\t\t\tdisplayList(people);\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// show error\n\t\t\tdisplayError(error + ' while getting list');\n\t\t});\n\t}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "getAllProfiles() {\n return this.#fetchAdvanced(this.#getAllProfilesURL()).then((responseJSON) => {\n let profileBOs = ProfileBO.fromJSON(responseJSON);\n return new Promise(function (resolve) {\n resolve(profileBOs);\n })\n })\n }", "static getProfile() {\n // console.log(\"getProfile()\");\n return store.get('CURRENT_PROFILE');\n }", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"id\", \"first_name\", \"last_name\", \"num-connections\", \"email-address\", \"industry\", \"location\", \"picture-url\", \"public-profile-url\").result(onSuccess).error(onError);\n}", "function getProfile(results, callback) {\n async.concatSeries(results.object, getEachProfile, callback)\n }", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"firstName\", \"lastName\", \"id\").result(onSuccess).error(onError);\n}", "function updateProfileList(templateId) {\n\t\n\t// If the placeholder has been selected\n\tif(templateId == \"NONE\") {\n\t\t$('#profiles').html('<h6 class=\"infotext\">Profiles for the currently selected template will appear here.</h6>');\n\t\treturn;\n\t}\n\t\n\t// Now do a database lookup for profile names for this template.\n\t$(\"#profiles-loading\").show();\n\t$.ajax({\n method: 'get',\n url: '/tempss/api/profile/' + templateId + '/names',\n dataType: 'json',\n success: function(data){\n \tlog('Profile name data received from server: ' + data.profile_names);\n \tif(data.profile_names.length > 0) {\n\t \tvar htmlString = \"\";\n\t \tfor(var i = 0; i < data.profile_names.length; i++) {\n\t \t\tvar profileVisibilityIcon = \"\";\n\t \t\tif(data.profile_names[i].public == true) {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-user text-success no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Public profile\"></span>';\n\t \t\t}\n\t \t\telse {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-lock text-danger no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Private profile\"></span>';\n\t \t\t}\n\t \t\thtmlString += '<div class=\"profile-item\">' + \n\t \t\t profileVisibilityIcon +\n\t \t\t '<a class=\"profile-link\" href=\"#\"' + \n\t \t\t\t'data-pid=\"'+ data.profile_names[i].name + '\">' + data.profile_names[i].name +\n\t \t\t\t'</a><div style=\"float: right;\">';\n\t \t\t\tif(data.profile_names[i].owner) {\n\t \t\t\t\thtmlString += '<span class=\"glyphicon glyphicon-remove-sign delete-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Delete profile\"></span>';\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\thtmlString += '<span></span>';\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\thtmlString += '<span class=\"glyphicon glyphicon-floppy-save load-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Load profile into template\"></span>' +\n\t \t\t\t'</div></div>\\n';\n\t \t}\n\t \t$('#profiles').html(htmlString);\n\t \t$('.profile-item span[data-toggle=\"tooltip\"]').tooltip();\n \t}\n \telse {\n \t\t// If no profiles are available\n \t\t$('#profiles').html('<h6 class=\"infotext\">There are no profiles registered for the \"' + templateId + '\" template.</h6>');\n \t}\n $(\"#profiles-loading\").hide(0);\n },\n error: function() {\n $(\"#profiles-loading\").hide(0);\n $('#profiles').html('<h6 class=\"infotext\">Unable to get profiles for the \"' + templateId + '\" template.</h6>');\n }\n });\n}", "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "async function list (request, reply) {\n let people = await Person.find({})\n reply(people.map(person => person.getPublicProfile()))\n}", "function TwiceProfiles() {\n let profiles = Profiles();\n profiles.insertBefore(TwicePicture(), profiles.firstChild);\n return profiles;\n}", "function getPeopleStorage () {\n\n function getPeopleComplete(data) {\n\n return data;\n }\n\n function getPeopleFailed(error) {\n\n console.log(\"LocalForage Failed for getPeople. \" + error.data);\n }\n\n return $localForage.getItem(peoplePath)\n .then(getPeopleComplete, getPeopleFailed);\n }", "function builtInProfiles () {\n new Profile('Kevin', '../img/monk.png', 'martial arts', '1F6212', knownArray, interestArray);\n new Profile('Austin', '../img/fighter.png', 'watching movies', '404040', ['Javascript', 'HTML', 'CSS'], ['Python', 'Ruby']);\n new Profile('Zach', '../img/wizzard.png', 'Anime', '49F3FF', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Ramon', '../img/monk.png', 'Racing motorsports', 'FF0000', ['Javascript', 'HTML', 'CSS'], ['Python']);\n new Profile('Sooz', '../img/rogue.png', 'Knitting', 'FF8C00', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Kris', '../img/rogue.png', 'reading', 'B51A1F', ['Javascript', 'Python'], ['Java']);\n new Profile('Judah', '../img/druid.jpg', 'Cooking', '000000', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Allie', '../img/cleric.png', 'Cooking', '29B0FF', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Carl', '../img/wizzard.png', 'Cooking', '0560dd', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Jose', '../img/rogue.png', 'Youtubing', 'af111c', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Michael', '../img/rogue.png', 'Youtubing', '000000', ['Javascript'], ['Javascript']);\n new Profile('Han', '../img/monk.png', 'Coding', '29B0FF', ['Javascript', 'HTML', 'CSS', 'Python', 'Java'], ['C++']);\n}", "function getProfileData() {\n\tIN.API.Raw(\"/people/~:(email-address)\").result(onSuccess).error(onError);\n}", "function profile(){\n let login = window.sessionStorage.getItem('login');\n getProfile(login);\n}", "function retrieve() {\n // Get the user's uid\n let uid = $rootScope.account.authData.uid;\n\n // Get the profile\n $rootScope.db.users.child(uid).once('value', function (snapshot) {\n let profile = snapshot.val();\n BroadcastService.send(EVENTS.PROFILE_LOADED, profile);\n });\n }", "function get_profile(number) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', '/profiles/profile' + String(number) + '.json', false);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n cur_profile = JSON.parse(xobj.responseText);\n }\n };\n xobj.send(null);\n }", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "function loadProfile() {\n var d = $q.defer();\n // aca deberia hacer la llamada al servidor\n vm.view.profile = \"admin\";\n\n var style = (vm.view.profile == 'admin') ? vm.view.profileAdmin : vm.view.profileUser;\n vm.view.style = style + ' ' + vm.view.displayListUsers;\n d.resolve();\n\n return d.promise;\n }", "render() {\n const { profiles, loading } = this.props.profiles;\n let profileItems;\n \n // if profiles is null, our loading component will be returned via profileItems\n if (profiles === null || loading ) {\n profileItems = <Spinner />;\n } else {\n \n /* if the length of profiles received is more than 0, our profileItems variable\n will map through an array to access its properties, and return that array, \n then we choose what properties to display via the profile parameter */\n if (profiles.length > 0) {\n profileItems = profiles.map( (profile, index) => \n <div key= {index} onClick = { () => this.selectUsers(profile.id) } >\n <ProfilesWrapper>\n <WrappedDiv>\n <p className = 'property-title'> Username: </p>\n <p className = 'property-content'> {profile.username ? profile.username : <Deleted />}</p>\n </WrappedDiv>\n <WrappedDiv>\n <p className = 'property-title'> Status: </p>\n <p className = 'property-content'> {profile.status}</p>\n </WrappedDiv>\n </ProfilesWrapper>\n </div>)\n } else {\n profileItems = <h4>No profiles found...</h4>;\n }\n }\n \n return (\n <div className = 'ProfileWrapper'>\n <ProfilesTitle> PROFILES </ProfilesTitle>\n {profileItems}\n </div>\n );\n }", "function loadProfile() {\n if (!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\", profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n}", "function loadProfile() {\n if(!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\",profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n }", "function getProfiles(){\n return $http.get('/profile/' + mentorId)\n .then(function (response) {\n response.data.result[0].id = response.data.userId;\n mentorBio.info = response.data.result[0];\n mentorBio.faqs = [];\n for(var key in response.data.result) {\n mentorBio.faqs.push(\n {\n question: response.data.result[key].question,\n answer: response.data.result[key].answer,\n faq_id: response.data.result[key].faq_id\n }\n );\n }\n })\n .catch(function (error) {\n console.log('An error has occurred');\n });\n }", "function buildProfileList(uuid, profiles = {}) {\n const key = `skyblock_profiles:${uuid}`;\n redis.get(key, (err, res) => {\n if (err) {\n return logger.error(`Failed getting profile list hash from redis: ${err}`);\n }\n const p = JSON.parse(res) || {};\n // TODO - Mark old profiles\n const updateQueue = Object.keys(profiles).filter((id) => !(id in p));\n if (updateQueue.length === 0) return;\n async.each(updateQueue, (id, cb) => {\n buildProfile(uuid, id, false, (err, profile) => {\n p[id] = Object.assign(profiles[id], getStats(profile.members[uuid] || {}, profile.members));\n cb();\n });\n }, () => updateProfileList(key, p));\n });\n}", "function getUserProfiles(url, displayFunction) {\n console.log(`Getting user profile`);\n let xhr = new XMLHttpRequest();\n xhr.open(`GET`, url);\n //return the user profile when response received\n xhr.onreadystatechange = function () {\n if (this.readyState === 4 && this.status === 200) {\n displayFunction(this);\n }\n }\n xhr.send();\n}", "function getProfile(email) {\n return dataservice.getProfile(email).then(function(data) {\n vm.profileName = data[0].name;\n vm.profileSurname = data[0].last_name;\n vm.profileAddress = data[0].address;\n vm.profilePostal = data[0].cp;\n vm.profileEmail = data[0].email;\n vm.previousAvatar = data[0].avatar;\n vm.profileAvatar = vm.previousAvatar;\n console.log(vm.profileAvatar);\n\n return [vm.profileName, vm.profileSurname, vm.profileAddress,\n vm.profilePostal, vm.profileEmail, vm.profileAvatar];\n });\n }", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "function populateProfiles() {\n $.getJSON(\n _lcarsAPI + \"profiles\",\n function (data, status) {\n if (status === \"success\") {\n $(\"#profiles\").empty();\n // Check that theres actually a profile, instead of just empty JSON strings\n if (data[0].profiles__pid) {\n $.each(data, function(i, item) {\n $(\"#profiles\").append('<tr><th scope=\"row\" style=\"display:none;\">' + data[i].profiles__pid + '</th>'\n + '<td>' + data[i].profiles__name + '</td>'\n + '<td>' + data[i].profiles__details + '</td>'\n + '<td>' + data[i].profiles__updatedate + '</td>'\n + '<td><button type=\"button\" class=\"btn btn-default btn-xs\"><span title=\"Edit\" class=\"glyphicon glyphicon-pencil\"></span></button>'\n + '<button type=\"button\" class=\"btn btn-default btn-xs\"><span title=\"Delete\" class=\"glyphicon glyphicon-trash\"></span></button></td></tr>');\n });\n }\n }\n });\n}", "function profilesFolder(callback) {\n // for now just return profiles. In future prompt user\n // over stdin or do an async stat to see whether it already\n // exists / etc\n callback(null, \"~/.profiles\")\n}", "async _getProfile () {\n try {\n var p = await profile.getProfile();\n this.setState({ profile: p });\n } catch (e) {\n console.error(e, e.stack);\n }\n }", "function myprofile(){\n\tuser_profile.style.display = 'block'\n\tvar user=JSON.parse(localStorage.getItem('User'));\n\tdocument.getElementById('profile_name').innerHTML=user.fullName;\n\tdocument.getElementById('profile_phone').innerHTML=user.phone;\n\tdocument.getElementById('profile_email').innerHTML=user.email;\n\tdocument.getElementById('profile_password').value=user.password;\n}", "function ProfileQuery(req, res, next) {\n ajaxGetProfiles((profiles) => {\n if (profiles) {\n res.locals.data = {\n ProfileStore: {\n profiles,\n },\n };\n\n next();\n } else {\n res.locals.data = {\n ProfileStore: {\n profiles: [],\n },\n };\n\n next();\n }\n });\n}", "function loadProfile(){\n var request = gapi.client.plus.people.get( {'userId' : 'me'} );\n request.execute(loadProfileCallback);\n }", "function loadPromotedProfiles( totalItems ){\r\n\r\n\r\n // Get profile data from the service\r\n\r\n $.get(\"/Ad\",function(data,status){\r\n\r\n var ads = data.Ad;\r\n\r\n for(i = 0; i < ads.length && i < totalItems; i++){\r\n\r\n var ad = ads[i];\r\n\r\n // Construct the div\r\n\r\n var div =\r\n \"<li>\"+\r\n \"\t<a href=\\\"/ad.jsp/?id=\"+ ad.id +\"\\\">\"+\r\n \" <img src=\\\"/image/?ad=\" + ad.id+\"&size=2\\\" height=\\\"50\\\" alt=\\\"\\\"></a>\" +\r\n \" \t\t<span class=\\\"searching\\\">\"+ad.category+\"</span>\"+\r\n \"\t\t\t<span class=\\\"title\\\">\"+ ad.title+\"</span>\"+\r\n \"\t</a>\"+\r\n \"</li>\";\r\n\r\n $(\"#promotedProfiles\").append(div);\r\n\r\n }\r\n\r\n });\r\n\r\n}", "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "function loadLatestLogin( totalItems ){\r\n\r\n\r\n // Get profile data from the service\r\n\r\n $.get(\"/Profile?type=1&selection=1\",function(data,status){\r\n\r\n var profiles = data.profile;\r\n\r\n for(i = 0; i < profiles.length && i < totalItems; i++){\r\n\r\n var profile = profiles[i];\r\n\r\n // Construct the div\r\n\r\n var div =\r\n \"<li>\" +\r\n \" <a href=\\\"profile.jsp/?user=\"+ profile.id+\"\\\">\"+\r\n \" <img src=\\\"/image/?user=\" + profile.id+\"&size=2\\\" height=\\\"50\\\" alt=\\\"\\\"></a>\" +\r\n \"\t\t\t<span class=\\\"username\\\">\"+ profile.name + \"</span>\" +\r\n \" <span class=\\\"age \"+ profile.sex +\"\\\"> \"+ profile.age + \" \" + year + \"</span>\"+\r\n \" <span class=\\\"city\\\"> \"+ profile.city + \"</span>\"+\r\n \"\t\t</a>\" +\r\n \"\t</li>\";\r\n\r\n\r\n\r\n $(\"#latestLogins\").append(div);\r\n\r\n }\r\n\r\n });\r\n\r\n}", "function viewProfile(Id, Name, Email, Num, DateCreated) {\n const TestimonyDisp = new DisplayTestimonyStuffs();\n TestimonyDisp.displayProfile();\n document.querySelector('#uploadProfileBody').style.display = 'flex';\n const data = JSON.parse(localStorage.getItem('t_b_data')); //The current users data\n console.log(\"The idddd is \", Id);\n const id = Id || data.payload.data._id;\n const name = Name || data.payload.data.name;\n const email = Email || data.payload.data.email;\n const number = Num || data.payload.data.number;\n const dateCreated = DateCreated || data.payload.data.created;\n const extractDateDetails = dateCreated.split('T').shift().split('-');\n const dt = new Date(extractDateDetails);\n const datePosted = dt.toGMTString().split('00:00:00 GMT')[0]\n //Render the data to the DOM \n document.querySelector('#profileName').innerHTML = name;\n document.querySelector('#profileEmail').innerHTML = email;\n document.querySelector('#profileNumber').innerHTML = number;\n document.querySelector('#profileCreationDate').innerHTML = datePosted;\n const token = data.payload.token;\n //Load the posted testimonies of the viewed users profile\n fetch(`${api}/api/testimony/get?postersId=${id}`, {\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': `Bearer ${token}`\n }\n })\n .then(data => {\n return data.json();\n })\n .then(response => {\n //save the gotten response in a session\n sessionStorage.setItem('userTestimonies', JSON.stringify(response));\n //render the response to the DOM\n const tempStorage = sessionStorage.getItem('userTestimonies');\n if (tempStorage) {\n //render the data to the DOM\n const data = JSON.parse(tempStorage);\n const parent = document.querySelector('#profileTestimoniesList');\n document.querySelector('#profileTestimoniesHead').querySelector('h5').innerHTML = \"Testimonies\" + `(${data.payload.length})`;\n for (i in data.payload) {\n parent.innerHTML = '';\n parent.innerHTML += `\n <li data-index='${i}' data-id='${data.payload[i]._id}'>${data.payload[i].title}</li>\n `\n }\n //When any testimony title is clicked, display the full comment\n parent.querySelectorAll('li').forEach(list => {\n list.addEventListener('click', () => {\n viewTestimonyDetails(list, isNewComment = false, isList = true);\n })\n })\n }\n })\n .catch(err => {\n console.log(\"The error is \", err);\n })\n}", "function fetchInfo() {\n $scope.showProcessing = true;\n var url = apiPath + \"profile.php\";\n mediasoftHTTP.actionProcess(url, [{\n user_id: $rootScope.selectedID,\n type: 'users',\n\n }])\n .success(loadInfoSuccess)\n .error(loadError);\n }", "function getPeopleList () {\n if (listPeople.length == 0) {\n var localStorageList = localStorage.getItem('peopleStarWar')\n\n if (localStorageList) {\n listPeople = JSON.parse(localStorageList)\n }\n }\n\n return listPeople\n}", "function getUserProfile(id) {\n console.log(id);\n let profile = [{\n firstName: 'bran',\n lastName: 'Lee',\n email: 'bl@gmail.com',\n password: '1234',\n country: 'canada',\n birthDate: '10/11/1998',\n description: 'Test',\n post: '3',\n message: '5',\n like: '10',\n imageURL: 'https://randomuser.me/api/portraits/med/men/62.jpg'\n }];\n return profile;\n}", "function getProfile(profileName, callback) {\n profilesFolder(function (err, profilesFolder) {\n if (err) {\n return callback(err)\n }\n\n var fileUri = path.join(profilesFolder, profileName + \".json\")\n fs.readFile(fileUri, function (err, content) {\n if (err) {\n return callback(err)\n }\n\n safeParse(content, callback)\n })\n })\n}", "function index(req, res,){\n\n Profile.find({}) \n \n .then(profiles => {\n \n res.render('profiles/index',{\n\n title:\"not-reddit profiles\",\n\n profiles,\n\n }) \n })\n}", "get userProfile() {\r\n return this.profileLoader.userProfile;\r\n }", "showLoggedIn() {\n\t\tvar profile = JSON.parse(localStorage.getItem('profile'));\n\t\tconsole.log(profile)\n\t\treturn profile;\n\t}", "function loadProfileData() {\n\ttry {\n\t\tvar userData = localStorage.getItem(\"profile\");\n\t\tvar user = JSON.parse(userData);\n\t\tif(user != undefined || user != null) {\n\t\t\tdocument.getElementById(\"profileName\").value = user.name;\n\t\t\tdocument.getElementById(\"userAge\").value = user.age;\n\t\t\tdocument.getElementById(\"userPhone\").value = user.phoneno;\n\t\t\tdocument.getElementById(\"userMail\").value = user.email;\n\t\t\tdocument.getElementById(\"userAddress\").value = user.address;\n\t\t\tdocument.getElementById(\"userImg\").value = user.imagefile;\n\t\t\t}\n\t} catch (e) {\n\t\tconsole.log(e);\n\t}\t\n}", "function loadCurrentProfile(e){\n let targetProfile = e.target.title;\n \n if(localStorage.getItem(targetProfile) !== null){\n let currentProfile = localStorage.getItem(targetProfile);\n localStorage.setItem(\"currentProfile\", JSON.stringify(currentProfile));\n }\n else{\n console.log(\"Error: profile not found\");\n }\n}", "function loadMyProfile() {\n\t\tlet userId = sessionStorage.getItem('userId');\n\n\t\tauthorService.loadAuthorByUserId(userId)\n\t\t\t.then(author => {\n\t\t\t\tdisplayUpdateAuhtorForm(author);\n\n\t\t\t}).catch(handleError);\n\t}", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function getDataProfile() {\n loader(1);\n //alert(accessToken);\n\t\tvar term = null;\n\t\t$.ajax({\n\t\t\turl: 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + accessToken,\n\t\t\ttype: 'GET',\n\t\t\tdata: term,\n\t\t\tdataType: 'json',\n\t\t\terror: function(jqXHR, text_status, strError) {\n //alert(JSON.stringify(jqXHR));\n //alert(JSON.stringify(text_status));\n //alert(JSON.stringify(strError));\n disconnectUser();\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tvar item;\n\t\t\t\tconsole.log(JSON.stringify(data));\n\t\t\t\t//alert(JSON.stringify(data));\n\t\t\t\t// Save the userprofile data in your localStorage.\n\t\t\t\t/* localStorage.gmailLogin = \"true\";\n\t\t\t\tlocalStorage.gmailID = data.id;\n\t\t\t\tlocalStorage.gmailEmail = data.email;\n\t\t\t\tlocalStorage.gmailFirstName = data.given_name;\n\t\t\t\tlocalStorage.gmailLastName = data.family_name;\n\t\t\t\tlocalStorage.gmailProfilePicture = data.picture;\n\t\t\t\tlocalStorage.gmailGender = data.gender; */\n\t\t\t\tdisconnectUser();\n\t\t\t\tGoogleName = data.given_name+' '+data.family_name;\n\t\t\t\tGoogleEmail = data.email;\n\t\t\t\tGoogleId = data.id;\n\t\t\t\tImgUser = data.picture;\n\t\t\t\tSignInDirect('google');\n\t\t\t}\n\t\t});\n\t}", "function getUserPictures() {\n let query = \"command=loadPictureList\";\n query += \"&username=\" + endabgabe2.globalUser;\n console.log(query);\n sendRequest(query, handlePictureListeResponse);\n }", "async function getProfiles(req, res) {\n try {\n const profiles = await findAll();\n res.writeHead(200, { \"content-type\": \"application/json\" });\n res.end(profiles);\n }\n catch (error) {\n console.log(error);\n }\n}", "function getProfilesForResourceType(resourceType) {\n $scope.profilesThisType = [];\n var url = $scope.input.server.url + \"StructureDefinition?kind=resource&type=\"+resourceType;\n GetDataFromServer.adHocFHIRQuery(url).then(\n function(data) {\n console.log(data)\n if (data.data && data.data.entry) {\n //this is a bundle\n data.data.entry.forEach(function(ent){\n var url = ent.resource.url; //the 'canonical' url for this profile...\n $scope.profilesThisType.push(url);\n })\n }\n\n\n\n\n },\n function(err){\n console.log(err)\n }\n )\n }", "function listUsers() {\n gapi.client.directory.users.list({\n 'customer': 'my_customer',\n 'maxResults': 100,\n 'orderBy': 'email',\n 'viewType': \"domain_public\"\n }).then(function(response) {\n var users = response.result.users;\n var menu = document.getElementById('menu-main');\n menu.className += \" show-toggle\";\n //appendPre('Directory Loaded, you may now Show Directory <a href=\"link\"> test </a>');\n if (users && users.length > 0) {\n for (i = 0; i < users.length; i++) {\n //console.log(user);\n var user = users[i];\n userlist.push(user)\n /*appendPre('-' + user.primaryEmail + ' (' + user.name.fullName + ')');\n if (user.organizations){\n appendPre(user.organizations[0].title);\n };\n if (user.thumbnailPhotoUrl){\n appendPre(user.thumbnailPhotoUrl)\n }*/\n }\n } else {\n appendPre('No users found.');\n }\n });\n }", "getProfiles() {\n axios.get('/profile/get/', { headers: { Authorization: `Bearer ${this.state.token}` }})\n .then(res => {\n this.setState({\n profiles: res.data.profile \n });\n })\n .catch(err => {\n console.log(\"Error fetching and parsing data\", err);\n }); \n }", "function displayProfile(profile) {\n document.getElementById('name').innerHTML = window.profile['displayName'];\n document.getElementById('pic').innerHTML = '<img src=\"' + window.profile['image']['url'] + '\" />';\n document.getElementById('email').innerHTML = email;\n toggleElement('profile');\n}", "function getListFromStorage() {\n var listArray = JSON.parse(window.localStorage.getItem(nickname));\n return listArray;\n}", "function loadProfileCallback(obj) {\n profile = obj;\n\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n displayProfile(profile);\n }", "function onprofiles(req, res) { \n\n db.collection('profiles') //pakt de collection profiles uit de db\n .find().toArray(done); //pakt de info uit profiles en zet dit in een array\n\n function done(err, data) { //maakt een function done aan en die word aangeroepen als de .toArray method klaar is. \n if (err) { // als er een error is laat die dan zien\n next(err);\n } else {\n \n res.render('profiles.ejs', { //render de template en geeft profiles mee als argument\n profiles: data //profiles geven we mee aan de ejs template\n });\n }\n }\n}", "async getInfoProfile() {\n\t\tthis.spinner.info('Get profile info!');\n\t\tthis.spinner.info('here');\n\t\tawait this.page.waitForSelector(element.numberPosts, {timeout: 5000});\n\t\tlet area_count_post = await this.page.$(element.numberPosts)\n\t\tlet numberPosts = await (await area_count_post.getProperty(\"innerText\")).jsonValue();\n\n\t\tthis.page.evaluate(async element => {\n\t\t\treturn {\n\t\t\talias: document.querySelector(element.alias).innerText,\n\t\t\tusername: document.querySelector(element.username).innerText,\n\t\t\tdescriptionProfile: document.querySelector(element.descriptionProfile)\n\t\t\t\t? document.querySelector(element.descriptionProfile).innerText\n\t\t\t\t: '',\n\t\t\turlImgProfile: document\n\t\t\t\t.querySelector(element.urlImgProfile)\n\t\t\t\t.getAttribute('src'),\n\t\t\twebsite: document.querySelector(element.website)\n\t\t\t\t? document.querySelector(element.website).innerText\n\t\t\t\t: null,\n\t\t\tnumberFollowers: document.querySelector(element.numberFollowers)\n\t\t\t\t.innerText,\n\t\t\tnumberFollowing: document.querySelector(element.numberFollowing)\n\t\t\t\t.innerText,\n\t\t\tprivate: !!document.querySelector(element.isPrivate),\n\t\t\tisOfficial: !!document.querySelector(element.isOfficial),\n\t\t\tnumberPosts: numberPosts\n\t\t};\n\t}, element);\n\t}", "function getFavorites() {\n console.log('Getting favorites');\n var favorites = localStorage.getItem('activeFavorites');\n if (favorites && favorites != '[]') {\n var json = JSON.parse(favorites);\n for (var fav in json) {\n console.log(json[fav]);\n $(\"#favs\").append(json[fav]);\n }\n activeFavs = json;\n } else { console.log('No pre-existing favorites to be shown') }\n}", "async function fetchBasicProfiles(user) {\n const playerUuid = await uuidFromUser(user);\n if (!playerUuid)\n return null; // invalid player, just return\n if (basicProfilesCache.has(playerUuid)) {\n if (debug)\n console.debug('Cache hit! fetchBasicProfiles', playerUuid);\n return basicProfilesCache.get(playerUuid);\n }\n if (debug)\n console.debug('Cache miss: fetchBasicProfiles', user);\n const player = await fetchPlayer(playerUuid);\n if (!player) {\n console.log('bruh playerUuid', user, playerUuid);\n return [];\n }\n const profiles = player.profiles;\n basicProfilesCache.set(playerUuid, profiles);\n if (!profiles)\n return null;\n // cache the profile names and uuids to profileNameCache because we can\n for (const profile of profiles)\n profileNameCache.set(`${playerUuid}.${profile.uuid}`, profile.name);\n return profiles;\n}", "function checkUserForProfile() {\n auth.onAuthStateChanged(function(user) {\n if (user) { // User is signed in.\n uid = user.uid;\n\n //get profile picture if it exists\n var picsRef = storageRef.child('profiles');\n var curRef = picsRef.child(String(uid));\n curRef.getDownloadURL().then(function(url) {\n document.getElementById('profPic').src = url;\n }).catch(function(error) { //picture doesn't exist\n console.log(error);\n });\n\n //load profile information\n var userRef = db.collection('user').doc(String(uid));\n userRef.get().then(function(doc) {\n if (doc.exists) {\n document.getElementById('profName').innerText = doc.data().displayname;\n document.getElementById('profUser').innerText += doc.data().username;\n } else {\n console.log(\"No such document!\");\n }\n }).catch(function(error) {\n console.log(\"Error getting document: \", error);\n });\n\n //get the user's lists\n // var lists = db.collection('list').where('uid', '==', uid);\n var lists = db.collection('list').orderBy('lname', 'asc');\n var lcount = 0;\n lists.get().then(function(snapshot) {\n var content = \"\";\n var count = true;\n snapshot.forEach(function(doc) {\n\n if(lcount < 5 && doc.data().uid == uid) {\n if(count) { //make first card active\n content += '<div class=\"carousel-item active\">';\n count = false;\n }\n else {\n content += '<div class=\"carousel-item\">';\n }\n content += '<div class=\"card\"><div class=\"card-body carouselCardBody\">';\n content += '<h5 class=\"card-title\">' + doc.data().lname + '</h5>'\n content += '<ul>';\n var arr = doc.data().items;\n for(var i=0; i<arr.length; i++) {\n content += '<li>' + arr[i] + '</li>';\n }\n content += '</ul></div></div></div>';\n\n lcount++;\n }\n });\n if(content != \"\") {\n document.getElementById('carouselLists').innerHTML = content;\n }\n });\n\n //get the user's 5 most recent status updates\n var s = db.collection('status').orderBy('time','desc');\n var counter = 0;\n\n // var s = db.collection('status').where('uid', '==', uid).limit(5);\n\n s.get().then(function(snapshot) {\n var content = \"\";\n var count = true;\n snapshot.forEach(function(doc) {\n\n if(counter < 5 && doc.data().uid == uid) {\n\n if(count) { //make first card active\n content += '<div class=\"carousel-item active\">';\n count = false;\n }\n else {\n content += '<div class=\"carousel-item\">';\n }\n content += '<div class=\"card\"><div class=\"card-body carouselCardBody\"><p class=\"card-text\">';\n var ms = doc.data().time.toMillis(); //get date in milliseconds\n var d = new Date(ms);\n content += d.toLocaleString() + '<br><br>' + doc.data().text;\n content += '</p></div></div></div>';\n\n counter++;\n }\n \n });\n if(content != \"\") {\n document.getElementById('carouselStatuses').innerHTML = content;\n }\n });\n\n } else { // User is not signed in.\n window.alert(\"You are signed out!\");\n window.location.href = 'index.html';\n }\n });\n}", "profile (state, getters) {\n return state.profile.filter(prof => {\n return prof.user === getters.user.id\n })\n }", "function ProfileStorage(storage) {\n this.storage = storage;\n}", "function profile(){\n $.getJSON('/team_dashboard/profile',data=>{\n profiletable(data)\n })\n}", "function createRotatingProfile() {\n\t\t if ($('#modRotatingProfile .profiles')) {\n\t\t\tif (!isMobile) {\n\t\t\t //put everything into variables\n\t\t\t $('#modRotatingProfile .profiles li').each(function() {\n\t\t\t\t\t\t\t\t\t profileList.push($(this).html());\n\t\t\t\t\t\t\t\t });\n\t\t\t \n\t\t\t $('#modRotatingProfile .profiles ul').html(\"\");\n\t\t\t \n\t\t\t $(\"#modRotatingProfile .profiles\").jcarousel({\n\t\t\t\t auto: 7,\n\t\t\t\t\tscroll: 1,\n\t\t\t\t\twrap: 'circular',\n\t\t\t\t\tinitCallback: rotatingProfile_callback,\n\t\t\t\t\tbuttonNextHTML: null,\n\t\t\t\t\tbuttonPrevHTML: null\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t $(\"#modRotatingProfile\").hide();\n\t\t\t}\n\t\t }\n\t\t}", "static getFilmsFromStorage()\n {\n let films;\n if(localStorage.getItem('films') === null)\n {\n films = [];\n }else{\n films = JSON.parse(localStorage.getItem('films'));\n }\n return films;\n }", "async function profilePage() {\n if (getPath() === 'profile.html') {\n const params = new URLSearchParams(document.location.search.substring(1));\n let overview;\n if (params.has('user')) {\n // Hide edit button\n document.querySelector('a.edit').classList.add('hide');\n\n // Fetch user profile\n const id = params.get('user');\n const [user] = await UserAPI.fetchUser(id);\n // Fetch user records\n const baseUrl = RecordAPI.uri;\n const url = `${baseUrl}/records?user=${id}`;\n const records = await RecordAPI.fetchRecords(url);\n overview = generateOverview(records);\n renderProfile(user, overview);\n } else {\n const { user } = auth();\n overview = getOverview();\n renderProfile(user, overview);\n }\n }\n}", "componentDidMount() {\n this.props.getProfiles();\n }", "function _fetchProfile ( di, complete ) {\n // build an Agent Request and IX Token, get RS Tokens, then call People RS to get name and photo\n var agentRequestDetails =\n { 'iss': config.host.setup\n , 'aud': config.host.ix\n , 'request.a2p3.org':\n { 'resources':\n [ config.baseUrl.people + '/scope/namePhoto' ]\n , 'auth':\n { 'passcode': true\n , 'authorization': true\n }\n , 'returnURL': config.baseUrl.setup + '/dashboard/return'\n }\n }\n var agentRequest = request.create( agentRequestDetails, vault.keys[config.host.ix].latest )\n var jws = new jwt.Parse( agentRequest )\n var ixTokenDetails =\n { 'iss': config.host.setup\n , 'aud': config.host.ix\n , 'sub': di\n , 'token.a2p3.org':\n { 'sar': jws.signature\n , 'auth': agentRequestDetails['request.a2p3.org'].auth\n }\n }\n var ixToken = token.create( ixTokenDetails, vault.keys[config.host.ix].latest )\n var details =\n { host: 'ix'\n , api: '/exchange'\n , credentials: vault.keys[config.host.ix].latest\n , payload:\n { iss: config.host.setup\n , aud: config.host.ix\n , 'request.a2p3.org':\n { 'request': agentRequest\n , 'token': ixToken\n }\n }\n }\n api.call( details, function ( e, result ) {\n if (e) return complete( e )\n if (!result) return complete( new Error('UNKNOWN') )\n var peopleHost = Object.keys(result.tokens)[0]\n var peopleToken = result.tokens[peopleHost]\n var peopleDetails =\n { host: config.reverseHost[peopleHost]\n , api: '/namePhoto'\n , credentials: vault.keys[peopleHost].latest\n , payload:\n { iss: config.host.setup\n , aud: peopleHost\n , 'request.a2p3.org': { 'token': peopleToken }\n }\n }\n api.call( peopleDetails, function ( e, result ) {\n if (e) return complete( e , null )\n complete( null, result )\n })\n })\n}", "function getProfilesForResourceType(resourceType) {\n $scope.profilesThisType = [];\n //todo - add the standard profile for this type..\n var url = $scope.input.server.url + \"StructureDefinition?kind=resource&type=\"+resourceType;\n GetDataFromServer.adHocFHIRQuery(url).then(\n function(data) {\n console.log(data)\n if (data.data && data.data.entry) {\n //this is a bundle\n data.data.entry.forEach(function(ent){\n var url = ent.resource.url; //the 'canonical' url for this profile...\n $scope.profilesThisType.push(ent.resource);\n })\n }\n\n\n\n\n },\n function(err){\n console.log(err)\n }\n )\n }", "function getProfile() {\n const endpoint = BASE_URL + `/user-profile`;\n const token = localStorage.token;\n return fetch(endpoint, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json\",\n Authorization: `Bearer ${token}`,\n },\n }).then((res) => {\n return res.json();\n });\n}" ]
[ "0.81912386", "0.7726208", "0.749142", "0.7314501", "0.71633613", "0.7153221", "0.71326655", "0.69910026", "0.6809023", "0.6690777", "0.6689355", "0.66671264", "0.66576064", "0.6651746", "0.6596602", "0.6596602", "0.65773606", "0.65120834", "0.6487844", "0.6434193", "0.64257896", "0.6398743", "0.63935876", "0.6328711", "0.6317985", "0.62991226", "0.62970626", "0.62960434", "0.62766916", "0.6269781", "0.62562686", "0.6249104", "0.6217793", "0.6210212", "0.61777014", "0.6162268", "0.61572474", "0.6149167", "0.614819", "0.61376256", "0.61335826", "0.6132002", "0.6122469", "0.6112975", "0.6080756", "0.6074192", "0.60691357", "0.605859", "0.60532594", "0.6045187", "0.60349196", "0.60271597", "0.60267025", "0.6001929", "0.59898776", "0.5988188", "0.5976444", "0.5973498", "0.5969527", "0.5933901", "0.59221214", "0.5915238", "0.5885362", "0.5878153", "0.58655167", "0.586428", "0.5857011", "0.5854293", "0.58517665", "0.5831285", "0.5830496", "0.58183676", "0.5817892", "0.58125526", "0.5787082", "0.57829624", "0.5774743", "0.57726645", "0.57582444", "0.575445", "0.5745634", "0.57445323", "0.57442397", "0.5740572", "0.5735628", "0.5730535", "0.57244766", "0.5712697", "0.5704", "0.5703874", "0.5702712", "0.5699162", "0.5698455", "0.5697956", "0.56928957", "0.5690732", "0.56830966", "0.56584007", "0.5656379", "0.5651775" ]
0.89017963
0
simple function to append a profile to the list
function addProfileToAList(profile) { var listItem = document.createElement("li"); listItem.innerHTML = '<a href="#" class="profile" storageID="' + profile.id + '">' + profile.name + '</a>'; profilesList.appendChild(listItem); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onError);\r\n displayProfiles();\r\n });\r\n}", "function addNewProfile () {\n if (profileToAdd.direction === GAME_DIRECTION.LTR) {\n profileToAdd.x = - profileToAdd.width;\n }\n else {\n profileToAdd.x = this._width + profileToAdd.width;\n }\n\n profileToAdd.y = Math.round(Math.random() * this._height * 0.8);\n this._profiles.push(profileToAdd);\n }", "static addProfileToStorage(profile) {\n let profiles;\n // When first profile is added or if there is no profiles key in local storage, assign empty array to profiles\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n // Get the existing profiles to the array\n profiles = JSON.parse(localStorage.getItem('profiles'));\n }\n // Adding new profile\n profiles.push(profile);\n console.log(profiles)\n localStorage.setItem('profiles', JSON.stringify(profiles));\n }", "function addProfileClicked ()\n{\n\tif(!project.STAProfiles){\n\t\tproject.STAProfiles=[];\n\t}\n\t//get data and add to json\n\tproject.STAProfiles.push(\n\t\t{\n\t\t\t'id':makeid(),\n\t\t\t'SSID':$('#SSIDText').val(),\n\t\t\t'SecurityKey':$('#SecurityText').val(),\n\t\t\t'SecurityType':$('#SecurityTypeSelect').val(),\n\t\t\t'ProfilePriority':$('#ProfilePriorityText').val()\n\t\t}\n\t);\n\t//reload the list\n\tloadDeviceRoleSettingsSTA();\n\t//save project\n\tsaveProjectAPI();\n}", "function buildProfileList(uuid, profiles = {}) {\n const key = `skyblock_profiles:${uuid}`;\n redis.get(key, (err, res) => {\n if (err) {\n return logger.error(`Failed getting profile list hash from redis: ${err}`);\n }\n const p = JSON.parse(res) || {};\n // TODO - Mark old profiles\n const updateQueue = Object.keys(profiles).filter((id) => !(id in p));\n if (updateQueue.length === 0) return;\n async.each(updateQueue, (id, cb) => {\n buildProfile(uuid, id, false, (err, profile) => {\n p[id] = Object.assign(profiles[id], getStats(profile.members[uuid] || {}, profile.members));\n cb();\n });\n }, () => updateProfileList(key, p));\n });\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "function addProfiles(profileEntries)\n{\n \"use strict\";\n\n const profiles = jQuery.parseJSON(profileEntries);\n\n jQuery('#selectable-profiles').children().remove();\n\n jQuery.each(profiles, function (key, value) {\n\n const rowID = 'profile' + value.id;\n let row;\n\n // Element already exists\n if (!profiles.hasOwnProperty(key) || jQuery('#' + rowID).length)\n {\n return true;\n }\n\n row = '<tr id=\"' + rowID + '\">';\n\n row += '<td class=\"order nowrap center\" style=\"width: 1rem;\">';\n row += '<span class=\"sortable-handler inactive\" style=\"cursor: auto;\"><span class=\"icon-menu\"></span></span>';\n row += '</td>';\n\n row += '<td class=\"profile-data\" style=\"text-align: left\">';\n row += '<span class=\"check-span icon-checkbox-unchecked\" onclick=\"processProfileRow(\\'' + rowID + '\\')\"></span>';\n row += '<span class=\"profile-sort-name\">' + value.sortName + '</span>';\n row += '<span class=\"profile-display-name\" style=\"display: none;\">' + value.displayName + '</span>';\n row += '<span class=\"profile-id\" style=\"display: none;\">' + value.id + '</span>';\n row += '<span class=\"profile-link\" style=\"display: none;\">' + value.link + '</span>';\n row += '</td>';\n row += '</tr>';\n\n jQuery(row).appendTo('#selectable-profiles');\n });\n}", "function TwiceProfiles() {\n let profiles = Profiles();\n profiles.insertBefore(TwicePicture(), profiles.firstChild);\n return profiles;\n}", "function addProfiles(data) {\n console.log(` Adding: Profile ${data.firstName} for (${data.owner})`);\n Profiles.collection.insert(data);\n}", "function addProfiles(data) {\n console.log(` Adding: ${data.name} (${data.owner})`);\n Profiles.collection.insert(data);\n}", "function Profile() {\n\t}", "function findProfiles() {}", "getProfile (start, end, width, depth, callback) {\n\t\t\tlet request = new Potree.ProfileRequest(start, end, width, depth, callback);\n\t\t\tthis.profileRequests.push(request);\n\t\t}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function builtInProfiles () {\n new Profile('Kevin', '../img/monk.png', 'martial arts', '1F6212', knownArray, interestArray);\n new Profile('Austin', '../img/fighter.png', 'watching movies', '404040', ['Javascript', 'HTML', 'CSS'], ['Python', 'Ruby']);\n new Profile('Zach', '../img/wizzard.png', 'Anime', '49F3FF', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Ramon', '../img/monk.png', 'Racing motorsports', 'FF0000', ['Javascript', 'HTML', 'CSS'], ['Python']);\n new Profile('Sooz', '../img/rogue.png', 'Knitting', 'FF8C00', ['Javascript', 'HTML', 'CSS'], ['Python', 'C#']);\n new Profile('Kris', '../img/rogue.png', 'reading', 'B51A1F', ['Javascript', 'Python'], ['Java']);\n new Profile('Judah', '../img/druid.jpg', 'Cooking', '000000', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Allie', '../img/cleric.png', 'Cooking', '29B0FF', ['Javascript', 'HTML', 'CSS'], ['C#']);\n new Profile('Carl', '../img/wizzard.png', 'Cooking', '0560dd', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Jose', '../img/rogue.png', 'Youtubing', 'af111c', ['Javascript', 'HTML', 'CSS'], ['C#', 'Python']);\n new Profile('Michael', '../img/rogue.png', 'Youtubing', '000000', ['Javascript'], ['Javascript']);\n new Profile('Han', '../img/monk.png', 'Coding', '29B0FF', ['Javascript', 'HTML', 'CSS', 'Python', 'Java'], ['C++']);\n}", "function createProfile() {\n var protoClass = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'proto-icon';\n var description = arguments.length > 1 ? arguments[1] : undefined;\n var username = arguments.length > 2 ? arguments[2] : undefined;\n var img = arguments.length > 3 ? arguments[3] : undefined;\n var newProfile = document.getElementsByClassName(protoClass)[0].cloneNode(true);\n newProfile.getElementsByTagName('img')[0].src = img;\n newProfile.getElementsByTagName('h1')[0].textContent = username;\n newProfile.getElementsByTagName('p')[0].textContent = description;\n return newProfile;\n} //-----------addFriend function-----------", "function saveProfile(profile) {\n }", "function addToOnlineUsers(nickname) {\n var onlineList = $('#online_now');\n var onlineUsers = $('<li>', {\n html : nickname,\n id : nickname\n });\n onlineList.append(onlineUsers);\n }", "createProfile (state, { name = 'New profile', host = null }) {\n for (let profile of state) {\n profile.active = false\n }\n\n state.push({\n id: uuid(),\n name,\n host,\n paired: false,\n active: true,\n apps: []\n })\n }", "function addAchievement( profile, achievement ) {\n if (!profile.expose.achievements) profile.expose.achievements = [];\n profile.expose.achievements.push( achievement );\n }", "function Profiles() {\n for (let x = docsList.length - 1; x >= 0; x--) {\n let item = generateItemProfiles(docsList[x], x);\n let item2 = document.getElementById(\"idHtmlSecond\").insertAdjacentHTML(\"beforeend\", item);\n console.log(\"Profile-DR\" + x);\n }\n}", "updateProfile() {}", "function addPassenger (name, list) {\n if (list.length == 0) {\n list.push(name);\n } else {\n for (var i = 0; i < list.length; i++) {\n if (list[i] == undefined) {\n list[i] = name;\n return list;\n } else if (i == list.length - 1) {\n list.push(name);\n return list;\n }\n }\n }\n}", "function prepend(toAdd, list) {\n list = {\n value: toAdd,\n rest: list\n }\n return list;\n}", "function getFull(tempProfile, tempUser, tempStatus) {\n\n temp = {\n 'profile': tempProfile,\n 'user': tempUser,\n 'status': tempStatus\n }\n vm.followings.push(temp)\n\n }", "renderProfiles () {\n const profiles = phoneTap.getProfiles(people)\n\n for (let i = 0; profiles.length > i; i++) {\n const profileTemplate = profile(profiles[i])\n const profileModule = document.getElementById('profile-wrapper')\n profileModule.insertAdjacentHTML('beforeend', profileTemplate)\n }\n }", "function getProfile(results, callback) {\n async.concatSeries(results.object, getEachProfile, callback)\n }", "function selectProfile(prof){\n\n\tvar profHandle = $(prof).parent('.mainListItem').find('p.profhandle').text();\n\n\t//Check if profile is in the selectedProfs array\n\tif(selectedProfs.includes(profHandle)){\n\t\t//If in array, remove, re-enab;e hover and change color back to dark\n\t\tselectedProfs.splice(selectedProfs.indexOf(profHandle), 1);\n\t\tupdateJSON();\n\t\tenableHover(prof);\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#444444\"}, 100);\n\t}else{\n\t\t//If not in array, add to array, remove hover events and make item green\n\t\tselectedProfs.push(profHandle);\n\t\tupdateJSON();\n\t\t$(prof).parent('.mainListItem').unbind('mouseenter mouseleave');\n\t\t$(prof).parent('.mainListItem').animate({\"backgroundColor\":\"#417f50\"}, 100);\n\t\n\t}\n\n}", "function addToPeersList() {\n if(peersArr.length < 1){\n role = 'hub';\n return peers.$set(myId, {username: username, role: role});\n } else {\n role = 'spoke';\n return peers.$set(myId, {username: username, role: role});\n }\n\n }", "function addUser(userList, user) {\r\n let newList = Object.assign({}, userList)\r\n newList[user.name] = user\r\n return newList\r\n}", "function appendUserListElement(firstname, lastname) {\n searchResultsList.append('<li><p>'+firstname+\" \"+lastname+'</p></li>');\n }", "function addWithFunction(list, item, hashFunction) {\n if (findWithFunction(list, hashFunction) === -1) {\n list.push(item);\n }\n }", "function createRotatingProfile() {\n\t\t if ($('#modRotatingProfile .profiles')) {\n\t\t\tif (!isMobile) {\n\t\t\t //put everything into variables\n\t\t\t $('#modRotatingProfile .profiles li').each(function() {\n\t\t\t\t\t\t\t\t\t profileList.push($(this).html());\n\t\t\t\t\t\t\t\t });\n\t\t\t \n\t\t\t $('#modRotatingProfile .profiles ul').html(\"\");\n\t\t\t \n\t\t\t $(\"#modRotatingProfile .profiles\").jcarousel({\n\t\t\t\t auto: 7,\n\t\t\t\t\tscroll: 1,\n\t\t\t\t\twrap: 'circular',\n\t\t\t\t\tinitCallback: rotatingProfile_callback,\n\t\t\t\t\tbuttonNextHTML: null,\n\t\t\t\t\tbuttonPrevHTML: null\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t $(\"#modRotatingProfile\").hide();\n\t\t\t}\n\t\t }\n\t\t}", "function generateProfile(data) {\n /* create new array populated by calling provided function */\n data.map(profile => {\n\n profile = \n `<div class=\"card\">\n <div class=\"card-img-container\">\n <img class=\"card-img\" src=\"${profile.picture.large}\" alt=\"profile picture\">\n </div>\n <div class=\"card-info-container\">\n <h3 id=\"name\" class=\"card-name cap\">${profile.name.first} ${profile.name.last}</h3>\n <p class=\"card-text\">${profile.email}</p>\n <p class=\"card-text cap\">${profile.location.city}, ${profile.location.state}</p>\n </div>\n </div>`;\n \n gallery.insertAdjacentHTML('beforeend', profile);\n });\n}", "function addStudentToList(id,name) {\n students2.push({\n id: id,\n name: name,\n isLoggeIn: false,\n requestConection() {\n console.log('deseo ingresar a clases');\n }\n });\n}", "function add(pokemon) {\n pokemonList.push(pokemon);\n}", "createProfile() {}", "function appendStatistic(prof, res) {\n const profile1 = prof.toObject();\n profile1.setsCount = 0;\n profile1.notecardCount = 0;\n profile1.followerCount = 0;\n\n profile1.followerCount = profile1.follower.length;\n\n dbmodel.set.findByOwner(profile1.id, (err, sets) => {\n if (sets) {\n profile1.setsCount = sets.length;\n }\n dbmodel.notecard.findByOwner(profile1.id, (err1, cards) => {\n if (cards) {\n profile1.notecardCount = cards.length;\n }\n res.send(profile1);\n });\n });\n}", "_onTick () {\n const profileToAdd = GAME_LEVEL[this._currentTick];\n\n if (this._timesToAddProfile.indexOf(this._currentTick) > -1) {\n addNewProfile.call(this);\n }\n\n if (this._profiles.length > 0) {\n const profilesClone = [];\n\n this._profiles.forEach(profile => profilesClone.push(profile));\n profilesClone.forEach(profile => moveProfile.call(this, profile));\n this.repaint();\n }\n else if (this._currentTick > this._lastProfileTick) {\n this.stop();\n }\n\n this._currentTick++;\n\n /**\n * Add a new profile to the list of profiles\n */\n function addNewProfile () {\n if (profileToAdd.direction === GAME_DIRECTION.LTR) {\n profileToAdd.x = - profileToAdd.width;\n }\n else {\n profileToAdd.x = this._width + profileToAdd.width;\n }\n\n profileToAdd.y = Math.round(Math.random() * this._height * 0.8);\n this._profiles.push(profileToAdd);\n }\n\n /**\n * Move the profile one step in the right direction\n * @param {GameProfile} profile\n */\n function moveProfile (profile) {\n const currentProfile = profile;\n \n if (currentProfile.direction === GAME_DIRECTION.LTR) {\n currentProfile.x += currentProfile.speed;\n\n if (currentProfile.x > this._width + currentProfile.width) {\n this._profiles.splice(this._profiles.indexOf(currentProfile), 1);\n }\n }\n else {\n currentProfile.x -= currentProfile.speed;\n\n if (currentProfile.x < - currentProfile.width) {\n this._profiles.splice(this._profiles.indexOf(currentProfile), 1);\n }\n }\n }\n }", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "async create(profile) {\n if (!profile.id) profile.id = uniqid__WEBPACK_IMPORTED_MODULE_1___default()();\n profile.createdAt = new Date();\n profile.updatedAt = new Date();\n this.profiles[profile.id] = profile;\n return profile;\n }", "function ProfileData() {\r\n}", "function updateProfileList(templateId) {\n\t\n\t// If the placeholder has been selected\n\tif(templateId == \"NONE\") {\n\t\t$('#profiles').html('<h6 class=\"infotext\">Profiles for the currently selected template will appear here.</h6>');\n\t\treturn;\n\t}\n\t\n\t// Now do a database lookup for profile names for this template.\n\t$(\"#profiles-loading\").show();\n\t$.ajax({\n method: 'get',\n url: '/tempss/api/profile/' + templateId + '/names',\n dataType: 'json',\n success: function(data){\n \tlog('Profile name data received from server: ' + data.profile_names);\n \tif(data.profile_names.length > 0) {\n\t \tvar htmlString = \"\";\n\t \tfor(var i = 0; i < data.profile_names.length; i++) {\n\t \t\tvar profileVisibilityIcon = \"\";\n\t \t\tif(data.profile_names[i].public == true) {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-user text-success no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Public profile\"></span>';\n\t \t\t}\n\t \t\telse {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-lock text-danger no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Private profile\"></span>';\n\t \t\t}\n\t \t\thtmlString += '<div class=\"profile-item\">' + \n\t \t\t profileVisibilityIcon +\n\t \t\t '<a class=\"profile-link\" href=\"#\"' + \n\t \t\t\t'data-pid=\"'+ data.profile_names[i].name + '\">' + data.profile_names[i].name +\n\t \t\t\t'</a><div style=\"float: right;\">';\n\t \t\t\tif(data.profile_names[i].owner) {\n\t \t\t\t\thtmlString += '<span class=\"glyphicon glyphicon-remove-sign delete-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Delete profile\"></span>';\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\thtmlString += '<span></span>';\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\thtmlString += '<span class=\"glyphicon glyphicon-floppy-save load-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Load profile into template\"></span>' +\n\t \t\t\t'</div></div>\\n';\n\t \t}\n\t \t$('#profiles').html(htmlString);\n\t \t$('.profile-item span[data-toggle=\"tooltip\"]').tooltip();\n \t}\n \telse {\n \t\t// If no profiles are available\n \t\t$('#profiles').html('<h6 class=\"infotext\">There are no profiles registered for the \"' + templateId + '\" template.</h6>');\n \t}\n $(\"#profiles-loading\").hide(0);\n },\n error: function() {\n $(\"#profiles-loading\").hide(0);\n $('#profiles').html('<h6 class=\"infotext\">Unable to get profiles for the \"' + templateId + '\" template.</h6>');\n }\n });\n}", "function appendList(user) {\n \t$('#unordList').append('<li>' + user + '</li>');\n\n }", "function insertPicture(element, category, list) {\n list[category].push(element)\n}", "function append(list, item) {\n remove(item);\n item._idleNext = list._idleNext;\n list._idleNext._idlePrev = item;\n item._idlePrev = list;\n list._idleNext = item;\n }", "saveProfilesWithoutTeam(profiles) {\n const oldProfileList = this.profiles_without_team;\n const oldProfileMap = {};\n for (let i = 0; i < oldProfileList.length; i++) {\n oldProfileMap[oldProfileList[i]] = this.getProfile(oldProfileList[i]);\n }\n\n const newProfileMap = Object.assign({}, oldProfileMap, profiles);\n const newProfileList = Object.keys(newProfileMap);\n\n newProfileList.sort((a, b) => {\n const aProfile = newProfileMap[a];\n const bProfile = newProfileMap[b];\n\n if (aProfile.username < bProfile.username) {\n return -1;\n }\n if (aProfile.username > bProfile.username) {\n return 1;\n }\n return 0;\n });\n\n this.profiles_without_team = newProfileList;\n this.saveProfiles(profiles);\n }", "function add(random){\n namelist.push(random);\n}", "async function createProfileElement(profile) {\n const template = document.querySelector('#profile-item');\n const clone = document.importNode(template.content, true);\n clone.querySelector('.dogProfile').id = `profile-${profile.pro_id}`;\n clone.querySelector('#name').textContent = `${profile.pro_name}, ${util.getAgeFromDate(\n profile.pro_birthday,\n )}`;\n clone.querySelector('#breed').textContent = profile.pro_breed;\n clone.querySelector('#birthday').textContent = profile.pro_birthday;\n clone.querySelector('#sex').textContent = profile.pro_sex;\n\n const imageObj = await util.getProfilePicById(profile.pro_id);\n let profilePicSrc;\n !imageObj\n ? (profilePicSrc = './images/user.png')\n : (profilePicSrc = `./uploadedImages/${imageObj.img_id}.${imageObj.img_ext}`);\n\n clone.querySelector('#profilePicElement').src = profilePicSrc;\n\n document.querySelector('#userProfileArea').appendChild(clone);\n}", "function addKiwi(ourList){\n ourList.push(\"kiwi\");\n }", "function addToFriendList(screen_name){\n\tfriend_list.push(screen_name);\n\tif(friend_list.length>3000){\n\t\tvar df = friend_list.length - 3000;\n\t\tfor(var i=0; i<df; i++){\n\t\t\tTwitter.post('friendships/destroy', {'screen_name': friend_list[0]}, function(err, data, response){\n\t\t\t\tif(err) {\n\t\t\t\t\tconsole.log(\"friendship destroy error: \" + err);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"friendship destroyed: \" + friend_list[0]);\n\t\t\t\t\tfriend_list.shift();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n\tvar friend_list_str = friend_list.join();\n\tfriend_list_str.replaceAll(',','\\n');\n\tfs.truncate(friend_list_path, 0, function() {\n fs.writeFile(friend_list_path, friend_list_str, function (err) {\n if (err) {\n console.log(\"Error writing friend_list file: \" + err);\n } else {\n \tconsole.log(\"Written a new friend_list file. Length -> \" + friend_list.length);\n }\n });\n});\n}", "function saveAllProfiles(unlabeledProfiles, length, searchId) {\n var i = 0;\n return Promise.resolve(i).then(function addNextProfile(i) {\n if (i > length-1) return;\n var unlabeledProfile = unlabeledProfiles[i++];\n return saveUnlabeledProfile(unlabeledProfile, searchId).then(() => addNextProfile(i));\n })\n}", "function LodLiveProfile() {\n\n }", "function addUser(userList, user){\n let newList = Object.assign({}, userList);\n newList[user.name] = user;\n return newList;\n }", "function addUserToGamePlayerList(username) {\n console.log(\"adding \" + username);\n var thisPlayer = document.createElement('li');\n thisPlayer.classList.add('list-group-item','justify-content-between');\n thisPlayer.appendChild(document.createTextNode(username));\n if(gamePlayerList.children().length === 0) {\n var leaderBadge = document.createElement('span');\n leaderBadge.classList.add('badge','badge-success','badge-pill');\n leaderBadge.appendChild(document.createTextNode('Leader'));\n thisPlayer.appendChild(leaderBadge);\n }\n\n gamePlayerList.append(thisPlayer);\n}", "function appendUserToList(url, nickname) {\n\tvar $user = $('<li>').html('<a class= \"user_link\" href=\"'+url+'\">'+nickname+'</a>');\n\t//Add to the user list\n\t$(\"#user_list\").append($user);\n\treturn $user;\n}", "function loadPromotedProfiles( totalItems ){\r\n\r\n\r\n // Get profile data from the service\r\n\r\n $.get(\"/Ad\",function(data,status){\r\n\r\n var ads = data.Ad;\r\n\r\n for(i = 0; i < ads.length && i < totalItems; i++){\r\n\r\n var ad = ads[i];\r\n\r\n // Construct the div\r\n\r\n var div =\r\n \"<li>\"+\r\n \"\t<a href=\\\"/ad.jsp/?id=\"+ ad.id +\"\\\">\"+\r\n \" <img src=\\\"/image/?ad=\" + ad.id+\"&size=2\\\" height=\\\"50\\\" alt=\\\"\\\"></a>\" +\r\n \" \t\t<span class=\\\"searching\\\">\"+ad.category+\"</span>\"+\r\n \"\t\t\t<span class=\\\"title\\\">\"+ ad.title+\"</span>\"+\r\n \"\t</a>\"+\r\n \"</li>\";\r\n\r\n $(\"#promotedProfiles\").append(div);\r\n\r\n }\r\n\r\n });\r\n\r\n}", "function loadProfileCallback(obj) {\n profile = obj;\n window.profile = obj;\n // Filter the emails object to find the user's primary account, which might\n // not always be the first in the array. The filter() method supports IE9+.\n email = obj['emails'].filter(function(v) {\n return v.type === 'account'; // Filter out the primary email\n })[0].value; // get the email from the filtered results, should always be defined.\n var displayName = profile['displayName'];\n displayProfile(profile);\n //Create account in ubm db\n createUBMUser(email, displayName, profile);\n}", "addPlayer(no,firstName,lastName,pos,bat,thw,age,ht,wt,birthplace) {\n let player = {\n No: no,\n firstName: firstName,\n lastName: lastName,\n POS: pos,\n BAT: bat,\n THW: thw,\n AGE: age,\n HT: ht,\n WT: wt,\n birthPlace: birthplace\n };\n //add the each of new player in the list.\n this._players.push(player);\n }", "function pushNewProfileInLocal(id, al){\n\t// console.log(queriesT.al, 'url', localStorage.getItem('aUsrA'), 'local', sessionStorage.getItem('currentUserAlias'), 'session', \"newTests-workOk\");\n\tvar alternativeIdToSend = ($.isNumeric(sessionStorage.getItem('currentUserId'))) ? sessionStorage.getItem('currentUserId') : parseInt(sessionStorage.getItem('currentUserId'));\n\t\n\t// recording with an active user\n\tif(notNullNotUndefined(localStorage.getItem('aUsrA'))){\n\t\t// you want to check wether the active user is recorded and remove that record\n\t\t// if its not the active user profile, somebody else's not yet visited profile\n\t\t// record it\n\t\t// after that, or if the active user was not recorded, is necesary to record in API those visited profiles with the new one (if it wasn't the active user profile)\n\n\t\tdeletingActiveUserFromVisitedUsrs();\n\n\t\t// if you are not in the active user profile, record the present profile\n\t\tif(queriesT.al !== localStorage.getItem('aUsrA')){\n\t\t\t(id && al) ? visitedUsrs.push({al: al, id: id, usrState: 'active'}) : visitedUsrs.push({al: sessionStorage.getItem('currentUserAlias'), id: alternativeIdToSend, usrState: 'active'});\n\t\t}\n\n\t\n\t}else{\n\t// recording with a passive user\n\t\t(id && al) ? visitedUsrs.push({al: al, id: id, usrState: 'pasive'}) : visitedUsrs.push({al: sessionStorage.getItem('currentUserAlias'), id: alternativeIdToSend, usrState: 'pasive'});\n\t}\n\n\trecordInLocal();\n}", "function addToSkillArr (skill) {\n skillsArr.push(skill);\n}", "function addAllCards() {\r\n for (var i = 3; i < profileData.allnames.length; i++){\r\n let newProfile = new Profile(profileData.allnames[i],\r\n profileData.allage[i],\r\n profileData.alltitles[i],\r\n profileData.allphotos[i][0]);\r\n // listedProfile.push(newProfile);\r\n let newProfileCard = document.createElement('div');\r\n newProfileCard.classList.add('swipe-card');\r\n cardsContainer.appendChild(newProfileCard);\r\n newProfileCard.innerHTML = `<img src=\"${newProfile.photos}\" alt=\"\">\r\n <div class=\"name-wrapper\">\r\n <div class=\"card-name\">${newProfile.name}, ${newProfile.age}</div>\r\n <i class=\"fas fa-check-circle\"></i>\r\n </div>\r\n <div class=\"card-title\">${newProfile.title}</div>`\r\n }\r\n}", "function prepend(element, list) {\n newList = { value: element, rest: list };\n return newList;\n}", "function addGuess(){\n \n $('#guessList').append('<li>'+userGuess+'</li>');\n}", "function addingListUsers(users){\n for(let i = 0; i < users.length; i++){\n const HTMLString = playListTemplate(users[i])\n const HTMLTemplate = playListHTMLTemplate(HTMLString);\n $playlist.append(HTMLTemplate);\n }\n }", "addFriend(newFriend){\n var i;\n for (i = 0; i < this._friends.length; i++) {\n if (this._friends[i] === newFriend){\n console.log(newFriend + \" is already in list\");\n return;\n }\n }\n this._friends.push(newFriend);\n }", "async function addProfile(data) {\n const [prospect] = await db\n .from('prospect')\n .insert(data)\n .returning('*');\n return prospect;\n}", "function prepend(element, list){\n var newList = {};\n newList.value = element;\n newList.rest = list;\n return newList;\n}", "function appendGuess(userGuess) {\n\t\t$('ul#guessList').append('<li>' + userGuess + '</li>');\n\t}", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdminSession,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_BANQUE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function addPlayer(player) {\n $(\"#game .left .players\").append(\"<li id='player-\" + player.id + \"' style='color:\" + player.color + \";'>\" + player.nickname + \"</li>\");\n }", "function addUserSkill(skill){\n let x = users.find(student =>student.name == skill.name)\n if (x == undefined){\n return console.log(\"user does not exist\")\n }else{\n x.skills.push(skill.skills)\n }\n console.log(x)\n}", "function addOne()\n{\n var tweeps = [];// local if var is added\n tweeps.push('@lighthouselabs')\n}", "function updateProfile(info) {\n setProfile(info);\n }", "function AddToProfile (container, options) {\n /**\n * Options reference\n */\n this.options = options;\n\n /**\n * jQuery reference to Add to profile button\n */\n this.addButton = container.find(options[\"add-to-profile-button\"]);\n\n /**\n * jQuery reference to completeness tip value\n */\n this.tip = container.find(options[\"completness-tip\"]).val();\n\n }", "get profiles() {\r\n return this.create(UserProfileQuery);\r\n }", "getProfileSuggestions(profile) {\n const profileSuggestions = [];\n if (!profile) {\n return profileSuggestions;\n }\n\n if (profile.username) {\n const usernameSuggestions = getSuggestionsSplitByMultiple(profile.username.toLowerCase(), Constants.AUTOCOMPLETE_SPLIT_CHARACTERS);\n profileSuggestions.push(...usernameSuggestions);\n }\n [profile.first_name, profile.last_name, profile.nickname].forEach((property) => {\n const suggestions = getSuggestionsSplitBy(property.toLowerCase(), ' ');\n profileSuggestions.push(...suggestions);\n });\n profileSuggestions.push(profile.first_name.toLowerCase() + ' ' + profile.last_name.toLowerCase());\n\n return profileSuggestions;\n }", "append(item) {\n }", "function addToList(blueArea) {\n\tguesses.push(blueArea);\n\t$(\"#count\").text(guesses.length);\n\t$(\"ul#guessList\").append(\"<li>\" + blueArea + \"</li>\");\n}", "function appendGuess(guess) {\n\t\tguesses.push(guess);\n\t\t$('#guessList').append('<li>' + guess + '</li>');\n\t}", "function add(pokemon) {\n pokemonList.push(pokemon);\n }", "function add(pokemon) {\n pokemonList.push(pokemon);\n }", "[LOAD_PROFILE_INFO](context, payload) {\n context.commit(GET_PROFILE_INFO, payload); \n }", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_ENTREPRISE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function addToFollowPage(id) {\n const list = JSON.parse(localStorage.getItem('followPage')) || []\n const user = users.find((user) => user.id === id)\n \n if (list.some((user) => user.id === id)) {\n return alert(\"Already followed.\")\n }\n list.push(user)\n localStorage.setItem('followPage', JSON.stringify(list))\n }", "function addObjectInList(list, object) {\n if (object) {\n list.push(object);\n }\n }", "function append(element) {\n\tthis.dataStore[this.listSize++] = element;\n}", "async function handleAddProfile(newProfileData) {\n const newProfile = await profileService.create(newProfileData);\n console.log(newProfile)\n history.push(\"/\");\n }", "function append(element) {\n this.dataStore[this.listSize++] = element;\n}", "function addToRegisteredUsers( obj ) {\n\t// alter this function if mongoDB is used later\n\tconsole.log(\"pushing the new user to the storage\");\n\tregisteredUsers.push(obj);\n\t//obj = {};\n}", "function submitProfile(newProfile) {\n }", "function addPerson(people, personToAdd){\n\t\treturn [...people, personToAdd]\n\t}", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "function push(list, item) {\n list.push(item);\n}", "add(value){\n if(!this.has(value)){\n this.members.push(value);\n }\n }", "function addOne(tweeps, theOne)// tweeps here only belongs to this function it doesnt mean the global tweeps. any name would do\n{\n tweeps.push(theOne)\n return tweeps;\n}", "function addOne(tweeps, theOne)// tweeps here only belongs to this function it doesnt mean the global tweeps. any name would do\n{\n tweeps.push(theOne)\n return tweeps;\n}", "function addToPimped(id) {\n\tvar pimped = getPimpedList()\n\tpimped[id] = true;\n\tsetPimpedList(pimped);\n}", "function append(list, value) {\n while (list.next) {\n list = list.next;\n }\n list.next = new LinkedList(value);\n}", "function getUserProfile(id) {\n console.log(id);\n let profile = [{\n firstName: 'bran',\n lastName: 'Lee',\n email: 'bl@gmail.com',\n password: '1234',\n country: 'canada',\n birthDate: '10/11/1998',\n description: 'Test',\n post: '3',\n message: '5',\n like: '10',\n imageURL: 'https://randomuser.me/api/portraits/med/men/62.jpg'\n }];\n return profile;\n}" ]
[ "0.74825114", "0.68396777", "0.6788901", "0.65672934", "0.63543403", "0.62696093", "0.6196134", "0.6146733", "0.61103535", "0.605347", "0.5871462", "0.58407044", "0.57896614", "0.5737176", "0.5734181", "0.5618927", "0.56093657", "0.56024736", "0.5590593", "0.5580317", "0.55762607", "0.55559576", "0.55139786", "0.55048275", "0.5483377", "0.5476046", "0.5461986", "0.54498005", "0.5417212", "0.54115814", "0.54097843", "0.5382425", "0.53541344", "0.5337777", "0.5336022", "0.53324485", "0.5330952", "0.53300214", "0.5324449", "0.5323842", "0.5320748", "0.5317591", "0.53102237", "0.5299657", "0.52962136", "0.5293563", "0.5289707", "0.5281687", "0.5272537", "0.52523696", "0.52521306", "0.5251224", "0.5242336", "0.52287275", "0.5226893", "0.5214498", "0.52132833", "0.52094156", "0.519576", "0.5193203", "0.5190911", "0.51893646", "0.5187255", "0.518668", "0.5185078", "0.51781267", "0.5177498", "0.5164563", "0.51609397", "0.51601076", "0.5159764", "0.5159206", "0.5157649", "0.5157433", "0.5152782", "0.5146977", "0.51464665", "0.51441014", "0.5140805", "0.51397085", "0.5139078", "0.5139078", "0.5135025", "0.51298153", "0.51264143", "0.51163197", "0.51163113", "0.51157475", "0.5114655", "0.51077485", "0.51048976", "0.51048756", "0.5093137", "0.509159", "0.5087814", "0.5083514", "0.5083514", "0.5074026", "0.5070763", "0.5066511" ]
0.7308846
1
Get a profile from storage using its name then add its data to the input fields
function getProfile(profileId) { let store = browser.storage.local.get({ profiles: [] }); store.then(function(results) { var profiles = results.profiles; for (var i = 0; i < profiles.length; i++) { if (profileId == profiles[i].id) { regexInput.value = profiles[i].regex; templateInput.value = profiles[i].template; globalCheckbox.checked = profiles[i].globalFlag; caseInsensitiveCheckbox.checked = profiles[i].caseInsensitiveFlag; multilineCheckbox.checked = profiles[i].multilineFlag; IgnoreHTMLCheckbox.checked = profiles[i].IgnoreHTML ? true : false; break; } } }, onError); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadProfileData() {\n\ttry {\n\t\tvar userData = localStorage.getItem(\"profile\");\n\t\tvar user = JSON.parse(userData);\n\t\tif(user != undefined || user != null) {\n\t\t\tdocument.getElementById(\"profileName\").value = user.name;\n\t\t\tdocument.getElementById(\"userAge\").value = user.age;\n\t\t\tdocument.getElementById(\"userPhone\").value = user.phoneno;\n\t\t\tdocument.getElementById(\"userMail\").value = user.email;\n\t\t\tdocument.getElementById(\"userAddress\").value = user.address;\n\t\t\tdocument.getElementById(\"userImg\").value = user.imagefile;\n\t\t\t}\n\t} catch (e) {\n\t\tconsole.log(e);\n\t}\t\n}", "function Load_Data()\n{\n let data = storage.textContent;\n profile = JSON.parse(data);\n\n let tempName = profile.name;\n if (tempName != \"empty\")\n {\n name.value = tempName;\n }\n\n let tempAge = profile.age;\n if (tempAge != 0)\n {\n age.value = tempAge;\n }\n\n let tempPetName = profile.petName;\n if (tempName != \"empty\")\n {\n petName.value = tempPetName;\n }\n\n let tempFavCol = profile.favoriteColor;\n if (tempName != \"empty\")\n {\n favoriteColor.value = tempFavCol;\n }\n\n let tempFavFood = profile.favoriteFood;\n if (tempName != \"empty\")\n {\n favoriteFood.value = tempFavFood;\n }\n}", "function addProfile(profile) {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n profiles.push(profile);\r\n let store = browser.storage.local.set({\r\n profiles\r\n });\r\n store.then(null, onError);\r\n displayProfiles();\r\n });\r\n}", "get profile() {\n const value = this.get(PROFILE_STORAGE_KEY);\n\n if (value) {\n const profile = new UserProfile();\n\n // Patch in the values\n Object.assign(profile, JSON.parse(value));\n\n return profile;\n }\n }", "function add_user() {\n\tif (typeof(Storage) !== \"undefined\") {\n\t\t// get info from html and make profile object\n\t\tvar profile = {\n\t\t\tname: $(\"#firstname\")[0].value + \" \" +\n\t\t\t $(\"#middlename\")[0].value + \" \" + \n\t\t\t $(\"#lastname\")[0].value, \n\t\t\tbday: $(\"#birth\")[0].value,\n\t\t\tinterests: []\n\t\t};\n\t\t// update local storage\n\t\tlocalStorage.setItem(\"profile\", JSON.stringify(profile));\n\t}\n\telse {\n\t\tconsole.log(\"Local Storage Unsupported\")\n\t}\n\n}", "static addProfileToStorage(profile) {\n let profiles;\n // When first profile is added or if there is no profiles key in local storage, assign empty array to profiles\n if (localStorage.getItem('profiles') === null) {\n profiles = [];\n } else {\n // Get the existing profiles to the array\n profiles = JSON.parse(localStorage.getItem('profiles'));\n }\n // Adding new profile\n profiles.push(profile);\n console.log(profiles)\n localStorage.setItem('profiles', JSON.stringify(profiles));\n }", "function setDataFromLocalStorage() { \t\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setDataFromLocalStorage\");\n \t$(\"#name\").val(gameData.data.player.profile.name);\n \t$(\"#surname\").val(gameData.data.player.profile.surname);\n \t$(\"#age\").val(gameData.data.player.profile.age);\n \t$(\"#sex\").val(gameData.data.player.profile.sex);\n \t$(\"#mobile\").val(gameData.data.player.profile.mobile); \n \t \t \t\n }", "function Save_Data()\n{\n //handles setting profile's variable to entered name\n let tempName = name.value;\n if(tempName != \"\")\n {\n profile.name = tempName;\n }\n\n //sets profile's age to entered age\n let tempAge = Number(age.value);\n if ((tempAge != 0) && (tempAge != NaN))\n {\n profile.age = tempAge;\n }\n\n //sets profile's pet name to entered name\n let tempPetName = petName.value;\n if (tempName != \"\")\n {\n profile.petName = tempPetName;\n }\n\n //sets profile's favorite color to entered color\n let tempFavCol = favoriteColor.value;\n if (tempName != \"\")\n {\n profile.favoriteColor = tempFavCol;\n }\n\n //sets profile's favorite food to entered food\n let tempFavFood = favoriteFood.value;\n if (tempName != \"\")\n {\n profile.favoriteFood = tempFavFood;\n }\n\n //turns the profile object into json tet format and is displayed onto the page\n let json = JSON.stringify(profile);\n storage.textContent = json;\n}", "function myprofile(){\n\tuser_profile.style.display = 'block'\n\tvar user=JSON.parse(localStorage.getItem('User'));\n\tdocument.getElementById('profile_name').innerHTML=user.fullName;\n\tdocument.getElementById('profile_phone').innerHTML=user.phone;\n\tdocument.getElementById('profile_email').innerHTML=user.email;\n\tdocument.getElementById('profile_password').value=user.password;\n}", "getProfile() {\n return JSON.parse(localStorage.getItem(PROFILE_KEY));\n }", "static getProfile() {\n // Retrieves the profile data from localStorage\n const profile = localStorage.getItem('profile')\n return profile ? JSON.parse(localStorage.profile) : {}\n }", "function getProfileData() {\n // obtener los datos del usuario al iniciar sesión\n IN.API.Raw(\"people/~:(first-name,last-name,id,num-connections,picture-url,location,positions,summary,public-profile-url)\").result(onSuccess).error(onError); \n }", "function getProfile( profile_name ) {\n var rval;\n \n if( typeof localStorage !== 'undefined' ) {\n rval = JSON.parse( localStorage.getItem('profile_' + profile_name) );\n if( rval == null ) {\n rval = JSON.parse( localStorage.getItem( 'profile_Default') );\n if( rval == null ) {\n // create and save a default set now...\n localStorage.setItem( 'profile_Default', JSON.stringify(DefaultProfile) );\n rval = DefaultProfile;\n }\n } \n \n } else {\n // no local storage SHOULD NEVER HAPPEN!\n //console.log('What??? No local storage?');\n rval = DefaultProfile;\n }\n \n return rval;\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"firstName\", \"lastName\", \"id\").result(onSuccess).error(onError);\n}", "function preloadName(){\n\tdocument.getElementById(\"cardname\").value = localStorage.getItem(\"firstname\") + \" \" + localStorage.getItem(\"lastname\");\n}", "loadProfile() {\n\t\tconst url = this.user.url;\n\t\treturn solid.fetch(url)\n\t\t\t.then(res => Promise.all([res.text(), res.headers.get('Content-Type')]))\n\t\t\t.then(([contents, contentType]) => loadProfile({ url, contents, contentType }))\n\t\t\t.then(profile => {\n\t\t\t\tObject.assign(this.user, profile);\n\t\t\t\tif (profile.accountName)\n\t\t\t\t\tthis.id = profile.accountName;\n\t\t\t\treturn profile;\n\t\t\t});\n\t}", "function loadMyProfile() {\n\t\t$scope.myProfile = JSON.parse(localStorage.getItem('ynan-profile'));\n\t}", "set profile(value) {\n if (value) {\n this.set(PROFILE_STORAGE_KEY, JSON.stringify(value));\n } else {\n this.remove(PROFILE_STORAGE_KEY);\n }\n }", "function saveProfileInformation(){\n\tvar name = document.getElementById(\"profileName\").value;\n\tvar age = document.getElementById(\"userAge\").value;\n\tvar phoneNumber = document.getElementById(\"userPhone\").value;\n\tvar mailId = document.getElementById(\"userMail\").value;\n\tvar address = document.getElementById(\"userAddress\").value;\n\tvar profileImg = document.getElementById(\"userImg\").value;\n\tvalidateUserProfile(name, age, phoneNumber, mailId, address, profileImg);\n\tif (profileDataValid) {\n\t\tvar user = new User(name, age, phoneNumber, mailId, address, profileImg);\n\t\tlocalStorage.setItem(\"profileData\", JSON.stringify(user));\n\t}\n\telse{\n\t\talert(\"Error saving Data\");\n\t}\n}", "function loadCurrentProfile(e){\n let targetProfile = e.target.title;\n \n if(localStorage.getItem(targetProfile) !== null){\n let currentProfile = localStorage.getItem(targetProfile);\n localStorage.setItem(\"currentProfile\", JSON.stringify(currentProfile));\n }\n else{\n console.log(\"Error: profile not found\");\n }\n}", "function fetchStorage() {\n txtFName.value = localStorage.getItem(\"input-name\");\n txtLName.value = localStorage.getItem(\"input-lastname\");\n txtPhone.value = localStorage.getItem(\"input-phone\");\n txtEmail.value = localStorage.getItem(\"input-email\");\n }", "function loadProfile() {\n if(!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\",profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n }", "function loadProfile() {\n if (!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\", profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n}", "function profile(){\n let login = window.sessionStorage.getItem('login');\n getProfile(login);\n}", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"id\", \"first_name\", \"last_name\", \"num-connections\", \"email-address\", \"industry\", \"location\", \"picture-url\", \"public-profile-url\").result(onSuccess).error(onError);\n}", "function GetDataFromLocalStorage(){\n /*if (storageObject.getItem(\"username\") != null) {\n $(\".usernameval\").val(storageObject.username);\n }\n if (storageObject.getItem(\"password\") != null) {\n $(\".passwordval\").val(storageObject.password);\n }*/\n}", "function loadUserData() {\n const data = JSON.parse(localStorage.getItem('t_b_data'));\n const name = data.payload.data.name;\n const email = data.payload.data.email;\n const number = data.payload.data.number;\n document.querySelector('#userName').innerHTML = name.substr(0, 10) + '.....';\n document.querySelector('#userDetailName').innerHTML = name;\n document.querySelector('#userEmail').innerHTML = email;\n}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"positions:(title)\", \"educations\", \"first-name\", \"last-name\", \"industry\", \"picture-url\", \"public-profile-url\", \"email-address\").result(displayProfileData).error(onError);\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n }", "function setData(profile){\n \tgameData.data.player.profile.name = profile.name;\n \tgameData.data.player.profile.surname = profile.surname;\n \tgameData.data.player.profile.age = profile.age;\n \tgameData.data.player.profile.sex = profile.sex; \t\n \tgameData.data.player.profile.mobile = profile.mobile;\n \tgameData.saveLocal();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setData\");\n \tsetDataFromLocalStorage(); \t\n }", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "function updateProfile (data){\n\tvar fullname = data.name.first + \" \" + data.name.last\n\tfullnameDisp.innerText = fullname\n\tavatar.src = data.picture.medium\n\tusername.innerText = data.login.username\n\tuseremail.innerText = data.email\n\tcity.innerText = data.location.city\n}", "function getProfileData() {\n\tIN.API.Raw(\"/people/~:(email-address)\").result(onSuccess).error(onError);\n}", "function updateProfile(info) {\n setProfile(info);\n }", "function loadProfileInfo() {\n \n if ( localStorage.exsist ) {\n \n $('#create-list').hide(); // hide the red cover\n $('#profile-photo').attr('src', localStorage.myProfileImage);\n $('#title-of-list').html(localStorage.myProfileTitle);\n }else {\n resetProfileInfo();\n }\n \n}", "static getProfile() {\n // console.log(\"getProfile()\");\n return store.get('CURRENT_PROFILE');\n }", "function updateProfileBasics(userData) {\n $('.name').text(userData['name']);\n $('#email').text(userData['email']);\n buildAsLabels(`#interests`, userData['interests'], 'interests');\n buildAsLabels(`#skills`, userData['skills'], 'skills');\n populateExistingImage('profile', '#profile-picture-main');\n}", "function getProfile(profileName, callback) {\n profilesFolder(function (err, profilesFolder) {\n if (err) {\n return callback(err)\n }\n\n var fileUri = path.join(profilesFolder, profileName + \".json\")\n fs.readFile(fileUri, function (err, content) {\n if (err) {\n return callback(err)\n }\n\n safeParse(content, callback)\n })\n })\n}", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "function getProfileData() {\n IN.API.Raw(\"/people/~\").result(onSuccess).error(onError);\n}", "function loadChange(){\n //Cargo los valores de los inputs.\n let perfil = JSON.parse(localStorage.getItem(\"perfil\"))\n if (perfil ){\n document.getElementById(\"perfilNombre\").value = perfil.nombre;\n document.getElementById(\"perfilApellido\").value = perfil.apellido;\n document.getElementById(\"perfilMail\").value = perfil.email;\n document.getElementById(\"perfilTelefono\").value = perfil.telefono;\n\n //Cargo valores debajo de la imagen. \n document.getElementById(\"nombreUserTxt\").innerHTML = perfil.nombre;\n document.getElementById(\"emailUserTxt\").innerHTML = perfil.email;\n }\n}", "function onProfileRequestChange() {\n\n if ((profileRequest.readyState == 4) && (profileRequest.status == 200)) {\n window.profile_data = JSON.parse(profileRequest.responseText);\n\n for (var i = 0; i < inputs.length; i++) {\n var input = inputs[i];\n var fieldname = input.name;\n input.value = window.profile_data[0][fieldname];\n input.addEventListener(\"change\", onChange);\n }\n }\n}", "function displayData() {\n\n if (localStorage.getItem(\"formData\") != null){\n\n let values = JSON.parse(localStorage.getItem(\"formData\"));\n \n nameInput.value = values[values.length-1].inpName;\n emailInput.value = values[values.length-1].inpEmail;\n phoneInput.value = values[values.length-1].inpPhone;\n messageInput.value = values[values.length-1].inpText;\n }\n \n}", "function loadMyProfile() {\n\t\tlet userId = sessionStorage.getItem('userId');\n\n\t\tauthorService.loadAuthorByUserId(userId)\n\t\t\t.then(author => {\n\t\t\t\tdisplayUpdateAuhtorForm(author);\n\n\t\t\t}).catch(handleError);\n\t}", "async function loadFromURL (url) {\n debug(`loading profile from ${url}`)\n\n try {\n var profile = await fetchJSON(url)\n } catch (err) {\n throw new Error(`error loading profile from ${url}: ${err.message}`)\n }\n\n const profileInfo = ProfileInfo.create(profile)\n\n Store.set({\n profileInfo,\n pkgIdSelected: null,\n modIdSelected: null,\n fnIdSelected: null\n })\n\n return profileInfo\n}", "function getUserInput(storage){\n Tag = $(\"#tag-duplicator-tag1-select\").val();\n for (let i = 0; i < storage['values'].length; i++) {\n if(storage['values'][i]['name'] == Tag) {\n getOneTag(storage['values'][i]['id']);\n i = storage['values'].length;\n }\n }\n}", "async save() {\n localStorage.setItem(\"profiles\", JSON.stringify(this.profiles));\n return;\n }", "function save_data() {\n var name = document.getElementById(\"getInfo\")[0].value;\n var lastName = document.getElementById(\"getInfo\")[1].value;\n \n localStorage.setItem(\"name\", name);\n localStorage.setItem(\"lastName\", lastName);\n}", "function ProfileStorage(storage) {\n this.storage = storage;\n}", "function displayProfile(profile) {\n document.getElementById('name').innerHTML = window.profile['displayName'];\n document.getElementById('pic').innerHTML = '<img src=\"' + window.profile['image']['url'] + '\" />';\n document.getElementById('email').innerHTML = email;\n toggleElement('profile');\n}", "function updateProfile() {\n\t\tif (newName.value!=\"\") {\n\t\t\tname.innerHTML = newName.value;\n\t\t}\n\t\tif (newEmail.value!=\"\") {\n\t\t\temail.innerHTML = newEmail.value;\n\t\t}\n\t\tif (newPhone.value!=\"\") {\n\t\t\tphone.innerHTML = newPhone.value;\n\t\t}\n\t\tif (newZipcode.value!=\"\") {\n\t\t\tzipcode.innerHTML = newZipcode.value;\n\t\t}\n\t\tif (newPassword.value!=\"\") {\n\t\t\tpassword.innerHTML = newPassword.value;\n\t\t}\n\t\tif (newPwconfirm.value!=\"\") {\n\t\t\tpwconfirm.innerHTML = newPwconfirm.value;\n\t\t}\n\n\t\tnewName.value = \"\";\n\t\tnewEmail.value = \"\";\n\t\tnewPhone.value = \"\";\n\t\tnewZipcode.value = \"\";\n\t\tnewPassword.value = \"\";\n\t\tnewPwconfirm.value = \"\";\n\t}", "function setProfileFromLS() {\n if (\n localStorage.getItem('customer') != null &&\n localStorage.getItem('customer') != 'undefined'\n ) {\n let localST = JSON.parse(localStorage.getItem('customer'))\n $('#validationCustom01').val(localST.firstName)\n $('#validationCustom02').val(localST.lastName)\n $('#validationCustom03').val(localST.email)\n $('#validationCustom04').val('*************')\n $('#validationCustom05').val(localST.number)\n $('#validationCustom06').val(localST.address.street)\n $('#validationCustom07').val(localST.address.city)\n $('#validationCustom08').val(localST.address.zipcode)\n $('#welcomeText').text('Hej ' + localST.firstName + ' ' + localST.lastName)\n $('#welcomeEmail').text(localST.email)\n }\n}", "function getUser(userName) {\n localStorage.setItem('savedName', userName);\n document.getElementById('keyLoc').innerHTML = userName;\n}", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function getProfile(profileName) {\n var file = chain(profilesFolder, function (profilesFolder) {\n var fileUri = path.join(profilesFolder, profileName + \".json\")\n return fs.readFile.bind(null, fileUri)\n })\n\n return chain(file, safeParse)\n}", "function searchByName(name, view){\n var token = localStorage.getItem(\"token\") || \"\";\n var url = (name === \"\") ? \"/api/\" + view : \"/api/\" + view + \"/name/\" + name;\n axios.request({\n method: \"GET\",\n url: url,\n headers: {'token': token}\n }).then(function(res){\n _profiles = res.data;\n ProfileStore.emit(MainConstant.DASHBOARD.UPDATE);\n }).catch(function(err){\n console.log(err);\n });\n}", "function userSavedProfile() {\n\n nameItem[0].value = JSON.parse(localStorage.getItem('saveName'));\n ageItem[0].value = JSON.parse(localStorage.getItem('saveAge'));\n genderItem[0].value = JSON.parse(localStorage.getItem('saveGen'));\n htFtItem[0].value = JSON.parse(localStorage.getItem('saveFt'));\n htInItem[0].value = JSON.parse(localStorage.getItem('saveIn'));\n weightItem[0].value = JSON.parse(localStorage.getItem('saveWt'));\n\n nameItem[0].style = 'background-color:white';\n ageItem[0].style = 'background-color:white';\n genderItem[0].style = 'background-color:white';\n htFtItem[0].style = 'background-color:white';\n htInItem[0].style = 'background-color:white';\n weightItem[0].style = 'background-color:white';\n\n}", "function setProfilePlayerDataFromValues(){\n \tgameData.data.player.profile.name = $(\"#name\").val();\n \tgameData.data.player.profile.surname = $(\"#surname\").val();\n \tgameData.data.player.profile.sex = $(\"#sex\").val();\n \tgameData.data.player.profile.age = $(\"#age\").val(); \n \tgameData.data.player.profile.mobile = $(\"#mobile\").val();\n \tgameData.data.synch.profile = CORE.getCurrentTime();\n \tgameData.saveLocal();\n \t\n \tgameData.pushProfile();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setProfilePlayerDataFromValues\");\n }", "function saveProfile(profile) {\n }", "function fetchUserDetails() {\n var lsUser = localStorage.getItem('wceUser');\n var user = JSON.parse(lsUser);\n\n if (isRealValue(user)){\n $('#user_event_first_name').val(user.first);\n $('#user_event_last_name').val(user.last);\n $('#user_event_user_email').val(user.email);\n }\n}", "function getName(profile) {\n return profile.name;\n}", "function addProfileClicked ()\n{\n\tif(!project.STAProfiles){\n\t\tproject.STAProfiles=[];\n\t}\n\t//get data and add to json\n\tproject.STAProfiles.push(\n\t\t{\n\t\t\t'id':makeid(),\n\t\t\t'SSID':$('#SSIDText').val(),\n\t\t\t'SecurityKey':$('#SecurityText').val(),\n\t\t\t'SecurityType':$('#SecurityTypeSelect').val(),\n\t\t\t'ProfilePriority':$('#ProfilePriorityText').val()\n\t\t}\n\t);\n\t//reload the list\n\tloadDeviceRoleSettingsSTA();\n\t//save project\n\tsaveProjectAPI();\n}", "function ProfileData() {\r\n}", "function showData(){\n let name = sessionStorage.getItem('Name')\n let passwd = sessionStorage.getItem('Password') \n \n if(sessionStorage.getItem(\"url\") !== null){\n let profilePictureUrl = sessionStorage.getItem('url') //===\n $('#profilePicture').attr('src',profilePictureUrl)\n }\n $('#myFile').change( function(e) {\n var imgSrc = URL.createObjectURL(e.target.files[0]);\n $('#profilePicture').attr('src', imgSrc);\n sessionStorage.removeItem('url') //=====\n sessionStorage.setItem('url',imgSrc) //======\n });\n\n\n\n $('#usrData').text(''); \n $('#usrData').append(\n `<tr id='oldData'>\n <td> ${name}</td>\n <td> ${passwd}</td>\n <td> <button class='btn btn-primary' onclick = \"editUsrData()\" id='edit'> Edit </button> </td>\n </tr>` +\n\n `<tr id = 'inputData' style='display:none'>\n <td> <input name='newName' type='text' value='${name}'></td>\n <td> <input name='newPassword' type='text' value='${passwd}'></td>\n <td> <button class='btn btn-primary' onclick=\"saveUsrData()\"> Save </button> </td>\n <td> <button class='btn btn-primary' onclick=\"cancelUsrData()\"> cancel </button> </td>\n </tr>` \n )\n}", "function load_profile_from_device(path)\n{\n var data = {};\n data[\"path\"] = path;\n \n close_modal();\n \n $.post({\n url: \"api/get_file\", \n data: data,\n complete: function(res){\n \t$(\"#profile-name\").val(path.slice(path.lastIndexOf(\"/\") + 1, path.indexOf(\".cfg\")));\n load_from_string(res.responseText);\n }\n });\n}", "function loadName() {\n\n //First get local storage name to have it right now.\n let name = 'Friend'\n let localName = localStorage.getItem('name')\n if (localName) {\n name = localName\n }\n emit('name-changed', name)\n\n //Then check chrom storage.\n if (!chrome.storage) return\n chrome.storage.sync.get(['name'], function(item) {\n\n if (item.name && item.name !== null) {\n name = item.name\n emit('name-changed', name)\n }\n })\n\n}", "function getName() {\r\n if (localStorage.getItem('name') === null) {\r\n name.textContent = '[enter name]';\r\n }\r\n else {\r\n name.textContent = localStorage.getItem('name');\r\n }\r\n}", "function readURLProfile(input) {\r\n if (input.files && input.files[0]) {\r\n var reader = new FileReader();\r\n\r\n reader.onload = function (e) {\r\n $('#wizardPicturePreview1').attr('src', e.target.result).fadeIn('slow');\r\n }\r\n reader.readAsDataURL(input.files[0]);\r\n }\r\n}", "async function updateDetails() {\n const profileObj = {};\n profileObj.id = util.currentProfile;\n profileObj.name = document.querySelector('#nameOption').value;\n profileObj.breed = document.querySelector('#breed').value;\n profileObj.location = document.querySelector('#location').value;\n profileObj.likes = document.querySelector('#likes').value;\n profileObj.dislikes = document.querySelector('#dislikes').value;\n profileObj.aboutme = document.querySelector('#aboutme').value;\n profileObj.birthday = document.querySelector('#birthday').value;\n profileObj.sex = document.querySelector('#sex').value;\n\n console.log(profileObj);\n const response = await util.updateProfileByUUID(profileObj);\n console.log('Response: ', response);\n showProfile();\n}", "function loadDinerData(data) {\n console.log(data)\n Array.from(profile_item).forEach(e => {\n if (e.name) {\n e.value = data[e.name]\n }\n });\n let msg = document.getElementById('welcome-msg')\n let email = document.getElementById('welcome-email')\n msg.innerHTML = `Welcome, ${data['first_name']}!`\n email.innerHTML = data['email']\n\n let gender = localStorage.getItem('diner_profile_img')\n let profile_img = document.getElementById('welcome-img');\n console.log(gender)\n if (gender == 'true') {\n profile_switch.checked = true\n profile_img.src = '../../static/images/person_male.png'\n } else {\n profile_img.src = '../../static/images/person_female.png'\n profile_switch.checked = false\n }\n}", "updateProfile() {}", "autofill() {\n\t\tif (localStorage.getItem(\"lastname\")) {\n\t\t\t$(\"#lastName\").val(localStorage.getItem(\"lastname\"));\n\t\t\t$(\"#firstName\").val(localStorage.getItem(\"firstName\"));\n\t\t}\n\t}", "async function getname() {\n let modified_url2 = url_info + handle_name;\n\n const jsondata2 = await fetch(modified_url2);\n const jsdata2 = await jsondata2.json();\n let name = jsdata2.result[0].firstName || \"user\";\n\n let user = document.querySelector(\".user\");\n let user_avatar = document.querySelector(\".user_avatar\");\n let str = jsdata2.result[0].titlePhoto;\n let p = \"http://\";\n str = str.substr(2);\n let arr = [p, str];\n let stt = arr.join(\"\");\n user_avatar.innerHTML = `<img src=\"${stt}\" class=\"avatar\"></img>`;\n user.innerHTML = name;\n }", "function populateAccount(data){\n\t//e.preventDefault();\n\t\tconst keys = Object.keys(data);\n\t\tconst length = keys.length;\n//start at 1 to skip the userId key and length -2 to avoid las 2 key values\n\t\tfor(let i = 1; i < length - 2; i++){\n\t\t const key = keys[i]\n\t\t document.getElementById(key).value = data[key];\n\t\t}\n}", "function getName() {\n if (localStorage.getItem('name') !== null) {\n name.textContent = localStorage.getItem('name');\n }\n}", "async function createProfileElement(profile) {\n const template = document.querySelector('#profile-item');\n const clone = document.importNode(template.content, true);\n clone.querySelector('.dogProfile').id = `profile-${profile.pro_id}`;\n clone.querySelector('#name').textContent = `${profile.pro_name}, ${util.getAgeFromDate(\n profile.pro_birthday,\n )}`;\n clone.querySelector('#breed').textContent = profile.pro_breed;\n clone.querySelector('#birthday').textContent = profile.pro_birthday;\n clone.querySelector('#sex').textContent = profile.pro_sex;\n\n const imageObj = await util.getProfilePicById(profile.pro_id);\n let profilePicSrc;\n !imageObj\n ? (profilePicSrc = './images/user.png')\n : (profilePicSrc = `./uploadedImages/${imageObj.img_id}.${imageObj.img_ext}`);\n\n clone.querySelector('#profilePicElement').src = profilePicSrc;\n\n document.querySelector('#userProfileArea').appendChild(clone);\n}", "function addProfiles(data) {\n console.log(` Adding: Profile ${data.firstName} for (${data.owner})`);\n Profiles.collection.insert(data);\n}", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "function getName() {\r\n if(localStorage.getItem('name') === null){\r\n name.textContent = '[Enter Name]';\r\n } else {\r\n name.textContent = localStorage.getItem('name');\r\n }\r\n}", "function register() {\n\tvar nameValue = document.getElementById(\"name\").value;\n\tvar nameGiftValue = document.getElementById(\"name_gift\").value;\n\n\tvar spouseNameValue = document.getElementById(\"spouse_name\").value;\n\tvar spouseGiftValue = document.getElementById(\"spouse_name_gift\").value;\n\n\tuser_data = JSON.parse(localStorage.getItem(\"user_data\"));\n\tif (!user_data) {\n\t\tuser_data = [];\n\t}\n\t\n\tuser_data.push({\n\t\tname: nameValue,\n\t\tgift: nameGiftValue,\n\t\tspouse: spouseNameValue,\n\t\tspouse_gift: spouseGiftValue\n\t});\n\n\tlocalStorage.setItem(\"user_data\", JSON.stringify(user_data));\n\tlocalStorage.setItem(\"all_users\", JSON.stringify(getUserList(user_data)));\n}", "function create(){\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = instance.extract($rootScope.account.authData);\n\n // INITIALIZE\n $rootScope.db.users.child(uid).set(profile);\n $rootScope.account.profile = profile;\n }", "function addProfileToAList(profile) {\r\n var listItem = document.createElement(\"li\");\r\n listItem.innerHTML = '<a href=\"#\" class=\"profile\" storageID=\"' + profile.id + '\">' + profile.name + '</a>';\r\n profilesList.appendChild(listItem);\r\n}", "function displayProfile(profile){\n \t// console.log(\"name:\" + profile['displayName']);\n \t// console.log(\"email: \"+ email);\n \tuserName = profile['displayName'];\n \tuserID = email;\n \tGplusLoggedin = true;\n \tloginSuccessFul();\n \t\n \t\n \tcheckIfUserInDB(userID);\n \t\n \t// console.log();\n \t\n // document.getElementById('name').innerHTML = profile['displayName'];\n // document.getElementById('pic').innerHTML = '<img src=\"' + profile['image']['url'] + '\" />';\n // document.getElementById('email').innerHTML = email;\n \n }", "function display_name()\n{\n // localStorage.clear();\n let username=document.getElementById(\"username\").value;\n // alert(username)\n localStorage.setItem('username', username);\n}", "function getDataProfile() {\n loader(1);\n //alert(accessToken);\n\t\tvar term = null;\n\t\t$.ajax({\n\t\t\turl: 'https://www.googleapis.com/oauth2/v1/userinfo?alt=json&access_token=' + accessToken,\n\t\t\ttype: 'GET',\n\t\t\tdata: term,\n\t\t\tdataType: 'json',\n\t\t\terror: function(jqXHR, text_status, strError) {\n //alert(JSON.stringify(jqXHR));\n //alert(JSON.stringify(text_status));\n //alert(JSON.stringify(strError));\n disconnectUser();\n\t\t\t},\n\t\t\tsuccess: function(data) {\n\t\t\t\tvar item;\n\t\t\t\tconsole.log(JSON.stringify(data));\n\t\t\t\t//alert(JSON.stringify(data));\n\t\t\t\t// Save the userprofile data in your localStorage.\n\t\t\t\t/* localStorage.gmailLogin = \"true\";\n\t\t\t\tlocalStorage.gmailID = data.id;\n\t\t\t\tlocalStorage.gmailEmail = data.email;\n\t\t\t\tlocalStorage.gmailFirstName = data.given_name;\n\t\t\t\tlocalStorage.gmailLastName = data.family_name;\n\t\t\t\tlocalStorage.gmailProfilePicture = data.picture;\n\t\t\t\tlocalStorage.gmailGender = data.gender; */\n\t\t\t\tdisconnectUser();\n\t\t\t\tGoogleName = data.given_name+' '+data.family_name;\n\t\t\t\tGoogleEmail = data.email;\n\t\t\t\tGoogleId = data.id;\n\t\t\t\tImgUser = data.picture;\n\t\t\t\tSignInDirect('google');\n\t\t\t}\n\t\t});\n\t}", "async function fetchProfileData() {\n try {\n const response = await Axios.post(`/profile/${username}`, { token: appState.user.token }, { cancelToken: postRequest.token })\n setState(draft => {\n draft.profileData = response.data\n })\n } catch (error) {\n console.log(\"There was a problem retrieving user data or user cancelled\")\n }\n }", "function showUserForm() {\n let user = null;\n\n // Try getting user object back from storage.\n try {\n user = JSON.parse(localStorage.getItem(\"user\"));\n } catch (e) {\n alert(\"Error loading from user information from storage.\");\n console.log(e);\n }\n\n // If the user object exists and isn't a null reference\n // update the form information with the user info.\n if (user != null) {\n $(\"#txtFirstName\").val(user.FirstName);\n $(\"#txtLastName\").val(user.LastName);\n $(\"#dateBirthday\").val(user.Birthdate);\n $(\"#txtNewPIN\").val(user.PIN);\n $(\"#sldMaxHoursPerDay\").val(user.HoursGoal);\n $(\"#sldMaxHoursPerDay\").slider(\"refresh\");\n }\n}", "function updateDatProfile(you, them) {\n var uidURL = you.uid;\n var updateProfileRef = new Firebase('https://carousel-of-love.firebaseio.com/Users/'+uidURL+'/');\n\n // Update the profile with all the values from the input fields\n updateProfileRef.set({\n \"About\" : $(\"textarea[name='profile']\").val(),\n \"Age\" : $(\"input[name='age']\").val(),\n \"Animals\" : $(\"input[name='animals']\").val(),\n \"FName\" : $(\"input[name='fname']\").val(),\n \"Job\" : $(\"input[name='job']\").val(),\n \"Juggle\" : $(\"input[name='juggle']\").val(),\n \"LName\" : $(\"input[name='lname']\").val(),\n \"Likes\" : \"\",\n \"Matches\" : \"\",\n \"Photo\" : $(\"input[name='Photo']\").val(),\n \"Spaces\" : $(\"input[name='small-space']\").val(),\n \"uid\": uidURL\n });\n \n }", "function saveName(text) {\n localStorage.setItem('currentUser', text);\n}", "function profileChipPopulate() {\n var profileStore = retrieveProfileInfo();\n var activity = makeGerund(profileStore.style);\n var userProfString = profileStore.firstName + \", \" + profileStore.age + \" | \" + \"Exploring \" + activity + \" \" + profileStore.venue + \"s\";\n $(\"#userProfile\").text(userProfString);\n}", "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "function retrieve()\n{\n ajax.get('api/profile', { id: cookieGetLoggedUserID() }, function (response)\n {\n if (response !== null)\n {\n document.getElementById('firstname').value = response.split(\" \")[0];\n document.getElementById('lastname').value = response.split(\" \")[1];\n document.getElementById('git').value = response.split(\" \")[2];\n document.getElementById('fb').value = response.split(\" \")[3];\n }\n }); \n}", "static async saveProfile(username, data) {\n let res = await this.request(`users/${username}`, data, \"patch\");\n return res.user;\n }", "function ProfileStorage(storage) {\n\t this.storage = storage;\n\t}", "getData() {\n const key = `${this.props.walletProxy}-profile-data`\n const data = localStore.get(key)\n\n if (hasDataExpired(data)) {\n // Clearing out old data\n localStore.set(key, undefined)\n\n const profile = pick(this.state, [\n 'firstName',\n 'lastName',\n 'description',\n 'avatarUrl'\n ])\n\n const attestations = (this.state.verifiedAttestations || []).map(\n attestation => attestation.rawData\n )\n\n return {\n profile,\n attestations\n }\n }\n\n return pick(data, ['attestations', 'profile'])\n }", "function populateGuestNameRandom() {\n\tvar randomNameURI = usersURI + \"/random_name\";\n\tvar getting = $.get(randomNameURI);\n\t//Gets name value\n\tgetting.done(function(data) {\n\t\tvar name = JSON.parse(JSON.stringify(data));\n\t\t$(\"#guest-username-input\").val(name.fullname);\n\t});\n}", "function professionPeoples() {\r\n var profession = document.getElementById(\"profession\");\r\n profession[localStorage.getItem(\"save\")];\r\n console.log(profession.value);\r\n localStorage.setItem(\"profession\", profession.value);\r\n \r\n }" ]
[ "0.69459546", "0.6834408", "0.666196", "0.6636763", "0.658222", "0.6564242", "0.6538307", "0.643693", "0.63872206", "0.6359476", "0.6335426", "0.62667614", "0.62357306", "0.623473", "0.6229562", "0.6228444", "0.6181745", "0.61217964", "0.6081109", "0.6072671", "0.6029728", "0.60244346", "0.5993234", "0.5976943", "0.59754694", "0.597445", "0.5944042", "0.59159774", "0.59117126", "0.59013766", "0.5884069", "0.5884069", "0.5882846", "0.5858255", "0.5842609", "0.5840501", "0.5839772", "0.58374673", "0.5827666", "0.58183515", "0.5813493", "0.5811291", "0.57875866", "0.5779971", "0.5775373", "0.5773246", "0.5741593", "0.5689286", "0.5686132", "0.56857646", "0.56724125", "0.5665244", "0.5664687", "0.5663649", "0.56563973", "0.56555915", "0.5652939", "0.56524754", "0.5649352", "0.5644598", "0.56421286", "0.5640537", "0.5638421", "0.56176084", "0.56151754", "0.5612208", "0.56109697", "0.5599835", "0.5598935", "0.5577183", "0.5575256", "0.5564472", "0.55605304", "0.5535222", "0.55282897", "0.5527277", "0.55191517", "0.5514567", "0.5502953", "0.54974943", "0.5496557", "0.54854465", "0.5484501", "0.5484389", "0.5482465", "0.54817986", "0.54793316", "0.5464474", "0.54609007", "0.5451848", "0.54453194", "0.54425496", "0.54425067", "0.54307795", "0.542923", "0.5417828", "0.5415633", "0.5413946", "0.54131514", "0.5406776" ]
0.6888832
1
to log errors :D
function onError(err) { console.error(err); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function error(msg){\r\n rootLogger.error(msg)\r\n}", "function errorlogging(err) \r\n{\r\n\talert(\"Error processing SQL: Main err\"+err.code);\r\n}", "function logError (err) {\n util.log('error:', err)\n}", "function error_log(error){\n console.log(error.message);\n }", "static logError(error) {\r\n console.log(`[ERROR] Something did not work - \\n`, error);\r\n }", "error_handler(err) {\n console.log(`Problem encountered. Detail:${err.message}`);\n }", "function errorHandler(error) { console.log('Error: ' + error.message); }", "error(...theArgs) { return this._log('ERROR', {}, theArgs); }", "function error(error) {\n console.log(\"Error : \" + error);\n}", "static logError(error) {\n console.log('[ERROR] Looks like there was a problem: \\n', error);\n }", "error(err) {\n this.checkDate();\n console.error(`[${red(`ERROR ${dayjs().format(\"HH:mm:ss\")}`)}]: ${err.message + (err.stack ? \"\\n\"+err.stack.split('\\n').splice(1).join('\\n'):\"\")}\\n`);\n }", "function errorHandler(){\n\tconsole.log (\"Sorry, your data didn't make it. Please try again.\");\n}", "function errorHandler(){\n Logger.log(\"=========================EXAMPLES=========================\")\n Logger.log(\"firebase-engine operations=\\\"clean, restore\\\" path=\\\"./test/utils/vend-park-development.json\\\" services=\\\"firestore, auth\\\" backup=\\\"vend-park-development.backup\\\"\")\n Logger.log(\"firebase-engine o=\\\"b, c\\\" p=\\\"./test/utils/vend-park-development.json\\\"\")\n Logger.log(\"=========================ARGUMENTS========================\")\n Logger.table(arg)\n Logger.log(\"===========================ERROR==========================\")\n}", "error(error) {}", "function _logE(i) { console.error(i); }", "function error(e) { \n console.error('error:'.bold.red, e); \n}", "function errorLog(error){\r\n\tconsole.error.bind(error);\r\n\tthis.emit('end');\r\n}", "LogError() {}", "function err() {\n logWithProperFormatting(out.console.error, '(ERROR)', arguments);\n}", "error(...parameters)\n\t{\n\t\tconsole.log(colors.red(this.preamble, '[error]', generate_log_message(parameters)))\n\t}", "function logError(err) {\n console.error(err);\n}", "error(text) {\n if (this.seenErrors.has(text))\n return;\n this.seenErrors.add(text);\n this.log(text, LogLevel.Error);\n }", "function logErrors (err, req, res, next) {\n //console.error(err.stack)\n console.log(\"caught an erroor\");\n console.log(err.stack)\n next(err)\n}", "function devlog(msg)\n{\n customError(\"Dev\", msg, -1, true, false);\n}", "function errorlog(toAdd) {\n //Print error\n logString += \"<span style='color:red'>\" + \"Error: \" + toAdd + \"</span><br />\";\n //end compile\n if (document.getElementById('machine-code') !== null) {\n document.getElementById('machine-code').id = 'error-log';\n } //no more output will occur\n document.getElementById('hex-code').innerHTML = \"Machine Code was not generated due to an error, see logger for details.\";\n notError = false;\n}", "function error(message) {\n Logger.log(\"ERROR: \" + message);\n}", "function onFail(d) { console.log(\"ERR:ON FAIL\"+d); logm(\"ERR\",1,\"ON FAIL\",d); }", "function logError(err) { if(console && console.log) console.log('Error!', err); return false; }", "function fail() {\n Logger.log(\"fail\");\n}", "function logErr(err) {\n\tfs.appendFile('botErrors.log',err,function(err) {\n\t\tif (err) console.log(\"Error recording error: \",err);\n\t\telse console.log(\"Error logged\");\n\t});\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function error(err) {\n console.warn('ERROR(' + err.code + '): ' + err.message);\n}", "function onError(e) { console.log(e); }", "_logError (msg, url, lineNo, columnNo, error) {\n let log = ErrLogger.getLogs()\n if (!log) {log = { session: [] } }\n log.session.push({\n timestamp: new Date().valueOf(),\n columnNo,\n error: error,\n lineNo,\n message: msg,\n url,\n })\n ErrLogger.setLog(log)\n return true\n }", "onError(error) {\n // console.log('>>ERROR : ', error);\n }", "static error(message) {\n\t\tthis.log(Logger.Level.error, message)\n\t}", "error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "function onError(error) {\n console.log(error);\n }", "function error(err) {\n\t\t// TODO output error message to HTML\n\t\tconsole.warn(`ERROR(${err.code}): ${err.message}`);\n\t\t// let msg = \"If you don't want us to use your location, you can still make a custom search\";\n\t\t// displayErrorMsg(msg);\n\t}", "function errorHandler(error) {\n console.log(error);\n }", "function error() {\n var args = [];\n for (var _i = 0; _i < (arguments.length - 0); _i++) {\n args[_i] = arguments[_i + 0];\n }\n // Short circuit if logging is disabled. This is as close to noop as we can get, incase there is a direct reference to this method.\n if(!tConfig.log.enabled) {\n return;\n }\n if(logLevel >= LEVEL.ERROR) {\n var args = slice.call(arguments);\n args.unshift(cError);\n logRunner.apply(this, args, 'error');\n }\n }", "logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n }", "error(...params) {\r\n console.error(this.getLogStamp(), ...params);\r\n }", "function _logError(message) {\n console.error('[audit.js] ' + message);\n }", "function logerror(content) {\n return logger(content,\" [ERROR] \");\n}", "static error(...args) {\n if (this.toLog('ERROR')) {\n console.error.apply(console, arguments);\n }\n }", "logError(message, meta) {\n this.winstonLogger.log('error', message, meta);\n }", "function logErrors(err, req, res, next) {\n\tconsole.error(err.stack);\n\tnext(err);\n}", "handleAppErrors() {\r\n this.app.on('error', (err, ctx) => {\r\n logger.error(`Application Error: ${ err.name } @ ${ ctx.method }:${ ctx.url }`);\r\n logger.error(err.stack);\r\n });\r\n }", "function onError(error) {\n console.error(\"Error occured: \", error);\n}", "function logError (controller, err, message) {\n controller.log(message)\n controller.log(err)\n}", "function my_log(msg, error) {\n var ln = error.lineNumber;\n var fn = error.fileName.split('->').slice(-1)[0].split('/').splice(-1)[0];\n console.log(fn + \",\" + ln + \": \" + msg);\n}", "function alert_log_error(alert, log) {\n $log.error(\"Alert & Log Error: \", log);\n return;\n }", "function logError(code, message) {\n\tconsole.error(new Date() + \" [HTTP Code: \" + code + \", Message: \" + message + \"]\")\n}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n }", "function error() {\n _error.apply(null, utils.toArray(arguments));\n }", "function eLog(err) {\n if (err) {\n console.log('Redis Error: ' + err);\n }\n}", "function onError(error) {\nconsole.log(`Error: ${error}`);\n}", "function handleError(error){\n\t\tconsole.error(\"[ERROR] \", error);\n\t}", "function error_log(error){\n\t\t\tconsole.log(error.message);\n\t\t\talert(error.message);\n\t\t}", "onerror(err) {\n debug(\"error\", err);\n super.emit(\"error\", err);\n }", "error() {}", "_handle_error(event) {\n let message = event.detail;\n this.$.log.error(message)\n }", "function onErrorRequest(error) {\r\n\t\t\tconsole.log(\"err [\" + error.name + \"] msg[\" + error.message + \"]\");\r\n\t\t}", "function reportError(error) {\n console.error(error);\n }", "function jsLogError(msg) {\n\t//log error\n}", "function showError() {\n console.log(\"error in writing data to the database\")\n}", "function onError(error) {\n console.log(error);\n }", "function onError(error) {\n console.log(error);\n }", "function onError(error) {\n console.log(error);\n }", "function onError(err) {\n console.log(err);\n}", "error(el) {\n\t\tif (this.level >= 1) {\n\t\t\tconst color = \"\\x1b[31m%s\\x1b[0m\"\n\t\t\tconst log = \"Error: \" + el\n\t\t\tconsole.error(color, log)\n\t\t\tthis.writeLog(log)\n\t\t}\n\t}", "function logGridError(e) {\r\n var stErrMsg = \"An error occurred\";\r\n\r\n if (e && e.errors) {\r\n for (var prop in e.errors) {\r\n stErrMsg = e.errors[prop].errors;\r\n }\r\n }\r\n logError(stErrMsg);\r\n}", "function log_error(text) {\n var time = new Date();\n console.error(\"[\" + time.toLocaleTimeString() + \"] \" + text);\n}", "function onError (error) {\n console.log(`An error occurred: ${error}`)\n}", "logError(error) {\n console.error(error);\n return error;\n }", "function handleErrors(error) {\n console.log('Please try again problem occured!');\n}", "function _error(message,error){\r\n if(error){\r\n message += ' ' + JSON.stringify(error);\r\n }\r\n console.log(message);\r\n var logger = _getLogger();\r\n if(logger){\r\n logger.error(message);\r\n }\r\n}", "function errorHandler(err) {\n //alert(\"An error occured\\n\" + err.message + \"\\n\" + err.details.join(\"\\n\"));\n }", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function error(err) {\n console.error(err.stack)\n}", "function errorHandler(data) {\n console.log(\"error: \" + JSON.stringify(data));\n }", "function onError(error) {\n console.log(`Error: ${error}`);\n}", "onError(e) {\n console.log('error =>', e.message);\n }", "onerror() {}", "onerror() {}", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}", "function errorHandler(error) {\n console.log('Error. Result:', error, arguments);\n debugLog(JSON.stringify(error));\n}", "function ErrorHandler() {}", "function log(msg) {\r\n //For us to debug out to browser java console\r\n setTimeout(function () {\r\n throw new Error(msg);\r\n }, 0);\r\n }", "logDiagnostics(err) {\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `Error in stage \"${this.currentStage}\": ${err.description}`);\n for (let i = 0; i < err.errorData.length; i++) {\n systemLog_1.default.error({ doubleIndent: true }, `\"${i}: ${err.errorData[i]}`);\n }\n systemLog_1.default.error({ leadingBlankLine: true, indent: true }, `\"${this.currentStage}\" stage failed. See SystemManager console for additional information.`);\n }", "function logError(err) {\n console.log(err.toString(), err);\n}", "handleCallError(errs, url, method) {\n // TODO: probably we need some logger, now it's just logging to console\n console.log(`Failed calling ${method} for URL:`, url);\n console.log(`Reason:`, errs);\n }", "function logErrors(err, req, res, next) {\n console.error(err.stack);\n next(err);\n}", "function OnErr() {\r\n}", "function logErr(err) {\n\tlet d = new Date();\n\tlet errMsg = \"error occurred at \" + d + \": \" + err;\n\tfs.appendFileSync(\"Error_Log.txt\", errMsg, \"utf8\");\n}", "function logerror(error){\n\t\tif(error.type){\n\t\tvar errorstring='';\n\t\tswitch (error.type) {\n\t\t\t\tcase 1: errorstring='Please use other name, this word '+(error.setname?'\\''+error.setname+'\\'':'')+' is reserved';break;\t\t\t\n\t\t\t\tcase 2: errorstring='This variable name '+(error.setname?'\\''+error.setname+'\\'':'')+' cannot be found';break;\n\t\t\t\tcase 3: errorstring='The range input for this fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is incorrect. The correct format is n to m where n and m represents start and stop points of the range respectively.';break;\n\t\t\t\tcase 4: errorstring='The range input for this fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is not a number';break;\t\t\t\t\n\t\t\t\tcase 5: errorstring='The definition for fuzzy term '+(error.termname?'\\''+error.termname+'\\'':'')+' is not found';break;\n\t\t\t\tcase 6: errorstring='The membership function for this fuzzy term '+(error.termname?'\\''+error.termname+'\\'':'')+' is invalid';break;\n\t\t\t\tcase 7: errorstring='The step size for fuzzy set '+(error.setname?'\\''+error.setname+'\\'':'')+' is not found or invalid';break;\n\t\t\t\tcase 8: errorstring='The point/s defined for '+(error.termname?'\\''+error.termname+'\\'':'')+' term are beyond the fuzzy set range';break;\n\t\t\t\tcase 9: errorstring='There is dimension mismatch in the min operation between 2 fuzzy terms';break;\n\t\t\t\tdefault: errorstring='error';\t\t\t\t\t\n\t\t\t}\t\t\t\n\t\t\talert(errorstring); //temporary. It should not be alerting, instead just keep the error log for debugging purpose\n\t\t}\n\t}", "static get LOG_ERRORS() {\n return false;\n }", "function error(err) {\n console.warn(`ERROR(${err.code}): ${err.message}`);\n}" ]
[ "0.72854203", "0.7235557", "0.7231614", "0.7219788", "0.7082443", "0.70444876", "0.7014929", "0.7005933", "0.6995414", "0.6964137", "0.6909824", "0.68992114", "0.6894756", "0.6855484", "0.68475187", "0.6841918", "0.68389374", "0.68288094", "0.6823875", "0.6817356", "0.6817052", "0.6796739", "0.6793243", "0.6783446", "0.6781486", "0.67774034", "0.6774463", "0.6773799", "0.67613137", "0.6749062", "0.6738086", "0.6738086", "0.673189", "0.671979", "0.6718585", "0.6716887", "0.6709443", "0.6698006", "0.6687428", "0.66869", "0.6686277", "0.6684528", "0.66716605", "0.66671866", "0.6667107", "0.6664801", "0.6656598", "0.66554624", "0.6645376", "0.6641823", "0.6638503", "0.6635905", "0.6634652", "0.66300935", "0.6630035", "0.6629517", "0.6623048", "0.66217804", "0.66201025", "0.6608003", "0.66069967", "0.65972084", "0.6595355", "0.6593083", "0.6589666", "0.6587687", "0.65861565", "0.65690356", "0.6566495", "0.6566495", "0.6566495", "0.65622836", "0.65590763", "0.6545966", "0.6545782", "0.65355414", "0.65347886", "0.65318555", "0.65314204", "0.65196687", "0.6519264", "0.6516633", "0.65157753", "0.6508216", "0.65072805", "0.6506546", "0.6506546", "0.6504222", "0.6501086", "0.6499408", "0.6496156", "0.6491539", "0.649104", "0.64874446", "0.648233", "0.6480207", "0.6471164", "0.6469922", "0.64695334", "0.6467639" ]
0.66241056
56
clicking on cells on a row to select/deselect that row...
checkChanged(indx){ //update checkbox status when checkboxes are checked... this.props.selectionChanged(indx); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _select(e,row) {\n let { checked } = e.target;\n let index = rows.indexOf(row);\n rows[index].checked = checked;\n getCheckedRows();\n }", "selectRow() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableRow();\n }", "function rowSelection(e) {\n var\n // get current HTML row object\n currentRow = this,\n // get current HTML row index\n index = currentRow.offsetTop / (options.rowHeight + options.borderHeight);\n\n if (!options.multiselection)\n // mark all other selected row as unselected \n self.clearSelection();\n\n \n if (! (e.shiftKey || e.metaKey || e.ctrlKey))\n // clear selected row\n self.clearSelection();\n \n if (e.shiftKey && options.multiselection) {\n // Shift is pressed\n var\n _lastSelectedIndex = lastSelectedIndex(),\n // get last selected index\n from = Math.min(_lastSelectedIndex + 1, index),\n to = Math.max(_lastSelectedIndex, index),\n viewPort = getViewPort();\n\n // select all rows between interval\n for (var i = from; i <= to && _currentData[i]; i++) {\n if ($.inArray(i, selectedIndexes()) == -1) {\n selectRow(i);\n if (i >= viewPort.from && i <= viewPort.to) {\n var row = self.rowAt(i);\n $self.trigger('rowSelection', [i, row, true, _currentData[i]]);\n }\n }\n }\n\n } else if (e.ctrlKey || e.metaKey) {\n /* Ctrl is pressed ( CTRL on Mac is identified by metaKey property ) */\n\n // toggle selection\n if ( $.inArray( index, selectedIndexes() ) > -1) {\n unselectRow(index);\n $self.trigger('rowSelection', [index, this, false, _currentData[index]]);\n } else {\n selectRow(index);\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\n }\n\n } else {\n // simple click\n selectRow(index);\n $self.trigger('rowSelection', [index, this, true, _currentData[index]]);\n }\n\n }", "selectCell() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableCell();\n }", "_selectRow(e) {\n let allTr = this.shadowRoot.querySelector('tbody').querySelectorAll('tr');\n let len = allTr.length;\n while (len--) {\n allTr[len].setAttribute('selected', false);\n }\n\n if (e.target.parentElement.parentNode.rowIndex >= 0) {\n e.target.parentElement.parentNode.setAttribute('selected', true);\n this._selectedIndex = e.target.parentElement.parentNode.rowIndex - 1;\n\n if (e.type === 'click') {\n this.dispatchEvent(new CustomEvent('tablerow-selected', {\n detail: this._collection.rawEntity.entities[this._selectedIndex], bubbles: true, composed: true\n }));\n }\n } else if (e.target.nodeName === 'INPUT' && e.target.parentNode.parentElement.parentElement.rowIndex >= 0) {\n this._selectedIndex = e.target.parentNode.parentElement.parentElement.rowIndex - 1;\n }\n\n }", "function select( row, isReselect ) {\n\n var top_row = get_prev_top_row( row );\n var in_select = top_row.nextUntil( '.top' );\n var after_row = get_next_top_row( row );\n var rows = top_row.prevAll()\n .add( after_row.nextAll() );\n\n deselect();\n top_row.addClass( 'selected' );\n in_select.addClass( 'in-selected' );\n after_row.addClass( 'after-selected' );\n rows.addClass( 'dim' );\n\n // TODO change after changing click logic in the rows\n if ( !!isReselect ) {\n var clickable_children = in_select.find( 'td.click' ).parent();\n var open_children = clickable_children.filter( '[data-open=\"true\"]' );\n var close_children = clickable_children.filter( '[data-open=\"false\"]' );\n\n top_row\n .unbind( 'click' )\n .click( hide_children_of );\n after_row.unbind( 'click' );\n open_children.click( hide_children_of );\n close_children.click( show_children_of );\n }\n }", "function MSM_SelecttableClicked(tblRow) {\n //console.log( \"===== MSM_SelecttableClicked ========= \");\n //console.log(\"tblRow: \", tblRow);\n if(tblRow) {\n // toggle is_selected\n const is_selected = (!get_attr_from_el_int(tblRow, \"data-selected\"))\n\n tblRow.setAttribute(\"data-selected\", (is_selected) ? \"1\" : \"0\")\n tblRow.cells[0].children[0].className = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n\n // row 'all' has pk = -9\n if(is_selected){\n const selected_pk_int = get_attr_from_el_int(tblRow, \"data-pk\");\n const selected_is_all = (selected_pk_int === -9);\n const tblBody_select = tblRow.parentNode;\n for (let i = 0, lookup_row; lookup_row = tblBody_select.rows[i]; i++) {\n const lookup_pk_int = get_attr_from_el_int(lookup_row, \"data-pk\");\n if (lookup_pk_int !== selected_pk_int){\n const lookup_is_all = (lookup_pk_int === -9);\n\n // remove tickmark on all other items when 'all' is selected\n // remove tickmark on 'all' when other item is selected\n //let remove_selected = (base_is_all) ? (lookup_base_pk_int !== -9) : (lookup_base_pk_int === -9);;\n let remove_selected = (selected_is_all && !lookup_is_all) || (!selected_is_all && lookup_is_all);\n if(remove_selected){\n lookup_row.setAttribute(\"data-selected\", \"0\");\n lookup_row.cells[0].children[0].className = \"tickmark_0_0\";\n };\n };\n };\n };\n };\n }", "function MSM_SelecttableClicked(tblRow) {\n //console.log( \"===== MSM_SelecttableClicked ========= \");\n //console.log(\"tblRow: \", tblRow);\n if(tblRow) {\n // toggle is_selected\n const is_selected = (!get_attr_from_el_int(tblRow, \"data-selected\"))\n\n tblRow.setAttribute(\"data-selected\", (is_selected) ? \"1\" : \"0\")\n tblRow.cells[0].children[0].className = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\";\n\n // row 'all' has pk = -9\n if(is_selected){\n const selected_pk_int = get_attr_from_el_int(tblRow, \"data-pk\");\n const selected_is_all = (selected_pk_int === -9);\n const tblBody_select = tblRow.parentNode;\n for (let i = 0, lookup_row; lookup_row = tblBody_select.rows[i]; i++) {\n const lookup_pk_int = get_attr_from_el_int(lookup_row, \"data-pk\");\n if (lookup_pk_int !== selected_pk_int){\n const lookup_is_all = (lookup_pk_int === -9);\n\n // remove tickmark on all other items when 'all' is selected\n // remove tickmark on 'all' when other item is selected\n //let remove_selected = (base_is_all) ? (lookup_base_pk_int !== -9) : (lookup_base_pk_int === -9);;\n let remove_selected = (selected_is_all && !lookup_is_all) || (!selected_is_all && lookup_is_all);\n if(remove_selected){\n lookup_row.setAttribute(\"data-selected\", \"0\");\n lookup_row.cells[0].children[0].className = \"tickmark_0_0\";\n };\n };\n };\n };\n };\n }", "function datagrid_deselect_rows(table) {\n\tvar rows = table.fnGetNodes();\n\tfor (var i = 0; i < rows.length; i++) {\n\t\tvar row = rows[i];\n\t\tif (row)\n\t\t\t$(row).removeClass('datagrid_row_selected');\n\t}\n}", "function f_row_select_(grid_p, fila_p) {\n\t$('#' + grid_p).find('tr.selected').removeClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ')').addClass('selected');\n\t$('#' + grid_p + ' tbody tr:eq(' + fila_p + ') td:not(td:first-child)')[0].click();\n\n\tt1 = $('#' + grid_p).DataTable();\n\tvar rowSelected = t1.row().$('tr.selected');\n\t$('#' + grid_p).DataTable().row( $(rowSelected).closest('tr') ).select();\n}", "function selectData() {\r\n\tpreEditBtn.style.pointerEvents = \"none\";\r\n\r\n\t$(tbody).on(\"click\", \"tr\", function() {\r\n\t\t$(\"tr\")\r\n\t\t\t.not(this)\r\n\t\t\t.removeClass(\"selected\");\r\n\t\t$(this).toggleClass(\"selected\");\r\n\t\tif ($(this).hasClass(\"selected\")) {\r\n\t\t\tpreEditBtn.style.pointerEvents = \"auto\";\r\n\t\t} else preEditBtn.style.pointerEvents = \"none\";\r\n\t});\r\n\r\n\t$(\"th\").click((e) => e.stopPropagation()); // stops event bubbling && prevents selecting th\r\n}", "function DoSelection(nextRowIndex){\r\n\t\t\t\t\tif(et.defaultSelection == 'row'){\r\n\t\t\t\t\t\tet.Selection.SelectRowByIndex(nextRowIndex);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tet.ClearSelections();\r\n\t\t\t\t\t\tvar cellIndex = selecteElm.cellIndex;\r\n\t\t\t\t\t\tvar row = o.tbl.rows[nextRowIndex];\r\n\t\t\t\t\t\tif(et.defaultSelection == 'both') et.Selection.SelectRowByIndex(nextRowIndex);\r\n\t\t\t\t\t\tif(row) et.Selection.SelectCell(row.cells[cellIndex]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Table is filtered\r\n\t\t\t\t\tif(o.validRowsIndex.length != o.GetRowsNb()){\r\n\t\t\t\t\t\tvar row = o.tbl.rows[nextRowIndex];\r\n\t\t\t\t\t\tif(row) row.scrollIntoView(false);\r\n\t\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\t\tif(cell.cellIndex==(o.GetCellsNb()-1) && o.gridLayout) o.tblCont.scrollLeft = 100000000;\r\n\t\t\t\t\t\t\telse if(cell.cellIndex==0 && o.gridLayout) o.tblCont.scrollLeft = 0;\r\n\t\t\t\t\t\t\telse cell.scrollIntoView(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "function setSelection(){\r\n\t\t\tif (opts.idField){\r\n\t\t\t\tfor(var i=0; i<data.rows.length; i++){\r\n\t\t\t\t\tvar row = data.rows[i];\r\n\t\t\t\t\tif (contains(state.selectedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).addClass('datagrid-row-selected');\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (contains(state.checkedRows, row)){\r\n\t\t\t\t\t\topts.finder.getTr(target, i).find('div.datagrid-cell-check input[type=checkbox]')._propAttr('checked', true);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfunction contains(a,r){\r\n\t\t\t\tfor(var i=0; i<a.length; i++){\r\n\t\t\t\t\tif (a[i][opts.idField] == r[opts.idField]){\r\n\t\t\t\t\t\ta[i] = r;\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}", "function selectRow(target, index){\r\n\t\tvar grid = $.data(target, 'datagrid').grid;\r\n\t\tvar opts = $.data(target, 'datagrid').options;\r\n\t\tvar data = $.data(target, 'datagrid').data;\r\n\t\tvar selectedRows = $.data(target, 'datagrid').selectedRows;\r\n\r\n\r\n\t\tvar ck = $('.datagrid-body tr[datagrid-row-index='+index+'] .datagrid-cell-check input[type=checkbox]',grid);\r\n\t\tvar change= true;\r\n\t\tif(typeof(opts.onSelectChange)=='function'){\r\n\t\t\tvar c= opts.onSelectChange.call(target, index, data.rows[index],selectedRows);\r\n\t\t\tif(c===false) change=c;\r\n\t\t\tif(!change){\r\n\t\t\t\tck.attr('checked', false);\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//see as focused if selectrow\r\n\t\t$(grid).data(\"focused\",true);\r\n\r\n\t\tvar tr = $('.datagrid-body tr[datagrid-row-index='+index+']',grid);\r\n\t\tif (opts.singleSelect == true){\r\n\t\t\tclearSelections(target);\r\n\t\t}\r\n\t\ttr.addClass('datagrid-row-selected');\r\n\t\tck.attr('checked', true);\r\n\r\n\t\tif (opts.idField){\r\n\t\t\tvar row = data.rows[index];\r\n\t\t\tfor(var i=0; i<selectedRows.length; i++){\r\n\t\t\t\tif (selectedRows[i][opts.idField] == row[opts.idField]){\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tselectedRows.push(row);\r\n\t\t}\r\n\t\topts.onSelect.call(target, index, data.rows[index]);\r\n\t}", "function select_row_internal_fill_external(){\n // select row\n $(\"#internal_table tbody\").on('click', 'tr', function () {\n // if we click on row which is already selected. we desect it\n if($(this).hasClass('selected')){\n //row is deselected. that means there is no selected row in the table\n is_selected_internal = false;\n\n // remove supplier external product table content\n table_external.clear().draw();\n\n // deselect row\n $(this).removeClass('selected');\n\n sel_internal_table_row = null;\n // row is not selected. deselect selected row and select current\n }else{\n //row is selected\n is_selected_internal = true;\n\n table_internal.$('tr.selected').removeClass('selected');\n $(this).addClass('selected');\n\n var data = table_internal.row(this).data();\n // fill supplier external product table content\n fill_supplier_external_product_table(data);\n\n sel_internal_table_row = this;\n }\n });\n}", "function onClickTableRow(event)\n{\n resetTableHighlights();\n var rowElement = event.currentTarget;\n document.selectedIndex = event.currentTarget.rowIndex;\n addRowHighlight(event);\n\n $(\"first_name_element\").value =rowElement.cells[FIRST_NAME_INDEX].innerHTML;\n $(\"last_name_element\").value =rowElement.cells[LAST_NAME_INDEX].innerHTML;\n $(\"phone_number_element\").value =rowElement.cells[PHONE_INDEX].innerHTML;\n $(\"email_element\").value =rowElement.cells[EMAIL_INDEX].innerHTML;\n $(\"age_element\").value =rowElement.cells[AGE_INDEX].innerHTML;\n $(\"id_element\").value =rowElement.cells[ID_INDEX].innerHTML;\n $(\"gender_element\").selectedIndex = getGender(rowElement.cells[GENDER_INDEX].innerHTML);\n\n disableDeleteButton(false);\n disableSaveButton(true);\n disableClearButton(false);\n document.selectedRow = rowElement;\n}", "function selectRow(target, index, notCheck){\r\n\t\tvar state = $.data(target, 'datagrid');\r\n\t\tvar dc = state.dc;\r\n\t\tvar opts = state.options;\r\n\t\tvar selectedRows = state.selectedRows;\r\n\t\t\r\n\t\tif (opts.singleSelect){\r\n\t\t\tunselectAll(target);\r\n\t\t\tselectedRows.splice(0, selectedRows.length);\r\n\t\t}\r\n\t\tif (!notCheck && opts.checkOnSelect){\r\n\t\t\tcheckRow(target, index, true);\t// don't select the row again\r\n\t\t}\r\n\t\t\r\n\t\tvar row = opts.finder.getRow(target, index);\r\n\t\tif (opts.idField){\r\n\t\t\taddArrayItem(selectedRows, opts.idField, row);\r\n\t\t}\r\n\t\topts.finder.getTr(target, index).addClass('datagrid-row-selected');\r\n\t\topts.onSelect.call(target, index, row);\r\n\t\tscrollTo(target, index);\r\n\t}", "function selectrow ($this, state) {\r\n // contextual\r\n !!$($this).data(\"contextual\") ? contextual = $($this).data(\"contextual\") : contextual = \"active\";\r\n\r\n if(state === \"checked\") {\r\n // add contextual class\r\n $($this).parents(target).addClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.selected\", { \"element\": $($this).parents(target) });\r\n } else {\r\n // remove contextual class\r\n $($this).parents(target).removeClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.unselected\", { \"element\": $($this).parents(target) });\r\n }\r\n }", "function selectrow ($this, state) {\r\n // contextual\r\n !!$($this).data(\"contextual\") ? contextual = $($this).data(\"contextual\") : contextual = \"active\";\r\n\r\n if(state === \"checked\") {\r\n // add contextual class\r\n $($this).parents(target).addClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.selected\", { \"element\": $($this).parents(target) });\r\n } else {\r\n // remove contextual class\r\n $($this).parents(target).removeClass(contextual);\r\n\r\n // publish event\r\n $(element).trigger(settings.eventPrefix+\".selectrow.unselected\", { \"element\": $($this).parents(target) });\r\n }\r\n }", "function markSelected(btn) {\n $(\"#itemsTable tr\").removeClass(\"selected\"); // remove seleced class from rows that were selected before\n row = (btn.parentNode).parentNode; // button is in TD which is in Row\n row.className = 'selected'; // mark as selected\n }", "function selectRow(target, index, notCheck, state) {\n if (!state) state = $.data(target, 'datagrid');\n var dc = state.dc;\n var opts = state.options;\n var data = state.data;\n var selectedRows = $.data(target, 'datagrid').selectedRows;\n\n //如果有cannot-select的class属性就不能select\n var tr = opts.finder.getTr(target, index, undefined, undefined, state)\n if(tr.hasClass('cannot-select'))return\n\n if (opts.singleSelect) {\n unselectAll(target, undefined, state);\n selectedRows.splice(0, selectedRows.length);\n }\n if (!notCheck && opts.checkOnSelect) {\n checkRow(target, index, true, state);\t// don't select the row again\n }\n\n if (opts.idField) {\n var row = opts.finder.getRow(target, index, state);\n if (!row[opts.idField]||indexOfRowId(selectedRows, opts.idField, row[opts.idField]) < 0)\n selectedRows.push(row);\n }\n\n opts.onSelect.call(target, index, data.rows[index]);\n\n //var tr = opts.finder.getTr(target, index, undefined, undefined, state).addClass('datagrid-row-selected');\n tr.addClass('datagrid-row-selected')\n if (tr.length) {\n var body2 = dc.body2;\n var top = tr.position().top;// - headerHeight;\n if (top <= 0) {\n body2.scrollTop(body2.scrollTop() + top);\n } else {\n var th = tr._outerHeight(), bh = body2[0].clientHeight;\n if (top + th > bh) {\n body2.scrollTop(body2.scrollTop() + top + th - bh);// - bh + 18\n }\n }\n }\n }", "function selectRow(that){\n\tvar selectedPointId = $(that).find('button').data('id');\n\t$.each(scene.__webglObjects, function(key,val){\n\t\tif(val[0].object.pointId == selectedPointId){\n\t\t\tif(val[0].object.material.color.getStyle() == 'rgb(0,0,0)')\n\t\t\t\tval[0].object.material.color.setStyle(\"red\");\n\t\t\telse if(val[0].object.material.color.getStyle() == 'rgb(255,0,0)')\n\t\t\t\tval[0].object.material.color.setStyle(\"black\");\n\t\t}\n\t});\n\t$(that).toggleClass('selectedPoint');\n}", "selectCellAt(columnIndex, rowIndex) {\n this.clearSelection();\n this.getCellElementAt(columnIndex, rowIndex).addClass('selected');\n }", "handleRowSelection(event) {\n this.selectedData = this.template.querySelector('lightning-datatable').getSelectedRows();\n }", "function clickHandlerForGrid() {\n\n $('[bind=activity] > [bind=grid] > table > tbody > tr').click(function () {\n $(this).siblings().each(function () {\n $(this).removeClass('selected');\n });\n $(this).addClass('selected');\n });\n\n}", "function UltraGrid_Row_SetSelected(bSelected)\n{\n\t//update selected state\n\tthis.Selected = bSelected;\n\t//loop through all cells in the row\n\tfor (var cells = this.Columns, iCell = 0, cCell = cells.length; iCell < cCell; iCell++)\n\t{\n\t\t//update selection\n\t\tcells[iCell].SetSelected(bSelected);\n\t}\n}", "beforeSelectRow(rowid, e){\n }", "function onSelectRow() {\n // Update selected rows\n if (component.initialized) {\n updateSelectedRows();\n }\n }", "function update_selection(cellView,paper,graph) {\n deselect_all_elements(paper,graph);\n select_element(cellView,graph);\n}", "function HandleTblRowClicked(tblRow) {\n\n// --- toggle select clicked row\n t_td_selected_toggle(tblRow, false); // select_single = false: multiple selected is possible\n\n// get data_dict from data_rows\n const data_dict = get_datadict_from_tblRow(tblRow);\n console.log( \"data_dict\", data_dict);\n\n// --- update selected studsubj_dict / student_pk / subject pk\n selected.data_dict = (data_dict) ? data_dict : null;\n\n console.log( \" selected\", selected);\n }", "function toggleRowSelection(row) {\n _grid.getData().beginUpdate();\n HandleAccordionShowHide(row);\n _grid.getData().endUpdate();\n }", "function rowClick(grid, rowID, event){\n\t var x = event.getTarget();\n\t if (x.name == \"checkbox\"){\n\t\t if (x.checked){\n\t\t\t x.checked = true;\n\t\t\t grid.selModel.selectRow(rowID, true, false);\n\t\t\t return false;\t\t\t\n\t\t }\n\t\t else\n\t\t {\n\t\t\t x.checked = false;\n\t\t\t grid.selModel.deselectRow(rowID, false, false);\n\t\t }\n\t } \n\t return true;\n }", "doOnClickHighlight(row) {\n let indexFound = this.clickedRow.indexOf(this.rows[row.$index]);\n if (indexFound == -1) {\n this.clickedRow.push(this.rows[row.$index]);\n }\n else {\n this.clickedRow.splice(indexFound, 1);\n }\n }", "_onRowSelect(e) {\n let row = e.currentTarget;\n let range = this._range;\n let ord = Number.parseInt(row.getAttribute('data-ordinal'));\n if (!this._majorAvailable && (ord < 1 || ord > 14)) {\n return;\n }\n if (range.high === -1) {\n this._selectRangeRows(ord, ord)\n } else if (range.low == range.high) {\n this._selectRangeRows(range.low, ord);\n } else {\n this._clearRangeTable();\n this._selectRangeRows(ord, ord);\n }\n }", "onRowSelect(row, isSelected, e) {\n // On row select\n if (isSelected) { \n this.setState({ disable: false });\n this.state.selected.push(row);\n } \n // On row deselect\n else{\n var index = this.state.selected.indexOf(row);\n this.state.selected.splice(index, 1);\n this.setState({selected: this.state.selected });\n if(this.state.selected.length == 0){\n this.setState({ disable: true });\n } \n }\n }", "_selectRowByIndex(idx) {\n let allTr = this.shadowRoot.querySelector('tbody').querySelectorAll('tr');\n\n if (idx >= 0 && allTr.length > 1 && idx < allTr.length) {\n\n let len = allTr.length;\n while (len--) {\n allTr[len].setAttribute('selected', false);\n }\n allTr[idx].setAttribute('selected', true);\n this._selectedIndex = idx;\n }\n }", "function selectCell() {\n\n // If the game ends then none of the cells should be clickable\n if (clickDisabled) {\n return;\n }\n\n // This is a conditional to make sure that only one cell is highlighted at a time by reverting the previous selected cell back to normal\n if (selectedCell && !($(selectedCell).hasClass('incorrect-clicked'))) {\n $(selectedCell).removeClass('clicked');\n $(selectedCell).addClass('empty-cell');\n } else if (selectedCell) {\n $(selectedCell).removeClass('incorrect-clicked');\n $(selectedCell).addClass('incorrect');\n }\n\n // Updates the selected cell to the current one\n selectedCell = this;\n\n // Updates the background of the selected cell to show that it is highlighted\n $(this).removeClass('empty-cell');\n if (!$(this).hasClass('incorrect')) {\n $(this).addClass(\"clicked\");\n } else {\n $(this).addClass(\"incorrect-clicked\");\n }\n\n // For loop to traverse the entire array to find the selected cell in the grid 2-d array and then stores the coordinates of that cell\n for (var row = 0; row < grid.length; row++) {\n if (grid[row].indexOf(this) != -1) {\n selectedCol = grid[row].indexOf(this);\n selectedRow = row;\n }\n }\n}", "function retainSelectedRows(chngedRows)\r\n{\r\n\tif(chngedRows)\r\n\t{\r\n\t\tfor(i=0;i<chngedRows.length;i++)\r\n\t\t{\r\n\t\t\tvar valobj=getElemnt(chngedRows[i]);\r\n\t\t\tif(valobj!= null && valobj.type && valobj.type=='checkbox')\r\n\t\t\t{\r\n\t\t\t\tvalobj.checked=true;\r\n\t\t\t\tif(valobj.onclick)\r\n\t\t\t\t{\r\n\t\t\t\t valobj.onclick();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "selectTable() {\n if (!this.owner.enableSelection) {\n return;\n }\n this.selectTableInternal();\n }", "function setClickedRow(index){\n var vm = this;\n vm.selectedRow = index;\n }", "function getRow(_row, _todo) {\n if (_row >= 0)\n setSelectedRow({ row: _row, todo: _todo });\n }", "function selectCell() {\n let highlighting = false;\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.highlight != null) {\n highlighting = true;\n cell.highlight = null;\n cell.owner = playersTurn;\n if (checkWin(cell.row, cell.col)) {\n gameOver = true;\n }\n break OUTER;\n }\n }\n }\n\n //do not allow selection if no highlighting\n if (!highlighting) {\n return;\n }\n\n //checks for a tied game\n if (!gameOver) {\n gameTied = true;\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.owner == null) {\n gameTied = false;\n break OUTER;\n }\n }\n }\n\n if (gameTied) {\n gameOver = true;\n }\n }\n\n //switch the player if the game is not over\n if (!gameOver) {\n playersTurn = !playersTurn;\n }\n}", "function select() {\n var el = d3.select(this);\n var thislabel = el.node().__data__;\n var indx = _.indexOf(data.columnLabels, thislabel);\n var indy = _.indexOf(data.rowLabels, thislabel);\n if (indx > -1) {\n selectedx = getselected(selectedx, indx)\n }\n if (indy > -1) {\n selectedy = getselected(selectedy, indy)\n }\n draw()\n }", "resetSelectedRow() {\n\n this.selectedRowCoords.r = null\n this.selectedRowCoords.c = null\n this.editedRowCoords.r = null\n this.editedRowCoords.c = null\n this.validatedCell.r = null\n this.validatedCell.c = null\n\n this.hot.deselectCell();\n }", "function selectRows(data) {\n \t\n }", "onRowSelection () {\n this.grid.selectedRows = this.$refs.grid.gridOptions.api.getSelectedRows();\n if (this.grid.selectedRows && this.grid.selectedRows.length) {\n this.grid.hasSelectedRows = true;\n }\n }", "function selectCell() {\n let highlighting = false;\n\n // Allow player to place a token in a cell.\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.highlight !== null) {\n highlighting = true;\n cell.highlight = null;\n cell.owner = playerTurn;\n\n if (checkWin(cell.row, cell.col)) {\n gameOver = true;\n }\n\n break OUTER;\n }\n }\n }\n\n // Prohibit clicking on cells which are not empty.\n if (!highlighting) {\n return;\n }\n\n // Check to see if there is a draw.\n if (!gameOver) {\n gameTied = true;\n OUTER: for (let row of grid) {\n for (let cell of row) {\n if (cell.owner === null) {\n gameTied = false;\n break OUTER;\n }\n }\n }\n\n // Set game over.\n if (gameTied) {\n gameOver = true;\n }\n }\n\n // Switch player.\n if (!gameOver) {\n playerTurn = !playerTurn;\n }\n}", "onCellClick(args) {\n\n let ezid = this.state.mainTableData[args.index].EZID,\n selectedRow = this.state.selectedRow.concat([]),\n selection = this.state.selection.concat([]);\n\n let newSelection = {\n \"EZID\": this.state.mainTableData[args.index].EZID,\n \"Name\": this.state.mainTableData[args.index].Name,\n \"EntityTypeCode\": this.state.mainTableData[args.index].EntityTypeCode\n };\n\n //selection with control key combo, can select multiple records as user click on them\n if (args.ctrlKey) {\n\n if (selectedRow.indexOf(ezid) == -1) {\n this.setState({\n selectedRow: selectedRow.concat(ezid),\n selection: selection.concat(newSelection)\n })\n }\n else {\n this.setState({\n selectedRow: selectedRow.filter((r) => {\n return r != ezid\n }),\n highLightedCol: null,\n selection: selection.filter(s => s.EZID !== ezid)\n });\n }\n this.setState({hotKeyShift: null})\n\n }\n //selection with shift key combo, can select multiple records\n else if (args.shiftKey) {\n\n let lastEzid = (this.state.hotKeyShift != null ) ? this.state.hotKeyShift : selectedRow.pop(),\n indexTo = args.index,\n selectedEzid = [],\n mySelection = [],\n indexFrom = this.state.mainTableData.findIndex((d) => {\n return d.EZID == lastEzid\n });\n\n if (indexTo > indexFrom) {\n selectedEzid = this.state.mainTableData.slice(indexFrom, indexTo + 1).map((d) => {\n return d.EZID\n });\n mySelection = this.state.mainTableData.slice(indexFrom, indexTo + 1).map((d) => {\n return {\"EZID\": d.EZID, \"Name\": d.Name, \"EntityTypeCode\": d.EntityTypeCode}\n });\n\n this.setState({\n selectedRow: this.state.selectedRow.concat(selectedEzid),\n selection: mySelection\n })\n\n }\n else {\n selectedEzid = this.state.mainTableData.slice(indexTo, indexFrom + 1).map((d) => {\n return d.EZID\n }).reverse();\n mySelection = this.state.mainTableData.slice(indexTo, indexFrom + 1).map((d) => {\n return {\"EZID\": d.EZID, \"Name\": d.Name, \"EntityTypeCode\": d.EntityTypeCode}\n }).reverse();\n this.setState({\n selectedRow: this.state.selectedRow.concat(selectedEzid),\n selection: mySelection\n })\n }\n this.setState({selectedRow: selectedEzid});\n\n this.setState({hotKeyShift: lastEzid});\n\n }\n //normal single selections.\n else {\n let newSelection = {\n \"EZID\": this.state.mainTableData[args.index].EZID,\n \"Name\": this.state.mainTableData[args.index].Name,\n \"EntityTypeCode\": this.state.mainTableData[args.index].EntityTypeCode\n };\n if (selectedRow.indexOf(ezid) > -1) {\n if (selectedRow.length > 1) {\n this.setState({\n selectedRow: [].concat(ezid),\n highLightedCol: args.col,\n selection: [].concat(newSelection)\n });\n }\n else\n this.setState({\n selectedRow: [],\n highLightedCol: null,\n selection: []\n })\n }\n else {\n this.setState({\n selectedRow: [].concat(ezid),\n highLightedCol: args.col,\n selection: [].concat(newSelection)\n });\n }\n this.setState({hotKeyShift: null})\n }\n }", "function selectedRowToInput() {\n console.info(\"selectedRowToInput\");\n for (var i = 3; i < table.rows.length - 1; i++) {\n console.log(\"table.rows[\" + i + \"]: \" + table.rows[i].classList.contains(\"processed\"));\n if (!table.rows[i].classList.contains(\"processed\")) {\n // console.log(\"table.rows[i]: \" + table.rows[i].classList.value);\n // continue;\n table.rows[i].onclick = function () {\n // get the seected row index\n rIndex = this.rowIndex;\n // console.log(\"table.rows[i].cells: \" + table.rows[i].cells[1]);\n if (typeof index !== \"undefined\") {\n table.rows[index].classList.toggle(\"selected\");\n }\n document.getElementById(\"account_activity_id\").value = this.cells[0].innerHTML;\n document.getElementById(\"activity_kind\").value = this.cells[1].innerHTML;\n document.getElementById(\"activity\").value = this.cells[2].innerHTML;\n document.getElementById(\"timer_start\").value = this.cells[3].innerHTML;\n document.getElementById(\"record\").value = this.cells[4].innerHTML;\n\n // console.log(typeof index);\n console.log(rIndex);\n // get the selected row index\n\n // get the selected row index\n index = this.rowIndex;\n // add class selected to the row\n this.classList.toggle(\"selected\");\n // console.log(typeof index);\n };\n }\n }\n}", "function rowSelector() {\n var $auditTableRow = $('.js-row-selector tr'),\n activeClass = 'active-table-row';\n\n $auditTableRow.click(function() {\n $(this).siblings().removeClass(activeClass);\n $(this).find('td input[type=radio]').prop('checked', true);\n $(this).addClass(activeClass);\n });\n}", "SelectFirstCell() {\n var myTable = document.getElementsByClassName('MuiDataGrid-cell');\n var row = myTable[0];\n if (row != undefined) {\n row.click();\n }\n }", "function HandleTblRowClicked(tr_clicked) {\n //console.log(\"=== HandleTblRowClicked\");\n //console.log( \"tr_clicked: \", tr_clicked, typeof tr_clicked);\n //console.log( \"tr_clicked.id: \", tr_clicked, typeof tr_clicked.id);\n\n// --- deselect all highlighted rows, select clicked row\n t_td_selected_toggle(tr_clicked, true); // select_single = True\n\n //const data_dicts = get_datadicts_from_selectedBtn();\n //const data_dict = (tr_clicked && tr_clicked.id && tr_clicked.id in data_dicts) ? data_dicts[tr_clicked.id]: null;\n //console.log( \" data_dict: \", data_dict);\n\n }", "selectRow(e) {\n const { selectRow } = this.props;\n selectRow(e.target.dataset.id);\n }", "function clickRow( inputrow ) {\n var input = $(inputrow);\n\tvar paginatedTable = input.closest( '.datatables' );\n\tvar dataTable = paginatedTable.closest( '.dataTables_wrapper' );\n\tvar tableId = paginatedTable.attr( 'id' );\n\n\t// If the input is a normal checkbox, the user clicked on it. Update the elementsSelected array\n\tif( selectType[ tableId ] == \"selectMulti\" ) {\n\t\tvar arrayPos = jQuery.inArray( parseInt( input.val() ), elementsSelected[ tableId ] );\n\t\tif( input.attr( 'checked' ) ) {\n\t\t\t// Put the id in the elementsSelected array, if it is not present\n\t\t\tif( arrayPos == -1 ) {\n\t\t\t\telementsSelected[ tableId ][ elementsSelected[ tableId ].length ] = parseInt( input.val() );\n\t\t\t}\n\t\t} else {\n\t\t\t// Remove the id from the elementsSelected array, if it is present\n\t\t\tif( arrayPos > -1 ) {\n\t\t\t\telementsSelected[ tableId ].splice( arrayPos, 1 );\n\t\t\t}\n\t\t}\n\n var checkAll = $( '#'+tableId+'_checkAll', paginatedTable );\n updateCheckAll( inputrow );\n\t} else {\n // Assumption: selectType[ tableId ] == \"selectOne\"\n elementsSelected[ tableId ][0] = parseInt( input.val() );\n }\n}", "function selectRow(target, step, state) {\n if (!state) state = $.data(target, 'combogrid');\n var opts = state.options;\n if (!state.grid) $(target).combo(\"panel\");\n var grid = state.grid;\n var rowCount = grid.datagrid('getRows').length;\n state.remainText = false;\n\n var index;\n var selections = grid.datagrid('getSelections');\n if (selections.length) {\n index = grid.datagrid('getRowIndex', selections[selections.length - 1][opts.idField]);\n index += step;\n if (index < 0) index = 0;\n if (index >= rowCount) index = rowCount - 1;\n } else if (step > 0) {\n index = 0;\n } else if (step < 0) {\n index = rowCount - 1;\n } else {\n index = -1;\n }\n if (index >= 0) {\n grid.datagrid('clearSelections');\n grid.datagrid('selectRow', index);\n if (step == 0) {//触发onclickrow事件\n opts.onClickRow.call(this, index, grid.datagrid('getRowByIndex', index));\n }\n }\n }", "function selectRow(target, step, state) {\n if (!state) state = $.data(target, 'combotree');\n if (!state.tree) $(target).combo(\"panel\");\n var tree = state.tree;\n state.remainText = false;\n if (step < 0) tree.tree(\"selectPrev\");\n else tree.tree(\"selectNext\");\n }", "select(...cells) {\n let selection_changed = false;\n // The selection set is treated immutably, so we duplicate it here to\n // ensure that existing references to the selection are not modified.\n this.selection = new Set(this.selection);\n for (const cell of cells) {\n if (!this.selection.has(cell)) {\n this.selection.add(cell);\n cell.select();\n selection_changed = true;\n }\n }\n if (selection_changed) {\n this.panel.update(this);\n this.toolbar.update(this);\n }\n }", "function makeSelect(row) {\n var id=$(row).attr('id');\n $(\"#data tr\").attr('abc', 'no');\n $(row).attr('abc', 'yes');\n $(\"#data tr\").removeClass('selected');\n $(row).addClass('selected');\n}", "function doSelections(event, selectedEles, cols) {\n // Select elements in a range, either across rows or columns\n function selectRange() {\n var frstSelect = selectedEles[0];\n var lstSelect = selectedEles[selectedEles.length - 1];\n if (cols) {\n var flipStart = flipFlipIdx(Math.min(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n var flipEnd = flipFlipIdx(Math.max(flipIdx(selectionMinPivot), flipIdx(selectionMaxPivot),\n flipIdx(frstSelect), flipIdx(lstSelect)));\n selectElemsDownRows(Math.min(flipStart, flipEnd), Math.max(flipStart, flipEnd));\n } else {\n var start = Math.min(selectionMinPivot, frstSelect);\n var end = Math.max(selectionMaxPivot, lstSelect);\n selectElemRange(start, end);\n }\n }\n // If not left mouse button then leave it for someone else\n if (event.which != LEFT_MOUSE_BUTTON) {\n return;\n }\n // Just a click - make selection current row/column clicked on\n if (!event.ctrlKey && !event.shiftKey) {\n clearAll();\n selectEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Cntrl/Shift click - add to current selections cells between (inclusive) last single selection and cell\n // clicked on\n if (event.ctrlKey && event.shiftKey) {\n selectRange();\n return;\n }\n // Cntrl click - keep current selections and add toggle of selection on the single cell clicked on\n if (event.ctrlKey) {\n toggleEles(selectedEles);\n selectionMinPivot = selectedEles[0];\n selectionMaxPivot = selectedEles[selectedEles.length - 1];\n return;\n }\n // Shift click - make current selections cells between (inclusive) last single selection and cell clicked on\n if (event.shiftKey) {\n clearAll();\n selectRange();\n }\n }", "function selectRow() {\r\n document.getElementById(\"tblUsers\").addEventListener('click', function (e) {\r\n var row = e.target.parentNode;\r\n var userID = row.firstChild.innerHTML;\r\n getASingleUser(userID);\r\n document.getElementById(\"userID\").disabled = true;\r\n })\r\n}", "function ChangeSelectionWithoutContentLoad(event, tree, aSingleSelect) {\n var treeSelection = tree.view.selection;\n\n var row = tree.getRowAt(event.clientX, event.clientY);\n // Only do something if:\n // - the row is valid\n // - it's not already selected (or we want a single selection)\n if (row >= 0 && (aSingleSelect || !treeSelection.isSelected(row))) {\n // Check if the row is exactly the existing selection. In that case\n // there is no need to create a bogus selection.\n if (treeSelection.count == 1) {\n let minObj = {};\n treeSelection.getRangeAt(0, minObj, {});\n if (minObj.value == row) {\n event.stopPropagation();\n return;\n }\n }\n\n let transientSelection = new JSTreeSelection(tree);\n transientSelection.logAdjustSelectionForReplay();\n\n gRightMouseButtonSavedSelection = {\n // Need to clear out this reference later.\n view: tree.view,\n realSelection: treeSelection,\n transientSelection,\n };\n\n var saveCurrentIndex = treeSelection.currentIndex;\n\n // tell it to log calls to adjustSelection\n // attach it to the view\n tree.view.selection = transientSelection;\n // Don't generate any selection events! (we never set this to false, because\n // that would generate an event, and we never need one of those from this\n // selection object.\n transientSelection.selectEventsSuppressed = true;\n transientSelection.select(row);\n transientSelection.currentIndex = saveCurrentIndex;\n tree.ensureRowIsVisible(row);\n }\n event.stopPropagation();\n}", "_refreshSelections() {\n forEachRow(this._refs.body, tr => {\n tr.classList.remove('eds-selected');\n tr.querySelector('eds-checkbox').checked = false;\n });\n this.selectedRows.forEach(row => {\n let tr = this._refs.body.querySelector(`tr[data-id=\"${row.id}\"]`);\n tr.classList.add('eds-selected');\n tr.querySelector('eds-checkbox').checked = true;\n });\n this._syncSelectAllCheckbox();\n\n if (this.selectedRows.length) this._showSelectionHeader();\n else this._hideSelectionHeader();\n }", "function SelectRow(row) {\n var inputs = row.getElementsByTagName('input');\n for (var i = 0; i < inputs.length; i++) {\n if (inputs[i].type == \"checkbox\") {\n inputs[i].checked = !inputs[i].checked;\n\n // Check if it's checked\n if (inputs[i].checked == true) {\n row.style.backgroundColor = \"lightblue\";\n }\n else {\n row.style.backgroundColor = \"white\";\n }\n\n }\n }\n}", "_handleCancelSelection() {\n const { _rows: oldRows, _searchString: searchString } = this;\n this._rows = this._rows.map((row) =>\n searchString && !doesRowMatchSearchString(row, searchString) ? row : { ...row, selected: false }\n );\n this.requestUpdate('_rows', oldRows);\n }", "get selectedCell() {\n return this.table.find('td.cell.selected');\n }", "function select(e){\n if(userId){\n $('tr[data-id='+ userId +']').css('background', 'none');\n }\n $('tr[data-id='+ e.currentTarget.getAttribute('data-id') +']').css('background', '#999');\n userId = e.currentTarget.getAttribute('data-id');\n }", "function onRowSelected(row) {\n if (row) {\n selectedVmRow = row;\n selectedRow = row;\n //updateContextualCommands(row);\n }\n }", "function MUPM_set_selected(tblRow, is_selected){\n //console.log( \" --- MUPM_set_selected --- \", is_selected);\n// --- put new value in tblRow, show/hide tickmark\n if(tblRow){\n tblRow.setAttribute(\"data-selected\", ( (is_selected) ? 1 : 0) )\n const img_class = (is_selected) ? \"tickmark_2_2\" : \"tickmark_0_0\"\n const el = tblRow.cells[0].children[0];\n //if (el){add_or_remove_class(el, \"tickmark_2_2\", is_selected , \"tickmark_0_0\")}\n if (el){el.className = img_class}\n }\n } // MUPM_set_selected", "function click() {\n\t// If clicking on a cell with your piece in it, highlight the cell\n\tif (!selectedBox) { // 1st click\n\t\tif ((!blueTurn && this.hasClassName(\"red\")) || (blueTurn && this.hasClassName(\"blue\"))) {\n\t\t\tthis.addClassName(\"selected\");\n\t\t\tselectedBox = this;\n\t\t}\n\t}\n\t\n\t// Player is trying to move a piece\n\telse { // 2nd click\n\t\tselectedBox.removeClassName(\"selected\");\n\t\tthis.onmouseout();\n\t\t\n\t\t// If there are forced jumps and player is not jumping, highlight forced jumps\n\t\tif (forcedJumps != false) {\n\t\t\tif (!jump(this)) {\n\t\t\t\thighlightForcedJumps(forcedJumps);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Try moving, then try jumping\n\t\telse if (!move(this))\n\t\t\tjump(this);\n\t\t\t\n\t\tselectedBox = null;\n\t\tcheckVictory();\n\t}\n}", "function update_row_click_events() {\n\t$(\".clickable_row\").each(function(){\n\t\t$(this).click(function(){\n\t\t\t$(this).find(\"input\").prop(\"checked\", $(this).find(\"input\").prop(\"checked\") ? false : true);\n\t\t});\n\t});\n}", "selectCol(e)\n {\n var cellpos=[...e.currentTarget.parentElement.children].indexOf(e.currentTarget);\n\n var selectedCol=[];\n for (var y=0;y<this.rows.length;y++)\n {\n selectedCol.push(this.rows[y].children[cellpos]);\n }\n\n this.selectedCols.push(selectedCol);\n }", "clearSelection() {\n this.table.find('td.selected').removeClass('selected');\n }", "function onClickHandler(pkey, selected){\n\tvar objDetailsGrid = View.panels.get(\"abCbRptHlBlRmPrj_gridRep\");\n\t\n\tobjDetailsGrid.gridRows.each(function(gridRow){\n\t\tif (gridRow.getFieldValue('rm.bl_id') == pkey[0] && gridRow.getFieldValue('rm.fl_id') == pkey[1] && gridRow.getFieldValue('rm.rm_id') == pkey[2]) {\n\t\t\tif (selected) {\n\t\t\t\tgridRow.select();\n\t\t\t} else {\n\t\t\t\tgridRow.unselect();\n\t\t\t}\n\t\t\tvar suffix = selected ? \" selected\" : \"\";\n\t\t\tvar cn = gridRow.dom.className;\n\t\t\tvar j = 0;\n\t\t\tif ((j = cn.indexOf(\" selected\")) > 0)\n\t\t\t\tcn = cn.substr(0, j);\n\t\t\tgridRow.dom.className=cn + suffix;\n\t\t}\n\t});\n}", "selectRow(rowId) {\n this.setState({\n selectedRowId: rowId\n })\n }", "selectTableCellInternal(tableCell, clearMultiSelection) {\n let firstParagraph = this.getFirstParagraph(tableCell);\n let lastParagraph = this.getLastParagraph(tableCell);\n if (firstParagraph === lastParagraph && lastParagraph.isEmpty()) {\n this.selectParagraphInternal(lastParagraph, true);\n }\n else {\n let firstLineWidget = lastParagraph.childWidgets[0];\n this.start.setPosition(firstParagraph.childWidgets[0], true);\n this.end.setPositionParagraph(firstLineWidget, firstLineWidget.getEndOffset());\n this.fireSelectionChanged(true);\n }\n }", "function table_selectRows(tableid, rows)\r\n{\r\n var selected = new Array();\r\n var tableobj = document.getElementById(tableid);\r\n if (tableobj != null)\r\n {\r\n var checkboxes;\r\n // IE has a document object per element\r\n if(tableobj.document)\r\n checkboxes = tableobj.document.getElementsByTagName(\"INPUT\");\r\n else\r\n checkboxes = document.getElementsByTagName(\"INPUT\");\r\n\r\n if (checkboxes != null)\r\n {\r\n var len = checkboxes.length;\r\n var j = 0;\r\n for(var i=0; i<len; i++)\r\n {\r\n if (checkboxes[i].id != null &&checkboxes[i].id== tableid+\"_rowselector\")\r\n {\r\n j++;\r\n var checked = false;\r\n for(var k=0; k<rows.length; k++)\r\n {\r\n if (checkboxes[i].value == rows[k])\r\n {\r\n checked = true;break;\r\n }\r\n }\r\n if (checked)\r\n {\r\n checkboxes[i].checked = true;\r\n table_highlightSelectedRowForChild(checkboxes[i])\r\n }\r\n else table_highlightSelectedRowForChild(checkboxes[i], false)\r\n }\r\n }\r\n }\r\n }\r\n return selected;\r\n}", "function updateSelectedRows() {\n var selectedList = [];\n if (grid.api) {\n var selectedRows = component.getSelection();\n _.each(selectedRows, function (row) {\n selectedList.push(row[component.constants.ROW_IDENTIFIER]);\n });\n }\n component.onSelectRows(selectedList);\n }", "function add_selection( rows_code ) {\n var top_row = get_prev_top_row( rows_code );\n var top_row_id = get_id( top_row );\n\n var old_selected = $('tr.selected');\n var old_selected_row_id;\n\n if ( old_selected.length === 1 ) {\n old_selected_row_id = get_id( old_selected );\n }\n\n if ( old_selected_row_id !== top_row_id ) {\n select( rows_code );\n _resource.row_selected( active_sheet_id(), top_row_id, old_selected_row_id );\n }\n else {\n rows_code.addClass( 'in-selected' );\n }\n }", "function deSelectCell(cell) {\n var strokeWeight = 0;\n var fillOpacity = 0;\n var toggle = document.getElementById(\"Grid-Toggle\");\n if (toggle.checked) strokeWeight = 1;\n if (cell.getAttribute(\"fill\") != \"\") fillOpacity = 1;\n cell.selected = \"false\";\n cell.setAttribute(\"stroke\", \"black\");\n cell.setAttribute(\"stroke-width\", strokeWeight);\n cell.setAttribute(\"fill-opacity\", fillOpacity);\n selectedCell = \"None\";\n loadLegendCell(\"None\");\n var selected = document.getElementById(\"legend-layer-Selected-value\");\n selected.innerText = \"-\";\n}", "function deSelectCell(cell) {\n var strokeWeight = 0;\n var fillOpacity = 0;\n var toggle = document.getElementById(\"Grid-Toggle\");\n if (toggle.checked) strokeWeight = 1;\n if (cell.getAttribute(\"fill\") != \"\") fillOpacity = 1;\n cell.selected = \"false\";\n cell.setAttribute(\"stroke\", \"black\");\n cell.setAttribute(\"stroke-width\", strokeWeight);\n cell.setAttribute(\"fill-opacity\", fillOpacity);\n selectedCell = \"None\";\n loadLegendCell(\"None\");\n var selected = document.getElementById(\"legend-layer-Selected-value\");\n selected.innerText = \"-\";\n}", "function strikethrough (){\r\n for (var i = 1; i< table.rows.length; i++){\r\n table.rows[i].onclick = function (){\r\n //get the selected row index\r\n rIndex= this.rowIndex;\r\n //console.log(rIndex)\r\n //get the cell from selected rInde\r\n table.rows[rIndex].cells[0].classList.toggle(\"stroke\")\r\n }; \r\n }\r\n }", "deactivateRow() {\n const idx = this.activatedRow()[0].row;\n if (idx >= 0) {\n this.toggleRowActivation(idx);\n }\n }", "select_table_row(row_trait) {\n const selections = this.state.selected;\n let any_selected = this.state.overall_selection;\n\n selections[row_trait] = !selections[row_trait];\n\n // @DOUBLE-CHECK THIS WORKS\n // @DOUBLE-CHECK THIS WORKS\n // @DOUBLE-CHECK THIS WORKS\n // @DOUBLE-CHECK THIS WORKS\n // @DOUBLE-CHECK THIS WORKS\n for (const trait of Object.keys(selections)) {\n if (selections[trait]) {\n any_selected = true;\n break;\n }\n any_selected = false;\n }\n\n this.setState({ selected: selections, overall_selection: any_selected });\n }", "function selectTD(elem) {\n\tlet selectedTd;\n\telem.addEventListener('click', function(event) {\n\t\tlet target = event.target;\n\t\tif (target.tagName != 'TD') return;\n\t\thighlight(target);\n\t});\n\tfunction highlight(node) {\n\t\tif (selectedTd) {\n\t\t\tselectedTd.classList.remove('highlight');\n\t\t}\n\t\tselectedTd = node;\n\t\tselectedTd.classList.add('highlight');\n\t} \n}", "function onAfterSelection(et, selecteElm, e){\r\n\t\t\t\tif(!o.validRowsIndex) return; //table is not filtered\r\n\t\t\t\tvar row = et.defaultSelection != 'row' ? selecteElm.parentNode : selecteElm;\r\n\t\t\t\tvar cell = selecteElm.nodeName=='TD' ? selecteElm : null; //cell for default_selection = 'both' or 'cell'\r\n\t\t\t\tvar keyCode = e != undefined ? et.Event.GetKey(e) : 0;\r\n\t\t\t\tvar isRowValid = o.validRowsIndex.tf_Has(row.rowIndex);\r\n\t\t\t\tvar nextRowIndex;\r\n\t\t\t\tvar d = (keyCode == 34 || keyCode == 33 ? (o.pagingLength || et.nbRowsPerPage) : 1); //pgup/pgdown keys\r\n\r\n\t\t\t\t//If next row is not valid, next valid filtered row needs to be calculated\r\n\t\t\t\tif(!isRowValid){\r\n\t\t\t\t\t//Selection direction up/down\r\n\t\t\t\t\tif(row.rowIndex>o._lastRowIndex){\r\n\t\t\t\t\t\tif(row.rowIndex >= o.validRowsIndex[o.validRowsIndex.length-1]) //last row\r\n\t\t\t\t\t\t\tnextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1];\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tvar calcRowIndex = (o._lastValidRowIndex + d);\r\n\t\t\t\t\t\t\tif(calcRowIndex > (o.validRowsIndex.length-1))\r\n\t\t\t\t\t\t\t\tnextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1];\r\n\t\t\t\t\t\t\telse nextRowIndex = o.validRowsIndex[calcRowIndex];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else{\r\n\t\t\t\t\t\tif(row.rowIndex <= o.validRowsIndex[0]) nextRowIndex = o.validRowsIndex[0];//first row\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tvar v = o.validRowsIndex[o._lastValidRowIndex - d];\r\n\t\t\t\t\t\t\tnextRowIndex = v ? v : o.validRowsIndex[0];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\to._lastRowIndex = row.rowIndex;\r\n\t\t\t\t\tDoSelection(nextRowIndex);\r\n\t\t\t\t} else{\r\n\t\t\t\t\t//If filtered row is valid, special calculation for pgup/pgdown keys\r\n\t\t\t\t\tif(keyCode!=34 && keyCode!=33){\r\n\t\t\t\t\t\to._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(row.rowIndex);\r\n\t\t\t\t\t\to._lastRowIndex = row.rowIndex;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif(keyCode == 34){ //pgdown\r\n\t\t\t\t\t\t\tif((o._lastValidRowIndex + d) <= (o.validRowsIndex.length-1)) //last row\r\n\t\t\t\t\t\t\t\tnextRowIndex = o.validRowsIndex[o._lastValidRowIndex + d];\r\n\t\t\t\t\t\t\telse nextRowIndex = o.validRowsIndex[o.validRowsIndex.length-1];\r\n\t\t\t\t\t\t} else { //pgup\r\n\t\t\t\t\t\t\tif((o._lastValidRowIndex - d) <= (o.validRowsIndex[0])) //first row\r\n\t\t\t\t\t\t\t\tnextRowIndex = o.validRowsIndex[0];\r\n\t\t\t\t\t\t\telse nextRowIndex = o.validRowsIndex[o._lastValidRowIndex - d];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\to._lastRowIndex = nextRowIndex;\r\n\t\t\t\t\t\to._lastValidRowIndex = o.validRowsIndex.tf_IndexByValue(nextRowIndex);\r\n\t\t\t\t\t\tDoSelection(nextRowIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t//Next valid filtered row needs to be selected\r\n\t\t\t\tfunction DoSelection(nextRowIndex){\r\n\t\t\t\t\tif(et.defaultSelection == 'row'){\r\n\t\t\t\t\t\tet.Selection.SelectRowByIndex(nextRowIndex);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tet.ClearSelections();\r\n\t\t\t\t\t\tvar cellIndex = selecteElm.cellIndex;\r\n\t\t\t\t\t\tvar row = o.tbl.rows[nextRowIndex];\r\n\t\t\t\t\t\tif(et.defaultSelection == 'both') et.Selection.SelectRowByIndex(nextRowIndex);\r\n\t\t\t\t\t\tif(row) et.Selection.SelectCell(row.cells[cellIndex]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//Table is filtered\r\n\t\t\t\t\tif(o.validRowsIndex.length != o.GetRowsNb()){\r\n\t\t\t\t\t\tvar row = o.tbl.rows[nextRowIndex];\r\n\t\t\t\t\t\tif(row) row.scrollIntoView(false);\r\n\t\t\t\t\t\tif(cell){\r\n\t\t\t\t\t\t\tif(cell.cellIndex==(o.GetCellsNb()-1) && o.gridLayout) o.tblCont.scrollLeft = 100000000;\r\n\t\t\t\t\t\t\telse if(cell.cellIndex==0 && o.gridLayout) o.tblCont.scrollLeft = 0;\r\n\t\t\t\t\t\t\telse cell.scrollIntoView(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "function activate_row(row, cell) {\n if(row.className.contains(\"active\")) {\n deactivate_single_row(row);\n return;\n }\n\n // let's make it editable \n deactivate_active_rows(); // First, make other rows inactive\n activate_row_helper(row.cells, cell);\n\n cell.firstChild.focus(); // Focus the selected cell input\n row.className = row.className + \" active\"; // Adds the active component\n}", "selectRow({ index }) {\n const { expandedHeight } = this.props;\n const { selectedIndex, hoverIndex } = this.state;\n const unselect = expandedHeight ? undefined : index;\n const updateIndex = index === selectedIndex ? unselect : index;\n this.setState({ selectedIndex: updateIndex });\n }", "function selectRow(index) {\n if (index == undefined || index < 0 || index >= _currentData.length) return;\n selectedIndexes().push(index);\n }", "set selectedCell(value) {\n if (!(value instanceof jQuery))\n throw new latte.InvalidArgumentEx('value');\n this.selectCellAt(value.data('columnIndex'), value.data('rowIndex'));\n }", "function table_highlightSelectedRowForChild(obj, state)\r\n{\r\n if (state == null) state = true;\r\n\r\n var rowobj = obj;\r\n while (rowobj != null && rowobj.tagName != \"TR\")\r\n {\r\n if (rowobj.parentElement)\r\n {\r\n rowobj = rowobj.parentElement;\r\n }\r\n else\r\n {\r\n rowobj = rowobj.parentNode;\r\n }\r\n }\r\n if (rowobj != null)\r\n {\r\n if (state == true)\r\n {\r\n rowobj.originalClassName = rowobj.className;\r\n rowobj.className = \"rowHighlight\";\r\n rowobj.cells[0].childNodes[0].style.backgroundColor = \"\";\r\n }\r\n else\r\n {\r\n if (rowobj.originalClassName != null)\r\n rowobj.className = rowobj.originalClassName;\r\n }\r\n }\r\n\r\n\r\n}", "function toggleSelect() {\n toggleSelectTask(requireCursor());\n }", "function clickFunction(e){\n var currLine = getCurrentLine(this);\n num_lines_selected = 1; //returns to default, in case just clicking, if it is selected that's taken care of in subsequent onselect\n prevLine = currLine;\n}", "_handleClick(event) {\n var row = $(event.target).parents('tr:first');\n var rows = this.$element.find('tbody tr');\n\n if (!this.lastChecked) {\n this.lastChecked = row;\n return;\n }\n\n if (event.shiftKey) {\n this.changeMultiple = true;\n\n var start = rows.index(row);\n var end = rows.index(this.lastChecked);\n var from = Math.min(start, end);\n var to = Math.max(start, end) + 1;\n var checked = this.lastChecked.find('input').is(':checked');\n var checkboxes = rows.slice(from, to).find('input');\n\n if (checked) {\n checkboxes.trigger('check.zf.trigger');\n } else {\n checkboxes.trigger('uncheck.zf.trigger');\n }\n\n this.changeMultiple = false;\n }\n\n this.lastChecked = row;\n }", "deselectAll () {\n this.list.views.forEach(row => {\n row.selected = false\n })\n }", "function selectElemsDownRows(ia, ib) {\n // Flip indexes\n var iaFlipIdx = flipIdx(ia);\n var ibFlipIdx = flipIdx(ib);\n // Find first and last index being selected\n var bot = Math.min(iaFlipIdx, ibFlipIdx);\n var top = Math.max(iaFlipIdx, ibFlipIdx);\n // Go through and mark selected elements - note we flip back to original coordinates to select element\n for (var i = bot; i <= top; i++) {\n var j = flipFlipIdx(i);\n tds[j].className = 'selected';\n }\n }", "_onclickRowSelected() {\n try {\n query(\".widget-consulta-proyecto .tab-content .list-group\")\n .on(\"click\", function(e) {\n const target = event.target;\n // Tag LI\n if (target.nodeName == \"LI\") {\n this._clearNodes(target);\n this._queryResultsFeatures(\n target.dataset.objectid,\n target.dataset.layerid,\n target\n );\n }\n // Tag DIV\n if (target.nodeName == \"DIV\") {\n this._clearNodes(target.parentNode);\n this._queryResultsFeatures(\n target.parentNode.dataset.objectid,\n target.parentNode.dataset.layerid,\n target.parentNode\n );\n }\n // Tag STRONG\n if (target.nodeName == \"STRONG\") {\n this._clearNodes(target.parentNode.parentNode);\n this._queryResultsFeatures(\n target.parentNode.parentNode.dataset.objectid,\n target.parentNode.parentNode.dataset.layerid,\n target.parentNode.parentNode\n );\n }\n }.bind(this));\n } catch (error) {\n console.error(`Error: _onclickRowSelected ${error.name} - ${error.message}`);\n }\n }", "deleteRow() {\n if (!this.selectedRows.length) return;\n\n this.selectedRows.forEach(row => {\n this._table.deleteRow(row.rowIndex);\n this._numberOfRows--;\n });\n this._resetSelecting();\n }", "selectCell() {\n if(this.check_Reset())\n return;\n if (this.view.getCurrentSelectedPiece() != this.selectedPiece) {\n this.state = 'PROCESS_PIECE';\n }\n else {\n if (this.view.board.selectedCell != null) {\n this.state = 'REQUEST_PLAY_P';\n }\n }\n }", "function select_row_listColores(row){\n\n console.log('Selected color!');\n var id_row = row.getAttribute('id');\n\n /* do visible content button delete formula */\n document.getElementById('content_button_delete_color').classList.remove(\"hidden\");\n /* Prepare button delete */\n document.getElementById('btn_delete_color_fast_formula').setAttribute('data-id_row',id_row);\n\n\n }", "function checkRow(target, index, notSelect){\r\n\t\tvar state = $.data(target, 'datagrid');\r\n\t\tvar opts = state.options;\r\n\t\tif (!notSelect && opts.selectOnCheck){\r\n\t\t\tselectRow(target, index, true);\t// don't check the row again\r\n\t\t}\r\n\t\tvar tr = opts.finder.getTr(target, index).addClass('datagrid-row-checked');\r\n\t\tvar ck = tr.find('div.datagrid-cell-check input[type=checkbox]');\r\n\t\tck._propAttr('checked', true);\r\n\t\ttr = opts.finder.getTr(target, '', 'checked', 2);\r\n\t\tif (tr.length == state.data.rows.length){\r\n\t\t\tvar dc = state.dc;\r\n\t\t\tvar header = dc.header1.add(dc.header2);\r\n\t\t\theader.find('input[type=checkbox]')._propAttr('checked', true);\r\n\t\t}\r\n\t\tvar row = opts.finder.getRow(target, index);\r\n\t\tif (opts.idField){\r\n\t\t\taddArrayItem(state.checkedRows, opts.idField, row);\r\n\t\t}\r\n\t\topts.onCheck.call(target, index, row);\r\n\t}", "function tb_onRowSelected(event) {\n if (event.node.isSelected()) {\n add_attr(event.node.data.feature);\n }\n else {\n remove_attr(event.node.data.feature);\n }\n}" ]
[ "0.7867484", "0.7771549", "0.76807773", "0.7652376", "0.74898666", "0.7440918", "0.730385", "0.730385", "0.71745074", "0.71107453", "0.7093224", "0.7038621", "0.7003956", "0.69792247", "0.6968329", "0.695336", "0.69454914", "0.69077355", "0.69077355", "0.6887717", "0.68843216", "0.6880324", "0.68685436", "0.6845344", "0.68437237", "0.6830216", "0.68011624", "0.6790879", "0.6776178", "0.6774641", "0.6760726", "0.6751008", "0.67438745", "0.67242867", "0.6710924", "0.6650859", "0.66335124", "0.66136307", "0.66080165", "0.660489", "0.65702206", "0.65685993", "0.6533788", "0.65259254", "0.6524374", "0.6518627", "0.65136814", "0.6507269", "0.65047765", "0.6494846", "0.6491926", "0.64886224", "0.6481133", "0.6476085", "0.6474904", "0.64648277", "0.64606583", "0.6460533", "0.6451621", "0.6447704", "0.64306325", "0.6417172", "0.641618", "0.6411529", "0.64105636", "0.6398713", "0.63835377", "0.6381355", "0.63445354", "0.6336271", "0.63332933", "0.632663", "0.63258904", "0.63232344", "0.63167995", "0.6311929", "0.6308914", "0.63054824", "0.6295852", "0.6295852", "0.6288503", "0.6282516", "0.6270163", "0.62614465", "0.6258279", "0.625719", "0.6254815", "0.6250264", "0.62486744", "0.62275237", "0.62263674", "0.62258524", "0.6211541", "0.619496", "0.6192991", "0.61909", "0.6185474", "0.61788744", "0.617036", "0.61699253", "0.6167973" ]
0.0
-1
For this game, the ball just starts in the middle.
function nextRound(game) { let gameId = game.gameId; if (gameId == null || gameId == undefined) { console.log("Unknown game!") return; } if (game.gameStates.length == 0) { console.log("Not gameState!"); return; } let idx = game.gameStates.length-1; let gameState = game.gameStates[idx]; let ballId = gameState.balls[0].uuid; let ball = randomBall(ballId); let nextRound = { type: "nextRound", gameId: game.gameId, balls: [ball] } gameState.sequence = 0; game.players.forEach(function(player) { let connection = getConnectionFromAlias(player); if (connection === undefined) { console.log("XXXXXXXXXXXXX Bad connection!"); } else { connection.send(JSON.stringify(nextRound)); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "start(){\n \t// si la balle est au centre (après le reset)\n\t\tif (this.ball.mouv.x === 0 && this.ball.mouv.y === 0){\n\t\t\t // balle bouge vars la gauche (joueur 1) lorsque la partie reprend\n\t\t\t this.ball.mouv.x = - 300,\n\t\t\t // 1 chance sur deux que la balle se dirige vers le bas ou vers le haut \n this.ball.mouv.y = 300 * (Math.random() > .5 ? 1 : - 1);\n // vitesse lente à chaque reprise de la partie \n this.ball.mouv.len = 300;\n }\n\t\n\t}", "function ballCenter(){\n posicaoBolaX = larguraCampo / 2\n posicaoBolaY = alturaCampo / 2\n velocidadeBolaPosicaoX = -velocidadeBolaPosicaoX\n velocidadeBolaPosicaoY = 3\n}", "function Start() {\n\t\n\tstartingPos = ball.position;\n}", "start() {\n\t\tif (this.ball.vel.x === 0 && this.ball.vel.y === 0) {\n\t\t\t// randomize the direction of the ball\n\t\t\tthis.ball.vel.x = 300 * (Math.random() > .5 ? 1 : -1); // if what is returned by math.random is more than .5 then mult by 1 otherwise if less than. mult by -1\n\t\t\tthis.ball.vel.y = 300 * (Math.random() * 2 - 1); // tweaks the y value so it changes the speed up or down just a little bit\n\t\t\tthis.ball.vel.len = 200;\n\t\t}\n\t}", "function ballStart() \n {\n ball.xPos = 400;\n ball.yPos = 230;\n ball.speedY = 5 + 5 * Math.random();\n ball.speedX = 5 + 5 * Math.random();\n\n changedirection = true * Math.random;\n }", "setupBall() {\n // Add ball mesh to scene\n const edgeOffset = 30.0;\n const startingPositionX = this.terrain.terrainWidth / 2.0 - edgeOffset;\n const startingPositionZ = this.terrain.terrainHeight / 2.0 - edgeOffset;\n this.ball = new Ball(this, startingPositionX, startingPositionZ);\n this.add(this.ball);\n\n // Hacky way to push the ball up\n this.ball.position.set(0, this.ball.radius, 0);\n }", "moveBall() {\n if (!this.firstCollision) {\n this.ball.Y += this.ball.dy;\n } else {\n this.ball.X += this.ball.dx;\n this.ball.Y += this.ball.dy;\n }\n }", "start () {\n if (this.ball.velocity.x === 0 && this.ball.velocity.x === 0) {\n this.ball.velocity.x = 3 * (Math.random() > .5 ? 1 : -1);\n this.ball.velocity.y = 3 * (Math.random() * 2 - 1);\n this.ball.velocity.len = 3;\n }\n }", "function start() {\n\tif(noBallsPresent()){\n\t putBall();\n\t}\n\tmove();\n}", "function startBall () {\n\tlet direction = 1; \n\ttopPositionOfBall = startTopPositionOfBall;\n\tleftPositionOfBall = startLeftPositionOfBall;\n\n\t//50% change of starting in either direction (right of left)\n\tif (Math.random() < 0.5){\n\t\tdirection = 1;\n\t} else {\n\t\tdirection = -1;\n\t}//else\n\n\n\ttopSpeedOfBall = Math.random() * 2 + 3; //3-4\n\tleftSpeedOfBall = direction * (Math.random() * 2 + 3); \n\n\toriginalTopSpeedOfBall = topSpeedOfBall;\n\toriginalLeftSpeedOfBall = leftSpeedOfBall;\n\n}//startBall", "startMiddle() {\n this._x = Scene_Width / 2;\n this._y = Scene_Height / 2;\n this._dx = 1;\n this._dy = 1.5;\n }", "playBallAnimation() {\n\t\tthis.ballTimeDiff = new Date().getTime() - this.presentBallTime;\n\t\tif(this.ball.y < this.groundBoundary)\n\t\t\tthis.ballPathMovement();\n\t\telse \n\t\t\tthis.resetBowlingpositions();\n\t}", "function updateBallPosition() {\n ball.x += ball.speedX;\n ball.y += ball.speedY;\n }", "function startBall(left, top, angle, speed) {\n\n // 0 degrees is to the right, 90 down, 180 to the left, 270 degrees is up.\n ballDirection=(360+angle)%360;\n\n // This is a CSS hoop we need to jump through in order to stop and restart an animation.\n actualball.style.animationName='none';\n void actualball.offsetWidth;\n\n // Origin point of the ball:\n theball.style.left=left.toString()+'%';\n theball.style.top=top.toString()+'%';\n\n // Direction of the ball:\n theball.style.transform='rotate('+angle.toString()+'deg)';\n\n // Get the ball moving:\n actualball.style.animation='ball-movement '+(10/speed).toString()+'s forwards running';\n actualball.style.animationTimingFunction='linear';\n }", "function Ball() {\n\tctx.fillStyle = white;\n\tctx.beginPath();\n\tctx.arc(BallX, BallY, BallRadius, 0, Math.PI * 2, true);\n\tctx.fill();\n\tctx.closePath();\n\tBallX += BallDisplacementX;\n\tBallY += BallDisplacementY;\n}", "function setupBall() {\n ball.x = width/2;\n ball.y = height/2;\n ball.vx = ball.speed;\n ball.vy = ball.speed;\n}", "function doInitialBallMovement() {\n var oldVector = gameBall.getLinearVelocity();\n gameBall.setLinearVelocity(new THREE.Vector3(oldVector.x + .5 * 100 * 10, oldVector.y + 50, oldVector.z + 50));\n }", "moveBall(){\n\t\tthis.x = this.x+ this.speed;\n\t\tthis.y = this.y+.5;\n\t}", "function ballMove() {\n ballX += speedBallX;\n ballY += speedBallY;\n\n if (ballX + ballRadius > canvas.width && speedBallX > 0) {\n speedBallX *= -1\n }\n if (ballX - ballRadius < 0 && speedBallX < 0) {\n speedBallX *= -1\n }\n if (ballY + ballRadius > canvas.height) {\n ballReset();\n brickReset();\n score = 0;\n }\n if (ballY - ballRadius < 0 && speedBallY < 0) {\n speedBallY *= -1\n }\n}", "function reset()\r\n{\r\nball.x = width/2+100,\r\nball.y = height/2+100;\r\nball.dx=3;\r\nball.dy =3; \r\n}", "function init() {\n //set starting positions\n player.x = player.width;\n player.y = (HEIGHT - player.height) / 2;\n\n ai.x = WIDTH - (player.width + ai.width);\n ai.y = (HEIGHT - ai.height) / 2;\n\n ball.x = (WIDTH - ball.side) / 2;\n ball.y = (HEIGHT - ball.side) / 2;\n\n ball.vel = {\n x: ball.speed,\n y: 0\n\n }\n\n\n\n\n\n\n\n\n\n}", "ballMove(){\n //move position Y\n this._posY += this._ballVelocityY;\n //move position X\n this._posX += this._ballVelocityX;\n \n }", "function start_ball(){\n clearInterval(ball_interval);\n ball_interval=window.setInterval(move_ball,16);\n}", "hit(ball) {\n if (\n ball.x > this.x - this.width / 2 &&\n ball.x < this.x + this.width / 2 &&\n ball.y + ball.size / 2 > this.y - this.height / 2 &&\n ball.y - ball.size / 2 < this.y + this.height / 2\n ) {\n this.active = false;\n let dx = ball.x - this.x;\n ball.vx += map(dx, -this.width / 2, this.width / 2, -2, 2);\n\n ball.vy = -ball.vy;\n ball.ay = 0;\n brickCounter++;\n this.playNote();\n }\n }", "function bounceOffTopBottom() {\n ball.velocityY = -ball.velocityY;\n }", "function moveBall() {\n ball.x += ball.dx;\n ball.y += ball.dy;\n}", "start(){\n this.setMiddleCanva();\n this.changeBallSpeed(4,1);\n }", "drawBall(){\n \tstroke(0);\n strokeWeight(1);\n fill(\"brown\");\n\t\t rect(this.x,this.y,100,35,10);\n\t}", "moveBall(){\n\t\tthis.x = this.x+ this.speed;\n\t\tthis.y = this.y;\n\t}", "update(){\n var offset = 50;\n this.ball.setVelocity((this.ball.body.velocity.x > 0) ? gameOptions.ballSpeed : -gameOptions.ballSpeed, this.ball.body.velocity.y);\n\n // if the ball flies off the screen...\n if(this.ball.y < -offset || this.ball.y > game.config.height + offset){\n \n // restart the game\n this.scene.start(\"PlayGame\");\n }\n }", "bounceBall(){\n if (this.x >= me.x-15 && this.x <= me.x+15 && this.y > me.y-40 && this.y < me.y+40){\n this.speed = -this.speed;\n mySound.setVolume(0.1);\n mySound.play();\n \t\t}\n \t}", "reset() {\n //spawns it at the middle of the sketch\n this.x = width / 2;\n this.y = height / 2;\n //allows the ball to pop up at a random speed and angle when it has been generated\n let angle = random(-PI / 4, PI / 4);\n this.ballvx = 5 * Math.cos(angle);\n this.ballvy = 5 * Math.sin(angle);\n\n if (random(1) < 0.5) {\n this.ballvx *= -1;\n }\n }", "moveBall() {\n this.ball.X += this.ball.dx;\n this.ball.Y += this.ball.dy;\n }", "function ballReset() {\n ballSpeedX = -ballSpeedX;\n ballX = canvas.width / 2;\n ballY = canvas.height / 2;\n}", "function moveBall() {\n\n\tif (!firstTime) {\n\t\tball.x += ball.dx;\n\t\tball.y += ball.dy;\n\t}\n\n\t// Wall collision (right/left)\n\tif (ball.x + ball.size > canvas.width || ball.x - ball.size < 0)\n\t\tball.dx *= -1;\n\n\n\t// Wall collision (top/bottom)\n\tif (ball.y + ball.size > canvas.height || ball.y - ball.size < 0)\n\t\tball.dy *= -1;\n\n\t// Paddle collision\n\tif (ball.x - ball.size >= paddle.x && ball.x + ball.size <= paddle.x + paddle.w &&\n\t\tball.y + ball.size >= paddle.y)\n\t\tball.dy = -ball.speed;\n\n\t// Brick collision\n\tbricks.forEach(row => {\n\t\trow.forEach(brick => {\n\t\t\tif (brick.visible) {\n\t\t\t\tif (ball.x - ball.size > brick.x && // brick left side check\n\t\t\t\t\tball.x + ball.size < brick.x + brick.w && // brick right side check\n\t\t\t\t\tball.y + ball.size > brick.y && // brick top side check\n\t\t\t\t\tball.y - ball.size < brick.y + brick.h // brick bottom side check\n\t\t\t\t) {\n\t\t\t\t\tball.dy *= -1;\n\t\t\t\t\tbrick.visible = false;\n\t\t\t\t\tincreaseScore();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t});\n\n\t// Lose game if ball hits bottom wall\n\tif (ball.y + ball.size > canvas.height)\n\t\tendGame();\n}", "function updateBall()\n{\n\tballLastX = ballX;\n\tballLastY = ballY;\n\tif (ballVelocityX > 0)\n\t{\n\t\tballX = ballX + ballSpeed + ballAngleMod;\n\t}\n\telse\n\t{\n\t\tballX = ballX - ballSpeed - ballAngleMod;\n\t}\n\tif (ballVelocityY > 0)\n\t{\n\t\tballY = ballY + ballSpeed;\n\t}\n\telse\n\t{\n\t\tballY = ballY - ballSpeed;\n\t}\n}", "function myMove(eball)\n{\n //Set the position 0 initially\n var pos = 0;\n //Ref 8 based on stackoverflow defined in licenses.txt\n //Answer Link:https://stackoverflow.com/questions/25352760/how-to-make-object-move-in-js\n\n //Set a interval sa as to make the ball finish its desired path in a fixed time limit\n var id = setInterval(frame, 10);\n //Function that has the moving logic\n function frame()\n {\n //Clear the element if it reaches below a certain pixel range\n if (pos == 1024)//setting of the finish line\n {\n clearInterval(id);\n eball.remove();\n }\n //Continue to move till the finish line hits.\n else\n {\n pos++;//Add the position\n eball.style.top = pos + 'px';//Continuosly keep on adding the position value to account for the movement\n }\n }\n}", "function resetBall() {\n ball.x = canvas.width / 2\n ball.y = canvas.height - 50\n ball.dx = 1\n ball.dy = 1\n ball.speed = 1\n}", "moveBall(){\r\n if (this.direction == \"right\"){\r\n this.x = this.x+ this.speed;\r\n } else if(this.direction == \"left\"){\r\n this.x = this.x - this.speed;\r\n }\r\n\t\t// this.x = this.x+ this.speed;\r\n\t\t// this.y = this.y+.5;\r\n\t}", "function ballReset() {\n ballX = canvas.width / 2;\n ballY = canvas.height / 2;\n speedBallY = 3;\n}", "function resetBall() {\n ball.x = cvs.width / 2;\n ball.y = paddle.y - BALL_RADIUS;\n ball.dx = 3 * (Math.random() * 2 - 1);\n ball.dy = -3;\n}", "function drawBall() {\n\t\tctx.beginPath();\n\t\tctx.arc(ball.x, ball.y, ball.size, 0, Math.PI * 2);\n\t\tctx.fillStyle = '#555';\n\t\tctx.fill();\n\t\tctx.closePath();\n\t}", "function draw() {\n fill(255, 60);\n rect(0, 0, width, height);\n //Now, we draw the ball\n fill(255, 0, 0);\n ellipse(x, y, 20, 20)\n //Now, we account for wall bounce\n if (x === 390) {\n xSpeed = -1;\n }\n if (x === 10) {\n xSpeed = 1\n }\n if (y === 290) {\n ySpeed = -1\n }\n if (y === 10) {\n ySpeed = 1\n }\n //Now, we move the ball\n x = x + xSpeed\n y = y + ySpeed\n}", "move() {\n if (this._y - Ball_Radius <= 0) {\n this._reverseY();\n } else if (this._x - Ball_Radius <= 0 || this._x + Ball_Radius >= Scene_Width) {\n this._reverseX();\n }\n this._x = this._x + this._dx;\n this._y = this._y + this._dy;\n }", "function addBall(){\n ball = new Circle (BALL_RADIUS);\n ball.setPosition(getWidth()/2, getHeight()/2);\n add(ball);\n}", "checkBall() {\n this.ballPosition++;\n\n var disc = this.discs[ this.ballPosition ];\n\n if (disc && !disc.isSlotLinedUp()) {\n // ball bounces away\n this.ballPosition = -1;\n this.ballDropping = false;\n }\n }", "restart() {\n this.x = ballIni.xIni;\n this.hb.x = this.x + ballHitBox.plusX;\n this.y = ballIni.yIni;\n this.hb.y = this.y + ballHitBox.plusy;\n this.speedx = ballIni.speedX * randomPolarity();\n this.speedy = ballIni.speedY * randomPolarity();\n }", "function BallStartPosition()\n {\n var randomNum = Math.floor(Math.random()*2)\n if(randomNum == 0)\n {\n ball.speedX = -ball.speedX;\n ball.speedY = -ball.speedY;\n }\n if(randomNum == 1)\n {\n ball.speedX = Math.abs(ball.speedX);\n ball.speedY = Math.abs(ball.speedY);\n }\n console.log(randomNum);\n }", "function ball() {\r\n ctx.fillStyle = 'white';\r\n ctx.fillRect(ballX, ballY, ballSize, ballSize);\r\n // ruch pilki\r\n ballX += ballSpeedX;\r\n ballY += ballSpeedY;\r\n // przyspieszanie piłki gdy pilka odbija sie od paletek lub scianek\r\n if (ballY >= ch - ballSize || ballY <= 0) {\r\n ballSpeedY *= -1;\r\n speedUp();\r\n }\r\n if (ballX <= playerX + paddelWidth && ballX >= playerX && ballY >= playerY - ballSize && ballY <= playerY + paddelHeight) {\r\n ballSpeedX *= -1;\r\n speedUp();\r\n }\r\n if (ballX >= aiX - ballSize && ballY > aiY - ballSize && ballY < aiY + paddelHeight) {\r\n ballSpeedX *= -1;\r\n speedUp();\r\n }\r\n //zapisywanie wyniku\r\n if (ballX <= 0) {\r\n updateScore(ai);\r\n }\r\n\r\n if (ballX >= cw - ballSize) {\r\n updateScore(player);\r\n }\r\n}", "function frame() {\n if (xpos > house_dimensions.left + house_dimensions.width/2) { //once ball is no longer visible\n clearInterval(id); //stop animating\n id = null;\n thrown = true;\n\n xpos = mice[mouse].getBoundingClientRect().left+mice[mouse].getBoundingClientRect().width/2-ball.getBoundingClientRect().width/2-field_dimensions.left; //move ball behind mouse head\n ypos = mice[mouse].getBoundingClientRect().top+mice[mouse].getBoundingClientRect().height/2-ball.getBoundingClientRect().height/2-field_dimensions.top;\n ball.style.top = ypos + 'px';\n ball.style.left = xpos +'px';\n }\n else {\n xpos += xvel; //move ball a little bit (animating)\n ypos += yvel;\n yvel += yacc;\n ball.style.top = ypos + 'px';\n ball.style.left = xpos + 'px';\n }\n}", "function resetBall(){\n ball.x = canvas.width/2;\n ball.y = canvas.height/2;\n ball.vx = -ball.vx;\n ball.speed = 5;\n}", "function createBall() {\n ball = Matter.Bodies.circle(WINDOWWIDTH / 2, WINDOWHEIGHT / 2, BALLRADIUS, {\n label: 'ball',\n density: BALLDENSITY,\n friction: BALLFRICTION,\n frictionAir: BALLAIRFRICTION,\n restitution: BALLBOUNCE,\n render: {\n fillStyle: BALLCOLOR,\n },\n bounds: {\n min: { x: WALLTHICKNESS, y: WALLTHICKNESS },\n max: { x: WINDOWWIDTH - WALLTHICKNESS, y: WINDOWHEIGHT - WALLTHICKNESS }\n }\n });\n Matter.World.add(world, ball);\n }", "function Ball () {\n this.x = canvas.width/2; \t//byrjunar x\n this.y = canvas.height-30;\t//byrjunar y\n this.ballRadius = 10;\t\t//stærð boltans\n this.status = 1; \t\t//status 1 visible, status 0 invisible and not in the game\n this.dx = 2; //hvað boltinn hreyfist í hverjum ramma\n this.dy = -2; //hvað boltinn hreyfist í hverjum ramma\n this.color = \"#000000\";\n this.restart = function() { //setja boltann inn aftur\n if (this.status==1){\n \tthis.x = canvas.width/2; \t//byrjunar x\n \tthis.y = canvas.height-30;\t//byrjunar y\n \tthis.ballRadius = 10;\t\t//stærð boltans\n }\n };\n this.draw = function() { //teikna boltann\n if (this.status==1){\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.ballRadius, 0, Math.PI*2);\n ctx.fillStyle = \"#000000\";\n ctx.fill();\n ctx.closePath();\n }\n };\n}", "function drawBall() {\n ctx.beginPath();\n ctx.arc(ballObject.x, ballObject.y, ballObject.radius, 0, Math.PI * 2);\n ctx.fillStyle = \"black\";\n ctx.fill();\n ctx.closePath;\n }", "function resetBall() {\r\n ball.x = canvas.width / 2;\r\n ball.y = canvas.height / 2;\r\n ball.velocityX = -ball.velocityX;\r\n ball.speed = 7;\r\n}", "drawBall(){\r\n \t\tstroke(0);\r\n \tstrokeWeight(1);\r\n \t\tfill(\"red\");\r\n\t\tellipse(this.x,this.y,10,10);\r\n\t}", "function resetBall() {\n\t//Win conditions\n\tif (player1Score >= WINNING_SCORE || player2Score >= WINNING_SCORE){\n\t\twinScreen = true;\n\t}\n\n\tballSpeedX = -ballSpeedX;\n\t//Gives horizontal center\n\tballX = canvas.width/2;\n\t//Gives vertical center\n\tballY = canvas.height/2;\n}", "function moveBall() {\n\tvar deltaX; // The change in the ball's X direction\n\n\t// Move the ball ahead\n\tballX += ballSpeedX;\n\tballY += ballSpeedY;\n\n\t// Left-side ball/wall collision\n\tif (ballX - ballR < 0) {\n\t\tballSpeedX = -ballSpeedX;\n\t}\n\t// Right-side ball/wall collision\n\tif (ballX + ballR > canvas.width) {\n\t\tballSpeedX = -ballSpeedX;\n\t}\n\t// Top ball/banner collision\n\tif (ballY - ballR < bannerHeight) {\n\t\tballSpeedY = -ballSpeedY;\n\t}\n\t// Bottom ball/lava collision\n\tif (ballY + ballR > canvas.height) {\n\t\tlivesRemaining--;\n\t\tif (livesRemaining === 0) {\n\t\t\tgameOver = true;\n\t\t} else {\n\t\t\tresetBall();\n\t\t\tresetPaddle();\n\t\t\troundStart = true;\n\t\t}\n\t}\n\t// Ball/paddle collision\n\tif (ballY + ballR > canvas.height - paddleHeight &&\n\t\tballX >= paddleX && ballX <= paddleX + paddleWidth) {\n\t\tballSpeedY = -ballSpeedY;\n\t\t// Change ball direction and speed based\n\t\t// on where on the paddle it was hit\n\t\tdeltaX = ballX - (paddleX + (paddleWidth / 2));\n\t\tballSpeedX = deltaX * 0.15;\n\t}\n}", "drawBall(){\n \tstroke(0,55,185);\n strokeWeight(2);\n \tfill(128, 170, 255);\n arc(this.x, this.y, 30, 50, 180, 0);\n strokeWeight(3);\n bezier(this.x-10,this.y+5,this.x-20,this.y+15,this.x-5,this.y+25,this.x-10,this.y+35);\n bezier(this.x,this.y+5,this.x-10,this.y+15,this.x+5,this.y+25,this.x,this.y+35);\n bezier(this.x+10,this.y+5,this.x,this.y+15,this.x+15,this.y+25,this.x+10,this.y+35);\n\n stroke(0,204,102);\n strokeWeight(1.5);\n bezier(this.x-5,this.y+2,this.x-15,this.y+12,this.x,this.y+22,this.x-5,this.y+32);\n bezier(this.x+5,this.y+2,this.x-5,this.y+12,this.x+10,this.y+22,this.x+5,this.y+32);\n\n\t}", "function launchBall() {\n if (oneClick == 1) {\n //** trig caclulations for launch only\n var changeX = x - paddleX; \n changeX = changeX - paddleCenter;\n\n var deltaY = Math.sqrt(Math.pow(paddleCenter, 2) - Math.pow(changeX, 2));\n var theta = Math.atan2(deltaY, changeX);\n dy = (deltaY * (1 / Math.tan(theta)) * Math.tan(theta))/accel;\n dx = dy * (1 / Math.tan(theta));\n dy = -dy;\n //end trig\n\n launch = true;\n oneClick--;\n }\n else{\n return null;\n }\n}", "function ballReset() {\n if (playerOneScore >= winningScore || playerTwoScore >= winningScore) {\n showWinScreen = true;\n }\n //ball fires from the middle of the screen towards the winner of the last point\n ballX = canvas.width / 2;\n ballY = canvas.height / 2;\n ballSpeedX = -ballSpeedX;\n}", "function ballReset() {\n if (player1Score >= WINNING_SCORE ||\n player2Score >= WINNING_SCORE) {\n showingWinScreen = true;\n }\n\n ballSpeedX = -ballSpeedX;\n ballX = canvas.width / 2;\n ballY = canvas.height / 2;\n }", "function moveBall(debug) {\n\t\t//Check were the ball gets hit\n\t\tthis.y += this.speedY;\n\t\tthis.x += this.speedX;\n\t\t//get middle of ball || this.x + (this.radius/2) //Where it hits on plank planksX\n\t\t//this.middleOfBall = this.x + (this.radius/2);\n\t\t/*\n\t\tthis.plankPosX1 = \n\t\tthis.plankPosX2 = this.plankPosX + this.plankWidth;\n\t\tvar middleOfPlank = this.plankPosX1+(this.plankWidth/2);\n\t\tvar ballPositionOnPlank = this.x - this.plankPosX1;\n\t\tconsole.log(ballPositionOnPlank, middleOfPlank);\n\t\tif(!(ballPositionOnPlank<0 ||ballPositionOnPlank > this.plankWidth)) {\n\t\t\tturnY();\n\t\t\tpercentPosition = (ballPositionOnPlank-middleOfPlank)/this.plankWidth;\n\t\t\tconsole.log(\"pp\"+percentPosition);\n\t\t\t\n\t\t\n\n\t\t/*\n\t\tif ((((this.y+this.radius)>= this.ground) && ((this.y+this.radius) <= (this.ground+this.speedY)) && (this.speedY>0)) || (this.y+this.radius)>= this.height) {\n\t\t\t//alert(\"Here\");\n\t\t\t//Left\n\t\t\tif (this.x >= this.plankPosX && this.x <= (this.plankPosX+(this.plankWidth/3))) {//Yellow Zone\n\t\t\t\tif (debug) {\n\t\t\t\t\talert(\"Works1\");\n\t\t\t\t}\n\t\t\t\tthis.speedY*=-1;\n\t\t\t\tif (this.speedX >= 0) {\n\t\t\t\t\tthis.speedX = -1;\n\t\t\t\t}\n\t\t\t\telse if (this.speedX > 0) { //When Ball Enters From Left Side\n\t\t\t\t\tif (debug) {\n\t\t\t\t\t\talert(\"Do nothing\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.x >= (this.plankPosX+(this.plankWidth/3)) && this.x <= this.plankPosX+(this.plankWidth/3)*2) { //Mid CollisionBox\n\t\t\t\tthis.speedX=0;\n\t\t\t\tthis.speedY*=-1;\n\t\t\t}\n\t\t\t//Right\n\t\t\tif ((this.x >= (this.plankPosX+(this.plankWidth/3)*2)) && this.x <= this.plankPosX+(this.plankWidth/3)*3) {//RightCollisionBox\n\t\t\t\tif (debug) {\n\t\t\t\t\n\t\t\t\talert(\"Works3\");\n\t\t\t\t}\n\t\t\t\tthis.speedY*=-1;\n\t\t\t\tif (this.speedX >= 0) {\n\t\t\t\t\tthis.speedX = 1;\n\t\t\t\t}\n\t\t\t\telse if (this.speedX < 0) { //When Ball Enters Box From Right Side\n\t\t\t\t\tif (debug) {\n\t\t\t\t\talert(\"Do nothing\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.debug && this.y > this.height) {\n\t\t\t\n\t\t\t\tthis.SpeedY*=-1;\n\t\t\t\n\t\t\t}\n\t\t}\n\t\telse */if (((this.y-this.radius) <= 0) && (this.speedY<0)) {\n\n\t\t\tthis.speedY*=-1;\n\t\t}\n\n\t\tif ((((this.x+this.radius)>= this.width) && ((this.x+this.radius)< (this.width+this.speedX)) && (this.speedX>0)) || (this.x+this.radius)>= this.width) {\n\n\t\t\tthis.speedX*=-1;\n\n\t\t} else if (((this.x-this.radius) <= 0) && (this.speedX<0)) {\n\n\t\t\tthis.speedX*=-1;\n\n\t\t}\n\t}", "reset() {\n this.ball.pos.x = this._canvas.width / 2;\n this.ball.pos.y = this._canvas.height / 2;\n this.ball.velocity.x = 0;\n this.ball.velocity.y = 0;\n }", "function draw() {\n clear();\n circle(x, y, 10);\n \n//if x + dx is greater than width or x + dx is less than 0, then x=-dx which means the ball is moving in a negtive width direction, left\n if (x + dx > WIDTH || x + dx < 0)\n dx = -dx;\n//if y + dy is greather than height or y + dy is less than zero then the ball is moving in a negative height direction causing the bounce\n if (y + dy > HEIGHT || y + dy < 0)\n dy = -dy;\n \n x += dx;\n y += dy;\n}", "function bouncing_ball() {\n\n\tdraw_briques();\n\n\tfor(j=0;j<balls_lost.length;j++) {\n\t\tif (x[j] + dx[j] > WIDTH || x[j] + dx[j] < 0)\n\t\t\tdx[j] = -dx[j];\n\t\tif (y[j] + dy[j] > HEIGHT || y[j] + dy[j] < 0)\n\t\t\tdy[j] = -dy[j];\n\t}\n\tdraw_ball_or_balls();\n}", "function bounce() {\n ball.body.velocity.x = 400;\n if (ball.body.velocity.y > 0) {\n ball.body.velocity.y = Math.random() * 750\n }\n else {\n ball.body.velocity.y = -Math.random() * 750\n }\n ball.body.velocity.x = ball.body.velocity.x + 10\n this.counter++;\n }", "showBall(){\n noStroke()\n fill('#575dfa')\n circle(this._posX, this._posY, this._radius);\n }", "function ballCollisionsCanvas() {\n if (ball.y + ball.radius > canvas_height) {\n ball.ySpeed = -ball.ySpeed;\n } else if (ball.y - ball.radius < 0) {\n ball.ySpeed = -ball.ySpeed;\n }\n if (ball.x + ball.radius >= canvas_width) {\n ball.xSpeed = -ball.xSpeed;\n } else if (ball.x - ball.radius < 0)\n ball.xSpeed = -ball.xSpeed;\n}", "update() {\n this.x += this.ballvx;\n this.y += this.ballvy;\n }", "function RunBall(ball, map){ \n \n \n ball.dx = ball.dx * .5;\n ball.dy = ball.dy * .5;\n if(Math.abs(ball.dx) < .5){\n ball.dx = ball.dx > 0 ? .5 : -.5;\n }\n if(Math.abs(ball.dy) < .5){\n ball.dy = ball.dy > 0 ? .5 : -.5;\n }\n \n \n if(! ping.Lib.util.inside(ball.x, 0, 575)){\n ball.dx *= -1;\n }\n if(! ping.Lib.util.inside(ball.y, 0, 375)){\n ball.dy *= -1;\n }\n \n return ball;\n }", "ballPathMovement() {\n\t\tthis.ball.setAlpha(1);\n\t\tif(this.ball.y > this.pitchPoint) {\n\t\t\tthis.ball.setScale(this.ball.scale + 0.01);\n\t\t\tthis.ball.y += 8;\n\t\t\tthis.ball.x -=6;\n\t\t\tthis.ball.setPosition(this.ball.x,this.ball.y);\n\t\t} else {\n\t\t\tthis.ball.y += 10;\n\t\t\tthis.ball.x -=1;\n\t\t\tthis.ball.setPosition(this.ball.x,this.ball.y);\n\t\t}\n\t\tif(this.ball.y > this.wicketPos) {\n\t\t\tthis.stadiumGroup.playWicketAnimation();\n\t\t}\n\t}", "function resetBall() {\n\tballX = startBallX;\n\tballY = startBallY;\n\tballSpeedX = 0;\n\tballSpeedY = 0;\n}", "constructor()\r\n {\r\n // getting the image of the white ball\r\n this.image = document.getElementById(\"whiteBall\");\r\n\r\n // size of the ball - width and height\r\n this.size = 50;\r\n\r\n // starting position of the ball\r\n this.position = {\r\n x : tableWidth / 3, \r\n y : (tableHeight / 2) - (this.size / 2)\r\n };\r\n\r\n // starting speed of the ball\r\n this.maxSpeed = {x : 500, y : 500};\r\n\r\n this.speed = {x : 0, y : 0};\r\n\r\n // variable used to determine when the ball is moving\r\n this.moving = false;\r\n\r\n // variable used to decrease the speed\r\n this.decreaseSpeed = 0; \r\n\r\n // will be used to calculate the angle of movement of the white ball\r\n this.lastPosition = {x : 0, y : 0};\r\n\r\n // getting the context\r\n this.ctx = ctx;\r\n }", "function drawBall(x,y)\n{\n\tpush();\n\ttranslate(width/2,height/2);\n\ttranslate(x,y);\n\tscale(50,50);\n\tfill(0);// 填充白色\n\tnoStroke();\n\tellipse(0,0,0.1,0.1); // 画圆形\n\tpop();\n\n}", "function Ball(){\n fill(color(255, 255, 0));\n circle(xBall, yBall, diameter);\n}", "startMovingBall(ball, direction, speed = 10000) {\n this.moveBall(ball.update({ direction, speed }))\n }", "function nextShot()\r\n{\r\n wBall.moving = false;\r\n\r\n // re-drawing the direction line, starting from the center of the white ball\r\n line.position = {\r\n x : wBall.position.x + (wBall.size / 2), // wBall.size / 2 = the radius of the white ball\r\n y : wBall.position.y + (wBall.size / 2)\r\n }\r\n\r\n // re-setting the rotation of the direction line, and the decreasing speed value of the white ball\r\n line.rotation = 0;\r\n wBall.decreaseSpeed = 0;\r\n}", "function spawnBall(){\r\n if(gameState===\"play\") {\r\nif(frameCount %40===0){\r\n ball=createSprite(300,-10,101,19)\r\n ball.x = Math.round(random(0,1000));\r\n ball.addImage(ballImage);\r\n ball.scale = 0.2;\r\n ball.velocityY = +5;\r\n ballGroup.add(ball)\r\n ball.lifetime=200\r\n}\r\n\r\n}\r\n\r\n}", "function draw(){\n background(0); //Why do we need to set the background color here? Try commenting this out!\n fill(r, g, b); //Coloring the ball\n ellipse(xPos, yPos, rad*2, rad*2);\n text('You\\'ve clicked the ball ' + clickCount + ' times!', 30, 30);\n\n // exit();\n //Adding the speed to the position of the ball to move it every time the draw function runs\n xPos += spdX;\n yPos += spdY;\n\n //A random number between -15 and 15\n let randomNum = Math.floor(random(-15, 15));\n\n if(xPos < 0){ //Checking if the ball's position is on the edge of the canvas\n xPos = 0; //Making sure it doesn't go beyond the edge\n\n```\nif(spdX == maxSpeed || spdX == -maxSpeed){ //Checking if the speed has reached our max speed\n spdX = spdX; //If it has, we will set it equal to itself from now on in order to prevent it from going higher\n}\nelse if(spdX > 0){//Is our speed value positive\n spdX += speedIncrement; //If it's positive we add to it to make it faster\n}else{\n spdX -= speedIncrement; //If it's negative we subtract to make it faster\n}\n\nspdX = -spdX; //Reversing the direction because it hit a wall\nxPos += randomNum; //Making the ball go in a slightly random direction everytime it hits the wall\n```\n\n }\n\n //Below we repeat this process for the other 3 sides of the canvas\n if(yPos < 0){\n yPos = 0;\n if(spdY == maxSpeed || spdY == -maxSpeed){\n spdY = spdY;\n }\n else if(spdY > 0){\n spdY += speedIncrement;\n }else{\n spdY -= speedIncrement;\n }\n spdY = -spdY;\n yPos += randomNum;\n }\n if(xPos > 600){\n xPos = 600;\n if(spdX == maxSpeed || spdX == -maxSpeed){\n spdX = spdX;\n }\n else if(spdX > 0){\n spdX += speedIncrement;\n }else{\n spdX -= speedIncrement;\n }\n spdX = -spdX;\n xPos -= randomNum;\n }\n if(yPos > 600){\n yPos = 600;\n if(spdY == maxSpeed || spdY == -maxSpeed){\n spdY = spdY;\n }\n else if(spdY > 0){\n spdY += speedIncrement;\n }else{\n spdY -= speedIncrement;\n }\n spdY = -spdY;\n yPos -= randomNum;\n }\n\n\n}", "function ballCollisionsCanvas(){\n if(ball.y + ball.radius > canvas_height){\n ball.ySpeed = -ball.ySpeed;\n }else if(ball.y - ball.radius < 0){\n ball.ySpeed = -ball.ySpeed;\n }\n if(ball.x + ball.radius >= canvas_width){\n ball.xSpeed = -ball.xSpeed;\n }else if(ball.x - ball.radius < 0)\n ball.xSpeed = -ball.xSpeed;\n}", "function resetBall(){\n ball.x = canvas.width/2;\n ball.y = canvas.height/2;\n ball.velocityX = -ball.velocityX;\n ball.speed = 7;\n}", "function resetBall(){\n ball.x = canvas.width/2;\n ball.y = canvas.height/2;\n ball.velocityX = -ball.velocityX;\n ball.speed = 7;\n}", "function freeBallMovement(){\n let ball = document.querySelector('#ball');\n let ballTop = ball.offsetTop;\n let ballLeft = ball.offsetLeft;\n\n //free ball movement\n if(directionTop==true){\n ball.style.top = (ballTop+ballSpeed*3)+'px';\n if(directionLeft==true){\n // console.log(\"top-left\"+ball.style.left)\n ball.style.left = (ballLeft+ballSpeed*1.8)+'px';\n }else{\n // console.log(\"top-right\"+ball.style.left)\n ball.style.left = (ballLeft-ballSpeed*.5)+'px';\n }\n }\n else{\n ball.style.top = (ballTop-ballSpeed)+'px';\n if(directionLeft==true){\n // console.log(\"bottom-left\"+ball.style.left)\n ball.style.left = (ballLeft+ballSpeed*1.8)+'px';\n }else{\n // console.log(\"bottom-right\"+ball.style.left)\n ball.style.left = (ballLeft-ballSpeed*.5)+'px';\n }\n }\n detectCollision();\n}", "function run_ball_1() {\r\n id_movingBall(\"p0\", 0);\r\n setInterval(move_Ball_1, 10);\r\n}", "scaleBall() {\n this.ball.scaleX = 1 - (this.distance * 3) / (4 * this.totalDistance);\n this.ball.scaleY = 1 - (this.distance * 3) / (4 * this.totalDistance);\n this.ballRadius = startRadius * this.ball.scaleX;\n this.stage.update();\n }", "function moveBall() {\n balls.forEach((element) => {\n if (\n element.xPos + element.radius > canvas.width ||\n element.xPos - element.radius < 0\n ) {\n element.xVel = -element.xVel;\n }\n if (\n element.yPos + element.radius > canvas.height ||\n element.yPos - element.radius < 0\n ) {\n element.yVel = -element.yVel;\n }\n\n element.xPos += element.xVel;\n element.yPos += element.yVel;\n });\n}", "function moveBallTo(xPosition, yPosition)\n{\n\tballX = xPosition;\n\tballY = yPosition;\n\tballLastX = xPosition;\n\tballLastY = yPosition;\n}", "function ballPaddleCollision() {\n if (ball.x < paddle.x + paddle.width && ball.x > paddle.x && paddle.y < paddle.y + paddle.height && ball.y > paddle.y) {\n\n // JOUER LE SON\n PADDLE_HIT.play();\n\n // CHECK WHERE THE BALL HIT THE PADDLE\n let collidePoint = ball.x - (paddle.x + paddle.width / 2);\n\n // NORMALIZE THE VALUES\n collidePoint = collidePoint / (paddle.width / 2);\n\n // CALCULATE THE ANGLE OF THE BALL\n let angle = collidePoint * Math.PI / 3;\n\n\n ball.dx = ball.speed * Math.sin(angle);\n ball.dy = -ball.speed * Math.cos(angle);\n }\n}", "function frame()\n {\n //Clear the element if it reaches below a certain pixel range\n if (pos == 1024)//setting of the finish line\n {\n clearInterval(id);\n eball.remove();\n }\n //Continue to move till the finish line hits.\n else\n {\n pos++;//Add the position\n eball.style.top = pos + 'px';//Continuosly keep on adding the position value to account for the movement\n }\n }", "function startGame(){\n var x = field.offsetWidth - 150;\n var y = field.offsetHeight - 150;\n\n var randX = Math.floor(Math.random(x) * x);\n var randY = Math.floor(Math.random(y) * y);\n\n var ballPositionX = randX;\n var ballPositionY = randY; \n var id = setInterval(frame, 10);\n\n function frame() {\n\n if (ballPositionX == field.offsetWidth-goal.offsetHeight || ballPositionY == field.offsetHeight-goal.offsetHeight) {\n clearInterval(id);\n } else if (currentPosition === ballPositionX || ballPositionY) {\n ballPositionX ++;\n ballPositionY ++;\n ball.style.top = ballPositionY + 'px';\n ball.style.left = ballPositionX + 'px';\n }\n paddleCollision();\n threeShots();\n }\n }", "function ballHitPaddle(ball, paddle) {\n ball.animations.play('wobble');\n ball.body.velocity.x = -1 * 5 * (paddle.x - ball.x)\n}", "function ballReset() {\n winCheck();\n ballSpeedX = 5;\n ballSpeedY = 0;\n ballX = canvas.width/2;\n ballY = canvas.height/2;\n}", "bonanza() {\n while (!this.collides(0, 1, this.shape)) {\n this.moveDown()\n }\n }", "jump() {\n this.x = Math.floor(this.x0 + this.v0*this.t + 1/2 * this.g * this.t*this.t);\n this.ballPos.splice(0, 1, 180-this.x);\n this.ball.style.top = `${this.ballPos[0]}px`;\n this.t+=0.1;\n \n if (this.x <= 0) {\n this.jumpin = false; \n this.ball.style.top = 180+'px';\n this.x=0;\n this.t = 0.1;\n this.jumpKeyDown = this.jumpKeyDown ? false : true;\n this.jumpKeyUp = this.jumpKeyUp ? false : true;\n \n this.ball.innerHTML = this.faces[0]\n }\n }", "movePaddle(ball) {\n if (this.type === 'Human') {\n //\"previous\" values keep track of 4 positions ago, and are the values\n //actually used in spinVector\n this.previousX = this.placeholder2X;\n this.previousY = this.placeholder2Y;\n\n this.placeholder2X = this.placeholderX;\n this.placeholder2Y = this.placeholderY;\n\n this.placeholderX = this.paddle.x;\n this.placeholderY = this.paddle.y;\n\n this.paddle.x = this.stage.mouseX - this.width / 2;\n this.paddle.y = this.stage.mouseY - this.height / 2;\n } else {\n const xGap = ball.farX - (this.paddle.x + (this.width / 2));\n const yGap = ball.farY - (this.paddle.y + (this.height / 2));\n //below divisor determines how quickly aiPaddle reacts\n this.paddle.x += (xGap * (0.025 * (this.difficulty + 1)));\n this.paddle.y += (yGap * (0.025 * (this.difficulty + 1)));\n }\n\n this.defineBounds();\n this.stage.update();\n }", "function keepInScreen() {\n // ball hits floor\n if (ballY + (ballSize/2) > height) {\n makeBounceBottom(height);\n }\n // ball hits cieling\n if (ballY - (ballSize/2) < 0) {\n makeBounceTop(0);\n }\n //ball hits left wall\n if (ballX - (ballSize/2) < 0) {\n makeBounceLeft(0);\n }\n\n // ball hits right wall\n if (ballX + (ballSize/2) > width) {\n makeBounceRight(width);\n }\n}", "function moveBall(){\n //Define the start position before changing to the new position\n ballStartX = ballNewPosX;\n ballStartY = ballNewPosY;\n\n //Calculate the new position\n newPos();\n\n //Set the intermediate number to be added to the positions, to make the movement\n var intermediateX = (ballNewPosX-ballStartX+1)/6; //+1 is to avoid getting a 0 in the numerator\n var intermediateY = (ballNewPosY-ballStartY+1)/6; //+1 is to avoid getting a 0 in the numerator\n var intervalCount = 0;\n var cycle = 0;\n\n //Makes the movement of the ball\n var ballInterval = setInterval(function(){\n //Counter of the interval and Stop moving the ball after drawing the predefined amout of times\n intervalCount += 1;\n if (intervalCount == 6){\n clearInterval(ballInterval);\n }\n\n //Define new position of the ball\n ballStartX = ballStartX + intermediateX;\n ballStartY = ballStartY + intermediateY;\n\n //BOUNDARY: Bounce the ball if reaches RIGHT or LEFT boundary\n if (ballStartX>boundaryRight-ballWidth || ballStartX<boundaryLeft){\n //Set the X adjusted position after bouncing, adjust X direction\n ballNewPosX = ballStartX - (7 - intervalCount) * intermediateX;\n ballStartX = ballStartX - intermediateX;\n intermediateX = - intermediateX;\n timesBounced = timesBounced + 1;\n }\n\n //BOUNDARY: Bounce the ball if reaches UP or DOWN boundary\n if (ballStartY<boundaryUp || ballStartY>boundaryDown-ballHeight){\n //Set the Y adjusted position after bouncing, adjust Y irection\n ballNewPosY = ballStartY - (7 - intervalCount) * intermediateY;\n ballStartY = ballStartY - intermediateY;\n intermediateY = - intermediateY;\n timesBounced = timesBounced + 1;\n }\n\n var howManyWalls = wallPosition[level-1][\"length\"];\n for (var i = 0; i < howManyWalls; i++){\n wallX = wallPosition[level-1][i][0];\n wallY = wallPosition[level-1][i][1];\n wallW = wallPosition[level-1][i][2];\n wallH = wallPosition[level-1][i][3];\n if ((ballStartY > wallY - wallH/2)\n && (ballStartY < wallY + wallH/2)\n && (ballStartX < wallX + wallW/2)\n && (ballStartX > wallX - wallW/2)){\n ballNewPosX = ballStartX - (7 - intervalCount) * intermediateX;\n ballStartX = ballStartX - intermediateX;\n intermediateX = - intermediateX;\n\n ballNewPosY = ballStartY - (7 - intervalCount) * intermediateY;\n ballStartY = ballStartY - intermediateY;\n intermediateY = - intermediateY;\n timesBounced = timesBounced + 1;\n console.log(\"Hit the wall\");\n }\n }\n\n //WALL: Bounce the ball if hits walls\n console.log (wallX, ballStartX, wallW, ballWidth, ballStartY, wallY);\n if ((ballStartY > wallY - wallH/2)\n && (ballStartY < wallY + wallH/2)\n && (ballStartX < wallX + wallW/2)\n && (ballStartX > wallX - wallW/2)){\n console.log(\"Hit the wall\");\n }\n //if the ball position = wall postion, then its over a wall\n\n if (ballStartX > wallX-ballWidth\n && ballStartX < wallX+wallW\n && ballStartY > wallY-ballHeight\n && ballStartY < wallY+wallH){\n\n\n // ballNewPosX = ballStartX - (7 - intervalCount) * intermediateX;\n // ballStartX = ballStartX - intermediateX;\n // intermediateX = - intermediateX;\n //\n // ballNewPosY = ballStartY - (7 - intervalCount) * intermediateY;\n // ballStartY = ballStartY - intermediateY;\n // intermediateY = - intermediateY;\n // timesBounced = timesBounced + 1;\n }\n // function contactWithWall (){\n // if\n // }\n\n //Clear canvas and Draw objects\n context.clearRect(0,0,canvas.width,canvas.height);\n draw();\n\n //Draw the moving ball\n cycle = (cycle+1)%2;\n context.drawImage(ball, cycle * ballWidth, 0, ballWidth, ballHeight, ballStartX, ballStartY, ballWidth, ballHeight);\n\n //Define the area in which the ball will be considered in the hole, end game\n if ((ballNewPosX > holePosX-15 && ballNewPosX < holePosX+15) && (ballNewPosY > holePosY-15 && ballNewPosY < holePosY+15)){\n clearInterval(ballInterval);\n document.removeEventListener(\"mousemove\",trackLine);\n nextLevel();\n }\n },50)\n //Reset the strike power to 0 for a new strike\n strike = 0;\n}", "function reset() {\n drawBricks();\n ctx.clearRect(ball.x - ball.radius, ball.y - ball.radius, ball.radius*2, ball.radius*2);\n \n ball.x = canvas.width / 2;\n ball.y = canvas.height - 50;\n ball.speed = 5;\n ball.dx = 1;\n ball.dy = -1;\n paddle.x = 110;\n paddle.y = 135;\n drawPaddle();\n \n}", "function Ball(x, y, radius, color) {\r\n this.x = x;\r\n this.y = y;\r\n this.radius = radius;\r\n this.color = color;\r\n this.dx = ballSpeed;\r\n this.dy = -ballSpeed;\r\n}", "bounce() {\r\n if (this.x + this.w / 2 >= width) {\r\n this.x = width - this.w / 2;\r\n }\r\n\r\n if (this.x - this.w / 2 <= 0) {\r\n this.x = this.w / 2;\r\n }\r\n }" ]
[ "0.7489963", "0.73889536", "0.73438424", "0.72446686", "0.7232999", "0.720319", "0.7152269", "0.7126559", "0.7043286", "0.70104784", "0.6984164", "0.696131", "0.6956806", "0.69281054", "0.6904723", "0.69002414", "0.68799525", "0.6836017", "0.68121886", "0.67816716", "0.67703027", "0.676138", "0.6756385", "0.675304", "0.6736271", "0.673002", "0.6726152", "0.6722505", "0.67209154", "0.67121047", "0.6710103", "0.66979855", "0.6697328", "0.6685534", "0.6650499", "0.66498375", "0.664471", "0.66426027", "0.66183245", "0.66153026", "0.66028726", "0.6597251", "0.659453", "0.65836203", "0.65823686", "0.6578002", "0.6567696", "0.6567587", "0.6557369", "0.6556881", "0.65539086", "0.6535131", "0.6527512", "0.65273416", "0.65248525", "0.6515516", "0.6513178", "0.6497265", "0.6496917", "0.6496904", "0.6496184", "0.64811814", "0.64767194", "0.6475508", "0.6471535", "0.64664763", "0.6462845", "0.6461342", "0.64536834", "0.6448097", "0.64461863", "0.644565", "0.6443133", "0.64384353", "0.6435036", "0.64284784", "0.6426674", "0.642595", "0.64246374", "0.64067376", "0.6406365", "0.64048135", "0.64048135", "0.6402102", "0.63932633", "0.63920176", "0.6387996", "0.63863766", "0.635498", "0.63493496", "0.63394624", "0.6328757", "0.63283783", "0.6318955", "0.631258", "0.63067687", "0.6303288", "0.6296426", "0.629346", "0.6290653", "0.62855047" ]
0.0
-1
corresponding to whether that string is a palindrome (spelled the same backwards and forwards). Our palindrome check should be caseinsensitive. Examples isPal('car') => false isPal('racecar') => true isPal('RaCecAr') => true isPal('!? 100 ABCcba 001 ?!') => true
function isPal(str) { const lowerCaseStr = str.toLowerCase(); let reversedStr = ''; for (let i = lowerCaseStr.length - 1; i > -1; i--) { reversedStr += lowerCaseStr[i]; } if (lowerCaseStr === reversedStr) { return true; } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isPalindrome(str) {\n\n}", "function palindrome(str) {\n return true;\n}", "function isPalidrome(str){\n let reverseStrArray = str.split('').reverse();\n let reverseStr = reverseStrArray.join(''); \n \n if (str === reverseStr){\n return true;\n }\n \n return false;\n }", "function palindrome(str) {\n \n // pre-process\n str = str.toLowerCase();\n \n // find unwanted characters and replace\n const re = /[^a-z\\d]+/g;\n\tstr = str.replace(re, '');\n\t\n // for reversing a string\n function reverseString(txt) {\n return txt.split('').reverse().join('');\n\t}\n\n\t// A question of symmetry:\n // find length & middle, split and reverse one piece\n // then check for equality\n \n\t// even if odd length string, this will give us enough to\n\t// check two halves are palindromic\n\tconst half = Math.floor(str.length / 2);\n\t\n\tconst flipped = reverseString(str.substring(str.length - half));\n\t\n\treturn str.substring(0, half) === flipped;\n \n}", "function isPalindrome(str) {\n return str.split('').reverse().join('').toLocaleLowerCase() === str.toLocaleLowerCase();\n}", "function palindrome(string) {\n let lower = string.toLowerCase();\n return lower === reverse(lower);\n}", "function isPalindrome(str) {\n var re = /[^A-Za-z0-9]/g; //set up our regular expression that will do a global(g modifier) search for the character-span that is not from A-Z, a-z, and 0-9;\n var myString = str.toLowerCase().replace(re, \"\"); //set our string to lower case and remove anything that is not from A-Z, a-z, and 0-9 replace with an empty quotation mark(\"\");\n var reverseString = myString.split(\"\").reverse().join(\"\"); //split our string, reverses it and join back together for comparsion;\n return myString === reverseString; //check to see if our string is palindrome, returns true or false value;\n}", "function palindrome(str) {\r\n // Good luck!\r\n return true;\r\n}", "function palindrome(string) {\n return string.toLowerCase() === reverse(string.toLowerCase());\n}", "function palindrome(str) {\n return str.toLowerCase().split('').reverse().join('') === str.toLowerCase();\n}", "function isPalindrome(s) {\n var str = s.replace(/[^a-zA-Z0-9]/g, '').toLowerCase()\n var half = Math.floor(str.length / 2)\n var lastIndex = str.length - 1\n for (var i = 0; i < half; i++) {\n if (str[i] !== str[lastIndex - i]) {\n return false\n }\n }\n\n return true\n}", "function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent === reverse(processedContent);\n}", "function palindrome(str){\r\n return reverseString(str) === str;\r\n}", "function isRealPalindrome(string) {\n string = string.replace(/[^a-z0-9]/gi,\"\").toLowerCase();\n return isPalindrome(string);\n}", "function isPalindrome(s) {\n var pal = s.split('').reverse().join('');\n return s == pal;\n}", "function palindrome(str) {\n const string = str.toLowerCase().replace(/[^0-9a-z]/gi, '').trim(),\n reversed = string.split('').reverse().join('');\n\n if (reversed === string) {\n return true;\n }\n\n return false;\n}", "function isPalindrome(str){\n let revStr = reversedStr(str)\n if(revStr.toLowerCase() === str.toLowerCase()){\n console.log(`${str} is a palindrome!`)\n } else { \n console.log(`${str} is not a palindrome!`)\n }\n}", "function palindrome(str) {\n var filteredString = str.toLowerCase().replace(/[^A-Za-z0-9]/g,'');\n var reverseString = filteredString.split('').reverse().join('');\n \n if (filteredString === reverseString) {\n return true;\n }\n return false;\n}", "function isPalindrome( string ) {\n\tstring = onlyLetters( string );\n\tfor ( var i = 0; i < Math.floor( string.length / 2 ); i++ ) {\n\t\tif ( string[ i ].toUpperCase() !== string[ string.length - i - 1 ].toUpperCase() ) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function isPalindrome(str) {\n if(str === null) {\n return false;\n }\n str = str.toLowerCase();\n str = str.replace(/[^a-zA-Z0-9]/g,''); \n var std = str.replace(\" \", \"\").split('').reverse().join('');\n if(str == std){\n return true;\n }\n else{\n return false;\n }\n }", "function palindrome(str) {\n let regex = /[a-z0-9]/;\n let strArr = str.toLowerCase().split(\"\").filter(ele => regex.test(ele));\n let inverseArr = [];\n\n strArr.forEach(ele => {inverseArr.unshift(ele)});\n\n return strArr.join(\"\") == inverseArr.join(\"\")? true: false;\n}", "function isPalindrome(str){\n var noPuncStr = str.replace(/[\\.,-\\/#!$%\\^&\\*;:{}=\\-_`~()]/g,\"\");\n var newStr = noPuncStr.toLowerCase().replace(/ /g, '');\n var reverseStr = newStr.split('').reverse().join('');\n\n if (newStr === reverseStr){\n return true;\n } else {\n return false;\n }\n}", "function isPalindrome (inputStr) {\n\treturn inputStr.split('').reverse().join('') === inputStr ? true : false; \n}", "function palindrome(str) {\n // Compare if original string is equal with reversed string\n return str === reverse(str)\n}", "function palindrome(str) {\n // var re = /[\\W_]/g;\n // var lowRegStr = str.toLowerCase().replace(re, '');\n var reverseStr = str.split('').reverse().join('');\n if(str == reverseStr) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome(str) {\n let pal = str.split('').filter(char => /[a-z]| */.test(char));\n\n return pal.join('') === pal.reverse().join('') ? true : false;\n}", "function isPalindrome(s) {\n\tvar str = s.replace(/\\W/g,\"\").toLowerCase();\n\treturn str == str.split(\"\").reverse().join(\"\")\n}", "function isPalindrome(str) {\n var re = /[^A-Za-z0-9]/g; //set up our regular expression that will do a global(g modifier) search for the character-span that is not from A-Z, a-z, and 0-9;\n str = str.toLowerCase().replace(re, \"\"); //set our string to lower case and remove anything that is not from A-Z, a-z, and 0-9 replace with an empty quotation mark(\"\");\n var strLength = str.length; //use .lenth to get the length of our string;\n for (var i= 0; i< strLength/2; i++ ){ //divide the string length in half for faster calculation against large string;\n if(str[i] !== str[strLength - 1 - i]){ //compare each letter, strLength-1 is because index is different than length, index starts from 0 while .length counts from 1; \n return false; //return false once the character don't match and exit the loop;\n }\n }\n return true;\n}", "function isPalindrome(s) {\n s = s.replace(/( |[^a-zA-Z0-9])/g, '').toLowerCase()\n var i = 0\n var j = s.length - 1\n\n while (i < j){\n if (s[i] === s[j]) {\n i++\n j--\n } else {\n return false\n }\n }\n\n return true\n}", "function isPalindrome(str) {\n\n //str = str.toString().replace(/[^a-z0-9]/gi, '').toLowerCase()\n str = str.replace(/[^a-z0-9]/gi, '').toLowerCase()\n\n let x = 0\n let y = str.length - 1\n\n if (str[x] != str[y]) {\n return false\n }\n x += 1\n y -= 1\n\n return true\n}", "function palindrome(str) {\n// var lowRegStr = str.toLowerCase().replace(/[\\W_]/g, '');\n// var reverseStr = str.toLowerCase().replace(/[\\W_]/g, '').split('').reverse().join(''); \n return str.toLowerCase().replace(/[\\W_]/g, '').split('').reverse().join('') === str.toLowerCase().replace(/[\\W_]/g, '');\n}", "function palindrome(str) {\n let unwanted = /[^A-Z0-9]/gi;\n let stripped = str.replace(unwanted, \"\").toLowerCase();\n let reversed = stripped.split(\"\").reverse().join(\"\");\n return stripped == reversed;\n}", "function palindrome(string) {\n let processedContent = string.toLowerCase();\n return processedContent() === reverse(this.processedContent());\n}", "function isPalindrome(str, isCaseSensitive)\n{\n return isCaseSensitive ? (reverseString(str).toLowerCase() === str.toLowerCase()) : (reverseString(str) === str);\n}", "function palindromeCheck(str) {\n if (str.length === 1) { // if the length of a word is only 1 character, \n return false; // take it out because a palindrome cannot be created. \n }\n\n str = str.toLowerCase(); // make lower case to make sure algo accounts for all characters in string\n\n let reverseStr = ''; // instantiate blank palindrome holder; \n\n for (let i = str.length - 1; i >= 0; i--) { // loop through string backwards and see what comes out as a palindrome. \n reverseStr += str[i]; // count the number of times a palindrome was able to be found and with what words in string. \n }\n\n return reverseStr === str; // return all palindromes that are the same as the existing words in the string.\n}", "function palindrome(str) {}", "function isPalindrome(userStr) { \n // removes the special chars and spaces and transforms it to lowercase\n // g - global matching (all matches)\n // i - insensitive match - ignore letter case (case insensitive)\n newStr = userStr.replace(/[^A-Z0-9]/gi, \"\").toLowerCase()\n return newStr === newStr.split('').reverse().join('');\n}", "function isPalindrome(text){\n if (text === undefined){\n return;\n }\n /* Store original formatted string using regex to strip all symbols and whitespace */\n var originalString = text.toLowerCase().replace(/[^\\w]|_/g, \"\");\n\n /* Store formatted reversed string */\n var reversedString = text.toLowerCase().replace(/[^\\w]|_/g, \"\").split(\"\").reverse().join(\"\");\n\n /* If the two strings are equal to each other, it is a palindrome */\n if (originalString == reversedString){\n return 'is-palindrome';\n } else{\n return 'not-palindrome';\n }\n}", "function palindrome2(str) {\n str = str.match(/[A-Za-z0-9]/gi).join(\"\").toLowerCase();\n var polindromo = str.split('').reverse().join('');\n return polindromo === str;\n}", "function checkPalindrom(str) {\n//replace all non letter characters and move all to lowercase\n // str = str.replace(/[^a-zA-Z0-9]/g, '').toLowerCase();\n str = str.toLowerCase();\n //check if input string is not zero sized\n if (str.length !== 0)\n //return answer if input string is a palindrome\n return str === str.split('').reverse().join('');\n else return false;\n}", "function palindromeChecker(text) {\n const reversedText = text.toLowerCase().split(\"\").reverse().join(\"\")\n return text === reversedText\n}", "isPalindrome() {\n }", "function checkStringPalindrome(str){\n // convert string into lowercase and remove all alphanumeric characters\n var reg = /[^A-Za-z0-9]/g;\n var lowercaseString = str.toLowerCase().replace(reg , '');\n // Reverse String\n var reversedString = lowercaseString.split('').reverse().join('');\n // check if reversedstring and lowercaseString are equal\n if(reversedString === lowercaseString){\n return 'Palindrome';\n } else {\n return 'Not Palindrome';\n } \n}", "function isPalindrome(str) {\n // const revString = str\n // .split(\"\") // turn a string into an array\n // .reverse() // reverse, duh\n // .join(\"\"); // method returns the array as a string.\n // return revString === str;\n}", "function isPalindrome(str) {\r\n if(str === reverseString(str))\r\n return true;\r\n return false;\r\n}", "function palindrome(str) {\n //assign a front and a back pointer\n let front = 0\n let back = str.length - 1\n \n //back and front pointers won't always meet in the middle, so use (back > front)\n while (back > front) {\n //increments front pointer if current character doesn't meet criteria\n if ( str[front].match(/[\\W_]/) ) {\n front++\n continue\n }\n //decrements back pointer if current character doesn't meet criteria\n if ( str[back].match(/[\\W_]/) ) {\n back--\n continue\n }\n //finally does the comparison on the current character\n if ( str[front].toLowerCase() !== str[back].toLowerCase() ) return false\n front++\n back--\n }\n \n //if the whole string has been compared without returning false, it's a palindrome!\n return true\n \n }", "function isPalindrome(str) {\r\n if (str === reverseString(str)) {\r\n return true;\r\n }\r\n return false;\r\n}", "function isPalindrome(palindrome) {\n palindrome = uniformString(palindrome);\n\tfor ( var i=0; i <palindrome.length/2; i++) {\n\t\treturn (palindrome.charAt(i) === palindrome.charAt(palindrome.length-1));\n //Compares characters starting at both ends of the String\n\t}\n}", "function palindrome(str){\n var unWanted=/[\\W_]g/;\n var strLower=str.toLowerCase().replace(unWanted, \"\");\n var strReversed=strLower.split(\"\").reverse().join(\"\");\n return strLower===strReversed;\n}", "function isPalindrome(someStr) {\r\n \r\n thePalin = someStr.split('').reverse().join('');\r\n if (thePalin == someStr)\r\n return true;\r\n else\r\n return false;\r\n \r\n}", "function Palindrome(str) {\n\n return str.replace(/[\\s]/g, \"\").toLowerCase() == str.replace(/[\\s]/g, \"\").toLowerCase().split(\"\").reverse().join(\"\");\n}", "function isPalendrome(word) {\n // palendrom is same forward and backwards\n // take in word as is\n // create new word that is the reverse\n // compare and return\n let reverseWord = word.split(\"\").reverse().join(\"\");\n //console.log('Word', word)\n //console.log('Reverse', reverseWord);\n return reverseWord === word ? true : false;\n}", "function isPalindrome(str){\n const revString = str.split('').reverse().join(''); \n return revString === str; // will give true or false\n \n}", "function isPalindrome(phrase){\r\n return true;\r\n}", "function isPalindrome(str)\n{\n var reverse = reverseStr(str);\n if(str === reverse)\n {\n return true;\n }\n return false;\n\n}", "function palindrome(str) {\n var lowerCaseString = str.toLowerCase();\n var formattedString = lowerCaseString.replace(/[!@#$%^&*()_+,.:;'\"?/|\\-\\s]/g, \"\");\n var reversedString = formattedString.split(\"\").reverse().join(\"\");\n if (formattedString === reversedString) {\n return true;\n }\n return false;\n}", "function palindrome(string) {\n\n}", "function isPalindrome(str) {\n return str.split('').reverse().join('') === str\n}", "function isPal(str) {\n var array = str.split('');\n var pal = array.reverse().join('');\n var tr = str;\n\n if (pal == str) {\n tr = '';\n\n for (var i = 0; i < array.length; i++) {\n tr += i % 2 == 0 ? array[i].toUpperCase() : array[i].toLowerCase();\n }\n }\n\n return tr;\n}", "function isPalindrome(str) {\n var toLower = str.toLowerCase();\n var noSpace = toLower.replace(\" \", \"\");\n var letterArray = noSpace.split(\"\");\n var reversed = letterArray.reverse();\n var final = reversed.join(\"\");\n\n return str.toLowerCase() === final;\n}", "function is_palindrome(s) {\n s = s.toLowerCase().replace(/[^a-zA-Z0-9]/g, '');\n\n const regularString = new Stack();\n for (let i = 0; i < s.length; i++) {\n regularString.push(s[i]);\n }\n\n // racecar front to back, racecar back to front\n const reverseString = new Stack();\n for (let i = s.length - 1; i >= 0; i--) {\n reverseString.push(s[i]);\n }\n\n while (regularString.top !== null) {\n if (regularString.top.data !== reverseString.top.data) {\n return false;\n }\n regularString.top = regularString.top.next;\n reverseString.top = reverseString.top.next;\n }\n\n return true;\n}", "function isPalindrome (str) {\n // 步驟一:將所有的單字轉成小寫,拆成陣列,並且排除非英文單字\n str = str.toLowerCase()\n\n charactersArr = str.split('').filter(character => {\n return /[a-z]/.test(character)\n })\n\n // 步驟二:如果正著寫和反轉過來寫的內容都一樣,則回傳 true,否則 false\n return charactersArr.join('') === charactersArr.reverse().join('')\n}", "function isPalindrome(str) {\n const revString = str.split('').reverse().join('');\n return str === revString;\n}", "function isPalindrome(str) {\n str = str.replace(/\\W/g, '').toLowerCase();\n return (str == str.split('').reverse().join(''));\n}", "function validPalindrome(s) {\n // only have alphanumeric\n s = s.replace(/[^0-9a-zA-Z]+/gim, \"\")\n s = s.toLowerCase()\n\n // using two pointer\n // one starts at the beginning\n // one at end of s\n let l = 0\n let r = s.length - 1\n // while 0 < length - 1\n while (l <= r) {\n // if char doesn't match return false right away\n if (s[l] !== s[r]) {\n return false\n }\n // else increment the pointer\n l++\n r--\n }\n // once all string has been traversed return true\n return true\n}", "function isPalindrome(x) {\n return x.toLowerCase() === x.toLowerCase().split('').slice().reverse().join('') ? true : false;\n}", "function isPalindrome(string){\n string = string.toLowerCase()\n const charactersArr = string.split('')\n const validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('')\n\n let lettersArr = charactersArr.filter(char => validCharacters.includes(char))\n \n return lettersArr.join('') === lettersArr.reverse().join('')\n //if (lettersArr.join('') === lettersArr.reverse().join('')) return true; else return false\n}", "function palindrome(str) {\n\t// Array.prototype.every -- is used to do a boolean check on every element within an array\n\t// arr.every((val) => val > 5);\n\t// If any function returns false, then the overall expression returns false as well\n\treturn str.split('').every((char,i) => {\n\t\treturn char === str[str.length -i -1]; // mirrored element\n\t});\n}", "function isPalindrome(str){\r\n // add whatever parameters you deem necessary - good luck!\r\n \r\n function reverse(str){\r\n //console.log(\"STR: \"+str);\r\n if(str === ''){ \r\n return '';\r\n }\r\n \r\n return str.charAt(str.length-1)+reverse(str.substr(0,str.length-1));\r\n }\r\n \r\n return str === reverse(str) ? true : false;\r\n \r\n }", "function palindrome (string) {\r\n var regExp = /[\\W_]/g; //This is a regular expression. The expreesion in the var regExp is symbol for non alphanumerics and hyphen.\r\n var newString = string.toLowerCase().replace(regExp, ''); //The input parameter is set to lower case and all non alphanumerics are replaced with an empty string\r\n var reversedString = newString.split('').reverse().join(''); // The new string is split into an array, reversed and joined back into a string\r\n if (reversedString === newString) { //if the reversed and new string are equal, the code below runs accordingly\r\n return true;\r\n } \r\n else {\r\n return false \r\n } \r\n}", "function isPalindrome(string) {\n string = string.toLowerCase();\n var charactersArr = string.split(\"\");\n var validCharacters = \"abcdefghijklmnopqrstuvwxyz\".split(\"\");\n\n var lettersArr = [];\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\n\n if (lettersArr.join(\"\") === lettersArr.reverse().join(\"\")) return true;\n else return false;\n}", "function isPalindrome(string) {\n\n function reverse() {\n return string.split('').reverse().join('')\n }\n\n return string === reverse();\n}", "function isPalindrome(str) {\n //remove spaces, turn same case\n let newStr = str.toString().toLowerCase().replace(/\\s+/g, '');\n console.log(newStr);\n //reverse strings\n let revers = newStr.split(\"\").reverse().join('');\n console.log(revers);\n console.log(newStr + \"=\" + revers + \"?\");\n if (newStr === revers) {\n return `'${[str]}' is a palindrome :)`;\n }\n return `'${[str]}' is not a palindrome!`;\n\n}", "function palindrome(str) {\n const rev = str.split('').reverse().join('');\n return str === rev;\n}", "function palindrome (str) {\n const filtered = str.toLowerCase().match(/[a-z]|\\d/g);\n return filtered.join('') === filtered.reverse().join('');\n}", "function isPalindrome(str) {\n // NOTE Reverse the string\n const reversed = str\n .split(\"\")\n .reverse()\n .join(\"\");\n // NOTE Check if reversed string matches the original\n\n if (reversed === str) {\n return true;\n } else {\n return false;\n }\n // NOTE This returns the same.\n //return reversed === str;\n}", "function isPalindrome(str){\n//base case\nif (str.length === 1) return true;\nif (str.length === 2) return str[0] === str[1] //boolean\n\nif (str[0] === str.slice(-1)) return isPalindrome(str.slice(1, -1)) //.slice(-1) is the end of the word \n\nreturn false \n\n}", "function checkForPalindrome(word) {\r\n if (word === reverseString(word)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function isRealPalindrome(string) {\n let newString = \"\";\n for (let i = 0; i < string.length; i++) {\n if (/^[a-z0-9]/.test(string[i].toLowerCase())) {\n newString += string[i].toLowerCase();\n }\n }\n return isPalindrome(newString);\n}", "function palindrome(str) {\n const arrStr = []\n let strNew = str.split('')\n strNew.forEach(character => {\n if (character.match(/[A-Za-z]/g)) {\n arrStr.push(character.toLowerCase())\n }\n })\n if (arrStr.join('') === arrStr.reverse().join('')) {\n return true\n } else {\n return false\n }\n}", "function isPalindrome_V2(str){\n if(str.split('').reverse().join('')==str){\n return true;\n }\n return false;\n \n}", "function isPalindromic(string) {\n var i;\n var stringMinusSpaces = '';\n for (i = 0; i < string.length; i++) {\n if (string[i] !== ' ') {\n stringMinusSpaces += string[i];\n }\n }\n var stringInReverse = '';\n for (i = stringMinusSpaces.length - 1; i >= 0; i = i - 1) {\n stringInReverse += stringMinusSpaces[i];\n }\n if (stringInReverse === stringMinusSpaces) {\n return true;\n } else {\n return false;\n }\n}", "function palindrome(string){\n var newWord='';\n for (var i=string.length-1; i>=0; i--){\n newWord+=string[i];\n \n }\n if (newWord===string){\n return string +' is a palindrome'\n \n } else{\n return string +' is not a palindrome'\n }\n \n }", "function isPalindrome(string) {\n string = string.toLowerCase();\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n \n var lettersArr = [];\n charactersArr.forEach(char => {\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char);\n });\n \n return lettersArr.join('') === lettersArr.reverse().join('');\n}", "function isPalindrome(x) {\n let rev=x.toLowerCase().split('').reverse().join('');\n return x.toLowerCase()===rev? true:false;\n}", "function palindrome(str){\n //regular expression matches any non-word character. Equivalent to [^A-Za-z0-9_].\n\t var strRe = /[\\W_]/g;\n\n\t str = str.toLowerCase().replace(strRe, \"\");\n\n for(var i = 0; i < str.length; i++){\n\n\t if(str[i] !== str[str.length-1-i]){\n\t return false;\n\t }\n\t }\n\t return true;\n\n\t }", "function isPalindrome(str) {\r\n return str === str.split('').reverse().join('');\r\n}", "function palindrome(string){\n let len = string.length;\n let str = string.toLowerCase();\n for(let i = 0; i < str.length/2; i ++){\n if(str[i] != str[len - i - 1]){\n return false;\n }\n }\n return true;\n}", "function isPalindrome2(string){\n string = string.toLowerCase(); //case insensitive\n var charactersArr = string.split('');\n var validCharacters = 'abcdefghijklmnopqrstuvwxyz'.split('');\n\n var lettersArr = [];\n charactersArr.forEach(function(char){ // for each character\n if (validCharacters.indexOf(char) > -1) lettersArr.push(char); //get rid of the character if it's not in the list of eligible chars\n });\n\n return lettersArr.join('') === lettersArr.reverse().join(''); // return result of comparing the word with the reverse version of it\n}", "function isPalindrome(name) {\n let word = name.split(\"\").reverse.().join(\"\");\n if (word === name) {\n return true:\n }\n else {\n return false;\n }\n}", "function isPalindrome(str) {\n\tfor(var i = 0; i < str.length / 2; i++) {\n\t\tvar oppositeI = str.length - 1 - i;\n\n\t\t// The letters on the other end better match!\n\t\tif(str[i] !== str[oppositeI]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function palindrome(str) {\n\tlet reversedStr = str\n\t\t.toLowerCase()\n\t\t.split(\"\")\n\t\t.reverse()\n\t\t.join(\"\");\n\treturn reversedStr === str;\n}", "function palindrome(str) {\n // Good luck!\n var reg = /[\\W_]/g;\n var smallstr = str.toLowerCase().replace(reg, \"\");\n var reverse = smallstr.split(\"\").reverse().join(\"\");\n if( reverse === smallstr) return true;\n return false;\n}", "function isPalindrome(str){\n var forwardStr = str.toLowerCase().replace(/ /g, '');\n var chars = forwardStr.split('');\n var length = chars.length;\n var reverseStr = '';\n for(var i = length-1; i >= 0; i--){\n if (chars[i] != ' '){\n reverseStr += chars[i];\n }\n }\n if(forwardStr === reverseStr){\n return true;\n }\n return false;\n}", "function isPalindrome(str){\n var str2 = str.toLowerCase().split(\"\").join(\"\").replace(/ /g, '');\n var str3 = str.toLowerCase().split(\"\").reverse().join(\"\").replace(/ /g, '');\n if (str3 === str2) {\n console.log(\"Yay, it's a Palindrome!\")\n }else {\n console.log(\"Sorry, it's not a Palindrome...\")\n }\n}", "function isPalindrome(str) {\n str = str.toLowerCase();\n // loop to replace spaces\n while (str.includes(' ')) str = str.replace(' ', '');\n for (var i = 0; i < Math.floor(str.length / 2); i++) {\n if (str.charAt(i) !== str.charAt(str.length - i - 1)) return false;\n }\n return true;\n}", "function palChecker(pallendromeCandidate) {\n//split the string into an array, reverse the array, and then merge the elements back into one. The quote marks in join keeps from separating the array with commas\n var pallendromeCandidateOpposite = pallendromeCandidate.split().reverse().join(\"\");\n console.log(pallendromeCandidateOpposite);\n\n//looking at the word forwards and backwards, and with teh same case, determine if both are the same\n if(pallendromeCandidate.toUpperCase() === pallendromeCandidateOpposite.toUpperCase()){\n \treturn true;\n } else {\n \treturn false;\n }\n}", "function isPalindrome(str) {\n\n/////////////////////////////////////////////////////////\n // const strArr = str.split('');\n\n // strArr.reverse();\n \n // const reverseWord = strArr.join('');\n\n // if(str === reverseWord) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n\n///////////////////////////////////////////////////////////\n // let revString = '';\n\n // for(let i = str.length - 1 ; i >= 0 ; i--){\n // revString += str[i] ;\n // }\n\n // if(str.lower === revString.lower) {\n // console.log(\"It's a Palindrome.\");\n // }else{\n // console.log(\"It's not a Plaindrom.\");\n // }\n \n//////////////////////////////////////////////////////////\n \n let revString = '';\n\n for(let i = 0 ; i <=str.length - 1 ; i++) {\n revString = str[i] + revString;\n }\n console.log(revString);\n if(str === revString) {\n console.log(\"It's a Palindrome.\");\n }else{\n console.log(\"It's not a Plaindrome.\");\n }\n \n///////////////////////////////////////////////////////////\n\n \n}", "function isPalindrome(str) {\n return (\n str ===\n str\n .split(\"\")\n .reverse()\n .join(\"\")\n );\n}", "function checkPalindrome(str){ \n // convert string to array\n var reg = /[^A-Za-z0-9]/g;\n str = str.toLowerCase().replace(reg , '');\n var stringArray = str.split('');\n var l =stringArray.length;\n let i=0;\n while(i<l){\n if(stringArray[i] === stringArray[l-1-i]){\n return 'Palindrome';\n } else {\n return 'Not Palindrome';\n }\n i++;\n }\n}" ]
[ "0.81695557", "0.8011625", "0.79444754", "0.7903679", "0.78936017", "0.7867636", "0.7860524", "0.7860463", "0.7858169", "0.7855762", "0.78327435", "0.77949005", "0.7786259", "0.7775405", "0.77577746", "0.77576137", "0.7754082", "0.7751388", "0.7750053", "0.7749725", "0.7747283", "0.77438563", "0.7743059", "0.7737968", "0.77374506", "0.7729342", "0.77270067", "0.77230984", "0.7719279", "0.7714968", "0.77135926", "0.77124614", "0.7710042", "0.7708542", "0.7701618", "0.76910275", "0.7681402", "0.76756626", "0.7674251", "0.7659533", "0.7656388", "0.76512873", "0.76366717", "0.76313514", "0.7630679", "0.76210684", "0.7619398", "0.76167274", "0.7615997", "0.76073086", "0.7601047", "0.7598703", "0.7589516", "0.75860536", "0.75846535", "0.7580612", "0.75798553", "0.75791645", "0.757014", "0.7567479", "0.7566851", "0.7566467", "0.7565733", "0.7563652", "0.75628805", "0.75620216", "0.7559472", "0.7559071", "0.75556093", "0.7551298", "0.7550342", "0.7544626", "0.75429153", "0.7541648", "0.7518519", "0.7513198", "0.75108236", "0.7506951", "0.75068754", "0.7500749", "0.74998754", "0.7498099", "0.74968284", "0.7494326", "0.74939597", "0.74920255", "0.7489823", "0.7488623", "0.7488145", "0.7478011", "0.7476657", "0.746969", "0.74672824", "0.7465032", "0.74611086", "0.74582237", "0.7452554", "0.74480253", "0.744509", "0.743572" ]
0.80870146
1
Create a function that takes an id or DOM element and:
function solve() { function toggleShowHideState(element) { if (element.innerHTML === 'show') { element.innerHTML = 'hide'; } else if (element.innerHTML === 'hide') { element.innerHTML = 'show'; } else { throw new Error('Invalid element!'); } } function toggleDisplayMode(element) { if (element.style.display === 'none') { element.style.display = ''; } else { element.style.display = 'none'; } } return function (selector) { var selectedElement, buttonElements, i, len; if (typeof selector !== 'string') { throw new Error('Invalid input selector!'); } selector = selector.substring(1, selector.length); //console.log(selector); selectedElement = document.querySelector(selector); if (selectedElement === null) { throw new Error('Invalid id selector!'); } buttonElements = selectedElement.getElementsByClassName('button'); for (i = 0,len = buttonElements.length; i < len; i+=1) { buttonElements[i].innerHTML = 'hide'; } selectedElement.addEventListener('click', function (ev) { var currentButton = ev.target, nextElementSibling, previuosElementSibling; if (ev.target.className === 'button') { nextElementSibling = currentButton.nextElementSibling; previuosElementSibling = currentButton.previousElementSibling; while (previuosElementSibling) { if (previuosElementSibling.className === 'button') { toggleShowHideState(previuosElementSibling); } if (previuosElementSibling.className === 'content') { break; } previuosElementSibling = previuosElementSibling.previousElementSibling; } while (nextElementSibling) { if (nextElementSibling.className === 'button'){ toggleShowHideState(nextElementSibling); } if (nextElementSibling.className === 'content') { toggleShowHideState(currentButton); toggleDisplayMode(nextElementSibling); break; } nextElementSibling = nextElementSibling.nextElementSibling; } } }, false); var contentElements = selectedElement.getElementsByClassName('content'); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function id(el){\n return document.getElementById(el);\n}", "function elementId(id){\n const inputId = document.getElementById(id);\n return inputId;\n}", "function el(id) {\n return document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function id_of(id) {\n return document.getElementById(id);\n}", "function id(element) {\n\n return document.getElementById(element);\n}", "function id(element) {\n return document.getElementById(element);\n}", "function ElemId(id){\n\treturn document.getElementById(id);\n}", "function elt(id) {\n return document.getElementById(id)\n}", "function $(a){return document.getElementById(a);}", "function getIdElement(id) {\n return document.getElementById(id);\n}", "function byId(id){return document.getElementById(id);}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function $e(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function $el(id) {\n if (typeof id === 'string') {\n return document.getElementById(id);\n }\n return id;\n }", "function prendiElementoDaId(id_elemento) \r\n{\r\n\tvar elemento;\r\n\tif(document.getElementById)\r\n\t{\r\n\t\telemento = document.getElementById(id_elemento);\r\n\t}\r\n\telse\r\n\t{\r\n\t\telemento = document.all[id_elemento];\r\n\t}\r\n\treturn elemento;\r\n}", "function id(id){return d.getElementById(id)}", "function ID(id){\n return document.getElementById(id);\n}", "function _(id){\n return document.getElementById(id);\n}", "function _(el) {\n return document.getElementById(el);\n}", "function $id(id) {\n\treturn document.getElementById(id);\n}", "function _(id){\r\n\treturn document.getElementById(id);\r\n}", "function E(id) { return document.getElementById(id); }", "function E(id) { return document.getElementById(id); }", "function $(id){\n return document.getElementById(id); \n}", "function $(id){\n return document.getElementById(id);\n}", "function getEl(id) {\n return document.getElementById(id)\n}", "function $(x) {return document.getElementById(x);}", "function $ID(element) \n{\n\tif (arguments.length > 1) \n\t{\n\t\tfor (var i = 0, elements = [], length = arguments.length; i < length; i++)\n\t\t{\n \t\telements.push($ID(arguments[i]));\n \t}\n\t\treturn elements;\n\t}\n\tif (typeof element == \"string\")\n\t{\n\t\telement = document.getElementById(element);\n\t\treturn element;\n\t}\n}", "function ele(id) {\n\treturn document.getElementById(id);\n}", "function $(elementID){\n return document.getElementById(elementID);\n}", "function _(id) {\n return document.getElementById(id);\n}", "function el(x){\n return document.getElementById(x);\n }", "function _(e) {return document.getElementById(e)}", "function elem(id) {\n return document.getElementById(id);\n }", "function getEle(id) {\r\n\treturn document.getElementById(id);\r\n}", "function byId(id) {\n return document.getElementById(id);\n}", "function byId(id) {\n return document.getElementById(id);\n}", "function byId(id) {\n return document.getElementById(id);\n}", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function $(elm_id){\r\n \treturn document.getElementById(elm_id);\r\n }", "function elementById(id) {\n return document.getElementById(id);\n}", "function id(name) {\n return document.getElementById(name);\n}", "function byId( id ){ return document.getElementById( id ); }", "function $(elementId) { return document.getElementById(elementId); } // shortcut from \"Prototype Javascript Framework\"", "function $(id) {\r\n return document.getElementById(id);\r\n}//end function $", "function getEl(id){\n\treturn document.getElementById(id);\n}", "function $id(id) \n\t{\n\t\treturn document.getElementById(id);\n\t}", "function $(id) { return document.getElementById(id); }", "function $(idobj) {\n return document.getElementById(idobj);\n}", "function el(elementid) {\n if (document.getElementById) {\n return document.getElementById(elementid);\n } else if (window[elementid]) {\n return window[elementid];\n }\n}", "function getElm(id) {\n return document.getElementById(id);\n}", "function e(id) {\n return document.getElementById(id);\n}", "i(id) { return document.getElementById(id); }", "function $(id) { return document.getElementById(id) }", "function forid_1(id) {\n return document.getElementById(id);\n}", "function $(o) {\n return document.getElementById(o);\n}", "function $(id,aElem) {\n\tif(!aElem) {\n\t\treturn document.getElementById(id);\n\t}\n\telse {\n\t\treturn document.evaluate('id(\"'+id+'\")',aElem,null,XPFirst,null).singleNodeValue;\n\t}\n}", "function $(id) { return document.getElementById(id); }", "function l(what) {return document.getElementById(what);}", "function $(demo){\n return document.getElementById(demo);\n}", "function $(id) {\r\n\r\n return document.getElementById(id);\r\n\r\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getElement(elementId){\n return document.getElementById(elementId);\n }", "function getElById(el) {\n return document.getElementById(el);\n}", "function _$(id){return document.getElementById( id );}", "function $(id)\n{\n return document.getElementById(id);\n}", "function elem(elemName){var getElem=document.getElementById(elemName); return getElem;}", "function __$(id){\n return document.getElementById(id);\n}", "function $id(quem) {\n return document.getElementById(quem);\n}", "function getEleById(ele) {\n return document.getElementById(ele);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $( element )\n{\n return document.getElementById( element ); \n}", "function $(A) {return document.getElementById(A)}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function $(id) {\n return document.getElementById(id);\n}", "function id(input) {\n return document.getElementById(input);\n}", "static getEle(id) {\n return document.getElementById(id);\n }", "function $(id) {\r\n return document.getElementById(id);\r\n}", "function $(elementName) { return document.getElementById(elementName); }", "function $(id){const el=document.getElementById(id);return el?assertInstanceof(el,HTMLElement):null}" ]
[ "0.74873775", "0.7376615", "0.7207702", "0.71791726", "0.71574765", "0.71574765", "0.71261096", "0.7117003", "0.7091389", "0.70861197", "0.70832306", "0.7058443", "0.70461386", "0.70310533", "0.6997405", "0.6997405", "0.6997405", "0.6996946", "0.69908327", "0.69908327", "0.69908327", "0.6980555", "0.6977569", "0.6953727", "0.69158137", "0.69071513", "0.6864208", "0.6849902", "0.6832647", "0.68301773", "0.68301773", "0.68096197", "0.68068385", "0.6803491", "0.67775124", "0.6775674", "0.6768681", "0.6768617", "0.6756638", "0.6748988", "0.6744849", "0.67388487", "0.6736", "0.6734129", "0.6729913", "0.6729913", "0.6720234", "0.6720234", "0.67201036", "0.6705956", "0.66987795", "0.66969246", "0.669361", "0.6690545", "0.66853917", "0.6669431", "0.66551524", "0.66424644", "0.66367036", "0.66290957", "0.6629048", "0.661785", "0.65895647", "0.6571009", "0.6564584", "0.6549645", "0.6546684", "0.6542537", "0.6531824", "0.65303075", "0.65303075", "0.65303075", "0.65294504", "0.6524231", "0.6524066", "0.6523589", "0.65129167", "0.6504698", "0.65037405", "0.6499233", "0.649603", "0.649603", "0.649603", "0.649603", "0.649603", "0.64958405", "0.6490046", "0.64883024", "0.64883024", "0.64883024", "0.6485338", "0.6485338", "0.6485338", "0.6485338", "0.6485338", "0.6485338", "0.648195", "0.6479596", "0.6478959", "0.64741963", "0.64661425" ]
0.0
-1
Smart Search of Global Code Categories starts here
function OnGCodeCategorySelection(e) { var dataItem = this.dataItem(e.item.index()); $("#txtDescription").val(dataItem.Name); $('#txtOrderSetValue').val(dataItem.CodeValue); $('#hfCodeValue').val(dataItem.CodeValue); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "function processCategories( searchCategories ) {\n\t//console.log( \"In processCategories, searchCats = \", searchCategories);\n\n\tvar keywordCategories = \"\";\n\tvar typeCategories = [];\n\tfor (var i=0; i<searchCategories.length; i++) {\n\t\t// Type search.\n\t\tif ( place_categories[ searchCategories[i] ].search_type === 'type' ) {\n\n\t\t\ttypeCategories.push( place_categories[ searchCategories[i] ].value );\n\n\t\t}\n\t\t// Keyword search is currently disabled. \n\t\telse if ( place_categories[ searchCategories[i] ].search_type === 'keyword' ) {\n\t\t\t// concatenate the keywords into a pipe deliminated string.\n\t\t\tif ( keywordCategories.length ) keywordCategories += '|';\n\t\t\tkeywordCategories += place_categories[ searchCategories[i] ].value;\n\t\t}\n\t}\n\n\treturn { types: typeCategories, keywords: keywordCategories };\n}", "function search(searchContent) {\r\n smoothTopScroll();\r\n if (searchContent.length==0) {\r\n callCategories();\r\n return;\r\n }\r\n document.getElementById(\"pagetitle\").innerHTML = \"Search\";\r\n var results = {};\r\n Object.keys(itemvarsetidenum).forEach(function(num) {\r\n Object.keys(itemvarsetidenum[num]).forEach(function(key) {\r\n if (key.toLowerCase().includes(searchContent.toLowerCase())) {\r\n results[key]=itemvarsetidenum[num][key];\r\n }\r\n });\r\n });\r\n\r\n hideAllBoxes();\r\n activeSet = 1;\r\n generateBox(\"Back\", null, 0, 1, \"<div class='subtext'>Click to return to categories</div>\");\r\n Object.keys(results).forEach(function(key) {\r\n if (Object.keys(results).indexOf(key) + 2 > 20) {return};\r\n generateBox(key, results, 0, Object.keys(results).indexOf(key) + 2,\r\n \"<div class='subtext shortcut'>\" + results[key] + \"</div>\")\r\n });\r\n}", "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "setupCategorySearch() {\n if (this.typeahead) this.typeahead.destroy();\n\n $('#category-input').typeahead({\n ajax: {\n url: 'https://commons.wikimedia.org/w/api.php',\n timeout: 200,\n triggerLength: 1,\n method: 'get',\n preDispatch: query => {\n return {\n action: 'query',\n list: 'prefixsearch',\n format: 'json',\n pssearch: query,\n psnamespace: 14\n };\n },\n preProcess: data => {\n const results = data.query.prefixsearch.map(elem => elem.title.replace(/^Category:/, ''));\n return results;\n }\n }\n });\n }", "function hotcat_find_category (wikitext, category)\n{\n var cat_name = category.replace(/([\\\\\\^\\$\\.\\?\\*\\+\\(\\)])/g, \"\\\\$1\");\n var initial = cat_name.substr (0, 1);\n var cat_regex = new RegExp (\"\\\\[\\\\[\\\\s*[Kk]ategoria\\\\s*:\\\\s*\"\n + (initial == \"\\\\\"\n ? initial\n : \"[\" + initial.toUpperCase() + initial.toLowerCase() + \"]\")\n + cat_name.substring (1).replace (/[ _]/g, \"[ _]\")\n + \"\\\\s*(\\\\|.*?)?\\\\]\\\\]\", \"g\"\n );\n var result = new Array ();\n var curr_match = null;\n while ((curr_match = cat_regex.exec (wikitext)) != null) {\n result [result.length] = {match : curr_match};\n }\n return result; // An array containing all matches, with positions, in result[i].match\n}", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "function catOnlySearchQuery(val) {\n var peopleOps = \"human+resources+OR+hr+OR+people+OR+operations+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+ops+OR+ organization+OR+organizational\";\n var peopleAnalytics = \"people+OR+analytics+OR+talent+OR+human+OR+insights+OR+organization+OR+organizational\";\n var divInclu = \"diversity inclusion organization organizational\";\n var talent = \"talent sourcer+OR+recruiter\";\n var hrExec = \"talent+OR+operations+OR+CPO+OR+human+OR+resources+OR+HR+OR+CHRO+OR+culture+OR+D&I+OR+diversity+OR+inclusion+OR+head+OR+Chief+OR+director+OR+VP+OR+officer\";\n var allCat = \"diversity+OR+inclusion+OR+head+OR+talent+OR+people+OR+operations+OR+chief+OR+cpo+OR+human+OR+resources+OR+director+OR+acquisition+OR+hr+OR+vp+OR+chro+OR+officer+OR+culture+OR+d&i+OR+diversity+OR+inclusion+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+hr+OR+ops+OR+analytics+OR+recruiting+OR+insights+OR+talent+OR+acquisition+OR+sourcer+OR+recruiter+OR+recruiting\";\n switch (val) {\n case \"10\":\n return peopleAnalytics;\n break;\n case \"11\":\n return peopleOps;\n break;\n case \"12\":\n return divInclu;\n break;\n case \"13\":\n return talent;\n break;\n case \"14\":\n return hrExec;\n break;\n case \"15\":\n return allCat;\n break;\n }\n}", "function determineCategory(data) {\n if(category.value === 'astronaut') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addAstronautToDOM(data);\n } else showNoResults();\n } else if(category.value === 'launch') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addLaunchToDOM(data);\n } else showNoResults();\n } else if(category.value === 'expedition') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addExpeditionToDOM(data);\n } else showNoResults();\n } else if(category.value === 'spacecraft') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addSpacecraftToDOM(data);\n } else showNoResults();\n }\n}", "function getCategories(word){\n\twhile(word.length > 0){\n\t\tif (RID[word]){\n\t\t\treturn RID[word];\n\t\t}\n\t\tif (RID[word+\"%\"]){\n\t\t\treturn RID[word+\"%\"];\n\t\t}\n\t\tword = word.substr(0,word.length-1);\n\t}\n\treturn null;\n}", "function hotcat_find_ins ( wikitext )\n{\n var re = /\\[\\[(?:Kategoria):[^\\]]+\\]\\]/ig\n var index = -1;\n while( re.exec(wikitext) != null ) index = re.lastIndex;\n \n if( index > -1) return index;\n //we should try to find interwiki links here, but that's for later.\n \n return -1;\n}", "function _mod_search() {\n\t\"use strict\";\n\t// private section - following fields and functions are private and need to be accessed by methods provided in the public section\n\tvar _inputId;\n\tvar autoComplete = {};\n\n\tautoComplete.suggestion = {};\n\tautoComplete.suggestion.tags = [];\n\tautoComplete.suggestion.id = [];\n\tautoComplete.dictionaryTags = [];\n\n\t/****\n\t * create a completely new tag\n\t * @param id of the corresponding html list element\n\t * @param tag to be linked to the id\n\t * @return {Object}\n\t */\n\tfunction newIdTagPair(id, tag) {\n\t\tvar liElem = {};\n\t\tliElem.id = id;\n\t\tliElem.tags = [];\n\t\tliElem.tags.push(tag);\n\t\treturn liElem;\n\t}\n\n\t/****\n\t * filters a list while typing text into an input field and hides all\n\t * list items that don't match to the search string.\n\t * @param searchStr string that is currently in the search field (others would be possible to, but mostly senseless)\n\t * @param listRootId list to be filterd\n\t */\n\tfunction searchFilter(searchStr, listRootId) {\n\t\tvar match;\n\t\tvar searchIndex;\n\t\tvar i, j;\n\t\tvar nodeJQ;\n\t\tvar visibleNodes = [];\n\n\t\t// show all\n\t\tif (!searchStr || searchStr === \"\") {\n\t\t\tjQuery(\"#\" + listRootId).find(\"li\").andSelf().show();\n\t\t}\n\n\t\tsearchStr = searchStr.toLowerCase();\n\n\n\t\t// hide all nodes while traversing\n\t\t// not to nice implemented ;)\n\t\tfor (i = autoComplete.dictionaryTags.length - 1; i >= 0; i--) {\n\t\t\tnodeJQ = jQuery(\"#\" + autoComplete.dictionaryTags[i].id);\n\t\t\t//console.log(autoComplete.dictionaryTags[i].tags[0])\n\t\t\tmatch = null;\n\t\t\tfor (j = 0; j < autoComplete.dictionaryTags[i].tags.length; j++) {\n\t\t\t\tsearchIndex = autoComplete.dictionaryTags[i].tags[j].toLowerCase().match(searchStr);\n\t\t\t\tif (searchIndex) {\n\t\t\t\t\tmatch = nodeJQ;\n\t\t\t\t\t//select node in tree to highlight\n\t\t\t\t\tif (searchIndex === 0 && autoComplete.dictionaryTags[i].tags[j].length === searchStr.length) {\n\t\t\t\t\t\tMYAPP.tree.select_node(jQuery(\"#\" + autoComplete.dictionaryTags[i].id));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodeJQ.hide();\n\n\t\t\tif (match) {\n\t\t\t\tvisibleNodes.push(match);\n\t\t\t}\n\t\t}\n\n\t\t// show matching nodes and all their parents\n\t\t// !!! todo: the method parents gos up to the html root but it should stop at the top of the list\n\t\tfor (i = visibleNodes.length - 1; i >= 0; i--) {\n\t\t\tvisibleNodes[i].parents(\"#treeList li\").andSelf().show();\n\t\t}\n\t}\n\n\t// private section END\n\n\n\t// public section\n\t// all methods that give access to the private fields and allow to process the menu\n\treturn {\n\t\t/****\n\t\t * @param treeRootId\n\t\t * id of the root of the list that should be filtered\n\t\t * @param inputId\n\t\t * id of the input field in witch should get the autocompleate function\n\t\t * @param dictionaryTags\n\t\t * an array that looks as followed:\n\t\t * [ { id: ... , tags: [..., ...]}, { id: ... , tags: [..., ...]} ]\n\t\t * the id is the id of the li element that should be processed,\n\t\t * the tag is an array with corresponding strings (if the search string matches\n\t\t * any of the tag string or tag substring in any position the li element is displayed.\n\t\t * if there is no match at all the li element will be hidden.\n\t\t *\n\t\t */\n\t\tinitSearch : function (treeRootId, inputId, dictionaryTags) {\n\t\t\tvar i, j;\n\n\t\t\tdictionaryTags = dictionaryTags || [];\n\t\t\t_inputId = inputId;\n\t\t\tautoComplete.dictionaryTags = dictionaryTags;\n\n\t\t\tfor (i = 0; i < dictionaryTags.length; i++) {\n\t\t\t\tfor (j = 0; j < dictionaryTags[i].tags.length; j++) {\n\t\t\t\t\tautoComplete.suggestion.tags.push(dictionaryTags[i].tags[j]);\n\t\t\t\t\tautoComplete.suggestion.id.push(dictionaryTags[i].id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tjQuery(\"#\" + inputId).autocomplete({\n\t\t\t\tsource : autoComplete.suggestion.tags,\n\t\t\t\tselect : function (event, ui) {\n\t\t\t\t\tif (ui.item) {\n\t\t\t\t\t\tvar i = jQuery.inArray(ui.item.value, autoComplete.suggestion.tags);\n\t\t\t\t\t\tvar node = jQuery(\"#\" + autoComplete.suggestion.id[i]);\n\t\t\t\t\t\tMYAPP.tree.select_node(node);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert(\"Dieses Element ist im Objekt nicht enthalten.\");\n\t\t\t\t\t}\n\t\t\t\t\t//alert(ui.item ? ui.item.value: \"Nothing selected, input was \" + this.value );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tjQuery(\"#\" + inputId).keyup(function () {\n\t\t\t\t//alert(\"\")\n\t\t\t\tsearchFilter(jQuery(\"#\" + inputId).val(), treeRootId);\n\t\t\t});\n\t\t\t// filter when x is pressed\n\t\t\tjQuery(\"#\" + inputId).parent().children(\".ui-input-clear\").mouseup(function () {\n\t\t\t\tsearchFilter(\"\", treeRootId);\n\t\t\t});\n\n\t\t},\n\t\t/****\n\t\t * push a new tag to the data set that is used to filter the html list\n\t\t * and to the data set that is the base for the autoComplete suggestions\n\t\t * @param id of the corresponding list element\n\t\t * @param tag that is being linked to the tag\n\t\t */\n\t\tpushTag : function (id, tag) {\n\t\t\tvar i;\n\t\t\tvar index = -1;\n\n\t\t\t//console.log(\" id \" + id + \" tag \" + tag + \" _inputId \" + _inputId)\n\t\t\tif (typeof id !== \"string\" || typeof tag !== \"string\") {\n\t\t\t\tconsole.error(\"data to push are not valid (mod_search->method pushTag(id, tag)\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < autoComplete.dictionaryTags.length; i++) {\n\t\t\t\tif (autoComplete.dictionaryTags[i].id.match(id)) {\n\t\t\t\t\tindex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (-1 < index) { // element with the submitted id already exists\n\t\t\t\tautoComplete.dictionaryTags[index].tags.push(tag);\n\t\t\t\t/*\n\t\t\t\t console.log(\n\t\t\t\t autoComplete.dictionaryTags[index].id[0] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].tags[0] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].id[1] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].tags[1]\n\t\t\t\t )\n\t\t\t\t */\n\t\t\t}\n\t\t\telse { // create new entry\n\t\t\t\tautoComplete.dictionaryTags.push(newIdTagPair(id, tag));\n\t\t\t\t//console.log(newIdTagPair(id, tag).id + \" --- \" + autoComplete.dictionaryTags[testI].id + \" --- \" + autoComplete.dictionaryTags[testI].tags[0] )\n\t\t\t}\n\n\t\t\tautoComplete.suggestion.tags.push(tag);\n\t\t\tautoComplete.suggestion.id.push(id);\n\n\t\t\t//console.log( autoComplete.suggestion.id[testI] + \" --- \" + autoComplete.suggestion.tags[testI] ) ;\n\t\t\t//console.log( id + \" --- \" + tag ) ;\n\n\t\t\tjQuery(\"#\" + _inputId).autocomplete('option', 'source', autoComplete.suggestion.tags);\n\t\t}\n\t};\n\t// public section END (return end)\n}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "function get_cat(e){\"forum\"==e||\"fjb\"==e?($(\".select-category\").addClass(\"show\"),$.ajax({url:\"/misc/get_categories_search/\"+e,success:function(e){var t=location.href.match(/forumchoice(\\[\\])*=([^&]+)/),s=\"\";t&&(s=t[2]);var a=\"\";for(var o in e)s==e[o].forum_id?(a=\"selected\",$(\"#search_category\").parent().find(\".customSelectInner\").text(e[o].name)):a=\"\",$(\"#search_category\").append('<option data-child-list=\"'+e[o].child_list+'\" value=\"'+e[o].forum_id+'\" '+a+\">\"+e[o].name+\"</option>\")}})):$(\".select-category\").removeClass(\"show\")}", "function getCatCategory() {\n\tvar categories = \"\";\n\tvar listValues = getCategoryValues([\"catVinRouge\", \"catVinBlanc\", \"catVinGrappa\", \"catVinMousseuxRose\", \"catVinPineau\", \"catVinAromatise\"]);\n\tif (listValues != \"\")\n\t\tcategories = \"(@tpcategorie==(\" + listValues + \"))\";\n\t\n\treturn categories;\n}", "function addCategoryNames(){\n\tAUTHORIZATION_CODE = JSON.parse(sessionStorage.access);\n\tvar categories = getSpotifyCategory(getCategoryID);\n}", "function searchcategory_mapping_with_menus(search_category) {\n switch (search_category) {\n case 'LSH1':\n var tobe_active_menu = 'LuxuryNavBarComponent';\n return tobe_active_menu;\n break;\n case 'ISH1':\n var tobe_active_menu = 'INDILUXNavBarComponent';\n return tobe_active_menu;\n break;\n case 'LBSH1':\n var tobe_active_menu = 'LUXBOXNavBarComponent';\n return tobe_active_menu;\n break;\n default:\n var tobe_active_menu = 'LuxuryNavBarComponent';\n return tobe_active_menu;\n }\n }", "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function ListCategories () \n{\n\tMakeXMLHTTPCallListCategories(\"GET\", \"http://uvm061.dei.isep.ipp.pt/ARQSI/Widget/WidgetAPI/EditorAPI.php?type=GetAllCategories\");\n}", "function findSuggestions(category, storedData, suggestions) {\n storedData.forEach(function (b) {\n if (b.category == category)\n suggestions.push(b);\n });\n}", "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgorychoosen)\n }\n }", "function searchKeywords() {\n if(searchString.toLowerCase().includes('unit')) {\n if(searchString.toLowerCase().includes('1')) {\n searchBox.value = 'Javascript DOM JQuery CSS function html flexbox arrays';\n } if(searchString.toLowerCase().includes('2')) {\n searchBox.value = 'middleware node express authorization authentication psql ejs fetch api cookies';\n } if(searchString.toLowerCase().includes('3')) {\n searchBox.value = 'react authorization authentication psql git fetch tokens'\n } if(searchString.toLowerCase().includes('4')) {\n searchBox.value = 'ruby rails psql'\n }\n }\n}", "function categoryCheck (word) {\n switch (word) {\n case \"anniversary\":\n return \"anniversary\"\n break;\n case \"birthday\":\n return \"birthday\"\n break; \n case \"congratulations\":\n return \"congratulations\"\n break; \n case \"well\":\n return \"getWell\"\n break;\n case \"getwell\":\n return \"getWell\"\n break;\n case \"housewarming\":\n return \"housewarming\"\n break; \n case \"warming\":\n return \"housewarming\"\n break; \n case \"sorry\":\n return \"sorry\"\n break; \n case \"patrick\":\n return \"stPatricksDay\"\n break; \n case \"patrick\\'s\":\n return \"stPatricksDay\"\n break; \n case \"because\":\n return \"justBecause\"\n break;\n case \"just\":\n return \"justBecause\"\n break;\n case \"justBecause\":\n return \"justBecause\"\n break;\n case \"baby\":\n return \"newBaby\"\n break;\n case \"newBaby\":\n return \"newBaby\"\n break;\n case \"newborn\":\n return \"newBaby\"\n break; \n case \"romance\":\n return \"loveRomance\"\n break;\n case \"retirement\":\n return \"retirement\"\n break; \n case \"retire\":\n return \"retirement\"\n break; \n case \"funeral\":\n return \"sympathy\"\n break; \n case \"sympathy\":\n return \"sympathy\"\n break; \n case \"thank\":\n return \"thankYou\"\n break; \n case \"thankYou\":\n return \"thankYou\"\n break; \n case \"year\":\n return \"newYear\"\n break;\n case \"valentine\":\n return \"valentinesDay\"\n break;\n case \"valentine\\'s\":\n return \"valentinesDay\"\n break;\n case \"valentines\":\n return \"valentinesDay\"\n break;\n case \"easter\":\n return \"easter\"\n break; \n case \"mother\\'s\":\n return \"mothersDay\"\n break;\n case \"mothers\":\n return \"mothersDay\"\n break;\n case \"mother\":\n return \"mothersDay\"\n break;\n case \"memorial\":\n return \"memorialDay\"\n break; \n case \"fathers\":\n return \"fathersDay\"\n break;\n case \"father\\'s\":\n return \"fathersDay\"\n break;\n case \"father\":\n return \"fathersDay\"\n break; \n case \"july\":\n return \"july4th\"\n break; \n case \"4th\":\n return \"july4th\"\n break; \n case \"fourth\":\n return \"july4th\"\n break; \n case \"labor\":\n return \"laborDay\"\n break;\n case \"laborDay\":\n return \"laborDay\"\n break;\n case \"halloween\":\n return \"halloween\"\n break; \n case \"veteran\":\n return \"veteransDay\"\n break;\n case \"veterans\":\n return \"veteransDay\"\n break;\n case \"veteransDay\":\n return \"veteransDay\"\n break;\n case \"veteran\\'s\":\n return \"veteransDay\"\n break;\n case \"thanksgiving\":\n return \"thanksgiving\"\n break; \n case \"hanukkah\":\n return \"hanukkah\"\n break; \n case \"christmas\":\n return \"christmas\"\n break;\n }\n}", "function filterCategories(value) {\n for (i = 0; i < categoryArray.length; i++) {\n if (categoryArray[i].text.toLowerCase().includes(value.toLowerCase())) {\n $(\"#\" + categoryArray[i].value).attr(\"tabindex\", \"-1\");\n $(\"#\" + categoryArray[i].value).attr(\"role\", \"menuitem\");\n $(\"#\" + categoryArray[i].value).addClass(\"dropdown-item\");\n $(\"#\" + categoryArray[i].value).show();\n }\n else {\n $(\"#\" + categoryArray[i].value).removeAttr(\"tabindex\");\n $(\"#\" + categoryArray[i].value).removeAttr(\"role\");\n $(\"#\" + categoryArray[i].value).removeClass(\"dropdown-item\");\n $(\"#\" + categoryArray[i].value).hide();\n }\n }\n}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function getKeywords() {\n \n for (let selection of selections) {\n for (let category of aliasData['categories']) {\n if (category.keyword.toLowerCase() == selection) {\n keywordAliases.push(...category.aliases)\n }\n }\n }\n\n\t\tdisplayFilters();\n\t}", "function searchProductCategory() {\n\n productCategoryService.searchProductCategory($scope.productCategorySearch, $scope.pageLimit, $scope.currentPage)\n .then(function success(response) {\n\n $scope.categoryLists = response.data.data;\n $scope.totalItems = response.data.dataCount;\n $scope.catCount = response.data.dataCount;\n\n }, function error(error) {\n toastr.error('ERROR!', 'Replacement has been Create failed.');\n });\n }", "function Category() {\n}", "function checkIfKeywordIsACategory(keyword){\n if(keyword.includes(\"node\")||keyword.includes(\"propert\")||keyword.includes(\"relationship\")||keyword.includes(\"schema\"))\n return true;\n else false;\n}", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "static getCategoryFromCommonName (inCommonName) {\n for (let index = 0; index < gEBirdAll.data.length; index++) {\n if (gEBirdAll.data[index]['PRIMARY_COM_NAME'] === inCommonName) {\n return gEBirdAll.data[index]['CATEGORY']\n }\n }\n\n return 'Unknown'\n }", "function searchKey(inpVal) {\r\n document.querySelector(\".cat-list\").remove();\r\n fetch(`https://cataas.com/api/cats?tags=${inpVal}`, {\r\n method: \"GET\"\r\n })\r\n .then((data) => {\r\n return data.json();\r\n })\r\n .then((cats) => loadCats(cats));\r\n}", "function Search() {\r\n\tGlobal.dom.forEach(function(item) {\r\n\t\titem.className = item.className.replace(\"search-result\", \"\");\r\n\t});\r\n\tvar keyword_value = Global.keyword.value;\r\n\tif (keyword_value == \"\") return;\r\n\tGlobal.dom.forEach(function(item, index) {\r\n\t\tvar dom_content = item.innerText;\r\n\t\tconsole.log(dom_content);\r\n\t\tif (dom_content.indexOf(keyword_value) != -1) {\r\n\t\t\titem.className += \" search-result\";\r\n\t\t\tconsole.log(\"in\");\r\n\t\t}\r\n\t});\r\n}", "static get tag(){return\"site-search\"}", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function createGlobalCategories() {\n return [\n\t//ROOT CATEGORY:\n\tconstants.ROOT_CATEGORY,\n\t\n\t//TOP-LEVEL CATEGORIES:\n\t//(they should have root as their only parent)\n\tnew Category([categories.ROOT], categories.RAW),\n\t//new Category([categories.ROOT], categories.FOOD),\n\t\n\t//SUB-CATEGORIES:\n\tnew Category([categories.RAW], categories.FOOD),\n\tnew Category([categories.RAW], categories.CONSUMABLE),\n\t\n ];\n}", "function search(text) {\n text = text.toLowerCase();\n var container = $(\"#catalog\");\n // clear everything\n $(container).html('');\n\n // paint only items that fullfil the filter\n for (var i = 0; i < DB.length; i++) {\n var item = DB[i];\n\n // decide if the items fullfils the filter\n // if so, display it\n if (\n item.title.toLowerCase().indexOf(text) >= 0 // if title contains the text\n || // or\n item.code.toLowerCase().indexOf(text) >= 0 // if the code contains the text\n ) {\n displayItem(item);\n }\n\n }\n}", "function tech() { categoryChoice = TECHNOLOGY;\n getNews()\n}", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "function searchTerm(){\n \n }", "function getCatalogs(){\n\n}", "function search() {\n\t\n}", "function categorise(string, categories)\n{\n\tvar categoryList = []\n\n\t// initialise output list with input list (if there is one)\n\tif ( categories.length > 0 )\n\t{\n\t\tcategoryList.push.apply(categoryList, JSON.parse(\"[\" + categories.replace(/[^0-9,]/gi, '') + \"]\"))\n\t\tAgent.log(\"categoryList=\" + JSON.stringify(categoryList) )\n\t}\n\n\t// if there's anything to do...\n\tif ( string.trim().length > 0 )\n\t{\n\t\t// get list of all categories in system\n\t\tvar allCategories = JSON.parse(Agent.credential('wpsg_categories'))\n\t\t//Agent.log(\"allCategories=\" + JSON.stringify(allCategories))\n\n\t\t// identify categories that appear in the string\n\t \tfor (var i = 0; i < allCategories.length; i++) \n\t\t{\n\t\t\t//Agent.log(\"allCategories[i]['name'].trim().toUpperCase()=\" + allCategories[i]['name'].trim().toUpperCase() )\n\t\t\t// remove 'uncategorized' category\n\t\t\tif ( allCategories[i]['name'].trim().toUpperCase() == 'UNCATEGORIZED' )\n\t\t\t{\n\t\t\t\t//Agent.log(\"allCategories[i]['name'].trim().toUpperCase()=\" + allCategories[i]['name'].trim().toUpperCase() )\n\t\t\t\tvar uncategorizedIdIndex = categoryList.indexOf(allCategories[i]['id']);\n\t\t\t\t// Agent.log(\"uncategorizedIdIndex=\" + uncategorizedIdIndex )\n\t\t\t\tif ( uncategorizedIdIndex >= 0 && categoryList.length > 1)\n\t\t\t\t{\n\t\t\t\t\tcategoryList.splice(uncategorizedIdIndex, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar categoryName = \"\\\\b\" + allCategories[i]['name'].trim().replace(/&amp;/gi, 'and').replace(/\\s+/g, '\\\\s+') + \"\\\\b\"\n\t\t\t\t\n\t\t\t\tvar regex = new RegExp( categoryName ,\"ig\");\n\n\t\t\t\tif (string.search(regex) >= 0 ) \n\t\t\t\t{\n\t\t\t\t\tcategoryList.push(allCategories[i]['id'])\n\t\t \t\t}\n\t\t\t}\n\t\t}\n\n\t\t// unique list \n\t\toutputCategoryList = JSON.stringify(sortUnique(categoryList)).replace(/[\\[\\]]/g, '')\n\t}\n\n\t//Agent.log(\"outputCategoryList=\" + outputCategoryList)\n\treturn outputCategoryList\n}", "findCategory(name) {\n return this.categories.find(category => {\n return category.id.toLowerCase() === name.toLowerCase();\n });\n }", "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "function search(current){\n\n}", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "function getCategories(searchTerm) {\n searchTerm = encodeURIComponent(searchTerm);\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n return fetch(`${TRIPPLANNERAPI}/search/categories/${searchTerm}`, requestOptions)\n .then(handleResponse)\n}", "function Suggestions() {\n}", "function getCategory(catName, searchTerm, searchExclude) {\n\tfunction getCategoryNode(name, subcategories, parent) {\n\t\tif (selectedCategory = categories[0][name]) {\n\t\t\treturn topCategory = homeCategory = selectedCategory;\n\t\t}\n\t\ttopCategory = undefined;\n\n\t\tstack.push(parent);\n\t\tvar category,\n\t\t\tl = subcategories.length;\n\t\twhile (l--) {\n\t\t\tcategory = subcategories[l];\n\t\t\tif (category.name === name || category.categories && (category = getCategoryNode(name, category.categories, category))) {\n\t\t\t\twhile (parent = stack.pop()) {\n\t\t\t\t\ttopCategory = parent;\n\t\t\t\t\tif (!parent.expanded) {\n\t\t\t\t\t\t$.observable(parent).setProperty(\"expanded\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn category;\n\t\t\t}\n\t\t}\n\t\tstack.pop();\n\t}\n\tvar topCat, // specific to this getScript call\n\t\tstack = [],\n\t\tcategories = content.categories,\n\t\toldTopCategory = topCategoryName,\n\t\tloadedPromise = $.Deferred();\n\n\tselectedCategory = catName && getCategoryNode(catName, categories) || categories[0].jsrender;\n\ttopCategory = topCategory || selectedCategory;\n\tif (searchTerm && !catName) {\n\t\ttopCategory = searchCategory;\n\t\tif (page) {\n\t\t\tpage.category = undefined;\n\t\t}\n\t}\n\n\ttopCategoryName = topCategory.name;\n\n\tif (topCategoryName !== oldTopCategory) {\n\t\tif (oldTopCategory) {\n\t\t\t$(\"#id-\" + oldTopCategory)\n\t\t\t\t.removeClass(\"selected\")\n\t\t\t\t.addClass(\"unselected\");\n\t\t}\n\t\t$(\"#id-\" + topCategoryName)\n\t\t\t.removeClass(\"unselected\")\n\t\t\t.addClass(\"selected\");\n\t}\n\n\tif (content.topCategory !== topCategory) {\n\t\tcontent.catName = catName; // Don't change this observably, to avoid triggering an additional UI update before topCategory has been set.\n\t\t$.observable(content).setProperty(\"topCategory\", topCategory);\n\t}\n\n\tif (searchTerm) {\n\t\tif (content.searched !== searchTerm || content.searchExclude !== searchExclude) {\n\t\t\tloadAllContent()\n\t\t\t\t.then(function() {\n\t\t\t\t\tloadAllContent(\"find\")\n\t\t\t\t\t\t.then(function() {\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tsearchContent(searchTerm);\n\t\t\t\t\t\t\t\t$.observable(content).setProperty(\"searched\", searchTerm);\n\t\t\t\t\t\t\t\tcontent.searchExclude = searchExclude;\n\t\t\t\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t} else {\n\t\tif (!topCategory.loaded && !topCategory.loading) {\n\t\t\ttopCategory.loading = \" \"; // true, but render blank until after timeout\n\t\t\ttopCat = topCategory; // Specific to this getCategory() call. (Global topCategory var may change before then() returns)\n\n\t\t\t$.getScript(\"documentation/contents-\" + topCategory.name + \".js\")\n\t\t\t\t.then(function() {\n\t\t\t\t\t$.observable(topCat).setProperty(\"loaded\", true);\n\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t});\n\t\t} else if (topCategory.loaded) {\n\t\t\tif (content.searched) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclearSearch(); // lazy clear search annotations from content\n\t\t\t\t\t$.observable(content).setProperty({\n\t\t\t\t\t\tsearch: undefined,\n\t\t\t\t\t\tfilterlen: 0\n\t\t\t\t\t});\n\t\t\t\t\tcontent.searched = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t}\n\treturn loadedPromise.promise();\n}", "function addCategory(category) {\n// var db = ScriptDb.getMyDb(); \n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n \n if (category == null) {\n return 0; \n }\n \n // if (db.query({type: \"list#categories\"}).getSize() == 0) {\n \n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n var id = db.save({type: \"categories\", list: [category]}).getId(); \n PropertiesService.getScriptProperties().setProperty(\"categories\", id);\n return 1;\n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n for (var i = 0 ; i<categories.list.length ; i++) {\n if (categories.list[i] == category) {\n return 0;\n }\n }\n categories.list.push(category);\n categories.list = categories.list.sort();\n db.save(categories);\n return 1;\n}", "function _get_category(resource_text) {\n\n\t\t\tfor (var key_cat in browser_conf_json.categories) {\n\t\t\t\tif (browser_conf_json.categories.hasOwnProperty(key_cat)) {\n\t\t\t\t\tvar re = new RegExp(browser_conf_json.categories[key_cat][\"rule\"]);\n\t\t\t\t\tif (resource_text.match(re)) {return key_cat;}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "setupCategoryInterface() {\n this.resetSelect2(false); // Destroy and don't reinitialize.\n $('.num-entities-info').hide();\n $('.file-selector').hide();\n $('.category-selector').show();\n $('#category-input').val('').focus();\n this.setupCategorySearch();\n }", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function findCategory(category) {\n return originals[category]\n}", "categoryClick(category) {\n const helper = algoliasearchHelper(client, indexName, {\n hitsPerPage: 1000,\n facets: [\"food_type\"]\n });\n\n helper.on(\"result\", content => {\n this.setState({\n searchResults: content.hits,\n currentResults: content.hits.slice(0, 5),\n count: content.nbHits,\n searchTime: content.processingTimeMS,\n currentCategory: category,\n currentPayment: null\n });\n });\n\n if (!this.state.geoLocation) {\n helper\n .setQueryParameter(`aroundLatLngViaIP`, true)\n .addFacetRefinement(\"food_type\", category)\n .search();\n } else {\n const { lat, lng } = this.state.geoLocation;\n helper\n .setQueryParameter(`aroundLatLng`, `${lat}, ${lng}`)\n .addFacetRefinement(\"food_type\", category)\n .search();\n }\n }", "function SC(command, term) \n{\n switch (command) {\n\n case \"concert-this\":\n concertSearch(term);\n break;\n\n case \"spotify-this-song\":\n songSearch(term);\n break;\n \n case \"movie-this\":\n if (term === \"\" || term === null) {\n movieSearch();\n }\n else {\n movieSearch(term);\n }\n break;\n\n case \"do-what-it-says\":\n randomSearch();\n break;\n \n default:\n console.log(output); \n }\n}", "function doGeneralImageSearch() {\n\n}", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "function displayCats() {\r\n if (\r\n searchValue.toLowerCase() === 'cat' ||\r\n searchValue.toLowerCase() === 'cats'\r\n ) {\r\n alert('I must say, you have amazing taste 🌟😻🌟');\r\n }\r\n}", "filterTopCategories() {\n const result = [];\n if (!this.searchResults) return;\n this.topCategories = [];\n const sr = this.searchResults;\n sr.forEach((item) => {\n if (item.categoryPath) {\n const cats = item.categoryPath.split('/');\n const exactNode = cats[cats.length - 1];\n if (!result.some(e => e.name === exactNode) && result.length < 3) {\n result.push(new TopCategory(exactNode));\n }\n }\n });\n this.topCategories = result;\n }", "function fetch_categories(wiki){\n var cats=[]\n var reg=new RegExp(\"\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):(.{2,60}?)\\]\\](\\w{0,10})\", \"ig\")\n var tmp=wiki.match(reg)//regular links\n if(tmp){\n var reg2=new RegExp(\"^\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):\", \"ig\")\n tmp.forEach(function(c){\n c=c.replace(reg2, '')\n c=c.replace(/\\|?[ \\*]?\\]\\]$/i,'')\n if(c && !c.match(/[\\[\\]]/)){\n cats.push(c)\n }\n })\n }\n return cats\n }", "_getSearchTokens(aSearch) {\n return [this._learnMoreString.toLowerCase()];\n }", "function SearchKeywordClassification(trafficType, id, name, url) {\n FacetClassification(trafficType, id, name, url, 500, 130);\n}", "async function pageCategories(pag) {\n var cats = await pag.categories(), z = [];\n for(var cat of cats) {\n var c = cat.replace('Category:', '');\n if(!CATEGORY_EXC.test(c)) z.push(c);\n }\n return z;\n}", "function compileCategories(myStyleCategories) {\n\t\tfor (var i = 0; i < myStyleCategories.length; ++i) {\n\t\t\tsource = $('#styleCategoryTemplate').html();\n\t\t\ttemplate = Handlebars.compile(source);\n\t\t\tvar categories = template(myStyleCategories[i]);\n\t\t\t$('#searchStyleCategory').append(categories);\n\t\t}\n\t}", "function search( root, search ) {\n search = search.toLowerCase();\n app.set('possibilities', []);\n if (search) {\n return search_recurse(root, search, []);\n }\n}", "function searchRecom() {\n\t// store keyword in localSession\n\twindow.localStorage.setItem('kw', keyWord);\n\t// Fuse options\t\t\t\t\n\tvar options = {\n\t\tshouldSort: true,\n\t\ttokenize: true,\n\t\tthreshold: 0.2,\n\t\tlocation: 0,\n\t\tdistance: 100,\n\t\tincludeScore: true,\n\t\tmaxPatternLength: 32,\n\t\tminMatchCharLength: 2,\n\t\tkeys: [\"title.recommendation_en\",\n\t\t\t \"title.title_recommendation_en\",\n\t\t\t \"topic.topic_en\"]\n\t};\n\t//Fuse search\n\tvar fuse = new Fuse(recommends, options); //https://fusejs.io/\n\tconst results = fuse.search(keyWord);\n\treturn results;\n}", "getAllDisplayName(category) {\n return category === 'All' ? 'Todos los lugares' : category;\n }", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function SearchWrapper () {}", "function searchFilter(searchStr, listRootId) {\n\t\tvar match;\n\t\tvar searchIndex;\n\t\tvar i, j;\n\t\tvar nodeJQ;\n\t\tvar visibleNodes = [];\n\n\t\t// show all\n\t\tif (!searchStr || searchStr === \"\") {\n\t\t\tjQuery(\"#\" + listRootId).find(\"li\").andSelf().show();\n\t\t}\n\n\t\tsearchStr = searchStr.toLowerCase();\n\n\n\t\t// hide all nodes while traversing\n\t\t// not to nice implemented ;)\n\t\tfor (i = autoComplete.dictionaryTags.length - 1; i >= 0; i--) {\n\t\t\tnodeJQ = jQuery(\"#\" + autoComplete.dictionaryTags[i].id);\n\t\t\t//console.log(autoComplete.dictionaryTags[i].tags[0])\n\t\t\tmatch = null;\n\t\t\tfor (j = 0; j < autoComplete.dictionaryTags[i].tags.length; j++) {\n\t\t\t\tsearchIndex = autoComplete.dictionaryTags[i].tags[j].toLowerCase().match(searchStr);\n\t\t\t\tif (searchIndex) {\n\t\t\t\t\tmatch = nodeJQ;\n\t\t\t\t\t//select node in tree to highlight\n\t\t\t\t\tif (searchIndex === 0 && autoComplete.dictionaryTags[i].tags[j].length === searchStr.length) {\n\t\t\t\t\t\tMYAPP.tree.select_node(jQuery(\"#\" + autoComplete.dictionaryTags[i].id));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodeJQ.hide();\n\n\t\t\tif (match) {\n\t\t\t\tvisibleNodes.push(match);\n\t\t\t}\n\t\t}\n\n\t\t// show matching nodes and all their parents\n\t\t// !!! todo: the method parents gos up to the html root but it should stop at the top of the list\n\t\tfor (i = visibleNodes.length - 1; i >= 0; i--) {\n\t\t\tvisibleNodes[i].parents(\"#treeList li\").andSelf().show();\n\t\t}\n\t}", "function $3f6badc8e7bad870$var$swift(hljs) {\n var SWIFT_KEYWORDS = {\n // override the pattern since the default of of /\\w+/ is not sufficient to\n // capture the keywords that start with the character \"#\"\n $pattern: /[\\w#]+/,\n keyword: \"#available #colorLiteral #column #else #elseif #endif #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation _ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false fileprivate final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating open operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set some static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet\",\n literal: \"true false nil\",\n built_in: \"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip\"\n };\n var TYPE = {\n className: \"type\",\n begin: \"\\\\b[A-Z][\\\\w\\xc0-ʸ']*\",\n relevance: 0\n };\n // slightly more special to swift\n var OPTIONAL_USING_TYPE = {\n className: \"type\",\n begin: \"\\\\b[A-Z][\\\\w\\xc0-ʸ']*[!?]\"\n };\n var BLOCK_COMMENT = hljs.COMMENT(\"/\\\\*\", \"\\\\*/\", {\n contains: [\n \"self\"\n ]\n });\n var SUBST = {\n className: \"subst\",\n begin: /\\\\\\(/,\n end: \"\\\\)\",\n keywords: SWIFT_KEYWORDS,\n contains: [] // assigned later\n };\n var STRING = {\n className: \"string\",\n contains: [\n hljs.BACKSLASH_ESCAPE,\n SUBST\n ],\n variants: [\n {\n begin: /\"\"\"/,\n end: /\"\"\"/\n },\n {\n begin: /\"/,\n end: /\"/\n }\n ]\n };\n // https://docs.swift.org/swift-book/ReferenceManual/LexicalStructure.html#grammar_numeric-literal\n // TODO: Update for leading `-` after lookbehind is supported everywhere\n var decimalDigits = \"([0-9]_*)+\";\n var hexDigits = \"([0-9a-fA-F]_*)+\";\n var NUMBER = {\n className: \"number\",\n relevance: 0,\n variants: [\n // decimal floating-point-literal (subsumes decimal-literal)\n {\n begin: `\\\\b(${decimalDigits})(\\\\.(${decimalDigits}))?` + `([eE][+-]?(${decimalDigits}))?\\\\b`\n },\n // hexadecimal floating-point-literal (subsumes hexadecimal-literal)\n {\n begin: `\\\\b0x(${hexDigits})(\\\\.(${hexDigits}))?` + `([pP][+-]?(${decimalDigits}))?\\\\b`\n },\n // octal-literal\n {\n begin: /\\b0o([0-7]_*)+\\b/\n },\n // binary-literal\n {\n begin: /\\b0b([01]_*)+\\b/\n }\n ]\n };\n SUBST.contains = [\n NUMBER\n ];\n return {\n name: \"Swift\",\n keywords: SWIFT_KEYWORDS,\n contains: [\n STRING,\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT,\n OPTIONAL_USING_TYPE,\n TYPE,\n NUMBER,\n {\n className: \"function\",\n beginKeywords: \"func\",\n end: /\\{/,\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][0-9A-Za-z$_]*/\n }),\n {\n begin: /</,\n end: />/\n },\n {\n className: \"params\",\n begin: /\\(/,\n end: /\\)/,\n endsParent: true,\n keywords: SWIFT_KEYWORDS,\n contains: [\n \"self\",\n NUMBER,\n STRING,\n hljs.C_BLOCK_COMMENT_MODE,\n {\n begin: \":\"\n } // relevance booster\n ],\n illegal: /[\"']/\n }\n ],\n illegal: /\\[|%/\n },\n {\n className: \"class\",\n beginKeywords: \"struct protocol class extension enum\",\n keywords: SWIFT_KEYWORDS,\n end: \"\\\\{\",\n excludeEnd: true,\n contains: [\n hljs.inherit(hljs.TITLE_MODE, {\n begin: /[A-Za-z$_][\\u00C0-\\u02B80-9A-Za-z$_]*/\n })\n ]\n },\n {\n className: \"meta\",\n begin: \"(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|@propertyWrapper|@main)\\\\b\"\n },\n {\n beginKeywords: \"import\",\n end: /$/,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n BLOCK_COMMENT\n ],\n relevance: 0\n }\n ]\n };\n}", "function WR_Shortcode_Product_Categories() {\n\t \tvar button = $( '.sc-cat-list[data-expand=\"true\"]' ).children( 'a' );\n\t \t$( '.sc-cat-list[data-expand=\"true\"] ul' ).hide();\n\n\t \tbutton.on( 'click', function() {\n\t \t\t$( this ).next().slideToggle();\n\t \t} );\n\t }", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "function suggest(keywords,key,object)\n{\n //alert(\"line 19=\"+object.id);\nvar results = document.getElementById(\"results\");\n \n if(keywords != \"\")\n {\n var terms = get_data(); // sort? -- data should be alphabetical for best results\n\n var ul = document.createElement(\"ul\");\n var li;\n var a;\n \n if ((key.keyCode == '40' || key.keyCode == '38' || key.keyCode == '13'))\n {\n navigate(key.keyCode,object);\n }\n else\n {\n var kIndex = -1;\n \n for(var i = 0; i < terms.length; i++)\n { \n kIndex = terms[i].activity.toLowerCase().indexOf(keywords.toLowerCase());\n \n if(kIndex >= 0) \n {\n li = document.createElement(\"li\");\n \n // setup the link to populate the search box\n a = document.createElement(\"a\");\n a.href = \"javascript://\"; \n \n a.setAttribute(\"rel\",terms[i].val);\n a.setAttribute(\"rev\", getRank(terms[i].activity.toLowerCase(), keywords.toLowerCase()));\n a.setAttribute(\"ref\",terms[i].val2);\n \n if(!document.all) a.setAttribute(\"onclick\",\"populate(this,object);\");\n else a.onclick = function() { populate(this,object); }\n \n \n \n a.appendChild(document.createTextNode(\"\"));\n \n if(keywords.length == 1) \n {\n var kws = terms[i].activity.toLowerCase().split(\" \");\n //alert(\"line 68=\"+kws+terms[i].val2);\n\n var firstWord = 0;\n \n for(var j = 0; j < kws.length; j++)\n {\n // if(kws[j].toLowerCase().charAt(0) == keywords.toLowerCase()) {\n \n ul.appendChild(li);\n \n if(j != 0) {\n kIndex = terms[i].activity.toLowerCase().indexOf(\" \" + keywords.toLowerCase());\n kIndex++;\n }\n \n break;\n // }\n }\n }\n else if(keywords.length > 1) {\n ul.appendChild(li);\n }\n else continue;\n\n \n var before = terms[i].activity.substring(0,kIndex);\n var after = terms[i].activity.substring(keywords.length + kIndex, terms[i].activity.length);\n \n a.innerHTML = before + \"<strong>\" + keywords.toLowerCase() + \"</strong>\" + after;\n \n li.appendChild(a);\n\n }\n } \n \n if(results.hasChildNodes()) results.removeChild(results.firstChild);\n \n // position the list of suggestions\n var s = document.getElementById(object.id);\n var xy = findPos(s);\n \n results.style.left = xy[0] + \"px\";\n results.style.top = xy[1] + s.offsetHeight + \"px\";\n results.style.width = s.offsetWidth + \"px\";\n \n // if there are some results, show them\n if(ul.hasChildNodes()) {\n results.appendChild(filterResults(ul));\n \n if(results.firstChild.childNodes.length == 1) results.firstChild.firstChild.getElementsByTagName(\"a\")[0].className = \"hover\";\n \n }\n\n }\n }\n else\n {\n if(results.hasChildNodes()) results.removeChild(results.firstChild);\n }\n}", "function getCategory(content) {\n var category = '';\n // var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/(\\w+)(\\/index\\.rss)/;\n var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/search\\/(\\w+)(\\?&srchType=A)/;\n var result = content.match(url);\n if(result != null) {\n category = result[4];\n }\n return category;\n}", "function compileCategories() {\n var url = \"https://www.eventbriteapi.com/v3/categories/?token=\" + TOKEN;\n var request = new XMLHttpRequest();\n \n // When the request is completed, map the categories to the hashmap\n request.onreadystatechange = function(data) {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var data = request.responseText;\n var obj = $.parseJSON(data);\n \n $.each(obj.categories, function(i, item) {\n gCategories[item.id] = item.short_name;\n }); \n } else {\n console.log('Error', request.status)\n }\n }\n }\n \n // Perform a GET request to the API url\n request.open('GET', url, true);\n request.send(); \n}", "categ(state,data)\n {\n return state.category=data\n }", "filterCourses(query, selectedTerm) {\n return this.props._terms.availableCourses[selectedTerm].filter(course => course.code.includes(query.replace(/ /g, '').toUpperCase()));\n }", "function processSearchResults(searchResults) {\n for (var i = 0; i < searchResults.length; i++) {\n \tvar doc = searchResults[i];\n makeSimpleCategoryValue(doc);\n }\n\treturn searchResults;\n}", "get categories() {\n return this.args.categories || this.args.settings || [];\n }", "function ListCategoryDefinitions(szLibraryId, szSecurityCode)\n{\n try\n {\n var szUrl = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s?securityCode=%s\",\n szLibraryId, szSecurityCode);\n var pSuccess = UrlFetchApp.fetch(szUrl);\n var pAOut = new Array();\n //\n if (pSuccess.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n\n //call lambda code\n return JSON.parse(pSuccess.getContentText());\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "function doubleSearch () {}", "function searchFunction(evt) {\n\tvar title = document.title;\n\tvar searchString = this.value;\n\tconsole.log(searchString);\n\tvar url = \"\";\n\tif(title === 'Home') {\n\t\turl = \"/636800/library/search.php?search_string=\" + searchString;\t\n\t\tproductGetRequest(url, 'products');\n\t}\n\telse {\n\t\tvar category_name = document.title;\n\t\turl = \"/636800/library/search.php?search_string=\" + searchString + \"&category_name=\" + category_name;\t\n\t\tproductGetRequest(url, 'products');\n\t}\n\t\n\t/*\n\tif(title == \"Home\" && search_string === \"\") {\n\t\turl = \"/636800/library/all_json.php\";\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\telse if(title === \"Home\") {\n\t\turl = \"/636800/library/search.php?search_string=\" + search_string;\n\t\tproductGetRequest(url, 'products');\n\t}\n\t*/\n\t/*\n\telse if(search_string === \"\") {\n\t\turl = \"/636800/library/category_json.php?category_name=\" + title;\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\telse {\n\t\turl = \"/636800/library/search_json_category.php?category_name=\" + title + \"&search_string=\" + search_string;\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\t*/\n\n}", "async indexAction () {\n if (this.isPost) {\n return this.fail()\n }\n // 获取分类\n const data = await this.getTermsByTaxonomy('category')\n // this.success(data)\n return this.success({\n found: data.length,\n categories: data\n })\n }", "function masterSearch(){\n switch (userCommand) {\n\n case \"my-tweets\":\n findTweets();\n break;\n\n case \"spotify-song\":\n spotifyNow();\n break;\n\n case \"movie-please\":\n movie();\n break;\n\n case \"directions-por-favor\":\n followDirections();\n break;\n }\n}", "function getCodeSamplesTree(config) {\n\t const results = [];\n\t /**\n\t * Check if code sample can be shown\n\t */\n\t function canUse(mode, type) {\n\t // Check for required functions\n\t switch (mode) {\n\t case 'svg-box':\n\t case 'svg-raw':\n\t case 'svg-uri':\n\t if (!iconify.Iconify.renderHTML) {\n\t return false;\n\t }\n\t }\n\t // Check type\n\t switch (type) {\n\t case 'raw':\n\t return config[type];\n\t case 'api':\n\t return config.api !== void 0;\n\t case 'npm':\n\t return config.npmES !== void 0 || config.npmCJS !== void 0;\n\t }\n\t }\n\t /**\n\t * Get title\n\t */\n\t function getTitle(mode) {\n\t if (phrases$1.codeSampleTitles[mode] !== void 0) {\n\t // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t return phrases$1.codeSampleTitles[mode];\n\t }\n\t return capitalize_1.capitalize(mode);\n\t }\n\t for (const key in rawCodeTabs) {\n\t // Using weird type casting because TypeScript can't property resolve it\n\t const attr = key;\n\t const item = rawCodeTabs[key];\n\t // Item without children\n\t if (typeof item === 'string') {\n\t const mode = attr;\n\t if (canUse(mode, item)) {\n\t // Add item without children\n\t const newItem = {\n\t mode,\n\t type: item,\n\t title: getTitle(attr),\n\t };\n\t results.push(newItem);\n\t }\n\t continue;\n\t }\n\t // Item with children\n\t const children = [];\n\t for (const key2 in item) {\n\t const mode = key2;\n\t // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t const type = item[mode];\n\t if (canUse(mode, type)) {\n\t const newItem = {\n\t mode,\n\t type,\n\t title: getTitle(mode),\n\t };\n\t children.push(newItem);\n\t }\n\t }\n\t let firstChild;\n\t const tab = attr;\n\t const title = getTitle(tab);\n\t switch (children.length) {\n\t case 0:\n\t break;\n\t case 1:\n\t // Merge children\n\t // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n\t firstChild = children[0];\n\t results.push({\n\t tab,\n\t mode: firstChild.mode,\n\t type: firstChild.type,\n\t title,\n\t });\n\t break;\n\t default:\n\t // Add all children\n\t results.push({\n\t tab,\n\t children,\n\t title,\n\t });\n\t }\n\t }\n\t return results;\n\t}", "function GetCategoriesList() {\n var requestString = 'wscmd=crscategories';\n AjaxRequest('./rs.aspx', requestString, GotCategoriesList, null, 'crscategories');\n}", "function bloggerCatFilter(innerHTML) {\n var cat = innerHTML;\n var headings = document.evaluate(\"//button[@class='btn' and contains(., '\" + cat + \"')]\", document, null, XPathResult.ANY_TYPE, null );\n var thisHeading = headings.iterateNext();\n thisHeading.click();\n}", "function search(nameKey, myArray) {\n // The clean function clears any char issues relating to fetching category names from\n function clean(string) {\n string = string\n .toLowerCase()\n .replace(/[^a-zA-Z0-9 ]/g, \"\")\n .replace(\n /([\\uE000-\\uF8FF]|\\uD83C[\\uDC00-\\uDFFF]|\\uD83D[\\uDC00-\\uDFFF]|[\\u2011-\\u26FF]|\\uD83E[\\uDD10-\\uDDFF])/g,\n \"\"\n )\n .replace(\" \", \"\")\n .trim();\n return string;\n }\n for (var i = 0; i < myArray.length; i++) {\n if (clean(myArray[i].name) == clean(nameKey)) {\n return myArray[i];\n }\n }\n return \"No Match\";\n}", "function isCat(text) {\n text = text.toLowerCase();\n return text.indexOf(\"cat\") != -1;\n}", "function onCategoriesSelectorOpen()\n {\n // The md-select directive eats keydown events for some quick select\n // logic. Since we have a search input here, we don't need that logic.\n $document.find('md-select-header input[type=\"search\"]').on('keydown', function (e)\n {\n e.stopPropagation();\n });\n }", "function searchCheck() {\n switch(searchType) {\n case \"my-tweets\":\n\tmyTweets();\n\tbreak;\n case \"spotify-this-song\":\n\tcheckName();\n\tbreak;\n case \"movie-this\":\n checkName();\n\tbreak;\n case \"do-what-this-says\":\n\trandomSearch();\n\tbreak;\n }\n}", "function searchCraft(e) {\r\n\te.preventDefault();\r\n\tconst searchItem = document.querySelector('#searchbar').value;\r\n\tconsole.log('Searching: '+searchItem)\r\n\trelatedCrafts=[]\r\n\tallCrafts.forEach(function (value, index, array){\r\n\t\tif( value.title.includes(searchItem) | value.authorname.includes(searchItem)) {\r\n\t\t\trelatedCrafts.push(value)\r\n\t\t\r\n\t\t}\r\n\t})\r\n\t// empty the board, load craft tags that contains the search key\r\n\t$('#board').empty();\r\n\t// const cg = new CraftGenerator()\r\n\trelatedCrafts.forEach(function (value, index, array) {\r\n\t\tmakeTag(value)\r\n\t});\r\n}", "function getNamespacesFilter() {\n var objNamespace = mw.config.get(\"wgNamespaceIds\");\n // var nsNameList = $(\"#namespaceDropdown\").val() || \"\";\n var nsFilters = [];\n var nsName;\n // for (ns = 0; ns < nsNameList.length; ns += 1) {\n nsName = $(\"#namespaceDropdown\").val() || \"\";\n if (nsName === \"main\") {\n nsFilters.push(0);\n }\n if (objNamespace[nsName]) {\n nsFilters.push(objNamespace[nsName]);\n }\n // }\n return nsFilters.join(\"|\");\n }", "function findStud(req, res, next){\n Immunization.find({\"category\":{$eq:req.body.category}}, function(err, immunizations){\n if (err) throw (err);\n res.json({criteriaImmunizations: immunizations});\n })\n}", "function retrieveJSON(category, searchText){\n $.ajax({\n url:\"http://www.mattbowytz.com/simple_api.json?data=\" + category,\n type:\"GET\",\n dataType:\"json\"\n })\n .done(function(json){\n var substringMatches = [];\n json.data.programming.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n json.data.interests.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n })\n .fail(function(xhr, status, error){\n console.log('ERROR: ' + error);\n });\n }", "static get keywords() {\n return [\n '#if',\n '#ifdef',\n '#elif',\n '#else',\n '#endif',\n '#include',\n '#error',\n '#define'\n ];\n }", "function showCritCatList() {\n // reSets all Markers, removes all Popups and renders criteria list\n updateCategoryList(crtCritIndex);\n }", "function filterProjectsBy(evt) {\n var category = evt.target.value;\n $('.project-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.project-filterable').show();\n }\n}" ]
[ "0.6503081", "0.62249935", "0.6120937", "0.6091419", "0.6001836", "0.59314936", "0.5883683", "0.5880309", "0.58211994", "0.5689806", "0.5647416", "0.55702066", "0.5556883", "0.5548632", "0.55471855", "0.5543056", "0.55282634", "0.5520167", "0.55167305", "0.5499745", "0.54884887", "0.5465911", "0.5464455", "0.54628384", "0.54490465", "0.543373", "0.5416236", "0.5412878", "0.5385481", "0.5380761", "0.5380038", "0.5376149", "0.5373384", "0.5369458", "0.5366266", "0.53634536", "0.5310014", "0.5281259", "0.5270483", "0.5259486", "0.5253403", "0.52405024", "0.5240376", "0.52121234", "0.52079624", "0.52052444", "0.518916", "0.5182519", "0.51814204", "0.51630265", "0.5159145", "0.51579237", "0.51511484", "0.5135041", "0.5128596", "0.5126367", "0.5107175", "0.51044077", "0.51012045", "0.5097417", "0.50862354", "0.5085681", "0.5081277", "0.5067212", "0.50646156", "0.50584334", "0.5053035", "0.5042229", "0.50347453", "0.50332445", "0.50272095", "0.5023549", "0.5015657", "0.5014232", "0.5005358", "0.5002296", "0.5001119", "0.49965137", "0.49738833", "0.49726406", "0.49725467", "0.49697387", "0.49694747", "0.4968772", "0.4964461", "0.49599028", "0.49553558", "0.4951408", "0.49510303", "0.49386516", "0.49373806", "0.4936375", "0.4927754", "0.49171147", "0.49112558", "0.49109745", "0.49107996", "0.49063984", "0.49056306", "0.490472", "0.49042302" ]
0.0
-1
Smart Search of Global Code Categories ends here
function SortLabTestOrderList(event) { var url = "/LabTestOrderSet/SortLabTestOrderList"; if (event.data != null && (event.data.msg != null || event.data.msg != undefined || event.data.msg != '')) { url += "?" + "&" + event.data.msg; } $.ajax({ type: "POST", url: url, async: false, contentType: "application/json; charset=utf-8", dataType: "html", data: null, success: function (data) { $("#collapseLabTestOrderSetList").empty(); $("#collapseLabTestOrderSetList").html(data); //$('#LabTest').fixedHeaderTable({ cloneHeadToFoot: true, altClass: 'odd', autoShow: true }); //BindLabTestDetails(data); }, error: function (msg) { } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "function processCategories( searchCategories ) {\n\t//console.log( \"In processCategories, searchCats = \", searchCategories);\n\n\tvar keywordCategories = \"\";\n\tvar typeCategories = [];\n\tfor (var i=0; i<searchCategories.length; i++) {\n\t\t// Type search.\n\t\tif ( place_categories[ searchCategories[i] ].search_type === 'type' ) {\n\n\t\t\ttypeCategories.push( place_categories[ searchCategories[i] ].value );\n\n\t\t}\n\t\t// Keyword search is currently disabled. \n\t\telse if ( place_categories[ searchCategories[i] ].search_type === 'keyword' ) {\n\t\t\t// concatenate the keywords into a pipe deliminated string.\n\t\t\tif ( keywordCategories.length ) keywordCategories += '|';\n\t\t\tkeywordCategories += place_categories[ searchCategories[i] ].value;\n\t\t}\n\t}\n\n\treturn { types: typeCategories, keywords: keywordCategories };\n}", "function search(searchContent) {\r\n smoothTopScroll();\r\n if (searchContent.length==0) {\r\n callCategories();\r\n return;\r\n }\r\n document.getElementById(\"pagetitle\").innerHTML = \"Search\";\r\n var results = {};\r\n Object.keys(itemvarsetidenum).forEach(function(num) {\r\n Object.keys(itemvarsetidenum[num]).forEach(function(key) {\r\n if (key.toLowerCase().includes(searchContent.toLowerCase())) {\r\n results[key]=itemvarsetidenum[num][key];\r\n }\r\n });\r\n });\r\n\r\n hideAllBoxes();\r\n activeSet = 1;\r\n generateBox(\"Back\", null, 0, 1, \"<div class='subtext'>Click to return to categories</div>\");\r\n Object.keys(results).forEach(function(key) {\r\n if (Object.keys(results).indexOf(key) + 2 > 20) {return};\r\n generateBox(key, results, 0, Object.keys(results).indexOf(key) + 2,\r\n \"<div class='subtext shortcut'>\" + results[key] + \"</div>\")\r\n });\r\n}", "function _dex_getCategories(){ // Step 1 of 2 – Gets top-level categories\n var t=new Date().getTime(),out={},ar=LibraryjsUtil.getHtmlData(\"http://www.dexknows.com/browse-directory\",/\\\"http:\\/\\/www\\.dexknows\\.com\\/local\\/(\\w+\\/\\\">.+)<\\/a>/gm)//return ar;\n ,i=ar.length;while(i--){ar[i]=ar[i].split('/\">');ar[i][1]=ar[i][1].replace(/&amp;/g,\"&\");out[ar[i][0]]={\"displayName\":ar[i][1]}}\n LibraryjsUtil.write2fb(\"torrid-heat-2303\",\"dex/categories/\",\"put\",out)}//function test(){/*print2doc*/Logger.log(_dex_getCategories())}", "setupCategorySearch() {\n if (this.typeahead) this.typeahead.destroy();\n\n $('#category-input').typeahead({\n ajax: {\n url: 'https://commons.wikimedia.org/w/api.php',\n timeout: 200,\n triggerLength: 1,\n method: 'get',\n preDispatch: query => {\n return {\n action: 'query',\n list: 'prefixsearch',\n format: 'json',\n pssearch: query,\n psnamespace: 14\n };\n },\n preProcess: data => {\n const results = data.query.prefixsearch.map(elem => elem.title.replace(/^Category:/, ''));\n return results;\n }\n }\n });\n }", "function determineCategory(data) {\n if(category.value === 'astronaut') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addAstronautToDOM(data);\n } else showNoResults();\n } else if(category.value === 'launch') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addLaunchToDOM(data);\n } else showNoResults();\n } else if(category.value === 'expedition') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addExpeditionToDOM(data);\n } else showNoResults();\n } else if(category.value === 'spacecraft') {\n if(data.results.length !== 0) {\n searchWindow.classList.remove('show');\n addSpacecraftToDOM(data);\n } else showNoResults();\n }\n}", "function catOnlySearchQuery(val) {\n var peopleOps = \"human+resources+OR+hr+OR+people+OR+operations+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+ops+OR+ organization+OR+organizational\";\n var peopleAnalytics = \"people+OR+analytics+OR+talent+OR+human+OR+insights+OR+organization+OR+organizational\";\n var divInclu = \"diversity inclusion organization organizational\";\n var talent = \"talent sourcer+OR+recruiter\";\n var hrExec = \"talent+OR+operations+OR+CPO+OR+human+OR+resources+OR+HR+OR+CHRO+OR+culture+OR+D&I+OR+diversity+OR+inclusion+OR+head+OR+Chief+OR+director+OR+VP+OR+officer\";\n var allCat = \"diversity+OR+inclusion+OR+head+OR+talent+OR+people+OR+operations+OR+chief+OR+cpo+OR+human+OR+resources+OR+director+OR+acquisition+OR+hr+OR+vp+OR+chro+OR+officer+OR+culture+OR+d&i+OR+diversity+OR+inclusion+OR+employee+OR+partner+OR+development+OR+relations+OR+talent+OR+management+OR+hr+OR+ops+OR+analytics+OR+recruiting+OR+insights+OR+talent+OR+acquisition+OR+sourcer+OR+recruiter+OR+recruiting\";\n switch (val) {\n case \"10\":\n return peopleAnalytics;\n break;\n case \"11\":\n return peopleOps;\n break;\n case \"12\":\n return divInclu;\n break;\n case \"13\":\n return talent;\n break;\n case \"14\":\n return hrExec;\n break;\n case \"15\":\n return allCat;\n break;\n }\n}", "function disneyCategories(){\n //fetch get index for attractions\n \n byCategory()\n}", "function hotcat_find_category (wikitext, category)\n{\n var cat_name = category.replace(/([\\\\\\^\\$\\.\\?\\*\\+\\(\\)])/g, \"\\\\$1\");\n var initial = cat_name.substr (0, 1);\n var cat_regex = new RegExp (\"\\\\[\\\\[\\\\s*[Kk]ategoria\\\\s*:\\\\s*\"\n + (initial == \"\\\\\"\n ? initial\n : \"[\" + initial.toUpperCase() + initial.toLowerCase() + \"]\")\n + cat_name.substring (1).replace (/[ _]/g, \"[ _]\")\n + \"\\\\s*(\\\\|.*?)?\\\\]\\\\]\", \"g\"\n );\n var result = new Array ();\n var curr_match = null;\n while ((curr_match = cat_regex.exec (wikitext)) != null) {\n result [result.length] = {match : curr_match};\n }\n return result; // An array containing all matches, with positions, in result[i].match\n}", "function get_cat(e){\"forum\"==e||\"fjb\"==e?($(\".select-category\").addClass(\"show\"),$.ajax({url:\"/misc/get_categories_search/\"+e,success:function(e){var t=location.href.match(/forumchoice(\\[\\])*=([^&]+)/),s=\"\";t&&(s=t[2]);var a=\"\";for(var o in e)s==e[o].forum_id?(a=\"selected\",$(\"#search_category\").parent().find(\".customSelectInner\").text(e[o].name)):a=\"\",$(\"#search_category\").append('<option data-child-list=\"'+e[o].child_list+'\" value=\"'+e[o].forum_id+'\" '+a+\">\"+e[o].name+\"</option>\")}})):$(\".select-category\").removeClass(\"show\")}", "function searchProductCategory() {\n\n productCategoryService.searchProductCategory($scope.productCategorySearch, $scope.pageLimit, $scope.currentPage)\n .then(function success(response) {\n\n $scope.categoryLists = response.data.data;\n $scope.totalItems = response.data.dataCount;\n $scope.catCount = response.data.dataCount;\n\n }, function error(error) {\n toastr.error('ERROR!', 'Replacement has been Create failed.');\n });\n }", "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgorychoosen)\n }\n }", "function getCategories(word){\n\twhile(word.length > 0){\n\t\tif (RID[word]){\n\t\t\treturn RID[word];\n\t\t}\n\t\tif (RID[word+\"%\"]){\n\t\t\treturn RID[word+\"%\"];\n\t\t}\n\t\tword = word.substr(0,word.length-1);\n\t}\n\treturn null;\n}", "function _mod_search() {\n\t\"use strict\";\n\t// private section - following fields and functions are private and need to be accessed by methods provided in the public section\n\tvar _inputId;\n\tvar autoComplete = {};\n\n\tautoComplete.suggestion = {};\n\tautoComplete.suggestion.tags = [];\n\tautoComplete.suggestion.id = [];\n\tautoComplete.dictionaryTags = [];\n\n\t/****\n\t * create a completely new tag\n\t * @param id of the corresponding html list element\n\t * @param tag to be linked to the id\n\t * @return {Object}\n\t */\n\tfunction newIdTagPair(id, tag) {\n\t\tvar liElem = {};\n\t\tliElem.id = id;\n\t\tliElem.tags = [];\n\t\tliElem.tags.push(tag);\n\t\treturn liElem;\n\t}\n\n\t/****\n\t * filters a list while typing text into an input field and hides all\n\t * list items that don't match to the search string.\n\t * @param searchStr string that is currently in the search field (others would be possible to, but mostly senseless)\n\t * @param listRootId list to be filterd\n\t */\n\tfunction searchFilter(searchStr, listRootId) {\n\t\tvar match;\n\t\tvar searchIndex;\n\t\tvar i, j;\n\t\tvar nodeJQ;\n\t\tvar visibleNodes = [];\n\n\t\t// show all\n\t\tif (!searchStr || searchStr === \"\") {\n\t\t\tjQuery(\"#\" + listRootId).find(\"li\").andSelf().show();\n\t\t}\n\n\t\tsearchStr = searchStr.toLowerCase();\n\n\n\t\t// hide all nodes while traversing\n\t\t// not to nice implemented ;)\n\t\tfor (i = autoComplete.dictionaryTags.length - 1; i >= 0; i--) {\n\t\t\tnodeJQ = jQuery(\"#\" + autoComplete.dictionaryTags[i].id);\n\t\t\t//console.log(autoComplete.dictionaryTags[i].tags[0])\n\t\t\tmatch = null;\n\t\t\tfor (j = 0; j < autoComplete.dictionaryTags[i].tags.length; j++) {\n\t\t\t\tsearchIndex = autoComplete.dictionaryTags[i].tags[j].toLowerCase().match(searchStr);\n\t\t\t\tif (searchIndex) {\n\t\t\t\t\tmatch = nodeJQ;\n\t\t\t\t\t//select node in tree to highlight\n\t\t\t\t\tif (searchIndex === 0 && autoComplete.dictionaryTags[i].tags[j].length === searchStr.length) {\n\t\t\t\t\t\tMYAPP.tree.select_node(jQuery(\"#\" + autoComplete.dictionaryTags[i].id));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodeJQ.hide();\n\n\t\t\tif (match) {\n\t\t\t\tvisibleNodes.push(match);\n\t\t\t}\n\t\t}\n\n\t\t// show matching nodes and all their parents\n\t\t// !!! todo: the method parents gos up to the html root but it should stop at the top of the list\n\t\tfor (i = visibleNodes.length - 1; i >= 0; i--) {\n\t\t\tvisibleNodes[i].parents(\"#treeList li\").andSelf().show();\n\t\t}\n\t}\n\n\t// private section END\n\n\n\t// public section\n\t// all methods that give access to the private fields and allow to process the menu\n\treturn {\n\t\t/****\n\t\t * @param treeRootId\n\t\t * id of the root of the list that should be filtered\n\t\t * @param inputId\n\t\t * id of the input field in witch should get the autocompleate function\n\t\t * @param dictionaryTags\n\t\t * an array that looks as followed:\n\t\t * [ { id: ... , tags: [..., ...]}, { id: ... , tags: [..., ...]} ]\n\t\t * the id is the id of the li element that should be processed,\n\t\t * the tag is an array with corresponding strings (if the search string matches\n\t\t * any of the tag string or tag substring in any position the li element is displayed.\n\t\t * if there is no match at all the li element will be hidden.\n\t\t *\n\t\t */\n\t\tinitSearch : function (treeRootId, inputId, dictionaryTags) {\n\t\t\tvar i, j;\n\n\t\t\tdictionaryTags = dictionaryTags || [];\n\t\t\t_inputId = inputId;\n\t\t\tautoComplete.dictionaryTags = dictionaryTags;\n\n\t\t\tfor (i = 0; i < dictionaryTags.length; i++) {\n\t\t\t\tfor (j = 0; j < dictionaryTags[i].tags.length; j++) {\n\t\t\t\t\tautoComplete.suggestion.tags.push(dictionaryTags[i].tags[j]);\n\t\t\t\t\tautoComplete.suggestion.id.push(dictionaryTags[i].id);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tjQuery(\"#\" + inputId).autocomplete({\n\t\t\t\tsource : autoComplete.suggestion.tags,\n\t\t\t\tselect : function (event, ui) {\n\t\t\t\t\tif (ui.item) {\n\t\t\t\t\t\tvar i = jQuery.inArray(ui.item.value, autoComplete.suggestion.tags);\n\t\t\t\t\t\tvar node = jQuery(\"#\" + autoComplete.suggestion.id[i]);\n\t\t\t\t\t\tMYAPP.tree.select_node(node);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\talert(\"Dieses Element ist im Objekt nicht enthalten.\");\n\t\t\t\t\t}\n\t\t\t\t\t//alert(ui.item ? ui.item.value: \"Nothing selected, input was \" + this.value );\n\t\t\t\t}\n\t\t\t});\n\n\t\t\tjQuery(\"#\" + inputId).keyup(function () {\n\t\t\t\t//alert(\"\")\n\t\t\t\tsearchFilter(jQuery(\"#\" + inputId).val(), treeRootId);\n\t\t\t});\n\t\t\t// filter when x is pressed\n\t\t\tjQuery(\"#\" + inputId).parent().children(\".ui-input-clear\").mouseup(function () {\n\t\t\t\tsearchFilter(\"\", treeRootId);\n\t\t\t});\n\n\t\t},\n\t\t/****\n\t\t * push a new tag to the data set that is used to filter the html list\n\t\t * and to the data set that is the base for the autoComplete suggestions\n\t\t * @param id of the corresponding list element\n\t\t * @param tag that is being linked to the tag\n\t\t */\n\t\tpushTag : function (id, tag) {\n\t\t\tvar i;\n\t\t\tvar index = -1;\n\n\t\t\t//console.log(\" id \" + id + \" tag \" + tag + \" _inputId \" + _inputId)\n\t\t\tif (typeof id !== \"string\" || typeof tag !== \"string\") {\n\t\t\t\tconsole.error(\"data to push are not valid (mod_search->method pushTag(id, tag)\");\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfor (i = 0; i < autoComplete.dictionaryTags.length; i++) {\n\t\t\t\tif (autoComplete.dictionaryTags[i].id.match(id)) {\n\t\t\t\t\tindex = i;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (-1 < index) { // element with the submitted id already exists\n\t\t\t\tautoComplete.dictionaryTags[index].tags.push(tag);\n\t\t\t\t/*\n\t\t\t\t console.log(\n\t\t\t\t autoComplete.dictionaryTags[index].id[0] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].tags[0] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].id[1] + \" --- \" +\n\t\t\t\t autoComplete.dictionaryTags[index].tags[1]\n\t\t\t\t )\n\t\t\t\t */\n\t\t\t}\n\t\t\telse { // create new entry\n\t\t\t\tautoComplete.dictionaryTags.push(newIdTagPair(id, tag));\n\t\t\t\t//console.log(newIdTagPair(id, tag).id + \" --- \" + autoComplete.dictionaryTags[testI].id + \" --- \" + autoComplete.dictionaryTags[testI].tags[0] )\n\t\t\t}\n\n\t\t\tautoComplete.suggestion.tags.push(tag);\n\t\t\tautoComplete.suggestion.id.push(id);\n\n\t\t\t//console.log( autoComplete.suggestion.id[testI] + \" --- \" + autoComplete.suggestion.tags[testI] ) ;\n\t\t\t//console.log( id + \" --- \" + tag ) ;\n\n\t\t\tjQuery(\"#\" + _inputId).autocomplete('option', 'source', autoComplete.suggestion.tags);\n\t\t}\n\t};\n\t// public section END (return end)\n}", "function filterCategories(value) {\n for (i = 0; i < categoryArray.length; i++) {\n if (categoryArray[i].text.toLowerCase().includes(value.toLowerCase())) {\n $(\"#\" + categoryArray[i].value).attr(\"tabindex\", \"-1\");\n $(\"#\" + categoryArray[i].value).attr(\"role\", \"menuitem\");\n $(\"#\" + categoryArray[i].value).addClass(\"dropdown-item\");\n $(\"#\" + categoryArray[i].value).show();\n }\n else {\n $(\"#\" + categoryArray[i].value).removeAttr(\"tabindex\");\n $(\"#\" + categoryArray[i].value).removeAttr(\"role\");\n $(\"#\" + categoryArray[i].value).removeClass(\"dropdown-item\");\n $(\"#\" + categoryArray[i].value).hide();\n }\n }\n}", "function ListCategories () \n{\n\tMakeXMLHTTPCallListCategories(\"GET\", \"http://uvm061.dei.isep.ipp.pt/ARQSI/Widget/WidgetAPI/EditorAPI.php?type=GetAllCategories\");\n}", "function hotcat_find_ins ( wikitext )\n{\n var re = /\\[\\[(?:Kategoria):[^\\]]+\\]\\]/ig\n var index = -1;\n while( re.exec(wikitext) != null ) index = re.lastIndex;\n \n if( index > -1) return index;\n //we should try to find interwiki links here, but that's for later.\n \n return -1;\n}", "function getCategories() {\n\trimer.category.find(function(error, value) {\n\t\tif(error) {\n\t\t\tconsole.log(error)\n\t\t}\n\t\telse {\n\t\t\tconsole.log(value)\n\t\t}\n\t})\n}", "function searchcategory_mapping_with_menus(search_category) {\n switch (search_category) {\n case 'LSH1':\n var tobe_active_menu = 'LuxuryNavBarComponent';\n return tobe_active_menu;\n break;\n case 'ISH1':\n var tobe_active_menu = 'INDILUXNavBarComponent';\n return tobe_active_menu;\n break;\n case 'LBSH1':\n var tobe_active_menu = 'LUXBOXNavBarComponent';\n return tobe_active_menu;\n break;\n default:\n var tobe_active_menu = 'LuxuryNavBarComponent';\n return tobe_active_menu;\n }\n }", "function findSuggestions(category, storedData, suggestions) {\n storedData.forEach(function (b) {\n if (b.category == category)\n suggestions.push(b);\n });\n}", "function getCatCategory() {\n\tvar categories = \"\";\n\tvar listValues = getCategoryValues([\"catVinRouge\", \"catVinBlanc\", \"catVinGrappa\", \"catVinMousseuxRose\", \"catVinPineau\", \"catVinAromatise\"]);\n\tif (listValues != \"\")\n\t\tcategories = \"(@tpcategorie==(\" + listValues + \"))\";\n\t\n\treturn categories;\n}", "getCategories() {\n return ['Snacks', 'MainDishes', 'Desserts', 'SideDishes', 'Smoothies', 'Pickles', 'Dhal', 'General']\n }", "function addCategoryNames(){\n\tAUTHORIZATION_CODE = JSON.parse(sessionStorage.access);\n\tvar categories = getSpotifyCategory(getCategoryID);\n}", "function searchKey(inpVal) {\r\n document.querySelector(\".cat-list\").remove();\r\n fetch(`https://cataas.com/api/cats?tags=${inpVal}`, {\r\n method: \"GET\"\r\n })\r\n .then((data) => {\r\n return data.json();\r\n })\r\n .then((cats) => loadCats(cats));\r\n}", "function getKeywords() {\n \n for (let selection of selections) {\n for (let category of aliasData['categories']) {\n if (category.keyword.toLowerCase() == selection) {\n keywordAliases.push(...category.aliases)\n }\n }\n }\n\n\t\tdisplayFilters();\n\t}", "function opensearch(){\n\tsummer.openWin({\n\t\tid : \"search\",\n\t\turl : \"comps/summer-component-contacts/www/html/search.html\"\n\t});\n}", "function categoryCheck (word) {\n switch (word) {\n case \"anniversary\":\n return \"anniversary\"\n break;\n case \"birthday\":\n return \"birthday\"\n break; \n case \"congratulations\":\n return \"congratulations\"\n break; \n case \"well\":\n return \"getWell\"\n break;\n case \"getwell\":\n return \"getWell\"\n break;\n case \"housewarming\":\n return \"housewarming\"\n break; \n case \"warming\":\n return \"housewarming\"\n break; \n case \"sorry\":\n return \"sorry\"\n break; \n case \"patrick\":\n return \"stPatricksDay\"\n break; \n case \"patrick\\'s\":\n return \"stPatricksDay\"\n break; \n case \"because\":\n return \"justBecause\"\n break;\n case \"just\":\n return \"justBecause\"\n break;\n case \"justBecause\":\n return \"justBecause\"\n break;\n case \"baby\":\n return \"newBaby\"\n break;\n case \"newBaby\":\n return \"newBaby\"\n break;\n case \"newborn\":\n return \"newBaby\"\n break; \n case \"romance\":\n return \"loveRomance\"\n break;\n case \"retirement\":\n return \"retirement\"\n break; \n case \"retire\":\n return \"retirement\"\n break; \n case \"funeral\":\n return \"sympathy\"\n break; \n case \"sympathy\":\n return \"sympathy\"\n break; \n case \"thank\":\n return \"thankYou\"\n break; \n case \"thankYou\":\n return \"thankYou\"\n break; \n case \"year\":\n return \"newYear\"\n break;\n case \"valentine\":\n return \"valentinesDay\"\n break;\n case \"valentine\\'s\":\n return \"valentinesDay\"\n break;\n case \"valentines\":\n return \"valentinesDay\"\n break;\n case \"easter\":\n return \"easter\"\n break; \n case \"mother\\'s\":\n return \"mothersDay\"\n break;\n case \"mothers\":\n return \"mothersDay\"\n break;\n case \"mother\":\n return \"mothersDay\"\n break;\n case \"memorial\":\n return \"memorialDay\"\n break; \n case \"fathers\":\n return \"fathersDay\"\n break;\n case \"father\\'s\":\n return \"fathersDay\"\n break;\n case \"father\":\n return \"fathersDay\"\n break; \n case \"july\":\n return \"july4th\"\n break; \n case \"4th\":\n return \"july4th\"\n break; \n case \"fourth\":\n return \"july4th\"\n break; \n case \"labor\":\n return \"laborDay\"\n break;\n case \"laborDay\":\n return \"laborDay\"\n break;\n case \"halloween\":\n return \"halloween\"\n break; \n case \"veteran\":\n return \"veteransDay\"\n break;\n case \"veterans\":\n return \"veteransDay\"\n break;\n case \"veteransDay\":\n return \"veteransDay\"\n break;\n case \"veteran\\'s\":\n return \"veteransDay\"\n break;\n case \"thanksgiving\":\n return \"thanksgiving\"\n break; \n case \"hanukkah\":\n return \"hanukkah\"\n break; \n case \"christmas\":\n return \"christmas\"\n break;\n }\n}", "function Search() {\r\n\tGlobal.dom.forEach(function(item) {\r\n\t\titem.className = item.className.replace(\"search-result\", \"\");\r\n\t});\r\n\tvar keyword_value = Global.keyword.value;\r\n\tif (keyword_value == \"\") return;\r\n\tGlobal.dom.forEach(function(item, index) {\r\n\t\tvar dom_content = item.innerText;\r\n\t\tconsole.log(dom_content);\r\n\t\tif (dom_content.indexOf(keyword_value) != -1) {\r\n\t\t\titem.className += \" search-result\";\r\n\t\t\tconsole.log(\"in\");\r\n\t\t}\r\n\t});\r\n}", "static getCategoryFromCommonName (inCommonName) {\n for (let index = 0; index < gEBirdAll.data.length; index++) {\n if (gEBirdAll.data[index]['PRIMARY_COM_NAME'] === inCommonName) {\n return gEBirdAll.data[index]['CATEGORY']\n }\n }\n\n return 'Unknown'\n }", "function search(text) {\n text = text.toLowerCase();\n var container = $(\"#catalog\");\n // clear everything\n $(container).html('');\n\n // paint only items that fullfil the filter\n for (var i = 0; i < DB.length; i++) {\n var item = DB[i];\n\n // decide if the items fullfils the filter\n // if so, display it\n if (\n item.title.toLowerCase().indexOf(text) >= 0 // if title contains the text\n || // or\n item.code.toLowerCase().indexOf(text) >= 0 // if the code contains the text\n ) {\n displayItem(item);\n }\n\n }\n}", "static get tag(){return\"site-search\"}", "function searchKeywords() {\n if(searchString.toLowerCase().includes('unit')) {\n if(searchString.toLowerCase().includes('1')) {\n searchBox.value = 'Javascript DOM JQuery CSS function html flexbox arrays';\n } if(searchString.toLowerCase().includes('2')) {\n searchBox.value = 'middleware node express authorization authentication psql ejs fetch api cookies';\n } if(searchString.toLowerCase().includes('3')) {\n searchBox.value = 'react authorization authentication psql git fetch tokens'\n } if(searchString.toLowerCase().includes('4')) {\n searchBox.value = 'ruby rails psql'\n }\n }\n}", "function tech() { categoryChoice = TECHNOLOGY;\n getNews()\n}", "function getCategory(c){\n return getCategoryObject(c.definition); \n}", "function getCategory()\n{\n\tvar category = new Array([111,'server'], [222,'switcher'], [333,'storage'], [444,'workstation']);\n\treturn category;\n}", "function getCategory(catName, searchTerm, searchExclude) {\n\tfunction getCategoryNode(name, subcategories, parent) {\n\t\tif (selectedCategory = categories[0][name]) {\n\t\t\treturn topCategory = homeCategory = selectedCategory;\n\t\t}\n\t\ttopCategory = undefined;\n\n\t\tstack.push(parent);\n\t\tvar category,\n\t\t\tl = subcategories.length;\n\t\twhile (l--) {\n\t\t\tcategory = subcategories[l];\n\t\t\tif (category.name === name || category.categories && (category = getCategoryNode(name, category.categories, category))) {\n\t\t\t\twhile (parent = stack.pop()) {\n\t\t\t\t\ttopCategory = parent;\n\t\t\t\t\tif (!parent.expanded) {\n\t\t\t\t\t\t$.observable(parent).setProperty(\"expanded\", true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn category;\n\t\t\t}\n\t\t}\n\t\tstack.pop();\n\t}\n\tvar topCat, // specific to this getScript call\n\t\tstack = [],\n\t\tcategories = content.categories,\n\t\toldTopCategory = topCategoryName,\n\t\tloadedPromise = $.Deferred();\n\n\tselectedCategory = catName && getCategoryNode(catName, categories) || categories[0].jsrender;\n\ttopCategory = topCategory || selectedCategory;\n\tif (searchTerm && !catName) {\n\t\ttopCategory = searchCategory;\n\t\tif (page) {\n\t\t\tpage.category = undefined;\n\t\t}\n\t}\n\n\ttopCategoryName = topCategory.name;\n\n\tif (topCategoryName !== oldTopCategory) {\n\t\tif (oldTopCategory) {\n\t\t\t$(\"#id-\" + oldTopCategory)\n\t\t\t\t.removeClass(\"selected\")\n\t\t\t\t.addClass(\"unselected\");\n\t\t}\n\t\t$(\"#id-\" + topCategoryName)\n\t\t\t.removeClass(\"unselected\")\n\t\t\t.addClass(\"selected\");\n\t}\n\n\tif (content.topCategory !== topCategory) {\n\t\tcontent.catName = catName; // Don't change this observably, to avoid triggering an additional UI update before topCategory has been set.\n\t\t$.observable(content).setProperty(\"topCategory\", topCategory);\n\t}\n\n\tif (searchTerm) {\n\t\tif (content.searched !== searchTerm || content.searchExclude !== searchExclude) {\n\t\t\tloadAllContent()\n\t\t\t\t.then(function() {\n\t\t\t\t\tloadAllContent(\"find\")\n\t\t\t\t\t\t.then(function() {\n\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\tsearchContent(searchTerm);\n\t\t\t\t\t\t\t\t$.observable(content).setProperty(\"searched\", searchTerm);\n\t\t\t\t\t\t\t\tcontent.searchExclude = searchExclude;\n\t\t\t\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t} else {\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t} else {\n\t\tif (!topCategory.loaded && !topCategory.loading) {\n\t\t\ttopCategory.loading = \" \"; // true, but render blank until after timeout\n\t\t\ttopCat = topCategory; // Specific to this getCategory() call. (Global topCategory var may change before then() returns)\n\n\t\t\t$.getScript(\"documentation/contents-\" + topCategory.name + \".js\")\n\t\t\t\t.then(function() {\n\t\t\t\t\t$.observable(topCat).setProperty(\"loaded\", true);\n\t\t\t\t\tloadedPromise.resolve();\n\t\t\t\t});\n\t\t} else if (topCategory.loaded) {\n\t\t\tif (content.searched) {\n\t\t\t\tsetTimeout(function() {\n\t\t\t\t\tclearSearch(); // lazy clear search annotations from content\n\t\t\t\t\t$.observable(content).setProperty({\n\t\t\t\t\t\tsearch: undefined,\n\t\t\t\t\t\tfilterlen: 0\n\t\t\t\t\t});\n\t\t\t\t\tcontent.searched = undefined;\n\t\t\t\t});\n\t\t\t}\n\t\t\tloadedPromise.resolve();\n\t\t}\n\t}\n\treturn loadedPromise.promise();\n}", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "function getCategories(searchTerm) {\n searchTerm = encodeURIComponent(searchTerm);\n const requestOptions = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json' },\n };\n return fetch(`${TRIPPLANNERAPI}/search/categories/${searchTerm}`, requestOptions)\n .then(handleResponse)\n}", "function Category() {\n}", "function checkIfKeywordIsACategory(keyword){\n if(keyword.includes(\"node\")||keyword.includes(\"propert\")||keyword.includes(\"relationship\")||keyword.includes(\"schema\"))\n return true;\n else false;\n}", "function createGlobalCategories() {\n return [\n\t//ROOT CATEGORY:\n\tconstants.ROOT_CATEGORY,\n\t\n\t//TOP-LEVEL CATEGORIES:\n\t//(they should have root as their only parent)\n\tnew Category([categories.ROOT], categories.RAW),\n\t//new Category([categories.ROOT], categories.FOOD),\n\t\n\t//SUB-CATEGORIES:\n\tnew Category([categories.RAW], categories.FOOD),\n\tnew Category([categories.RAW], categories.CONSUMABLE),\n\t\n ];\n}", "function getCatalogs(){\n\n}", "categoryClick(category) {\n const helper = algoliasearchHelper(client, indexName, {\n hitsPerPage: 1000,\n facets: [\"food_type\"]\n });\n\n helper.on(\"result\", content => {\n this.setState({\n searchResults: content.hits,\n currentResults: content.hits.slice(0, 5),\n count: content.nbHits,\n searchTime: content.processingTimeMS,\n currentCategory: category,\n currentPayment: null\n });\n });\n\n if (!this.state.geoLocation) {\n helper\n .setQueryParameter(`aroundLatLngViaIP`, true)\n .addFacetRefinement(\"food_type\", category)\n .search();\n } else {\n const { lat, lng } = this.state.geoLocation;\n helper\n .setQueryParameter(`aroundLatLng`, `${lat}, ${lng}`)\n .addFacetRefinement(\"food_type\", category)\n .search();\n }\n }", "function getCategories() {\n\tvar categories = getCatDisponibility() + \" \" + getCatCategory() + \" \" + getCatCountries();\n\t\n\treturn categories;\n}", "setupCategoryInterface() {\n this.resetSelect2(false); // Destroy and don't reinitialize.\n $('.num-entities-info').hide();\n $('.file-selector').hide();\n $('.category-selector').show();\n $('#category-input').val('').focus();\n this.setupCategorySearch();\n }", "filterTopCategories() {\n const result = [];\n if (!this.searchResults) return;\n this.topCategories = [];\n const sr = this.searchResults;\n sr.forEach((item) => {\n if (item.categoryPath) {\n const cats = item.categoryPath.split('/');\n const exactNode = cats[cats.length - 1];\n if (!result.some(e => e.name === exactNode) && result.length < 3) {\n result.push(new TopCategory(exactNode));\n }\n }\n });\n this.topCategories = result;\n }", "function categorise(string, categories)\n{\n\tvar categoryList = []\n\n\t// initialise output list with input list (if there is one)\n\tif ( categories.length > 0 )\n\t{\n\t\tcategoryList.push.apply(categoryList, JSON.parse(\"[\" + categories.replace(/[^0-9,]/gi, '') + \"]\"))\n\t\tAgent.log(\"categoryList=\" + JSON.stringify(categoryList) )\n\t}\n\n\t// if there's anything to do...\n\tif ( string.trim().length > 0 )\n\t{\n\t\t// get list of all categories in system\n\t\tvar allCategories = JSON.parse(Agent.credential('wpsg_categories'))\n\t\t//Agent.log(\"allCategories=\" + JSON.stringify(allCategories))\n\n\t\t// identify categories that appear in the string\n\t \tfor (var i = 0; i < allCategories.length; i++) \n\t\t{\n\t\t\t//Agent.log(\"allCategories[i]['name'].trim().toUpperCase()=\" + allCategories[i]['name'].trim().toUpperCase() )\n\t\t\t// remove 'uncategorized' category\n\t\t\tif ( allCategories[i]['name'].trim().toUpperCase() == 'UNCATEGORIZED' )\n\t\t\t{\n\t\t\t\t//Agent.log(\"allCategories[i]['name'].trim().toUpperCase()=\" + allCategories[i]['name'].trim().toUpperCase() )\n\t\t\t\tvar uncategorizedIdIndex = categoryList.indexOf(allCategories[i]['id']);\n\t\t\t\t// Agent.log(\"uncategorizedIdIndex=\" + uncategorizedIdIndex )\n\t\t\t\tif ( uncategorizedIdIndex >= 0 && categoryList.length > 1)\n\t\t\t\t{\n\t\t\t\t\tcategoryList.splice(uncategorizedIdIndex, 1);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tvar categoryName = \"\\\\b\" + allCategories[i]['name'].trim().replace(/&amp;/gi, 'and').replace(/\\s+/g, '\\\\s+') + \"\\\\b\"\n\t\t\t\t\n\t\t\t\tvar regex = new RegExp( categoryName ,\"ig\");\n\n\t\t\t\tif (string.search(regex) >= 0 ) \n\t\t\t\t{\n\t\t\t\t\tcategoryList.push(allCategories[i]['id'])\n\t\t \t\t}\n\t\t\t}\n\t\t}\n\n\t\t// unique list \n\t\toutputCategoryList = JSON.stringify(sortUnique(categoryList)).replace(/[\\[\\]]/g, '')\n\t}\n\n\t//Agent.log(\"outputCategoryList=\" + outputCategoryList)\n\treturn outputCategoryList\n}", "function searchTerm(){\n \n }", "function categories() {\n // assign categories object to a variable\n var categories = memory.categories;\n // loop through categories\n for (category in categories) {\n // call categories render method\n memory.categories[category].render();\n //console.log(memory);\n }\n }", "function findCategory(){\n return _.find(categories, function(c){\n return c.name == categoryName;\n });\n }", "function search() {\n\t\n}", "function addCategory(category) {\n// var db = ScriptDb.getMyDb(); \n var db = ParseDb.getMyDb(applicationId, restApiKey, \"list\");\n \n if (category == null) {\n return 0; \n }\n \n // if (db.query({type: \"list#categories\"}).getSize() == 0) {\n \n if (PropertiesService.getScriptProperties().getProperty(\"categories\") == null) {\n var id = db.save({type: \"categories\", list: [category]}).getId(); \n PropertiesService.getScriptProperties().setProperty(\"categories\", id);\n return 1;\n }\n var categories = db.load(PropertiesService.getScriptProperties().getProperty(\"categories\"));\n for (var i = 0 ; i<categories.list.length ; i++) {\n if (categories.list[i] == category) {\n return 0;\n }\n }\n categories.list.push(category);\n categories.list = categories.list.sort();\n db.save(categories);\n return 1;\n}", "function processSearchResults(searchResults) {\n for (var i = 0; i < searchResults.length; i++) {\n \tvar doc = searchResults[i];\n makeSimpleCategoryValue(doc);\n }\n\treturn searchResults;\n}", "findCategory(name) {\n return this.categories.find(category => {\n return category.id.toLowerCase() === name.toLowerCase();\n });\n }", "function search(current){\n\n}", "function _get_category(resource_text) {\n\n\t\t\tfor (var key_cat in browser_conf_json.categories) {\n\t\t\t\tif (browser_conf_json.categories.hasOwnProperty(key_cat)) {\n\t\t\t\t\tvar re = new RegExp(browser_conf_json.categories[key_cat][\"rule\"]);\n\t\t\t\t\tif (resource_text.match(re)) {return key_cat;}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn -1;\n\t\t}", "function doGeneralImageSearch() {\n\n}", "function compileCategories(myStyleCategories) {\n\t\tfor (var i = 0; i < myStyleCategories.length; ++i) {\n\t\t\tsource = $('#styleCategoryTemplate').html();\n\t\t\ttemplate = Handlebars.compile(source);\n\t\t\tvar categories = template(myStyleCategories[i]);\n\t\t\t$('#searchStyleCategory').append(categories);\n\t\t}\n\t}", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function displayCats() {\r\n if (\r\n searchValue.toLowerCase() === 'cat' ||\r\n searchValue.toLowerCase() === 'cats'\r\n ) {\r\n alert('I must say, you have amazing taste 🌟😻🌟');\r\n }\r\n}", "get categoryMapping() {\n let categoryMapping = {};\n this.domain.forEach(d => {\n this.currentCategories.forEach(f => {\n if (f.categories.includes(d.toString())) {\n categoryMapping[d] = f.name;\n }\n });\n });\n return categoryMapping;\n }", "async indexAction () {\n if (this.isPost) {\n return this.fail()\n }\n // 获取分类\n const data = await this.getTermsByTaxonomy('category')\n // this.success(data)\n return this.success({\n found: data.length,\n categories: data\n })\n }", "function searchFilter(searchStr, listRootId) {\n\t\tvar match;\n\t\tvar searchIndex;\n\t\tvar i, j;\n\t\tvar nodeJQ;\n\t\tvar visibleNodes = [];\n\n\t\t// show all\n\t\tif (!searchStr || searchStr === \"\") {\n\t\t\tjQuery(\"#\" + listRootId).find(\"li\").andSelf().show();\n\t\t}\n\n\t\tsearchStr = searchStr.toLowerCase();\n\n\n\t\t// hide all nodes while traversing\n\t\t// not to nice implemented ;)\n\t\tfor (i = autoComplete.dictionaryTags.length - 1; i >= 0; i--) {\n\t\t\tnodeJQ = jQuery(\"#\" + autoComplete.dictionaryTags[i].id);\n\t\t\t//console.log(autoComplete.dictionaryTags[i].tags[0])\n\t\t\tmatch = null;\n\t\t\tfor (j = 0; j < autoComplete.dictionaryTags[i].tags.length; j++) {\n\t\t\t\tsearchIndex = autoComplete.dictionaryTags[i].tags[j].toLowerCase().match(searchStr);\n\t\t\t\tif (searchIndex) {\n\t\t\t\t\tmatch = nodeJQ;\n\t\t\t\t\t//select node in tree to highlight\n\t\t\t\t\tif (searchIndex === 0 && autoComplete.dictionaryTags[i].tags[j].length === searchStr.length) {\n\t\t\t\t\t\tMYAPP.tree.select_node(jQuery(\"#\" + autoComplete.dictionaryTags[i].id));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tnodeJQ.hide();\n\n\t\t\tif (match) {\n\t\t\t\tvisibleNodes.push(match);\n\t\t\t}\n\t\t}\n\n\t\t// show matching nodes and all their parents\n\t\t// !!! todo: the method parents gos up to the html root but it should stop at the top of the list\n\t\tfor (i = visibleNodes.length - 1; i >= 0; i--) {\n\t\t\tvisibleNodes[i].parents(\"#treeList li\").andSelf().show();\n\t\t}\n\t}", "function findCategory(category) {\n return originals[category]\n}", "function compileCategories() {\n var url = \"https://www.eventbriteapi.com/v3/categories/?token=\" + TOKEN;\n var request = new XMLHttpRequest();\n \n // When the request is completed, map the categories to the hashmap\n request.onreadystatechange = function(data) {\n if (request.readyState == 4) {\n if (request.status == 200) {\n var data = request.responseText;\n var obj = $.parseJSON(data);\n \n $.each(obj.categories, function(i, item) {\n gCategories[item.id] = item.short_name;\n }); \n } else {\n console.log('Error', request.status)\n }\n }\n }\n \n // Perform a GET request to the API url\n request.open('GET', url, true);\n request.send(); \n}", "function fetch_categories(wiki){\n var cats=[]\n var reg=new RegExp(\"\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):(.{2,60}?)\\]\\](\\w{0,10})\", \"ig\")\n var tmp=wiki.match(reg)//regular links\n if(tmp){\n var reg2=new RegExp(\"^\\\\[\\\\[:?(\"+category_words.join(\"|\")+\"):\", \"ig\")\n tmp.forEach(function(c){\n c=c.replace(reg2, '')\n c=c.replace(/\\|?[ \\*]?\\]\\]$/i,'')\n if(c && !c.match(/[\\[\\]]/)){\n cats.push(c)\n }\n })\n }\n return cats\n }", "categ(state,data)\n {\n return state.category=data\n }", "async function pageCategories(pag) {\n var cats = await pag.categories(), z = [];\n for(var cat of cats) {\n var c = cat.replace('Category:', '');\n if(!CATEGORY_EXC.test(c)) z.push(c);\n }\n return z;\n}", "function suggest(keywords,key,object)\n{\n //alert(\"line 19=\"+object.id);\nvar results = document.getElementById(\"results\");\n \n if(keywords != \"\")\n {\n var terms = get_data(); // sort? -- data should be alphabetical for best results\n\n var ul = document.createElement(\"ul\");\n var li;\n var a;\n \n if ((key.keyCode == '40' || key.keyCode == '38' || key.keyCode == '13'))\n {\n navigate(key.keyCode,object);\n }\n else\n {\n var kIndex = -1;\n \n for(var i = 0; i < terms.length; i++)\n { \n kIndex = terms[i].activity.toLowerCase().indexOf(keywords.toLowerCase());\n \n if(kIndex >= 0) \n {\n li = document.createElement(\"li\");\n \n // setup the link to populate the search box\n a = document.createElement(\"a\");\n a.href = \"javascript://\"; \n \n a.setAttribute(\"rel\",terms[i].val);\n a.setAttribute(\"rev\", getRank(terms[i].activity.toLowerCase(), keywords.toLowerCase()));\n a.setAttribute(\"ref\",terms[i].val2);\n \n if(!document.all) a.setAttribute(\"onclick\",\"populate(this,object);\");\n else a.onclick = function() { populate(this,object); }\n \n \n \n a.appendChild(document.createTextNode(\"\"));\n \n if(keywords.length == 1) \n {\n var kws = terms[i].activity.toLowerCase().split(\" \");\n //alert(\"line 68=\"+kws+terms[i].val2);\n\n var firstWord = 0;\n \n for(var j = 0; j < kws.length; j++)\n {\n // if(kws[j].toLowerCase().charAt(0) == keywords.toLowerCase()) {\n \n ul.appendChild(li);\n \n if(j != 0) {\n kIndex = terms[i].activity.toLowerCase().indexOf(\" \" + keywords.toLowerCase());\n kIndex++;\n }\n \n break;\n // }\n }\n }\n else if(keywords.length > 1) {\n ul.appendChild(li);\n }\n else continue;\n\n \n var before = terms[i].activity.substring(0,kIndex);\n var after = terms[i].activity.substring(keywords.length + kIndex, terms[i].activity.length);\n \n a.innerHTML = before + \"<strong>\" + keywords.toLowerCase() + \"</strong>\" + after;\n \n li.appendChild(a);\n\n }\n } \n \n if(results.hasChildNodes()) results.removeChild(results.firstChild);\n \n // position the list of suggestions\n var s = document.getElementById(object.id);\n var xy = findPos(s);\n \n results.style.left = xy[0] + \"px\";\n results.style.top = xy[1] + s.offsetHeight + \"px\";\n results.style.width = s.offsetWidth + \"px\";\n \n // if there are some results, show them\n if(ul.hasChildNodes()) {\n results.appendChild(filterResults(ul));\n \n if(results.firstChild.childNodes.length == 1) results.firstChild.firstChild.getElementsByTagName(\"a\")[0].className = \"hover\";\n \n }\n\n }\n }\n else\n {\n if(results.hasChildNodes()) results.removeChild(results.firstChild);\n }\n}", "function WR_Shortcode_Product_Categories() {\n\t \tvar button = $( '.sc-cat-list[data-expand=\"true\"]' ).children( 'a' );\n\t \t$( '.sc-cat-list[data-expand=\"true\"] ul' ).hide();\n\n\t \tbutton.on( 'click', function() {\n\t \t\t$( this ).next().slideToggle();\n\t \t} );\n\t }", "function searchFunction(evt) {\n\tvar title = document.title;\n\tvar searchString = this.value;\n\tconsole.log(searchString);\n\tvar url = \"\";\n\tif(title === 'Home') {\n\t\turl = \"/636800/library/search.php?search_string=\" + searchString;\t\n\t\tproductGetRequest(url, 'products');\n\t}\n\telse {\n\t\tvar category_name = document.title;\n\t\turl = \"/636800/library/search.php?search_string=\" + searchString + \"&category_name=\" + category_name;\t\n\t\tproductGetRequest(url, 'products');\n\t}\n\t\n\t/*\n\tif(title == \"Home\" && search_string === \"\") {\n\t\turl = \"/636800/library/all_json.php\";\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\telse if(title === \"Home\") {\n\t\turl = \"/636800/library/search.php?search_string=\" + search_string;\n\t\tproductGetRequest(url, 'products');\n\t}\n\t*/\n\t/*\n\telse if(search_string === \"\") {\n\t\turl = \"/636800/library/category_json.php?category_name=\" + title;\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\telse {\n\t\turl = \"/636800/library/search_json_category.php?category_name=\" + title + \"&search_string=\" + search_string;\n\t\tjsonRequest(url, displayAllProducts, 'products');\n\t}\n\t*/\n\n}", "function SC(command, term) \n{\n switch (command) {\n\n case \"concert-this\":\n concertSearch(term);\n break;\n\n case \"spotify-this-song\":\n songSearch(term);\n break;\n \n case \"movie-this\":\n if (term === \"\" || term === null) {\n movieSearch();\n }\n else {\n movieSearch(term);\n }\n break;\n\n case \"do-what-it-says\":\n randomSearch();\n break;\n \n default:\n console.log(output); \n }\n}", "function doSearch() {\n\n //This full path is used for redirect users to seek search pages\n var NavToPath = \"DateRange=\";\n if (selectedValue(\"DateRange\"))\n NavToPath = NavToPath + selectedValue(\"DateRange\");\n else\n NavToPath = NavToPath + '31';\n\n if (selectedValue(\"catparentlocation\")) {\n var location = selectedValue(\"catparentlocation\").split('|');\n for (var i = 0; i < location.length; i++) {\n switch (location[i + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + location[i];\n break;\n case '13': NavToPath = NavToPath + \"&catstate=\" + location[i];\n break;\n case '12': NavToPath = NavToPath + \"&catnation=\" + location[i];\n break;\n }\n }\n }\n if (selectedValue(\"catchildlocation\") && selectedValue(\"catchildlocation\") != 0 && selectedValue(\"catchildlocation\") != 'Any Area') {\n if (selectedValue(\"catchildlocation\").indexOf(\"|\") > -1) {\n var areaSplit = selectedValue(\"catchildlocation\").split('|');\n for (var k = 0; k < areaSplit.length; k++) {\n switch (areaSplit[k + 1]) {\n case '1': NavToPath = NavToPath + \"&catlocation=\" + areaSplit[k];\n break;\n case '11': NavToPath = NavToPath + \"&catarea=\" + areaSplit[k];\n break;\n }\n }\n }\n else\n NavToPath = NavToPath + \"&catarea=\" + selectedValue(\"catchildlocation\");\n }\n if (selectedValue(\"catindustry\") && selectedValue(\"catindustry\") != 0)\n NavToPath = NavToPath + \"&catindustry=\" + selectedValue(\"catindustry\");\n if (selectedValue(\"catoccupation\") && selectedValue(\"catoccupation\") != 0 && selectedValue(\"catoccupation\") != 'Any Sub-Classification')\n NavToPath = NavToPath + \"&catoccupation=\" + selectedValue(\"catoccupation\");\n if (selectedValue(\"Keywords\"))\n NavToPath = NavToPath + \"&Keywords=\" + selectedValue(\"Keywords\");\n if (selectedValue(\"catworktype\") && selectedValue(\"catworktype\") != 0)\n NavToPath = NavToPath + \"&catworktype=\" + selectedValue(\"catworktype\");\n var navToLocation = mainSeekSiteAddress + \"/jobsearch/index.ascx?\" + NavToPath;\n\n //Adds advertiser id if it's selected from a drop down\n if (selectedValue(\"AdvertiserID\") && selectedValue(\"AdvertiserID\") != 0)\n navToLocation = navToLocation + \"&AdvertiserID=\" + selectedValue(\"AdvertiserID\");\n else\n navToLocation = navToLocation + '&' + Settings[\"Advertiser\"];\n\n if (typeof target == 'object') {\n if (document.getElementById(\"JSresults\")) {\n document.getElementById(\"JSresults\").src = navToLocation;\n }\n else {\n target.location.href = navToLocation;\n }\n }\n else {\n if (target == 'blank')\n window.open(navToLocation, 'Job_Search_Results');\n else if (target == '/alliances/gough-recruitment/index.htm')\n window.open(mainSeekSiteAddress + target + '?' + NavToPath, 'Job_Search_Results');\n else if (target == 'http://www.scotfordfennessy.com.au/search_jobs.php')\n window.location.href = target + '?' + NavToPath;\n }\n}", "displayCategories(){\n const categoriesList = cocktail.getCategories()\n .then(categories => {\n const catList = categories.categories.drinks;\n \n // append the first option without value\n const firstOption = document.createElement('option');\n firstOption.textContent = '-- Select --';\n firstOption.value = '';\n document.querySelector('#search').appendChild(firstOption);\n\n // append the other options\n catList.forEach(category => {\n const option = document.createElement('option');\n option.textContent = category.strCategory;\n option.value = category.strCategory.split(' ').join('_');\n document.querySelector('#search').appendChild(option);\n \n });\n\n })\n }", "function retrieveJSON(category, searchText){\n $.ajax({\n url:\"http://www.mattbowytz.com/simple_api.json?data=\" + category,\n type:\"GET\",\n dataType:\"json\"\n })\n .done(function(json){\n var substringMatches = [];\n json.data.programming.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n json.data.interests.forEach(function(entry){\n entry = entry.toLowerCase();\n if(searchText.length > 0 && entry.startsWith(searchText.toLowerCase())){\n substringMatches.push(entry);\n $(\".dropdown-content\").append(\"<a href=\\\"#\\\">\" + entry + \"</a>\");\n }\n });\n })\n .fail(function(xhr, status, error){\n console.log('ERROR: ' + error);\n });\n }", "function getCategory(content) {\n var category = '';\n // var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/(\\w+)(\\/index\\.rss)/;\n var url = /(\\w+):\\/\\/([\\w.]+)(\\.craigslist\\.org)\\/search\\/(\\w+)(\\?&srchType=A)/;\n var result = content.match(url);\n if(result != null) {\n category = result[4];\n }\n return category;\n}", "function success_getAllCategories(r) {\n productBO.cacheAllCategories=r;\n }", "function searchRecom() {\n\t// store keyword in localSession\n\twindow.localStorage.setItem('kw', keyWord);\n\t// Fuse options\t\t\t\t\n\tvar options = {\n\t\tshouldSort: true,\n\t\ttokenize: true,\n\t\tthreshold: 0.2,\n\t\tlocation: 0,\n\t\tdistance: 100,\n\t\tincludeScore: true,\n\t\tmaxPatternLength: 32,\n\t\tminMatchCharLength: 2,\n\t\tkeys: [\"title.recommendation_en\",\n\t\t\t \"title.title_recommendation_en\",\n\t\t\t \"topic.topic_en\"]\n\t};\n\t//Fuse search\n\tvar fuse = new Fuse(recommends, options); //https://fusejs.io/\n\tconst results = fuse.search(keyWord);\n\treturn results;\n}", "function searchCraft(e) {\r\n\te.preventDefault();\r\n\tconst searchItem = document.querySelector('#searchbar').value;\r\n\tconsole.log('Searching: '+searchItem)\r\n\trelatedCrafts=[]\r\n\tallCrafts.forEach(function (value, index, array){\r\n\t\tif( value.title.includes(searchItem) | value.authorname.includes(searchItem)) {\r\n\t\t\trelatedCrafts.push(value)\r\n\t\t\r\n\t\t}\r\n\t})\r\n\t// empty the board, load craft tags that contains the search key\r\n\t$('#board').empty();\r\n\t// const cg = new CraftGenerator()\r\n\trelatedCrafts.forEach(function (value, index, array) {\r\n\t\tmakeTag(value)\r\n\t});\r\n}", "getAllDisplayName(category) {\n return category === 'All' ? 'Todos los lugares' : category;\n }", "function search( root, search ) {\n search = search.toLowerCase();\n app.set('possibilities', []);\n if (search) {\n return search_recurse(root, search, []);\n }\n}", "function showCritCatList() {\n // reSets all Markers, removes all Popups and renders criteria list\n updateCategoryList(crtCritIndex);\n }", "function ListCategoryDefinitions(szLibraryId, szSecurityCode)\n{\n try\n {\n var szUrl = Utilities.formatString(\n \"https://api-dot-ao-docs.appspot.com/_ah/api/category/v1/libraries/%s?securityCode=%s\",\n szLibraryId, szSecurityCode);\n var pSuccess = UrlFetchApp.fetch(szUrl);\n var pAOut = new Array();\n //\n if (pSuccess.getResponseCode() != 0xc8)\n throw Utilities.formatString(\"IDD_RESPONSE_CODE_%d\", pResult.getResponseCode());\n\n //call lambda code\n return JSON.parse(pSuccess.getContentText());\n }\n catch (e)\n {\n Logger.log(e.message);\n throw e;\n }\n}", "function GetCategoriesList() {\n var requestString = 'wscmd=crscategories';\n AjaxRequest('./rs.aspx', requestString, GotCategoriesList, null, 'crscategories');\n}", "_getSearchTokens(aSearch) {\n return [this._learnMoreString.toLowerCase()];\n }", "async function assignCategories(ngramData) {\n let dataTypes = await wordpos.getPOS(ngramData);\n let filteredData = sortTypes(dataTypes);\n let nounResults = [];\n let verbResults = [];\n let adverbResults = [];\n let adjectiveResults = [];\n let restResults = filteredData.rest;\n\n\n // create ngram objects with all information (definitions, synonyms...etc) for nouns\n for (let ngram of filteredData.nouns) {\n let ngramInfo = await wordpos.lookupNoun(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n nounResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for verbs\n for (let ngram of filteredData.verbs) {\n let ngramInfo = await wordpos.lookupVerb(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n verbResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for adverbs\n for (let ngram of filteredData.adverbs) {\n let ngramInfo = await wordpos.lookupAdverb(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n adverbResults.push(info);\n }\n // create ngram objects with all information (definitions, synonyms...etc) for adjectives\n for (let ngram of filteredData.adjectives) {\n let ngramInfo = await wordpos.lookupAdjective(ngram);\n let info = {\n ngram,\n ngramData: ngramInfo\n };\n adjectiveResults.push(info);\n }\n\n let allResults = nounResults.concat(verbResults, adjectiveResults, adverbResults);\n let animals = finder(allResults, \"animal\");\n let attributes = finder(allResults, \"attribute\");\n let shapes = finder(allResults, \"shape\");\n let food = finder(allResults, \"food\");\n let places = finder(allResults, \"location\");\n let person = finder(allResults, \"person\");\n let possessions = finder(allResults, \"possession\");\n let communication = finder(allResults, \"communication\");\n let motions = finder(allResults, \"motion\");\n let substances = finder(allResults, \"substance\");\n let cognition = finder(allResults, \"cognition\");\n let contentActions = finder(allResults, \"contact\");\n let actions = finder(allResults, \"act\");\n let descriptors = finder(allResults, \"adj.all\");\n let plants = finder(allResults, \"plant\");\n let time = finder(allResults, \"time\");\n let creationActions = finder(allResults, \"creation\");\n let artifacts = finder(allResults, \"artifact\");\n let objects = finder(allResults, \"object\");\n\n // ngrams related to animals\n let finalAnimals = sortRest(restResults, animals);\n // ngrams that give attributes to other words\n let finalAttributes = sortRest(restResults, attributes);\n // ngrams that are related to shapes\n let finalShapes = sortRest(restResults, shapes);\n // ngrams that are related to food\n let finalFood = sortRest(restResults, food);\n // ngrams that are related to locations\n let finalPlaces = sortRest(restResults, places);\n // ngrams that are related to people\n let finalPerson = sortRest(restResults, person);\n // ngrams that are related to possessions\n let finalPossessions = sortRest(restResults, possessions);\n // ngrams that are related to communication\n let finalCommunication = sortRest(restResults, communication);\n // ngrams that are related to motion\n let finalMotions = sortRest(restResults, motions);\n // ngrams that are related to substances\n let finalSubstances = sortRest(restResults, substances);\n // ngrams that are related to cognition\n let finalCognition = sortRest(restResults, cognition);\n // ngrams that are contact actions\n let finalContentActions = sortRest(restResults, contentActions);\n // ngrams that are miscellanious actions\n let finalMiscActions = sortRest(restResults, actions);\n // ngrams that are descriptors for other words\n let finalDescriptors = sortRest(restResults, descriptors);\n // ngrams that are related to related to plants\n let finalPlants = sortRest(restResults, plants);\n // ngrams that are related to related to time\n let finalTime = sortRest(restResults, time);\n // ngrams that are creation actions\n let finalCreationActions = sortRest(restResults, creationActions);\n // ngrams that are man made objects\n let finalArtifacts = sortRest(restResults, artifacts);\n // ngrams that are objects\n let finalObjects = sortRest(restResults, objects);\n\n let allSortedNgrams = finalAnimals.concat(\n finalAttributes,\n finalShapes,\n finalFood,\n finalPlaces,\n finalPerson,\n finalPossessions,\n finalCommunication,\n finalMotions,\n finalSubstances,\n finalCognition,\n finalContentActions,\n finalMiscActions,\n finalDescriptors,\n finalPlants,\n finalTime,\n finalCreationActions,\n finalArtifacts,\n finalObjects\n );\n\n let sortedData = data.sort((a, b) => a.length - b.length);\n let sortedDataLowered = lower(sortedData);\n\n // ngrams that are not included in any category\n let leftovers = [];\n\n sortedDataLowered.forEach((ngram) => {\n if (\n !allSortedNgrams.includes(ngram) &&\n !leftovers.includes(ngram)\n ) {\n leftovers.push(ngram);\n }\n });\n\n // final data object containing all ngrams sorted into pertinent categories\n let categorizedNgrams = {\n categories: {\n finalAnimals: finalAnimals,\n finalAttributes: finalAttributes,\n finalShapes: finalShapes,\n finalFood: finalFood,\n finalPlaces: finalPlaces,\n finalPerson: finalPerson,\n finalPossessions: finalPossessions,\n finalCommunication: finalCommunication,\n finalMotions: finalMotions,\n finalSubstances: finalSubstances,\n finalCognition: finalCognition,\n finalContentActions: finalContentActions,\n finalDescriptors: finalDescriptors,\n finalPlants: finalPlants,\n finalTime: finalTime,\n finalCreationActions: finalCreationActions,\n finalArtifacts: finalArtifacts,\n finalMiscActions: finalMiscActions,\n finalObjects: finalObjects,\n leftovers: leftovers\n }\n };\n\n return categorizedNgrams;\n}", "function SearchKeywordClassification(trafficType, id, name, url) {\n FacetClassification(trafficType, id, name, url, 500, 130);\n}", "function getCategories() {\n \n // API call to get categories\n fetch(\"https://my-store2.p.rapidapi.com/catalog/categories\", {\n \"method\": \"GET\",\n \"headers\": {\n \"x-rapidapi-key\": \"ef872c9123msh3fdcc085935d35dp17730cjsncc96703109e1\",\n \"x-rapidapi-host\": \"my-store2.p.rapidapi.com\"\n }\n })\n .then(response => {\n return response.json();\n })\n .then(response => {\n\n // call display catgories to display it on screen\n displayCategories(response);\n })\n .catch(err => {\n console.error(err);\n });\n }", "findCanonicalsAndCategories(viralTweets) {\n let headCanonicals = ['-- TOTS --', '-- AMB CANÒNIC --', '-- GENÈRICS --']\n let headCategories = ['-- TOTS --', '-- AMB CATEGORIA --', '-- GENÈRICS --']\n let foundCanonicals = []\n let foundCategories = []\n viralTweets.forEach((tweet) => {\n if (!isInArray(foundCategories, tweet.category)) {\n if (tweet.category !== 'genèric') {\n foundCategories.push(tweet.category)\n }\n }\n if (tweet.canonical_name !== 'genèric') {\n let canonical_entry = tweet.canonical_name + ' (' + tweet.category + ')'\n if (!isInArray(foundCanonicals, canonical_entry)) {\n foundCanonicals.push(canonical_entry)\n }\n }\n })\n\n foundCanonicals.sort()\n foundCategories.sort()\n this.setState({\n canonicalNamesFound: headCanonicals.concat(foundCanonicals),\n dictionaryCategoriesFound: headCategories.concat(foundCategories)\n })\n }", "function categorySelect() {\n\t//카테고리 선택 안했을때 -> hamburger\n\tmenus.forEach((menu) => {\n\t\tif (menu.dataset.type !== \"hamburger\") {\n\t\t\t// console.log(menu.dataset.type);\n\t\t\tmenu.classList.add(\"invisible\");\n\t\t}\n\t});\n\n\t//카테고리 선택시\n\tcategory.addEventListener(\"click\", (event) => {\n\t\tconst filter = event.target.dataset.filter;\n\t\tif (filter == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t//선택 카테고리 색상 변경\n\t\tconst active = document.querySelector(\".category_btn.selected\");\n\t\tactive.classList.remove(\"selected\");\n\t\tevent.target.classList.add(\"selected\");\n\n\t\t//메뉴 선별\n\t\tmenus.forEach((menu) => {\n\t\t\tif (filter === menu.dataset.type) {\n\t\t\t\tmenu.classList.remove(\"invisible\");\n\t\t\t} else {\n\t\t\t\tmenu.classList.add(\"invisible\");\n\t\t\t}\n\t\t});\n\t});\n}", "filterCourses(query, selectedTerm) {\n return this.props._terms.availableCourses[selectedTerm].filter(course => course.code.includes(query.replace(/ /g, '').toUpperCase()));\n }", "get categories() {\n return this.args.categories || this.args.settings || [];\n }", "function create_labels(caller) // *** errors occurring in returned results usually somehow relate to the variables search_used or recent_used somehow becoming negative OR search_used_list not effectively being updated\n{\ndocument.getElementById(parent_prefix+\"category_select\").style.display = (caller <= 2)?\"block\":\"none\";\n\ncheck_cat_val = replace_dashes(document.getElementById(parent_prefix+\"new_post_category\").value);\n//document.getElementById(\"test_results\").innerHTML += parent_prefix+\"new_post_category\"+\"<br />\"; // for testing\n//if(create_lbl_list.length > 0)\n// {\n\tcreate_lbl_list.sort(function(a,b){ if(a[1] == b[1]){return 0;} else if(a[1] == \"recent\"){return -1;} else if(b[1] == \"recent\"){return 1;}});\n\n\tif(recent_count > 0) // prepare recent first (if there are any)\n\t {\n//empty_create_lbl(0);\n\t\tif(recent_used > 0) // check below to see even with more letters if the recent still matches\n\t\t {\n\t\t\td6=recent_used;\n\t\t\td4=0;\n\t\t\tfor(d = 0;d<d6;d++)\n\t\t\t {\n\t\t\t\tif(current_list[d-d4][2].substr(0,check_cat_val.length).toLowerCase() == check_cat_val.toLowerCase() && set_string.indexOf(\";\"+current_list[d-d4][2]+\";\") == -1)\n\t\t\t\t {\n\t\t\t\t\t//document.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).innerHTML = \"<b>\" + current_list[d-d4][2].substr(0,check_cat_val.length) + \"</b>\" + current_list[d-d4][2].substr(check_cat_val.length);\n\t\t\t\t } else {\n\n\t\t\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).parentNode.removeChild(document.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])));\n\t\t\t\t\trecent_used -= 1;\n\t\t\t\t\tjust_removed += 1;\n\t\t\t\t\tcreate_lbl_list.splice(0,0,new Array(current_list[d-d4][0],current_list[d-d4][1],current_list[d-d4][2]));\n\t\t\t\t\tcurrent_list.splice(d-d4,1);\n\t\t\t\t\td4+=1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\tif((recent_used) < 4 && (recent_used+just_removed) < recent_count) // recheck all recent - if there are recently posted categories that aren't being used they should be checked\n\t\t {\n\t\t\td = 0;\n\t\t\td4=0;\n\t\t\td6=recent_used;\n\t\t\t\n\t\t\twhile (recent_used < 4 && d < (recent_count - d6))\n\t\t\t {\n\t\t\t\tif(create_lbl_list[d-d4][2].substr(0,check_cat_val.length).toLowerCase() == check_cat_val.toLowerCase() && set_string.indexOf(\";\"+create_lbl_list[d-d4][2]+\";\") == -1)\n\t\t\t\t {\n/*\n\t\t\t\t\tif(current_list.length > recent_used)\n\t\t\t\t\t {\n\t\t\t\t\t\tfor(var d2 = recent_used;d2<current_list.length;d2++)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d2][2])).parentNode.removeChild(document.getElementById(\"cat_\"+replace_spaces(current_list[d2][2])));\n\t\t\t\t\t\t\tcreate_lbl_list.push(new Array(search_used_list[d2-recent_used][0],search_used_list[d2-recent_used][1],search_used_list[d2-recent_used][2]));\n\n\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).parentNode.removeChild(document.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])));\n\t\t\tsearch_used -= 1;\n\t\t\tcreate_lbl_list.push(new Array(current_list[d-d4][0],current_list[d-d4][1],current_list[d-d4][2]));\n\t\t\tcurrent_list.splice(d-d4,1);\n\t\t\tsearch_used_list.splice(((d-d4)-search_used),1);\n\t\t\td4+=1;\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n*/\n\n\t\t\t\t\tadd_label(create_lbl_list[d-d4][0],create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]);\n\t\t\t\t//\tvar temp_c_list_hold = current_list.splice(recent_used,(current_list.length-recent_used)); // remove all at the end; must replace the search values\n\t\t\t\t//\tcurrent_list.push(new Array(create_lbl_list[d-d4][0],create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]));\n\n\t\tcurrent_list.splice(recent_used,0,new Array(create_lbl_list[d-d4][0],create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]));\n\t\t\t\t\tcreate_lbl_list.splice(d-d4,1);\n\n\t\t\t\t\t//create_lbl_list = create_lbl_list.concat(temp_c_list_hold);\n\t\t\t\t//\tsearch_used_list.length = 0;\n\t\t\t\t\trecent_used += 1;\n\t\t\t\t\td4+=1;\n\t\t\t\t//\tsearch_used = 0;\n\t\t\t\t\treplace_search = true;\n\t\t\t\t }\n\t\t\t\td++;\n\t\t\t }\n\n\t\t }\n\n\t\tjust_removed = 0;\n\t }\n\n\tcreate_lbl_list = clean_array(create_lbl_list);\n\n\tif(check_cat_val != \"\") // check search used below\n\t {\n\t\tif(search_used > 0) // check below to see even with more letters if the search still matches\n\t\t {\n\n//document.getElementById(\"test_results\").innerHTML += recent_used+\"::<br />\";\n\t\t\td6=search_used-t_reset_shown;\n\t\t\td4=0;\n\t\t\tfor(d = recent_used;d<(recent_used+d6);d++)\n\t\t\t {\n\t\t\t\tif(current_list[d-d4][2].substr(0,check_cat_val.length).toLowerCase() == check_cat_val.toLowerCase() && set_string.indexOf(\";\"+current_list[d-d4][2]+\";\") == -1)\n\t\t\t\t {\n\t\t\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).innerHTML = \"<b>\" + current_list[d-d4][2].substr(0,check_cat_val.length) + \"</b>\" + current_list[d-d4][2].substr(check_cat_val.length);\n\n\t\t\t\t\tif(u_cat_private[replace_spaces(current_list[d-d4][2])])\n\t\t\t\t\t {\n\t\t\t\t\t\tR5_sp=document.createElement(\"span\");\n\t\t\t\t\t\tR5_sp.className = \"private_category\";\n\t\t\t\t\t\t//R5_sp.title = \"This category is private\";\n\t\t\t\t\t\tR5_sp.id = \"private_sym_\"+replace_spaces(replace_spaces(current_list[d-d4][2]));\n\t\t\t\t\t\tR5_sp.onmouseover = function(){info_message(this.id,3,8,\"This category is private\",0,\"#fff\",\"#000\",\"#000\",255,.75);}\n\t\t\t\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).appendChild(R5_sp);\n\t\t\t\t\t }\n\n\t\t\t\t } else {\n\t\t\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).parentNode.removeChild(document.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])));\n\t\t\t\t\tsearch_used -= 1;\n\t\t\t\t\tcreate_lbl_list.push(new Array(current_list[d-d4][0],current_list[d-d4][1],current_list[d-d4][2]));\n\t\t\t\t\tcurrent_list.splice(d-d4,1)\n\t\t\t\t\tsearch_used_list.splice(((d-d4)-recent_used),1);\n\t\t\t\t\td4 += 1;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\tif((search_used+recent_used) < 8)//recheck all search (as user types more letters, deletes some, and retypes letters: since there is a max of 8 shown, if a newly typed letter takes out some of the currently shown, we may have already queried server)\n\t\t {\n\t\t\td = recent_count-recent_used;\n\t\t\td4=0;\n\t\t\td7 = create_lbl_list.length;\n\t\t\td6=search_used;\n\t\t\twhile ((search_used+recent_used) < 8 && d < d7)\n\t\t\t {\n\t\t\t\tif(create_lbl_list[d-d4][2].substr(0,check_cat_val.length).toLowerCase() == check_cat_val.toLowerCase() && set_string.indexOf(\";\"+create_lbl_list[d-d4][2]+\";\") == -1)\n\t\t\t\t {\n\t\t\t\t\ttemp_new_label = \"<b>\" + create_lbl_list[d-d4][2].substr(0,check_cat_val.length) + \"</b>\" + create_lbl_list[d-d4][2].substr(check_cat_val.length);\n\t\t\t\t\tadd_label(temp_new_label,create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]);\n\t\t\t\t\tcurrent_list.push(new Array(create_lbl_list[d-d4][0],create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]));\n\t\t\t\t\tsearch_used_list.push(new Array(create_lbl_list[d-d4][0],create_lbl_list[d-d4][1],create_lbl_list[d-d4][2]));\n\t\t\t\t\tcreate_lbl_list.splice(d-d4,1);\n\t\t\t\t\tsearch_used += 1;\n\t\t\t\t\td4+=1;\n\t\t\t\t }\n\t\t\t\td++;\n\t\t\t }\n\n\t//\tempty_create_lbl(\"1\");\n\t\t }\n\n\t\t//document.getElementById(\"test_results\").innerHTML += previous_all_val.indexOf(check_cat_val); // for testing without using alert b/c of focus issues\n\t\t\t\t// if((search_used+recent_used) < 8 && caller == 0 && !((check_cat_val.indexOf(previous_val) == 0 && previous_val != \"\" && previous_total < 8) || previous_all_val.indexOf(\",\"+check_cat_val.substr(0,1)) > -1))\n\t\t\t\t// ^ changes made because if a user types quickly it will skip searching the first letters typed. the above would make it impossible to search for certain categories under that situation:\n\t\t\t\t// ^ EX: if user quickly types \"mi\", and subsequently deletes \"i\" so the value is \"m\", the above will not search for m because it thinks it already has\n\t\tif((search_used+recent_used) < 8 && caller == 0 && !(is_cat_loaded(previous_all_val,check_cat_val)))\n\t\t {\n\t\t\t//temp_prev_ar = previous_all_val.split(\",\");\n\n\t\t\tprevious_all_val += check_cat_val+\",\";\n\n\t\t\t// document.getElementById(\"test_results\").innerHTML += previous_all_val+\"<br />\"; // for testing\n\t\t\tcategory_select((8 - (search_used+recent_used)));\n\n\t\t }\n/* else {\n\n\t\t\tif(check_cat_val != \"\" && !((search_used+recent_used) < 8 && a == 0 && !(is_cat_loaded(previous_all_val,check_cat_val))))\n\t\t\t {\n\t\t//\tif(R5_user==\"john\"){document.getElementById(\"test_results\").innerHTML += \"HERE::\"+(previous_all_val)+\"::1:\"+(((search_used+recent_used) < 8)?\"true\":\"false\")+\"::2:\"+((a == 0)?\"true\":\"false\")+\"::3:\"+((!(is_cat_loaded(previous_all_val,check_cat_val)))?\"true\":\"false\")+\"<br />\";} // for testing\n\t\t\t }\n\t\t }\n*/\n\t\t//document.getElementById(\"test_results\").innerHTML += \"<br />\"; // for testing\n\n\t\tprevious_val = check_cat_val;\n\t\tprevious_total = (search_used+recent_used);\n\n\t } else\n\tif(search_used > 0) // take out all search used and put them into create_lbl_list for later use\n\t {\n//document.getElementById(\"test_results\").innerHTML += \"greater than 1<br />\"; // for testing\n\t\td4=0;\n\t\td7 = current_list.length;\n\t\tfor(d = recent_used;d<d7;d++)\n\t\t {\n\t\t\tdocument.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])).parentNode.removeChild(document.getElementById(\"cat_\"+replace_spaces(current_list[d-d4][2])));\n\t\t\tsearch_used -= 1;\n\t\t\tcreate_lbl_list.push(new Array(current_list[d-d4][0],current_list[d-d4][1],current_list[d-d4][2]));\n\t\t\tcurrent_list.splice(d-d4,1);\n\t\t\tsearch_used_list.splice(((d-d4)-search_used),1);\n\t\t\td4+=1;\n\t\t }\n\n\t//\tempty_create_lbl(\"2\");\n\n\t\tprevious_val = check_cat_val;\n\t\tprevious_total = (search_used+recent_used);\n\t }\n\ndocument.getElementById(parent_prefix+\"category_select\").style.display = (current_list.length > 0 && caller <= 2)?\"block\":\"none\";\n}", "function bloggerCatFilter(innerHTML) {\n var cat = innerHTML;\n var headings = document.evaluate(\"//button[@class='btn' and contains(., '\" + cat + \"')]\", document, null, XPathResult.ANY_TYPE, null );\n var thisHeading = headings.iterateNext();\n thisHeading.click();\n}", "function SearchWrapper () {}", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function Suggestions() {\n}", "function onCategoriesSelectorOpen()\n {\n // The md-select directive eats keydown events for some quick select\n // logic. Since we have a search input here, we don't need that logic.\n $document.find('md-select-header input[type=\"search\"]').on('keydown', function (e)\n {\n e.stopPropagation();\n });\n }", "function findSearch(searchTerm) {\r\n\r\nfor (var i = 0; i < jobList.length; i++) {\r\n if (jobList[i].JobTitle.toLowerCase().includes(searchTerm.toLowerCase()) || jobList[i].Category.toLowerCase().includes(searchTerm.toLowerCase() ) || jobList[i].Location.toLowerCase().includes(searchTerm.toLowerCase() ) ) {\r\n document.getElementById(i).style.display = \"block\"\r\n }\r\n else{\r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n } \r\n}", "function filterProjectsBy(evt) {\n var category = evt.target.value;\n $('.project-filterable').hide();\n if (category) {\n $('.' + category).show();\n } else {\n $('.project-filterable').show();\n }\n}", "function searchCategoriesItem() {\n var x;\n var searchString = document.getElementById(\"searchInput\").value.toUpperCase();\n var index = categories.findIndex(x => x.product == searchString);\n if (index > -1) {\n createAndReturnCategoryDivElement(index, searchDiv);\n }\n else {\n document.getElementById(\"searchDiv\").innerHTML = \"Product not found in categories\";\n document.getElementById(\"searchInput\").value = \"\";\n }\n}" ]
[ "0.6649075", "0.6353675", "0.62846303", "0.6212454", "0.60889447", "0.60212547", "0.59802705", "0.59317213", "0.5916298", "0.57603437", "0.56630903", "0.56363976", "0.563162", "0.5629121", "0.5614036", "0.5611835", "0.5607619", "0.56047654", "0.5583509", "0.557324", "0.5564287", "0.5558585", "0.5546779", "0.5528293", "0.55126935", "0.5504374", "0.54886097", "0.5480381", "0.54757273", "0.5447253", "0.5414009", "0.53949094", "0.5379922", "0.5376881", "0.53758603", "0.53460723", "0.5322429", "0.53141326", "0.5307638", "0.53067", "0.5301461", "0.5300719", "0.5294566", "0.5290983", "0.52883077", "0.5274641", "0.5269961", "0.5269227", "0.52602196", "0.5251723", "0.5239427", "0.523202", "0.5225073", "0.5223964", "0.52223796", "0.51779085", "0.5156564", "0.51563823", "0.5155997", "0.5151225", "0.513111", "0.512773", "0.51251906", "0.51242113", "0.51211935", "0.51185673", "0.51125365", "0.51114696", "0.5109536", "0.5109521", "0.510927", "0.5102432", "0.5080754", "0.507792", "0.50762796", "0.5067625", "0.50660694", "0.50617945", "0.5059669", "0.50595087", "0.5056663", "0.5050863", "0.5046945", "0.5046733", "0.5043134", "0.50406444", "0.50388175", "0.50361145", "0.5036054", "0.5026612", "0.50255316", "0.50252944", "0.50251323", "0.5024502", "0.50242627", "0.50238085", "0.5023061", "0.5019748", "0.5018904", "0.5007295", "0.5006357" ]
0.0
-1
show console messages if debugging variable is on
function debug(message) { if(debugging) { console.log(message); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function debugMessage() {\n if (debug) console.debug(arguments);\n}", "function debug(message) {\n if ($.fn.track.defaults.debug && typeof console !== 'undefined' && typeof console.debug !== 'undefined') {\n console.debug(message);\n }\n }", "debug() {}", "function debug_log(msg) {\n\n if (window['debug']) {\n\n console.log(msg);\n\n }\n\n}", "function debug() {\n\t\t\tconsole.log()\n\t\t\ttheInterface.emit('ui:startDebug');\n\t\t}", "function debug(v, str) {\r\n\t\t\tv && console.log(str);\r\n\t\t}", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "function d(message) {\n if (debug_mode) console.log(message);\n }", "function showDebugInfo() {\n\t\t\tconsole.log();\n\t\t}", "static debug(...messages) {\n if (config.dev.debug === true) {\n console.log(...messages);\n }\n }", "function debug () {\n if (Retsly.debug) console.log.apply(console, arguments);\n}", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "function debug(v){return false;}", "function devDebug(){\n\n}", "function debug(s) {\n if (!debugOn) {\n return;\n }\n console.log(s);\n}", "function debug(msg) {\n if (options.debug) console.error(msg)\n}", "get debug() {\n return this.args.debug || false;\n }", "function _debug(message, tag, force) {\n if(typeof(force) == 'undefined' || force !== true) force = false;\n if(this.options().debug || force ) console.log(message, tag);\n }", "function debug(msg) {\n if (typeof(console) != 'undefined') {\n console.info(msg);\n }\n }", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "function debug_print(message)\n{\n if (debug_output_target == 1)\n console.log(message);\n else\n alert(message);\n}", "function debugMsg(string) {\n\tif (debug) {\n\t\tconsole.log(string);\n\t}\n}", "function isDebug() {\n return debug;\n }", "function myDebug(){\n if(window.console) console.info(arguments);\n}", "function debug () {\n if (!debugEnabled) { return; }\n console.log.apply(console, arguments);\n }", "function debug(msg){\n\tif(dbg){\n\t\talert(msg);\n\t}\n}", "set debug(value) {\n Logger.debug = value;\n }", "function _debug(str) {\n\tif (window.console && window.console.log) window.console.log(str);\n }", "function debug(message)\n{\n\tif (DEBUG)\n\t\tconsole.log(message);\n}", "function dbg(value)\n{\n\tvar active = false;//true for active\n\tvar firefox = true;//true if debug under firefox\n\n\tif (active)\n\t\tif (firefox)\n\t\t\tconsole.log(value);\n\t\telse\n\t\t\talert(value);\n}", "logDev(message){\n\t\tif(this.debugLevel==='DEVELOPPEMENT')\n\t\t\tconsole.log(message)\n\t}", "setDebug() {\n this.debug = true;\n }", "function _debug( msg )\n {\n if( window.console && window.console.log ) \n console.log( \"[debug] \" + msg ); \n }", "function debug() {\n if(IS_DEBUG) {\n let text = '';\n for(let i in arguments) {\n text += ' ' + arguments[i];\n }\n console.log(text);\n }\n}", "isDebug() {\n return nativeTools.debug;\n }", "function debugLog(data){\n\t if(DEBUG !== 1) return false;\n\n\tconsole.log(data);\n}", "function console_log(msg){\n\tif(menu_config.development_mode){\n\t\tconsole.log(msg);\n\t}\n}", "function debug(msg) {\n\tif(DEBUG_LEVEL > 0) {\n\t\tconsole.log(\"DEBUG::\" + msg);\n\t}\n}", "function debug(msg){\n console.log(msg);\n}", "function debug(...args) {\n if (false) {\n console.log(...args);\n }\n }", "function debug() {\r\n\tif (console) {\r\n\t\tconsole.log(this, arguments);\r\n\t}\r\n}", "function debug(msg){\n\n \t// comment out the below line while debugging\n \t \t//console.log(msg);\n }", "function debug(msg) {\n console.log(msg);\n}", "hasDebug() {\n return qx.core.Environment.get(\"qx.debug\");\n }", "function printdebug(msg) { \n if (debug) {\n debug_html += msg;\n // Write debug HTML to div\n document.getElementById(\"debug_div\").innerHTML = debug_html;\n }\n }", "function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}", "function isDebug() {\n return process.env[\"RUNNER_DEBUG\"] === \"1\";\n }", "function debug()\n {\n var i;\n \n if (debugging)\n {\n for (i = 0; i < arguments.length; i++)\n {\n HTMLDebugInfo.innerHTML += arguments[i].toString() + \"<br>\";\n }\n } \n }", "debug(...parameters)\n\t{\n\t\tif (this.options.debug)\n\t\t{\n\t\t\tconsole.log(this.preamble, '[debug]', generate_log_message(parameters))\n\t\t}\n\t}", "function debugCommandOutput(flag) {\n if (flag) {\n const co = commands.commands;\n console.log(Object.keys(co).map(c => {\n return `${c}: ${co[c].m}`;\n }));\n }\n}", "set debug(val) {\n this._debug = val;\n }", "function debug(message) {\n command_1.issueCommand(\"debug\", {}, message);\n }", "function debug() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n if (args_finder_1.isDebugMode()) {\n write(args, PRINT_COLOR, DEBUG('DEBUG: '));\n }\n}", "function debu(x){\n if (debug) console.log(x)\n}", "function debug() {\n if (process.env.DEBUG) {\n // Because arguments is an array-like object, it must be called with Function.prototype.apply().\n console.log('DEBUG: %s', util.format.apply(util, arguments));\n }\n}", "dd(msg, msg_type = \"DEBUG\") {\n if (this.debug) {\n console.log('[' + msg_type + '] ' + msg )\n }\n }", "function debug($obj) {\n if (window.console && window.console.log) {\n window.console.log($obj);\n }\n }", "static debug(...args) {\n if (this.toLog('DEBUG')) {\n // noinspection TsLint\n console.debug.apply(console, arguments); // eslint-disable-line\n }\n }", "function Debug(inputString){\n\t\n\tif(!DebugMode)\n\t\treturn;\n\tconsole.log(\"Debug || \" + inputString);\n}", "function debug($obj) {\n if (window.console && window.console.log) {\n window.console.log($obj);\n }\n }", "function debug($obj) {\n if (window.console && window.console.log) {\n window.console.log($obj);\n }\n }", "function debug($obj) {\n if (window.console && window.console.log) {\n window.console.log($obj);\n }\n }", "function debug($obj) {\n if (window.console && window.console.log) {\n window.console.log($obj);\n }\n }", "toggleDebugMode() {\n debug = !debug;\n }", "debugLog (message) {\n if (GEPPETTO.G.isDebugOn()) {\n this.getConsole().debugLog(message);\n }\n }", "function debug($obj) {\r\n if (window.console && window.console.log) {\r\n window.console.log($obj);\r\n }\r\n }", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "function setDebug(state) {\n DEBUG = state;\n}", "debug(el) {\n\t\tif (this.level >= 3) {\n\t\t\tconst color = \"\\x1b[33m%s\\x1b[0m\"\n\t\t\tconst log = \"Debug: \" + el\n\t\t\tconsole.log(color, log)\n\t\t}\n\t}", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function DebugLog(cad)\r\n{\r\n try\r\n {\r\n if (gb_log_debug === true)\r\n {\r\n console.log(cad);\r\n }\r\n }\r\n catch(err)\r\n { \r\n } \r\n}", "function isInDebugMode() {\n return (typeof config.debug !== 'undefined' && config.debug === true);\n}", "function debug(message) {\n console.log(\"DEBUG: \" + message)\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function debug(message) {\r\n command_1.issueCommand('debug', {}, message);\r\n}", "function writeDebug(msg) {\n if ($.fn.tagSelector.defaults.debug) {\n msg = \"DEBUG: TagSelector - \"+msg;\n if (window.console && window.console.log) {\n window.console.log(msg);\n } else { \n //alert(msg);\n }\n }\n }", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function DebugConsole() {\n}", "function showDebug(name){\r\n\t\t//fill the debug div\r\n\t\tvar $debug = $('#debug_content'),\r\n\t\tl, arr, i = 0;\r\n\t\t$debug.html('');\r\n\t\tif(test.debug && test.debug[name].length){\r\n\t\t\tarr = test.debug[name];\r\n\t\t\tl = arr.length;\r\n\t\t\twhile(i < l){\r\n\t\t\t\t$debug.append($('<div class=\"varDump\">').html('<pre>' + dump(arr[i]) + '</pre>'));\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$debug.show();\r\n\t}", "function log(message) {\n if (debug) console.log(message);\n}", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function debug(message)\n{\n if (DEBUG)\n {\n var element = document.getElementById(\"debug\");\n element.innerHTML += message;\n }\n console.log(message);\n}", "debug (messageParms) {\n // We can actually replace this method with a simpler one when not in debug.\n if (!IsDebug) {\n Logger.prototype.debug = () => {}\n return\n }\n\n this._print(arguments, {debug: true})\n }", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}", "function debug(message) {\n command_1.issueCommand('debug', {}, message);\n}" ]
[ "0.76454496", "0.75051767", "0.73131984", "0.72947127", "0.71841234", "0.717526", "0.7170721", "0.71669", "0.714148", "0.71316284", "0.71206737", "0.7116414", "0.71032894", "0.71029335", "0.70863664", "0.7054463", "0.70291215", "0.7027945", "0.70245713", "0.70236945", "0.7020656", "0.7012928", "0.6990355", "0.6989872", "0.69875556", "0.6941487", "0.69332826", "0.6918509", "0.6902496", "0.68807226", "0.6872982", "0.68679965", "0.68635565", "0.6855676", "0.6837235", "0.68205035", "0.68178296", "0.6792607", "0.67807657", "0.67646706", "0.67567044", "0.67425823", "0.67293006", "0.6720927", "0.6709667", "0.67079127", "0.67028177", "0.6698607", "0.6698527", "0.66972536", "0.66969836", "0.6686102", "0.668554", "0.668006", "0.66613895", "0.66580194", "0.6656626", "0.6655746", "0.665226", "0.66478646", "0.66478646", "0.66478646", "0.66478646", "0.66440105", "0.6635392", "0.6617714", "0.6617336", "0.6610449", "0.6604187", "0.65745157", "0.65745157", "0.6561313", "0.6558844", "0.6555938", "0.6555938", "0.6532847", "0.65258807", "0.65258807", "0.65258807", "0.6524162", "0.6521248", "0.65101945", "0.65088856", "0.6495575", "0.6491034", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225", "0.6488225" ]
0.73899746
2
update visuals of the timers
function onTrackedVideoFrame(currentTime, duration){ $("#current").text(currentTime); $("#duration").text(duration); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function statusChanged(){\n resetTimer();\n renderTimer();\n}", "function updateUI(){\n\t\n\t$('elapsed').innerText = timeElapsed();\n\t$('timer').innerText = countdown;\n\t$('shots').innerText = min_elapsed;\n\t$('bottles').innerText = toBottles(min_elapsed);\n\t$('ml').innerText = toMl(min_elapsed);\n\t$('oz').innerText = toOz(min_elapsed);\n\tif(paused){\n\t\t$('status').innerText = 'Play!';\n\t\t$('status').setStyle('color', '#'+Math.floor(Math.random()*16777215).toString(16));\n\t}\n\telse{\n\t\t$('status').innerText = 'Pause.';\n\t}\n\t$('interval').innerText = 'Game interval is ' + interval + ' seconds. Click to change.';\n}", "function updateTime(){\n setTimeContent(\"timer\");\n}", "function updateTaskVisuals() {\n\t\tconsole.log(\"Updating...\")\n\t\t// Check clock, then check alarms\n\t\tvar currTime = new Date();\n\t\tvar currHr = currTime.getHours();\n\t\tvar currMin = currTime.getMinutes();\n\t\t$scope.tasks.forEach(function (task) {\n\t\t\tconsole.log(task);\n\t\t\tif ((task.alarmTimeHr !== null) \n\t\t\t\t&& (task.alarmTimeMin !== null)\n\t\t\t\t&& (task.active !== true)) {\n\t\t\t\tif (currHr >= task.alarmTimeHr &&\n\t\t\t\t\tcurrMin >= task.alarmTimeMin) {\t\n\t\t\t\t\tTasksFactory.activateTask(task);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t// Re-render $scope.tasks every 10 seconds\n\t\t$scope.tasks = TasksFactory.renderTasks();\n\t}", "update() {\n this.view.drawArrows(Clock.getCurrentDate());\n // SetTimeout for next iteration if clock is working.\n if (this.isWork) {\n setTimeout(() => {\n this.update.apply(this);\n }, 50);\n }\n }", "function updateTimerDisplay(){\n // Update current time text display.\n $('#current-time').text(formatTime( player.getCurrentTime() ));\n $('#duration').text(formatTime( player.getDuration() ));\n }", "function updateTimerDisplay(){\n // Update current time text display.\n $('#current-time').text(formatTime( r.getCurrentTime() ));\n $('#duration').text(formatTime( r.getDuration() ));\n}", "function updateTimeDisplay()\n{\n // Get the current time in seconds and then get the difference from the stop seconds.\n var diff = globalStopSeconds - currentSeconds();\n\n // Set the time on the screen.\n $(\"#timer-display\").text( secondsToMinutes( diff));\n\n // Update the sand column graph. \n sandColumnUpdate( diff);\n\n}", "function updateTimer() {\n var t = addTimer();\n $('#days').html(t.days);\n $('#hours').html(t.hours);\n $('#minutes').html(t.minutes);\n $('#seconds').html(t.seconds);\n}", "function updateTimerDisplay() {\n // Update current time text display.\n //$('#current-time').text(formatTime(player.getCurrentTime()))\n //$('#duration').text(formatTime(player.getDuration()))\n}", "function updateTimer() {\n\t\t\tvar timeString = formatTime(currentTime);\n\t\t\t$stopwatch.html(timeString);\n\t\t\tcurrentTime += incrementTime;\n\t\t}", "function setTimers()\n{\n\ttimeID = window.setTimeout( \"updateAll()\", refreshRate );\n}", "function dashboardUpdateAll() {\n\t\tdashboardSet('stars', whiteStar + whiteStar + whiteStar);\n\t\tdashboardSet('tally', 0);\n\t\tdashboardSet('reset', semicircleArrow);\n\t\tdocument.getElementsByClassName('current-timer')[0].innerHTML = \"00:00\";\n}", "function update() {\n controls.update();\n stats.update();\n }", "function updateCanvasTimer() {\r\n\r\n updateCanvas(timeHandler.getTimePeriods());\r\n setTimeout(updateCanvasTimer, 60000);\r\n\r\n}", "updateVisuals() {\r\n\t\tthis.props.updateVisuals()\r\n\t\tthis.animationFrameRequest = window.requestAnimationFrame(this.updateVisuals)\r\n\t}", "update() {\n\t\tthis.node.innerText = this.getTime(this.ticks);\n\t}", "function update() {\n clock += change();\n render();\n }", "updateTimer() {\n\t\tlet timer = parseInt((Date.now() - this.gameStartTimestamp)/1000);\n\t\tthis.gameinfoElement.childNodes[1].innerHTML = \"<h1>Time: \" + timer + \" s</h1>\";\n\t}", "renderUI() {\n this.displayMeasures();\n this.getBugCounts();\n\n // Update counts periodically\n window.setInterval(() => this.getBugCounts(), this.config.refreshMinutes * 60 * 1000);\n }", "function runTimer() {\n var displayText = runCounters(true)\n document.getElementById('timer-window').innerHTML = displayText\n}", "function updateScreen() {\n var l;\n $(\"#sessL\").html(convertNumToMin(session_length));\n $(\"#timeR\").html(convertNumToMin(current_time));\n if (break_on) {\n document.getElementById(\"inner_circle\").style.backgroundColor = 'red';\n document.getElementById(\"inner_circle\").style.opacity = 1 - (current_time / session_length);\n $(\"#timeE\").html(convertNumToMin(break_length - current_time));\n l = \"BREAK!\";\n } else {\n document.getElementById(\"inner_circle\").style.backgroundColor = 'green';\n document.getElementById(\"inner_circle\").style.opacity = 1 - (current_time / session_length);\n $(\"#timeE\").html(convertNumToMin(session_length - current_time));\n l = \"GO!\";\n }\n $(\"#breaL\").html(convertNumToMin(break_length));\n $(\"#sessN\").html(num_sessions);\n $(\"#label\").html(l + \"&nbsp;&nbsp;&nbsp;\" + (num_sessions - current_session + 1) + \" / \" + num_sessions)\n checkTime();\n}", "function updateTimer(newVal, oldVal) {\r\n\t\t// Change class on the timer to change the colour if needed.\r\n\t\t// See the common.css file for more information.\r\n\t\tif (oldVal) timerElem.toggleClass('timer_'+oldVal.state, false);\r\n\t\ttimerElem.toggleClass('timer_'+newVal.state, true);\r\n\t\t\r\n\t\ttimerElem.html(newVal.time); // timer.html\r\n\t}", "function updateTimer() {\n counter++;\n timer.innerHTML = \"<div>timer: \" + counter + \"</div>\";\n }", "function live_update() {\n date = new Date(date.getTime() + live_update_interval);\n addAnimation(animate_composite);\n setTimeout(live_update, live_update_interval);\n}", "function updateBtnDisplay(buttonNum){\n \n // check if first + and enables other +\n if(customSelected == 3){\n buttonsTime[4].disabled = false;\n buttonsTime[4].classList.remove(\"btn-greyed\");\n\n settingsTabs[5].disabled = false;\n settingsTabs[5].classList.remove(\"btn-greyed\");\n }\n // fills btn display based on Timer settings ( 1 min, 10:20 , or 2 sec display)\n if(Timers[buttonNum].time == 0 && Timers[buttonNum].seconds != 0){\n buttonsTime[buttonNum].textContent = Timers[buttonNum].seconds + \" sec\";\n }\n else if(Timers[buttonNum].seconds == 0 ){\n buttonsTime[buttonNum].textContent = Timers[buttonNum].time + \" min\";\n }\n else{\n if(Timers[buttonNum].seconds < 10){\n buttonsTime[buttonNum].textContent = Timers[buttonNum].time + \" : 0\" + Timers[buttonNum].seconds;\n }\n else{\n buttonsTime[buttonNum].textContent = Timers[buttonNum].time + \" : \" + Timers[buttonNum].seconds;\n }\n \n }\n settingsTabs[buttonNum + 1].textContent = Timers[buttonNum].tag + \" Timer\";\n \n}", "function updateTime() {\n if (counter >= 0) {\n timer.innerHTML = counter;\n --counter;\n setTimeout(updateTime, 1000);\n }\n if (counter <= 0) {\n $('#over').modal('show')\n }\n }", "function updateTimeDisplay(newTime) {\n $(\".timer\").text(time);\n time = newTime;\n}", "update_() {\n var current = this.tlc_.getCurrent();\n this.scope_['time'] = current;\n var t = new Date(current);\n\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\n\n if (coord) {\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\n\n this.scope_['coord'] = coord;\n var sets = [];\n\n // sun times\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\n\n // Determine dawn/dusk based on user preference\n var calcTitle;\n var dawnTime;\n var duskTime;\n\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\n case 'nautical':\n calcTitle = 'Nautical calculation';\n dawnTime = suntimes.nauticalDawn.getTime();\n duskTime = suntimes.nauticalDusk.getTime();\n break;\n case 'civilian':\n calcTitle = 'Civilian calculation';\n dawnTime = suntimes.dawn.getTime();\n duskTime = suntimes.dusk.getTime();\n break;\n case 'astronomical':\n default:\n calcTitle = 'Astronomical calculation';\n dawnTime = suntimes.nightEnd.getTime();\n duskTime = suntimes.night.getTime();\n break;\n }\n\n var times = [{\n 'label': 'Dawn',\n 'time': dawnTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Sunrise',\n 'time': suntimes.sunrise.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Solar Noon',\n 'time': suntimes.solarNoon.getTime(),\n 'color': '#FFD700'\n }, {\n 'label': 'Sunset',\n 'time': suntimes.sunset.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Dusk',\n 'time': duskTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Night',\n 'time': suntimes.night.getTime(),\n 'color': '#000080'\n }];\n\n this.scope_['sun'] = {\n 'altitude': sunpos.altitude * geo.R2D,\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\n };\n\n // moon times\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\n var moonlight = SunCalc.getMoonIllumination(t);\n\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\n\n if (moontimes.rise) {\n times.push({\n 'label': 'Moonrise',\n 'time': moontimes.rise.getTime(),\n 'color': '#ddd'\n });\n }\n\n if (moontimes.set) {\n times.push({\n 'label': 'Moonset',\n 'time': moontimes.set.getTime(),\n 'color': '#2F4F4F'\n });\n }\n\n var phase = '';\n for (var i = 0, n = PHASES.length; i < n; i++) {\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\n phase = PHASES[i].label;\n break;\n }\n }\n\n this.scope_['moon'] = {\n 'alwaysUp': moontimes.alwaysUp,\n 'alwaysDown': moontimes.alwaysDown,\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\n 'altitude': moonpos.altitude * geo.R2D,\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\n 'phase': phase\n };\n\n times = times.filter(filter);\n times.forEach(addTextColor);\n googArray.sortObjectsByKey(times, 'time');\n sets.push(times);\n\n this.scope_['times'] = times;\n ui.apply(this.scope_);\n }\n }", "function updateTimer() {\n //console.log(currentTime);\n formatTimeDuration(currentTime);\n var timeString = formatTime(currentTime);\n $stopwatch.html(timeString);\n currentTime += incrementTime;\n }", "_updateTime() {\r\n // Determine what to append to time text content, and update time if required\r\n let append = \"\";\r\n if (this.levelNum <= MAX_LEVEL && !this.paused) {\r\n this.accumulatedTime += Date.now() - this.lastDate;\r\n }\r\n this.lastDate = Date.now();\r\n\r\n // Update the time value in the div\r\n let nowDate = new Date(this.accumulatedTime);\r\n let twoDigitFormat = new Intl.NumberFormat('en-US', {minimumIntegerDigits: 2});\r\n if (nowDate.getHours() - this.startHours > 0) {\r\n this.timerDisplay.textContent = `Time: ${nowDate.getHours() - this.startHours}:`+\r\n `${twoDigitFormat.format(nowDate.getMinutes())}:` +\r\n `${twoDigitFormat.format(nowDate.getSeconds())}${append}`;\r\n }\r\n else {\r\n this.timerDisplay.textContent = `Time: ${twoDigitFormat.format(nowDate.getMinutes())}:` +\r\n `${twoDigitFormat.format(nowDate.getSeconds())}${append}`;\r\n }\r\n }", "function updateTimerDisplay(){\n // Update current time text display.\n $('#current-time').text(formatTime(player.getCurrentTime() ));\n $('#duration').text(formatTime( player.getDuration() ));\n}", "function update() {\n ticking = false;\n for (var i = inViewEls.length; i--;) {\n inViewEls[i].update();\n }\n }", "function updateTime() {\n seconds += 1;\n document.querySelector(\"#timer\").innerText = \"Time elapsed: \" + seconds;\n}", "function domTimer() {\n $(`.timer`).text(`Timer: ${totalMinutes}:${totalSeconds}`);\n }", "doodle() {\n this.update()\n this.display()\n }", "function update() {\n\t\tfor (let i = 0; i < loop.update.length; i++) {\n\t\t\tloop.update[i](tickCounter);\n\t\t}\n\t\tfor (let i = 0; i < loop.updateLast.length; i++) {\n\t\t\tloop.updateLast[i](tickCounter);\n\t\t}\n\t\ttickCounter++;\n\t\tmouseClicked = false;\n\t}", "display(){\n $('#timer').text(timer.hours + \":\" + timer.minutes + \":\"+ timer.secondes);\n }", "function showTimer()\r\n{\r\n document.getElementById('timeDisplay').style.display = 'none'\r\n document.getElementById('messageDisplay').style.display = 'none'\r\n document.getElementById('musicDisplay').style.display = 'none'\r\n document.getElementById('stopWatchDisplay').style.visibility = 'visible'\r\n \r\n document.getElementById('message').style.color = 'gray'\r\n document.getElementById('clock').style.color = 'white'\r\n document.getElementById('music').style.color = 'gray'\r\n}", "function update() {\n me.stop();\n\n // determine interval to refresh\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.redraw();\n me.body.emitter.emit('currentTimeTick');\n\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }", "function updateElements() { //Main loop logic here.\r\n updateResourceDisplay();\r\n updateCoreDisplay();\r\n}", "function updateDisplay() {\n // get the current time in milliseconds\n const now = new Date().getTime();\n\n // get total seconds from milliseconds\n let elapsed = Math.floor((now - epoch) / 1000);\n\n const years = Math.floor(elapsed / (365 * 24 * 60 * 60));\n elapsed = elapsed - years * (365 * 24 * 60 * 60);\n\n // hide years if there haven't been any that have elapsed\n if (years === 0)\n {\n yearsSection.style.display = \"none\";\n }\n\n // calculate months\n const months = Math.floor(elapsed / (30 * 24 * 60 * 60));\n elapsed = elapsed - months * (30 * 24 * 60 * 60);\n\n // hide months if there haven't been any that have elapsed\n if (months === 0 && years === 0)\n {\n monthsSection.style.display = \"none\";\n }\n\n // calculate days\n const days = Math.floor(elapsed / (24 * 60 * 60));\n elapsed = elapsed - days * (24 * 60 * 60);\n\n // hide days if there haven't been any that have elapsed\n if (days === 0 && months === 0)\n {\n daysSection.style.display = \"none\";\n }\n\n // calculate hours\n const hours = Math.floor(elapsed / (60 * 60)); \n elapsed = elapsed - hours * (60 * 60);\n\n // hide hours if there haven't been any that have elapsed\n if (hours === 0 && days === 0)\n {\n hoursSection.style.display = \"none\";\n }\n\n // calculate minutes\n const minutes = Math.floor(elapsed / 60);\n\n // hide minutes if there haven't been any that have elapsed\n if (minutes === 0 && hours === 0)\n {\n minutesSection.style.display = \"none\";\n }\n\n // calculate seconds\n const seconds = elapsed - minutes * 60;\n\n // update progress bar values\n yearsBar.value = years;\n monthsBar.value = months;\n daysBar.value = days;\n hoursBar.value = hours;\n minutesBar.value = minutes;\n secondsBar.value = seconds;\n\n // update time readouts\n yearsDisplay.innerText = `${years} ${years == 1 ? \"year\" : \"years\"}`;\n monthsDisplay.innerText = `${months} ${months == 1 ? \"month\" : \"months\"}`;\n daysDisplay.innerText = `${days} ${days == 1 ? \"day\" : \"days\"}`;\n hoursDisplay.innerText = `${hours} ${hours == 1 ? \"hour\" : \"hours\"}`;\n minutesDisplay.innerText = `${minutes} ${minutes == 1 ? \"minute\" : \"minutes\"}`;\n secondsDisplay.innerText = `${seconds} ${seconds == 1 ? \"second\" : \"seconds\"}`;\n\n // calculate last and next milestones\n let lastMilestone = \"\", nextMilestone = \"\";\n if (days === 0)\n {\n lastMilestone = \"N/A\";\n nextMilestone = \"1 day\";\n }\n else\n {\n // get last multiple of 5 days, or last month\n const last = Math.floor(days / 5) * 5;\n\n // if the last milestone was a month milestone\n if (last % 30 === 0 && last !== 0)\n {\n lastMilestone = `${last / 30} ${last / 30 == 1 ? \"month\" : \"months\"}`;\n }\n else\n {\n // get the one day milestone\n if (last === 0 && days < 5)\n {\n lastMilestone = `1 day`;\n }\n else\n {\n lastMilestone = `${last} days`;\n }\n }\n\n // get next multiple of 5 days, or next month\n const next = Math.ceil(days / 5) * 5;\n if (next % 30 === 0)\n {\n nextMilestone = `${next / 30} ${next / 30 == 1 ? \"month\" : \"months\"}`;\n }\n // if currently on a milestone, add five days to get next milestone\n else if (days % 5 === 0)\n {\n nextMilestone = `${next + 5} days`;\n }\n else\n {\n nextMilestone = `${next} days`;\n }\n }\n\n // update milestone displays\n lastMilestoneEl.innerHTML = lastMilestone;\n nextMilestoneEl.innerHTML = nextMilestone;\n}", "function update_timers(sdelay) {\n if (window.interval_id !== undefined) clearInterval(window.interval_id);\n if (window.timeout_id !== undefined) clearTimeout(window.timeout_id);\n window.lastCheck = new Date().getTime();\n window.interval_id = setInterval(function(){\n var now = new Date().getTime();\n var diff = now - window.lastCheck;\n if (diff > 3000) {\n clearInterval(window.interval_id);\n if ($(\".ui-page-active\").attr(\"id\") == \"#status\") get_status();\n }\n window.lastCheck = now;\n $.each(window.totals,function(a,b){\n if (b <= 0) {\n delete window.totals[a];\n if (a == \"p\") {\n if ($(\".ui-page-active\").attr(\"id\") == \"#status\") get_status();\n } else {\n $(\"#countdown-\"+a).parent(\"p\").text(_(\"Station delay\")).parent(\"li\").removeClass(\"green\").addClass(\"red\");\n window.timeout_id = setTimeout(get_status,(sdelay*1000));\n }\n } else {\n if (a == \"c\") {\n ++window.totals[a];\n $(\"#clock-s\").text(new Date(window.totals[a]*1000).toUTCString().slice(0,-4));\n } else {\n --window.totals[a];\n $(\"#countdown-\"+a).text(\"(\" + sec2hms(window.totals[a]) + \" \"+_(\"remaining\")+\")\");\n }\n }\n });\n },1000);\n}", "displayTime() {\n if(app === 1){\n this.d1.value = this.twoDigitNum(stopwatch.t1);\n this.d2.value = this.twoDigitNum(stopwatch.t2);\n this.d3.value = this.twoDigitNum(stopwatch.t3);\n }\n else{\n this.d1.value = this.twoDigitNum(timer.t1);\n this.d2.value = this.twoDigitNum(timer.t2);\n this.d3.value = this.twoDigitNum(timer.t3);\n }\n }", "function refresh () {\n // If the ticker is not running already...\n if (ticker === 0) {\n // Let's create a new one!\n ticker = self.setInterval(render, Math.round(1000 / 60));\n }\n }", "function myTimer() {\r\n aleph.pyramidYearIndex++;\r\n\r\n if (aleph.pyramidYearIndex > aleph.years.length - 1) {\r\n aleph.pyramidYearIndex = 0;\r\n }\r\n aleph.pyramidYear = aleph.years[aleph.pyramidYearIndex];\r\n\r\n d3.selectAll(\".selected-year\")\r\n .classed(\"aleph-hide\", false)\r\n .text(aleph.pyramidYear);\r\n\r\n $(\"#pyramid-slider\").slider(\"option\", \"value\", aleph.pyramidYear);\r\n transitionPyramidChart();\r\n updateInformationLabels();\r\n }", "function update_timeline(once) {\r\n if (once == undefined) once = false;\r\n determine_now();\r\n tl_update_data();\r\n \r\n // Get context\r\n var g = tl.getContext(\"2d\");\r\n g.clearRect(0,0,TIMELINE_SIZES_WIDTH,TIMELINE_SIZES_FULL_HEIGHT);\r\n g.save();\r\n \r\n // Draw bar\r\n g.translate(TIMELINE_SIZES_WIDTH - 9.5, TIMELINE_SIZES_HISTORY * TIMELINE_SIZES_HEIGHT + .5);\r\n \r\n g.strokeStyle = \"rgb(0,0,0)\";\r\n g.beginPath();\r\n g.moveTo(0,-TIMELINE_SIZES_HISTORY * TIMELINE_SIZES_HEIGHT);\r\n g.lineTo(0, TIMELINE_SIZES_FUTURE * TIMELINE_SIZES_HEIGHT);\r\n g.stroke();\r\n for (var i=-TIMELINE_SIZES_HISTORY - tl_scroll_offset; i<=TIMELINE_SIZES_FUTURE - tl_scroll_offset; i+=1) {\r\n g.beginPath();\r\n l = -2;\r\n ll = 0;\r\n if (i%5 == 0) l-=2;\r\n if (i%15 == 0) l-=2;\r\n if ((i + tl_t_time.getMinutes())%60 == 0) ll+=8;\r\n g.moveTo(l, tl_warp(i + tl_scroll_offset));\r\n g.lineTo(ll, tl_warp(i + tl_scroll_offset)); \r\n g.stroke();\r\n }\r\n\r\n // Draw times\r\n g.mozTextStyle = \"8pt Monospace\";\r\n function round15(i){ return Math.floor(i/15)*15;}\r\n function drawtime(i, t) {\r\n h = t.getHours()+\"\";\r\n m = t.getMinutes()+\"\";\r\n if (m.length==1) m = \"0\" + m;\r\n x = h+\":\"+m;\r\n\r\n g.save();\r\n g.translate(-g.mozMeasureText(x) - 10, 4 + tl_warp(i + tl_scroll_offset));\r\n g.mozDrawText(x); \r\n g.restore(); \r\n }\r\n for (var i=round15(-TIMELINE_SIZES_HISTORY - tl_scroll_offset);\r\n i <= round15(TIMELINE_SIZES_FUTURE - tl_scroll_offset); i+=15) {\r\n t = new Date(tl_t_time);\r\n t.setMinutes(t.getMinutes() + i);\r\n drawtime(i, t);\r\n }\r\n\r\n // Draw current time\r\n diff = (tl_c_time.getTime() - tl_t_time.getTime()) / 1000 / 60;\r\n if (diff+tl_scroll_offset >= -TIMELINE_SIZES_HISTORY && diff+tl_scroll_offset <= TIMELINE_SIZES_FUTURE){\r\n y = tl_warp(diff + tl_scroll_offset);\r\n\r\n g.strokeStyle = \"rgb(0,0,255)\";\r\n g.beginPath();\r\n g.moveTo(-8, y);\r\n g.lineTo( 4, y);\r\n g.lineTo( 6, y-2);\r\n g.lineTo( 8, y);\r\n g.lineTo( 6, y+2);\r\n g.lineTo( 4, y);\r\n g.stroke();\r\n\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n drawtime(diff, tl_c_time);\r\n\r\n // Highlight the 'elapsed time since last refresh'\r\n diff2 = (script_start_time - tl_t_time.getTime()) / 1000 / 60;\r\n y2 = tl_warp(diff2 + tl_scroll_offset);\r\n g.fillStyle = \"rgba(0,128,255,0.1)\";\r\n g.fillRect(9-TIMELINE_SIZES_WIDTH, y,TIMELINE_SIZES_WIDTH+1, y2-y);\r\n }\r\n\r\n unit = new Array(17);\r\n for (i=1; i<12; i++) {\r\n unit[i] = new Image();\r\n if (i==11)\r\n unit[i].src = \"img/un/u/hero.gif\";\r\n else\r\n unit[i].src = \"img/un/u/\"+(RACE*10+i)+\".gif\";\r\n }\r\n\r\n for (i=13; i<17; i++) {\r\n unit[i] = new Image();\r\n unit[i].src = \"img/un/r/\"+(i-12)+\".gif\";\r\n }\r\n\r\n\r\n function left(q) {\r\n if (q.constructor == Array)\r\n return q[0]-q[1];\r\n else\r\n return q-0;\r\n }\r\n\r\n // Draw data\r\n for (e in events) {\r\n p = events[e];\r\n diff = (e - tl_t_time.getTime()) / 1000 / 60 + tl_scroll_offset;\r\n if (diff<-TIMELINE_SIZES_HISTORY || diff>TIMELINE_SIZES_FUTURE) continue;\r\n y = tl_warp(diff);\r\n y = Math.round(y);\r\n g.strokeStyle = TIMELINE_EVENT_COLORS[p[0]];\r\n g.beginPath();\r\n g.moveTo(-10, y);\r\n g.lineTo(-50, y); \r\n g.stroke();\r\n \r\n g.fillStyle = \"rgb(0,128,0)\";\r\n var cap = 60*left(p[1])+40*left(p[2])+110*left(p[5]) - ((p[13]-0)+(p[14]-0)+(p[15]-0)+(p[16]-0));\r\n cap = (cap<=0)?\"*\":\"\";\r\n g.save();\r\n g.translate(20 - TIMELINE_SIZES_WIDTH - g.mozMeasureText(cap), y+4);\r\n g.mozDrawText(cap + p[12]);\r\n g.restore();\r\n\r\n if (p[17]) {\r\n g.fillStyle = \"rgb(0,0,128)\";\r\n g.save();\r\n g.translate(20 - TIMELINE_SIZES_WIDTH, y-5);\r\n g.mozDrawText(p[17]);\r\n g.restore();\r\n }\r\n\r\n if (SHOW_TIMELINE_REPORT_INFO) {\r\n g.fillStyle = \"rgb(64,192,64)\";\r\n g.save();\r\n g.translate(-40, y+4+12); // Move this below the message.\r\n for (i = 16; i>0; i--) {\r\n if (i==12)\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n else if (p[i]) {\r\n try {\r\n g.translate(-unit[i].width - 8, 0);\r\n g.drawImage(unit[i], -0.5, Math.round(-unit[i].height*0.7) -0.5);\r\n } catch (e) {\r\n // This might fail if the image is not yet or can't be loaded.\r\n // Ignoring this exception prevents the script from terminating to early.\r\n var fs = g.fillStyle;\r\n g.fillStyle = \"rgb(128,128,128)\";\r\n g.translate(-24,0);\r\n g.mozDrawText(\"??\");\r\n g.fillStyle = fs;\r\n }\r\n if (p[i].constructor == Array) {\r\n g.fillStyle = \"rgb(192,0,0)\";\r\n g.translate(-g.mozMeasureText(-p[i][1]) - 2, 0);\r\n g.mozDrawText(-p[i][1]);\r\n g.fillStyle = \"rgb(0,0,255)\";\r\n g.translate(-g.mozMeasureText(p[i][0]), 0);\r\n g.mozDrawText(p[i][0]);\r\n } else {\r\n g.translate(-g.mozMeasureText(p[i]) - 2, 0);\r\n g.mozDrawText(p[i]);\r\n }\r\n }\r\n }\r\n }\r\n g.restore();\r\n }\r\n g.restore();\r\n if (KEEP_TIMELINE_UPDATED && once != true) {\r\n setTimeout(update_timeline,TIMELINE_UPDATE_INTERVAL);\r\n }\r\n }", "function tick() {\n if((timer <= 0)) clearInterval(tick_ref);\n\n displayTimer();\n\n let style = \"\";\n\n timer--;\n\n progressbarPosition = map(timer, 0, total_time, 0, 100);\n\n style += \"--progress-position: \" + (-progressbarPosition) + \"%;\";\n\n if(timer <= 0) {\n style = \"--progress-position: 0%;\"\n }\n\n // Change color\n if(timer < 30 && timer >= 10) {\n style += \"--progress-color: var(--progress-warn);\";\n }\n if(timer < 10) {\n style += \"--progress-color: var(--progress-stop);\";\n }\n // apply css changes to DOM\n let html = document.getElementsByTagName('html')[0];\n html.style.cssText = style;\n}", "refreshTime() {\n if (this._game.isRun()) {\n this._view.setValue(\"time\", this._game.timeElapsed);\n }\n }", "function updateAll() {\n updateDots(tracker);\n \n //set width of slidewindow to 100%\n slidewindow.style.width = \"100%\";\n \n //Get current width and height\n var curWidth = slides[0].offsetWidth;\n var curHeight = slides[0].offsetHeight;\n \n //set current w/h of slidewindow to match slide\n slidewindow.style.width = curWidth + \"px\";\n slidewindow.style.height = curHeight + \"px\";\n \n //set position of each slide\n for (var i = 0; i < slides.length; i++) {\n // console.log(slides[i].style.transform)\n slides[i].style.transform = \"translateX(\" + (i * curWidth + tracker * curWidth) + \"px )\";\n }\n }", "function update() {\n me.stop(); // determine interval to refresh\n\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n me.redraw();\n me.body.emitter.emit('currentTimeTick'); // start a renderTimer to adjust for the new time\n\n me.currentTimeTimer = setTimeout$2(update, interval);\n }", "function timer() {\r\n\ttimerId = window.setInterval(\"updateTime()\", 1000);\r\n}", "function render() {\n timer.innerHTML = (clock / 1000).toFixed(3);\n }", "function showTimer() {\n changeTimer();\n}", "init() {\n this.build();\n this.container.querySelector('.progress-bar__start').innerHTML = this.timer.startDate.toLocaleDateString();\n this.container.querySelector('.progress-bar__end').innerHTML = this.timer.endDate.toLocaleDateString();\n\n let loop = true;\n const interval = setInterval(() => {\n loop = this.updateProgressBarView();\n if (!loop) {\n clearInterval(interval);\n }\n }, 1000);\n }", "function _updateStatsSurface(){\n Timer.setInterval(function(){\n placeID = getSelectedPlace();\n // update stats panel\n this.statsSurface.setContent(getRecord(this.options.placeStats, placeID))\n }.bind(this), 250)\n }", "function updateColors() {\n var today = new Date();\n var timeNow = today.getHours();\n //${i} for assigning to the style.css and added classes\n for (var i = 9; i < 18; i++) {\n //current time\n if ($(`#${i}`).data(\"time\") == timeNow) {\n $(`#text${i}`).addClass(\"present\");\n //future time\n } else if (timeNow < $(`#${i}`).data(\"time\")) {\n $(`#text${i}`).addClass(\"future\");\n }\n }\n }", "function updateViews(){\r\n\treloadBall();\r\n\treloadCalendar();\r\n\treloadWordle();\r\n}", "update (dt) {\n // This thing is called over and over again byt the game engine. If it's not there, nothing shows\n }", "function show()\n{\n // Restart any timers that were stopped on hide\n}", "function show()\n{\n // Restart any timers that were stopped on hide\n}", "function show()\n{\n // Restart any timers that were stopped on hide\n}", "async updateTimebar() {\n this.timeText = await this.time.getCurrentTime();\n this.tag('Time').patch({ text: { text: this.timeText } });\n }", "update(remainingSeconds) {\n let formatted = null;\n\n if (remainingSeconds >= 60)\n formatted = format('%d:%02d', Math.floor(remainingSeconds / 60), remainingSeconds % 60);\n else if (remainingSeconds > 0)\n formatted = format('%d', remainingSeconds);\n else\n formatted = 'FINISHED';\n\n // (1) Update the text of the text draw for future players.\n this.#element_.text = formatted;\n\n // (2) Determine if the background colour of the text draw has to change.\n let colourUpdate = null;\n\n if (remainingSeconds <= 10 && this.#element_.boxColor !== kStressedBackgroundColor)\n colourUpdate = kStressedBackgroundColor;\n else if (remainingSeconds > 10 && remainingSeconds <= 30) {\n if (this.#element_.boxColor !== kHighlightedBackgroundColor)\n colourUpdate = kHighlightedBackgroundColor;\n }\n\n if (colourUpdate)\n this.#element_.boxColor = colourUpdate;\n\n // If a colour change happened, we have to completely re-show the text draw for all the\n // participants. Otherwise we just update the text to its new value.\n for (const player of this.#players_) {\n if (colourUpdate) {\n this.#element_.hideForPlayer(player);\n this.#element_.displayForPlayer(player);\n } else {\n this.#element_.updateTextForPlayer(player, formatted);\n }\n }\n }", "function displayChanged() {\n if (display.on) {\n startTimer();\n } else {\n stopTimer();\n }\n}", "function update_time()\n{\n\t$('.cronos').each(function() {\n\t\tvar name = $(this).attr(\"name\");\n\t\tvar estado = parseInt($(this).attr(\"estado\"));\n\t\tvar time = $(this).val();\n\t\tvar ID = name.substring(6); // a partir de la 6 posicio\n\t\tvar capa = '#time_'+ID;\n\t\tvar capabotons = '#capabotons_'+ID;\n\t\t\n\t\t// color\n\t\tvar color = \"blue\";\n\t\tif (time<3600) color = \"orange\";\n\t\tif (time<300) color = \"red\";\n\t\t$(capa).html(strtotime(time));\n\t\t$(capa).css(\"color\", color);\n\t\t$(this).val(time-1);\n\t\tif (time<0 && estado < 5)\n\t\t\t$(capabotons).hide();\t\n\t});\t\n}", "function drawTimeGrid() {\n timeGrid.innerHTML = \"\";\n updateDateAndTz();\n fillDays();\n makeRows(25, difference + 1);\n }", "@autobind\n updateTimeAndColorTime(event) {\n this.updateTime();\n this.updateColorTime(event, false);\n }", "function init() {\n\tsetInterval(updateUI, 2000);\t\n}", "function updateStats() {\n let contents = \"Restarts: \" + restarts;\n $(\"#restarts\").text(contents);\n\n contents = \"Endings: \" + endings.length + \"/\" + TOTAL_ENDINGS;\n $(\"#totalEndings\").text(contents);\n}", "function delayRedraw() {\n clearTimeout(timer);\n timer = setTimeout(redraw, 25);\n }", "function delayRedraw() {\n clearTimeout(timer);\n timer = setTimeout(redraw, 25);\n }", "function delayRedraw() {\n clearTimeout(timer);\n timer = setTimeout(redraw, 25);\n }", "onTimeChanged () {\n this.view.renderTimeAndDate();\n }", "function updatePanel() {\n if(panelTimer.expired()) {\n table[r1][r2] = 0;\n // set new \"mole\"\n randomizePanel();\n // set random color\n setRandomColor();\n // reset timer\n panelTimer.start();\n }\n}", "function updateTime() {\n var strHours = document.getElementById(\"str-hours\"),\n strConsole = document.getElementById(\"str-console\"),\n strMinutes = document.getElementById(\"str-minutes\"),\n datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes();\n\n strHours.innerHTML = hour;\n strMinutes.innerHTML = minute;\n\n if (minute < 10) {\n strMinutes.innerHTML = \"0\" + minute;\n }\n if (hour < 10) {\n \t\tstrHours.innerHTML = \"0\" + hour;\n }\n\n if (flagDigital) {\n strConsole.style.visibility = flagConsole ? \"visible\" : \"hidden\";\n flagConsole = !flagConsole;\n } else {\n strConsole.style.visibility = \"visible\";\n flagConsole = false;\n }\n }", "function visualisationUpdateLoop() {\n getGoldEvents();\n getHeroPositions();\n visualisationSize = document.getElementById('visualisationDiv').offsetWidth;\n //generateRadiantGoldHeatmap();\n //generateDireGoldHeatmap();\n //generateRadiantControlHeatmap();\n gRCHU();\n //generateDireControlHeatmap();\n getObserverData();\n getHealthData();\n // drawPlayers();\n\n // console.log(\"loop!\");\n}", "function myTimer()\n {\n var d = new Date();\n var n = d.getSeconds();\n if (n % 2 === 0) {\n showMapLayer(keyLayer);\n } else {\n hideMapLayer(keyLayer);\n }\n }", "setDisplayManually() {\n if(!this.app.isRunning){\n this.app.t1 = parseInt(this.d1.value);\n this.app.t2 = parseInt(this.d2.value);\n this.app.t3 = parseInt(this.d3.value); \n } \n }", "function update() {\n redrawView(evalContainer, evalVis, evalData);\n redrawView(detailContainer, detailVis, detailData);\n redrawView(messageContainer, messageVis, messageData);\n }", "function onTimeSelectionChange() {\n drawTimeBlocks();\n drawInfoBox(timeSelectionControl.value);\n updateTimeSelectionIndicator(timeSelectionControl.value);\n }", "function startTime2() {\n if (t == 0) {\n //h, m and s are assigned to the real time\n var today = new Date();\n h = today.getHours();\n m = today.getMinutes();\n s = today.getSeconds();\n }\n if (t == 1) { \n //h, m and s are assigned to the set time\n h = hSetTime;\n m = mSetTime;\n s = sSetTime; \n }\n\n\t\t\tseconds.animate({transform: [ 'r',((s*6) + 180),200,200]}); //secondhand animation\n\t\t\tminutes.animate({transform: ['r',((m*6) + 180),200,200]}); //minute hand animation\n\t\t\thours.animate({transform: ['r',((h*30) + 180),200,200]}); //hours hand animation\t\t\n\t\t\t\n\t\t\tsetTimeout(function(){startTime2()}, 250); //funtion refreshes at 1/4 second intervals\n\n //Changes the AM/PM text depending on the time\n\t\t\tif (h < 12){\n ampmtxt.attr({text: \"AM\", \"font-size\": 15, fill: outline1 });\n\t\t\t} else {\n ampmtxt.attr({text: \"PM\" , \"font-size\": 15, fill: outline1});\n\t\t\t}\t\n\t\t}", "function updateTime() {\n\n}", "function timer() {\n footballCrowd();\n timerId = setInterval(() => {\n time--;\n $timer.html(time);\n\n if(time === 0) {\n restart();\n lastPage();\n }\n }, 1000);\n highlightTiles();\n }", "function updateTimerLengths() {\n if (sessionLength < 0) {\n sessionLength = 0;\n }\n if (breakLength < 0) {\n breakLength = 0;\n }\n $('#worklength').html(sessionLength / 60);\n $('#breaklength').html(breakLength / 60);\n }", "function updateAll() {\n refreshSliderDimensions();\n ngModelRender();\n redrawTicks();\n }", "function displayTime() {\n $(\"tbody\").empty();\n setInterval(displayTime, 10 * 1000);\n $(\"#currentTime\").html(\"<h2>\" + moment().format(\"hh:mm a\") + \"</h2>\");\n displayTrain();\n }", "function run(){\n\ttime++;\n\t\n\tgreen -= colorGap;\n\tred += colorGap;\n\ttimeBarLength -= barDecriment;\n\tupdateTimeBar();\n}", "function loadAll() {\r\n variables.alarm.loop = true;\r\n updateTime(variables.updatedTime);\r\n let status = document.getElementById('status');\r\n variables.statDisp = status;\r\n for (var i = 0; i < variables.changer.length; i++) {\r\n variables.changer[i].addEventListener('click', timeChange, false);\r\n }\r\n variables.startBtn.addEventListener('click', function() {\r\n if (!variables.alarm.paused) variables.alarm.pause();\r\n addDisplay();\r\n startPause.call(this);\r\n });\r\n variables.resetBtn.addEventListener('click', reset);\r\n }", "function updateTime() {\n let date = getToday();\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let seconds = date.getSeconds();\n\n hours = addZero(hours);\n minutes = addZero(minutes);\n seconds = addZero(seconds);\n\n document.querySelector(\".date .time\").innerText = hours + \":\" + minutes + \":\" + seconds;\n // $('.date .time').text(`${hours}:${minutes}:${seconds}`);\n update = setTimeout(function () { updateTime() }, 500)\n}", "updateVisibleTime(ts) {\n\t const startSec = Math.max(ts.start, globals.globals.state.traceTime.startSec);\n\t const endSec = Math.min(ts.end, globals.globals.state.traceTime.endSec);\n\t this.visibleWindowTime = new time.TimeSpan(startSec, endSec);\n\t this.timeScale.setTimeBounds(this.visibleWindowTime);\n\t this._visibleTimeLastUpdate = Date.now() / 1000;\n\t // Post a delayed update to the controller.\n\t const alreadyPosted = this.pendingGlobalTimeUpdate !== undefined;\n\t this.pendingGlobalTimeUpdate = this.visibleWindowTime;\n\t if (alreadyPosted)\n\t return;\n\t setTimeout(() => {\n\t this._visibleTimeLastUpdate = Date.now() / 1000;\n\t globals.globals.dispatch(actions.Actions.setVisibleTraceTime({\n\t startSec: this.pendingGlobalTimeUpdate.start,\n\t endSec: this.pendingGlobalTimeUpdate.end,\n\t lastUpdate: this._visibleTimeLastUpdate,\n\t }));\n\t this.pendingGlobalTimeUpdate = undefined;\n\t }, 100);\n\t }", "displayTimer(){\n this.final_timer = `${this.year}-${this.month}-${this.date} Time : ${this.hours}:${this.mins}:${this.seconds}`;\n }", "async updateUi() {\n this.$div.find('.stats-match').text(this.stats.match);\n this.$div.find('.stats-time').text(convertTimeToText(this.stats.matchTime, 1));\n this.$div\n .find('.stats-match-duration')\n .text(convertTimeToText(this.stats.lastDurations.getAverage(), 1));\n\n return new Promise(resolve => {\n window.requestAnimationFrame(resolve);\n });\n }", "function displayTimer(){\n\t\tif(!timerOn){\n\t\t\treturn;\n\t\t}\n\t\tdocument.getElementById(\"numeric\").innerHTML=\"<h1>\"+count+\"</h1>\";\n\t\tdocument.bgColor = window.location.hash.substring(1) === 'fullbg' ? 'darkred' : '';\n\t\tif(count==0){\n\t\t\tstartT=(new Date()).getTime();\n\t\t}\n\t\tcount +=100;\n\t\tif(count>maxResponseTime){\n\t\t\tresetDisplayTimer();\n\t\t\treturn;\n\t\t}\n\t\tt=setTimeout(\"displayTimer()\", 100);\n\t}", "function dataUpdate(){ \n updateRunStatus();\n repaint();\n}", "function updateTimer(){\n stage.update(); \n}", "function update() {\n animateElements.animateHeroTxt();\n animateElements.animateHeroImg();\n animateElements.handleFooter();\n\n // allow further rAFs to be called\n ticking = false;\n}", "function incrementTimer() {\n globalTimer += SAMPLE_RATE / 1000;\n graphs.update(); //measure voltages and add them to graph\n}", "function updateAll() {\r\n updateDots(tracker);\r\n\r\n //set width of slidewindow to 100%\r\n slidewindow.style.width = \"100%\";\r\n\r\n //Get current width and height\r\n var curWidth = slides[0].offsetWidth;\r\n var curHeight = slides[0].offsetHeight;\r\n\r\n //set current w/h of slidewindow to match slide\r\n slidewindow.style.width = curWidth + \"px\";\r\n slidewindow.style.height = curHeight + \"px\";\r\n\r\n //set position of each slide\r\n for (var i = 0; i < slides.length; i++) {\r\n console.log(slides[i].style.transform)\r\n slides[i].style.transform = \"translateX(\" + (i * curWidth + tracker * curWidth) + \"px )\";\r\n }\r\n }", "function updatetimer(i) {\n var now = new Date();\n var then = timers[i].eventdate;\n var diff = count=Math.floor((then.getTime()-now.getTime())/1000);\n \n // catch bad date strings\n if(isNaN(diff)) {\n timers[i].firstChild.nodeValue = '** ' + timers[i].eventdate + ' **' ;\n return;\n }\n \n // determine plus/minus\n if(diff<0) {\n diff = -diff;\n var tpm = 'T plus ';\n } else {\n var tpm = 'T minus ';\n }\n \n // calcuate the diff\n var left = (diff%60) + ' seconds';\n diff=Math.floor(diff/60);\n if(diff > 0) left = (diff%60) + ' minutes ' + left;\n diff=Math.floor(diff/60);\n if(diff > 0) left = (diff%24) + ' hours ' + left;\n diff=Math.floor(diff/24);\n if(diff > 0) left = diff + ' days ' + left\n timers[i].firstChild.nodeValue = tpm + left;\n \n // a setInterval() is more efficient, but calling setTimeout()\n // makes errors break the script rather than infinitely recurse\n timeouts[i] = setTimeout('updatetimer(' + i + ')',1000);\n }", "function update_counter() {\n let time = remaining_time(); //get the time object\n\n //adds zero in front of the time measure unit if it displays less than 2 symbols\n function add_zero(measure_unit) {\n let unit; //variable needed to store different data from the time object depending on function argument\n\n if (measure_unit == hours){\n unit = time.hours; //stores the hours\n } else if (measure_unit == minutes) {\n unit = time.minutes; //stores the minutes\n } else if (measure_unit == seconds) {\n unit = time.seconds; //stores the seconds\n }\n\n //function returns additional zero symbol if 'unit' variable value are less than 10\n return (unit < 10) ? measure_unit.innerText = '0' + unit : measure_unit.innerText = unit;\n }\n\n //if delta time is over stops update function and display zero to every time measure unit\n if (time.total < 0) {\n clearInterval(update_time);\n time.hours = time.minutes = time.seconds = 0;\n }\n\n //adding zero to every displayed measure unit\n add_zero(hours);\n add_zero(minutes);\n add_zero(seconds);\n }" ]
[ "0.7118416", "0.6842594", "0.68326455", "0.68129057", "0.6699384", "0.6657453", "0.6656695", "0.65983874", "0.6570122", "0.65315324", "0.6479246", "0.64557", "0.6449253", "0.64016545", "0.63803715", "0.63573533", "0.633589", "0.63297486", "0.6316345", "0.63009256", "0.62910414", "0.6247338", "0.6242244", "0.6230051", "0.62265176", "0.62247103", "0.6212565", "0.6206702", "0.6193718", "0.6186779", "0.61867416", "0.6179892", "0.6174459", "0.6169951", "0.61522716", "0.61487156", "0.6143286", "0.6143077", "0.61251664", "0.61202025", "0.6116122", "0.6113103", "0.6113003", "0.6108976", "0.6108801", "0.61080647", "0.60982907", "0.6093785", "0.60935587", "0.60651773", "0.606468", "0.606129", "0.6058563", "0.60553396", "0.6044818", "0.6043945", "0.60429895", "0.604228", "0.60397637", "0.60347843", "0.60347843", "0.60347843", "0.60325634", "0.60273355", "0.6010285", "0.6005833", "0.5995803", "0.5995667", "0.59930676", "0.59928775", "0.5988283", "0.5988283", "0.5988283", "0.5977384", "0.5975877", "0.5970047", "0.5966287", "0.5961263", "0.59580165", "0.5950799", "0.5945847", "0.59385705", "0.5938555", "0.5935419", "0.59330314", "0.5931015", "0.59309095", "0.59292054", "0.5921761", "0.59214646", "0.59209", "0.5912919", "0.59118706", "0.59061843", "0.5905041", "0.5902877", "0.590232", "0.5893295", "0.58905816", "0.5885313", "0.58851814" ]
0.0
-1
playpause toggle of the video element
function action_toggle_play() { if (video.paused) { video.play(); change_icon('play'); } else { video.pause(); change_icon('pause'); } delay = delay_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "toggle () {\n if (this.video.paused) {\n this.play();\n }\n else {\n this.pause();\n }\n }", "function togglePlayPause() {\r\n if (video.paused) {\r\n playVideo();\r\n } else {\r\n pauseVideo();\r\n }\r\n}", "function togglePlay() {\n video[video.paused ? 'play' : 'pause']();\n}", "function pauseToggle(){\n\n\t\t//test if the video is currently playign or paused\n\t\t// posted propter - boolen\n\n\t\tif(vid.paused){\n\n\t\t\t//if paused then play the video\n\t\t\tvid.play();\n\n\t\t}else{\n\n\t\t\t//video is the\n\t\t}\n}", "function togglePlay() {\n video.paused ? video.play() : video.pause();\n}", "function toggle_play_pause(ev)\n {\n ev.preventDefault();\n if (video_elt.paused || video_elt.ended) play_video(); else pause_video();\n }", "function toggleplay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function togglePlay() {\n const isPaused = video.paused ? true : false; //paused is a property on video\n \n if (isPaused) { \n video.play();\n } else {\n video.pause();\n }\n}", "function togglePlayPause() {\n if (video.paused || video.ended) {\n playpause.title = 'pause';\n playpause.innerHTML = '<img src=\"icons/pause-icon.png\">';\n playpause.className = 'pause';\n video.play();\n}\n else {\n playpause.title = 'play';\n playpause.innerHTML = '<img src=\"icons/play-icon.png\">';\n playpause.className = 'play';\n video.pause();\n }\n}", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function togglePlay() {\n const method = video.paused ? 'play' : 'pause' ;\n video[method]();\n}", "function togglePauseVideo() {\n const videoEl = document.querySelector('video');\n if(videoEl) {\n if (videoEl.paused) videoEl.play();\n else videoEl.pause();\n }\n }", "function togglePlayPause() {\n var video = document.getElementById(\"Video\");\n if (video.paused || video.ended) {\n video.play();\n }\n else {\n video.pause();\n }\n}", "function toggleVideoState() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n\n }", "function togglePlay() {\n if (elements.video.paused) {\n elements.video.play();\n elements.playBtn.classList.replace('fa-play', 'fa-pause');\n elements.playBtn.setAttribute('title', 'Pause');\n } else {\n elements.video.pause();\n showPlayIcon();\n }\n}", "function togglePlay() {\n // If video is paused play it or pause it\n // `.paused` property is used because there is no play property\n return video.paused ? video.play() : video.pause(); // My solution\n // Wes's solution\n // const method = video.paused ? 'play' : 'pause';\n // video[method]();\n}", "function toggleVideoStatus(){\n if(video.paused){\n video.play();\n }else {\n video.pause();\n }\n}", "function togglePlay() {\n // if (selectors.video.paused) {\n // selectors.video.play();\n // } else {\n // selectors.video.pause();\n // }\n\n const method = selectors.video.paused ? \"play\" : \"pause\";\n selectors.video[method]();\n}", "function togglePlayPause() {\n\tvar button = document.getElementById(\"play-pause-btn\");\n\t\n\t/* || is &, . is = */\n\tif (videoPlayer.paused || videoPlayer.ended) {\n\t\tchangeButton(button, \"&#10074;&#10074;\");\n\t\tvideoPlayer.play();\n\t\t\n\t} else {\n\t\tchangeButton(button,\"&#9654;\");\n\t\tvideoPlayer.pause();\n\t}\n}", "function toggleVideoStatus() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n}", "function togglePlay() {\n\t// Selecting the right method\n\tconst method = video.paused ? 'play' : 'pause';\n\t// Calling the finction\n\tvideo[method]();\n}", "function togglePlay() {\n if(isPlaying) {\n domVideo.pause();\n isPlaying = false;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/play.png\" />';\n } else {\n domVideo.play();\n isPlaying = true;\n playButton.innerHTML = '<img src=\"video-plugin/video-img/pause.png\" />';\n }\n}", "function togglePlay(){\n console.log(\"working? togglePlay fn\")\n const method = video.paused ? 'play' : 'pause';\n video[method]();\n}", "function togglePause() {\r\n //Toggle play state\r\n //Pause\r\n if (paused === true) {\r\n //Update playing boolean\r\n paused = false;\r\n //Change play button text\r\n pauseBtn.innerText = \"Pause\";\r\n }\r\n //Play\r\n else {\r\n //Update paused boolean\r\n paused = true;\r\n //Change play button text\r\n pauseBtn.innerText = \"Resume\";\r\n }\r\n}", "function togglePlayback() {\n if(vm.mediaElement.paused) {\n vm.mediaElement.play();\n } else {\n vm.mediaElement.pause();\n }\n }", "togglePause () {\n this.paused = !this.paused\n }", "function toggleVid() {\n if (playing) {\n earring.pause();\n button.html('play');\n } else {\n earring.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function togglePlayVideo() {\n let icon = playbtn.querySelector('.video-ctrl-bt');\n if(video.paused) {\n videoduration = convertSecondsToMinutes(video.duration);\n overvideo.style.backgroundColor = 'transparent';\n video.play();\n playToPauseBtn(icon);\n videobtn.style.display = 'none';\n addVideoListeners();\n outVideoControl();\n videoPlaying = true;\n }\n else {\n video.pause();\n pauseToPlayBtn(icon);\n videobtn.style.display = 'block';\n removeVideoListeners();\n videoCtrlTl.reverse();\n videoPlaying = false;\n }\n }", "function toggleVid() {\n if (playing) {\n myVideo.pause();\n button.html('play');\n } else {\n myVideo.loop();\n button.html('pause');\n }\n playing = !playing;\n}", "function togglePlay() {\n const playPause = document.querySelector('.play-pause');\n\n if (video.paused === true) {\n video.play();\n playPause.classList.add('state-pause');\n playPause.classList.remove('state-play');\n } else {\n video.pause();\n playPause.classList.add('state-play');\n playPause.classList.remove('state-pause');\n }\n}", "function togglePlay() {\r\n\tif (video.paused) { //paused is a video property, not play\r\n\t\tvideo.play();\r\n\t} else {\r\n\t\tvideo.pause();\r\n\t}\r\n//the short way:\r\n//const method = video.paused ? 'play' : 'pause';\r\n//video[method]();\r\n}", "function pauseVid() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function togglePlay() {\n if (video.paused) {\n video.play();\n } else {\n video.pause();\n }\n\n // or other way to do this same thing \n /*const method =video.paused?'play':'pause';\n video[method]();*/\n}", "function VideoPlayPause() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "pause() {\n this.video.pause();\n }", "playPauseVideo() {\n if (this.state.showPlay) {\n this.refs.video.play();\n this.setState({\n showPlay: false\n })\n }\n else {\n this.refs.video.pause();\n this.setState({\n showPlay: true\n })\n }\n }", "function videoPause() {\n video.pause();\n }", "function videoPause() {\n video.pause();\n }", "function togglePlayVideo()\r\n\t{\r\n\t\t //if statement; outcome differs depending on conditions\r\n\t\tif ( myVideo.paused === true ) //video is paused\r\n\t\t{\r\n\t\t\tmyVideo.play(); //the DOM play method plays the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9616;&#9616;\"; //updates inside HTML button selector: turns into a pause icon made from two same Unicode characters\r\n\t\t\tisPaused = false; //boolean variable is assigned to false\r\n\t\t}\r\n\t\telse //if the video is playing\r\n\t\t{\r\n\t\t\tmyVideo.pause(); //the DOM pause method pauses the video, when clicked\r\n\t\t\tplayButton.innerHTML = \"&#9658;\" ; //updates inside HTML button selector when clicked: turns into a right-pointing pointer made from single Unicode character\r\n\t\t\tisPaused = true; //boolean variable is assigned to true\r\n\t\t} //ends if statement\r\n\t} //ends function \"togglePlayVideo\"", "function play_pause(event) {\n video = event.target.previousSibling\n\n button = event.target\n if (video.paused == true) {\n // $('body > *').find('video').not(video).pause()\n\n //Play the video\n video.play();\n //Change to pause button\n $(button).removeClass('play').addClass('pause');\n\n if (settings.fullscreen) {\n if (video.requestFullscreen) {\n video.requestFullscreen();\n } else if (video.mozRequestFullScreen) {\n video.mozRequestFullScreen(); // Firefox\n } else if (video.webkitRequestFullscreen) {\n video.webkitRequestFullscreen(); // Chrome and Safari\n }\n }\n } else {\n video.pause();\n //Change to play button\n $(button).removeClass('pause').addClass('play');\n }\n }", "function togglePause() {\n\n if (isPaused()) {\n resume();\n }\n else {\n pause();\n }\n\n }", "toggleVideo() {\n var self = this;\n\n if (self.get('isPlaying')) {\n self.get('Player').pauseVideo();\n self.set('isPlaying', false);\n\n self.get('$progressBar').stop();\n Ember.run.cancel(self.vidClock);\n } else {\n self.get('Player').playVideo();\n self.set('isPlaying', true);\n }\n }", "function togglePause() {\n var e = document.getElementById('pause');\n\n if (gba.paused) {\n gba.runStable();\n e.textContent = \"PAUSE\";\n } else {\n gba.pause();\n e.textContent = \"UNPAUSE\";\n }\n }", "pause(){\n if(this._isRunning && !this._isPaused){\n this._isPaused = true;\n this._togglePauseBtn.classList.add(\"paused\");\n this.onPause();\n }\n }", "function toggleVid() {\n if (playing) {\n currVid.pause();\n //currVid.hide()\n } else {\n //currVid.show()\n currVid.play();\n }\n playing = !playing;\n}", "function toggleVideoPlayback(e){\n\tif (e.source.playing) {\n\t\te.source.pause();\n\t} else {\n\t\te.source.play();\n\t}\n}", "play() {\n this.paused = false;\n }", "function togglePause() {\n if (loading) {\n return;\n }\n\n if (parseInt(controls.style.bottom,10) === 0) {\n video.play(1);\n // Delay hidding the controls a bit to make it more fluent\n setTimeout(function() {\n hideControls();\n }, 1000);\n }\n else {\n video.play(0);\n showControls('PAUSED');\n }\n }", "function videoClick(){\n\tif(video.paused){\n\t\tplayVideo();\n\t}else{\n\t\tpauseVideo();\n\t}\n}", "function pause_video()\n {\n if (video_elt.pause) { // A VIDEO or AUDIO element\n video_elt.pause();\n } else { // An IFRAME\n video_elt.contentWindow.postMessage([\"pause\"], \"*\");\n video_elt.paused = true;\n video_elt.dispatchEvent(new Event(\"pause\")); // Synthesize our own event\n }\n }", "toggle() {\n return this.paused ? this.resume() : this.pause();\n }", "function pauseOn()\n\t\t\t{\n\t\t\t\tpause = true;\n\t\t\t\tq.find(\".x-controls .pause\").hide();\n\t\t\t\tq.find(\".x-controls .play\").show();\n\t\t\t}", "toggle(event) {\n if (this.playing) {\n this.pause();\n }\n else {\n this.play();\n }\n this.playing = !this.playing;\n }", "function ifVideoTogglePlay() {\n if (video.paused || video.ended) {\n video.play();\n videoContainer.classList.add('is-active');\n videoContainer.classList.remove('is-paused');\n } else {\n video.pause();\n videoContainer.classList.remove('is-active');\n videoContainer.classList.add('is-paused');\n }\n }", "function togglePlayPause() {\n let playPauseButton = document.getElementById('play-pause-button');\n if (player.paused || player.ended) {\n changeButtonType(playPauseButton, 'Pause');\n player.play();\n }\n else {\n changeButtonType(playPauseButton, 'Play');\n player.pause();\n }\n}", "function togglePlay() {\n var theSVG = this.firstElementChild;\n poster.classList.add('hide');\n videoControls.classList.remove('invisible');\n vidPlayer.classList.remove('hide');\n\n if (vidPlayer.paused) {\n theSVG.dataset.icon = \"pause-circle\";\n vidPlayer.play();\n } else {\n theSVG.dataset.icon = \"play-circle\";\n vidPlayer.pause();\n }\n }", "async _togglePause() {\n if (this.state.done) {\n if (this.state.paused) {\n this._play()\n } else {\n this._pause()\n }\n }\n }", "function myFunction() {\r\nif (video.paused) {\r\n video.play();\r\n btn.innerHTML = \"Pause\";\r\n} else {\r\n video.pause();\r\n btn.innerHTML = \"Play\";\r\n}\r\n}", "togglePlayPause() {\n let state = this.player.paused || this.player.ended;\n if (state) {\n this.play();\n } else {\n this.pause();\n }\n\n MediaPlayer.changeButtonState({\n button: this.playBtn,\n removeClass: (state) ? PLAYBTN_STATES.PLAY : PLAYBTN_STATES.PAUSE,\n addClass: (!state) ? PLAYBTN_STATES.PLAY : PLAYBTN_STATES.PAUSE,\n title: (state) ? 'Pause' : 'Play'\n });\n return state;\n }", "pause () {\n this.playing = false;\n }", "pause () {\n this.playing = false;\n }", "function pause() {\n if (running) {\n togglePlay();\n }\n}", "function myFunction() {\r\n if (video.paused) {\r\n video.play();\r\n btn.innerHTML = \"Pause\";\r\n } else {\r\n video.pause();\r\n btn.innerHTML = \"Play\";\r\n }\r\n}", "swapPlayPause() {\n let video = document.getElementById('video');\n if (video.paused || video.ended) {\n video.play()\n this.setState({ play_icon: \"pause\" })\n // this.playPause()\n } else {\n video.pause()\n this.setState({ play_icon: \"play_arrow\" })\n // this.playPause()\n }\n }", "_pauseVideo() {\n this.e.target.pauseVideo();\n console.log('Pausing the video');\n }", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Pause\";\n } else {\n video.pause();\n btn.innerHTML = \"Play\";\n }\n}", "function pauseVideo() {\r\n video.pause();\r\n play.innerHTML = '<i class=\"fas fa-play fa-2x\"></i>';\r\n}", "togglePause() {\n this.model.togglePause();\n }", "function togglePlay() {\r\n if (player.paused === false) {\r\n player.pause();\r\n isPlaying = false;\r\n $('#play-btn').removeClass('pause');\r\n\r\n } else {\r\n player.play();\r\n $('#play-btn').addClass('pause');\r\n isPlaying = true;\r\n }\r\n }", "function playpause(){\n\t\tif($('#pause').hasClass('activeButton'))\n\t\t{\n\t\t\t$('#slider,#play,#pause').click(function(){\n\t\t\t\t$('#pause').removeClass('activeButton');\n\t\t\t\t$('#play').addClass('activeButton');\n\t\t\t\t$('#pause').hide();\n\t\t\t\t$('#play').show();\n\t\t\t\tautoswitch=false;\n\t\t\t});\n\t\t}\t\n\t\t//When play is clicked, activate pause button\n\telse if($('#play').hasClass('activeButton'))\n\t\t{\n\t\t\t$('#slider,#play,#pause').click(function(){\n\t\t\t\t$('#play').removeClass('activeButton');\n\t\t\t\t$('#pause').addClass('activeButton');\n\t\t\t\t$('#play').hide();\n\t\t\t\t$('#pause').show();\n\t\t\t\tautoswitch=true;\n\t\t\t});\n\t\t}\n}", "function togglePlay() {\n if (player.paused === false) {\n player.pause();\n isPlaying = false;\n document.getElementById('play-btn').className = \"\";\n\n } else {\n player.play();\n document.getElementById('play-btn').className = \"pause\";\n isPlaying = true;\n }\n }", "function playPauseVideo() {\n // Check if video is paused or playing\n if ( video.paused ) {\n // if video is paused, play the video\n video.play();\n } else {\n // if video is playing, pause the video\n video.pause();\n }\n\n}", "toggle_paused() {\n this.paused = !this.paused\n\n // update the button\n let display_text = this.paused ? \"Play\" : \"Pause\";\n $(\"#pause\").html(display_text);\n\n // Update this value so when we unpause we don't add a huge\n // chunk of time.\n this.last_update = AnimationManager.epoch_seconds();\n }", "function togglePause() {\n isGamePaused = !isGamePaused;\n }", "pause () {\n if (this.current) {\n this.current.video.pause()\n }\n }", "function togglePlay() {\n var playPauseBtn = document.getElementById('play-pause-btn');\n running = !running;\n\n if (running) {\n playPauseBtn.value = 'Pause';\n } else {\n playPauseBtn.value = 'Play';\n }\n}", "pause(){\n super.pause();\n this.isPlaying = false;\n }", "pauseButton(){\r\n pause.addEventListener(\"click\" , () =>{\r\n\t\tevent.preventDefault();\r\n clearInterval(this.slideInterval);\r\n document.getElementById(\"pause\").style.display= \"none\";\r\n document.getElementById(\"play\").style.display= \"inline-block\";\r\n }); \r\n\t}", "pause() {\n this.paused = true;\n }", "playPause() {\n let video = document.getElementById('video');\n\n if (video) { \n if (video.ended) {\n this.setState({play_icon: \"replay\"})\n } else if (video.paused) {\n this.setState({ play_icon: \"play_arrow\" })\n } else {\n this.setState({ play_icon: \"pause\" })\n }\n }\n }", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"<i class='fas fa-pause'></i>\";\n } else {\n video.pause();\n btn.innerHTML = \"<i class='fas fa-play'></i>\";\n }\n}", "pause() {\n var self = this;\n this.pauseBtn.addEventListener(\"click\", function() {\n self.playBtn.disabled = false;\n this.disabled = true;\n clearInterval(self.idSetInterval);\n });\n }", "function togglePlayback() {\n let video_is_cued = player.getPlayerState() == states.video_cued;\n let video_is_paused = player.getPlayerState() == states.paused;\n let video_is_playing = player.getPlayerState() == states.playing;\n if (video_is_cued || video_is_paused) {\n player.playVideo();\n } else if (video_is_playing) {\n player.pauseVideo();\n }\n}", "function togglePausePlay() {\n\n // If we are in the middle of demonstrating the step button (see tutorial.js)\n // then disable the pause/play button\n if (TUTORIAL_STEP_BUTTON_ACTIVE) {\n return\n }\n\n if (PLAY_STATUS == PlayStatus.INITAL_STATE_PAUSED) {\n doRun()\n } else if (PLAY_STATUS == PlayStatus.PAUSED) {\n doResume()\n } else {\n doPause()\n }\n}", "function pause() {\n if (playId) {\n clearInterval(playId)\n playId = undefined\n }\n\n /* Re-enable all settings, and hide the pause button. */\n d3.selectAll('button').attr('disabled', null)\n d3.select('#pause-button').style('display', 'none')\n d3.select('#play-button').style('display', 'inline-block')\n}", "pause() {\n this._isPaused = true;\n }", "function playVideo() { \n\tif($video[0].paused) {\n\t\t$video[0].play();\n\t\t$playButton.find(\"img\").attr(\"src\", \"icons/pause-icon.png\"); \n\t\t$buttonControls.hide();\n\t\t$videoControls.css(\"margin-top\", \"5%\");\t \t\n\t} else {\n\t\t$video[0].pause();\n\t\t$playButton.find(\"img\").attr(\"src\", \"icons/play-icon.png\");\t\t\t\n\t}\t\t\n}", "#controlState() {\n this.wrapper.addEventListener(\"click\", () => {\n if (this.video.paused) {\n this.controller.checked = false;\n this.video.play();\n } else {\n this.controller.checked = true;\n this.video.pause();\n }\n });\n }", "togglePlayback() {\n if (this.player.isPlaying()) {\n this.player.stop();\n } else {\n this.player.play();\n }\n }", "function playpauseTrack(){\n\n // Switch between play & pause depending on the current state\n if(!isPlaying) playTrack();\n else pauseTrack();\n\n}", "function myFunction() {\n if (video.paused) {\n video.play();\n btn.innerHTML = \"Stop video\";\n } else {\n video.pause();\n btn.innerHTML = \"Watch video\";\n }\n}", "pause() {\n this._isPaused = true;\n }", "pause() {\n this._isPaused = true;\n }", "onPlayPauseClick() {\n const { controller } = this.props;\n controller.togglePlayPause();\n }", "function playpause(event) {\n player.play();\n player.pause();\n }", "function playPause() {\n target = this.classList[1] - 1;\n\n if(shownMedia[target].paused) {\n shownMedia[target].play();\n playPauseBtn[target].textContent = 'Pause';\n } else {\n shownMedia[target].pause();\n playPauseBtn[target].textContent = 'Play';\n }\n }" ]
[ "0.8368461", "0.83267105", "0.8311592", "0.82392395", "0.82229155", "0.8166258", "0.8025651", "0.79920286", "0.7987903", "0.7981648", "0.7961293", "0.7922364", "0.78738517", "0.7838555", "0.777426", "0.77668166", "0.7728154", "0.77083886", "0.77076787", "0.76838326", "0.7680799", "0.7679421", "0.76732105", "0.7652503", "0.7651397", "0.76425225", "0.764191", "0.7634812", "0.7632801", "0.7605796", "0.75977856", "0.756429", "0.7559935", "0.7547694", "0.7491594", "0.74766225", "0.74629897", "0.74629897", "0.7460177", "0.74535275", "0.7449033", "0.7447396", "0.7438238", "0.74301434", "0.7421562", "0.74046695", "0.740039", "0.7378983", "0.7364076", "0.7361555", "0.7356991", "0.73336816", "0.7325108", "0.7323104", "0.73048013", "0.7302624", "0.7300924", "0.7299861", "0.72763973", "0.7251227", "0.7251227", "0.725046", "0.7248846", "0.7247765", "0.7245677", "0.72324187", "0.72324187", "0.72324187", "0.72324187", "0.72324187", "0.72242016", "0.722392", "0.72154844", "0.718231", "0.7180035", "0.717804", "0.7174695", "0.7167709", "0.7165462", "0.71266514", "0.7109201", "0.71067536", "0.7095542", "0.70896107", "0.70868087", "0.70867187", "0.70751333", "0.7070599", "0.7057625", "0.705074", "0.705042", "0.7049448", "0.70331144", "0.7016431", "0.70153975", "0.69613814", "0.69613814", "0.6951775", "0.6950297", "0.69501704" ]
0.76019377
30
Takes a snapshot of the video
function action_snapshot() { //dimensions this.width = w; this.height = h; //create canvas old-school style this.element = document.createElement('canvas'); $('.screenshots').append('<div class="screenshot screenshot_'+new_screenshot_index+'"></div>'); //update attributes $(this.element) .attr('id', 'screenshot_'+new_screenshot_index) .text('unsupported browser') .width(this.width) .height(this.height) .appendTo('.screenshot_'+new_screenshot_index); //some fake data var fake_data_html = '<b>title:</b> Ex Machina | <b>user:</b> Gary' + '<br><b>time:</b> ' + $('#current').text() + 's'; $('.screenshot_'+new_screenshot_index).append('<div class="description" value="'+$("#current").text()+'"></div>'); $('.screenshot_'+new_screenshot_index+' .description').html(fake_data_html); $('.screenshot_'+new_screenshot_index).click(function(){ $('.screenshot').removeClass('selected'); $(this).addClass('selected'); countdown = 5; adjusted_time = parseFloat($(this).find('.description').attr('value')) - countdown; if(adjusted_time < 0){adjusted_time = 0;} video.currentTime = adjusted_time; video.play(); change_icon ('countdown', countdown); }); this.context = this.element.getContext("2d"); // Get a handle on the 2d context of the canvas element //var context = canvas.element.get(0).getContext('2d'); this.context.fillRect(0, 0, w, h); this.context.drawImage(video, 0, 0, w, h); //just slowly add the screenshot and scroll to the bottom new_screenshot_index++; $('.screenshots').animate({ scrollTop: $('.screenshots').get(0).scrollHeight }, 2000); //blink with the heart change_icon('love'); //configure fingerprint var mar_100 = parseInt($('.fingerprint').css('width').replace('px', '')); var mar = -15 + Math.floor(mar_100*parseFloat($("#current").text())/parseFloat($("#duration").text())); $('.fingerprint').append('<i style="color: #FFF; float:left; margin-top: -55px; position:relative; left:'+mar+'px;" class="fa fa-arrows-v fa-2x"></i>'); delay = delay_value; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function takeSnap() {\n\n // get video element\n var vid = document.querySelector('video');\n // get canvas element\n var canvas = document.querySelector('canvas');\n // get its context\n var ctx = canvas.getContext('2d');\n // set its size to the one of the video\n canvas.width = vid.videoWidth;\n canvas.height = vid.videoHeight;\n // show snapshot on canvas\n ctx.drawImage(vid, 0, 0);\n // show spinner image below\n document.querySelector('#spinner').classList.remove('hidden');\n return new Promise((res, rej) => {\n // request a Blob from the canvas\n canvas.toBlob(res, 'image/jpeg');\n });\n}", "function takeSnapshot() {\n const context = canvas.getContext(\"2d\");\n context.drawImage(video, videoX, videoY, imageWidth, imageHeight, 0, 0, imageWidth, imageHeight);\n const srcDataUrl = canvas.toDataURL(\"image/png\");\n image.setAttribute(\"src\", srcDataUrl);\n // hide video and show image\n video.classList.add(\"hide\");\n image.classList.remove(\"hide\");\n // update instructions overlay\n instructions.innerHTML = \"tap screen to display camera capture\";\n }", "function takeSnapshot() {\n\n // use MediaDevices API\n // docs: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia\n\n video.style.display = \"inline\";\n let context;\n let width = video.offsetWidth,\n height = video.offsetHeight;\n\n canvas = canvas || document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n context = canvas.getContext('2d');\n context.drawImage(video, 0, 0, width, height);\n\n recognizeImage(canvas.toDataURL('image/png'));\n }", "function takeSnapshot() {\n var img = document.createElement('img');\n var context;\n var width = video.offsetWidth\n , height = video.offsetHeight;\n canvas = document.getElementById('face_1');\n canvas.width = width;\n canvas.height = height;\n context = canvas.getContext('2d');\n context.drawImage(video, 0, 0, width, height);\n img.src = canvas.toDataURL('image/png');\n $(\"#face_snapshot\").attr(\"src\", img.src);\n return img;\n }", "snap() {\n try {\n const mimeType = this.options.imageMIMEType;\n const quality = this.options.imageQuality || 90;\n const imageOnly = this.options.captureImageOnly;\n if (!this.liveVideo) {\n throw new MediaCaptureError('No video stream');\n }\n getVideoStreamSnapshot(this.stream).then((canvas) => {\n return saveCanvasContents(canvas, mimeType, quality).then((blob) => {\n const { width, height } = canvas;\n const url = URL.createObjectURL(blob);\n this.capturedImage = { url, blob, width, height };\n if (imageOnly) {\n this.status = 'captured';\n }\n this.notifyChange();\n });\n });\n } catch (err) {\n this.saveError(err);\n }\n }", "function take_snapshot() {\n\t\t// toma la imagen\n\t\tvar data_uri = Webcam.snap();\n\n\t\t// injecta el resultado\n\t\t$('#results').html(\n\t\t\t'<h2>captura</h2>' + '<img src=\"'+data_uri+'\"/>'\n\t\t) \n\t}", "getSnapShot(){\n var ret = null;\n\n try {\n var video = document.querySelector('video'), shrinkSz = .5, canvas, context;\n if(video) {\n var width = video.offsetWidth * shrinkSz, height = video.offsetHeight * shrinkSz;\n\n canvas = canvas || document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n context = canvas.getContext('2d');\n context.drawImage(video, 0, 0, width, height);\n\n ret = canvas.toDataURL('image/png');\n }\n }\n catch(ex){\n console.log(\" [Susie] Error getting video snapshot: \", ex);\n }\n\n return ret;\n }", "function snapshot() {\n\tvar c = canvas.getContext('2d');\n\tcanvas.width= video.clientWidth;\n\tcanvas.height= video.clientHeight;\n\tcanvas.style.width = video.clientWidth;\n\tcanvas.style.height = video.clientHeight;\n\t\n\t//to animate the countdown a selfinvoking recursive function\n\t(function countDown(i){\n\tsetTimeout(function(){\n\t\t\t$('.countdown').remove();\n\t\t\t$('.centerBox').append('<div class=\"countdown\">'+i+'</div>');\n\t\t\tif(i--){countDown(i);}\n\t\t\telse{\n\t\t\t$('.countdown').remove();\n\t\t\tdrawSnapShot();}\n\t\t}, 1000);})(3);\n\t\n\t//for when the countdown is finished draw the snapshot\n\tfunction drawSnapShot(){\n\t\tc.drawImage(video,0,0,canvas.width,canvas.height);\n\t\t$('#videoDiv').toggle();\n\t\t$('#app').toggle();\n\t\t$('#takePic').unbind('click');\n\t\t$('#takePic').remove();\n\t\t$('.previous').append('<a href=\"#\" id=\"tryAgain\">Try Again</a>');\n\t\t$(\"#tryAgain\").click(function(){\n\t\t\ttryAgain();\n\t\t});\n\t\t$('.next').append('<a href=\"#\" id=\"saveIt\">Save It</a>');\n\t\t$(\"#saveIt\").click(function(){\n\t\t\tsaveImg();\n\t\t});\n\t}\n}", "function shoot(){\n\t var video = document.getElementById(videoId);\n\t var output = document.getElementById('output');\n\t var canvas = capture(video, scaleFactor);\n\t canvas.onclick = function(){\n\t window.open(this.toDataURL());\n\t };\n\t snapshots.unshift(canvas);\n\t output.innerHTML = '';\n\t for(var i=0; i<4; i++){\n\t output.appendChild(snapshots[i]);\n\t }\n\t}", "function takeASnapShot(){\n\t\twindow.webcam.capture(3);\n\t}", "function snapshot(event) {\n event.preventDefault();\n\n// swaps between the webcam and screenshot\n $('#screenshot-canvas').toggleClass('dispnone')\n $('#webcam').toggleClass('dispnone')\n\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n ctx.drawImage(video, 0, 0);\n imageString = canvas.toDataURL('image/png')\n // console.log(\"imageString\", imageString)\n $('#canvasimage').attr('value', imageString)\n\n\n // \"image/webp\" works in Chrome.\n // Other browsers will fall back to image/png.\n // document.querySelector('img').src = canvas.toDataURL('image/webp');\n }", "function take_snapshot() {\n Webcam.snap(function(data_uri){\n document.getElementById(\"result\").innerHTML = \"<img id='snap' src='\" + data_uri + \"'>\";\n });\n}", "function snap() {\n // Define the size of the rectangle that will be filled (basically the entire element)\n context.fillRect(0, 0, w, h);\n // Grab the image from the video\n context.drawImage(video, 0, 0, w, h);\n // wulianliang: save the image\n var image = new Image();\n // var image = $(\"#snapImage\");\n image.setAttribute('crossOrigin', 'anonymous');\n //image.crossOrigin = \"anonymous\";\n image.src = canvas.toDataURL(\"image/png\");\n}", "function takeScreenshot() {\n let video = document.querySelector('video');\n var img = document.getElementById('screenshotImage');\n var context;\n var width = video.offsetWidth, \n height = video.offsetHeight;\n\n canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n\n context = canvas.getContext('2d');\n context.drawImage(video, 0, 0, width, height);\n\n img.src = canvas.toDataURL('image/png');\n img.style.transform = \"scaleX(-1)\";\n\n var image = canvas.toDataURL('image');\n localStorage.setItem('image_context', image);\n}", "function captureSnapshot() {\n\n\tif(cameraStream) {\n\t\tvar ctx = capture.getContext( '2d' );\n\t\tvar img = new Image();\n\t\tctx.drawImage( stream, 0, 0, capture.width, capture.height );\n\t\timg.src = capture.toDataURL( \"image/png\" );\n\t\timg.width = 240;\n\t\tsnapshot = capture.toDataURL( \"image/png\" );\n\t\tcloseWebcam();\n\t\tdocument.getElementById('cam').classList.add(\"hidden\");\n document.getElementById('photo').classList.remove(\"hidden\");\n document.getElementById('takePhotoBtn').classList.add(\"hidden\");\n document.getElementById('openCamBtn').classList.remove(\"hidden\");\n document.getElementById('submitCaptureImg').classList.remove(\"hidden\");\n\t}\n}", "function shoot(){\n var output = document.getElementById('output');\n var canvas = capture(video, scaleFactor);\n canvas.onclick = function(){\n window.open(this.toDataURL());\n };\n snapshots.unshift(canvas);\n output.innerHTML = '';\n for(var i=0; i<1; i++){\n output.appendChild(snapshots[i]);\n }\n}", "function screenshot (video, hash) {\n const commend = `-v error -y -i ${video} -ss 2 -vf scale=\\'-1:720\\' -qscale:v 4 -frames:v 1 ${basePath}/${hash}.jpg`;\n console.log(commend);\n return new Promise((resolve, reject) => {\n const analyse = spawn('ffmpeg', commend.split(' '));\n // ffmpeg -y -i IMG_0434.MOV -ss 2 -qscale:v 4 -vf \"scale=-1:720\" -frames:v 1 1.jpg\n analyse.stderr.on('data', (data) => {\n console.log('--------------ffmpeg===============')\n reject(data.toString());\n });\n \n analyse.on('exit', (code) => {\n resolve(`${basePath}/${hash}.jpg`);\n });\n })\n}", "function take_snapshot() {\n // take snapshot and get image data\n Webcam.snap(function (data_uri) {\n // Send data_uri to the backend.\n var blob = dataURItoBlob(data_uri);\n fd = new FormData(document.forms.namedItem('regForm'));\n fd.append(\"webcam_pic\", blob,\n \"webcam_pic.jpg\");\n });\n}", "function take_snapshot() {\n // take snapshot and get image data\n if (checkExpireImg()) {\n Webcam.snap(function (data_uri) {\n insertImage(data_uri);\n });\n } else {\n Swal.fire({\n title: \"Ảnh Tối Đa Thêm là 10 Ảnh\",\n position: \"center\",\n showClass: {\n popup: \"animate__animated animate__fadeInDown\",\n timer: 500,\n },\n hideClass: {\n popup: \"animate__animated animate__fadeOutUp\",\n timer: 500,\n },\n });\n }\n}", "function snap() {\n\t// Define the size of the rectangle that will be filled (basically the entire element)\n\tcontext.fillRect(0, 0, w, h);\n\t// Grab the image from the video\n\tcontext.drawImage(video, 0, 0, w, h);\n t = video.currentTime;\n document.getElementById('secToLog').innerHTML=t;\n}", "function captureVideo() {\n // Launch device video recording application, \n // allowing user to capture up to 1 video clips\n navigator.device.capture.captureVideo(captureSuccess, captureError, {limit: 1, duration: 90});\n }", "function getVideo() {\n\tnavigator.mediaDevices.getUserMedia({video: true, audio: false})\n\t\t.then(localMediaStream => {\n\t\t\tconsole.log(localMediaStream);\n\t\t\tvideo.src = window.URL.createObjectURL(localMediaStream);\n\t\t\t//MediaStream is an object and needs to be changed to be a URL\n\t\t\tvideo.play();\n\t\t\t//this updates so that the camera shouldn't just be one frame\n\t\t\t//if inspected, blob is the video being caught\n\t\t})\n\t\t.catch(err => {\n\t\t\tconsole.error(`WELP ERROR`, err);\n\t\t});\n}", "function currentFrameCanvas(){\n let video = document.getElementById(\"video_id\");\n canvas = document.getElementById('screenShot');\n canvas.width = width;\n canvas.height = height;\n canvas.getContext('2d').drawImage(video, 0, 0, canvas.width, canvas.height);\n}", "function snap() {\n\n context.fillRect(0, 0, w, h);\n // Grab the image from the video\n context.drawImage(vid, 0, 0, w, h);\n canvas = $(canvas);\n applyVisualEffects(canvas);\n \n }", "function takepicture() {\n const context = canvas.getContext('2d');\n if (stream_width && stream_height) {\n canvas.width = stream_width;\n canvas.height = stream_height;\n context.drawImage(video, 0, 0, stream_width, stream_height);\n \n const data = canvas.toDataURL('image/png');\n photo.setAttribute('src', data);\n showPhoto();\n } else {\n clearphoto();\n }\n }", "async snapshot() {\n const img = await this.webcam.capture();\n const processedImg =\n tf.tidy(() => img.expandDims(0).toFloat().div(127).sub(1));\n img.dispose();\n return processedImg;\n }", "function drawSnapShot(){\n\t\tc.drawImage(video,0,0,canvas.width,canvas.height);\n\t\t$('#videoDiv').toggle();\n\t\t$('#app').toggle();\n\t\t$('#takePic').unbind('click');\n\t\t$('#takePic').remove();\n\t\t$('.previous').append('<a href=\"#\" id=\"tryAgain\">Try Again</a>');\n\t\t$(\"#tryAgain\").click(function(){\n\t\t\ttryAgain();\n\t\t});\n\t\t$('.next').append('<a href=\"#\" id=\"saveIt\">Save It</a>');\n\t\t$(\"#saveIt\").click(function(){\n\t\t\tsaveImg();\n\t\t});\n\t}", "function captureVideo(){\nnavigator.device.capture.captureVideo(videoCaptureSuccess,videoCaptureFailed);\n //console.log(\"Its Working\");\n}", "function captureCurrentFrame(videoElement){\n return getTempCanvasAndContext(videoElement).canvas.toDataURL('image/png');\n }", "function drawVedio() {\n setTimeout(() => {\n canvas.getContext(\"2d\").drawImage(video, 0, 0, 100, 100);\n drawVedio();\n }, 0);\n }", "function startVideo() {\n navigator.getUserMedia(\n { video: {} },\n stream => video.srcObject = stream,\n error => console.error(error)\n )\n}", "function startVideo(){\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n canvas.getContext('2d').\n drawImage(video, 0, 0, canvas.width, canvas.height);\n $scope.sendPicture();\n}", "function takepicture() {\n var context = canvas.getContext('2d');\n if (width && height) {\n canvas.width = width;\n canvas.height = height;\n context.drawImage(video, 0, 0, width, height);\n \n var data = canvas.toDataURL('image/png');\n photo.setAttribute('src', data);\n } else {\n clearphoto();\n }\n }", "function startVideo() {\n navigator.getUserMedia(\n { \n video: \n {\n //the ideal part is imp, it helps to get 16:9 ratio also\n height : { ideal : window.innerHeight } ,\n width : { ideal : window.innerWidth }\n } \n } ,\n stream => video.srcObject = stream,\n err => console.error(err)\n ) \n}", "function startWebcam() {\n var vid = document.querySelector('video');\n // request cam\n navigator.mediaDevices.getUserMedia({\n video: true\n })\n .then(stream => {\n // save stream to variable at top level so it can be stopped lateron\n webcamStream = stream;\n // show stream from the webcam on te video element\n vid.srcObject = stream;\n // returns a Promise to indicate if the video is playing\n return vid.play();\n })\n .then(() => {\n // enable the 'take a snap' button\n var btn = document.querySelector('#takeSnap');\n btn.disabled = false;\n // when clicked\n btn.onclick = e => {\n takeSnap()\n .then(blob => {\n analyseImage(blob, params, showResults);\n })\n };\n })\n .catch(e => console.log('error: ' + e));\n}", "function retake() {\n video.play();\n snapButton.onclick = snap;\n snapButton.value = \"Capture\";\n document.getElementById(\"editor\").innerHTML = \"\";\n document.getElementById(\"calculate\").style.display = \"none\";\n canvas.style.display = \"none\";\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n}", "function captureVideo(cb){\n if (cb == null ){\n var options = { limit: 1 };\n navigator.device.capture.captureVideo(captureVideoSuccess, captureVideoError, options);\n }else{\n var options = { limit: 1 };\n navigator.device.capture.captureVideo(cb, captureVideoError, options);\n }\n}", "function snapshot() {\n var ctx = canvas.getContext('2d');\n var feed = liveFeed.getContext('2d');\n imageData = feed.getImageData(0, 0, 224, 224);\n ctx.putImageData(imageData,0,0);\n}", "doVideo( stream ) {\n this.root.src = window.URL.createObjectURL( stream );\n }", "function getVideo() {\n // getting someone's video webcam\n navigator.mediaDevices.getUserMedia({ video: true, audio: false}) // this returns a promise\n .then(localMediaStream => {\n console.log(localMediaStream);\n //video.src = localMediaStream;\n // still need to convert it to some sort of url to make it work\n video.src = window.URL.createObjectURL(localMediaStream); // now it works but only one frame\n video.play(); // now it's a live stream :)\n })\n .catch(err => {\n console.error(`Oupsy Daisy!`, err);\n }); // if it doesn't work shows an error (like oupsy daisy you need to allow acess to the camera)\n}", "function preload() {\n video = createCapture(VIDEO);\n \n}", "function takepicture() {\n showResult.showMsg('');\n var context = canvas.getContext('2d');\n if (width && height) {\n canvas.width = outwidth;\n canvas.height = outheight;\n var xoff = 0;\n var yoff = 0;\n var r = (video.videoWidth/width)\n if(height > width){\n yoff = r * (height - outheight) / 2\n } else {\n xoff = r * (width - outwidth) / 2\n }\n context.drawImage(video, xoff, yoff, r*outwidth, r*outheight,\n 0, 0, outwidth, outheight);\n var data = canvas.toDataURL('image/png');\n photo.setAttribute('src', data);\n setTimeout(() => (predict(context, 150, 150))); // Timeout just lets the photo update before we use all the cpu cycles.\n } else {\n clearphoto();\n }\n}", "function takepicture() {\n var context = canvas.getContext('2d');\n if (width && height) {\n canvas.width = width;\n canvas.height = height;\n context.drawImage(video, 0, 0, width, height);\n \n var data = canvas.toDataURL('image/jpeg');\n photo.setAttribute('src', data);\n photoblob = dataURLtoBlob(data);\n postbutton.disabled = false;\n } else {\n clearphoto();\n }\n }", "function startVideo(){\n //gets the webcam, takes object as the first param, video is key, empty object as param\n navigator.getUserMedia(\n {video: {}},\n //whats coming from our webcam, setting it as source\n stream =>video.srcObject = stream,\n err => console.log(err))\n}", "function takePicture() {\n const photo = document.getElementById(\"photo\");\n const canvas = document.getElementById(\"canvas\");\n const video = document.getElementById(\"video\");\n const context = canvas.getContext(\"2d\");\n if (canvas.height) {\n context.drawImage(video, 0, 0, canvas.width, canvas.height);\n\n const data = canvas.toDataURL(\"image/png\");\n photo.setAttribute(\"src\", data);\n } else {\n clearPhoto();\n }\n}", "function takePhoto (e) {\nlet ctx = outputCanvas.getContext('2d')\nctx.drawImage(inputVideo,0,0)\n}", "function takePicture() {\n\t var context = canvas.getContext('2d');\n\t\tcanvas.width = videoElem.offsetWidth;\n\t\tcanvas.height = videoElem.offsetHeight;\n\t\tcontext.drawImage(videoElem, 0, 0, videoElem.offsetWidth, videoElem.offsetHeight);\n\t\tvar data = context.getImageData(0, 0, videoElem.offsetWidth, videoElem.offsetHeight);\n\n\t\treturn data;\n\t\t//var data = canvas.toDataURL('image/png');\n\t\t//photo.setAttribute('src', data);\n\t\t//return data;\n\t}", "async function setUpVideo(v) {\n const stream = await navigator.mediaDevices.getUserMedia({\n video: true,\n });\n v.srcObject = stream;\n v.play();\n}", "function createVideo() {\n var video = getVideoObject();\n submitVideo(video, 'create_video', onCreateSuccess);\n}", "function takepicture() {\n const context = canvas.getContext(\"2d\");\n if (width && height) {\n canvas.width = width;\n canvas.height = height;\n context.drawImage(video, width * 0, height * 0.0, width * 1, height * 1);\n context.beginPath();\n context.rect(0, 0, width * 0.4, height);\n context.fillStyle = \"white\";\n context.fill();\n\n context.beginPath();\n context.rect(width * 0.6, 0, width, height);\n context.fillStyle = \"white\";\n context.fill();\n\n context.imageSmoothingEnabled = false;\n\n context.globalCompositeOperation = \"saturation\";\n context.fillStyle = \"black\";\n context.globalAlpha = 2; // alpha 0 = no effect 1 = full effect\n context.fillRect(0, 0, canvas.width, canvas.height);\n // context.filter = \"saturate(5)\"\n\n const data = canvas.toDataURL(\"image/png\");\n sendImgtoAPI(data);\n photo.setAttribute(\"src\", data);\n } else {\n clearphoto();\n }\n }", "function captureCamera(capture) {\r\n navigator.mediaDevices.getUserMedia({\r\n video: true\r\n })\r\n .then(function (stream) {\r\n myvideo.srcObject = stream;\r\n myvideo.play();\r\n capture && capture(stream);\r\n })\r\n .catch(function (err) {\r\n console.error(err);\r\n alert(\"Ups, we need your camera! Please refresh the page and start again\");\r\n });\r\n}", "function gotMedia(mediaStream) {\n const mediaStreamTrack = mediaStream.getVideoTracks()[0];\n const imageCapture = new ImageCapture(mediaStreamTrack);\n video.src = window.URL.createObjectURL(mediaStream);\n \n return imageCapture;\n console.log(imageCapture);\n }", "function cam() {\n snapBtn.addEventListener('click', enroll);\n // detectButton.addEventListener('click', detect);\n navigator.mediaDevices.getUserMedia({\n audio: false,\n video: {\n width: 500,\n height: 500\n }\n })\n .then(stream => {\n video.srcObject = stream;\n video.onloadedmetadata = video.play()\n })\n .catch(err => console.error(err));\n}", "function get_video(path) {\n //with camera stream, only working if we use video here not with 'var video', but before this point video doesn't exist\n video = video2;\n \n //need to be careful here: in use_webcam() the src Object is set with video.srcObject = stream; not with video.setAttribute(). If we don't reset\n //it to null it seems to override the attributes that are set with setAttribute.\n video.srcObject = null;\n //first I created a seperate source object here, which is complete nonesense\n //it's totally dufficient to add the path from the file picker <video src=\"path\" ...>\n video.setAttribute('src', path);\n video.load();\n video.play();\n\n //add an update, as soon as the video is running loop is called constantly\n video.ontimeupdate = function() {loop()};\n\n}", "function paintToCanvas() {\n // first we need the width and height\n const width = video.videoWidth;\n const height = video.videoHeight;\n // make sure now that the canvas is the same size as the video before we paint into it\n canvas.width = width;\n canvas.height = height;\n\n // now ever x seconds we're going to snap a picture\n setInterval(() => {\n ctx.drawImage(video, 0, 0, width, height); // paint with the video, starting at the left top of the canvas, with the width and height specified above;\n // take the pixels out\n let pixels = ctx.getImageData(0, 0, width, height); // we get an array of millions of pixel values with each one it's own color value\n // messing with the pixels\n //pixels = redEffect(pixels); // the function redEffect is all the way down below\n pixels = rgbSplit(pixels); // I'm choosing to play with this one instead of the two other functions\n ctx.globalAlpha = 0.8;\n //pixels = greenScreen(pixels);\n // putting the pixels back back\n ctx.putImageData(pixels, 0, 0);\n }, 16); // here every 16 milliseconds a picture is taken from the video\n}", "getVideoThumbnail(video, w, h, out) {\n nativeTools.getVideoThumbnail(video, w, h, out);\n }", "showLocalVideo() {}", "async function streamVideoRequest() {\n try {\n captureStream = await navigator.mediaDevices.getDisplayMedia();\n videoContainer.srcObject = captureStream;\n videoContainer.onloadedmetadata = () => {\n videoContainer.play();\n };\n } catch (error) {\n console.error(error);\n }\n}", "function generateThumbnail() {\n c = document.createElement(\"canvas\");\n c.width = width;\n c.height = height;\n c.style.width = width;\n c.style.height = height;\n ctx = c.getContext(\"2d\");\n ctx.canvas.width = width;\n ctx.canvas.height = height;\n ctx.drawImage(video, 0, 0, width, height);\n var pixel = ctx.getImageData(x, y, 1, 1);\n var newx = video.currentTime; // or i for frame #?\n var newy = pixel.data[0] + pixel.data[1] + pixel.data[2];\n if (newy > 0) Plotly.extendTraces('plot', { x: [[newx]], y: [[newy]] }, [0])\n}", "function snap() {\n video.pause();\n snapButton.onclick = retake;\n snapButton.value = \"Retake\";\n canvas.style.display = \"block\";\n}", "function manipulatevideo(){\n if( cameravideo || capturevideo ){\n cameravideo = false;\n capturevideo = false;\n capturestream = null;\n buttonOff(document.querySelector('.app__system--button.video'));\n camerastream.getVideoTracks()[0].enabled = cameravideo;\n document.getElementById('localvideo').srcObject = camerastream;\n //-------------------CREATE NEW PRODUCER-------------------------------------------\n removeOldVideoProducers();\n let videoProducer = mediasouproom.createProducer(camerastream.getVideoTracks()[0]);\n videoProducer.send(sendTransport);\n updatevideo();\n }\n}", "function snap() {\n picture = webcam.snap();\n webcamElement.style.display = \"none\";\n canvasElement.style.display = \"block\";\n snapButtonElement.style.display = \"none\";\n startButtonElement.style.display = \"block\";\n webcam.stop();\n alert(\"Your picture has been taken!\");\n}", "function OpenVideoScreen(filePath)\n{\n if(watchingVideo)\n return\n\n watchingVideo = true\n\n document.getElementById(\"video-wrap\").classList.remove(\"closed\")\n document.getElementById(\"vs-video-source\").src = filePath\n document.getElementById(\"vs-video\").load()\n}", "function takeScreenShot(){\n console.log(\"take screenshot: \")\n // window.open('', document.getElementById('story').toDataURL());\n}", "function cpt( id, opts ){\n var el = id && document.querySelector( id ) || document.body\n , $el = id && $(id) || $(document.body)\n , img = opts ? (opts.image===null ? null : ( opts.image && document.querySelector( opts.image ) || getImage( el ))) : getImage( el )\n , video = opts && opts.video && document.querySelector( opts.video ) || getVideo( el )\n , canvas = getCanvas( el )\n , ctx = canvas.getContext( '2d' )\n , mstream = null\n , width = height = 0\n\n opts = opts || {}\n opts.quality = opts.quality || ( opts === 'hd' && hd ) || ( opts === 'vga' && vga ) || vga\n opts.extension = opts.extension || 'webp'\n\n function Capture(){ this.snapshot() }\n\n Capture.prototype.startStream = function(){\n navigator.getUserMedia({ video: opts.quality }, function( stream ){\n video.src = window.URL.createObjectURL( stream )\n mstream = stream\n $el.trigger( 'capture.stream.started', stream )\n }, window.alert.bind(window))\n }\n\n\n Capture.prototype.snapshot = function(){\n if ( !mstream ) return\n if ( width === 0 ){\n width = canvas.width = video.videoWidth;\n height = canvas.height = video.videoHeight;\n }\n ctx.drawImage( video, 0, 0, width, height )\n var dataurl = canvas.toDataURL('image/'+this.opts.extension)\n img && (img.src = dataurl)\n $el.trigger( 'capture.snapshot.taken', dataurl )\n }\n\n Capture.prototype.stream = function(){\n return mstream\n }\n\n var capture = new Capture()\n capture.opts = opts\n\n $el.on( 'capture.snapshot.take', capture.snapshot.bind(capture))\n $el.on( 'capture.stream.start', capture.startStream.bind(capture))\n $el.on( 'capture.stream.stop', function(){\n if (!mstream) return;\n mstream.stop();\n mstream = null;\n $el.trigger( 'capture.stream.stopped' )\n })\n\n $el.data('capture', capture )\n return capture\n }", "function importWebcamStream() {\n let constraints = {\n video: {\n mandatory: {\n minWidth: width,\n minHeight: height,\n },\n optional: [{ maxFrameRate: 24 }],\n },\n audio: true,\n };\n createCapture(constraints, function (stream) {\n console.log(stream);\n });\n}", "async function selectMediaStream() {\n try {\n // Working with Screen Capture API.\n // We get our mediastream data.\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n // We pass the mediaStream the user select as video src.\n video.srcObject = mediaStream;\n // When the video has loaded its metadata it's gonna call a function to play the video.\n video.onloadedmetadata = () => {\n video.play();\n }\n } catch (error) {\n console.error(`Whoops, error here: ${error}`);\n }\n}", "requestVideoFrame() {\n\t\tthis.session.requestVideoFrame();\n\t}", "function capture (cb) {\n console.log(cb);\n var vw = 640;\n var vh = 480;\n var fr = 24;\n var config = {\n audio: false,\n video: {\n width: vw,\n height: vh,\n frameRate: fr\n }\n };\n var p = undefined\n p = navigator.mediaDevices.getUserMedia(config)\n p.then(cb).catch(function (error) {\n console.error(error);\n });\n $.alert({\n title: 'Attention!',\n content:'Connection in progress! Please stand by! Click ok to continue!',\n });\n // document.getElementById(\"presenter\").style.display = \"none\";\n if(!$('#xprowebinarPublisherCamera').length){\n $( \"#xprowebinarSubscriberCamera\" ).css('display', 'none');\n $('.selectvidimage').before('<video id=\"xprowebinarPublisherCamera\" class=\"red5pro-media red5pro-media-background\" autoplay controls muted></video>');\n\n if(!$('#selectvidimage').length){\n $( \"#selectvidimage\" ).css('display', 'initial');\n }else{\n $( \"#selectvidimage\" ).css('display', 'none');\n }\n \n }\n }", "function getVideo() {\n // Returns a promise\n navigator.mediaDevices\n .getUserMedia({ video: true, audio: false })\n .then((localMediaStream) => {\n // console.log(localMediaStream)\n // Take video and set source object to this localMediaStream\n video.srcObject = localMediaStream;\n video.play(); // emits \"canplay\" event\n })\n .catch((err) => {\n console.error(\n 'Oh no, we need your webcam permission in order for this to work!',\n err\n );\n });\n}", "function takePhoto() {\n // every time takePhoto button is pressed play the camera shutter(here snap) sound\n snap.currentTime = 0;\n snap.play();\n\n // canvas.toDataURL will return a long DOM string containing the data of the image from the video in jpeg format\n // image are displayed in a downloadable link of anchor tag\n // a counter is also implemented to identify which image is taken first\n // .setAttribute('download','cool-img') will make the link downloadable and set the downloaded file name to cool-img\n // strip.insertBefore(link,strip.firstChild) will\n const data = canvas.toDataURL('image/jpeg');\n const link = document.createElement('a');\n link.href = data;\n link.setAttribute('download', 'cool-img');\n link.innerHTML =\n `<img src =\"${data}\" alt = \"Handsome Man \">\n <p>Image ${++imgCount}</p>`\n link.id=`img-${imgCount}`;\n\n \n // The image will be sorted by latest --> oldest\n strip.insertBefore(link,strip.firstChild);\n \n // To reverse the order de-comment the code below and comment the insertBefore() function\n\n // function insertAfter(newNode,referenceNode){\n // referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling);\n // }\n\n // if(imgCount == 1){\n // strip.insertBefore(link, strip.firstChild);\n // }\n // else{\n // const referenceNode=document.getElementById(`img-${imgCount-1}`)\n // insertAfter(link,referenceNode);\n // }\n\n}", "async function selectMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia(); //Screen Capture API\n videoElement.srcObject = mediaStream; //pass the mediaStream as the source\n videoElement.onloadedmetadata = () => { \n videoElement.play();\n }\n } catch (error) {\n console.log('Ooops, we\\'ve got an error: ', error);\n }\n}", "capture_() {\n this.checkSupport_();\n\n this.renderFrame().then(() => {\n this.getCanvas().then((canvas) => {\n if (canvas) {\n capture.saveCanvas(canvas);\n }\n }, this.onCaptureError, this);\n }, this.onCaptureError, this);\n }", "function getVideo() {// getUserMedia must have MediaStreamConstraints\n navigator.mediaDevices.getUserMedia({ video: true, audio: false}) // returns promise\n .then(MediaStream => {\n console.log(MediaStream); // MediaStream is an object\n video.srcObject = MediaStream; // video.srcObject is different to teacher video\n video.play();\n }).catch(err => {\n console.error(`Oh no!! You need to allow the site to use your webcam, ${err}`);\n alert(`Please reload and allow the site to access your webcam`);\n })\n}", "function resetVideo() {\n // hide image and show video\n image.classList.add(\"hide\");\n video.classList.remove(\"hide\");\n // update instructions overlay\n instructions.innerHTML = \"tap screen to take a snapshot\";\n }", "function takeVideoStream() {\n\tcleanElements(); // CLean all the elements\n\t\n\t// Create the start, stop and video elements for the video stream\n\tvar videoStreamElement = document.getElementById(\"videoStreamElement\");\n\tvideoStreamElement.innerHTML = '<br><button class=\"btn btn-dark\" id=\"startStream\">Start recording</button><br>';\n\tvideoStreamElement.innerHTML += '<button class=\"btn btn-dark\" id=\"stopStream\">Stop recording</button><br>';\n\tvideoStreamElement.innerHTML += '<br><br><video></video>';\n\tvideoStreamElement.innerHTML += '<br><br><video id=\"capturedVideoStream\" controls></video>';\n\n\tvar start = document.getElementById(\"startStream\");\n\tvar stop = document.getElementById(\"stopStream\");\n\tvar capturedVideoStream = document.getElementById(\"capturedVideoStream\");\n\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\n\n\t// The constraints for the media\n\tlet constraint = {\n\t\taudio: false,\n\t\tvideo: { facingMode: \"user\" }\n\t}\n\n\t// Handle old browsers that do not support the medie capture API\n\tif (navigator.mediaDevices == undefined) {\n\t\t/*navigator.mediaDevices = {};\n\t\tnavigator.mediaDevices.getUserMedia = function(constraintObj) {\n\t\t\tlet getUserMedia = navigator.webkitGetUserMedia || navigator.mozGetUserMedia;\n\t\t\tif (!getUserMedia) {\n\t\t\t\treturn Promise.reject(new Error('getUserMedia is not implemented in this browser'));\n\t\t\t}\n\t\t\treturn new Promise(function(resolve, reject) {\n\t\t\t\tgetUserMedia.call(navigator, constraintObj, resolve, reject);\n\t\t\t});\n\t\t}*/\n\t} else { // List all the devices ... this is where we can implement the select video capture device\n\t\tnavigator.mediaDevices.enumerateDevices().then(devices => {\n\t\t\tdevices.forEach(device => {\n\t\t\t\tconsole.log(device.kind.toUpperCase(), device.label);\n\t\t\t});\n\t\t}).catch( error => {\n\t\t\tconsole.log(error.name, error.message);\n\t\t});\n\t}\n\n\tnavigator.mediaDevices.getUserMedia(constraint).then(stream => {\n\t\t// Connect the video stream to the the video element\n\t\tlet video = document.querySelector('video');\n\t\tif (\"srcObject\" in video)\n\t\t\tvideo.srcObject = stream; // send the stream to the video element\n\t\telse\n\t\t\tvideo.src = window.URL.createObjectURL(stream); //For old browers\n\n\t\tvideo.onloadedmetadata = function(ev) {\n\t\t\tvideo.play(); // Display the video stream in the video element.\n\t\t}\n\n\t\t//store the blobs of the video stream\n\t\tlet mediaRecorder = new MediaRecorder(stream);\n\t\tlet recordedBlobs = [];\n\n\t\t// Start recording\n\t\tstart.addEventListener('click', (ev) => {\n\t\t\tmediaRecorder.start();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t\tcapturedVideoStream.style.visibility = \"hidden\"; // Hide the second video element (the captured video element)\n\t\t});\n\n\t\t// Stop recording\n\t\tstop.addEventListener('click', (ev)=> {\n\t\t\tmediaRecorder.stop();\n\t\t\tconsole.log(mediaRecorder.state);\n\t\t});\n\n\t\t// Record all of the blobs\n\t\tmediaRecorder.ondataavailable = function(ev) {\n\t\t\trecordedBlobs.push(ev.data);\n\t\t};\n\n\t\t// When the stop recoding button is clicked\n\t\tmediaRecorder.onstop = (ev)=> {\n\t\t\tlet blob = new Blob(recordedBlobs, { 'type': 'video/mp4;'});\n\n\t\t\trecordedBlobs = [];\n\t\t\tlet videoURL = window.URL.createObjectURL(blob);\n\n\t\t\tcapturedVideoStream.style.visibility = \"visible\"; // Make the captured video element visiable\n\t\t\tcapturedVideoStream.src = videoURL;\n\n\t\t\tsubmitVideo(blob, true); // Submit the video\n\t\t};\n\t}).catch(error => {\n\t\tconsole.log(error.name, error.message);\n\t});\n}", "function saveSnapshot() {\n console.log(\"save snapshot\");\n}", "constructor() {\n super();\n /**\n * video source file or stream\n * @type {string}\n * @private\n */\n this._source = '';\n\n /**\n * use camera\n * @type {boolean}\n * @private\n */\n this._useCamera = false;\n\n /**\n * is component ready\n * @type {boolean}\n */\n this.isReady = false;\n\n /**\n * is video playing\n * @type {boolean}\n */\n this.isPlaying = false;\n\n /**\n * width of scaled video\n * @type {int}\n */\n this.videoScaledWidth = 0;\n\n /**\n * height of scaled video\n * @type {int}\n */\n this.videoScaledHeight = 0;\n\n /**\n * how the video is scaled\n * @type {string}\n * @default letterbox\n */\n this.videoScaleMode = 'contain';\n\n /**\n * what type of data comes back with frame data event\n * @type {string}\n * @default imagedataurl\n */\n this.frameDataMode = 'none';\n\n /**\n * determines whether to use the canvas element for display instead of the video element\n * @type {boolean}\n * @default false\n */\n this.useCanvasForDisplay = false;\n\n /**\n * canvas filter function (manipulate pixels)\n * @type {method}\n * @default 0 ms\n */\n this.canvasFilter = this.canvasFilter ? this.canvasFilter : null;\n\n /**\n * refresh interval when using the canvas for display\n * @type {int}\n * @default 0 ms\n */\n this.canvasRefreshInterval = 0;\n\n /**\n * video element\n * @type {HTMLElement}\n * @private\n */\n this.videoElement = null;\n\n /**\n * camera sources list\n * @type {Array}\n */\n this.cameraSources = [];\n\n /**\n * canvas element\n * @type {Canvas}\n * @private\n */\n this.canvasElement = null;\n\n /**\n * component shadow root\n * @type {ShadowRoot}\n * @private\n */\n this.root = null;\n\n /**\n * interval timer to draw frame redraws\n * @type {int}\n * @private\n */\n this.tick = null;\n\n /**\n * canvas context\n * @type {CanvasContext}\n * @private\n */\n this.canvasctx = null;\n\n /**\n * has the canvas context been overridden from the outside?\n * @type {boolean}\n * @private\n */\n this._canvasOverride = false;\n\n /**\n * width of component\n * @type {int}\n * @default 0\n */\n this.width = 0;\n\n /**\n * height of component\n * @type {int}\n * @default 0\n */\n this.height = 0;\n\n /**\n * left offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxLeft = 0;\n\n /**\n * top offset for letterbox of video\n * @type {int}\n * @default 0\n */\n this.letterBoxTop = 0;\n\n /**\n * aspect ratio of video\n * @type {number}\n */\n this.aspectRatio = 0;\n\n /**\n * render scale for canvas frame data\n * best used when grabbing frame data at a different size than the shown video\n * @attribute canvasScale\n * @type {float}\n * @default 1.0\n */\n this.canvasScale = 1.0;\n\n /**\n * visible area bounding box\n * whether letterboxed or cropped, will report visible video area\n * does not include positioning in element, so if letterboxing, x and y will be reported as 0\n * @type {{x: number, y: number, width: number, height: number}}\n */\n this.visibleVideoRect = { x: 0, y: 0, width: 0, height: 0 };\n\n this.template = `\n <style>\n ccwc-video {\n display: inline-block;\n background-color: black;\n position: relative;\n overflow: hidden;\n }\n \n ccwc-video > canvas {\n position: absolute;\n }\n \n ccwc-video > video {\n position: absolute;\n }\n </style>\n\n <video autoplay=\"true\"></video>\n <canvas></canvas>`;\n }", "function handleSuccess(stream) {\n window.stream = stream; // make stream available to browser console\n video.srcObject = stream;\n}", "function handleSuccess(stream) {\n window.stream = stream; // make stream available to browser console\n video.srcObject = stream;\n}", "function newVideo(url) {\n media = document.getElementById(\"video\");\n media.setAttribute(\"src\", url)\n\n // Getting the Duration of the Video.\n media.addEventListener('canplay', function (e) {\n duration = Math.round(media.duration);\n try { document.getElementById(\"progress-bar\").style.width = `${0}%`; }\n catch (err) { }\n });\n // Callback to Play Function\n play();\n}", "function webcamToVideo()\n{\n\tn \t\t\t = navigator\n\tn.getUserMedia = n.getUserMedia || n.webkitGetUserMedia || n.mozGetUserMedia || n.msGetUserMedia;\n\twindow.URL \t = window.URL || window.webkitURL;\n\tn.getUserMedia(\n\t\t{video:true}, \n\t\tfunction(stream)\n\t\t{\n\t\t\tvideo.src = window.URL.createObjectURL(stream);\n\t\t\tlocalMediaStream = stream;\n\t\t},\n\t\tonCameraFail\n\t);\n}", "function successCallback(gotStream) {\n // Make the stream available to the console for introspection \n window.stream = gotStream;\n\n // Attach the returned stream to the <video> element // in the HTML page\n video.src = window.URL.createObjectURL(stream);\n\n // Start playing video\n video.play();\n}", "function capturePic(){\n cameraSensor.width = cameraView.videoWidth;\n cameraSensor.height = cameraView.videoHeight;\n cameraSensor.getContext(\"2d\").drawImage(cameraView, 0, 0);\n picPreview.src = cameraSensor.toDataURL(\"image/webp\");\n picPreview.classList.add(\"picPreview\");\n}", "async function GamoVideo(uri, jar, {'user-agent': userAgent}) {\n try {\n const videoPageHtml = await rp({\n uri,\n headers: {\n 'user-agent': userAgent,\n 'Upgrade-Insecure-Requests': 1,\n Host: 'gamovideo.com'\n },\n followAllRedirects: true,\n jar,\n timeout: 5000\n });\n \n return GamoVideoHtml(videoPageHtml);\n } catch (err) {\n logger.error(err)\n }\n}", "function capture_frame(bptr, bw, bh, sx, sy, sw, sh, ww, wh) { \n if (capturingScreenshot) {\n capturingScreenshot = false;\n let pixels = new Uint8ClampedArray(HEAPU8.subarray(bptr, bptr + bw*bh*4));\n //console.log(`(${bw}x${bh}):(${sx},${sy}) ${sw}x${sh} => ${ww}x${wh}`);\n // Flip endianness and convert ARGB to RGBA \n // This is probably slower than doing it in WebGL but it doesn't\n // seem to add much overhead \n let dv = new DataView(pixels.buffer);\n for (let y=0 ; y < sh; y++) {\n for (let x=0; x < sw; x++) {\n let p = (sy+y)*bw*4 + (sx+x)*4;\n /*if (x==0 && y== 0) {\n console.log(pixels.slice(p, p+8));\n }*/\n dv.setUint32(p, (dv.getUint32(p, true)<<8)|0xff, false);\n }\n }\n let imgData = new ImageData(pixels, bw);\n\n // We can scale the bitmap using resizeWidth/resizeWidth but Firefox \n // doesn't support resizeQuality: pixelated. Instead scale on canvas\n createImageBitmap(imgData, sx, sy, sw, sh)\n .then(bitmap => {\n let canvas = document.createElement('canvas');\n let ctx = canvas.getContext('2d');\n canvas.width = ww;\n canvas.height = wh;\n ctx.imageSmoothingEnabled = false;\n ctx.drawImage(bitmap, 0, 0, ww, wh);\n saveEmulatorScreenshot(canvas);\n });\n } else if (capturingVideo) {\n window.videoFrames++;\n let offset = sy*bw*4 + sx*4;\n let pixels = new Uint8Array(HEAPU8.subarray(bptr+offset, bptr + bw*bh*4));\n videoWorker.postMessage(pixels.buffer, pixels.buffer);\n }\n}", "function grabFrame() {\n imageCapture.grabFrame().then(function(imageBitmap) {\n console.log('Grabbed frame:', imageBitmap);\n canvas.width = imageBitmap.width;\n canvas.height = imageBitmap.height;\n canvas.getContext('2d').drawImage(imageBitmap, 0, 0);\n canvas.classList.remove('hidden');\n\t$('i#iconcancel').show();\n\t$('div#camera').hide();\n\t$('div#fotoresultaat').show();\n\tdocument.getElementById(\"result-label\").innerHTML = \"Tip: make sure your background is clean, and keep your face as straight as possible. Press 'Analyze Face' to continue, or take a new photo.\";\n\t$('a#grabFrame').hide();\n\t$('a#grabFrameDisabled').show();\n\t$('select#videoSource').hide();\n\t$('a#videoSourceDisabled').show();\n\t$('a#analyze-buttonDisabled').hide();\n\t$('a#analyze-button').show();\n dataURL = canvas.toDataURL(imageBitmap);\n\tvar audio = new Audio(sound1);\n\taudio.loop = false;\n\taudio.play();\n }).catch(function(error) {\n console.log('grabFrame() error: ', error);\n });\n}", "function takepicture() {\n\t var context = canvas.getContext('2d');\n\t if (width && height) {\n\t canvas.width = width;\n\t canvas.height = height;\n\t \n\t context.translate(width, 0);\n \t\t\t\tcontext.scale(-1, 1);\n\n\t context.drawImage(video, 0, 0, width, height);\n\n\t var user_data = canvas.toDataURL('image/png');\n\t user_pic.setAttribute('src', user_data);\n\n\t /* preview rendu */\n\t\t\t\tvar img = document.getElementsByClassName(\"render-filter\")[0].firstElementChild;\n\t\t\t\tvar filter= document.createElement(\"img\");\n\t\t\t\tfilter.setAttribute('src', img.src);\n\t\t\t\tfilter.style.width = img.getAttribute(\"data-width\");\n\n\t\t\t\tcontext.translate(width, 0);\n \t\t\t\tcontext.scale(-1, 1);\n\n\t context.drawImage(filter, 0, 0, img.width, img.height);\n\n\t var data = canvas.toDataURL('image/png');\n\t photo.setAttribute('src', data);\n\n\t\t\t\tdocument.getElementById(\"photo\").style.display = \"inline\";\n\t\t\t\tdocument.getElementById(\"saveButton\").style.display = \"inline\";\n\t\t\t\tif( document.getElementById(\"saveButton\").classList.contains('disabled') )\n\t\t\t\t\tdocument.getElementById(\"saveButton\").classList.remove(\"disabled\");\n\t } else {\n\t clearphoto();\n\t }\n\t }", "async function videoMediaStream() {\n try {\n const mediaStream = await navigator.mediaDevices.getDisplayMedia();\n videoElement.srcObject = mediaStream;\n videoElement.onloadedmetadata = () => {\n videoElement.play();\n }\n } catch (error) {\n //Error\n }\n}", "function screencap() {\n console.log(\"capturing screenshot - current time: \" + new Date());\n exec(\"screencapture -x ./img/screencap_\" + Date.now() + \".png\", puts); // screencap on interval timer\n}", "function updateBlob(){\n\t\tvar video = document.querySelector('video');\n\t\tsocket.emit('updateBlob', video.src);\n\t}", "async function startVideo() {\n console.log('Models loaded!!!')\n\n let stream\n try {\n stream = await navigator.mediaDevices.getUserMedia({ video: {}})\n } catch (err) {\n console.error(err)\n }\n video.srcObject = stream\n}", "async function setupCamera() {\n const video = document.getElementById('video');\n video.width = maxVideoSize;\n video.height = maxVideoSize;\n\n if (navigator.mediaDevices && navigator.mediaDevices.getUserMedia) {\n const mobile = isMobile();\n const stream = await navigator.mediaDevices.getUserMedia({\n 'audio': false,\n 'video': {\n facingMode: 'user',\n width: mobile ? undefined : maxVideoSize,\n height: mobile ? undefined: maxVideoSize}\n });\n video.srcObject = stream;\n\n return new Promise(resolve => {\n video.onloadedmetadata = () => {\n resolve(video);\n };\n });\n } else {\n const errorMessage = \"This browser does not support video capture, or this device does not have a camera\";\n alert(errorMessage);\n return Promise.reject(errorMessage);\n }\n}", "async function populateVideo() {\n // We grab the feed off the user's webcam\n const stream = await navigator.mediaDevices.getUserMedia({\n video: { width: 1280, height: 720 },\n });\n\n // We set the object to be the stream\n video.srcObject = stream; // usually when dealing with video files we use video.src = 'videoName.mp4'\n await video.play();\n\n // size the canvases to be the same size as the video\n console.log(video.videoWidth, video.videoHeight);\n\n canvas.width = video.videoWidth;\n canvas.height = video.videoHeight;\n\n faceCanvas.width = video.videoWidth;\n faceCanvas.height = video.videoHeight;\n}", "function getVideoThumbnail(video, canvas) {\n // context.drawImage(video, 0, videoStartCoordY, canvas.width, videoStartCoordY + canvas.height)\n let context = canvas.getContext('2d')\n context.drawImage(video, 0, 0, canvas.width, canvas.height)\n}", "function startStream() {\r\n\r\n if (navigator.platform == \"iPhone\" || navigator.platform == \"Linux armv8l\") {\r\n vid = createCapture(VIDEO, constraints)\r\n } else {\r\n\r\n vid = createCapture(VIDEO);\r\n }\r\n\r\n vid.position(0, 0)\r\n button.remove()\r\n select(\"#accept\").remove()\r\n\r\n classifyVideo()\r\n\r\n}", "function paintToCanvas() { //to display webcame live in a specified canvas with videos actual height and width\n\n const width = video.videoWidth; //getting actual height and width of video\n const height = video.videoHeight;\n canvas.width = width; //setting the canvas width and height accordingly \n canvas.height = height;\n return setInterval(() => { //by setintertval method we are drawing the recieved video's image in after every 16milli sec \n ctx.drawImage(video, 0, 0, width, height); //here we are drawing the image recieved in canvas\n let pixels = ctx.getImageData(0, 0, width, height) //here we are getting the canvas image to make some effect\n // console.log(pixels)\n // debugger;\n // pixels = redeffect(pixels) //here redeffect is called\n // console.log(hola);\n pixels = rgbsplit(pixels) // we are calling rgb split to make some changes in the pixels thats is the image we get from canvas\n ctx.globalAlpha=0.8; \n // pixels = greenscreen(pixels)\n ctx.putImageData(pixels, 0, 0); //after we get the changed pixels we put it back in the canvas\n }, 16);\n}", "function takepicture() {\n var context = canvas.getContext('2d');\n console.log(context);\n if (width && height) {\n canvas.width = width;\n canvas.height = height;\n context.drawImage(video, 0, 0, width, height);\n \n var data = canvas.toDataURL('image/png');\n\n\n var content = data;\n\t//content = content.replace('data:image/jpeg;base64,', 'hi');\n\tconsole.log(typeof content)\n\tconsole.log(content);\n\t//salert('adf')\n\tconsole.log('asdfa')\n\t sendFileToCloudVision(content.replace('data:image/png;base64,', ''));\n\n //sendFileToCloudVision(content);\n //console.log(data);\n photo.setAttribute('src', data);\n } else {\n clearphoto();\n }\n }", "function paintToCanvas() {\n // get the width and height of the actual live feed video\n const width = video.videoWidth;\n const height = video.videoHeight;\n\n // set canvas width and height to be the same as the live feed video\n canvas.width = width;\n canvas.height = height;\n\n // every 16ms, take the image from the webcam and put it into the canvas\n return setInterval(() => {\n ctx.drawImage(video, 0, 0, width, height);\n\n // take the pixels out\n let pixels = ctx.getImageData(0, 0, width, height);\n\n // mess with them\n // pixels = redEffect(pixels);\n\n // pixels = redSplit(pixels);\n // ctx.globalAlpha = 0.8;\n\n pixels = greenScreen(pixels);\n\n // put them back\n ctx.putImageData(pixels, 0, 0);\n }, 16);\n}", "function capturePhoto () {\n console.log('>>> Capturing Photo <<<')\n var promise = new Promise(\n function (resolve, reject) {\n // Capture picture and save it as 'outut.jpg' in directory\n // Resolve in callback\n cmd.get('raspistill -o output.jpg -q 40', function () {\n return resolve('Photo Done')\n })\n }\n )\n return promise\n}" ]
[ "0.80400956", "0.7973131", "0.7972817", "0.77883387", "0.7710764", "0.7617289", "0.7552318", "0.7249978", "0.72290224", "0.7144497", "0.7114868", "0.7094358", "0.6973082", "0.68949175", "0.6882829", "0.68615514", "0.6840102", "0.6826717", "0.6655729", "0.6649953", "0.664293", "0.66417927", "0.66319954", "0.6617417", "0.6613201", "0.65573585", "0.64437836", "0.63450813", "0.6333083", "0.6329983", "0.63184893", "0.6316023", "0.6305651", "0.6289343", "0.62853605", "0.6272382", "0.6257786", "0.6257297", "0.6211166", "0.6209848", "0.62054175", "0.61861825", "0.6176459", "0.61704725", "0.61406296", "0.6133466", "0.6126817", "0.6122675", "0.6102739", "0.60822636", "0.6081405", "0.60729986", "0.60621315", "0.6061122", "0.6057807", "0.605512", "0.60436314", "0.60428095", "0.60360426", "0.60272306", "0.6016252", "0.6012219", "0.60094976", "0.6006766", "0.60059536", "0.5992282", "0.59652174", "0.59580076", "0.5931935", "0.59163916", "0.59047437", "0.5883891", "0.586487", "0.586141", "0.5860009", "0.5855421", "0.5855371", "0.5842052", "0.5834473", "0.5834473", "0.5833853", "0.5830752", "0.58187485", "0.58105856", "0.5810385", "0.5806344", "0.58001643", "0.5800012", "0.57977873", "0.5795692", "0.5793615", "0.5788468", "0.57828987", "0.57815695", "0.5776261", "0.5773798", "0.57593924", "0.57576483", "0.5757249", "0.5744419" ]
0.64909995
26
blinking confirmation beakon effect
function change_icon (action, countdown) { countdown = countdown || 0; $('.overlay').html(''); $('.overlay').css('opacity', '1'); if(action == 'play'){ $('.overlay').html('<i class="fa fa-play fa-2x"></i>'); } else if (action == 'pause') { $('.overlay').html('<i class="fa fa-pause fa-2x"></i>'); } else if (action == 'love') { $('.overlay').html('<i class="fa fa-heart fa-2x"></i>'); } else if (action == 'countdown' && countdown > 0) { $('.overlay').html('<i class="fa fa-clock-o fa-2x"></i>'+countdown); countdown--; console.log(countdown); setTimeout( function() { change_icon('countdown', countdown); }, 1000); } $('.overlay').animate( { opacity: 0 }, 800 ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setSuccess(blink) {\n blink.fadeToRGB(500, 0, 100, 0); // millisec, r, g, b: 0 - 255\n}", "function blinkingText() {\r\n if ($(\"#start-game-btn\").hasClass(\"dark-green\")) {\r\n $(\"#start-game-btn\").removeClass(\"dark-green\").addClass(\"off-white\");\r\n }\r\n else {\r\n $(\"#start-game-btn\").removeClass(\"off-white\").addClass(\"dark-green\");\r\n }\r\n }", "function blinkEffect(blinkData){\n\t//alert(\"Hello\");\n\t\n}", "function ksfCanvas_blinkButton(btn)\n{\n\tvar resetBackColor = $(btn).css('background-color');\n\tvar resetColor = $(btn).css('color');\n\t$(btn).animate(\n\t\t{\n\t\t\t\"background-color\": \"#FF8500\",\n\t\t\t\"color\": \"#fff\"\n\t\t}, 200, function()\n\t\t{\n\t\t\t$(btn).animate(\n\t\t\t{\n\t\t\t \"background-color\": resetBackColor,\n\t\t\t \"color\": resetColor\n\t\t\t}, 800);\n\t\t} );\n}", "blink() {\n let xEyes = 20;\n let yEyes = 50;\n let sEyes = 1.0;\n\n if (this.sleep === true) {\n fill(255, 255, 255);\n\n rect(\n this.x + 125 * sEyes,\n this.y + 130 * sEyes,\n xEyes * sEyes,\n yEyes * sEyes\n );\n rect(\n this.x + 55 * sEyes,\n this.y + 130 * sEyes,\n xEyes * sEyes,\n yEyes * sEyes\n );\n }\n }", "blink(text) {\n if ((text.alpha === 1)) {\n if (this.tick === 45) {\n text.setAlpha(0);\n this.tick = 0;\n }\n }\n else {\n if (this.tick === 30) {\n text.setAlpha(1);\n this.tick = 0;\n }\n }\n }", "function blinkAnimate(){\r\n\t\t\tif (gameState.currentState != states.gameover \r\n\t\t\t\t&& gameState.currentState != states.demo){\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tel.style.opacity = Tween.easeInOutQuad(t,start,change,dur);\r\n\t\t\tt++;\r\n\t\t\t\r\n\t\t\tt = t % (dur*2);\r\n\t\t\t\r\n\t\t\tsetTimeout(function(){\r\n\t\t\t\tblinkAnimate();\r\n\t\t\t},20)\r\n\t\t}", "function launchConfirmPrompt() {\n $('.confirm-background').fadeIn();\n return;\n}", "function blinkPage() {\n let msgWindowRef = document.getElementById('message');\n audio.play()\n if (blinkState) {\n msgWindowRef.style.backgroundColor = 'red';\n blinkState = !blinkState;\n } else {\n msgWindowRef.style.backgroundColor = msgWindowDefaultBackground;\n blinkState = !blinkState;\n }\n}", "function btnFeedbackAnimation(btnColor) {\n $(\".\" + btnColor).addClass(\"flash\")\n setTimeout(function () {\n $(\".\" + btnColor).removeClass(\"flash\")\n }, 250)\n}", "function blinkMsg() {\n $('#blkTxt').fadeOut(1);\n setTimeout(function () {\n $('#blkTxt').fadeIn(1);\n }, 1000);\n setTimeout(blinkMsg, 2000);\n}", "function blink(blinkText) {\n\tTweenLite.to(blinkText, 0.3, {\n\t\tautoAlpha: 0,\n\t\tdelay: 1,\n\t\tonComplete: function() {\n\t\t\tTweenLite.to(blinkText, 0.3, {\n\t\t\t\tautoAlpha: 1,\n\t\t\t\tdelay: 0.3,\n\t\t\t\tonComplete: blink,\n\t\t\t\tonCompleteParams : [blinkText]\n\t\t\t\t\n\t\t\t});\n\t\t}\n\t});\n}", "function blink_text() {\n $('#blinker').fadeOut(250);\n $('#blinker').fadeIn(250);\n}", "function flashButton(color) {\n\tpressButton(color);\n\tsetTimeout(function() {\n\t\tunpressButton(color);\n\t}, 500);\n}", "function blinkOpen() {\n\n\t$(\"#title h1\").removeClass(\"blink\");\n\tsetTimeout('BlinkClose()',randomXToY(1000,4000));\t\n\n}", "function confirm() {\n transition(CONFIRM);\n }", "function blink(dropDownID, color){\n\tvar btn = $('button#' + dropDownID);\n\tbtn.animate(\n\t{\n\t\tbackgroundColor: color,\n\t\t// opacity: 1\n\t},\n\t{\n\t\tduration: 400,\n\t\tcomplete: function(){\n\t\t\tbtn.animate({backgroundColor: '#fff'}, 200);\n\t\t}\n\t});\n}", "function doBlink() {\n\t\t// Blink, Blink, Blink...\n\t\tvar blink = document.all.tags(\"BLINK\")\n\t\tfor (var i=0; i < blink.length; i++)\n\t\t\tblink[i].style.visibility = blink[i].style.visibility == \"\" ? \"hidden\" : \"\" \n\t}", "function okBlink() {\n context.fillStyle = \"green\";\n context.fill();\n setTimeout(() => {\n context.fillStyle = \"black\";\n context.fill();\n }, 150);\n}", "function p1Cooldown() {setTimeout(function(){\n p1BlinkCooldown = 1;\n cultistBlinkNotReady.setVisible(false);\n cultistBlinkReady.setVisible(true);\n }, 3000)}", "function blink(currentColour) {\n currentColour.fadeOut(100).fadeIn(100);\n}", "function BlinkClose() {\n\n\t$(\"#title h1\").addClass(\"blink\");\n\tsetTimeout('blinkOpen()',100);\t\n\n}", "function blinkText(){\n if(!blink){\n context.font =\"30px menuFont\";\n context.fillStyle = \"white\";\n context.fillText(\"Press Enter\", canvas.width/2-70, canvas.height/2+60);\n blink = true;\n }\n else if(blink){\n context.fillStyle = \"black\";\n context.fillRect(canvas.width/2-80, canvas.height/2+33, 200, 35);\n blink = false;\n }\n}", "function blinkNotify(selector) {\n var element = $(selector);\n setInterval(function () {\n element.fadeIn(500, function () {\n element.fadeOut(500, function () {\n element.fadeIn(1000);\n });\n });\n }, 2000);\n}", "function blink() {\n light.toggle();\n }", "function blinkChatFrame(frame, title,buttons) {\n\t/* True attribute refering we are in blue color */\n\tif (frame.data(\"colorBlink\")) {\n\t\tdocument.title = document.oldTitle + \" (Message)\";\n\t\tapplyBackgroundColor(title,true);\n\t\tapplyBackgroundColor(buttons,true);\n\t\tframe.data(\"colorBlink\",false);\n\t\t\n\t} else {\n\t\tdocument.title = document.oldTitle;\n\t\tapplyBackgroundColor(title,false);\n\t\tapplyBackgroundColor(buttons,false);\n\t\tframe.data(\"colorBlink\",true);\n\t}\n}", "blink()\n\t\t{\n\t\t\tif (this.statelessProductCardRef)\n\t\t\t{\n\t\t\t\tthis.statelessProductCardRef.blink();\n\t\t\t}\n\t\t}", "function pulseAlert () {\n document.getElementById('correctness').classList.remove(\"hidden\");\n document.getElementById('correctness').classList.add(\"pulse-once\");\n\n setTimeout(function() {\n document.getElementById('correctness').classList.remove(\"pulse-once\");\n document.getElementById('correctness').classList.add(\"hidden\");\n }, 1500);\n}", "function blink(){\n // Setup of a random selektor\n let startID = Math.floor((Math.random() * 100) + 1);\n // Selekting random star\n let selection = document.querySelector( \"#\" + setStargazer[\"generateItemClass\"] + \"-\"+ startID);\n // Adding blink-classs to selektion\n selection.classList.add(setStargazer[\"setMorphClass\"]);\n setTimeout(function(){ \n // Removing Blink-class after timeout\n selection.classList.remove(setStargazer[\"setMorphClass\"]);\n }, setStargazer[\"setMorphSpeed\"]/2);\n }", "function blink() {\n var body = document.getElementById('body');\n var colors = ['#F88', '#FF8', '#8F8', '#8FF', '#88F', '#F8F'];\n for (let i = 0; i <= 17; i++) {\n setTimeout(function() {body.style.backgroundColor = colors[i % colors.length];}, i*100);\n }\n setTimeout(function() {body.style.backgroundColor = 'white';}, 1800);\n}", "function stopBlink() {\n audio.pause()\n let msgWindowRef = document.getElementById('message');\n msgWindowRef.style.backgroundColor = msgWindowDefaultBackground;\n clearInterval(alertInterval);\n}", "function screenFlash() {\n\t\tbooFlash = !booFlash;\t\t\n\t\tif ( booFlash ) {\n\t\t\t$(\"#alarm\").css(\"background\",\"orange\");\t\n\t\t} else {\n\t\t\t$(\"#alarm\").css(\"background\",\"red\");\t\n\t\t}\n\t\tif ( booFault ) {\t\t\n\t\t\tsetTimeout(screenFlash,500);\n\t\t}\n\n\t}", "function flashClickedButton(theColor) {\n $(\".\" + theColor).addClass(\"pressed\");\n setTimeout( function() {$(\".\" + theColor).removeClass(\"pressed\")}, 250 );\n\n}", "function paddleBlink() {\n\tblinkCounter = 5;\n}", "function drinkNow(){\n\t// Do a bunch of stuff here.\n\t// Change the background color\n\tbackFlash(); \n\t// Show the \"drink now\" message\n\t$('overlay').setStyle('color', '#'+Math.floor(Math.random()*16777215).toString(16));\n\t$('overlay').show();\n\tsetTimeout(function(){$('overlay').hide()},250);\n\t// Now play a sound or something\n\t// Now change the song the chromeless player is playing\n\n}", "function launchShuttle(msg, bg, ht) {\n var button = document.getElementById('takeoff');\n var height = 0;\n if (button) {\n button.addEventListener('click', function () {\n var status = confirm(\"Ready to launch the shuttle?\");\n if (status) {\n msg.innerHTML = \"Shuttle in flight.\";\n bg.style.backgroundColor = \"blue\";\n ht.innerHTML = \"10000\";\n }\n });\n }\n}", "function blink(outputelemnt) {\n let x = true;\n setInterval(() => {\n if (x) {\n document.getElementById(outputelemnt).style.visibility = \"visible\";\n x = false;\n } else {\n document.getElementById(outputelemnt).style.visibility = \"hidden\";\n x = true;\n }\n }, 2000);\n}", "function handleBlink() {\n if (solutionSequence[roundBlinkCount] === 1) {\n handleButtonBlink(1);\n } else if (solutionSequence[roundBlinkCount] === 2) {\n handleButtonBlink(2);\n } else if (solutionSequence[roundBlinkCount] === 3) {\n handleButtonBlink(3);\n } else {\n handleButtonBlink(4);\n }\n}", "function afterLoadControl(blinkStr){\n fadeInBody()\n flashMenuButton(blinkStr);\n}", "function setFail(blink) {\n blink.setRGB(255, 0, 0);\n blink.fadeToRGB(500, 100, 0, 0); // millisec, r, g, b: 0 - 255\n}", "function performBlink(tempArr) {\n for (var i = 0; i < tempArr.length; i++) {\n if (tempArr[i] == 10) {} else {\n var bowlingPin = document.getElementById('bowlingPin_' + tempArr[i].toString());\n bowlingPin.src = \"bowling_pin_transparent.png\";\n }\n }\n //uncomment below to get flashing back\n /*\n setTimeout(function() {\n for (var j = 0; j < tempArr.length; j++) {\n //document.getElementById(\"bowlingPin_\" + i.toString()).style.visibility = 'hidden';\n var bowlingPin = document.getElementById('bowlingPin_' + tempArr[j].toString());\n bowlingPin.src = \"bowling_pin_solid.png\";\n }\n }, 30);\n */\n}", "bell() {\n if (this._soundBell()) {\n this._soundService.playBellSound();\n }\n // if (this._visualBell()) {\n // this.element.classList.add('visual-bell-active');\n // clearTimeout(this._visualBellTimer);\n // this._visualBellTimer = window.setTimeout(() => {\n // this.element.classList.remove('visual-bell-active');\n // }, 200);\n // }\n }", "function timerBlinker() {\n $scope.redCountdown = !$scope.redCountdown;\n $scope.blinker = setTimeout(timerBlinker, 100 * $scope.time.seconds);\n }", "function msgPerdeu() {\n swal({\n title: \"Perdeste!\",\n type: \"error\",\n timer: 3000,\n showConfirmButton: false\n });\n bloqueioBoneco();\n }", "function blinkCard(id)\n\t{\n\t\tfor ( var iTimeout = 0 ; iTimeout < timeouts.length ; iTimeout ++ )\n\t\t{\n\t\t\tif ( timeouts[iTimeout].id == id )\n\t\t\t\tclearTimeout(timeouts[iTimeout].timeout ) ; \n\t\t}\n\n\t\ttimeouts.push({id: id, timeout: setTimeout( function() \n\t\t{\n\t\t\t$( \"#\"+id ).queue(function() { $( this ).addClass( \"border-success\" ).dequeue(); }).delay( 100 ).queue(function() { $( this ).removeClass( \"border-success\" ).dequeue(); }).delay( 100 ).queue(function() { $( this ).addClass( \"border-success\" ).dequeue(); }).delay( 100 ).queue(function() { $( this ).removeClass( \"border-success\" ).dequeue(); }).delay( 100 ).queue(function() { $( this ).addClass( \"border-success\" ).dequeue(); }).delay( 100 ).queue(function() { $( this ).removeClass( \"border-success\" ).dequeue(); }).delay( 100 ) ;\n\t\t}, 1500) } ) ; \n\t}", "function blinkEyes() {\n eyes.forEach(function(eye) {\n eye.blink();\n });\n setTimeout(function() {\n eyes.forEach(function(eye) {\n eye.blink();\n });\n }, 75);\n}", "doBlink() {\n this.eyeMask.classList.add('close');\n\n this.eyeMask.getElementsByTagName('g')[0].addEventListener('transitionend', (event) => {\n setTimeout(() => {\n this.eyeMask.classList.remove('close');\n }, 20);\n }, { once: true });\n }", "function flashText(dom){\n\t\tvar colors = [ 'red', 'green', 'blue', 'black', 'yellow', 'pink' ];\n\t\tvar current = 0;\n\t\tvar timer = 0;\n\t\tvar myinterval = setInterval(function(){\n\t\t\tdom[0].style.color = colors[current];\n\t\t\tcurrent = (current + 1) % colors.length;\n\t\t\tif(timer === 50){\n\t\t\t\tclearInterval(myinterval);\n\t\t\t\tdom[0].style.color='black';\n\t\t\t}\n\t\t\ttimer++;\n\t\t}, 50);\n\t}", "function abilitaBtnPreferenze() {\n\t$('#piede #preference p.msg').replaceWith('<p class=\"msg ok\">salvato</p>');\n\t$('#piede #preference p.msg.ok').delay(1500).fadeOut(function() {\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tthis.remove();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$('#velocita').removeAttr('disabled');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$('#setVelocita').removeAttr('disabled');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t});\n}", "function shredAlert() {\n var ACTIVE = 'shred';\n\n setTimeout(function(){\n document.body.classList.add(ACTIVE);\n }, 1500);\n\n setTimeout(function(){\n document.body.classList.remove(ACTIVE);\n }, 6500);\n\n shakaParticles();\n shredAlertColor();\n}", "function shredAlertColor() {\n var theText = document.querySelector('.call-to-shred-text'),\n animation = Math.floor(Math.random() * textColorOptions) + 1,\n style = 'style';\n\n theText.removeAttribute(style);\n\n theText.setAttribute(style, 'animation-name: flash' + animation);\n}", "function bleh() {}", "function flashButton(button) {\n if (!button) {\n return;\n }\n\n button.classList.add('active');\n setTimeout(() => {\n button.classList.remove('active');\n }, 100);\n}", "function changePhotoConfirmation(){\n\t$(\"body\").css(\"pointer-events\",\"none\");\n\t$(\"#changeConfirmationBox\").fadeIn();\n}", "function buttonOn(){\n\t\t\t$('#power-button').unbind('click');\n\t\t\t$('#power-button').click(function(){\n\t\t\t\t// do a little terminal flash or something cool\n\t\t\t\t setTimeout(powerOn,500);\n\t\t\t});\n\t\t}", "function flash_notice( msg ){\n\t\tj('#notib').html( msg ).fadeIn()\n\t\tsetTimeout( \"j('#notib').fadeOut()\", 5000 )\n\t}", "function flashButton(button){\n button.style.backgroundColor=button.id;\n const timer=setTimeout(function(){\n button.style.backgroundColor=\"black\"; \n console.log(\"timer \")},flashSpeed);\n}", "function flashTeal() {\n $(\".btn-teal\").css(\"background-color\", \"#4ea0ae\");\n}", "function pulse_flash() {\n $('.flash, .flash p').effect('highlight', {}, 3000)\n}", "function blink() {\n characteristic.read(changeState);\n }", "function blink(t, d)\r\n{\r\n return ((t % d) < d/2);\r\n}", "function confirmCommand() {\n\tswal(\"Votre commande a bien été validée, vous allez être redirigé\", \"\", \"success\");\n\tsetTimeout(function () {\n\t\twindow.location = \"confirmation.html\";\n\t}, 3000);\n}", "function blink_controller(){\n for (var i=0; i < game_items.length; i++) {\n game_items[i].update_blink();\n }\n setTimeout(blink_controller, interval * 35);\n}", "blink() {\n this.movingAllowed = false;\n const xDisappear = -303;\n const yDisappear = -303;\n this.x = xDisappear;\n this.y = yDisappear;\n setTimeout(function() {\n this.x = this.startX;\n this.y = this.startY;\n setTimeout(function() {\n this.x = xDisappear;\n this.y = yDisappear;\n }.bind(this), 500)\n setTimeout(function() {\n setTimeout(function() {\n this.x = this.startX;\n this.y = this.startY;\n this.movingAllowed = true;\n }.bind(this), 500)\n }.bind(this), 500)\n }.bind(this), 1000);\n }", "function flashButtons () {\n theButtons.forEach((button) => {\n button.classList.add('press')\n setTimeout(() => {\n button.classList.remove('press')\n }, 300)\n })\n}", "function flash_animations() {\n if ($('#notify > div').length > 0) {\n $('#notify').show();\n }\n\n $('#flash').delay(500).fadeIn('normal', function () {\n $(this).delay(4000).fadeOut('normal', function () {\n $(this).hide();\n $('#notify').hide();\n });\n });\n}", "function fastBeep() {\n beep (220, 50)\n}", "function afterHappy(){\n if(happy){\n var t3 = setTimeout(\"setCommandValue('Good, what a positive attitude 👍')\",1500);\n var t4 = setTimeout(\"setCommandValue('Show your surprise for overtime today 💀')\",4000);\n var t5 = setTimeout(\"happy = false\",1000);\n var t6 = setTimeout(\"surprise = true\",4000);\n }\n else {\n return;\n }\n }", "function onBlink(request, response) {\n console.log('Received synchronous call to blink');\n var responsePayload = {\n status: 'Blinking LED every ' + request.payload + ' seconds'\n }\n response.send(200, responsePayload, (err) => {\n if (err) {\n console.error('Unable to send method response: ' + err.toString());\n } else {\n console.log('Blinking LED every ' + request.payload + ' seconds');\n }\n });\n }", "function callback(data, error) {\n if (error) throw error;\n // wait 50ms, then call blink() again:\n interval = setTimeout(blink, 50);\n }", "function current_turn_blink() {\n let current_turn_class = document.getElementsByClassName(\"game-detail-move\")[0];\n let current_opacity = 0\n setInterval(() => {\n current_opacity = Math.abs(current_opacity - 0.8)\n current_turn_class.style.opacity = current_opacity;\n }, 700);\n}", "setBlinkDelay() {\n this.blinkDelay = Math.ceil(Math.random() * Trex.BLINK_TIMING);\n }", "function blink(selector){ \n\t$(selector).fadeOut('slow', function(){ \n\t\t$(this).fadeIn('slow', function(){ \n\t\t\tblink(this); \n\t\t}); \n\t}); \n}", "function flashColor() {\n $(\".btn-teal\").css(\"background-color\", \"rgba(78, 160, 174, 0.5)\");\n $(\".btn-white\").css(\"background-color\", \"rgba(237, 239, 251, 0.5)\");\n $(\".btn-purple\").css(\"background-color\", \"rgba(108, 83, 164, 0.5)\");\n $(\".btn-grey\").css(\"background-color\", \"rgba(4, 0, 0, 0.5)\");\n}", "function Congratulation() {\n console.log(\"we win!\");\n\n swal({\n title: \"Congratulation!!\",\n confirmButtonText: 'Reset',\n showCancelButton: true\n }, function() {\n location.reload();\n \n });\n }", "toggleBlink(domElem, val) {\n\n //if (val == true) { \n\n //var elem = document.getElementById(domElem);\n //setInterval(function () {\n // elem.style.display = (elem.style.display == 'none' ? '' : 'none');\n //}, 750);\n //}\n\n\n }", "function blinkClass(element, cl) {\n element.addClass(cl).delay(500).queue(function(){\n element.removeClass(cl).dequeue();\n });\n }", "function redFlash(){\n\t\t$(\".redbox\").css(\"background-color\", \"#A0291E\");\n\t\t\t\t\t\t\n\t\tsetTimeout(function(){\n\t\t\t$(\".redbox\").css(\"background-color\", \"#C16C64\");\n\t\t}, 400);\n\t}", "function handleButtonBlink(buttonNum) {\n if (buttonNum === 1) {\n blueSimonButton.style.backgroundColor = \"rgb(76, 116, 247)\";\n sound.volume = 0.2;\n sound.play();\n setTimeout(function () {\n blueSimonButton.style.backgroundColor = \"rgb(6, 34, 126)\";\n }, blinkDuration);\n } else if (buttonNum === 2) {\n greenSimonButton.style.backgroundColor = \"rgb(77, 165, 96)\";\n sound.volume = 0.2;\n sound.play();\n setTimeout(function () {\n greenSimonButton.style.backgroundColor = \"rgb(24, 90, 38)\";\n }, blinkDuration);\n } else if (buttonNum === 3) {\n redSimonButton.style.backgroundColor = \"rgb(230, 97, 97)\";\n sound.volume = 0.2;\n sound.play();\n setTimeout(function () {\n redSimonButton.style.backgroundColor = \"rgb(163, 10, 10)\";\n }, blinkDuration);\n } else {\n yellowSimonButton.style.backgroundColor = \"rgb(243, 243, 106)\";\n sound.volume = 0.2;\n sound.play();\n setTimeout(function () {\n yellowSimonButton.style.backgroundColor = \"rgb(185, 185, 11)\";\n }, blinkDuration);\n }\n}", "function flash ()\r\n{\r\n\r\n if (control != 2 & codigoRetorno != \"\" & textoCodigo != \"\")\r\n {\r\n if (control == 1)\r\n {\r\n window.status=textoCodigo;\r\n control=0;\r\n }\r\n else{\r\n window.status=\"\";\r\n control=1;\r\n }\r\n setTimeout(\"flash();\",speed);\r\n }\r\n}", "function blink(selector){\n $(selector).animate({opacity:0}, 50, \"linear\", function(){\n $(this).delay(700);\n $(this).animate({opacity:1}, 50, function(){\n blink(this);\n });\n $(this).delay(700);\n });\n}", "function blink(color, reps) {\n for (var i = 0; i < reps+1; i++) {\n setTimeout(function(){\n document.getElementById(\"theBody\").style.backgroundColor = color;\n }, 200 * i - 100);\n setTimeout(function(){\n document.getElementById(\"theBody\").style.backgroundColor = \"#ffffff\";\n }, 200 * i);\n };\n}", "function celebrate(){\n\tsetTimeout(function(){\n\t\twinSound.play();\n\t}, 500);\t\t\n\n\tresetGame();\n\tdisplay(\"**\");\t\t\t \n\t$(\"#board div\").addClass(\"clickeffect\");\n\tsetTimeout(function(){\n\t\t$(\"#board div\").removeClass(\"clickeffect\");\n\t}, 3000);\t\t\n}", "function fadeToBlack() {\n var ctx = hangmanGame.canvas.getContext(\"2d\");\n\n if (hangmanGame.frameCount % 2 === 0) {\n if (blackOpac < 1) {\n blackOpac = round(blackOpac + 0.025, 1000);\n }\n }\n\n if (blackOpac > 1) {\n blackOpac = 1;\n }\n\n ctx.globalAlpha = blackOpac;\n ctx.fillStyle = \"#000000\";\n ctx.fillRect(0, 0, hangmanGame.canvas.width, hangmanGame.canvas.height);\n ctx.fillStyle = fontColor;\n ctx.globalAlpha = 1;\n}", "function piman_send_message(msg,error){\n msg = '<span>' + msg + '</span>';\n\n $(window).scrollTop($('body').position().top)\n\n $(\"#notifications_content\").html(msg)\n .addClass(error ? 'error' : 'success');\n\n $(\"#notifications\")\n .toggle()\n .delay(5000).fadeOut()\n .click(function(){$(this).stop(true,true).fadeOut()});\n\n}", "function highlight(bid) {\n\tlet neonStyle = document.getElementById(\"class_name\").href.includes(\"neon\");\n\n\tlet btn = document.getElementById(bid);\n\n\tbtn.className = btn.className + \" KDOWN\"\n\t\t+ (neonStyle == true ? \n\t\t\t(btn.className.includes(\"clear\") ? \"clr\"\n\t\t\t:btn.className.includes(\"math\") ? \"math\"\n\t\t\t:btn.className.includes(\"number\") ? \"num\"\n\t\t\t:btn.id.includes(\"equals\") ? \"eq\"\n\t\t\t:btn.id.includes(\"sign\") ? \"sign\"\n\t\t\t: \"\") : \"\");\n\t// Set a timer to take-off the button push\n\tsetTimeout(dehighlight, 220, bid);\n}", "function backFlash(){\n\tvar color = '#'+Math.floor(Math.random()*16777215).toString(16);\n\tdocument.body.style.background = color;\n\n}", "function blink(selector){\n let count = 0;\n while(count<6) {\n $(selector).fadeOut('slow', function(){\n $(this).fadeIn('slow', function(){\n blink(this);\n });\n });\n count++;\n }\n}", "function blindCallback(ok) {\n\tif (!ok) {\n\t\tblindBeingControlled.attributes.getNamedItem(\"status\").value = \"still\";\n\t\tblindBeingControlled.firstChild.firstChild.src = IMG_BLIND_STILL;\n\t}\n\tblindBeingControlled = false;\n}", "function highlightHintButton() {\n $(\"#hint\").css('background-image','url(img/hint1.png)').fadeTo(500,0, function() {\n $(\"#hint\").css('background-image', 'url(img/hint4.png)').fadeTo(1000, 1, function() {\n setTimeout(function() {\n $(\"#hint\").css('background-image', 'url(img/hint4.png)').fadeTo(1000, 0, function() {\n $(\"#hint\").css('background-image','url(img/hint1.png)').fadeTo(300,1);\n });\n } ,2000);\n });\n });\n}", "function processWol(host_copy) {\n document.getElementById(host_copy + \"-status\").innerHTML = \"sent\";\n var wakebtn = document.getElementById(\"btn\" + host_copy + \"-wake\");\n wakebtn.onclick = function (){getStatus(host_copy);};\n wakebtn.textContent = \"chk\";\n wakebtn.disabled = false;\n}", "function callback() {\n setTimeout(function() {\n $( \"#bRegister\" ).removeAttr( \"style\" ).hide().fadeIn();\n }, 0 );\n }", "function dance() {\n\t$head.effect( \"bounce\", 500 );\n\t$torso.effect( \"shake\", 500 );\n\t$arms.effect( \"bounce\", 500 );\n\t$legs.effect( \"shake\", 500 );\n}", "directToClientMethod(value){\n this.e.renderer.blink([0, this.params.gain * value, 0], 0.4);\n console.log('blinking now!');\n }", "function bookingConfirmationClose(){\n\n\t\t$bookingOverlay.velocity('fadeOut', 100);\n\t\t$bookConfirm.velocity('fadeOut', 200);\n\n\t}", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "function blink(cell) {\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 650);\n setTimeout(function() {\n cell.style.color = \"red\";\n }, 1150);\n setTimeout(function() {\n cell.style.color = \"\";\n }, 1650);\n}", "function stopFollowingUserEff(stalkedid, userid, ideaid) {\n\t\t$('#followUserButton').text(\"Stop following this user?\").css('background-color', '#FF4D4D').fadeIn(1000);\n\n\t\t$('#followUserButton').mouseout(function() {\n\t\t\t$('#followUserButton').text(\"You are following this user.\").css('background-color', '#66FF66');\n\t\t});\n\n\t\t$('#followUserButton').click(function() {\n\t\t\t// This might prevent flickering of colors on clicking.\n\t\t\t$('#followUserButton').text(\"Stop following this user?\"+ideaid).css('background-color', '#FF4D4D').fadeIn(1000);\n\t\t\t stopFollowingUser(stalkedid, userid, ideaid);\n\t\t});\n\t}", "function congratulate_draw() {\n $.toast({ \n heading: \"It's a DRAW\",\n icon: 'info',\n text: \"Thank you for this tough game. It was fun to watch\",\n textAlign : 'center',\n textColor : '#fff',\n bgColor : '#ffba18',\n hideAfter : false,\n stack : false,\n position : 'mid-center',\n allowToastClose : true,\n showHideTransition : 'fade',\n loader: false,\n });\n}", "methodTriggeredFromServer(rdvTime){\n // get rel time (sec) in which I must blink\n let timeRemaining = rdvTime - this.e.sync.getSyncTime();\n console.log('will blink in', timeRemaining, 'seconds');\n setTimeout( () => { this.e.renderer.blink([0, 160, 200], 0.4); }, timeRemaining * 1000 );\n }", "function flashblue() {\r\n $('#buttonone').click(function () {\r\n togglelight($(this));\r\n $.ajax({\r\n url:\"http://192.168.0.50/api/stlaB2I6VZ8O80Qepc-1xfmLrHgyTFvB9IGupaQz/lights/1/state/\",\r\n type: \"PUT\",\r\n data: JSON.stringify({\"on\":true,\"bri\":254,\"hue\":46920}),\t\t\t\r\n });\r\n\t\tsetTimeout(function () {\r\n $.ajax({\r\n\t\t\t\t\turl:\"http://192.168.0.50/api/stlaB2I6VZ8O80Qepc-1xfmLrHgyTFvB9IGupaQz/lights/1/state/\",\r\n\t\t\t\t\ttype: \"PUT\",\r\n\t\t\t\t\tdata: JSON.stringify({\"on\":false,}),\r\n\t\t\t\t\t});\r\n }, 750)\r\n })\r\n}" ]
[ "0.6652335", "0.6583782", "0.65703756", "0.6560736", "0.6434304", "0.6403273", "0.6356119", "0.6345212", "0.6330613", "0.6327562", "0.6323953", "0.6289518", "0.6214727", "0.6199736", "0.61682945", "0.6107219", "0.60986316", "0.6095831", "0.6078128", "0.6062919", "0.6060506", "0.6047648", "0.60466665", "0.6037257", "0.6029221", "0.6029079", "0.60083115", "0.6006027", "0.5997711", "0.5992429", "0.597441", "0.5941403", "0.59363174", "0.5921156", "0.5919934", "0.59140426", "0.5904034", "0.59018683", "0.58962816", "0.5894241", "0.58836293", "0.5881446", "0.5851986", "0.58423597", "0.58394986", "0.5826335", "0.58207715", "0.5818744", "0.58087516", "0.5771894", "0.57662404", "0.57661456", "0.57650524", "0.5759724", "0.5749673", "0.5743846", "0.5739604", "0.57269883", "0.5721824", "0.5721368", "0.57197034", "0.5710879", "0.57072115", "0.5702291", "0.56936", "0.56837267", "0.5682139", "0.5669445", "0.5668843", "0.5664487", "0.5664237", "0.5659732", "0.5655553", "0.56483144", "0.5636093", "0.5631794", "0.56244737", "0.56242317", "0.562293", "0.5617595", "0.5615862", "0.5611337", "0.56102777", "0.5607417", "0.5601846", "0.55931914", "0.55922866", "0.5584941", "0.5579689", "0.5578177", "0.5574109", "0.55560386", "0.5554496", "0.55532324", "0.5551243", "0.5543491", "0.5543491", "0.5539316", "0.5537512", "0.5536919", "0.5535252" ]
0.0
-1
Main Type and Public API / QB The primary type of the qb package
function QB (options) { if (!(this instanceof QB)) { return new QB(options); } // Super constructor MiddlewareProvider.call(this); var qb = this; // Init qb._options = defaults(options, default_options) qb._types = {} qb._aliases = {} qb.name = qb._options.name // TODO process this into .alias _processAliasOptions(qb, qb._options.aliases) qb.log = book.default(); if (qb._options.catch_sigterm_end) handleSigterm(qb); _listen(qb) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FQB() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var graphEndpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n\n _classCallCheck(this, FQB);\n\n this._graphNode; // the GraphNode we are working with\n this._graphVersion; // the URL prefix version of the Graph API\n this._appSecret; // the application secret key\n this._enableBetaMode = false; // a toggle to enable the beta tier of the Graph API\n this._config = config; // the config options sent in from the user\n\n this._graphNode = new _graph_node2.default(graphEndpoint);\n if (config.hasOwnProperty('accessToken')) this.accessToken(config.accessToken);\n if (config.hasOwnProperty('graphVersion')) this.graphVersion(config.graphVersion);\n if (config.hasOwnProperty('appSecret')) this._appSecret = config.appSecret;\n if (config.hasOwnProperty('enableBetaMode') && config.enableBetaMode === true) this._enableBetaMode = true;\n }", "function banano_bananovuematerial_bananoalasql() {\nvar _B=this;\n_B._db_bool=\"BOOL\";\n\n_B._db_int=\"INT\";\n\n_B._db_string=\"STRING\";\n\n_B._db_real=\"REAL\";\n\n_B._db_date=\"DATE\";\n\n_B._db_blob=\"BLOB\";\n\n_B._db_float=\"FLOAT\";\n\n_B._db_integer=\"INTEGER\";\n\n_B._db_text=\"TEXT\";\n\n_B._rectype={};\n\n_B._schema={};\n\n// [20] Public Sub Initialize() As BANanoAlaSQL \n_B.initialize=function() {\n// [21] recType.Initialize \n_B._rectype={};\n// [22] Schema.Initialize \n_B._schema={};\n// [23] Return Me \nreturn _B;\n// End Sub\n};\n\n// [26] Sub Update(tblName As String, priKey As String, priValue As String, tblfields As Map) As AlaSQLResultSet \n_B.update=function(_tblname,_prikey,_privalue,_tblfields) {\nvar _tblwhere;\n// [27] Dim tblWhere As Map = CreateMap() \n_tblwhere={};\n// [28] tblWhere.Put(priKey, priValue) \n_tblwhere[_prikey]=_privalue;\n// [29] Return UpdateWhere(tblName, tblfields, tblWhere, Null) \nreturn _B.updatewhere(_tblname,_tblfields,_tblwhere,null,_B);\n// End Sub\n};\n\n// [33] Sub SchemaClear As BANanoAlaSQL \n_B.schemaclear=function() {\n// [34] Schema.clear \n_B._schema={};\n// [35] Return Me \nreturn _B;\n// End Sub\n};\n\n// [39] Sub SchemaAddBoolean(bools As List) As BANanoAlaSQL \n_B.schemaaddboolean=function(_bools) {\nvar _b;\n// [40] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [41] Schema.Put(b, DB_BOOL) \n_B._schema[_b]=_B._db_bool;\n// [42] Next \n}\n// [43] Return Me \nreturn _B;\n// End Sub\n};\n\n// [46] Sub SchemaAddInt(bools As List) As BANanoAlaSQL \n_B.schemaaddint=function(_bools) {\nvar _b;\n// [47] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [48] Schema.Put(b, DB_INT) \n_B._schema[_b]=_B._db_int;\n// [49] Next \n}\n// [50] Return Me \nreturn _B;\n// End Sub\n};\n\n// [53] Sub SchemaAddFloat(bools As List) As BANanoAlaSQL \n_B.schemaaddfloat=function(_bools) {\nvar _b;\n// [54] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [55] Schema.Put(b, DB_FLOAT) \n_B._schema[_b]=_B._db_float;\n// [56] Next \n}\n// [57] Return Me \nreturn _B;\n// End Sub\n};\n\n// [60] Sub SchemaAddBlob(bools As List) As BANanoAlaSQL \n_B.schemaaddblob=function(_bools) {\nvar _b;\n// [61] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [62] Schema.Put(b, DB_BLOB) \n_B._schema[_b]=_B._db_blob;\n// [63] Next \n}\n// [64] Return Me \nreturn _B;\n// End Sub\n};\n\n// [67] Sub SchemaAddText(bools As List) As BANanoAlaSQL \n_B.schemaaddtext=function(_bools) {\nvar _b;\n// [68] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [69] Schema.Put(b, DB_TEXT) \n_B._schema[_b]=_B._db_text;\n// [70] Next \n}\n// [71] Return Me \nreturn _B;\n// End Sub\n};\n\n// [74] Sub SchemaAddDate(bools As List) As BANanoAlaSQL \n_B.schemaadddate=function(_bools) {\nvar _b;\n// [75] For Each b As String In bools \nfor (var _bindex=0;_bindex<_bools.length;_bindex++) {\n_b=_bools[_bindex];\n// [76] Schema.Put(b, DB_DATE) \n_B._schema[_b]=_B._db_date;\n// [77] Next \n}\n// [78] Return Me \nreturn _B;\n// End Sub\n};\n\n// [81] Sub ResetTypes As BANanoAlaSQL \n_B.resettypes=function() {\n// [82] recType.Initialize \n_B._rectype={};\n// [83] Return Me \nreturn _B;\n// End Sub\n};\n\n// [86] Sub GetNextID(fld As String, rsl As List) As String \n_B.getnextid=function(_fld,_rsl) {\nvar _nextid,_strid,_nr,_ni;\n// [87] Dim nextid As Int \n_nextid=0;\n// [88] Dim strid As String \n_strid=\"\";\n// [90] If rsl.Size = 0 Then \nif (_rsl.length==0) {\n// [91] nextid = 0 \n_nextid=0;\n// [92] Else \n} else {\n// [93] Dim nr As Map = rsl.Get(0) \n_nr=_rsl[0];\n// [94] Dim ni As String = nr.Getdefault(fld, {25} ) \n_ni=(_nr[_fld] || \"0\");\n// [95] nextid = BANano.parseInt(ni) \n_nextid=parseInt(_ni);\n// [96] End If \n}\n// [97] nextid = nextid + 1 \n_nextid=_nextid+1;\n// [98] strid = CStr(nextid) \n_strid=_B.cstr(_nextid,_B);\n// [99] Return strid \nreturn _strid;\n// End Sub\n};\n\n// [104] Sub CStr(o As Object) As String \n_B.cstr=function(_o) {\n// [105] Return {26} & o \nreturn \"\"+_o;\n// End Sub\n};\n\n// [110] Sub AddStrings(fieldNames As List) As BANanoAlaSQL \n_B.addstrings=function(_fieldnames) {\nvar _strfld;\n// [111] For Each strfld As String In fieldNames \nfor (var _strfldindex=0;_strfldindex<_fieldnames.length;_strfldindex++) {\n_strfld=_fieldnames[_strfldindex];\n// [112] recType.Put(strfld, {27} ) \n_B._rectype[_strfld]=\"STRING\";\n// [113] Next \n}\n// [114] Return Me \nreturn _B;\n// End Sub\n};\n\n// [118] Sub AddIntegers(fieldNames As List) As BANanoAlaSQL \n_B.addintegers=function(_fieldnames) {\nvar _strfld;\n// [119] For Each strfld As String In fieldNames \nfor (var _strfldindex=0;_strfldindex<_fieldnames.length;_strfldindex++) {\n_strfld=_fieldnames[_strfldindex];\n// [120] recType.Put(strfld, {28} ) \n_B._rectype[_strfld]=\"INT\";\n// [121] Next \n}\n// [122] Return Me \nreturn _B;\n// End Sub\n};\n\n// [126] Sub AddDoubles(fieldNames As List) As BANanoAlaSQL \n_B.adddoubles=function(_fieldnames) {\nvar _strfld;\n// [127] For Each strfld As String In fieldNames \nfor (var _strfldindex=0;_strfldindex<_fieldnames.length;_strfldindex++) {\n_strfld=_fieldnames[_strfldindex];\n// [128] recType.Put(strfld, {29} ) \n_B._rectype[_strfld]=\"DOUBLE\";\n// [129] Next \n}\n// [130] Return Me \nreturn _B;\n// End Sub\n};\n\n// [134] Sub AddBooleans(fieldNames As List) As BANanoAlaSQL \n_B.addbooleans=function(_fieldnames) {\nvar _strfld;\n// [135] For Each strfld As String In fieldNames \nfor (var _strfldindex=0;_strfldindex<_fieldnames.length;_strfldindex++) {\n_strfld=_fieldnames[_strfldindex];\n// [136] recType.Put(strfld, {30} ) \n_B._rectype[_strfld]=\"BOOL\";\n// [137] Next \n}\n// [138] Return Me \nreturn _B;\n// End Sub\n};\n\n// [142] Sub AddBlobs(fieldNames As List) As BANanoAlaSQL \n_B.addblobs=function(_fieldnames) {\nvar _strfld;\n// [143] For Each strfld As String In fieldNames \nfor (var _strfldindex=0;_strfldindex<_fieldnames.length;_strfldindex++) {\n_strfld=_fieldnames[_strfldindex];\n// [144] recType.Put(strfld, {31} ) \n_B._rectype[_strfld]=\"BLOB\";\n// [145] Next \n}\n// [146] Return Me \nreturn _B;\n// End Sub\n};\n\n// [150] private Sub GetMapValues(sourceMap As Map) As List \n_B.getmapvalues=function(_sourcemap) {\nvar _listofvalues,_icnt,_itot,_value;\n// [151] Dim listOfValues As List \n_listofvalues=[];\n// [152] listOfValues.Initialize \n_listofvalues.length=0;\n// [153] Dim iCnt As Int \n_icnt=0;\n// [154] Dim iTot As Int \n_itot=0;\n// [155] iTot = sourceMap.Size - 1 \n_itot=Object.keys(_sourcemap).length-1;\n// [156] For iCnt = 0 To iTot \nfor (_icnt=0;_icnt<=_itot;_icnt++) {\n// [157] Dim value As String = sourceMap.GetValueAt(iCnt) \n_value=banano_getB4JValueAt(_sourcemap,_icnt);\n// [158] listOfValues.Add(value) \n_listofvalues.push(_value);\n// [159] Next \n}\n// [160] Return listOfValues \nreturn _listofvalues;\n// End Sub\n};\n\n// [164] private Sub JoinFields(delimiter As String, lst As List) As String \n_B.joinfields=function(_delimiter,_lst) {\nvar _i,_sb,_fld;\n// [165] Dim i As Int \n_i=0;\n// [166] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [167] Dim fld As String \n_fld=\"\";\n// [168] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [169] fld = lst.Get(0) \n_fld=_lst[0];\n// [170] fld = EscapeField(fld) \n_fld=_B.escapefield(_fld,_B);\n// [171] sb.Append(fld) \n_sb.append(_fld);\n// [172] For i = 1 To lst.size - 1 \nfor (_i=1;_i<=_lst.length-1;_i++) {\n// [173] Dim fld As String = lst.Get(i) \n_fld=_lst[_i];\n// [174] fld = EscapeField(fld) \n_fld=_B.escapefield(_fld,_B);\n// [175] sb.Append(delimiter).Append(fld) \n_sb.append(_delimiter).append(_fld);\n// [176] Next \n}\n// [177] Return sb.ToString \nreturn _sb.toString();\n// End Sub\n};\n\n// [181] private Sub GetMapKeys(sourceMap As Map) As List \n_B.getmapkeys=function(_sourcemap) {\nvar _listofvalues,_icnt,_itot,_value;\n// [182] Dim listOfValues As List \n_listofvalues=[];\n// [183] listOfValues.Initialize \n_listofvalues.length=0;\n// [184] Dim iCnt As Int \n_icnt=0;\n// [185] Dim iTot As Int \n_itot=0;\n// [186] iTot = sourceMap.Size - 1 \n_itot=Object.keys(_sourcemap).length-1;\n// [187] For iCnt = 0 To iTot \nfor (_icnt=0;_icnt<=_itot;_icnt++) {\n// [188] Dim value As String = sourceMap.GetKeyAt(iCnt) \n_value=banano_getB4JKeyAt(_sourcemap,_icnt);\n// [189] listOfValues.Add(value) \n_listofvalues.push(_value);\n// [190] Next \n}\n// [191] Return listOfValues \nreturn _listofvalues;\n// End Sub\n};\n\n// [195] Sub Json2Map(strJSON As String) As Map \n_B.json2map=function(_strjson) {\nvar _json,_map1;\n// [196] Dim json As BANanoJSONParser \n_json={};\n// [197] Dim Map1 As Map \n_map1={};\n// [198] Map1.Initialize \n_map1={};\n// [199] Map1.clear \n_map1={};\n// [200] Try \ntry {\n// [201] If strJSON.length > 0 Then \nif (_strjson.length>0) {\n// [202] json.Initialize(strJSON) \n_json=JSON.parse(_strjson);\n// [203] Map1 = json.NextObject \n_map1=_json;\n// [204] End If \n}\n// [205] Return Map1 \nreturn _map1;\n// [206] Catch \n} catch(err) {\n// [207] Return Map1 \nreturn _map1;\n// [208] End Try \n}\n// End Sub\n};\n\n// [212] Sub Delete(tblName As String, primaryKey As String, primaryValue As String) As AlaSQLResultSet \n_B.delete=function(_tblname,_primarykey,_primaryvalue) {\nvar _qw,_qry;\n// [213] Dim qw As Map = CreateMap() \n_qw={};\n// [214] qw.Put(primaryKey, primaryValue) \n_qw[_primarykey]=_primaryvalue;\n// [215] Dim qry As AlaSQLResultSet = DeleteWhere(tblName, qw, Array( {32} )) \n_qry=_B.deletewhere(_tblname,_qw,[\"=\"],_B);\n// [216] Return qry \nreturn _qry;\n// End Sub\n};\n\n// [220] Private Sub EscapeField(f As String) As String \n_B.escapefield=function(_f) {\n// [221] Return {0} \nreturn \"[\" + _f + \"]\";\n// End Sub\n};\n\n// [224] Sub SchemaCreateTable(tblName As String, PK As String) As AlaSQLResultSet \n_B.schemacreatetable=function(_tblname,_pk) {\n// [225] Return CreateTable(tblName, Schema, PK) \nreturn _B.createtable(_tblname,_B._schema,_pk,_B);\n// End Sub\n};\n\n// [229] public Sub CreateTable(tblName As String, tblFields As Map, PK As String) As AlaSQLResultSet \n_B.createtable=function(_tblname,_tblfields,_pk) {\nvar _fldname,_fldtype,_fldtot,_fldcnt,_sb,_query,_m;\n// [230] Dim fldName As String \n_fldname=\"\";\n// [231] Dim fldType As String \n_fldtype=\"\";\n// [232] Dim fldTot As Int \n_fldtot=0;\n// [233] Dim fldCnt As Int \n_fldcnt=0;\n// [234] fldTot = tblFields.Size - 1 \n_fldtot=Object.keys(_tblfields).length-1;\n// [235] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [236] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [237] sb.Append( {33} ) \n_sb.append(\"(\");\n// [238] For fldCnt = 0 To fldTot \nfor (_fldcnt=0;_fldcnt<=_fldtot;_fldcnt++) {\n// [239] fldName = tblFields.GetKeyAt(fldCnt) \n_fldname=banano_getB4JKeyAt(_tblfields,_fldcnt);\n// [240] fldType = tblFields.Get(fldName) \n_fldtype=_tblfields[_fldname];\n// [241] If fldCnt > 0 Then \nif (_fldcnt>0) {\n// [242] sb.Append( {34} ) \n_sb.append(\", \");\n// [243] End If \n}\n// [244] sb.Append(EscapeField(fldName)) \n_sb.append(_B.escapefield(_fldname,_B));\n// [245] sb.Append( {35} ) \n_sb.append(\" \");\n// [246] sb.Append(fldType) \n_sb.append(_fldtype);\n// [247] If fldName.EqualsIgnoreCase(PK) Then \nif (_fldname.equalsIgnoreCase(_pk)) {\n// [248] sb.Append( {36} ) \n_sb.append(\" PRIMARY KEY\");\n// [249] End If \n}\n// [250] Next \n}\n// [251] sb.Append( {37} ) \n_sb.append(\")\");\n// [253] Dim query As String = {38} & EscapeField(tblName) & {39} & sb.ToString \n_query=\"CREATE TABLE IF NOT EXISTS \"+_B.escapefield(_tblname,_B)+\" \"+_sb.toString();\n// [254] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [255] m.Initialize \n_m.initialize();\n// [256] m.query = query \n_m._query=_query;\n// [257] m.args = Null \n_m._args=null;\n// [258] m.types = Null \n_m._types=null;\n// [259] m.command = {40} \n_m._command=\"createtable\";\n// [260] m.response = {41} \n_m._response=\"\";\n// [261] m.error = {42} \n_m._error=\"\";\n// [262] m.result = Array() \n_m._result=[];\n// [263] m.json = {43} \n_m._json=\"\";\n// [264] m.affectedRows = 0 \n_m._affectedrows=0;\n// [265] Return m \nreturn _m;\n// End Sub\n};\n\n// [269] Sub InsertList(tblname As String) As AlaSQLResultSet \n_B.insertlist=function(_tblname) {\nvar _ssql,_m;\n// [270] Dim sSQL As String = {1} \n_ssql=\"SELECT * INTO [\" + _tblname + \"] FROM ?\";\n// [271] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [272] m.Initialize \n_m.initialize();\n// [273] m.query = sSQL \n_m._query=_ssql;\n// [274] m.args = Null \n_m._args=null;\n// [275] m.types = Null \n_m._types=null;\n// [276] m.command = {44} \n_m._command=\"insert\";\n// [277] m.response = {45} \n_m._response=\"\";\n// [278] m.error = {46} \n_m._error=\"\";\n// [279] m.result = Array() \n_m._result=[];\n// [280] m.json = {47} \n_m._json=\"\";\n// [281] m.affectedRows = 0 \n_m._affectedrows=0;\n// [282] Return m \nreturn _m;\n// End Sub\n};\n\n// [286] Sub GetMax(tblName As String, fldName As String) As AlaSQLResultSet \n_B.getmax=function(_tblname,_fldname) {\nvar _sb,_m;\n// [287] Dim sb As String = {2} \n_sb=\"SELECT MAX(\" + _fldname + \") As \" + _fldname + \" FROM \" + _B.escapefield(_tblname,_B) + \"\";\n// [288] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [289] m.Initialize \n_m.initialize();\n// [290] m.query = sb \n_m._query=_sb;\n// [291] m.args = Null \n_m._args=null;\n// [292] m.types = Null \n_m._types=null;\n// [293] m.command = {48} \n_m._command=\"getmax\";\n// [294] m.response = {49} \n_m._response=\"\";\n// [295] m.error = {50} \n_m._error=\"\";\n// [296] m.result = Array() \n_m._result=[];\n// [297] m.json = {51} \n_m._json=\"\";\n// [298] m.affectedRows = 0 \n_m._affectedrows=0;\n// [299] Return m \nreturn _m;\n// End Sub\n};\n\n// [303] public Sub DropTable(tblName As String) As AlaSQLResultSet \n_B.droptable=function(_tblname) {\nvar _query,_m;\n// [305] Dim query As String = {52} & EscapeField(tblName) \n_query=\"DROP TABLE \"+_B.escapefield(_tblname,_B);\n// [306] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [307] m.Initialize \n_m.initialize();\n// [308] m.query = query \n_m._query=_query;\n// [309] m.args = Null \n_m._args=null;\n// [310] m.types = Null \n_m._types=null;\n// [311] m.response = {53} \n_m._response=\"\";\n// [312] m.error = {54} \n_m._error=\"\";\n// [313] m.command = {55} \n_m._command=\"droptable\";\n// [314] m.result = Array() \n_m._result=[];\n// [315] m.json = {56} \n_m._json=\"\";\n// [316] m.affectedRows = 0 \n_m._affectedrows=0;\n// [317] Return m \nreturn _m;\n// End Sub\n};\n\n// [320] Sub Execute(strSQL As String) As AlaSQLResultSet \n_B.execute=function(_strsql) {\nvar _m;\n// [321] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [322] m.Initialize \n_m.initialize();\n// [323] m.query = strSQL \n_m._query=_strsql;\n// [324] m.args = Null \n_m._args=null;\n// [325] m.types = Null \n_m._types=null;\n// [326] m.command = {57} \n_m._command=\"execute\";\n// [327] m.response = {58} \n_m._response=\"\";\n// [328] m.error = {59} \n_m._error=\"\";\n// [329] m.result = Array() \n_m._result=[];\n// [330] m.json = {60} \n_m._json=\"\";\n// [331] m.affectedRows = 0 \n_m._affectedrows=0;\n// [332] Return m \nreturn _m;\n// End Sub\n};\n\n// [336] Sub Insert(tblName As String, tblFields As Map) As AlaSQLResultSet \n_B.insert=function(_tblname,_tblfields) {\nvar _sb,_columns,_values,_listofvalues,_listoftypes,_icnt,_itot,_col,_m;\n// [337] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [338] Dim columns As StringBuilder \n_columns=new StringBuilder();\n// [339] Dim values As StringBuilder \n_values=new StringBuilder();\n// [340] Dim listOfValues As List = GetMapValues(tblFields) \n_listofvalues=_B.getmapvalues(_tblfields,_B);\n// [341] Dim listOfTypes As List = GetMapTypes(tblFields) \n_listoftypes=_B.getmaptypes(_tblfields,_B);\n// [342] Dim iCnt As Int \n_icnt=0;\n// [343] Dim iTot As Int \n_itot=0;\n// [344] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [345] columns.Initialize \n_columns.init();\n_columns.isinitialized=true;\n// [346] values.Initialize \n_values.init();\n_values.isinitialized=true;\n// [347] sb.Append( {3} ) \n_sb.append(\"INSERT INTO \" + _B.escapefield(_tblname,_B) + \" (\");\n// [348] iTot = tblFields.Size - 1 \n_itot=Object.keys(_tblfields).length-1;\n// [349] For iCnt = 0 To iTot \nfor (_icnt=0;_icnt<=_itot;_icnt++) {\n// [350] Dim col As String = tblFields.GetKeyAt(iCnt) \n_col=banano_getB4JKeyAt(_tblfields,_icnt);\n// [351] If iCnt > 0 Then \nif (_icnt>0) {\n// [352] columns.Append( {61} ) \n_columns.append(\", \");\n// [353] values.Append( {62} ) \n_values.append(\", \");\n// [354] End If \n}\n// [355] columns.Append(EscapeField(col)) \n_columns.append(_B.escapefield(_col,_B));\n// [356] values.Append( {63} ) \n_values.append(\"?\");\n// [357] Next \n}\n// [358] sb.Append(columns.ToString) \n_sb.append(_columns.toString());\n// [359] sb.Append( {64} ) \n_sb.append(\") VALUES (\");\n// [360] sb.Append(values.ToString) \n_sb.append(_values.toString());\n// [361] sb.Append( {65} ) \n_sb.append(\")\");\n// [362] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [363] m.Initialize \n_m.initialize();\n// [364] m.query = sb.ToString \n_m._query=_sb.toString();\n// [365] m.args = listOfValues \n_m._args=_listofvalues;\n// [366] m.types = listOfTypes \n_m._types=_listoftypes;\n// [367] m.command = {66} \n_m._command=\"insert\";\n// [368] m.response = {67} \n_m._response=\"\";\n// [369] m.error = {68} \n_m._error=\"\";\n// [370] m.result = Array() \n_m._result=[];\n// [371] m.json = {69} \n_m._json=\"\";\n// [372] m.affectedRows = 0 \n_m._affectedrows=0;\n// [373] Return m \nreturn _m;\n// End Sub\n};\n\n// [378] private Sub GetMapTypes(sourceMap As Map) As List \n_B.getmaptypes=function(_sourcemap) {\nvar _listoftypes,_icnt,_itot,_col,_coltype;\n// [379] Dim listOfTypes As List \n_listoftypes=[];\n// [380] listOfTypes.Initialize \n_listoftypes.length=0;\n// [381] Dim iCnt As Int \n_icnt=0;\n// [382] Dim iTot As Int \n_itot=0;\n// [383] iTot = sourceMap.Size - 1 \n_itot=Object.keys(_sourcemap).length-1;\n// [384] For iCnt = 0 To iTot \nfor (_icnt=0;_icnt<=_itot;_icnt++) {\n// [385] Dim col As String = sourceMap.GetKeyAt(iCnt) \n_col=banano_getB4JKeyAt(_sourcemap,_icnt);\n// [386] Dim colType As String = recType.GetDefault(col, {70} ) \n_coltype=(_B._rectype[_col] || \"STRING\");\n// [387] Select Case colType \nswitch (\"\" + _coltype) {\n// [388] Case {71} , {72} , {73} , {74} \ncase \"\" + \"VARCHAR(20)\":\ncase \"\" + \"VARCHAR(10)\":\ncase \"\" + \"VARCHAR(30)\":\ncase \"\" + \"VARCHAR(40)\":\n// [389] listOfTypes.add( {75} ) \n_listoftypes.push(\"s\");\n// [390] Case {76} , {77} , {78} \nbreak;\ncase \"\" + \"VARCHAR(50)\":\ncase \"\" + \"VARCHAR(100)\":\ncase \"\" + \"VARCHAR(255)\":\n// [391] listOfTypes.add( {79} ) \n_listoftypes.push(\"s\");\n// [392] Case {80} , {81} , {82} , {83} , {84} , {85} \nbreak;\ncase \"\" + \"STRING\":\ncase \"\" + \"VARCHAR\":\ncase \"\" + \"TEXT\":\ncase \"\" + \"DATE\":\ncase \"\" + \"DATETIME\":\ncase \"\" + \"NVARCHAR\":\n// [393] listOfTypes.add( {86} ) \n_listoftypes.push(\"s\");\n// [394] Case {87} , {88} , {89} , {90} \nbreak;\ncase \"\" + \"INTEGER\":\ncase \"\" + \"INT\":\ncase \"\" + \"BOOL\":\ncase \"\" + \"BOOLEAN\":\n// [395] listOfTypes.add( {91} ) \n_listoftypes.push(\"i\");\n// [396] Case {92} \nbreak;\ncase \"\" + \"BLOB\":\n// [397] listOfTypes.add( {93} ) \n_listoftypes.push(\"b\");\n// [398] Case {94} , {95} , {96} \nbreak;\ncase \"\" + \"REAL\":\ncase \"\" + \"FLOAT\":\ncase \"\" + \"DOUBLE\":\n// [399] listOfTypes.add( {97} ) \n_listoftypes.push(\"d\");\n// [400] Case Else \nbreak;\ndefault:\n// [401] listOfTypes.add( {98} ) \n_listoftypes.push(\"s\");\n// [402] End Select \nbreak;\n}\n// [403] Next \n}\n// [404] Return listOfTypes \nreturn _listoftypes;\n// End Sub\n};\n\n// [408] Sub EQOperators(sm As Map) As List \n_B.eqoperators=function(_sm) {\nvar _nl,_k;\n// [409] Dim nl As List \n_nl=[];\n// [410] nl.initialize \n_nl.length=0;\n// [411] For Each k As String In sm.Keys \nvar _kKeys = Object.keys(_sm);\nfor (var _kindex=0;_kindex<_kKeys.length;_kindex++) {\n_k=_kKeys[_kindex];\n// [412] nl.Add( {99} ) \n_nl.push(\"=\");\n// [413] Next \n}\n// [414] Return nl \nreturn _nl;\n// End Sub\n};\n\n// [419] Sub UpdateWhere(tblName As String, tblfields As Map, tblWhere As Map, operators As List) As AlaSQLResultSet \n_B.updatewhere=function(_tblname,_tblfields,_tblwhere,_operators) {\nvar _listoftypes,_listoftypes1,_listofvalues,_listofvalues1,_sb,_i,_itot,_col,_iwhere,_opr,_m;\n// [420] If operators = Null Then operators = EQOperators(tblWhere) \nif (_operators==null) {_operators=_B.eqoperators(_tblwhere,_B);}\n// [421] Dim listOfTypes As List = GetMapTypes(tblfields) \n_listoftypes=_B.getmaptypes(_tblfields,_B);\n// [422] Dim listOfTypes1 As List = GetMapTypes(tblWhere) \n_listoftypes1=_B.getmaptypes(_tblwhere,_B);\n// [423] listOfTypes.AddAll(listOfTypes1) \n_listoftypes.splice(_listoftypes.length,0,..._listoftypes1);\n// [424] Dim listOfValues As List = GetMapValues(tblfields) \n_listofvalues=_B.getmapvalues(_tblfields,_B);\n// [425] Dim listOfValues1 As List = GetMapValues(tblWhere) \n_listofvalues1=_B.getmapvalues(_tblwhere,_B);\n// [426] listOfValues.AddAll(listOfValues1) \n_listofvalues.splice(_listofvalues.length,0,..._listofvalues1);\n// [427] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [428] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [429] sb.Append( {4} ) \n_sb.append(\"UPDATE \" + _B.escapefield(_tblname,_B) + \" SET \");\n// [430] Dim i As Int \n_i=0;\n// [431] Dim iTot As Int = tblfields.Size - 1 \n_itot=Object.keys(_tblfields).length-1;\n// [432] For i = 0 To iTot \nfor (_i=0;_i<=_itot;_i++) {\n// [433] Dim col As String = tblfields.GetKeyAt(i) \n_col=banano_getB4JKeyAt(_tblfields,_i);\n// [434] sb.Append(EscapeField(col)) \n_sb.append(_B.escapefield(_col,_B));\n// [435] If i <> iTot Then \nif (_i!=_itot) {\n// [436] sb.Append( {100} ) \n_sb.append(\"= ?,\");\n// [437] Else \n} else {\n// [438] sb.Append( {101} ) \n_sb.append(\"= ?\");\n// [439] End If \n}\n// [440] Next \n}\n// [441] sb.Append( {5} ) \n_sb.append(\" WHERE \");\n// [442] Dim iWhere As Int = tblWhere.Size - 1 \n_iwhere=Object.keys(_tblwhere).length-1;\n// [443] For i = 0 To iWhere \nfor (_i=0;_i<=_iwhere;_i++) {\n// [444] If i > 0 Then \nif (_i>0) {\n// [445] sb.Append( {102} ) \n_sb.append(\" AND \");\n// [446] End If \n}\n// [447] Dim col As String = tblWhere.GetKeyAt(i) \n_col=banano_getB4JKeyAt(_tblwhere,_i);\n// [448] sb.Append(EscapeField(col)) \n_sb.append(_B.escapefield(_col,_B));\n// [449] Dim opr As String = operators.Get(i) \n_opr=_operators[_i];\n// [450] sb.Append( {6} ) \n_sb.append(\" \" + _opr + \" ?\");\n// [451] Next \n}\n// [452] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [453] m.Initialize \n_m.initialize();\n// [454] m.query = sb.tostring \n_m._query=_sb.toString();\n// [455] m.args = listOfValues \n_m._args=_listofvalues;\n// [456] m.types = listOfTypes \n_m._types=_listoftypes;\n// [457] m.command = {103} \n_m._command=\"update\";\n// [458] m.response = {104} \n_m._response=\"\";\n// [459] m.error = {105} \n_m._error=\"\";\n// [460] m.result = Array() \n_m._result=[];\n// [461] m.json = {106} \n_m._json=\"\";\n// [462] m.affectedRows = 0 \n_m._affectedrows=0;\n// [463] Return m \nreturn _m;\n// End Sub\n};\n\n// [467] Sub DeleteWhere(tblName As String, tblWhere As Map, operators As List) As AlaSQLResultSet \n_B.deletewhere=function(_tblname,_tblwhere,_operators) {\nvar _listoftypes,_listofvalues,_sb,_i,_iwhere,_col,_opr,_m;\n// [468] If operators = Null Then operators = EQOperators(tblWhere) \nif (_operators==null) {_operators=_B.eqoperators(_tblwhere,_B);}\n// [469] Dim listOfTypes As List = GetMapTypes(tblWhere) \n_listoftypes=_B.getmaptypes(_tblwhere,_B);\n// [470] Dim listOfValues As List = GetMapValues(tblWhere) \n_listofvalues=_B.getmapvalues(_tblwhere,_B);\n// [471] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [472] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [473] sb.Append( {7} ) \n_sb.append(\"DELETE FROM \" + _B.escapefield(_tblname,_B) + \" WHERE \");\n// [474] Dim i As Int \n_i=0;\n// [475] Dim iWhere As Int = tblWhere.Size - 1 \n_iwhere=Object.keys(_tblwhere).length-1;\n// [476] For i = 0 To iWhere \nfor (_i=0;_i<=_iwhere;_i++) {\n// [477] If i > 0 Then \nif (_i>0) {\n// [478] sb.Append( {107} ) \n_sb.append(\" AND \");\n// [479] End If \n}\n// [480] Dim col As String = tblWhere.GetKeyAt(i) \n_col=banano_getB4JKeyAt(_tblwhere,_i);\n// [481] sb.Append(col) \n_sb.append(_col);\n// [482] Dim opr As String = operators.Get(i) \n_opr=_operators[_i];\n// [483] sb.Append( {8} ) \n_sb.append(\" \" + _opr + \" ?\");\n// [484] Next \n}\n// [485] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [486] m.Initialize \n_m.initialize();\n// [487] m.query = sb.tostring \n_m._query=_sb.toString();\n// [488] m.args = listOfValues \n_m._args=_listofvalues;\n// [489] m.types = listOfTypes \n_m._types=_listoftypes;\n// [490] m.command = {108} \n_m._command=\"delete\";\n// [491] m.response = {109} \n_m._response=\"\";\n// [492] m.error = {110} \n_m._error=\"\";\n// [493] m.result = Array() \n_m._result=[];\n// [494] m.json = {111} \n_m._json=\"\";\n// [495] m.affectedRows = 0 \n_m._affectedrows=0;\n// [496] Return m \nreturn _m;\n// End Sub\n};\n\n// [501] Sub DeleteAll(tblName As String) As AlaSQLResultSet \n_B.deleteall=function(_tblname) {\nvar _sb,_m;\n// [502] Dim sb As String = {9} \n_sb=\"DELETE FROM \" + _B.escapefield(_tblname,_B) + \" WHERE 1=1\";\n// [503] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [504] m.Initialize \n_m.initialize();\n// [505] m.query = sb \n_m._query=_sb;\n// [506] m.args = Null \n_m._args=null;\n// [507] m.types = Null \n_m._types=null;\n// [508] m.command = {112} \n_m._command=\"delete\";\n// [509] m.response = {113} \n_m._response=\"\";\n// [510] m.error = {114} \n_m._error=\"\";\n// [511] m.result = Array() \n_m._result=[];\n// [512] m.json = {115} \n_m._json=\"\";\n// [513] m.affectedRows = 0 \n_m._affectedrows=0;\n// [514] Return m \nreturn _m;\n// End Sub\n};\n\n// [519] Sub Map2Json(mp As Map) As String \n_B.map2json=function(_mp) {\nvar _json;\n// [520] Dim JSON As BANanoJSONGenerator \n_json={};\n// [521] JSON.Initialize(mp) \n_json=_mp;\n// [522] Return JSON.ToString \nreturn JSON.stringify(_json);\n// End Sub\n};\n\n// [526] Sub List2Json(mp As List) As String \n_B.list2json=function(_mp) {\nvar _json;\n// [527] Dim JSON As BANanoJSONGenerator \n_json={};\n// [528] JSON.Initialize2(mp) \n_json=_mp;\n// [529] Return JSON.ToString \nreturn JSON.stringify(_json);\n// End Sub\n};\n\n// [533] Sub Json2List(strValue As String) As List \n_B.json2list=function(_strvalue) {\nvar _lst,_parser;\n// [534] Dim lst As List \n_lst=[];\n// [535] lst.Initialize \n_lst.length=0;\n// [536] lst.clear \n_lst.length=0;\n// [537] If strValue.Length = 0 Then \nif (_strvalue.length==0) {\n// [538] Return lst \nreturn _lst;\n// [539] End If \n}\n// [540] Try \ntry {\n// [541] Dim parser As BANanoJSONParser \n_parser={};\n// [542] parser.Initialize(strValue) \n_parser=JSON.parse(_strvalue);\n// [543] Return parser.NextArray \nreturn _parser;\n// [544] Catch \n} catch(err) {\n// [545] Return lst \nreturn _lst;\n// [546] End Try \n}\n// End Sub\n};\n\n// [551] Sub UpdateAll(tblName As String, tblFields As Map, operators As List) As AlaSQLResultSet \n_B.updateall=function(_tblname,_tblfields,_operators) {\nvar _listoftypes,_args,_sb,_i,_itot,_oper,_col,_m;\n// [552] If operators = Null Then operators = EQOperators(tblFields) \nif (_operators==null) {_operators=_B.eqoperators(_tblfields,_B);}\n// [553] Dim listOfTypes As List = GetMapTypes(tblFields) \n_listoftypes=_B.getmaptypes(_tblfields,_B);\n// [554] Dim args As List = GetMapValues(tblFields) \n_args=_B.getmapvalues(_tblfields,_B);\n// [555] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [556] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [557] sb.Append( {10} ) \n_sb.append(\"UPDATE \" + _B.escapefield(_tblname,_B) + \" SET \");\n// [558] Dim i As Int \n_i=0;\n// [559] Dim iTot As Int = tblFields.Size - 1 \n_itot=Object.keys(_tblfields).length-1;\n// [560] For i = 0 To iTot \nfor (_i=0;_i<=_itot;_i++) {\n// [561] Dim oper As String = operators.Get(i) \n_oper=_operators[_i];\n// [562] Dim col As String = tblFields.GetKeyAt(i) \n_col=banano_getB4JKeyAt(_tblfields,_i);\n// [563] sb.Append(col) \n_sb.append(_col);\n// [564] If i <> iTot Then \nif (_i!=_itot) {\n// [565] sb.Append( {116} ) \n_sb.append(\" = ?,\");\n// [566] Else \n} else {\n// [567] sb.Append( {11} ) \n_sb.append(\" \" + _oper + \" ?\");\n// [568] End If \n}\n// [569] Next \n}\n// [570] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [571] m.Initialize \n_m.initialize();\n// [572] m.query = sb.tostring \n_m._query=_sb.toString();\n// [573] m.args = args \n_m._args=_args;\n// [574] m.types = listOfTypes \n_m._types=_listoftypes;\n// [575] m.command = {117} \n_m._command=\"update\";\n// [576] m.response = {118} \n_m._response=\"\";\n// [577] m.error = {119} \n_m._error=\"\";\n// [578] m.result = Array() \n_m._result=[];\n// [579] m.json = {120} \n_m._json=\"\";\n// [580] m.affectedRows = 0 \n_m._affectedrows=0;\n// [581] Return m \nreturn _m;\n// End Sub\n};\n\n// [585] Sub Read(tblName As String, primaryKey As String, primaryValue As String) As AlaSQLResultSet \n_B.read=function(_tblname,_primarykey,_primaryvalue) {\nvar _qw,_qry;\n// [586] Dim qw As Map = CreateMap() \n_qw={};\n// [587] qw.Put(primaryKey, primaryValue) \n_qw[_primarykey]=_primaryvalue;\n// [588] Dim qry As AlaSQLResultSet = SelectWhere(tblName, Array( {121} ), qw, Array( {122} ), Array(primaryKey)) \n_qry=_B.selectwhere(_tblname,[\"*\"],_qw,[\"=\"],[_primarykey],_B);\n// [589] Return qry \nreturn _qry;\n// End Sub\n};\n\n// [594] Sub Exists(tblName As String, primaryKey As String, primaryValue As String) As AlaSQLResultSet \n_B.exists=function(_tblname,_primarykey,_primaryvalue) {\nvar _qw,_qry;\n// [595] Dim qw As Map = CreateMap() \n_qw={};\n// [596] qw.Put(primaryKey, primaryValue) \n_qw[_primarykey]=_primaryvalue;\n// [597] Dim qry As AlaSQLResultSet = SelectWhere(tblName, Array(primaryKey), qw, Array( {123} ), Array(primaryKey)) \n_qry=_B.selectwhere(_tblname,[_primarykey],_qw,[\"=\"],[_primarykey],_B);\n// [598] Return qry \nreturn _qry;\n// End Sub\n};\n\n// [602] Sub SelectWhere(tblName As String, tblfields As List, tblWhere As Map, operators As List, orderBy As List) As AlaSQLResultSet \n_B.selectwhere=function(_tblname,_tblfields,_tblwhere,_operators,_orderby) {\nvar _listoftypes,_listofvalues,_fld1,_selfields,_sb,_i,_iwhere,_col,_opr,_stro,_m;\n// [603] If operators = Null Then operators = EQOperators(tblWhere) \nif (_operators==null) {_operators=_B.eqoperators(_tblwhere,_B);}\n// [604] Dim listOfTypes As List = GetMapTypes(tblWhere) \n_listoftypes=_B.getmaptypes(_tblwhere,_B);\n// [605] Dim listOfValues As List = GetMapValues(tblWhere) \n_listofvalues=_B.getmapvalues(_tblwhere,_B);\n// [607] Dim fld1 As String = tblfields.Get(0) \n_fld1=_tblfields[0];\n// [608] Dim selFIelds As String = {124} \n_selfields=\"\";\n// [609] Select Case fld1 \nswitch (\"\" + _fld1) {\n// [610] Case {125} \ncase \"\" + \"*\":\n// [611] selFIelds = {126} \n_selfields=\"*\";\n// [612] Case Else \nbreak;\ndefault:\n// [613] selFIelds = JoinFields( {127} , tblfields) \n_selfields=_B.joinfields(\",\",_tblfields,_B);\n// [614] End Select \nbreak;\n}\n// [615] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [616] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [617] sb.Append( {12} ) \n_sb.append(\"SELECT \" + _selfields + \" FROM \" + _B.escapefield(_tblname,_B) + \" WHERE \");\n// [618] Dim i As Int \n_i=0;\n// [619] Dim iWhere As Int = tblWhere.Size - 1 \n_iwhere=Object.keys(_tblwhere).length-1;\n// [620] For i = 0 To iWhere \nfor (_i=0;_i<=_iwhere;_i++) {\n// [621] If i > 0 Then \nif (_i>0) {\n// [622] sb.Append( {128} ) \n_sb.append(\" AND \");\n// [623] End If \n}\n// [624] Dim col As String = tblWhere.GetKeyAt(i) \n_col=banano_getB4JKeyAt(_tblwhere,_i);\n// [625] sb.Append(col) \n_sb.append(_col);\n// [626] Dim opr As String = operators.Get(i) \n_opr=_operators[_i];\n// [627] sb.Append( {13} ) \n_sb.append(\" \" + _opr + \" ?\");\n// [628] Next \n}\n// [629] If orderBy <> Null Then \nif (_orderby!=null) {\n// [631] Dim stro As String = JoinFields( {129} , orderBy) \n_stro=_B.joinfields(\",\",_orderby,_B);\n// [632] If stro.Length > 0 Then \nif (_stro.length>0) {\n// [633] sb.Append( {130} ).Append(stro) \n_sb.append(\" ORDER BY \").append(_stro);\n// [634] End If \n}\n// [635] End If \n}\n// [636] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [637] m.Initialize \n_m.initialize();\n// [638] m.query = sb.tostring \n_m._query=_sb.toString();\n// [639] m.args = listOfValues \n_m._args=_listofvalues;\n// [640] m.types = listOfTypes \n_m._types=_listoftypes;\n// [641] m.command = {131} \n_m._command=\"select\";\n// [642] m.response = {132} \n_m._response=\"\";\n// [643] m.error = {133} \n_m._error=\"\";\n// [644] m.result = Array() \n_m._result=[];\n// [645] m.json = {134} \n_m._json=\"\";\n// [646] m.affectedRows = 0 \n_m._affectedrows=0;\n// [647] Return m \nreturn _m;\n// End Sub\n};\n\n// [651] private Sub Join(delimiter As String, lst As List) As String \n_B.join=function(_delimiter,_lst) {\nvar _i,_sb,_fld;\n// [652] Dim i As Int \n_i=0;\n// [653] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [654] Dim fld As String \n_fld=\"\";\n// [655] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [656] fld = lst.Get(0) \n_fld=_lst[0];\n// [657] sb.Append(fld) \n_sb.append(_fld);\n// [658] For i = 1 To lst.size - 1 \nfor (_i=1;_i<=_lst.length-1;_i++) {\n// [659] Dim fld As String = lst.Get(i) \n_fld=_lst[_i];\n// [660] sb.Append(delimiter).Append(fld) \n_sb.append(_delimiter).append(_fld);\n// [661] Next \n}\n// [662] Return sb.ToString \nreturn _sb.toString();\n// End Sub\n};\n\n// [667] Sub SelectAll(tblName As String, tblfields As List, orderBy As List) As AlaSQLResultSet \n_B.selectall=function(_tblname,_tblfields,_orderby) {\nvar _fld1,_selfields,_sb,_stro,_m;\n// [669] Dim fld1 As String = tblfields.Get(0) \n_fld1=_tblfields[0];\n// [670] Dim selFIelds As String = {135} \n_selfields=\"\";\n// [671] Select Case fld1 \nswitch (\"\" + _fld1) {\n// [672] Case {136} \ncase \"\" + \"*\":\n// [673] selFIelds = {137} \n_selfields=\"*\";\n// [674] Case Else \nbreak;\ndefault:\n// [675] selFIelds = JoinFields( {138} , tblfields) \n_selfields=_B.joinfields(\",\",_tblfields,_B);\n// [676] End Select \nbreak;\n}\n// [677] Dim sb As StringBuilder \n_sb=new StringBuilder();\n// [678] sb.Initialize \n_sb.init();\n_sb.isinitialized=true;\n// [679] sb.Append( {14} ) \n_sb.append(\"SELECT \" + _selfields + \" FROM \" + _B.escapefield(_tblname,_B) + \"\");\n// [680] If orderBy <> Null Then \nif (_orderby!=null) {\n// [682] Dim stro As String = JoinFields( {139} , orderBy) \n_stro=_B.joinfields(\",\",_orderby,_B);\n// [683] If stro.Length > 0 Then \nif (_stro.length>0) {\n// [684] sb.Append( {140} ).Append(stro) \n_sb.append(\" ORDER BY \").append(_stro);\n// [685] End If \n}\n// [686] End If \n}\n// [687] Dim m As AlaSQLResultSet \n_m= new banano_bananovuematerial_alasqlresultset();\n// [688] m.Initialize \n_m.initialize();\n// [689] m.query = sb.tostring \n_m._query=_sb.toString();\n// [690] m.args = Null \n_m._args=null;\n// [691] m.types = Null \n_m._types=null;\n// [692] m.command = {141} \n_m._command=\"select\";\n// [693] m.response = {142} \n_m._response=\"\";\n// [694] m.error = {143} \n_m._error=\"\";\n// [695] m.result = Array() \n_m._result=[];\n// [696] m.json = {144} \n_m._json=\"\";\n// [697] m.affectedRows = 0 \n_m._affectedrows=0;\n// [698] Return m \nreturn _m;\n// End Sub\n};\n\n}", "static get type() { return 'mq'; }", "function TQuery(){}", "function qi(a){qi.i.constructor.call(this,a);this.bd()}", "function TQuery() { }", "function TQuery() { }", "function TQuery() {}", "function TQuery() {}", "function TQuery() {}", "function TQueries(){}", "get queryInputType() { return this._type; }", "function make_biquad_q(q_db) {\n if (!browser_biquad_filter_uses_audio_cookbook_formula)\n return q_db;\n\n var q_lin = dBToLinear(q_db);\n var q_new = 1 / Math.sqrt((4 - Math.sqrt(16 - 16 / (q_lin * q_lin))) / 2);\n q_new = linearToDb(q_new);\n return q_new;\n}", "async fundType (rootObj, { id }) {\n // returns an object that matches the ItemType fields\n return await fundTypesController.retrieve({id: id})\n }", "getClassType(division_db, token) {\n const self = this;\n const deferred = Q.defer();\n const sql = `use [${division_db}];select * from dbo.class`;\n self.db\n .request()\n .query(sql)\n .then(result => {\n deferred.resolve(result.recordset);\n })\n .catch(err => {\n console.trace(err); // todo : will do to logger later\n deferred.reject(err);\n });\n return deferred.promise;\n }", "function q(hljs) {\n var Q_KEYWORDS = {\n keyword:\n 'do while select delete by update from',\n literal:\n '0b 1b',\n built_in:\n 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum',\n type:\n '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid'\n };\n return {\n name: 'Q',\n aliases:['k', 'kdb'],\n keywords: Q_KEYWORDS,\n lexemes: /(`?)[A-Za-z0-9_]+\\b/,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE\n ]\n };\n}", "getAll():Object {//: Q.Promise<ArrayBuffer> {\n throw new TypeError(\"Method getAll is not implemented\");\n }", "function BidtStockTypeApi() {\n var _this = _super.call(this, BidtStockTypeApi_1.baseUrl) || this;\n _this.findAll = _super.prototype.appendToBaseUrl.call(_this, '/find_all');\n _this.findByCriteria = _super.prototype.appendToBaseUrl.call(_this, '/find_by_criteria_stock_type');\n _this.delete = _super.prototype.appendToBaseUrl.call(_this, '/delete_stock_type');\n _this.getById = _super.prototype.appendToBaseUrl.call(_this, '/get_by_id_stock_type');\n return _this;\n }", "async function bnQueryGen() {\n resultMode = \"bn\";\n await setLimit();\n showSpinner();\n var subject = validateSubject();\n var predicate = validatePredicate();\n var object = nonvalidatedObject();\n var graph = gAppState.checkValue(\"docNameID\", \"docNameID2\");\n\n\n if (gAppState.getCurTab() === \"dbms\") {\n var query =\n \"PREFIX : <\" + graph + \"#>\\n\"\n + \"SELECT DISTINCT * \\n\"\n + \"FROM <\" + graph + \"> \\n\"\n + \"WHERE {\" + \" \" + subject + \" \" + predicate + \" \" + object + \" \" + \"}\"\n } else if (gAppState.getCurTab() === \"fs\") {\n var query =\n \"DEFINE get:soft\" + \" \" + '\"soft\"' + \"\\n\"\n + \"PREFIX : <\" + graph + \"#>\\n\"\n + \"SELECT DISTINCT * \\n\"\n + \"FROM <\" + graph + \"> \\n\"\n + \"WHERE {\" + \" \" + subject + \" \" + predicate + \" \" + object + \" \" + \"}\"\n }\n\n if (limit >= 1) { // if results per page is active\n query = query + \"\\n\" + \"OFFSET \" + offset + \"\\n\" + \"LIMIT \" + limit;\n }\n\n if (DOC.iSel(\"riID\").checked == true) {// if reasoning and inference is on\n query = \"DEFINE input:same-as\" + '\"yes\" \\n' + query;\n } else if (DOC.iSel(\"ruleNameID\").checked == true) {\n query = \"DEFINE input:inference\" + ' ' + \"'\" + DOC.iSel(\"infRuleNameID\").value + \"'\" + ' \\n' + query;\n }\n\n // CSV download\n if (DOC.iSel(\"csvID\").checked == true || DOC.iSel(\"xmlID\").checked == true) {\n await downloadResults();\n }\n\n var endpoint = DOC.iSel(\"sparql_endpoint\").value + \"?default-graph-uri=&query=\";\n let url = endpoint + encodeURIComponent(query) + \"&should-sponge=&format=application%2Fsparql-results%2Bjson\";\n\n if (DOC.iSel(\"cmdID\").checked == true) {\n console.log(\"SPARQL Query: \" + query);\n console.log(\"Query URL: \" + url)\n }\n\n const options = {\n method: 'GET',\n headers: {\n 'Content-type': 'application/sparql-results+json; charset=UTF-8',\n },\n credentials: 'include',\n mode: 'cors',\n crossDomain: true,\n };\n\n var resp;\n try {\n resp = await solidClient.fetch(url, options)\n if (resp.ok && resp.status == 200) {\n var data = await resp.json();\n\n refreshTable();\n\n /*\n Dynamic Table for processing JSON Structured Data (via \"application/sparql-results+json\" document content type)\n that enables INSERT to be handled via a 3-tuple subject, predicate, object graph (relation) while query results\n are handled via an N-Tuple structured table (relation).\n */\n if (data.results.bindings.length > 0) {\n var table = gAppState.checkId(\"dbmsTableID\", \"fsTableID\"); // creates table for header\n var header = table.createTHead(); // creates empty tHead\n var headRow = header.insertRow(0); // inserts row into tHead\n var bindings = data.results.bindings;\n for (var col = 0; col < data.head.vars.length; col++) { // for each column\n var headCell = headRow.insertCell(col); // inserts new cell at position i in thead\n headCell.innerHTML = \"<b>\" + data.head.vars[col] + \"</b>\"; // adds bold text to thead cell\n }\n for (i in bindings) {\n var curr = 0; // curr is used to keep track of correct cell position\n var binding = bindings[i];\n var bodyRow = table.insertRow(-1); // create new row\n for (n in binding) {\n var bodyCell = bodyRow.insertCell(curr); // create new cell in row\n bodyCell.innerHTML = tableFormat(binding[n].value); // set value of cell\n curr += 1;\n }\n }\n hideSpinner();\n }\n else {\n hideSpinner();\n console.log(\"No data returned by query\");\n }\n\n } else {\n var msg = await resp.text();\n hideSpinner();\n console.error('Query Failed', msg);\n alert('Query Failed ' + msg)\n }\n\n } catch (e) {\n hideSpinner();\n console.error('Query Failed', e);\n alert('Query Failed ' + e)\n }\n await setTableSize();\n await buttonDisplay();\n}", "constructor() {\n /**\n *\n * @member {String} code\n */\n this.code = undefined\n /**\n *\n * @member {String} name\n */\n this.name = undefined\n /**\n *\n * @member {String} url\n */\n this.url = undefined\n /**\n *\n * @member {String} description\n */\n this.description = undefined\n /**\n *\n * @member {Boolean} purchasable\n */\n this.purchasable = undefined\n /**\n * @member {module:models/Stock} stock\n */\n this.stock = undefined\n /**\n *\n * @member {Array.<module:models/FutureStock>} futureStocks\n */\n this.futureStocks = undefined\n /**\n *\n * @member {Boolean} availableForPickup\n */\n this.availableForPickup = undefined\n /**\n *\n * @member {Number} averageRating\n */\n this.averageRating = undefined\n /**\n *\n * @member {Number} numberOfReviews\n */\n this.numberOfReviews = undefined\n /**\n *\n * @member {String} summary\n */\n this.summary = undefined\n /**\n *\n * @member {String} manufacturer\n */\n this.manufacturer = undefined\n /**\n *\n * @member {String} variantType\n */\n this.variantType = undefined\n /**\n * @member {module:models/Price} price\n */\n this.price = undefined\n /**\n *\n * @member {String} baseProduct\n */\n this.baseProduct = undefined\n /**\n *\n * @member {Array.<module:models/Image>} images\n */\n this.images = undefined\n /**\n *\n * @member {Array.<module:models/Category>} categories\n */\n this.categories = undefined\n /**\n *\n * @member {Array.<module:models/Review>} reviews\n */\n this.reviews = undefined\n /**\n *\n * @member {Array.<module:models/Classification>} classifications\n */\n this.classifications = undefined\n /**\n *\n * @member {Array.<module:models/Promotion>} potentialPromotions\n */\n this.potentialPromotions = undefined\n /**\n *\n * @member {Array.<module:models/VariantOption>} variantOptions\n */\n this.variantOptions = undefined\n /**\n *\n * @member {Array.<module:models/BaseOption>} baseOptions\n */\n this.baseOptions = undefined\n /**\n *\n * @member {Boolean} volumePricesFlag\n */\n this.volumePricesFlag = undefined\n /**\n *\n * @member {Array.<module:models/Price>} volumePrices\n */\n this.volumePrices = undefined\n }", "function TQueries() { }", "function TQueries() { }", "static get requires() {\n return {\n 'JQX.ComboBox': 'jqxcombobox.js'\n }\n }", "classType () {\n const depTypeFn = depTypes[String(this.currentAstNode)]\n if (!depTypeFn) {\n throw Object.assign(\n new Error(`\\`${String(this.currentAstNode)}\\` is not a supported dependency type.`),\n { code: 'EQUERYNODEPTYPE' }\n )\n }\n const nextResults = depTypeFn(this.initialItems)\n this.processPendingCombinator(nextResults)\n }", "function qi(a){qi.k.constructor.call(this,a);this.Uc()}", "function TQueries() {}", "function TQueries() {}", "function TQueries() {}", "static get schema() {\n return {\n name: { type: 'string' },\n kit: { type: 'string' },\n }\n }", "get itemBaseType() {\n throw new TypeError(\"Abstract class Item cannot be instantiated.\");\n }", "function q(hljs) {\n var Q_KEYWORDS = {\n $pattern: /(`?)[A-Za-z0-9_]+\\b/,\n keyword:\n 'do while select delete by update from',\n literal:\n '0b 1b',\n built_in:\n 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum',\n type:\n '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid'\n };\n return {\n name: 'Q',\n aliases:['k', 'kdb'],\n keywords: Q_KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE\n ]\n };\n}", "function CreateDatabaseQuery() {}", "get termType() {\n return 'Quad';\n }", "function initQueryBuilder() {\n console.log(\"DO initQueryBuilder \");\n var uig = \"querybuilder\";\n qb = new QueryBuilder(\"querybuilder\");\n $(\"tool-querybuilder\").onclick = function (e) {\r\n qb.open(aLayer.url);\n }\n}", "function ______MA_Query() {}", "constructor() {\n /**\n *\n * @member {Boolean} preselected\n */\n this.preselected = undefined\n /**\n *\n * @member {String} referenceType\n */\n this.referenceType = undefined\n /**\n *\n * @member {String} description\n */\n this.description = undefined\n /**\n *\n * @member {Number} quantity\n */\n this.quantity = undefined\n }", "function xqserver_msgadd_upperboundqtype(){\r\n\tsetup(g_qwUserId);\r\n\tengine.TickleListen(true,g_wPort);\r\n\tengine.MsgAdd(l_dwSessionID,++l_dwSequence,QWORD2CHARCODES(g_qwUserId),1,g_dwNthQType,g_bstrNthQTypeData,g_dwNthQTypeDataSize);\r\n\tWaitForTickle(engine);\r\n\tif (1!=engine.GetTickleElement(\"QLength\")) FAIL();\r\n}//endmethod", "getProduct() {\n MxI.$raiseNotImplementedError(IBuilder, this);\n }", "get type () { return this._doc.type; }", "static addQV(qa, qb) {\nvar qv;\nqv = this.copyOfQV(qa);\nreturn this.setAddQV(qv, qb);\n}", "function selectQbo(id) {\n\n switch(id) {\n case config.THAI.REALM_ID:\n return qbo_thai;\n case config.TURKISH.REALM_ID:\n return qbo_turkish;\n case config.MEXICAN.REALM_ID:\n return qbo_mexican;\n case config.BURGERS.REALM_ID:\n return qbo_burgers;\n }\n}", "'getType'() {\n\t\tthrow new Error('Not implemented.');\n\t}", "function Q(a,b,c,d){function e(h){var i;return f[h]=!0,fa.each(a[h]||[],function(a,h){var j=h(b,c,d);return\"string\"!=typeof j||g||f[j]?g?!(i=j):void 0:(b.dataTypes.unshift(j),e(j),!1)}),i}var f={},g=a===Ab;return e(b.dataTypes[0])||!f[\"*\"]&&e(\"*\")}", "get _rabbitmqKind() {\n return rabbitmqConstants.globalRabbitmqKind;\n }", "function updateMCQ() {\n let mcq = getEditInput();\n let typeId = 0;\n let mcqref = firebase\n .database()\n .ref(\"Types\")\n .child(typeId)\n .child(mcq.qID)\n .set(mcq);\n listQuesList();\n}", "function LQuery(){}", "static get schema() {\n return {\n name: { type: 'string' },\n version: { type: 'string' },\n description: { type: 'string' },\n authors: { type: 'array' },\n }\n }", "Program() {\n return {\n type: 'Program',\n body: this.StatementList(),\n };\n }", "static fromRQ(q) {\nreturn this.fromQV(q.xyzw);\n}", "function JQClass() {\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\t}\n\t\t}", "get baseDefinition () {\n\t\treturn this._baseDefinition;\n\t}", "getAllString():Object {//: Q.Promise<string> {\n throw new TypeError(\"Method getAllString is not implemented\");\n }", "_getQuery(){\n let builder = this.builder;\n if( !builder ){\n throw new Error('query.builder cannot be undefined/null/false');\n }\n if( !Array.isArray(builder) ){\n throw new Error('query.builder should be an Array');\n }\n if( builder.length == 0 ){\n throw new Error('query.builder should be an Array with at least one element');\n }\n if( builder.length == 1 ){\n builder = builder[0];\n }\n if( !builder ){\n throw new Error('query.builder contained an invalid element');\n }\n switch( typeof builder ){\n case 'string':\n return [builder];\n case 'function':\n let args = builder();\n if( !args ){\n throw new Error('query builder function must return an Array of query args');\n }\n if( !Array.isArray(args) ){\n args = [args];\n }\n return args;\n case 'object':\n if( Array.isArray(builder) ){\n return builder;\n }\n default:\n throw new Error('query builder must be either an Array of args or a function that returns an Array of args');\n }\n }", "function ReadyState($3gq,readyState$){\n $init$ReadyState();\n if(readyState$===undefined)m$3g8.throwexc(m$3g8.InvocationException$meta$model(\"Cannot instantiate abstract class\"),'?','?')\n readyState$.$3gq_=$3gq;\n return readyState$;\n}", "constructor() {\n /**\n * @type {Bus}\n */\n this._listener = new _quickBus.default();\n }", "constructor(props) {\n\t\tsuper(props);\n\t\tthis.state = {\n\t\t\t//UI option/toggles\n\t\t\tdisplayFacets : this.props.collectionConfig.facets ? true : false,\n\t\t\tgraphType : null,\n\t\t\tisSearching : false,\n\n\t\t\tquery : this.props.query,\n\n\t\t\t//query OUTPUT\n currentCollectionHits: this.getCollectionHits(this.props.collectionConfig),\n aggregations : {}\n\n }\n this.CLASS_PREFIX = 'qb';\n\t}", "async function main() {\n await amazonDB.displayAllItems();\n var userOptions = [\n {\n type: 'input',\n name: 'itemId',\n message: 'Which item would you like to buy? (enter item id)'\n },\n {\n type: 'input',\n name: 'quantity',\n message: 'What quantity would you like to buy?'\n }\n ];\n const userInput = await inquirer.prompt(userOptions);\n const result = await amazonDB.buyItems(userInput.itemId, userInput.quantity);\n await amazonDB.terminate();\n}", "async getAllBooks(parent,args,ctx,info){\n return await ctx.db.query.books({\n where : {active:true}\n },`{\n id\n title\n author\n publisher {\n name\n discount\n }\n category{\n name\n }\n type {\n name\n }\n images {\n src\n }\n mrp\n sku\n }`);\n \n }", "function HBaseElement() {\n }", "get baseFormulaType() {\n\t\treturn this.__baseFormulaType;\n\t}", "Program() {\n return {\n type: 'Program',\n body: this.StatementList(),\n }\n }", "function Builder() {}", "function Builder() {}", "static get requires() {\n return {\n 'JQX.Button': 'jqxbutton.js'\n }\n }", "function q(hljs) {\n const KEYWORDS = {\n $pattern: /(`?)[A-Za-z0-9_]+\\b/,\n keyword:\n 'do while select delete by update from',\n literal:\n '0b 1b',\n built_in:\n 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum',\n type:\n '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid'\n };\n\n return {\n name: 'Q',\n aliases: [\n 'k',\n 'kdb'\n ],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE\n ]\n };\n}", "function q(hljs) {\n const KEYWORDS = {\n $pattern: /(`?)[A-Za-z0-9_]+\\b/,\n keyword:\n 'do while select delete by update from',\n literal:\n '0b 1b',\n built_in:\n 'neg not null string reciprocal floor ceiling signum mod xbar xlog and or each scan over prior mmu lsq inv md5 ltime gtime count first var dev med cov cor all any rand sums prds mins maxs fills deltas ratios avgs differ prev next rank reverse iasc idesc asc desc msum mcount mavg mdev xrank mmin mmax xprev rotate distinct group where flip type key til get value attr cut set upsert raze union inter except cross sv vs sublist enlist read0 read1 hopen hclose hdel hsym hcount peach system ltrim rtrim trim lower upper ssr view tables views cols xcols keys xkey xcol xasc xdesc fkeys meta lj aj aj0 ij pj asof uj ww wj wj1 fby xgroup ungroup ej save load rsave rload show csv parse eval min max avg wavg wsum sin cos tan sum',\n type:\n '`float `double int `timestamp `timespan `datetime `time `boolean `symbol `char `byte `short `long `real `month `date `minute `second `guid'\n };\n\n return {\n name: 'Q',\n aliases: [\n 'k',\n 'kdb'\n ],\n keywords: KEYWORDS,\n contains: [\n hljs.C_LINE_COMMENT_MODE,\n hljs.QUOTE_STRING_MODE,\n hljs.C_NUMBER_MODE\n ]\n };\n}", "static topBookStore() {\n\t\treturn 'Barnes & Noble';\n\t}", "function Rabbit(type) {\n this.type = type\n}", "async initForLoading() {\n registerCustomQuillFormats()\n await DataStore.query(TranscriptionContributor)\n }", "function qv() {}", "subscribeBoq(boqId, isEdit) {\n //fill boq Item Drop\n dataservice.GetDataList('getContractsBoqItemsForDrop?boqId=' + boqId, 'details', 'id').then(result => {\n if (isEdit) {\n let id = this.state.itemEdit.boqItemId;\n let selectedValue = {};\n if (id) {\n selectedValue = find(result, function (i) { return i.value == id })\n this.setState({ selectedBoqItem: selectedValue });\n }\n }\n else {\n this.setState({ selectedBoqItem: { label: Resources.boqItemSelection[currentLanguage], value: \"0\" } });\n }\n this.setState({ boqItemData: [...result], Loading: false });\n });\n }", "static get __resourceType() {\n\t\treturn 'Quantity';\n\t}", "static get type() { return 'model'; }", "function Type() {\r\n}", "function apiQuestionBuilder(site, qid) {\n return apiBuilder(\n 'questions/' + qid, \n {\n site: site,\n order: 'asc',\n page: 1,\n pagesize: 100,\n sort: 'activity',\n filter: '!w-2nxYBnAP3ZrgppIq'\n });\n }", "function clientCode(director) {\n var builder = new ConcreteBuilder1();\n director.setBuilder(builder);\n console.log('Standard basic product:');\n director.buildMinimalViableProduct();\n builder.getProduct().listParts();\n console.log('Standard full featured product:');\n director.buildFullFeaturedProduct();\n builder.getProduct().listParts();\n // Remember, the Builder pattern can be used without a Director class.\n console.log('Custom product:');\n builder.producePartA();\n builder.producePartC();\n builder.getProduct().listParts();\n}", "function Builder() {\r\n //internal field for API methods use.\r\n this.__app = new shared.Application();\r\n //setting methods\r\n this.use = Builder.use;\r\n this.get = Builder.get;\r\n this.post = Builder.post;\r\n this.delete = Builder.delete;\r\n this.put = Builder.put;\r\n this.route = Builder.route;\r\n this.listen = Builder.listen;\r\n this.close = function () {}; //deprecated\r\n}", "type() {\n return this._type.name;\n }", "function WidgetBuilder() {\r\n}", "static get __resourceType() {\n\t\treturn 'ChargeItem';\n\t}", "function ______TEXT_QUERIES______() {}", "function JQClass() {\r\n\t\t\t// All construction is actually done in the init method\r\n\t\t\tif (!initializing && this._init) {\r\n\t\t\t\tthis._init.apply(this, arguments);\r\n\t\t\t}\r\n\t\t}", "function BXMLTypeSelector(Params)\n{\n\tthis.oML = Params.oML;\n\tthis.oCallback = Params.oCallback;\n\tthis.Types = Params.Types;\n\tthis.Init();\n}", "function getQrCode () {\n\n}", "get documentTypeInput() {\n return this._documentType;\n }", "setFromRQ(q) {\nRQ.setQV(this.xyzw, q.xyzw);\nreturn this;\n}", "function Rabbit ( type ) {\n this.type = type;\n}", "query(type, value) {\n this.modifyState({\n loading: true\n });\n API.object(type, value).then((res) => {\n this.apiResponded(res, 'queryResult');\n });\n }", "function Rabbit(type) {\n this.type = type;\n}", "function Rabbit(type) {\n this.type = type;\n}", "getFixedQuery() {}", "query() { }", "makeQueryData () {\n\t\treturn {\n\t\t\tpluginIDE: this.pluginName,\n\t\t\tpluginVersion: this.pluginVersion\n\t\t};\n\t}", "constructor(args) {\n super();\n args = args || {}\n this.CONSTRUCTOR_ID = 0x1427a5e1;\n this.SUBCLASS_OF_ID = 0xbf4e2753;\n\n this.q = args.q;\n }", "function GadgetBuilder()\r\n{\r\n // ProgID of the Gadget Adapter for use in creating an ActiveX object instance\r\n var progID = \"GadgetInterop.GadgetAdapter\";\r\n // File name of the Gadget Interop DLL\r\n var assemblyName = \"Gadget.Interop.dll\";\r\n // Gadget Adapter class GUID\r\n var guid = \"{89BB4535-5AE9-43a0-89C5-19B4697E5C5E}\";\r\n // Gadget Adapter assembly location (under the gadget's root directory)\r\n var assemblyStore = \"\\\\bin\\\\\";\r\n \r\n // Instance of the ActiveX gadget adapter object\r\n this._builder; \r\n \r\n // Method pointers\r\n this.Initialize = Initialize;\r\n this.LoadType = LoadType;\r\n this.LoadTypeWithParams = LoadTypeWithParams;\r\n this.UnloadType = UnloadType;\r\n this.AddConstructorParam = AddConstructorParam;\r\n this.InteropRegistered = InteropRegistered;\r\n this.GetActiveXObject = GetActiveXObject;\r\n \r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Initializes this class by creating an instance of the Gadget Adapter. If the\r\n // Gadget Adapter assembly is not yet retistered, the corresponding registry\r\n // values are added to register the Gadget Adapter. (i.e. runtime registration)\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function Initialize()\r\n {\r\n // Check if the gadget adapter needs to be registered\r\n if(InteropRegistered() == false)\r\n {\r\n // Register the adapter since an instance couldn't be created.\r\n RegisterGadgetInterop();\r\n }\r\n \r\n // Load an instance of the Gadget Adapter as an ActiveX object\r\n _builder = GetActiveXObject();\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Load the specified .NET type from the given assembly\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function LoadType(assemblyPath, classType)\r\n {\r\n try\r\n {\r\n return _builder.LoadType(assemblyPath, classType);\r\n }\r\n catch(e)\r\n {\r\n return null;\r\n }\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Load the specified type from the given assembly. The \"preserve\" argument provides \r\n // control over clearing the constructor arguments after object creating\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function LoadTypeWithParams(assemblyPath, classType, preserve)\r\n {\r\n try\r\n {\r\n return _builder.LoadTypeWithParams(assemblyPath, classType, preserve);\r\n }\r\n catch(e)\r\n {\r\n return null;\r\n }\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Call the object's Dispose method\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function UnloadType(typeToUnload)\r\n {\r\n try\r\n {\r\n _builder.UnloadType(typeToUnload);\r\n }\r\n catch(e)\r\n {}\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Add a parameter to the list of objects needed to call the class' constructor\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function AddConstructorParam(param)\r\n {\r\n _builder.AddConstructorParam(param);\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Add the Gadget.Interop dll to the registry so it can be used by COM and\r\n // created in javascript as an ActiveX object\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function RegisterGadgetInterop()\r\n {\r\n try\r\n {\r\n // Full path to the Gadget.Interop.dll assembly\r\n var fullPath = System.Gadget.path + assemblyStore;\r\n var asmPath = fullPath + assemblyName;\r\n \r\n // Register the interop assembly under the Current User registry key\r\n RegAsmInstall(\"HKCU\", progID, \"Gadget.Interop.GadgetAdapter\", guid,\r\n \"Gadget.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9389e9f4d8844504\",\r\n \"1.0.0.0\", asmPath);\r\n }\r\n catch(e)\r\n {} \r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Remove the Gadget.Interop dll from the registry and the GAC\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function UnregisterGadgetInterop()\r\n {\r\n try\r\n {\r\n var fullPath = System.Gadget.path + assemblyStore;\r\n var asmPath = fullPath + assemblyName;\r\n \r\n RegAsmUninstall(\"HKLM\", progID, \"Gadget.Interop.GadgetAdapter\", guid,\r\n \"Gadget.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9389e9f4d8844504\",\r\n \"1.0.0.0\", asmPath); \r\n }\r\n catch(e)\r\n {}\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Returns true if a Gadget Adapter ActiveX object is successfully created,\r\n // otherwise returns false.\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function InteropRegistered()\r\n {\r\n try\r\n {\r\n var proxy = GetActiveXObject();\r\n proxy = null;\r\n \r\n return true;\r\n }\r\n catch(e)\r\n {\r\n return false;\r\n }\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Attempts to create and return an instance of the Gadget Adapter ActiveX object.\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function GetActiveXObject()\r\n {\r\n return new ActiveXObject(progID);\r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Replace all occurrences of a character\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function ReplaceAll(input, oldValue, newValue)\r\n { \r\n var tempInput = input; \r\n var i = tempInput.indexOf(oldValue); \r\n \r\n while(i > -1)\r\n { \r\n tempInput = tempInput.replace(oldValue, newValue); \r\n i = tempInput.indexOf(oldValue); \r\n } \r\n \r\n return tempInput; \r\n }\r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Code to register a .NET type for COM interop\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function RegAsmInstall(root, progId, cls, clsid, assembly, version, codebase) \r\n {\r\n var wshShell;\r\n wshShell = new ActiveXObject(\"WScript.Shell\"); \r\n\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\\", progId);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\\" + progId + \"\\\\\", cls);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\\" + progId + \"\\\\CLSID\\\\\", clsid); \r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\\", cls); \r\n\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\\", \"mscoree.dll\");\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\ThreadingModel\", \"Both\");\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\Class\", cls);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\Assembly\", assembly);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\RuntimeVersion\", \"v2.0.50727\");\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\CodeBase\", codebase); \r\n\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\\" + version + \"\\\\Class\", cls);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\\" + version + \"\\\\Assembly\", assembly);\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\\" + version + \"\\\\RuntimeVersion\", \"v2.0.50727\");\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\InprocServer32\\\\\" + version + \"\\\\CodeBase\", codebase); \r\n\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\ProgId\\\\\", progId); \r\n\r\n wshShell.RegWrite(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid + \"\\\\Implemented Categories\\\\{62C8FE65-4EBB-45E7-B440-6E39B2CDBF29}\\\\\", \"\");\r\n } \r\n ////////////////////////////////////////////////////////////////////////////////\r\n //\r\n // Unregister a component\r\n //\r\n ////////////////////////////////////////////////////////////////////////////////\r\n function RegAsmUninstall(root, progId, clsid) \r\n {\r\n var wshShell;\r\n wshShell = new ActiveXObject(\"WScript.Shell\"); \r\n\r\n wshShell.RegDelete(root + \"\\\\Software\\\\Classes\\\\\", progId);\r\n wshShell.RegDelete(root + \"\\\\Software\\\\Classes\\\\CLSID\\\\\" + clsid);\r\n } \r\n}", "function bidItem() { }", "function startQ() {\n inquirer\n .prompt(q.homeBase)\n .then(answer => {\n switch(answer.homeBase){\n case 'view all employees' : getEmployees(); break;\n case 'view all employees by department' : getEmployees('department'); break;\n case 'view all employees by manager' : getEmployees('manager'); break;\n case 'add employee' : getEmployeeDept(); break;\n case 'add department' : addDepartment(); break;\n case 'add role' : addRole(); break;\n case 'remove employee' : removeEmployee(); break;\n case 'remove role' : removeRole(); break;\n case 'remove department' : removeDepartment(); break;\n case 'update employee role' : updateRole(); break;\n case 'update employee manager' : updateManager(); break;\n case 'view all roles' : viewRoles(); break;\n case 'view all departments' : viewDepartments(); break;\n case 'view budget' : viewBudget(); break;\n case 'quit' : quit(); break;\n }\n })\n .catch(err => {\n if(err) throw err;\n });\n}", "function callQueue(qType, codeModule, FireTiming, DisplayErrors, codeID) {\n qType.push([codeModule, FireTiming, DisplayErrors, codeID]);\n }", "queryCoinType(tokenName) {\n throw new errors_1.SdkError('Not supported');\n }", "get type() { return this._type; }" ]
[ "0.57055616", "0.53903157", "0.53299206", "0.53047425", "0.5253266", "0.52337986", "0.52337986", "0.51918304", "0.51918304", "0.51918304", "0.51670724", "0.5165274", "0.51415485", "0.51081216", "0.51041734", "0.50775146", "0.5075952", "0.5066737", "0.5036762", "0.5034327", "0.4998234", "0.4998234", "0.49910706", "0.4962306", "0.4961641", "0.49361262", "0.49361262", "0.49361262", "0.49355096", "0.49280882", "0.49269623", "0.4919282", "0.49160764", "0.48970982", "0.4877975", "0.48766723", "0.48464426", "0.48328787", "0.4829603", "0.48166934", "0.47939062", "0.47873834", "0.4786869", "0.47816798", "0.47807336", "0.47743645", "0.47677463", "0.4757679", "0.47415733", "0.4740832", "0.47290245", "0.47197542", "0.47168797", "0.47064477", "0.47038457", "0.46979007", "0.46843666", "0.46819174", "0.46768185", "0.46755183", "0.46744898", "0.467288", "0.467288", "0.46726447", "0.46721408", "0.46721408", "0.46720678", "0.4660983", "0.4656854", "0.46550164", "0.4643816", "0.4643764", "0.4642049", "0.46404868", "0.46380398", "0.46314278", "0.4627065", "0.46224684", "0.46188533", "0.4615065", "0.46138835", "0.46136272", "0.46126482", "0.46116316", "0.46072406", "0.46061274", "0.46039885", "0.46027166", "0.4601711", "0.4601711", "0.4601527", "0.45990548", "0.45934573", "0.45927548", "0.45924267", "0.45922774", "0.4589138", "0.45871985", "0.45840406", "0.4581121" ]
0.60240555
0
update profile image in state
handleImage(image) { this.setState({ profile: image }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateProfileImageTEMP () {\n\t\tvar signedinListitems = createProfileMenuSignedin(),\n\t\t\tsignedinData = {\n\t\t\t\tlinkContents: \"\",\n\t\t\t\tlinkAlt: IBM.common.translations.data.v18main.misc.welcomeback,\n\t\t\t\tbackgroundImage: \"\",\n\t\t\t\ttype: \"default\"\n\t\t\t};\n\n\t\t// Change the menu to the \"user is signed in\" one ONLY if there are links from the translation data file. \n\t\t// Otherwise we keep it as \"signedout\" links.\n\t\tif (signedinListitems !== \"\") {\n\t\t\t$profileMenu.children(\"ul\").html(signedinListitems);\n\t\t}\n\n\t\tsignedinData.type = \"image\";\n\t\tsignedinData.backgroundImage = IBMCore.common.util.config.get(\"coreservicesUrl\") + \"cc=us&lc=en&format=image&ts=\" + new Date().getTime() + \"&cb=170%3AIBMCore.common.util.user.updateProfileImage\";\n\t\t\n\t\t// Show the profile link as \"signed in\" then adjust used space, toggle links and search field if needed.\n\t\tshowProfileLinkSignedin(signedinData);\n\t\tsetMastheadWidthUsed();\n\t\ttoggleInlineLinks();\n\t\ttoggleSearchField();\n\n\t\t// Add the user's profile image to the user object.\n\t\tIBM.common.util.user.subscribe(\"ready\", \"Masthead profile\", function(){\n\t\t\t\tIBM.common.util.user.setInfo({\"imageUrl\": signedinData.backgroundImage});\n\t\t\t\tmyEvents.publish(\"userProfileImageReady\");\n\t\t\t}).runAsap(function(){\n\t\t\t\tIBM.common.util.user.setInfo({\"imageUrl\": signedinData.backgroundImage});\n\t\t\t\tmyEvents.publish(\"userProfileImageReady\");\n\t\t\t});\n\t\t\n\t\tmyEvents.publish(\"profileMenuReady\");\n\t}", "updateProfile() {}", "updateImage(e) {\n e.preventDefault();\n\n let reader = new FileReader();\n let file = e.target.files[0];\n reader.readAsDataURL(file);\n\n\n reader.onloadend = () => {\n const user = this.state.user;\n user.profilePic= reader.result;\n\n this.setState({\n user: user\n });\n\n }\n }", "async changeAvatar() {\n\n let response = await fetchApi('user/profile/change_avatar', 'PUT', true, {\n avatar_id: this.state.selectedImage.id,\n user_id: this.state.user.id\n })\n\n if (response) {\n await response\n await getUserInformation()\n this.setState({modalShow: false})\n await this.isAvatarChange()\n }\n }", "function updateAvatar(avatar) {\n props.handleChangeInputs(avatar, 'photo');\n }", "function updateUserProfileWinImage() {\n let userProfileImg = document.getElementById('user-profile-img');\n userProfileImg.src = './assets/player-win.svg';\n}", "handleUpdateUserProfile(props) {\n const response = props.updateUserProfile.response;\n if (response !== this.props.updateUserProfile.response) {\n if (\n Object.keys(response).length > 0 &&\n response.status &&\n response.status === 200\n ) {\n toastr.success(\n response.message || this.props.locale.user.profile.update.success\n );\n // Update the global variable with current state\n // to display the updated value in profile\n profileState = this.state;\n // Update the customer logo\n if (\n this.props.auth.isCustomerAdmin() &&\n this.props.auth.getLogo() !== this.state.fields.logo\n ) {\n this.props.auth.updateLogo(this.state.fields.logo);\n }\n let authorizedUserDetails = JSON.parse(\n ls.getItem(\"authorizedUserDetails\")\n );\n authorizedUserDetails.profilePicture = this.state.fields.profilePicture;\n ls.setItem(\n \"authorizedUserDetails\",\n JSON.stringify(authorizedUserDetails)\n );\n let fields = this.props.auth.authUser;\n fields = _.set(\n fields,\n \"profilePicture\",\n this.state.fields.profilePicture\n );\n // this.toggleModal();\n window.location.reload();\n } else if (\n !props.updateUserProfile.isFetching &&\n props.updateUserProfile.isError\n ) {\n toastr.error(\n response.message || this.props.locale.user.profile.update.error\n );\n }\n }\n }", "handleUpdateAvatar() {\n if (\n \n this.state.avatar !== ''\n ) {\n \n fetch(myGet + '/' + this.state.user.id, {\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n method: 'put',\n body: JSON.stringify({\n \n avatar: this.state.avatar\n })\n })\n .then(() => this.props.fectchAccount())\n alert('The avatar has been successfully updated')\n } else {\n alert('Please enter avatar source')\n }\n }", "function handleUpdateAvatar(newAvatar) {\n api.setAvatar(newAvatar)\n .then((userData) => {\n setCurrentUser(userData.data)\n })\n .then(closeAllPopups)\n .catch(err => console.log(\"Error: \" + err));\n }", "setPicture(state, picture) {\n state.picture = picture\n }", "updateAvatar (avatarUrl) {\n $(\"#dominantSpeakerAvatar\").attr('src', avatarUrl);\n }", "function imageIsLoaded(e) {\n $('#img-profile').attr('src', e.target.result);\n }", "function updateCardPhoto() {\n profileImage.style.backgroundImage = `url(${formData.photo})`;\n profilePreview.style.backgroundImage = `url(${formData.photo})`;\n}", "function onChange(event){\n setProfilePic(URL.createObjectURL(event.target.files[0]));\n }", "handleUpdateProfile() {\n let storageRef = this.props.firebase\n .storage()\n .ref(this.props.auth.uid + \"/\" + \"profilepic\");\n storageRef.getDownloadURL().then(url => this.setState({ source: url }));\n }", "updateProfile(state, payload) {\n state[payload.key] = payload.value;\n }", "setUserProfile(state, val) {\n state.userProfile = val\n }", "function updateProfile(info) {\n setProfile(info);\n }", "function updateUIforSignIn(avatarSrc) {\n\tauthDropdownItem.innerHTML = `<i><img class=\"avatar-image\" src=\"${avatarSrc}\" /></i>`;\n}", "function setNameAvatar(inName, inAvatarSrc){\r\n\t//local logic\r\n\tif( !CURRENT_USER ){\r\n\t\tCURRENT_USER = new User(inName, inAvatarSrc);\r\n\t} else {\r\n\t\tCURRENT_USER.name = inName;\r\n\t\tCURRENT_USER.avatar = inAvatarSrc;\r\n\t}\r\n\r\n\t//on local page\r\n\tupdateProfileOnPage(inName, inAvatarSrc);\r\n\r\n\t//update UI\r\n\tupdateUI();\r\n}", "_FB_getUserImage() {\n const _this = this;\n\n _this._FB_API('/me/picture', function(response) {\n _this.setState({\n FB_user_picture: response.data.url\n });\n })\n }", "handleSignIn(transition, scitran, profile) {\n if (!profile.imageUrl) {\n profile.imageUrl = scitran.avatar\n }\n this.update({ loading: false })\n this.update({ scitran, profile }, { persist: true })\n datasetActions.reloadDataset()\n dashboardActions.getDatasets(true)\n }", "onUpdateProfile() {\n logger.info('Updating profile');\n this.polyInterface.updateProfile();\n }", "async loadProfilePic () {\n\n try {\n let responseData = await PortfolioApi.getPic('profilePic');\n this.setProfileImageState (responseData);\n } catch (err) {\n this.setState({error: \"error loading profile pic\", errorMessage: err})\n }\n }", "fetchImage(user, state){\n // Get self image or friend image\n HttpRequest.fetchImage(`${process.env.REACT_APP_HOSTURL}/user_image/`, user)\n .then(url => this.setState({[state]: url}));\n }", "async updateImage(url) {\n const avatar = url;\n\n if (!avatar) {\n swal({ text: 'Hace falta el avatar' })\n }\n\n const consulta = await fetch(`${this.url}/user/avatar`, {\n method: 'POST',\n body: JSON.stringify({ avatar: avatar }),\n headers: {\n 'Content-Type': 'application/json',\n 'x-access-token': sessionStorage.getItem('__token')\n }\n });\n const res = await consulta.json();\n return res\n }", "function updateProfile (data){\n\tvar fullname = data.name.first + \" \" + data.name.last\n\tfullnameDisp.innerText = fullname\n\tavatar.src = data.picture.medium\n\tusername.innerText = data.login.username\n\tuseremail.innerText = data.email\n\tcity.innerText = data.location.city\n}", "componentDidMount() {\n UserApiService.getUserAccount().then(user => {\n this.context.setUser(user);\n this.setState({\n profile: { value: user.profile, touched: true },\n image_url: { value: user.image_url, touched: true }\n });\n });\n }", "sendHeaderInfo () {\n let { name } = this.state\n updateUserProfile({ name })\n // var user = this.state\n // updateStudent({ first_name: user.name })\n // if (user.img) {\n // uploadUserProfilePic(this.getImageData(user))\n // .catch(e => console.log('profile pic bug'))\n // .then(r => this.retrieveProfilePicture())\n // }\n }", "uploadProfileImage(callback=()=>{}) {\n const state = Store.getState().profile;\n if (!state.selectedImage) { callback(); return; }\n const imageFile = Backend.auth.user().email+\"-\"+Date.now()+\".jpg\";\n let previousImageFile = decodeURIComponent(state.image).split(\"/\").pop().split(\"?\").shift();\n Backend.storage.deleteFile(previousImageFile, () => {\n Store.changeProperty(\"profile.image\",Backend.storage.getFileUrl(imageFile));\n Backend.storage.putFile(imageFile,state.selectedImage,() => {\n callback();\n })\n })\n }", "function updateUser(){\n let user = firebase.auth().currentUser;\n user.updateProfile({\n displayName: \"Jane Q. User\",\n photoURL: \"https://example.com/jane-q-user/profile.jpg\"\n }).then(function() {\n // Update successful.\n }).catch(function(error) {\n // An error happened.\n });\n }", "function changeProfilePic(file) {\r\n if (file.target.files[0].type == 'image/jpeg' || file.target.files[0].type == 'image/png') {\r\n const currentUserEmail = authentication.currentUser.email;\r\n const targetFile = file.target.files[0];\r\n const storageRef = storage.ref(USER_PROFILE_PICTURE_FOLDER + currentUserEmail + '.jpeg');\r\n const task = storageRef.put(targetFile);\r\n\r\n const profilePicUploadProgressContainer = document.getElementById('profile-pic-upload-progress-container');\r\n const profilePicUploadProgressBar = document.getElementById('profile-pic-upload-progress-bar');\r\n profilePicUploadProgressContainer.setAttribute('style', 'display: block');\r\n\r\n task.on('state_changed', function progress(snapshot) {\r\n const uploadPercentage = (snapshot.bytesTransferred / snapshot.totalBytes) * 100;\r\n profilePicUploadProgressBar.style.width = uploadPercentage + '%';\r\n }, function error(error) {\r\n displayErrorAlert(error.message);\r\n }, function complete() {\r\n savePicUrl();\r\n });\r\n } else {\r\n displayErrorAlert('Select Image File First');\r\n }\r\n}", "function update() {\n // PREPARE\n let uid = $rootScope.account.authData.uid;\n let profile = $rootScope.account.profile;\n\n // NEW USER ACTION\n if (profile.newUser) {\n instance.addAchievement(profile, ACHIEVEMENTS.PROFILE_COMPLETED);\n profile.newUser = false;\n }\n\n // UPDATE\n $rootScope.db.users.child(uid).update(profile);\n\n // NOTIFY\n BroadcastService.send(EVENTS.PROFILE_UPDATED, profile);\n }", "async function showProfilePic() {\n const imageObj = await util.getProfilePicById(util.currentProfile);\n\n let profilePicSrc;\n !imageObj\n ? (profilePicSrc = './images/user.png')\n : (profilePicSrc = `./uploadedImages/${imageObj.img_id}.${imageObj.img_ext}`);\n\n document.querySelector('#profilePicElement').src = profilePicSrc;\n}", "async updateProfileUser(context, { userName, userPhotoURL }) {\n await firebase\n .auth()\n .currentUser.updateProfile({\n displayName: userName,\n photoURL: userPhotoURL\n })\n .then(() => {\n context.commit(\"checkAuthState\");\n });\n }", "function updateImg(newImg) {\r\n $(\"#detailPic\").attr(\"src\",newImg.photoDetail);\r\n}", "retrieveProfilePicture (id) {\n // getUserProfilePic(id)\n // .catch(e => console.log('PIC ERROR', e))\n // .then(r => {\n // this.state.img = r.data.url || 'default image'\n // this.setState(this.state)\n // })\n }", "function changeUserProfilePicture(photoID){\n\t\t$.get(domainFiles+'changeUserProfilePicture.php?ID='+photoID, function (response) {\n\t\t\tif(response) {\n\t\t\t\t//update profile picute was successfull\n\t\t\t} else {\n\t\t\t\t//unsuccessful\n\t\t\t}\n\t\t});\n}", "function handleProfileImgLoad(event){\n updateElement('card-picture-img', {'className': 'card-picture-img card-show-profileImg'});\n displayProfileHome() // 파이어베이스에서 이미지가 완전히 로드된 후에 home 화면 보여주기\n // showAlert('succeed to fetch user information from server !', 500);\n \n // 초반에 'card-picture-img' DOM을 생성할때 src가 비어있어서 초기 렌더링시 error 이벤트가 발생하므로 \n // 이미지를 로드한 이후에 사진을 다시 숨겨버린다\n // 그러나 이미지 로드한 이후에는 더이상 사진을 숨길 필요가 없으므로 error 이벤트를 제거함\n // searchElement('card-picture-img').removeEventListener(\"error\", hideProfileImg);\n }", "onUpdateUserDetails(key, value, e) {\n\t\tif(key == 'photo'){\n let file = e.target.files[0];\n let reader = new FileReader();\n reader.onloadend = () => {\n this.setState({\n addNewUserDetail: {\n ...this.state.addNewUserDetail,\n ['photo']: reader.result\n },\n cropResult:true\n });\n }\n\n reader.readAsDataURL(file)\n } \n\n if(key !== 'photo'){\n this.setState({\n\t\t\t\teditUser: {\n\t\t\t\t\t...this.state.editUser,\n\t\t\t\t\t[key]: value\n\t\t\t\t}\n\t\t\t});\n }\n\t\t\n\t}", "function updateImage(whichImage){\n memeDisplay = document.querySelector(\".meme-display img\")\n const PATH = `img/${whichImage}.png` // to access the img folder\n memeDisplay.src = PATH;\n memeDisplay.alt = PATH;\n }", "function updateImage() {\n const title = $('#changeImageTitle').val()\n const desc = $('#changeImageDesc').val()\n updateInfo(title, desc, false)\n}", "mapStateToProps(state) {\n // noinspection JSUnresolvedFunction\n let image = state.profile.selectedImage ? {uri: state.profile.selectedImage} :\n state.profile.image ? {uri:state.profile.image} : require(\"../img/default_profile.png\");\n return {\n name: state.profile.name,\n image: image,\n password: state.profile.password,\n confirmPassword: state.profile.confirmPassword,\n errors: state.profile.errors\n }\n }", "async function changeprofilephoto(req,res){\n profilepicture.change_dp_pic(req,res)\n}", "setProfile() {\n\t\tProfileStore.getProfile(this.props.result._id);\n\t}", "function change(x) {\n x.src = \"images/Profile1.jpg\";\n}", "renderAvatar() {\n const avatarId = this.props.currentUser.profile_photo_id;\n if (avatarId && (this.props.photos[avatarId] && this.props.photos[avatarId].avatar)) {\n return (\n <img src={this.props.photos[avatarId].avatar}\n id=\"menu-button\"\n className=\"profile-image nav-bar-avatar\"/>\n );\n } else {\n return (\n <img src=\"https://s3.us-east-2.amazonaws.com/flexpx-dev/avatar.png\"\n id=\"menu-button\"\n className=\"profile-image stock-avatar\"/>\n );\n }\n }", "function updateImage() {\n const file = document.getElementById('user-picture').files[0];\n // check media type e.g. image/png, text/html\n if (!file.type.startsWith(\"image/\")) {\n alert(\"Not an image!\");\n } else {\n const preview = document.getElementById('meme-picture');\n\n preview.src = window.URL.createObjectURL(file);\n // We cannot revoke the object URL at this\n // point as html2canvas will need it.\n // preview.onload = function() {\n // window.URL.revokeObjectURL(this.src);\n // }\n }\n}", "function loadUserImage(imageName) {\n const avatar = document.getElementById('avatar');\n checkReference(avatar, () => {\n const path = './assets/images/User_Avatars/';\n avatar.src = path + imageName;\n console.log('user image changed');\n });\n}", "update () {\n const url = this.options_.user.avatar;\n const timecode = formatTime(this.timecode, this.player_.duration());\n this.setSrc(url);\n this.tcEl_.innerHTML = `${timecode} ${this.user.nickname ? '- ' + this.user.nickname : ''}`;\n // If there's no poster source we should display:none on this component\n // so it's not still clickable or right-clickable\n if (url) {\n this.show();\n } else {\n this.hide();\n }\n }", "updateProfile(state) {\n axios.get('api/account/profile').then(({ data }) => {\n state.commit('storeUser', data.user);\n })\n }", "uploadProfilePicture(file) {\n if (file) {\n // Start upload\n this.Upload.upload({\n url: 'api/users/picture',\n data: {\n file: file,\n user: this.authentication.user\n }\n }).then((response) => {\n console.log(\"response\", response)\n this.authentication.user = response.data;\n this.imageURL = response.data.profileImageURL;\n //Reload state\n this.$state.reload();\n this.toastr.success('Success ' + response.config.data.file.name + ' uploaded.', 'Success');\n }, (responseError) => {\n console.log('Error: ', responseError);\n this.toastr.error('Error status: ' + responseError.status, 'Error');\n }, (evt) => {\n //let progressPercentage = parseInt(100.0 * evt.loaded / evt.total);\n //console.log('progress: ' + progressPercentage + '% ' + evt.config.data.file.name);\n });\n } else {\n this.toastr.warning('La imagen no cumple con los requisitos.', 'Info');\n }\n\n }", "function updateCurrentUserProfile() {\n\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles! Role will indicate what editing capabilites are available.\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "function updateUserPicture(){\n //put the loading screen on\n loadingScreen(); \n \n //create the object to send \n var obj=new Object();\n obj.serial = $('#changeProfilePicDialog_serial').val();\n \n //send it via jquery and update rating\n $.ajax({\n type: \"POST\",\n url: '/user/updateimage/',\n dataType: \"json\",\n data: obj ,\n success: function(res) {\n if(res.items[0].status ==='success'){\n if (res.items[0].data == 0){\n setSuccessToSuccess();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n \n //change the nprofile picture\n d = new Date();\n $('.userprofileimage').attr(\"src\" , \"/user/showpicture?\" +d.getTime());\n \n $('#changeProfilePicDialog').remove();\n \n $('body').append(res.items[0].html);\n \n \n }\n else{\n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n\n //display success failure screen\n displaySuccessFailure();\n if(res.items[0].data == 1){\n $('#error').text('Invalid image file');\n }\n if(res.items[0].data == 2){\n $('#error').text(\"File is to big\");\n }\n }\n \n }\n \n //removeLoadingGlassScreen();\n },\n error: function(res) { \n setSuccessToFailed();\n //loading screen\n removeLoadingScreen();\n \n //display success failure screen\n displaySuccessFailure();\n \n $(\"#error\").text(\"Connection failure! Try again\");\n },\n complete: function(){\n $('#changeProfilePicDialog').fadeOut('normal');\n $('#glassnoloading').fadeOut('normal');\n }\n });\n}", "uploadFile(){\n const component = this\n var file = this.state.imageFile\n var signedRequest = this.state.signedRequest\n var url = this.state.url\n\n if(file === \"\" || url === \"\"){ //aka The value from the stateHelper has never been changed\n alert(\"No file to upload\")\n }else{\n \n //We upload image to AWS Bucket\n const xhr = new XMLHttpRequest();\n xhr.open('PUT', signedRequest);\n xhr.onreadystatechange = () => {\n if(xhr.readyState === 4){\n if(xhr.status === 200){\n axios.post(api()+\"/changeProfilePicture\",{_id:this.state._id,url:this.state.url})\n .then(function(response){\n if(response.data.message == \"okay\"){\n component.setState({profilePicture:url})\n //We reupdate our sessionStorage as well\n sessionStorage.setItem(\"profilePicture\", url);\n window.location.reload()\n //affecting the parent's state --. userview, so that updated image shows on sidebar\n component.handleStateChange({profilePicture:url})\n }else{\n alert(\"Could not change your profile picture. Please try again.\")\n }\n }).catch(function(error){\n console.log(error)\n })\n }\n else{\n alert('Could not upload file.');\n }\n }\n };\n \n xhr.send(file);\n }\n}", "function updateProfile(user, tweets) {\n clearPictures()\n for (prop in user) {\n var userProperty = $('.' + prop)\n if (userProperty.length == 1) {\n if (prop === 'prof_pic') {\n $(userProperty[0].firstChild).attr('src', user[prop]);\n } else {\n userProperty[0].innerHTML = user[prop];\n }\n } else {\n if (prop === 'background') {\n $('.userProfile').css('background-image', 'url(' + user[prop] + ')')\n } else {\n $.each(userProperty, function(key, value) {\n value.innerHTML = user[prop];\n });\n }\n }\n }\n\n $.each(tweets, function(key, value) {\n var $tweetDiv = $('#tweet' + (key + 1))\n $.each($tweetDiv[0].children, function(prop, val) {\n tweetVal = val.className\n if (tweetVal !== 'username') {\n if (tweetVal === 'tweet_pic') {\n if (value[tweetVal] !== null) {\n var $imgDiv = val.children[0]\n $(val).attr('value', '1')\n $($imgDiv).attr('src', 'http://' + value[tweetVal].host + value[tweetVal].path)\n }\n } else {\n val.innerHTML = value[tweetVal];\n }\n }\n });\n });\n }", "SetProfilePicture(sex) {\r\n switch(sex.toUpperCase()) {\r\n case 'MALE':\r\n return 'http://res.cloudinary.com/onclicksell-com/image/upload/v1513504833/OnclickSell.com/Icons/Conceptional-Avatar-Male-Final-Design.png'\r\n case 'FEMALE':\r\n return 'http://res.cloudinary.com/onclicksell-com/image/upload/v1513504833/OnclickSell.com/Icons/Conceptional-Avatar-Female-Final-Design.png'\r\n }\r\n }", "function loadImage(fileName){\n\talert(\"This is the page to load a saved Project but I only save an image to the users progfile right now. :(\");\n\tvar user = firebase.auth().currentUser;\nvar name, email, photoUrl, uid, emailVerified;\n name = user.displayName;\n email = user.email;\n photoUrl = user.photoURL;\n alert(email+\" \"+name+\" \"+photoUrl);\n user.updateProfile({\n photoURL: \"'../images/test.GIF'\"\n})\n photoUrl = user.photoURL;\n alert(photoUrl);\n}", "function updateProfileBasics(userData) {\n $('.name').text(userData['name']);\n $('#email').text(userData['email']);\n buildAsLabels(`#interests`, userData['interests'], 'interests');\n buildAsLabels(`#skills`, userData['skills'], 'skills');\n populateExistingImage('profile', '#profile-picture-main');\n}", "changePhoto() {\n var options = {\n title: 'Select Avatar',\n storageOptions: {\n skipBackup: true,\n path: 'images'\n }\n };\n ImagePicker.showImagePicker(options, (response) => {\n if (response.didCancel) {}\n else if (response.error){}\n else if (response.customButton){}\n else {\n let source = { uri: response.uri };\n this.setState({\n avatarSource: source\n });\n }\n });\n }", "componentDidUpdate () {\n /** if there is no pic or the pic has no changed return */\n if (!this.props.pic || this.props.pic === '' || this.props.pic === this.pic) { return }\n\n this.pic = this.props.pic\n /** create the preview image url */\n this.pic.image = window.URL.createObjectURL(this.pic.file)\n /** show it */\n this.setState({pic: this.pic})\n // this.forceUpdate()\n }", "function updatePic() {\n $.ajax({\n url: '/uploadimage', //Server script to process data\n type: 'POST',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n //$('form').serialize(),\n success: function(response) {\n $.ajax({\n url: '/uploadmainlistingimage/'+listingview, //Server script to process data\n type: 'POST',\n data: {\n name : response.filename+\"\",\n token : currenttoken\n },\n //$('form').serialize(),\n success: function(resp) {\n $('#editmainlistingpicture, #mainlistingpic').attr('src', \"uploads/\"+resp.mainPicture);\n // Set it to the name of this picture in the profile gallery\n\n $.ajax({\n type: \"GET\",\n url: \"/listingbyname/\" + resp.mainPicture,\n success: function(data){\n if (data) {\n $('#mainlistinglink').attr('name', data._id);\n setCurrentUser();\n }\n }\n });\n }\n });\n\n }\n });\n }", "function UserProfileDetails(props) {\n const classes = useStyles();\n const { userInfo } = props;\n const {\n username, achievements, badges, graphs_created: graphsCreated, completedNodeCount, userId, private: privacy,\n completedGraphs,\n } = userInfo;\n\n const [userImage, setUserImage] = useState();\n const [isUploading, setIsUploading] = useState(false);\n const [uploadStatus, setUploadStatus] = useState(undefined);\n\n // Set the current user image dataURL\n useEffect(() => {\n getUserImage(username).then((data) => {\n if (data.image) {\n setUserImage(data.image);\n }\n });\n }, []);\n\n // Converts image files to a data URL for easy storage in the server\n function convertToDataURLviaCanvas(url, callback, outputFormat) {\n const img = new Image();\n img.crossOrigin = 'Anonymous';\n img.onload = function () {\n let canvas = document.createElement('CANVAS');\n const ctx = canvas.getContext('2d');\n let dataURL;\n canvas.height = 200;\n canvas.width = 200;\n ctx.drawImage(this, 0, 0);\n dataURL = canvas.toDataURL(outputFormat);\n callback(dataURL);\n canvas = null;\n };\n img.src = url;\n }\n\n const onImageChange = (event) => {\n if (event.target.files && event.target.files[0]) {\n const img = event.target.files[0];\n const fileType = img.type;\n const validImageTypes = ['image/gif', 'image/jpeg', 'image/png'];\n if (!validImageTypes.includes(fileType)) {\n setUserImage(null);\n } else {\n setIsUploading(true);\n convertToDataURLviaCanvas(URL.createObjectURL(img), (base64Img) => {\n setUserImage(base64Img);\n });\n }\n }\n };\n\n const uploadImage = () => {\n uploadUserImage(username, userImage).then((data) => {\n if (data.success) {\n setUploadStatus('Successful');\n } else {\n setUploadStatus('unSuccessful');\n }\n setTimeout(() => {\n setUploadStatus(undefined);\n }, 2000);\n setIsUploading(false);\n });\n };\n\n return (\n <div>\n {userInfo && (\n <Paper>\n <Grid container direction=\"column\" alignItems=\"center\">\n <Grid item xs={12}>\n <Avatar alt=\"Remy Sharp\" src={userImage} className={classes.avatar} style={{ objectFit: 'fill' }} />\n </Grid>\n {userId === getUserId() && (\n <div>\n <Grid item xs={12}>\n {uploadStatus && (\n <p>{uploadStatus}</p>\n )}\n <input accept=\"image/*\" id=\"icon-button-file\" type=\"file\" hidden onChange={onImageChange} />\n <label htmlFor=\"icon-button-file\">\n Upload Image\n <IconButton color=\"primary\" className={classes.button} component=\"span\">\n <Publish />\n </IconButton>\n </label>\n {isUploading && (\n <Button onClick={uploadImage}>\n Confirm\n </Button>\n )}\n </Grid>\n <Grid item xs={12}>\n <PrivacyToggle id={userId} updatePrivacy={updateUserPrivacy} initialStatus={privacy} />\n </Grid>\n </div>\n )}\n\n <Grid item xs={8}>\n {badges.map((badge) => <Chip label={badge.name} key={badge._id} variant=\"outlined\" style={{ backgroundColor: badge.color, color: 'white' }} />)}\n </Grid>\n </Grid>\n <Grid container direction=\"column\">\n <Grid item xs={12} className={classes.hr}>\n <hr />\n </Grid>\n <Grid item xs={12} className={classes.detailsTitle}>\n <Typography component=\"h5\" variant=\"h5\">\n Account information\n </Typography>\n <br />\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Username:\n {' '}\n {username}\n </Typography>\n </Grid>\n <Grid item xs={12} className={classes.hr}>\n <hr />\n </Grid>\n <Grid item xs={12} className={classes.detailsTitle}>\n <Typography component=\"h5\" variant=\"h5\">\n Map information\n </Typography>\n <br />\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Maps Completed:\n {' '}\n {completedGraphs.length}\n </Typography>\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Nodes Completed:\n {' '}\n {completedNodeCount}\n </Typography>\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Maps Created:\n {' '}\n {graphsCreated.length}\n </Typography>\n <br />\n </Grid>\n <Grid item xs={12} className={classes.hr}>\n <hr />\n </Grid>\n <Grid item xs={12} className={classes.detailsTitle}>\n <Typography component=\"h5\" variant=\"h5\">\n Achievement Information\n </Typography>\n <br />\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Achievements Completed:\n {' '}\n {achievements.length}\n </Typography>\n </Grid>\n <Grid item xs={12} className={classes.details}>\n <Typography component=\"h6\" variant=\"h6\">\n Badges Earned:\n {' '}\n {badges.length}\n </Typography>\n <br />\n </Grid>\n </Grid>\n </Paper>\n )}\n </div>\n\n );\n}", "getImg() {\n axios.get('/api/getPicture/' + this.state.profilePictureID.imgData)\n .then((res) => {\n this.setState({\n profilePicture: res.data.data\n });\n }, (error) => {\n console.error(\"Could not get uploaded profile image from database (API call error) \" + error);\n });\n }", "function updatePic() {\n $.ajax({\n url: '/uploadimage', //Server script to process data\n type: 'POST',\n data: formData,\n cache: false,\n contentType: false,\n processData: false,\n //$('form').serialize(),\n success: function(response) {\n $.ajax({\n url: '/uploadprofileimage/'+currentuser._id, //Server script to process data\n type: 'POST',\n data: { name : response.filename+\"\",\n token : currenttoken\n },\n //$('form').serialize(),\n success: function(resp) {\n $('#editprofilepicture, #profilepicture').attr('src', \"uploads/\"+resp.profileimage.mainPicture);\n\n $.ajax({\n type: \"GET\",\n url: \"/listingbyname/\" + resp.profileimage.mainPicture,\n success: function(data){\n if (data) {\n $('#mainlistinglink').attr('name', data._id);\n }\n }\n });\n }\n });\n\n }\n });\n }", "function changePicture(value){\n setPicture(value)\n }", "getAvatarUrl() {\n const { user } = this.state;\n return endpoint + '/core/avatar/' + user.id + '/' + user.avatar;\n }", "function changeIMG() {\n document.getElementById(\"eins\").src =\n \"/registration/avatar/<%= file.filename %>\";\n}", "function updateGravatar() {\n var gravatarOptions = currentAttrs();\n var gravatarUrl = gravatar.generateUrl(gravatarOptions);\n\n element.attr('src', gravatarUrl);\n }", "function updateProfileMenu () {\n\t\tvar data = $.extend({result: {url: \"\"}}, profilePhotoData),\n\t\t\timageUrl = data.result.url,\n\t\t\tsignedinListitems = createProfileMenuSignedin(),\n\t\t\tsignedinData = {\n\t\t\t\tlinkContents: \"\",\n\t\t\t\tlinkAlt: IBM.common.translations.data.v18main.misc.welcomeback,\n\t\t\t\tbackgroundImage: \"\",\n\t\t\t\ttype: \"default\"\n\t\t\t};\n\n\t\t// Change the menu to the \"user is signed in\" one ONLY if there are links from the translation data file. \n\t\t// Otherwise we keep it as \"signedout\" links.\n\t\tif (signedinListitems !== \"\") {\n\t\t\t$profileMenu.children(\"ul\").html(signedinListitems);\n\t\t}\n\n\t\t// TESTING ONLY, force a custom image to use instead of default signed-in icon:\n\t\t//imageUrl = \"//lorempixel.com/120/120/people/\";\n\t\t\n\t\t// If we got an image from the profile image service, add it to the API call,\n\t\t// Else, we simply call the default \"signed in\" API to show the blue BG, white icon style.\n\t\tif (imageUrl !== \"\") {\n\t\t\tif (imageUrl.substring(0,2) === \"//\") {\n\t\t\t\timageUrl = \"https://\" + imageUrl;\n\t\t\t}\n\t\t\tsignedinData.type = \"image\";\n\t\t\tsignedinData.backgroundImage = imageUrl;\n\t\t}\n\n\t\t// Show the profile link as \"signed in\" then adjust used space, toggle links and search field if needed.\n\t\tshowProfileLinkSignedin(signedinData);\n\t\tsetMastheadWidthUsed();\n\t\ttoggleInlineLinks();\n\t\ttoggleSearchField();\n\n\t\t// Add the user's profile image to the user object.\n\t\tIBM.common.util.user.subscribe(\"ready\", \"Masthead profile\", function(){\n\t\t\t\tIBM.common.util.user.setInfo({\"imageUrl\": imageUrl});\n\t\t\t\tmyEvents.publish(\"userProfileImageReady\");\n\t\t\t}).runAsap(function(){\n\t\t\t\tIBM.common.util.user.setInfo({\"imageUrl\": imageUrl});\n\t\t\t\tmyEvents.publish(\"userProfileImageReady\");\n\t\t\t});\n\t\t\n\t\tmyEvents.publish(\"profileMenuReady\");\n\t}", "function updateCard() {\n updateCardText('name', 'Nombre Apellido');\n updateCardText('job', 'Front-end developer');\n updateCardLinks('email', 'mailto:');\n updateCardLinks('phone', 'tel:');\n updateCardLinks('linkedin', 'https://linkedin.com/in/');\n updateCardLinks('github', 'https://github.com/');\n if (formData.photo !== '') {\n updateCardPhoto();\n } else {\n profileImage.style.backgroundImage = `url(./assets/images/Logo-Gryffincode.png)`;\n }\n}", "function updateImg() {\n const $url = $('#newPinUrl');\n // If URL field is empty, don't do anything\n if ($url.val() === '') return;\n // Otherwise, continue with validation\n let thisUrl = $url.val().trim().replace(/['\"]/g, '');\n // Prepend URL with protocol, if necessary\n if (!thisUrl.toLowerCase().startsWith('http')) thisUrl = `https://${thisUrl}`;\n $url.val(thisUrl);\n // If URL is new and appears valid, update the image\n if (thisUrl !== lastUrl) {\n $('#newPinImg').attr('src', thisUrl);\n lastUrl = thisUrl;\n }\n}", "function display_profile_image(image) {\n if (image) {\n return 'src = \"' + image + '\"';\n } else {\n return 'src = \"files\\\\profile\\\\img\\\\default.png\"';\n }\n}", "function handleProfileImg(res, userId, profilePic){\n Users.findByIdAndUpdate(userId, {profilePic: profilePic}, (err, picUpdated) => {\n if(err) { res.status(404).send({ err }) }\n\n return res.status(200).send({ message: \"Profile picture updated\", success: true, profilePic})\n })\n}", "function resetProfileInfo() {\n $('#profile-photo').attr('src', 'img/my-list/1.png');\n $('#title-of-list').html('My list');\n $('#create-list').show();\n}", "edit({ email, name, password, image }) {\n let details = { email, name, password, image };\n for (const key in details)\n if (details[key]) {\n currentUser[key] = details[key];\n }\n callFuture(updateUserListeners);\n }", "[PROFILE.FETCH_SUCCESS] (state, profile) {\n state.profile = buildProfile(profile)\n }", "componentDidMount() {\n axios.get('/user').then(({ data }) => {\n if (data.rows[0].profilepic == null) {\n data.rows[0].profilepic = 'default.png';\n }\n this.setState(data.rows[0]);\n // data.rows[0].profilepicurl = null\n console.log(\"profile pic url:\", data.rows[0]);\n });\n }", "function setAvatarBo() {\n avatar = 'img/char-boy.png';\n}", "function loadProfile() {\n if(!supportsHTML5Storage()) { return false; }\n // we have to provide to the callback the basic\n // information to set the profile\n getLocalProfile(function(profileImgSrc, profileName, profileReAuthEmail) {\n //changes in the UI\n $(\"#profile-img\").attr(\"src\",profileImgSrc);\n $(\"#profile-name\").html(profileName);\n $(\"#reauth-email\").html(profileReAuthEmail);\n $(\"#inputEmail\").hide();\n $(\"#remember\").hide();\n });\n }", "getProfile(uid) {\n this.props.firebase.pictures(`${uid}.png`).getDownloadURL().then((url) => {\n this.setState({ url })\n }).catch((error) => {\n // Handle any errors\n this.setState({ url: \"\"})\n })\n }", "function EditUserCard({ user: { img_url, username }, stateUser }) {\n // console.log(user);\n\n return (\n <Div>\n <img\n src={img_url}\n alt=\"User Avatar\"\n style={{\n height: \"120px\",\n width: \"120px\",\n objectFit: \"cover\",\n margin: \"20px 10px\",\n borderRadius: \"50%\"\n }}\n />\n <div style={{ padding: \"10px\" }}>\n <p>What other users see as your username:</p>\n {stateUser ? <h3>{stateUser}</h3> : <h3>{username}</h3>}\n </div>\n </Div>\n );\n}", "function view_user_profile_image(id) {\n $.ajax({\n url: 'users/' + id,\n type: 'get',\n success: function (data) {\n if (data) {\n hold_modal('viewUserImageModal', 'show')\n $('#user_profile_name').html(data.name)\n $('#v_load_view_user_profile').html(`<img src=\"/all/app-assets/images/profile/user-uploads/${data.profile}\"\n style=\"width: 370px; height: 370px; border-radius: 50px\" alt=\"Profile\">`)\n }\n },\n error: function () {\n alert('Failed!')\n }\n })\n}", "setProfilePhotoUrl(myPhotoUrl) {\n dispatch({type : constants.SET_PROFILE_PHOTO_URL, value : myPhotoUrl})\n }", "function updateAvatar() {\n avatar.x = mouseX;\n avatar.y = mouseY;\n // Shrink the avatar and use constrain() to keep it to reasonable bounds\n avatar.size = constrain(avatar.size - AVATAR_SIZE_LOSS,0,avatar.maxSize);\n if (avatar.size === 0) {\n avatar.active = false;\n }\n}", "function profileLoad()\r\n{\r\n user_id = document.cookie;\r\n\r\n // Updates the form submit of the profile update input so that the php file will have access to the user's id\r\n var frm = document.getElementById('form-submit');\r\n frm.action = \"/php/upload.php/?user_id=\" + user_id;\r\n\r\n // json string that will contain the user's id\r\n var jsonPayload = '{\"user_id\" : \"' + user_id + '\"}';\r\n var url = urlBase + '/profileupdate.' + extension;\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.onreadystatechange = function()\r\n {\r\n if (this.readyState == 4)\r\n {\r\n if (this.status == 200)\r\n {\r\n var jsonObject = JSON.parse(xhr.responseText);\r\n\r\n if (jsonObject[\"error\"] != null)\r\n {\r\n alert(\"Unable to load profile image\");\r\n return;\r\n }\r\n\r\n // Checks to see if the profileLocation field is there or not\r\n if (jsonObject[0][\"profileLocation\"] != null)\r\n {\r\n profileLocation = jsonObject[0][\"profileLocation\"];\r\n\r\n // Makes sure that the user has selected a profile image\r\n if (profileLocation != \"empty\")\r\n {\r\n document.getElementById(\"profile_img\").src = profileLocation;\r\n }\r\n }\r\n\r\n var username = jsonObject[0][\"username\"];\r\n var firstname = jsonObject[0][\"firstname\"];\r\n var lastname = jsonObject[0][\"lastname\"];\r\n var birthdate = jsonObject[0][\"birthdate\"];\r\n var age = getAge(birthdate);\r\n var email = jsonObject[0][\"email\"];\r\n var preference = jsonObject[0][\"preference\"];\r\n var zipcode = jsonObject[0][\"zipcode\"];\r\n var about = jsonObject[0][\"about\"];\r\n\r\n // Updates the source of the profile image\t\r\n document.getElementById(\"username\").innerHTML = username;\r\n document.getElementById(\"firstname\").innerHTML = \"<p id = \\\"firstname\\\">\" + firstname + \"<span type=\\\"button\\\" id=\\\"setFirst\\\" onclick = \\\"editFirst()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n document.getElementById(\"lastname\").innerHTML = \"<p id = \\\"lastname\\\">\" + lastname + \"<span type=\\\"button\\\" id=\\\"setLast\\\" onclick = \\\"editLast()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n document.getElementById(\"age\").innerHTML = \"<p id=\\\"age\\\">\" + age + \"</p>\"\r\n document.getElementById(\"email\").innerHTML = \"<p id = \\\"email\\\">\" + email + \"<span type=\\\"button\\\" id=\\\"setEmail\\\" onclick = \\\"editEmail()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n document.getElementById(\"preference\").innerHTML = \"<p id = \\\"preference\\\">\" + preference + \"<span type=\\\"button\\\" id=\\\"setPreference\\\" onclick = \\\"editPreference()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n document.getElementById(\"zipcode\").innerHTML = \"<p id = \\\"zipcode\\\">\" + zipcode + \"<span type=\\\"button\\\" id=\\\"setZip\\\" onclick = \\\"editZip()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n document.getElementById(\"about\").innerHTML = \"<p id = \\\"about\\\">\" + about + \"<span type=\\\"button\\\" id=\\\"setAbout\\\" onclick = \\\"editAbout()\\\" class=\\\"glyphicon glyphicon-pencil\\\"></span>\"\r\n }\r\n }\r\n };\r\n\r\n xhr.open(\"POST\", url, true);\r\n xhr.send(jsonPayload);\r\n}", "function updateCurrentUserProfile() {\n\n Debug.trace(\"Refreshing user profile...\");\n\n sharedServices.getCurrentUserProfile()\n .success(function (data, status, headers, config) {\n\n vm.currentUserProfile = data; //Used to determine what is shown in the view based on user Role.\n currentUserRoleIndex = vm.platformRoles.indexOf(data.Role) //<-- use PLATFORM roles, NOT ACCOUNT roles!\n\n Debug.trace(\"Profile refreshed!\");\n Debug.trace(\"Role index = \" + currentUserRoleIndex);\n\n })\n .error(function (data, status, headers, config) {\n\n\n })\n\n }", "componentDidMount() {\n this.userData.on('value', snapshot => {\n const userInfo = snapshot.val();\n if(!userInfo){\n this.setState({\n userDetails: {\n image: 'https://firebasestorage.googleapis.com/v0/b/workoutapp-79860.appspot.com/o/images%2Fback.jpg?alt=media&token=539288a5-620c-4fac-b9ea-d2939b3bd655',\n }\n })\n }else{\n this.setState({userDetails: userInfo});\n }\n });\n }", "setLastAvatarUrl(props) {\n let avatarUrl = _.get(props, ['session', 'user', 'avatarUrl'])\n if (avatarUrl) {\n this.setState({ lastAvatarUrl: avatarUrl })\n }\n }", "getProfilePic() {\n return 'images/' + this.species.toLowerCase() + \".png\";\n }", "setPicturePrivacy() {\n let context = this;\n let currentPrivacy = context.get(\"model.userInfo.show_pic\");\n let newPrivacy = currentPrivacy ? 'N' : 'Y';\n let privacyToSet = currentPrivacy ? false : true;\n // console.log(newPrivacy);\n let successMessage;\n let setPrivacy = function(value) {\n return putAsync(\"/profiles/image_privacy/\" + value, value, context).catch((reason) => {\n // console.log(reason);\n //TODO handle error\n });\n };\n let transition = function() {\n context.set(\"model.userInfo.show_pic\", privacyToSet);\n if(privacyToSet) {\n successMessage = \"Your profile picture is now visible on your public profile page. Changes may take a few minutes to take effect.\";\n } else {\n successMessage = \"Your profile picture is no longer visible on your public profile page. Changes may take a few minutes to take effect.\";\n }\n context.set(\"profilePictureSuccessMessage\", successMessage);\n };\n\n setPrivacy(newPrivacy)\n .then(transition);\n }", "setAvatar(url) {\n const template = `<img src=\"${url}\" alt=\"\">`;\n this._userAvatar.insertAdjacentHTML(\"afterbegin\", template);\n }", "changeImage() { Store.changeProperty(\"activeScreen\",Screens.IMAGE_PICKER); }", "set sourceAvatar(value) {}", "function updateUserProfile() {\n // $('#profile-name)\n $(\"#show-name\").html(` ${currentUser.name}`);\n $(\"#show-username\").html(` ${currentUser.username}`);\n $(\"#show-date\").html(` ${currentUser.createdAt.slice(0, 10)}`);\n }", "async refreshProfile() {\n // Fetch the latest profile\n const response = await this.fetcher.fetchJSON({\n method: 'GET',\n path: routes.api().auth().profile().path\n });\n\n // Create a profile instance\n this._profile = new UserProfile(response);\n // Store this for later hydration\n this.storage.profile = this._profile;\n }", "function fetchImageDataAndUpdateState() {\n\n const titleList = images.reduce((newList, img) => [...newList, img.title], []);\n\n hydrateDetailPageImages(titleList, currDetailPage).then(function(detailPage) {\n\n // Update wiki page from our in memory list\n wikiPages[pageID] = detailPage;\n\n // Dispatch our pages list update and set data for the current detail view\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n\n }).catch((e) => {\n console.error('Failed to hydrate image info on details page', e);\n dispatchUpdates(wikiPages, wikiPages[pageID]);\n });\n }", "setupUserProfile(){\n var userPhoto=this.state.user.photoURL?this.state.user.photoURL:'http://www.gravatar.com/avatar/' + md5(this.state.user.email+\"\")+\"?s=512\";\n return (\n <div className=\"container-fluid\">\n <div className=\"row\">\n <div className=\"col-md-10\">\n <div className=\"row\">\n <Card \n class=\"col-md-3 col-md-offset-2\"\n name={\"userDataRight\"}\n title={\"User Info\"}\n showAction={false}\n >\n <row>\n <br /><br />\n <div className=\"col-md-12\">\n <div className=\"col-md-6 col-md-offset-3\">\n <Image \n class=\"img-circle\"\n wrapperClass=\" \"\n theKey=\"image\"\n value={userPhoto}\n updateAction={(imageName,linkToImage)=>{this.setUpUserImage(linkToImage)}}\n >\n </Image>\n </div>\n <div className=\"clearfix\"></div>\n <div className=\"col-md-8 col-md-offset-2\">\n <h4 className=\"text-center\">{this.state.user.displayName}</h4>\n <p className=\"text-center\"><b>{this.state.user.email}</b></p>\n </div>\n </div>\n </row>\n </Card>\n <div className=\"col-md-7\">\n <div className=\"row\">\n <Card \n class=\"col-md-12\"\n name={\"userDataRight\"}\n title={\"My Profile\"}\n showAction={false}\n >\n <div className=\"row\">\n <div className=\"form-group-md col-md-10 col-md-offset-1\">\n <div className=\"row\">\n <label for=\"firstName\" className=\"col-md-3 col-form-label labelUserProfile\">Full Name</label>\n <div className=\"col-md-7\">\n <ConditionalDisplay condition={this.state.user.email}>\n <Input \n class=\"col-md-7\"\n theKey=\"name\"\n \n value={this.state.user.displayName}\n updateAction={(nameKey,displayName)=>{this.setUpName(displayName)}}\n >\n </Input>\n </ConditionalDisplay>\n </div>\n </div>\n <br /><br />\n </div>\n </div>\n </Card>\n <Card \n class=\"col-md-12\"\n name={\"userPassword\"}\n title={\"Reset Password\"}\n showAction={false}\n >\n <div className=\"row\">\n <div className=\"form-group-md col-md-10 col-md-offset-1\">\n <div className=\"row\">\n <label for=\"password\" className=\"col-md-3 col-form-label labelUserProfile\">New Password</label>\n <div className=\"col-md-7\">\n <Input \n class=\"col-md-7\"\n theKey=\"password\"\n value={this.state.password}\n type={\"password\"}\n updateAction={(nameKey,newpassword)=>{\n this.setState({\n password: newpassword\n })\n }}\n >\n </Input>\n </div>\n </div>\n </div>\n <div className=\"form-group-md col-md-10 col-md-offset-1\">\n <div className=\"row\">\n <label for=\"passwordConfirmation\" className=\"col-md-3 col-form-label labelUserProfile\">New Password Confirmation</label>\n <div className=\"col-md-7\">\n <Input \n class=\"col-md-7\"\n theKey=\"passwordConfirm\"\n value={this.state.confirmPass}\n type={\"password\"}\n updateAction={(nameKey,newpassword)=>{\n this.setState({\n confirmPass: newpassword\n })\n }}\n >\n </Input>\n </div>\n </div>\n <br /><br />\n <a type=\"submit\" onClick={this.resetPassword} className={\"btn \"+Config.designSettings.submitButtonClass}>Change password</a>\n </div>\n </div>\n </Card>\n <div style={{\"text-align\": \"center\"}} className=\"col-md-8 col-md-offset-7\">\n <br />\n <br />\n <a className=\"button\" href=\"/\">Go Back</a>\n <br />\n <br />\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div> \n )\n }", "function updateInfo(infos){\n document.getElementById(\"image_du_chat\").src = infos.profile_img ;\n document.getElementById(\"nom_du_chat\").textContent = infos.name ;\n document.getElementById(\"age_du_chat\").textContent = infos.age ;\n document.getElementById(\"description_du_chat\").textContent = infos.description ;\n}", "updateCache() {\n this.imageCache.src = this.config.src;\n }" ]
[ "0.7243879", "0.72405624", "0.72354543", "0.70856494", "0.6900407", "0.6855687", "0.68529993", "0.6851334", "0.68011844", "0.6798323", "0.6741892", "0.672388", "0.6718735", "0.67142665", "0.67111516", "0.6693026", "0.66868806", "0.66364396", "0.6601799", "0.6591476", "0.65565294", "0.6499955", "0.6475157", "0.64624053", "0.6417859", "0.64025104", "0.63837117", "0.6381408", "0.6351396", "0.63497055", "0.6341977", "0.6338187", "0.6318543", "0.6293445", "0.6291424", "0.6281644", "0.62770593", "0.6275368", "0.6254767", "0.62462294", "0.62446576", "0.62427115", "0.6240872", "0.6230629", "0.6227923", "0.62193316", "0.62054235", "0.6200272", "0.6188068", "0.61761796", "0.6172484", "0.6172204", "0.6159966", "0.6152808", "0.6149828", "0.61491144", "0.61483294", "0.61381745", "0.61316264", "0.61293423", "0.6127748", "0.611838", "0.61076313", "0.6104185", "0.6092306", "0.6090307", "0.60893327", "0.60761267", "0.60744834", "0.6070037", "0.60698813", "0.6067139", "0.6064516", "0.60623515", "0.60582644", "0.60548085", "0.60517", "0.60490316", "0.60462576", "0.60450983", "0.6044045", "0.60418", "0.6033499", "0.60282385", "0.602253", "0.60216904", "0.6016663", "0.6009379", "0.6008626", "0.6003235", "0.5986826", "0.59867895", "0.5979585", "0.5972942", "0.5967606", "0.59651166", "0.59585387", "0.59455436", "0.5942543", "0.5940337" ]
0.73725945
0
see if interest was checked or not
handleInterest(interest) { if (this.state.interests.includes(interest)) { const newstate = [...this.state.interests]; const index = newstate.indexOf(interest); newstate.splice(index, 1); this.setState({ interests: newstate }); } else { this.setState({ interests: [...this.state.interests, interest] }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleInterestExplanation() {\n let interestDisplay = document.getElementById(\"toggle-other-interests\");\n if(otherInterest.checked) {\n interestDisplay.style.display = \"block\";\n otherChecked = true;\n } else {\n interestDisplay.style.display = \"none\";\n otherChecked = false;\n }\n}", "_updateInterest () {\n const prev = this._amInterested\n this._amInterested = !!this._selections.length\n\n this.wires.forEach(wire => {\n let interested = false\n for (let index = 0; index < this.pieces.length; ++index) {\n if (this.pieces[index] && wire.peerPieces.get(index)) {\n interested = true\n break\n }\n }\n\n if (interested) wire.interested()\n else wire.uninterested()\n })\n\n if (prev === this._amInterested) return\n if (this._amInterested) this.emit('interested')\n else this.emit('uninterested')\n }", "_updateInterest () {\n const prev = this._amInterested\n this._amInterested = !!this._selections.length\n\n this.wires.forEach(wire => this._updateWireInterest(wire))\n\n if (prev === this._amInterested) return\n if (this._amInterested) this.emit('interested')\n else this.emit('uninterested')\n }", "_updateInterest () {\n const prev = this._amInterested\n this._amInterested = !!this._selections.length\n\n this.wires.forEach(wire => this._updateWireInterest(wire))\n\n if (prev === this._amInterested) return\n if (this._amInterested) this.emit('interested')\n else this.emit('uninterested')\n }", "calcinterest() {\n return (this.balance * this.int_rate);\n }", "function interview(student, eligibilityTestingMechanism) {\n let isEligible = eligibilityTestingMechanism(student);\n console.log(isEligible);\n if(isEligible === true) {\n console.log('Eligible for interview');\n }else {\n console.log('Not eligible for interview');\n }\n return isEligible;\n}", "function isBoosted() {\n return document.getElementById(\"booster\").checked;\n }", "function check(){\r\n if (document.getElementById(\"metamorphosis\").checked){\r\n alert(\"Correct! There is one individual with 3 life stages.\");\r\n }\r\n else if (document.getElementById('evolution').checked){\r\n alert(\"Try again. Think about how many individuals there are and how many life stages each individual has.\"); \r\n }\r\n\r\n }", "needsInspection() {\n return this.specialActionNeeded || new Date().getFullYear() - this.yearLastInspected > 10;\n }", "function anySelected() {\n\tvar returnBool = false;\n\n\tfor(var i=0; i < allInterests.length; i++) {\n\n\t\tif( Boolean(allInterests[i].selected) )\n\t\t{\n\t\t\treturnBool = true;\n\t\t}\n\t}\n\treturn returnBool;\n}", "isChecked() {\n return this.hasAnyAttribute('checked');\n }", "function tax() {\n if (paysTax.checked) {\n return true;\n } else {\n return false;\n }\n}", "function hasLoan(){\n return bankLoan !== 0\n}", "getInterest() {\n return this.interest;\n }", "function inspectBox()\n{\n if (oCheckbox.checked)\n {\n alert(\"The box is checked.\");\n } else {\n alert(\"The box is not checked at the moment.\");\n }\n}", "function check() {\n var inputs = are.children(\"input:checked\");\n for (var i = 0; i < inputs.length; i++) {\n if ($(inputs[i]).val() === questions[i].correctAnswer) {\n game.correct++;\n } else {\n game.incorrect++;\n }\n }\n }", "function checkedTest() {\n cy.get('[name=\"terms\"]')\n .not('have.checked')\n .click()\n .should('have.checked')\n }", "function meetsDietaryRequirements(mi) {\n gluteninput = document.getElementById(\"glutencheckbox\");\n vegetarianinput = document.getElementById(\"vegetariancheckbox\");\n veganinput = document.getElementById(\"vegancheckbox\");\n\n if (!gluteninput.checked || (gluteninput.checked === true\n & mi.dataset.glutenfree === \"true\")) {\n if (!vegetarianinput.checked || (vegetarianinput.checked === true\n & mi.dataset.vegetarian === \"true\")) {\n if (!veganinput.checked || (veganinput.checked === true & mi.dataset.vegan\n === \"true\")) {\n return true;\n }\n }\n }\n return false;\n\n}", "function checkTerms(e) {\n //If someone clicked on the checkbox, it will return true. \n\tif (check.checked == true) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n} //End CheckTerms //", "function isEligible(student) {\n // assumed student is not eligible\n let flag = false;\n console.log(student.marks);\n if(student.marks > 60) {\n flag = true;\n }\n return flag;\n}", "function InputCheck() {\r\n var x = document.getElementById(\"check\").checked;\r\n var age1 = document.getElementById(\"age1\").checked;\r\n var age2 = document.getElementById(\"age2\").checked;\r\n\r\n if (x == true && (age1 == true || age2 == true)) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "function household_registration_unearned_income_step()\n{\n // alert('onload -earned income step ')\n\n if ($('#household_member_unearned_income_flag_n').is(':checked'))\n {\n $('#new_unearned_income_button').hide();\n }\n\n// Hidden field is shown on the view - if income record is present , so that new button is visible to add more income records.\n if ($('#household_member_unearned_income_flag').is('Y'))\n {\n $('#new_unearned_income_button').show();\n } \n\n\n}", "function instrumentBox(){\n if (document.getElementById(\"sax\").checked){\n rightCount++;\n write(\"result2\", \"Right!\");\n hide(\"result2\");\n hide(\"instrument\");\n show(\"correct2\");\n show(\"carQuestion\");\n console.log(\"Instrument answered correctly\");\n console.log(\"Right: \" + rightCount + \" Wrong: \" + wrongCount);\n } else{\n wrongCount++\n console.log(\"Instrument answered incorrectly\");\n write(\"result2\", \"Wrong!\");\n }\n}", "function checkIfImAPirate () {\n if (readCookie('WhoAmI') === 'You are a pirate!') {\n youAreAPirate(true)\n document.querySelector('#yarr').checked = true\n }\n}", "function searchUndergrad() {\r\n search.undergrad = $(\"#undergradsearch\").is(\":checked\");\r\n updateData();\r\n}", "function incomeVisibility() {\n 'use strict';\n\n // Earned Income\n FBRun.vis.applyRule($('#p3'), employedInHousehold());\n\n // Pensions Income:\n FBRun.vis.applyRule($('#p5'), pensionerInHousehold());\n\n // Non-dep Income:\n FBRun.vis.applyRule($('#p7'), nonDepInHousehold());\n return false;\n}", "applied(money) {\n if ((this.money >= 150) && (this.qualify)) {\n this.isStudent = 1;\n return 1;\n } else {\n return 0;\n }\n }", "function setDiceAverage() {\r\n if (document.getElementById(\"average_dice\").checked === true) {\r\n dice_averaged = true;\r\n } else {\r\n dice_averaged = false;\r\n }\r\n}", "function checkBox(){\n if($(\"action\" && \"sci-fi\").checked){\n genreValue = $(\"action\" && \"sci-fi\").value;\n \n \n }\n }", "function passesFences() {\r\n var fenceRadioButtonNames = $(\"input[name*='fence_'][value=1]\");\r\n var passesFences = true;\r\n \r\n // iterate through all fence radio button groups and find out if any of them are \r\n fenceRadioButtonNames.each(function() {\r\n passesFences = passesFences && aquireRadioValue($(this).attr(\"name\"));\r\n });\r\n return passesFences;\r\n}", "function calculateInterestOnlyLoanPayment(loanTerms) {\n let payment;\n payment = loanTerms.principle * calculateInterestRate(loanTerms.interestRate);\n return 'The interest only loan payment is ' + payment.toFixed(2);\n}", "function checkStatement(opinion){\n document.getElementById('important').checked = false;\n for(var k = 0; k < position.length; k++){\n document.getElementById(position[k]).style.background = 'none';\n }\n\n if(subjects[statementNumber].weight == true){\n document.getElementById('important').checked = true;\n }\n\n if(opinion == ''){\n return;\n }else{\n document.getElementById(opinion).style.background = 'rgb(1, 180, 220)';\n }\n}", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n return true\n } else {\n return false\n }\n }", "function checkClicked() {\n \n}", "function check() {\n if (document.getElementById(\"checkit\").clicked === true) {\n alert(\"button was clicked\");\n }\n}", "function checkPass(result) {\n let labMarks = result.labMarks ? result.labMarks : 0;\n return result.theoryMarks + labMarks >= 50;\n }", "isPaymentSufficient() {\n if (this.cashTendered >= this.amountDue) {\n console.log(\"Payment complete\")\n\n } else {\n this.insertCoin(type);\n }\n }", "function IsChecked2(field)\n{\n\tif (field.checked)\n\t{return false;}\n\telse\n\t{return true;}\n}", "function employed(){\nif(hasExperience){\n if(amountOfExperience >5){\n return true;\n }\n}\nif(hasExperience === false || amountOfExperience < 5){\n return false;\n}\n}", "function calculateInterest() {\n\t// get number of years user will earn interest and convert to decimal\n\tage = document.getElementById('age').value;\n\tuserageNumber = parseFloat(age);\n\n\t// get current savings and convert to decimal\n\tsavings = document.getElementById('savings').value;\n\tsavingsNumber = parseFloat(savings);\n\t\n\t// get interest rate, convert to number, and then convert to percentage\n\trate = document.getElementById('rate').value;\n\trateNumber = parseFloat(rate);\n\tratePercentage = rateNumber / 100;\n\n\ttotal = savingsNumber;\n\n\t// for each year money will earn interest, add the total plus the interest\n\tfor (i=0; i<userageNumber; i++) {\n\t\ttotal += total * ratePercentage;\n\t}\n\n\t// Limit the total to two decimal places\n\ttotal = total.toFixed(2);\n\n\t// Check that all the numbers are actually numbers\n\t// If not, show an alert\n\t// If so, display the total\n\tif ( isNaN(total) || isNaN(userageNumber) ) {\n\t\talert('Please fill out all the fields with numbers only.');\n\t} else {\n\t\t// Display the message stating how much the total will be\n\t\t// To add commas to separate thousands, I used function outlined here: https://blog.abelotech.com/posts/number-currency-formatting-javascript/\n\t\tmessage += `<p>At ${rate}% interest, after ${userageNumber} years, you will have $${addCommas(total)} in savings.</p>`;\n\t\tdocument.getElementById('answer').innerHTML = message;\n\t\tanswer.style.display = 'block';\n\t\tanswer.style.marginTop = '2em';\n\t\tanswer.style.marginBottom = '20px';\n\n\t\t// Show the reset button and erase button\n\t\tresetButton.style.display = 'block';\n\t\teraseButton.style.display = 'block';\n\n\n\t\t// Hide the form so is it replaced with the results and reset button\n\t\tform.style.display = 'none';\n\t\t}\n\n\t}", "function searchGraduate() {\r\n search.graduate = $(\"#graduatesearch\").is(\":checked\");\r\n updateData();\r\n}", "function party_is_in(){\n\n\treturn this.party ? true: false;\n}", "function checkPublish(){\n \n publish = $(\"input[type='radio']:checked\").val().trim(); //get published status\n \n //if article is not published warn user it will not be visible \n if(publish.trim() !== \"1\") {\n setError($(\"#warning-publish\"),\"*Unpublished articles will not be visible to other users!\");\n return true;\n }else{\n resetError($(\"#warning-publish\"));\n return false;\n }\n \n}//END checkPublish function", "function bothAnsweredCheck() {\n return answerSubmitted.every(function (element) {\n // console.log(element);\n return element == true;\n });\n}", "function _checkAi(){return true;}", "function checkOverlay(){\r\n return(document.getElementById(\"overlay\").checked == true);\r\n}", "function isValideSquadrePreferite(squadrePreferite) {\n //console.log(squadrePreferite);\n //console.log(squadrePreferite[0].checked);\n\n /* for (var i = 0; i < squadrePreferite.length; i++){\n if (squadrePreferite[i].checked)\n return true;\n } */\n\n for (var squadra of squadrePreferite) {\n if (squadra.checked)\n return true;\n }\n\n return false;\n}", "function checkOTCAnswer() {\n if ($('input[name=otcq]:checked').val() == 4) {\n createFirework(25,187,5,1,null,null,null,null,false,true);\n $('#overlay').fadeIn('fast');\n $('#correct').fadeIn('slow');\n } else {\n alert(\"Sorry. That's not correct.\");\n }\n}", "function simpleInterest(p, r, t){\n return((p * r * t)/100);\n}", "function consultationNeeded(fever, precon, headinjury, fracture){\n \t\tif (fever > 39 || precon === 'yes' || headinjury === 'yes' || fracture === 'yes'){\n return true;\n }else{\n return false;\n }\n }", "function isAllEntered() {\n var chekboxes = document.getElementsByName('source');\n var ch = false;\n for (var i = 0, length = chekboxes.length; i < length; i++) {\n if (chekboxes[i].checked) {\n ch = true;\n break;\n }\n }\n if (!ch) {\n document.getElementById('checkMandatory').style.color = \"red\";\n document.getElementById('checkMandatory').style.display = \"block\";\n }\n return ch;\n}", "function isEnrolledOrPending(r){ return r.enrolled || r.pending; }", "getFee() {\n return !!document.getElementById(\"en__field_supporter_transaction_fee\")\n .checked;\n }", "get satisfied() {\n return this.taken >= this.take && this.hours >= this.min_hours;\n }", "isHurt() {\n return (this.currentInvincibility > 0);\n }", "function checkIfDone(){\n\tif(remainingSlides === 0 | remainingSlides < 0){\n\t\tconsole.log(\"DONE\");\n\t\t$(\"#quiz\").css(\"display\", \"none\");\n\t\t$(\"#results\").css(\"display\", \"block\");\n\t\tvar totalAgainstNN = liked/totalSlides*100;\n\t\tif (totalAgainstNN >= 50.0){\n\t\t\t$(\"#foragainst\").text(\"for\");\n\t\t\t$(\"#foragainst2\").text(\"for\");\n\t\t\t$(\"#magicNum\").text(Math.round(totalAgainstNN));\n\t\t\t$(\"#folksAgainstNN\").css(\"display\", \"block\");\n\t\t} else {\n\t\t\t$(\"#foragainst\").text(\"against\");\n\t\t\t$(\"#foragainst2\").text(\"against\");\n\t\t\t$(\"#magicNum\").text(Math.round(100-totalAgainstNN));\n\t\t\t$(\"#folksForNN\").css(\"display\", \"block\");\n\t\t}\n\t}\n}", "function checkMom(){\r\n if (document.getElementById(\"traitsA1\").checked){\r\n alert(\"Correct! The cheek color is inherited from the Mom.\");\r\n } else{\r\n alert(\"Try again, take a look at the color and shape of each trait in the parents and child.\");\r\n }\r\n}", "function detChecked()\r\n{\r\n\tvar dln = $(\"input[id ^= _detl_deli_chek]:checked\").length;\r\n\tvar rln = $(\"input[id ^= chkRowKeys]:checked\").length;\r\n\tif ( dln > 0 || rln > 0)\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\treturn false;\r\n}", "setInterest(aInterest) {\n this.interest = aInterest;\n }", "function toggleDone() {\n event.preventDefault();\n //event.stopPropagation();\n console.log(\"Inside toggleDone\");\n\n//need to add a check to see if it has been counted already \n$(\"input[type=checkbox]:checked\").each(function(){ \n \n if($(this).hasClass(\"counted\")){\n console.log(\"Already counted\");\n \n }\n\n else{ \n\n $(this).addClass(\"counted\")\n completionCount++;\n badgeAlert(completionCount);\n var todo = {\n id: parseInt($(this).val()),\n complete: true\n }\n \n var count = {\n completionCount: completionCount\n }\n console.log(todo);\n updateTodo(todo);\n console.log(\"Count 162: \"+count);\n updateCount(count); \n }//end of else\n\n });\n \n}", "function isCheckedInput(input) {\n return input.checked;\n}", "function checkboxChecked(input) {\n if (input.checked){\n return true;\n } return false;\n}", "function indicateChecked() {\r\n\t\t\t\tcheckbox.checked = true;\r\n\t\t\t\ttaskElement.classList.add(\"checked\");\r\n\t\t\t\ttaskElement.classList.add(\"crossout\");\r\n\t\t\t}", "function CheckPlayable() {\n if ((playerCredit < playerBet)) {\n messageLabel.text = \"low credit\";\n spinButton.mouseEnabled = false;\n spinButton.alpha = 0.3;\n console.log(playerCredit);\n }\n else if (playerBet == 0) {\n messageLabel.text = \"Enter bet\\n amount\";\n spinButton.mouseEnabled = false;\n }\n else {\n spinButton.mouseEnabled = true;\n spinButton.alpha = 1;\n }\n }", "function hasAnswered(){\n if( document.getElementById(\"a\").checked == true ||\n document.getElementById(\"b\").checked == true ||\n document.getElementById(\"c\").checked == true){\n return true;\n }\n return false;\n}", "function isComplete(){\n if(rootCheck.checked && relativeCheck.checked){\n return rootSelAnswer != -1 && modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else if (rootCheck.checked) {\n return rootSelAnswer != -1 != -1 && modeSelAnswer != -1;\n }else if (relativeCheck.checked) {\n return modeSelAnswer != -1 && relativeSelAnswer != -1;\n }else {\n return modeSelAnswer != -1;\n }\n}", "function test() {\n\tconsole.log(document.getElementById(\"smallCap\").checked);\n}", "function hometownClick(){\n if (document.getElementById(\"dtw\").checked){\n rightCount++;\n console.log(\"Hometown correct\");\n console.log(\"Right: \" + rightCount + \" Wrong: \" + wrongCount);\n write(\"result1\", \"Right!\");\n\n // Hide previous question and display the next after a correct answer\n hide(\"hometownForm\");\n show(\"hometownSpell\");\n\n } else { // If not Detroit, it's wrong\n wrongCount++;\n console.log(\"Hometown incorrect\");\n console.log(\"Right: \" + rightCount + \" Wrong: \" + wrongCount);\n write(\"result1\", \"Wrong! Try again...\");\n }\n}", "function indicateChecked() {\r\n\t\t\tcheckbox.checked = true;\r\n\t\t\ttaskElement.classList.add(\"checked\");\r\n\t\t\ttaskElement.classList.add(\"crossout\");\r\n\t\t}", "function checkChecked(){\n let checked = false;\n activities.each(function(index,e){\n if($(e).is(\":checked\")){\n checked = true;\n }\n });\n if(checked){\n $(\".cbox-warn\").hide();\n }else{\n $(\".cbox-warn\").show();\n }\n return checked;\n}", "getCustomState() {\n\t\tconst checkedSubInputs = this.subGroup.querySelectorAll( '[type=\"checkbox\"]:checked' );\n\n\t\tlet state = false;\n\n\t\tif ( checkedSubInputs.length === this.subInputs.length ) {\n\t\t\tstate = true;\n\t\t} else if ( 0 < checkedSubInputs.length ) {\n\t\t\tstate = 'mixed';\n\t\t}\n\n\t\treturn state;\n\t}", "function verificaCheckboxes(checkbox){\n\treturn checkbox == true;\n}", "function validateTC(){\n\tvar retval = jQuery('#terms-conditions').is(':checked');\n\trequiredAction('#terms-conditions',retval);\n\treturn retval;\n}", "function changeEnough(change, amountDue) {\n\t// break down change\n let quarters = change[0] * 0.25;\n let dimes = change[1] * 0.10;\n let nickels = change[2] * 0.05;\n let pennies = change[3] * 0.01;\n let total = quarters + dimes + nickels + pennies\n // console.log(total);\n return (total-amountDue >= 0)? true : false\n}", "'change .learning input'(event, instance) {\n instance.state.set('showLearning', event.target.checked);\n }", "async function shouldCheck() {\n\n\t// Get today\n\tlet today = new Date().getDay();\n\n\t// Get the day an update was last checked\n\tlet lastChecked = await store.get(Constants.checkedUpdateKey);\n\n\t// Check if we have ever checked for an update\n\tif (lastChecked === undefined || lastChecked === null) {\n\n\t\t// Set today as last checked\n\t\tawait store.set(Constants.checkedUpdateKey, today);\n\n\t\treturn true;\n\n\t} else {\n\n\t\t// Check if an update was checked for today\n\t\tif (today === lastChecked) {\n\t\t\treturn false;\n\t\t} else {\n\n\t\t\t// Set today as last checked\n\t\t\tawait store.set(Constants.checkedUpdateKey, today);\n\n\t\t\treturn true;\n\n\t\t}\n\n\n\t}\n\n}", "function startCondition() {\n if ((document.getElementById('toggleHandicap').checked) === true) {\n document.getElementById('toggleHandicap').click();\n }\n if ((document.getElementById('toggleMunicipalGarages').checked) === false) {\n document.getElementById('toggleMunicipalGarages').click();\n console.log('it is true')\n }\n if ((document.getElementById('togglePrivateGarages').checked) === false) {\n document.getElementById('togglePrivateGarages').click();\n }\n if ((document.getElementById('toggleSmartMeters').checked) === true) {\n document.getElementById('toggleSmartMeters').click();\n }\n if ((document.getElementById('toggleBlueTopMeters').checked) === true) {\n document.getElementById('toggleBlueTopMeters').click();\n }\n if ((document.getElementById('toggleBrownTopMeters').checked) === true) {\n document.getElementById('toggleBrownTopMeters').click();\n }\n if ((document.getElementById('toggleYellowTopMeters').checked) === true) {\n document.getElementById('toggleYellowTopMeters').click();\n }\n if ((document.getElementById('toggleEVCharge').checked) === true) {\n document.getElementById('toggleEVCharge').click();\n }\n if ((document.getElementById('toggleMotorcycle').checked) === true) {\n document.getElementById('toggleMotorcycle').click();\n }\n if ((document.getElementById('toggleBusLargeVehicle').checked) === true) {\n document.getElementById('toggleBusLargeVehicle').click();\n }\n if ((document.getElementById('toggleResidential').checked) === true) {\n document.getElementById('toggleResidential').click();\n }\n if ((document.getElementById('toggleLoadingUnloading').checked) === true) {\n document.getElementById('toggleLoadingUnloading').click();\n }\n }", "function willYou(young, beautiful, loved) {\r\n if(young === true && beautiful === true && loved === true){\r\n return false;\r\n }\r\n if(young === true && beautiful === true && loved === false){\r\n return true;\r\n }\r\n if(young === false && beautiful === false && loved === false){\r\n return false;\r\n }\r\n if(young === false && beautiful === true && loved === false){\r\n return false;\r\n }\r\n if(young === false || beautiful === false && loved === true){\r\n return true;\r\n }\r\n if(young === true || beautiful === true && loved === false){\r\n return false;\r\n }\r\n}", "isReady() {\n return this.age >= this.period;\n }", "function passesCritical(){\n return (billsTotal()>= criticalLevelSet);\n}", "function checkedIn(data) {\n if (data.photoID == 1) {\n return true;\n } else if (data.photoID == 0) {\n return false;\n } else {\n return data.photoID;\n }\n}", "function submitIntake() {\n\n let rightHandedness = document.getElementById(\"rightHanded\").checked;\n let leftHandedness = document.getElementById(\"leftHanded\").checked;\n\n\n if (rightHandedness === true) {\n handedness = \"right\";\n antihandedness = \"left\";\n } else if (leftHandedness === true) {\n handedness = \"left\";\n antihandedness = \"right\";\n }\n\n if (document.getElementById(\"brightness\").checked === false /*|| document.getElementById(\"headphones\").checked === false || document.getElementById(\"volume\").checked === false*/) {\n // do nothing\n } else {\n // alert(\"your subjectid is \" + subjectID);\n workerId = parseInt(subjectID);\n validateIntake();\n }\n}", "function notice(id, msg) {\n if (document.getElementById(id).checked) {\n window.alert(msg);\n }\n}", "isCheck (king) {\n\t\treturn this.getCheckingPieces(king).length !== 0;\n\t}", "function toggle_household_income() {\n var selected = _form_marital_status.find(':selected').val();\n\n // 0 = not married \n if (selected == 0) { \n _form_household_income\n .closest('.onboard-field-wrapper')\n .addClass('disabled');\n _form_individual_income\n .closest('.onboard-field-wrapper')\n .removeClass('disabled');\n } \n\n // 1 = married\n else { \n _form_individual_income\n .closest('.onboard-field-wrapper')\n .addClass('disabled');\n _form_household_income\n .closest('.onboard-field-wrapper')\n .removeClass('disabled');\n }\n }", "function validateCheck() {\n\t\tif ($('input[type=checkbox]:checked').length <= 0) {\n\t\t\t$('#alert_check').text('Please select atleast one interest ');\n\t\t\tsetTimeout(function () {\n\t\t\t\t$('#alert_check').text('');\n\t\t\t}, 7000);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "function isRowSelectedForAppointment(){\n var radiosDonation = document.getElementsByClassName(\"appointRadios\");\n for(var i = 0; i<radiosDonation.length;i++){\n if(radiosDonation[i].type === \"radio\" && radiosDonation[i].checked){\n return true;\n }\n\n }\n return false;\n}", "function check(answer) {\n\tswitch (type) {\n\t\tcase TYPE_READING:\n\t\t\treturn true;\n\t\tcase TYPE_CHOOSE:\n\t\t\treturn document.getElementById(\"cardEnglish\").checked ? answer === japanese[idx] : answer === english[idx];\n\t\tdefault:\n\t\t\treturn answer === english[idx];\n\t}\n}", "renderInterests() {\n const interestItems = interests.map((interest) => {\n if (this.state.interests.includes(interest)) {\n return (\n <TouchableOpacity style={styles.checked} key={interest} onPress={() => { this.handleInterest(interest); }}>\n <Text style={styles.interestText}>{interest}</Text>\n </TouchableOpacity>\n );\n } else {\n return (\n <TouchableOpacity style={styles.unchecked} key={interest} onPress={() => { this.handleInterest(interest); }}>\n <Text style={styles.interestText}>{interest}</Text>\n </TouchableOpacity>\n );\n }\n });\n return (\n <View style={styles.interests}>\n {interestItems}\n </View>\n );\n }", "function isAnySelected() {\n if (selectedAssessment == null) {\n console.log(\"isAnySelected returned false\");\n return false;\n }\n return true;\n\n\n}", "function isDonationRowSelected(){\n var radiosDonation = document.getElementsByClassName(\"selectionRadios\");\n for(var i = 0; i<radiosDonation.length;i++){\n if(radiosDonation[i].type === \"radio\" && radiosDonation[i].checked){\n return true;\n }\n\n }\n return false;\n}", "function isChecked0 (buttonFunction, valueAdjust){\n let isChecked = buttonFunction.target.checked;\n if(isChecked) {\n value += valueAdjust\n calcTotal();\n } else {\n value -= valueAdjust\n calcTotal();\n }\n}", "function sample2_3_2() {\n var element = document.getElementById('checkbox');\n var checked = element.checked;\n console.log(checked);\n}", "function isChecked($chkbx) {\n return $chkbx.is(':checked');\n}", "function checked() {\r\n var cbx = popup.find(\"#markallrecipients\");\r\n return cbx.prop('checked');\r\n }", "function clickHandler () {\n if(document.getElementById('excellent').checked) {\n EbillAmount();\n }\n else if(document.getElementById('good').checked){\n GbillAmount();\n\n }\n else if(document.getElementById('average').checked){\n AbillAmount();\n }\n else if(document.getElementById('bad').checked){\n BbillAmount();\n } \n}", "function validateactivity () {\n for (var i = 0; i < checkboxes.length; i++) {\n if (checkboxes[i].checked) {\n return true;\n } \n }\n}", "wants() {\n return this.yesElement.prop('checked');\n }", "function CheckBox_GetUserInputChanges()\n{\n\t//default result\n\tvar result = null;\n\t//we have input\n\tif (this.InterpreterObject.HasUserInput)\n\t{\n\t\t//get it\n\t\tresult = new Array({ Property: __NEMESIS_PROPERTY_CHECKED, Value: this.InterpreterObject.Properties[__NEMESIS_PROPERTY_CHECKED] });\n\t}\n\t//return the result\n\treturn result;\n}", "function changeBool(element) {\r\n if (element.undergraduate == 1) {\r\n element.undergraduate = \"Yes\"\r\n } else {\r\n element.undergraduate = \"No\"\r\n }\r\n }", "function setLoseContestant(current) {\n// cleanRadios();\n $(current).attr('checked', 'true');\n $.each($(\"#gradingTableBody\").find('tr'), function (key, value) {\n var win = $($(value).find('td')[1]).find('input');\n var lose = $($(value).find('td')[3]).find('input');\n if (!($(win).is(\":checked\"))) {\n $(lose).attr('checked', true);\n }\n });\n}" ]
[ "0.63409495", "0.6039327", "0.59244394", "0.59244394", "0.5739927", "0.57265437", "0.5707265", "0.5700423", "0.5676368", "0.56758946", "0.56711775", "0.5646167", "0.5592462", "0.5574645", "0.55585474", "0.55336857", "0.54885525", "0.5485758", "0.54471666", "0.5441228", "0.5437534", "0.543267", "0.54282737", "0.54276484", "0.5414452", "0.53890395", "0.5378716", "0.5327061", "0.5295421", "0.5291982", "0.528111", "0.52725834", "0.5262852", "0.5260856", "0.52545613", "0.5248937", "0.5246031", "0.5243162", "0.52412045", "0.52368176", "0.5234017", "0.523065", "0.52292633", "0.522508", "0.5219521", "0.5218752", "0.5211062", "0.5209576", "0.52069986", "0.52029896", "0.5196154", "0.519453", "0.51914865", "0.51889235", "0.51886684", "0.5185362", "0.5181249", "0.51788956", "0.51715636", "0.51659125", "0.51574224", "0.5149337", "0.5140498", "0.513868", "0.51188666", "0.51157737", "0.5115067", "0.51147276", "0.51111346", "0.5108181", "0.51053125", "0.51005816", "0.50925833", "0.50911534", "0.5089083", "0.50757545", "0.5074475", "0.5062979", "0.5060444", "0.50582874", "0.50576276", "0.50467175", "0.5045049", "0.50309545", "0.5028405", "0.5027681", "0.50234646", "0.50229555", "0.50204265", "0.50173384", "0.5014032", "0.50103223", "0.5000507", "0.49957004", "0.49904907", "0.4984776", "0.49682426", "0.49676985", "0.4962839", "0.4962268", "0.49615997" ]
0.0
-1
render display of interests
renderInterests() { const interestItems = interests.map((interest) => { if (this.state.interests.includes(interest)) { return ( <TouchableOpacity style={styles.checked} key={interest} onPress={() => { this.handleInterest(interest); }}> <Text style={styles.interestText}>{interest}</Text> </TouchableOpacity> ); } else { return ( <TouchableOpacity style={styles.unchecked} key={interest} onPress={() => { this.handleInterest(interest); }}> <Text style={styles.interestText}>{interest}</Text> </TouchableOpacity> ); } }); return ( <View style={styles.interests}> {interestItems} </View> ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderInterests(data) {\n if (data) {\n var results = JSON.parse(data);\n\n // Early exit if user hasn't added any favorites\n if (results.length === 0) {\n return '';\n }\n\n function getInterests() {\n var interestsList = [];\n\n results.map(function(interest) {\n // Gets buy / rental price\n function getPrice() {\n if (interest.Prijs.Koopprijs && !interest.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(interest.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }\n\n // Checks if property-area should be included\n function getArea() {\n if (interest.Perceeloppervlakte) {\n return interest.Woonoppervlakte + 'm² / ' + interest.Perceeloppervlakte + 'm² • ' + interest.AantalKamers + ' kamers';\n } else {\n return interest.Woonoppervlakte + 'm² • ' + interest.AantalKamers + ' kamers';\n }\n }\n\n // Checks if the house is for sale or for rent\n function getType() {\n if (interest.Koopprijs && !interest.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }\n\n // Pushes DOM-structure to interestsList\n interestsList.push([\n '<li>',\n '<img src=\"' + interest.FotoLarge + '\" alt=\"Foto van ' + interest.Adres + '\">',\n '<a href=\"/favorites/add/' + getType() + '/' + interest.Id + '\" class=\"fav-label\"></a>',\n '<h3>',\n '<a data-id=\"' + interest.Id + '\" href=\"/detail/' + getType() + '/' + interest.Id + '\">' + interest.Adres + '</a>',\n '</h3>',\n '<p>' + interest.Postcode + ', ' + interest.Woonplaats + '</p>',\n '<p>' + getPrice() + '</p>',\n '<p>' + getArea() + '</p>',\n '<span>' + interest.AangebodenSindsTekst + '</span>',\n '</li>'\n ].join('\\n'));\n });\n\n return interestsList.join('\\n');\n }\n\n return [\n '<ul id=\"interests\" class=\"result-list\">',\n getInterests(),\n '</ul>',\n ].join('\\n');\n }\n}", "render() {\n return(\n <div className=\"interests\">\n <h1>Interests</h1>\n </div>\n )\n }", "function renderInfo() {\n /** Get state */\n if (!wave.getState()) {\n return;\n }\n var state = wave.getState();\n \n /** Retrieve topics */\n var topics = toObject(state.get('topics','[]'));\n var votes = toObject(state.get('votes','[]'));\n \n /** Add topics to the canvas */\n var html = \"\";\n for (var i = 0; i < topics.length; i++){\n var id = \"topic\"+i;\n html += '<div class=\"topic\"><h4> ' + topics[i] + '</h4></div>';\n }\n document.getElementById('body').innerHTML = html;\n \n /** Create \"Add topic\" button to the footer */\n html += '<input type=\"text\" id=\"textBox\" value=\"\"/><button id=\"addInput\" onclick=\"addInput()\">Add Topic</button>';\n document.getElementById('footer').innerHTML = html;\n \n /** Adjust window size dynamically */\n gadgets.window.adjustHeight();\n}", "render () {\n return (\n <p>\n My academic work was completed at the University of Utah in the Atmospheric Sciences. <br /> \n <br />\n As a Research Associate at MesoWest, I endeavored on large-scale validation of instrumentation for NASA, the GSLO<sub>3</sub>S research campaign, and deployed and maintained a network of surface weather stations.\n {/* TODO! Modal of research posters for all projects!!! */}\n <br /> <br />\n I also undertook a research project with Professor Emeritus Dave Whiteman where we quantified the pollutants transported by fog in Persistant Cold Air Pool events. <br /> \n </p>\n )\n }", "function renderRanking() {\n var context = { artists: rankingData };\n var tpt = window[\"JST\"][\"templates/ranking.hbs\"];\n var html = tpt(context);\n $(\"#ranking\").html(html);\n }", "function renderInfo(data){\n\n console.log(data);\n\n //display title\n title.innerHTML = data.name;\n\n //display image\n image.src = data.image.url;\n image.alt=\"Image not found\";\n \n //display favourite\n if(favList!==null && favList.includes(id)){\n fav.innerHTML = '<i id=\"heart-icon\" class=\"fas fa-heart\"></i>';\n }\n else{\n fav.innerHTML = '<i id=\"heart-icon\" class=\"far fa-heart\"></i>';\n }\n\n //display powerstats\n for(var i in data.powerstats){\n document.getElementById(i).innerHTML = data.powerstats[i];\n }\n\n //display biography\n for(var i in data.biography){\n document.getElementById(i).innerHTML = data.biography[i];\n }\n\n //display appearance\n for(var i in data.appearance){\n document.getElementById(i).innerHTML = data.appearance[i];\n }\n\n //display work\n for(var i in data.work){\n document.getElementById(i).innerHTML = data.work[i];\n }\n\n //display connections\n for(var i in data.connections){\n document.getElementById(i).innerHTML = data.connections[i];\n }\n}", "function render() {\n res.render('socList', {\n title: 'Sentinel Project: SOC Manager',\n socs: socs,\n datapoints: resultsDatapoints\n });\n }", "function displayWork() {\n $(\"#workExperience\").append(HTMLworkStart);\n for (key in work.work){\n if (work.work.hasOwnProperty(key)) {\n var employerHTML = HTMLworkEmployer.replace(\"%data%\", work.work[key].employer);\n $(\".work-entry:last\").append(employerHTML);\n\n var titleHTML = HTMLworkTitle.replace(\"%data%\", work.work[key].title);\n $(\"a:last\").append(titleHTML);\n\n var datesHTML = HTMLworkDates.replace(\"%data%\", work.work[key].dates);\n $(\".work-entry:last\").append(datesHTML);\n\n var locationHTML = HTMLworkLocation.replace(\"%data%\", work.work\n [key].location);\n $(\".work-entry:last\").append(locationHTML);\n\n var descriptionHTML = HTMLworkDescription.replace(\"%data%\", work.work\n [key].description);\n $(\".work-entry:last\").append(descriptionHTML);\n }\n }\n\n}", "displayBio(data){\n \n this.ui.userBioContainer.innerHTML=`\n <div class=\"bio text-center\">\n <img src=\"${data.authorImage}\" alt=\"Image Placeholder\" class=\"img-fluid mb-5\" style=\"height:150px;width:150px;border-radius:50%;\">\n <div class=\"bio-body\">\n <h2>${data.authorName}</h2>\n <p class=\"mb-4\">${data.authorBio}</p>\n \n <p class=\"social\">\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-facebook\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-twitter\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-instagram\"></span></a>\n <a href=\"#\" class=\"p-2\"><span class=\"fa fa-youtube-play\"></span></a>\n </p>\n </div>\n </div>\n `\n }", "function displayWork() {\n\tfor (job in work.jobs) {\n\t\t//create new div for work experience\n\t\t$(\"workExperience\").append(HTMLworkStart);\n\t\t// concat employer and title\n\t\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\t\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job])\n\t}\n}", "render(){\n\t\treturn (\n\n\t\t\t<div className='projectdisplay'>\n\t\t\t\t{this.props.projects.map((project,i) => {return(\n\t\t\t\t\t\t<IndividualProject key={i} project={project} interestfn={this.props.interestfn}/>\n\t\t\t\t\t)}\n\t\t\t\t)}\n\t\t\t</div>)\n\t}", "function displayWork(){\n //Evalution of bio.skills and append of skills\n if(bio.skills.lenght != 0){\n $(\"#header\").append(HTMLskillsStart);\n var i= 0;\n while(i<bio.skills.length){\n $(\"#skills\").append(HTMLskills.replace(\"%data%\",bio.skills[i]));\n i++;\n }\n //Evaluation and append of jobs in work (Bucle for with iterator)\n for(job in work.jobs){\n $(\"#workExperience\").append(HTMLworkStart);\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\",work.jobs[job].employer);\n if ( work.jobs[job].url.length > 5){\n var formattedEmployer = formattedEmployer.replace(\"#\",work.jobs[job].url);\n }\n var formattedTitle = HTMLworkTitle.replace(\"%data%\",work.jobs[job].title);\n var formatEmployerTitle = formattedEmployer+ formattedTitle ;\n $(\".work-entry:last\").append(formatEmployerTitle);\n var formattedDates = HTMLworkDates.replace(\"%data%\",work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n var formattedDescription = HTMLworkDescription.replace(\"%data%\",work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n\n\n }\n }\n}", "renderPage() {\n return (\n <Container className='content'>\n <Header as=\"h2\" textAlign=\"center\">User Page</Header>\n <Button floated=\"right\" color='blue'>Edit Page</Button>\n <Header as=\"h2\">EMAIL:<a>{this.props.currentUser}</a></Header>\n <Header as=\"h2\">Interests:</Header>\n <Segment>\n <List>\n <Label tag>\n { this.props.interests.map(interest => interest.interests + ', ')}\n </Label>\n </List>\n </Segment>\n <Header as=\"h2\" color='red'>News:</Header>\n <Message compact>\n <Icon className='alarm outline'/>\n New clubs have been added to the list. Check it Out!\n </Message>\n </Container>\n );\n }", "function showItineraryInfo(){\n\tif(directionsDisplay){\n\t\tvar html = '';\n\t\thtml += '<div id=\"intinerary\"><ul>Your Itinerary:';\n\t\tvar letter = 'A';\n\t\tfor(var i=0;i<itinerary.length;i++){\n\t\t\thtml += '<li>'+letter+': '+results[itinerary[i]].name+'</li>';\n\t\t\tletter = String.fromCharCode(letter.charCodeAt(0) + 1);\n\t\t}\n\t\thtml += '</ul></div>';\n\t\t\n\t\titineraryContainer.innerHTML = html;\n\t\tdirectionsDisplay.setPanel(document.getElementById('intinerary'));\n\t}\n}", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "renderReview() {\n if (this.props.data.results) {\n this.props.data.results.map((review, index) => {\n return (\n <div key={index}>\n <div className=\"stars\">{this.ratingStars(this.props.data.count)}</div>\n <div>{this.provedUser(review.reviewer_name)}</div>\n <div>{this.renderSummary(review.summary)}</div>\n <div>{this.renderBody(review.body)}</div>\n <div>{this.renderRecommend(review.recommend, review.helpfulness)}</div>\n </div>\n );\n });\n } else {\n return <div className=\"numRev\">fetching data ...</div>;\n }\n }", "function display_toys() {\n \n }// displays toys in the interface", "function outPutDATAtoHTML() {\n let displayResult = STATE.searchResult.map(singleRest => {\n return `<div class=\"col-12\">\n <div class=\"col text-color\">\n <p>Name: ${singleRest.name} </p>\n <p>Address: ${singleRest.address}</p>\n <p> Price Range <img class=\"raiting-size\" src=\"images/dollar.png\" alt=\"Price rating\"> ${\n singleRest.priceRange\n } </p>\n <p>Rating <img class=\"raiting-size\" src=\"images/star.png\" alt=\"Restaurant rating\"> ${\n singleRest.ratings\n }</p>\n </div>\n <hr>\n </div>`;\n });\n \n $(\"#show-search-result\").html(displayResult);\n }", "function renderResults(data, favorites, interests) {\n if (data) {\n var results = JSON.parse(data);\n\n // Will contain the DOM-structure of every result\n var resultList = [];\n\n results.map(function(result) {\n // Gets buy / rental price\n function getPrice() {\n if (result.Prijs.Koopprijs && !result.Prijs.Huurprijs) {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Koopprijs) + ' <abbr title=\"Kosten Koper\">k.k.</abbr></strong>';\n } else {\n return '<strong>€ ' + numberWithPeriods(result.Prijs.Huurprijs) + ' <abbr title=\"Per maand\">/mnd</abbr></strong>';\n }\n }\n\n // Checks if property-area should be included\n function getArea() {\n if (result.Perceeloppervlakte) {\n return result.Woonoppervlakte + 'm² / ' + result.Perceeloppervlakte + 'm² • ' + result.AantalKamers + ' kamers';\n } else {\n return result.Woonoppervlakte + 'm² • ' + result.AantalKamers + ' kamers';\n }\n }\n\n // Checks if the house is for sale or for rent\n function getType() {\n if (result.Koopprijs && !result.Huurprijs) {\n return 'koop';\n } else {\n return 'huur';\n }\n }\n\n // Checks whether an item already exists in favorites of user and sets correct reference\n function checkFavorites() {\n if (favorites) {\n // Checks if user has any favorites added, returns 'add' link for each result otherwise\n if (favorites.length) {\n for (var i = 0; i < favorites.length; i++) {\n if (favorites[i].favorite_ID === result.Id) {\n return '<a href=\"/favorites/remove/' + result.Id + '\" class=\"fav-label checked\"></a>';\n }\n if (i === favorites.length - 1) {\n return '<a href=\"/favorites/add/' + getType() + '/' + result.Id + '\" class=\"fav-label\"></a>';\n }\n }\n } else {\n return '<a href=\"/favorites/add/' + getType() + '/' + result.Id + '\" class=\"fav-label\"></a>';\n }\n } else {\n return '<a href=\"/favorites/add/' + getType() + '/' + result.Id + '\" class=\"fav-label\"></a>';\n }\n }\n\n // Pushes DOM-structure to resultList\n resultList.push([\n '<li>',\n '<img src=\"' + result.FotoLarge + '\" alt=\"Foto van ' + result.Adres + '\">',\n checkFavorites(),\n '<h3>',\n '<a data-id=\"' + result.Id + '\" href=\"/detail/' + getType() + '/' + result.Id + '\">' + result.Adres + '</a>',\n '</h3>',\n '<p>' + result.Postcode + ', ' + result.Woonplaats + '</p>',\n '<p>' + getPrice() + '</p>',\n '<p>' + getArea() + '</p>',\n '<span>' + result.AangebodenSindsTekst + '</span>',\n '</li>'\n ].join('\\n')); // join on every new line\n });\n\n // Adds every result together, by joining the HTML on new lines\n var getList = function() {\n return resultList.join('\\n');\n };\n\n // Returns entire result page with results\n return [\n '<section id=\"results\">',\n '<section class=\"btn-block\">',\n '<a href=\"/favorites\">Favorieten</a>',\n '</section>',\n '<h2>Resultaten</h2>',\n renderInterests(interests),\n '<ul id=\"results\" class=\"result-list\">',\n getList(),\n '</ul>',\n '</section>'\n ].join('\\n');\n } else {\n // Returns entire result page without any results\n return [\n '<section id=\"results\">',\n '<section class=\"btn-block\">',\n '<a href=\"/favorites\">Favorieten</a>',\n '</section>',\n '<h2>Resultaten</h2>',\n '<p>',\n 'Er zijn geen resultaten gevonden.',\n '</p>',\n '</section>',\n ].join('\\n');\n }\n}", "renderPage() {\n const interests = _.pluck(Interests.collection.find().fetch(), 'name');\n const interestData = interests.map(interest => getInterestData(interest));\n return (\n <Container id=\"interests-page\">\n <Card.Group>\n {_.map(interestData, (interest, index) => <MakeCard key={index} interest={interest}/>)}\n </Card.Group>\n </Container>\n );\n }", "function displayInterests (zero, one, two, three) {\n console.log(\"* \" + zero);\n console.log(\"* \" + one);\n console.log(\"* \" + two);\n console.log(\"* \" + three);\n console.log(\"\");//adds a blank space\n}", "function displayWork() {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\",\n work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\",\n work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n $(\".work-entry:last\").append(formattedEmployerTitle);\n\n var formattedDates = HTMLworkDates.replace(\"%data%\",\n work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n\n var formattedDescription = HTMLworkDescription.replace(\"%data%\",\n work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "function showRH(i, id){\n rh = `\n ${currentData[i].rh} % de humedad\n `\n document.getElementById(id).innerHTML = rh;\n}", "function displayWork() {\n\nfor (job in work.jobs) {\n\t$(\"#workExperience\").append(HTMLworkStart);\n\n\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\n\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n\n\tvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\n\tvar formattedworkDates = HTMLworkDates.replace (\"%data%\",work.jobs[job].dates);\n\n\tvar formattedworkLocation = HTMLworkLocation.replace (\"%data%\", work.jobs[job].location);\n\n \tvar formattedworkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n\n \t$(\".work-entry:last\").append(formattedworkDates);\n \t$(\".work-entry:last\").append(formattedworkLocation);\n \t$(\".work-entry:last\").append(formattedworkDescription);\n\n\t}\n}", "function render() {\n\n\t\t\t}", "function displayIssueInfo(){\n\t\tvar issue = $(this).attr('data-name');\n\t\tconsole.log(issue);\n\t\t//var user = $('#user-input').val().trim();\n\t\t//var pass = $('#pass-input').val().trim();\n\t\t//var queryURL = \"http://jira/rest/api/2/search?jql=project=GP+order+by+duedate&fields=id,key\";\n\t\t//var url = \"http://jira/rest/api/2/issue/\" + issue;\n\t\tvar queryURL = \"http://jira/rest/api/2/issue/\" + issue;\n\t\tconsole.log(queryURL);\n\t\t// Creates AJAX call for the specific issue being \n\t\t$.ajax({url: queryURL,method: 'GET'}).done(function(response) {\n\n\t\t\t// Creates a generic div to hold the issue\n\t\t\tvar issueDiv = $('<div class=\"issue\">');\n\t\t\tvar issueDiv = $('<div>').attr('class','issue');\n\t\t\tconsole.log(response);\n\t\t\t// Retrieves the Rating Data\n\t\t\t//var rating = response.Rated;\n\n\t\t\t// Creates an element to have the rating displayed\n\t\t\t//var pOne = $('<p>').text( \"Rating: \" + rating);\n\n\t\t\t// Displays the rrating\n\t\t\t//issueDiv.append(pOne);\n\n\t\t\t// Retrieves the release year\n\t\t\t//var released = response.Released;\n\n\t\t\t// Creates an element to hold the release year\n\t\t\t//var pTwo = $('<p>').text( \"Released: \" + released);\n\n\t\t\t// Displays the release year\n\t\t\t//issueDiv.append(pTwo);\n\n\t\t\t// Retrieves the plot\n\t\t\t//var plot = response.Plot;\n\n\t\t\t// Creates an element to hold the plot\n\t\t\t//var pThree = $('<p>').text( \"Plot: \" + plot);\n\n\t\t\t// Appends the plot\n\t\t\t//issueDiv.append(pThree);\n\n\t\t\t// Creates an element to hold the image \n\t\t\t//var image = $('<img>').attr(\"src\", response.Poster);\n\n\t\t\t// Appends the image\n\t\t\t//issueDiv.append(image);\n\n\t\t\t// Puts the entire issue above the previous issues.\n\t\t\t//$('#issuesView').prepend(issueDiv);\n\t\t});\n\n\t}", "function showfinancials(){\n\tfor(var key in object){\n\t\tconsole.log(object[key])\n\t\tstringfinancials = object[key][0]\n\t\tvaluefinancials = object[key][1]\n\t// document.getElementById('header').innerHTML = \"<h3>Summary of Financial Ratios: </h3>\"\n\tdocument.getElementById('financial-show').innerHTML += stringfinancials +\": \" + valuefinancials + \"</br>\" \n\t}\n\t// document.getElementById('financial-show').innerHTML = financialratios\n}", "function displayData(data) {\n var params = { data: data[\"list\"], inviter: userId, isMember: true }; \n \n // @todo Find a way to dynamically pass the soy function\n //$container.find(selector).html(soyTemplate(params));\n $j('#inviter-places-reco').find(\".ispaces\").each(function() {\n $j(this).html(soyTemplate(params));\n } );\n }", "render() {\n \n return (\n <div>\n <h3>\n This is where you can track your check-ins over time. The focus is on your emotional intensity. I hope that this will give you\n some insight into your own patterns. \n </h3>\n </div>\n )\n\n }", "function displayAnn() {\n\tfor (var index = 0; index < annDetails.length; index += 1) {\n\t\tif (annGrade[index] === studentGrade || annGrade[index] === \"allgrades\") {\n\t\t\tif (annGender[index] === studentGender || annGender[index] === \"allgenders\") {\n\t\t\t\tif (annClub[index] === studentClub || annClub[index] === \"allstudents\" || annStudentNumber[index] === studentNumber) {\n\t\t\t\t\tallAnnouncements += \"<h2>\" + annDateTime[index] + \"</h2>\" + \"<h3>\" + annTitle[index] + \"</h3>\" + \"<p>\" + annDetails[index] + \"</p>\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tdocument.getElementById(\"filteredannouncements\").innerHTML = allAnnouncements;\n}", "renderSummary() {\n return ''; // @todo\n }", "function displayHTML(){\n\t\tdom.name.innerHTML = \"1. Name: \"+studentArray[position].name;\n\t\tdom.address.innerHTML = \"2. Address: \"+studentArray[position].street+\n\t\t\", \"+studentArray[position].city+\n\t\t\", \"+studentArray[position].state;\n\t\tdom.grades.innerHTML = \"3. Grades: \"+studentArray[position].grades;\n\t\tdom.date.innerHTML = \"4. Date: \"+studentArray[position].getDate();\n\t\tdom.gpaAvg.innerHTML = \"5. Average GPA: \"+studentArray[position].getAverage(studentArray[position].grades).toFixed(2);\n\t}//close displayHTML function", "displayHTML() {\n return `<p>Name: ${this.name}</p>\n <p>Email: ${this.email}</p>\n <p>Phone: ${this.phone}</p>\n <p>Relation: ${this.relation}</p>`;\n }", "function showPerson(){\n const item = reviews[currentItem]\n img.src = item.img\n author.textContent = item.name\n job.textContent = item.job\n info.textContent = item.text\n}", "function claims_ui_display(gift) {\n\t$(\"#splitTable\").html(\"\");\n\tgift.claims.forEach(function(claim) {\n\t\tvar claimRow = create_ui_element(\"tr\", \"claim_row_\" + claim._id, \"claim_row\");\n\n\t\tvar claimNameCell = create_ui_element(\"td\", \"claim_name_cell_\" + claim._id, \"claim_cell\");\n\t\tvar claimEmailCell = create_ui_element(\"td\", \"claim_email_cell_\" + claim._id, \"claim_cell\");\n\t\tvar claimPercentageCell = create_ui_element(\"td\", \"claim_percentage_cell_\" + claim._id, \"claim_cell\");\n\n\t\tvar claimName = create_ui_element(\"div\", \"claim_name_\" + claim._id, \" claim_info\")[0];\n\t\tvar claimEmail = create_ui_element(\"div\", \"claim_email_\" + claim._id, \" claim_info\")[0];\n\t\tvar claimPercentage = create_ui_element(\"div\", \"claim_percentage_\" + claim._id, \" claim_info\")[0];\n\n\t\tclaimName.innerHTML = claim.claimant.firstName;\n\t\tclaimEmail.innerHTML = claim.claimant.email;\n\t\tclaimPercentage.innerHTML = claim.percentage+\"%\";\n\n\t\tclaimNameCell.append(claimName);\n\t\tclaimEmailCell.append(claimEmail);\n\t\tclaimPercentageCell.append(claimPercentage);\n\n\t\tclaimRow.append(claimNameCell);\n\t\tclaimRow.append(claimEmailCell);\n\t\tclaimRow.append(claimPercentageCell);\n\n\t\t$(\"#splitTable\").append(claimRow);\n\t});\n}", "function displayEntry(idx) { \n var entry = \"<div class=\\\"todo_title\\\">\" + this.title + \"</div>\\n\"\n + \"<div class=\\\"todo_date\\\">\" + this.date + \"</div>\\n\";\n // TODO: display category\n \n var content = \"<div class=\\\"todo_content\\\">\" + this.content + \"</div>\\n\";\n // TODO: display the different elements in the content list as unordered list.\n\n return entry + content;\n}", "function displayObservation(obs) {\n hdl.innerHTML = obs.hdl;\n ldl.innerHTML = obs.ldl;\n sys.innerHTML = obs.sys;\n dia.innerHTML = obs.dia;\n\n // ==================== !! Here need some change ==================\n height.innerHTML = obs.height;\n weight.innerHTML = obs.weight;\n}", "displayAllStudents() {\n\t\t$(\"#displayArea\").empty();\n\t\tvar studentDetails = Object.keys(this.data);\n\t\t//console.log(\"data\", studentDetails);\n\t\t\n\t\tfor(var key in this.data){\n\t\t\n\t\t\t$(\"#displayArea\").append(this.data[key].render());\n\t\t\t\t\n\t\t}\n\t\tthis.displayAverage();\n\n\t}", "function visualizeResults(){\r\n\r\n if(results.length == 0) $('#results_research').html(no_results_string);\r\n else{\r\n\r\n var color;\r\n $('#results_research').html('');\r\n template_home ='';\r\n results.forEach(function(res, index){\r\n color = res.Compatibility < 35? 'red': res.Compatibility < 68? '#FFCC00': 'green';\r\n $('#results_research').append(\r\n \"<div id=' \"+ res.Nickname + \"' class='businesscard' style ='border: 5px dotted \" + color + \"'>\"+\r\n \"<table class='tabellainformazioni'>\"+\r\n \"<tr>\"+\r\n \"<th>NickName :</th><td>\"+ res.Nickname + \"</td>\"+\r\n \"</tr>\"+\r\n \"<tr><th>Anno di nascita :</th><td>\" + res.Year + \"</td>\"+\r\n \"</tr>\"+\r\n \"<tr>\"+\r\n \"<th>Provincia :</th><td>\" + res.Province + \"</td>\"+\r\n \"</tr>\"+\r\n \"<tr>\"+\r\n \"<th colspan='2'>Interessi in comune :</th>\"+\r\n \"</tr>\"+\r\n \"<td>\"+ res.CommonInterests +\"</td>\"+\r\n \"</table>\"+\r\n \"<div class = 'tabellaazioni'>\"+\r\n \"<div style = 'background-color:\" + color + \" 'class = 'compability'>\" + res.Compatibility + \"%</div>\"+\r\n \"<input type='button' value='Invia un messaggio' class='btn btn-secondary' id='inviomessaggio' onclick = 'send( \" + index + \")'>\"+\r\n \"<input type = 'button' class='open_profile_btn btn btn-primary' id='apriprofilo' value='Visualizza profilo' onclick = 'openProfile( \" + index + \")'>\"+\r\n \"</div>\"+\r\n \"</div>\"\r\n );\r\n //\"<div style = 'background-color:\" + color + \" 'class = 'compability'>\" + res.Compatibility + \"%</div><p><input type='button' value='Invia un messaggio' class='btn btn-secondary' id='inviomessaggio' onclick = 'send( \" + index + \")'><input type = 'button' class='open_profile_btn btn btn-primary' id='apriprofilo' value='Visualizza profilo' onclick = 'openProfile( \" + index + \")'></p></div>\" );\r\n });\r\n }\r\n}", "function display(hits_out) {\n var htmlStr = \"\";\n htmlStr += \"<article class='result'>\";\n htmlStr += \"<p>The variable you selected is present in the dataset:</p>\";\n htmlStr += \"<h2>\" + hits_out[0].datasetName + \"</h2>\";\n htmlStr += \"<span class='result-label'>External dataset URL: </span> <a href='\" + hits_out[0].datasetUrl + \"'>\" + hits_out[0].datasetUrl + \"</a> <hr />\";\n htmlStr += \"<p><span class='result-label'>Publishing organization :</span>\" + hits_out[0].org + \"</p>\";\n htmlStr += \"<p><span class='result-label'>Tags :</span>\";\n if (hits_out[0].tagList != null) {\n\tfor(var jj = 0; jj < hits_out[0].tagList.length; jj++) {\n\t htmlStr += \"<span> \" + hits_out[0].tagList[jj] + \"&nbsp;&nbsp; </span>\"\n\t}\n }\n htmlStr += \"</p>\";\n htmlStr += \"<p><span class='result-label'>Available formats :</span>\";\n if (hits_out[0].formatList != null) {\n\tfor(var jj = 0; jj < hits_out[0].formatList.length; jj++) {\n htmlStr += \"<span> \" + hits_out[0].formatList[jj] + \"&nbsp;&nbsp; </span>\"\n\t}\n }\n htmlStr += \"</p>\";\n htmlStr += \"<p><span class='result-label'>Access dataset files directly from the following links:</span>\"\n if (hits_out[0].urlList != null) {\n\tfor(var jj = 0; jj < hits_out[0].urlList.length; jj++) {\n htmlStr += \"<div> <a href='\" + hits_out[0].urlList[jj] + \"'>\" + hits_out[0].urlList[jj] + \"&nbsp;&nbsp; </a></div>\"\n\t}\n }\n htmlStr += \"</p>\";\n htmlStr += \"</article>\";\n htmlStr += \"<article class='result'>\";\n htmlStr += \"<p><span class='result-label'>All variables in this dataset (count = \" + hits_out.length + \"):</span></p>\";\n for(var ii = 0; ii < hits_out.length; ii++ ) {\n htmlStr += hits_out[ii].name + \"<br />\"; \n }\n htmlStr += \"</article>\";\n $(\".results\").html(htmlStr);\n}", "function displaySelected() {\n console.log(\"response text\", this.responseText);\n var response = JSON.parse( this.responseText );\n console.log( response );\n\n // DOM final results\n var displayAt = document.querySelector('#show-detail');\n\n var title = document.createElement(\"h1\");\n title.innerHTML = response.name;\n displayAt.appendChild(title);\n\n var image = document.createElement(\"img\");\n image.src = response.image.medium;\n displayAt.appendChild(image);\n\n var summary = document.createElement(\"p\");\n summary.innerHTML = response.summary;\n displayAt.appendChild(summary);\n\n}", "function render() {\n remember();\n\n main.innerHTML = tweets.map((tweet, idx) => {\n return `\n <aside>\n <div>\n <img class=\"avatar\" src=\"${tweet.avatar}\">\n </div>\n <div class=\"formatted-tweet\">\n <h6><a href=\"https://twitter.com/${tweet.username}\">${tweet.name}</a> <span class=\"username\">@${tweet.username}</span></h6>\n <p>${tweet.tweet}</p>\n <div class=\"imgGifPoll\">\n ${tweet.isPollCreated ? displayVotes(tweet, idx) : tweet.img }\n </div>\n <div>\n <section>\n <div id=\"reactions\" class=\"btn-group mr-2\">\n <button\n type=\"button\"\n class=\"btn btn-secondary mdi mdi-message-outline\"\n aria-label=\"reply\"\n ></button>\n <button\n type=\"button\"\n class=\"btn btn-secondary mdi mdi-twitter-retweet\"\n aria-label=\"retweet\"\n ></button>\n <button\n type=\"button\"\n class=\"btn btn-secondary mdi mdi-heart-outline\"\n aria-label=\"like\"\n style=\"\"\n ></button>\n <button\n type=\"button\"\n class=\"btn btn-secondary mdi mdi-upload\"\n aria-label=\"share\"\n ></button>\n </div>\n </section>\n </div>\n </div>\n </aside>\n `;\n }).join('');\n}", "displayInfo() {\n let imageContainer = document.querySelector(\"#image-container\");\n let thumbnailEl = document.createElement(\"img\");\n thumbnailEl.setAttribute(\"src\", this.thumbnailImg)\n imageContainer.append(thumbnailEl);\n let artistNameDiv = document.querySelector(\"#artist-name\");\n artistNameDiv.textContent = this.name;\n let artistInfoDiv = document.querySelector(\"#profile-info\");\n artistInfoDiv.textContent = this.profileInfo;\n\n }", "function show_race(race) {\n let name = \"<h2><u>\" + race.name + \"</u></h2>\";\n let desc = race.desc === \"\" ? \"\" : \"<b>Desc:</b> \" + race.desc;\n let str_bonus = race.str_bonus === 0 ? \"\" : \"<b>STR Bonus:</b> \" + race.str_bonus + \"</br>\";\n let dex_bonus = race.dex_bonus === 0 ? \"\" : \"<b>DEX Bonus:</b> \" + race.dex_bonus + \"</br>\";\n let int_bonus = race.int_bonus === 0 ? \"\" : \"<b>INT Bonus:</b> \" + race.int_bonus + \"</br>\";\n let con_bonus = race.con_bonus === 0 ? \"\" : \"<b>CON Bonus:</b> \" + race.con_bonus + \"</br>\";\n let wis_bonus = race.wis_bonus === 0 ? \"\" : \"<b>WIS Bonus:</b> \" + race.wis_bonus + \"</br>\";\n let cha_bonus = race.cha_bonus === 0 ? \"\" : \"<b>CHA Bonus:</b> \" + race.cha_bonus + \"</br>\";\n let size = race.size === 0 ? \"<b>Size:</b> Medium<br/>\" : \"<b>Size:</b> Small<br/>\"\n let saves = race.save_array.length === 0 ? \"\" : \"<b>Saves:</b> \" + show_list(race.save_array) + \"<br/>\";\n let profs = race.prof_array.length === 0 ? \"\" : \"<b>Profs:</b> \" + show_list(race.prof_array) + \"<br/>\";\n let weapon_profs = race.weapon_prof_array.length === 0? \"\" : \"<b>Weapons:</b> \" + show_list(race.weapon_prof_array) + \"<br/>\";\n let armor_profs = race.armor_prof_array.length === 0 ? \"\" : \"<b>Armors:</b> \" + show_list(race.armor_prof_array) + \"<br/>\";\n return name\n + desc\n + str_bonus\n + int_bonus\n + dex_bonus\n + con_bonus\n + wis_bonus\n + cha_bonus\n + size\n + saves\n + profs\n + weapon_profs\n + armor_profs;\n}", "render() {\n\n if (this.props.type === \"general\") {\n return (\n <table className='RankingEntry'>\n <tr>\n <td className='columnRanking1'>\n <img src={require('./assets/icon.png')} alt='Icon.' />\n </td>\n <td className='columnRanking2'>\n <p>NAME</p>\n </td>\n <td className='columnRanking3'>\n <p>SCORE</p>\n </td>\n </tr>\n </table>\n )\n } else {\n //TODO\n return (\n <table className='RankingEntryPersonal'>\n <tr>\n <td className='columnRanking1'>\n <img src={require('./assets/icon.png')} alt='Icon.' />\n </td>\n <td className='columnRanking2'>\n <p>MY NAME</p>\n </td>\n <td className='columnRanking3'>\n <p>SCORE</p>\n </td>\n </tr>\n </table>\n )\n }\n\n }", "function display(json) {\n //create a html string\n html = '<table cellspacing =5 cellpadding=5 >';\n\t\n \n\t// for each object in json\n for(var i in json) {\n\t \n\t\t//html += '<th>Path'\n\t\thtml += '<b>****Path ****</b>'\n\t\t//html += j\n\t\thtml += ''\n\t\t//html += '</th>'\n\t\titem = json[i];\n\t\thtml += '<br/>'\n\t\tfor (k in item) {\n\t\t// item2 = item[j];\n\t\t \n\t\t html += item[k]\n\t\t html += '<br/>'\n\t\t \n\t\t }\n\t\t html += '<p/>'\n // html += toRow(item);\n\t //}\n\t\t\n }\n html += '</table>';\n\t//add it to the 'search-results' div\n $('#search-results').html(html);\n}", "function render() {\n let html = '';\n\n if (STORE.quizStarted === false) {\n $('main').html(displayStartScreen());\n return;\n }\n else if (STORE.questionNumber >= 0 && STORE.questionNumber < STORE.questions.length) {\n html = displayQuestNumAndScore();\n html += displayQuestion();\n $('main').html(html);\n }\n else {\n $('main').html(displayResults());\n }\n }", "function displayModelInfo() {\n numberReactionsDisplay.innerHTML = \"Number of Reactions: \" + currentReactionNumber;\n}", "displayDrinkWithIngredients(drinks){\n // Show the Results\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // Insert the Results\n const resultsDiv = document.querySelector('#results');\n // loop through the Drinks\n drinks.forEach( drink => {\n // Build The Template\n resultsDiv.innerHTML += `\n <div class=\"col-md-6\">\n <div class=\"card my-3\">\n <button type=\"button\" data-id=\"${drink.idDrink}\" class=\"favorite-btn btn btn-outline-info \">\n +\n </button>\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\" >\n \n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink} </h2>\n <p class=\"card-text font-weight-bold\"> Instrucions :\n \n </p>\n <p class=\"card-text\">\n ${drink.strInstructions}\n </p>\n <p class=\"card-text\">\n <ul class=\"list-group\">\n <li class=\"list-group-item alert alert-danger\">Ingerdients</li>\n\n ${this.displayIngredients(drink)}\n\n\n </ul>\n\n </p>\n <p class=\"card-text font-weight-bold\"> Extra Information : </p>\n <p class=\"card-text\">\n <span class=\"badge badge-pill badge-success\">\n ${drink.strAlcoholic}\n </span>\n <span class=\"badge badge-pill badge-warning\">\n Category : ${drink.strCategory}\n </span>\n </p>\n\n </div>\n </div>\n </div>\n \n `;\n });\n this.isFavorite();\n }", "render() {\n\n\t\treturn (\n\t\t\t\n\t\t\t<div className=\"UserRecipes\">\n\t\t\t\t<h4>Your Recipes:</h4>\n\t\t\t\t<table>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<th>Name</th>\n\t\t\t\t\t\t<th>Status</th>\n\t\t\t\t\t\t<th>Views</th>\n\t\t\t\t\t\t<th>Comments</th>\n\t\t\t\t\t\t<th>Recommendations</th>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Name...</td>\n\t\t\t\t\t\t<td>Published (<a href=\"#\">Change Status</a>)</td>\n\t\t\t\t\t\t<td>50</td>\n\t\t\t\t\t\t<td>2</td>\n\t\t\t\t\t\t<td>1</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Fdsa...</td>\n\t\t\t\t\t\t<td>Unpublished (<a href=\"#\">Change Status</a>)</td>\n\t\t\t\t\t\t<td>12</td>\n\t\t\t\t\t\t<td>0</td>\n\t\t\t\t\t\t<td>0</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>Asdf...</td>\n\t\t\t\t\t\t<td>Published (<a href=\"#\">Change Status</a>)</td>\n\t\t\t\t\t\t<td>100</td>\n\t\t\t\t\t\t<td>20</td>\n\t\t\t\t\t\t<td>12</td>\n\t\t\t\t\t</tr>\n\t\t\t\t</table>\n\t\t\t</div>\n\t\t)\n\t}", "function displayObservation(obs) {\n\t \n sys.innerHTML = obs.sys;\n dia.innerHTML = obs.dia;\n glucose.innerHTML = obs.glucose;\n a1c.innerHTML = obs.a1c;\n fastp.innerHTML = obs.fastp;\n hdl.innerHTML = obs.hdl;\n ldl.innerHTML = obs.ldl;\n cholesterol.innerHTML = obs.cholesterol;\n tri.innerHTML = obs.triglycerides;\n}", "function render(){\n let bookmarks = [...STORE.bookmarks];\n // filter bookmark list\n if(STORE.searhTerm){\n bookmarks = bookmarks\n .filter(bookmark => bookmark.rating >= STORE.searhTerm);\n }\n const bookmarkString = generateHtmlString(bookmarks);\n console.log(bookmarks);\n // render html elements\n $('.js-container').html(bookmarkString);\n }", "function InfoDisplayer(props){\n const loggedIn = props.loggedIn;\n const types = props.types;\n const data = props.data;\n const imageDisplay =data.image ? <div key={data.image+\"a\"}><img src= {data.image} style={{width: 200}}/></div> : null\n const info = (types.map((type, index) => <NameDisplayer key={type} loggedIn={loggedIn} item={data[type]+ \" \"} simple={index}/>));\n return (\n <div>\n <div>{[imageDisplay].concat(info)}</div></div>\n )\n}", "function displayNotes(note){\n return `<p>title: ${note.title}</p><p style=\"display:none\">note: ${note.body}</p>`\n }", "function _drawResults() {\n let songs = store.State.songs;\n console.log(songs);\n let template = \"\";\n songs.forEach(song => (template += song.Template));\n document.getElementById(\"search-results\").innerHTML = template;\n}", "function displayInfo(){\n \n\n fill(255);\n var lifeExpValue = lifeExp[int(inp.value())];\n var countryNameValue = countryNames[int(inp.value())];\n \n push();\n \n textSize(76);\n textAlign(CENTER);\n fill(255);\n stroke(0);\n strokeWeight(3);\n \n text(`${lifeExpValue}`, width/4 + 75, height/2 + 150);\n text(`${countryNameValue}`, width/4 + 75, height/2 + 250);\n \n pop();\n \n}", "showHTML() { \n return `\n <div class='showRecipes'>\n <div>\n <h3>${this.recipeTitle}</h3> \n </div> \n <div>\n ${'Time: ' + this.recipeTime}\n </div>\n <div>\n ${this.recipeIngredients}\n </div>\n <div>\n ${this.recipeAllergies}</li>\n </div>\n </div>`\n }", "function display()\n{\n nameDisp.textContent= name;\n scoreDisp.textContent= score;\n lifeDisp.textContent= life;\n missileDisp.textContent= missile;\n levelDisp.textContent= level;\n}", "function render(toy){\n let collection = document.getElementbyId('toy-collection')\n\n let card = document.createElemenet('div')\n card.innerHTML +=\n `<div class= 'card'\n <h2>${toy.name}</h2>\n <image src= ${toy.image} class='toy-avatar' />\n <p>'${toy.likes} Likes'</p>\n <button class= 'like-btn'> 'Like <3' </button>\n </div>`\n\n collection..appendChild(card)\n }", "function pageDisplay(iteration) {\n // save the info from this iteration in the appendages array\n var title = appendages[iteration].title;\n var intro = appendages[iteration].intro;\n var link = appendages[iteration].link;\n var video = decodeURI(appendages[iteration].video);\n\n // format the info\n var titleText = $('<h4>').text(title);\n var introText = $('<p>').text(intro);\n var wikiLink = $('<a>').text(\"Click here for more info\")\n .addClass('wiki-link')\n .attr('target', '_blank')\n .attr('href', link);\n var videoDiv = $('<div>').append(video)\n .addClass(\"embed-container\");\n\n // append it all to the proper divs\n $('#wikiSpot').empty().append(titleText, introText, wikiLink);\n $('#videoSpot').empty().append(videoDiv);\n}", "function renderResults(result){\n\tif(result.snoothrank>0){\n\t\t\t\treturn `\n\t\t<div class=\"col-4\">\n\t\t\t<div class=\"resultBorder\">\n\t\t\t<a href=\"${result.link}\" target=\"_blank\">\n\t\t\t\t<img class=\"wineImg\" src=\"${result.image.replace('https','http')}\" alt=\"image of ${result.name}\">\n\t\t\t</a>\n\t\t\t<a href=\"${result.link}\" target=\"_blank\">\n\t\t\t\t<p class=\"wineName\">${result.name}</p>\n\t\t\t</a>\n\t\t\t<p>Region: ${result.region}</p>\n\t\t\t<p>Type: ${result.type}</p>\n\t\t\t<p>Price: $ ${result.price}</p>\n\t\t\t<p>Snooth Rating: ${result.snoothrank}/5</p>\n\t\t\t</div>\n\t\t</div>\n\t`\n\t\t\t}else {\n\t\t\t\treturn `\n\t\t<div class=\"col-4\">\n\t\t\t<div class=\"resultBorder\">\n\t\t\t<a href=\"${result.link}\" target=\"_blank\">\n\t\t\t\t<img class=\"wineImg\" src=\"${result.image.replace('https','http')}\" alt=\"image of ${result.name}\">\n\t\t\t</a>\n\t\t\t<a href=\"${result.link}\" target=\"_blank\">\n\t\t\t\t<p class=\"wineName\">${result.name}</p>\n\t\t\t</a>\n\t\t\t<p>Region: ${result.region}</p>\n\t\t\t<p>Type: ${result.type}</p>\n\t\t\t<p>Price: $ ${result.price}</p>\n\t\t\t<p>Snooth Rating: N/A</p>\n\t\t\t</div>\n\t\t</div>\n\t`\n\t\t\t}\n}", "display(){\n this.htmlBuilder.build();\n this.displayCityName();\n this.displayTodayWeather();\n this.displayWeekWeather();\n this.displayTimeSlots();\n }", "render() {\n return (\n <div className=\"cards datacards\">\n <div>\n <i className=\"fa fa-gavel fa-3x\"></i>\n <p>\n Supreme Court ideology data (1937 - 2015) from the University of Michigan can be viewed \n <a href=\"https://www.kaggle.com/umichigan/court-justices\"> here</a>.\n </p>\n </div>\n <div>\n <i className=\"fa fa-university fa-3x\"></i>\n <p>\n Voter Registration data from the WA Secretary of State can be\n viewed <a href=\"https://www.sos.wa.gov/elections/research/data-and-statistics.aspx\">here </a>\n under \"Voter Participation\".\n </p>\n </div>\n </div>\n );\n }", "function _render() {\n DOM.$p\n .empty()\n .text(`People: ${people.length}`)\n .appendTo(DOM.$stats);\n }", "function displayExercise(exerciseStructure) {\n editorDisplay.innerHTML = `\n <div class=\"display--exercise\">\n ${exerciseStructure}\n </div>\n `;\n}", "function renderObservationPage() {\n const observationId = location.hash.split(\"observations/\")[1];\n // get one observation\n const observation = Model.get_observation(parseInt(observationId));\n const userId = observation.participant;\n loadPage(\"observation-details\", {\n observation: Model.get_observation(parseInt(observationId)),\n user: Model.get_user(parseInt(userId)),\n });\n}", "display() {\n \t\tfor (let key in this.ticket) {\n \t\t\tconsole.log(key + ' : ' + this.ticket[key] + this.currency);\n \t\t}\n }", "function displayItems() {\r\n \r\n scoreTable\r\n .read() // Read the results\r\n .then(addHighestScoreHandler, handleError);\r\n }", "function displayResults(responseObj){\n\t// console.log(\"calling inside displayResults\" , responseObj);\n\t\n\tconst works = responseObj.GoodreadsResponse.search.results.work;\n\tdocument.getElementById(\"results\").innerHTML = \"\";\n\t// console.log(works)\n\t works.forEach(function(work){\n\t \t\n\t \tconst author = work.best_book.author.name[\"#text\"]\n\t \tconst title = work.best_book.title[\"#text\"]\n\t \tconst imgUrl = work.best_book.image_url[\"#text\"]\n\t \tconsole.log(title, author, imgUrl)\n\t \t\n\t \tconst myListItem = document.createElement(\"li\");\n\t \tconst image = document.createElement(\"img\")\n\t \timage.setAttribute(\"src\" , imgUrl)\n\t \t\n\t \n\t \tmyListItem.innerHTML = title + \"by\" + author;\n\t \tdocument.getElementById(\"results\").appendChild(myListItem)\n \t \t\n\t \t// console.log(work)\n\t\t\n\t })\n\n\t\n\n}", "function displayInfo(theSculpture) {\n var theName = theSculpture.name;\n var theDesc = theSculpture.description;\n var theYear = theSculpture.year;\n document.getElementById(\"location-container\").getElementsByTagName('h3')[0].innerHTML = theName;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[0].innerHTML = theYear;\n document.getElementById(\"location-container\").getElementsByTagName(\"p\")[1].innerHTML = theDesc;\n document.getElementById(\"location-container\").style.display = \"block\";\n}", "render() {\n // If we have no articles, we will return this.renderEmpty() which in turn returns some HTML\n if (!this.state.savedArticles) {\n return this.renderEmpty();\n }\n // If we have articles, return this.renderContainer() which in turn returns all saves articles\n return this.renderContainer();\n }", "display() {\n for (let i = 0; i < this.data.stock.length; i++) {\n console.log(i + 1 + \". \" + this.data.stock[i].corporation);\n }\n }", "function render() {\n\t\t\t}", "displayDrinksWithIngredients(drinks){\n\n // show the results field\n const resultsWrapper = document.querySelector('.results-wrapper');\n resultsWrapper.style.display = 'block';\n\n // insert the results\n const resultsDiv = document.querySelector('#results');\n\n drinks.forEach(drink => {\n resultsDiv.innerHTML += `\n <div class=\"col-md-6\">\n <div class=\"card my-3\">\n\n <img class=\"card-img-top\" src=\"${drink.strDrinkThumb}\" alt=\"${drink.strDrink}\">\n\n <div class=\"card-body\">\n <h2 class=\"card-title text-center\">${drink.strDrink}</h2>\n <p class=\"card-text font-weight-bold\">Instructions: </p>\n <p class=\"card-text\">\n ${drink.strInstructions}\n </p>\n <p class=\"card-text\">\n <ul class=\"list-group\">\n <li class=\"list-group-item alert alert-danger\">Ingredients</li>\n ${this.displayIngredients(drink)}\n </ul>\n </p>\n <p class=\"card-text font-weight-bold\">Extra Information:</p>\n <p class=\"card-text\">\n <span class=\"badge badge-pill badge-success\">\n ${drink.strAlcoholic}\n </span>\n <span class=\"badge badge-pill badge-warning\">\n Category: ${drink.strCategory}\n </span>\n </p>\n </div>\n </div>\n </div>\n `;\n })\n }", "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "function showHighScoreContent() {\n if (highscoreData.highscores == undefined) {\n p5HTMLElements.push(createP('No Highscores to view here'));\n p5HTMLElements[p5HTMLElements.length - 1].position(view.options.x2 / 2 + 50, view.options.y + 100);\n return;\n }\n highscoreData.highscores.reverse();\n var tableContent = '<tr><th>Name</th><th>Score</th></tr>';\n for (var i = 0; i < highscoreData.highscores.length; i++) {\n tableContent += '<tr><td>' + highscoreData.highscores[i].name + '</td><td>' + highscoreData.highscores[i].score + '</td></tr>';\n }\n highscoreData.highscores.reverse();\n p5HTMLElements.push(createElement('table', tableContent));\n var highscoresTable = p5HTMLElements[p5HTMLElements.length - 1];\n highscoresTable.position(view.options.x + 10, view.options.y + 50);\n highscoresTable.size(view.options.x2 - 20, highscoresTable.size().height);\n}", "function showPerson(){\n const item = story[currentItem];\n text.textContent = item.text;\n heading.textContent = item.heading;\n}", "function displayOkitJson() {\n // $(jqId(JSON_MODEL_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonModel, null, 2) + '</code></pre>');\n // $(jqId(JSON_VIEW_PANEL)).html('<pre><code>' + JSON.stringify(okitJsonView, null, 2) + '</code></pre>');\n // $(jqId(JSON_REGION_PANEL)).html('<pre><code>' + JSON.stringify(regionOkitJson, null, 2) + '</code></pre>');\n}", "function displayData()\n\t{\n\t\t// Clear old search results\n\t\t$searchResults.html('');\n\n\t\t// Loop through search results\n\t\tsearchResults.forEach(function(track)\n\t\t{\n\t\t\t// Missing track cover?\n\t\t\tif(track.cover === null)\n\t\t\t{\n\t\t\t\t// Yes, set default image as track cover\n\t\t\t\ttrack.cover = \"images/cover-default.svg\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\ttrack.cover = track.cover.replace(\"large\", \"crop\");\n\t\t\t}\n\n\t\t\t// Create HTML element to display\n\t\t\tvar songHTML = \n\t\t\t`\n\t\t\t\t<div id=\"${track.id}\" class=\"col-sm-6 col-md-3 song-block\">\n\t\t\t\t\t<div class=\"song\">\n\t\t\t\t\t\t<div class=\"cover-blur\"></div>\n\t\t\t\t\t\t<div class=\"content\">\n\t\t\t\t\t\t\t<div class=\"cover-block\">\n\t\t\t\t\t\t\t\t<img class=\"cover-hover\" src=\"images/play.svg\">\n\t\t\t\t\t\t\t\t<img class=\"cover\" src=\"${track.cover}\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<h2 class=\"song-title\">${track.title}</h2>\n\t\t\t\t\t\t\t<div class=\"user\">\n\t\t\t\t\t\t\t\t<img class=\"avatar\" src=\"${track.userAvatar}\">\n\t\t\t\t\t\t\t\t<h3 class=\"username\">${track.username}</h3>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div> \n\t\t\t\t</div>\n\t\t\t`;\n\n\t\t\t// Add HTML element to search results\n\t\t\t$searchResults.append(songHTML);\n\t\t});\n\n\t\t// Set height = width (prevents crazy resolutions from throwing off layout)\n\t\tvar coverHeight = $('.cover').width();\n\t\t$('.cover').height(coverHeight);\n\t}", "function render() {\n //empty existing posts from view\n $nationalparks.empty();\n\n //pass 'allParks' into template function\n var parksHtml = getAllNationalparksHtml(allParks);\n\n //append html to view\n $nationalparks.append(parksHtml);\n}", "function show() {\n best.html(population.pop[0].genes);\n averageFitness.html(population.averageFitness);\n generationNum.html(gNum);\n phrases.html(\"\");\n\n var phrs = \"\";\n\n for (let i = 1; i < population.pop.length && i < nPhrases.val(); i++) {\n phrs += '<span>' + population.pop[i].genes.join(\"\") + '</span>';\n }\n\n phrases.html(phrs);\n }", "function displayExperiment(data){\n\n\t$('#msform').addClass('hidden');\n\t//checks to see if experiment is complete\n\tif (data.status === ' Complete') {\n\t\t$('#edit').addClass('hidden');\n\t\t$('#dme').addClass('hidden');\n\t};\n\n\n\t$('.title').text(data.title);\n\t$('.author').text(data.author);\n\t$('.created').text(data.created);\n\t$('.background').text(data.background);\n\t$('.purpose').text(data.purpose);\n\t$('.procedure').text(data.procedure);\n\t$('.mce').html(data.results.text);\n\n\tif(data.results.drawing.length >= 0){\n\t\t$(\"<img>\", {\n\t \t\"src\":data.results.drawing,\n\t \t// added `width` , `height` properties to `img` attributes\n\t \t\"width\": \"250px\", \"height\": \"250px\"})\n\t\t.appendTo(\".drawing\");\n\n\t} else {\n\t\t$('.drawing').text('No images Drawn');\n\t};\n\n\t$('.molecule').text(data.results.molecule);\n\t$('.conclusion').html(data.conclusion);\n\t$('.id').text(data.id);\n}", "renderSummaryDetails() {\n\t\tlet imageSection = null;\n\t\tif (this.state.currentSidewalk.lastImage) {\n\t\t\timageSection = (\n\t\t\t\t<div className=\"drawerImageSection\">\n\t\t\t\t\t<img className=\"img-responsive\" alt=\"sidewalk-preview\" src={this.state.currentSidewalk.lastImage.url} />\n\t\t\t\t</div>\n\t\t\t)\n\t\t} else {\n\t\t\timageSection = <h4>There are no uploaded images for this sidewalk.</h4>;\n\t\t}\n\n\t\tlet velocityText;\n\t\tif (this.state.currentSidewalk.averageVelocity > 0) {\n\t\t\tvelocityText = `The average pedestrian velocity on this sidewalk is ${this.state.currentSidewalk.averageVelocity} metres per second.;`;\n\t\t} else {\n\t\t\tvelocityText = \"No data has been recorded for the average pedestrian velocity of this sidewalk.\";\n\t\t}\n\t\t\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<h3 className=\"streetNameSection\">\n\t\t\t\t\t{this.state.address}\n\t\t\t\t</h3>\n\t\t\t\t<hr />\n\t\t\t\t\t{imageSection}\n\t\t\t\t<hr />\n\t\t\t\t<h5>\n\t\t\t\t\t{velocityText}\n\t\t\t\t\t<div>\n\t\t\t\t\t\t{this.state.isLoggedIn && this.state.sidewalkHasCSVData && <CSVLink data={this.state.sidewalkCsvFormatted}>\n\t\t\t\t\t\t\t<Button bsStyle=\"primary\" className=\"sidewalkCsvButton\">\n\t\t\t\t\t\t\t\tExport CSV\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t</CSVLink>}\n\t\t\t\t\t</div>\n\t\t\t\t</h5>\n\t\t\t</div>\n\t\t);\n\t}", "function displayWork() {\n\n for(job in work.jobs){\n $(\"#workExperience\").append(HTMLworkStart); \n //create new div for Work sektion\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n $(\".work-entry:last\").append(formattedEmployerTitle);\n var formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n var formattedLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location);\n $(\".work-entry:last\").append(formattedLocation);\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n }", "function render() {\n $insert.html(template(bandObject)); //inserts into template, in {{#each this}} it is THIS\n }", "function showGoonies(){\n var result = \"\"; \n \n for(var i = 0; i < goonies.records.length; i++){\n \n result += \"<p><b>Name: </b>\" + goonies.records[i].firstName + \" \" + goonies.records[i].lastName + \", <b>Phone: </b>\" + goonies.records[i].cell + \"</p>\";\n }\n document.getElementById(\"div_goonies\").innerHTML = result;\n}", "function displayIGT(corp_id, igt_id) {\n $('#editor-panel').html(ajax_loader_big());\n url = appRoot()+'/display/'+corp_id+'/'+igt_id+'?user='+userID();\n $.ajax({\n url: url,\n success: displaySuccess,\n error: displayError,\n contentType : \"json\"\n });\n}", "function render() {\n var bodVal = tBody.val(); // Raw article markup\n var m = marked(bodVal); // Convert markup to html\n\n // Render article preview (rendered HTML)\n pMarkOut.html(m);\n //3. Finds each <pre><code> tag in the pMarkOut jQuery element\n pMarkOut.find('pre code').each(function(i, block) {\n //4. Applies highlighting to each block it finds. Returns an object with language, relevance, value (HTML string), and top properties; value HTML string is then rendered in the DOM\n hljs.highlightBlock(block); // Syntax-highlight each code block \"in place\"\n });\n\n pHrawOut.text(m); // Draw raw HTML\n\n // Update JSON article\n //5a. Use dot notation to assign the articleBody key a value of m, (the markup converted to HTML in line 10); user sees entered markup rendered as HTML\n mObj.articleBody = m;\n //5b. Populate the #pJson element's text with the JSON version of the mObj object. Stringify converts mObj from a javascript object to JSON format which the user can now see.\n var jsonStr = pJson.text(JSON.stringify(mObj));\n }", "function qdisplay() {\n\t\t$('#main').html(\"<p>\" + test[count].b + \"</p>\");\n\t\tconsole.log(\"test[count].b\" + test[count].b)\n\t}", "function displayCelebs() {\n\t\t// Display an error message if error code is not 410 or 200 (okay)\n\t\tif (this.status != 200 && this.status != 410) {\n\t\t\tdisplayError();\n\t\t}\n\t\tvar data = JSON.parse(this.responseText);\n\t\t// Display each actor\n\t\tfor (var i = 0; i < data.actors.length; i++) {\n\t\t\tdisplayActor(data.actors[i]);\n\t\t}\n\t\t// Hide loading icon when completed\n\t\tdocument.getElementById(\"loadingcelebs\").style.display = \"none\";\n\t}", "function displayInfo(code) {\n const dataName = nationsData.find(country => country.alpha3Code === code);\n document.querySelector(\"#flag img\").src = dataName.flag;\n document.querySelector(\"#flag img\").alt = `Flag of ${dataName.name}`;\n document.getElementById(\"capital\").innerHTML = dataName.capital;\n document.getElementById(\"population\").innerHTML = dataName.population.toLocaleString(\"en-US\");\n document.getElementById(\"languages\").innerHTML = dataName.languages.filter(c => c.name).map(c => `${c.name}`).join(\", \");\n document.getElementById(\"currencies\").innerHTML = dataName.currencies.filter(c => c.name).map(c => `${c.name} (${c.code})`).join(\", \");\n\n}", "function display(hashmap, name, index, context) {\r\n\r\n Word.run(function (context) {\r\n\r\n // Mettez en file d'attente une commande pour obtenir la selection actuelle, puis\r\n // creez un objet de plage proxy avec les resultats.\r\n var body = context.document.body;\r\n context.load(body, 'text');\r\n\r\n console.log(\"Name to display : \" + hashmap[name][index]);\r\n\r\n var bdate = new Date(hashmap[name][index][6] + 'T10:20:30Z');\r\n bdate = calculateAge(bdate);\r\n\r\n $('#politicians').append(\r\n '<div class=\"panel panel-default\" id=\"panel' + counter.i + '\">\\\r\n <div class=\"panel-heading\">\\\r\n <a data-toggle=\"collapse\" data-target=\"#collapse'+ counter.i + '\">\\\r\n <h4 class=\"panel-title\">' + hashmap[name][index][4] + \" \" + hashmap[name][index][5] + '</h4>\\\r\n </a>\\\r\n </div>\\\r\n <div id=\"collapse'+ counter.i + '\" class=\"panel-collapse collapse \">\\\r\n <div class=\"panel-body\">\\\r\n <div class=\"row\">\\\r\n <div class=\"col-xs-2\" id=\"photo\"> <i class=\"material-icons md-60\">face</i> </div>\\\r\n <div class=\"col-xs-10\">\\\r\n <div class=\"row\"> ' + hashmap[name][index][8] + '</div>\\\r\n <div class=\"row\"> ' + hashmap[name][index][2] + '</div>\\\r\n <div class=\"row\"> ' + hashmap[name][index][7] + '</div>\\\r\n <div class=\"row\"> ' + bdate + ' years old' + '</div>\\\r\n <div class=\"row\"> <a href=\"http://www.wecitizens.be\">More on Wecitizens.be</a> </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\\r\n </div>\\ '\r\n );\r\n\t\t\t\tcounter.i++;\r\n })\r\n }", "function _drawResults() {\n let template = ''\n let results = store.State.songs\n results.forEach(song => template += song.Template)\n document.querySelector(\"#songs\").innerHTML = template\n}", "function displayWork() {\n\nfor(job in work.jobs){\n\n$(\"#workExperience\").append(HTMLworkStart);\n\nvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\nvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\nvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n$(\".work-entry:last\").append(formattedEmployerTitle);\n\nvar formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n$(\".work-entry:last\").append(formattedDates);\n\nvar formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n$(\".work-entry:last\").append(formattedDescription);\n\n};\n\n}", "function displayInfo(element) {\n const container = document.getElementById('container');\n const divInfo = createAndAppend('div', container, {\n id: 'leftSide',\n class: 'left-div whiteframe',\n });\n // Table info\n createAndAppend('table', divInfo, { id: 'table' });\n const table = document.getElementById('table');\n createAndAppend('tbody', table, { id: 'tbody' });\n function createTableRow(label, description) {\n const tableR = createAndAppend('tr', table);\n createAndAppend('td', tableR, { text: label, class: 'label' });\n createAndAppend('td', tableR, { text: description });\n }\n\n createTableRow('Repository: ', element.name);\n createTableRow('Description: ', element.description);\n createTableRow('Forks : ', element.forks);\n const newDate = new Date(element.updated_at).toLocaleString();\n createTableRow('Updated: ', newDate);\n }", "function displaySkills(myArray) {\r\n\tfor(var i = 0; i < myArray.length; i++) {\r\n\t\tget(\"skill\" + i).innerHTML = myArray[i];\r\n\t\tget(\"skill\" + i).style.display = \"block\";\r\n\t}\r\n}", "function showPerson() {\n $('body').find('.name').text(\"Name: \" + muArray[number].name);\n $('body').find('.git').text(\"github: \" + muArray[number].git_username);\n $('body').find('.shoutout').text(\"Shoutout: \" + muArray[number].shoutout);\n }", "function showCareers(id) {\n //var careersJSON = document.getElementById(\"careersJSON\");\n var trHTML;\n Traitify.getCareers(id).then(function(data){\n //careersJSON.innerHTML = codePretty(data);\n trHTML = '<table class=\"table\">';\n trHTML += '<tr><td colspan=\"2\"><strong>Career Options<strong></td></tr>';\n console.log(data);\n for(var i=0; i<data.length; i++){\n trHTML += '<tr><td align=\"center\"><strong><id = \"careertitle\">' + data[i].career.title + '</id><strong><br><img src=\"'+ data[i].career.picture +'\"></td>';\n trHTML += '<td><id = \"score\">Score: ' + Math.round(data[i].score * 100) / 100 + '</id><br><br><id = \"description\">' + data[i].career.description + '</id><br><br><i>College Major Choices:</i> ';\n\n for(var j=0; j<data[i].career.majors.length; j++){\n trHTML += data[i].career.majors[j].title + ' ';\n }\n trHTML += '<br><br><id=\"traits\"> Personality Traits: ';\n for(var k=0; k<data[i].career.personality_traits.length; k++){\n trHTML += data[i].career.personality_traits[k].personality_trait.name + ', ';\n }\n trHTML += '</id>';\n\n trHTML += '<br><br><i>Salary Mean:</i> $' + numberWithCommas(data[i].career.salary_projection.annual_salary_mean) +'';\n\n trHTML += '</td></tr>';\n }\n trHTML += '</table>';\n var careersJSON = document.getElementById(\"careersJSON\");\n careersJSON.innerHTML = trHTML;\n });\n}", "function displayNotesDetails(note){\n return `<p>title: ${note.title}</p><p style=\"display:block\">note: ${note.body}</p>`\n }", "function render() {\n let html = '';\n\n if (questionnaire.quizStarted === false) {\n $('main').html(generateStartButton());\n \n return;\n } else if (\n questionnaire.currentQuestion >= 0 &&\n questionnaire.currentQuestion < questionnaire.questions.length\n ) {\n $(\"header\").css({ \"margin-top\": \"50px\" });\n \n html = printQuiz();\n html += printQuestion();\n $('main').html(html);\n } \n \n \n else {\n \n \n $('main').html(generateResultsScreen());\n \n \n }\n}", "function displayEntities() {\n // clear the preview div\n $(\"#previewDiv\").empty();\n // dispaly each entity in the entities list\n for (var i = 0; i < entities.length; i++) {\n displayEntity(entities[i]);\n }\n}" ]
[ "0.7195199", "0.63879454", "0.6261766", "0.62493545", "0.62136143", "0.60883844", "0.60799474", "0.60360473", "0.6021716", "0.60103846", "0.5989388", "0.59637976", "0.59454286", "0.5902918", "0.5887821", "0.58539325", "0.58304095", "0.58293194", "0.58273584", "0.5824763", "0.5802885", "0.57697207", "0.5747895", "0.57215405", "0.5713134", "0.5710357", "0.5709104", "0.57076156", "0.5704718", "0.5699495", "0.5698455", "0.56907266", "0.5684388", "0.56772935", "0.56697947", "0.5668496", "0.5661194", "0.56574064", "0.565689", "0.56478924", "0.5646945", "0.5645364", "0.5639641", "0.563555", "0.5635072", "0.56299335", "0.5623837", "0.56223685", "0.5614905", "0.56088156", "0.5607899", "0.5603265", "0.5599577", "0.5599513", "0.5596236", "0.55914265", "0.5590024", "0.5588288", "0.55881137", "0.5586397", "0.5582758", "0.55766183", "0.5566013", "0.5553003", "0.55526245", "0.5552481", "0.5552283", "0.554987", "0.554916", "0.5548563", "0.5547968", "0.55474085", "0.55457014", "0.5540733", "0.5539703", "0.55268824", "0.55264866", "0.5525303", "0.5519243", "0.5516747", "0.55057776", "0.5505297", "0.5502335", "0.5499663", "0.5499216", "0.54983145", "0.5497517", "0.54967797", "0.5489947", "0.54870033", "0.54859775", "0.5485661", "0.5483736", "0.54834086", "0.5480687", "0.5480518", "0.5478858", "0.5478748", "0.54786503", "0.5474115", "0.5468472" ]
0.0
-1
render list of profile options
renderImage(item) { if (this.state.profile === item) { return ( <TouchableOpacity key={item} onPress={(event) => { this.handleImage(item); }}> <Image style={styles.checkedImage} source={item} /> </TouchableOpacity> ); } else { return ( <TouchableOpacity key={item} onPress={(event) => { this.handleImage(item); }}> <Image style={styles.uncheckedImage} source={item} /> </TouchableOpacity> ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function load_options() {\n\n\tvar profiles = get_profiles();\n\n\tvar t = $.template('<tr><td rowspan=\"2\">${name}</td><td>Live:</td><td>${live}</td><td rowspan=\"2\"><button type=\"button\" class=\"btnDeleteProfile\" data-index=\"${index}\">Del</button></td></tr><tr><td>Dev:</td><td>${dev}</td></tr>');\n\tfor (var i in profiles)\n\t{\n\t\tvar profile = profiles[i];\n\t\tprofile.index = i;\n\t\t$('#profilesrows').append(t, profile);\n\t}\n}", "static displayProfiles() {\n const profiles = Store.getProfilesFromLocalStorage();\n profiles.forEach(profile => {\n const ui = new UI();\n ui.addProfileToList(profile)\n })\n }", "renderProfiles () {\n const profiles = phoneTap.getProfiles(people)\n\n for (let i = 0; profiles.length > i; i++) {\n const profileTemplate = profile(profiles[i])\n const profileModule = document.getElementById('profile-wrapper')\n profileModule.insertAdjacentHTML('beforeend', profileTemplate)\n }\n }", "function generateStatOptionsString() {\n for (let arr in statList) {\n let full = statList[arr][0];\n statOptionsString += `<option>${full}</option>`;\n }\n}", "function renderOption() {\n const userTerritoryList = JSON.parse(localStorage.getItem('userTerritoryList'));\n return userTerritoryList.map((item) => {\n return (\n <Option value={item.id} key={item.id}>\n {item.name}\n </Option>\n );\n });\n }", "render() {\n const { profiles, loading } = this.props.profiles;\n let profileItems;\n \n // if profiles is null, our loading component will be returned via profileItems\n if (profiles === null || loading ) {\n profileItems = <Spinner />;\n } else {\n \n /* if the length of profiles received is more than 0, our profileItems variable\n will map through an array to access its properties, and return that array, \n then we choose what properties to display via the profile parameter */\n if (profiles.length > 0) {\n profileItems = profiles.map( (profile, index) => \n <div key= {index} onClick = { () => this.selectUsers(profile.id) } >\n <ProfilesWrapper>\n <WrappedDiv>\n <p className = 'property-title'> Username: </p>\n <p className = 'property-content'> {profile.username ? profile.username : <Deleted />}</p>\n </WrappedDiv>\n <WrappedDiv>\n <p className = 'property-title'> Status: </p>\n <p className = 'property-content'> {profile.status}</p>\n </WrappedDiv>\n </ProfilesWrapper>\n </div>)\n } else {\n profileItems = <h4>No profiles found...</h4>;\n }\n }\n \n return (\n <div className = 'ProfileWrapper'>\n <ProfilesTitle> PROFILES </ProfilesTitle>\n {profileItems}\n </div>\n );\n }", "function renderpropertyList(options) {\n propertyList.children().not(\":last\").remove();\n propertyContainer.children(\".alert\").remove();\n if (options.length) {\n console.log(options);\n propertyList.prepend(options);\n }\n else {\n renderEmpty();\n }\n }", "function displayUsers() {\n usersPlaceholder = \"\";\n\n for (i = 0; i < users.length; ++i) {\n usersPlaceholder += `\n <option id=\"${i}\" onclick=\"addUp(event)\" value=\"${users[i].firstName}\">${users[i].firstName} ${users[i].lastName}</option>\n `;\n }\n document.getElementById(\"usersList\").innerHTML = usersPlaceholder;\n}", "function displayProfiles() {\r\n let store = browser.storage.local.get({\r\n profiles: []\r\n });\r\n store.then(function(results) {\r\n var profiles = results.profiles;\r\n\r\n for (var i = 0; i < profiles.length; i++) {\r\n addProfileToAList(profiles[i]);\r\n }\r\n });\r\n}", "static splash_screen_tutorial_options_html(){\n let result = \"\"\n let labels = persistent_get(\"splash_screen_tutorial_labels\") //might have checkmarks in them.\n for(let name_and_tooltip of this.splash_screen_tutorial_names_and_tooltips){\n let name = name_and_tooltip[0]\n let label = null\n for(let a_label of labels) {\n if(a_label.endsWith(name)){\n label = a_label //might have a checkmark\n break;\n }\n }\n if(!label) { label = \"&nbsp;&nbsp;&nbsp;\" + name } //default is no checkmark\n result += \"<option class='splash_screen_item' \" +\n \"title='\" + name_and_tooltip[1] +\n \"' style='cursor:pointer;'>\" +\n label + \"</option>\\n\"\n }\n return result\n }", "function render(profilesArr) {\n const toyTemplates = profilesArr.map((profile) => getToyTemplates(profile)).join('');\n toys.insertAdjacentHTML('beforeend', toyTemplates);\n $('.profile').append(`<a href=\"/profile\" class=\"btn btn-outline-primary btn-rounded btn-md mr-lg-2\">my profile</a>`);\n}", "render() {\n\t\treturn `\n\t\t\t<div id=\"toolbar\" class=\"box\">\n\t\t\t\t${this.optionAll.render()}\n\t\t\t\t${this.options.map((option)=>{\n\t\t\t\t\treturn this['option'+option.id].render()\n\t\t\t\t}).join('')}\n\t\t\t</div>\n\t\t`;\n\t}", "renderFilterOptions(){\n\n\t\tvar self = this;\n\n\t\tlet arr = this.attributes.filters;\n\n\t\tfor (var key in arr) {\n\n\t\t\tif(!arr[key]['active']){\n\t\t\t\t var li = \n\t\t \t`<li data-filter=\"${key}\" data-type=\"${arr[key]['type']}\"><a href=\"#\" class=\"`+this.getClassOrIdName(this.styles.filter_option)+`\">${key}<span class=\"`+this.getClassOrIdName(this.styles.input_list_value)+`\"></span></a></li>`;\n\n\t\t \t$(self.styles.filters_list).append(li);\n\t\t\t}\t\t\t \n\t\t\t\t\n\t\t}\n\t}", "function updateProfileList(templateId) {\n\t\n\t// If the placeholder has been selected\n\tif(templateId == \"NONE\") {\n\t\t$('#profiles').html('<h6 class=\"infotext\">Profiles for the currently selected template will appear here.</h6>');\n\t\treturn;\n\t}\n\t\n\t// Now do a database lookup for profile names for this template.\n\t$(\"#profiles-loading\").show();\n\t$.ajax({\n method: 'get',\n url: '/tempss/api/profile/' + templateId + '/names',\n dataType: 'json',\n success: function(data){\n \tlog('Profile name data received from server: ' + data.profile_names);\n \tif(data.profile_names.length > 0) {\n\t \tvar htmlString = \"\";\n\t \tfor(var i = 0; i < data.profile_names.length; i++) {\n\t \t\tvar profileVisibilityIcon = \"\";\n\t \t\tif(data.profile_names[i].public == true) {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-user text-success no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Public profile\"></span>';\n\t \t\t}\n\t \t\telse {\n\t \t\t\tprofileVisibilityIcon += '<span class=\"profile-type glyphicon glyphicon-lock text-danger no-pointer\" data-toggle=\"tooltip\" data-placement=\"left\" title=\"Private profile\"></span>';\n\t \t\t}\n\t \t\thtmlString += '<div class=\"profile-item\">' + \n\t \t\t profileVisibilityIcon +\n\t \t\t '<a class=\"profile-link\" href=\"#\"' + \n\t \t\t\t'data-pid=\"'+ data.profile_names[i].name + '\">' + data.profile_names[i].name +\n\t \t\t\t'</a><div style=\"float: right;\">';\n\t \t\t\tif(data.profile_names[i].owner) {\n\t \t\t\t\thtmlString += '<span class=\"glyphicon glyphicon-remove-sign delete-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Delete profile\"></span>';\n\t \t\t\t}\n\t \t\t\telse {\n\t \t\t\t\thtmlString += '<span></span>';\n\t \t\t\t}\n\t \t\t\t\n\t \t\t\thtmlString += '<span class=\"glyphicon glyphicon-floppy-save load-profile\" aria-hidden=\"true\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"Load profile into template\"></span>' +\n\t \t\t\t'</div></div>\\n';\n\t \t}\n\t \t$('#profiles').html(htmlString);\n\t \t$('.profile-item span[data-toggle=\"tooltip\"]').tooltip();\n \t}\n \telse {\n \t\t// If no profiles are available\n \t\t$('#profiles').html('<h6 class=\"infotext\">There are no profiles registered for the \"' + templateId + '\" template.</h6>');\n \t}\n $(\"#profiles-loading\").hide(0);\n },\n error: function() {\n $(\"#profiles-loading\").hide(0);\n $('#profiles').html('<h6 class=\"infotext\">Unable to get profiles for the \"' + templateId + '\" template.</h6>');\n }\n });\n}", "_register_view_options() {\n let current_renderers = renderers.getInstance();\n for (let name in current_renderers) {\n const display_name = current_renderers[name].name || name;\n const opt = `<option value=\"${name}\">${display_name}</option>`;\n this._vis_selector.innerHTML += opt;\n }\n }", "availablePPSProfiles(data, index) {\n let profiles=data.getObjectAt(index).profiles.map(function(profile){\n profile.value = profile.profile_name\n // profile.label = <div key={profile.profile_name} className=\"pps-list-available-profile\">\n // <div className=\"profile-name\">{profile.profile_name}</div>\n // {profile.applied && <div className=\"applied-status\">V</div>}</div>\n\n profile.label =profile.profile_name\n return profile\n })\n\n\n return profiles\n}", "async function showProfiles() {\n const userId = localStorage.getItem('currentAccount');\n const profiles = await util.getProfilesByUserAccount(userId);\n\n await profiles.forEach(createProfileElement);\n}", "function render(state) {\n var profiles = state.get('profiles');\n\n function li(profile) {\n return h('li', [\n h('.u-pull-right', [\n h('a', {href: 'http://twitter.com/' + profile.twitter }, ['@' + profile.twitter ]),\n h('span', ' | '),\n h('a', {href: 'http://github.com/' + profile.github }, 'github: ' + profile.github )\n ]),\n h('a', { href: '/profiles/' + profile._id + '/show' }, profile.name)\n\n ]);\n }\n\n return h('div', [\n h('.row', [\n h('form', { action:'/search', method: 'POST'}, [\n h('.five.columns', [\n h('input.u-full-width', {type: 'text', name: 'q', value: ''}),\n ]),\n h('.two.columns', [\n h('input.button.button-primary', { type: 'submit', value: 'Search' } )\n ]),\n h('.four.columns', [\n h('a.button.button-primary', { href: '/profiles/new'}, ['New Profile'])\n ])\n ])\n ]),\n \n h('.row', [\n h('.twelve.columns', [\n h('ul', profiles.map(li))\n ])\n ])\n ])\n}", "function displayProfiles(profiles) {\n member = profiles.values[0];\n console.log(member.emailAddress);\n $(\"#name\").val(member.emailAddress);\n $(\"#mail\").val(member.emailAddress);\n $(\"#pass\").val(member.id);\n apiregister(member.emailAddress,member.id);\n }", "async function getProfie() {\n var tagline = await getTagline();\n var country = await getCountry();\n var profile = await getUrl();\n var featured = await getImages();\n res.render('pages/userProfile', {\n username: uname,\n icon: icon,\n tagline: tagline,\n country: country,\n link: profile,\n featured: featured,\n currentUser: currentUser\n });\n }", "renderOptions() {\n return this.props.data.map(item => {\n return <option key={item.id} value={item.id}>{item.option}</option>;\n });\n }", "function RenderProfileDataUI(profile) {\n $(\"#welcome-username\").text(profile.Name);\n var DateLastActive_SessionID = Math.min.apply(Math, profile.previousSessions.map(function (sesh) { return sesh.SessionID; }));\n var DateLastActive = profile.previousSessions.find(function (session) { return session.SessionID === DateLastActive_SessionID; }).DateLastActive;\n\n $(\"#welcome-lastlogin\").text(ConvertToReadableDate(DateLastActive));\n}", "function handleRenderOptions() {\n let url = 'https://api.napster.com/v2.2/genres?apikey=OTI0NjE5NWEtNWVjOC00ZTJjLTliMDgtOTdkMTg5NjEwYmU0';\n\n fetch(url)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n //console.log(data.genres);\n for (var i = 0; i < data.genres.length; i++) {\n let options = data.genres[i].name;\n let genreId = data.genres[i].id;\n genreArray = data.genres\n //console.log(options, genreId);\n let userOptions = document.createElement('option');\n userOptions.innerHTML = options;\n userOptions.value = genreId;\n select$.append(userOptions);\n select$.formSelect();\n }\n })\n }", "render() {\n return (\n <React.Fragment>\n <h1>Your Profile</h1>\n <h2>{this.props.user.firstName} {this.props.user.lastName}</h2>\n {/*<List\n itemLayout=\"horizontal\"\n dataSource={officesUnderExperienceManagerData}\n renderItem={item => (\n <List.Item>\n <List.Item.Meta\n avatar={<Avatar src=\"https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png\" />}\n title={<a href=\"https://ant.design\">{item.title}</a>}\n description=\"Ant Design, a design language for background applications, is refined by Ant UED Team\"\n />\n </List.Item>*/}\n )}\n />\n\n </React.Fragment>\n \n );\n\n }", "function generateProviderProfileHtml( ProfileObj ) {\n var profileStr = \"\";\n var VerticalTabObject = {\"Information\":\"Profile information\",\"FAQ\" : \"Providers FAQ Details\"};\n profileStr += '<div class=\"row\">';\n profileStr += CreateVerticalTabs( VerticalTabObject );\n\n profileStr += '<div class=\"col-xs-9\">';\n profileStr += '<div class=\"tab-content\">';\n profileStr += '<div class=\"tab-pane active\" id=\"Information\">'; \n profileStr += getContentInformationTabHtml( ProfileObj );\n\n profileStr +='</div>';\n profileStr += '<div class=\"tab-pane\" id=\"FAQ\">'; \n profileStr += generateFaqHtml( ProfileObj );\n profileStr +='</div>';\n profileStr +='</div>';\n profileStr +='</div>';\n profileStr +='</div>';\n\n $(\"#AccordionProfileDetails\").html( profileStr );\n }", "renderOption(option) {\n\n if (option.value === null) {\n return <div>&nbsp;</div>; // placeholder for no-user\n }\n let user = this.getAppUser(option.value);\n const datatypeAttributes = this.props.fieldDef && this.props.fieldDef.datatypeAttributes ? this.props.fieldDef.datatypeAttributes : {};\n const userLabel = userFormatter.format({value: user}, datatypeAttributes);\n\n if (user) {\n return (\n <div className=\"userOption\">\n {this.state.selectedUserId === user.userId && !this.props.isAddUser && <QbIcon icon=\"check-reversed\"/>}\n <div className=\"userLabel\">{userLabel} {user.screenName &&\n <span>({user.screenName})</span>} {user.deactivated &&\n <span className=\"deactivatedLabel\">(deactivated)</span>}</div>\n {(option.showEmail || this.props.isAddUser) && user.email && <div className=\"email\">{user.email}</div>}\n </div>);\n } else {\n return <div className=\"hidden\">&nbsp;</div>;\n }\n }", "function Profile({ name, title, avatar, profileUrl, size, orientation, type }) {\n const style = {\n base: [styles.base],\n anchor: [styles.element.anchor.base],\n avatar: [styles.element.avatar.base],\n details: [styles.element.details.base],\n name: [styles.element.name.base],\n title: [styles.element.title.base],\n bio: [styles.element.bio.base],\n };\n\n if (size) {\n style.base.push(styles.size[size]);\n style.avatar.push(styles.element.avatar.size[size]);\n style.details.push(styles.element.details.size[size]);\n style.name.push(styles.element.name.size[size]);\n style.title.push(styles.element.title.size[size]);\n }\n\n if (orientation) {\n style.base.push(styles.orientation[orientation]);\n style.avatar.push(styles.element.avatar.orientation[orientation]);\n style.details.push(styles.element.details.orientation[orientation]);\n style.name.push(styles.element.name.orientation[orientation]);\n style.title.push(styles.element.title.orientation[orientation]);\n }\n\n if (type) {\n style.base.push(styles.type[type]);\n style.avatar.push(styles.element.avatar.type[type]);\n style.details.push(styles.element.details.type[type]);\n style.name.push(styles.element.name.type[type]);\n style.title.push(styles.element.title.type[type]);\n }\n\n const ProfileAvatar = (\n <img\n className=\"Profile-avatar\"\n style={style.avatar}\n src={avatar}\n alt=\"Avatar\"\n />\n );\n\n const AuthorDetails = (\n <div className=\"Profile-details\" style={style.details}>\n <div className=\"Profile-name\" style={style.name}>\n {name}\n </div>\n\n <div className=\"Profile-title\" style={style.title}>\n {title}\n </div>\n </div>\n );\n\n if (profileUrl) {\n return (\n <div className=\"Profile\" style={style.base}>\n <a style={style.anchor} href={profileUrl}>\n {ProfileAvatar}\n {AuthorDetails}\n </a>\n </div>\n );\n }\n\n return (\n <div className=\"Profile\" style={style.base}>\n {ProfileAvatar}\n {AuthorDetails}\n </div>\n );\n}", "function fLlenarProfesoresRegistro(){\n //hacemos un for que recorra el array profesores (que guarda los objetos de cada profesor) y liste sus nombres en <option></option> que se añadirán al html\n let opciones = `<option hidden value=\"elegir\">Elegir profesor</option>`; //string que guardará todas las opciones de profesor, valor inicial dice \"Elegir profesor\"\n for (i=0; i < profesores.length; i++)\n {\n opciones += `<option value=\"${profesores[i].id}\">${profesores[i].nombre}</option>`;\n }\n return opciones;\n}", "function updateJSON(){\n\n\tvar selectedProfArr = selectedProfs;\n\tvar newjson = \"\";\n\n\t//Iterate through selectedProfs array and format to put each profile on new line\n\tselectedProfArr.forEach(function(prof){\n\t\tvar index = selectedProfArr.indexOf(prof);\n\t\tnewjson += prof;\n\t\tindex+1 == selectedProfArr.length ? newjson += \" <br>\" : newjson += \", <br>\";\n\t});\n\t$(\"#jsonList\").html(newjson);\n}", "function displayOptions (options) {\n if ( Array.isArray(options) ) {\n\n return options.map((e, i) => (\n <li key={i} className=\"option\">\n <div className=\"option-name\" onClick={() => !e.options ? console.log('OPTION CLICKED') : null}>{e.name}</div>\n { e.options && <Aux>\n <div className=\"arrow\"><i className=\"icon-angle-right\"></i></div>\n <div className=\"option-content\">\n <ul className=\"content\">\n { displayOptions(e.options) }\n </ul>\n </div></Aux> }\n </li>\n ))\n\n } else {\n return console.log('Toolbar: options needs an array');\n }\n }", "function ProfileSelector(props) {\n var value = props.value,\n options = props.options,\n onChange = props.onChange,\n onContinue = props.onContinue,\n onClose = props.onClose;\n return /*#__PURE__*/react_default.a.createElement(react_default.a.Fragment, null, /*#__PURE__*/react_default.a.createElement(Dialog_DialogContent, {\n minHeight: \"200px\"\n }, /*#__PURE__*/react_default.a.createElement(src[\"u\" /* Text */], {\n typography: \"h6\",\n mb: \"3\",\n caps: true,\n color: \"primary.contrastText\"\n }, \"Select Profile\"), /*#__PURE__*/react_default.a.createElement(RadioGroup, {\n options: options,\n selected: value,\n onChange: onChange\n })), /*#__PURE__*/react_default.a.createElement(Dialog_DialogFooter, null, /*#__PURE__*/react_default.a.createElement(src[\"f\" /* ButtonPrimary */], {\n mr: \"3\",\n onClick: onContinue\n }, \"Continue\"), /*#__PURE__*/react_default.a.createElement(src[\"g\" /* ButtonSecondary */], {\n onClick: onClose\n }, \"Cancel\")));\n}", "function profileChipPopulate() {\n var profileStore = retrieveProfileInfo();\n var activity = makeGerund(profileStore.style);\n var userProfString = profileStore.firstName + \", \" + profileStore.age + \" | \" + \"Exploring \" + activity + \" \" + profileStore.venue + \"s\";\n $(\"#userProfile\").text(userProfString);\n}", "function showProfile(profile, currentUser) {\n profile.children.item(0).innerHTML = currentUser.username;\n profile.children.item(1).innerHTML = currentUser.title;\n profile.children.item(2).innerHTML = currentUser.score;\n profile.children.item(1).style.color = '#e40046';\n profile.children.item(1).style.fontWeight = 'bold';\n profile.children.item(2).style.color = '#e40046';\n profile.children.item(2).style.fontWeight = 'bold';\n profile.children.item(3).innerHTML = currentUser.email;\n return;\n}", "function drawAuthorList() {\n $(\"#author-list option\").remove();\n var html = \"\";\n for(var key in author_data) {\n // check if we've already selected this author\n if($.inArray(key+\"\", selected_authors) > -1) {\n continue;\n }\n var j = author_data[key];\n var docs = j.count ? j.count : 0;\n html += \"<option value='\" + key + \"'>\"\n + j.name + \" (\" + docs + \")</option>\";\n }\n\n $(\"#author-list\").append(html);\n}", "renderTmpl() {\n if (!this._data) {\n return;\n }\n\n const template = window.profileDataTmplTemplate(this._data);\n [...this._el].forEach((profile) => {\n profile.innerHTML = template;\n });\n }", "function createOptionsList() {\n if (!this.soundSelected) select.textContent = audios['defaultStatus'];\n else select.textContent = this.soundSelected;\n \n for (let key in audios){\n if (key == 'defaultStatus') continue;\n let option = document.createElement('div');\n option.classList.add('sound_option');\n option.textContent = audios[key].name;\n options.append(option);\n }\n }", "renderOptions(type) {\n const { instruments } = this.props;\n const existingInstrumentsArray = instruments.map((instrument) => (instrument.name))\n\n var optionsArray = []\n var retOptions = []\n switch(type) {\n case 'instruments':\n optionsArray = INSTRUMENTS\n break;\n case 'proficiency':\n optionsArray = PROFICIENCY;\n break;\n case 'years_played':\n optionsArray = YEARS_PLAYED;\n break;\n }\n for (var i = 0; i < optionsArray.length; i++) {\n if (existingInstrumentsArray.includes(optionsArray[i])) {\n // Don't show instruments that user already has under them.\n continue;\n }\n retOptions.push(<option value={i}>{optionsArray[i]}</option>);\n }\n return retOptions;\n }", "function done(err, data) { //maakt een function done aan en die word aangeroepen als de .toArray method klaar is. \n if (err) { // als er een error is laat die dan zien\n next(err);\n } else {\n \n res.render('profiles.ejs', { //render de template en geeft profiles mee als argument\n profiles: data //profiles geven we mee aan de ejs template\n });\n }\n }", "function displaySpesificUsageChoices(data, status, xhr) {\n\t\t//Parse data \n\t\t$data = JSON.parse(data);\n\t\tconsole.log($data);\n\t\t//clears the old data (to remove old prints)\n\t\t$('#spesificUseageSelect').html('');\n\n\t\t//enables spesific usage select\n\t\t//$('#spesificUseageSelect').prop('disabled', false);\n\t\t$('#spesificUseageSelect').append('<option disabled selected>Choose useage</option>');\n\t\t//loops through and prints everything\n\t\tfor(i in $data){\n\t\t\t$choices = '<option value=\"'+$data[i].category+'\">'+$data[i].category+'</option>';\n\n\t\t\t$('#spesificUseageSelect').append($choices);\n\t\t}\n\n\t\tcomponentHandler.upgradeAllRegistered();\n\t}", "function outputUsers(users){\n userList.innerHTML=`\n ${users.map(user=>`<li>${user.username}</li>`).join('')}\n `\n}", "function renderUserOptions({ currentUser }) {\n if (!currentUser) {\n return [\n <li>\n <Link onClick={() => closeSideNav()} to=\"/auth/login\">\n Login\n </Link>\n </li>,\n <li>\n <Link onClick={() => closeSideNav()} to=\"/auth/signup\">\n Signup\n </Link>\n </li>\n ];\n }\n\n if (currentUser.id) {\n return [\n <li key={0}>\n <Link\n onClick={() => closeSideNav()}\n to=\"/management/search\"\n // to=\"/management/search?searchType=byTitle&query=SSL&pageNum=1&sortField=createdAt&sortOrder=Asc\"\n >\n Dashboard\n </Link>\n </li>,\n <li key={1}>\n <Link onClick={() => closeSideNav()} to=\"/\">\n Subscribe\n </Link>\n </li>,\n <li key={2}>\n <Link onClick={() => closeSideNav()} to=\"/logout\" replace>\n Logout\n </Link>\n </li>\n ];\n } else {\n return [\n <li key={0}>\n <Link onClick={() => closeSideNav()} to=\"/auth/login\">\n Login\n </Link>\n </li>,\n <li key={1}>\n <Link onClick={() => closeSideNav()} to=\"/auth/signup\">\n Signup\n </Link>\n </li>\n ];\n }\n}", "function output_user_profile(res, login, userInfo, userInterests, userFriends, peopleWithSameInterests) {\n\tres.render('profile.jade',\n\t\t { title: \"Profile for User with login \" + login,\n\t\t\t userInfo: userInfo,\n\t\t\t userInterests: userInterests,\n\t\t\t userFriends: userFriends,\n\t\t\t peopleWithSameInterests : peopleWithSameInterests}\n\t );\n}", "function renderMemberList(data) {\n if (!data.length) {\n window.location.href = \"/members\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createMemberRow(data[i]));\n }\n memberSelect.empty();\n console.log(rowsToAdd);\n console.log(memberSelect);\n memberSelect.append(rowsToAdd);\n memberSelect.val(userId);\n console.log(\"I selected \", memberSelect, \"!!!\")\n }", "function outputUsers(users){\n userList.innerHTML=`\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}`;\n}", "render() {\n const sections = [\n {\n data: [{\n key: \"id\",\n value: this.props.profileDetails.id,\n imageValue: this.props.profileDetails.image\n }],\n title: \"Id\"\n },\n { data: [{ key: \"name\", value: this.props.profileDetails.name }], title: \"Name\" },\n { data: [{ key: \"email\", value: this.props.profileDetails.email }], title: \"Email\" }\n ];\n\n return (\n <SectionList\n style={styles.container}\n renderItem={this.renderItem}\n renderSectionHeader={this.renderSectionHeader}\n keyExtractor={(item, index) => index}\n sections={sections}\n />\n );\n }", "function outputUsers(users) {\r\n userList.innerHTML = `\r\n ${users.map((user) => `<li>${user.username}</li>`).join(\"\")}\r\n `;\r\n}", "function commandDisplayer() {\n $(\"#available-options\").empty();\n $(\"#available-options\").append(\"<li>Possible Commands:</li>\")\n if(userCommands.length > 0) {\n for(var idx = 0; idx < userCommands.length; idx++) {\n $(\"#available-options\").append(\"<li>\" + userCommands[idx] + \"</li>\")\n }\n }\n}", "function outputUsers(users) {\n userList.innerHTML = `<ul>\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n </ul>`;\n}", "function renderCountryOptions(webcamObject, index) {\n var offset = 0;\n var limit = maxLimit;\n console.log(JSON.stringify(webcamObject));\n\n var $list = $(\"<a>\");\n // set the class\n $list.addClass(\"dropdown-item country-code m-1\");\n $list.attr(\"href\", \"#\");\n // Adding a data-attribute\n $list.attr(\"data-name\", webcamObject.countryCode);\n $list.attr(\"value\", index);\n // Providing the initial button text\n $list.text(webcamObject.countryName);\n // Adding the list to the list div\n $(\"#list\").append($list)\n\n }", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user=>`<h6>${user.username}</h6>`).join('')}\n `;\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}\n `;\n}", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdminSession,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_BANQUE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function getProfileData() {\n IN.API.Profile(\"me\").fields(\"positions:(title)\", \"educations\", \"first-name\", \"last-name\", \"industry\", \"picture-url\", \"public-profile-url\", \"email-address\").result(displayProfileData).error(onError);\n }", "function outputUsers(users){\n userList.innerHTML= `\n ${users.map(user =>`<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users) {\n const userList = document.getElementById('users');\n \n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}\n `;\n}", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join('')}`;\n}", "function outputUsers(users){\n userList.innerHTML = `\n ${users.map(user =>`\n <li>\n ${user.username}\n </li>\n `).join('')\n}`;\n}", "function displayRoomUsers(userList) {\r\n $(\".users-list\").html(\r\n `${userList.map(\r\n (user) => `\r\n ${user.username}\r\n `\r\n )}`\r\n );\r\n}", "function listProfiles() {\n $http({\n method: 'GET',\n url: baseUrl + 'admin/profile/list/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n for (var i = 0; i < response.data.profile_list.length; i++) {\n if (response.data.profile_list[i].type === 'ADMIN_ENTREPRISE' || response.data.profile_list[i].type === 'USER_HABILITY') {\n $scope.listProfils.push(response.data.profile_list[i]);\n };\n };\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function renderMemberList(data) {\n if (!data.length) {\n window.location.href = \"/members\";\n }\n $(\".hidden\").removeClass(\"hidden\");\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createMemberRow(data[i]));\n }\n memberSelect.empty();\n console.log(rowsToAdd);\n console.log(memberSelect);\n memberSelect.append(rowsToAdd);\n memberSelect.val(memberId);\n }", "function outputUsers(users){\n userlist.innerHTML = `\n ${users.map(user => `<li>${user.username}</li>`).join(\"\")}\n `\n}", "showProfile(user) {\n\t\t// Creating a template for adding it in our profile\n\t\tconsole.log(user);\n\t\tthis.profile.innerHTML = `\n\t\t\t<div class=\"card card-body mb-3\">\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-md-3\">\n <img src=\"${user.avatar_url}\" alt=\"\" class=\"img-fluid mb-2\" />\n <p>Name: ${user.name}</p>\n\t\t <a href='${user.html_url}' target='blank' class='btn btn-primary btn-block mb-4'> View Profile</a>\n </div>\n <div class=\"col-md-9\">\n <div><h2 class='display-5'>${user.name}</h2></div>\n <div><h5>${user.login}</h5></div>\n <span class='badge badge-primary badge-pill' style='padding:14px; font-size:14px; background-color:rgb(109, 107, 107)'>Public Repos: ${user.public_repos}</span>\n <span class='badge badge-info badge-pill'\n style='padding:14px; font-size:14px'>Public Gists: ${user.public_gists}</span>\n <span class='badge badge-success badge-pill'\n style='padding:14px; font-size:14px'>Followers: ${user.followers}</span>\n <span class='badge badge-warning badge-pill'\n style='padding:14px; font-size:14px'>Following: ${user.following}</span>\n <br><br>\n <ul class='list-group'>\n <li class='list-group-item'>Company: ${user.company}</li>\n <li class='list-group-item'>Website/Blog: ${user.blog}</li>\n <li class='list-group-item'>Location: ${user.location}</li>\n <li class='list-group-item'>Member since: ${user.created_at}</li>\n </ul>\n </div>\n\t\t\t</div>\n </div>\n <br>\n \n <h3>Latest Repositories: </h3>\n <div id='repos'></div>\n\t\t`;\n\t}", "function outputUsers(users) {\n userList.innerHTML = `${users.map(user => `<li><i class=\"fa fa-user-circle\"></i>${user.username}</li>`).join('')}`\n}", "function createProfileHTMLCards(profile) {\n let icon = '';\n let order = '';\n if (profile.role === 'Manager'){\n icon = 'fas fa-mug-hot '\n order = 'order-first'\n link = `Office Number: ${profile.specialAttr}`\n } else if (profile.role === 'Engineer'){\n icon = 'fas fa-glasses '\n order = ' ';\n link = `Github: <a href=\"https://github.com/${profile.specialAttr}\" target=\"_blank\">${profile.specialAttr}</a>`\n } else if (profile.role === 'Intern'){\n icon = 'fas fa-user-graduate '\n order = 'order-last'\n link = `School: ${profile.specialAttr}`\n }\n \n let profileHTML = \n `\n <div id=\"employeeCard\" class=\"mb-4 col-sm col-md-4 ${order}\">\n <header>\n <h2>${profile.name}</h2>\n <h3><span class=\"${icon}\"></span> ${profile.role}</h3>\n <div class=\"card\">\n <ul class=\"list-group\">\n <li class=\"list-group-item\">ID: ${profile.id}</li>\n <li class=\"list-group-item\">Email: <a href=\"mailto:${profile.email}\">${profile.email}</a></li>\n <li class=\"list-group-item\">${link}</li> \n </ul>\n </div>\n </header>\n </div>\n\n `\n return profileHTML\n}", "function addProfileToAList(profile) {\r\n var listItem = document.createElement(\"li\");\r\n listItem.innerHTML = '<a href=\"#\" class=\"profile\" storageID=\"' + profile.id + '\">' + profile.name + '</a>';\r\n profilesList.appendChild(listItem);\r\n}", "renderOptions() {\n return this.props.optionValues.map((value, index) => (\n <option value={value} key={value}>\n {this.props.optionLabels[index]}\n </option>\n ));\n }", "function index(req, res,){\n\n Profile.find({}) \n \n .then(profiles => {\n \n res.render('profiles/index',{\n\n title:\"not-reddit profiles\",\n\n profiles,\n\n }) \n })\n}", "function listOptions( theContacts )\r\n{\r\n var s ='';\r\n for( var contact in theContacts )\r\n {\r\n if (s != '') { s = s + \", \" };\r\n s = s + contact + \" (\" + theContacts[ contact ].nameChoices + \")\";\r\n }\r\n return s;\r\n}", "render() {\n\t\t// Creating the option elements\n\t\tvar sourceNames = this.props.sourceNames;\n\t\tvar options = [];\n\n\t\tsourceNames.forEach(function(sourceName) {\n\n\t\t\toptions.push(<option name={sourceName} key={sourceName}>{sourceName}</option>);\n\n\t\t});\n\n\t\treturn (\n\t\t\t<div className=\"filter-group\">\n\t\t\t\t<label htmlFor=\"sourceNames\">Source: </label>\n\t\t\t\t<select id=\"sourceNames\" name=\"sourceNames\" onChange={this.onChangeSource}>\n\t\t\t\t\t{options}\n\t\t\t\t</select>\n\t\t\t</div>\n\t\t);\n\t}", "function avatarOptions() {\n\tvar avatarType = document.querySelector('input[name=\"avatar\"]:checked').value;\n\tif (avatarType === \"previousAvatar\") {\n\t\tdocument.getElementById(\"selectAvatarType\").style.display='none';\n\t\tdocument.getElementById(\"selectPrevious\").style.display='';\n\t} else if (avatarType === \"newAvatar\") {\n\t\tdocument.getElementById(\"selectAvatarType\").style.display='none';\n\t\tdocument.getElementById(\"selectScript\").style.display='';\n\t}\n}", "function generateDisplayOptions(options) {\n\t\t//DEBUG\n\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").debug == true) {\n\t\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t\t<h2 class=\"headerList\">Debug</h2>\n\t\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\">\n\t\t\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t\t\t${iconHardware.monitorStroke}\n\t\t\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t\t\t<span>OS Theme</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"os\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\" style=\"text-transform: none\"></span>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"default\" onclick=\"overrideOS('default')\">Default</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"ios\" onclick=\"overrideOS('ios')\">iOS</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"macos\" onclick=\"overrideOS('macos')\">macOS</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"android\" onclick=\"overrideOS('android')\">Android</button>\n\t\t\t\t\t\t\t\t\t\t<button data-name=\"windows\" onclick=\"overrideOS('windows')\">Windows</button>\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\t\t\t</section>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t}\n\t\t\t\n\t\t\tswitch (getPreferenceGroup(\"rebar.appSettings\").os) {\n\t\t\t\tcase 'default':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Default`);\n\t\t\t\t\t$(`[data-name=\"default\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'ios':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`iOS`);\n\t\t\t\t\t$(`[data-name=\"ios\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'macos':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`macOS`);\n\t\t\t\t\t$(`[data-name=\"macos\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'android':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Android`);\n\t\t\t\t\t$(`[data-name=\"android\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'windows':\n\t\t\t\t\t$(`[data-setting=\"os\"] .contextLabel`).append(`Windows`);\n\t\t\t\t\t$(`[data-name=\"windows\"]`).addClass(`picked`);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\n\t\tif (options.themeOptions == true || options.accentOptions == true || options.contrastOptions == true || options.motionOptions == true) {\n\t\t\t//SET UP THE CONTAINER\n\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t<h2 class=\"headerList\">Visuals</h2>\n\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\" id=\"containerVisuals\"></section>\n\t\t\t\t</div>\n\t\t\t`);\n\t\t\t\n\t\t\t//THEMES\n\t\t\tif (options.themeOptions == true) {\n\t\t\t\t//SET UP THE CONTAINER\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.paintbrushStroke}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Theme</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"appearance\" data-position=\"right\" data-type=\"pickericons\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE THE TOKENS\n\t\t\t\t$.each( appThemes, function( key, val ) {\n\t\t\t\t\t$(`[data-setting=\"appearance\"] .contextContainerMenu`).append(`\n\t\t\t\t\t\t<button data-value=\"${key}\" data-label=\"${val.name}\" data-icongroup='${val.iconGroup}' data-iconname='${val.iconName}'>\n\t\t\t\t\t\t\t${val.name}\n\t\t\t\t\t\t\t${window[val.iconGroup][val.iconName]}\n\t\t\t\t\t\t</button>\n\t\t\t\t\t`);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET THEME DROPDOWN\n\t\t\t\t$(`[data-setting=\"appearance\"] button[data-value='${getPreferenceGroup(\"rebar.appSettings\").appearance}']`).addClass(\"picked\");\n\t\t\t\t$(`[data-setting=\"appearance\"] .contextLabel`).append(window[appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].iconGroup][appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].iconName]);\n\t\t\t\t$(`[data-setting=\"appearance\"] .contextLabel`).append(appThemes[getPreferenceGroup(\"rebar.appSettings\").appearance].name);\n\t\t\t}\n\t\t\t\n\t\t\t//ACCENTS\n\t\t\tif (options.accentOptions == true) {\n\t\t\t\t//SET UP THE CONTAINER\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.swatchBookRight}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Accent</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"accent\" data-position=\"right\" data-type=\"popover\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\" style=\"text-transform: none\"><span class=\"colorChip\" data-accent=\"${getPreferenceGroup(\"rebar.appSettings\").accent}\"></span> ${appAccents[getPreferenceGroup(\"rebar.appSettings\").accent]}</span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t<div class=\"containerAccents itemList fixedIconSize\" id=\"pickerAccent\" data-max=\"1\" data-setting=\"accent\"></div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE THE TOKENS\n\t\t\t\t$.each( appAccents, function( key, val ) {\n\t\t\t\t\t$(`#pickerAccent`).append(`\n\t\t\t\t\t\t<div class=\"accentChip selectionRing\" data-value=\"${key}\" data-accent=\"${key}\" title=\"${val}\"></div>\n\t\t\t\t\t`);\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET THE PICKED TOKEN\n\t\t\t\t$(`#pickerAccent [data-value=\"${getPreferenceGroup(\"rebar.appSettings\").accent}\"]`).addClass(\"picked\");\n\t\t\t\t$(`#selectedAccent`).empty().append(appAccents[getPreferenceGroup(\"rebar.appSettings\").accent]);\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE INCREASED CONTRAST OPTIONS\n\t\t\tif (options.contrastOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconShapes.circleHalfVerticalRightFill}\n\t\t\t\t\t\t<div class=\"label\" id=\"increaseContrastLabel\">\n\t\t\t\t\t\t\t<span>Increase Contrast</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"increaseContrast\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//SET SWITCH STATE\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").increaseContrast == \"less\") {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (queryIncreasedContrast == true) {\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').addClass(\"disabled\").removeClass(\"off\");\n\t\t\t\t\t$(\"#increaseContrastLabel\").append(`<span class=\"subtext\">Using device settings</span>`)\n\t\t\t\t\t$('[data-setting=\"increaseContrast\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE REDUCED MOTION OPTIONS\n\t\t\tif (options.motionOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerVisuals`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconObjects.dialOffStroke}\n\t\t\t\t\t\t<div class=\"label\" id=\"reducedMotionLabel\">\n\t\t\t\t\t\t\t<span>Reduce Motion</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"reduceMotion\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//SET SWITCH STATE\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").reduceMotion == \"off\") {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (queryReducedMotion == true) {\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').addClass(\"disabled\").removeClass(\"off\");\n\t\t\t\t\t$(\"#reducedMotionLabel\").append(`<span class=\"subtext\">Using device settings</span>`)\n\t\t\t\t\t$('[data-setting=\"reduceMotion\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (options.textSizeOptions == true || options.textWeightOptions == true || options.textFontOptions == true) {\n\t\t\t//SET UP THE CONTAINER\n\t\t\t$(`#${options.target}`).append(`\n\t\t\t\t<h2 class=\"headerList\">Text</h2>\n\t\t\t\t<div class=\"containerItemList inset inline spacerDouble alwaysBackgroundColor\">\n\t\t\t\t\t<section class=\"containerSection excludePadding excludeMargin\" id=\"containerText\"></section>\n\t\t\t\t</div>\n\t\t\t`);\n\t\t\t\n\t\t\t//GENERATE FONT OPTIONS\n\t\t\tif (options.textFontOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textDyslexia}\n\t\t\t\t\t\t<div class=\"label\">Font</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"font\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\">\n\t\t\t\t\t\t\t\t<button data-value=\"system\" data-label=\"System\">\n\t\t\t\t\t\t\t\t\t<span>System<br /><span class=\"subtext\">The default font for your device</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button data-value=\"opendyslexic\" data-label=\"OpenDyslexic\">\n\t\t\t\t\t\t\t\t\t<span>OpenDyslexic<br /><span class=\"subtext\">For people with Dyslexia</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t<button data-value=\"atkinson\" data-label=\"Atkinson Hyperlegible\">\n\t\t\t\t\t\t\t\t\t<span>Atkinson Hyperlegible<br /><span class=\"subtext\">For people with low vision</span></span>\n\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\tswitch (getPreferenceGroup(\"rebar.appSettings\").textFont) {\n\t\t\t\t\tcase 'system':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`System`);\n\t\t\t\t\t\t$(`[data-value=\"system\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'opendyslexic':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`OpenDyslexic`);\n\t\t\t\t\t\t$(`[data-value=\"opendyslexic\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'atkinson':\n\t\t\t\t\t\t$(`[data-setting=\"font\"] .contextLabel`).append(`Atkinson Hyperlegible`);\n\t\t\t\t\t\t$(`[data-value=\"atkinson\"]`).addClass(`picked`);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE TEXT SIZE OPTIONS\n\t\t\tif (options.textSizeOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textSize}\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t\t<span>Text Size</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"containerContextButton\" data-setting=\"dynamicTypeSize\" data-position=\"right\" data-type=\"picker\">\n\t\t\t\t\t\t\t<button class=\"buttonContext transparent excludePadding\">\n\t\t\t\t\t\t\t\t<div class=\"contextContainerLabel\">\n\t\t\t\t\t\t\t\t\t<span class=\"contextLabel\"></span>\n\t\t\t\t\t\t\t\t\t<span class=\"contextGripper\">${iconShapes.chevronOutwardsVerticalFill}</span>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t<div class=\"contextContainerMenu\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\t//GENERATE MENU ITEMS\n\t\t\t\t$.each( appTextSizes, function( key, val ) {\n\t\t\t\t\t$(`[data-setting=\"dynamicTypeSize\"] .contextContainerMenu`).append(`\n\t\t\t\t\t\t<button data-value=\"${key}\" data-label=\"${val}\">${val}</button>\n\t\t\t\t\t`)\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t//SET TEXT SIZE DROPDOWN\n\t\t\t\t$(`[data-setting='dynamicTypeSize'] button[data-value='${getPreferenceGroup(\"rebar.appSettings\").dynamicTypeSize.value}']`).addClass(\"picked\");\n\t\t\t\t$(\"[data-setting='dynamicTypeSize'] .contextLabel\").append(getPreferenceGroup(\"rebar.appSettings\").dynamicTypeSize.label);\n\t\t\t}\n\t\t\t\n\t\t\t//GENERATE BOLD TEXT OPTIONS\n\t\t\tif (options.textWeightOptions == true) {\n\t\t\t\t//GENERATE MENU\n\t\t\t\t$(`#containerText`).append(`\n\t\t\t\t\t<div class=\"itemList fixedIconSize\">\n\t\t\t\t\t\t${iconInterfaceElements.textWeight}\n\t\t\t\t\t\t<div class=\"label\">\n\t\t\t\t\t\t\t<span>Bold Text</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<button class=\"switch\" data-setting=\"boldText\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t`);\n\t\t\t\t\n\t\t\t\tif (getPreferenceGroup(\"rebar.appSettings\").textWeight == \"regular\") {\n\t\t\t\t\t$('[data-setting=\"boldText\"]').addClass(\"off\");\n\t\t\t\t\t$('[data-setting=\"boldText\"]').attr(\"title\", \"Off\")\n\t\t\t\t} else {\n\t\t\t\t\t$('[data-setting=\"boldText\"]').attr(\"title\", \"On\")\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function options() {\n for (var i = 0; i < questions[questionNumber].options.length; i++) {\n $(\"#list\").append(\"<li class='options' id='\" + questions[questionNumber].options[i] + \"'>\" + questions[questionNumber].options[i] + \"</li>\");\n }\n}", "function createList(data){\n $(\"#member_list\").empty();\n data.forEach(function(element){\n if(element.member_type != \"admin\"){\n $(\"#member_list\").show()\n $(\"#member_list\").append(\n '<li class=\"list-group-item d-flex justify-content-between align-items-center\">'\n +'\t<span>'+element.name+'</span>'\n +' <div class=\"float-right\">'\n + concatOptions(element)\n +' </div>'\n +'</li>'\n );\n }\n });\n }", "function outputUsers(users) {\n userList.innerHTML = `\n ${users.map(user => `<li class=\"contact\">\n <div class=\"wrap\">\n <div class=\"meta\">\n <p class=\"name\">${user.username}</p>\n </div>\n </div>\n </li>`).join('')}\n `\n}", "render() {\n var options = [],\n currentValues = [],\n name = this.props.name,\n counter = 0;\n this.props.data.forEach(function(option) {\n var planResult = Object.keys(option)[0];\n var plan = option[planResult];\n var valueToAdd = plan.details[name];\n var index = currentValues.indexOf(valueToAdd);\n if (index === -1) {\n options.push(<option value={valueToAdd} data-rank={counter} data-planResult={planResult}>{valueToAdd}</option>);\n currentValues.push(valueToAdd);\n }\n counter++;\n }, this);\n return (\n <div className=\"col one tablet-full\">\n <label>{name}</label>\n <select onChange={this.planSelected}>\n {options}\n </select>\n </div>\n );\n }", "function generateFontList() {\n var fontList = [];\n for (var val in fonts) {\n // console.log(fonts[val]);\n for (var fam in fonts[val]) {\n fontList = fontList.concat(fonts[val][fam]);\n }\n }\n // console.log(fontList);\n var select = \"\";\n for (val in fontList) {\n select += '<option value=\"' + fontList[val] + '\">' + fontList[val] + '</option>';\n }\n $('#font-list').append(select);\n\n}", "displayMembersList(){\n let memberListDiv = document.querySelector(\"#members-list\");\n let membersHeading = document.createElement(\"strong\");\n membersHeading.textContent = \"Members: \"\n memberListDiv.append(membersHeading)\n for(var i = 0; i < this.members.length; i++){\n let memberListItem = document.createElement(\"span\");\n memberListItem.textContent = ` ${this.members[i].name} |`\n memberListDiv.append(memberListItem);\n }\n\n }", "function displayUsers() {\n if (users && users.length) {\n var str = \"\";\n $(users).each(function () {\n str += this.name + \", \";\n });\n str = str.replace(/, $/, \"\");\n userList.text(str);\n userDisplay.show();\n }\n else {\n userDisplay.hide();\n }\n }", "function Profile() {\n const tokenState = useSelector(token);\n const loading = useSelector((state) => state.user.status);\n\n let profileMarkup;\n\n if (loading === 'pending') {\n profileMarkup = <ProfileSkeleton />;\n }\n\n if (loading === 'success' && tokenState) {\n profileMarkup = <AuthProfile />;\n }\n if (\n (!tokenState && loading === 'success') ||\n loading === 'idle' ||\n loading === 'rejected'\n ) {\n profileMarkup = <GuestProfile />;\n }\n\n return profileMarkup;\n}", "function buildSidebarDetailsProfileDisplayNameList(profObj) {\n var dna = [];\n for (var pem in profObj) {\n if (profObj.hasOwnProperty(pem)) {\n var po = {};\n po.name = viewableProfileByPkPemMap[pem].displayName;\n po.pem = pem;\n po.asrs = profObj[pem];\n dna.push(po);\n }\n }\n dna.sort(function(a, b) {return a.name.localeCompare(b.name);});\n return dna;\n}", "function GetComposerOptions() {\n InitializeWorklist();\n var output = '';\n var longname;\n var abbr;\n var i;\n\n for (i=0; i<WORKLIST.length; i++) {\n longname = WORKLIST[i].comlong;\n shortname = WORKLIST[i].comshort;\n abbr = WORKLIST[i].repid;\n output += '<option value=\"' + abbr + '\">';\n // output += longname + '</option>\\n';\n output += shortname + '</option>\\n';\n if (abbr == 'Jos') {\n output += '<option value=\"Joa\">Josquin (secure)</option>\\n';\n output += '<option value=\"Job\">';\n output += 'Josquin&nbsp;';\n output += '(not&nbsp;secure)</option>\\n';\n }\n }\n return output;\n}", "renderOptions() {\n return this.state.options.map( (option, idx) => {\n const optionText = option;\n return (\n <NewPollOption\n delFunction={this.removeOption}\n id={idx}\n key={idx}\n optionText={optionText}\n reportUpdate={this.boundReportUpdate}\n />\n );\n });\n }", "populate_dropdown() {\n let dropdown = $(\"#vertex-shader\");\n this.shader_lib.vertex_info.map((x, i) => {\n $('<option>')\n .val(i)\n .html(x.title)\n .appendTo(dropdown);\n });\n }", "async handleoptions() {\n axios.get(`https://aip-v1.ts.r.appspot.com/api/users/`)\n .then(response => {\n const data = response.data.users\n const selectOptions = data.map(users => ({\n \"value\": users.user_id,\n \"label\": users.first_name + \" \" + users.last_name\n }))\n\n this.setState({ options: selectOptions })\n\n })\n }", "function getOptions() {\n var result = [],\n row,\n i;\n pageCount = model.media.getPages(itemsPerPage);\n for (i = 0; i < pageCount; i++) {\n row = model.media.getFirst(i, itemsPerPage)[0];\n result.push((i + 1) + \" - \" + row.file.substr(0, 8) + \"...\");\n }\n return result;\n }", "function DisplayOptions() {\n OptionsPage.call(this, 'display',\n loadTimeData.getString('displayOptionsPageTabTitle'),\n 'display-options-page');\n }", "function getContentInformationTabHtml( ProfileObj ) {\n var profileStrs = \"\";\n profileStrs += '<div class=\"row row-margin-lr-0\">';\n profileStrs += '<div class=\"col-md-3\"><label> profile name</label></div>';\n profileStrs += '<div class=\"col-md-9\">'+ProfileObj[\"profile_name\"]+'</div>';\n profileStrs += '</div>';\n profileStrs += '<div class=\"row row-margin-lr-0\">';\n profileStrs += '<div class=\"col-md-3\"><label> profile short description</label></div>';\n profileStrs += '<div class=\"col-md-9\">'+ProfileObj[\"profile_short_description\"]+'</div>';\n profileStrs += '</div>';\n profileStrs += '<div class=\"row row-margin-lr-0\">';\n profileStrs += '<div class=\"col-md-3\"><label> profile description</label></div>';\n profileStrs += '<div class=\"col-md-9\">'+ProfileObj[\"profile_description\"]+'</div>';\n profileStrs += '</div>';\n profileStrs += '<div class=\"row row-margin-lr-0\">';\n profileStrs += '<div class=\"col-md-3\"><label> profile special requirements</label></div>';\n profileStrs += '<div class=\"col-md-9\">'+ProfileObj[\"profile_special_requirements\"]+'</div>';\n profileStrs += '</div>';\n profileStrs += '<div class=\"row row-margin-lr-0\">';\n profileStrs += '<div class=\"col-md-3\"><label> profile url</label></div>';\n profileStrs += '<div class=\"col-md-9\">'+ProfileObj[\"profile_url\"]+'</div>';\n profileStrs += '</div>';\n\n return profileStrs;\n }", "function createRotatingProfile() {\n\t\t if ($('#modRotatingProfile .profiles')) {\n\t\t\tif (!isMobile) {\n\t\t\t //put everything into variables\n\t\t\t $('#modRotatingProfile .profiles li').each(function() {\n\t\t\t\t\t\t\t\t\t profileList.push($(this).html());\n\t\t\t\t\t\t\t\t });\n\t\t\t \n\t\t\t $('#modRotatingProfile .profiles ul').html(\"\");\n\t\t\t \n\t\t\t $(\"#modRotatingProfile .profiles\").jcarousel({\n\t\t\t\t auto: 7,\n\t\t\t\t\tscroll: 1,\n\t\t\t\t\twrap: 'circular',\n\t\t\t\t\tinitCallback: rotatingProfile_callback,\n\t\t\t\t\tbuttonNextHTML: null,\n\t\t\t\t\tbuttonPrevHTML: null\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t $(\"#modRotatingProfile\").hide();\n\t\t\t}\n\t\t }\n\t\t}", "static renderPersonas(){\n for (let i = 0; i < personas.length; i++) {\n listadoPersonasSeleccion.innerHTML = listadoPersonasSeleccion.innerHTML + `<div class=\"persona\">${personas[i].numero}</div>`;\n }\n }", "function displayProfile(profile) {\n document.getElementById('name').innerHTML = window.profile['displayName'];\n document.getElementById('pic').innerHTML = '<img src=\"' + window.profile['image']['url'] + '\" />';\n document.getElementById('email').innerHTML = email;\n toggleElement('profile');\n}", "function adminViewUserList(url){\n var method = \"GET\";\n var httpRequest = createHttpRequest(method, url);\n\n httpRequest.onreadystatechange = function(){\n if (httpRequest.readyState == 4 && httpRequest.status == 200) {\n var httpResponse = JSON.parse(httpRequest.response);\n var userViewSelect = document.getElementById(\"userViewSelect\");\n\n // Remove old entries, if any\n var length = userViewSelect.options.length;\n for (i = 0; i < length; i++) {\n userViewSelect.options[0] = null;\n }\n // Create default entry\n var defaultOption = document.createElement('option');\n defaultOption.text = \"Select the Resource\";\n defaultOption.disabled = true;\n defaultOption.selected = true;\n userViewSelect.appendChild(defaultOption);\n\n // Create other entries based on data\n outerloop:\n for (var key in httpResponse) {\n innerloop:\n for (var subkey in httpResponse[key]) {\n var options = document.createElement('option');\n if (subkey == \"firstName\") {\n options.value = httpResponse[key]['id'];\n options.innerHTML = httpResponse[key][subkey];\n userViewSelect.appendChild(options);\n break innerloop;\n }\n }\n }\n\n }\n }\n httpRequest.onerror = onError;\n sendHttpRequest(httpRequest, method, url, \"application/json\", null);\n}", "selections() {\n let nombres = this.props.namesGenes;\n return (\n nombres.map(function (item, i) {\n return <option value={item} key={i}>{item}</option>\n }))\n }", "function renderUserSkills() { \n if (!isUserLoggedIn()) return; \n if (!canAccessProfile()) return; \n\n // display users skills and master list of skills \n $('.js-page-content').html(generateMyUserSkills(props.USER_PROFILE));\n generateMasterSkillsForUser(); \n}", "function addProfiles(profileEntries)\n{\n \"use strict\";\n\n const profiles = jQuery.parseJSON(profileEntries);\n\n jQuery('#selectable-profiles').children().remove();\n\n jQuery.each(profiles, function (key, value) {\n\n const rowID = 'profile' + value.id;\n let row;\n\n // Element already exists\n if (!profiles.hasOwnProperty(key) || jQuery('#' + rowID).length)\n {\n return true;\n }\n\n row = '<tr id=\"' + rowID + '\">';\n\n row += '<td class=\"order nowrap center\" style=\"width: 1rem;\">';\n row += '<span class=\"sortable-handler inactive\" style=\"cursor: auto;\"><span class=\"icon-menu\"></span></span>';\n row += '</td>';\n\n row += '<td class=\"profile-data\" style=\"text-align: left\">';\n row += '<span class=\"check-span icon-checkbox-unchecked\" onclick=\"processProfileRow(\\'' + rowID + '\\')\"></span>';\n row += '<span class=\"profile-sort-name\">' + value.sortName + '</span>';\n row += '<span class=\"profile-display-name\" style=\"display: none;\">' + value.displayName + '</span>';\n row += '<span class=\"profile-id\" style=\"display: none;\">' + value.id + '</span>';\n row += '<span class=\"profile-link\" style=\"display: none;\">' + value.link + '</span>';\n row += '</td>';\n row += '</tr>';\n\n jQuery(row).appendTo('#selectable-profiles');\n });\n}", "renderGenres() {\n return this.props.genres.map((genre) => {\n return (\n <option value={genre.id} className=\"text\">{genre.name}</option>\n );\n });\n }", "getOptions() {\n return this.state.options.map(function(item){\n return <option key={item} value={item}>{item}</option>;\n });\n }", "function renderList(resumes, filter = 'all') {\n const usr = getAuthInfo();\n\n clearSections();\n $('#js-list').removeClass('hidden').attr('value', filter); // filter setting - to remember the prev page\n // const listTitle = (filter === 'user')? 'My Resume List': 'All Applicants List'; \n // $('#js-list-title').html(listTitle);\n\n if (filter ==='user') {\n $('#js-list-title').html(`${usr.firstName}'s Resume List`);\n $('#js-list a').attr('id', 'js-all-list-link').html('Go to All List >');\n $('#js-demo-note').addClass('hidden');\n // history.pushState({}, \"a\", \"user-list\");\n\n } else {\n $('#js-list-title').html('All Applicants List');\n $('#js-demo-note').removeClass('hidden');\n // history.pushState({}, \"b\", \"all-list\");\n\n if (usr) {\n $('#js-list a').attr('id', 'js-user-list-link').html('Go to Your List >');\n } else {\n $('#js-list a').empty();\n }\n }\n\n $('#js-ul').empty().append(`<li class='li_main'>\n <div class='w2 li_title'>&nbsp;&nbsp;&nbsp;&nbsp; Date</div>\n <div class='w2 li_title'>Name</div>\n <div class='w3 li_title'>Title</div>\n <div class='w1a li_title'>Reporter</div>\n <div class='w1 li_title'>Status</div>\n <div class='w1a li_title'> </div>\n </li>`);\n\n for (let i = 0; i < resumes.length; i++) {\n const id = resumes[i]._id;\n const created = customDate(new Date(resumes[i].created))[0];\n\n const name = resumes[i].firstName + ' ' + resumes[i].lastName;\n const title = resumes[i].title;\n const username = resumes[i].submitter.username;\n const admin = resumes[i].submitter.admin;\n const recruiter = resumes[i].submitter.recruiter;\n const status = resumes[i].status;\n let userRole = \"\";\n if (recruiter) userRole = `<span class='green b'> (recruiter)</span>`;\n if (admin) userRole = `<span class='red b'> (administrator)</span>`;\n\n $('#js-ul').append(`\n <li class='li_main'>\n <div class='w2'><div><img src='./img/circle-check.svg' alt='checked'></div>\n &nbsp; ${created}</div>\n <div class='w2'>${name}</div>\n <div class='w3'>${title}</div>\n <div class='w1a'>${username}${userRole}</div>\n <div class='w1'>${status}</div>\n <div class='w1a'><a id='${id}' class='thin' href>View Detail ></a></div>\n </li>`);\n } \n}", "function displayUserAvatars(users) {\n\n return `\n <!-- Start avatars -->\n <div class=\"avatars-stack mt-2\">\n\n ${users.map(users => ` \n <div class=\"avatar\">\n <a href=\"${users.userProfileURL}\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"${users.display_name} ${users.aboutdisplay}\">\n <img class=\"img-avatar\" src=\"${users.profilepictureurl}\" onerror=\"this.onerror=null;this.src='${avatarImageDefaut}';\">\n </a>\n </div> \n `).join(\"\")}\n </div> \n <!-- stop avatars --> \n`;\n}", "function setup(){\r\n document.getElementById('backButton').setAttribute('href', '/home/' + thisUser.id);\r\n let mySelect = document.getElementById('friendId');\r\n for(let i = 0; i < thisUser.friends.length; i++){\r\n let newOption = document.createElement('option');\r\n newOption.text = thisUser.friends[i];\r\n mySelect.add(newOption);\r\n }\r\n}" ]
[ "0.6789768", "0.6744866", "0.66457903", "0.60738605", "0.60689616", "0.60122687", "0.59874", "0.59765035", "0.595397", "0.5855576", "0.58369917", "0.5817204", "0.58073306", "0.58072084", "0.5797266", "0.57872474", "0.5787049", "0.5732487", "0.5687231", "0.5664628", "0.5641935", "0.5640829", "0.5633146", "0.5623854", "0.560358", "0.5599303", "0.5599212", "0.55875903", "0.5585967", "0.5572579", "0.5572111", "0.5568471", "0.5541384", "0.55345654", "0.5493555", "0.5485351", "0.54640865", "0.54572743", "0.54571164", "0.5453901", "0.5443298", "0.5440671", "0.54342556", "0.5434033", "0.5428079", "0.54231656", "0.5422735", "0.5419395", "0.5413064", "0.5409251", "0.5396815", "0.539293", "0.53927106", "0.53870726", "0.53827554", "0.53799546", "0.5377777", "0.5377271", "0.5368207", "0.5357755", "0.5349072", "0.53450406", "0.53442216", "0.5340545", "0.53354955", "0.53299373", "0.53248996", "0.5319596", "0.53145146", "0.52988917", "0.52899265", "0.5288784", "0.52695197", "0.5268119", "0.5266733", "0.5259928", "0.5255135", "0.5254406", "0.52526075", "0.5249608", "0.5248474", "0.524717", "0.52444166", "0.5236582", "0.5234443", "0.52324474", "0.5228103", "0.5224971", "0.5220836", "0.52179986", "0.52159685", "0.52158904", "0.52050847", "0.52047795", "0.5196974", "0.51812726", "0.5180356", "0.5179014", "0.5177047", "0.51736647", "0.5172308" ]
0.0
-1
Start a new game
function newGame() { freshStart = true; removals = 0; // Remove the gameover overlay document.getElementById("postgame-message").style.display = "none"; // Clear the board for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (tileArray[row][column] != null) { $(tileArray[row][column]).remove(); tileArray[row][column] = null; } } } // Set the colors yellowActivated = false; greenActivated = false; purpleActivated = false; orangeActivated = false; pinkActivated = false; tealActivated = false; brownActivated = false; grayActivated = false; blackActivated = false; whiteActivated = false; // Reset the color array colorArray = []; colorArray.push("firebrick"); colorArray.push("darkblue"); // Reset scores document.getElementById("current-score").innerHTML = "0"; document.getElementById("gameover-score").innerHTML = "0"; // Make a random "old" future tile and add a tile to the board of that color //newFutureTile(); futureColor = pickColor(); newTile(); // Make another random "old" future tile and add another tile to the board of that color //newFutureTile(); futureColor = pickColor(); newTile(); // Re-enable the fadeIns for center and future tiles freshStart = false; // Make the first center tile newCenterTile(); // Make the real future tile at the top newFutureTile(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function startNewGame() {\n const newGame = new GameLoop();\n newGame.startGame(true);\n}", "function StartNewGame() {\n\tsnowStorm.stop();\n\tsnowStorm.freeze();\n\n\tvar params = {\n\t\tchosen: \"riley\"\n\t};\n\n\t_gameObj = new Game();\n\t_gameObj.SetupCanvas(params);\n\t$j(window).resize(function () {\n\t\t_gameObj.SetupCanvas(params);\n\t});\n\n\t$j.mobile.changePage($j('#game'));\n}", "function startGame() { }", "function NewGame() {\n\t// Your code goes here for starting a game\n\tprint(\"Complete this method in Singleplayer.js\");\n}", "function startGame() {\n incrementGameStep({ gameId, gameData });\n }", "function startGame() {\n logger.log('Staring a new game');\n // Hide any dialog that might have started this game\n $('.modal').modal('hide');\n\n // Reset the board\n board.init();\n\n // Init the scores\n level = 1;\n score = 0;\n totalShapesDropped = 1;\n delay = 500; // 1/2 sec\n updateUserProgress();\n\n // Init the shapes\n FallingShape = previewShape;\n previewShape = dropNewShape();\n\n // Reset game state\n drawPreview();\n pauseDetected = false;\n isPaused = false;\n isGameStarted = true;\n isStopped = false;\n\n // Update the button if this is the first game\n $('#newGameButton').text(\"New Game\");\n\n // Start dropping blocks\n advance();\n }", "function startGame() {\n\n\t\tvar gss = new Game(win.canvas);\n\n\t\t// shared zone used to share resources.\n gss.set('keyboard', new KeyboardInput());\n gss.set('loader', loader);\n\n\t\tgss.start();\n\t}", "function startNewGame(text){\n\n\t//console.log('start new game!');\n\n\ttext.destroy();\n\n\t//not very elegant but it does the job\n\tvar playerName = prompt(\"What's your name?\", \"Cloud\");\n\n\t//store player name in cache to be shown on in-game HUD\n\tlocalStorage.setItem(\"playerName\", playerName);\n\n\tthis.game.state.start('Game');\n}", "function startGame(){\n\tvar game = new Game();\n\tgame.init();\n}", "function startGame(mapName = 'galaxy'){\n toggleMenu(currentMenu);\n if (showStats)\n $('#statsOutput').show();\n $('#ammoBarsContainer').show();\n scene.stopTheme();\n scene.createBackground(mapName);\n if (firstTime) {\n firstTime = false;\n createGUI(true);\n render();\n } else {\n requestAnimationFrame(render);\n }\n}", "function newGame() {\n if (DEBUG) console.log('inside newGame(), calling clearGame() to clean things up...');\n clearGame();\n if (DEBUG) console.log('about to wait a bit before starting the next game...');\n delayOperation = window.setTimeout(function(){ initGame(); }, millisecondOperationDelay);\n }", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "startGame () {\n game.state.start('ticTac')\n }", "function startNewGame() {\n // Clears the wave generation timeout\n clearInterval(info.timeout);\n // Hides the modal if displayed\n if(divs.modal_div.style.display != \"none\") {\n divs.modal_div.style.display = \"none\";\n }\n // Resets the score, level and lives\n info.score = 0;\n info.level = 1;\n info.lives = 3;\n // Starts the wave\n startWave();\n}", "function startNewGame(){\n\t\tclearTimeout(intervalVar);\n\t\tcurWin.set({\n\t\t\tcurrentWin: -1\n\t\t});\n\n\t\tplayerOneRef.update({\n\t\t\tchoice: \"undefined\"\n\t\t});\n\n\t\tplayerTwoRef.update({\n\t\t\tchoice: \"undefined\"\n\t\t});\t\t\n\n\t\tturnRef.set({\n\t\t\tturn: 1\n\t\t});\n\t}", "function startGame() {\n\t\t\tvm.gameStarted = true;\n\t\t\tMastermind.startGame();\n\t\t\tcurrentAttempt = 1;\n\t\t\tactivateAttemptRow();\n\t\t}", "function startGame() {\n\t\tstatus.show();\n\t\tinsertStatusLife();\n\t\tsetLife(100);\n\t\tsetDayPast(1);\n\t}", "function startGame() {\n init();\n}", "function start() {\n\tclear();\n\tc = new GameManager();\n\tc.startGame();\t\n}", "function startGame() {\n (new SBar.Engine()).startGame();\n}", "function startGame(pointer) {\n \n window.location.href = './index.html';\n }", "StartGame(player, start){\n this.scene.start('level1');\n }", "function startGame() {\n\tsetup();\n\tmainLoop();\n}", "function startGame() {\n removeSplashScreen();\n if (gameOverScreen) {\n removeGameOverScreen();\n } else if (youWinScreen){\n removeYouWinScreen();\n }\n createGameScreen();\n\n game = new Game(gameScreen);\n game.start();\n}", "function startGame() {\n myGameArea.start();\n}", "function startGame () {\n if (!gameStarted) { // ensure setInterval only fires once\n setInterval(countdown, 1000)\n generateList() // start game generates first order, subsequent order generated by serve\n setTimeout(gameOver, 90000) // cause endGameOverlay DOM\n }\n gameStarted = true\n removeStartScreen() //remove instructions\n createBoard() //create title and bottom burger in playArea\n }", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "function createGame () {}", "function newGame(gameMode) {\n seriesPlayed = 1;\n gameIsStarted = true;\n gameHasEnded = false;\n isReady = false;\n $('#instructionsContent').text(\"Clique quand la couleur change\");\n $('#actionButton').text(\"START\");\n\n console.log(\"New Game starting.\")\n\n}", "function start(){\n\t\t //Initialize this Game. \n newGame(); \n //Add mouse click event listeners. \n addListeners();\n\t\t}", "newGame () {}", "function runGame() {\n\tvar g = new Main('game', 'container');\n\tg.init();\n}", "function startGame(){\n initialiseGame();\n}", "function startGame() {\n lobby.hide();\n game.start();\n animate();\n}", "function startGame() {\n pageTransition(\"blankpage\");\n setTimeout(function(){window.location.href = \"./game.html\"}, 800);\n}", "function startGame(){\n hideContent();\n unhideContent();\n assignButtonColours();\n generateDiffuseOrder();\n clearInterval(interval);\n setlevel();\n countdown(localStorage.getItem(\"theTime\"));\n listeningForClick();\n}", "startGame() {\n //@todo: have this number set to the difficulty, easy = 3, normal = 6, hard = 9\n StateActions.onStart(5, 5, this.state.difficulty);\n StateStore.setGameState(1);\n this.gameState();\n }", "function prepareNewGame(){\n client.prepareNewGame('Phat3lfstone', 'red', GameSettings.create());\n}", "function run () {\n var $canvasBox;\n \n $('#newGameLink').removeAttr('disabled'); // can click new game link\n\n if (m.debug > m.NODEBUG) { console.log('screens.gameScreen.run'); }\n \n if (needsInit) {\n \n // disable mouse events on canvas and halt the game loop when we return to the menu\n $('#gameMenuLink')\n .click( function (event) {\n m.playtouch.unhookMouseEvents();\n m.Model.stopGameNow();\n m.Audio.beQuiet();\n m.screens.showScreen('menuScreen');\n });\n \n // shuffle and deal if we ask nicely\n $('#newGameLink')\n .click( function (event) {\n // disallow double-clicks, also disabled in the model while dealing\n if ( $(this).attr('disabled') === 'disabled' ) { return false; } \n $(this).attr('disabled', 'disabled'); \n // if you start a new game before winning, give 'em the not impressed face\n if (m.Settings.getPlaySounds() && !hasWon) {\n m.Sounds.playSoundFor(m.Sounds.QUIT);\n }\n \n // now we play\n setTimeout( function() {\n m.Model.stopGameNow();\n m.screens.showScreen('gameScreen');\n }, m.Settings.Delays.Quit);\n return false;\n });\n \n }\n needsInit = false;\n \n // start the game animation loop\n m.gameloop.setLoopFunction(m.view.refreshDisplay);\n \n // start a new game\n m.view.newGame($('#gameViewBox'));\n \n // hook up event handling\n m.playtouch.hookMouseEvents(); \n\n // resize the game pane if needed after a short delay\n $(window)\n .resize(function (event) {\n setTimeout( function () {\n mikeycell.view.setMetrics();\n }, 500);\n });\n\n }", "function startGame(){\n \t\tGameJam.sound.play('start');\n \t\tGameJam.sound.play('run');\n\t\t\n\t\t// Put items in the map\n\t\titemsToObstacles(true);\n\n\t\t// Create the prisoner path\n\t\tGameJam.movePrisoner();\n\n\t\t// Reset items, we dont want the user to be able to drag and drop them\n \t\tGameJam.items = [];\n \t\t\n \t\tfor (var item in GameJam.levels[GameJam.currentLevel].items) {\n \t\t\tGameJam.levels[GameJam.currentLevel].items[item].count = GameJam.levels[GameJam.currentLevel].items[item].countStart;\n \t\t}\n\n\t\t// Reset prisoner speed\n\t\tGameJam.prisoner[0].sprite.speed = 5;\n\n\t\t// Reset game time\n\t\tGameJam.tileCounter = 0;\n\t\tGameJam.timer.className = 'show';\n\t\tdocument.getElementById('obstacles').className = 'hide';\n\t\tdocument.getElementById('slider').className = 'hide';\n\t\tdocument.getElementById('start-button-wrapper').className = 'hide';\n\n\t\t// Game has started\n\t\tGameJam.gameStarted = true;\n\n\t\tGameJam.gameEnded = false;\n\n\t\tdocument.getElementById('static-canvas').className = 'started';\n\n\t\tconsole.log('-- Game started');\n\t}", "startGame() {\n this.state.start('GameState');\n }", "function startGame() {\n\tinitGame();\n\tsetInterval(updateGame, 90);\n}", "function newGame() {\n /* This uses a callback function as all of the other processes are dependant on the configuration information. */\n GAME.loadConfig(function() {\n GAME.loadSVGFiles(); // This will also begin to draw the starting room when complete. //\n GAME.createMaze();\n GAME.prepareCanvas(); // Draws a blank canvas in preparation for rooms. //\n PLAYER.setRandomRoom(); // Assign the player to a random room. //\n });\n}", "function startNewGame() {\n\t\tif (userRoundScore > randomScore) {\n\t\t\tlosses++;\n\t\t\talert(\"Math is hard... You Lost. Try again!\");\n\t\t\tinitializeVariables();\n\t\t}\n\n\t\tif (userRoundScore == randomScore) {\n\t\t\twins++;\n\t\t\tinitializeVariables();\n\t\t\talert(\"Szechuan Sauce For All! You Win!\");\n\t\t}\n\t}", "function loadGame(){\n myGameArea.start();\n}", "function newGame() {\n userScore = 0;\n gameStart();\n }", "function startTheGame() {\n if (opponentReady) {\n startNewRound();\n }\n }", "async startClick() {\n this.game = await this.getGame();\n // STORE GAME STATE TO localStorage to persist after refresh\n localStorage.setItem(\"game\", JSON.stringify(this.game));\n await this.startGame();\n }", "function startGame() {\n //init the game\n gWorld = new gameWorld(6);\n gWorld.w = cvs.width;\n gWorld.h = cvs.height;\n \n gWorld.state = 'RUNNING';\n gWorld.addObject(makeGround(gWorld.w, gWorld.h));\n gWorld.addObject(makeCanopy(gWorld.w));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h));\n gWorld.addObject(makeWalker(gWorld.w, gWorld.h,true));\n gWorld.addObject(makePlayer());\n \n startBox.active = false;\n pauseBtn.active = true;\n soundBtn.active = true;\n touchRightBtn.active = true;\n touchLeftBtn.active = true;\n replayBtn.active = false;\n \n gameLoop();\n }", "function startNewGame() {\n // Possible speeds\n var speeds = {\n 0: 60,\n 200: 77,\n 500: 120,\n 800: 300\n };\n\n // Getting speed based on difficulty\n var speed = difficulty.options[difficulty.selectedIndex].value;\n\n var moleTimer = new Timer({\n seconds: speeds[speed],\n speed: speed,\n onTime: function() {\n if (!gameEnded) {\n renderMole();\n }\n }\n });\n\n // Start timer.\n gameTimer.start();\n moleTimer.start();\n\n // New game\n gameEnded = false;\n }", "function startNewGame() {\n if (!document.fullscreenElement) { p.wrapper.requestFullscreen(); }\n p.loadingWidth = 0;\n p.matrix = [];\n p.ready = false;\n p.timeOfStart = 0;\n p.timeOfEnd = 0;\n clearTimeout(p.timeOut1);\n clearTimeout(p.timeOut2);\n\n createMatrix();\n if (p.startGame) { startTimer(); }\n }", "function startGame() {\n createButtons();\n createCards();\n}", "function startGame() {\n createButtons();\n createCards();\n}", "function startGame () {\n location.replace(\"vcaballeassign3_1.html\");\n}", "function startGame() {\n axios\n .post(`${baseurl}/startGame`)\n .then((response) => {\n if ([204, 201, 200].includes(response.status)) {\n game.gameStarted = true;\n game.music.play();\n game.playerName = response.data.name;\n }\n })\n .catch((error) => {\n console.error(error);\n });\n}", "function startGame() {\n createAnsArray();\n playAnswer();\n }", "function startGame() {\n\t\n\t// fill the question div with new random question\n\tgenerateQuestion();\n\t\n\t// start the timer\n\tmoveProgressBar();\n}", "function start() {\n inquirer\n .prompt({\n name: \"action\",\n type: \"list\",\n message: \"What would you like to do?\",\n choices: [\"Play the game\", \n \"Quit\"]\n })\n .then(function(answer) {\n // based on their answer, either call newGame function \n switch (answer.action) {\n case \"Play the game\" :\n console.log(\"more than once\");\n newGame();\n break;\n case \"Quit\" :\n console.log(\"Adios\")\n break;\n }\n });\n}", "function launchGame() {\n resetAll();\n this.classList.add('active');\n if (this.classList.contains('circle')) {\n starter = true;\n } else {\n starter = false;\n }\n startGame();\n}", "function startGame(){\n gameArea.start();\n debuggerLog(\"The game has started!\");\n}", "function startGame(){\n countdown();\n question();\n solution();\n }", "startGame() {\n if (this.tick <= 50) {\n this.tutorial.alpha -= 0.02;\n this.fireToContinue.alpha -= 0.02;\n this.bg.alpha -= 0.02;\n this.star.alpha -= 0.02;\n }\n else {\n this.startBgm.stop();\n this.scene.stop();\n this.scene.start('mainGame', { remapped: this.remapped, remapKeys: this.remapKeys });\n }\n }", "runGame(){\n\t\t\tthis.scene.runGame();\n\t\t}", "startNewGame() {\n this.currentRound = 0;\n this.monsterHealth = 100;\n this.playerHealth = 100;\n this.playerCanAttack = true;\n this.winner = null;\n this.logMsg = [];\n }", "function startRandomGame() {\n\n}", "function newGame() {\r\n if (is5x5) {\r\n startUp()\r\n constructMaze(5, 5);\r\n Texture().initialize(150);\r\n }\r\n else if (is10x10) {\r\n startUp()\r\n constructMaze(10, 10);\r\n Texture().initialize(75);\r\n }\r\n else if (is15x15) {\r\n startUp()\r\n constructMaze(15, 15);\r\n Texture().initialize(50);\r\n }\r\n else if (is20x20) {\r\n startUp()\r\n constructMaze(20, 20);\r\n Texture().initialize(37.5);\r\n }\r\n else {\r\n console.log(\"Please select a maze size to start.\")\r\n }\r\n }", "function startgame() {\t\r\n\tloadImages();\r\nsetupKeyboardListeners();\r\nmain();\r\n}", "function startGame() {\n\t\tvar game = document.getElementById(\"game-area\");\n\t\ttimeStart();\t\t\t\t\n\t}", "function startGame(){\n var gameNumber = getRandomNumber(1, 10)\n var tries = 10\n var gameOver = false\n var message = 'Guess The Number'\n game = Game(gameNumber, tries, gameOver, message)\n\n //render(game, 'guess a number')\n}", "startGame() {\r\n // Hide start screen overlay\r\n document.getElementById('overlay').style.display = 'none';\r\n\r\n // get a random phrase and set activePhrase property\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhrasetoDisplay();\r\n }", "start() {\n\t\tthis.emit(\"game_start\");\n\t}", "_startNewGame(){\n if(this._gameon){\n return;\n }\n this._gameon=true;\n this.interval = setInterval(this.playGame.bind(this),100);\n }", "function newGame() {\n rebuildDeck(shapes);\n resetOpenCards();\n resetMoves();\n resetMatchCount();\n timer.reset();\n}", "function startGame(){\n game = new Phaser.Game(790, 400, Phaser.AUTO, 'game', stateActions);\n}", "startGame() {\r\n\t\tthis.board.drawHTMLBoard();\r\n\t\tthis.activePlayer.activeToken.drawHTMLToken();\r\n\t\tthis.ready = true;\r\n\t}", "newGame() {\n canClick = false;\n model.reset();\n model.makeRandomPairs(numberOfPairs);\n view.newGame(model.getRandomCards(), startTime);\n view.printScore(model.getScore());\n\n setTimeout(() => {\n canClick = true;\n }, startTime + (animationTime * 1.5));\n }", "function startGame() {\n createButtons(gameButtons);\n createCards();\n}", "launchGame() {\n this.grid.generate()\n this.grid.generateWalls()\n this.grid.generateWeapon('axe', this.grid.giveRandomCase())\n this.grid.generateWeapon('pickaxe', this.grid.giveRandomCase())\n this.grid.generateWeapon('sword', this.grid.giveRandomCase())\n this.grid.generateWeapon('rod', this.grid.giveRandomCase())\n \n this.shears = new Weapon('shears', 10)\n this.sword = new Weapon('sword', 20)\n this.axe = new Weapon('axe', 30)\n this.pickaxe = new Weapon('pickaxe', 40)\n this.rod = new Weapon('rod', 50)\n\n var position_player1 = -1\n var position_player2 = -1\n\n do {\n position_player1 = this.grid.generatePlayer('1')\n this.player1.setPosition(position_player1)\n } while (position_player1 == -1)\n\n do {\n position_player2 = this.grid.generatePlayer('2')\n this.player2.setPosition(position_player2)\n } while (position_player2 == -1 || this.grid.isNextToPlayer(position_player2))\n\n this.game_status = $('#game_status')\n this.game_status.html('Recherche d\\'armes pour les deux joueurs...')\n }", "function startGame() {\n if(!presence.ballIsSpawned) {\n fill(start.color.c, start.color.saturation, start.color.brightness);\n stroke(start.color.c, start.color.saturation, start.color.brightness)\n if((windowWidth < 600) && (windowHeight < 600)) {\n textSize(20);\n text(\"PRESS ENTER TO START GAME\", windowWidth/4.2, windowHeight/2.5);\n textSize(15);\n text(\"(First to 7 Wins)\", windowWidth * 0.41, windowHeight * 0.47);\n }\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(30)\n text(\"PRESS ENTER TO START GAME\", windowWidth * 0.35, windowHeight/2.5);\n textSize(20);\n text(\"(First to 7 Wins)\", start.textX + start.textX * 0.265, windowHeight * 0.44);\n }\n if(mode == 'single'){\n if((windowWidth > 601) && (windowHeight > 601)){\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08);\n textSize(18);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.2, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR TWO PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n if((windowWidth < 600) && (windowHeight < 600)){\n text(\"Mode: \" + mode, windowWidth * 0.8, windowHeight * 0.08);\n textSize(14);\n text(\"USE ARROWS TO MOVE\", start.textX + start.textX * 0.01, start.textY + start.textY * 0.04);\n textSize(12);\n text(\"PRESS SHIFT FOR TWO PLAYER\", windowWidth * 0.35, start.textY + start.textY * 0.16);\n defaultBallSpeed = 4;\n }\n }\n if(mode == 'two'){\n if((windowWidth > 601) && (windowHeight > 601)) {\n textSize(20);\n text(\"Mode: \" + mode, windowWidth * 0.9, windowHeight * 0.08)\n textSize(18);\n text(\"USE Q, A, P, L TO MOVE\", windowWidth * 0.43, windowHeight * 0.48);\n textSize(14);\n text(\"PRESS SHIFT FOR ONE PLAYER\", start.textX + start.textX * 0.2, windowHeight * 0.52);\n }\n }\n \n start.color.c += 1;\n if(start.color.c > 359) {\n start.color.c = 0;\n }\n }\n }", "function startGame() {\n\tupdateGameState()\n\tmoveTetroDown()\n}", "function startGame() {\n pairMovieWithSounds();\n randomSounds(movie);\n addPhraseToDisplay();\n keyboardSetup();\n}", "startMultiplayer()\n {\n document.getElementById(\"chat-box\").style.visibility = \"visible\";\n document.getElementById(\"open-box\").style.visibility = \"visible\";\n \n if(game.firstPlay === true)\n {\n\n if(game.challengingFriend)\n {\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey, \"friend\":game.friend.username});\n }\n else\n {\n makeClient();\n Client.makeNewPlayer({\"name\":game.username, \"gametype\":game.gametype, \"userkey\":game.userkey});\n }\n console.log(\"firstPlay!\")\n game.firstPlay = false\n game.waiting = true\n }\n else\n {\n game.askForRematch()\n }\n }", "function startGame(g_ctx){\n main.GameState = 1;\n levelTransition.levelIndex = -1;\n}", "runGame() {\r\n HangmanUtils.displayGameOptions();\r\n let gameOption = input.questionInt(\">> \");\r\n let game = new Game(this.sourceFileName, this.recordsFileName, this.maxScore);\r\n switch (gameOption) {\r\n case 1:\r\n game.opOneRoundIndependent();\r\n break;\r\n case 2:\r\n game.opOneGameplay();\r\n break;\r\n case 3:\r\n game.opContinuousGameplays();\r\n break;\r\n case 4:\r\n break;\r\n default:\r\n console.log(\"\\nPlease only enter 1, 2, 3 or 4!\");\r\n input.question(\"\\nPress \\\"Enter\\\" to proceed...\");\r\n }\r\n }", "function startNewGame() {\n game = new Game(); //create a new Game object\n game.startGame(); //Start game by calling startGame() method in the Game class\n keysPressed.length = 0; //reset keysPressed array\n}", "function startGame(index){\n\tgamePaused = false;\n\tmapStarted = true;\n}", "function startGame(){\r\n // This object has parentesis because we will work on it later.\r\n window.game= new Game()\r\n}", "function startGame() {\n if(gameState.gameDifficulty === 'easy')\n {\n easyMode();\n } \n if(gameState.gameDifficulty ==='normal'){\n normalMode();\n }\n\n if(gameState.gameDifficulty ==='hard'){\n hardMode();\n }\n\n}", "startGame() {\n this.scene.start('MenuScene');\n }", "function startGame() {\n\n game.updateDisplay();\n game.randomizeShips();\n $(\"#resetButton\").toggleClass(\"hidden\");\n $(\"#startButton\").toggleClass(\"hidden\");\n game.startGame();\n game.updateDisplay();\n saveGame();\n}", "function startGame () {\n\tplay = true;\n\n}", "function startNewGame(p_type){\n\t hideLockoutLayerAtStart();\n\t // send state immediately for static\n\t //$(\"#lockout\").css({\"background\": \"transparent\"});\n\t \n\t _currVars.myVars.myType = p_type;\n\t sendState();\n }", "function startGame(player1Name, player2Name, difficultySetting) {\n window.scoreboard = new Scoreboard(player1Name, player2Name, difficultySetting); \n window.gameboard = new Gameboard(difficultySetting); \n window.clickToPlay = new ClickToPlay(player1Name, player2Name, difficultySetting);\n $('#grid-container-body').removeClass('hide');\n setTimeout(hideWelcomeModal, 500);\n }", "start() {\n\t\tplaySound( 'lvls' );\n\t\tgame.loading = true;\n\n\t\t// the game noticibly lags while setting the terrain, so this makes it look like a loading\n\t\t// black screen for 100 ms whenever it is loaded\n\t\tsetTimeout( () => {\n\t\t\tpause_name = '';\n\n\t\t\t//I think this maybe saved like 8 bytes over just saying game.loading, game.started... etc\n\t\t\tObject.assign( game, {\n\t\t\t\tloading: 0,\n\t\t\t\tstarted: 1,\n\t\t\t\tpaused: 0,\n\t\t\t\tscrolling: 1,\n\t\t\t\tlvln: 1,\n\t\t\t\ta: [],\n\t\t\t\tspawns: [],\n\t\t\t\tpl: new Player(),\n\t\t\t\tscore: 0,\n\t\t\t\tsmult: 1,\n\t\t\t\tspfr: 0,\n\t\t\t\ttss: TSS,\n\t\t\t\ti: null\n\t\t\t} );\n\t\t\tgame.createObjects();\n\t\t\tgame.camToLvl( game.lvln );\n\t\t\tgame.fade( true );\n\t\t}, 100 );\n\t}", "function startNewGame() {\n setGoal();\n updateDisplay();\n randomlizeCrystals();\n storeCrystals();\n}", "function startGame(img, img2, imgBullet, imgBullet2) {\n removeSplashScreen();\n if(gameOverScreen){\n removeGameOverScreen();\n }\n createGameScreen();\n\n game = new Game(gameScreen);\n //game.gameScreen = gameScreen;\n game.start(img, img2, imgBullet, imgBullet2);\n}", "function startGame(freshGame = false) {\n if (freshGame) initState()\n loop()\n}", "function playGame(){\n createTimer();\n juego.resetScore();\n juego.resetCorrectLabel();\n juego.setStatePlaying(true);\n disablePlayButton();\n juego.updateExpression();\n enableSendResultButton();\n resetClasses();\n}", "function startGame() {\n createButtons();\n const cards = createCardsArray();\n appendCardsToDom(cards);\n}", "function startGame(){\n\t$( \"#button_game0\" ).click(function() {selectGame(0)});\n\t$( \"#button_game1\" ).click(function() {selectGame(1)});\n\t$( \"#button_game2\" ).click(function() {selectGame(2)});\n\tloadRound();\n}", "function startGame() {\n if (isGameRunning) return;\n isGameRunning = true;\n hideAllMenus();\n setupScore();\n updateScoreDisplay();\n shootBulletsRandomlyLoop();\n}" ]
[ "0.8278555", "0.80758935", "0.77411234", "0.7467077", "0.74592555", "0.7443089", "0.74224275", "0.7417059", "0.74104816", "0.7316804", "0.7302208", "0.73010427", "0.7268494", "0.72651684", "0.7259647", "0.7253097", "0.7244614", "0.724415", "0.71853125", "0.7175703", "0.71740776", "0.71688056", "0.7167608", "0.7143061", "0.7121606", "0.708024", "0.7075587", "0.7046685", "0.702889", "0.70027184", "0.70022166", "0.70011085", "0.6988849", "0.69883263", "0.6987123", "0.69712406", "0.6954501", "0.6947506", "0.6945849", "0.6929134", "0.6912607", "0.69121456", "0.6912076", "0.6907773", "0.69021815", "0.6883409", "0.687973", "0.68751055", "0.6874951", "0.68700683", "0.68467855", "0.6843761", "0.6843761", "0.68360144", "0.68358487", "0.6833073", "0.68302196", "0.68246424", "0.682407", "0.682147", "0.68210346", "0.6818184", "0.6808369", "0.67989075", "0.6796097", "0.6790115", "0.67779666", "0.6773433", "0.67729986", "0.67628455", "0.6749254", "0.67440003", "0.6742961", "0.6740861", "0.67372954", "0.673623", "0.67352694", "0.672971", "0.67226046", "0.6722604", "0.67222816", "0.6721516", "0.67186886", "0.6714595", "0.6714193", "0.6710814", "0.67097974", "0.670842", "0.67067903", "0.6694887", "0.6689121", "0.6685508", "0.6684913", "0.6678242", "0.6677539", "0.667667", "0.66752607", "0.66743124", "0.66693705", "0.6667426", "0.6662091" ]
0.0
-1
These events happen when you move a tile Check if the tile is on an edge
function isEdge(row, column) { if (row == 0 || row == 3 || column == 0 || column == 3) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "checkEdges(){\n if(this.loc.x < 0){\n gameState = 3\n }\n if(this.loc.x > width){\n gameState = 3\n }\n if(this.loc.y < 0){\n gameState = 3\n }\n if(this.loc.y > height){\n gameState = 3\n }\n }", "function myDown(e){\n canvas.onmousemove=myMove;\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function myDown(e) {\n\n // funciton to mark/unmark tiles while moving mouse\n canvas.onmousemove = myMove;\n\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\") {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\") {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "static entityOnMapEdges(e, m){\n return (\n e.body.position.x < 0 ||\n e.body.position.y < 0 ||\n e.body.position.x + e.body.size.x > m.widthpx ||\n e.body.position.y + e.body.size.y > m.heightpx\n );\n }", "checkEdge(){\n\t\tif (this.loc.y < 0){\n\t\t\tthis.dead = true;\n\t\t}\n\t}", "move() {\n //if I'm going east & I hit the edge...\n if(this.direction === 0) {\n this.x += this.speed;\n if (this.x > (WIDTH)){\n this.place()\n } //if I'm going west & I hit the edge...\n } else if(this.direction === 1) {\n this.x -= this.speed;\n if (this.x < 0) {\n this.place()\n }\n //if I'm going south & I hit the edge...\n } else if(this.direction === 2) {\n this.y += this.speed;\n if (this.y > (HEIGHT)) {\n this.place()\n }\n //if I'm going north & I hit the edge...\n }else if(this.direction === 3) {\n this.y -= this.speed;\n if (this.y < 0) {\n this.place()\n }\n }\n}", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "edgeCheck() {\n\n // check if the selected segment has hit a vertical wall (left or right walls)\n if (this.segments[this.select].x + (this.segments[this.select].width /2) >= width || this.segments[this.select].x - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaX *= -1;\n }\n // check if the selected segment has hit a horizontal wall (top or bottom walls)\n if (this.segments[this.select].y + (this.segments[this.select].width /2) >= height || this.segments[this.select].y - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaY *= -1;\n }\n }", "function offensive_move() {\n \n if ($(cells[left_upper_cell]).hasClass(machine_clicked)) {\n if ($(cells[upper_center_cell]).hasClass(machine_clicked) && $(cells[right_upper_cell]).hasClass(empty_cell)) return right_upper_cell;\n if ($(cells[right_upper_cell]).hasClass(machine_clicked) && $(cells[upper_center_cell]).hasClass(empty_cell)) return upper_center_cell;\n if ($(cells[left_center_cell]).hasClass(machine_clicked) && $(cells[left_lower_cell]).hasClass(empty_cell)) return left_lower_cell;\n\n \n if ($(cells[left_lower_cell]).hasClass(machine_clicked) && $(cells[left_center_cell]).hasClass(empty_cell)) return left_center_cell;\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(machine_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n }\n\n if ($(cells[upper_center_cell]).hasClass(machine_clicked)) {\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[lower_center_cell]).hasClass(empty_cell)) return lower_center_cell;\n if ($(cells[lower_center_cell]).hasClass(machine_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n }\n\n if ($(cells[left_center_cell]).hasClass(machine_clicked)) {\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[right_center_cell]).hasClass(empty_cell)) return right_center_cell;\n if ($(cells[right_center_cell]).hasClass(machine_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n }\n\n if ($(cells[right_upper_cell]).hasClass(machine_clicked)) {\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[left_lower_cell]).hasClass(empty_cell)) return left_lower_cell;\n if ($(cells[left_lower_cell]).hasClass(machine_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n if ($(cells[right_center_cell]).hasClass(machine_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(machine_clicked) && $(cells[right_center_cell]).hasClass(empty_cell)) return right_center_cell;\n }\n\n if ($(cells[left_lower_cell]).hasClass(machine_clicked)) {\n if ($(cells[lower_center_cell]).hasClass(machine_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(machine_clicked) && $(cells[lower_center_cell]).hasClass(empty_cell)) return lower_center_cell;\n }\n\n if ($(cells[left_upper_cell]).hasClass(empty_cell)) {\n if ($(cells[upper_center_cell]).hasClass(machine_clicked) && $(cells[right_upper_cell]).hasClass(machine_clicked)) return left_upper_cell;\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[right_lower_cell]).hasClass(machine_clicked)) return left_upper_cell;\n if ($(cells[left_center_cell]).hasClass(machine_clicked) && $(cells[left_lower_cell]).hasClass(machine_clicked)) return left_upper_cell;\n }\n\n if ($(cells[left_center_cell]).hasClass(empty_cell) &&\n $(cells[center_cell]).hasClass(machine_clicked) &&\n $(cells[right_center_cell]).hasClass(machine_clicked)) return left_center_cell;\n\n if ($(cells[upper_center_cell]).hasClass(empty_cell) &&\n $(cells[center_cell]).hasClass(machine_clicked) &&\n $(cells[lower_center_cell]).hasClass(machine_clicked)) return upper_center_cell;\n\n if ($(cells[left_lower_cell]).hasClass(empty_cell) &&\n $(cells[lower_center_cell]).hasClass(machine_clicked) &&\n $(cells[right_lower_cell]).hasClass(machine_clicked)) return left_lower_cell;\n\n if ($(cells[right_upper_cell]).hasClass(empty_cell)) {\n if ($(cells[right_center_cell]).hasClass(machine_clicked) && $(cells[right_lower_cell]).hasClass(machine_clicked)) return right_upper_cell;\n if ($(cells[center_cell]).hasClass(machine_clicked) && $(cells[left_lower_cell]).hasClass(machine_clicked)) return right_upper_cell;\n }\n }", "function getTile(e) {\n var g = grid();\n for (var i = 0; i < g.length; i++) {\n if ((g[i][0] < e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] < e.x) &&\n ((g[i][1] + 256) > e.x)) return g[i][2];\n }\n return false;\n }", "moveEdge() {\n switch(this.pos.x) {\n\t\t\tcase 0: \n\t\t\t\tthis.liveObj.move(RIGHT);\n\t\t\t\treturn true;\n\t\t\tcase 49: \n\t\t\t\tthis.liveObj.move(LEFT);\n\t\t\t\treturn true;\n\t\t}\n\t\tswitch(this.pos.y) {\n\t\t\tcase 0:\n\t\t\t\tthis.liveObj.move(BOTTOM);\n\t\t\t\treturn true;\n\t\t\tcase 49: \n\t\t\t\tthis.liveObj.move(TOP);\n\t\t\t\treturn true;\n\t\t}\n\n return false;\n }", "function checkArea(e) {\n var state = $.data(e.data.target, 'draggable');\n var handle = state.handle;\n var offset = $(handle).offset();\n var width = $(handle).outerWidth();\n var height = $(handle).outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t,r,b,l) > state.options.edge;\n }", "function checkArea(e) {\n var state = $.data(e.data.target, 'draggable');\n var handle = state.handle;\n var offset = $(handle).offset();\n var width = $(handle).outerWidth();\n var height = $(handle).outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t,r,b,l) > state.options.edge;\n }", "mouseCheck() {\r\n if(this.position.x+this.width/2 > this.movingTo.x-5\r\n &&this.position.x+this.width/2 < this.movingTo.x+5) {\r\n this.movement.x = 0;\r\n this.check(); //Checks for desyncs\r\n this.socket.emit('Desync check', this.number, this.movement.x, this.movement.y, this.side);\r\n } if (this.position.y+this.height/2 > this.movingTo.y-5\r\n &&this.position.y+this.height/2 < this.movingTo.y+5) {\r\n this.movement.y = 0;\r\n this.check(); //Checks for desyncs\r\n this.socket.emit('Desync check', this.number, this.movement.x, this.movement.y, this.side);\r\n }\r\n }", "function move(e) {\n switch (e.event.code) {\n case 'Numpad1':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowDown':\n if (\n player.detectCollision(\n player.sprite.x,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad3':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y + player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.sprite.y += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowLeft':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowRight':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad7':\n if (\n player.detectCollision(\n player.sprite.x - player.tile_size.w,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x -= player.tile_size.w;\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'ArrowUp':\n if (\n player.detectCollision(\n player.sprite.x,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n case 'Numpad9':\n if (\n player.detectCollision(\n player.sprite.x + player.tile_size.w,\n player.sprite.y - player.tile_size.w\n ) == 2 &&\n !player.disableControl\n ) {\n player.sprite.x += player.tile_size.w;\n player.sprite.y -= player.tile_size.w;\n player.doStep();\n }\n break;\n }\n }", "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "function canFrameShift(map, row, col, dir) {\n // console.log(`r,c=${row},${col} dir=${dir}`)\n if (row < 0 || col < 0 || row >= map.rows || col >= map.cols) {\n//\tconsole.log(\"can't shift: off the world\")\n\treturn false\n }\n if (!map.hasObstacleAt(row, col)) {\n\t//console.log(\"the map has no obstacle at row, col\")\n\tif (map.hasObjectTouching(row, col)) {\n\t // console.log(\"there's an obj touching row, col\")\n\t var obj = map.getObjectTouching(row, col)\n\t if (obj.isMoving === false) {\n\t//\tconsole.log(\"the obj is not moving\")\n\t\treturn false\n\t }\n\t // console.log(\"the object is moving\")\n\t return checkFrontier(map, obj, row, col, dir)\n\t}\n//\tconsole.log(\"there is no obj touching\")\n\tlet v = true\n\tmap.objList.forEach(function(obj) {\n\t if (obj.isMoving) {\n\t\tif (obj !== player && checkFrontier(map, obj, row, col, dir) == false) v = false\n\t }\n\t})\n\treturn v //prevent sideways collision\n }\n // console.log(\"there is obstacle at row col\")\n \n return false //is obstacle\n}", "function tileClicked(e){\n // check if the tile can move to the empty spot\n // if the tile can move, move the tile to the empty spot\n\n\tvar curr_tile = e.target; // setting the curr_tile to the tile that has been clicked\n\t\n\tvar curr_row = curr_tile.row; // setting the curr_row to the row of the tile clicked\n\tvar curr_col = curr_tile.col; //setting the curr_col to the column of the tile clicked\n\t\n\t/*\n\t* check the tile in the row before the tile clicked , if the tile from the row before it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\tif( ! (curr_row - 1 < 0 )) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row-1][curr_col] == 0) //check if the item before the tile clicked is the empty tile\n\t\t{\n\t\t\tvar temp1 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\tcurr_tile.row = curr_row - 1; // setting the tile new row\n\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp1; //saving the div in the new position\n\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t/*\n\t* check the tile in the row after the tile clicked , if the tile from the row after it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\t\n\tif(!(curr_row + 1 > _num_rows - 1)) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row + 1][curr_col] == 0) //check if the item after the tile clicked is the empty tile\n\t\t{\n\t\t\t\tvar temp2 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\t\tcurr_tile.row = curr_row + 1; // setting the tile new row\n\t\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp2; //saving the div in the new position\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t}\n\t\n\t}\n\t\n\t\t/*\n\t\t* check the tile in the column before the tile clicked , if the tile from the row before it is the empty one \n\t\t* , we move the tile to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t\t*/\n\n\t\tif(!(curr_col - 1 < 0))\n\t\t{\n\t\t\tif(tile_array[curr_row][curr_col-1] == 0)\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[curr_row][curr_col];\n\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\tcurr_tile.col = curr_col - 1;\n\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp3;\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\t\tif(!(curr_col + 1 > _num_cols))\n\t\t\t{\n\t\t\t\tif(tile_array[curr_row][curr_col+1] == 0)\n\t\t\t\t{\n\t\t\t\t\tvar temp4 = tile_array[curr_row][curr_col];\n\t\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\t\tcurr_tile.col = curr_col+1;\n\t\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp4;\n\t\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\n}", "function tileMouseMove(e, $element){\n\t\t//&& (e.which === 1 || ev.touches)\n\t\tif( GAME.board.painting ){\n\n\t\t\tswitch($activeTool){\n\t\t\t\tcase $paintTool:\n\t\t\t\t\tthrottlePaint($element);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $fillTool:\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t\tcase $eraseTool:\n\t\t\t\t\tthrottleErase($element);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $highlightTool:\n\t\t\t\t\tthrottleHighlight($element);\n\t\t\t\t\tbreak;\n\t\t\t\tcase $sampleTool:\n\t\t\t\t\t\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function checkArea(e, state) {\n var $handle = $(state.handle);\n var offset = $handle.offset();\n var width = $handle.outerWidth();\n var height = $handle.outerHeight();\n var t = e.pageY - offset.top;\n var r = offset.left + width - e.pageX;\n var b = offset.top + height - e.pageY;\n var l = e.pageX - offset.left;\n\n return Math.min(t, r, b, l) > state.options.edge;\n }", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\t// checks to see if the tile is next to the empty square tile\n\tif(Math.abs(otherLeft - left) == TILE_AREA && Math.abs(otherTop - top) == 0) {\n\t\treturn true;\n\t} else if(Math.abs(otherLeft - left) == 0 && Math.abs(otherTop - top) == TILE_AREA) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function checkIfIconCanBeMovedHere(fromPosX, fromPosY, toPosX, toPosY) {\n\n if (toPosX < 0 || toPosX >= BOARD_COLS || toPosY < 0 || toPosY >= BOARD_ROWS)\n {\n return false;\n }\n\n if (fromPosX === toPosX && fromPosY >= toPosY - 1 && fromPosY <= toPosY + 1)\n {\n return true;\n }\n\n if (fromPosY === toPosY && fromPosX >= toPosX - 1 && fromPosX <= toPosX + 1)\n {\n return true;\n }\n\n return false;\n}", "function onMouseMove(e) {\n //Posição do mouse\n var pos = getMousePos(canvas, e);\n if (drag && level.selectedtile.selected) {\n //Pega o tile sobre o mouse\n mt = getMouseTile(pos);\n if (mt.valid) {\n //Verifica se pode ser trocado\n if (canSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row)) {\n //Troca os tiles\n mouseSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row);\n }\n }\n }\n }", "didSnakeHitAWall() {\n const rowAxis = document.querySelectorAll('.row');\n const cellAxis = rowAxis[0].children;\n\n const snakeHeadLocation = this.snake.segments[this.snake.segments.length - 1];\n if (snakeHeadLocation.x > cellAxis.length - 1\n || snakeHeadLocation.x < 0\n || snakeHeadLocation.y < 0\n || snakeHeadLocation.y > rowAxis.length - 1) {\n this.gameOver();\n }\n }", "function handleSpecialMoveCheck(tile,i,j) {\n\t//console.log(tile,i,j,currSelectedPiece);\n\tif (isWhite) {\n\t\tif (lookupTile(2,i,j).piece.charAt(0) != 'w' && j == 7 && currSelectedPiece.piece.charAt(1) == 'p') {\n\t\t\tconsole.log('in here');\n\t\t\tupgrade(false);\n\t\t} else {\n\t\t\tif (tile.piece.charAt(1) == 'k')\n\t\t\t\tkingMoved = true;\n\t\t\tif (tile.piece.charAt(1) == 'r' && currSelectedPiece.i == 0 && currSelectedPiece.j == 0)\n\t\t\t\trook1Moved = true;\n\t\t\tif (tile.piece.charAt(1) == 'r' && currSelectedPiece.i == 7 && currSelectedPiece.j == 0)\n\t\t\t\trook2Moved = true;\n\t\t\tsocket.emit('move', {from: {x: currSelectedPiece.i, y: currSelectedPiece.j}, to: {x: i, y:j}, upgrade: false});\n\t\t}\n\t} else {\n\t\tif (lookupTile(2,i,j).piece.charAt(0) == 'b' && j == 0 && currSelectedPiece.piece.charAt(1) == 'p') {\n\t\t\tupgrade(false);\n\t\t} else {\n\t\t\tif (tile.piece.charAt(1) == 'k')\n\t\t\t\tkingMoved = true;\n\t\t\tif (tile.piece.charAt(1) == 'r' && currSelectedPiece.i == 0 && currSelectedPiece.j == 7)\n\t\t\t\trook1Moved = true;\n\t\t\tif (tile.piece.charAt(1) == 'r' && currSelectedPiece.i == 7 && currSelectedPiece.j == 7)\n\t\t\t\trook2Moved = true;\n\t\t\tsocket.emit('move', {from: {x: currSelectedPiece.i, y: currSelectedPiece.j}, to: {x: i, y:j}, upgrade: false});\n\t\t}\n\t}\n}", "function checkIfAnyTileCanMove() {\n function checkTile(tile, direction) {\n // Calculates the position of the next cell\n // in the direction of the movement.\n const nextX = tile.x + direction.x;\n const nextY = tile.y + direction.y;\n\n // If next cell is out of bound stop.\n if (nextX > 3 || nextY > 3 || nextX < 0 || nextY < 0) {\n return false;\n }\n\n const nextCell = grid[nextY][nextX];\n const canMove = !nextCell || nextCell.value === tile.value;\n\n return canMove;\n }\n\n let canAnyTileMove = false;\n loopGrid((x, y) => {\n const cell = grid[y][x];\n const tile = {\n id: cell.id,\n value: cell.value,\n x,\n y,\n };\n // Checks move to the right.\n const canMoveRight = !!checkTile(tile, { x: 1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveRight;\n if (canAnyTileMove) return true;\n // Checks move to the left.\n const canMoveLeft = !!checkTile(tile, { x: -1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveLeft;\n if (canAnyTileMove) return true;\n // Checks move to the top.\n const canMoveUp = !!checkTile(tile, { x: 0, y: -1 });\n canAnyTileMove = canAnyTileMove || canMoveUp;\n if (canAnyTileMove) return true;\n // Checks move to the bottom.\n const canMoveDown = !!checkTile(tile, { x: 0, y: 1 });\n canAnyTileMove = canAnyTileMove || canMoveDown;\n if (canAnyTileMove) return true;\n\n return false;\n });\n\n return canAnyTileMove;\n}", "doubleClickTile(row, col){\n\n let tile = this.grid[row][col];\n if(tile.isRevealed){\n let neighbours = MineSweeper.getNeighbours((row == 0), (row == this.rows - 1), (col == 0), (col == this.cols - 1));\n let flaggedNeighbours = 0;\n for(let neighbour of neighbours){\n let r = row + neighbour[0],\n c = col + neighbour[1];\n if (this.grid[r][c].isFlagged){\n flaggedNeighbours++;\n }\n }\n\n let winner = false;\n if(flaggedNeighbours == tile.surroundingBombs){\n for(let neighbour of neighbours){\n let r = row + neighbour[0],\n c = col + neighbour[1];\n if (!this.grid[r][c].isFlagged){\n winner = winner || this.clickTile(r,c, 0);\n }\n }\n }\n return winner;\n }\n }", "function canTileMove (x, y) {\n return ((x > 0 && canSwap(x, y, x-1 , y)) ||\n (x < cols-1 && canSwap(x, y, x+1 , y)) ||\n (y > 0 && canSwap(x, y, x , y-1)) ||\n (y < rows-1 && canSwap(x, y, x , y+1)));\n }", "function hasMoved() {\n const bounds = map.getBounds();\n if (bounds.getSouthWest().equals(sw) && bounds.getNorthEast().equals(ne)) {\n return false;\n }\n sw = bounds.getSouthWest();\n ne = bounds.getNorthEast();\n return true;\n}", "isObstacleBetween(corners, tileMap) {\n const enemyCorners = [];\n enemyCorners.push({x: this.x, y: this.y});\n enemyCorners.push({x: this.x + this.w * 0.999, y: this.y});\n enemyCorners.push({x: this.x, y: this.y + this.h * 0.999});\n enemyCorners.push({x: this.x + this.w * 0.999, y: this.y + this.h * 0.999});\n\n for (let i = 0; i < 4; i++) {\n const differenceX = corners[i].x - enemyCorners[i].x;\n const differenceY = corners[i].y - enemyCorners[i].y;\n const distance = Math.sqrt(Math.pow(differenceX, 2) + Math.pow(differenceY, 2));\n\n const ray = new Ray(enemyCorners[i], {x: differenceX, y: differenceY});\n const intersection = ray.castWalls(tileMap.boundaries);\n if (intersection == null)\n continue;\n\n const intersectionDistance = Math.sqrt(Math.pow(intersection.x - enemyCorners[i].x, 2) + Math.pow(intersection.y - enemyCorners[i].y, 2));\n if (intersectionDistance < distance) \n return true; \n \n // enemy corner may be on a boundary, and casting a ray to the boundary will always give no intersection\n // check if there is a intersection by checking first tile square in direction of ray\n if (enemyCorners[i].x == Math.floor(enemyCorners[i].x) || enemyCorners[i].y == Math.floor(enemyCorners[i].y)) {\n let varianceX, varianceY;\n varianceX = differenceX > 0 ? 0.00001 : -0.00001;\n varianceY = differenceY > 0 ? 0.00001 : -0.00001;\n if (differenceX == 0) \n varianceX = 0;\n if (differenceY == 0)\n varianceY = 0;\n let square;\n if (enemyCorners[i].x == Math.floor(enemyCorners[i].x) && enemyCorners[i].y == Math.floor(enemyCorners[i].y)) {\n square = tileMap.array[Math.floor(enemyCorners[i].y + varianceY)][Math.floor(enemyCorners[i].x + varianceX)];\n }\n else if (enemyCorners[i].x == Math.floor(enemyCorners[i].x)) {\n square = tileMap.array[Math.floor(enemyCorners[i].y)][Math.floor(enemyCorners[i].x + varianceX)];\n }\n else if (enemyCorners[i].y == Math.floor(enemyCorners[i].y)) {\n square = tileMap.array[Math.floor(enemyCorners[i].y + varianceY)][Math.floor(enemyCorners[i].x)];\n }\n if (square == 1) { // if a wall\n return true;\n } \n }\n }\n return false;\n }", "checkEdges() {\n if (this.location.x > p.w - this.radius) {\n this.velocity.x *= -1;\n } else if (this.location.x < 0 + this.radius) {\n this.velocity.x *= -1;\n }\n if (this.location.y > p.h - this.radius) {\n this.velocity.y *= -1;\n } else if (this.location.y < 0 + this.radius) {\n this.velocity.y *= -1;\n }\n }", "function checkIfGemCanBeMovedHere(fromPosX, fromPosY, toPosX, toPosY) {\n\n if (toPosX < 0 || toPosX >= BOARD_COLS || toPosY < 0 || toPosY >= BOARD_ROWS)\n {\n return false;\n }\n\n if (fromPosX === toPosX && fromPosY >= toPosY - 1 && fromPosY <= toPosY + 1)\n {\n return true;\n }\n\n if (fromPosY === toPosY && fromPosX >= toPosX - 1 && fromPosX <= toPosX + 1)\n {\n return true;\n }\n\n return false;\n}", "checkEdges () {\n if(this.loc.x + this.radius >= canvas.width){\n this.loc.x = canvas.width - this.radius;\n this.vel.x *= -1;\n }\n if(this.loc.x - this.radius < 0){\n this.loc.x = this.radius;\n this.vel.x *= -1;\n }\n if(this.loc.y + this.radius >= canvas.height){\n this.loc.y = canvas.height - this.radius;\n this.vel.y *= -1;\n }\n if(this.loc.y - this.radius < 0){\n this.loc.y = this.radius;\n this.vel.y *= -1;\n }\n }", "function onDrag() {\r\n\t\t\t//Gets the top left corner of square that you're in (x, y)\r\n\t\t\tmoving = true;\r\n\t\t\tlet x_check = Math.floor((d3.event.x - graph.offset.x + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tlet y_check = Math.floor((d3.event.y - graph.offset.y + graph.cell_size / 2) / graph.cell_size);\r\n\t\t\tif(x_check <= 0) {\r\n\t\t\t\tpoint.x = 0;\r\n\t\t\t} else if(x_check >= graph.numCols) {\r\n\t\t\t\tpoint.x = graph.numCols;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.x = x_check;\r\n\t\t\t}\r\n\t\t\tif(y_check <= 0) {\r\n\t\t\t\tpoint.y = 0;\r\n\t\t\t} else if(y_check >= graph.numRows) {\r\n\t\t\t\tpoint.y = graph.numRows;\r\n\t\t\t} else {\r\n\t\t\t\tpoint.y = y_check;\r\n\t\t\t}\r\n\t\t\tupdatePosition();\r\n\t\t\tgraph.update();\r\n\t\t}", "function mouseDragged() {\n if (!running) {\n var x = parseInt(mouseX / w);\n var y = parseInt(mouseY / h);\n if (pencil) {\n try {\n grid[x][y].obstacle = true;\n start.obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n } else if (eraser) {\n try {\n grid[x][y].obstacle = false;\n } catch (error) {\n console.log(\"Click out of canvas\");\n }\n }\n\n if (cursorX !== x || cursorY !== y) {\n cursorX = x.valueOf();\n cursorY = y.valueOf();\n }\n }\n\n return false;\n}", "function checkVictoryClick() {\n\t// Dazu muss die gesamte Matrix durchlaufen werden\n\tfor(var i = 0; i < arrayDimensionLine; i++) {\n\t\tfor(var j = 0; j < arrayDimensionColumn; j++) {\n\t\t\t// Und fuer jede Zelle muss geprueft werden, ob sie auf der Map ist\n\t\t\tif(hexatileOnMap(i,j))\n\t\t\t\t// Dann wird geprueft, ob diese Zelle noch verdeckt und keine Mine ist\n\t\t\t\tif(!gameField[i][j].isOpen && !gameField[i][j].isMine)\n\t\t\t\t\t// in diesem Fall hat man noch nicht durch aufdecken aller leeren Felder gewonnen\n\t\t\t\t\treturn false;\n\t\t}\n\t}\n\n\t// An dieser Stelle ist klar, dass alle leeren Felder aufgedeckt wurden \n\treturn true;\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "onPointerPressed(e)\n {\n let position = this.inverseTransformVector(e.position).trunc();\n let info = this.positionInfo(position);\n\n // Check if the tile is in the world\n if (!this.region.contains(position))\n return;\n\n // Check if the tile contains an entity and it is interactable\n if (typeof info.entity !== 'undefined' && typeof info.entity.canInteract !== 'undefined')\n {\n // Check if the player can interact with the entity\n if (info.entity.canInteract(this.player))\n info.entity.onInteract(this.player);\n }\n else\n {\n // Move the player to where he clicked\n if (!this.player.moveTo(position))\n console.warn(`${this.player} cannot move to ${position}`);\n }\n }", "function checkClick(tile) {\n\tif (tile.type === 0) {\n\t\trevealTile(tile)\n\t\trevealBlanks(tile) \n\t} else if (tile.type > 0) \n\t\trevealTile(tile)\n\telse {\n\t\trevealMines(tile)\n\t\tdisplayLose(tile)\n\t}\n}", "mouseOverCheck(x,y){\n let d = dist(x,y,this.locX,this.locY);\n if(d<this.ballSize/2){return true;}\n else{return false;}\n }", "checkProximity(row, col, theRow, theCol) {\n\n /* mine cant be on this tile */\n if (row === theRow && col === theCol) {\n return false;\n }\n\n /* mine cant be above this tile */\n if (row === theRow - 1 && col === theCol) {\n return false;\n }\n\n /* mine cant be below this tile */\n if (row === theRow + 1 && col === theCol) {\n return false;\n }\n\n /* mine cant be left of this tile */\n if (row === theRow && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be right of this tile */\n if (row === theRow && col === theCol + 1) {\n return false;\n }\n\n /* mine cant be above and to the left of this tile */\n if (row === theRow - 1 && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be above and to the right of this tile */\n if (row === theRow - 1 && col === theCol + 1) {\n return false;\n }\n\n /* mine cant be below and to the left of this tile */\n if (row === theRow + 1 && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be below and to the right of this tile */\n if (row === theRow + 1 && col === theCol + 1) {\n return false;\n }\n\n return true;\n }", "function onMouseDown(e) {\n \n // Get the mouse position\n var pos = getMousePos(mycanvas, e);\n \n // Start dragging\n if (!drag) {\n \n // Get the tile under the mouse\n mt = getMouseTile(pos);\n \n if (mt.valid) {\n \n // Valid tile\n var swapped = false;\n if (level.selectedtile.selected) {\n \n if (mt.x == level.selectedtile.column && mt.y == level.selectedtile.row) {\n // Same tile selected, deselect\n \n level.selectedtile.selected = false;\n drag = true;\n return;\n } else if (canSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row)){\n // Tiles can be swapped, swap the tiles\n \n mouseSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row);\n swapped = true;\n }\n }\n \n if (!swapped) {\n \n // Set the new selected tile\n level.selectedtile.column = mt.x;\n level.selectedtile.row = mt.y;\n level.selectedtile.selected = true;\n }\n } else {\n \n // Invalid tile\n level.selectedtile.selected = false;\n }\n \n // Start dragging\n drag = true;\n }\n \n // Check if a button was clicked\n// for (var i=0; i<buttons.length; i++) {\n// if (pos.x >= buttons[i].x && pos.x < buttons[i].x+buttons[i].width &&\n// pos.y >= buttons[i].y && pos.y < buttons[i].y+buttons[i].height) {\n// \n// // Button i was clicked\n// if (i == 0) {\n// // New Game\n// newGame();\n// } else if (i == 1) {\n// // Show Moves\n// showmoves = !showmoves;\n// buttons[i].text = (showmoves?\"Hide\":\"Show\") + \" Moves\";\n// } else if (i == 2) {\n// // AI Bot\n// aibot = !aibot;\n// buttons[i].text = (aibot?\"Disable\":\"Enable\") + \" AI Bot\";\n// }\n// }\n// }\n }", "edges() {\n if (this.pos.y + this.r > height - 75 - 1) {\n this.die();\n }\n }", "onEnemyCollision(collider){\n\t\tif (this.isSolid) {\n const collisionDirection = this.getEntityCollisionDirection(collider.hitbox);\n\n var newPosition;\n\n\t\t\tswitch (collisionDirection) {\n\t\t\t\tcase Direction.Up:\n newPosition = this.mapPosition.y - MotherTree.PUSH_BACK_LENGTH; //this.enemyHitbox.position.y - (collider.dimensions.y + Tile.TILE_SIZE * 2);\n timer.tween(collider.mapPosition, \n ['y'], \n [newPosition],\n MotherTree.DAZE_TIME, () => {collider.isDazed = false;});\n\t\t\t\t\t//collider.mapPosition.y = this.enemyHitbox.position.y + (collider.dimensions.y + Tile.TILE_SIZE * 2);\n break;\n\t\t\t\tcase Direction.Down:\n newPosition = this.mapPosition.y + MotherTree.PUSH_BACK_LENGTH; //this.enemyHitbox.position.y + (collider.dimensions.y + Tile.TILE_SIZE * 2);\n timer.tween(collider.mapPosition, \n ['y'], \n [newPosition],\n MotherTree.DAZE_TIME, () => {collider.isDazed = false;});\n \n //collider.mapPosition.y = this.enemyHitbox.position.y - (collider.dimensions.y + Tile.TILE_SIZE * 2);\n break;\n\t\t\t\tcase Direction.Left:\n newPosition = this.mapPosition.x - MotherTree.PUSH_BACK_LENGTH; //this.enemyHitbox.position.x - (collider.dimensions.x + Tile.TILE_SIZE * 2);\n timer.tween(collider.mapPosition, \n ['x'], \n [newPosition],\n MotherTree.DAZE_TIME, () => {collider.isDazed = false;});\n\n\t\t\t\t\t//collider.mapPosition.x = this.enemyHitbox.position.x - (collider.dimensions.x + Tile.TILE_SIZE * 2);\n break;\n\t\t\t\tcase Direction.Right:\n newPosition = this.mapPosition.x + MotherTree.PUSH_BACK_LENGTH //this.enemyHitbox.position.x + (collider.dimensions.x + Tile.TILE_SIZE * 2);\n timer.tween(collider.mapPosition, \n ['x'], \n [newPosition],\n MotherTree.DAZE_TIME, () => {collider.isDazed = false;});\n\t\t\t\t\t//collider.mapPosition.x = this.enemyHitbox.position.x + (collider.dimensions.x + Tile.TILE_SIZE * 2);\n break;\n\t\t\t}\n\n collider.isDazed = true;\n collider.stateMachine.change(EnemyStateName.Idle);\n\t\t}\n\n\t\tif (this.wasCollided) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.wasCollided = true;\n\t}", "move(mapX, mapY) {\n // check if it is a walkable tile\n let walkable = this.dontTreadOnMe();\n if (this.state.healing) {\n walkable[this.state.villager.map[0]-1][this.state.villager.map[1]-1] = 0;\n }\n if (walkable[mapX-1][mapY-1] === 0) {\n // use easy-astar npm to generate array of coordinates to goal\n const startPos = {x:this.state.playerMap[0], y:this.state.playerMap[1]};\n const endPos = {x:mapX,y:mapY};\n const aStarPath = aStar((x, y)=>{\n if (walkable[x-1][y-1] === 0) {\n return true; // 0 means road\n } else {\n return false; // 1 means wall\n }\n }, startPos, endPos);\n let path = aStarPath.map( element => [element.x, element.y]);\n if (this.state.healing) { path.pop() };\n this.setState({moving: true}, () => this.direction(path));\n };\n }", "function collision(e){\r\n\t\tif (e === 37){\r\n\t\t\tmoveRight = true;\r\n\t\t\tmoveUp = true;\r\n\t\t\tmoveDown = true;\r\n\t\t\tfor (row = 0; row < 10; row++){\r\n\t\t\t\tfor (column = 0; column < 10; column++){\r\n\t\t\t\t\tif (objectsL1[row][column] !== floor &&\r\n objectsL1[row][column] !== wall &&\r\n\t\t\t\t\t\tobjectsL1[row][column] !== l_rug &&\r\n\t\t\t\t\t\tplayer.x <= (column + 1) * 64 + moveSpeed &&\r\n\t\t\t\t\t\tplayer.x >= (column + 1) * 64 &&\r\n\t\t\t\t\t\tplayer.y >= row * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.y <= (row + 1) * 64 + moveSpeed\r\n\t\t\t\t\t){\r\n\t\t\t\t\t\tmoveLeft = false;\r\n\t\t\t\t\t\tsceneLevel1Index = getScene(row, column);\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\tif (e === 39){\r\n\t\t\tmoveLeft = true;\r\n\t\t\tmoveUp = true;\r\n\t\t\tmoveDown = true;\r\n\t\t\tfor (row = 0; row < 10; row++){\r\n\t\t\t\tfor (column = 0; column < 10; column++){\r\n\t\t\t\t\tif (objectsL1[row][column] !== floor &&\r\n objectsL1[row][column] !== wall &&\r\n\t\t\t\t\t\tobjectsL1[row][column] !== l_rug &&\r\n\t\t\t\t\t\tplayer.x >= column * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.x <= column * 64 - 32 &&\r\n\t\t\t\t\t\tplayer.y >= row * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.y <= (row + 1) * 64 + moveSpeed\r\n\t\t\t\t\t){\r\n\t\t\t\t\t\tmoveRight = false;\r\n\t\t\t\t\t\tsceneLevel1Index = getScene(row, column);\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\tif (e === 40){\r\n\t\t\tmoveLeft = true;\r\n\t\t\tmoveRight = true;\r\n\t\t\tmoveUp = true;\r\n\t\t\tfor (row = 0; row < 10; row++){\r\n\t\t\t\tfor (column = 0; column < 10; column++){\r\n\t\t\t\t\tif (objectsL1[row][column] !== floor &&\r\n objectsL1[row][column] !== wall &&\r\n\t\t\t\t\t\tobjectsL1[row][column] !== l_rug &&\r\n\t\t\t\t\t\tplayer.x >= column * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.x <= (column + 1) * 64 + moveSpeed &&\r\n\t\t\t\t\t\tplayer.y >= row * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.y <= row * 64 - 32\r\n\t\t\t\t\t){\r\n\t\t\t\t\t\tmoveDown = false;\r\n\t\t\t\t\t\tsceneLevel1Index = getScene(row, column);\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\tif (e === 38){\r\n\t\t\tmoveLeft = true;\r\n\t\t\tmoveRight = true;\r\n\t\t\tmoveDown = true;\r\n\t\t\tfor (row = 0; row < 10; row++){\r\n\t\t\t\tfor (column = 0; column < 10; column++){\r\n\t\t\t\t\tif (objectsL1[row][column] !== floor &&\r\n\t\t\t\t\t\tobjectsL1[row][column] !== wall &&\r\n objectsL1[row][column] !== l_rug &&\r\n\t\t\t\t\t\tplayer.x >= column * 64 - moveSpeed - 32 &&\r\n\t\t\t\t\t\tplayer.x <= (column + 1) * 64 + moveSpeed &&\r\n\t\t\t\t\t\tplayer.y >= (row + 1)* 64 &&\r\n\t\t\t\t\t\tplayer.y <= (row + 1) * 64 + moveSpeed\r\n\t\t\t\t\t){\r\n\t\t\t\t\t\tmoveUp = false;\r\n\t\t\t\t\t\tsceneLevel1Index = getScene(row, column);\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}", "isAdjacent(tile){\n\t\tif(Math.abs(tile.pos - emptyTile.pos) === 1 || Math.abs(tile.pos - emptyTile.pos) === this.cols) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function checkDirection(side){\n if(placedTile[side].condition == \"road\" && direction != backwards[side]){\n // console.log(\"tile has a top road\");\n direction = side;\n var newTile = gameState.filter(function(tile){\n return tile.position.x == placedTile.position.x && tile.position.y == (placedTile.position.y + 1);\n })[0];\n\n return checkForTerminus(newTile, false, direction);\n }\n }", "function checkRegularMovement() {\r\n if ((Math.abs(newPositionX - oldPositionX) == 1) && (event.target.getAttribute(\"src\") == emptyImage)) {\r\n if (isWhiteTurn && (newPositionY - 1 == oldPositionY)) {\r\n isLegalMovement = true;\r\n }\r\n if (!isWhiteTurn && (oldPositionY - 1 == newPositionY)) {\r\n isLegalMovement = true;\r\n }\r\n }\r\n}", "hasMoved() {\n return (this.color === Color.WHITE && this.row !== 6)\n || (this.color === Color.BLACK && this.row !== 1);\n }", "function isMovable(x, y) {\n var currentEmptyTileX = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE;\n var currentEmptyTileY = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE;\n \n // LS: x - WIDTH_HEIGHT_OF_TILE == currentEmptyTileX\n // RS: x + WIDTH_HEIGHT_OF_TILE == currentEmptyTileX\n if (y == currentEmptyTileY && \n (x - WIDTH_HEIGHT_OF_TILE == currentEmptyTileX ||\n x + WIDTH_HEIGHT_OF_TILE == currentEmptyTileX)) {\n return true;\n }\n \n // Top: y - WIDTH_HEIGHT_OF_TILE == currentEmptyTileY\n // Bottom: y + WIDTH_HEIGHT_OF_TILE == currentEmptyTileY\n if (x == currentEmptyTileX &&\n (y - WIDTH_HEIGHT_OF_TILE == currentEmptyTileY ||\n y + WIDTH_HEIGHT_OF_TILE == currentEmptyTileY)) {\n return true;\n }\n \n return false;\n }", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "checkCollisionTwo() {\n if (player.x + player.size / 2 > this.x && player.x - player.size / 2 < this.x + this.width) {\n if (player.y - player.size / 2 < this.y && player.y + player.size / 2 > this.y + this.height) {\n currentState = 1;\n }\n }\n }", "onTileClicked(e){\n var w = this.map.tilewidth;\n var h = this.map.tileheight;\n var scrollLeft = document.documentElement.scrollLeft;\n var scrollTop = document.documentElement.scrollTop;\n\n var mx = e.src.pageX-scrollLeft;\n var my = e.src.pageY-scrollTop;\n \n var nodes = document.elementsFromPoint(mx,my);\n var tilenodes = nodes;//nodes.filter(n => n.classList.contains(\"tile\"));\n console.log(\"objects in proximity of click\", tilenodes)\n var target = tilenodes.shift();\n console.log(mx,my)\n console.log(\"top most object\", target);\n // console.log(this.renderer.screenXY_to_mapXY(mx+scrollLeft,my+scrollTop));\n }", "function tileClick() {\n\tmoveOneTile(this);\n}", "function checkExtraForcedJumpAndReact(){\r\n expectedOldPositionX = newPositionX;\r\n expectedOldPositionY = newPositionY;\r\n if(ExtraForcedJump(parseInt(expectedOldPositionX), parseInt(expectedOldPositionY))) {\r\n isExtraForcedJump = true;\r\n announcePlayerExtraForcedJump();\r\n document.getElementById(\"chessBoard\").removeEventListener(\"dragover\", destinationEvent);\r\n document.getElementById(\"chessBoard\").addEventListener(\"drag\", originalLocationEvent);\r\n }\r\n}", "turn(event) {\n if (typeof DATA.boardCells[event.target.id] === 'number') {\n this.playerMove(event.target.id, DATA.human)\n if (!this.checkWin(DATA.boardCells, DATA.human) && !this.checkTie()) this.playerMove(this.aiMove(), DATA.ai);\n }\n }", "detectClicks() {\n if (\n hand.x > this.x &&\n hand.y > this.y &&\n hand.x < this.x + this.markerW &&\n hand.y < this.y + this.markerH\n ) {\n return true;\n } else {\n return false;\n }\n }", "onKeyDown(event){\r\n let movable = 1;\r\n\tswitch(event.keyCode){\r\n\t\tcase cc.macro.KEY.down:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.y += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.up:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) )\r\n movable = 0;\r\n } \r\n\t\t\tthis.tiledTile.y += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.left:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.right:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\t\t\t\r\n\t}\r\n}", "_setClickedEvent(x, y) {\n this.selected_event = null;\n this.selected_event_moved = false;\n this.selected_top = false;\n this.selected_bot = false;\n for (const e of events) {\n // skip checking events that are not in view\n if ((e.end_date < this.origin_date) || (e.start_date > this.next_origin_date)) {\n continue;\n }\n let e_col = inWeek(e.start_date.getDay() - this.originOffsetFromSunday);\n const e_x_min = this._getSidebarPx() + this.left_col_px + e_col*this._colWidth()+1 + e.layer*this._colWidth()*0.1;\n const e_x_max = e_x_min + 0.9*this._colWidth() - e.layer*this._colWidth()*0.1;\n const e_y_min = Math.max(this._hoursMinsToY(e.start_date.getHours(), e.start_date.getMinutes()), this.top_row_px);\n const e_y_max = this._hoursMinsToY(e.end_date.getHours(), e.end_date.getMinutes());\n\n if ((x >= e_x_min && x <= e_x_max) && (y >= e_y_min && y <= e_y_max)) {\n if ((this.selected_event === null) || (this.selected_event.layer < e.layer)) {\n this.selected_event = e;\n this.selected_top = (y >= e_y_min && y <= e_y_min + EDGE_SIZE) ? true : false;\n this.selected_bot = (y <= e_y_max && y >= e_y_max - EDGE_SIZE) ? true : false;\n //break;\n }\n }\n }\n }", "checkTileHit(x, y){\n\t\tif(!this.grid[x][y]['isHit']){\n\t\t\tvar didHit = false;\n\t\t\tthis.grid[x][y]['isHit'] = true;\n\n\t\t\tswitch(this.grid[x][y]['isShip']){\n\t\t\t\tcase shipType.CARRIER:\n\t\t\t\t\tthis.ships.CARRIER--;\n\t\t\t\t\tif(this.ships.CARRIER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte hangarfartyget.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte hangarfartyget.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte hangarfartyget.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte hangarfartyget.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.BATTLESHIP:\n\t\t\t\t\tthis.ships.BATTLESHIP--;\n\t\t\t\t\tif(this.ships.BATTLESHIP == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte slagsskeppet.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte slagsskeppet.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte slagsskeppet.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte slagsskeppet.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.CRUISER:\n\t\t\t\t\tthis.ships.CRUISER--;\n\t\t\t\t\tif(this.ships.CRUISER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte kryssaren.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte kryssaren.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte kryssaren.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte kryssaren.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.SUBMARINE:\n\t\t\t\t\tthis.ships.SUBMARINE--;\n\t\t\t\t\tif(this.ships.SUBMARINE == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte ubåten.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte ubåten.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte ubåten.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte ubåten.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.DESTROYER:\n\t\t\t\t\tthis.ships.DESTROYER--;\n\t\t\t\t\tif(this.ships.DESTROYER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte jagaren.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte jagaren.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte jagaren.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte jagaren.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(this.isPlayer){\n\t\t\t\t$(\".player-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isHit\", \"true\");\n\n\t\t\t\tif(didHit){\n\t\t\t\t\t$(\".player-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isShip\", \"true\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$(\".enemy-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isHit\", \"true\");\n\n\t\t\t\tif(didHit){\n\t\t\t\t\t$(\".enemy-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isShip\", \"true\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.isPlayer){\n\t\t\t\tp2.shots++;\n\t\t\t\tif(didHit){\n\t\t\t\t\tp2.hits++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tp1.shots++;\n\t\t\t\tif(didHit){\n\t\t\t\t\tp1.hits++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\twasHit: false,\n\t\t\t\tshipHit: didHit\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\twasHit: true\n\t\t};\n\t}", "isObstacle(col, row) {\n return this.maze_.map.getTile(row, col) === SquareType.OBSTACLE;\n }", "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "function makeMovement(event){\n\tvar x = event.clientX - canvas.offsetLeft;\n\tvar y = event.clientY - canvas.offsetTop;\n\tvar col = Math.floor(y / pieceSize) ;\n\tvar row = Math.floor(x / pieceSize) ;\n\t// Check if it's turn of IA or Player;\n\tif (turn==0){\n\t\tplay(row,col);\n\t}\n\tif (turn==1){\n\t\tvar pos = minMax(MINMAX_DEPTH,INIT_MINMAX_FLAG,pieces,validPlays);\n\t\tplay(pos[0],pos[1]);\n\t}\n}", "function checkNeighbors(tile, currentID) {\n\n setTimeout(() => {\n // North \n if (currentID > 9) {\n const newID = tiles[N(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // North-East\n if (currentID > 9 && !isRightEdge(currentID)) {\n const newID = tiles[NE(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // East\n if (currentID > -1 && !isRightEdge(currentID)) {\n const newID = tiles[E(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // South-East\n if (currentID < 89 && !isRightEdge(currentID)) {\n const newID = tiles[SE(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // South\n if (currentID < 90) {\n const newID = tiles[S(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // South-West\n if (currentID < 90 && !isLeftEdge(currentID)) {\n const newID = tiles[SW(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // West\n if (currentID > 0 && !isLeftEdge(currentID)) {\n const newID = tiles[W(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n \n // North-West\n if (currentID > 10 && !isLeftEdge(currentID)) {\n const newID = tiles[NW(currentID)].id;\n const newTile = document.getElementById(newID);\n click(newTile);\n }\n }, 10);\n}", "function checkMove(){\n var iMove = gMan.i + gDirec.i;\n var jMove = gMan.j + gDirec.j;\n var canMove = true;\n \n \n if (gArr[iMove][jMove]=== 'W') return false; //` into wall box\n // var nextCellWAllObj = isElsInPos(iMove,jMove,'W');//` into wall box\n // if( nextCellWAllObj !=null ) return false;\n var nextCellBoxObj = isElsInPos(iMove,jMove,'B');\n if (nextCellBoxObj !=null ){ //` pusshing box\n if (gArr[iMove+ gDirec.i][jMove+ gDirec.j]=== 'W') return false; //` into wall box\n //var wall = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'W');//` into wall box\n var box = isElsInPos(iMove+ gDirec.i,jMove+ gDirec.j,'B');//` into another box\n if(box !=null ){\n return false;\n }else{\n objsToMove.push(nextCellBoxObj); \n }\n }\n return true\n}", "move(direction) {\n // NOTE: West movement should -- and east should ++. Need to work on map orientation\n if (direction === \"north\" && this.currentCell.hasLink(this.currentCell.north) === true) {\n //alert(\"north\");\n this.y++;\n this.currentCell = this.currentCell.north;\n }\n if (direction === \"west\" && this.currentCell.hasLink(this.currentCell.west) === true) {\n //alert(\"west\");\n this.x--;\n this.currentCell = this.currentCell.west;\n }\n if (direction === \"south\" && this.currentCell.hasLink(this.currentCell.south) === true) {\n //alert(\"south\");\n this.y--;\n this.currentCell = this.currentCell.south;\n }\n if (direction === \"east\" && this.currentCell.hasLink(this.currentCell.east) === true) {\n //alert(\"east\");\n this.x++;\n this.currentCell = this.currentCell.east;\n }\n }", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "function detectNextBlock_DownLeft (x,y,h,w)\n {\n var mapCoordY = (y + h)/ h;\n var mapCoordX = (x) / w;\n \n mapCoordX = Math.floor(mapCoordX);\n mapCoordY = Math.floor(mapCoordY);\n \n //Frage\n //var stoneBool = (Crafty.e('Stone') == map_comp[mapCoordY-1][mapCoordX-1]);\n //console.log(\"Is Stone: \" + stoneBool);\n return map[mapCoordY-1][mapCoordX-1];\n }", "function checkHit(x,y,which){\n\t//lets change the x and y coords (mouse) to match the transform\n\tx=x-BOARDX;\n\ty=y-BOARDY;\t\n\t//go through ALL of the board\n\tfor(i=0;i<BOARDWIDTH;i++){\n\t\tfor(j=0;j<BOARDHEIGHT;j++){\n\t\t\tvar drop = boardArr[i][j].myBBox;\n\t\t\t//document.getElementById('output2').firstChild.nodeValue+=x +\":\"+drop.x+\"|\";\n\t\t\tif(x>drop.x && x<(drop.x+drop.width) && y>drop.y && y<(drop.y+drop.height) && boardArr[i][j].droppable && boardArr[i][j].occupied == ''){\n\t\t\t\t\n\t\t\t\t//NEED - check is it a legal move???\n\t\t\t\t//if it is - then\n\t\t\t\t//put me to the center....\n\t\t\t\tsetTransform(which,boardArr[i][j].getCenterX(),boardArr[i][j].getCenterY());\n\t\t\t\t//fill the new cell\n\t\t\t\t//alert(parseInt(which.substring((which.search(/\\|/)+1),which.length)));\n\t\t\t\tgetPiece(which).changeCell(boardArr[i][j].id,i,j);\n\t\t\t\t//change other's board\n\t\t\t\tchangeBoardAjax(which,i,j,'changeBoard',gameId);\n\t\t\t\t\n\t\t\t\t//change who's turn it is\n\t\t\t\tchangeTurn();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\t\n\t}\n\treturn false;\n}", "find_possible_directions(map, sprite_xpos, sprite_ypos) {\r\n \r\n // Possible new directions\r\n var new_directions = [\r\n { name: 'UP', dEnum: this.directionEnum.UP, value: 1 },\r\n { name: 'RIGHT', dEnum: this.directionEnum.RIGHT, value: 1 },\r\n { name: 'DOWN', dEnum: this.directionEnum.DOWN, value: 1 },\r\n { name: 'LEFT', dEnum: this.directionEnum.LEFT, value: 1 }\r\n ];\r\n\r\n // we can change direction - but we cannot reverse direction (normally)\r\n // So remove opposite directions from possibles\r\n var in_ghost_house = this.in_ghost_house();\r\n \r\n // Stop reverse direction. \r\n if (in_ghost_house == false) \r\n { // If we are not in the ghost house then we cannot reverse direction. \r\n if (this.ghost.direction_current != null) { \r\n if (this.ghost.direction_current.dEnum == this.directionEnum.UP) { new_directions[this.directionEnum.DOWN].value = 0; }\r\n if (this.ghost.direction_current.dEnum == this.directionEnum.RIGHT) { new_directions[this.directionEnum.LEFT].value = 0; }\r\n if (this.ghost.direction_current.dEnum == this.directionEnum.DOWN) { new_directions[this.directionEnum.UP].value = 0; }\r\n if (this.ghost.direction_current.dEnum == this.directionEnum.LEFT) { new_directions[this.directionEnum.RIGHT].value = 0; }\r\n }\r\n }\r\n\r\n // If in ghost house and release count > 0;\r\n // stop left and right movement.\r\n if (in_ghost_house && this.ghost.release_count > 0) {\r\n // If we are in the ghost house restric left and right movement.\r\n new_directions[this.directionEnum.LEFT].value = 0;\r\n new_directions[this.directionEnum.RIGHT].value = 0;\r\n }\r\n\r\n\r\n // Do any of the surrounding tiles prevent movement ?\r\n // Remove direction available to travel based on the map tile\r\n var map_tiles = new Array(' ', '.','p');\r\n var surrounding_tiles = map.get_map_surrounding_tiles_pixel_coords(sprite_xpos, sprite_ypos); \r\n\r\n // Allow ghost through door of ghost house.\r\n if (this.sprite.status == this.statusEnum.DEAD && surrounding_tiles[2].value=='x') {\r\n map_tiles.push('x');\r\n }\r\n else if (this.ghost.release_count == 0 && surrounding_tiles[0].value=='x') {\r\n map_tiles.push('x');\r\n }\r\n\r\n\r\n if (map_tiles.indexOf(surrounding_tiles[this.directionEnum.UP].value) == -1)\r\n new_directions[this.directionEnum.UP].value = 0;\r\n\r\n if (map_tiles.indexOf(surrounding_tiles[this.directionEnum.RIGHT].value) == -1)\r\n new_directions[this.directionEnum.RIGHT].value = 0;\r\n\r\n if (map_tiles.indexOf(surrounding_tiles[this.directionEnum.DOWN].value) == -1)\r\n new_directions[this.directionEnum.DOWN].value = 0;\r\n\r\n if (map_tiles.indexOf(surrounding_tiles[this.directionEnum.LEFT].value) == -1)\r\n new_directions[this.directionEnum.LEFT].value = 0; \r\n\r\n return new_directions;\r\n }", "function defensive_move() {\n \n if ($(cells[left_upper_cell]).hasClass(user_clicked)){\n if ($(cells[upper_center_cell]).hasClass(user_clicked) && $(cells[right_upper_cell]).hasClass(empty_cell)) return right_upper_cell;\n if ($(cells[right_upper_cell]).hasClass(user_clicked) && $(cells[upper_center_cell]).hasClass(empty_cell)) return upper_center_cell;\n if ($(cells[left_center_cell]).hasClass(user_clicked) && $(cells[left_lower_cell]).hasClass(empty_cell)) return left_lower_cell;\n if ($(cells[left_lower_cell]).hasClass(user_clicked) && $(cells[left_center_cell]).hasClass(empty_cell)) return left_center_cell;\n if ($(cells[center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(user_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n } \n\n if ($(cells[upper_center_cell]).hasClass(user_clicked)){\n if ($(cells[center_cell]).hasClass(user_clicked) && $(cells[lower_center_cell]).hasClass(empty_cell)) return lower_center_cell;\n if ($(cells[lower_center_cell]).hasClass(user_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n if ($(cells[right_center_cell]).hasClass(user_clicked) && $(cells[right_upper_cell]).hasClass(empty_cell)) return right_upper_cell;\n if ($(cells[left_center_cell]).hasClass(user_clicked) && $(cells[left_upper_cell]).hasClass(empty_cell)) return left_upper_cell;\n }\n\n if ($(cells[lower_center_cell]).hasClass(user_clicked)){\n if ($(cells[right_center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[left_center_cell]).hasClass(user_clicked) && $(cells[left_lower_cell]).hasClass(empty_cell)) return left_lower_cell;\n } \n\n if ($(cells[left_center_cell]).hasClass(user_clicked)){\n if ($(cells[center_cell]).hasClass(user_clicked) && $(cells[right_center_cell]).hasClass(empty_cell)) return right_center_cell;\n if ($(cells[right_center_cell]).hasClass(user_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n } \n\n if ($(cells[left_lower_cell]).hasClass(user_clicked)){\n if ($(cells[lower_center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(user_clicked) && $(cells[lower_center_cell]).hasClass(empty_cell)) return lower_center_cell;\n } \n\n if ($(cells[right_upper_cell]).hasClass(user_clicked)){\n if ($(cells[center_cell]).hasClass(user_clicked) && $(cells[left_lower_cell]).hasClass(empty_cell)) return left_lower_cell;\n if ($(cells[left_lower_cell]).hasClass(user_clicked) && $(cells[center_cell]).hasClass(empty_cell)) return center_cell;\n if ($(cells[right_center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(empty_cell)) return right_lower_cell;\n if ($(cells[right_lower_cell]).hasClass(user_clicked) && $(cells[right_center_cell]).hasClass(empty_cell)) return right_center_cell;\n } \n\n if (($(cells[left_upper_cell]).hasClass(empty_cell) && $(cells[upper_center_cell]).hasClass(user_clicked) && $(cells[right_upper_cell]).hasClass(user_clicked)) || \n ($(cells[left_upper_cell]).hasClass(empty_cell) && $(cells[left_center_cell]).hasClass(user_clicked) && $(cells[left_lower_cell]).hasClass(user_clicked)) ||\n ($(cells[left_upper_cell]).hasClass(empty_cell) && $(cells[center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(user_clicked))) return left_upper_cell;\n\n if ($(cells[upper_center_cell]).hasClass(empty_cell) && $(cells[center_cell]).hasClass(user_clicked) && $(cells[lower_center_cell]).hasClass(user_clicked)) return upper_center_cell;\n\n if ($(cells[left_center_cell]).hasClass(empty_cell) && $(cells[center_cell]).hasClass(user_clicked) && $(cells[right_center_cell]).hasClass(user_clicked)) return left_center_cell; \n\n if ($(cells[left_lower_cell]).hasClass(empty_cell) && $(cells[lower_center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(user_clicked)) return left_lower_cell;\n\n if (($(cells[right_upper_cell]).hasClass(empty_cell) && $(cells[center_cell]).hasClass(user_clicked) && $(cells[left_lower_cell]).hasClass(user_clicked)) || \n ($(cells[right_upper_cell]).hasClass(empty_cell) && $(cells[right_center_cell]).hasClass(user_clicked) && $(cells[right_lower_cell]).hasClass(user_clicked))) return right_upper_cell;\n \n }", "handleMouseDown(row, col) {\n const { grid, mainIsPressed } = this.state;\n const node = grid[row][col];\n if (node.isStart === true && node.isFinish === false) {\n this.setState({ mainIsPressed: \"start\" });\n node.isStart = false;\n }\n if (node.isFinish === true && node.isStart === false) {\n this.setState({ mainIsPressed: \"finish\" });\n node.isFinish = false;\n }\n if (mainIsPressed === \"\") {\n const newGrid = gridWithWallToggled(grid, row, col);\n this.setState({ grid: newGrid, mouseIsPressed: true });\n }\n }", "collisionEdge(){\n if(this.y - this.r < 0 || this.y + this.r > height)\n return true;\n return false;\n }", "function checkBelow(row, column) {\n if (!isEdge(row + 1, column) && tileArray[row][column] != null) {\n if (document.getElementById(\"center-tile\").style.backgroundColor == tileArray[row][column].style.backgroundColor) {\n return true;\n } else {\n return false;\n }\n } else {\n return !tileArray[row + 1][column];\n }\n }", "handleMove(e) {\n this.handleStartHover = !this.disabled && inBounds(e, this.handleStart);\n this.handleEndHover = !this.disabled && inBounds(e, this.handleEnd);\n }", "function handleDragEvent(type, clientX, clientY) {\n // Center point in gameArea\n var x = clientX - gameArea.offsetLeft;\n var y = clientY - gameArea.offsetTop;\n var row, col;\n // Is outside gameArea?\n if (x < 0 || y < 0 || x >= gameArea.clientWidth || y >= gameArea.clientHeight) {\n console.log(\"outside gameArea\");\n if (draggingPiece) {\n // Drag the piece where the touch is (without snapping to a square).\n var size = getSquareWidthHeight();\n setDraggingPieceTopLeft({top: y - size.height / 2, left: x - size.width / 2});\n } else {\n return;\n }\n } else {\n // Inside gameArea. Let's find the containing square's row and col\n var col = Math.floor(colsNum * x / gameArea.clientWidth);\n var row = Math.floor(rowsNum * y / gameArea.clientHeight);\n console.log(\"now at: \", row, col);\n\n //check if the help screen is Hide\n //var helpModel = document.getElementById(\"helpModal\");\n //var helpModelHideCheck = helpModel.getAttribute(\"class\");\n //var isHelpModelHide;\n //if (helpModelHideCheck === \"overlayModal ng-hide\") isHelpModelHide = true;\n //else isHelpModelHide = false;\n //\n //console.log(\"isHelpModelHide\", isHelpModelHide);\n\n\n //console.log(\"isHelpIconClicked\", isHelpIconClicked);\n\n //if (isHelpIconClicked) {\n // isHelpIconClicked = false;\n // return;\n //}\n\n if (type === \"touchstart\" && !draggingStartedRowCol) {\n // drag started\n draggingStartedRowCol = {row: row, col: col};\n\n if (($scope.stateAfterMove[key(row, col)] !== null)//not hide\n && ($scope.stateAfterMove[key(row, col)] !== '')//has piece\n && ((($scope.turnIndex === 0) && ($scope.stateAfterMove[key(row, col)][0] ==='R'))//red piece can move\n || (($scope.turnIndex === 1) && ($scope.stateAfterMove[key(row, col)][0] ==='B'))//blue piece can move\n )\n ){\n draggingPiece = document.getElementById(\"img_\" + draggingStartedRowCol.row + \"x\" + draggingStartedRowCol.col);\n }\n }\n if (type === \"touchend\") {\n var from = draggingStartedRowCol;\n var to = {row: row, col: col};\n dragDone(from, to);\n } else {\n // Drag continue\n var size = getSquareWidthHeight();\n setDraggingPieceTopLeft({top: y - size.height / 2, left: x - size.width / 2});\n }\n }\n if (type === \"touchend\" || type === \"touchcancel\" || type === \"touchleave\") {\n // drag ended\n // return the piece to it's original style (then angular will take care to hide it).\n setDraggingPieceTopLeft(getSquareTopLeft(draggingStartedRowCol.row, draggingStartedRowCol.col));\n draggingStartedRowCol = null;\n if (draggingPiece !== null) {\n draggingPiece.removeAttribute(\"style\");//fix broken UI\n draggingPiece = null;\n }\n }\n }", "function checkMove ( moveX, moveY, newTetromino ) {\r\n //If the tetromino is simply moving along with the arrow key\r\n if ( newTetromino == undefined ) {\r\n newTetromino = tetromino;\r\n }\r\n \r\n for ( let y = 0; y < TETROMINO_SIZE; y++ ) {\r\n for ( let x = 0; x < TETROMINO_SIZE; x++ ) {\r\n\r\n if ( newTetromino[y][x] != 0 ) {\r\n let newX = tetromino_x + x + moveX;\r\n let newY = tetromino_y + y + moveY;\r\n\r\n if ( newX < 0 || newY < 0 || FIELD_COLUMN <= newX || FIELD_ROW <= newY\r\n || field[newY][newX] != 0 ) {\r\n return false;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return true;\r\n}", "move(event){\n this.xyE = this.getXY(event);\n }", "handleCollTop(obj, tileTop) {\n if (obj.bottom > tileTop && obj.bottomOld <= tileTop) {\n obj.bottom = tileTop - 0.01;\n obj.velY = 0;\n return true;\n }\n return false;\n }", "function middleClickHandler(e) {\n\n if (e && e.which == 3) {\n rightClickDown = true;\n } else if (e && e.which == 1) {\n leftClickDown = true;\n }\n\n // simultaneous left and right click\n if (leftClickDown && rightClickDown) {\n // console.log('both clicked');\n e.preventDefault();\n let rowCol = cellIdNumToRowCol(parseInt((this.id).substring(1)), currentGridWidth);\n let row = rowCol[0], col = rowCol[1];\n \n if (grid[row][col].label > 0 && grid[row][col].isVisible) { \n\n let numFlaggedCorrect = 0;\n let numFlaggedIncorrect = 0;\n let neighborCoordinates = [];\n\n // look around the neighbour and if flag and mine matches\n for (let i = 0; i < NUM_DIRECTIONS; i++) {\n let neighborRow = row + dRow[i];\n let neighborCol = col + dCol[i];\n\n if (!isInBounds(neighborRow, neighborCol, currentGridWidth, currentGridHeight)) continue;\n \n if (!grid[neighborRow][neighborCol].isVisible && grid[neighborRow][neighborCol].rightClickStatus === 0) {\n let cellNum = rowColToCellNum(neighborRow, neighborCol, currentGridWidth);\n markCellColorVisible(gameSvg.childNodes[cellNum], \"blue\");\n }\n\n ////\n if (grid[neighborRow][neighborCol].rightClickStatus === 1) {\n if (grid[neighborRow][neighborCol].isMine) {\n numFlaggedCorrect++;\n } else {\n numFlaggedIncorrect++;\n }\n }\n\n if (!grid[neighborRow][neighborCol].isMine && !grid[neighborRow][neighborCol].isVisible) {\n neighborCoordinates.push([neighborRow, neighborCol]);\n }\n ////\n\n } // end for\n\n if (numFlaggedIncorrect > 0) {\n gameLose();\n return;\n }\n\n // highlight neighboring cells that are not visible yet\n if (numFlaggedCorrect === grid[row][col].label && neighborCoordinates.length > 0) {\n setNonMineNeighborVisible(neighborCoordinates);\n }\n }\n }\n\n // middle click only\n // implementation is mostly same as above\n if (e && e.which == 2) {\n e.preventDefault();\n let rowCol = cellIdNumToRowCol(parseInt((this.id).substring(1)), currentGridWidth);\n let row = rowCol[0], col = rowCol[1];\n\n // middle click on a visible cell, make sure it's not an empty cell\n if (grid[row][col].label > 0 && grid[row][col].isVisible) { \n \n let numFlaggedCorrect = 0;\n let numFlaggedIncorrect = 0;\n let neighborCoordinates = [];\n\n // look around the neighbour and if flag and mine matches\n for (let i = 0; i < NUM_DIRECTIONS; i++) {\n let neighborRow = row + dRow[i];\n let neighborCol = col + dCol[i];\n\n if (!isInBounds(neighborRow, neighborCol, currentGridWidth, currentGridHeight)) continue;\n \n if (grid[neighborRow][neighborCol].rightClickStatus === 1) {\n if (grid[neighborRow][neighborCol].isMine) {\n numFlaggedCorrect++;\n } else {\n numFlaggedIncorrect++;\n }\n }\n\n if (!grid[neighborRow][neighborCol].isMine && !grid[neighborRow][neighborCol].isVisible) {\n neighborCoordinates.push([neighborRow, neighborCol]);\n }\n } // end for\n \n if (numFlaggedIncorrect > 0) {\n gameLose();\n return;\n }\n if (numFlaggedCorrect === grid[row][col].label && neighborCoordinates.length > 0) {\n setNonMineNeighborVisible(neighborCoordinates);\n }\n }\n\n }\n return false;\n}", "function check_move(x, y, newx, newy, dir) {\n // if the map ends in either direction, disallow the desired move\n if (player['x'] === 0 && dir === 2) return false;\n if (player['x'] === MAP_WIDTH-1 && dir === 0) return false;\n if (player['y'] === 0 && dir === 1) return false;\n if (player['y'] === MAP_HEIGHT-1 && dir === 3) return false;\n\n // disallow moves onto lava\n if (map[newy][newx]['type'] === ' ') {\n return false;\n }\n\n // don't allow moves onto tiles that are currently rotating\n if (map[newy][newx]['tweenrot'] !== 0) {\n return false;\n }\n\n // (dir + 2) % 4 checks the side opposite the side we are moving into\n // eg. o if we are moving left ONTO this object, then dir = 2,\n // o o <- so then (dir+2)%4 = 0, meaning the right side must be \n // x open, 0, for us to be able to move onto it, which is true.\n // \n // o if instead we wanted to move up, dir=1, onto this object,\n // o o then (dir+2)%4 = 3, which corrosponds to the bottom, which is\n // x 1 in this case, so we cannot complete this move.\n // ^\n // |\n //\n // the blocked list for this object would be: [right, top, left, bottom] = [0,0,0,1]\n if ( !(is_blocked(newx, newy, (dir + 2) % 4, false))\n && !(is_blocked(x, y, (dir + 2) % 4, true)) ) {\n return true;\n }\n //console.log(\"direction IS blocked\");\n return false;\n}", "clickTile(row, col, button){\n //If left mouse button\n if (button == 0){\n if(this.grid[row][col].isBomb && !this.grid[row][col].isFlagged){\n this.grid[row][col].isTrigger = true;\n this.gameOver = true;\n this.drawSmiley(this.smileyCtx, 'dead')\n }\n this.revealTile(row, col);\n\n } else if(button == 2 && !this.grid[row][col].isRevealed){\n this.flagTile(row,col);\n\n }\n if (this.gameWon()){\n this.gameOver = true;\n this.draw();\n this.drawSmiley(this.smileyCtx, 'shades');\n return true;\n }\n this.draw();\n this.drawBombsLeft();\n return false;\n }", "move() {\n //Move the kid to the determined location\n this.x = this.nextMoveX;\n this.y = this.nextMoveY;\n //Check in case the kid touches the edges of the map,\n // if so, prevent them from leaving.\n this.handleConstraints();\n }", "function on_edge(a, e) {\n var tol = 0.01;\n var origin = e.get_origin();\n var dest = e.get_dest();\n var l1 = Math.sqrt((a.x - origin.x) * (a.x - origin.x) + (a.y - origin.y) * (a.y - origin.y));\n if (l1 < tol) {\n return true;\n }\n var l2 = Math.sqrt((a.x - dest.x) * (a.x - dest.x) + (a.y - dest.y) * (a.y - dest.y));\n if (l2 < tol) {\n return true;\n }\n var l = Math.sqrt((origin.x - dest.x) * (origin.x - dest.x) + (origin.y - dest.y) * (origin.y - dest.y));\n if (l1 > l || l2 > l) {\n return false;\n }\n if (Math.abs(l1 + l2 - l) < tol) {\n return true;\n }\n else {\n return false;\n }\n }", "checkCollisionOne() {\n if (player.x + player.size / 2 > this.x && player.x - player.size / 2 < this.x + this.width) {\n if (player.y + player.size / 2 > this.y && player.y - player.size / 2 < this.y + this.height) {\n currentState = 1;\n }\n }\n }", "edges() {\r\n if (this.pos.x > width) {\r\n this.pos.x = 0;\r\n this.updatePrev();\r\n }\r\n if (this.pos.x < 0) {\r\n this.pos.x = width;\r\n this.updatePrev();\r\n }\r\n if (this.pos.y > height) {\r\n this.pos.y = 0;\r\n this.updatePrev();\r\n }\r\n if (this.pos.y < 0) {\r\n this.pos.y = height;\r\n this.updatePrev();\r\n }\r\n\r\n }", "didSnakeEatItself() {\n const snakeHeadLocation = this.snake.segments[this.snake.segments.length - 1];\n this.snake.segments.forEach((segment, idx) => {\n if (idx !== this.snake.segments.length - 1) {\n if (snakeHeadLocation.x === segment.x && snakeHeadLocation.y === segment.y) {\n this.gameOver();\n }\n }\n });\n }", "check() { \r\n if (this.movement.x === 0 && this.movement.y === 0) {\r\n if(this.game.player.unit === this) { //Check if unit belongs to client's player\r\n this.socket.emit('Desync check', this.number, 0, 0, this.side); //Desync check sent to server\r\n }\r\n this.moving = false; //Stops any movement\r\n this.mouseMovement = false;\r\n if(this.side) { //Changes png to Idle\r\n this.image = this.idleRight;\r\n } else {\r\n this.image = this.idleLeft;\r\n }\r\n }\r\n }", "function HittingTheWall() {\n for (let i = 0; i < curTetromino.length; i++) {\n let newX = curTetromino[i][0] + startX;\n if (newX <= 0 && direction === DIRECTION.LEFT) {\n return true;\n } else if (newX >= 11 && direction === DIRECTION.RIGHT) {\n return true;\n }\n }\n return false;\n}", "isOver() {\n return !( this.hasMove('white') || this.hasMove('black') );\n }", "function checkSideCollision(rectOne, rectTwo) {\n \n // Check whether the previous y location is greater than the top of the platform\n if (prevX - rectOne.width > rectTwo.x) {\n while (blockCollision(rectOne, rectTwo)) {\n rectOne.x += 0.7;\n }\n }\n // Check whether the previous y location is greater than the top of the platform\n if (prevX + rectOne.width < rectTwo.x + gridSquareSizeX) {\n while (blockCollision(rectOne, rectTwo)) {\n rectOne.x -= 0.7;\n }\n }\n \n}", "function mouseMoveActions(found_hover, found_edge, m) {\n m = m ? m : [0, 0]; //default value\n //Call mouse events\n\n if (current_hover === found_hover && found_hover !== null) {//do nothing\n } else if (found_hover === null && found_edge === null && current_hover === null) {//do nothing\n } else if (found_hover && click_active) {\n //Only run this if there is a click active & a node is hovered\n //Highlight the hovered node on the hover canvas\n clearCanvas([ctx_hover]);\n drawHoveredNode(found_hover); //Draw rotating circle around the hovered node\n\n drawDottedHoverCircle(found_hover);\n } else if (found_edge && click_active) {\n //Only run of there is a click, no node is hovered, but and edge is\n clearCanvas([ctx_hover]);\n node_hover.style('display', 'none'); //Hide the rotating circle\n //Draw the hovered edge in the color of the other side's node\n\n var other_side = found_edge.source.id === current_click.id ? found_edge.target : found_edge.source;\n var line_width = getLineWidth(found_edge) * (transform.k < 1.5 ? 2 : 1);\n drawEdges(ctx_hover, found_edge, other_side.fill, line_width); //Draw both sides of the hovered edge's nodes on top of the edge\n\n drawHoveredNode(current_click);\n drawHoveredNode(other_side); //Draw a tooltip above the mouse position | create an array\n\n var edge_pos = {\n type: 'edge',\n x: m[0],\n y: m[1],\n label: other_side.label,\n node: other_side\n };\n showTooltip(edge_pos);\n } else if (click_active) {\n //Run only if there's a click active, but no node or edge hover\n hideTooltip();\n node_hover.style('display', 'none');\n clearCanvas([ctx_hover]);\n } else if (found_hover && !click_active) {\n //Only run this if there is no click active, but a node hover is found\n found = found_hover;\n setSelection(found);\n drawSelected(); //Draw the selected nodes\n } else {\n //Reset\n hideTooltip();\n nodes_selected = nodes; //Reset the selected nodes\n\n node_hover.style('display', 'none'); //Hide the rotating circle\n\n if (!click_active) mouseOutNode();\n } //else\n\n\n current_hover = found_hover;\n } //function mouseMoveActions", "function mouseMoveActions(found_hover, found_edge, m) {\n m = m ? m : [0, 0]; //default value\n //Call mouse events\n\n if (current_hover === found_hover && found_hover !== null) {//do nothing\n } else if (found_hover === null && found_edge === null && current_hover === null) {//do nothing\n } else if (found_hover && click_active) {\n //Only run this if there is a click active & a node is hovered\n //Highlight the hovered node on the hover canvas\n clearCanvas([ctx_hover]);\n drawHoveredNode(found_hover); //Draw rotating circle around the hovered node\n\n drawDottedHoverCircle(found_hover);\n } else if (found_edge && click_active) {\n //Only run of there is a click, no node is hovered, but and edge is\n clearCanvas([ctx_hover]);\n node_hover.style('display', 'none'); //Hide the rotating circle\n //Draw the hovered edge in the color of the other side's node\n\n var other_side = found_edge.source.id === current_click.id ? found_edge.target : found_edge.source;\n var line_width = getLineWidth(found_edge) * (transform.k < 1.5 ? 2 : 1);\n drawEdges(ctx_hover, found_edge, other_side.fill, line_width); //Draw both sides of the hovered edge's nodes on top of the edge\n\n drawHoveredNode(current_click);\n drawHoveredNode(other_side); //Draw a tooltip above the mouse position | create an array\n\n var edge_pos = {\n type: 'edge',\n x: m[0],\n y: m[1],\n label: other_side.label,\n node: other_side\n };\n showTooltip(edge_pos);\n } else if (click_active) {\n //Run only if there's a click active, but no node or edge hover\n hideTooltip();\n node_hover.style('display', 'none');\n clearCanvas([ctx_hover]);\n } else if (found_hover && !click_active) {\n //Only run this if there is no click active, but a node hover is found\n found = found_hover;\n setSelection(found);\n drawSelected(); //Draw the selected nodes\n } else {\n //Reset\n hideTooltip();\n nodes_selected = nodes; //Reset the selected nodes\n\n node_hover.style('display', 'none'); //Hide the rotating circle\n\n if (!click_active) mouseOutNode();\n } //else\n\n\n current_hover = found_hover;\n } //function mouseMoveActions", "function checkEast()\n{\n\tvar hit : RaycastHit;\n\tvar destinationSquare : int;\n\tsquareCheck = transform.TransformDirection (Vector3(1,0,0));\n if (Physics.Raycast(transform.position, squareCheck, hit, 1))\n {\n // This means there was a hit.\n if(hit.collider.gameObject.tag == \"Inactive White Piece\" && color == 1)\n {\n \t// Piece can be captured\n \tdestinationSquare = (square + 1);\n\n \t// This is a sanity check.\n \tif(destinationSquare < 0 || destinationSquare > 63)\n \t{\n \tdestinationSquare = 64;\n \t}\n\n \t// Add the square to the array.\n \tlegalMoves.push(destinationSquare);\n }\n else if(hit.collider.gameObject.tag == \"Inactive Black Piece\" && color == 0)\n {\n \t// Piece can be captured\n \tdestinationSquare = (square + 1);\n \t// This is a sanity check.\n \tif(destinationSquare < 0 || destinationSquare > 63)\n \t{\n \tdestinationSquare = 64;\n \t}\n\n \t// Add the square to the array.\n \tlegalMoves.push(destinationSquare);\n }\n else\n {\n \t// This triggers when a square is blocked by a piece of the same color.\n }\t\n\n }\n else\n {\n \t// This means nothing was hit, add to array.\n destinationSquare = (square + 1);\n\n // This is a sanity check.\n if(destinationSquare < 0 || destinationSquare > 63)\n {\n destinationSquare = 64;\n }\n\n // Square was empty, so add the square to the array.\n legalMoves.push(destinationSquare);\n }\n}", "function canMove (x,y,dir) {}", "function hit() {\n\t\tvar nx = snake_array[0].x;\n \t\tvar ny = snake_array[0].y;\n \t\t//hit border\n\t\tif(nx == -1 || ny == -1 || nx == w/c_sz || ny == h/c_sz) {\n\t\t\tlose();\n\t\t}\n\n\t\t//hit itself\n\t\tfor(var i = 1; i < snake_array.length; i++) {\n\t\t\tif(snake_array[i].x == nx && snake_array[i].y == ny) {\n\t\t\t\tlose();\n\t\t\t}\n\t\t}\n\t}" ]
[ "0.7157723", "0.70985484", "0.7089717", "0.69289976", "0.68215036", "0.66167843", "0.6593307", "0.6401328", "0.64008695", "0.63955015", "0.6383461", "0.6352068", "0.63304555", "0.6320106", "0.6320106", "0.62783194", "0.6273222", "0.6261163", "0.6261163", "0.6249336", "0.61947095", "0.6191938", "0.6185483", "0.6179196", "0.6178833", "0.61712563", "0.6168091", "0.61421883", "0.61373526", "0.6128731", "0.6121401", "0.6098272", "0.6070917", "0.60680854", "0.6067449", "0.6064807", "0.6048421", "0.60451186", "0.6027417", "0.60241723", "0.60082495", "0.5990112", "0.596312", "0.59568393", "0.59548336", "0.59531015", "0.59502506", "0.5948782", "0.594569", "0.5942031", "0.5940299", "0.5938993", "0.5938214", "0.5918638", "0.591359", "0.5913469", "0.589951", "0.5884026", "0.5883874", "0.5862301", "0.58606774", "0.58552754", "0.5851054", "0.5847177", "0.5844258", "0.58398014", "0.58365816", "0.5833003", "0.5831721", "0.58280706", "0.58231914", "0.58222944", "0.5819641", "0.5818557", "0.5816993", "0.5803147", "0.57998824", "0.57986677", "0.57909846", "0.5765508", "0.5762942", "0.57592636", "0.5756923", "0.5755238", "0.57548636", "0.57547355", "0.5753785", "0.5751674", "0.5743871", "0.5741894", "0.57375175", "0.5736233", "0.5734903", "0.5719946", "0.5712913", "0.5711843", "0.5702003", "0.5702003", "0.56994367", "0.5695808", "0.569573" ]
0.0
-1
Move ALL tiles downward
function moveTilesDown() { for (var column = 3; column >= 0; column--) { for (var row = 2; row >= 0; row--) { if (checkBelow(row, column) && tileArray[row][column] != null) { moveTileDown(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function moveTile() {\n moveTileHelper(this);\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "function moveTilesUp() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 1; row <= 3; row++) {\n if (checkAbove(row, column) && tileArray[row][column] != null) {\n moveTileUp(row, column);\n }\n }\n }\n }", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function mooveDown()\n\t\t{\n\t\t\tfor (var i = 0; i <= 4; i++) \n\t\t\t{\n\t\t\t\tfor (var j = 3; j >= 0; j--) \n\t\t\t\t{\n\t\t\t\t\tvar tile = $('body').find('[data-x='+i+'][data-y='+j+']');\n\n\t\t\t\t\tif($(tile).length > 0)\n\t\t\t\t\t\t$(tile).each(function(){ recursiveMouvementDown(i,j, tile) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreate(1);\n\t\t}", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function moveTileDown(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row + 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n //This happens at the end of each tile's movement\n if (checkRemove(row + 1, column)) {\n $(tileArray[row + 1][column]).remove();\n tileArray[row + 1][column] = null;\n } else {\n tileArray[row + 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4));\n }\n });\n tileArray[row + 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveDown() {\n let prevCol;\n let curCol;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight; y++) {\n if (y === 0) {\n prevCol = get(x * sizeBlock + 1, (sizeHeight - 1) * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function moveDown() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.row++;\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();\n }\n }", "function moveAliensDown() {\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.remove('alien')\n })\n currentAlienPositions = currentAlienPositions.map((alien) => {\n return alien += width\n })\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.add('alien')\n })\n}", "placeEnd(levelIndex) {\n let pos = this.breadthFirst();\n for (let j = pos.y + 5; j >= pos.y - 5; j--) {\n for (let i = pos.x + 5; i >= pos.x - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n if (levelIndex % 2 === 0) {\n this.tiles[pos.y][pos.x] = 'End';\n } else {\n this.tiles[pos.y][pos.x] = 'Start';\n }\n }", "moveDown() {\n dataMap.get(this).moveY = 5;\n }", "moveUp() {\n dataMap.get(this).moveY = -5;\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function moveDown() {\n\t\tfor (col = 0; col < Cols; col++) {\n\t\t\tarrayRow = new Array(Cols);\n\t\t\tfor (row = 0; row < Rows; row++) {\n\t\t\t\tarrayRow[row] = matrix[Rows - 1 - row][col];\n\t\t\t}\n\t\t\tvar temp = newArray(arrayRow).reverse();\n\t\t\tfor (var i = 0; i < Rows; i++) {\n\t\t\t\tmatrix[i][col] = temp[i];\n\t\t\t}\n\t\t}\n\n\t\tdraw();\n\t}", "function moveCol5Dn(grid) {\n for (let i = 0; i < 46; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 45) {\n grid[i].position = 4;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveCol6Dn(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 47) {\n grid[i].position = 5;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveCol7Dn(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 48) {\n grid[i].position = 6;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "shiftCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\t\t\tvar newX = card.x - 20;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "static moveBackwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).forEach(item => {\n if (item.previousSibling && items.indexOf(item.previousSibling) === -1) {\n item.insertBelow(item.previousSibling);\n }\n });\n });\n }", "function moveCol5Up(grid) {\n for (let i = 0; i < 47; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 46;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "static moveForwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).reverse().forEach(item => {\n if (item.nextSibling && items.indexOf(item.nextSibling) === -1) {\n item.insertAbove(item.nextSibling);\n }\n });\n });\n }", "function moveCol7Up(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 48;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}", "move(direction) {\n\n if (!this.gameIsOver()) {\n if (direction == \"up\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (up to down)\n for (var j = 0; j < n; j++) { // for each current (j), will walk down (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // below tile, always starts directly below current (j)\n if (matrix[j][i] == 0) { // if current is 0, move down to next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if below is 0, move onto next below\n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != below, move onto next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == below, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find lowest tile & pull it up\n for (var j = 0; j < n - 1; j++) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find lowest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[full][i] != 0) { // if a below tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"left\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (L to R)\n for (var j = 0; j < n - 1; j++) { // for each current (j), will walk right (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // right tile, always starts directly to the right of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move right to next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if right is 0, move onto next right\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != right, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == right, combine into current & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make right 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find rightmost tile & pull it left (L to R)\n for (var j = 0; j < n - 1; j++) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find rightmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[i][full] != 0) { // if a right tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n\n this.gameState.board = row; // make board the row array\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n\n return;\n } else if (direction == \"right\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (R to L)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk left (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // left tile, always starts directly to the left of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move onto next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if left is 0, move onto next left\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != left, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == left, combine & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make left 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find leftmost tile & pull it\n for (var j = n - 1; j > 0; j--) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find leftmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[i][full] != 0) { // if a left tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"down\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (down to up)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk up (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // above tile, always starts directly above current (j)\n if (matrix[j][i] == 0) { // if current is 0, move up next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if above is 0, move onto above \n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != above, move up next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == above, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find highest tile & pull it down\n for (var j = n - 1; j > 0; j--) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find highest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[full][i] != 0) { // if an above tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n this.callCallbacks();\n return;\n }\n }\n }", "function tween_tiles() {\n for (j=0; j<MAP_HEIGHT; j++) {\n for (i=0; i<MAP_WIDTH; i++) {\n var tile = map[j][i];\n if (map[j][i]['type'] !== ' ') {\n // tween the tiles until they reach their destination\n // MOVEMENT TWEENING\n if (tile['newx'] !== tile['x']) {\n var diffx = Math.abs(tile['x'] - tile['newx']);\n if (tile['newx'] > tile['x']) {\n tile['tweenx'] += TWEENSPEED;\n }\n else if (tile['newx'] < tile['x']) {\n tile['tweenx'] -= TWEENSPEED;\n }\n }\n if (tile['newy'] !== tile['y']) {\n var diffy = Math.abs(tile['y'] - tile['newy']);\n if (tile['newy'] > tile['y']) {\n tile['tweeny'] += TWEENSPEED;\n }\n else if (tile['newy'] < tile['y']) {\n tile['tweeny'] -= TWEENSPEED;\n }\n }\n // swap tiles when they have completed their movement\n // (if they moved at all)\n if (tile['tweenx'] !== 0 || tile['tweeny'] !== 0) {\n if (Math.abs(tile['tweenx']) > TILESIZE * diffx) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n if (Math.abs(tile['tweeny']) > TILESIZE * diffy) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n }\n // ROTATION TWEENING\n if (tile['newangle'] !== tile['angle']) {\n tile['tweenrot'] += TWEENSPEED;\n }\n if (tile['tweenrot'] !== 0) {\n // done rotating\n if (Math.abs(tile['tweenrot']) >= 90) {\n tile['angle'] = tile['newangle'];\n tile['tweenrot'] = 0;\n shift_barriers(i, j);\n }\n }\n\n }\n }\n }\n}", "function MoveElements(data,canvas,imgArray){\n var LENGTH_OF_ONE_TILE = 50;\n var ONE_TILE_DOWN = -50;\n var firstElement = data.elementsToReposition[0].id;\n var lastElement = data.elementsToReposition[data.elementsToReposition.length - 1].id;\n var firstColumn = parseInt(GetXandYCoordinate(firstElement).x);\n var lastColumn = parseInt(GetXandYCoordinate(lastElement).x);\n var firstRow = parseInt(GetXandYCoordinate(firstElement).y);\n var lastRow = parseInt(GetXandYCoordinate(data.elementsToReposition[data.elementsToReposition.length - 1].moveTo).y);\n var heightToClear = ((lastRow - firstRow) + 1) * LENGTH_OF_ONE_TILE;\n var widthToClear = ((lastColumn - firstColumn) + 1) * LENGTH_OF_ONE_TILE;\n var startingX = (parseInt(GetXandYCoordinate(firstElement).x) * LENGTH_OF_ONE_TILE) - LENGTH_OF_ONE_TILE;\n var startingY = (parseInt(GetXandYCoordinate(firstElement).y) * LENGTH_OF_ONE_TILE) - LENGTH_OF_ONE_TILE;\n var counterY = 0;\n var rowsToMove = lastRow - firstRow;\n //Clear all the elements which need to be moved so we can animate movements.\n canvas.clearRect(startingX,startingY,widthToClear,heightToClear);\n //Now we need to move the elements down..\n\n var movingDownDistance = (data.elementsToReposition[0].moveTo - data.elementsToReposition[0].id)/10;//Here we are checking that how many tiles we have to move..\n movingDownDistance = (ONE_TILE_DOWN) * movingDownDistance;\n var movingIntervalTime = 10;\n var timeTakenForAnimation = Math.abs((movingDownDistance * movingIntervalTime)) + 10;\n var movingInterval = setInterval(function(){\n for(var currentElement = (data.elementsToReposition.length - 1);currentElement>=0;currentElement--){\n DrawElements(canvas,GetXandYCoordinate(data.elementsToReposition[currentElement].id).x,GetXandYCoordinate(data.elementsToReposition[currentElement].id).y,counterY,0,imgArray[data.gameArray[data.elementsToReposition[currentElement].moveTo].element],\"white\");\n }\n if(counterY > movingDownDistance){\n counterY-=2;\n }\n },movingIntervalTime);\n setTimeout(function(){\n clearInterval(movingInterval);\n }\n ,timeTakenForAnimation);\n}", "shift() {\n if (this.isDropping) {\n for (var i = 0; i < this.enemies.length; i++) {\n this.enemies[i].position.y += this.speed;\n }\n //reverses direction\n this.dir *= -1;\n this.isDropping = false;\n } else {\n for (var i = 0; i < this.enemies.length; i++) {\n if (this.dir === -1) {\n this.enemies[i].position.x -= this.speed;\n }\n if (this.dir === 1) {\n this.enemies[i].position.x += this.speed;\n }\n }\n }\n }", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "function moveAllGhosts() { ghosts.forEach(ghost => moveGhost(ghost))}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function moveCol6Up(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 47;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function myDown(e){\n canvas.onmousemove=myMove;\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function moveTileUp(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row - 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row - 1, column)) {\n $(tileArray[row - 1][column]).remove();\n tileArray[row - 1][column] = null;\n } else {\n tileArray[row - 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row - 1][column].id.slice(5)) - 4));\n }\n });\n tileArray[row - 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveUp() {\n let prevCol;\n let curCol;\n let temp;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight - 1; y++) {\n if (y === sizeHeight - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, (y + 1) * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect(x * sizeBlock, (y + 1) * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift}", "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'left')\n\t\t{\n\t\t\tmissiles[i]['position'][0] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'up')\n\t\t{\n\t\t\tmissiles[i]['position'][1] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'down')\n\t\t{\n\t\t\tmissiles[i]['position'][1] += 10;\n\t\t}\n\t}\n}", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function moveAll(){\r\n var newX = fabImg.getLeft();\r\n var newY = fabImg.getTop();\r\n\r\n for(var key in allElements){ \r\n var item = allElements[key]; \r\n var iLeft = item.getLeft() - (lastImageX-newX);\r\n var iTop = item.getTop() - (lastImageY-newY);\r\n if(item){\r\n item.setItemPos(iLeft, iTop, AnnotationTool.SCALE);\r\n }\r\n }\r\n \r\n lastImageX = newX;\r\n lastImageY = newY;\r\n canvas.renderAll();\r\n\r\n }", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "shiftRowsDown(row_index) {\n // replace each row with row above from bottom to top\n for (let i = row_index; i > 1; i--) {\n for (let j = 0; j < this.numCols; j++) {\n let topCell = this.rows[i - 1][j];\n let bottomCell = this.rows[i][j];\n bottomCell.block = topCell.block;\n bottomCell.filled = topCell.filled;\n\n if (bottomCell.block !== null) {\n bottomCell.block.y += this.cellHeight;\n }\n }\n }\n // erase top row\n for (let j = 0; j < this.numCols; j++) {\n let cell = this.rows[0][j];\n cell.block = null;\n cell.filled = false;\n }\n }", "function resizeFixup(ui){\n\t \tvar resizeId = ui.element.attr('id');\n\t \t//which direction did it resize?\n\t \tif(resizeDir == 'n'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, 0) - virtical_location(ui.helper.position().top, 0);\n\t \t\tif(diff <= 0 && parseInt(ui.element.attr('row')) <= 1){\n\t \t\t\t//the tile is at the top\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY-2].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY-2].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'row':parseInt(ui.element.attr('row'))-diff,\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif(diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 's', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 's', item);\n\t \t\t\t});\n\t \t\t}\n\t \t}\n\t \tif(resizeDir == 's'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, ui.originalSize.height) - virtical_location(ui.helper.position().top, ui.helper.height());\n\t \t\tif(parseInt(ui.element.attr('row'))+parseInt(ui.element.attr('sizey'))-1 == maxHeight ){\n\t \t\t\t//the tile is at the bottom\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY + resizeStartSizeY - 1].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY + resizeStartSizeY - 1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))-diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 'n', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 'n', item);\n\t \t\t\t});\n\t \t\t}\n\t \t} \n\t \tif(resizeDir == 'e'){\n\t \t\tif(parseInt(ui.element.attr('col'))+parseInt(ui.element.attr('sizex'))-1 == maxCols){\n\t \t\t\t//the element is on the right of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX + resizeStartSizeX - 1][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX + resizeStartSizeX - 1][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t\t\t//did it go right or left?\n\t\t\tvar diff = horizontal_location(ui.originalPosition.left, ui.originalSize.width) - horizontal_location(ui.helper.position().left, ui.helper.width());\n\t\t\tui.element.attr({\n\t\t\t\t'sizex':parseInt(ui.element.attr('sizex'))-diff\n\t\t\t});\n\t\t\tupdate_board(resizeId);\n\t\t\tvar moved = new Set();\n\t\t\tmoved.add(resizeId);\n\t\t\tif( diff < 0){\n\t \t\t\t//it moved right\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t} \n\t \tif(resizeDir == 'w'){\n\t \t\tif(parseInt(ui.element.attr('col')) == 1){\n\t \t\t\t//the element is on the left side of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX - 2][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX - 2][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go right or left?\n\t \t\tvar diff = horizontal_location(ui.originalPosition.left,0) - horizontal_location(ui.helper.position().left, 0);\n\t \t\tui.element.attr({\n\t \t\t\t'col':parseInt(ui.element.attr('col'))-diff,\n\t \t\t\t'sizex':parseInt(ui.element.attr('sizex'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved right\n\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t}\n\t }", "function recursiveMouvementDown(i,j,tile)\n\t\t{\n\t\t\t// !!! Verifier si colone full !!!\n\t\t\tvar tileNext = $('body').find('[data-x='+i+'][data-y='+(j+1)+']');\n\t\t\tvar value =$(tile).find('.tile-inner').text();\n\t\t\tvar valueNext = $(tileNext).find('.tile-inner').text();\n\t\t\tif( tileNext.length == 0 && j<4)\n\t\t\t{\n\t\t\t\t\tsetClass($(tile), j+1);\n\t\t\t\t\trecursiveMouvementDown(i,j+1,tile);\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( value == valueNext){\n\t\t\t\t\tsetClass($(tile), j-1);\n\t\t\t\t\tfusion(tile,tileNext, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "moveUp() {\n const nextRow = this.row - 1;\n const nextColumn = this.col;\n\n if (\n !this.game.maze.layout[nextRow][nextColumn] &&\n !this.game.maze.layout[nextRow][nextColumn + 1]\n ) {\n this.row = nextRow;\n }\n }", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function moveDown() {\n const firstRow = [0, 1, 2, 3, 4, 5, 6, 7];\n\n for (let i = 0; i < 63; i++) {\n var isFirstRow = firstRow.includes(i);\n if (squares[i].style.backgroundImage === \"\" && isFirstRow) {\n var randomColor = Math.floor(Math.random() * boardColors.length);\n squares[i].style.backgroundImage = boardColors[randomColor];\n } else if (squares[i].style.backgroundImage === \"\" && !isFirstRow) {\n squares[i].style.backgroundImage =\n squares[i - width].style.backgroundImage;\n squares[i - width].style.backgroundImage = \"\";\n } else {\n }\n }\n }", "function allMove(y) {\n\t\t\tif (bg.sourceY <= 3 && y > 0)return;\n\t\t\tif (bg.sourceY >= 454 && y < 0)return;\n\t\t\tif (Math.abs(y) > 5) bg.moved = true;//手机上很难不移动,但是移动在5px以内时视为没移动\n\t\t\tbg.sourceY -= y;\n\t\t\tif (bg.sourceY < 0) {\n\t\t\t\tbg.sourceY = 0;\n\t\t\t} else if (bg.sourceY > 456) {\n\t\t\t\tbg.sourceY = 456;\n\t\t\t}\n\t\t\tbg1.sourceY = bg.sourceY;\n\t\t\tfor (let i = 0; i < index_g.chooselevel.bt.length; i++) {\n\t\t\t\tlet ty = 456 + BOARDDATA[i].y + (456 - bg.sourceY) / 1.33;//图的实际大小比上理想尺寸\n\t\t\t\tindex_g.chooselevel.bt[i].y = calcPx(ty, 1);\n\t\t\t\tindex_g.chooselevel.ts[i].y = calcPx(ty + 50, 1);\n\t\t\t}\n\t\t}", "moveRowsDown() {\n if(this.moveRow != -1) {\n var x, y\n for(y = this.moveRow - 1; y >= 0; y--) {\n for(x = 0; x < X_SPACES; x++) {\n let temp = this.board[y][x]\n this.board[y][x] = new Piece(30, 30, 30, false)\n this.board[y+1][x] = temp\n }\n }\n // Add scoring information\n this.score += 100\n this.lines += 1\n }\n }", "moveDown(amount){\n var initRow = this.index.row;\n this.index.row+=amount;\n this.gameObject.setTint(this.identifier.color);\n this.moveData.push({\n from: {x: this.gameObject.x, y:this.gameObject.y},\n to: {x: this.x + ((initRow + 1)%2 * this.board.hexWidth/2), y: this.y + this.board.vertOffset}\n });\n //generates all of the positions that it will go on it's way movinf down\n //I can then interpolate between each of these positions\n for(var i = 1; i< amount; i++){\n this.moveData.push({\n from: {x: this.moveData[i-1].to.x, y: this.moveData[i-1].to.y},\n to: {x: this.x + ((initRow + i+1 )%2 * this.board.hexWidth/2), y: this.y + (i+1) * this.board.vertOffset}\n });\n }\n this.offset =(this.index.row%2 * this.board.hexWidth/2);\n\n this.assocText.setText(\"\");\n this.y += amount * this.board.vertOffset\n this.addToBoardAnim();\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function moveAllToBottom() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 3;\n\t\tfor (var r = 3; r >= 0 ; r-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function moveAllDown(array, array2, array3, array4, array5) {\n moveDroidsDown(array)\n moveLAndTDown(array2)\n moveHitsDown(array3)\n moveTroopersDown(array4)\n moveHitTroopersDown(array5)\n}", "function myDown(e) {\n\n // funciton to mark/unmark tiles while moving mouse\n canvas.onmousemove = myMove;\n\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\") {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\") {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function swapTile(row, column) {\r\n\t\r\n\tvar currentTD = tableRowColumn[row][column];\r\n\tvar currentCard = cardsRowColumn[row][column];\r\n\tvar leftCard = column-1;\r\n\tvar rightCard = column+1;\r\n\tvar upCard = row-1;\r\n\tvar downCard = row+1;\r\n\t\r\n\t//Up\r\n\tif (row != 0 && cardsRowColumn[upCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[upCard][column];\r\n\t\tvar nextCard = cardsRowColumn[upCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[upCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Down\r\n\tif (row != 3 && cardsRowColumn[downCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[downCard][column];\r\n\t\tvar nextCard = cardsRowColumn[downCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[downCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Right\r\n\tif (column != 3 && cardsRowColumn[row][rightCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][rightCard];\r\n\t\tvar nextCard = cardsRowColumn[row][rightCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][rightCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Left\r\n\tif (column != 0 && cardsRowColumn[row][leftCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][leftCard];\r\n\t\tvar nextCard = cardsRowColumn[row][leftCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][leftCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Check if solved, and if solved, change h1 to display congratulations\r\n\tif (cardsRowColumn[0][0] == \"1\"\r\n\t\t&& cardsRowColumn[0][1] == \"2\"\r\n\t\t&& cardsRowColumn[0][2] == \"3\"\r\n\t\t&& cardsRowColumn[0][3] == \"4\"\r\n\t\t&& cardsRowColumn[1][0] == \"5\"\r\n\t\t&& cardsRowColumn[1][1] == \"6\"\r\n\t\t&& cardsRowColumn[1][2] == \"7\"\r\n\t\t&& cardsRowColumn[1][3] == \"8\"\r\n\t\t&& cardsRowColumn[2][0] == \"9\"\r\n\t\t&& cardsRowColumn[2][1] == \"10\"\r\n\t\t&& cardsRowColumn[2][2] == \"11\"\r\n\t\t&& cardsRowColumn[2][3] == \"12\"\r\n\t\t&& cardsRowColumn[3][0] == \"13\"\r\n\t\t&& cardsRowColumn[3][1] == \"14\"\r\n\t\t&& cardsRowColumn[3][2] == \"15\"\r\n\t\t&& cardsRowColumn[3][3] == \"-1\") {\r\n\t\theader1.innerText = \"Congratulations, you completed the puzzle!\";\r\n\t\tmoves.innerText = totalMoves;\r\n\t\tmoveCounter.innerText = \"Total number of moves used:\";\r\n\t}\r\n}", "function moveDown() {\n for (i = 0; i < 56; i++) {\n if (squares[i + width].style.backgroundImage === '') {\n squares[i + width].style.backgroundImage =\n squares[i].style.backgroundImage;\n squares[i].style.backgroundImage = '';\n }\n const firstRow = [0, 1, 2, 3, 4, 5, 6, 7];\n const isFirstRow = firstRow.includes(i);\n if (isFirstRow && squares[i].style.backgroundImage === '') {\n let randomColor = Math.floor(Math.random() * candyColors.length);\n //set that color background for the square at this index\n squares[i].style.backgroundImage = candyColors[randomColor];\n }\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.7319744", "0.72963244", "0.72792137", "0.7199269", "0.70286226", "0.70277596", "0.696229", "0.689661", "0.682219", "0.68153536", "0.6743534", "0.6680645", "0.66574603", "0.64544666", "0.6424538", "0.6403815", "0.63727856", "0.63361466", "0.6322985", "0.6305963", "0.62975436", "0.6257643", "0.6255275", "0.6243642", "0.6237627", "0.62002563", "0.6181984", "0.61764497", "0.61600685", "0.6156648", "0.61251825", "0.6104375", "0.6101413", "0.6100534", "0.6078921", "0.6072162", "0.60695416", "0.6065168", "0.60217655", "0.60201406", "0.6012664", "0.6007489", "0.60067254", "0.5992731", "0.59855145", "0.5985119", "0.59612286", "0.5960221", "0.59596926", "0.5957511", "0.5930728", "0.5910953", "0.59076005", "0.587208", "0.5861305", "0.5853733", "0.5853157", "0.5842577", "0.5840895", "0.5835803", "0.583427", "0.5831518", "0.58285105", "0.58269304", "0.582093", "0.5816629", "0.5815919", "0.58113295", "0.58104277", "0.57966846", "0.5795754", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423", "0.57940423" ]
0.7606728
0
Move ALL tiles upward
function moveTilesUp() { for (var column = 3; column >= 0; column--) { for (var row = 1; row <= 3; row++) { if (checkAbove(row, column) && tileArray[row][column] != null) { moveTileUp(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();\n }\n }", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(row, column);\n }\n }\n }\n }", "function moveTile() {\n moveTileHelper(this);\n }", "function moveUp() {\n let prevCol;\n let curCol;\n let temp;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight - 1; y++) {\n if (y === sizeHeight - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, (y + 1) * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect(x * sizeBlock, (y + 1) * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function moveTileUp(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row - 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row - 1, column)) {\n $(tileArray[row - 1][column]).remove();\n tileArray[row - 1][column] = null;\n } else {\n tileArray[row - 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row - 1][column].id.slice(5)) - 4));\n }\n });\n tileArray[row - 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "moveUp() {\n dataMap.get(this).moveY = -5;\n }", "function moveCol5Up(grid) {\n for (let i = 0; i < 47; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 46;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "moveUp() {\n const nextRow = this.row - 1;\n const nextColumn = this.col;\n\n if (\n !this.game.maze.layout[nextRow][nextColumn] &&\n !this.game.maze.layout[nextRow][nextColumn + 1]\n ) {\n this.row = nextRow;\n }\n }", "function moveCol7Up(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 48;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveCol6Up(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 47;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}", "function moveUp() {\n\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\tarrayRow = new Array(Cols);\n\t\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\t\tarrayRow[row] = matrix[row][col];\n\t\t\t}\n\t\t\tfor (var i = 0; i < Rows; i++) {\n\t\t\t\tmatrix[i][col] = newArray(arrayRow)[i];\n\t\t\t}\n\t\t}\n\n\t\tdraw();\n\t}", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "move(direction) {\n\n if (!this.gameIsOver()) {\n if (direction == \"up\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (up to down)\n for (var j = 0; j < n; j++) { // for each current (j), will walk down (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // below tile, always starts directly below current (j)\n if (matrix[j][i] == 0) { // if current is 0, move down to next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if below is 0, move onto next below\n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != below, move onto next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == below, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find lowest tile & pull it up\n for (var j = 0; j < n - 1; j++) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find lowest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[full][i] != 0) { // if a below tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"left\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (L to R)\n for (var j = 0; j < n - 1; j++) { // for each current (j), will walk right (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // right tile, always starts directly to the right of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move right to next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if right is 0, move onto next right\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != right, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == right, combine into current & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make right 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find rightmost tile & pull it left (L to R)\n for (var j = 0; j < n - 1; j++) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find rightmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[i][full] != 0) { // if a right tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n\n this.gameState.board = row; // make board the row array\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n\n return;\n } else if (direction == \"right\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (R to L)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk left (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // left tile, always starts directly to the left of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move onto next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if left is 0, move onto next left\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != left, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == left, combine & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make left 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find leftmost tile & pull it\n for (var j = n - 1; j > 0; j--) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find leftmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[i][full] != 0) { // if a left tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"down\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (down to up)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk up (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // above tile, always starts directly above current (j)\n if (matrix[j][i] == 0) { // if current is 0, move up next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if above is 0, move onto above \n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != above, move up next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == above, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find highest tile & pull it down\n for (var j = n - 1; j > 0; j--) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find highest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[full][i] != 0) { // if an above tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n this.callCallbacks();\n return;\n }\n }\n }", "static moveForwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).reverse().forEach(item => {\n if (item.nextSibling && items.indexOf(item.nextSibling) === -1) {\n item.insertAbove(item.nextSibling);\n }\n });\n });\n }", "shiftUp() {\n for (let row = 0; row < this.height - 1; row++) {\n if (row % 2 === 0) {\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[row][col].setType(this.cells[row + 1][col].type);\n }\n this.cells[row][this.width - 1].setType(BeadType.default);\n } else {\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[row][col].setType(this.cells[row + 1][col + 1].type);\n }\n }\n }\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[this.height - 1][col].setType(BeadType.default);\n }\n }", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function resizeFixup(ui){\n\t \tvar resizeId = ui.element.attr('id');\n\t \t//which direction did it resize?\n\t \tif(resizeDir == 'n'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, 0) - virtical_location(ui.helper.position().top, 0);\n\t \t\tif(diff <= 0 && parseInt(ui.element.attr('row')) <= 1){\n\t \t\t\t//the tile is at the top\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY-2].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY-2].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'row':parseInt(ui.element.attr('row'))-diff,\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif(diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 's', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 's', item);\n\t \t\t\t});\n\t \t\t}\n\t \t}\n\t \tif(resizeDir == 's'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, ui.originalSize.height) - virtical_location(ui.helper.position().top, ui.helper.height());\n\t \t\tif(parseInt(ui.element.attr('row'))+parseInt(ui.element.attr('sizey'))-1 == maxHeight ){\n\t \t\t\t//the tile is at the bottom\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY + resizeStartSizeY - 1].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY + resizeStartSizeY - 1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))-diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 'n', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 'n', item);\n\t \t\t\t});\n\t \t\t}\n\t \t} \n\t \tif(resizeDir == 'e'){\n\t \t\tif(parseInt(ui.element.attr('col'))+parseInt(ui.element.attr('sizex'))-1 == maxCols){\n\t \t\t\t//the element is on the right of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX + resizeStartSizeX - 1][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX + resizeStartSizeX - 1][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t\t\t//did it go right or left?\n\t\t\tvar diff = horizontal_location(ui.originalPosition.left, ui.originalSize.width) - horizontal_location(ui.helper.position().left, ui.helper.width());\n\t\t\tui.element.attr({\n\t\t\t\t'sizex':parseInt(ui.element.attr('sizex'))-diff\n\t\t\t});\n\t\t\tupdate_board(resizeId);\n\t\t\tvar moved = new Set();\n\t\t\tmoved.add(resizeId);\n\t\t\tif( diff < 0){\n\t \t\t\t//it moved right\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t} \n\t \tif(resizeDir == 'w'){\n\t \t\tif(parseInt(ui.element.attr('col')) == 1){\n\t \t\t\t//the element is on the left side of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX - 2][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX - 2][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go right or left?\n\t \t\tvar diff = horizontal_location(ui.originalPosition.left,0) - horizontal_location(ui.helper.position().left, 0);\n\t \t\tui.element.attr({\n\t \t\t\t'col':parseInt(ui.element.attr('col'))-diff,\n\t \t\t\t'sizex':parseInt(ui.element.attr('sizex'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved right\n\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t}\n\t }", "static moveBackwards(items) {\n PaperJSOrderingUtils._sortItemsByLayer(items).forEach(layerItems => {\n PaperJSOrderingUtils._sortItemsByZIndex(layerItems).forEach(item => {\n if (item.previousSibling && items.indexOf(item.previousSibling) === -1) {\n item.insertBelow(item.previousSibling);\n }\n });\n });\n }", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "moveUpNext() {\r\n this.movement.y = -this.speed;\r\n this.move();\r\n }", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "moveUp() {\n this.y>0?this.y-=83:false;\n }", "function moveAllToTop() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 0;\n\t\tfor (var r = 0; r < 4 ; r++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift}", "goUp() {\n\t\tthis.setFloor(this.getFloor() + 1);\n\t}", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "moveUp(){\n this.y -= 7;\n }", "function mooveDown()\n\t\t{\n\t\t\tfor (var i = 0; i <= 4; i++) \n\t\t\t{\n\t\t\t\tfor (var j = 3; j >= 0; j--) \n\t\t\t\t{\n\t\t\t\t\tvar tile = $('body').find('[data-x='+i+'][data-y='+j+']');\n\n\t\t\t\t\tif($(tile).length > 0)\n\t\t\t\t\t\t$(tile).each(function(){ recursiveMouvementDown(i,j, tile) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreate(1);\n\t\t}", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function move_up() {\n\t check_pos();\n\t blob_pos_y = blob_pos_y - move_speed;\n\t}", "function moveTileDown(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row + 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n //This happens at the end of each tile's movement\n if (checkRemove(row + 1, column)) {\n $(tileArray[row + 1][column]).remove();\n tileArray[row + 1][column] = null;\n } else {\n tileArray[row + 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4));\n }\n });\n tileArray[row + 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveAllToLeft() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 0;\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function moveAliensDown() {\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.remove('alien')\n })\n currentAlienPositions = currentAlienPositions.map((alien) => {\n return alien += width\n })\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.add('alien')\n })\n}", "function moveAllGhosts() { ghosts.forEach(ghost => moveGhost(ghost))}", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "__setHandPos(){\n\n this.players.forEach((player, i) => {\n for(var i = 0; i < player.hand.length; i++){\n var tile = player.hand[i];\n\n //if the player is currently moving a tile, do not reset that tile's position\n if(player.selectedTile == tile){\n continue;\n }\n\n //top row\n if(i < player.hand.length/2){\n var posX = this.w/10 + (tile.width + 20)*i;\n var posY = this.h - tile.height - 120;\n\n }\n //bottom row\n else{\n var posX = this.w/10 + (tile.width + 20)* (i - Math.floor(player.hand.length/2));\n var posY = this.h - tile.height - 30;\n }\n\n tile.x = posX;\n tile.y = posY;\n\n }\n });\n }", "function changePosition(from, to, rowToUpdate) {\n\n var $tiles = $(\".tile\");\n var insert = from > to ? \"insertBefore\" : \"insertAfter\";\n\n // Change DOM positions\n $tiles.eq(from)[insert]($tiles.eq(to));\n\n layoutInvalidated(rowToUpdate);\n}", "function moveAll(){\r\n var newX = fabImg.getLeft();\r\n var newY = fabImg.getTop();\r\n\r\n for(var key in allElements){ \r\n var item = allElements[key]; \r\n var iLeft = item.getLeft() - (lastImageX-newX);\r\n var iTop = item.getTop() - (lastImageY-newY);\r\n if(item){\r\n item.setItemPos(iLeft, iTop, AnnotationTool.SCALE);\r\n }\r\n }\r\n \r\n lastImageX = newX;\r\n lastImageY = newY;\r\n canvas.renderAll();\r\n\r\n }", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "_siftUp() {\n var i;\n var parent;\n\n for (i = this.n;\n i > 1 && (parent = i >> 1) && this._comparator.greaterThan(\n this._elements[parent], this._elements[i]);\n i = parent) {\n this._swap(parent, i);\n }\n }", "function moveUp(){\n ctx.clearRect(0, 0, 450, 450);\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 9 || empty == 7 || empty == 8){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty+3;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n \n }\n}", "placeEnd(levelIndex) {\n let pos = this.breadthFirst();\n for (let j = pos.y + 5; j >= pos.y - 5; j--) {\n for (let i = pos.x + 5; i >= pos.x - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n if (levelIndex % 2 === 0) {\n this.tiles[pos.y][pos.x] = 'End';\n } else {\n this.tiles[pos.y][pos.x] = 'Start';\n }\n }", "function moveRow6L(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position -= 1;\n } if (grid[i].position < 35) {\n grid[i].position = 41;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveAllToBottom() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 3;\n\t\tfor (var r = 3; r >= 0 ; r-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "moveUp() {\n if (this.y === 0) {\n this.y = this.tape.length - 1;\n } else {\n this.y--;\n }\n }", "moveUp(amount) {\n this.y += amount;\n }", "moveUp(amount) {\n this.y += amount;\n }", "function recursiveMouvementUp(i,j,tile)\n\t\t{\n\t\t\tvar tileNext = $('body').find('[data-x='+i+'][data-y='+(j-1)+']');\n\t\t\tvar value =$(tile).find('.tile-inner').text();\n\t\t\tvar valueNext = $(tileNext).find('.tile-inner').text();\n\t\t\t\n\t\t\tif( tileNext.length == 0 && j>1)\n\t\t\t{\n\t\t\t\t\t setClass($(tile), j-1);\n\t\t\t\t\t recursiveMouvementUp(i,j-1,tile);\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( value == valueNext){\n\t\t\t\t\tsetClass($(tile), j+1);\n\t\t\t\t\tfusion(tile,tileNext, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function moveDown() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.row++;\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function layout_treeMove(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t} // EXECUTE SHIFTS", "shiftCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\t\t\tvar newX = card.x - 20;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "swapTile(last, curr) {\n let gap = $(`#${last}`).css(\"background-position\");\n let clicked = $(`#${curr}`).css(\"background-position\");\n let classTemp = $(`#${curr}`).attr(\"class\");\n $(`#${curr}`).css({\n \"opacity\": 0,\n \"background-position\": gap\n });\n $(`#${curr}`).attr(\"value\", \"gap\");\n $(`#${curr}`).attr(\"class\", $(`#${last}`).attr(\"class\"));\n $(`#${last}`).css({ \"background-position\": clicked, \"opacity\": 1 });\n $(`#${last}`).attr(\"value\", \"\");\n $(`#${last}`).attr(\"class\", classTemp);\n }", "function moveDown() {\n let prevCol;\n let curCol;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight; y++) {\n if (y === 0) {\n prevCol = get(x * sizeBlock + 1, (sizeHeight - 1) * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function moveRow6R(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position += 1;\n } if (grid[i].position > 41) {\n grid[i].position = 35;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveUp() {\r\n var min = 99;\r\n for(index of shipArray) {\r\n if(min > index) {\r\n min = index;\r\n }\r\n }\r\n if(min > 9) {\r\n for(i in shipArray) {\r\n shipArray[i] = shipArray[i] - 10;\r\n }\r\n }\r\n //If it is possible to move the ship here, then do so\r\n if(checkPlacement() == true) {\r\n updatePosColor();\r\n }\r\n}", "moveUp(howFar) {\n this.setLastPos();\n this.y -= howFar;\n }", "function moveUp(){\n\t\t\tplayerPosition.x += 1\n\t\t\tplayer.attr({\n\t\t\t\t'cx': playerPosition.x\n\t\t\t})\n\t\t}", "function moveAllPlayers() {\n for (const player of this.playerStates) {\n if (player.direction && player.alive) {\n const oldPositions = player.positions.slice();\n player.positions[0] = {\n x: player.positions[0].x + player.direction.x,\n y: player.positions[0].y + player.direction.y\n };\n\n if (player.positions[0].x < 0) {\n player.positions[0].x += SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].x >= SNAKE_GAME_CONFIG.gridSize.width) {\n player.positions[0].x -= SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].y < 0) {\n player.positions[0].y += SNAKE_GAME_CONFIG.gridSize.height;\n }\n if (player.positions[0].y >= SNAKE_GAME_CONFIG.gridSize.height) {\n player.positions[0].y -= SNAKE_GAME_CONFIG.gridSize.height;\n }\n\n for (let i = 1; i < player.positions.length; i++) {\n player.positions[i] = oldPositions[i - 1];\n }\n if (player.positions.length < player.length) {\n player.positions.push(oldPositions[oldPositions.length - 1]);\n }\n }\n }\n}", "function tween_tiles() {\n for (j=0; j<MAP_HEIGHT; j++) {\n for (i=0; i<MAP_WIDTH; i++) {\n var tile = map[j][i];\n if (map[j][i]['type'] !== ' ') {\n // tween the tiles until they reach their destination\n // MOVEMENT TWEENING\n if (tile['newx'] !== tile['x']) {\n var diffx = Math.abs(tile['x'] - tile['newx']);\n if (tile['newx'] > tile['x']) {\n tile['tweenx'] += TWEENSPEED;\n }\n else if (tile['newx'] < tile['x']) {\n tile['tweenx'] -= TWEENSPEED;\n }\n }\n if (tile['newy'] !== tile['y']) {\n var diffy = Math.abs(tile['y'] - tile['newy']);\n if (tile['newy'] > tile['y']) {\n tile['tweeny'] += TWEENSPEED;\n }\n else if (tile['newy'] < tile['y']) {\n tile['tweeny'] -= TWEENSPEED;\n }\n }\n // swap tiles when they have completed their movement\n // (if they moved at all)\n if (tile['tweenx'] !== 0 || tile['tweeny'] !== 0) {\n if (Math.abs(tile['tweenx']) > TILESIZE * diffx) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n if (Math.abs(tile['tweeny']) > TILESIZE * diffy) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n }\n // ROTATION TWEENING\n if (tile['newangle'] !== tile['angle']) {\n tile['tweenrot'] += TWEENSPEED;\n }\n if (tile['tweenrot'] !== 0) {\n // done rotating\n if (Math.abs(tile['tweenrot']) >= 90) {\n tile['angle'] = tile['newangle'];\n tile['tweenrot'] = 0;\n shift_barriers(i, j);\n }\n }\n\n }\n }\n }\n}", "function swapUp(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y - 1, x: blankPOS.x })\n}", "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'left')\n\t\t{\n\t\t\tmissiles[i]['position'][0] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'up')\n\t\t{\n\t\t\tmissiles[i]['position'][1] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'down')\n\t\t{\n\t\t\tmissiles[i]['position'][1] += 10;\n\t\t}\n\t}\n}", "function moveCol6Dn(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position += 7;\n } if ((grid[i].position) > 47) {\n grid[i].position = 5;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function MoveElements(data,canvas,imgArray){\n var LENGTH_OF_ONE_TILE = 50;\n var ONE_TILE_DOWN = -50;\n var firstElement = data.elementsToReposition[0].id;\n var lastElement = data.elementsToReposition[data.elementsToReposition.length - 1].id;\n var firstColumn = parseInt(GetXandYCoordinate(firstElement).x);\n var lastColumn = parseInt(GetXandYCoordinate(lastElement).x);\n var firstRow = parseInt(GetXandYCoordinate(firstElement).y);\n var lastRow = parseInt(GetXandYCoordinate(data.elementsToReposition[data.elementsToReposition.length - 1].moveTo).y);\n var heightToClear = ((lastRow - firstRow) + 1) * LENGTH_OF_ONE_TILE;\n var widthToClear = ((lastColumn - firstColumn) + 1) * LENGTH_OF_ONE_TILE;\n var startingX = (parseInt(GetXandYCoordinate(firstElement).x) * LENGTH_OF_ONE_TILE) - LENGTH_OF_ONE_TILE;\n var startingY = (parseInt(GetXandYCoordinate(firstElement).y) * LENGTH_OF_ONE_TILE) - LENGTH_OF_ONE_TILE;\n var counterY = 0;\n var rowsToMove = lastRow - firstRow;\n //Clear all the elements which need to be moved so we can animate movements.\n canvas.clearRect(startingX,startingY,widthToClear,heightToClear);\n //Now we need to move the elements down..\n\n var movingDownDistance = (data.elementsToReposition[0].moveTo - data.elementsToReposition[0].id)/10;//Here we are checking that how many tiles we have to move..\n movingDownDistance = (ONE_TILE_DOWN) * movingDownDistance;\n var movingIntervalTime = 10;\n var timeTakenForAnimation = Math.abs((movingDownDistance * movingIntervalTime)) + 10;\n var movingInterval = setInterval(function(){\n for(var currentElement = (data.elementsToReposition.length - 1);currentElement>=0;currentElement--){\n DrawElements(canvas,GetXandYCoordinate(data.elementsToReposition[currentElement].id).x,GetXandYCoordinate(data.elementsToReposition[currentElement].id).y,counterY,0,imgArray[data.gameArray[data.elementsToReposition[currentElement].moveTo].element],\"white\");\n }\n if(counterY > movingDownDistance){\n counterY-=2;\n }\n },movingIntervalTime);\n setTimeout(function(){\n clearInterval(movingInterval);\n }\n ,timeTakenForAnimation);\n}", "function shuffleTiles(){\n\t\n\t//set the empty tile row and columns position\n\tvar row = 0;\n\tvar col = 0;\n\t\n\t//for loops to ensure iteration over each tile and moving it\n\tfor(var r=0; r < _num_rows; r++)\n\t{\n\t\tfor(var c=0; c < _num_cols; c++)\n\t\t{\n\t\t\tif(tile_array[r][c] === 0) //if its the empty tile, continue to the next tile\n\t\t\t{continue;}\n\t\t\t\n\t\t\tif(!(r-1 < 0) && tile_array[r-1][c] === 0) // check for teh row before the empty tile , if its valid\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[r][c]; // set a temp. variable to save the tile in\n\t\t\t\ttemp3.style.left = c * _tile_width+\"px\";\n\t\t\t\ttemp3.style.top = (r-1) * _tile_height + \"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r-1][c] = temp3;\n\t\t\t}\n\t\t\t\n\t\t\tif(!(c-1 < 0) && tile_array[r][c-1] === 0)\n\t\t\t{\n\t\t\t\tvar temp = tile_array[r][c];\n\t\t\t\ttemp.style.left = (c - 1) * _tile_width+\"px\";\n\t\t\t\ttemp.style.top = r * _tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r][c-1] = temp;\n\t\t\t}\n\t\t\t\n\t\t\tif( (c+1) < _num_cols && tile_array[r][c+1] === 0)\n\t\t\t{\n\t\t\t\tvar temp2 = tile_array[r][c];\n\t\t\t\ttemp2.style.left = (c + 1) * _tile_width+\"px\";\n\t\t\t\ttemp2.style.top = r * _tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r][c+1] = temp2;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\tif( (r+1) < _num_rows && tile_array[r+1][c] === 0)\n\t\t\t{\n\t\t\t\tvar temp4 = tile_array[r][c];\n\t\t\t\ttemp4.style.left = c * _tile_width+\"px\";\n\t\t\t\ttemp4.style.top = (r+1)*_tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r+1][c] = temp4;\n\t\t\t}\n\t\t}\n\t}\n\n}", "move() {\n let to_move = [this.head].concat(this.parts);\n this.dir_q.unshift(this.dir);\n for (let i = 0; i < to_move.length; i++) {\n to_move[i].add(this.dir_q[i]);\n if (to_move[i].x < -width / 2) to_move[i].x = width / 2 - BOX;\n if (to_move[i].x >= (width / 2) - 1) to_move[i].x = -width / 2;\n if (to_move[i].y < -height / 2) to_move[i].y = height / 2 - BOX;\n if (to_move[i].y >= (height / 2) - 1) to_move[i].y = -height / 2;\n }\n }", "function dragFixup(col, row) {\n\n\t\tif(col < 0 || col > maxCols || row < 0 || row > maxHeight){\n\t\t\t$('.ui-draggable-dragging').remove();\n\t\t\treturn;\n\t\t}\n\t\tvar targetId = board[col-1][row-1].tile;\n\t\tvar targetX = parseInt($('#'+targetId).attr('col'));\n\t\tvar targetY = parseInt($('#'+targetId).attr('row'));\n\t\tvar targetSizeX = parseInt($('#'+targetId).attr('sizex'));\n\t\tvar targetSizeY = parseInt($('#'+targetId).attr('sizey'));\n\t\tvar targetGrid = $('#'+targetId);\n\t\tvar startGrid = $('#'+dragStartId);\n\t\tif(targetId == dragStartId) {\n\t\t\tvar targetOffset = offset_from_location(row,col);\n\t\t\t$('#'+targetId).css({\n\t\t\t\t'top':dragStartOffset.top,\n\t\t\t\t'left':dragStartOffset.left,\n\t\t\t\t'height':dragStartSizeY*tileHeight,\n\t\t\t\t'width':dragStartSizeX*tileWidth\n\t\t\t});\n\t\t} else {\n\t\t\tvar startOffset = offset_from_location(dragStartSizeY, dragStartSizeX);\n\t\t\tvar targetOffset = offset_from_location(targetY, targetX);\n\t\t\tstartGrid.attr({\n\t\t\t\t'col': targetGrid.attr('col'),\n\t\t\t\t'row': targetGrid.attr('row'),\n\t\t\t\t'sizex': targetGrid.attr('sizex'),\n\t\t\t\t'sizey': targetGrid.attr('sizey')\n\t\t\t});\n\t\t\tstartGrid.css({\n\t\t\t\t'top':targetOffset.top,\n\t\t\t\t'left':targetOffset.left,\n\t\t\t\t'width':parseInt(startGrid.attr('sizex'))*tileWidth,\n\t\t\t\t'height':parseInt(startGrid.attr('sizey'))*tileHeight\n\t\t\t});\n\t\t\tupdate_board(dragStartId);\n\n\t\t\ttargetGrid.attr({\n\t\t\t\t'col': dragStartX,\n\t\t\t\t'row': dragStartY,\n\t\t\t\t'sizex': dragStartSizeX,\n\t\t\t\t'sizey': dragStartSizeY\n\t\t\t});\n\t\t\ttargetGrid.css({\n\t\t\t\t'top':dragStartOffset.top,\n\t\t\t\t'left':dragStartOffset.left,\n\t\t\t\t'width':parseInt(targetGrid.attr('sizex'))*tileWidth,\n\t\t\t\t'height':parseInt(targetGrid.attr('sizey'))*tileHeight\n\t\t\t});\n\t\t\tupdate_board(targetId);\n\t\t}\n\t}", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }", "function update() {\n $map.css({\n left: position[0],\n top: position[1]\n });\n\n var centre_last = centre;\n centre = [Math.floor(-position[0] / tilesize), Math.floor(-position[1] / tilesize)];\n\n function tile_name(x, y) {\n x -= size[3];\n y -= size[0];\n return (y >= 0 ? y + 1 + \"s\" : -y + \"n\") + (x >= 0 ? x + 1 + \"e\" : -x + \"w\");\n }\n\n if (centre[0] != centre_last[0] || centre[1] != centre_last[1]) {\n var $remove = $map.children().not(\".ground\");\n\n for (var y = -1; y <= +1; y++) {\n for (var x = -1; x <= +1; x++) {\n var name = tile_name(centre[0] + x, centre[1] + y);\n var tile = $map.find(\".tile\" + name);\n\n if (tile.length) {\n $remove = $remove.not(tile);\n } else {\n var $image = $(\n \"<img class=\"tile\" + name + \"\" src=\"http://imgs.xkcd.com/clickdrag/\" + name + \".png\" style=\"top:\" + (centre[1] + y) * tilesize + \"px;left:\" + (centre[0] + x) * tilesize + \"px; z-index: -1; position: absolute;;\" style=\"display:none\" />\"\n );\n\n $image.load(function() {\n $(this).show();\n }).error(function() {\n $(this).remove();\n });\n\n $map.append($image);\n }\n }\n }\n\n $remove.remove();\n }\n }" ]
[ "0.7357319", "0.73486304", "0.7348536", "0.73415923", "0.7213197", "0.712264", "0.7102516", "0.7087443", "0.6967448", "0.69236034", "0.6907207", "0.6762628", "0.6739732", "0.6722844", "0.6708591", "0.6645257", "0.662945", "0.6612544", "0.6590713", "0.6563467", "0.6547967", "0.6536284", "0.64779156", "0.63631594", "0.6293587", "0.62562263", "0.62156785", "0.62090313", "0.61970216", "0.61682016", "0.61283755", "0.6111835", "0.6111446", "0.608208", "0.60762775", "0.60746205", "0.60735965", "0.6066904", "0.60633135", "0.60605395", "0.60554045", "0.60400623", "0.601076", "0.6007882", "0.60072637", "0.60046476", "0.6004349", "0.5994822", "0.5994252", "0.59772027", "0.59645593", "0.59553015", "0.59512824", "0.59433174", "0.5938687", "0.5934192", "0.58959043", "0.5894442", "0.5893143", "0.5891407", "0.5891407", "0.58840805", "0.5878813", "0.58754766", "0.586328", "0.58626217", "0.58594054", "0.5849607", "0.5848807", "0.5840789", "0.58401597", "0.5834731", "0.5833686", "0.5832993", "0.5825964", "0.5815971", "0.5811048", "0.5806878", "0.5805949", "0.57955974", "0.57868713", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437", "0.577437" ]
0.77202564
0
Move ALL tiles left
function moveTilesLeft() { for (var column = 1; column <= 3; column++) { for (var row = 3; row >= 0; row--) { if (checkLeft(row, column) && tileArray[row][column] != null) { moveTileLeft(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % width === 0,\n );\n if (!isAtLeftEdge) {\n currentPosition -= 1;\n }\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\"),\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(\r\n (index) => (currentPosition + index) % width === 0\r\n );\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition += 1;\r\n }\r\n draw();\r\n }", "function moveLeft () {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) {\n currentPosition -= 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n draw()\n }", "function moveLeft() {\n undraw()\n\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) currentPosition -= 1\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n\n draw()\n }", "function moveLeft()\r\n {\r\n undraw()\r\n const isAtLeftEdge = currentTetromino.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge)\r\n currentPosition -= 1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition += 1\r\n draw()\r\n }", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some((index) => (currentPosition + index) % width === 0);\n if (!isAtLeftEdge) currentPosition -= 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n draw();\n}", "function moveLeft() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtLeftEdge = current.some(\n //condition is at left hand side is true\n (index) => (currentPosition + index) % width === 0\n );\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveLeft(){\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width ===0)\n if(!isAtLeftEdge) currentPosition-=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition+=1;\n }\n\n draw();\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge) currentPosition -=1\r\n\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\n draw()\r\n }", "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveLeft() {\n undraw()\n const reachedLeftEdge = curT.some(index => (curPos + index) % width === 0)\n if (!reachedLeftEdge) curPos -= 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos += 1\n }\n draw()\n }", "function moveLeft() {\n undraw(squares, current, currentPosition);\n const isAtLeftEdge = current.some(index => (currentPosition + index) % WIDTH === 0);\n \n if(!isAtLeftEdge) currentPosition -= 1;\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n\n draw();\n }", "function moveAllToLeft() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 0;\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function moveLeft() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column - 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function moveLeft() {\n unDraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % xPixel === 0\n );\n\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n\n draw();\n }", "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if(!isAtLeftEdge) currentPosition -=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition +=1\n }\n draw()\n}", "function moveTileLeft(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column - 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column - 1)) {\n $(tileArray[row][column - 1]).remove();\n tileArray[row][column - 1] = null;\n } else {\n tileArray[row][column - 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column - 1].id.slice(5)) - 1));\n } \n });\n tileArray[row][column - 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "_moveLeft() {\n if (this._currentPosition < 2 && this._settings.infinity) {\n this._moveLeftInfinity();\n return;\n }\n for (let moved = 0; moved < this._settings.moveCount; moved++) {\n if (this._currentPosition < 1) break;\n\n this._itemsHolder.style.transition = `transform ${ this._settings.movementSmooth }ms`;\n\n const targetItem = this._items[this._currentPosition - 1];\n this._offset += targetItem.offsetWidth + this._settings.slidesSpacing;\n\n this._itemsHolder.style.transform = `translateX(${ this._offset + this._calcTowardsLeft() }px)`;\n\n this._currentPosition -= 1;\n }\n this._adaptViewWrapSizes();\n this._setDisplayedItemsClasses();\n }", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\r\n // allows shape to move left if it's not at the left position\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n\r\n // push it unto a tetrimino that is already on the left edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition += 1;\r\n\r\n }\r\n draw();\r\n}", "function left_move() {\n if (coord_pos[0] > 0) {\n coord_pos[0] -= 1;\n }\n else if(coord_pos[1] > 0) { // If we need to wrap around (and have room to)\n coord_pos[0] = n;\n coord_pos[1] -= 1;\n } else { // If we hit the upper left, we go the bottom right corner\n coord_pos = [n,n];\n }\n recent_move = -1;\n}", "function moveLeft() {\n let prevCol;\n let curCol;\n let temp;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth - 1; x++) {\n if (x === sizeWidth - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get((x + 1) * sizeBlock + 1, y * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect((x + 1) * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index)% width ===0)\r\n if(!isAtLeftEdge) currentPosition -=1\r\n if(current.some (index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\ndraw()\r\n}", "_moveLeftInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = this._items.length;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n\n this._offset = -(this._calcShiftMaxLength() + this._calcTowardsLeft() );\n this._itemsHolder.style.transform = `translateX(${ this._offset - this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveLeft(), this._settings.oppositeSideAppearDelay);\n }", "function moveWithLogLeft() {\n if (currentIndex > 18 && currentIndex <= 26) {\n squares[currentIndex].classList.remove('frog');\n currentIndex -= 1;\n squares[currentIndex].classList.add('frog');\n }\n }", "function moveLeft() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol);\n\t\t}\n\n\t\tdraw();\n\t}", "function moveLeft(){\n //first check that keys are enabled\n if(keyEnabled == true){\n undraw();\n const isAtLeftEdge = currentShape.some(index => (currentPosition + index)% 10 === 0 )\n\n if(!isAtLeftEdge)\n {\n currentPosition = currentPosition - 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition +1;\n }\n\n draw();\n }\n }", "function moveLeftAll() {\n allTheObstacles1.forEach((eachObstacle) => {\n eachObstacle.moveLeft();\n })\n allTheObstacles2.forEach((eachObstacle) => {\n eachObstacle.moveLeft();\n })\n allCloud1.forEach((cloud) => {\n cloud.moveLeft();\n })\n allCloud2.forEach((cloud) => {\n cloud.moveLeft();\n })\n\n player1.moveLeft();\n player2.moveLeft();\n}", "function moveAliensLeft() {\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.remove('alien')\n })\n currentAlienPositions = currentAlienPositions.map((alien) => {\n return alien -= 1\n })\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.add('alien')\n })\n}", "function moveTile() {\n moveTileHelper(this);\n }", "function moveLeft() {\n for (var i = 0; i < 4; i++) {\n\t\t\tvar k =0;\n\t\t\tfor (var j = 1; j < 4; j++) {\n\t\t\t\tif(mat[i][k] === 0 && mat[i][j]!== 0){\n\t\t\t\t\tmat[i][k] =mat[i][j];\n\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\tstateChange = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(mat[i][k] === mat[i][j] && mat[i][k] !== 0){\n\t\t\t\t\tmat[i][k] = 2*mat[i][k];\n\t\t\t\t\tscore += mat[i][k];\n\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\t++k;\n\t\t\t\t\tstateChange = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(mat[i][k] !== mat[i][j] && mat[i][k] !==0 && mat[i][j] !==0){\n\t\t\t\t\tif(k == j-1){\n\t\t\t\t\t\t++k;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t++k;\n\t\t\t\t\t\tmat[i][k] = mat[i][j];\n\t\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\t\tstateChange = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "newPieceMoveLeft(){\n\n\t\tlet isCollision = false;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0]-1 \t+ index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1] \t+ Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || x < 0){\n\t\t\t\t\tisCollision = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif(!isCollision){\n\t\t\tthis.newPiecePosition[0] -= 1;\n\t\t}\n\n\t}", "function move_left() {\n\t check_pos();\n\t blob_pos_x = blob_pos_x - move_speed;\n\t}", "function moveLeft(){\n let initialPosLeft = witch.getBoundingClientRect().left;\n let lifeLeft = witch_lifeline.getBoundingClientRect().left;\n if(initialPosLeft > 32){\n witch_lifeline.style.left = lifeLeft - 20 + 'px';\n witch.style.left = initialPosLeft - 20 + 'px';\n }\n}", "moveLeft() {\r\n this.actual.moveLeft();\r\n }", "function moveWithLogLeft() {\n if (index >= 27 && index < 35) {\n squares[index].classList.remove('man')\n index += 1\n squares[index].classList.add('man')\n }\n }", "shiftCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\t\t\tvar newX = card.x - 20;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "function moveLeft() {\n moveOn();\n }", "function moveLeft() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.left);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function moveAllPlayers() {\n for (const player of this.playerStates) {\n if (player.direction && player.alive) {\n const oldPositions = player.positions.slice();\n player.positions[0] = {\n x: player.positions[0].x + player.direction.x,\n y: player.positions[0].y + player.direction.y\n };\n\n if (player.positions[0].x < 0) {\n player.positions[0].x += SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].x >= SNAKE_GAME_CONFIG.gridSize.width) {\n player.positions[0].x -= SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].y < 0) {\n player.positions[0].y += SNAKE_GAME_CONFIG.gridSize.height;\n }\n if (player.positions[0].y >= SNAKE_GAME_CONFIG.gridSize.height) {\n player.positions[0].y -= SNAKE_GAME_CONFIG.gridSize.height;\n }\n\n for (let i = 1; i < player.positions.length; i++) {\n player.positions[i] = oldPositions[i - 1];\n }\n if (player.positions.length < player.length) {\n player.positions.push(oldPositions[oldPositions.length - 1]);\n }\n }\n }\n}", "moveLeft() {\n this.x>0?this.x-=101:false;\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "function moveLeft(){\n ctx.clearRect(0, 0, 450, 450);\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 6 || empty == 9 || empty == 3){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty+1;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n }\n}", "function moveAllToRight() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 3;\n\t\tfor (var c = 3; c >= 0 ; c-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function MoveToLeftMost(){\n\t//var movePixel = 8 - circles[pointedCircle].guiTexture.pixelInset.x;\n\n\tvar amount = circles.length;\n\tfor (var i = pointedCircle; i < amount; i++)\n\t{\n\t\tcircles[i].transform.position = Vector3.MoveTowards(circles[i].transform.position, Vector3(tarPosX[i], 0.91, 0), Time.deltaTime);\n\t}\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function moveAllGhosts() { ghosts.forEach(ghost => moveGhost(ghost))}", "function moveLeft(){\n mergeLeft();\n //Merging block first, pushing later\n for (var i = 0; i < height; i++){\n for (var temp = 0; temp < width - 1; temp++){ //This line will repeat the moving block until all blocks are moved to the very left\n for (var j = 0; j < width - 1; j++){\n if (block2D[i][j] == 0){ //Skip value 0 at the last element \n block2D[i][j] = block2D[i][j + 1];\n block2D[i][j + 1] = 0;\n }\n }\n }\n }\n console.log(\"Move left:\");\n printBoardSimple();\n addBlock();\n}", "function moveWithLogLeft() {\n if (currentIndex >= 27 && currentIndex < 35) {\n $(\"div\").removeClassWild(\"frog-*\");\n currentIndex += 1\n squares[currentIndex].classList.add('frog-on-log')\n }\n}", "function moveAllEntities() {\n gameMap.clearEntities(0);\n lanes5.forEach(function (entity) {\n checkForEach(entity.y, entity);\n });\n lanes10.forEach(function (entity) {\n checkForEach(entity.y, entity);\n });\n cheeses.forEach(function (entity) {\n entity.update();\n });\n livesImages.forEach(function (life) {\n life.update();\n });\n timer.update();\n scoreImage.update(score);\n updateHighScore();\n highScoreImage.update(highScore);\n checkForPlayerMove(\n player.x,\n player.x + player.width,\n player.y,\n player.y + player.height\n );\n}", "moveLeft() {\n\n if (this.posX >= 10 && pause == false)\n this.posX = this.posX - 5;\n }", "function moveLeft() {\n //remove current shape, slide it over, if it collides though, slide it back\n removeShape();\n currentShape.x--;\n if (collides(grid, currentShape)) {\n currentShape.x++;\n }\n //apply the new shape\n applyShape();\n}", "function moveShapeLeft(){\n square_pos = 0;\n for( var i = 0; i < 32; i+= 2){\n positions[square_pos+i] = positions[square_pos+i] - 0.1*(X_MAX-X_MIN);\n }\n main();\n}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "moveLeftRight(val) {\r\n let newGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n let rowAdd = [];\r\n for (let j = 0; j < this.gameState.board.length; j++) {\r\n if ((i + 1) === Math.ceil(((j + 1) / this.size))) {\r\n rowAdd.push(this.gameState.board[j]);\r\n }\r\n }\r\n newGrid.push(rowAdd);\r\n }\r\n for (let i = 0; i < newGrid.length; i++) {\r\n if(val === 0) {newGrid[i] = this.aggregateUpLeft(newGrid[i])} else {newGrid[i] = this.aggregateDownRight(newGrid[i])}\r\n }\r\n let returnGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n for (let j = 0; j < this.size; j++) {\r\n returnGrid.push(newGrid[i][j])\r\n }\r\n }\r\n if(!(returnGrid.join(',') === this.gameState.board.join(','))){\r\n this.gameState.board = returnGrid;\r\n this.genNextSpot()\r\n }\r\n }", "function moveLeft() {\r\n var min = 99;\r\n for(index of shipArray) {\r\n if(min > index) {\r\n min = index;\r\n }\r\n }\r\n if((min % 10) != 0) {\r\n for(i in shipArray) {\r\n shipArray[i]--;\r\n }\r\n }\r\n //If it is possible to move the ship here, then do so\r\n if(checkPlacement() == true) {\r\n updatePosColor();\r\n }\r\n}", "function moveLeft () {\n\t\tvar hiddenRight \t= $(window).width() - $ps_albums.offset().left;\n\t\n\t\tvar cnt = 0;\n\t\tvar last= first+3;\n\t\t$ps_albums.children('div:nth-child('+last+')').animate({'left': hiddenRight + 'px','opacity':0},500,function(){\n\t\t\t\tvar $this = $(this);\n\t\t\t\t$ps_albums.children('div').slice(parseInt(last-4),parseInt(last-1)).each(\n\t\t\t\t\tfunction(i){\n\t\t\t\t\t\tvar $elem = $(this);\n\t\t\t\t\t\t$elem.animate({'left': positions[i+1] + 'px'},800,function(){\n\t\t\t\t\t\t\t++cnt;\n\t\t\t\t\t\t\tif(cnt == 3){\n\t\t\t\t\t\t\t\t$ps_albums.children('div:nth-child('+parseInt(last-4)+')').animate({'left': positions[0] + 'px','opacity':1},500,function(){\n\t\t\t\t\t\t\t\t\t//$this.hide();\n\t\t\t\t\t\t\t\t\t--first;\n\t\t\t\t\t\t\t\t\tenableNavRight();\n\t\t\t\t\t\t\t\t\tif(first > 1){\n\t\t\t\t\t\t\t\t\t\tenableNavLeft();\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tTempdisableNavLeft();\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}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t});\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t});\n\t}", "function moveLeft(gifs) {\n if (gifIndex > 0) {\n gifIndex = gifIndex - 1;\n } else {\n gifIndex = gifs.length - 1;\n }\n changeContent(gifs);\n}", "moveLeft() {\n if (this.x === 0) {\n this.x = this.tape[0].length - 1;\n } else {\n this.x--;\n }\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "moveLeft() {\n if (!this.collides(-1, 0, this.shape)) this.pos.x--\n }", "function moveShapeLeft()\n {\n undrawShape();\n\n // check to see if the shape is at the edge of the grid\n // this is to prevent the shape going out and appear from the other side of the grid\n const isAtLeftEdge = currentShape.some(\n (index) => (currentPosition + index) % GRID_WIDTH === 0);\n\n \n if(!isAtLeftEdge)\n {\n currentPosition -=1;\n canRotate = true;\n }\n else if (isAtLeftEdge)\n {\n canRotate = false;\n }\n\n\n let isCollisionSquare = currentShape.some(\n (index) => squares[currentPosition + index].classList.contains(\"taken\"))\n \n \n if(isCollisionSquare)\n {\n currentPosition+=1 // dont move the shape to the left \n }\n\n drawShape();\n\n }", "function moveLeft() {\r\n moveTo(player.x - 1, player.y);\r\n}", "function toLeft(){\n imgIndex--;\n if(imgIndex == -1){\n imgIndex = imgItems.length-1;\n }\n changeImg(imgIndex);\n }", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function moveAll(){\r\n var newX = fabImg.getLeft();\r\n var newY = fabImg.getTop();\r\n\r\n for(var key in allElements){ \r\n var item = allElements[key]; \r\n var iLeft = item.getLeft() - (lastImageX-newX);\r\n var iTop = item.getTop() - (lastImageY-newY);\r\n if(item){\r\n item.setItemPos(iLeft, iTop, AnnotationTool.SCALE);\r\n }\r\n }\r\n \r\n lastImageX = newX;\r\n lastImageY = newY;\r\n canvas.renderAll();\r\n\r\n }", "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'left')\n\t\t{\n\t\t\tmissiles[i]['position'][0] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'up')\n\t\t{\n\t\t\tmissiles[i]['position'][1] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'down')\n\t\t{\n\t\t\tmissiles[i]['position'][1] += 10;\n\t\t}\n\t}\n}", "function movePieces() {\n currentTime--\n timeLeft.textContent = currentTime\n autoMoveCars()\n autoMoveLogs()\n moveWithLogLeft()\n moveWithLogRight()\n lose()\n }", "function moveRow1L(grid) {\n for (let i = 0; i < 7; i++) {\n if ((grid[i].position) < 7) {\n grid[i].position -= 1;\n } if (grid[i].position < 0) {\n grid[i].position = 6;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "getLeftTile() {\n\t\treturn this.position;\n\t}", "function move() {\n\t\tmovePiece(this);\n\t}", "function moveLeft() {\n robotLeft -= 10;\n robot.style.left = robotLeft + \"px\";\n }", "function onMoveLeft(evt){\n\t\t\troote.box.x -=20;\n\t\t}", "handleCollLeft(obj, tileLeft) {\n if (obj.right > tileLeft && obj.rightOld <= tileLeft) {\n obj.right = tileLeft - 0.01;\n obj.velX = 0;\n return true;\n }\n return false;\n }", "function movePieces() {\n currentTime--;\n timeLeft.textContent = currentTime;\n autoMoveCars();\n autoMoveLogs();\n moveWithLogLeft();\n moveWithLogRight();\n lose();\n \n }", "move() {\n this.x = this.x - 7\n }", "function moveShipLeft() {\n\tif(leftDown) {\n\t\tif(((fighter.position().left - (FIGHTER_WIDTH / 2)) / SCALE) - 2 > 0) {\n\t\t\tfighter.css('left', \"-=2\");\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "function moveAllToTop() {\n\tvar moved = false;\n\tfor (var c = 0; c < 4 ; c++ ) {\n\t\tvar s = 0;\n\t\tfor (var r = 0; r < 4 ; r++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (r != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(s, c, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function moveLeft(){\n if (current != 1){\n current--;\n }\n smlImage();\n norm('#image', .3, 1);\n\n if ($('#image').hasClass('pixPerf')){\n $('.leftButt').css('visibility','hidden');\n }\n $('.rightButt').css('visibility','visible');\n moveCirc(current+1, current);\n}", "function moveLeft() {\n ////if the player moves from the initial position horizontally to the left and faces a wall\n if (firstLevel[playerPosI][playerPosJ - 1] == \"x\") {\n //do not let the player to do so\n return;\n }\n //if the player moves from the initial position horizontally to the left and faces a box\n if (firstLevel[playerPosI][playerPosJ - 1] == \"*\") {\n //when moving a box and the second consecutive position after the player moves the box\n //when the position is not the wall and not a box\n if (firstLevel[playerPosI][playerPosJ - 2] != \"x\" && firstLevel[playerPosI][playerPosJ - 2] != \"*\") {\n //when on the goal\n if (isOverGoal(playerPosI, playerPosJ) == true) {\n //update to player point symbol\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //update to floor symbol\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //vertical position of the player remains the same\n playerPosI = playerPosI;\n //horizontal goes back one step -> meaning to the left\n playerPosJ = playerPosJ - 1;\n //player\n firstLevel[playerPosI][playerPosJ] = \"&\";\n //the box moves with the player\n firstLevel[playerPosI][playerPosJ - 1] = \"*\";\n }\n } else {\n //if player is on the goal position\n if(isOverGoal(playerPosI, playerPosJ) == true) {\n //change the symbol to player\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //update to floor\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //player moves to the left\n //vertical position remains the same\n playerPosI = playerPosI;\n //horizontal position is signified by extracting one to indicate moving to the left\n playerPosJ = playerPosJ - 1;\n //indicate the moving symbol\n firstLevel[playerPosI][playerPosJ] = \"&\";\n }\n printArrayHTML(firstLevel);\n}", "_moveToStart() {\n // moveCount can disturb the method logic.\n const initialMoveCount = this._settings.moveCount;\n this._settings.moveCount = 1;\n\n for (let pos = 1; pos < this._settings.startPosition; pos++) {\n this._rightMoveHandler();\n }\n this._settings.moveCount = initialMoveCount;\n }", "function swapLeft(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y, x: blankPOS.x - 1 })\n}", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function lMove(){\n\n if( position == right){\n flag = true; //set to true when movement needs to move back to left\n }\n //moving right\n if (position < right){\n position++;\n }\n\n obj.style.left = position + \"px\"; //adds the value px i.e #px\n}", "moveForward() {\n const { mainImageIndex, allIds } = this.state;\n\n // If not at the end\n if (mainImageIndex !== allIds.length - 1) {\n // Add one and set mainImage Index\n const nextIndex = mainImageIndex + 1;\n this.setState({\n mainImageIndex: nextIndex\n });\n // Take the current translate value and subtract one image's width from it.\n // This causes a smaller translate value moving the images container left,\n // but appears right.\n this.setState(prevState => ({\n translateValue: prevState.translateValue - this.getImageWidth()\n }));\n } else {\n // Ok now we're at the end of the array.\n // Set values back to default values.\n this.setState({ mainImageIndex: 0 });\n this.setState({ translateValue: 0 });\n }\n }", "moveBgLeft() {\n let minBgLeft = -this.bgImg.width + width;\n\n if (this.bgLeft - this.moveSpeed > minBgLeft) {\n for(let i = 0; i < lasers.length; i++){\n let laser = lasers[i];\n laser.x -= this.moveSpeed;\n }\n }\n super.moveBgLeft();\n }", "function moveLeft(){\nif(currentPosition > start) {\n paddleCollision()\n player.style.left = currentPosition - 5 + 'px';\n }\n}", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function leftWin() {\n\tif (clickable) {\n\t\ttempArr.push(idList[currentL]);\n\t\tcurrentL++;\n\t\tif (currentL > middle) {\n\t\t\twhile (currentR <= right) {\n\t\t\t\ttempArr.push(idList[currentR]);\n\t\t\t\tcurrentR++;\n\t\t\t}\n\t\t\treposition();\n\t\t} else {\n\t\t\tloadPokemonData();\n\t\t}\n\t}\n}" ]
[ "0.7500292", "0.7400394", "0.7333599", "0.73320657", "0.73221576", "0.7276573", "0.725312", "0.7243681", "0.722043", "0.72151256", "0.72095245", "0.72088295", "0.7208449", "0.72031623", "0.71905416", "0.7183518", "0.7159868", "0.7144131", "0.71268165", "0.7115274", "0.7046571", "0.6974525", "0.6905222", "0.68649083", "0.6847748", "0.67941606", "0.67889583", "0.67642486", "0.6739785", "0.6692783", "0.6661621", "0.665409", "0.6635148", "0.66227674", "0.6569758", "0.65659434", "0.6563421", "0.6557052", "0.6552908", "0.6544887", "0.65098464", "0.6501604", "0.647722", "0.64317834", "0.6430733", "0.641861", "0.6388871", "0.6378656", "0.6353641", "0.63300496", "0.63133174", "0.62967175", "0.6291508", "0.628591", "0.62664646", "0.62639767", "0.6239571", "0.6233258", "0.6229008", "0.622331", "0.62216324", "0.62178415", "0.6214228", "0.61962795", "0.6146563", "0.61314166", "0.6123076", "0.6111597", "0.6109887", "0.60922956", "0.6075239", "0.6068613", "0.6041297", "0.6037507", "0.6017891", "0.6001539", "0.60004085", "0.60002214", "0.5979041", "0.59730726", "0.5962185", "0.59381545", "0.5935", "0.59341985", "0.59155005", "0.59071094", "0.5896954", "0.589655", "0.58886075", "0.5887753", "0.5876174", "0.5868665", "0.5868457", "0.5860365", "0.5857144", "0.5850061", "0.58311135", "0.5820752", "0.5819635", "0.5813438" ]
0.7914101
0
Move ALL tiles right
function moveTilesRight() { for (var column = 2; column >= 0; column--) { for (var row = 3; row >= 0; row--) { if (checkRight(row, column) && tileArray[row][column] != null) { moveTileRight(row, column); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveTile() {\n moveTileHelper(this);\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveAllToRight() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 3;\n\t\tfor (var c = 3; c >= 0 ; c-- ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts--;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "function moveRight() {\r\n unDraw();\r\n const isAtRightEdge = current.some(\r\n (index) => (currentPosition + index) % width === width - 1\r\n );\r\n if (!isAtRightEdge) currentPosition += 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function moveRight() {\n undraw();\n //check if any of the tetromino's cells are on the right edge\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % width === width-1);\n //move tetromino to the right if none of its cells is at the left edge\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n \n //move tetromino one column to the right if any of its cells try and occupy a 'taken' cell\n if(currentTetromino.some(index=> squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1; \n }\n\n draw();\n }", "function moveRight () {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) {\n currentPosition += 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n draw()\n }", "function moveRight(){\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition+index)%width === width-1);\n if(!isAtRightEdge) currentPosition +=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition-=1;\n }\n\n draw();\n }", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(\r\n index=> (currentPosition + index) % width === width - 1)\r\n \r\n if (!isAtRightEdge) {\r\n currentPosition += 1;\r\n }\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some((index) => (currentPosition + index) % width === width - 1);\n if (!isAtRightEdge) currentPosition += 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1;\n }\n draw();\n}", "function moveRight() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column + 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "function moveRight() {\n undraw()\n\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) currentPosition += 1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n\n draw()\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n if(current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition -=1;\n }\n draw();\n }", "function moveRight() {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width -1)\n if(!isAtRightEdge) currentPosition +=1\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -=1\n }\n draw()\n}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function moveRight() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtRightEdge = current.some(\n //condition is at right hand side is true\n (index) => (currentPosition + index) % width === width - 1\n );\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n draw();\n }", "moveRight() {\n dataMap.get(this).moveX = 5;\n }", "function moveRight(){\r\n undraw()\r\n const isAtRightEdge = current.some(index => (currentPosition + index)%width === width -1)\r\n if(!isAtRightEdge) currentPosition +=1\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition -=1\r\n }\r\n draw()\r\n}", "function moveTileRight(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column + 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column + 1)) {\n $(tileArray[row][column + 1]).remove();\n tileArray[row][column + 1] = null;\n } else {\n tileArray[row][column + 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1));\n }\n });\n tileArray[row][column + 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function moveRight() {\n let prevCol;\n let curCol;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth; x++) {\n if (x === 0) {\n prevCol = get((sizeWidth - 1) * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x, y * sizeBlock, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function moveRight() {\n unDraw();\n const isAtRightEdge = current.some(\n (index) => (currentPosition + index) % xPixel === xPixel - 1\n );\n\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n\n draw();\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function moveRight(){\n if(keyEnabled == true){\n undraw();\n const isAtRightEdge = currentShape.some(index => (currentPosition + index)% width === width - 1 )\n\n if(!isAtRightEdge)\n {\n currentPosition = currentPosition + 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition -1;\n }\n\n draw();\n }\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\r\n // allows shape to move right if it's not at the right position\r\n if (!isAtRightEdge) currentPosition += 1;\r\n\r\n // push it unto a tetrimino that is already on the right edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition -= 1;\r\n\r\n }\r\n draw();\r\n}", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "function moveWithLogRight() {\n if (currentIndex >= 27 && currentIndex < 35) {\n squares[currentIndex].classList.remove('frog');\n currentIndex += 1;\n squares[currentIndex].classList.add('frog');\n }\n }", "function move_missiles()\n{\t\t\t\n\tmissile_timer -= 1;\n\tfor(var i = 0;i<missiles.length;i++)\n\t{\n\t\tif (missiles[i]['direction'] == 'right')\n\t\t{\n\t\t\tmissiles[i]['position'][0] += 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'left')\n\t\t{\n\t\t\tmissiles[i]['position'][0] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'up')\n\t\t{\n\t\t\tmissiles[i]['position'][1] -= 10;\n\t\t}\n\t\telse if (missiles[i]['direction'] == 'down')\n\t\t{\n\t\t\tmissiles[i]['position'][1] += 10;\n\t\t}\n\t}\n}", "_moveRight() {\n const reservedWidth = Math.max(this._settings.showCount, this._settings.moveCount);\n const isEnoughSpace = this._currentPosition + reservedWidth < this._items.length;\n\n if (!isEnoughSpace) {\n this._moveRightInfinity();\n return;\n }\n\n for (let moved = 0; moved < this._settings.moveCount; moved++) {\n const isEnoughSpace = (this._currentPosition + this._settings.showCount) < this._items.length;\n if (!isEnoughSpace) break;\n\n this._itemsHolder.style.transition = `transform ${ this._settings.movementSmooth }ms`;\n\n const currentItem = this._items[this._currentPosition];\n this._offset -= currentItem.offsetWidth + this._settings.slidesSpacing;\n\n this._itemsHolder.style.transform = `translateX(${ this._offset - this._calcOppositeRight() }px)`;\n\n this._currentPosition += 1;\n }\n this._adaptViewWrapSizes();\n this._setDisplayedItemsClasses();\n }", "function swapWithRightTiles(pos, g) {\n\t\t// center position.\n\t\tlet taps = [];\n\t\tlet tp = function(tile) {\n\t\t\tlet tapped = tap(tile,g);\n\t\t\ttaps.push(tapped);\n\t\t}\n\t\tlet [r,c] = [pos[0]+1, pos[1]];\n\t\tlet [\n\t\t\tt1,t2,t3,t4,t5,t6,t7,t8,t9\n\t\t]\n\t\t\t= [\n\t\t\t[r-1,c-1], [r-1,c], [r-1,c+1], [r,c-1], [r,c], [r,c+1], [r+1,c-1], [r+1,c], [r+1,c+1]\n\t\t];\n\n\t\tif(![t1,t2,t3,t4,t5,t6,t7,t8,t9].every(t=>tileExists(t,g))) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttaps.push(...moveSpaceTo(t5,g,{avoids:[t1,t2,t3],test:false}));\n\t\ttp(t2);\n\t\t//rotate counter-clockwisely.\n\t\t[t3,t6,t9,t8,t7,t4,t1].forEach(t=>tp(t));\n\t\ttp(t2);\n\t\ttp(t5);\n\t\ttp(t6);\n\t\t//rotate clockwisely to turn [t1,t2,t3] back to top row;\n\t\t[t3,t2,t1,t4].forEach(t=>tp(t));\n\t\treturn taps;\n\t}", "function moveAllToLeft() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 0;\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "moveRight() {\n this.shinobiPos.x += 30\n }", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "moveRight() {\r\n this.actual.moveRight();\r\n }", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function moveAll(){\r\n var newX = fabImg.getLeft();\r\n var newY = fabImg.getTop();\r\n\r\n for(var key in allElements){ \r\n var item = allElements[key]; \r\n var iLeft = item.getLeft() - (lastImageX-newX);\r\n var iTop = item.getTop() - (lastImageY-newY);\r\n if(item){\r\n item.setItemPos(iLeft, iTop, AnnotationTool.SCALE);\r\n }\r\n }\r\n \r\n lastImageX = newX;\r\n lastImageY = newY;\r\n canvas.renderAll();\r\n\r\n }", "shiftCards() {\n\n\t\tfor (var i = this.cards.children.length - 1; i >= 0; i--) {\n\n\t\t\tvar card = this.cards.getChildAt(i);\n\t\t\tvar newX = card.x - 20;\n\n\t\t\tif (newX < this.leftBound) {\n\t\t\t\tnewX = this.leftBound;\n\t\t\t}\n\n\t\t\tif (newX != card.x) {\n\t\t\t\tcard.moveCardTo(newX, card.y, 1);\n\t\t\t}\n\t\t}\n\t}", "function editorRedoTiles(game, map, px, py) {\n for (var dx = -1; dx <= 1; dx++) {\n for (var dy = -1; dy <= 1; dy++) {\n editorRedoTile(game, map, px + dx, py + dy); // can handle outside map\n }\n }\n}", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(row, column);\n }\n }\n }\n }", "function moveWithLogRight() {\n if (index > 18 && index <= 26) {\n squares[index].classList.remove('man')\n index -= 1\n squares[index].classList.add('man')\n }\n }", "_moveRightInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = 0;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n this._offset = this._calcDisplayedItemsTotalWidth() -\n (this._settings.neighborsVisibleWidth + this._calcOppositeRight());\n this._itemsHolder.style.transform = `translateX(${ this._offset + this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveRight(), this._settings.oppositeSideAppearDelay);\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "function moveShapeRight(){\n square_pos = 0;\n for( var i = 0; i < 32; i+= 2){\n positions[square_pos+i] = positions[square_pos+i] + 0.1*(X_MAX-X_MIN);\n }\n main();\n}", "function moveTilesLeft() {\n for (var column = 1; column <= 3; column++) {\n for (var row = 3; row >= 0; row--) {\n if (checkLeft(row, column) && tileArray[row][column] != null) {\n moveTileLeft(row, column);\n }\n }\n }\n }", "function moveAllEntities() {\n gameMap.clearEntities(0);\n lanes5.forEach(function (entity) {\n checkForEach(entity.y, entity);\n });\n lanes10.forEach(function (entity) {\n checkForEach(entity.y, entity);\n });\n cheeses.forEach(function (entity) {\n entity.update();\n });\n livesImages.forEach(function (life) {\n life.update();\n });\n timer.update();\n scoreImage.update(score);\n updateHighScore();\n highScoreImage.update(highScore);\n checkForPlayerMove(\n player.x,\n player.x + player.width,\n player.y,\n player.y + player.height\n );\n}", "function moveRight() {\n if (flag) {\n flag = 0;\n //change the position of the element in array\n config.unshift(config.pop());\n //reset photos\n configImg();\n }\n }", "function moveRight() {\n removeShape();\n currentShape.x++;\n if (collides(grid, currentShape)) {\n currentShape.x--;\n }\n applyShape();\n}", "function moveRow2R(grid) {\n for (let i = 7; i < 14; i++) {\n if ((grid[i].position) > 6) {\n grid[i].position += 1;\n } if (grid[i].position > 13) {\n grid[i].position = 7;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveRight() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][Cols - 1 - col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol).reverse();\n\t\t}\n\n\t\tdraw();\n\t}", "function moveAllGhosts() { ghosts.forEach(ghost => moveGhost(ghost))}", "function move_right() {\n\t check_pos();\n\t blob_pos_x = blob_pos_x + move_speed;\n\t}", "function moveRight() {\r\n var max = 0;\r\n for(index of shipArray) {\r\n if(max < index) {\r\n max = index;\r\n }\r\n }\r\n if((max % 10) != 9) {\r\n for(i in shipArray) {\r\n shipArray[i]++;\r\n }\r\n }\r\n //If it is possible to move the ship here, then do so\r\n if(checkPlacement() == true) {\r\n updatePosColor();\r\n }\r\n}", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function moveAllPlayers() {\n for (const player of this.playerStates) {\n if (player.direction && player.alive) {\n const oldPositions = player.positions.slice();\n player.positions[0] = {\n x: player.positions[0].x + player.direction.x,\n y: player.positions[0].y + player.direction.y\n };\n\n if (player.positions[0].x < 0) {\n player.positions[0].x += SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].x >= SNAKE_GAME_CONFIG.gridSize.width) {\n player.positions[0].x -= SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].y < 0) {\n player.positions[0].y += SNAKE_GAME_CONFIG.gridSize.height;\n }\n if (player.positions[0].y >= SNAKE_GAME_CONFIG.gridSize.height) {\n player.positions[0].y -= SNAKE_GAME_CONFIG.gridSize.height;\n }\n\n for (let i = 1; i < player.positions.length; i++) {\n player.positions[i] = oldPositions[i - 1];\n }\n if (player.positions.length < player.length) {\n player.positions.push(oldPositions[oldPositions.length - 1]);\n }\n }\n }\n}", "function move() {\n\t\tmovePiece(this);\n\t}", "move() {\n let to_move = [this.head].concat(this.parts);\n this.dir_q.unshift(this.dir);\n for (let i = 0; i < to_move.length; i++) {\n to_move[i].add(this.dir_q[i]);\n if (to_move[i].x < -width / 2) to_move[i].x = width / 2 - BOX;\n if (to_move[i].x >= (width / 2) - 1) to_move[i].x = -width / 2;\n if (to_move[i].y < -height / 2) to_move[i].y = height / 2 - BOX;\n if (to_move[i].y >= (height / 2) - 1) to_move[i].y = -height / 2;\n }\n }", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "moveBoxes(actualI, actualJ, dir = this.playerDir) {\r\n\r\n //Obtiene la posible siguiente posicion de la caja de acuerdo hacia donde empuja el jugador\r\n let nextI, nextJ;\r\n if (dir === \"playerUp\") {\r\n nextI = actualI - 1;\r\n nextJ = actualJ;\r\n } else if (dir === \"playerDown\") {\r\n nextI = actualI + 1;\r\n nextJ = actualJ;\r\n } else if (dir === \"playerLeft\") {\r\n nextI = actualI;\r\n nextJ = actualJ - 1;\r\n } else if (dir === \"playerRight\") {\r\n nextI = actualI;\r\n nextJ = actualJ + 1;\r\n }\r\n let actualCellMatrix = this.boardMatrix[actualI][actualJ];\r\n let nextCellMatrix = this.boardMatrix[nextI][nextJ];\r\n let moved = false;\r\n //Si no sale del tablero\r\n if (!(nextI < 0) && !(nextJ < 0) && !(nextI >= this.boardMatrix.length) && !(nextJ >= this.boardMatrix[0].length)) {\r\n\r\n //Si la siguiente posicion es vacia\r\n if (nextCellMatrix === \"e\") {\r\n this.boardMatrix[nextI][nextJ] = \"b\";\r\n moved = true;\r\n }\r\n //Si la siguiente posicion es objetivo\r\n else if (nextCellMatrix === \"o\") {\r\n this.boardMatrix[nextI][nextJ] = \"bo\";\r\n moved = true;\r\n }\r\n\r\n //Si se movio\r\n if (moved) {\r\n //Pinta la celda actual de acuerdo a si es objetivo o vacia\r\n if (actualCellMatrix === \"b\") {\r\n this.boardMatrix[actualI][actualJ] = \"e\";\r\n } else if (actualCellMatrix === \"bo\") {\r\n this.boardMatrix[actualI][actualJ] = \"o\";\r\n }\r\n this.paintPosition(actualI, actualJ);\r\n this.paintPosition(nextI, nextJ);\r\n\r\n }\r\n\r\n\r\n }\r\n return moved;\r\n\r\n }", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function moveAliensRight() {\n //* remove aliens from current positions\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.remove('alien')\n })\n //* Redefine Positions\n currentAlienPositions = currentAlienPositions.map((alien) => {\n return alien += 1\n })\n //* Add aliens to new positions\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.add('alien')\n })\n}", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "moveLeftRight(val) {\r\n let newGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n let rowAdd = [];\r\n for (let j = 0; j < this.gameState.board.length; j++) {\r\n if ((i + 1) === Math.ceil(((j + 1) / this.size))) {\r\n rowAdd.push(this.gameState.board[j]);\r\n }\r\n }\r\n newGrid.push(rowAdd);\r\n }\r\n for (let i = 0; i < newGrid.length; i++) {\r\n if(val === 0) {newGrid[i] = this.aggregateUpLeft(newGrid[i])} else {newGrid[i] = this.aggregateDownRight(newGrid[i])}\r\n }\r\n let returnGrid = []\r\n for (let i = 0; i < this.size; i++) {\r\n for (let j = 0; j < this.size; j++) {\r\n returnGrid.push(newGrid[i][j])\r\n }\r\n }\r\n if(!(returnGrid.join(',') === this.gameState.board.join(','))){\r\n this.gameState.board = returnGrid;\r\n this.genNextSpot()\r\n }\r\n }", "function moveRow6R(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position += 1;\n } if (grid[i].position > 41) {\n grid[i].position = 35;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "__setHandPos(){\n\n this.players.forEach((player, i) => {\n for(var i = 0; i < player.hand.length; i++){\n var tile = player.hand[i];\n\n //if the player is currently moving a tile, do not reset that tile's position\n if(player.selectedTile == tile){\n continue;\n }\n\n //top row\n if(i < player.hand.length/2){\n var posX = this.w/10 + (tile.width + 20)*i;\n var posY = this.h - tile.height - 120;\n\n }\n //bottom row\n else{\n var posX = this.w/10 + (tile.width + 20)* (i - Math.floor(player.hand.length/2));\n var posY = this.h - tile.height - 30;\n }\n\n tile.x = posX;\n tile.y = posY;\n\n }\n });\n }", "move() {\n this.x = this.x - 7\n }", "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift}", "moveRight() {\n this.x<303?this.x+=101:false;\n }", "function moveRight(){\n ctx.clearRect(0, 0, 450, 450);\n\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 1 || empty == 4 || empty == 7){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty-1;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n }\n}", "move(){\n switch(this.direction){\n case \"n\":\n this.col-=1;\n this.direction=\"n\";\n break;\n case \"e\":\n this.row += 1;\n this.direction=\"e\"; \n break;\n case \"s\":\n this.col+=1;\n this.direction = \"s\";\n break;\n case \"w\":\n this. row -=1;\n this.direction=\"w\";\n }\n }", "placeEnd(levelIndex) {\n let pos = this.breadthFirst();\n for (let j = pos.y + 5; j >= pos.y - 5; j--) {\n for (let i = pos.x + 5; i >= pos.x - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n if (levelIndex % 2 === 0) {\n this.tiles[pos.y][pos.x] = 'End';\n } else {\n this.tiles[pos.y][pos.x] = 'Start';\n }\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function moveRight(character) {\n const wallToRight = positionArray[character.currentPosition + 1].classList.contains('wall')\n if (wallToRight === false) {\n positionArray[character.currentPosition + 1].classList.add('swim-right')\n positionArray[character.currentPosition].classList.remove('swim-left', 'swim-up', 'swim-down', 'swim-right', 'enemyOnSquare')\n character.currentPosition++\n }\n }", "function moveRow1R(grid) {\n for (let i = 0; i < 7; i++) {\n if ((grid[i].position) < 7) {\n grid[i].position += 1;\n } if (grid[i].position > 6) {\n grid[i].position = 0;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function layout_treeMove(wm, wp, shift) {\n\t var change = shift / (wp.i - wm.i);\n\t wp.c -= change;\n\t wp.s += shift;\n\t wm.c += change;\n\t wp.z += shift;\n\t wp.m += shift;\n\t} // EXECUTE SHIFTS", "function moveRocks() {\n var r = container_rocks.getNumChildren();\n\n for(var j = 0; j < r; j++){\n var rock = container_rocks.getChildAt(j);\n rock.y += rock.velY;\n if(rock.y<0 || rock.y>h){\n\n rock.velY = -rock.velY;\n }\n rock.x += rock.velX;\n if(rock.x<0 || rock.x>w){\n rock.velX = -rock.velX;\n }\n }\n}", "function shuffleTiles(){\n\t\n\t//set the empty tile row and columns position\n\tvar row = 0;\n\tvar col = 0;\n\t\n\t//for loops to ensure iteration over each tile and moving it\n\tfor(var r=0; r < _num_rows; r++)\n\t{\n\t\tfor(var c=0; c < _num_cols; c++)\n\t\t{\n\t\t\tif(tile_array[r][c] === 0) //if its the empty tile, continue to the next tile\n\t\t\t{continue;}\n\t\t\t\n\t\t\tif(!(r-1 < 0) && tile_array[r-1][c] === 0) // check for teh row before the empty tile , if its valid\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[r][c]; // set a temp. variable to save the tile in\n\t\t\t\ttemp3.style.left = c * _tile_width+\"px\";\n\t\t\t\ttemp3.style.top = (r-1) * _tile_height + \"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r-1][c] = temp3;\n\t\t\t}\n\t\t\t\n\t\t\tif(!(c-1 < 0) && tile_array[r][c-1] === 0)\n\t\t\t{\n\t\t\t\tvar temp = tile_array[r][c];\n\t\t\t\ttemp.style.left = (c - 1) * _tile_width+\"px\";\n\t\t\t\ttemp.style.top = r * _tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r][c-1] = temp;\n\t\t\t}\n\t\t\t\n\t\t\tif( (c+1) < _num_cols && tile_array[r][c+1] === 0)\n\t\t\t{\n\t\t\t\tvar temp2 = tile_array[r][c];\n\t\t\t\ttemp2.style.left = (c + 1) * _tile_width+\"px\";\n\t\t\t\ttemp2.style.top = r * _tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r][c+1] = temp2;\n\t\t\t}\n\t\t\t\n\t\t\n\t\t\tif( (r+1) < _num_rows && tile_array[r+1][c] === 0)\n\t\t\t{\n\t\t\t\tvar temp4 = tile_array[r][c];\n\t\t\t\ttemp4.style.left = c * _tile_width+\"px\";\n\t\t\t\ttemp4.style.top = (r+1)*_tile_height+\"px\";\n\t\t\t\ttile_array[r][c] = 0;\n\t\t\t\ttile_array[r+1][c] = temp4;\n\t\t\t}\n\t\t}\n\t}\n\n}", "function tween_tiles() {\n for (j=0; j<MAP_HEIGHT; j++) {\n for (i=0; i<MAP_WIDTH; i++) {\n var tile = map[j][i];\n if (map[j][i]['type'] !== ' ') {\n // tween the tiles until they reach their destination\n // MOVEMENT TWEENING\n if (tile['newx'] !== tile['x']) {\n var diffx = Math.abs(tile['x'] - tile['newx']);\n if (tile['newx'] > tile['x']) {\n tile['tweenx'] += TWEENSPEED;\n }\n else if (tile['newx'] < tile['x']) {\n tile['tweenx'] -= TWEENSPEED;\n }\n }\n if (tile['newy'] !== tile['y']) {\n var diffy = Math.abs(tile['y'] - tile['newy']);\n if (tile['newy'] > tile['y']) {\n tile['tweeny'] += TWEENSPEED;\n }\n else if (tile['newy'] < tile['y']) {\n tile['tweeny'] -= TWEENSPEED;\n }\n }\n // swap tiles when they have completed their movement\n // (if they moved at all)\n if (tile['tweenx'] !== 0 || tile['tweeny'] !== 0) {\n if (Math.abs(tile['tweenx']) > TILESIZE * diffx) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n if (Math.abs(tile['tweeny']) > TILESIZE * diffy) {\n // swap tile and lava\n swap_tiles(i, j, tile['newx'], tile['newy']);\n }\n }\n // ROTATION TWEENING\n if (tile['newangle'] !== tile['angle']) {\n tile['tweenrot'] += TWEENSPEED;\n }\n if (tile['tweenrot'] !== 0) {\n // done rotating\n if (Math.abs(tile['tweenrot']) >= 90) {\n tile['angle'] = tile['newangle'];\n tile['tweenrot'] = 0;\n shift_barriers(i, j);\n }\n }\n\n }\n }\n }\n}", "shift() {\n if (this.isDropping) {\n for (var i = 0; i < this.enemies.length; i++) {\n this.enemies[i].position.y += this.speed;\n }\n //reverses direction\n this.dir *= -1;\n this.isDropping = false;\n } else {\n for (var i = 0; i < this.enemies.length; i++) {\n if (this.dir === -1) {\n this.enemies[i].position.x -= this.speed;\n }\n if (this.dir === 1) {\n this.enemies[i].position.x += this.speed;\n }\n }\n }\n }", "function moveRow6L(grid) {\n for (let i = 35; i < 42; i++) {\n if ((grid[i].position) > 34) {\n grid[i].position -= 1;\n } if (grid[i].position < 35) {\n grid[i].position = 41;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveLeftAll() {\n allTheObstacles1.forEach((eachObstacle) => {\n eachObstacle.moveLeft();\n })\n allTheObstacles2.forEach((eachObstacle) => {\n eachObstacle.moveLeft();\n })\n allCloud1.forEach((cloud) => {\n cloud.moveLeft();\n })\n allCloud2.forEach((cloud) => {\n cloud.moveLeft();\n })\n\n player1.moveLeft();\n player2.moveLeft();\n}", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "function moveRow2L(grid) {\n for (let i = 7; i < 14; i++) {\n if ((grid[i].position) > 6) {\n grid[i].position -= 1;\n } if (grid[i].position < 7) {\n grid[i].position = 13;\n }\n }\n console.log('at end 1R', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "move(direction) {\n\n if (!this.gameIsOver()) {\n if (direction == \"up\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (up to down)\n for (var j = 0; j < n; j++) { // for each current (j), will walk down (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // below tile, always starts directly below current (j)\n if (matrix[j][i] == 0) { // if current is 0, move down to next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if below is 0, move onto next below\n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != below, move onto next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == below, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find lowest tile & pull it up\n for (var j = 0; j < n - 1; j++) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find lowest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[full][i] != 0) { // if a below tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"left\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (L to R)\n for (var j = 0; j < n - 1; j++) { // for each current (j), will walk right (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // right tile, always starts directly to the right of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move right to next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if right is 0, move onto next right\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != right, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == right, combine into current & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make right 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find rightmost tile & pull it left (L to R)\n for (var j = 0; j < n - 1; j++) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find rightmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[i][full] != 0) { // if a right tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n\n this.gameState.board = row; // make board the row array\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n\n return;\n } else if (direction == \"right\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (R to L)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk left (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // left tile, always starts directly to the left of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move onto next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if left is 0, move onto next left\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != left, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == left, combine & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make left 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find leftmost tile & pull it\n for (var j = n - 1; j > 0; j--) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find leftmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[i][full] != 0) { // if a left tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"down\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (down to up)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk up (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // above tile, always starts directly above current (j)\n if (matrix[j][i] == 0) { // if current is 0, move up next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if above is 0, move onto above \n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != above, move up next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == above, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find highest tile & pull it down\n for (var j = n - 1; j > 0; j--) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find highest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[full][i] != 0) { // if an above tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n this.callCallbacks();\n return;\n }\n }\n }" ]
[ "0.7736971", "0.74954706", "0.7475571", "0.7469078", "0.74665296", "0.74237514", "0.69887", "0.69273347", "0.6892154", "0.68891096", "0.6882489", "0.6860779", "0.6857235", "0.68368024", "0.68307424", "0.68184775", "0.6813281", "0.6803559", "0.6780032", "0.67656094", "0.6743682", "0.6743207", "0.6737398", "0.67282015", "0.6708006", "0.66832227", "0.666482", "0.66627717", "0.6656002", "0.656637", "0.65336514", "0.652288", "0.65152633", "0.6506023", "0.64949894", "0.647846", "0.6474304", "0.6467121", "0.64654714", "0.64322484", "0.6346651", "0.6342919", "0.63407713", "0.633971", "0.63391435", "0.6331972", "0.6318936", "0.63152343", "0.63141465", "0.63001806", "0.6291401", "0.6289912", "0.62839055", "0.62489396", "0.6221531", "0.6206631", "0.6198745", "0.61925083", "0.61787206", "0.6165776", "0.615337", "0.61511844", "0.6148335", "0.6143104", "0.6137446", "0.6134135", "0.6116492", "0.61161345", "0.6091825", "0.6091532", "0.6080364", "0.6078477", "0.60692924", "0.60667694", "0.60563534", "0.60488343", "0.60335416", "0.6031519", "0.60285544", "0.60098344", "0.6008782", "0.59869385", "0.5984779", "0.59763753", "0.59723395", "0.5970775", "0.5968316", "0.59665966", "0.5966495", "0.5959155", "0.59572953", "0.5944751", "0.5943391", "0.5940302", "0.59309393", "0.5929754", "0.59270006", "0.5925396", "0.59145314", "0.59109795" ]
0.7752994
0
Make sure the tile space below is clear
function checkBelow(row, column) { if (!isEdge(row + 1, column) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row + 1][column]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "hasSafeTiles(){\n return this._numberOfTiles !== this._numberOfBombs;\n }", "adjustTile(sprite) {\n // set origin at the top left corner\n sprite.setOrigin(0);\n\n // set display width and height to \"tileSize\" pixels\n sprite.displayWidth = this.tileSize;\n sprite.displayHeight = this.tileSize;\n }", "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "function checkSpace()\n\t\t{\n\n\t\t\tvar nb =random(3) ;\n\t\t\tvar nb2 = random(3);\n\t\t\tvar tileNew = $('body').find('[data-x='+nb+'][data-y='+nb2+']');\n\t\t\tif(tileNew.length === 0)\n\t\t\t{\n\t\t\t\treturn {x:nb , y: nb2};\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcheckSpace();\n\t\t\t}\n\t\t}", "trimLoadedTiles() {\n this._cache.trim();\n }", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function checkDestroy() {\n for (let i = 0; i < height; i++) {\n let cnt = 0;\n for (let j = 0; j < width; j++) {\n if (gameBoardData[i][j]) cnt++;\n }\n if (cnt != 10) continue\n for (let j = 0; j < 10; j++) {\n gameBoard.removeChild(allShapePos[i][j]);\n allShapePos[i][j] = null;\n gameBoardData[i][j] = 0;\n }\n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y - 1][x] != null) {\n allShapePos[y][x] = allShapePos[y - 1][x];\n allShapePos[y - 1][x] = null;\n allShapePos[y][x].y += cellSize;\n }\n }\n }\n \n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y][x] != null) {\n gameBoardData[y][x] = 1;\n } else {\n gameBoardData[y][x] = 0;\n }\n }\n }\n }\n}", "function clearEndangeredTiles(isSafeTile)\n{\n // Loop through all the endangered tiles and set them to SAFE_ZONE\n for (var i = 0; i < endangeredTiles.length; i++)\n {\n // stored as ['1,1', '2,2', 3,5']\n var x = parseInt(endangeredTiles[i].split(\",\")[0]);\n var y = parseInt(endangeredTiles[i].split(\",\")[1]);\n\n updateMapTile(x, y, isSafeTile);\n }\n\n // Reset the endangered tiles array\n endangeredTiles = [];\n}", "validSpaces(update) {\n if(!update) {\n return this.validTiles;\n }\n if(this.color == \"white\") {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i + 1];\n return [i + 1];\n } else {\n this.validTiles = [i + 1, i + 2];\n return [i + 1, i + 2];\n }\n } else {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i - 1];\n return [i - 1];\n } else {\n this.validTiles = [i - 1, i - 2];\n return [i - 1, i - 2];\n }\n }\n }", "function clearSpaces() {\n var canvas = document.getElementById(\"checkerboard\");\n var context2D = canvas.getContext(\"2d\");\n\n for (var boardRow = 0; boardRow < 8; boardRow++) {\n for (var boardCol = 0; boardCol < 8; boardCol++) {\n // coordinates of the top-left corner\n\t var x = boardCol * 50;\n\t var y = boardRow * 50;\n if ((boardRow + boardCol) % 2 == 1) {\n\t context2D.fillStyle = \"SeaGreen\";\n\t context2D.fillRect(x, y, 50, 50);\n\t }\n }\n }\n\n context2D.fillStyle = \"Gray\";\n}", "function drawTile0() {\n ctx.clearRect(25, 125, 65, 70);\n ctx.fillStyle = palette[2][0];\n ctx.fillRect(25, 125, 65, 70)\n }", "function ClearPixels(){\n for(const p of prev_pixels){\n p.attr('type','tile');\n }\n prev_pixels = [];\n}", "function tilingWhite() {\n let x = 60;\n let y = 0; // before y = 60\n\n for (let i = 0; i < tileWhite.segmentsY; i++) {\n if (i % 2 === 0) {\n x = 60; // before x = 90;\n }\n else {\n x = 0; //before x = 150;\n }\n // Draws horizontal tiles\n for (let j = 0; j < tileWhite.segmentsX; j++) {\n push();\n noStroke();\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b);\n rect(x,y, tileWhite.size);\n x = x + tileWhite.spacingX;\n pop();\n }\n y = y + tileWhite.spacingY;\n }\n}", "uncoverEmptyTiles(theRow, theCol, theBoard) {\n\n /* gets all surrounding tiles to tile at [xpos][ypos] */\n\n let surround = this.checkSurroundingArea(theRow, theCol, theBoard);\n\n surround.map(tile => {\n\n /* Check if this tile isn't revealed, flagged or a mine and is empty */\n if (!tile.mine && !tile.revealed && !tile.flag) {\n\n theBoard[tile.row][tile.col].revealed = true;\n\n /* since this tile is empty, check recursively all around this tile too */\n if (tile.mineCount === 0) {\n\n this.uncoverEmptyTiles(tile.row, tile.col, theBoard);\n\n }\n }\n\n });\n\n return theBoard;\n }", "function drawTileGrid(gameContainer, normalTexture, floodedTexture) {\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tfor (var j = 0; j < 6; j++) {\r\n\t\t\tvar tile = new Tile(normalTexture, floodedTexture, i, j, 'tile_' + i + '_' + j);\r\n\t\t\t// Skip tile positions on first row that need to be blank\r\n\t\t\tif ((i == 0 && j == 0) || (i == 0 && j == 1) || (i == 0 && j == 4) || (i == 0 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on second row that need to be blank\r\n\t\t\tif ((i == 1 && j == 0) || (i == 1 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on fifth row that need to be blank\r\n\t\t\tif ((i == 4 && j == 0) || (i == 4 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on sixth row that need to be blank\r\n\t\t\tif ((i == 5 && j == 0) || (i == 5 && j == 1) || (i == 5 && j == 4) || (i == 5 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Push tile object onto gameboard 2D Array\r\n\t\t\tgameBoard[i][j] = tile;\r\n\t\t\tgameContainer.addChild(tile);\r\n\t\t}\r\n\t}\r\n}", "static setEmpty(tile) {\n if (tile.classList.contains('ruby')){tile.classList.remove('ruby');}\n if (tile.classList.contains('hole')){tile.classList.remove('hole');}\n if (tile.classList.contains('ruby_hole')){tile.classList.remove('ruby_hole');}\n if (!tile.classList.contains('empty')){tile.classList.add('empty');}\n }", "function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}", "createFullGround() {\n\t\tfor (let i=0; i<this.game.width; i=i+this.tileSize) {\n\t\t\tthis.addTile(i);\n\t\t}\n\t}", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function resetBoard() {\n board = [];\n $(__BOARD__).children().remove();\n let nbTilesBuilt = 0;\n let arrayTmp = [];\n board.push(arrayTmp);\n let index1D = 0;\n let index2D = -1;\n while(nbTilesBuilt < nbTiles) {\n if(index2D !== 0 && index2D % (nbColumns - 1) === 0) {\n arrayTmp = [];\n board.push(arrayTmp);\n index1D++;\n index2D = 0;\n } else {\n index2D++;\n }\n arrayTmp.push(__BLACK_TILE_CLASS__);\n $(__BOARD__).append(\"<div data-index-1d='\" + index1D + \"' data-index-2d='\" + index2D + \"' class='\" + __BLACK_TILE_CLASS__ +\n \"' style='width:\"+ sizeTile +\"px; height:\"+ sizeTile +\"px;'></div>\");\n nbTilesBuilt++;\n }\n}", "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "clear()\r\n {\r\n // shifting the line to a point outside of the page so that it does not show anymore\r\n this.position.x = -5000;\r\n this.position.y = -5000;\r\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function gapFiller() {\n var arr = [];\n tileObj.forEach( function(x) {\n arr.push(x.boardPos);\n });\n for (i=0; i < 7; i++) {\n if($.inArray(i, arr) == -1) {\n tileGenerator(i);\n }\n }\n $('.ui-draggable').draggable({\n revert: \"invalid\"\n });\n}", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "_empty_grid() {\n\t\t\tfor (var x = 0; x < this._internal_grid_size[0]; x++) {\n\t\t\t\tfor (var y = 0; y < this._internal_grid_size[1]; y++) {\n\t\t\t\t\tthis._set_grid_value(x, y, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "getEmptyTile() {\n const index = this.tiles.indexOf(0);\n const pos = this.getTilePosition(index);\n return {x: pos.x, y: pos.y, index: index};\n }", "function clearBoard() {\n bottomHalfblocks.map(function(i) {\n i.classList.replace('green', 'blue');\n i.classList.add('marker')\n });\n }", "function deleteInitials1Inch(){\n ctx7.clearRect(0, 0, 115, 100);\n}", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function plotTankCleanly(col, row) {\r\n if (grid[col][row] === 0) {\r\n createEnemy(col * CELL, row * CELL);\r\n } else {\r\n console.log(`X: ${col}, Y: ${row} square occupied`);\r\n if (row < 10)\r\n plotTankCleanly(col, row + 1);\r\n else\r\n plotTankCleanly(col, row - 1);\r\n } \r\n}", "unhighlightTile () { \n this.tile.clearTint()\n }", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "function clearHoldPiece() {\n for(var i = 0; i < 3; i++)\n for(var j = 0; j < 7; j++)\n drawPixelHold( j, i, boardColour);\n}", "function nullifyClickedTiles(){\n\tCLICKED_TILE_1 = null;\n\tCLICKED_TILE_2 = null;\n}", "function drawTile3() {\n ctx.clearRect(235, 125, 65, 70);\n ctx.fillStyle = palette[2][3];\n ctx.fillRect(235, 125, 65, 70)\n }", "function displayBoard(board) {\n for (let i = 0; i < 4; i++) {\n const xVal = (i + 1) * 50;\n for (let j = 0; j < 4; j++) {\n const yVal = j * 50 + 50;\n if (board[4 * j + i] === \"blank\") {\n gameState.tiles.create(xVal, yVal, board[4 * j + i]).setScale(0.6);\n } else {\n gameState.tiles.create(xVal, yVal, board[4 * j + i]);\n }\n }\n }\n}", "clearTileCache() {\n this.i.mu();\n }", "clear() {\n this._board = Array(this.height).fill(this.EMPTY.repeat(this.width));\n }", "printBoard() {\n // This will print the board\n let grid = [...this.grid];\n \n // Loop through the values in the grid and set the tiles appropriately\n // Pass in the values to set its color in setTile()\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid.length; j++) { \n if(grid[i][j] === 0){\n // If grid tile === 0\n if((i===0 && (j===1 || j===2)) ){\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],'UP')\n } else if ((i === 3 && (j === 1 || j === 2))){\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],\"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"RIGHT\");\n }else{\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j]);\n }\n \n }else{\n // If doesnt equal 0 then place value in rect\n\n if ((i === 0 && (j === 1 || j === 2))) {\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], 'UP')\n } else if ((i === 3 && (j === 1 || j === 2))) {\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"RIGHT\");\n } else {\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j]);\n }\n } \n }\n }\n if(!this.printedBoard){\n // Displays the elements only needed to be set once (SCORE BANNER)\n this.scoresControlsContainer.append('div').attr('id', 'score-banner');\n d3.select('#score-banner').append('h3').text('SCORE');\n d3.select('#score-banner').append('p').attr('id','score-value'); // Shows score, changed in printBoard()\n this.printedBoard = true; // Prevent this if block from being printed again (unless new game)\n }\n // Change the score display to the current score\n d3.select('#score-value').text(this.score+\"\")\n\n\n\n }", "function tileClicked(e){\n // check if the tile can move to the empty spot\n // if the tile can move, move the tile to the empty spot\n\n\tvar curr_tile = e.target; // setting the curr_tile to the tile that has been clicked\n\t\n\tvar curr_row = curr_tile.row; // setting the curr_row to the row of the tile clicked\n\tvar curr_col = curr_tile.col; //setting the curr_col to the column of the tile clicked\n\t\n\t/*\n\t* check the tile in the row before the tile clicked , if the tile from the row before it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\tif( ! (curr_row - 1 < 0 )) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row-1][curr_col] == 0) //check if the item before the tile clicked is the empty tile\n\t\t{\n\t\t\tvar temp1 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\tcurr_tile.row = curr_row - 1; // setting the tile new row\n\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp1; //saving the div in the new position\n\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t/*\n\t* check the tile in the row after the tile clicked , if the tile from the row after it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\t\n\tif(!(curr_row + 1 > _num_rows - 1)) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row + 1][curr_col] == 0) //check if the item after the tile clicked is the empty tile\n\t\t{\n\t\t\t\tvar temp2 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\t\tcurr_tile.row = curr_row + 1; // setting the tile new row\n\t\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp2; //saving the div in the new position\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t}\n\t\n\t}\n\t\n\t\t/*\n\t\t* check the tile in the column before the tile clicked , if the tile from the row before it is the empty one \n\t\t* , we move the tile to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t\t*/\n\n\t\tif(!(curr_col - 1 < 0))\n\t\t{\n\t\t\tif(tile_array[curr_row][curr_col-1] == 0)\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[curr_row][curr_col];\n\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\tcurr_tile.col = curr_col - 1;\n\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp3;\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\t\tif(!(curr_col + 1 > _num_cols))\n\t\t\t{\n\t\t\t\tif(tile_array[curr_row][curr_col+1] == 0)\n\t\t\t\t{\n\t\t\t\t\tvar temp4 = tile_array[curr_row][curr_col];\n\t\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\t\tcurr_tile.col = curr_col+1;\n\t\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp4;\n\t\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function randomiseTiles(){\n\t\trandomiseArray(tiles);\n\t\tvar i;\n\t\tfor(i = 0; i < tiles.length; i++){\n\t\t\ttiles[i].x = -border + Math.random() * (maskRect.width - scale);\n\t\t\ttiles[i].y = ROWS * scale + Math.random() * (trayDepth - scale);\n\t\t\tdiv.appendChild(tiles[i].div);\n\t\t\ttiles[i].update();\n\t\t}\n\t}", "static isEmpty(tile) {tile.classList.contains('empty') ? true : false;}", "function canPutTileHere(spriteid, r, c, full) {\r\n\r\n // note that tile7 is also a valid tile to form a combination, since its the rainbow tile. thats why it pops up in adjacent checks like here below\r\n\r\n adjacentCount = 0;\r\n\r\n //check left\r\n if((c > 0) && (levelArray[r][c - 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x - 1\r\n if((c > 1) && ((levelArray[r][c - 2]._animation.name == spriteid) || levelArray[r][c - 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 2\r\n if((c > 0) && (r > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 1, y - 1\r\n }\r\n\r\n //check up\r\n if((r > 0) && (levelArray[r - 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y - 1\r\n if((r > 1) && (levelArray[r-2][c]._animation.name == spriteid)) {adjacentCount ++} // y - 2\r\n if((r > 0) && (c > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1, x - 1\r\n if((r > 0) && (c < 7) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1 , x + 1\r\n }\r\n\r\n if(full){\r\n //check right\r\n if((c < 6) && (levelArray[r][c + 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x + 1\r\n if((c < 6) && ((levelArray[r][c + 2]._animation.name == spriteid) || levelArray[r][c + 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 2\r\n if((c < 7) && (r > 0) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 1, y - 1\r\n }\r\n\r\n //check down\r\n if((r < 7) && (levelArray[r + 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y + 1\r\n if((r < 6) && (levelArray[r+2][c]._animation.name == spriteid)) {adjacentCount ++} // y + 2\r\n if((r < 7) && (c > 0) && ((levelArray[r + 1][c - 1]._animation.name == spriteid) || levelArray[r + 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1, x - 1\r\n if((r < 7) && (c < 7) && ((levelArray[r + 1][c + 1]._animation.name == spriteid) || levelArray[r + 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1 , x + 1\r\n }\r\n\r\n if(((r < 7) && (r > 0) && (levelArray[r + 1][c]._animation.name == levelArray[r - 1][c]._animation.name))){adjacentCount ++;} // left & right\r\n if(((c < 7) && (c > 0) && (levelArray[r][c + 1]._animation.name == levelArray[r][c - 1]._animation.name))){adjacentCount ++;} // up & down\r\n\r\n }\r\n\r\n if(adjacentCount >= 2){return false} else {return true}\r\n\r\n}", "function FixNonVisible(context) {\n\t// 64x32 and 64x64 skin parts\n\tcontext.clearRect(0, 0, 8, 8);\n\tcontext.clearRect(24, 0, 16, 8);\n\tcontext.clearRect(56, 0, 8, 8);\n\tcontext.clearRect(0, 16, 4, 4);\n\tcontext.clearRect(12, 16, 8, 4);\n\tcontext.clearRect(36, 16, 8, 4);\n\tcontext.clearRect(52, 16, 4, 4);\n\tcontext.clearRect(56, 16, 8, 32);\n\t\n\t// 64x64 skin parts\n\tcontext.clearRect(0, 32, 4, 4);\n\tcontext.clearRect(12, 32, 8, 4);\n\tcontext.clearRect(36, 32, 8, 4);\n\tcontext.clearRect(52, 32, 4, 4);\n\tcontext.clearRect(0, 48, 4, 4);\n\tcontext.clearRect(12, 48, 8, 4);\n\tcontext.clearRect(28, 48, 8, 4);\n\tcontext.clearRect(44, 48, 8, 4);\n\tcontext.clearRect(60, 48, 8, 4);\n}", "function isBoardFull() {\n for (let i = 0; i < height; i++)\n for (let j = 0; j < width; j++)\n if (gameBoard[i * height + j] === '⬜')\n return false;\n return true;\n }", "function remove_cell_from_validation_grid(x, y) {\r\n\t\tgridPlaced[x][y] = '0';\r\n\t}", "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function clearBoardRect() {\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n m.clear();\n for(j = 0; j < filledBoardRect.length; j++){\n mod = (filledBoardRect[j] % 15);\n qut = Math.floor(filledBoardRect[j] / 15);\n\n if (mod === 0) {\n x = 14 * rectLength + 5;\n y = (qut - 1) * rectBreadth + 210;\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n }\n }\n else {\n x = (mod - 1) * rectLength + 5;\n y = qut * rectBreadth + 210\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xLS'){\n ls3(x, y)\n }\n else if (rectType === '2xWS'){\n ws2(x, y)\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n else if (rectType === 'star'){\n getStar(x, y)\n }\n }\n }\n }\n filledBoardRect.length = 0;\n word.length = 0;\n selectLetter = null;\n wordss.length = 0;\n rackPreviousState();\n}", "clean() {\n const height = this.ctx.canvas.height;\n const width = this.ctx.canvas.width;\n // Origin is at the center, so start painting from bottom left.\n this.ctx.clearRect(width * -1 / 2, height * -1 / 2, width, height);\n }", "addTile() {\n if(this.full()) {\n return false;\n }\n while(true) {\n let r = randIdx(this.board.length);\n let c = randIdx(this.board[r].length);\n if(this.board[r][c] == 0) {\n this.board[r][c] = randInt(1,2) * 2;\n return true;\n }\n }\n }", "reset() {\n this.tiles = this.shuffle(this.getBase());\n this.deadSize = 16;\n this.dead = false;\n this.remaining = this.tiles.length - this.dead;\n\n // if there's a wall hack active, throw away what\n // we just did and use the hacked wall instead.\n if (config.WALL_HACK) {\n WallHack.set(this, WallHack.hacks[config.WALL_HACK]);\n }\n }", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\t// checks to see if the tile is next to the empty square tile\n\tif(Math.abs(otherLeft - left) == TILE_AREA && Math.abs(otherTop - top) == 0) {\n\t\treturn true;\n\t} else if(Math.abs(otherLeft - left) == 0 && Math.abs(otherTop - top) == TILE_AREA) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function keepInBounds(el){\n if(el.x + el.w >= canvas.width){\n el.x = canvas.width - el.w;\n }\n else if(el.x <= 0){\n el.x = 0;\n }\n if(el.y >= canvas.height - el.h){\n el.y = canvas.height - el.h;\n }\n else if(el.y <= 0){\n el.y = 0;\n }\n }", "function initTiles(){\n\t\tgetOffset(div);\n\t\tvar r, c;\n\t\tfor(r = 0; r < ROWS; r++){\n\t\t\ttiles[r] = [];\n\t\t\tfor(c = 0; c < COLS; c++){\n\t\t\t\ttiles[r][c] = new Tile(r, c, SPRITE_SHEET);\n\t\t\t\ttiles[r][c].update();\n\t\t\t\tdiv.appendChild(tiles[r][c].div);\n\t\t\t}\n\t\t}\n\t\t// make the top left corner empty\n\t\tdiv.removeChild(tiles[0][0].div);\n\t\ttiles[0][0] = undefined;\n\t\trandomiseTiles();\n\t}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function clearPieceBoard() {\n for(var i = 0; i < 3; i++)\n for(var j = 0; j < 7; j++)\n drawPixelNext( j, i, boardColour);\n}", "function isBoardFull(){\n let board = $box.map((index, currBox) => {\n let $currBox = $(currBox);\n return isEmpty($currBox);\n });\n return !board.get().includes(true);\n }", "function clear(){\n\tthis.top = 0;\n}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "clearBoard () {\n $('.mushroom-container').empty();\n }", "function layoutInvalidated() {\n\t\tglobalVars.containerwidth = $container.width();\n\t\tglobalVars.boxWidth = globalVars.containerwidth / globalVars.cols;\n\t\tvar imageResizeRatio = globalVars.containerwidth / globalVars.originalWidth;\n\t\tvar modifiedHeight = globalVars.originalHeight * imageResizeRatio;\n\t\tglobalVars.boxHeight = modifiedHeight / globalVars.rows;\n\t\t$container.height( modifiedHeight );\n\t\t\t\t\t\n\t\t//Assign the BG image to all boxes here. will position and scale it below\n\t\t$('.box').css('background-image', 'url(' + globalVars.image + ')');\n\t\t$('.box').css('background-size', globalVars.containerwidth+'px');\n\t\t\n\t\t$(\".box\").each(function(index, element) {\n\t\t\n\t\t\t//for each box, update its variables then move/scale it appropriately\n\t\t\tvar tile = this.tile;\n\t\t\t$.extend(tile, {\n\t\t\t\t x : getXPositionFromIndex(tile.order),\n\t\t\t\t y : getYPositionFromIndex(tile.order),\n\t\t\t\t width : globalVars.boxWidth,\n\t\t\t\t height : globalVars.boxHeight\n\t\t\t\t});\t\n\t\t\t\t\n\t\t\t//Assign and scale the BG image\n\t\t\t$(element).css('background-position', -getXPositionFromIndex(tile.index)+\"px \"+-getYPositionFromIndex(tile.index)+\"px\");\n\t\t\t\n\t\t\tTweenLite.to(element, .3, {\n\t\t\t\tx : Math.floor(tile.x),\n\t\t\t\ty : Math.floor(tile.y),\n\t\t\t\twidth : tile.width,\n\t\t\t\theight : tile.height,\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() { tile.positioned = true; },\n\t\t\t\tonStart : function() { tile.positioned = false; }\n\t\t\t });\n\t\t});\n\n\t}", "function FrameBorderCleaner() {\n push();\n translate(innerWidth/2, innerHeight/2);\n noFill();\n stroke(30);\n strokeWeight(200);\n rect(-405, -405, 810, 810);\n pop();\n}", "function clear() {\n ctx.clearRect(-2000, -2000, 5000, 5000);\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function put_one_element(pcanvas, layer, ptile, pedge, pcorner, punit, \n pcity, canvas_x, canvas_y, citymode)\n{\n\n var tile_sprs = fill_sprite_array(layer, ptile, pedge, pcorner, punit, pcity, citymode);\n\t\t\t\t \n var fog = (ptile != null && draw_fog_of_war\n\t && TILE_KNOWN_UNSEEN == tile_get_known(ptile));\t\t\t\t \n\n put_drawn_sprites(pcanvas, canvas_x, canvas_y, tile_sprs, fog);\n \n \n}", "function clearKeySpace() {\n g.setColor(g.theme.bg)\n .fillRect(offsetX, offsetY, 176, 176);\n }", "tryWall(x, y) {\n if (x >= 0 && x < this.tiles[0].length && y >= 0 && y < this.tiles.length &&\n this.tiles[y][x] === 'E') {\n this.tiles[y][x] = 'W';\n }\n }", "function drawTile1() {\n ctx.clearRect(95, 125, 65, 70);\n ctx.fillStyle = palette[2][1];\n ctx.fillRect(95, 125, 65, 70)\n }", "generateBlankMaze(tilesWide, tilesHigh) {\n return new Array(tilesWide * tilesHigh).fill(WALL_CHAR);\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function emptyBoardRect(x, y) {\n ctx.beginPath();\n ctx.clearRect(x, y, rectLength, rectLength);\n ctx.rect(x, y, rectLength, rectBreadth);\n ctx.strokeStyle = \"#000000\";\n ctx.stroke();\n ctx.closePath();\n}", "function doTileErase($element){\n\t\t$element.type = defaultTile.type;\n\t\t$element.background = defaultTile.background;\n\t\t$element.style.backgroundColor = defaultTile.background;\n\t\t$element.style.backgroundImage = '';\n\t\t$element.setAttribute(\"class\", defaultTile.classes);\n\t}", "drawBoard() {\n for (let y = 0; y < this.tetris.board.height; y++) {\n for (let x = 0; x < this.tetris.board.width; x++) {\n let id = this.tetris.board.getCell(x, y);\n if (id !== this.tetris.board.EMPTY) {\n this.drawBlock(this.ctxGame, id, x * this.size, y * this.size);\n }\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function resetCan() {\n clear();\n curr = make2DArr(width, height);\n prev = make2DArr(width, height);\n background(0);\n}", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function valid_placement(x, y, piece, cell_num)\n{\n if(!cell_num)\n {\n cell_num = 1;\n }\n var hor_step = 0;\n var vert_step = 0;\n if(piece.orientation === \"vert\")\n {\n vert_step = 1;\n }\n else\n {\n hor_step = 1;\n }\n if(on_board(x, y) && PS.data(x, y) === 0)\n { //if empty coord on board\n if(cell_num < piece.hits.length)\n {\n return valid_placement(x + hor_step, y + vert_step, piece, cell_num + 1); //check the next bead in line\n }\n else return true; //last bead checked, all clear\n }\n else\n {\n PS.statusText(\"Fails at \" + x + \",\" + y);\n return false;//not a free space\n }\n}", "function isUpClear (ghostCurrentPosition) {\n if (!cells[ghostCurrentPosition - width].classList.contains(borderClass) && (!cells[ghostCurrentPosition - width].classList.contains(tarantulaClass) || !cells[ghostCurrentPosition].classList.contains(scorpianClass) || !cells[ghostCurrentPosition].classList.contains(waspClass))) {\n // console.log('up clear')\n return true\n }\n }", "function player_1_borders(){\n var aa = \"\";\n var bb = \"\";\n var new_selected_tile = \"\";\n\n // THIS IS IN CASE THE CITY IS BUILT ALONG THE LEFT-MOST OF THE MAP (TILE X === 0)\n if (selected_tile_x === 0){\n for (var i = 0; i < 2; i++){\n aa = selected_tile_x + i;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }\n\n aa = map_width - 1;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }else{ // THIS IS FOR EVERY OTHER INSTANCE (WHERE THE CITY IS ANYWHERE BUT TILE X === 0)\n for (var i = -1; i < 2; i++){\n aa = selected_tile_x + i;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }\n }\n\n // generate css borders in a one-square radius from the city\n // for (var i = -1; i < 2; i++){\n // aa = selected_tile_x + i;\n //\n // for (var j = -1; j < 2; j++){\n // bb = selected_tile_y + j;\n // new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n //\n // document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n // }\n // }\n}", "destroyTile(i, j) {\n // This method will make the buffer dirty since it needs to load pixels\n if (!this.dirty) {\n this.dirty = true;\n this.buffer.loadPixels();\n }\n\n this.groundMap[this.lin_ij(i, j)] = false;\n\n // Manually set the alpha channel of pixels to transparent. This seems a bit overkill, but\n // replace blending a transparent image over the top doesn't seem to work.\n for (let y = i * this.tileSizeDrawn; y < (i + 1) * this.tileSizeDrawn; y++) {\n for (let x = j * this.tileSizeDrawn; x < (j + 1) * this.tileSizeDrawn; x++) {\n this.buffer.pixels[this.byteAddress_xyc(x, y, 'a')] = 0;\n }\n }\n\n // These methods should work, but there may be something wrong with p5's current implementation\n\n /*\n this.buffer.blendMode(REPLACE);\n this.buffer.image(this.tileNone,\n this.tileSizeDrawn * j,\n this.tileSizeDrawn * i);\n */\n\n /*\n this.buffer.blend(this.tileNone,\n 0,\n 0,\n this.tileSizeDrawn,\n this.tileSizeDrawn,\n this.tileSizeDrawn * j,\n this.tileSizeDrawn * i,\n this.tileSizeDrawn,\n this.tileSizeDrawn,\n REPLACE);\n */\n }", "function drawTile2() {\n ctx.clearRect(165, 125, 65, 70);\n ctx.fillStyle = palette[2][2];\n ctx.fillRect(165, 125, 65, 70)\n }", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "function clearBoard() {\n for (i=0; i<=maxX; i++) {\n for (j=0; j<=maxY; j++) {\n with (cellArray[arrayIndexOf(i,j)]) {\n isExposed = false;\n isBomb = false;\n isFlagged = false;\n isMarked = false;\n isQuestion = false;\n neighborBombs = 0; } } } }", "generateBoard() {\n for (let i = 0; i < this.rows; i++) {\n let row = [];\n for (let i = 0; i < this.cols; i++) row.push(new Tile(0, false));\n this.tiles.push(row);\n }\n this.setMines();\n }", "function clearPiece() {\n for (var i=0; i<prevPieceArray.length; i++){\n for (j=0; j<prevPieceArray.length; j++) {\n if (prevPieceArray[i][j] != 0)\n gameBoard[prevYPosition+i][prevXPosition+j] = 0;\n\n }\n }\n ctx.clearRect(150, 20, 400, 500);\n drawGameArea();\n}", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "function contentDelete(column,tile){\n if (grid[column][tile].content){\n }\n grid[column][tile].content = null;\n grid[column][tile].type = \"empty\";\n grid[column][tile].isWalkable = true;\n}", "_clearTrajectories() {\n this.elem.selectAll('.intention').remove();\n\n for (let i = 0; i < this.gridSize; i++) {\n for (let j = 0; j < this.gridSize; j++) {\n if (!this._isCornerCell(i, j)) {\n this.grid[i][j].hexagon.attr('fill', 'none');\n }\n }\n }\n }", "function reset() {\n for (c = 0; c < tileColumnCount; c++) {\n tiles[c] = [];\n for (r = 0; r < tileRowCount; r++) {\n tiles[c][r] = { x: c * (tileW + 3), y: r * (tileH + 3), state: 'e' }; //state is e for empty\n }\n }\n tiles[0][0].state = 's';\n tiles[tileColumnCount - 1][tileRowCount - 1].state = 'f';\n\n output.innerHTML = 'Green is start. Red is finish.';\n}" ]
[ "0.6844949", "0.67106986", "0.67106986", "0.66439617", "0.65255076", "0.65245396", "0.64574426", "0.63810587", "0.63665944", "0.63475156", "0.6323941", "0.627285", "0.62297314", "0.62206644", "0.6212618", "0.6185795", "0.6182601", "0.6160372", "0.6149189", "0.6120846", "0.6117985", "0.6111944", "0.60975856", "0.6087897", "0.6058135", "0.6056475", "0.60431105", "0.60429394", "0.60309625", "0.6027895", "0.6026837", "0.60260373", "0.60226786", "0.60124934", "0.59745544", "0.59596956", "0.59416056", "0.5938393", "0.5917406", "0.5899404", "0.58855194", "0.5883879", "0.5881446", "0.58802104", "0.5876395", "0.58761835", "0.58717537", "0.5865643", "0.5862147", "0.5856919", "0.5855886", "0.58545405", "0.5853481", "0.5849669", "0.5849236", "0.58470297", "0.58443874", "0.58439165", "0.5839964", "0.5839676", "0.5838237", "0.58287954", "0.5819811", "0.58176476", "0.5816445", "0.5812188", "0.5811493", "0.5808124", "0.5803947", "0.5796205", "0.57954955", "0.5795311", "0.57948256", "0.5791182", "0.57899374", "0.57831717", "0.5777944", "0.57739604", "0.5769502", "0.57678884", "0.5762539", "0.57613164", "0.57568705", "0.5745814", "0.57455236", "0.5741029", "0.5738469", "0.57383233", "0.5733756", "0.5733649", "0.57326066", "0.5730461", "0.57281524", "0.5721973", "0.57159746", "0.57135975", "0.57060397", "0.57022893", "0.5701125", "0.56972176", "0.56941074" ]
0.0
-1
Make sure the tile space above is clear
function checkAbove(row, column) { if (!isEdge(row - 1, column) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row - 1][column]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "adjustTile(sprite) {\n // set origin at the top left corner\n sprite.setOrigin(0);\n\n // set display width and height to \"tileSize\" pixels\n sprite.displayWidth = this.tileSize;\n sprite.displayHeight = this.tileSize;\n }", "hasSafeTiles(){\n return this._numberOfTiles !== this._numberOfBombs;\n }", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "trimLoadedTiles() {\n this._cache.trim();\n }", "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "function checkSpace()\n\t\t{\n\n\t\t\tvar nb =random(3) ;\n\t\t\tvar nb2 = random(3);\n\t\t\tvar tileNew = $('body').find('[data-x='+nb+'][data-y='+nb2+']');\n\t\t\tif(tileNew.length === 0)\n\t\t\t{\n\t\t\t\treturn {x:nb , y: nb2};\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcheckSpace();\n\t\t\t}\n\t\t}", "function ClearPixels(){\n for(const p of prev_pixels){\n p.attr('type','tile');\n }\n prev_pixels = [];\n}", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function drawTile0() {\n ctx.clearRect(25, 125, 65, 70);\n ctx.fillStyle = palette[2][0];\n ctx.fillRect(25, 125, 65, 70)\n }", "clear()\r\n {\r\n // shifting the line to a point outside of the page so that it does not show anymore\r\n this.position.x = -5000;\r\n this.position.y = -5000;\r\n }", "function checkDestroy() {\n for (let i = 0; i < height; i++) {\n let cnt = 0;\n for (let j = 0; j < width; j++) {\n if (gameBoardData[i][j]) cnt++;\n }\n if (cnt != 10) continue\n for (let j = 0; j < 10; j++) {\n gameBoard.removeChild(allShapePos[i][j]);\n allShapePos[i][j] = null;\n gameBoardData[i][j] = 0;\n }\n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y - 1][x] != null) {\n allShapePos[y][x] = allShapePos[y - 1][x];\n allShapePos[y - 1][x] = null;\n allShapePos[y][x].y += cellSize;\n }\n }\n }\n \n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y][x] != null) {\n gameBoardData[y][x] = 1;\n } else {\n gameBoardData[y][x] = 0;\n }\n }\n }\n }\n}", "function clearEndangeredTiles(isSafeTile)\n{\n // Loop through all the endangered tiles and set them to SAFE_ZONE\n for (var i = 0; i < endangeredTiles.length; i++)\n {\n // stored as ['1,1', '2,2', 3,5']\n var x = parseInt(endangeredTiles[i].split(\",\")[0]);\n var y = parseInt(endangeredTiles[i].split(\",\")[1]);\n\n updateMapTile(x, y, isSafeTile);\n }\n\n // Reset the endangered tiles array\n endangeredTiles = [];\n}", "uncoverEmptyTiles(theRow, theCol, theBoard) {\n\n /* gets all surrounding tiles to tile at [xpos][ypos] */\n\n let surround = this.checkSurroundingArea(theRow, theCol, theBoard);\n\n surround.map(tile => {\n\n /* Check if this tile isn't revealed, flagged or a mine and is empty */\n if (!tile.mine && !tile.revealed && !tile.flag) {\n\n theBoard[tile.row][tile.col].revealed = true;\n\n /* since this tile is empty, check recursively all around this tile too */\n if (tile.mineCount === 0) {\n\n this.uncoverEmptyTiles(tile.row, tile.col, theBoard);\n\n }\n }\n\n });\n\n return theBoard;\n }", "function tilingWhite() {\n let x = 60;\n let y = 0; // before y = 60\n\n for (let i = 0; i < tileWhite.segmentsY; i++) {\n if (i % 2 === 0) {\n x = 60; // before x = 90;\n }\n else {\n x = 0; //before x = 150;\n }\n // Draws horizontal tiles\n for (let j = 0; j < tileWhite.segmentsX; j++) {\n push();\n noStroke();\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b);\n rect(x,y, tileWhite.size);\n x = x + tileWhite.spacingX;\n pop();\n }\n y = y + tileWhite.spacingY;\n }\n}", "unhighlightTile () { \n this.tile.clearTint()\n }", "getEmptyTile() {\n const index = this.tiles.indexOf(0);\n const pos = this.getTilePosition(index);\n return {x: pos.x, y: pos.y, index: index};\n }", "function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}", "static setEmpty(tile) {\n if (tile.classList.contains('ruby')){tile.classList.remove('ruby');}\n if (tile.classList.contains('hole')){tile.classList.remove('hole');}\n if (tile.classList.contains('ruby_hole')){tile.classList.remove('ruby_hole');}\n if (!tile.classList.contains('empty')){tile.classList.add('empty');}\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "clearTileCache() {\n this.i.mu();\n }", "createFullGround() {\n\t\tfor (let i=0; i<this.game.width; i=i+this.tileSize) {\n\t\t\tthis.addTile(i);\n\t\t}\n\t}", "function clear(){\n\tthis.top = 0;\n}", "function clear() {\r\n\r\n\t\tturn = \"\";\r\n\t\tgrid = [[0, 0, 0], [0, 0, 0], [0, 0, 0]];\r\n\t\tmsg(\"\");\r\n\t\t// We use map to generate a new empty array\r\n\t\t$(\".tile\").map(function () {\r\n\t\t\t$(this).text(\"\");\r\n\r\n\t\t});\r\n\r\n\t\twinner = 0;\r\n\t\tcount = 0;\r\n\t}", "function drawTileGrid(gameContainer, normalTexture, floodedTexture) {\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tfor (var j = 0; j < 6; j++) {\r\n\t\t\tvar tile = new Tile(normalTexture, floodedTexture, i, j, 'tile_' + i + '_' + j);\r\n\t\t\t// Skip tile positions on first row that need to be blank\r\n\t\t\tif ((i == 0 && j == 0) || (i == 0 && j == 1) || (i == 0 && j == 4) || (i == 0 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on second row that need to be blank\r\n\t\t\tif ((i == 1 && j == 0) || (i == 1 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on fifth row that need to be blank\r\n\t\t\tif ((i == 4 && j == 0) || (i == 4 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on sixth row that need to be blank\r\n\t\t\tif ((i == 5 && j == 0) || (i == 5 && j == 1) || (i == 5 && j == 4) || (i == 5 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Push tile object onto gameboard 2D Array\r\n\t\t\tgameBoard[i][j] = tile;\r\n\t\t\tgameContainer.addChild(tile);\r\n\t\t}\r\n\t}\r\n}", "function nullifyClickedTiles(){\n\tCLICKED_TILE_1 = null;\n\tCLICKED_TILE_2 = null;\n}", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function resetBoard() {\n board = [];\n $(__BOARD__).children().remove();\n let nbTilesBuilt = 0;\n let arrayTmp = [];\n board.push(arrayTmp);\n let index1D = 0;\n let index2D = -1;\n while(nbTilesBuilt < nbTiles) {\n if(index2D !== 0 && index2D % (nbColumns - 1) === 0) {\n arrayTmp = [];\n board.push(arrayTmp);\n index1D++;\n index2D = 0;\n } else {\n index2D++;\n }\n arrayTmp.push(__BLACK_TILE_CLASS__);\n $(__BOARD__).append(\"<div data-index-1d='\" + index1D + \"' data-index-2d='\" + index2D + \"' class='\" + __BLACK_TILE_CLASS__ +\n \"' style='width:\"+ sizeTile +\"px; height:\"+ sizeTile +\"px;'></div>\");\n nbTilesBuilt++;\n }\n}", "function gapFiller() {\n var arr = [];\n tileObj.forEach( function(x) {\n arr.push(x.boardPos);\n });\n for (i=0; i < 7; i++) {\n if($.inArray(i, arr) == -1) {\n tileGenerator(i);\n }\n }\n $('.ui-draggable').draggable({\n revert: \"invalid\"\n });\n}", "_empty_grid() {\n\t\t\tfor (var x = 0; x < this._internal_grid_size[0]; x++) {\n\t\t\t\tfor (var y = 0; y < this._internal_grid_size[1]; y++) {\n\t\t\t\t\tthis._set_grid_value(x, y, 0);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function FixNonVisible(context) {\n\t// 64x32 and 64x64 skin parts\n\tcontext.clearRect(0, 0, 8, 8);\n\tcontext.clearRect(24, 0, 16, 8);\n\tcontext.clearRect(56, 0, 8, 8);\n\tcontext.clearRect(0, 16, 4, 4);\n\tcontext.clearRect(12, 16, 8, 4);\n\tcontext.clearRect(36, 16, 8, 4);\n\tcontext.clearRect(52, 16, 4, 4);\n\tcontext.clearRect(56, 16, 8, 32);\n\t\n\t// 64x64 skin parts\n\tcontext.clearRect(0, 32, 4, 4);\n\tcontext.clearRect(12, 32, 8, 4);\n\tcontext.clearRect(36, 32, 8, 4);\n\tcontext.clearRect(52, 32, 4, 4);\n\tcontext.clearRect(0, 48, 4, 4);\n\tcontext.clearRect(12, 48, 8, 4);\n\tcontext.clearRect(28, 48, 8, 4);\n\tcontext.clearRect(44, 48, 8, 4);\n\tcontext.clearRect(60, 48, 8, 4);\n}", "reset() {\n this.tiles = this.shuffle(this.getBase());\n this.deadSize = 16;\n this.dead = false;\n this.remaining = this.tiles.length - this.dead;\n\n // if there's a wall hack active, throw away what\n // we just did and use the hacked wall instead.\n if (config.WALL_HACK) {\n WallHack.set(this, WallHack.hacks[config.WALL_HACK]);\n }\n }", "function deleteInitials1Inch(){\n ctx7.clearRect(0, 0, 115, 100);\n}", "validSpaces(update) {\n if(!update) {\n return this.validTiles;\n }\n if(this.color == \"white\") {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i + 1];\n return [i + 1];\n } else {\n this.validTiles = [i + 1, i + 2];\n return [i + 1, i + 2];\n }\n } else {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i - 1];\n return [i - 1];\n } else {\n this.validTiles = [i - 1, i - 2];\n return [i - 1, i - 2];\n }\n }\n }", "function clearSpaces() {\n var canvas = document.getElementById(\"checkerboard\");\n var context2D = canvas.getContext(\"2d\");\n\n for (var boardRow = 0; boardRow < 8; boardRow++) {\n for (var boardCol = 0; boardCol < 8; boardCol++) {\n // coordinates of the top-left corner\n\t var x = boardCol * 50;\n\t var y = boardRow * 50;\n if ((boardRow + boardCol) % 2 == 1) {\n\t context2D.fillStyle = \"SeaGreen\";\n\t context2D.fillRect(x, y, 50, 50);\n\t }\n }\n }\n\n context2D.fillStyle = \"Gray\";\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function initTiles(){\n\t\tgetOffset(div);\n\t\tvar r, c;\n\t\tfor(r = 0; r < ROWS; r++){\n\t\t\ttiles[r] = [];\n\t\t\tfor(c = 0; c < COLS; c++){\n\t\t\t\ttiles[r][c] = new Tile(r, c, SPRITE_SHEET);\n\t\t\t\ttiles[r][c].update();\n\t\t\t\tdiv.appendChild(tiles[r][c].div);\n\t\t\t}\n\t\t}\n\t\t// make the top left corner empty\n\t\tdiv.removeChild(tiles[0][0].div);\n\t\ttiles[0][0] = undefined;\n\t\trandomiseTiles();\n\t}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "clean() {\n const height = this.ctx.canvas.height;\n const width = this.ctx.canvas.width;\n // Origin is at the center, so start painting from bottom left.\n this.ctx.clearRect(width * -1 / 2, height * -1 / 2, width, height);\n }", "function drawTile3() {\n ctx.clearRect(235, 125, 65, 70);\n ctx.fillStyle = palette[2][3];\n ctx.fillRect(235, 125, 65, 70)\n }", "clear () {\n this.top = 0\n }", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "function tileClicked(e){\n // check if the tile can move to the empty spot\n // if the tile can move, move the tile to the empty spot\n\n\tvar curr_tile = e.target; // setting the curr_tile to the tile that has been clicked\n\t\n\tvar curr_row = curr_tile.row; // setting the curr_row to the row of the tile clicked\n\tvar curr_col = curr_tile.col; //setting the curr_col to the column of the tile clicked\n\t\n\t/*\n\t* check the tile in the row before the tile clicked , if the tile from the row before it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\tif( ! (curr_row - 1 < 0 )) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row-1][curr_col] == 0) //check if the item before the tile clicked is the empty tile\n\t\t{\n\t\t\tvar temp1 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\tcurr_tile.row = curr_row - 1; // setting the tile new row\n\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp1; //saving the div in the new position\n\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t/*\n\t* check the tile in the row after the tile clicked , if the tile from the row after it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\t\n\tif(!(curr_row + 1 > _num_rows - 1)) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row + 1][curr_col] == 0) //check if the item after the tile clicked is the empty tile\n\t\t{\n\t\t\t\tvar temp2 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\t\tcurr_tile.row = curr_row + 1; // setting the tile new row\n\t\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp2; //saving the div in the new position\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t}\n\t\n\t}\n\t\n\t\t/*\n\t\t* check the tile in the column before the tile clicked , if the tile from the row before it is the empty one \n\t\t* , we move the tile to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t\t*/\n\n\t\tif(!(curr_col - 1 < 0))\n\t\t{\n\t\t\tif(tile_array[curr_row][curr_col-1] == 0)\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[curr_row][curr_col];\n\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\tcurr_tile.col = curr_col - 1;\n\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp3;\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\t\tif(!(curr_col + 1 > _num_cols))\n\t\t\t{\n\t\t\t\tif(tile_array[curr_row][curr_col+1] == 0)\n\t\t\t\t{\n\t\t\t\t\tvar temp4 = tile_array[curr_row][curr_col];\n\t\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\t\tcurr_tile.col = curr_col+1;\n\t\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp4;\n\t\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\n}", "function keepInBounds(el){\n if(el.x + el.w >= canvas.width){\n el.x = canvas.width - el.w;\n }\n else if(el.x <= 0){\n el.x = 0;\n }\n if(el.y >= canvas.height - el.h){\n el.y = canvas.height - el.h;\n }\n else if(el.y <= 0){\n el.y = 0;\n }\n }", "function clearBoard() {\n bottomHalfblocks.map(function(i) {\n i.classList.replace('green', 'blue');\n i.classList.add('marker')\n });\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function plotTankCleanly(col, row) {\r\n if (grid[col][row] === 0) {\r\n createEnemy(col * CELL, row * CELL);\r\n } else {\r\n console.log(`X: ${col}, Y: ${row} square occupied`);\r\n if (row < 10)\r\n plotTankCleanly(col, row + 1);\r\n else\r\n plotTankCleanly(col, row - 1);\r\n } \r\n}", "function randomiseTiles(){\n\t\trandomiseArray(tiles);\n\t\tvar i;\n\t\tfor(i = 0; i < tiles.length; i++){\n\t\t\ttiles[i].x = -border + Math.random() * (maskRect.width - scale);\n\t\t\ttiles[i].y = ROWS * scale + Math.random() * (trayDepth - scale);\n\t\t\tdiv.appendChild(tiles[i].div);\n\t\t\ttiles[i].update();\n\t\t}\n\t}", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function layoutInvalidated() {\n\t\tglobalVars.containerwidth = $container.width();\n\t\tglobalVars.boxWidth = globalVars.containerwidth / globalVars.cols;\n\t\tvar imageResizeRatio = globalVars.containerwidth / globalVars.originalWidth;\n\t\tvar modifiedHeight = globalVars.originalHeight * imageResizeRatio;\n\t\tglobalVars.boxHeight = modifiedHeight / globalVars.rows;\n\t\t$container.height( modifiedHeight );\n\t\t\t\t\t\n\t\t//Assign the BG image to all boxes here. will position and scale it below\n\t\t$('.box').css('background-image', 'url(' + globalVars.image + ')');\n\t\t$('.box').css('background-size', globalVars.containerwidth+'px');\n\t\t\n\t\t$(\".box\").each(function(index, element) {\n\t\t\n\t\t\t//for each box, update its variables then move/scale it appropriately\n\t\t\tvar tile = this.tile;\n\t\t\t$.extend(tile, {\n\t\t\t\t x : getXPositionFromIndex(tile.order),\n\t\t\t\t y : getYPositionFromIndex(tile.order),\n\t\t\t\t width : globalVars.boxWidth,\n\t\t\t\t height : globalVars.boxHeight\n\t\t\t\t});\t\n\t\t\t\t\n\t\t\t//Assign and scale the BG image\n\t\t\t$(element).css('background-position', -getXPositionFromIndex(tile.index)+\"px \"+-getYPositionFromIndex(tile.index)+\"px\");\n\t\t\t\n\t\t\tTweenLite.to(element, .3, {\n\t\t\t\tx : Math.floor(tile.x),\n\t\t\t\ty : Math.floor(tile.y),\n\t\t\t\twidth : tile.width,\n\t\t\t\theight : tile.height,\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() { tile.positioned = true; },\n\t\t\t\tonStart : function() { tile.positioned = false; }\n\t\t\t });\n\t\t});\n\n\t}", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "function put_one_element(pcanvas, layer, ptile, pedge, pcorner, punit, \n pcity, canvas_x, canvas_y, citymode)\n{\n\n var tile_sprs = fill_sprite_array(layer, ptile, pedge, pcorner, punit, pcity, citymode);\n\t\t\t\t \n var fog = (ptile != null && draw_fog_of_war\n\t && TILE_KNOWN_UNSEEN == tile_get_known(ptile));\t\t\t\t \n\n put_drawn_sprites(pcanvas, canvas_x, canvas_y, tile_sprs, fog);\n \n \n}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "function clearGrid() {\n clearPipes();\n clearObstacles();\n}", "function resetCan() {\n clear();\n curr = make2DArr(width, height);\n prev = make2DArr(width, height);\n background(0);\n}", "function clearHoldPiece() {\n for(var i = 0; i < 3; i++)\n for(var j = 0; j < 7; j++)\n drawPixelHold( j, i, boardColour);\n}", "handleCollTop(obj, tileTop) {\n if (obj.bottom > tileTop && obj.bottomOld <= tileTop) {\n obj.bottom = tileTop - 0.01;\n obj.velY = 0;\n return true;\n }\n return false;\n }", "function doTileErase($element){\n\t\t$element.type = defaultTile.type;\n\t\t$element.background = defaultTile.background;\n\t\t$element.style.backgroundColor = defaultTile.background;\n\t\t$element.style.backgroundImage = '';\n\t\t$element.setAttribute(\"class\", defaultTile.classes);\n\t}", "reset() {\n\t\tthis.tilesForTextureUpdate = Array.from( this.tiles );\n\t\tthis.updateNextTile();\n\t}", "function clear() {\n ctx.clearRect(-2000, -2000, 5000, 5000);\n }", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "destroyTile(i, j) {\n // This method will make the buffer dirty since it needs to load pixels\n if (!this.dirty) {\n this.dirty = true;\n this.buffer.loadPixels();\n }\n\n this.groundMap[this.lin_ij(i, j)] = false;\n\n // Manually set the alpha channel of pixels to transparent. This seems a bit overkill, but\n // replace blending a transparent image over the top doesn't seem to work.\n for (let y = i * this.tileSizeDrawn; y < (i + 1) * this.tileSizeDrawn; y++) {\n for (let x = j * this.tileSizeDrawn; x < (j + 1) * this.tileSizeDrawn; x++) {\n this.buffer.pixels[this.byteAddress_xyc(x, y, 'a')] = 0;\n }\n }\n\n // These methods should work, but there may be something wrong with p5's current implementation\n\n /*\n this.buffer.blendMode(REPLACE);\n this.buffer.image(this.tileNone,\n this.tileSizeDrawn * j,\n this.tileSizeDrawn * i);\n */\n\n /*\n this.buffer.blend(this.tileNone,\n 0,\n 0,\n this.tileSizeDrawn,\n this.tileSizeDrawn,\n this.tileSizeDrawn * j,\n this.tileSizeDrawn * i,\n this.tileSizeDrawn,\n this.tileSizeDrawn,\n REPLACE);\n */\n }", "function drawTile1() {\n ctx.clearRect(95, 125, 65, 70);\n ctx.fillStyle = palette[2][1];\n ctx.fillRect(95, 125, 65, 70)\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "checkWarp () {\n this.x = Phaser.Math.Wrap(this.x, 0, levelData.WIDTH)\n this.y = Phaser.Math.Wrap(this.y, 0, levelData.HEIGHT)\n }", "static isEmpty(tile) {tile.classList.contains('empty') ? true : false;}", "function reset() {\n $boundary\n .css('height', 'auto')\n .find('.placeholder')\n .remove()\n .end()\n .find('.draggable')\n .attr('style', '');\n }", "InitializeLayout() {\n for (let i = 0; i < FrackerSettings.k_worldTiles; ++i) {\n this.m_material[i] = Fracker_Material.EMPTY;\n this.m_bodies[i] = null;\n }\n }", "clear() {\n this._board = Array(this.height).fill(this.EMPTY.repeat(this.width));\n }", "function canPutTileHere(spriteid, r, c, full) {\r\n\r\n // note that tile7 is also a valid tile to form a combination, since its the rainbow tile. thats why it pops up in adjacent checks like here below\r\n\r\n adjacentCount = 0;\r\n\r\n //check left\r\n if((c > 0) && (levelArray[r][c - 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x - 1\r\n if((c > 1) && ((levelArray[r][c - 2]._animation.name == spriteid) || levelArray[r][c - 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 2\r\n if((c > 0) && (r > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 1, y - 1\r\n }\r\n\r\n //check up\r\n if((r > 0) && (levelArray[r - 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y - 1\r\n if((r > 1) && (levelArray[r-2][c]._animation.name == spriteid)) {adjacentCount ++} // y - 2\r\n if((r > 0) && (c > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1, x - 1\r\n if((r > 0) && (c < 7) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1 , x + 1\r\n }\r\n\r\n if(full){\r\n //check right\r\n if((c < 6) && (levelArray[r][c + 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x + 1\r\n if((c < 6) && ((levelArray[r][c + 2]._animation.name == spriteid) || levelArray[r][c + 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 2\r\n if((c < 7) && (r > 0) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 1, y - 1\r\n }\r\n\r\n //check down\r\n if((r < 7) && (levelArray[r + 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y + 1\r\n if((r < 6) && (levelArray[r+2][c]._animation.name == spriteid)) {adjacentCount ++} // y + 2\r\n if((r < 7) && (c > 0) && ((levelArray[r + 1][c - 1]._animation.name == spriteid) || levelArray[r + 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1, x - 1\r\n if((r < 7) && (c < 7) && ((levelArray[r + 1][c + 1]._animation.name == spriteid) || levelArray[r + 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1 , x + 1\r\n }\r\n\r\n if(((r < 7) && (r > 0) && (levelArray[r + 1][c]._animation.name == levelArray[r - 1][c]._animation.name))){adjacentCount ++;} // left & right\r\n if(((c < 7) && (c > 0) && (levelArray[r][c + 1]._animation.name == levelArray[r][c - 1]._animation.name))){adjacentCount ++;} // up & down\r\n\r\n }\r\n\r\n if(adjacentCount >= 2){return false} else {return true}\r\n\r\n}", "clearBoard () {\n $('.mushroom-container').empty();\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "reset() {\n this.health = icon_width + 100;\n\n this.x_team_pos = 25;\n this.y_icon_pos = 25 + (icon_height*this.id) + (spacing*this.id);\n this.x_boss_pos = 1075;\n }", "reset() {\n this.grid = this.getEmptyBoard();\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function player_1_borders(){\n var aa = \"\";\n var bb = \"\";\n var new_selected_tile = \"\";\n\n // THIS IS IN CASE THE CITY IS BUILT ALONG THE LEFT-MOST OF THE MAP (TILE X === 0)\n if (selected_tile_x === 0){\n for (var i = 0; i < 2; i++){\n aa = selected_tile_x + i;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }\n\n aa = map_width - 1;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }else{ // THIS IS FOR EVERY OTHER INSTANCE (WHERE THE CITY IS ANYWHERE BUT TILE X === 0)\n for (var i = -1; i < 2; i++){\n aa = selected_tile_x + i;\n\n for (var j = -1; j < 2; j++){\n bb = selected_tile_y + j;\n new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n\n document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n\n if (is_enabled_fog_of_war === 1 && p_color === 0){ fog_of_war_remove(aa,bb); fog_of_war_remove_mini_map(aa,bb); }\n }\n }\n }\n\n // generate css borders in a one-square radius from the city\n // for (var i = -1; i < 2; i++){\n // aa = selected_tile_x + i;\n //\n // for (var j = -1; j < 2; j++){\n // bb = selected_tile_y + j;\n // new_selected_tile = \"tile_\" + aa + \"_\" + bb;\n //\n // document.getElementById(new_selected_tile).innerHTML = \"<img src='./images/player_1_border_all.png'>\";\n // }\n // }\n}", "function FrameBorderCleaner() {\n push();\n translate(innerWidth/2, innerHeight/2);\n noFill();\n stroke(30);\n strokeWeight(200);\n rect(-405, -405, 810, 810);\n pop();\n}", "generateBoard() {\n for (let i = 0; i < this.rows; i++) {\n let row = [];\n for (let i = 0; i < this.cols; i++) row.push(new Tile(0, false));\n this.tiles.push(row);\n }\n this.setMines();\n }", "function layoutInvalidated(rowToUpdate) {\n\n var timeline = new TimelineMax();\n var partialLayout = (rowToUpdate > -1);\n\n var height = 0;\n var col = 0;\n var row = 0;\n var time = 0.35;\n\n $(\".tile\").each(function(index, element) {\n\n var tile = this.tile;\n var oldRow = tile.row;\n var oldCol = tile.col;\n var newTile = tile.newTile;\n\n // PARTIAL LAYOUT: This condition can only occur while a tile is being\n // dragged. The purpose of this is to only swap positions within a row,\n // which will prevent a tile from jumping to another row if a space\n // is available. Without this, a large tile in column 0 may appear\n // to be stuck if hit by a smaller tile, and if there is space in the\n // row above for the smaller tile. When the user stops dragging the\n // tile, a full layout update will happen, allowing tiles to move to\n // available spaces in rows above them.\n if (partialLayout) {\n row = tile.row;\n if (tile.row !== rowToUpdate) return;\n }\n\n // Update trackers when colCount is exceeded\n if (col + tile.colspan > colCount) {\n col = 0; row++;\n }\n\n $.extend(tile, {\n col : col,\n row : row,\n index : index,\n x : col * gutterStep + (col * colSize),\n y : row * gutterStep + (row * rowSize),\n width : tile.colspan * colSize + ((tile.colspan - 1) * gutterStep),\n height : tile.rowspan * rowSize\n });\n\n col += tile.colspan;\n\n // If the tile being dragged is in bounds, set a new\n // last index in case it goes out of bounds\n if (tile.isDragging && tile.inBounds) {\n tile.lastIndex = index;\n }\n\n if (newTile) {\n\n // Clear the new tile flag\n tile.newTile = false;\n\n var from = {\n autoAlpha : 0,\n boxShadow : shadow1,\n height : tile.height,\n scale : 0,\n width : tile.width\n };\n\n var to = {\n autoAlpha : 1,\n scale : tile.isTemp ? .4 : 1,\n zIndex : zIndex\n };\n\n // move temps to where the menu hover was ....\n if(tile.isTemp){\n var xHack = $('#list').width() - (tile.colspan === 2 ? 610 : 320),\n yHack = yOffset - 175; // come up half a tile height .....\n // if(isTablet) {\n // xHack = $('#list').width() - (tile.colspan === 2 ? 610 : 320);\n // //yHack = xOffset - 210;\n // }else if (isStudio){\n // xHack = $('#list').width() - (tile.colspan === 2 ? 610 : 320);\n // //xHack = currMouseOverX;\n // } else {\n //\n // }\n tile.x = xHack;\n tile.y = yHack;\n }\n timeline.fromTo(element, time, from, to, \"reflow\");\n } else if (tile.width === (tile.colspan * colSize + ((tile.colspan - 1) * gutterStep) ) * .75){\n var from = {\n scale : .75\n };\n\n var to = {\n scale : 1\n };\n timeline.fromTo(element, time, from, to, \"reflow\");\n }\n\n // Don't animate the tile that is being dragged and\n // only animate the tiles that have changes\n if (!tile.isDragging && (oldRow !== tile.row || oldCol !== tile.col)) {\n\n var duration = newTile ? 0 : time;\n\n // Boost the z-index for tiles that will travel over\n // another tile due to a row change\n if (oldRow !== tile.row) {\n timeline.set(element, { zIndex: ++zIndex }, \"reflow\");\n }\n\n timeline.to(element, duration, {\n x : tile.x,\n y : tile.y,\n onComplete : function() { tile.positioned = true; },\n onStart : function() { tile.positioned = false; }\n }, \"reflow\");\n }\n });\n\n // If the row count has changed, change the height of the container\n if (row !== rowCount) {\n rowCount = row;\n height = rowCount * gutterStep + (++row * rowSize);\n timeline.to($list, 0.2, { height: height }, \"reflow\");\n }\n}", "clear() {\n let restoreMaxSize = this.maxSize\n this.resize(0)\n this.resize(restoreMaxSize)\n }", "function clearMapTileLayers() {\r\n stopFlicker(); // stop the flickering and reset the button if we change sections - do it regardless - should check to see if it was the previous open or actively flickering\r\n if (drawControl === 1) {\r\n map.removeControl(drawControl);\r\n }\r\n}", "_clearTrajectories() {\n this.elem.selectAll('.intention').remove();\n\n for (let i = 0; i < this.gridSize; i++) {\n for (let j = 0; j < this.gridSize; j++) {\n if (!this._isCornerCell(i, j)) {\n this.grid[i][j].hexagon.attr('fill', 'none');\n }\n }\n }\n }", "reset() {\n // x and y is the position of the enemy on the board, and parametrizes the centre of the\n // corresponding sprite.\n this.x = boardWidth / 2;\n this.y = spriteHeight / 2 + 4.5 * tileHeight;\n this.sprite = this.sprites[Math.floor(sampleInRange(0, 5))];\n }", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\t// checks to see if the tile is next to the empty square tile\n\tif(Math.abs(otherLeft - left) == TILE_AREA && Math.abs(otherTop - top) == 0) {\n\t\treturn true;\n\t} else if(Math.abs(otherLeft - left) == 0 && Math.abs(otherTop - top) == TILE_AREA) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function clearPieceBoard() {\n for(var i = 0; i < 3; i++)\n for(var j = 0; j < 7; j++)\n drawPixelNext( j, i, boardColour);\n}", "resetPlaces() {\n this.map = _.times(this.cfg.places, (i) => {\n return { x: i * this.cfg.width, y: 0, empty: true };\n });\n }", "function displayBoard(board) {\n for (let i = 0; i < 4; i++) {\n const xVal = (i + 1) * 50;\n for (let j = 0; j < 4; j++) {\n const yVal = j * 50 + 50;\n if (board[4 * j + i] === \"blank\") {\n gameState.tiles.create(xVal, yVal, board[4 * j + i]).setScale(0.6);\n } else {\n gameState.tiles.create(xVal, yVal, board[4 * j + i]);\n }\n }\n }\n}", "printBoard() {\n // This will print the board\n let grid = [...this.grid];\n \n // Loop through the values in the grid and set the tiles appropriately\n // Pass in the values to set its color in setTile()\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid.length; j++) { \n if(grid[i][j] === 0){\n // If grid tile === 0\n if((i===0 && (j===1 || j===2)) ){\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],'UP')\n } else if ((i === 3 && (j === 1 || j === 2))){\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],\"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"RIGHT\");\n }else{\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j]);\n }\n \n }else{\n // If doesnt equal 0 then place value in rect\n\n if ((i === 0 && (j === 1 || j === 2))) {\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], 'UP')\n } else if ((i === 3 && (j === 1 || j === 2))) {\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"RIGHT\");\n } else {\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j]);\n }\n } \n }\n }\n if(!this.printedBoard){\n // Displays the elements only needed to be set once (SCORE BANNER)\n this.scoresControlsContainer.append('div').attr('id', 'score-banner');\n d3.select('#score-banner').append('h3').text('SCORE');\n d3.select('#score-banner').append('p').attr('id','score-value'); // Shows score, changed in printBoard()\n this.printedBoard = true; // Prevent this if block from being printed again (unless new game)\n }\n // Change the score display to the current score\n d3.select('#score-value').text(this.score+\"\")\n\n\n\n }", "function eliminateSingleTiles()\r\n{\r\n for(var y = 3; y < WORLD_SIZE_MAX-3; ++y)\r\n {\r\n for(var x = 3; x < WORLD_SIZE_MAX-3; ++x)\r\n {\r\n if(worldMapArray[y][x].isStatic == false)\r\n {\r\n singleTileCoastEliminationCheck(x, y, 2);\r\n\r\n if(worldMapArray[y][x].biomeType == BIOME_DESERT)\r\n {\r\n singleTileDesertEliminationCheck(x, y, 2);\r\n }\r\n }\r\n }\r\n }\r\n}", "function remove_cell_from_validation_grid(x, y) {\r\n\t\tgridPlaced[x][y] = '0';\r\n\t}", "function reset() {\n for (c = 0; c < tileColumnCount; c++) {\n tiles[c] = [];\n for (r = 0; r < tileRowCount; r++) {\n tiles[c][r] = { x: c * (tileW + 3), y: r * (tileH + 3), state: 'e' }; //state is e for empty\n }\n }\n tiles[0][0].state = 's';\n tiles[tileColumnCount - 1][tileRowCount - 1].state = 'f';\n\n output.innerHTML = 'Green is start. Red is finish.';\n}", "function moveTilesUp() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 1; row <= 3; row++) {\n if (checkAbove(row, column) && tileArray[row][column] != null) {\n moveTileUp(row, column);\n }\n }\n }\n }", "function clearInitial() {\n for(var i = 0; i < initial.length;i++) {\n initial[i].setMap(null);\n }\n initial = [];\n bounds = new google.maps.LatLngBounds();\n bounds.extend(roomCoordinates);\n map.setCenter(roomCoordinates);\n if(check == 1) {\n document.getElementById(\"right-panel\").classList.add(\"hidden\");\n }\n directionRenderer.set('directions', null);\n }" ]
[ "0.6855285", "0.67363054", "0.67363054", "0.65975475", "0.6558319", "0.65490043", "0.6464617", "0.6380991", "0.62969166", "0.6284454", "0.62422603", "0.61964566", "0.61819565", "0.6151586", "0.61448246", "0.613089", "0.60987", "0.6084378", "0.6078584", "0.60715395", "0.6063382", "0.6025804", "0.6019933", "0.6018839", "0.6016129", "0.6012804", "0.6012667", "0.59998286", "0.59979993", "0.59973377", "0.5971434", "0.59634125", "0.5963317", "0.5956954", "0.5956913", "0.5954708", "0.5951061", "0.59483415", "0.5943243", "0.59197265", "0.59139353", "0.5913242", "0.59105456", "0.5895716", "0.58916813", "0.5879202", "0.58611697", "0.5860041", "0.5858069", "0.58570784", "0.58556306", "0.58526665", "0.5847257", "0.58455783", "0.58447003", "0.58387214", "0.58362466", "0.58355737", "0.58342", "0.5823414", "0.58231086", "0.58124924", "0.5806185", "0.57983583", "0.579759", "0.57961726", "0.57936054", "0.5788671", "0.5786037", "0.577814", "0.57759887", "0.57713777", "0.5762238", "0.5760189", "0.5758771", "0.5750751", "0.5748791", "0.5740411", "0.57397616", "0.5737951", "0.5734624", "0.5721697", "0.5713649", "0.5711806", "0.5706889", "0.5693014", "0.56853026", "0.5682753", "0.56806254", "0.56791943", "0.5678005", "0.56704557", "0.5669403", "0.5669337", "0.56652695", "0.5663739", "0.5658789", "0.5657082", "0.5657055", "0.56566924", "0.56558263" ]
0.0
-1
Make sure the tile space to the left is clear
function checkLeft(row, column) { if (!isEdge(row, column - 1) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row][column - 1]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTilesLeft() {\n for (var column = 1; column <= 3; column++) {\n for (var row = 3; row >= 0; row--) {\n if (checkLeft(row, column) && tileArray[row][column] != null) {\n moveTileLeft(row, column);\n }\n }\n }\n }", "function moveLeft() {\n let prevCol;\n let curCol;\n let temp;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth - 1; x++) {\n if (x === sizeWidth - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get((x + 1) * sizeBlock + 1, y * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect((x + 1) * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "function moveLeft(){\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width ===0)\n if(!isAtLeftEdge) currentPosition-=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition+=1;\n }\n\n draw();\n }", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % width === 0,\n );\n if (!isAtLeftEdge) {\n currentPosition -= 1;\n }\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\"),\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function moveLeft()\r\n {\r\n undraw()\r\n const isAtLeftEdge = currentTetromino.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge)\r\n currentPosition -= 1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition += 1\r\n draw()\r\n }", "function moveLeft() {\n undraw()\n\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) currentPosition -= 1\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n\n draw()\n }", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(\r\n (index) => (currentPosition + index) % width === 0\r\n );\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition += 1;\r\n }\r\n draw();\r\n }", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge) currentPosition -=1\r\n\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\n draw()\r\n }", "function moveLeft () {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) {\n currentPosition -= 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n draw()\n }", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some((index) => (currentPosition + index) % width === 0);\n if (!isAtLeftEdge) currentPosition -= 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n draw();\n}", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function moveLeft() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtLeftEdge = current.some(\n //condition is at left hand side is true\n (index) => (currentPosition + index) % width === 0\n );\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function moveLeft() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column - 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function moveLeft() {\n undraw()\n const reachedLeftEdge = curT.some(index => (curPos + index) % width === 0)\n if (!reachedLeftEdge) curPos -= 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos += 1\n }\n draw()\n }", "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if(!isAtLeftEdge) currentPosition -=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition +=1\n }\n draw()\n}", "function moveLeft() {\n undraw(squares, current, currentPosition);\n const isAtLeftEdge = current.some(index => (currentPosition + index) % WIDTH === 0);\n \n if(!isAtLeftEdge) currentPosition -= 1;\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n\n draw();\n }", "function moveLeft() {\n unDraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % xPixel === 0\n );\n\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n\n draw();\n }", "function isLeftClear (ghostCurrentPosition) {\n if (!cells[ghostCurrentPosition - 1].classList.contains(borderClass) && (!cells[ghostCurrentPosition - 1].classList.contains(tarantulaClass) || !cells[ghostCurrentPosition].classList.contains(scorpianClass) || !cells[ghostCurrentPosition].classList.contains(waspClass))) {\n // console.log('left clear')\n return true\n }\n }", "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index)% width ===0)\r\n if(!isAtLeftEdge) currentPosition -=1\r\n if(current.some (index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\ndraw()\r\n}", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function wall3Left() {\n wall3X = wall3X - 0.5;\n if (wall3X < -1200) { //when leftmost part of wall3 less than -1200, reset wall3X to 0, like resetting a typewriter\n wall3X = 0;\n }\n}", "function rewX() {\n\t while (rect.origin.x > box.left) {\n\t rect.origin.x -= img_width;\n\t }\n\t }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\r\n // allows shape to move left if it's not at the left position\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n\r\n // push it unto a tetrimino that is already on the left edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition += 1;\r\n\r\n }\r\n draw();\r\n}", "adjustTile(sprite) {\n // set origin at the top left corner\n sprite.setOrigin(0);\n\n // set display width and height to \"tileSize\" pixels\n sprite.displayWidth = this.tileSize;\n sprite.displayHeight = this.tileSize;\n }", "getLeftTile() {\n\t\treturn this.position;\n\t}", "_moveLeftInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = this._items.length;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n\n this._offset = -(this._calcShiftMaxLength() + this._calcTowardsLeft() );\n this._itemsHolder.style.transform = `translateX(${ this._offset - this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveLeft(), this._settings.oppositeSideAppearDelay);\n }", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "handleCollLeft(obj, tileLeft) {\n if (obj.right > tileLeft && obj.rightOld <= tileLeft) {\n obj.right = tileLeft - 0.01;\n obj.velX = 0;\n return true;\n }\n return false;\n }", "function moveTileLeft(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column - 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column - 1)) {\n $(tileArray[row][column - 1]).remove();\n tileArray[row][column - 1] = null;\n } else {\n tileArray[row][column - 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column - 1].id.slice(5)) - 1));\n } \n });\n tileArray[row][column - 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "wrap() {\n if (this.x > width) {\n this.x -= width;\n }\n }", "get unmaskedWidth() { return calcTileDimension(this.lrs, this.uls); }", "function removeLeft(){\n\t// kill all marios on the left half\n\t$(\"#characters\").children().each(function(index) {\n\t\tif($(this).attr(\"srcPos\") <5)\n\t\t{\n\t\t\t//if(isCompatible() == true)\n\t\t\t{\n\t\t\t\t$(this).addClass(\"character-removed\");\n\t\t\t\t$(this).bind(\"webkitTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"oTransitionEnd\", removeDiv);\n\t\t\t\t$(this).bind(\"otransitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"transitionend\", removeDiv);\n\t\t\t\t$(this).bind(\"msTransitionEnd\", removeDiv);\n\t\t\t}\n\t\t\t/*else\n\t\t\t{\n\t\t\t\t$(this).empty();\n\t\t\t\t$(this).remove();\n\t\t\t}*/\n\t\t}\n\t});\n}", "function minesLeft() {\n const markedTilesCount = board.reduce((count, row) => {\n return count + row.filter(tile => tile.status === TILE_STATUSES.MARKED).length\n }, 0)\n\n mineLeftText.textContent = NUMBER_OF_MINES - markedTilesCount\n}", "function moveLeft(){\n //first check that keys are enabled\n if(keyEnabled == true){\n undraw();\n const isAtLeftEdge = currentShape.some(index => (currentPosition + index)% 10 === 0 )\n\n if(!isAtLeftEdge)\n {\n currentPosition = currentPosition - 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition +1;\n }\n\n draw();\n }\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "handleWrapping() {\n// Off the left or right\n if (this.x < -100) {\n this.x += width;\n this.y = random(0,height);\n }\n else if (this.x > width) {\n this.x -= width;\n }\n }", "function FixLeftArm2(context) {\n\t// Front\n\tif(HasTransparency(context, 52, 52, 4, 12)) return;\n\t\n\t// Top, Bottom, Right, Left, Back\n\tif(HasTransparency(context, 52, 48, 4, 4)) return;\n\tif(HasTransparency(context, 56, 48, 4, 4)) return;\n\tif(HasTransparency(context, 48, 52, 4, 12)) return;\n\tif(HasTransparency(context, 56, 52, 4, 12)) return;\n\tif(HasTransparency(context, 60, 52, 4, 12)) return;\n\t\n\t// Didn't have transparency, clearing the left arm overlay area.\n\tcontext.clearRect(52, 48, 4, 4);\n\tcontext.clearRect(56, 48, 4, 4);\n\tcontext.clearRect(48, 52, 4, 12);\n\tcontext.clearRect(52, 52, 4, 12);\n\tcontext.clearRect(56, 52, 4, 12);\n\tcontext.clearRect(60, 52, 4, 12);\n}", "getRenderedLeft(){return e.System.Services.controlManager.checkControlGeometryByControl(this),this.__renderedSizeCache.left}", "tryWall(x, y) {\n if (x >= 0 && x < this.tiles[0].length && y >= 0 && y < this.tiles.length &&\n this.tiles[y][x] === 'E') {\n this.tiles[y][x] = 'W';\n }\n }", "function fixLeft() {\n var table = $(settings.table);\n\n // var fixColumn = settings.left;\n\n settings.leftColumns = $();\n\n var tr = table.find(\"tr\");\n tr.each(function (k, row) {\n\n solverLeftColspan(row, function (cell) {\n settings.leftColumns = settings.leftColumns.add(cell);\n });\n // var inc = 1;\n\n // for(var i = 1; i <= fixColumn; i = i + inc) {\n // \tvar nth = inc > 1 ? i - 1 : i;\n\n // \tvar cell = $(row).find(\"*:nth-child(\" + nth + \")\");\n // \tvar colspan = cell.prop(\"colspan\");\n\n // \tsettings.leftColumns = settings.leftColumns.add(cell);\n\n // \tinc = colspan;\n // }\n });\n\n var column = settings.leftColumns;\n\n column.each(function (k, cell) {\n var cell = $(cell);\n\n setBackground(cell);\n cell.css({\n 'position': 'relative'\n });\n });\n }", "function leftAlign(){\n\tvar baseX = 999999;\n\tfor(var i=0; i<currentShapes.length; i++){\n\t\tif(baseX>currentShapes[i].getX()){\n\t\t\tbaseX = currentShapes[i].getX();\n\t\t}\n\t}\n\tfor(var k=0; k<currentShapes.length; k++){\n\t\tcurrentShapes[k].setX(baseX);\n\t}\n\tlayer.draw();\n\thatioGroupRevised();\n}", "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "function encloseLeftState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX < 0){\n shipX = 0;\n }\n}", "function FixLeftLeg2(context) {\n\t// Front\n\tif(HasTransparency(context, 4, 52, 4, 12)) return;\n\t\n\t// Top, Bottom, Right, Left, Back\n\tif(HasTransparency(context, 4, 48, 4, 4)) return;\n\tif(HasTransparency(context, 8, 48, 4, 4)) return;\n\tif(HasTransparency(context, 0, 52, 4, 12)) return;\n\tif(HasTransparency(context, 8, 52, 4, 12)) return;\n\tif(HasTransparency(context, 12, 52, 4, 12)) return;\n\t\n\t// Didn't have transparency, clearing the left leg overlay area.\n\tcontext.clearRect(4, 48, 4, 4);\n\tcontext.clearRect(8, 48, 4, 4);\n\tcontext.clearRect(0, 52, 4, 12);\n\tcontext.clearRect(4, 52, 4, 12);\n\tcontext.clearRect(8, 52, 4, 12);\n\tcontext.clearRect(12, 52, 4, 12);\n}", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "function moveAllToLeft() {\n\tvar moved = false;\n\tfor (var r = 0; r < 4 ; r++ ) {\n\t\tvar s = 0;\n\t\tfor (var c = 0; c < 4 ; c++ ) {\n\t\t\tif (!isCellEmpty(r, c)) {\n\t\t\t\tif (c != s) {\n\t\t\t\t\tmoved = true;\n\t\t\t\t\tsetGridNumRC(r, s, grid[r][c]);\n\t\t\t\t\tsetEmptyCell(r, c);\n\t\t\t\t}\n\t\t\t\ts++;\n\t\t\t}\n\t\t}\n\t}\n\treturn moved;\n}", "function swapLeft(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y, x: blankPOS.x - 1 })\n}", "trimLoadedTiles() {\n this._cache.trim();\n }", "function clearBoardRect() {\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n m.clear();\n for(j = 0; j < filledBoardRect.length; j++){\n mod = (filledBoardRect[j] % 15);\n qut = Math.floor(filledBoardRect[j] / 15);\n\n if (mod === 0) {\n x = 14 * rectLength + 5;\n y = (qut - 1) * rectBreadth + 210;\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n }\n }\n else {\n x = (mod - 1) * rectLength + 5;\n y = qut * rectBreadth + 210\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xLS'){\n ls3(x, y)\n }\n else if (rectType === '2xWS'){\n ws2(x, y)\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n else if (rectType === 'star'){\n getStar(x, y)\n }\n }\n }\n }\n filledBoardRect.length = 0;\n word.length = 0;\n selectLetter = null;\n wordss.length = 0;\n rackPreviousState();\n}", "getEmptyTile() {\n const index = this.tiles.indexOf(0);\n const pos = this.getTilePosition(index);\n return {x: pos.x, y: pos.y, index: index};\n }", "validSpaces(update) {\n if(!update) {\n return this.validTiles;\n }\n if(this.color == \"white\") {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i + 1];\n return [i + 1];\n } else {\n this.validTiles = [i + 1, i + 2];\n return [i + 1, i + 2];\n }\n } else {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i - 1];\n return [i - 1];\n } else {\n this.validTiles = [i - 1, i - 2];\n return [i - 1, i - 2];\n }\n }\n }", "function moveLeft() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol);\n\t\t}\n\n\t\tdraw();\n\t}", "function clearSpaces() {\n var canvas = document.getElementById(\"checkerboard\");\n var context2D = canvas.getContext(\"2d\");\n\n for (var boardRow = 0; boardRow < 8; boardRow++) {\n for (var boardCol = 0; boardCol < 8; boardCol++) {\n // coordinates of the top-left corner\n\t var x = boardCol * 50;\n\t var y = boardRow * 50;\n if ((boardRow + boardCol) % 2 == 1) {\n\t context2D.fillStyle = \"SeaGreen\";\n\t context2D.fillRect(x, y, 50, 50);\n\t }\n }\n }\n\n context2D.fillStyle = \"Gray\";\n}", "function moveLeft(){\n mergeLeft();\n //Merging block first, pushing later\n for (var i = 0; i < height; i++){\n for (var temp = 0; temp < width - 1; temp++){ //This line will repeat the moving block until all blocks are moved to the very left\n for (var j = 0; j < width - 1; j++){\n if (block2D[i][j] == 0){ //Skip value 0 at the last element \n block2D[i][j] = block2D[i][j + 1];\n block2D[i][j + 1] = 0;\n }\n }\n }\n }\n console.log(\"Move left:\");\n printBoardSimple();\n addBlock();\n}", "createFullGround() {\n\t\tfor (let i=0; i<this.game.width; i=i+this.tileSize) {\n\t\t\tthis.addTile(i);\n\t\t}\n\t}", "function getLeftPosition(tile) {\n return parseInt(tile.style.left);\n }", "newPieceMoveLeft(){\n\n\t\tlet isCollision = false;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0]-1 \t+ index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1] \t+ Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || x < 0){\n\t\t\t\t\tisCollision = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif(!isCollision){\n\t\t\tthis.newPiecePosition[0] -= 1;\n\t\t}\n\n\t}", "function clearEndangeredTiles(isSafeTile)\n{\n // Loop through all the endangered tiles and set them to SAFE_ZONE\n for (var i = 0; i < endangeredTiles.length; i++)\n {\n // stored as ['1,1', '2,2', 3,5']\n var x = parseInt(endangeredTiles[i].split(\",\")[0]);\n var y = parseInt(endangeredTiles[i].split(\",\")[1]);\n\n updateMapTile(x, y, isSafeTile);\n }\n\n // Reset the endangered tiles array\n endangeredTiles = [];\n}", "checkWarp () {\n this.x = Phaser.Math.Wrap(this.x, 0, levelData.WIDTH)\n this.y = Phaser.Math.Wrap(this.y, 0, levelData.HEIGHT)\n }", "function moveRight() {\n let prevCol;\n let curCol;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth; x++) {\n if (x === 0) {\n prevCol = get((sizeWidth - 1) * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x, y * sizeBlock, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function checkSpace()\n\t\t{\n\n\t\t\tvar nb =random(3) ;\n\t\t\tvar nb2 = random(3);\n\t\t\tvar tileNew = $('body').find('[data-x='+nb+'][data-y='+nb2+']');\n\t\t\tif(tileNew.length === 0)\n\t\t\t{\n\t\t\t\treturn {x:nb , y: nb2};\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcheckSpace();\n\t\t\t}\n\t\t}", "hasSafeTiles(){\n return this._numberOfTiles !== this._numberOfBombs;\n }", "get left () {\n return this.pos.x - this.size.x / 2;\n }", "function reset(){\n\t\tsetSorting(false);\n\t\t// setDataBottom(new Array(rectNum).fill(new Rect(0,Math.round(maxWidth/rectNum),0)));\n\t\tsetLightUp([]);\n\t\t// setLightUpBottom([]);\n\n\t}", "function moveLeft(){\n let initialPosLeft = witch.getBoundingClientRect().left;\n let lifeLeft = witch_lifeline.getBoundingClientRect().left;\n if(initialPosLeft > 32){\n witch_lifeline.style.left = lifeLeft - 20 + 'px';\n witch.style.left = initialPosLeft - 20 + 'px';\n }\n}", "function keepInBounds(el){\n if(el.x + el.w >= canvas.width){\n el.x = canvas.width - el.w;\n }\n else if(el.x <= 0){\n el.x = 0;\n }\n if(el.y >= canvas.height - el.h){\n el.y = canvas.height - el.h;\n }\n else if(el.y <= 0){\n el.y = 0;\n }\n }", "_moveRightInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = 0;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n this._offset = this._calcDisplayedItemsTotalWidth() -\n (this._settings.neighborsVisibleWidth + this._calcOppositeRight());\n this._itemsHolder.style.transform = `translateX(${ this._offset + this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveRight(), this._settings.oppositeSideAppearDelay);\n }", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "function tilingWhite() {\n let x = 60;\n let y = 0; // before y = 60\n\n for (let i = 0; i < tileWhite.segmentsY; i++) {\n if (i % 2 === 0) {\n x = 60; // before x = 90;\n }\n else {\n x = 0; //before x = 150;\n }\n // Draws horizontal tiles\n for (let j = 0; j < tileWhite.segmentsX; j++) {\n push();\n noStroke();\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b);\n rect(x,y, tileWhite.size);\n x = x + tileWhite.spacingX;\n pop();\n }\n y = y + tileWhite.spacingY;\n }\n}", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "set LeftCenter(value) {}", "function resetBoard() {\n [hasFlippedCard, lockBoard] = [false, false];\n [firstCard, secondCard] = [null, null];\n }", "get left() {\n\t\treturn this.pos.x - this.size.x / 2;\n\t}", "function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}", "function left_move() {\n if (coord_pos[0] > 0) {\n coord_pos[0] -= 1;\n }\n else if(coord_pos[1] > 0) { // If we need to wrap around (and have room to)\n coord_pos[0] = n;\n coord_pos[1] -= 1;\n } else { // If we hit the upper left, we go the bottom right corner\n coord_pos = [n,n];\n }\n recent_move = -1;\n}", "function EraseOldActiveBlockPosition(){\n for(var i = 0; i < activeBlock.shapeMatrix[0].length; ++i){\n for(var j = 0; j < activeBlock.shapeMatrix[0].length; ++j){\n if(activeBlock.shapeMatrix[i][j] != 0){\n board[activeBlock.position.y + i][activeBlock.position.x + j] = 0;\n }\n }\n }\n updateGrid();\n}", "function drawTileGrid(gameContainer, normalTexture, floodedTexture) {\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tfor (var j = 0; j < 6; j++) {\r\n\t\t\tvar tile = new Tile(normalTexture, floodedTexture, i, j, 'tile_' + i + '_' + j);\r\n\t\t\t// Skip tile positions on first row that need to be blank\r\n\t\t\tif ((i == 0 && j == 0) || (i == 0 && j == 1) || (i == 0 && j == 4) || (i == 0 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on second row that need to be blank\r\n\t\t\tif ((i == 1 && j == 0) || (i == 1 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on fifth row that need to be blank\r\n\t\t\tif ((i == 4 && j == 0) || (i == 4 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on sixth row that need to be blank\r\n\t\t\tif ((i == 5 && j == 0) || (i == 5 && j == 1) || (i == 5 && j == 4) || (i == 5 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Push tile object onto gameboard 2D Array\r\n\t\t\tgameBoard[i][j] = tile;\r\n\t\t\tgameContainer.addChild(tile);\r\n\t\t}\r\n\t}\r\n}", "function resetCan() {\n clear();\n curr = make2DArr(width, height);\n prev = make2DArr(width, height);\n background(0);\n}", "get leftEnd () {\n return this.position.x - this.size.x / 2;\n }", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "function canMoveLeft() {\n var grid = null;\n var checkRow = 0;\n var checkColumn = 0;\n for(grid of GameData.activePiece.getLeft()) {\n checkRow = GameData.row + grid.getRow();\n checkColumn = correctColumn(GameData.column + grid.getColumn());\n if(GameData.mainPlayField.getBlockType(checkRow, checkColumn) !== 0) {\n return false;\n }\n }\n return true;\n}", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "function remove_cell_from_validation_grid(x, y) {\r\n\t\tgridPlaced[x][y] = '0';\r\n\t}", "function resetBox(){\n xOffset = playfield.width / 2;\n yOffset = playfield.height / 2;\n}" ]
[ "0.6782965", "0.64945406", "0.64813364", "0.6479679", "0.6474976", "0.6473858", "0.6466099", "0.6459601", "0.645585", "0.64152783", "0.6413282", "0.63957596", "0.63832474", "0.6348916", "0.63137734", "0.6259685", "0.6243375", "0.62421334", "0.6195912", "0.61550045", "0.61500305", "0.6149196", "0.61415684", "0.612861", "0.612861", "0.612861", "0.61254746", "0.6111778", "0.61106855", "0.60708684", "0.60617274", "0.6055222", "0.603685", "0.6036225", "0.60134447", "0.59726024", "0.59702826", "0.5969999", "0.5966349", "0.5950343", "0.59197927", "0.5914642", "0.58652496", "0.5861257", "0.5857354", "0.58513", "0.5845419", "0.58449024", "0.5842493", "0.5836834", "0.5812765", "0.5810062", "0.57844144", "0.57461196", "0.57438076", "0.57404524", "0.57404524", "0.57210654", "0.57204705", "0.57105863", "0.5704415", "0.5679607", "0.56520337", "0.56509507", "0.5650712", "0.5650442", "0.56464773", "0.5640493", "0.56378347", "0.5625013", "0.56176037", "0.5609001", "0.5601794", "0.56001264", "0.5596312", "0.55878997", "0.5587592", "0.5587571", "0.5586703", "0.5580578", "0.5569912", "0.55697554", "0.5562138", "0.555491", "0.5547997", "0.5544802", "0.5541479", "0.55414754", "0.5537661", "0.55371207", "0.55343235", "0.55331254", "0.55306584", "0.55271786", "0.55256236", "0.55233777", "0.552274", "0.5519576", "0.5512985", "0.55112207" ]
0.62167746
18
Make sure the tile space to the right is clear
function checkRight(row, column) { if (!isEdge(row, column + 1) && tileArray[row][column] != null) { if (document.getElementById("center-tile").style.backgroundColor == tileArray[row][column].style.backgroundColor) { return true; } else { return false; } } else { return !tileArray[row][column + 1]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "keepInBounds() {\n let x = this.sprite.position.x;\n let y = this.sprite.position.y;\n let spriteHalfWidth = this.sprite.width / 2;\n let spriteHalfHeight = this.sprite.height / 2;\n let stageWidth = app.renderer.width;\n let stageHeight = app.renderer.height;\n\n if (x - spriteHalfWidth <= 0)\n this.sprite.position.x = spriteHalfWidth;\n\n if (x + spriteHalfWidth >= stageWidth)\n this.sprite.position.x = stageWidth - spriteHalfWidth;\n\n //Add the same padding that the other bounds have\n if (y + spriteHalfHeight >= stageHeight - 10)\n this.sprite.position.y = stageHeight - spriteHalfHeight - 10;\n\n if (y - spriteHalfHeight <= 0)\n this.sprite.position.y = spriteHalfHeight;\n }", "function resetBoard() {\n isOneTileFlipped = false;\n lockBoard = false;\n firstTile = null;\n secondTile = null;\n}", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "adjustTile(sprite) {\n // set origin at the top left corner\n sprite.setOrigin(0);\n\n // set display width and height to \"tileSize\" pixels\n sprite.displayWidth = this.tileSize;\n sprite.displayHeight = this.tileSize;\n }", "function moveRight(){\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition+index)%width === width-1);\n if(!isAtRightEdge) currentPosition +=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition-=1;\n }\n\n draw();\n }", "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "function clearEndangeredTiles(isSafeTile)\n{\n // Loop through all the endangered tiles and set them to SAFE_ZONE\n for (var i = 0; i < endangeredTiles.length; i++)\n {\n // stored as ['1,1', '2,2', 3,5']\n var x = parseInt(endangeredTiles[i].split(\",\")[0]);\n var y = parseInt(endangeredTiles[i].split(\",\")[1]);\n\n updateMapTile(x, y, isSafeTile);\n }\n\n // Reset the endangered tiles array\n endangeredTiles = [];\n}", "tryWall(x, y) {\n if (x >= 0 && x < this.tiles[0].length && y >= 0 && y < this.tiles.length &&\n this.tiles[y][x] === 'E') {\n this.tiles[y][x] = 'W';\n }\n }", "validSpaces(update) {\n if(!update) {\n return this.validTiles;\n }\n if(this.color == \"white\") {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i + 1];\n return [i + 1];\n } else {\n this.validTiles = [i + 1, i + 2];\n return [i + 1, i + 2];\n }\n } else {\n let i = this.currentTile;\n if(this.hasMoved) {\n this.validTiles = [i - 1];\n return [i - 1];\n } else {\n this.validTiles = [i - 1, i - 2];\n return [i - 1, i - 2];\n }\n }\n }", "function moveRight() {\n let prevCol;\n let curCol;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth; x++) {\n if (x === 0) {\n prevCol = get((sizeWidth - 1) * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x, y * sizeBlock, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(\r\n index=> (currentPosition + index) % width === width - 1)\r\n \r\n if (!isAtRightEdge) {\r\n currentPosition += 1;\r\n }\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "hasSafeTiles(){\n return this._numberOfTiles !== this._numberOfBombs;\n }", "function moveRight() {\r\n unDraw();\r\n const isAtRightEdge = current.some(\r\n (index) => (currentPosition + index) % width === width - 1\r\n );\r\n if (!isAtRightEdge) currentPosition += 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some((index) => (currentPosition + index) % width === width - 1);\n if (!isAtRightEdge) currentPosition += 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1;\n }\n draw();\n}", "function moveRight() {\n undraw()\n\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) currentPosition += 1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n\n draw()\n }", "function checkSpace()\n\t\t{\n\n\t\t\tvar nb =random(3) ;\n\t\t\tvar nb2 = random(3);\n\t\t\tvar tileNew = $('body').find('[data-x='+nb+'][data-y='+nb2+']');\n\t\t\tif(tileNew.length === 0)\n\t\t\t{\n\t\t\t\treturn {x:nb , y: nb2};\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcheckSpace();\n\t\t\t}\n\t\t}", "function moveRight () {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) {\n currentPosition += 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n draw()\n }", "function moveRight(){\r\n undraw()\r\n const isAtRightEdge = current.some(index => (currentPosition + index)%width === width -1)\r\n if(!isAtRightEdge) currentPosition +=1\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition -=1\r\n }\r\n draw()\r\n}", "function moveRight() {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width -1)\n if(!isAtRightEdge) currentPosition +=1\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -=1\n }\n draw()\n}", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "handleWrapping() {\n// Off the left or right\n if (this.x < -100) {\n this.x += width;\n this.y = random(0,height);\n }\n else if (this.x > width) {\n this.x -= width;\n }\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveRight() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtRightEdge = current.some(\n //condition is at right hand side is true\n (index) => (currentPosition + index) % width === width - 1\n );\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n draw();\n }", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "function isRightClear (ghostCurrentPosition) {\n if (!cells[ghostCurrentPosition + 1].classList.contains(borderClass) && (!cells[ghostCurrentPosition + 1].classList.contains(tarantulaClass) || !cells[ghostCurrentPosition].classList.contains(scorpianClass) || !cells[ghostCurrentPosition].classList.contains(waspClass))) {\n // console.log('right clear')\n return true\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveRight(){\n if(keyEnabled == true){\n undraw();\n const isAtRightEdge = currentShape.some(index => (currentPosition + index)% width === width - 1 )\n\n if(!isAtRightEdge)\n {\n currentPosition = currentPosition + 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition -1;\n }\n\n draw();\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "addTile() {\n if(this.full()) {\n return false;\n }\n while(true) {\n let r = randIdx(this.board.length);\n let c = randIdx(this.board[r].length);\n if(this.board[r][c] == 0) {\n this.board[r][c] = randInt(1,2) * 2;\n return true;\n }\n }\n }", "get unmaskedWidth() { return calcTileDimension(this.lrs, this.uls); }", "function clearSpaces() {\n var canvas = document.getElementById(\"checkerboard\");\n var context2D = canvas.getContext(\"2d\");\n\n for (var boardRow = 0; boardRow < 8; boardRow++) {\n for (var boardCol = 0; boardCol < 8; boardCol++) {\n // coordinates of the top-left corner\n\t var x = boardCol * 50;\n\t var y = boardRow * 50;\n if ((boardRow + boardCol) % 2 == 1) {\n\t context2D.fillStyle = \"SeaGreen\";\n\t context2D.fillRect(x, y, 50, 50);\n\t }\n }\n }\n\n context2D.fillStyle = \"Gray\";\n}", "function clearBoardRect() {\n wordsAroundNewLetter.length = 0;\n usedRectArray.length = 0;\n m.clear();\n for(j = 0; j < filledBoardRect.length; j++){\n mod = (filledBoardRect[j] % 15);\n qut = Math.floor(filledBoardRect[j] / 15);\n\n if (mod === 0) {\n x = 14 * rectLength + 5;\n y = (qut - 1) * rectBreadth + 210;\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n }\n }\n else {\n x = (mod - 1) * rectLength + 5;\n y = qut * rectBreadth + 210\n emptyBoardRect(x, y);\n if (filledBoardRect[j] in multiplier) {\n var rectType = multiplier[filledBoardRect[j]];\n if (rectType === '2xLS') {\n ls2(x, y);\n }\n else if (rectType === '3xLS'){\n ls3(x, y)\n }\n else if (rectType === '2xWS'){\n ws2(x, y)\n }\n else if (rectType === '3xWS'){\n ws3(x, y)\n }\n else if (rectType === 'star'){\n getStar(x, y)\n }\n }\n }\n }\n filledBoardRect.length = 0;\n word.length = 0;\n selectLetter = null;\n wordss.length = 0;\n rackPreviousState();\n}", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function moveRight() {\n undraw();\n //check if any of the tetromino's cells are on the right edge\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % width === width-1);\n //move tetromino to the right if none of its cells is at the left edge\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n \n //move tetromino one column to the right if any of its cells try and occupy a 'taken' cell\n if(currentTetromino.some(index=> squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1; \n }\n\n draw();\n }", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function encloseRightState(){\n if(shipY < 0){\n shipY = 0;\n }\n if(shipY > height - 50){\n shipY = height - 50;\n }\n if(shipX > width - 40){\n shipX = width - 40;\n }\n}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "uncoverEmptyTiles(theRow, theCol, theBoard) {\n\n /* gets all surrounding tiles to tile at [xpos][ypos] */\n\n let surround = this.checkSurroundingArea(theRow, theCol, theBoard);\n\n surround.map(tile => {\n\n /* Check if this tile isn't revealed, flagged or a mine and is empty */\n if (!tile.mine && !tile.revealed && !tile.flag) {\n\n theBoard[tile.row][tile.col].revealed = true;\n\n /* since this tile is empty, check recursively all around this tile too */\n if (tile.mineCount === 0) {\n\n this.uncoverEmptyTiles(tile.row, tile.col, theBoard);\n\n }\n }\n\n });\n\n return theBoard;\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "checkWarp () {\n this.x = Phaser.Math.Wrap(this.x, 0, levelData.WIDTH)\n this.y = Phaser.Math.Wrap(this.y, 0, levelData.HEIGHT)\n }", "function canPutTileHere(spriteid, r, c, full) {\r\n\r\n // note that tile7 is also a valid tile to form a combination, since its the rainbow tile. thats why it pops up in adjacent checks like here below\r\n\r\n adjacentCount = 0;\r\n\r\n //check left\r\n if((c > 0) && (levelArray[r][c - 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x - 1\r\n if((c > 1) && ((levelArray[r][c - 2]._animation.name == spriteid) || levelArray[r][c - 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 2\r\n if((c > 0) && (r > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x - 1, y - 1\r\n }\r\n\r\n //check up\r\n if((r > 0) && (levelArray[r - 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y - 1\r\n if((r > 1) && (levelArray[r-2][c]._animation.name == spriteid)) {adjacentCount ++} // y - 2\r\n if((r > 0) && (c > 0) && ((levelArray[r - 1][c - 1]._animation.name == spriteid) || levelArray[r - 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1, x - 1\r\n if((r > 0) && (c < 7) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y - 1 , x + 1\r\n }\r\n\r\n if(full){\r\n //check right\r\n if((c < 6) && (levelArray[r][c + 1]._animation.name == spriteid)) {\r\n adjacentCount ++; // x + 1\r\n if((c < 6) && ((levelArray[r][c + 2]._animation.name == spriteid) || levelArray[r][c + 2]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 2\r\n if((c < 7) && (r > 0) && ((levelArray[r - 1][c + 1]._animation.name == spriteid) || levelArray[r - 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // x + 1, y - 1\r\n }\r\n\r\n //check down\r\n if((r < 7) && (levelArray[r + 1][c]._animation.name == spriteid)) {\r\n adjacentCount ++; // y + 1\r\n if((r < 6) && (levelArray[r+2][c]._animation.name == spriteid)) {adjacentCount ++} // y + 2\r\n if((r < 7) && (c > 0) && ((levelArray[r + 1][c - 1]._animation.name == spriteid) || levelArray[r + 1][c - 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1, x - 1\r\n if((r < 7) && (c < 7) && ((levelArray[r + 1][c + 1]._animation.name == spriteid) || levelArray[r + 1][c + 1]._animation.name == 'tile7' || spriteid == 'tile7' )) {adjacentCount ++} // y + 1 , x + 1\r\n }\r\n\r\n if(((r < 7) && (r > 0) && (levelArray[r + 1][c]._animation.name == levelArray[r - 1][c]._animation.name))){adjacentCount ++;} // left & right\r\n if(((c < 7) && (c > 0) && (levelArray[r][c + 1]._animation.name == levelArray[r][c - 1]._animation.name))){adjacentCount ++;} // up & down\r\n\r\n }\r\n\r\n if(adjacentCount >= 2){return false} else {return true}\r\n\r\n}", "function drawTile0() {\n ctx.clearRect(25, 125, 65, 70);\n ctx.fillStyle = palette[2][0];\n ctx.fillRect(25, 125, 65, 70)\n }", "function checkDestroy() {\n for (let i = 0; i < height; i++) {\n let cnt = 0;\n for (let j = 0; j < width; j++) {\n if (gameBoardData[i][j]) cnt++;\n }\n if (cnt != 10) continue\n for (let j = 0; j < 10; j++) {\n gameBoard.removeChild(allShapePos[i][j]);\n allShapePos[i][j] = null;\n gameBoardData[i][j] = 0;\n }\n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y - 1][x] != null) {\n allShapePos[y][x] = allShapePos[y - 1][x];\n allShapePos[y - 1][x] = null;\n allShapePos[y][x].y += cellSize;\n }\n }\n }\n \n for (let y = i; y > 0; y--) {\n for (let x = 0; x < width; x++) {\n if (allShapePos[y][x] != null) {\n gameBoardData[y][x] = 1;\n } else {\n gameBoardData[y][x] = 0;\n }\n }\n }\n }\n}", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\t// checks to see if the tile is next to the empty square tile\n\tif(Math.abs(otherLeft - left) == TILE_AREA && Math.abs(otherTop - top) == 0) {\n\t\treturn true;\n\t} else if(Math.abs(otherLeft - left) == 0 && Math.abs(otherTop - top) == TILE_AREA) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function remove_cell_from_validation_grid(x, y) {\r\n\t\tgridPlaced[x][y] = '0';\r\n\t}", "function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function drawTileGrid(gameContainer, normalTexture, floodedTexture) {\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tfor (var j = 0; j < 6; j++) {\r\n\t\t\tvar tile = new Tile(normalTexture, floodedTexture, i, j, 'tile_' + i + '_' + j);\r\n\t\t\t// Skip tile positions on first row that need to be blank\r\n\t\t\tif ((i == 0 && j == 0) || (i == 0 && j == 1) || (i == 0 && j == 4) || (i == 0 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on second row that need to be blank\r\n\t\t\tif ((i == 1 && j == 0) || (i == 1 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on fifth row that need to be blank\r\n\t\t\tif ((i == 4 && j == 0) || (i == 4 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on sixth row that need to be blank\r\n\t\t\tif ((i == 5 && j == 0) || (i == 5 && j == 1) || (i == 5 && j == 4) || (i == 5 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Push tile object onto gameboard 2D Array\r\n\t\t\tgameBoard[i][j] = tile;\r\n\t\t\tgameContainer.addChild(tile);\r\n\t\t}\r\n\t}\r\n}", "function keepInBounds(el){\n if(el.x + el.w >= canvas.width){\n el.x = canvas.width - el.w;\n }\n else if(el.x <= 0){\n el.x = 0;\n }\n if(el.y >= canvas.height - el.h){\n el.y = canvas.height - el.h;\n }\n else if(el.y <= 0){\n el.y = 0;\n }\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n if(current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition -=1;\n }\n draw();\n }", "function moveRight() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column + 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function moveRight() {\n unDraw();\n const isAtRightEdge = current.some(\n (index) => (currentPosition + index) % xPixel === xPixel - 1\n );\n\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n\n draw();\n }", "function wall3Right() {\n wall3X = wall3X + 0.5;\n if (wall3X > 0) { //when leftmost part of wall3 exceeds 0, reset wall3X to -1200\n wall3X = -1200;\n }\n}", "printBoard() {\n // This will print the board\n let grid = [...this.grid];\n \n // Loop through the values in the grid and set the tiles appropriately\n // Pass in the values to set its color in setTile()\n for (let i = 0; i < grid.length; i++) {\n for (let j = 0; j < grid.length; j++) { \n if(grid[i][j] === 0){\n // If grid tile === 0\n if((i===0 && (j===1 || j===2)) ){\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],'UP')\n } else if ((i === 3 && (j === 1 || j === 2))){\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j],\"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j], \"RIGHT\");\n }else{\n this.setTile(this.boardDisplay, this.blockWidth, i, j, true, this.grid, grid[i][j]);\n }\n \n }else{\n // If doesnt equal 0 then place value in rect\n\n if ((i === 0 && (j === 1 || j === 2))) {\n // If one of the two middle top tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], 'UP')\n } else if ((i === 3 && (j === 1 || j === 2))) {\n // If one of the two bottom tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"DOWN\");\n } else if ((j === 0 && (i === 1 || i === 2))) {\n // If one of the two left tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"LEFT\");\n } else if ((j === 3 && (i === 1 || i === 2))) {\n // If one of the two right tiles pressed\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j], \"RIGHT\");\n } else {\n this.setTile(this.boardDisplay, this.blockWidth, i, j, false, this.grid, grid[i][j]);\n }\n } \n }\n }\n if(!this.printedBoard){\n // Displays the elements only needed to be set once (SCORE BANNER)\n this.scoresControlsContainer.append('div').attr('id', 'score-banner');\n d3.select('#score-banner').append('h3').text('SCORE');\n d3.select('#score-banner').append('p').attr('id','score-value'); // Shows score, changed in printBoard()\n this.printedBoard = true; // Prevent this if block from being printed again (unless new game)\n }\n // Change the score display to the current score\n d3.select('#score-value').text(this.score+\"\")\n\n\n\n }", "function drawTiles(){\n for (var i = 0; i < ground.length; i++){\n image(tile, ground[i], 320);\n \n ground[i] -= 1;\n \n if (ground[i] <= -50){\n ground[i] = width;\n }\n }\n\n}", "checkSides() {\n return !( //Checks if any of the blocks hit the right side of the screen.\n this.x + this.activeshape[this.rotation][0].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][1].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][2].x >= this.canvaswidth / this.blockSize ||\n this.x + this.activeshape[this.rotation][3].x >= this.canvaswidth / this.blockSize ||\n\n //Checks if any of the blocks hit the left side of the screen.\n this.x + this.activeshape[this.rotation][0].x < 0 ||\n this.x + this.activeshape[this.rotation][1].x < 0 ||\n this.x + this.activeshape[this.rotation][2].x < 0 ||\n this.x + this.activeshape[this.rotation][3].x < 0\n );\n }", "clearGrid() {\n for(let col = 0; col < this.width; col++) {\n for(let row = 0; row < this.height; row++) {\n this.grid[col][row] = DEAD;\n }\n }\n }", "handleCollRight(obj, tileRight) {\n if (obj.left < tileRight && obj.leftOld >= tileRight) {\n obj.left = tileRight;\n obj.velX = 0;\n return true;\n }\n return false;\n }", "function tilingWhite() {\n let x = 60;\n let y = 0; // before y = 60\n\n for (let i = 0; i < tileWhite.segmentsY; i++) {\n if (i % 2 === 0) {\n x = 60; // before x = 90;\n }\n else {\n x = 0; //before x = 150;\n }\n // Draws horizontal tiles\n for (let j = 0; j < tileWhite.segmentsX; j++) {\n push();\n noStroke();\n fill(tileWhite.fill.r, tileWhite.fill.g, tileWhite.fill.b);\n rect(x,y, tileWhite.size);\n x = x + tileWhite.spacingX;\n pop();\n }\n y = y + tileWhite.spacingY;\n }\n}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "AddTileToCell(tileID, board, sideSwitcher){\r\n\t\t\r\n\t\t\tlet tile = board.FindTileById(tileID);\r\n\t\t\tlet nextOneUpCoords = tile.GetNextOneUpCoords();\r\n\t\t\tlet nextOneUpTile = board.FindTileByCoordinates(nextOneUpCoords.col, nextOneUpCoords.row);\r\n\t\t\tlet victoryCheck = new VictoryCheck();\r\n\t\t\t\r\n\t\t\tlet allCol = board.GetAllTilesInColumn(tile.col);\r\n\t\t\tlet allRow = board.GetAllTilesInRow(tile.row);\r\n\t\t\t\r\n\t\t\tlet allLeftDiags = board.GetLeftDiagonals(tile.col, tile.row);\r\n\t\t\t\r\n\t\t\tconsole.log(allLeftDiags);\r\n\t\t\t\r\n\t\t\tlet allRightDiags;\r\n\t\t\t\r\n\t\t\tfor(let a = allCol.length-1; a > -1; a--){\r\n\t\t\t\t\r\n\t\t\t\tif(allCol[a].occupationCode == 0){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sideSwitcher.currentTurn == 1){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList = \"\";\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList.add(\"redCounter\");\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).setAttribute(\"data-occupationcode\", sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tallCol[a].ChangeOccupationCode(sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sideSwitcher.currentTurn == 2){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList = \"\";\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList.add(\"blueCounter\");\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).setAttribute(\"data-occupationcode\", sideSwitcher.currentTurn);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tallCol[a].ChangeOccupationCode(sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tboard.UpdateTile(allCol[a]);\r\n\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t} \t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//\tCheck for vertical win \r\n\t\t\tvictoryCheck.CheckVictory(allRow, sideSwitcher.currentTurn);\r\n\t\t\t\r\n\t\t\t//\tCheck for a horizontal win \r\n\t\t\tvictoryCheck.CheckVictory(allCol, sideSwitcher.currentTurn);\r\n\t\t\t\r\n\r\n\t\t\tsideSwitcher.ChangeTurn();\r\n\t\r\n\t\t\r\n\t\t}", "drawBoard() {\n for (let y = 0; y < this.tetris.board.height; y++) {\n for (let x = 0; x < this.tetris.board.width; x++) {\n let id = this.tetris.board.getCell(x, y);\n if (id !== this.tetris.board.EMPTY) {\n this.drawBlock(this.ctxGame, id, x * this.size, y * this.size);\n }\n }\n }\n }", "wrap() {\n if (this.x > width) {\n this.x -= width;\n }\n }", "function clearGrid() {\n for (let i = 0; i < numRectanglesWide; i++) {\n for (let j = 0; j < numRectanglesHigh; j++) {\n setAndPlotRectangle(i, j, false);\n }\n }\n }", "function getValidSpace(col, row, tileVal) {\n\n tileVal = tileVal || 0;\n\n if (row >= boardSize || col >= boardSize || row < 0 || col < 0) {\n return null;\n }\n var space = (row * boardSize) + col;\n\n if (game.board[space] == tileVal) {return space;}\n return null;\n }", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\r\n // allows shape to move right if it's not at the right position\r\n if (!isAtRightEdge) currentPosition += 1;\r\n\r\n // push it unto a tetrimino that is already on the right edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition -= 1;\r\n\r\n }\r\n draw();\r\n}", "createFullGround() {\n\t\tfor (let i=0; i<this.game.width; i=i+this.tileSize) {\n\t\t\tthis.addTile(i);\n\t\t}\n\t}", "evaluate(tile) {\n let tileLen = $(\"#row\").val() * $(\"#col\").val();\n let placedRight = 0;\n for (let j = 0; j < tile.length; j++) {\n if (`tile t${j}` === tile[j].className) {\n placedRight++;\n if (tileLen - 1 == placedRight) {\n $(\"#info\").html(\"Solved!\");\n $(`.tile.t${tileLen - 1}`).css({ \"opacity\": 1 });\n $(\".tile\").off(\"click\");\n }\n }\n }\n }", "function shiftNodesToEmptySpaces() {\n workflowDiagram.selection.each((node) => {\n if (!(node instanceof go.Node)) return;\n while (true) {\n const exist = workflowDiagram.findObjectsIn(node.actualBounds,\n obj => obj.part,\n part => part instanceof go.Node && part !== node,\n true,\n ).first();\n if (exist === null) break;\n node.position = new go.Point(\n node.actualBounds.x, exist.actualBounds.bottom + 10,\n );\n }\n });\n }", "_moveRightInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = 0;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n this._offset = this._calcDisplayedItemsTotalWidth() -\n (this._settings.neighborsVisibleWidth + this._calcOppositeRight());\n this._itemsHolder.style.transform = `translateX(${ this._offset + this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveRight(), this._settings.oppositeSideAppearDelay);\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function rewX() {\n while (rect.origin.x > box.left) {\n rect.origin.x -= img_width;\n }\n }", "function drawTile2() {\n ctx.clearRect(165, 125, 65, 70);\n ctx.fillStyle = palette[2][2];\n ctx.fillRect(165, 125, 65, 70)\n }", "function resetCan() {\n clear();\n curr = make2DArr(width, height);\n prev = make2DArr(width, height);\n background(0);\n}", "function emptyBoardRect(x, y) {\n ctx.beginPath();\n ctx.clearRect(x, y, rectLength, rectLength);\n ctx.rect(x, y, rectLength, rectBreadth);\n ctx.strokeStyle = \"#000000\";\n ctx.stroke();\n ctx.closePath();\n}", "_safeCell(x, y) {\n if (x < 0 || x >= this.width) return false\n if (y < 0 || y >= this.height) return false\n return true\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "checkEdge(displayWidth, displayHeight){\n if(this.x < 0){\n this.x = displayWidth;\n }\n else if(this.x > displayWidth){\n this.x = 0;\n }\n if(this.y < 0){\n this.y = displayHeight;\n }\n else if(this.y > displayHeight){\n this.y = 0;\n }\n }", "newTile(board) {\n let num = this.getRandom(this.boardSize);\n let r = Math.random();\n do {\n num = this.getRandom(this.boardSize);\n } while (board[num] != 0);\n if (r < 0.9) {\n board[num] = 2;\n } else {\n board[num] = 4;\n }\n }", "function rookAndQueenValidSpaces(currentTile) {\n let i = currentTile + 1;\n let spaces = [];\n while(getTileNumber(i) != 1) {\n spaces.push(i);\n i += 1;\n }\n i = currentTile + 8;\n while(i < 65) {\n spaces.push(i);\n i += 8;\n }\n i = currentTile - 1;\n // Need i > 0 specifically for decrementing i but not incrementing\n // Results in infinite loop without it\n while(getTileNumber(i) != 8 && i > 0) {\n spaces.push(i);\n i -= 1;\n }\n i = currentTile - 8;\n while(i > 0) {\n spaces.push(i);\n i -= 8;\n }\n return spaces;\n}", "function FixNonVisible(context) {\n\t// 64x32 and 64x64 skin parts\n\tcontext.clearRect(0, 0, 8, 8);\n\tcontext.clearRect(24, 0, 16, 8);\n\tcontext.clearRect(56, 0, 8, 8);\n\tcontext.clearRect(0, 16, 4, 4);\n\tcontext.clearRect(12, 16, 8, 4);\n\tcontext.clearRect(36, 16, 8, 4);\n\tcontext.clearRect(52, 16, 4, 4);\n\tcontext.clearRect(56, 16, 8, 32);\n\t\n\t// 64x64 skin parts\n\tcontext.clearRect(0, 32, 4, 4);\n\tcontext.clearRect(12, 32, 8, 4);\n\tcontext.clearRect(36, 32, 8, 4);\n\tcontext.clearRect(52, 32, 4, 4);\n\tcontext.clearRect(0, 48, 4, 4);\n\tcontext.clearRect(12, 48, 8, 4);\n\tcontext.clearRect(28, 48, 8, 4);\n\tcontext.clearRect(44, 48, 8, 4);\n\tcontext.clearRect(60, 48, 8, 4);\n}", "function rewX() {\n\t while (rect.origin.x > box.left) {\n\t rect.origin.x -= img_width;\n\t }\n\t }", "function plotTankCleanly(col, row) {\r\n if (grid[col][row] === 0) {\r\n createEnemy(col * CELL, row * CELL);\r\n } else {\r\n console.log(`X: ${col}, Y: ${row} square occupied`);\r\n if (row < 10)\r\n plotTankCleanly(col, row + 1);\r\n else\r\n plotTankCleanly(col, row - 1);\r\n } \r\n}", "createRoom(x, y, width, height) {\n for (let i = -1; i <= width; i++) {\n for (let j = -1; j <= height; j++) {\n //if i == -1 || i == width - create boundary\n if(i == -1 || i == width) {\n //if we are at the topwest corner\n if(j == -1 && i == -1) {\n this.setTile(0, x+i, y+j, 3);\n } \n //if we are at the topeast corner\n else if (i == width && j == -1) {\n this.setTile(0, x+i, y+j, 5);\n }\n //if we are at either of the vertical areas (not corners)\n else if (j >= 0 && j < height) {\n this.setTile(0, x+i, y+j, 6);\n } \n //if we are at the bottomwest corner\n else if (i == -1 && j == height) {\n this.setTile(0, x+i, y+j, 7);\n } \n //if we are at the bottomeast corner\n else if (i == width && j == height) {\n this.setTile(0, x+i, y+j, 8);\n }\n\n //set collision tile\n this.setTile(1, x+i, y+j, 1);\n }\n //if we inside the room (x-wise)\n else if (i >= 0 && i < width) {\n //if we are at the y bottom\n if (j == height) {\n this.setTile(0, x+i, y+j, 4);\n this.setTile(1, x+i, y+j, 1);\n }\n //if we are at the y top\n else if(j == -1) {\n this.setTile(0, x+i, y+j, 4);\n this.setTile(1, x+i, y+j, 1);\n } \n //else create floor\n else {\n this.setTile(0, x+i, y+j, 1);\n }\n }\n }\n }\n }", "function randomiseTiles(){\n\t\trandomiseArray(tiles);\n\t\tvar i;\n\t\tfor(i = 0; i < tiles.length; i++){\n\t\t\ttiles[i].x = -border + Math.random() * (maskRect.width - scale);\n\t\t\ttiles[i].y = ROWS * scale + Math.random() * (trayDepth - scale);\n\t\t\tdiv.appendChild(tiles[i].div);\n\t\t\ttiles[i].update();\n\t\t}\n\t}", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "placeEnd(levelIndex) {\n let pos = this.breadthFirst();\n for (let j = pos.y + 5; j >= pos.y - 5; j--) {\n for (let i = pos.x + 5; i >= pos.x - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n if (levelIndex % 2 === 0) {\n this.tiles[pos.y][pos.x] = 'End';\n } else {\n this.tiles[pos.y][pos.x] = 'Start';\n }\n }", "function resetBoard() {\n board = [];\n $(__BOARD__).children().remove();\n let nbTilesBuilt = 0;\n let arrayTmp = [];\n board.push(arrayTmp);\n let index1D = 0;\n let index2D = -1;\n while(nbTilesBuilt < nbTiles) {\n if(index2D !== 0 && index2D % (nbColumns - 1) === 0) {\n arrayTmp = [];\n board.push(arrayTmp);\n index1D++;\n index2D = 0;\n } else {\n index2D++;\n }\n arrayTmp.push(__BLACK_TILE_CLASS__);\n $(__BOARD__).append(\"<div data-index-1d='\" + index1D + \"' data-index-2d='\" + index2D + \"' class='\" + __BLACK_TILE_CLASS__ +\n \"' style='width:\"+ sizeTile +\"px; height:\"+ sizeTile +\"px;'></div>\");\n nbTilesBuilt++;\n }\n}", "handleWrapping() {\n // When the snow goes off screen, more will come down\n if (this.y > height) {\n this.x = random(0, width);\n this.y -= height;\n }\n }", "_safeCell(x, y) {\r\n if (x < 0 || x >= this.grid.length) return false\r\n if (y < 0 || y >= this.grid[x].length) return false\r\n return true\r\n }", "function shiftDown(){\r\n for(let r = 4; r < 24; r++){\r\n for(let c = 0; c < 10; c++){\r\n if (board[r][c] !== \"#ffffff\" && (r+1<24)){\r\n if(board[r+1][c] === \"#ffffff\"){\r\n board[r+1][c] = board[r][c];\r\n board[r][c] = \"#ffffff\";\r\n }\r\n }\r\n }\r\n }\r\n checkForSpace();\r\n}", "trimLoadedTiles() {\n this._cache.trim();\n }" ]
[ "0.6677942", "0.6524666", "0.6500134", "0.64232445", "0.6380648", "0.63684976", "0.62648344", "0.6247605", "0.62409747", "0.6210571", "0.6178751", "0.61766344", "0.6162244", "0.61588746", "0.6158244", "0.61513054", "0.6140652", "0.6139852", "0.6134956", "0.6134351", "0.61339283", "0.61337733", "0.6126151", "0.6087438", "0.60078096", "0.5995646", "0.5994578", "0.599448", "0.5990182", "0.5985344", "0.5980102", "0.59794503", "0.5976219", "0.5969441", "0.5964337", "0.5961018", "0.59583205", "0.5952975", "0.594387", "0.5937489", "0.59006214", "0.5892575", "0.5880096", "0.5874494", "0.5874494", "0.58644384", "0.5864193", "0.58497375", "0.5836773", "0.58334047", "0.58289707", "0.5820832", "0.5813236", "0.5810887", "0.58035034", "0.5799778", "0.57979804", "0.579021", "0.5777741", "0.5776571", "0.57723016", "0.576877", "0.5767092", "0.57655984", "0.5764228", "0.5764055", "0.5762951", "0.57603556", "0.57582474", "0.5753795", "0.5749799", "0.5746293", "0.5741228", "0.5736093", "0.5729751", "0.5727427", "0.5722692", "0.5716781", "0.5716781", "0.5716781", "0.5714863", "0.57133067", "0.56905484", "0.566149", "0.5658548", "0.5656568", "0.56518817", "0.5646785", "0.56439495", "0.5639387", "0.56393635", "0.5630693", "0.56251377", "0.56226087", "0.5620475", "0.56194997", "0.56194687", "0.5619448", "0.56168103", "0.5616419" ]
0.5888432
42
Move A SINGLE tile downward
function moveTileDown(row, column) { //This happens as soon as the player makes a move if (checkRemove(row + 1, column)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "top": "+=" + shiftValue }, 80, "linear", function () { //This happens at the end of each tile's movement if (checkRemove(row + 1, column)) { $(tileArray[row + 1][column]).remove(); tileArray[row + 1][column] = null; } else { tileArray[row + 1][column].setAttribute("id", "tile-" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4)); } }); tileArray[row + 1][column] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\n }", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(row, column);\n }\n }\n }\n }", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "moveDown() {\n dataMap.get(this).moveY = 5;\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "moveUp() {\n dataMap.get(this).moveY = -5;\n }", "function moveDown() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.row++;\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();\n }\n }", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function moveTileUp(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row - 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row - 1, column)) {\n $(tileArray[row - 1][column]).remove();\n tileArray[row - 1][column] = null;\n } else {\n tileArray[row - 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row - 1][column].id.slice(5)) - 4));\n }\n });\n tileArray[row - 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveDown() {\n undraw(); //undraw tetromino\n currentPosition += width; //change reference point to one row down\n draw(); //draw the tetromino \n freeze(); \n }", "function moveDown() {\n let prevCol;\n let curCol;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight; y++) {\n if (y === 0) {\n prevCol = get(x * sizeBlock + 1, (sizeHeight - 1) * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "moveDown() {\n this.y<332?this.y+=83:false;\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "function moveDown(){\n undraw();\n currentPosition += width;\n draw();\n freeze();\n }", "function moveDown(){\n undraw()\n currentPosition += width\n // gameOver()\n draw()\n freeze()\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function tileClick() {\n\tmoveOneTile(this);\n}", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveTileRight(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column + 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column + 1)) {\n $(tileArray[row][column + 1]).remove();\n tileArray[row][column + 1] = null;\n } else {\n tileArray[row][column + 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1));\n }\n });\n tileArray[row][column + 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveDown() {\r\n undraw();\r\n currentPosition += width;\r\n draw();\r\n freeze();\r\n }", "moveUp() {\n const nextRow = this.row - 1;\n const nextColumn = this.col;\n\n if (\n !this.game.maze.layout[nextRow][nextColumn] &&\n !this.game.maze.layout[nextRow][nextColumn + 1]\n ) {\n this.row = nextRow;\n }\n }", "moveUp(){\n this.y -= 7;\n }", "teleportTo(x,y){\r\n // Remove from current tile\r\n let currentTile = this.field.getTile(this.x, this.y);\r\n if (currentTile) currentTile.creature = null;\r\n // Update the stored position\r\n this.x = x;\r\n this.y = y;\r\n // Move the image\r\n let landingTile = this.field.getTile(this.x, this.y);\r\n if(landingTile.image) landingTile.image.append(this.image);\r\n landingTile.creature = this;\r\n }", "function moveTilesUp() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 1; row <= 3; row++) {\n if (checkAbove(row, column) && tileArray[row][column] != null) {\n moveTileUp(row, column);\n }\n }\n }\n }", "function move_down() {\n\t check_pos(); \n\t blob_pos_y = blob_pos_y + move_speed;\n\t}", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function moveDown() {\n\t\tfor (col = 0; col < Cols; col++) {\n\t\t\tarrayRow = new Array(Cols);\n\t\t\tfor (row = 0; row < Rows; row++) {\n\t\t\t\tarrayRow[row] = matrix[Rows - 1 - row][col];\n\t\t\t}\n\t\t\tvar temp = newArray(arrayRow).reverse();\n\t\t\tfor (var i = 0; i < Rows; i++) {\n\t\t\t\tmatrix[i][col] = temp[i];\n\t\t\t}\n\t\t}\n\n\t\tdraw();\n\t}", "move() {\n this.x = this.x - 7\n }", "function moveDown() {\n undraw()\n currentPosition += width\n draw()\n freeze()\n}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "moveUp() {\n this.y>0?this.y-=83:false;\n }", "moveUpNext() {\r\n this.movement.y = -this.speed;\r\n this.move();\r\n }", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "goDown() {\n\t\tthis.setFloor(this.getFloor() - 1);\n\t}", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "moveTile(pointer) {\n // if we can move...\n if (this.canMove) {\n // determine column according to input coordinate and tile size\n let column = Math.floor(pointer.x / this.tileSize);\n\n // get the ditance from current player tile and destination\n let distance = Math.floor(\n Math.abs(column * this.tileSize - this.player.x) / this.tileSize\n );\n\n // did we actually move?\n if (distance > 0) {\n // we can't move anymore\n this.canMove = false;\n\n // tween the player to destination tile\n this.tweens.add({\n targets: [this.player],\n x: column * this.tileSize,\n duration: distance * 30,\n callbackScope: this,\n onComplete: function() {\n // at the end of the tween, check for tile match\n this.checkMatch();\n },\n });\n }\n }\n }", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "moveRight() {\n dataMap.get(this).moveX = 5;\n }", "function move(dir)\n\t{\n\t\tif (unit.movePoints == 0) return;\t\t// no movepoints left\n\n\t\t// determine destination tile\n\t\tvar x = this.x, y = this.y;\n\t\tswitch (dir)\n\t\t{\n\t\t\tcase 0: y-=2; break;\t\t\t\t\t\t// straight up (y - 2)\n\t\t\tcase 1: x=y%2==0?x:x+1; y--; break;\t\t\t// upper right\n\t\t\tcase 2: x++; break;\n\t\t\tcase 3: x=y%2==0?x:x+1; y++; break;\n\t\t\tcase 4: y+=2; break;\n\t\t\tcase 5: x=y%2==0?x-1:x; y++; break;\n\t\t\tcase 6: x--; break;\n\t\t\tcase 7: x=y%2==0?x-1:x; y--; break;\n\t\t}\n\n\t\t// check if the destination tile is ok\n\t\tif (!isTileMoveable(x,y)) return;\n\n\t\tunit.div.removeClass(\"selected\").css(\"opacity\", 1);\n\n\t\tunit.x = x;\n\t\tunit.y = y;\n\t\tunit.movePoints--;\n\t\tupdate();\n\t}", "moveUp() {\n if (this.y === 0) {\n this.y = this.tape.length - 1;\n } else {\n this.y--;\n }\n }", "function swapTile(row, column) {\r\n\t\r\n\tvar currentTD = tableRowColumn[row][column];\r\n\tvar currentCard = cardsRowColumn[row][column];\r\n\tvar leftCard = column-1;\r\n\tvar rightCard = column+1;\r\n\tvar upCard = row-1;\r\n\tvar downCard = row+1;\r\n\t\r\n\t//Up\r\n\tif (row != 0 && cardsRowColumn[upCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[upCard][column];\r\n\t\tvar nextCard = cardsRowColumn[upCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[upCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Down\r\n\tif (row != 3 && cardsRowColumn[downCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[downCard][column];\r\n\t\tvar nextCard = cardsRowColumn[downCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[downCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Right\r\n\tif (column != 3 && cardsRowColumn[row][rightCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][rightCard];\r\n\t\tvar nextCard = cardsRowColumn[row][rightCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][rightCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Left\r\n\tif (column != 0 && cardsRowColumn[row][leftCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][leftCard];\r\n\t\tvar nextCard = cardsRowColumn[row][leftCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][leftCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Check if solved, and if solved, change h1 to display congratulations\r\n\tif (cardsRowColumn[0][0] == \"1\"\r\n\t\t&& cardsRowColumn[0][1] == \"2\"\r\n\t\t&& cardsRowColumn[0][2] == \"3\"\r\n\t\t&& cardsRowColumn[0][3] == \"4\"\r\n\t\t&& cardsRowColumn[1][0] == \"5\"\r\n\t\t&& cardsRowColumn[1][1] == \"6\"\r\n\t\t&& cardsRowColumn[1][2] == \"7\"\r\n\t\t&& cardsRowColumn[1][3] == \"8\"\r\n\t\t&& cardsRowColumn[2][0] == \"9\"\r\n\t\t&& cardsRowColumn[2][1] == \"10\"\r\n\t\t&& cardsRowColumn[2][2] == \"11\"\r\n\t\t&& cardsRowColumn[2][3] == \"12\"\r\n\t\t&& cardsRowColumn[3][0] == \"13\"\r\n\t\t&& cardsRowColumn[3][1] == \"14\"\r\n\t\t&& cardsRowColumn[3][2] == \"15\"\r\n\t\t&& cardsRowColumn[3][3] == \"-1\") {\r\n\t\theader1.innerText = \"Congratulations, you completed the puzzle!\";\r\n\t\tmoves.innerText = totalMoves;\r\n\t\tmoveCounter.innerText = \"Total number of moves used:\";\r\n\t}\r\n}", "shift() {\n if (this.isDropping) {\n for (var i = 0; i < this.enemies.length; i++) {\n this.enemies[i].position.y += this.speed;\n }\n //reverses direction\n this.dir *= -1;\n this.isDropping = false;\n } else {\n for (var i = 0; i < this.enemies.length; i++) {\n if (this.dir === -1) {\n this.enemies[i].position.x -= this.speed;\n }\n if (this.dir === 1) {\n this.enemies[i].position.x += this.speed;\n }\n }\n }\n }", "moveDown(amount){\n var initRow = this.index.row;\n this.index.row+=amount;\n this.gameObject.setTint(this.identifier.color);\n this.moveData.push({\n from: {x: this.gameObject.x, y:this.gameObject.y},\n to: {x: this.x + ((initRow + 1)%2 * this.board.hexWidth/2), y: this.y + this.board.vertOffset}\n });\n //generates all of the positions that it will go on it's way movinf down\n //I can then interpolate between each of these positions\n for(var i = 1; i< amount; i++){\n this.moveData.push({\n from: {x: this.moveData[i-1].to.x, y: this.moveData[i-1].to.y},\n to: {x: this.x + ((initRow + i+1 )%2 * this.board.hexWidth/2), y: this.y + (i+1) * this.board.vertOffset}\n });\n }\n this.offset =(this.index.row%2 * this.board.hexWidth/2);\n\n this.assocText.setText(\"\");\n this.y += amount * this.board.vertOffset\n this.addToBoardAnim();\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "function moveDown() {\n undraw()\n curPos += width\n draw()\n freeze()\n }", "move(direction) {\n // NOTE: West movement should -- and east should ++. Need to work on map orientation\n if (direction === \"north\" && this.currentCell.hasLink(this.currentCell.north) === true) {\n //alert(\"north\");\n this.y++;\n this.currentCell = this.currentCell.north;\n }\n if (direction === \"west\" && this.currentCell.hasLink(this.currentCell.west) === true) {\n //alert(\"west\");\n this.x--;\n this.currentCell = this.currentCell.west;\n }\n if (direction === \"south\" && this.currentCell.hasLink(this.currentCell.south) === true) {\n //alert(\"south\");\n this.y--;\n this.currentCell = this.currentCell.south;\n }\n if (direction === \"east\" && this.currentCell.hasLink(this.currentCell.east) === true) {\n //alert(\"east\");\n this.x++;\n this.currentCell = this.currentCell.east;\n }\n }", "onKeyDown(event){\r\n let movable = 1;\r\n\tswitch(event.keyCode){\r\n\t\tcase cc.macro.KEY.down:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y + this.rate) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.y += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.up:\r\n\t\t\tthis.node.anchorX = 0;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + i, this.tiledTile.y - this.rate - this.size + 1) != 0 ) )\r\n movable = 0;\r\n } \r\n\t\t\tthis.tiledTile.y += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.left:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) ||\r\n\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x - this.rate, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += -this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tcase cc.macro.KEY.right:\r\n\t\t\tthis.node.anchorX = -0.5;\r\n\t\t\t// 如果前进的方向上有障碍物,则不移动\r\n\t\t\tfor (var i=0;i < this.size;i++){\r\n if( (this.Grass.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Wall.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Ornament.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) ||\r\n\t\t\t (this.Shelf.tiledLayer.getTileGIDAt(this.tiledTile.x + this.rate + this.size - 1, this.tiledTile.y - i) != 0 ) )\r\n movable = 0;\r\n }\r\n\t\t\tthis.tiledTile.x += this.rate * movable;\r\n\t\t\tbreak;\r\n\t\tdefault:\r\n\t\t\tbreak;\t\t\t\r\n\t}\r\n}", "function moveDown()\r\n {\r\n undraw()\r\n currentPosition += width\r\n draw()\r\n freeze()\r\n addScore()\r\n gameOver()\r\n }", "function moveTo(x, y) {\r\n var t = currentmap.getTile(x, y);\r\n if (t) {\r\n if (!t.doesCollide) {\r\n player.x = x;\r\n player.y = y;\r\n lastMouseX = -1;\r\n lastMouseY = -1;\r\n } else if (t.actionable) {\r\n tileActions[t.id](currentmap, x, y);\r\n }\r\n }\r\n}", "function swapDown(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y + 1, x: blankPOS.x })\n}", "function moveRight () {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) {\n currentPosition += 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n draw()\n }", "moveDown() {\n if (this.y === this.tape.length - 1) {\n this.y = 0;\n } else {\n this.y++;\n }\n }", "function moveRight(){\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition+index)%width === width-1);\n if(!isAtRightEdge) currentPosition +=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition-=1;\n }\n\n draw();\n }", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\n }", "function move_up() {\n\t check_pos();\n\t blob_pos_y = blob_pos_y - move_speed;\n\t}", "function higher(){\n coords.Y-=1\n ground.style = 'transform: translateX(-5000px) translateY(-5000px) translateZ('+coords.Y+'px) rotateZ('+coords.xRot+'deg) translateY('+coords.yMove+'px) translateX('+coords.xMove+'px)'\n}", "moveEnemyDown() {\n const nextCanvasRowY = game.getYOfCanvasRow(this.canvasRow + 1);\n this.moveDownToTarget(nextCanvasRowY);\n }", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "move() {\n if (!this.isOnTabletop()) return;\n let [dx, dy]=FacingOptions.getFacingMoment(this.facing);\n let nx=this.x+dx;\n let ny=this.y+dy;\n if (this.tabletop.isOutOfBoundary(nx, ny)) return;\n this.x=nx;\n this.y=ny;\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function canTileMove (x, y) {\n return ((x > 0 && canSwap(x, y, x-1 , y)) ||\n (x < cols-1 && canSwap(x, y, x+1 , y)) ||\n (y > 0 && canSwap(x, y, x , y-1)) ||\n (y < rows-1 && canSwap(x, y, x , y+1)));\n }", "function moveRight() {\r\n unDraw();\r\n const isAtRightEdge = current.some(\r\n (index) => (currentPosition + index) % width === width - 1\r\n );\r\n if (!isAtRightEdge) currentPosition += 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function myDown(e){\n canvas.onmousemove=myMove;\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some((index) => (currentPosition + index) % width === width - 1);\n if (!isAtRightEdge) currentPosition += 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1;\n }\n draw();\n}", "moveUp(amount) {\n this.y += amount;\n }", "moveUp(amount) {\n this.y += amount;\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "move() {\n //Move the kid to the determined location\n this.x = this.nextMoveX;\n this.y = this.nextMoveY;\n //Check in case the kid touches the edges of the map,\n // if so, prevent them from leaving.\n this.handleConstraints();\n }", "function mooveDown()\n\t\t{\n\t\t\tfor (var i = 0; i <= 4; i++) \n\t\t\t{\n\t\t\t\tfor (var j = 3; j >= 0; j--) \n\t\t\t\t{\n\t\t\t\t\tvar tile = $('body').find('[data-x='+i+'][data-y='+j+']');\n\n\t\t\t\t\tif($(tile).length > 0)\n\t\t\t\t\t\t$(tile).each(function(){ recursiveMouvementDown(i,j, tile) });\n\t\t\t\t}\n\t\t\t}\n\t\t\tcreate(1);\n\t\t}", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "moveRight() {\r\n this.actual.moveRight();\r\n }", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(\r\n index=> (currentPosition + index) % width === width - 1)\r\n \r\n if (!isAtRightEdge) {\r\n currentPosition += 1;\r\n }\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n if(current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition -=1;\n }\n draw();\n }", "move(mapX, mapY) {\n // check if it is a walkable tile\n let walkable = this.dontTreadOnMe();\n if (this.state.healing) {\n walkable[this.state.villager.map[0]-1][this.state.villager.map[1]-1] = 0;\n }\n if (walkable[mapX-1][mapY-1] === 0) {\n // use easy-astar npm to generate array of coordinates to goal\n const startPos = {x:this.state.playerMap[0], y:this.state.playerMap[1]};\n const endPos = {x:mapX,y:mapY};\n const aStarPath = aStar((x, y)=>{\n if (walkable[x-1][y-1] === 0) {\n return true; // 0 means road\n } else {\n return false; // 1 means wall\n }\n }, startPos, endPos);\n let path = aStarPath.map( element => [element.x, element.y]);\n if (this.state.healing) { path.pop() };\n this.setState({moving: true}, () => this.direction(path));\n };\n }", "moveUp(howFar) {\n this.setLastPos();\n this.y -= howFar;\n }", "moveRight() {\n this.shinobiPos.x += 30\n }", "function quickDrop(){\r\n while( !(collision(arena, piece)) ){\r\n piece.pos.y++;\r\n }\r\n piece.pos.y--;\r\n }", "function moveUp() {\n let prevCol;\n let curCol;\n let temp;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight - 1; y++) {\n if (y === sizeHeight - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, (y + 1) * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect(x * sizeBlock, (y + 1) * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "function shift_barriers(x, y) {\n // simply decrease the direction of the tile (keeping it between [0,3]) because the check_tile\n // function takes the tile's rotation into account when figuring out where its barriers are located\n map[y][x]['dir'] = (parseInt(map[y][x]['dir']) + 1) % 4\n //console.log(map[y][x]['dir']);\n}", "function moveRight() {\n undraw()\n\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) currentPosition += 1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n\n draw()\n }", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "moveActualBlockDown () {\n // If any collision occurs - add the block to the landed blocks array\n if (this.checkBlockCollision('down')) {\n this.landBlock()\n this.checkFullRow()\n this.createBlock()\n if (this.checkBlockCollision('down')) {\n this.gameOver = true\n }\n } else {\n this.actualBlock.y -= 1\n }\n }", "move(newDirection) {\n let newHead = new Position(this.head.row, this.head.column);\n this.tail.unshift(newHead);\n this.tail.pop();\n switch (newDirection) {\n case \"N\":\n if (this.head.row == 0) {\n this.head.row = 19;\n } else {\n this.head.row -= 1;\n } break;\n case \"S\":\n if (this.head.row == 19) {\n this.head.row = 0;\n } else {\n this.head.row += 1;\n } break;\n case \"W\":\n if (this.head.column == 0) {\n this.head.column = 23;\n } else {\n this.head.column -= 1;\n } break;\n case \"E\":\n if (this.head.column == 23) {\n this.head.column = 0;\n } else {\n this.head.column += 1;\n } break;\n }\n }", "placeEnd(levelIndex) {\n let pos = this.breadthFirst();\n for (let j = pos.y + 5; j >= pos.y - 5; j--) {\n for (let i = pos.x + 5; i >= pos.x - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n if (levelIndex % 2 === 0) {\n this.tiles[pos.y][pos.x] = 'End';\n } else {\n this.tiles[pos.y][pos.x] = 'Start';\n }\n }", "function moveElDown(row, col) {\n if (row < MATRIX_SIZE.row - 2) {\n matrix[row][col].classList.remove('fill');\n matrix[row + 1][col].classList.add('fill');\n }\n}", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}" ]
[ "0.7703539", "0.7260513", "0.70357674", "0.7021616", "0.697812", "0.6881911", "0.68533874", "0.6827446", "0.6824876", "0.681101", "0.67644966", "0.670336", "0.6680959", "0.66520804", "0.664044", "0.66145885", "0.6565055", "0.65553063", "0.65411097", "0.6536853", "0.6535573", "0.6524386", "0.6509263", "0.6498448", "0.64952993", "0.64595073", "0.6448965", "0.64479214", "0.6445843", "0.6430921", "0.6421501", "0.64207983", "0.641797", "0.64002526", "0.6399135", "0.639651", "0.63704884", "0.63593423", "0.6358997", "0.6336797", "0.6323604", "0.6306659", "0.6256152", "0.6251313", "0.6248463", "0.6245093", "0.62305427", "0.62157404", "0.6212257", "0.61989987", "0.6184175", "0.6181514", "0.61547136", "0.6152287", "0.6129716", "0.61267763", "0.6111693", "0.610589", "0.610501", "0.6101734", "0.60975116", "0.60749733", "0.6069147", "0.60654205", "0.606395", "0.60605884", "0.60582274", "0.6054418", "0.6054143", "0.605347", "0.60534084", "0.6052384", "0.6051347", "0.6044626", "0.60379714", "0.60327464", "0.6032622", "0.6032622", "0.6032279", "0.60295403", "0.6023181", "0.6020914", "0.60202074", "0.6014101", "0.60078245", "0.60075176", "0.60064226", "0.60044426", "0.6003077", "0.5998773", "0.599816", "0.59934926", "0.5982918", "0.5980837", "0.598002", "0.5975391", "0.59730136", "0.596541", "0.59643865", "0.5964203" ]
0.7377649
1
Move A SINGLE tile upward
function moveTileUp(row, column) { //This happens as soon as the player makes a move if (checkRemove(row - 1, column)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "top": "-=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row - 1, column)) { $(tileArray[row - 1][column]).remove(); tileArray[row - 1][column] = null; } else { tileArray[row - 1][column].setAttribute("id", "tile-" + (parseInt(tileArray[row - 1][column].id.slice(5)) - 4)); } }); tileArray[row - 1][column] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "up () {\n let first = this.props.game.getTileList();\n this.props.game.board.moveTileUp();\n let second = this.props.game.getTileList();\n if (this.moveWasLegal(first, second) === false) {\n this.updateBoard();\n return;\n } else {\n this.props.game.placeTile();\n this.updateBoard();\n }\n }", "function moveTile() {\n moveTileHelper(this);\n }", "moveUp() {\n dataMap.get(this).moveY = -5;\n }", "function moveTilesUp() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 1; row <= 3; row++) {\n if (checkAbove(row, column) && tileArray[row][column] != null) {\n moveTileUp(row, column);\n }\n }\n }\n }", "moveUp() {\n const nextRow = this.row - 1;\n const nextColumn = this.col;\n\n if (\n !this.game.maze.layout[nextRow][nextColumn] &&\n !this.game.maze.layout[nextRow][nextColumn + 1]\n ) {\n this.row = nextRow;\n }\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "moveUp() {\n this.y>0?this.y-=83:false;\n }", "function moveUp() {\n let prevCol;\n let curCol;\n let temp;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight - 1; y++) {\n if (y === sizeHeight - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, (y + 1) * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect(x * sizeBlock, (y + 1) * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "moveUp(){\n this.y -= 7;\n }", "function moveTileDown(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row + 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n //This happens at the end of each tile's movement\n if (checkRemove(row + 1, column)) {\n $(tileArray[row + 1][column]).remove();\n tileArray[row + 1][column] = null;\n } else {\n tileArray[row + 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4));\n }\n });\n tileArray[row + 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function move_up() {\n\t check_pos();\n\t blob_pos_y = blob_pos_y - move_speed;\n\t}", "moveUpNext() {\r\n this.movement.y = -this.speed;\r\n this.move();\r\n }", "moveUp(amount) {\n this.y += amount;\n }", "moveUp(amount) {\n this.y += amount;\n }", "function moveUp() {\n\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\tarrayRow = new Array(Cols);\n\t\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\t\tarrayRow[row] = matrix[row][col];\n\t\t\t}\n\t\t\tfor (var i = 0; i < Rows; i++) {\n\t\t\t\tmatrix[i][col] = newArray(arrayRow)[i];\n\t\t\t}\n\t\t}\n\n\t\tdraw();\n\t}", "moveUp() {\n if (this.y === 0) {\n this.y = this.tape.length - 1;\n } else {\n this.y--;\n }\n }", "moveUp(howFar) {\n this.setLastPos();\n this.y -= howFar;\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function moveUp(){\n\t\t\tplayerPosition.x += 1\n\t\t\tplayer.attr({\n\t\t\t\t'cx': playerPosition.x\n\t\t\t})\n\t\t}", "goUp() {\n\t\tthis.setFloor(this.getFloor() + 1);\n\t}", "function moveTilesDown() {\n for (var column = 3; column >= 0; column--) {\n for (var row = 2; row >= 0; row--) {\n if (checkBelow(row, column) && tileArray[row][column] != null) {\n moveTileDown(row, column);\n }\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function torus_up()\t{let temp = grid.shift(); grid.push(temp);}", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "moveDown() {\n dataMap.get(this).moveY = 5;\n }", "function positionFixup(){\n\t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t\t\tvar layout = returnBalanced(maxCols, maxHeight);\n\t\t\tvar t = $('#'+tiles[i]);\n\t\t\tt.attr({\n\t\t\t\t'row': layout[tiles.length-1][i].row(maxHeight),\n\t\t\t\t'col': layout[tiles.length-1][i].col(maxCols),\n\t\t\t\t'sizex': layout[tiles.length-1][i].sizex(maxCols),\n\t\t\t\t'sizey': layout[tiles.length-1][i].sizey(maxHeight)\n\t\t\t});\n\t\t\tvar tile_offset = offset_from_location(parseInt(t.attr('row')), parseInt(t.attr('col')));\n\t\t\tt.css({\n\t\t\t\t\"top\": tile_offset.top,\n\t\t\t\t\"left\":tile_offset.left,\n\t\t\t\t\"width\":t.attr('sizex')*tileWidth,\n\t\t\t\t\"height\":t.attr('sizey')*tileHeight});\n\t\t\tupdate_board(tiles[i]);\n\t\t};\n\t}", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "move() {\n this.x = this.x - 7\n }", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "move(direction) {\n\n if (!this.gameIsOver()) {\n if (direction == \"up\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (up to down)\n for (var j = 0; j < n; j++) { // for each current (j), will walk down (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // below tile, always starts directly below current (j)\n if (matrix[j][i] == 0) { // if current is 0, move down to next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if below is 0, move onto next below\n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != below, move onto next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == below, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find lowest tile & pull it up\n for (var j = 0; j < n - 1; j++) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find lowest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[full][i] != 0) { // if a below tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"left\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = 0; i < n; i++) { // combine everything that needs to be combined (L to R)\n for (var j = 0; j < n - 1; j++) { // for each current (j), will walk right (k) & see if there is a combination for it\n for (var k = j + 1; k < n; k++) { // right tile, always starts directly to the right of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move right to next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if right is 0, move onto next right\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != right, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == right, combine into current & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make right 0\n break;\n }\n }\n }\n }\n\n for (var i = 0; i < n; i++) { // for each tile, find rightmost tile & pull it left (L to R)\n for (var j = 0; j < n - 1; j++) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find rightmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full < n) { // stops iterating at last column\n if (matrix[i][full] != 0) { // if a right tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full + 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n\n this.gameState.board = row; // make board the row array\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n\n return;\n } else if (direction == \"right\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (R to L)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk left (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // left tile, always starts directly to the left of current (j)\n if (matrix[i][j] == 0) { // if current is 0, move onto next current (j)\n break;\n } else if (matrix[i][k] == 0) { // if left is 0, move onto next left\n continue;\n } else if (matrix[i][j] != matrix[i][k]) { // if current != left, move onto next current (j)\n break;\n } else if (matrix[i][j] == matrix[i][k]) { // if current == left, combine & move on\n matrix[i][j] = matrix[i][j] + matrix[i][k];\n this.gameState.score = this.gameState.score + matrix[i][j]; // update score\n matrix[i][k] = 0; // make left 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find leftmost tile & pull it\n for (var j = n - 1; j > 0; j--) {\n if (matrix[i][j] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find leftmost full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[i][full] != 0) { // if a left tile is full\n matrix[i][j] = matrix[i][full]; // replace current with full tile\n matrix[i][full] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n\n this.callCallbacks();\n return;\n\n } else if (direction == \"down\") {\n var matrix = [];\n var row = [];\n var n = this.dimension;\n\n for (var i = 0; i < this.numTiles + 1; i++) {\n if (row.length == n) {\n matrix.push(row);\n row = [];\n }\n row.push(this.gameState.board[i]);\n }\n\n for (var i = n - 1; i > -1; i--) { // combine everything that needs to be combined (down to up)\n for (var j = n - 1; j > 0; j--) { // for each current (j), will walk up (k) & see if there is a combination for it\n for (var k = j - 1; k > -1; k--) { // above tile, always starts directly above current (j)\n if (matrix[j][i] == 0) { // if current is 0, move up next current (j)\n break;\n } else if (matrix[k][i] == 0) { // if above is 0, move onto above \n continue;\n } else if (matrix[j][i] != matrix[k][i]) { // if current != above, move up next current (j)\n break;\n } else if (matrix[j][i] == matrix[k][i]) { // if current == above, combine & move on\n matrix[j][i] = matrix[j][i] + matrix[k][i];\n this.gameState.score = this.gameState.score + matrix[j][i]; // update score\n matrix[k][i] = 0; // make current 0\n break;\n }\n }\n }\n }\n\n for (var i = n - 1; i > -1; i--) { // for each tile, find highest tile & pull it down\n for (var j = n - 1; j > 0; j--) {\n if (matrix[j][i] != 0) { // if current is full, move on\n continue;\n } else { // if current is empty, find highest full tile\n var full = j; // make full equal to current (which we know is empty)\n while (full > -1) { // stops iterating at first column\n if (matrix[full][i] != 0) { // if an above tile is full\n matrix[j][i] = matrix[full][i]; // replace current with full tile\n matrix[full][i] = 0; // make full tile 0\n break;\n } else {\n full = full - 1;\n continue;\n }\n }\n }\n }\n }\n\n row = [];\n for (var i = 0; i < n; i++) { // load matrix into row array\n for (var j = 0; j < n; j++) {\n row.push(matrix[i][j]);\n }\n }\n this.gameState.board = row; // make board the row array\n\n this.addRandomTile();\n\n this.gameState.won = this.gameState.board.includes(2048);\n\n this.gameIsOver();\n this.callCallbacks();\n return;\n }\n }\n }", "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function moveCol6Up(grid) {\n for (let i = 0; i < 48; i++) {\n if ((grid[i].position - 5) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 47;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function moveDown() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.row++;\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function moveCol5Up(grid) {\n for (let i = 0; i < 47; i++) {\n if ((grid[i].position - 4) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 46;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "function mortyUp(){\n\tmUp -= 1;\n\t$('#morty').css('top', mUp+\"em\");\n}", "teleportTo(x,y){\r\n // Remove from current tile\r\n let currentTile = this.field.getTile(this.x, this.y);\r\n if (currentTile) currentTile.creature = null;\r\n // Update the stored position\r\n this.x = x;\r\n this.y = y;\r\n // Move the image\r\n let landingTile = this.field.getTile(this.x, this.y);\r\n if(landingTile.image) landingTile.image.append(this.image);\r\n landingTile.creature = this;\r\n }", "function tileClick() {\n\tmoveOneTile(this);\n}", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "move() {\n if (!this.isOnTabletop()) return;\n let [dx, dy]=FacingOptions.getFacingMoment(this.facing);\n let nx=this.x+dx;\n let ny=this.y+dy;\n if (this.tabletop.isOutOfBoundary(nx, ny)) return;\n this.x=nx;\n this.y=ny;\n }", "function moveCol7Up(grid) {\n for (let i = 0; i < 49; i++) {\n if ((grid[i].position +1) % 7 === 0) {\n grid[i].position -= 7;\n } if ((grid[i].position) < 0) {\n grid[i].position = 48;\n }\n }\n console.log('at end', grid);\n grid.sort(function (a, b) {\n return a.position - b.position;\n });\n setGrid([...grid]);\n }", "moveUp() {\n this.point.y -= this.scrollSpeed;\n }", "shiftUp() {\n for (let row = 0; row < this.height - 1; row++) {\n if (row % 2 === 0) {\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[row][col].setType(this.cells[row + 1][col].type);\n }\n this.cells[row][this.width - 1].setType(BeadType.default);\n } else {\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[row][col].setType(this.cells[row + 1][col + 1].type);\n }\n }\n }\n for (let col = 0; col < this.width - 1; col++) {\n this.cells[this.height - 1][col].setType(BeadType.default);\n }\n }", "function moveUp(){\n \n playerTank.body.velocity.y = -120;\n playerTank.animations.play('up');\n direction = 'up';\n playerTank.body.velocity.x = 0;\n}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function swapUp(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y - 1, x: blankPOS.x })\n}", "moveItemUp(itemId){\n let index = -1;\n for(let i = 0; i < this.items.length; i++){\n if(this.items[i].id === Number(itemId)){\n index = i;\n break;\n }\n }\n let tempItem = this.items[index - 1];\n this.items[index - 1] = this.items[index];\n this.items[index] = tempItem;\n }", "function moveItemUp(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tif (row.id.slice(0, row.id.indexOf(\"-\")) === \"base\") {\n\t\tmoveType(baseItems.types, cells[2].innerHTML, \"+\");\n\t} else {\n\t\tmoveType(optionalItems.types, cells[2].innerHTML, \"+\");\n\t}\n\tpopulateInventory();\n\tsyncToStorage();\n}", "function increaseTile(x, y) {\n if (board[x][y] === -1) return;\n board[x][y] += 1;\n}", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "function movedown(){\n undraw();\n currentposition+=GRID_WIDTH;\n draw();\n freeze();\n console.log(down);\n }", "function moveDown() {\n undraw(); //undraw tetromino\n currentPosition += width; //change reference point to one row down\n draw(); //draw the tetromino \n freeze(); \n }", "function swapTile(row, column) {\r\n\t\r\n\tvar currentTD = tableRowColumn[row][column];\r\n\tvar currentCard = cardsRowColumn[row][column];\r\n\tvar leftCard = column-1;\r\n\tvar rightCard = column+1;\r\n\tvar upCard = row-1;\r\n\tvar downCard = row+1;\r\n\t\r\n\t//Up\r\n\tif (row != 0 && cardsRowColumn[upCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[upCard][column];\r\n\t\tvar nextCard = cardsRowColumn[upCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[upCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Down\r\n\tif (row != 3 && cardsRowColumn[downCard][column] == -1){\r\n\t\tvar nextTD = tableRowColumn[downCard][column];\r\n\t\tvar nextCard = cardsRowColumn[downCard][column];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[downCard][column] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Right\r\n\tif (column != 3 && cardsRowColumn[row][rightCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][rightCard];\r\n\t\tvar nextCard = cardsRowColumn[row][rightCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][rightCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Left\r\n\tif (column != 0 && cardsRowColumn[row][leftCard] == -1){\r\n\t\tvar nextTD = tableRowColumn[row][leftCard];\r\n\t\tvar nextCard = cardsRowColumn[row][leftCard];\r\n\t\tconsole.log(\"nextCard: \" + nextCard);\r\n\t\tcurrentTD.innerHTML = \"<div class=\\\"puzzleBlank hoverpiece\\\">\"+\"16\"+\"</div>\";\r\n\t\tnextTD.innerHTML = \"<div class=\\\"\" + chosenPuzzle + \" piece\"+currentCard+\" hoverpiece\\\">\"+currentCard+\"</div>\";\r\n\t\tcardsRowColumn[row][column] = \"-1\";\r\n\t\tcardsRowColumn[row][leftCard] = currentCard;\r\n\t\ttotalMoves = totalMoves + 1;\r\n\t\tmoves.innerText = totalMoves;\r\n\t}\r\n\t//Check if solved, and if solved, change h1 to display congratulations\r\n\tif (cardsRowColumn[0][0] == \"1\"\r\n\t\t&& cardsRowColumn[0][1] == \"2\"\r\n\t\t&& cardsRowColumn[0][2] == \"3\"\r\n\t\t&& cardsRowColumn[0][3] == \"4\"\r\n\t\t&& cardsRowColumn[1][0] == \"5\"\r\n\t\t&& cardsRowColumn[1][1] == \"6\"\r\n\t\t&& cardsRowColumn[1][2] == \"7\"\r\n\t\t&& cardsRowColumn[1][3] == \"8\"\r\n\t\t&& cardsRowColumn[2][0] == \"9\"\r\n\t\t&& cardsRowColumn[2][1] == \"10\"\r\n\t\t&& cardsRowColumn[2][2] == \"11\"\r\n\t\t&& cardsRowColumn[2][3] == \"12\"\r\n\t\t&& cardsRowColumn[3][0] == \"13\"\r\n\t\t&& cardsRowColumn[3][1] == \"14\"\r\n\t\t&& cardsRowColumn[3][2] == \"15\"\r\n\t\t&& cardsRowColumn[3][3] == \"-1\") {\r\n\t\theader1.innerText = \"Congratulations, you completed the puzzle!\";\r\n\t\tmoves.innerText = totalMoves;\r\n\t\tmoveCounter.innerText = \"Total number of moves used:\";\r\n\t}\r\n}", "function moveUp(){ \n //paintSnake(x,10,\"#9c9\");\n paintSnake(x,y+10,\"#9c9\");\n paintSnake(x,y,\"black\");\n y = y - 10;\n return y;\n }", "function moveDown() {\n let prevCol;\n let curCol;\n\n for(x = 0; x < sizeWidth; x++) {\n for(y = 0; y < sizeHeight; y++) {\n if (y === 0) {\n prevCol = get(x * sizeBlock + 1, (sizeHeight - 1) * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "function moveTo(x, y) {\r\n var t = currentmap.getTile(x, y);\r\n if (t) {\r\n if (!t.doesCollide) {\r\n player.x = x;\r\n player.y = y;\r\n lastMouseX = -1;\r\n lastMouseY = -1;\r\n } else if (t.actionable) {\r\n tileActions[t.id](currentmap, x, y);\r\n }\r\n }\r\n}", "function moveUp() {\n bY -= 20; // I decrease Y (move up) on every key press\n}", "function move() {\n\t\tmovePiece(this);\n\t}", "moveTile(pointer) {\n // if we can move...\n if (this.canMove) {\n // determine column according to input coordinate and tile size\n let column = Math.floor(pointer.x / this.tileSize);\n\n // get the ditance from current player tile and destination\n let distance = Math.floor(\n Math.abs(column * this.tileSize - this.player.x) / this.tileSize\n );\n\n // did we actually move?\n if (distance > 0) {\n // we can't move anymore\n this.canMove = false;\n\n // tween the player to destination tile\n this.tweens.add({\n targets: [this.player],\n x: column * this.tileSize,\n duration: distance * 30,\n callbackScope: this,\n onComplete: function() {\n // at the end of the tween, check for tile match\n this.checkMatch();\n },\n });\n }\n }\n }", "function moveRocketUp(target){\n\n target.style.order = '-1' + clickCount;\n clickCount++;\n \n console.log('clicked')\n}", "function moveDown(){\n undraw()\n currentPosition += width\n // gameOver()\n draw()\n freeze()\n }", "moveDown() {\n this.y<332?this.y+=83:false;\n }", "function moveUpR() {\n if (objectLine2.transform[1] >= 0.9) {\n return;\n }\n objectLine2.transform[1] += 0.02;\n drawObjects();\n}", "function moveUp() {\n if (images.bird.yPos > 25) {\n images.bird.yPos -= 25;\n }\n sounds.fly.play();\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "moveActor() {\n // used to work as tunnel if left and right are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[0] < -1) {\n this.tileTo[0] = this.gameMap.layoutMap.column;\n }\n if (this.tileTo[0] > this.gameMap.layoutMap.column) {\n this.tileTo[0] = -1;\n }\n\n // used to work as tunnel if top and bottom are empty pacman/ghosts can easily move in tunnel\n if (this.tileTo[1] < -1) {\n this.tileTo[1] = this.gameMap.layoutMap.row;\n }\n if (this.tileTo[1] > this.gameMap.layoutMap.row) {\n this.tileTo[1] = -1;\n }\n\n // as our pacman/ghosts needs to move constantly widthout key press,\n // also pacman/ghosts should stop when there is obstacle the code has become longer\n\n // if pacman/ghosts is moving up check of upper box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.UP) {\n if (this.isBlockUpperThanActorEmpty()) {\n this.tileTo[1] -= 1;\n }\n }\n\n // if pacman/ghosts is moving down check of down box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.DOWN) {\n if (this.isBlockLowerThanActorEmpty()) {\n this.tileTo[1] += 1;\n }\n }\n\n // if pacman/ghosts is moving left check of left box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.LEFT) {\n if (this.isBlockLeftThanActorEmpty()) {\n this.tileTo[0] -= 1;\n }\n }\n\n // if pacman/ghosts is moving right check of right box is empty and go otherise stop\n if (this.movingDirection === MOVING_DIRECTION.RIGHT) {\n if (this.isBlockRightThanActorEmpty()) {\n this.tileTo[0] += 1;\n }\n }\n }", "function moveTileRight(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column + 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column + 1)) {\n $(tileArray[row][column + 1]).remove();\n tileArray[row][column + 1] = null;\n } else {\n tileArray[row][column + 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1));\n }\n });\n tileArray[row][column + 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveUp(){\n ctx.clearRect(0, 0, 450, 450);\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 9 || empty == 7 || empty == 8){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty+3;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n \n }\n}", "function move(dir)\n\t{\n\t\tif (unit.movePoints == 0) return;\t\t// no movepoints left\n\n\t\t// determine destination tile\n\t\tvar x = this.x, y = this.y;\n\t\tswitch (dir)\n\t\t{\n\t\t\tcase 0: y-=2; break;\t\t\t\t\t\t// straight up (y - 2)\n\t\t\tcase 1: x=y%2==0?x:x+1; y--; break;\t\t\t// upper right\n\t\t\tcase 2: x++; break;\n\t\t\tcase 3: x=y%2==0?x:x+1; y++; break;\n\t\t\tcase 4: y+=2; break;\n\t\t\tcase 5: x=y%2==0?x-1:x; y++; break;\n\t\t\tcase 6: x--; break;\n\t\t\tcase 7: x=y%2==0?x-1:x; y--; break;\n\t\t}\n\n\t\t// check if the destination tile is ok\n\t\tif (!isTileMoveable(x,y)) return;\n\n\t\tunit.div.removeClass(\"selected\").css(\"opacity\", 1);\n\n\t\tunit.x = x;\n\t\tunit.y = y;\n\t\tunit.movePoints--;\n\t\tupdate();\n\t}", "function moveup() {\r\n myGamePiece.speedY = -1; \r\n}", "function moveDown(){\n undraw();\n currentPosition += width;\n draw();\n freeze();\n }", "moveDown(amount){\n var initRow = this.index.row;\n this.index.row+=amount;\n this.gameObject.setTint(this.identifier.color);\n this.moveData.push({\n from: {x: this.gameObject.x, y:this.gameObject.y},\n to: {x: this.x + ((initRow + 1)%2 * this.board.hexWidth/2), y: this.y + this.board.vertOffset}\n });\n //generates all of the positions that it will go on it's way movinf down\n //I can then interpolate between each of these positions\n for(var i = 1; i< amount; i++){\n this.moveData.push({\n from: {x: this.moveData[i-1].to.x, y: this.moveData[i-1].to.y},\n to: {x: this.x + ((initRow + i+1 )%2 * this.board.hexWidth/2), y: this.y + (i+1) * this.board.vertOffset}\n });\n }\n this.offset =(this.index.row%2 * this.board.hexWidth/2);\n\n this.assocText.setText(\"\");\n this.y += amount * this.board.vertOffset\n this.addToBoardAnim();\n }", "function moveCharacterUp(){\n gameModel.moveCharacter(0);\n}", "function recursiveMouvementUp(i,j,tile)\n\t\t{\n\t\t\tvar tileNext = $('body').find('[data-x='+i+'][data-y='+(j-1)+']');\n\t\t\tvar value =$(tile).find('.tile-inner').text();\n\t\t\tvar valueNext = $(tileNext).find('.tile-inner').text();\n\t\t\t\n\t\t\tif( tileNext.length == 0 && j>1)\n\t\t\t{\n\t\t\t\t\t setClass($(tile), j-1);\n\t\t\t\t\t recursiveMouvementUp(i,j-1,tile);\n\t\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( value == valueNext){\n\t\t\t\t\tsetClass($(tile), j+1);\n\t\t\t\t\tfusion(tile,tileNext, value);\n\t\t\t\t}\n\t\t\t}\n\t\t}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "move(direction) {\n // NOTE: West movement should -- and east should ++. Need to work on map orientation\n if (direction === \"north\" && this.currentCell.hasLink(this.currentCell.north) === true) {\n //alert(\"north\");\n this.y++;\n this.currentCell = this.currentCell.north;\n }\n if (direction === \"west\" && this.currentCell.hasLink(this.currentCell.west) === true) {\n //alert(\"west\");\n this.x--;\n this.currentCell = this.currentCell.west;\n }\n if (direction === \"south\" && this.currentCell.hasLink(this.currentCell.south) === true) {\n //alert(\"south\");\n this.y--;\n this.currentCell = this.currentCell.south;\n }\n if (direction === \"east\" && this.currentCell.hasLink(this.currentCell.east) === true) {\n //alert(\"east\");\n this.x++;\n this.currentCell = this.currentCell.east;\n }\n }", "move(newDirection) {\n let newHead = new Position(this.head.row, this.head.column);\n this.tail.unshift(newHead);\n this.tail.pop();\n switch (newDirection) {\n case \"N\":\n if (this.head.row == 0) {\n this.head.row = 19;\n } else {\n this.head.row -= 1;\n } break;\n case \"S\":\n if (this.head.row == 19) {\n this.head.row = 0;\n } else {\n this.head.row += 1;\n } break;\n case \"W\":\n if (this.head.column == 0) {\n this.head.column = 23;\n } else {\n this.head.column -= 1;\n } break;\n case \"E\":\n if (this.head.column == 23) {\n this.head.column = 0;\n } else {\n this.head.column += 1;\n } break;\n }\n }", "siftup(i, x) {\n\t\tthis.upsteps++;\n\t\tlet px = this.p(x);\n\t\twhile (x > 1 && this.#key[i] < this.#key[this.itemAt(px)]) {\n\t\t\tthis.#item[x] = this.itemAt(px); this.#pos[this.itemAt(x)] = x;\n\t\t\tx = px; px = this.p(x);\n\t\t\tthis.upsteps++;\n\t\t}\n\t\tthis.#item[x] = i; this.#pos[i] = x;\n\t}", "function higher(){\n coords.Y-=1\n ground.style = 'transform: translateX(-5000px) translateY(-5000px) translateZ('+coords.Y+'px) rotateZ('+coords.xRot+'deg) translateY('+coords.yMove+'px) translateX('+coords.xMove+'px)'\n}", "function moveup() {\r\n player.dy = -player.speed;\r\n}", "function moveSubtree(wm,wp,shift){var change=shift/(wp.i-wm.i);wp.c-=change;wp.s+=shift;wm.c+=change;wp.z+=shift;wp.m+=shift}", "function moveup() {\n myGamePiece.speedY = -2;\n}", "move () {\n let row = this.ant.position.row;\n let col = this.ant.position.col;\n\n // turn the ant.\n // if the current cell is white, then turn clockwise. Else anti-clockwise.\n this.ant.turn(this.isWhite(row, col));\n // flip the color the current cell\n this.flip(row, col);\n // move the ant one step\n this.ant.move(this.grid);\n // update the size of the grid so that it fits the ants position\n this.ensureFit(this.ant.position);\n }", "function changePosition(from, to, rowToUpdate) {\n\n var $tiles = $(\".tile\");\n var insert = from > to ? \"insertBefore\" : \"insertAfter\";\n\n // Change DOM positions\n $tiles.eq(from)[insert]($tiles.eq(to));\n\n layoutInvalidated(rowToUpdate);\n}", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\n }", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "function resizeFixup(ui){\n\t \tvar resizeId = ui.element.attr('id');\n\t \t//which direction did it resize?\n\t \tif(resizeDir == 'n'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, 0) - virtical_location(ui.helper.position().top, 0);\n\t \t\tif(diff <= 0 && parseInt(ui.element.attr('row')) <= 1){\n\t \t\t\t//the tile is at the top\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY-2].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY-2].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'row':parseInt(ui.element.attr('row'))-diff,\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif(diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 's', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 's', item);\n\t \t\t\t});\n\t \t\t}\n\t \t}\n\t \tif(resizeDir == 's'){\n\t \t\tvar diff = virtical_location(ui.originalPosition.top, ui.originalSize.height) - virtical_location(ui.helper.position().top, ui.helper.height());\n\t \t\tif(parseInt(ui.element.attr('row'))+parseInt(ui.element.attr('sizey'))-1 == maxHeight ){\n\t \t\t\t//the tile is at the bottom\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar virt_adj = new Set();\n\t \t\tfor (var i = resizeStartX; i < resizeStartX + resizeStartSizeX; i++) {\n\t \t\t\tif(board[i-1][resizeStartY + resizeStartSizeY - 1].tile != resizeId){\n\t \t\t\t\tvirt_adj.add(board[i-1][resizeStartY + resizeStartSizeY - 1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go up or down?\n\t \t\t$(ui.element).attr({\n\t \t\t\t'sizey':parseInt(ui.element.attr('sizey'))-diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved down\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'down', diff, 'n', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved up\n\t \t\t\tvirt_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'up', diff, 'n', item);\n\t \t\t\t});\n\t \t\t}\n\t \t} \n\t \tif(resizeDir == 'e'){\n\t \t\tif(parseInt(ui.element.attr('col'))+parseInt(ui.element.attr('sizex'))-1 == maxCols){\n\t \t\t\t//the element is on the right of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX + resizeStartSizeX - 1][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX + resizeStartSizeX - 1][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t\t\t//did it go right or left?\n\t\t\tvar diff = horizontal_location(ui.originalPosition.left, ui.originalSize.width) - horizontal_location(ui.helper.position().left, ui.helper.width());\n\t\t\tui.element.attr({\n\t\t\t\t'sizex':parseInt(ui.element.attr('sizex'))-diff\n\t\t\t});\n\t\t\tupdate_board(resizeId);\n\t\t\tvar moved = new Set();\n\t\t\tmoved.add(resizeId);\n\t\t\tif( diff < 0){\n\t \t\t\t//it moved right\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'w', item);\n\t \t\t\t});\n\t \t\t} \n\t \t} \n\t \tif(resizeDir == 'w'){\n\t \t\tif(parseInt(ui.element.attr('col')) == 1){\n\t \t\t\t//the element is on the left side of the board\n\t \t\t\treturn;\n\t \t\t}\n\t \t\tvar horz_adj = new Set();\n\t \t\tfor (var i = resizeStartY; i < resizeStartY + resizeStartSizeY; i++) {\n\t \t\t\tif(board[resizeStartX - 2][i-1].tile != resizeId){\n\t \t\t\t\thorz_adj.add(board[resizeStartX - 2][i-1].tile);\n\t \t\t\t}\n\t \t\t};\n\t \t\t//did it go right or left?\n\t \t\tvar diff = horizontal_location(ui.originalPosition.left,0) - horizontal_location(ui.helper.position().left, 0);\n\t \t\tui.element.attr({\n\t \t\t\t'col':parseInt(ui.element.attr('col'))-diff,\n\t \t\t\t'sizex':parseInt(ui.element.attr('sizex'))+diff\n\t \t\t});\n\t \t\tupdate_board(resizeId);\n\t \t\tvar moved = new Set();\n\t \t\tmoved.add(resizeId);\n\t \t\tif( diff < 0){\n\t \t\t\t//it moved right\n\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'right', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t\telse if(diff > 0){\n\t \t\t\t//it moved left\n\t \t\t\thorz_adj.forEach(function(item){\n\t \t\t\t\trecursiveResize(moved, 'left', diff, 'e', item);\n\t \t\t\t});\n\t \t\t} \n\t \t}\n\t }", "moveForward () {\n let posAux = Object.assign({}, this.position);\n switch (this.position.orientation) {\n case 'N':\n this.position.column++;\n break;\n case 'S':\n this.position.column--;\n break;\n case 'E':\n this.position.row--;\n break;\n case 'W':\n this.position.row++;\n break;\n default:\n break;\n }\n this.isLost(posAux);\n }", "update_tile(tile_pos){\n var tile = this.grid[tile_pos.x][tile_pos.y]\n if(tile != null){\n tile.update(this.grid)\n }\n }", "move() {\n //Move the kid to the determined location\n this.x = this.nextMoveX;\n this.y = this.nextMoveY;\n //Check in case the kid touches the edges of the map,\n // if so, prevent them from leaving.\n this.handleConstraints();\n }", "function up(){\n turd.css('top', parseInt(turd.css('top')) - 10);\n }" ]
[ "0.7645715", "0.7620801", "0.7438366", "0.74352807", "0.7302458", "0.71444833", "0.7093712", "0.69303703", "0.6896559", "0.6891586", "0.68888384", "0.6869615", "0.6844837", "0.67976063", "0.67976063", "0.67746973", "0.67518926", "0.6737065", "0.6716795", "0.67129356", "0.67036647", "0.6684362", "0.6648187", "0.6641528", "0.6614832", "0.65734947", "0.6562157", "0.65281385", "0.65180886", "0.6509512", "0.650829", "0.64568555", "0.64476734", "0.6411494", "0.63950473", "0.6392271", "0.636149", "0.6346873", "0.6313344", "0.6299242", "0.62973964", "0.6278006", "0.62743855", "0.6263309", "0.6246117", "0.6241413", "0.6237361", "0.6232098", "0.62272435", "0.6204031", "0.6200749", "0.6197745", "0.6179456", "0.61707723", "0.6157244", "0.61487716", "0.61369133", "0.61333585", "0.6126207", "0.6126202", "0.61124563", "0.6100211", "0.6088985", "0.6082132", "0.60790247", "0.60749984", "0.60680795", "0.60583425", "0.6042179", "0.60380083", "0.6028317", "0.60253805", "0.60247296", "0.60192543", "0.60178995", "0.60127074", "0.60090935", "0.60041046", "0.6002202", "0.60019517", "0.59859896", "0.59835356", "0.5974672", "0.5973528", "0.59734964", "0.596969", "0.59531736", "0.594474", "0.59409", "0.5937614", "0.5929639", "0.59194815", "0.5917604", "0.5909806", "0.59058094", "0.590012", "0.58961475", "0.5895334", "0.58909106", "0.5879261" ]
0.75509495
2
Move A SINGLE tile left
function moveTileLeft(row, column) { //This happens as soon as the player makes a move if (checkRemove(row, column - 1)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "left": "-=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row, column - 1)) { $(tileArray[row][column - 1]).remove(); tileArray[row][column - 1] = null; } else { tileArray[row][column - 1].setAttribute("id", "tile-" + (parseInt(tileArray[row][column - 1].id.slice(5)) - 1)); } }); tileArray[row][column - 1] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "function moveLeft()\r\n {\r\n undraw()\r\n const isAtLeftEdge = currentTetromino.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge)\r\n currentPosition -= 1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition += 1\r\n draw()\r\n }", "function moveLeft () {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) {\n currentPosition -= 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n draw()\n }", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(\r\n (index) => (currentPosition + index) % width === 0\r\n );\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition += 1;\r\n }\r\n draw();\r\n }", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % width === 0,\n );\n if (!isAtLeftEdge) {\n currentPosition -= 1;\n }\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\"),\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function moveLeft() {\n undraw()\n const reachedLeftEdge = curT.some(index => (curPos + index) % width === 0)\n if (!reachedLeftEdge) curPos -= 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos += 1\n }\n draw()\n }", "function moveLeft() {\n undraw()\n\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if (!isAtLeftEdge) currentPosition -= 1\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1\n }\n\n draw()\n }", "function moveLeft() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtLeftEdge = current.some(\n //condition is at left hand side is true\n (index) => (currentPosition + index) % width === 0\n );\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n draw();\n }", "function moveLeft() {\n undraw();\n const isAtLeftEdge = current.some((index) => (currentPosition + index) % width === 0);\n if (!isAtLeftEdge) currentPosition -= 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n draw();\n}", "function moveLeft() {\n unDraw();\n const isAtLeftEdge = current.some(\n (index) => (currentPosition + index) % xPixel === 0\n );\n\n if (!isAtLeftEdge) currentPosition -= 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition += 1;\n }\n\n draw();\n }", "function moveLeft(){\n undraw();\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width ===0)\n if(!isAtLeftEdge) currentPosition-=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition+=1;\n }\n\n draw();\n }", "function moveLeft() {\n undraw(squares, current, currentPosition);\n const isAtLeftEdge = current.some(index => (currentPosition + index) % WIDTH === 0);\n \n if(!isAtLeftEdge) currentPosition -= 1;\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition += 1;\n }\n\n draw();\n }", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\r\n\r\n if(!isAtLeftEdge) currentPosition -=1\r\n\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\n draw()\r\n }", "function left_move() {\n if (coord_pos[0] > 0) {\n coord_pos[0] -= 1;\n }\n else if(coord_pos[1] > 0) { // If we need to wrap around (and have room to)\n coord_pos[0] = n;\n coord_pos[1] -= 1;\n } else { // If we hit the upper left, we go the bottom right corner\n coord_pos = [n,n];\n }\n recent_move = -1;\n}", "function moveTilesLeft() {\n for (var column = 1; column <= 3; column++) {\n for (var row = 3; row >= 0; row--) {\n if (checkLeft(row, column) && tileArray[row][column] != null) {\n moveTileLeft(row, column);\n }\n }\n }\n }", "function moveTile() {\n moveTileHelper(this);\n }", "function moveLeft() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column - 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "function moveLeft() {\r\n undraw();\r\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0);\r\n // allows shape to move left if it's not at the left position\r\n if (!isAtLeftEdge) currentPosition -= 1;\r\n\r\n // push it unto a tetrimino that is already on the left edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition += 1;\r\n\r\n }\r\n draw();\r\n}", "function move_left() {\n\t check_pos();\n\t blob_pos_x = blob_pos_x - move_speed;\n\t}", "function moveLeft() {\n undraw()\n const isAtLeftEdge = current.some(index => (currentPosition + index) % width === 0)\n\n if(!isAtLeftEdge) currentPosition -=1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition +=1\n }\n draw()\n}", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "moveLeft() {\r\n this.actual.moveLeft();\r\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function moveLeft(){\n let initialPosLeft = witch.getBoundingClientRect().left;\n let lifeLeft = witch_lifeline.getBoundingClientRect().left;\n if(initialPosLeft > 32){\n witch_lifeline.style.left = lifeLeft - 20 + 'px';\n witch.style.left = initialPosLeft - 20 + 'px';\n }\n}", "function moveLeft() {\n moveOn();\n }", "getLeftTile() {\n\t\treturn this.position;\n\t}", "function moveLeft() {\n\n\t\ttry {\n\t\t // Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.left);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "moveLeft() {\n\n if (this.posX >= 10 && pause == false)\n this.posX = this.posX - 5;\n }", "function moveLeft(){\r\n undraw()\r\n const isAtLeftEdge = current.some(index => (currentPosition + index)% width ===0)\r\n if(!isAtLeftEdge) currentPosition -=1\r\n if(current.some (index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition +=1\r\n }\r\ndraw()\r\n}", "moveLeft() {\n this.x>0?this.x-=101:false;\n }", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function moveLeft() {\r\n moveTo(player.x - 1, player.y);\r\n}", "function moveLeft(){\n //first check that keys are enabled\n if(keyEnabled == true){\n undraw();\n const isAtLeftEdge = currentShape.some(index => (currentPosition + index)% 10 === 0 )\n\n if(!isAtLeftEdge)\n {\n currentPosition = currentPosition - 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition +1;\n }\n\n draw();\n }\n }", "moveLeft() {\n if (this.x === 0) {\n this.x = this.tape[0].length - 1;\n } else {\n this.x--;\n }\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "newPieceMoveLeft(){\n\n\t\tlet isCollision = false;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0]-1 \t+ index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1] \t+ Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || x < 0){\n\t\t\t\t\tisCollision = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\tif(!isCollision){\n\t\t\tthis.newPiecePosition[0] -= 1;\n\t\t}\n\n\t}", "function moveLeft() {\n let prevCol;\n let curCol;\n let temp;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth - 1; x++) {\n if (x === sizeWidth - 1) {\n fill(curCol);\n rect(x, y, sizeBlock, sizeBlock);\n }\n else {\n prevCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get((x + 1) * sizeBlock + 1, y * sizeBlock + 1);\n\n temp = prevCol;\n prevCol = curCol;\n curCol = temp;\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n fill(curCol);\n rect((x + 1) * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n }\n }\n }\n}", "function moveWithLogLeft() {\n if (index >= 27 && index < 35) {\n squares[index].classList.remove('man')\n index += 1\n squares[index].classList.add('man')\n }\n }", "function moveLeft() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol);\n\t\t}\n\n\t\tdraw();\n\t}", "function getLeftPosition(tile) {\n return parseInt(tile.style.left);\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function moveWithLogLeft() {\n if (currentIndex > 18 && currentIndex <= 26) {\n squares[currentIndex].classList.remove('frog');\n currentIndex -= 1;\n squares[currentIndex].classList.add('frog');\n }\n }", "function lMove(){\n\n if( position == right){\n flag = true; //set to true when movement needs to move back to left\n }\n //moving right\n if (position < right){\n position++;\n }\n\n obj.style.left = position + \"px\"; //adds the value px i.e #px\n}", "moveLeft() {\n if (!this.collides(-1, 0, this.shape)) this.pos.x--\n }", "function moveTo(x, y) {\r\n var t = currentmap.getTile(x, y);\r\n if (t) {\r\n if (!t.doesCollide) {\r\n player.x = x;\r\n player.y = y;\r\n lastMouseX = -1;\r\n lastMouseY = -1;\r\n } else if (t.actionable) {\r\n tileActions[t.id](currentmap, x, y);\r\n }\r\n }\r\n}", "_moveLeft() {\n if (this._currentPosition < 2 && this._settings.infinity) {\n this._moveLeftInfinity();\n return;\n }\n for (let moved = 0; moved < this._settings.moveCount; moved++) {\n if (this._currentPosition < 1) break;\n\n this._itemsHolder.style.transition = `transform ${ this._settings.movementSmooth }ms`;\n\n const targetItem = this._items[this._currentPosition - 1];\n this._offset += targetItem.offsetWidth + this._settings.slidesSpacing;\n\n this._itemsHolder.style.transform = `translateX(${ this._offset + this._calcTowardsLeft() }px)`;\n\n this._currentPosition -= 1;\n }\n this._adaptViewWrapSizes();\n this._setDisplayedItemsClasses();\n }", "move() {\n this.x = this.x - 7\n }", "moveRight() {\n dataMap.get(this).moveX = 5;\n }", "function moveLeft() {\n //remove current shape, slide it over, if it collides though, slide it back\n removeShape();\n currentShape.x--;\n if (collides(grid, currentShape)) {\n currentShape.x++;\n }\n //apply the new shape\n applyShape();\n}", "function moveLeft(){\n var left = parseInt(window.getComputedStyle(character).getPropertyValue(\"left\"));\n if(left>0){\n character.style.left = left - 2 + \"px\";\n }\n}", "function moveLeft() {\n robotLeft -= 10;\n robot.style.left = robotLeft + \"px\";\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "function moveLeft(elem, distance) { //distance is maximum distance to go\n var left = 0;\n\n function frame() {\n left++; //move 1 pixel each time\n elem.style.left = left + 'px';\n if (left === distance) {\n clearInterval(timeId);\n }\n }\n\n var timeId = setInterval(frame, 10); // draw every 10ms\n}", "function onMouseMove(e) {\n //Posição do mouse\n var pos = getMousePos(canvas, e);\n if (drag && level.selectedtile.selected) {\n //Pega o tile sobre o mouse\n mt = getMouseTile(pos);\n if (mt.valid) {\n //Verifica se pode ser trocado\n if (canSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row)) {\n //Troca os tiles\n mouseSwap(mt.x, mt.y, level.selectedtile.column, level.selectedtile.row);\n }\n }\n }\n }", "function moveShapeLeft()\n {\n undrawShape();\n\n // check to see if the shape is at the edge of the grid\n // this is to prevent the shape going out and appear from the other side of the grid\n const isAtLeftEdge = currentShape.some(\n (index) => (currentPosition + index) % GRID_WIDTH === 0);\n\n \n if(!isAtLeftEdge)\n {\n currentPosition -=1;\n canRotate = true;\n }\n else if (isAtLeftEdge)\n {\n canRotate = false;\n }\n\n\n let isCollisionSquare = currentShape.some(\n (index) => squares[currentPosition + index].classList.contains(\"taken\"))\n \n \n if(isCollisionSquare)\n {\n currentPosition+=1 // dont move the shape to the left \n }\n\n drawShape();\n\n }", "_moveLeftInfinity() {\n if (!this._settings.infinity) return;\n\n this._currentPosition = this._items.length;\n this._itemsHolder.style.transition = `transform ${ 0 }ms`;\n\n this._offset = -(this._calcShiftMaxLength() + this._calcTowardsLeft() );\n this._itemsHolder.style.transform = `translateX(${ this._offset - this._settings.oppositeSideAppearShift }px)`;\n setTimeout(() => this._moveLeft(), this._settings.oppositeSideAppearDelay);\n }", "function tileClick() {\n\tmoveOneTile(this);\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function rMove(){\n\n if (position == left){\n flag = false; //flag set to false when it needs to start moving right\n }\n\n if (position > left) {\n position--;\n }\n \n obj.style.left = position + \"px\"; //adds the value px i.e #px\n}", "function moveShipLeft() {\n\tif(leftDown) {\n\t\tif(((fighter.position().left - (FIGHTER_WIDTH / 2)) / SCALE) - 2 > 0) {\n\t\t\tfighter.css('left', \"-=2\");\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "moveLeft() {\n this.point.x -= this.scrollSpeed;\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "moveLeft() { this.velX -= 0.55; this.dirX = -1; }", "function moveLeft(){\n ctx.clearRect(0, 0, 450, 450);\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 6 || empty == 9 || empty == 3){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty+1;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n }\n}", "function moveFloor(){\r\n\tif(floorg.x>55){\r\n\tfloorg.x=0;\r\n\t}else{\r\n\t\tfloorg .x+=level.speed;\r\n\t}\r\n}", "function onMoveLeft(evt){\n\t\t\troote.box.x -=20;\n\t\t}", "function move(piece){\r\n\tif (isMoveable(piece)){\r\n\t\tvar switchTop = emptyPiece[0] + \"px\";\r\n\t\tvar switchLeft = emptyPiece[1] + \"px\";\r\n\t\tvar styleTop = piece.style.top;\r\n\t\tvar styleLeft = piece.style.left;\r\n\t\tpiece.style.top = switchTop;\r\n\t\tpiece.style.left = switchLeft;\r\n\t\temptyPiece[0] = parseInt(styleTop);\r\n\t\temptyPiece[1] = parseInt(styleLeft);\r\n\t}\r\n}", "function moveLeft(){\nif(currentPosition > start) {\n paddleCollision()\n player.style.left = currentPosition - 5 + 'px';\n }\n}", "function moveLeft(){\n if (current != 1){\n current--;\n }\n smlImage();\n norm('#image', .3, 1);\n\n if ($('#image').hasClass('pixPerf')){\n $('.leftButt').css('visibility','hidden');\n }\n $('.rightButt').css('visibility','visible');\n moveCirc(current+1, current);\n}", "function moveTileRight(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column + 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column + 1)) {\n $(tileArray[row][column + 1]).remove();\n tileArray[row][column + 1] = null;\n } else {\n tileArray[row][column + 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1));\n }\n });\n tileArray[row][column + 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function toLeft(){\n imgIndex--;\n if(imgIndex == -1){\n imgIndex = imgItems.length-1;\n }\n changeImg(imgIndex);\n }", "moveTile(pointer) {\n // if we can move...\n if (this.canMove) {\n // determine column according to input coordinate and tile size\n let column = Math.floor(pointer.x / this.tileSize);\n\n // get the ditance from current player tile and destination\n let distance = Math.floor(\n Math.abs(column * this.tileSize - this.player.x) / this.tileSize\n );\n\n // did we actually move?\n if (distance > 0) {\n // we can't move anymore\n this.canMove = false;\n\n // tween the player to destination tile\n this.tweens.add({\n targets: [this.player],\n x: column * this.tileSize,\n duration: distance * 30,\n callbackScope: this,\n onComplete: function() {\n // at the end of the tween, check for tile match\n this.checkMatch();\n },\n });\n }\n }\n }", "function moveLeft() {\n for (var i = 0; i < 4; i++) {\n\t\t\tvar k =0;\n\t\t\tfor (var j = 1; j < 4; j++) {\n\t\t\t\tif(mat[i][k] === 0 && mat[i][j]!== 0){\n\t\t\t\t\tmat[i][k] =mat[i][j];\n\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\tstateChange = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(mat[i][k] === mat[i][j] && mat[i][k] !== 0){\n\t\t\t\t\tmat[i][k] = 2*mat[i][k];\n\t\t\t\t\tscore += mat[i][k];\n\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\t++k;\n\t\t\t\t\tstateChange = true;\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse if(mat[i][k] !== mat[i][j] && mat[i][k] !==0 && mat[i][j] !==0){\n\t\t\t\t\tif(k == j-1){\n\t\t\t\t\t\t++k;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t++k;\n\t\t\t\t\t\tmat[i][k] = mat[i][j];\n\t\t\t\t\t\tmat[i][j]=0;\n\t\t\t\t\t\tstateChange = true;\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "turnLeft() {\n if (DIRECTIONS.indexOf(this.position.heading) === 0) {\n this.position.heading = DIRECTIONS[3];\n } else {\n this.position.heading =\n DIRECTIONS[DIRECTIONS.indexOf(this.position.heading) - 1];\n }\n }", "function swapLeft(state) {\n let blankPOS = findBlankCell(state)\n return swap(state, { y: blankPOS.y, x: blankPOS.x - 1 })\n}", "moveRight() {\n this.shinobiPos.x += 30\n }", "function moveLeft(rover) {\n\n switch (rover.direction) {\n case \"N\":\n rover.direction = \"W\";\n break;\n\n case \"E\":\n rover.direction = \"N\";\n break;\n\n case \"S\":\n rover.direction = \"E\";\n break;\n\n case \"W\":\n rover.direction = \"S\";\n break;\n }\n}", "function pieceMove(dir){\r\n piece.pos.x += dir;\r\n if(collision(arena, piece)){\r\n piece.pos.x -= dir;\r\n }\r\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function move(dir)\n\t{\n\t\tif (unit.movePoints == 0) return;\t\t// no movepoints left\n\n\t\t// determine destination tile\n\t\tvar x = this.x, y = this.y;\n\t\tswitch (dir)\n\t\t{\n\t\t\tcase 0: y-=2; break;\t\t\t\t\t\t// straight up (y - 2)\n\t\t\tcase 1: x=y%2==0?x:x+1; y--; break;\t\t\t// upper right\n\t\t\tcase 2: x++; break;\n\t\t\tcase 3: x=y%2==0?x:x+1; y++; break;\n\t\t\tcase 4: y+=2; break;\n\t\t\tcase 5: x=y%2==0?x-1:x; y++; break;\n\t\t\tcase 6: x--; break;\n\t\t\tcase 7: x=y%2==0?x-1:x; y--; break;\n\t\t}\n\n\t\t// check if the destination tile is ok\n\t\tif (!isTileMoveable(x,y)) return;\n\n\t\tunit.div.removeClass(\"selected\").css(\"opacity\", 1);\n\n\t\tunit.x = x;\n\t\tunit.y = y;\n\t\tunit.movePoints--;\n\t\tupdate();\n\t}", "function Move() {\n\n if(Right == true) {\n\t\t\t\tif(StartingX < 1040) {//width-paddle length because x coord at far Right\n \tStartingX += PaddleDisplacement;\n \t\t} //if\n\t\t}// if right\n\n else if(Left == true) {\n\t\t\t\tif(StartingX > 0) { //nested if statement\n\t\t\t\t\tStartingX -= PaddleDisplacement;\n \t\t} //if\n\t\t}// if left\n\n}", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "function moveWithLogLeft() {\n if (currentIndex >= 27 && currentIndex < 35) {\n $(\"div\").removeClassWild(\"frog-*\");\n currentIndex += 1\n squares[currentIndex].classList.add('frog-on-log')\n }\n}", "function moveleft() {\n var t = \".slide_dot:nth-child(\" + (pointer + 1) + \")\";\n $(t).removeClass(\"selected_dot\");\n pointer = (pointer - 1 < 0) ? (image_sources.length - 1) : (pointer - 1);\n $(\"#slide_image\").attr(\"src\", image_sources[pointer]);\n t = \".slide_dot:nth-child(\" + (pointer + 1) + \")\";\n $(t).addClass(\"selected_dot\");\n }", "function xMoveTo(e,x,y)\n{\n xLeft(e,x);\n xTop(e,y);\n}", "moveEnemyLeftToRight() {\n if (!game.rightColumnEnemyIsInCanvasRightColumn()) {\n const nextCanvasColumnX = game.getXOfCanvasColumn(this.canvasColumn + 1);\n this.moveRightToTarget(nextCanvasColumnX);\n } else {\n this.lastMove = \"right\";\n this.moveEnemyDown();\n }\n }", "function moveShapeLeft(){\n square_pos = 0;\n for( var i = 0; i < 32; i+= 2){\n positions[square_pos+i] = positions[square_pos+i] - 0.1*(X_MAX-X_MIN);\n }\n main();\n}", "function moveAliensLeft() {\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.remove('alien')\n })\n currentAlienPositions = currentAlienPositions.map((alien) => {\n return alien -= 1\n })\n currentAlienPositions.forEach((alien) => {\n cells[alien].classList.add('alien')\n })\n}", "function move() {\n\tvar square = document.getElementById(\"square\");\n\tsquare.style.left = position + \"px\";\n\t\n\tif (position >= 500)\n\t\tmovingLeft = false;\n\telse if (position <= 0) {\n\t\tmovingLeft = true;\n\t\tconsole.log(\"Counter: \" + counter);\n\t\tcounter ++;\n\t}\n\n\tif (movingLeft)\n\t\tposition += 10;\n\telse\n\t\tposition -= 10;\n\n\tif (counter > 3)\n\t\tclearInterval(myTimer);\n}", "function computerMove() {\n\tvar cpuPosition = current.selectTile(board);\n\tboard.placeTile(current, cpuPosition);\n\tvar box = document.querySelector(`.box[data-position=\"${cpuPosition}\"]`);\n\tbox.getElementsByClassName('tile-image')[0].src = current.img;\n\tif (board.isWinningState(current, cpuPosition)) {\n\t\tend(current);\n\t} else if (board.isTie()) {\n\t\tend(current, true);\n\t} else {\n\t\tswitchCurrentPlayer();\n\t}\n}", "moveEnemyRightToLeft() {\n if (!game.leftColumnEnemyIsInCanvasLeftColumn()) {\n const nextCanvasColumnX = game.getXOfCanvasColumn(this.canvasColumn - 1);\n this.moveLeftToTarget(nextCanvasColumnX);\n } else {\n this.lastMove = \"left\";\n this.moveEnemyDown();\n }\n }" ]
[ "0.76739264", "0.7643933", "0.758759", "0.75747824", "0.7569376", "0.75636613", "0.7511753", "0.74948204", "0.74897724", "0.74803", "0.74449575", "0.7443422", "0.74400276", "0.7432567", "0.74157345", "0.73869175", "0.73726445", "0.72654706", "0.725234", "0.72474647", "0.7232149", "0.71762043", "0.71690565", "0.7147492", "0.7091412", "0.70741105", "0.70567083", "0.7044243", "0.6956142", "0.6921823", "0.69032884", "0.68935066", "0.6883503", "0.6878141", "0.6869383", "0.68285286", "0.6799805", "0.6792317", "0.67566806", "0.6756621", "0.6698759", "0.6694232", "0.66887313", "0.6676297", "0.66614646", "0.66462594", "0.6631402", "0.6608146", "0.6572367", "0.65696406", "0.65551734", "0.655107", "0.65315235", "0.6528424", "0.6485169", "0.64749575", "0.64701706", "0.6446066", "0.6423821", "0.64150274", "0.64134455", "0.6401246", "0.63886994", "0.6386175", "0.6383748", "0.63802797", "0.6378362", "0.63696015", "0.63448226", "0.6338197", "0.6329997", "0.6312741", "0.63120496", "0.6308042", "0.6307409", "0.62991136", "0.6292587", "0.62727004", "0.6259665", "0.6254877", "0.624398", "0.62357104", "0.6233458", "0.62325627", "0.6232116", "0.622257", "0.62129754", "0.6212813", "0.6186782", "0.6184614", "0.61767787", "0.6175722", "0.6175633", "0.6147582", "0.61337084", "0.6133488", "0.6118046", "0.6117438", "0.61145025", "0.61126596" ]
0.7645088
1
Move A SINGLE tile right
function moveTileRight(row, column) { //This happens as soon as the player makes a move if (checkRemove(row, column + 1)) { doubleColor = tileArray[row][column].style.backgroundColor; removals++; if (removals == 1) { // This will cause the creation of a new center tile, once all movements have been processed createNewCenterTile = true; } } // This is the animation $(tileArray[row][column]).animate({ "left": "+=" + shiftValue }, 80, "linear", function () { // This happens at the end of each tile's movement if (checkRemove(row, column + 1)) { $(tileArray[row][column + 1]).remove(); tileArray[row][column + 1] = null; } else { tileArray[row][column + 1].setAttribute("id", "tile-" + (parseInt(tileArray[row][column + 1].id.slice(5)) + 1)); } }); tileArray[row][column + 1] = tileArray[row][column]; tileArray[row][column] = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\n }", "function moveRight() {\n undraw()\n const reachedRightEdge = curT.some(index => (curPos + index) % width === width - 1)\n if (!reachedRightEdge) curPos += 1\n if (curT.some(index => squares[curPos + index].classList.contains('taken'))) {\n // if the position has been taken by another figure, push the tetromino back\n curPos -= 1 \n }\n draw()\n }", "function moveRight()\r\n {\r\n undraw()\r\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % 10 === 9)\r\n\r\n if(!isAtRightEdge)\r\n currentPosition +=1\r\n if(currentTetromino.some(index => squares[currentPosition + index].classList.contains('taken')))\r\n currentPosition -= 1\r\n draw()\r\n }", "function moveRight () {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) {\n currentPosition += 1\n }\n\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n draw()\n }", "function moveRight() {\r\n unDraw();\r\n const isAtRightEdge = current.some(\r\n (index) => (currentPosition + index) % width === width - 1\r\n );\r\n if (!isAtRightEdge) currentPosition += 1;\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "moveRight() {\n dataMap.get(this).moveX = 5;\n }", "function moveRight() {\n undraw();\n //check if any of the tetromino's cells are on the right edge\n const isAtRightEdge = currentTetromino.some(index => (currentPosition + index) % width === width-1);\n //move tetromino to the right if none of its cells is at the left edge\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n \n //move tetromino one column to the right if any of its cells try and occupy a 'taken' cell\n if(currentTetromino.some(index=> squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1; \n }\n\n draw();\n }", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(\r\n index=> (currentPosition + index) % width === width - 1)\r\n \r\n if (!isAtRightEdge) {\r\n currentPosition += 1;\r\n }\r\n if (\r\n current.some((index) =>\r\n squares[currentPosition + index].classList.contains(\"taken\")\r\n )\r\n ) {\r\n currentPosition -= 1;\r\n }\r\n draw();\r\n }", "function moveRight(){\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition+index)%width === width-1);\n if(!isAtRightEdge) currentPosition +=1;\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\n currentPosition-=1;\n }\n\n draw();\n }", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some((index) => (currentPosition + index) % width === width - 1);\n if (!isAtRightEdge) currentPosition += 1;\n if (current.some((index) => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1;\n }\n draw();\n}", "function moveRight() {\n undraw()\n\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1)\n\n if (!isAtRightEdge) currentPosition += 1\n\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -= 1\n }\n\n draw()\n }", "function move_tile(tile)\n{\n var x = tile.ix * tile_width+2.5;\n var y = tile.iy * tile_height+2.5;\n tile.elem.css(\"left\",x);\n tile.elem.css(\"top\",y);\n}", "function moveRight() {\n undraw();\n // current position+index divided by width has no remainder\n const isAtRightEdge = current.some(\n //condition is at right hand side is true\n (index) => (currentPosition + index) % width === width - 1\n );\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n squares[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n draw();\n }", "function moveTilesRight() {\n for (var column = 2; column >= 0; column--) {\n for (var row = 3; row >= 0; row--) {\n if (checkRight(row, column) && tileArray[row][column] != null) {\n moveTileRight(row, column);\n }\n }\n }\n }", "function moveRight() {\n undraw()\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width -1)\n if(!isAtRightEdge) currentPosition +=1\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\n currentPosition -=1\n }\n draw()\n}", "function moveRight() {\n undraw();\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\n if(!isAtRightEdge) {\n currentPosition += 1;\n }\n if(current.some(index => squares[currentPosition + index].classList.contains('block2'))) {\n currentPosition -=1;\n }\n draw();\n }", "function moveRight() {\r\n undraw();\r\n const isAtRightEdge = current.some(index => (currentPosition + index) % width === width - 1);\r\n // allows shape to move right if it's not at the right position\r\n if (!isAtRightEdge) currentPosition += 1;\r\n\r\n // push it unto a tetrimino that is already on the right edge\r\n if (current.some(index => squares[currentPosition + index].classList.contains('taken'))) {\r\n currentPosition -= 1;\r\n\r\n }\r\n draw();\r\n}", "function moveRight() {\n unDraw();\n const isAtRightEdge = current.some(\n (index) => (currentPosition + index) % xPixel === xPixel - 1\n );\n\n if (!isAtRightEdge) currentPosition += 1;\n if (\n current.some((index) =>\n pixels[currentPosition + index].classList.contains(\"taken\")\n )\n ) {\n currentPosition -= 1;\n }\n\n draw();\n }", "function moveRight() {\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n 0\n );\n }\n\n GameData.column = correctColumn(GameData.column + 1);\n\n var grid = null;\n for(grid of GameData.activePiece.getOrientation()) {\n GameData.mainPlayField.setBlock(\n GameData.row + grid.getRow(),\n correctColumn(GameData.column + grid.getColumn()),\n GameData.activePiece.getType()\n );\n }\n}", "moveRight() {\n this.shinobiPos.x += 30\n }", "moveRight() {\r\n this.actual.moveRight();\r\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "function moveTile($base, $tile) {\n var baseData = $base.data('slidingtile'),\n options = baseData.options,\n emptyRow = baseData.emptyTile.row,\n emptyCol = baseData.emptyTile.col,\n tileData = $tile.data('slidingtile'),\n tileRow = tileData.cPos.row,\n tileCol = tileData.cPos.col;\n \n $base.data('slidingtile', {\n options: options,\n emptyTile: {\n row: tileRow,\n col: tileCol\n }\n });\n \n $tile\n .css('left', $base.width() / options.columns * emptyCol + 'px')\n .css('top', $base.height() / options.rows * emptyRow + 'px')\n .data('slidingtile', {\n cPos: {\n row: emptyRow,\n col: emptyCol\n }\n });\n \n updateClickHandlers($base);\n }", "function moveRight(){\r\n undraw()\r\n const isAtRightEdge = current.some(index => (currentPosition + index)%width === width -1)\r\n if(!isAtRightEdge) currentPosition +=1\r\n if(current.some(index => squares[currentPosition + index].classList.contains('taken'))){\r\n currentPosition -=1\r\n }\r\n draw()\r\n}", "function moveRight(){\n if(keyEnabled == true){\n undraw();\n const isAtRightEdge = currentShape.some(index => (currentPosition + index)% width === width - 1 )\n\n if(!isAtRightEdge)\n {\n currentPosition = currentPosition + 1;\n\n }\n\n if(currentShape.some(index => squares[currentPosition + index].classList.contains(\"taken\")))\n {\n currentPosition = currentPosition -1;\n }\n\n draw();\n }\n }", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "function move_right() {\n\t check_pos();\n\t blob_pos_x = blob_pos_x + move_speed;\n\t}", "getRightTile() {\n\t\treturn (this.position + this.sizeW - 1);\n\t}", "function moveRight() {\n\n\t\ttry {\n\t\t\t// Pass in the movement to the game.\n\t\t animation.move(\"x\", moveTypes.right);\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log(err);\n\t\t}\n\t}", "function moveTileHelper(tile) {\n var left = getLeftPosition(tile);\n var top = getTopPosition(tile);\n if (isMovable(left, top)) { // Move the tile to new position (if movable)\n tile.style.left = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE + \"px\";\n tile.style.top = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE + \"px\";\n EMPTY_TILE_POS_X = left / WIDTH_HEIGHT_OF_TILE;\n EMPTY_TILE_POS_Y = top / WIDTH_HEIGHT_OF_TILE;\n }\n }", "function moveRight(character) {\n const wallToRight = positionArray[character.currentPosition + 1].classList.contains('wall')\n if (wallToRight === false) {\n positionArray[character.currentPosition + 1].classList.add('swim-right')\n positionArray[character.currentPosition].classList.remove('swim-left', 'swim-up', 'swim-down', 'swim-right', 'enemyOnSquare')\n character.currentPosition++\n }\n }", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "function move_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\tthis.style.top = eTop + \"px\";\r\n\t\t\tthis.style.left = eLeft + \"px\";\r\n\t\t\teTop = originalTop;\r\n\t\t\teLeft = originalLeft;\r\n\t\t}\r\n\t}", "function moveRight() {\n removeShape();\n currentShape.x++;\n if (collides(grid, currentShape)) {\n currentShape.x--;\n }\n applyShape();\n}", "moveRight() {\n if (!this.collides(1, 0, this.shape)) this.pos.x++\n }", "function moveRight() {\n let prevCol;\n let curCol;\n\n for(y = 0; y < sizeHeight; y++) {\n for(x = 0; x < sizeWidth; x++) {\n if (x === 0) {\n prevCol = get((sizeWidth - 1) * sizeBlock + 1, y * sizeBlock + 1);\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x, y * sizeBlock, sizeBlock, sizeBlock);\n }\n else {\n prevCol = curCol;\n curCol = get(x * sizeBlock + 1, y * sizeBlock + 1);\n\n fill(prevCol);\n rect(x * sizeBlock, y * sizeBlock, sizeBlock, sizeBlock);\n\n }\n }\n }\n}", "moveRight() {\n this.x<303?this.x+=101:false;\n }", "moveRight() {\n if (this.x === this.tape[0].length - 1) {\n this.x = 0;\n } else {\n this.x++;\n }\n }", "move() {\n if (this.crashed) {\n return;\n }\n if (this.direction == 1) {\n this.y -= settings.step;\n }\n else if (this.direction == 2) {\n this.x += settings.step;\n }\n else if (this.direction == 3) {\n this.y += settings.step;\n }\n else if (this.direction == 4) {\n this.x -= settings.step;\n }\n }", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "move() {\n // Check if out of boundaries\n if (this.x + tileSize > w) {\n this.x = 0;\n }\n if (this.x < 0) {\n this.x = w;\n }\n if (this.y + tileSize > h) {\n this.y = 0;\n }\n if (this.y < 0) {\n this.y = h;\n }\n\n // If direction is up, move up (y-)\n if (this.direction == \"up\") {\n this.draw();\n this.y -= tileSize;\n }\n // If direction is left, move left (x-)\n if (this.direction == \"left\") {\n this.draw();\n this.x -= tileSize;\n }\n // If direction is right, move left (x+)\n if (this.direction == \"right\") {\n this.draw();\n this.x += tileSize;\n }\n // If direction is down, move down (y+)\n if (this.direction == \"down\") {\n this.draw();\n this.y += tileSize;\n }\n // If direction is none, return\n if (this.direction == \"none\") {\n this.draw();\n }\n\n\n // Check if head collided with body\n for (let index = 0; index < this.body.length; index++) {\n const bodyPart = this.body[index];\n if (bodyPart[0] == this.coords[0] && bodyPart[1] == this.coords[1]) {\n // Player died\n alert(`Ups! La serpiente no se puede comer a sí misma. Obtuviste ${score} puntos.`);\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function movezombieRight () {\n var pos = zombieObj[0].offsetLeft;\n if (pos >= 700) {\n pos = 600\n }\n pos += 0;\n zombieObj[0].style.left = pos + 'px';\n}", "function myMove(e) {\n x = e.pageX - canvas.offsetLeft;\n y = e.pageY - canvas.offsetTop;\n\n for (c = 0; c < tileColumnCount; c++) {\n for (r = 0; r < tileRowCount; r++) {\n if (c * (tileW + 3) < x && x < c * (tileW + 3) + tileW && r * (tileH + 3) < y && y < r * (tileH + 3) + tileH) {\n if (tiles[c][r].state == \"e\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"w\";\n\n boundX = c;\n boundY = r;\n\n }\n else if (tiles[c][r].state == \"w\" && (c != boundX || r != boundY)) {\n tiles[c][r].state = \"e\";\n\n boundX = c;\n boundY = r;\n\n }\n }\n }\n }\n}", "function moveRight() {\n if (flag) {\n flag = 0;\n //change the position of the element in array\n config.unshift(config.pop());\n //reset photos\n configImg();\n }\n }", "function moveTo(x, y) {\r\n var t = currentmap.getTile(x, y);\r\n if (t) {\r\n if (!t.doesCollide) {\r\n player.x = x;\r\n player.y = y;\r\n lastMouseX = -1;\r\n lastMouseY = -1;\r\n } else if (t.actionable) {\r\n tileActions[t.id](currentmap, x, y);\r\n }\r\n }\r\n}", "moveTile(pointer) {\n // if we can move...\n if (this.canMove) {\n // determine column according to input coordinate and tile size\n let column = Math.floor(pointer.x / this.tileSize);\n\n // get the ditance from current player tile and destination\n let distance = Math.floor(\n Math.abs(column * this.tileSize - this.player.x) / this.tileSize\n );\n\n // did we actually move?\n if (distance > 0) {\n // we can't move anymore\n this.canMove = false;\n\n // tween the player to destination tile\n this.tweens.add({\n targets: [this.player],\n x: column * this.tileSize,\n duration: distance * 30,\n callbackScope: this,\n onComplete: function() {\n // at the end of the tween, check for tile match\n this.checkMatch();\n },\n });\n }\n }\n }", "move() {\n this.x = this.x - 7\n }", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\n }", "function moveShipRight() {\n\tif(rightDown) {\n\t\tif(((fighter.position().left - (FIGHTER_WIDTH / 2)) / SCALE) + 1 < (WIDTH - FIGHTER_WIDTH * 2)) {\n\t\t\tfighter.css('left', \"+=2\");\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "move(){\n switch(this.direction){\n case \"n\":\n this.col-=1;\n this.direction=\"n\";\n break;\n case \"e\":\n this.row += 1;\n this.direction=\"e\"; \n break;\n case \"s\":\n this.col+=1;\n this.direction = \"s\";\n break;\n case \"w\":\n this. row -=1;\n this.direction=\"w\";\n }\n }", "function moveRight() {\n\t\tfor (var row = 0; row < Rows; row++) {\n\t\t\tarrayCol = new Array(Cols);\n\t\t\tfor (var col = 0; col < Cols; col++) {\n\t\t\t\tarrayCol[col] = matrix[row][Cols - 1 - col];\n\t\t\t}\n\t\t\tmatrix[row] = newArray(arrayCol).reverse();\n\t\t}\n\n\t\tdraw();\n\t}", "teleportTo(x,y){\r\n // Remove from current tile\r\n let currentTile = this.field.getTile(this.x, this.y);\r\n if (currentTile) currentTile.creature = null;\r\n // Update the stored position\r\n this.x = x;\r\n this.y = y;\r\n // Move the image\r\n let landingTile = this.field.getTile(this.x, this.y);\r\n if(landingTile.image) landingTile.image.append(this.image);\r\n landingTile.creature = this;\r\n }", "function myMove(e){\n x=e.pageX-canvas.offsetLeft;\n y=e.pageY-canvas.offsetTop;\n for(c=1;c<tileColCount;c++){\n for(r=1;r<tileRowCount;r++){\n if(c*(tileW+3)<x && x<c*(tileW+3)+tileW && r*(tileH+3)<y && y<r*(tileH+3)+tileH){\n if(tiles[c][r].state=='e'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='w';\n boundX=c;\n boundY=r;\n }\n else if(tiles[c][r].state=='w'&&(c!=boundX||r!=boundY)){\n tiles[c][r].state='e';\n boundX=c;\n boundY=r;\n }\n }\n }\n }\n}", "function tileClick() {\n\tmoveOneTile(this);\n}", "function canTileMove (x, y) {\n return ((x > 0 && canSwap(x, y, x-1 , y)) ||\n (x < cols-1 && canSwap(x, y, x+1 , y)) ||\n (y > 0 && canSwap(x, y, x , y-1)) ||\n (y < rows-1 && canSwap(x, y, x , y+1)));\n }", "moveEnemyLeftToRight() {\n if (!game.rightColumnEnemyIsInCanvasRightColumn()) {\n const nextCanvasColumnX = game.getXOfCanvasColumn(this.canvasColumn + 1);\n this.moveRightToTarget(nextCanvasColumnX);\n } else {\n this.lastMove = \"right\";\n this.moveEnemyDown();\n }\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "function moveWithLogRight() {\n if (currentIndex >= 27 && currentIndex < 35) {\n squares[currentIndex].classList.remove('frog');\n currentIndex += 1;\n squares[currentIndex].classList.add('frog');\n }\n }", "function move_right(a_pt, amount) {\n return make_point(a_pt.x + amount, a_pt.y);\n}", "function moveWithLogRight() {\n if (index > 18 && index <= 26) {\n squares[index].classList.remove('man')\n index -= 1\n squares[index].classList.add('man')\n }\n }", "function rMove(){\n\n if (position == left){\n flag = false; //flag set to false when it needs to start moving right\n }\n\n if (position > left) {\n position--;\n }\n \n obj.style.left = position + \"px\"; //adds the value px i.e #px\n}", "function moveTileDown(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row + 1, column)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"top\": \"+=\" + shiftValue }, 80, \"linear\", function () {\n\n //This happens at the end of each tile's movement\n if (checkRemove(row + 1, column)) {\n $(tileArray[row + 1][column]).remove();\n tileArray[row + 1][column] = null;\n } else {\n tileArray[row + 1][column].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row + 1][column].id.slice(5)) + 4));\n }\n });\n tileArray[row + 1][column] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "move() {\n\t\tthis.lastPosition = [ this.x, this.y ];\n\n\t\tthis.x += this.nextMove[0];\n\t\tthis.y += this.nextMove[1];\n\t}", "function move(dir)\n\t{\n\t\tif (unit.movePoints == 0) return;\t\t// no movepoints left\n\n\t\t// determine destination tile\n\t\tvar x = this.x, y = this.y;\n\t\tswitch (dir)\n\t\t{\n\t\t\tcase 0: y-=2; break;\t\t\t\t\t\t// straight up (y - 2)\n\t\t\tcase 1: x=y%2==0?x:x+1; y--; break;\t\t\t// upper right\n\t\t\tcase 2: x++; break;\n\t\t\tcase 3: x=y%2==0?x:x+1; y++; break;\n\t\t\tcase 4: y+=2; break;\n\t\t\tcase 5: x=y%2==0?x-1:x; y++; break;\n\t\t\tcase 6: x--; break;\n\t\t\tcase 7: x=y%2==0?x-1:x; y--; break;\n\t\t}\n\n\t\t// check if the destination tile is ok\n\t\tif (!isTileMoveable(x,y)) return;\n\n\t\tunit.div.removeClass(\"selected\").css(\"opacity\", 1);\n\n\t\tunit.x = x;\n\t\tunit.y = y;\n\t\tunit.movePoints--;\n\t\tupdate();\n\t}", "moveEnemyRightToLeft() {\n if (!game.leftColumnEnemyIsInCanvasLeftColumn()) {\n const nextCanvasColumnX = game.getXOfCanvasColumn(this.canvasColumn - 1);\n this.moveLeftToTarget(nextCanvasColumnX);\n } else {\n this.lastMove = \"left\";\n this.moveEnemyDown();\n }\n }", "function moveShapeRight()\n {\n undrawShape();\n\n // check to see if the shape is at the edge of the grid\n // this is to prevent the shape going out and appear from the other side of the grid\n const isAtRightEdge = currentShape.some(\n (index) => (currentPosition + index) % GRID_WIDTH === GRID_WIDTH -1);\n\n \n if(!isAtRightEdge)\n {\n currentPosition +=1;\n canRotate = true;\n }\n else if(isAtRightEdge)\n {\n canRotate = false;\n }\n\n\n let isCollisionSquare = currentShape.some(\n (index) => squares[currentPosition + index].classList.contains(\"taken\"))\n \n \n if(isCollisionSquare)\n {\n currentPosition-=1 // dont move the shape to the Right \n }\n\n drawShape();\n\n }", "function moveRight(rover) {\n\n switch (rover.direction) {\n\n case \"N\":\n rover.direction = \"E\";\n break;\n\n case \"E\":\n rover.direction = \"S\";\n break;\n\n case \"S\":\n rover.direction = \"W\";\n break;\n\n case \"W\":\n rover.direction = \"N\";\n break;\n }\n}", "function editorRedoTile(game, map, px, py) {\n if (px < 0 || py < 0 || px > map.x - 1 || py > map.y - 1) return;\n editorDestroyTile(map, px, py);\n mapCreateSingleTile(game, map, px, py, edTiles[px + py*map.x], true);\n}", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "function push(dir, x, y) {\n // find the offset from the player's tile of the tile to push\n var xadd = 0;\n var yadd = 0;\n if (dir === 0) xadd = 1;\n if (dir === 1) yadd = -1;\n if (dir === 2) xadd = -1;\n if (dir === 3) yadd = 1;\n var tile_x = x + xadd;\n var tile_y = y + yadd;\n if (tile_x >= MAP_WIDTH || tile_x < 0 || tile_y >= MAP_HEIGHT || tile_y < 0) return;\n // find tile that will be pushed (if possible) \n if (map[tile_y][tile_x]['move']) {\n // make sure no blocks in the way of a pushable block\n if (map[tile_y+yadd][tile_x+xadd]['type'] === ' ') {\n // recurse for sliding tiles\n if (map[tile_y][tile_x]['slide']) {\n slide(dir, tile_x, tile_y, xadd, yadd);\n return;\n }\n // set the tiles' x and newx, so they animate\n map[tile_y][tile_x]['x'] = tile_x;\n map[tile_y][tile_x]['newx'] = tile_x + xadd;\n map[tile_y+yadd][tile_x+xadd]['x'] = tile_x;\n map[tile_y+yadd][tile_x+xadd]['newx'] = tile_x + xadd;\n map[tile_y][tile_x]['y'] = tile_y;\n map[tile_y][tile_x]['newy'] = tile_y + yadd;\n map[tile_y+yadd][tile_x+xadd]['y'] = tile_y;\n map[tile_y+yadd][tile_x+xadd]['newy'] = tile_y + yadd;\n\n }\n }\n}", "move() {\n switch (this.f) {\n case NORTH:\n if(this.y + 1 < this.sizeY) this.y++;\n break;\n case SOUTH:\n if(this.y > 0) this.y--;\n break;\n case EAST:\n if(this.x + 1 < this.sizeX) this.x++;\n break;\n case WEST:\n default:\n if(this.x > 0) this.x--;\n }\n }", "move(mapX, mapY) {\n // check if it is a walkable tile\n let walkable = this.dontTreadOnMe();\n if (this.state.healing) {\n walkable[this.state.villager.map[0]-1][this.state.villager.map[1]-1] = 0;\n }\n if (walkable[mapX-1][mapY-1] === 0) {\n // use easy-astar npm to generate array of coordinates to goal\n const startPos = {x:this.state.playerMap[0], y:this.state.playerMap[1]};\n const endPos = {x:mapX,y:mapY};\n const aStarPath = aStar((x, y)=>{\n if (walkable[x-1][y-1] === 0) {\n return true; // 0 means road\n } else {\n return false; // 1 means wall\n }\n }, startPos, endPos);\n let path = aStarPath.map( element => [element.x, element.y]);\n if (this.state.healing) { path.pop() };\n this.setState({moving: true}, () => this.direction(path));\n };\n }", "function moveRight(){\n ctx.clearRect(0, 0, 450, 450);\n\n if(restart == 1){\n drawConstant=0;\n drawImageInCanvas(container);\n return;\n }\n\n if(empty == 1 || empty == 4 || empty == 7){\n moves--;\n drawConstant++;\n drawImageInCanvas(container);\n }else{\n let curr = empty;\n empty = empty-1;\n let next = empty;\n shuffledArray[curr-1] = shuffledArray[next-1];\n shuffledArray[next-1] = 0;\n drawConstant++;\n drawImageInCanvas(container);\n }\n}", "function moveShapeRight(){\n square_pos = 0;\n for( var i = 0; i < 32; i+= 2){\n positions[square_pos+i] = positions[square_pos+i] + 0.1*(X_MAX-X_MIN);\n }\n main();\n}", "moveRight() {\n this.point.x += this.scrollSpeed;\n }", "move(direction) {\n // NOTE: West movement should -- and east should ++. Need to work on map orientation\n if (direction === \"north\" && this.currentCell.hasLink(this.currentCell.north) === true) {\n //alert(\"north\");\n this.y++;\n this.currentCell = this.currentCell.north;\n }\n if (direction === \"west\" && this.currentCell.hasLink(this.currentCell.west) === true) {\n //alert(\"west\");\n this.x--;\n this.currentCell = this.currentCell.west;\n }\n if (direction === \"south\" && this.currentCell.hasLink(this.currentCell.south) === true) {\n //alert(\"south\");\n this.y--;\n this.currentCell = this.currentCell.south;\n }\n if (direction === \"east\" && this.currentCell.hasLink(this.currentCell.east) === true) {\n //alert(\"east\");\n this.x++;\n this.currentCell = this.currentCell.east;\n }\n }", "turnRight() {\n if (DIRECTIONS.indexOf(this.position.heading) === 3) {\n this.position.heading = DIRECTIONS[0];\n } else {\n this.position.heading =\n DIRECTIONS[DIRECTIONS.indexOf(this.position.heading) + 1];\n }\n }", "_moveRight() {\n const reservedWidth = Math.max(this._settings.showCount, this._settings.moveCount);\n const isEnoughSpace = this._currentPosition + reservedWidth < this._items.length;\n\n if (!isEnoughSpace) {\n this._moveRightInfinity();\n return;\n }\n\n for (let moved = 0; moved < this._settings.moveCount; moved++) {\n const isEnoughSpace = (this._currentPosition + this._settings.showCount) < this._items.length;\n if (!isEnoughSpace) break;\n\n this._itemsHolder.style.transition = `transform ${ this._settings.movementSmooth }ms`;\n\n const currentItem = this._items[this._currentPosition];\n this._offset -= currentItem.offsetWidth + this._settings.slidesSpacing;\n\n this._itemsHolder.style.transform = `translateX(${ this._offset - this._calcOppositeRight() }px)`;\n\n this._currentPosition += 1;\n }\n this._adaptViewWrapSizes();\n this._setDisplayedItemsClasses();\n }", "function swapWithRightTiles(pos, g) {\n\t\t// center position.\n\t\tlet taps = [];\n\t\tlet tp = function(tile) {\n\t\t\tlet tapped = tap(tile,g);\n\t\t\ttaps.push(tapped);\n\t\t}\n\t\tlet [r,c] = [pos[0]+1, pos[1]];\n\t\tlet [\n\t\t\tt1,t2,t3,t4,t5,t6,t7,t8,t9\n\t\t]\n\t\t\t= [\n\t\t\t[r-1,c-1], [r-1,c], [r-1,c+1], [r,c-1], [r,c], [r,c+1], [r+1,c-1], [r+1,c], [r+1,c+1]\n\t\t];\n\n\t\tif(![t1,t2,t3,t4,t5,t6,t7,t8,t9].every(t=>tileExists(t,g))) {\n\t\t\treturn false;\n\t\t}\n\n\t\ttaps.push(...moveSpaceTo(t5,g,{avoids:[t1,t2,t3],test:false}));\n\t\ttp(t2);\n\t\t//rotate counter-clockwisely.\n\t\t[t3,t6,t9,t8,t7,t4,t1].forEach(t=>tp(t));\n\t\ttp(t2);\n\t\ttp(t5);\n\t\ttp(t6);\n\t\t//rotate clockwisely to turn [t1,t2,t3] back to top row;\n\t\t[t3,t2,t1,t4].forEach(t=>tp(t));\n\t\treturn taps;\n\t}", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function moveRight() {\n //if the player moves from the initial position horizontally and faces a wall\n if (firstLevel[playerPosI][playerPosJ + 1] == \"x\") {\n //prevent the player from moving; retutn the player\n return;\n }\n //if the player moves from the initial position horizontally and faces a box\n if (firstLevel[playerPosI][playerPosJ + 1] == \"*\") {\n //when moving a box and the second consecutive position after the player moves the box\n //when the position is not the wall and not a box\n if (firstLevel[playerPosI][playerPosJ + 2] != \"x\" && firstLevel[playerPosI][playerPosJ + 2] != \"*\") {\n //when on the goal position\n if (isOverGoal(playerPosI, playerPosJ) == true) {\n //update to goal point symbol\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //update to floor symbol\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //vertical position of the player remains the same\n playerPosI = playerPosI;\n //horizonatl chaqnges one step at the time\n playerPosJ = playerPosJ + 1;\n //position of the player\n firstLevel[playerPosI][playerPosJ] = \"&\";\n // player moves together with box\n firstLevel[playerPosI][playerPosJ + 1] = \"*\";\n }\n } else {\n //if player is on the goal position changed the symbol to player\n if (isOverGoal(playerPosI, playerPosJ) == true){\n firstLevel[playerPosI][playerPosJ] = \"#\";\n } else {\n //if not a player change to floor symbol\n firstLevel[playerPosI][playerPosJ] = \"o\";\n }\n //when the player is moving right\n //vertical position remain the same\n playerPosI = playerPosI;\n // when moving horizontally add one to indicate that\n playerPosJ = playerPosJ + 1;\n //assign the symbol for the player\n firstLevel[playerPosI][playerPosJ] = \"&\";\n }\n printArrayHTML(firstLevel);\n}", "function moveToRight() {\n picture.animate(\n [\n { transform: 'translateX(10vh)', opacity: 0 },\n { transform: 'translateX(0)', opacity: 1 },\n ],\n {\n duration: 700,\n easing: 'cubic-bezier(0.25, 0.46, 0.45, 0.94)',\n fill: 'both',\n }\n );\n}", "moveLeft() {\n dataMap.get(this).moveX = -5;\n }", "move() {\n this.x += this.xdir * .5;\n this.y += this.ydir * .5;\n }", "function moveTileLeft(row, column) {\n\n //This happens as soon as the player makes a move\n if (checkRemove(row, column - 1)) {\n doubleColor = tileArray[row][column].style.backgroundColor;\n removals++;\n if (removals == 1) {\n // This will cause the creation of a new center tile, once all movements have been processed\n createNewCenterTile = true;\n }\n }\n\n // This is the animation\n $(tileArray[row][column]).animate({ \"left\": \"-=\" + shiftValue }, 80, \"linear\", function () {\n\n // This happens at the end of each tile's movement\n if (checkRemove(row, column - 1)) {\n $(tileArray[row][column - 1]).remove();\n tileArray[row][column - 1] = null;\n } else {\n tileArray[row][column - 1].setAttribute(\"id\", \"tile-\" + (parseInt(tileArray[row][column - 1].id.slice(5)) - 1));\n } \n });\n tileArray[row][column - 1] = tileArray[row][column];\n tileArray[row][column] = null;\n }", "function moveRight(){\nif(currentPosition < end) {\n paddleCollision()\n player.style.left = currentPosition + 5 + 'px';\n }\n}", "move() \n\t{\n\t\tthis.raindrop.nudge(0,-1,0);\n\n\t\tif (this.raindrop.getY() <= this.belowplane ) \n\t\t{\n\t\t\t//setting the y value to a certain number\n\t\t\tthis.raindrop.setY(random(200,400))\n\t\t}\n\t}", "rotate_tile(tile_pos){\n var tile = this.grid[tile_pos.x][tile_pos.y]\n if(tile != null){\n tile.rotate(this.grid)\n // Update the tile we're pointing at\n var relative_position = number_map.get(tile.end_dir)\n var absolute_position = {x:tile.x + relative_position.x, y:tile.y + relative_position.y}\n this.update_tile(absolute_position)\n\n }\n }", "function move(dir, dist) {\n var newx = player['x'];\n var newy = player['y'];\n // set default distance to 1\n mode = typeof mode !== 'undefined' ? mode : 1;\n // adjust position based on distance to be moved\n if (dir == 0) newx+=dist;\n if (dir == 1) newy-=dist;\n if (dir == 2) newx-=dist;\n if (dir == 3) newy+=dist;\n // check that the move is possible:\n var fail = false; // gets set to true if dist > 1 and we fail a check_move\n \n // checks if a tile we want to move onto is currently in motion, &\n // if so, don't allow the move\n // TODO 'newy' & 'newx' are undefined if attempting to move/jump off the map, which throws some type errors.\n // check for this in the future to suppress that crap\n if (map[newy][newx]['x'] != map[newy][newx]['newx']\n || map[newy][newx]['y'] != map[newy][newx]['newy']) {\n fail = true;\n }\n\n // check moves that are > 1 space\n if (dist > 1) { \n // we need to check all possible spaces that the player will pass over,\n // and need to check that both the side we are moving from and the side\n // we are moving out of are free, otherwise don't even check the end tile\n // as we do below\n var tempnewx = player['x'];\n var tempnewy = player['y'];\n // check the space 2 away to make sure we can move OFF the space we are jumping over,\n // as well as ONTO it (which is checked with tempnewx, tempnewy)\n var tempnewx2 = player['x'];\n var tempnewy2 = player['y'];\n\n for (i=1; i<dist; i++) {\n if (dir == 0) tempnewx = player['x'] + i;\n if (dir == 1) tempnewy = player['y'] - i;\n if (dir == 2) tempnewx = player['x'] - i;\n if (dir == 3) tempnewy = player['y'] + i;\n if (dir == 0) tempnewx2 = player['x'] + (i + 1);\n if (dir == 1) tempnewy2 = player['y'] - (i + 1);\n if (dir == 2) tempnewx2 = player['x'] - (i + 1);\n if (dir == 3) tempnewy2 = player['y'] + (i + 1);\n\n // if any of the spaces we move over fail a check_move check\n // if the tile is lava we can ignore the check_move result\n if (map[tempnewy][tempnewx]['type'] != ' '\n // if there is a NON-LAVA tile, then the check_move for that tile needs to pass\n && (!(check_move(player['x'], player['y'], tempnewx, tempnewy, dir)) \n || !(check_move(tempnewx, tempnewy, tempnewx2, tempnewy2, dir)))) {\n //console.log(\"JUMPBLOCKED\")\n fail = true; // don't really need this because we break i guess\n break;\n } \n }\n }\n\n // check the start space and end space (above code checks in between spaces if dist > 1)\n if (!fail && (check_move(player['x'], player['y'], newx, newy, dir))) {\n // console.log('Player moved from (' + player[0] + ', ' + player[1] +\n // ') to (' + x + ', ' + y + ')');\n //add_move(player[0], player[1], x, y, dir, TWEENSPEED);\n player['newx'] = newx;\n player['newy'] = newy;\n }\n}", "function makeMove(tile, dstRow, dstCol, record){\n var now = Date.now();\n var timeDiff = now - window.lastMoveTime;\n window.lastMoveTime = now;\n var dstX = dstCol * window.TILE_DIMENSION;\n var dstY = dstRow * window.TILE_DIMENSION;\n var oldRow = tile.row;\n var oldCol = tile.col;\n //Update the board position\n moveTile(puzzle.grid, tile.row, tile.col, dstRow, dstCol);\n if (record){\n window.moveRecord.push([[[oldRow, oldCol],[dstRow, dstCol]], stringifyGrid(window.puzzle.grid), timeDiff]);\n }\n //Move the tile.\n tile.disp.style.left = dstX+\"px\";\n tile.disp.style.top = dstY+\"px\";\n //Update which tiles are moveable.\n window.puzzle.updateMovable(oldRow, oldCol);\n if (record && distance(puzzle.grid) == 0){\n taskComplete();\n }\n}", "move() { }", "move() { }", "function move(direction) {\n getPlayerPosition().pop();\n switch (direction) {\n case 'U':\n if (\n board[player.position.row - 1][player.position.column][0].type ===\n 'wall'\n ) {\n print('You bumped into a wall loser!');\n } else {\n player.position.row -= 1;\n }\n break;\n case 'D':\n if (\n board[player.position.row + 1][player.position.column][0].type ===\n 'wall'\n ) {\n print('You bumped into a wall loser!');\n } else {\n player.position.row += 1;\n }\n break;\n case 'L':\n if (\n board[player.position.row][player.position.column - 1][0].type ===\n 'wall'\n ) {\n print('You bumped into a wall loser!');\n } else {\n player.position.column -= 1;\n }\n break;\n case 'R':\n if (\n board[player.position.row][player.position.column + 1][0].type ===\n 'wall'\n ) {\n print('You bumped into a wall loser!');\n } else {\n player.position.column += 1;\n }\n break;\n }\n getPlayerPosition().push(player);\n verifyPosition();\n printBoard();\n}", "move() {\n switch (this.machineTable[this.state][this.lastRead].move) {\n case directions.UP:\n return this.moveUp();\n case directions.RIGHT:\n return this.moveRight();\n case directions.DOWN:\n return this.moveDown();\n case directions.LEFT:\n return this.moveLeft();\n default:\n }\n }" ]
[ "0.79783547", "0.7548235", "0.75283843", "0.75170714", "0.7513188", "0.74976325", "0.7497593", "0.749314", "0.74784356", "0.74557966", "0.74305856", "0.7400828", "0.73980963", "0.7367278", "0.7363921", "0.7336984", "0.732208", "0.73014694", "0.7295661", "0.72582906", "0.7234791", "0.7228579", "0.7211025", "0.72073567", "0.7177896", "0.7119664", "0.7116432", "0.71128535", "0.70104605", "0.6978094", "0.69552726", "0.69374055", "0.6909937", "0.6898254", "0.6836634", "0.6797375", "0.67928934", "0.6749764", "0.6694128", "0.6674612", "0.66585004", "0.66570294", "0.66503775", "0.66467273", "0.6593521", "0.65790457", "0.65648556", "0.6559866", "0.6557813", "0.6543316", "0.6538251", "0.65305614", "0.65249974", "0.650784", "0.6485266", "0.64785236", "0.6471748", "0.6464814", "0.64569736", "0.64552724", "0.6431908", "0.642835", "0.6416849", "0.64092326", "0.6408555", "0.6401527", "0.6392662", "0.63924646", "0.6387653", "0.6373047", "0.63682973", "0.6365836", "0.63653743", "0.6354959", "0.6352399", "0.6344317", "0.63301307", "0.6319939", "0.6311459", "0.63035", "0.6299952", "0.6291361", "0.62781435", "0.62643254", "0.62462944", "0.62388694", "0.62151295", "0.61905843", "0.6187648", "0.6185836", "0.618463", "0.61823463", "0.6160509", "0.6159581", "0.61595076", "0.6156819", "0.61565787", "0.61565787", "0.6144313", "0.61405754" ]
0.7479671
8
Check to see if a particular tile should be removed from the board
function checkRemove(row, column) { if (!isEdge(row, column)) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkChow(tile) {\n return Evaluator.getDiscardedChow(this, tile).length > 0;\n }", "function canMove(tile) {\n\tvar left = parseInt(tile.getStyle(\"left\"));\n\tvar top = parseInt(tile.getStyle(\"top\"));\n\tvar otherLeft = parseInt(row) * TILE_AREA;\n\tvar otherTop = parseInt(col) * TILE_AREA;\n\t\n\t// checks to see if the tile is next to the empty square tile\n\tif(Math.abs(otherLeft - left) == TILE_AREA && Math.abs(otherTop - top) == 0) {\n\t\treturn true;\n\t} else if(Math.abs(otherLeft - left) == 0 && Math.abs(otherTop - top) == TILE_AREA) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "hasSafeTiles(){\n return this._numberOfTiles !== this._numberOfBombs;\n }", "function removeHelper(tile){\n\t \tif(parseInt(tile.attr('sizex')) <= 0 || parseInt(tile.attr('sizey')) <= 0){\n\t \t\t$.when(tile.fadeOut()).then(function(){\n\t \t\t\ttile.remove();\n\t \t\t});\n\t \t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t \t\t\tif(tiles[i] == tile.attr('id')){\n\t \t\t\t\ttiles.splice(i, 1);\n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t};\n\t \t}\n\t }", "function IsValidTile(x,y)\n{\n var TileToCheck = Tiles[x][y];\n var finalResult = false;\n\n if (TileToCheck.passable == true || TileToCheck.TileType == TilesNames.Void)\n {\n finalResult = true;\n }\n\n return finalResult;\n}", "outOfBounds() {\n const minX = this.x >= 0;\n const maxX = this.x < tileSizeFull * cols;\n const minY = this.y >= 0;\n const maxY = this.y < tileSizeFull * rows;\n\n if (!(minX && maxX && minY && maxY)) {\n this.removeSelf();\n }\n }", "deadTile(tile, tilesRemaining) {\n this.checkChicken(tilesRemaining);\n\n // all tiles are welcome in a chicken hand.\n if (this.chicken) return false;\n\n // is this in a suit we want to get rid of?\n if (this.playClean !== false && tile < 27) {\n let suit = this.suit(tile);\n if (this.playClean !== suit) {\n // return how many of this suit we're going to get rid of.\n return this.player.tiles.map(t => this.suit(t.getTileFace())).filter(s => s===suit).length;\n }\n }\n\n // is this tile part of a concealed pung,\n // while we're going for a chow hand?\n let stats = this.analyse();\n if (stats.locked.chows > 0 && stats.counts[tile] > 2) {\n return true;\n }\n\n return false;\n }", "function removeRemoves() {\n if (doubleAchieved == true) {\n for (var doubleRow = 0; doubleRow <= 3; doubleRow++) {\n for (var doubleColumn = 0; doubleColumn <= 3; doubleColumn++) {\n if (removeArray[doubleRow][doubleColumn] == \"remove\") {\n $(document.getElementById(\"tile-\" + (4 * doubleRow + doubleColumn + 1).toString())).remove();\n tileArray[doubleRow][doubleColumn] = null;\n removeArray[doubleRow][doubleColumn] = null;\n }\n }\n }\n doubleAchieved = false;\n }\n }", "isCollideWithTile(tile)\n {\n let position = this.position.copy();\n position.subtract(tile.position);\n let deltaPosition = position;\n\n return (Math.abs(deltaPosition.x) < this.#width\n && Math.abs(deltaPosition.y) < this.#height);\n }", "function checkIfMessileDropped(x,y,isPlayersTurn) {\r\n\r\n var board = isPlayersTurn? board2 : board1 ;\r\n\r\n /* board[x][y] has 0 then missile is dropped already */\r\n // alert(x+\",\"+y+\"[\"+board[x][y]+\"]\");\r\n return (board[x][y] == 0)? true: false ;\r\n}", "function checkTileExists(tile){\n for(let i=0; i<blk.length; i++){\n if(blk[i][0] === tile[0] && blk[i][1] === tile[1])\n return true;\n }\n return false;\n }", "function canDropPiece(board, row, col, pieceID){\n\n\t var piece = PIECES[pieceID];\n\n\t for(var i = 0; i < piece.length; i++) {\n\t for (var j = 0; j < piece[i].length; j++) {\n\t if (piece[i][j] && Board[row + i][col + j] != -1) return false;\n\t }\n\t }\n\t return true;\n\n\t}", "isAcceptableTile(x,y){\n let tile = this.scene.map.getTileAt(x, y, false, \"World\");\n return (!tile || this.pathfinder.acceptableTiles.includes(tile.index));\n }", "function isSafe(x, y) {\n if (x >= 0 && x < tileRowCount && y >= 0 && y < tileColumnCount && (tiles[x][y].state != 'w'))\n return true;\n\n return false;\n}", "processTileDiscardChoice(tile) {\n if (tile !== Constants.NOTILE) {\n var pos = this.tiles.indexOf(tile);\n this.tiles.splice(pos,1);\n this.log(this.name, 'discarding: ', tile);\n }\n this.connector.publish('discard-tile', { tile });\n }", "uncoverEmptyTiles(theRow, theCol, theBoard) {\n\n /* gets all surrounding tiles to tile at [xpos][ypos] */\n\n let surround = this.checkSurroundingArea(theRow, theCol, theBoard);\n\n surround.map(tile => {\n\n /* Check if this tile isn't revealed, flagged or a mine and is empty */\n if (!tile.mine && !tile.revealed && !tile.flag) {\n\n theBoard[tile.row][tile.col].revealed = true;\n\n /* since this tile is empty, check recursively all around this tile too */\n if (tile.mineCount === 0) {\n\n this.uncoverEmptyTiles(tile.row, tile.col, theBoard);\n\n }\n }\n\n });\n\n return theBoard;\n }", "function removePiece() {\n var block = piece.pieceName;\n for(var i = 0;i < block.length; i++)\n for(var j = 0; j < block.length; j++)\n if( block[i][j] == 1)\n drawPixel( piece.xPos +j, piece.yPos+i, boardColour);\n}", "checkIfPieceAtSquare(board, expectedMoves){\n expectedMoves.forEach(move => {\n\n let myPieceAtSquare = board.getPiece(move);\n // should returns this.board[row][col]\n console.log(\"myPieceAtSquare\", myPieceAtSquare)\n\n if(myPieceAtSquare){\n expectedMoves.pop(move)\n }\n\n });\n return expectedMoves\n }", "function checkHitOrMiss(x, y, isPlayersTurn)\r\n{\r\n var board = isPlayersTurn? board2 : board1 ;\r\n\r\n /* board[x][y] has -1 then there's nothing there. Its a miss*/\r\n // alert(x+\",\"+y+\"[\"+board[x][y]+\"]\");\r\n return (board[x][y] == -1)?false : true ;\r\n}", "function singleTileDesertEliminationCheck(x, y, depth)\r\n{\r\n var surroundingTiles = getCardinalTiles(x,y);\r\n var nTile = surroundingTiles[0];\r\n var eTile = surroundingTiles[1];\r\n var sTile = surroundingTiles[2];\r\n var wTile = surroundingTiles[3];\r\n\r\n //check if we are a single coast tile (no chunks can match a 1 tile coast)\r\n var isSingle = false;\r\n if(nTile.biomeType == BIOME_DESERT && eTile.biomeType != BIOME_DESERT && sTile.biomeType != BIOME_DESERT && wTile.biomeType != BIOME_DESERT){isSingle=true;}\r\n else if(nTile.biomeType != BIOME_DESERT && eTile.biomeType == BIOME_DESERT && sTile.biomeType != BIOME_DESERT && wTile.biomeType != BIOME_DESERT){isSingle=true;}\r\n else if(nTile.biomeType != BIOME_DESERT && eTile.biomeType != BIOME_DESERT && sTile.biomeType == BIOME_DESERT && wTile.biomeType != BIOME_DESERT){isSingle=true;}\r\n else if(nTile.biomeType != BIOME_DESERT && eTile.biomeType != BIOME_DESERT && sTile.biomeType != BIOME_DESERT && wTile.biomeType == BIOME_DESERT){isSingle=true;}\r\n else if(nTile.biomeType == BIOME_DESERT && eTile.biomeType != BIOME_DESERT && sTile.biomeType == BIOME_DESERT && wTile.biomeType != BIOME_DESERT){isSingle=true;}\r\n else if(nTile.biomeType != BIOME_DESERT && eTile.biomeType == BIOME_DESERT && sTile.biomeType != BIOME_DESERT && wTile.biomeType == BIOME_DESERT){isSingle=true;}\r\n\r\n if(isSingle == true)\r\n {\r\n worldMapArray[y][x].biomeType = BIOME_GRASS; //to eliminate single tiles we transform them into grass\r\n worldMapArray[y][x].tile = 0xF3;\r\n worldMapArray[y][x].modifier = 0x00;\r\n\r\n if(depth > 0)\r\n {\r\n depth -= 1;\r\n singleTileDesertEliminationCheck(x-1,y,depth);\r\n singleTileDesertEliminationCheck(x+1,y,depth);\r\n singleTileDesertEliminationCheck(x,y-1,depth);\r\n singleTileDesertEliminationCheck(x,y+1,depth);\r\n }\r\n }\r\n}", "function canTileMove (x, y) {\n return ((x > 0 && canSwap(x, y, x-1 , y)) ||\n (x < cols-1 && canSwap(x, y, x+1 , y)) ||\n (y > 0 && canSwap(x, y, x , y-1)) ||\n (y < rows-1 && canSwap(x, y, x , y+1)));\n }", "checkWin(tile = null) {\n if (tile === null) {\n return Evaluator.getWinningMelds(this).length > 0;\n } else {\n this.addTile(tile);\n const bool = Evaluator.getWinningMelds(this).length > 0;\n this.removeTile(tile);\n return bool;\n }\n\n }", "doubleClickTile(row, col){\n\n let tile = this.grid[row][col];\n if(tile.isRevealed){\n let neighbours = MineSweeper.getNeighbours((row == 0), (row == this.rows - 1), (col == 0), (col == this.cols - 1));\n let flaggedNeighbours = 0;\n for(let neighbour of neighbours){\n let r = row + neighbour[0],\n c = col + neighbour[1];\n if (this.grid[r][c].isFlagged){\n flaggedNeighbours++;\n }\n }\n\n let winner = false;\n if(flaggedNeighbours == tile.surroundingBombs){\n for(let neighbour of neighbours){\n let r = row + neighbour[0],\n c = col + neighbour[1];\n if (!this.grid[r][c].isFlagged){\n winner = winner || this.clickTile(r,c, 0);\n }\n }\n }\n return winner;\n }\n }", "function hasMoves () {\n for (var x = 0; x < cols; x++) {\n for (var y = 0; y < rows; y++) {\n if (canTileMove(x, y)) {\n return true;\n }\n }\n }\n return false;\n }", "_removeTile(key) {\n const tile = this._tiles[key]\n if (!tile) {\n return\n }\n\n const clusters = this._tileClusters[key]\n\n if (clusters) {\n clusters.forEach(layer => this._clusters.removeLayer(layer))\n }\n\n delete this._tiles[key]\n\n this.fire('tileunload', {\n tileId: key,\n coords: this._keyToTileCoords(key),\n })\n }", "function cell_unblocked(grid, row, col) {\n if (grid[row][col] === 1) return true;\n else return false;\n}", "function checkIfAnyTileCanMove() {\n function checkTile(tile, direction) {\n // Calculates the position of the next cell\n // in the direction of the movement.\n const nextX = tile.x + direction.x;\n const nextY = tile.y + direction.y;\n\n // If next cell is out of bound stop.\n if (nextX > 3 || nextY > 3 || nextX < 0 || nextY < 0) {\n return false;\n }\n\n const nextCell = grid[nextY][nextX];\n const canMove = !nextCell || nextCell.value === tile.value;\n\n return canMove;\n }\n\n let canAnyTileMove = false;\n loopGrid((x, y) => {\n const cell = grid[y][x];\n const tile = {\n id: cell.id,\n value: cell.value,\n x,\n y,\n };\n // Checks move to the right.\n const canMoveRight = !!checkTile(tile, { x: 1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveRight;\n if (canAnyTileMove) return true;\n // Checks move to the left.\n const canMoveLeft = !!checkTile(tile, { x: -1, y: 0 });\n canAnyTileMove = canAnyTileMove || canMoveLeft;\n if (canAnyTileMove) return true;\n // Checks move to the top.\n const canMoveUp = !!checkTile(tile, { x: 0, y: -1 });\n canAnyTileMove = canAnyTileMove || canMoveUp;\n if (canAnyTileMove) return true;\n // Checks move to the bottom.\n const canMoveDown = !!checkTile(tile, { x: 0, y: 1 });\n canAnyTileMove = canAnyTileMove || canMoveDown;\n if (canAnyTileMove) return true;\n\n return false;\n });\n\n return canAnyTileMove;\n}", "function isMovable(x, y) {\n var currentEmptyTileX = EMPTY_TILE_POS_X * WIDTH_HEIGHT_OF_TILE;\n var currentEmptyTileY = EMPTY_TILE_POS_Y * WIDTH_HEIGHT_OF_TILE;\n \n // LS: x - WIDTH_HEIGHT_OF_TILE == currentEmptyTileX\n // RS: x + WIDTH_HEIGHT_OF_TILE == currentEmptyTileX\n if (y == currentEmptyTileY && \n (x - WIDTH_HEIGHT_OF_TILE == currentEmptyTileX ||\n x + WIDTH_HEIGHT_OF_TILE == currentEmptyTileX)) {\n return true;\n }\n \n // Top: y - WIDTH_HEIGHT_OF_TILE == currentEmptyTileY\n // Bottom: y + WIDTH_HEIGHT_OF_TILE == currentEmptyTileY\n if (x == currentEmptyTileX &&\n (y - WIDTH_HEIGHT_OF_TILE == currentEmptyTileY ||\n y + WIDTH_HEIGHT_OF_TILE == currentEmptyTileY)) {\n return true;\n }\n \n return false;\n }", "function isThereAMatch() {\n return (tiles_values[0] === tiles_values[1]);\n}", "isMoveLegal(piece) {\n // copy the currentBoard\n let currentBoard = JSON.parse(JSON.stringify(this.state.board));\n\n // check for illegal movement into existing floor or border, or nonexistent piece\n let illegalMove = false;\n piece.squares.forEach((square) => {\n let boardSquare = currentBoard[square[0]][square[1]];\n\n if (!boardSquare || boardSquare.type !== \"background\") {\n illegalMove = true\n }\n });\n //console.log(`illegalMove: ${illegalMove}`)\n if (illegalMove) { return false; }\n\n return true;\n }", "function unUsedInBox(solutionGrid, rowStart, colStart, num) \n { \n for (let i = 0; i<3; i++) \n for (let j = 0; j<3; j++) \n if (solutionGrid[rowStart+i][colStart+j]==num) \n return false; \n\n return true; \n }", "function eliminateSingleTiles()\r\n{\r\n for(var y = 3; y < WORLD_SIZE_MAX-3; ++y)\r\n {\r\n for(var x = 3; x < WORLD_SIZE_MAX-3; ++x)\r\n {\r\n if(worldMapArray[y][x].isStatic == false)\r\n {\r\n singleTileCoastEliminationCheck(x, y, 2);\r\n\r\n if(worldMapArray[y][x].biomeType == BIOME_DESERT)\r\n {\r\n singleTileDesertEliminationCheck(x, y, 2);\r\n }\r\n }\r\n }\r\n }\r\n}", "function checkDoubles() {\n if (removals == 2) {\n for (var row = 0; row <= 3; row++) {\n for (var column = 0; column <= 3; column++) {\n if (tileArray[row][column] != null && ((row != 1 && row != 2) || (column != 1 & column != 2))) {\n if (tileArray[row][column].style.backgroundColor == doubleColor) {\n removeArray[row][column] = \"remove\";\n removals++;\n doubleAchieved = true;\n }\n }\n }\n }\n }\n }", "function undrawPiece() {\nfor (var i =0; i<active.location.length;i++){\n row = active.location[i][0];\n col = active.location[i][1];\n if( grid[row][col] !== BORDER){\n\n\n ctx.fillStyle = \"black\";\n ctx.fillRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n ctx.strokeStyle = \"white\";\n ctx.strokeRect(col * SQUARE_SIZE, row * SQUARE_SIZE, SQUARE_SIZE, SQUARE_SIZE);\n grid[row][col] = -1;}\n}\n}", "tileIsOccupied(workerList, posn) {\n return workerList.some(function (iw) {\n return iw.x === posn.x && iw.y === posn.y;\n });\n }", "removeObstacle(x, y, width, height) {\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n this.setTile(1, x+i, y+j, 0);\n }\n }\n }", "checkTileHit(x, y){\n\t\tif(!this.grid[x][y]['isHit']){\n\t\t\tvar didHit = false;\n\t\t\tthis.grid[x][y]['isHit'] = true;\n\n\t\t\tswitch(this.grid[x][y]['isShip']){\n\t\t\t\tcase shipType.CARRIER:\n\t\t\t\t\tthis.ships.CARRIER--;\n\t\t\t\t\tif(this.ships.CARRIER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte hangarfartyget.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte hangarfartyget.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte hangarfartyget.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte hangarfartyget.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.BATTLESHIP:\n\t\t\t\t\tthis.ships.BATTLESHIP--;\n\t\t\t\t\tif(this.ships.BATTLESHIP == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte slagsskeppet.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte slagsskeppet.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte slagsskeppet.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte slagsskeppet.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.CRUISER:\n\t\t\t\t\tthis.ships.CRUISER--;\n\t\t\t\t\tif(this.ships.CRUISER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte kryssaren.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte kryssaren.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte kryssaren.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte kryssaren.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.SUBMARINE:\n\t\t\t\t\tthis.ships.SUBMARINE--;\n\t\t\t\t\tif(this.ships.SUBMARINE == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte ubåten.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte ubåten.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte ubåten.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte ubåten.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t\tcase shipType.DESTROYER:\n\t\t\t\t\tthis.ships.DESTROYER--;\n\t\t\t\t\tif(this.ships.DESTROYER == 0){\n\t\t\t\t\t\tthis.ships.amount--;\n\n\t\t\t\t\t\tif(currentGame.isAiTurn){\n\t\t\t\t\t\t\tcurrentGame.printAction(p2.playername+\" sänkte jagaren.\");\n\t\t\t\t\t\t\tsendNotification(p2.playername+\" sänkte jagaren.\", \"success\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tcurrentGame.printAction(p1.playername+\" sänkte jagaren.\");\n\t\t\t\t\t\t\tsendNotification(p1.playername+\" sänkte jagaren.\", \"success\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdidHit = true;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif(this.isPlayer){\n\t\t\t\t$(\".player-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isHit\", \"true\");\n\n\t\t\t\tif(didHit){\n\t\t\t\t\t$(\".player-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isShip\", \"true\");\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\t$(\".enemy-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isHit\", \"true\");\n\n\t\t\t\tif(didHit){\n\t\t\t\t\t$(\".enemy-container div.grid_square[data-column='\"+x+\"'][data-row='\"+y+\"']\").attr(\"data-isShip\", \"true\");\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(this.isPlayer){\n\t\t\t\tp2.shots++;\n\t\t\t\tif(didHit){\n\t\t\t\t\tp2.hits++;\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\tp1.shots++;\n\t\t\t\tif(didHit){\n\t\t\t\t\tp1.hits++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\twasHit: false,\n\t\t\t\tshipHit: didHit\n\t\t\t};\n\t\t}\n\n\t\treturn {\n\t\t\twasHit: true\n\t\t};\n\t}", "function checkBelow(row, column) {\n if (!isEdge(row + 1, column) && tileArray[row][column] != null) {\n if (document.getElementById(\"center-tile\").style.backgroundColor == tileArray[row][column].style.backgroundColor) {\n return true;\n } else {\n return false;\n }\n } else {\n return !tileArray[row + 1][column];\n }\n }", "hasNeighbor(tile) {\n // tslint:disable-next-line:no-unsafe-any\n return tiled_1.BaseTile.prototype.hasNeighbor.call(this, tile);\n }", "addTile() {\n if(this.full()) {\n return false;\n }\n while(true) {\n let r = randIdx(this.board.length);\n let c = randIdx(this.board[r].length);\n if(this.board[r][c] == 0) {\n this.board[r][c] = randInt(1,2) * 2;\n return true;\n }\n }\n }", "discardTile(cleandeal) {\n // wins are automatic for now.\n if (this.rules.checkCoverage(this.tiles, this.bonus, this.revealed)) {\n return this.connector.publish('discard-tile', { tile: Constants.NOTILE, selfdrawn: true });\n }\n var tile = this.ai.determineDiscard();\n this.processTileDiscardChoice(tile);\n }", "cleanBoard(treeCheck) {\n for (let cell of this.board) {\n if (!treeCheck.includes(cell.index)) {\n cell.hasTree = false;\n cell.myTree = false;\n cell.ennemyTree = false;\n }\n }\n }", "function contentDelete(column,tile){\n if (grid[column][tile].content){\n }\n grid[column][tile].content = null;\n grid[column][tile].type = \"empty\";\n grid[column][tile].isWalkable = true;\n}", "function canMove(row, col) {\n if (!hasOppositeChecker(row, col, currentColor)) {\n if (isAKing(occupiedArray[row][col].id)) {\n if (!cellIsVacant(row + 1, col + 1) && !cellIsVacant(row + 1, col - 1) && !cellIsVacant(row - 1, col + 1) && !cellIsVacant(row - 1, col - 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"black\")) {\n if (!cellIsVacant(row + 1, col - 1) && !cellIsVacant(row + 1, col + 1)) {\n return false;\n }\n }\n else if (occupiedArray[row][col].classList.contains(\"red\")) {\n if (!cellIsVacant(row - 1, col - 1) && !cellIsVacant(row - 1, col + 1)) {\n return false;\n }\n }\n return true;\n }\n}", "function weaponTileCheck(weapons, player) {\n\n var aPosition = player.currentPos\n var aWeapon = weapons.find(e => e.currentPos.x == aPosition.x && e.currentPos.y == aPosition.y)\n if(aWeapon == undefined) {\n return;\n }\n console.log(\"This tile has a weapon!\", aWeapon);\n \n pickUpWeapon(aWeapon, player);\n\n var anIndex = weapons.indexOf(aWeapon)\n if (anIndex > -1) {\n weapons.splice(anIndex, 1); ///using .splice() to remove the weapon from the array\n }\n}", "function letterDestroyer(boardid, tileid, char) {\n var shoveTile = { boardPos: boardid, tileId : tileid, charVal: char, immobile: false };\n tileObj.push(shoveTile);\n var result = $.grep(boardObj, function(e){ return e.tileId == tileid; });\n if (result.length != 0) {\n var $temp = '#block-' + result[0].boardPos;\n $($temp).droppable(\"enable\");\n }\n boardObj = $.grep(boardObj, function(e){\n return e.tileId != tileid;\n });\n}", "discard (aabbs) {\n // Should the label be culled if it can't fit inside the tile bounds?\n if (this.options.cull_from_tile) {\n let in_tile = this.inTileBounds();\n\n // If it doesn't fit, should we try to move it into the tile bounds?\n if (!in_tile && this.options.move_into_tile) {\n // Can we fit the label into the tile?\n if (!this.moveIntoTile()) {\n return true; // can't fit in tile, discard\n }\n } else if (!in_tile) {\n return true; // out of tile bounds, discard\n }\n }\n\n // If the label hasn't been discarded yet, check to see if it's occluded by other labels\n return this.occluded(aabbs);\n }", "deadGrid() {\n for(let col = 0; col < this.width; col ++) {\n for(let row = 0; row < this.height; row++) {\n if(this.grid[col][row] == ALIVE){\n return false\n }\n }\n }\n return true\n }", "function movable_tiles(){\r\n\t\toriginalTop = parseInt(this.style.top);\r\n\t\toriginalLeft = parseInt(this.style.left);originalLeft\r\n\t\tif (originalTop == eTop && originalLeft == (eLeft-100) || originalTop == eTop && originalLeft == (eLeft+100) || originalTop == (eTop-100) && originalLeft == eLeft || originalTop == (eTop+100) && originalLeft == eLeft){\r\n\t\t\t$(this).addClass('movablepiece');\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$(this).removeClass(\"movablepiece\");\r\n\t\t}\r\n\t}", "isAdjacent(tile){\n\t\tif(Math.abs(tile.pos - emptyTile.pos) === 1 || Math.abs(tile.pos - emptyTile.pos) === this.cols) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function isGameOver() {\n // Check to see if the whole board is cleared\n return (tiles_flipped === tiles.length);\n}", "hasMoved() {\n return (this.color === Color.WHITE && this.row !== 6)\n || (this.color === Color.BLACK && this.row !== 1);\n }", "function test7() {\n currentPiece = new I();\n currentPiece.moveDown()\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "function drop_piece(col, pNum){\n for (var row = 0; row < 4; row++){\n if (board[row][col]>0){\n if (row < 1 ){\n console.log(\"Invalid Move\");\n break;\n }\n else{\n board [row-1][col] = pNum;\n console.log(\"Found it\");\n break;\n }\n }\n if (row === 3 && board[row][col] === 0){\n board[row][col] = pNum;\n console.log(\"Found it\");\n break;\n }\n }\n}", "kill() {\n //calc size of hitbox (- a treshold)\n let mx_left = this.position.pix_x + 0.25 * tileSize;\n let mx_right = mx_left + tileSize - 0.25 * tileSize;\n let my_up = this.position.pix_y + 0.25 * tileSize;\n let my_down = my_up + tileSize - 0.25 * tileSize;\n\n //same for players\n let px_left;\n let px_right;\n let py_up;\n let py_down;\n board.players.forEach(player => {\n px_left = player.position.pix_x + 0.25 * tileSize;\n px_right = px_left + tileSize - 0.25 * tileSize;\n py_up = player.position.pix_y + 0.25 * tileSize;\n py_down = py_up + tileSize - 0.25 * tileSize;\n\n //check if hitboxes overlap\n //When monsters left edge is to the left of players right side\n //and at the same time the monsters right side is not totaly left of players left side\n //When at the same time the montsters upper bond is below the player's lower bound\n //but the monsters lower bound is higher than the players upper bound, then they overlap\n if (mx_left < px_right && mx_right > px_left &&\n my_up < py_down && my_down > py_up) {\n player.die();\n }\n });\n }", "function tileHas (x, y) {\n // currently, only players may exist on a tile without overwriting the value\n const players = PLAYERS.playersAt(x, y)\n if (players.length > 0) {\n return 'player'\n } else {\n return 'nothing'\n }\n}", "function checkStatus()\n\t\t{\n\t\t\tvar count = $('.tile').length;\n\t\t\tif(count == 16)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "checkProximity(row, col, theRow, theCol) {\n\n /* mine cant be on this tile */\n if (row === theRow && col === theCol) {\n return false;\n }\n\n /* mine cant be above this tile */\n if (row === theRow - 1 && col === theCol) {\n return false;\n }\n\n /* mine cant be below this tile */\n if (row === theRow + 1 && col === theCol) {\n return false;\n }\n\n /* mine cant be left of this tile */\n if (row === theRow && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be right of this tile */\n if (row === theRow && col === theCol + 1) {\n return false;\n }\n\n /* mine cant be above and to the left of this tile */\n if (row === theRow - 1 && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be above and to the right of this tile */\n if (row === theRow - 1 && col === theCol + 1) {\n return false;\n }\n\n /* mine cant be below and to the left of this tile */\n if (row === theRow + 1 && col === theCol - 1) {\n return false;\n }\n\n /* mine cant be below and to the right of this tile */\n if (row === theRow + 1 && col === theCol + 1) {\n return false;\n }\n\n return true;\n }", "function areNoCardsFlipped() {\n return (tiles_values.length === 0);\n}", "function isValidNeighbor(currentTile){\n if(currentTile !== undefined){\n if(currentTile.isPassable){\n return true;\n } else return false;\n }else return false;\n }", "function checkRight(row, column) {\n if (!isEdge(row, column + 1) && tileArray[row][column] != null) {\n if (document.getElementById(\"center-tile\").style.backgroundColor == tileArray[row][column].style.backgroundColor) {\n return true;\n } else {\n return false;\n }\n } else {\n return !tileArray[row][column + 1];\n }\n }", "possible_taken_piece(x, y) {\n let pt = false;\n let pl = false;\n let pr = false;\n let pb = false;\n\n if (this._board[x][y] === -1) {\n return false;\n }\n if (this._taken_color !== null && this._board[x][y] !== this._taken_color) {\n return false;\n }\n\n let cpt = 4;\n\n if (this.check_piece_top(x, y)) {\n if (this._board[x][y - 1] !== -1) {\n cpt--;\n pt = true;\n }\n }\n if (this.check_piece_left(x, y)) {\n if (this._board[x - 1][y] !== -1) {\n cpt--;\n pl = true;\n }\n }\n if (this.check_piece_right(x, y)) {\n if (this._board[x + 1][y] !== -1) {\n cpt--;\n pr = true;\n }\n }\n if (this.check_piece_bottom(x, y)) {\n if (this._board[x][y + 1] !== -1) {\n cpt--;\n pb = true;\n }\n }\n // si 2 alors vérifier si l'opposé diagonal est non-vide\n if (cpt === 2) {\n return this.check_is_split(x, y, pt, pl, pr, pb);\n }\n return (cpt >= 2);\n }", "function eraseTileItem(tile, isDead) {\n creaturesAndItems = lj.realm.getChestsAndMonsters(currentRoom);\n paint(tile, isDead);\n\n if (isDead) {\n setTimeout(() => {\n paintGameOver(tile);\n }, 1000);\n }\n }", "function test9() {\n currentPiece = new I();\n currentPiece.moveHor(-1)\n updateGraphics();\n return !currentPiece.coords.some(x => board[x[0]][x[1]] !== currentPiece.color);\n}", "checkKong(tile) {\n return Evaluator.getDiscardedKong(this, tile).length > 0;\n }", "deleteElementFromSquare(square, board){\n\t\tif (this.can_be_eaten){\n\t\t\tboard[square] = null;\n\t\t}\n\t\treturn board;\n\t}", "function destroyTiles(game){\n var matches = getMatches(game);\n if(matches.length != 0){\n //console.log(\"matche taille \", matches);\n game.updateScore(matches);\n removeMatchesFromBoard(game, matches);\n applyGravity(game);\n setTimeout(function() {\n destroyTiles(game);\n // Demare le pointage une fois que les tiles match de base on ete enlevé\n if(!isGameStarted){\n setTimeout(function(){\n isGameStarted = true;\n },NEWTILESPAWNSPEED);\n }\n },NEWTILESPAWNSPEED);\n }else{\n var checkForLostGame = new CheckForLostGame(game.board);\n checkForLostGame.check();\n }\n\n}", "function isTileMoveable(x,y)\n\t{\n\t\tvar tile = civ.map.getTile(x,y);\n\t\tif (!tile) return false;\n\n\t\tvar type = TileTypesList[tile.type];\n\t\tswitch (unit.type.moveType)\n\t\t{\n\t\t\tcase UnitMoveType.Land:\n\t\t\t\treturn (type != TileTypes.Ocean);\n\n\t\t\tcase UnitMoveType.Sea:\n\t\t\t\treturn (type == TileTypes.Ocean);\t// TODO: check if river\n\n\t\t\tcase UnitMoveType.Air:\n\t\t\t\treturn true;\n\t\t}\n\t}", "_cleanupTile(tx, ty) {\n if (this._getTileVersion(tx, ty) < this.versionHash) {\n this._clearTile(tx, ty);\n }\n }", "static isEmpty(tile) {tile.classList.contains('empty') ? true : false;}", "valid_piece_placement(index){\n let valid = true;\n if(!!this.board[index]){\n valid = false;\n }\n return valid;\n }", "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "function isAlreadyFlipped(t) {\n return tilesFlippedOver.indexOf(t);\n}", "function deleteBoard(){\n\tif(grid != null){\n \t\tdocument.body.removeChild(grid);\n \t}\n}", "function singleTileCoastEliminationCheck(x, y, depth)\r\n{\r\n var surroundingTiles = getCardinalTiles(x,y);\r\n var nTile = surroundingTiles[0];\r\n var eTile = surroundingTiles[1];\r\n var sTile = surroundingTiles[2];\r\n var wTile = surroundingTiles[3];\r\n\r\n //check if we are a single coast tile (no chunks can match a 1 tile coast)\r\n var isSingle = false;\r\n if(nTile.biomeType != BIOME_WATER && eTile.biomeType == BIOME_WATER && sTile.biomeType == BIOME_WATER && wTile.biomeType == BIOME_WATER){isSingle=true;}\r\n else if(nTile.biomeType == BIOME_WATER && eTile.biomeType != BIOME_WATER && sTile.biomeType == BIOME_WATER && wTile.biomeType == BIOME_WATER){isSingle=true;}\r\n else if(nTile.biomeType == BIOME_WATER && eTile.biomeType == BIOME_WATER && sTile.biomeType != BIOME_WATER && wTile.biomeType == BIOME_WATER){isSingle=true;}\r\n else if(nTile.biomeType == BIOME_WATER && eTile.biomeType == BIOME_WATER && sTile.biomeType == BIOME_WATER && wTile.biomeType != BIOME_WATER){isSingle=true;}\r\n else if(nTile.biomeType == BIOME_WATER && eTile.biomeType != BIOME_WATER && sTile.biomeType == BIOME_WATER && wTile.biomeType != BIOME_WATER){isSingle=true;}\r\n else if(nTile.biomeType != BIOME_WATER && eTile.biomeType == BIOME_WATER && sTile.biomeType != BIOME_WATER && wTile.biomeType == BIOME_WATER){isSingle=true;}\r\n\r\n if(isSingle == true)\r\n {\r\n //to eliminate any tiles we transform them into water\r\n worldMapArray[y][x].biomeType = BIOME_WATER;\r\n worldMapArray[y][x].tile = 0x00;\r\n worldMapArray[y][x].modifier = 0x00;\r\n\r\n if(depth > 0)\r\n {\r\n depth -= 1;\r\n singleTileCoastEliminationCheck(x-1,y,depth);\r\n singleTileCoastEliminationCheck(x+1,y,depth);\r\n singleTileCoastEliminationCheck(x,y-1,depth);\r\n singleTileCoastEliminationCheck(x,y+1,depth);\r\n }\r\n }\r\n}", "function unUsedInRow(solutionGrid, i, num) \n { \n for (let j = 0; j<9; j++) \n if (solutionGrid[i][j] == num) \n return false; \n return true; \n }", "function canDropToken (grid, row) {\n return (grid[row][NB_LIG-1] === NOBODY);\n}", "function checkBoundaries( tile, x, y) {\n if (x <= 0) {\n tile.top = false;\n }\n if (y <= 0) {\n tile.left = false;\n }\n if (x >= 11) {\n tile.bottom = false;\n }\n if (y >= 11) {\n tile.right = false;\n }\n}", "isSolved() {\n if (this.tiles[this.tiles.length - 1] !== 0) {\n return false;\n }\n for (let i = 0; i < this.tiles.length - 1; i++) {\n if (this.tiles[i] !== i + 1) {\n return false;\n }\n }\n return true;\n }", "function occupied(i, j) // is this square occupied\r\n{\r\n // Added check to ensure that occupied square is in grid.\r\n if (i <= gridsize && j <= gridsize &&\r\n i >= 0 && j >= 0) {\r\n\r\n switch (GRID[i][j]) {\r\n case GRID_WALL:\r\n case GRID_MAZE:\r\n case GRID_ENEMY:\r\n case GRID_AGENT:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }\r\n // off the grid\r\n return true;\r\n}", "function hasShip(grid, row, column){\n return (grid[row][column] === 1 ? true : false)\n}", "isThisTileRunOut( type, num, arg ) {\n // TODO: add check for arg 'chi'\n return this.curTiles[type][num - 1] >= 4 ||\n ( arg === \"pon\" && this.curTiles[type][num - 1] >= 2 ) ||\n ( (arg === \"kan\" || arg === \"ckan\") && this.curTiles[type][num - 1] >= 1 )\n }", "function getTile(e) {\n var g = grid();\n for (var i = 0; i < g.length; i++) {\n if ((g[i][0] < e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] < e.x) &&\n ((g[i][1] + 256) > e.x)) return g[i][2];\n }\n return false;\n }", "function isTentative(tile) {\n return typeof tile.get('turnId') === 'undefined';\n }", "newPieceCanDown(){\n\n\t\tlet isNoCollision = true;\n\t\tfor (let [index, element] of this.newPiece.entries()) {\n\t\t\n\t\t\tlet x = this.newPiecePosition[0] + index%this.newPieceLen;\n\t\t\tlet y = this.newPiecePosition[1]+1 + Math.trunc(index/this.newPieceLen);\n\n\t\t\tif(element > 0){\n\n\t\t\t\tif(this.board[x + y * this.boardLen] > 0 || y >= this.boardSize/this.boardLen){\n\t\t\t\t\tisNoCollision = false;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\n\t\t}\n\n\t\treturn isNoCollision;\n\n\t}", "function isImpassible(tile)\n{\n\tif(game.map[tile.x][tile.y] == 2)\n\t\treturn true;\n\tif(game.map[tile.x][tile.y] == 3)\n\t\treturn true;\n\tif(game.map[tile.x][tile.y] > 4)\n\t\treturn true;\n\t\t\n\treturn false;\n}", "function unUsedInCol(solutionGrid, j, num) \n { \n for (let i = 0; i<9; i++) \n if (solutionGrid[i][j] == num) \n return false; \n return true; \n }", "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "function getTile(e) {\n var g = grid();\n var regExp = new RegExp(gm.tileRegexp());\n for (var i = 0; i < g.length; i++) {\n if (e) {\n var isInside = ((g[i][0] <= e.y) &&\n ((g[i][0] + 256) > e.y) &&\n (g[i][1] <= e.x) &&\n ((g[i][1] + 256) > e.x));\n if(isInside && regExp.exec(g[i][2].src)) {\n return g[i][2];\n }\n }\n }\n return false;\n }", "function checkIsLegalMove(nextX, nextY) {\n let nextTile = currentGameWorld[nextY][nextX];\n\n // If next tile is a wall, locked, or the end\n if (nextTile != worldTile.WALL && nextTile != worldTile.LOCKED && nextTile != worldTile.END) {\n checkCollision(nextX, nextY);\n return true;\n }\n\n // If the next tile is locked\n else if (nextTile == worldTile.LOCKED) {\n let key;\n for (let obj of currentInventory) {\n if (obj.type == \"key\") {\n key = obj;\n break;\n }\n }\n\n // If dont' have key\n if (!key) {\n effectAudio.play();\n return false;\n }\n\n // If have key\n else {\n currentInventory.splice(currentInventory.indexOf(key.type), 1);\n currentGameWorld[nextY][nextX] = 0;\n inventory.removeChild(inventory.childNodes[findChildNode(\"key\", \"#inven\")]);\n }\n }\n\n // If the next tile is the end\n else if (nextTile == worldTile.END) {\n currentLevelNumber += 1;\n if (gameworld[\"world\" + currentLevelNumber]) {\n nextLevel();\n }\n else {\n noNextLevel();\n }\n }\n\n // If just floor\n else {\n effectAudio.play();\n return false;\n }\n}", "placeEnemy(enemy) {\n let pos = null;\n let validSpot = false;\n do {\n pos = this.floor.get(randInt(this.floor.length));\n if (!pos) {\n return false;\n }\n validSpot = true;\n for (let i = pos.x; i < pos.x + enemy.width; i++) {\n for (let j = pos.y; j < pos.y + enemy.height; j++) {\n if (!this.floor.contains({ x: i, y: j })) {\n validSpot = false;\n break;\n }\n }\n }\n if (!validSpot) {\n this.floor.remove(pos);\n }\n } while (!validSpot);\n this.tiles[pos.y][pos.x] = enemy.name;\n this.removeRadius(pos.x, pos.y, 1 + enemy.width);\n return true;\n }", "function isCurrentTile(index) {\n return $scope.currentTileIdx === index;\n }", "doesMovePutKingInCheck(pieceRow, pieceCol, destRow, destCol) {\n let pieceOwner = this.chessboard[pieceRow][pieceCol][1];\n let destinationCellContents = this.chessboard[destRow][destCol];\n // Move piece on destination square\n this.chessboard[destRow][destCol] = this.chessboard[pieceRow][pieceCol];\n this.chessboard[pieceRow][pieceCol] = EMPTY_CELL;\n\n let kingInCheck = this.isKingInCheck(pieceOwner);\n\n // This function uses the original chessboard to avoid creating\n // a copy of the chessboard matrix on every call\n this.chessboard[pieceRow][pieceCol] = this.chessboard[destRow][destCol];\n this.chessboard[destRow][destCol] = destinationCellContents;\n\n return kingInCheck;\n }", "function canFlipCard(tile) {\n return (tile.innerHTML == \"\" && tiles_values.length < 2);\n}", "isObstacle(col, row) {\n return this.maze_.map.getTile(row, col) === SquareType.OBSTACLE;\n }", "function removeTileFromShape_old(tileId, shapeId) {\n shapeIndex[shapeId] = shapeIndex[shapeId].filter(function(tileId2) {\n return tileId2 != tileId;\n });\n if (shapeIndex[shapeId].length > 0 === false) {\n // TODO: make sure to test the case where a shape becomes empty\n // error(\"empty shape\")\n }\n }", "lookForCompleteRowsAndDelete() {\n var y\n var x\n var rowToDelete = -1\n for(y = Y_SPACES - 1; y >= 0; y--) {\n var totalInRow = 0\n for(x = 0; x < X_SPACES; x++) {\n if (this.board[y][x].tetrinoPiece) {\n totalInRow += 1\n }\n }\n if (totalInRow == X_SPACES) {\n rowToDelete = y\n break\n }\n }\n\n // Delete this row!\n if (rowToDelete >= 0) {\n for(x = 0; x < X_SPACES; x++) {\n this.board[rowToDelete][x] = new Piece(30, 30, 30, false)\n }\n this.moveRow = rowToDelete\n this.gamePaused = true\n return\n }\n this.gamePaused = false\n this.moveRow = -1\n\n }", "hasSafeTiles() {\n // A user will win if and only if all of the non-bomb tiles have been flipped.\n // If these two values are equal, then the player has won the game (there are no more safe tiles on the board!).\n // Otherwise, if the values are not equal, the player has to continue playing the game (flipping tiles).\n return (this._numberOfTiles !== this._numberOfBombs);\n }", "function checkAbove(row, column) {\n if (!isEdge(row - 1, column) && tileArray[row][column] != null) {\n if (document.getElementById(\"center-tile\").style.backgroundColor == tileArray[row][column].style.backgroundColor) {\n return true;\n } else {\n return false;\n }\n } else {\n return !tileArray[row - 1][column];\n }\n }", "function removeTileFromArray(array, item) {\n\t\tvar index = findTileIndex(array, item);\n\t\tif (index != -1 ) {\n\t\t\tarray.splice(index, 1);\n\t\t}\n\t}" ]
[ "0.7087761", "0.685844", "0.676607", "0.67254937", "0.6694265", "0.6622946", "0.6621785", "0.6582375", "0.6571928", "0.6532176", "0.64792377", "0.64521396", "0.644777", "0.6444754", "0.6408108", "0.6398222", "0.63977015", "0.63729423", "0.63494104", "0.63188803", "0.6317402", "0.62918544", "0.62634456", "0.62620336", "0.62581056", "0.6234309", "0.6221168", "0.62141675", "0.6186474", "0.6184102", "0.6163526", "0.6153571", "0.6147145", "0.6126781", "0.6118601", "0.6101341", "0.6100049", "0.60896415", "0.6088787", "0.60798734", "0.6065762", "0.6051927", "0.6044526", "0.6033676", "0.60300183", "0.6026165", "0.6024855", "0.60244304", "0.60239553", "0.6009747", "0.59942174", "0.59903806", "0.59869885", "0.598069", "0.59736836", "0.597175", "0.5971672", "0.5966082", "0.5958208", "0.5958038", "0.5957937", "0.5955201", "0.5953029", "0.59505785", "0.594864", "0.59472233", "0.5940683", "0.59360236", "0.59348845", "0.5930392", "0.5928879", "0.5916138", "0.5914601", "0.59143007", "0.59134", "0.5908512", "0.59065413", "0.5906225", "0.5899995", "0.58979183", "0.5896996", "0.58843154", "0.58832157", "0.58776486", "0.5874259", "0.5873152", "0.5860585", "0.5859766", "0.5859766", "0.58561593", "0.58527833", "0.58500695", "0.5844699", "0.5843867", "0.5840612", "0.58334553", "0.5833116", "0.58330643", "0.58238804", "0.5823261" ]
0.6373808
17
Finish the old animations
function finishAnimations() { for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (row + 1 <= 3 && column + 1 <= 3) { if (tileArray[row + 1][column + 1] != null) { $(tileArray[row + 1][column + 1]).finish(); } } if (row - 1 >= 0 && column + 1 <= 3) { if (tileArray[row - 1][column + 1] != null) { $(tileArray[row - 1][column + 1]).finish(); } } if (row + 1 <= 3 && column - 1 >= 0) { if (tileArray[row + 1][column - 1] != null) { $(tileArray[row + 1][column - 1]).finish(); } } if (row - 1 >= 0 && column - 1 >= 0) { if (tileArray[row - 1][column - 1] != null) { $(tileArray[row - 1][column - 1]).finish(); } } } } // Remove the "remove"-marked tiles clearTimeout(removeRemovesId); removeRemoves(); // End the queue of the center tile //$("#center-tile").clearQueue(); // Hurry the newCenterTile function if the player plays too quickly clearTimeout(newCenterTileId); if (newCenterTileFinished == false) { newCenterTile(); } document.getElementById("center-tile").style.opacity = 1; document.getElementById("center-tile").style.display = "inline"; // Hurry the newTile function if the player plays too quickly clearTimeout(newTileId); if (newTileFinished == false ) { newTile(); } newTileFinished = false; // Hurry the newFutureTile function if the player plays too quickly clearTimeout(newFutureTileId); if (newFutureTileFinished == false) { newFutureTile(); } newFutureTileFinished = false; // Hurry the checkGameOver function if the player plays too quickly clearTimeout(checkGameOverId); if (checkGameOverFinished == false) { checkGameOver(); } checkGameOverFinished = false; // Finish the sounds swooshSound.pause(); swooshSound.currentTime = 0; removeSound.pause(); removeSound.currentTime = 0; gameOverSound.pause(); gameOverSound.currentTime = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function finishAllAnimations() {\n runningAnimations.forEach(function (animation) {\n animation.finishNow();\n });\n clearTimeout(fadeInTimer);\n clearTimeout(animateHeightTimer);\n clearTimeout(animationsCompleteTimer);\n runningAnimations.length = 0;\n }", "function finishAnimations() {\n var stepsRemaining = Maze.executionInfo.stepsRemaining();\n\n // allow time for additional pause if we're completely done\n var waitTime = (stepsRemaining ? 0 : 1000);\n\n // run after all animations\n timeoutList.setTimeout(function () {\n if (stepsRemaining) {\n stepButton.removeAttribute('disabled');\n } else {\n Maze.animating_ = false;\n if (studioApp().isUsingBlockly()) {\n // reenable toolbox\n Blockly.mainBlockSpaceEditor.setEnableToolbox(true);\n }\n // If stepping and we failed, we want to retain highlighting until\n // clicking reset. Otherwise we can clear highlighting/disabled\n // blocks now\n if (!singleStep || Maze.result === ResultType.SUCCESS) {\n reenableCachedBlockStates();\n studioApp().clearHighlighting();\n }\n displayFeedback();\n }\n }, waitTime);\n }", "function finishAnimations() {\n if (transition == null)\n throw new Error('Transition was already finished or never started.');\n\n for (const anim of document.getAnimations())\n anim.finish();\n}", "function _finish(){\n logger.logEvent({'msg': 'animation finished'});\n if(logHeartbeat){\n clearInterval(logHeartbeat);\n }\n $('#finished-bg').fadeIn();\n if(currentMusicObj){\n __musicFade(currentMusicObj, false,1/(2000/MUSIC_ANIMATION_INTERVAL), false); //Fadeout animation for 2 seconds\n }\n for(var i=0; i<animationFinishObserver.length; i++){\n animationFinishObserver[i]();\n }\n _stopAllQueues();\n\n //Change pause button to replay\n var button = $('#play-toggle');\n button.removeClass('icon-pause');\n button.addClass('icon-repeat');\n button.unbind('click');\n button.bind('click', function(){location.reload();});\n\n for(var i = 0; i< currentAnimation.length; i++){ //Stop active animations (i.e. background)\n for(var j = 0; j<currentAnimation[i].length; j++){\n var node = currentAnimation[i][j];\n if('animation' in node){\n var _animation = node['animation'];\n if('object' in _animation){\n var _obj=_animation['object'];\n if(_obj){\n _obj.stop();\n }\n }\n }\n }\n }\n }", "pauseAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(true);\n }\n }\n }", "endAll() {\n this.animations.forEach((anim) => anim.onEnd());\n this.animations = [];\n }", "_onAnimationEnd() {\n // Clean up the old container. This is done after the animation to avoid garbage\n // collection during the animation and because the black box updates need it.\n if (this._oldContainer) {\n this._oldContainer.removeFromParent();\n this._oldContainer.destroy();\n this._oldContainer = null;\n }\n\n if (this._delContainer) {\n this._delContainer.removeFromParent();\n this._delContainer.destroy();\n this._delContainer = null;\n }\n\n // Fire ready event saying animation is finished.\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "function frameAnimationEnd() {\n f.animatedFrames = f.animatedFrames || 0;\n f.animatedFrames++;\n if(f.animatedFrames == f.frameItems.length){\n f.finished = true;\n f.o.cbFinished.call(f);\n }\n \n }", "updateAnimations() {\n this.animations.forEach((animation, index) => {\n if (animation.finished) {\n this.animations.splice(index, 1);\n }\n });\n }", "function setEndAnimation() {\r\n\t\t\tinAnimation = false;\r\n\t\t}", "function animcompleted() {\n\t\t\t\t\t\t}", "OnAnimationEnd() {\n // Remove the container containing the delete animations\n if (this._deleteContainer) {\n this.removeChild(this._deleteContainer);\n this._deleteContainer = null;\n }\n\n // Clean up the old container used by black box updates\n if (this._oldContainer) {\n this.removeChild(this._oldContainer);\n this._oldContainer = null;\n }\n\n // Restore event listeners\n this.EventManager.addListeners(this);\n\n // Restore visual effects on node with keyboard focus\n this._processInitialFocus(true);\n\n // Process the highlightedCategories\n this._processInitialHighlighting();\n\n if (!this.AnimationStopped) this.RenderComplete();\n\n // Reset animation flags\n this.Animation = null;\n this.AnimationStopped = false;\n }", "playAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n }\n }\n }", "function animationComplete() {\n\t\t\t\t\t\tself._setHashTag();\n\t\t\t\t\t\tself.active = false;\n\t\t\t\t\t\tself._resetAutoPlay(true, self.settings.autoPlayDelay);\n\t\t\t\t\t}", "function finish() {\n// if (--finished == 0) {\n if (!isFinished) {\n isFinished = true;\n Physics.there.style(self.from.getContainerBodyId(), {\n opacity: 0\n });\n\n self.dfd.resolve();\n }\n }", "function onAnimationEnd() {\n // stop the last frame from being missed..\n rec.stop();\n }", "function clonedAnimationDone(){\n // scroll body\n anime({\n targets: \"html, body\",\n scrollTop: 0,\n easing: easingSwing, // swing\n duration: 150\n });\n\n // fadeOut oldContainer\n anime({\n targets: this.oldContainer,\n opacity : .5,\n easing: easingSwing, // swing\n duration: 300\n })\n\n // show new Container\n anime({\n targets: $newContainer.get(0),\n opacity: 1,\n easing: easingSwing, // swing\n duration: 300,\n complete: function(anim) {\n triggerBody()\n _this.done();\n }\n });\n\n $newContainer.addClass('one-team-anim')\n }", "onAnimationEnd() {\n\n }", "function finish() {\n if (!isIn) element.hide();\n reset();\n if (cb) cb.apply(element);\n } // Resets transitions and removes motion-specific classes", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "function onEnd() {\n element.off(css3AnimationEvents, onAnimationProgress);\n $$jqLite.removeClass(element, activeClassName);\n $$jqLite.removeClass(element, pendingClassName);\n if (staggerTimeout) {\n $timeout.cancel(staggerTimeout);\n }\n animateClose(element, className);\n var node = extractElementNode(element);\n for (var i in appliedStyles) {\n node.style.removeProperty(appliedStyles[i]);\n }\n }", "restartAnimation() {\n for (var key in this.animations) {\n if (this.animations.hasOwnProperty(key)) {\n this.animations[key].setFinished(false);\n this.animations[key].reset();\n }\n }\n }", "notifyAnimationEnd() {}", "_onFinishedEvent() {\n this._finished += 1;\n\n if (this._finished === this._babylonNumAnimations) {\n this._looped = 0;\n this._finished = 0;\n\n // Pause the animations\n this._babylonAnimatables.forEach(animatable => {\n animatable.speedRatio = 0;\n });\n\n this._promises.play.resolve();\n\n // Stop evaluating interpolators if they have already completed\n if (!this.weightPending && !this.timeScalePending) {\n this._paused = true;\n }\n }\n }", "animationEnd() {\n if (this.movements.length !== 0) {\n this.nextMove()\n } else {\n this.orchestrator.camera.startAnimation(\"position\", 1.5, () => {\n this.orchestrator.changeState(new GameOverState(this.orchestrator))\n },\n [...this.orchestrator.camera.originalPosition],\n [\n this.orchestrator.gameboardProperties.x,\n this.orchestrator.gameboardProperties.y,\n this.orchestrator.gameboardProperties.z\n ])\n }\n\n }", "static complete() {\n\t\tconsole.log('Animation.complete()')\n\t\tVelvet.capture.adComplete()\n\n\t}", "function onEnd() {\n\t\t\t\t\t\t\telement.off(css3AnimationEvents, onAnimationProgress);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, activeClassName);\n\t\t\t\t\t\t\t$$jqLite.removeClass(element, pendingClassName);\n\t\t\t\t\t\t\tif (staggerTimeout) {\n\t\t\t\t\t\t\t\t$timeout.cancel(staggerTimeout);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tanimateClose(element, className);\n\t\t\t\t\t\t\tvar node = extractElementNode(element);\n\t\t\t\t\t\t\tfor (var i in appliedStyles) {\n\t\t\t\t\t\t\t\tnode.style.removeProperty(appliedStyles[i]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}", "function onAnimationDone() {\n sourceFrameIndex = currentFrameIndex;\n if (playing) {\n waitTimeout();\n }\n }", "function AnimComplete() {\n // Add timer to mark sure at end place\n setTimeout(function () {\n VariableModule(that);\n va.$capLast.css('visibility', '');\n va.$capInner.css('height', '');\n }, 10);\n }", "function endAnimation() {\n let endAnimationText = getEndAnimation();\n endAnimationText.innerHTML = \"Finished!\";\n endAnimationText.style.fontSize = \"50px\";\n const finishedSound = audioFiles.finishedSound;\n if(audioOn && inhaleHold > 0) {\n finishedSound.load();\n finishedSound.play();\n }\n endEarlyDetails();\n}", "function animationManager () {\n for (var i = tasks.length; i--;) {\n if (tasks[i].step() == false) {\n // remove animation tasks\n logToScreen(\"remove animation\");\n tasks.splice(i, 1);\n }\n }\n }", "OnAnimationEnd() {\n // If the animation is complete (and not stopped), then rerender to restore any flourishes hidden during animation.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container, availSpace);\n\n // Reselect the nodes using the selection handler's state\n var selectedNodes = this._selectionHandler ? this._selectionHandler.getSelection() : [];\n for (var i = 0; i < selectedNodes.length; i++) selectedNodes[i].setSelected(true);\n }\n\n // : Force full angle extent in case the display animation didn't complete\n if (this._angleExtent < 2 * Math.PI) this._animateAngleExtent(2 * Math.PI);\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "function _sh_switch_workspace_tween_completed( ){\n\tTweener.removeTweens( this );\n}", "handleAnimationEnd() {\n this.isAnimating = false;\n this.index = (this.index + 1) % this.greetings.length;\n\n setTimeout(() => this.updateGreeting(), 500);\n }", "onComplete() {\n this.stopAudio();\n if (this.chains > 0) {\n this.chains--;\n }\n if (this.debug) {\n console.log('Animation completed chains left: ', this.chains);\n }\n if (this.destroyOnComplete && this.chains === 0) {\n if (this.destroyDelay > 0) {\n if (this.debug) {\n console.log(`Wall will be removed after ${ this.destroyDelay } seconds`);\n }\n setTimeout(() => {\n this.disposeWall();\n }, this.destroyDelay * 1000);\n } else {\n this.disposeWall();\n }\n }\n }", "function _finish() {\r\n // stop all fading and animations\n $.each(['#lightbox-image-details', '#jquery-lightbox', '#jquery-overlay'], function (i, id) {\n $(id).stop(true, true);\n });\n\n window._activeLightBox = null;\r\n _disable_keyboard_navigation();\r\n $('.hover-icon').remove();\r\n $('#lightbox-loading').remove();\r\n $('#jquery-lightbox').remove();\r\n $('#jquery-overlay').remove();\r\n // Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r\n $('embed, object, select').css({ 'visibility' : 'visible' });\r\n }", "function _onAnimationEnd () {\n clearTimeout(transitionEndTimeout);\n $target.off(events);\n animationEnded();\n deferred.resolve();\n }", "wait_GM_1st_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.numberOfTries > this.maxNumberOfTries) {\n this.numberOfTries = -1;\n\n if (this.currentPlayer == 2)\n {\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n else\n this.state = 'GAME_MOVIE';\n\n }\n this.numberOfTries++;\n }", "wait_GM_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.view.currentMoviePiece.parabolic.end == true) {\n if(this.model.lastMoviePlay() == true)\n {\n this.scene.reset = false;\n this.scene.showGameMovie = false;\n this.model.currentMoviePlay = 0;\n this.state = 'GAME_OVER';\n }\n else\n {\n this.model.inc_currentMoviePlay();\n this.scene.update_CameraRotation();\n this.state = 'WAIT_GM_CAMERA_ANIMATION_END';\n }\n }\n }", "_onEnd() {\n this._duringDisplayAnim = false;\n // - need to re render at the end of the display animation\n this._setAnimParams();\n }", "stopAtLastFrame() {\n\t\tthis.animActions.forEach( action => action.play() );\n\t\tthis.animMixer.update( this.duration );\n\t\tthis.animMixer.stopAllAction();\n\t}", "finish() {\n window.setTimeout(\n this.displayAbsorptionTexts.bind(this),\n absorptionDuration\n );\n const lastStep = this.measurementHistory.length - 1;\n window.setTimeout(\n this.displayMeasurementTexts.bind(this, lastStep),\n this.animationStepDuration\n );\n window.setTimeout(\n this.finishCallback.bind(this),\n this.absorptionDuration\n );\n window.setTimeout(\n () => {this.board.animationExists = false;},\n this.absorptionDuration\n );\n // Make text groups disappear\n window.setTimeout(\n this.removeTexts.bind(this),\n absorptionDuration + absorptionTextDuration\n );\n }", "function animateCompleteMotion () {\n var i;\n \n this.motionID = undefined;\n //if we've only got one, we're stopping the last one\n button.state.isActive = (button.state.motions.length > 1); \n\n //remove from the array of motions\n for (i=0; i < button.state.motions.length; i++) {\n if (this === button.state.motions[i]) {\n button.state.motions.splice(i, 1);\n break;\n }\n }\n\n if (!button.state.isActive) {\n sketch.invalidateGeom(button);\n }\n }", "_onAnimationDone(event) {\n this._animationDone.next(event);\n this._isAnimating = false;\n }", "function reset_animations(){\n if(active != \"idee\"){tl_idee.restart();\n tl_idee.pause();}\n if(active != \"reunion\"){tl_reunion.restart();\n tl_reunion.pause();}\n if(active != \"travail\"){tl_travail.restart();\n tl_travail.pause();}\n if(active != \"deploiement\"){tl_depl.restart();\n tl_depl.pause();}\n }", "function endCardAnimation() {\n\t$(\".computer-card\").removeClass(\"animated-card\");\n\tanimating = false;\n\tif (!training && disabled) {\n\t\tenableButtons();\n\t}\n}", "update() {\n if(this.animation.isDone()) {\n this.removeFromWorld = true;\n }\n }", "function endAllTransition(){\n\n // console.log('endAllTransition');\n\n // 是否恢复原状,子页面切换使用\n if(restore){\n currentEle.css({\n \"display\": \"none\",\n \"-webkit-transform\": generateTransform(0, 0, 0), \n \"-webkit-transition-duration\": \"0ms\"\n });\n nextEle.css({\n \"display\": \"block\",\n \"-webkit-transform\": generateTransform(0, 0, 0), \n \"-webkit-transition-duration\": \"0ms\",\n });\n }\n else{\n currentEle.css({\n \"display\": \"none\",\n });\n nextEle.css({\n \"display\": \"block\",\n });\n }\n }", "stopAnimation() {\r\n this.anims.stop();\r\n\r\n //Stop walk sound\r\n this.walk.stop();\r\n }", "wait_AnimationEnd() {\n if (this.tmpPiece.parabolic.end == true) {\n this.unvalidateCells();\n this.check_GameOver();\n this.check_Reset();\n this.checkSelected();\n this.locked = true;\n }\n }", "function undoAnimationDone() {\n isUndoing = false;\n tiles.splice(tiles.length - 1, 1);\n removeNode(tilesContainer.lastElementChild);\n updateTileVisibility(numTilesShown);\n lastBlacklistedTile.elem.removeEventListener(\n 'webkitTransitionEnd', undoAnimationDone);\n}", "cancelAllAnimations() {\n\t\tthis._cameraAnimationQueue.clear();\n\t\tthis._currentAnimation = null;\n\t}", "fadeOut() {\n const self = this;\n // \"Unload\" Animation - onComplete callback\n TweenMax.to($(this.oldContainer), 0.4, {\n opacity: 0,\n onComplete: () => {\n this.fadeIn();\n }\n });\n }", "OnAnimationEnd() {\n // Before the animation, the treemap nodes will remove their bevels and selection\n // effects. If the animation is complete (and not stopped), then rerender to restore.\n if (!this.AnimationStopped) {\n this._container.removeChildren();\n\n // Finally, re-layout and render the component\n var availSpace = new Rectangle(0, 0, this.Width, this.Height);\n this.Layout(availSpace);\n this.Render(this._container);\n\n // Reselect the nodes using the selection handler's state\n this.ReselectNodes();\n }\n\n // Delegate to the superclass to clear common things\n super.OnAnimationEnd();\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._openAnimationDone(totalTime);\n }\n else if (toState === 'exit') {\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "function handleAnimationEnd() {\r\n node.classList.remove(`${prefix}animated`, animationName);\r\n node.removeEventListener('animationend', handleAnimationEnd);\r\n\r\n resolve('Animation ended');\r\n }", "function stop() {\r\n animating = false;\r\n }", "function handleAnimationEnd() {\n node.classList.remove(`${prefix}animated`, animationName);\n node.removeEventListener('animationend', handleAnimationEnd);\n\n resolve('Animation ended');\n }", "function animateRestart() {\n animation1.restart();\n animation2.restart();\n animation3.restart();\n animation4.restart();\n}", "function animationCompleted()\n{\n // Remove the tick event listener.\n TweenMax.ticker.removeEventListener(\"tick\");\n\n // Reenable the test button.\n animationTest.disabled = false;\n}", "_playAnimation() {\n if (this._animationLast === undefined && this._animationQueue.length > 0) {\n this._animationLast = this._animationCurrent;\n this._animationCurrent = this._animationQueue.shift();\n console.log(\"New: \" + this._animationCurrent.name);\n this._animationCurrent.runCount = 0;\n }\n this._serviceAnimation(this._animationCurrent, true);\n this._serviceAnimation(this._animationLast, false);\n if (this._animationLast && this._animationLast.cleanup) {\n this._animationLast.animation.stop();\n this._animationLast.animation = undefined;\n this._animationLast = undefined;\n }\n }", "function runAnimay(){\n ropAnimation();\n headAnimation();\n bodyAnimation();\n larmAnimation();\n rarmAnimation();\n llegAnimation();\n rlegAnimation();\n}", "function _finish() {\n\t\t\t$('#jquery-lightbox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "function animationLost() {\n\t\tconsole.log(\"he perdido\");\t\n\tposX2=hasta;\t\nhasta=hasta-60;\nposX=posX-60;\n\t\t// Start the animation.\n\t\trequestID2 = requestAnimationFrame(animate2);\n\t}", "function _finish() {\n\t\t\t$('#jquery-largephotobox').remove();\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\n\t\t\t\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\n\t\t}", "function handleAnimationEnd(event) {\n event.stopPropagation();\n if(animationName !== event.animationName)\n {\n //ended other animation => ignore it callback now\n //console.error(animationName);\n //console.error(event);\n\n log('Animation end '+event.animationName+'; Expected: '+animationName );\n return;\n }\n\n node.classList.remove(animationName);\n\n log('Animation ended '+animationName );\n resolve('Animation ended '+animation);\n }", "function animateToEndState() {\n if (transition == null)\n throw new Error('Transition was already finished or never started.');\n\n for (const anim of document.getAnimations())\n anim.currentTime = anim.effect.getTiming().duration - 1;\n}", "static clearAnimations() {\n this.clearItems('cycleAnimation');\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = \"webkitAnimationEnd animationend\";\n \n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data(\"animation\");\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "_onAnimationDone({ toState, totalTime }) {\n if (toState === 'enter') {\n this._trapFocus();\n this._animationStateChanged.next({ state: 'opened', totalTime });\n }\n else if (toState === 'exit') {\n this._restoreFocus();\n this._animationStateChanged.next({ state: 'closed', totalTime });\n }\n }", "_onEndAnim() {\n if (this._overlay) {\n this._peer.getChart().getPlotArea().removeChild(this._overlay);\n this._overlay = null;\n }\n }", "complete() {\n if (this.element.renderTransform) {\n this.refreshTransforms();\n this.element.renderTransform.reset();\n }\n }", "#onAnimationFinish(state) {\n\t\t// Set the open attribute based on the parameter\n\t\tthis.state = state;\n\t\t// Clear the stored animation\n\t\tthis.animation = null;\n\t\t// Reset isClosing & isExpanding\n\t\tthis.isClosing = false;\n\t\tthis.isExpanding = false;\n\t\t// Remove the overflow hidden and the fixed height\n\t\tthis.element.style.height = this.element.style.overflow = '';\n\t}", "function animcompleted() {\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\t\tnextcaption.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t\t\t\t\t\t\t\t},100)\n\t\t\t\t\t\t\t\t\t}", "function animcompleted() {\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\t\t\tnextcaption.css({transform:\"none\",'-moz-transform':'none','-webkit-transform':'none'});\n\t\t\t\t\t\t\t\t\t\t},100)\n\t\t\t\t\t\t\t\t\t}", "function TweenComplete() {\n tweenSlide.eventComplete(function () {\n // Reset 'style' & 'transform' for slide\n that.ResetTFSlideCss();\n // Update the variable in toggle-end\n that.TOSLIDE.End();\n fxCSS.status = null;\n });\n }", "wait_GM_Camera_AnimationEnd(){\n if(this.check_Reset())\n return;\n if (this.scene.camera_rotation == 0) {\n this.state = 'GAME_MOVIE';\n }\n }", "function _finish() {\r\n\t\t\t$('#jquery-lightbox').remove();\r\n\t\t\t$('#jquery-overlay').fadeOut(function() { $('#jquery-overlay').remove(); });\r\n\t\t\t// Show some elements to avoid conflict with overlay in IE. These elements appear above the overlay.\r\n\t\t\t$('embed, object, select').css({ 'visibility' : 'visible' });\r\n\t\t}", "stop() {\n this.finishAll();\n }", "function stopAnimation() {\n reset();\n sprite.gotoAndStop(sprite.currentFrame);\n }", "function anim() {\n $(\"#lightsaber2\").addClass(\"animation2\");\n setTimeout(function() {\n $(\"#lightsaber2\").removeClass(\"animation2\");\n }, 300);\n $(\"#lightsaber1\").addClass(\"animation\");\n\n setTimeout(function() {\n $(\"#lightsaber1\").removeClass(\"animation\");\n }, 300);\n }", "updateAnimation() {\n return;\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function doAnimations (animations, oldPos, newPos) {\n if (animations.length === 0) return\n\n var numFinished = 0\n function onFinishAnimation3 () {\n // exit if all the animations aren't finished\n numFinished = numFinished + 1\n if (numFinished !== animations.length) return\n\n drawPositionInstant()\n\n // run their onMoveEnd function\n if (isFunction(config.onMoveEnd)) {\n config.onMoveEnd(deepCopy(oldPos), deepCopy(newPos))\n }\n }\n\n for (var i = 0; i < animations.length; i++) {\n var animation = animations[i]\n\n // clear a piece\n if (animation.type === 'clear') {\n $('#' + squareElsIds[animation.square] + ' .' + CSS.piece)\n .fadeOut(config.trashSpeed, onFinishAnimation3)\n\n // add a piece with no spare pieces - fade the piece onto the square\n } else if (animation.type === 'add') {\n $('#' + squareElsIds[animation.square])\n .append(buildPieceHTML(animation.piece, true))\n .find('.' + CSS.piece)\n .fadeIn(config.appearSpeed, onFinishAnimation3)\n\n // move a piece from squareA to squareB\n } else if (animation.type === 'move') {\n animateSquareToSquare(animation.source, animation.destination, animation.piece, onFinishAnimation3)\n }\n }\n }", "function doAnimations( elems ) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n \n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "killAnimations() {\n this.timelines.forEach((timeline) => {\n this.killTimeline(timeline);\n });\n\n this.tweens.forEach((tween) => {\n this.killTween(tween);\n });\n\n this.timelines = [];\n this.tweens = [];\n }", "transitionCompleted() {\n // implement if needed\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "function complete() {\n $archive.removeClass(\"processing\");\n Y.log('complete');\n }", "_animationDoneListener(event) {\n this._animationEnd.next(event);\n }", "finish() {\n\t\tthis.IS_STARTED = false;\n\t}", "_onEndAnim() {\n if (this._indicator) {\n this._indicator.getParent().removeChild(this._indicator);\n this._indicator = null;\n }\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n elems.each(function() {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function() {\n $this.removeClass($animationType);\n });\n });\n }", "function doAnimations(elems) {\n //Cache the animationend event in a variable\n var animEndEv = 'webkitAnimationEnd animationend';\n elems.each(function () {\n var $this = $(this),\n $animationType = $this.data('animation');\n $this.addClass($animationType).one(animEndEv, function () {\n $this.removeClass($animationType);\n });\n });\n }", "processAnimations(coords) {\n let moveTime = 1 / this.gameboard.orchestrator.moveSpeed\n let removeTime = moveTime * 1.75 / this.gameboard.orchestrator.moveSpeed\n\n this.moveAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0.1, 0],\n finalPosition: [this.destTile.x - this.origTile.x, 0, this.destTile.y - this.origTile.y],\n duration: moveTime,\n heightLevels: [{instant: 0, height: 0.1}, {instant: moveTime * 0.5, height: 0.66}, {instant: moveTime, height: 0}]\n }\n\n this.moveAnimation = new EasingAnimation(this.moveAnimationAux, () => { this.notifyMoveAnimationCompleted(\"move\") })\n\n this.removeAnimationAux = {\n animation: Animations[this.gameboard.orchestrator.moveAnimation],\n initialPosition: [0, 0, 0],\n finalPosition: [coords.x + this.gameboard.size * 1.3 - 1 - this.destTile.x, 0.15 + coords.y * 0.2, ((this.gameboard.size / 2 - 2 + coords.z) - this.destTile.y)],\n duration: removeTime,\n heightLevels: [{instant: 0, height: 0}, {instant: removeTime * 0.3333, height: 1.5}, {instant: removeTime * 0.90 , height: 1.5}, {instant: removeTime, height: 0.15 + coords.y * 0.2}]\n }\n\n this.removeAnimation = new EasingAnimation(this.removeAnimationAux, () => { this.notifyMoveAnimationCompleted(\"remove\") })\n }" ]
[ "0.76933557", "0.7533821", "0.75074375", "0.74322736", "0.7414079", "0.7368151", "0.7252725", "0.7156907", "0.7146061", "0.71236247", "0.7083577", "0.7074186", "0.70485705", "0.7039695", "0.7009224", "0.70079917", "0.69916004", "0.6941543", "0.691798", "0.6880823", "0.6879925", "0.6879925", "0.6879925", "0.68753624", "0.68430406", "0.67634183", "0.67505836", "0.6730727", "0.6729988", "0.67008793", "0.66467816", "0.6633861", "0.6607636", "0.6592784", "0.65902895", "0.6586826", "0.65105367", "0.6500545", "0.6463945", "0.6402713", "0.63885564", "0.6383044", "0.63812065", "0.6370185", "0.6370014", "0.6364335", "0.6330875", "0.632805", "0.6286487", "0.6286351", "0.6284609", "0.628352", "0.62687176", "0.62588775", "0.6248763", "0.62416196", "0.62226146", "0.62226146", "0.6221418", "0.6216189", "0.621445", "0.6205714", "0.6205067", "0.6198939", "0.6192244", "0.6159781", "0.6152056", "0.61487025", "0.61414295", "0.6128647", "0.6125909", "0.61224085", "0.6117435", "0.6107193", "0.6072698", "0.6066013", "0.60605633", "0.60605633", "0.6057711", "0.60548115", "0.6044434", "0.60410804", "0.6040155", "0.603974", "0.603933", "0.6035988", "0.603565", "0.6033382", "0.60309774", "0.60298574", "0.6029119", "0.6029119", "0.6026745", "0.6022085", "0.60214263", "0.6020882", "0.6020882", "0.6020882", "0.60188794", "0.6007324" ]
0.6279877
52
The operations of each turn Add a new tile
function newTile() { // Create a new tile createdTile = document.createElement("div"); createdTile.setAttribute("position", "absolute"); createdTile.setAttribute("class", "tile"); // Find the empty corners var emptyCorners = []; if (!tileArray[0][0]) { emptyCorners.push("tile-1"); } if (!tileArray[0][3]) { emptyCorners.push("tile-4"); } if (!tileArray[3][0]) { emptyCorners.push("tile-13"); } if (!tileArray[3][3]) { emptyCorners.push("tile-16"); } // Of the empty corners, pick a corner for the tile to go into var newTileCorner = Math.floor(Math.random() * emptyCorners.length); if (emptyCorners.length > 0) { // Pick a corner to put the tile in createdTile.setAttribute("id", emptyCorners[newTileCorner]); // Insert the tile into the corner $("#tile-container").append(createdTile); // Insert the tile into the array of tiles if (emptyCorners[newTileCorner] == "tile-1") { tileArray[0][0] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-4") { tileArray[0][3] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-13") { tileArray[3][0] = createdTile; } else if (emptyCorners[newTileCorner] == "tile-16") { tileArray[3][3] = createdTile; } // Access the tile with jquery var $activeTile = $("#" + createdTile.id); $activeTile.hide().fadeIn(100); // Make the new tile the same color as the old future tile createdTile.style.backgroundColor = futureColor; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function addTiles(){\n\tvar tile_1 = CLICKED_TILE_1;\n\tvar tile_2 = CLICKED_TILE_2;\n\ttile_1.sum(tile_2);\n\treplaceTile(tile_1);\n\treplaceTile(tile_2);\n}", "addTile(tile, wallSize) {\n this.currentGame.turn++;\n this.currentGame.wallSize = wallSize;\n this.tiles.push(tile);\n this.ai.tracker.gained(this.currentGame.position, tile);\n this.ai.updateStrategy();\n this.discardTile(true);\n }", "generateTiles() {\n let self = this;\n forEach(self.tiles, (tile) => {\n self.addElement(tile);\n });\n }", "addRandomTile() {\n // adds a random tile in an empty spot\n if (!this.gameState.board.includes(0)) { // if there aren't any empty \n return;\n } else {\n while (1) {\n var randomSpot = this.getRandom(0, this.numTiles - 1);\n // if randomSpot is empty, adds a new tile there. else, finds another randomSpot\n if (this.gameState.board[randomSpot] == 0) {\n if (Math.random() < .90) {\n this.gameState.board[randomSpot] = 2;\n } else {\n this.gameState.board[randomSpot] = 4;\n }\n break;\n }\n continue;\n }\n }\n }", "function start()\n{\n _map = {}, _tiles = [];\n for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10; j++) {\n\n\n\n var x =_map[0 + ':' + 0];\n console.log(_tiles[j]);\n // console.log(_map);\n new Tile((Math.floor(Math.random() * colors.length))).insert(i, j);\n\n\n }\n }\n }", "addTileToCache(tile) {\n this._cache.add(this, tile, (tileset, tileToAdd) => tileset._addTileToCache(tileToAdd));\n }", "function turnOnAddTileHandler() {\r\n\t\t\tvar addNewPixelTile = function (x, y) {\r\n\t\t\t\tvar newTile = angular.extend({}, $injector.get('tileDefaults'), {\r\n\t\t\t\t\tid: 'IzendaDashboardTileNew' + (newTileIndex++),\r\n\t\t\t\t\tisNew: true,\r\n\t\t\t\t\twidth: 1,\r\n\t\t\t\t\theight: 1,\r\n\t\t\t\t\tx: x,\r\n\t\t\t\t\ty: y\r\n\t\t\t\t});\r\n\t\t\t\twhile (!vm.checkTileIntersectsBbox(newTile) && newTile.width < 6 && newTile.width + newTile.x < 12) {\r\n\t\t\t\t\tnewTile.width++;\r\n\t\t\t\t}\r\n\t\t\t\tif (vm.checkTileIntersectsBbox(newTile)) {\r\n\t\t\t\t\tnewTile.width--;\r\n\t\t\t\t}\r\n\t\t\t\twhile (!vm.checkTileIntersectsBbox(newTile) && newTile.height < 3) {\r\n\t\t\t\t\tnewTile.height++;\r\n\t\t\t\t}\r\n\t\t\t\tif (vm.checkTileIntersectsBbox(newTile)) {\r\n\t\t\t\t\tnewTile.height--;\r\n\t\t\t\t}\r\n\t\t\t\tif (newTile.width <= 0 || newTile.height <= 0)\r\n\t\t\t\t\treturn;\r\n\t\t\t\tvm.tiles.push(newTile);\r\n\t\t\t\tvm.updateDashboardSize();\r\n\t\t\t\t$scope.$evalAsync();\r\n\t\t\t};\r\n\t\t\tvar $tileContainer = vm.getTileContainer();\r\n\r\n\t\t\t// on click on free dashboard area: add tile\r\n\t\t\t$tileContainer.on('mousedown.dashboard', function (event) {\r\n\t\t\t\tvar $target = angular.element(event.target);\r\n\t\t\t\tif (vm.isTile$($target))\r\n\t\t\t\t\treturn true;\r\n\t\t\t\tif (event.which !== 1)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t$tileContainer = vm.getTileContainer();\r\n\t\t\t\t// get {x, y} click coordinates\r\n\t\t\t\tvar x = Math.floor((event.pageX - $tileContainer.offset().left) / vm.tileWidth),\r\n\t\t\t\t\ty = Math.floor((event.pageY - $tileContainer.offset().top) / vm.tileHeight);\r\n\t\t\t\taddNewPixelTile(x, y);\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\r\n\t\t\t// on mouse move: show grid\r\n\t\t\t$tileContainer.on('mousemove.dashboard', function (e) {\r\n\t\t\t\tvar $target = angular.element(e.target);\r\n\t\t\t\tif (vm.isTile$($target))\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t$tileContainer = vm.getTileContainer();\r\n\t\t\t\t// get {x, y} click coordinates\r\n\t\t\t\tvar x = Math.floor((e.pageX - $tileContainer.offset().left) / vm.tileWidth),\r\n\t\t\t\t\ty = Math.floor((e.pageY - $tileContainer.offset().top) / vm.tileHeight);\r\n\t\t\t\tvm.showTileGrid();\r\n\t\t\t\tvm.showTileGridShadow({\r\n\t\t\t\t\tleft: x * vm.tileWidth,\r\n\t\t\t\t\ttop: y * vm.tileHeight,\r\n\t\t\t\t\twidth: vm.tileWidth,\r\n\t\t\t\t\theight: vm.tileHeight\r\n\t\t\t\t}, true);\r\n\t\t\t});\r\n\r\n\t\t\t// on mouse out: hide grid\r\n\t\t\t$tileContainer.on('mouseout.dashboard', function () {\r\n\t\t\t\tvm.hideTileGridShadow();\r\n\t\t\t\tvm.hideTileGrid();\r\n\t\t\t});\r\n\t\t}", "insertTile (tile) {\n this._cells[tile.posX][tile.posY] = tile;\n this.updateGrid(tile);\n }", "addTiles ( type, num, arg ) {\n if ( this.amount >= this.max || (arg && this.amount + 3 > this.max) ) {\n return console.log(`the hand is full ` + this.amount);\n }\n\n if ( arg ) this.addCombi( type, num, arg )\n else this.addSingleTile( type, num )\n }", "function add() {\n /* iterate through every block in the tetromino */\n for (let i = 0; i < tetr[currTet].config[configState].length; i++) {\n /* current pos for each block*/\n let row = row_state + tetr[currTet].config[configState][i][0]*36;\n let col = col_state + tetr[currTet].config[configState][i][1]*36;\n\n /* set it in occupied */\n occupied[row/36][col/36] = true;\n }\n}", "function addTile (x : int, y : int, tileType : String) {\n\tvar tileObject = new GameObject();\n\tvar charOn = false;\n\tvar character = 0;\n\t// check to see if this tile has a character or a target on it\n\t// if so, add that AND a blank tile\n\tif( tileType == \"1\" ) {\t\t\t\t// if it is the Green characer\n\t\ttileType == \"_\";\n\t\tcharacter = 1;\n\t\tcharOn = true;\n\t\tGreenInit = [x,y];\n\t} else if( tileType == \"2\" ) { \t\t// if it is the Purple character\n\t\ttileType == \"_\";\n\t\tcharacter = 2;\n\t\tcharOn = true;\n\t\tPurpleInit = [x,y];\n\t}\n\t\n\tvar tileScript = tileObject.AddComponent(\"tile\");\n\t\n\ttileScript.transform.parent = tileFolder.transform;\n\ttileScript.transform.position = Vector3(x,y,0);\n\n\ttileScript.init(x, y, tileType, charOn);\n\t\n\ttileScript.name = \"Tile \"+x+\" \"+y;\n\ttiles[y][x] = tileScript;\n\n\t\n\tif( tileType == \"A\" ) {\n\t\tGreenTargets[0] = tileScript;\n\t\tif(reqGreenTargets<1) {\n\t\t\treqGreenTargets=1;\n\t\t}\n\t} else if( tileType == \"B\" ) {\n\t\tGreenTargets[1] = tileScript;\n\t\tif(reqGreenTargets<2) {\n\t\t\treqGreenTargets=2;\n\t\t}\n\t} else if( tileType == \"C\" ) {\n\t\tGreenTargets[2] = tileScript;\n\t\tif(reqGreenTargets<3) {\n\t\t\treqGreenTargets=3;\n\t\t}\n\t} else if( tileType == \"a\" ) {\n\t\tPurpleTargets[0] = tileScript;\n\t\tif(reqPurpleTargets<1) {\n\t\t\treqPurpleTargets=1;\n\t\t}\n\t} else if( tileType == \"b\" ) {\n\t\tPurpleTargets[1] = tileScript;\n\t\tif(reqPurpleTargets<2) {\n\t\t\treqPurpleTargets=2;\n\t\t}\n\t} else if( tileType == \"c\" ) {\n\t\tPurpleTargets[2] = tileScript;\n\t\tif(reqPurpleTargets<3) {\n\t\t\treqPurpleTargets=3;\n\t\t}\n\t}\n\treturn tileScript;\n}", "function addtile(mtype,ofs,len,x,y,alfa){\n\tvar idxs = [], rollback = points.length + 0, maskrollbacks = {};\n\n\tfor(var i=0; i<tileangles[mtype].length; i++){\n\t\t\n\t\t// Angle mask\n\t\tvar angle = tileangles[mtype][ (i+ofs) % tileangles[mtype].length ];\n\t\tvar thisangle = tileangles[mtype][ (i+ofs+tileangles[mtype].length-1) % tileangles[mtype].length ];\n\t\t\n\t\tvar beta = alfa/36;\n\t\tvar mask = []; for(var j=0; j<10; j++){ mask[j]=0; } for(var j=0; j<thisangle; j++){ mask[ (j+beta+10) % 10 ]=1; }\n\t\t\n\t\t// Adding point\n\t\tvar pidx = addpoint(len, [x, y], mask );\n\t\tif(pidx>-1){\n\t\t\tmaskrollbacks[pidx] = mask;\n\t\t\tidxs.push( pidx );\n\t\t}else{\n\t\t\tfor(var k in maskrollbacks){ removemask(k,maskrollbacks[k]); /*removepointdistance(k);*/ }\n\t\t\tvar rem = (points.length-rollback);\n\t\t\tif(rem>0){ points.splice( rollback, rem ); }\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\t// Vector movement\n\t\tx += Math.cos( alfa *Math.PI/180 ) * len;\n\t\ty += Math.sin( alfa *Math.PI/180 ) * len;\n\t\talfa += ( 180 - angle * 36 );\n\t\t\n\t}// End of points loop\n\t\n\tvar newidxs = []; for(var i=rollback;i<points.length;i++){ newidxs.push(i); }\n\t\n\tif(testtilepoints(newidxs,len)){\n\t\ttiles.push({ type: mtype, pointindexes: idxs, offset: ofs, sidelength: len, rotation: alfa, masks: maskrollbacks });\n\t\treturn tiles.length-1;\n\t}else{\n\t\tfor(var k in maskrollbacks){ removemask(k,maskrollbacks[k]); /*removepointdistance(k);*/ }\n\t\tvar rem = (points.length-rollback);\n\t\tif(rem>0){ points.splice( rollback, rem ); }\n\t\treturn -1;\n\t}\n\t\n}// End of addtile()", "function addTiles(co,jk,jj,dp,dn,dq,dk,dj,dl,dh,dg,di){xc_eg(co,\"jn\",\"jn\",{\"width\":jk,\"height\":jj,\"jn\":[dp||\"\",dn||\"\",dq||\"\",dk||\"\",dj||\"\",dl||\"\",dh||\"\",dg||\"\",di||\"\"],\"ca\":0,\"bs\":0,\"id\":\"\"},0)}", "setTile(position, tile)\n {\n this.tiles[position.y * this.width + position.x] = tile;\n }", "addObstacle(x, y, width, height) {\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n this.setTile(1, x+i, y+j, 1);\n }\n }\n }", "function addTile(context, z, y, x) {\n var tile = context.findTile(z, y, x);\n if ( tile ) {\n tile.locked = false;\n return;\n }\n //console.log(\"addTile z=\"+z+\" y=\"+y+\" x=\"+x);\n var cood = new Float32Array(256*256*2);\n \n// var extent = ol.proj.get(\"EPSG:3857\").getExtent();\n \n var zz = Math.pow(2,parseInt(z));\n var xx = (parseFloat(x))/zz;\n var yy = (parseFloat(y)+1)/zz;\n \n xx = xx*(extent[2]-extent[0])+extent[0];\n yy = yy*(extent[3]-extent[1])+extent[1];\n var xd = (extent[2]-extent[0])/zz/256;\n var yd = (extent[3]-extent[1])/zz/256;\n \n var c = {x:[256],y:[256]};\n for ( var i = 0 ; i < 256 ; i++ ) {\n var xxx = xx + xd*parseFloat(i);\n var yyy = yy - yd*parseFloat(i);\n var xp = ol.proj.transform([xxx,yy], 'EPSG:3857', 'EPSG:4326');\n c.x[i] = xp[0];\n if ( c.x[i] < -180.0 )\n c.x[i] += 360.0;\n else if ( c.x[i] >= 180.0 )\n c.x[i] -= 360.0;\n var yp = ol.proj.transform([xx,yyy], 'EPSG:3857', 'EPSG:4326');\n c.y[i] = yp[1];\n }\n var i = 0;\n for ( var yi = 0 ; yi < 256 ; yi++ ) {\n for ( var xi = 0 ; xi < 256 ; xi++ ) {\n cood[i++] = c.y[yi];\n cood[i++] = c.x[xi];\n }\n }\n context.addTile(\"M\", z, y, x, cood,\n new WRAP.Geo.Bounds(cood[0]*60.0, cood[2*256*255]*60.0, cood[2*256*256-1]*60.0, cood[1]*60.0));\n }", "function tile(isTaken){\n\tthis.isTaken = isTaken;\n}", "update() {\r\n\t\tthis.matrix.forEach((row, y) => row.forEach((tile, x) => {\r\n\t\t\tif (tile && !tile.isEmpty) {\r\n\t\t\t\tlet temp = tile.top;\r\n\t\t\t\ttile.contents.shift();\r\n\t\t\t\tthis.insert(temp);\r\n\t\t\t}\r\n\t\t}));\r\n\t}", "function tileGenerator (i) {\n var currentTile = document.createElement('div'); // intializeing tile\n var letter = mixTiles(allTiles); // chooses the letter from randomized tiles\n currentTile.className = 'tile tile-' + letter + ' ui-draggable ui-draggable-handle'; // intialize the class name with the selected letters\n currentTile.style = \"position: relative;\"; // letters are position relative\n currentTile.id = totalTileID; // unique ID is created for each tile\n $('.tile-set')[i].append(currentTile); // makes an tile object to keep track.\n var shoveTile = { boardPos: i, tileId : totalTileID, charVal: letter, immobile: false};\n tileObj.push(shoveTile); // pushing into the array\n totalTileID++; // increase the unique ID.\n}", "addTile() {\n if(this.full()) {\n return false;\n }\n while(true) {\n let r = randIdx(this.board.length);\n let c = randIdx(this.board[r].length);\n if(this.board[r][c] == 0) {\n this.board[r][c] = randInt(1,2) * 2;\n return true;\n }\n }\n }", "function appendTile( tile )\n {\n\n var scope = tile.map;\n scope.tiles.splice( scope.tiles.indexOf( tile ), 1 );\n\n var img = tile.img;\n scope.loadedTiles.push( tile );\n scope.renderTiles( true );\n\n scope.eventEmitter.emit( Map.ON_TILE_LOADED, tile );\n\n if( scope.tiles.length == 0 ){\n\n scope.eventEmitter.emit( Map.ON_LOAD_COMPLETE, 0 );\n }\n }", "function appendTile( tile )\n {\n\n var scope = tile.map;\n scope.tiles.splice( scope.tiles.indexOf( tile ), 1 );\n\n var img = tile.img;\n scope.loadedTiles.push( tile );\n scope.renderTiles( true );\n\n scope.eventEmitter.emit( Map.ON_TILE_LOADED, tile );\n\n if( scope.tiles.length == 0 ){\n\n scope.eventEmitter.emit( Map.ON_LOAD_COMPLETE, 0 );\n }\n }", "createBoard() {\n\t\tfor (let i = 0; i < 6; i++) {\n\t\t\tfor (let j = 0; j < 6; j++) {\n\t\t\t\tlet tile = new MyTile(this.scene, this);\n\t\t\t\tlet pieceSize = 0.395 + 0.005;\n\t\t\t\ttile.addTransformation(['translation', -3 * pieceSize + pieceSize * j, -3 * pieceSize + pieceSize * i, 0]);\n\t\t\t\tthis.tiles.push(tile);\n\t\t\t}\n\t\t}\n\t\tfor (let i = 0; i < 8; i++) {\n\t\t\tthis.whitePieces.push(new MyPieceWhite(this.scene, 'whitePiece'));\n\t\t\tthis.blackPieces.push(new MyPieceBlack(this.scene, 'blackPiece'));\n\t\t}\n\t}", "AddTileToCell(tileID, board, sideSwitcher){\r\n\t\t\r\n\t\t\tlet tile = board.FindTileById(tileID);\r\n\t\t\tlet nextOneUpCoords = tile.GetNextOneUpCoords();\r\n\t\t\tlet nextOneUpTile = board.FindTileByCoordinates(nextOneUpCoords.col, nextOneUpCoords.row);\r\n\t\t\tlet victoryCheck = new VictoryCheck();\r\n\t\t\t\r\n\t\t\tlet allCol = board.GetAllTilesInColumn(tile.col);\r\n\t\t\tlet allRow = board.GetAllTilesInRow(tile.row);\r\n\t\t\t\r\n\t\t\tlet allLeftDiags = board.GetLeftDiagonals(tile.col, tile.row);\r\n\t\t\t\r\n\t\t\tconsole.log(allLeftDiags);\r\n\t\t\t\r\n\t\t\tlet allRightDiags;\r\n\t\t\t\r\n\t\t\tfor(let a = allCol.length-1; a > -1; a--){\r\n\t\t\t\t\r\n\t\t\t\tif(allCol[a].occupationCode == 0){\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sideSwitcher.currentTurn == 1){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList = \"\";\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList.add(\"redCounter\");\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).setAttribute(\"data-occupationcode\", sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tallCol[a].ChangeOccupationCode(sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(sideSwitcher.currentTurn == 2){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList = \"\";\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).childNodes[0].classList.add(\"blueCounter\");\r\n\t\t\t\t\t\tdocument.getElementById(allCol[a].tileID).setAttribute(\"data-occupationcode\", sideSwitcher.currentTurn);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tallCol[a].ChangeOccupationCode(sideSwitcher.currentTurn);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tboard.UpdateTile(allCol[a]);\r\n\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t\t\r\n\t\t\t\t} \t\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t//\tCheck for vertical win \r\n\t\t\tvictoryCheck.CheckVictory(allRow, sideSwitcher.currentTurn);\r\n\t\t\t\r\n\t\t\t//\tCheck for a horizontal win \r\n\t\t\tvictoryCheck.CheckVictory(allCol, sideSwitcher.currentTurn);\r\n\t\t\t\r\n\r\n\t\t\tsideSwitcher.ChangeTurn();\r\n\t\r\n\t\t\r\n\t\t}", "addNewTile(value, newTileNum, newTerrain, newResource, newResourceQuantity) {\n this.setTileNum(value, newTileNum);\n this.setTerrain(value, newTerrain);\n this.setResource(value, newResource);\n this.setResourceQuantity(value, newResourceQuantity);\n addTimeStamps(value);\n }", "create_tile(opts) {\n var tile = {\n area: 0,\n height: 0,\n model: 0,\n next: 0,\n rotate: 0\n };\n\n _.assign(tile, opts);\n\n var tile_index = this.tiles.length;\n this.tiles.push(tile);\n return tile_index;\n }", "function sampleTile($element){\n\t\tsetPaintTile($element.type, $element.background);\n\t}", "function generateTiles()\r\n{\r\n\tfor(let i = 0;i < mapSize;i++){\r\n\tgenerateTileType();\t\r\n\t}\r\n}", "draw() {\n this.tiles.forEach(t => {\n var tileCoords = {\n x: this.origin.x + (t.x * 8) + 16,\n y: this.origin.y + (t.y * 8)\n }\n this.context.drawImage(RESOURCE.sprites, t.t * 8, 16, 8, 8, tileCoords.x, tileCoords.y, 8, 8);\n });\n }", "function createTiles() {\n var divName = \"puzzlearea\";\n var tileNumber = 1;\n for (var i = 0; i < NUMBER_OF_ROWS_AND_COLUMNS; i++) {\n for (var j = 0; j < NUMBER_OF_ROWS_AND_COLUMNS; j++) {\n\n var tileElement = document.createElement(\"div\");\n tileElement.classList.add(\"tile\");\n \n var top = WIDTH_HEIGHT_OF_TILE * i; // x value\n var left = WIDTH_HEIGHT_OF_TILE * j; // y value\n \n // Set the tile's position and its background position\n tileElement.style.top = top + \"px\";\n tileElement.style.left = left + \"px\";\n tileElement.style.backgroundPosition = -left + \"px \" + -top + \"px\";\n \n tileElement.innerHTML = \"<span>\" + tileNumber++ + \"</span>\"; // Update tile number\n \n tileElement.onmouseover = highlightTile; // Highlight tiles that are moveable \n tileElement.onmouseout = unHighlightTile; // Unhighlight those that cannot be moved\n tileElement.onclick = moveTile; // Movable tiles can be moved upon clicking them\n \n // Append tile to target div, skipping last (Empty) tile\n var lastTile = NUMBER_OF_ROWS_AND_COLUMNS - 1;\n if (!(i == lastTile && j == lastTile)) {\n $(divName).appendChild(tileElement);\n }\n }\n }\n }", "function newGame() {\n generateTileArray();\n refreshCanvas();\n\n}", "function shiftTiles() {\n // Shift tiles\n \n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n \n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function initTiles(){\n\n let sky = new Image();\n sky.src=\"./imgs/sky-temp.png\";\n tiles.push(sky);\n let ground = new Image();\n ground.src=\"./imgs/ground-tile.png\";\n tiles.push(ground);\n let walk1 = new Image();\n walk1.src=\"./imgs/walk1.png\";\n tiles.push(walk1);\n let walk2 = new Image();\n walk2.src=\"./imgs/walk2.png\";\n tiles.push(walk2);\n let walk3 = new Image();\n walk3.src=\"./imgs/walk3.png\";\n tiles.push(walk3);\n let walk4 = new Image();\n walk4.src=\"./imgs/walk4.png\";\n tiles.push(walk4);\n let moon = new Image();\n moon.src=\"./imgs/moon-temp.png\";\n tiles.push(moon);\n let sun = new Image();\n sun.src=\"./imgs/sun.png\";\n tiles.push(sun);\n let plpic = new Image();\n plpic.src=\"./imgs/abomination.png\";\n tiles.push(plpic);\n let back_new= new Image();\n back_new.src=\"./imgs/tree_70x128.png\";\n tiles.push(back_new);\n let back_cloud= new Image();\n back_cloud.src=\"./imgs/back_proper.png\";\n tiles.push(back_cloud);\n let speed= new Image();\n speed.src=\"./imgs/speed.png\";\n tiles.push(speed);\n\n }", "loadTiles(tileset) {\n let tileGraphicsLoaded = 0;\n for (let i = 0; i < tileset.length; i++) {\n\n let tileGraphic = new Image();\n tileGraphic.src = tileset[i];\n tileGraphic.onload = (tile) => {\n // Once the image is loaded increment the loaded graphics count and check if all images are ready.\n // console.log(tile, this);\n tileGraphicsLoaded++;\n if (tileGraphicsLoaded === tileset.length) {\n set(this, 'tilesLoaded', MAP);\n // this.drawGrids(MAP);\n this.drawGrid(\n \"gamecanvas-flat\",\n \"hsl(60, 10%, 85%)\",\n true,\n this.currentLayout,\n this.mapService.hexMap,\n this.showTiles\n );\n\n }\n }\n\n this.tileGraphics.pushObject(tileGraphic);\n }\n }", "function shiftTiles() {\n //Mover\n for (var i = 0; i < level.columns; i++) {\n for (var j = level.rows - 1; j >= 0; j--) {\n //De baixo pra cima\n if (level.tiles[i][j].type == -1) {\n //Insere um radomico\n level.tiles[i][j].type = getRandomTile();\n } else {\n //Move para o valor que está armazenado\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j + shift)\n }\n }\n //Reseta o movimento daquele tile\n level.tiles[i][j].shift = 0;\n }\n }\n }", "buildTile(width, height, shuffled, lastTile) {\n let k = 0;\n var tNo = 0;\n var tWidth = 0;\n var tHeight = 0;\n var tileSet = \"\";\n for (let i = 0; i < this.row; i++) {\n for (let j = 0; j < this.col; j++) {\n tileSet += `<div class=\"tile t${shuffled[k] - 1}\" id=\"${i}${j}\"></div>`;\n k++;\n }\n }\n $(\".puzzle\").html(tileSet);\n this.puzzleTileSize(width, height);\n for (var i = 0; i < this.row; i++) {\n tWidth = 0;\n for (var j = 0; j < this.col; j++) {\n $(`.tile.t${tNo}`).css({\n \"background-position\": `${Math.floor(tWidth)}px ${Math.floor(tHeight)}px`\n });\n $(`.tile.t${tNo}`).attr(\"value\", \"\");\n tWidth -= (width / this.col);\n tNo++;\n }\n tHeight -= (height / this.row);\n }\n if (!lastTile) {\n $(`.tile.t${this.row * this.col - 1}`).css({ \"opacity\": 0 });\n $(`.tile.t${this.row * this.col - 1}`).attr(\"value\", \"gap\");\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n level.tiles[i][j].isNew = true;\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "function shiftTiles() {\n // Shift tiles\n for (var i=0; i<level.columns; i++) {\n for (var j=level.rows-1; j>=0; j--) {\n // Loop from bottom to top\n if (level.tiles[i][j].type == -1) {\n // Insert new random tile\n level.tiles[i][j].type = getRandomTile();\n } else {\n // Swap tile to shift it\n var shift = level.tiles[i][j].shift;\n if (shift > 0) {\n swap(i, j, i, j+shift)\n }\n }\n \n // Reset shift\n level.tiles[i][j].shift = 0;\n }\n }\n }", "append_tile_at(tx, ty, opts) {\n var tile = this.get_tile_at_cell(tx, ty);\n console.assert(tile);\n\n // traverse chain\n while (tile.next)\n tile = self.tiles[tile.next];\n\n // add the model\n tile.next = this.create_tile(opts);\n }", "move (tile) {\r\n let world = this.tile.world\r\n this.calories -= this.movementCost\r\n if (tile) {\r\n return world.moveObj(this.key, tile.xloc, tile.yloc)\r\n }\r\n let neighborTiles = this.tile.world.getNeighbors(this.tile.xloc, this.tile.yloc)\r\n let index = Tools.getRand(0, neighborTiles.length - 1)\r\n let destinationTile = neighborTiles[index]\r\n return world.moveObj(this.key, destinationTile.xloc, destinationTile.yloc)\r\n }", "placeTower() {\n var x = layer.getTileX(game.input.activePointer.worldX);\n var y = layer.getTileY(game.input.activePointer.worldY);\n\n var tile = map.getTile(x, y, layer);\n //if else if else - checks to see if the tile already has a tower, and if the tile index(id/type) can be built on.\n if (gameState.wallet >= gameData.level.towers[0].cost) {\n //if else if else - checks to see if the tile already has a tower, and if the tile index(id/type) can be built on.\n if (tile.properties.hasTower) {\n console.log('Already have a tower bro!')\n } else if (tile.index != gameData.level.buildableTileId) { //This is hardcoded for the current tileset. Stretch goal: \n console.log(\"no go bro\")\n } else {\n tile.properties.hasTower = true\n new Tower(tile.x, tile.y, gameData.level.towers[0].type)\n numOfTowers++\n gameState.wallet -= gameData.level.towers[0].cost\n // game.add.sprite(tile.x * 32, tile.y * 32, gameData.level.towers[0].type)\n }\n } else {\n console.log(\"Not enough Minerals!\")\n }\n currentTileProperties = JSON.stringify(tile.properties)\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "newTile(board) {\n let num = this.getRandom(this.boardSize);\n let r = Math.random();\n do {\n num = this.getRandom(this.boardSize);\n } while (board[num] != 0);\n if (r < 0.9) {\n board[num] = 2;\n } else {\n board[num] = 4;\n }\n }", "function addTiles() {\n\n for (var i=1; i<=10; i++) {\n $('.row').append(tile);\n }\n\n}", "function drawTileGrid(gameContainer, normalTexture, floodedTexture) {\r\n\tfor (var i = 0; i < 6; i++) {\r\n\t\tfor (var j = 0; j < 6; j++) {\r\n\t\t\tvar tile = new Tile(normalTexture, floodedTexture, i, j, 'tile_' + i + '_' + j);\r\n\t\t\t// Skip tile positions on first row that need to be blank\r\n\t\t\tif ((i == 0 && j == 0) || (i == 0 && j == 1) || (i == 0 && j == 4) || (i == 0 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on second row that need to be blank\r\n\t\t\tif ((i == 1 && j == 0) || (i == 1 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on fifth row that need to be blank\r\n\t\t\tif ((i == 4 && j == 0) || (i == 4 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\t\t\t// Skip tile positions on sixth row that need to be blank\r\n\t\t\tif ((i == 5 && j == 0) || (i == 5 && j == 1) || (i == 5 && j == 4) || (i == 5 && j == 5)) {\r\n\t\t\t\ttile.alpha=0;\r\n tile.state = \"sunk\";\r\n tile.buttonMode = false;\r\n tile.interactive = false;\r\n\t\t\t}\r\n\r\n\t\t\t// Push tile object onto gameboard 2D Array\r\n\t\t\tgameBoard[i][j] = tile;\r\n\t\t\tgameContainer.addChild(tile);\r\n\t\t}\r\n\t}\r\n}", "function addNewTile() {\r\n var empties = availableCells();\r\n var value = Math.random() < TWO_CHANCE ? 2 : 4;\r\n var newKey = empties[Math.floor(Math.random() * empties.length)];\r\n board[newKey] = value;\r\n\r\n //save game state\r\n localStorage.setItem(\"board\", JSON.stringify(board));\r\n}", "animateTiles() {\n this.checkers.tilePositionX -= .5;\n this.checkers.tilePositionY -= .5;\n this.grid.tilePositionX += .25;\n this.grid.tilePositionY += .25;\n }", "function template(){\n canvas = document.getElementById('tiles');\n ctx = canvas.getContext('2d');\n createTile(ctx,'dirt',0,0);\n createTile(ctx,'grass',85,0);\n createTile(ctx,'water',170,0);\n}", "function drawTileMap(){\n //+3, ker izrisujemo en tile prej(levo), ker indeksiramo z 0, in tile za tem\n let posX=-Math.floor(tileSide);\n let posY=-Math.floor(tileSide);\n for(let i=worldOffsetY; i<heightCols+worldOffsetY+4; i++){\n for(let j=worldOffsetX; j<widthCols+worldOffsetX+4; j++){\n if(map[i][j]===1){\n ctx.drawImage(tiles[1],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===2){\n ctx.drawImage(tiles[6],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===3){\n ctx.drawImage(tiles[7],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===7){\n ctx.drawImage(tiles[10],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n else if(map[i][j]===11){\n ctx.drawImage(tiles[11],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n\n else{\n ctx.drawImage(tiles[0],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY),tileSide,tileSide);\n }\n if(map[i][j]===9){\n ctx.drawImage(tiles[9],Math.round(posX+tileOffsetX),Math.round(posY+tileOffsetY)-128+tileSide,70,128);\n }\n posX+=tileSide\n }\n posX=-tileSide;\n posY+=tileSide;\n }\n }", "addElement(tile) {\n let self = this;\n let div = document.createElement('div');// create a new div element\n let newContent = document.createTextNode(tile);// and give it some content\n \n div.style.height = ((self.board.clientHeight - 2) / 12).toFixed().toString() + 'px'; // make the tile fit in a twelve tiles row\n div.style.width = ((self.board.clientWidth - 2) / 12).toFixed().toString() + 'px'; // make the tile fit in a twelve tiles row\n div.className = 'tile'; // add .tile class for further css styling\n div.onclick = self.tileClick.bind(self); // add callback function to the click event and bind the current 'this' to it. otherwise the 'this' will be the event.\n \n div.setAttribute('data-location', tile);\n div.appendChild(newContent);// add the text node to the newly created div\n self.board.appendChild(div);// add the newly created element and its content into the DOM\n }", "function addTetris(){\n board.inPlay = false ;\n for( var i = 0 ; i < tetris1.position[ tetris1.rotation % tetris1.types ].length ; ++ i ){\n board.grid[ tetris1.position[ tetris1.rotation % tetris1.types ][i].x + tetris1.dx ][ tetris1.position[ tetris1.rotation % tetris1.types ][i].y + tetris1.dy ].bool = true ;\n board.grid[ tetris1.position[ tetris1.rotation % tetris1.types ][i].x + tetris1.dx ][ tetris1.position[ tetris1.rotation % tetris1.types ][i].y + tetris1.dy ].color= tetris1.color ;\n checkLine( tetris1.position[ tetris1.rotation % tetris1.types ][i].y + tetris1.dy ) ;\n }\n board.checkStatus() ;\n}", "function tileClick() {\n\n //le quitamos el eventlistener para no poder hacerle click\n this.removeEventListener(\"click\", tileClick);\n\n //cambiamos clase para mostar la tile\n this.classList.replace(\"undigged\", \"digged\")\n\n //comprobamos si la tile tiene algun item que mostrar\n stageMaster[currentPlayerLevel].forEach((item) => {\n\n item.piece.forEach(piece => {\n if (piece.pos.x == this.dataset.row && piece.pos.y == this.dataset.column) {\n\n //creamos el elemento de la imagen \n var newImg = document.createElement('img');\n\n //añadimos clase al elemento img\n newImg.classList.add(\"itemImg\");\n\n //añadimos clase si la imagen tiene que estar girada\n newImg.classList.add(\"rot-\" + piece.rot);\n\n //añadimos los parametros de ruta la imagen\n newImg.src = piece.img;\n\n //finalmente añadimos el div a la tile\n this.appendChild(newImg);\n }\n });\n })\n}", "function GetTiles() {\n for (var i = 1; i <= 7; i++) {\n //looping 7 times\n if ($(\"#tilespawn\" + i).has(\"img\").length == 0) {\n TileTohand(\"#tilespawn\" + i);\n //adding tile\n }\n }\n}", "tileRollOver() {\n this.style.backgroundColor = '#f7e22a';\n towerGame.updateCostInfoElement(this.cost);\n }", "function createGrid() {\n clearValues();\n shuffleTiles();\n for (let i = 0; i < tiles.length; i++) {\n let tile = document.createElement('img');\n tile.setAttribute('src', 'assets/images/tile-back.jpg');\n tile.setAttribute('data-id', i);\n document.getElementById('tile-grid').appendChild(tile);\n tile.addEventListener('click', revealTile);\n }\n}", "function tetris(){\n\tif(frameCount % 60 === 0) {\n\t\tvar tetris = createSprite(200,1,50,50);\n\t\ttetris.x = mario.x\n\t\ttetris.scale = 0.3\n\t\ttetris.velocityY = tetris.velocityY + 2\n\n\t\t\n\t\t\n\n\tvar rand = Math.round(random(1,7));\n switch(rand) {\n case 1: tetris.addImage(t1img);\n break;\n case 2: tetris.addImage(t2img);\n break;\n case 3: tetris.addImage(t3img);\n break;\n case 4: tetris.addImage(t4img);\n break;\n case 5: tetris.addImage(t5img);\n break;\n case 6: tetris.addImage(t6img);\n break;\n\t case 7: tetris.addImage(t7img);\n break;\n default: break;\n}\ntgroup.add(tetris)\n}}", "function updateTiles() {\n forEachTile(function update(row, col) {\n setTimeout(function () {\n tileColor = jQuery.Color().hsla({\n hue: (tileColor.hue() + (Math.random() * tileMaxHueShift)) % 360,\n saturation: tileMinSaturation + (Math.random() * tileSaturationSpread),\n lightness: tileMinLightness + (Math.random() * tileLightnessSpread),\n alpha: tileOpacity\n });\n\n var currentColor = jQuery.Color($(\"#\" + row + \"-\" + col), \"backgroundColor\");\n\n // when to update the Tiles\n if (currentColor.lightness() < tileLightnessDeadZoneLowerBound() ||\n currentColor.lightness() > tileLightnessDeadZoneUpperBound() ||\n currentColor.lightness() == 1) {\n $(\"#\" + row + \"-\" + col).animate({\n backgroundColor: tileColor\n }, tileFadeDuration);\n }\n }, getTileDelayTime(row, col));\n });\n }", "function setTL(){\n for(var i=0; i<im_p.length; i++){\n var c = Math.floor(i /rows); var r = i %rows; //current column /rom of tile in canvas\n tl_p[im_p[i].id] = {px:im_p[i].px, py:im_p[i].py, tx:c *tl_size.w, ty:r *tl_size.h, ord:i};\n }\n drawTL(tl_p); //draw tiles in canvas\n }", "function createGame(frame){ // creates the game area by looping on the createTile function\n for(var i = 0; i < GAME_SIZE; i++)\n frame.appendChild(createTile());\n}", "function Tile( element ){\n\n// Tile element\nvar tile = element;\n\n// Global settings\n\n// Declare css for when the tile is in its idle state.\n var idleCss = \"perspective( 800px ) rotateX( 0deg ) rotateY( 0deg ) translateZ( 0px )\";\n\n\nvar initialize = function() {\n\n// Set transform origin to the center of the element.\ntile.style.webkitTransformOrigin = \"0% 50%\";\ntile.style.MozTransformOrigin = \"0% 50%\";\ntile.style.msTransformOrigin = \"0% 50%\";\ntile.style.oTransformOrigin = \"0% 50%\";\ntile.style.transformOrigin = \"0% 50%\";\n\n// Make sure the parent preserves the 3d perspective\ntile.parentElement.style.webkitTransformStyle = \"preserve-3d\";\ntile.parentElement.style.MozTransformStyle = \"preserve-3d\";\ntile.parentElement.style.msTransformStyle = \"preserve-3d\";\ntile.parentElement.style.oTransformStyle = \"preserve-3d\";\ntile.parentElement.style.transformStyle = \"preserve-3d\";\n\n// Set element transform times\ntile.style.webkitTransition = \"-webkit-transform 0.08s\";\ntile.style.MozTransition = \"-moz-transform 0.08s\";\ntile.style.msTransition = \"-ms-transform 0.08s\";\ntile.style.oTransition = \"-o-transform 0.08s\";\ntile.style.transition = \"transform 0.08s\";\n\n// This gives an antialiased effect for transforms in firefox.\ntile.style.outline = \"1px solid transparent\";\n\n// Font smoothing for webkit.\ntile.style.webkitFontSmoothing = \"antialiased\";\n\n// Listen to mouse events for the tile.\ntile.addEventListener('mousedown', MouseDown, false);\n\n}\n\n\nvar pushTile = function( x, y ){\n\n// Get the elements width and height.\nvar width = tile.offsetWidth;\nvar height = tile.offsetHeight;\n\nvar translateString = \"perspective( 800px ) \";\n\n\n/* Tilt based on position clicked\n*\n* Not quite sure how msft do this, but here's my logic:\n*\n* If the click is closer to the left, right, top or bottom:\n* Then tilt in that direction\n*\n* Unless the click is in the middle quater of the tile:\n* In which case, push the tile down.\n*\n*/\n\n// If the click is in the center quater of the element, push down.\nif ( x > width/4 && x < (width/4 * 3) && y > height/4 && y < (height/4 * 3) ) {\ntile.style.webkitTransformOrigin = \"50% 50%\";\ntile.style.MozTransformOrigin = \"50% 50%\";\ntile.style.msTransformOrigin = \"50% 50%\";\ntile.style.oTransformOrigin = \"50% 50%\";\ntile.style.transformOrigin = \"50% 50%\";\nvar trans = 40 / (width/150);\ntranslateString += \"rotateX( 0deg ) rotateY( 0deg ) translateZ(\" + -trans +\"px )\";\n}\n\n// is the user closer to the right/left hand side?\nelse if ( Math.min( x, width - x) < Math.min( y, height - y) ) {\nvar deg = 10 / (width/150) ;\n// Tilt on the left side\nif ( x < width - x ) {\n\ntile.style.webkitTransformOrigin = \"100% 50%\";\ntile.style.MozTransformOrigin = \"100% 50%\";\ntile.style.msTransformOrigin = \"100% 50%\";\ntile.style.oTransformOrigin = \"100% 50%\";\ntile.style.transformOrigin = \"100% 50%\";\ntranslateString += \"rotateX( 0deg ) rotateY( \"+ -deg + \"deg ) translateZ( -0px )\";\n\n// Tilt on the right side\n} else {\n\ntile.style.webkitTransformOrigin = \"0% 50%\";\ntile.style.MozTransformOrigin = \"0% 50%\";\ntile.style.msTransformOrigin = \"0% 50%\";\ntile.style.oTransformOrigin = \"0% 50%\";\ntile.style.transformOrigin = \"0% 50%\";\ntranslateString += \"rotateX( 0deg ) rotateY( \"+ deg + \"deg ) translateZ( -0px )\";\n}\n\n// the user is closer to the top/bottom side (also the default)\n} else {\nvar incline = 10 / (height/150);\n// Tilt on the top\nif ( y < height - y ) {\n\ntile.style.webkitTransformOrigin = \"50% 100%\";\ntile.style.MozTransformOrigin = \"50% 100%\";\ntile.style.msTransformOrigin = \"50% 100%\";\ntile.style.oTransformOrigin = \"50% 100%\";\ntile.style.transformOrigin = \"50% 100%\";\ntranslateString += \"rotateX( \"+incline+\"deg ) rotateY( 0deg ) translateZ( -0px )\";\n\n// Tilt on the bottom\n} else {\n\ntile.style.webkitTransformOrigin = \"50% 0%\";\ntile.style.MozTransformOrigin = \"50% 0%\";\ntile.style.msTransformOrigin = \"50% 0%\";\ntile.style.oTransformOrigin = \"50% 0%\";\ntile.style.transformOrigin = \"50% 0%\";\ntranslateString += \"rotateX( \"+ -incline +\"deg ) rotateY( 0deg ) translateZ( -0px )\";\n}\n}\n\n// Apply transformation to tile.\ntile.style.webkitTransform = translateString;\ntile.style.MozTransform = translateString;\ntile.style.msTransform = translateString;\ntile.style.oTransform = translateString;\ntile.style.transform = translateString;\n\ndocument.addEventListener('mouseup', MouseUp, false);\n\n};\n\nvar MouseDown = function( event ){\n\n// Chrome\nif ( event.offsetX ) {\npushTile( event.offsetX, event.offsetY );\nreturn;\n}\n\n// Non offsetX browsers\nvar tilePosition = elementPosition( tile );\nvar x = event.pageX - tilePosition.x;\nvar y = event.pageY - tilePosition.y;\n\npushTile( x, y );\n\n};\n\n\nvar MouseUp = function( event ){\n\n// Set the element to its idle state\ntile.style.webkitTransform = idleCss;\ntile.style.MozTransform = idleCss;\ntile.style.msTransform = idleCss;\ntile.style.oTransform = idleCss;\ntile.style.transform = idleCss;\n\ndocument.removeEventListener('mouseup', MouseUp, false);\n};\n\n// Element position finding for non webkit browsers.\n// How will this perform on mobile?\nvar getNumericStyleProperty = function(style, prop){\n return parseInt(style.getPropertyValue(prop),10) ;\n}\n\nvar elementPosition = function( e ){\nvar x = 0, y = 0;\nvar inner = true ;\ndo {\nx += e.offsetLeft;\ny += e.offsetTop;\nvar style = getComputedStyle(e,null) ;\nvar borderTop = getNumericStyleProperty(style,\"border-top-width\") ;\nvar borderLeft = getNumericStyleProperty(style,\"border-left-width\") ;\ny += borderTop ;\nx += borderLeft ;\nif (inner){\nvar paddingTop = getNumericStyleProperty(style,\"padding-top\") ;\nvar paddingLeft = getNumericStyleProperty(style,\"padding-left\") ;\ny += paddingTop ;\nx += paddingLeft ;\n}\ninner = false ;\n} while (e = e.offsetParent);\nreturn { x: x, y: y };\n}\n\n// Initialize the tile.\ninitialize();\n}", "_generateMap() {\n // Generate all the empty tiles\n var width = this.display.getOptions().width;\n var height = this.display.getOptions().height;\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n let tile = new Tile(\"empty\", x, y);\n let key = tile.getPositionKey();\n this.map[key] = tile;\n }\n }\n\n // Next, use celluar automata to lay down the first layer of resources\n // but make sure they meet the minimum bar\n var sumIronTiles = 0;\n while (sumIronTiles <= config.map.resources.iron.minTiles) {\n var ironMap = new ROT.Map.Cellular(width, height, { connected: true});\n // % chance to be iron\n ironMap.randomize(config.map.resources.iron.baseChance);\n // iterations smooth out and connect live tiles\n for (let i = 0; i < config.map.resources.iron.generations; i++) {\n ironMap.create();\n }\n // Check to ensure that we have a minimum number of iron tiles\n sumIronTiles = ironMap._map.flat().reduce(doSum, 0);\n }\n\n // Go through the map and change the tiles we touch to type \"iron\"\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (ironMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n let resourceAmount = this._calculateResourceAmount(x, y, ironMap._map, \"iron\");\n tile.addResources(\"iron\", resourceAmount);\n }\n }\n }\n\n // Same for coal\n var sumCoalTiles = 0;\n while (sumCoalTiles <= config.map.resources.coal.minTiles) {\n var coalMap = new ROT.Map.Cellular(width, height, { connected: true });\n coalMap.randomize(config.map.resources.coal.baseChance);\n for (let i = 0; i< config.map.resources.coal.generations; i++) {\n coalMap.create();\n }\n sumCoalTiles = coalMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"coal\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (coalMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, coalMap._map, \"coal\");\n tile.addResources(\"coal\", resourceAmount);\n }\n }\n }\n }\n\n // Same for copper\n var sumCopperTiles = 0;\n while (sumCopperTiles <= config.map.resources.copper.minTiles) {\n var copperMap = new ROT.Map.Cellular(width, height, { connected: true });\n copperMap.randomize(config.map.resources.copper.baseChance);\n for (let i = 0; i< config.map.resources.copper.generations; i++) {\n copperMap.create();\n }\n sumCopperTiles = copperMap._map.flat().reduce(doSum, 0);\n }\n\n // Change tiles to \"copper\", but only if they're empty!\n for (let x = 0; x < width; x++) {\n for (let y = 0; y < height; y++) {\n if (copperMap._map[x][y] == 1) {\n let key = `${x},${y}`\n let tile = this.map[key];\n if (tile.tileType == \"empty\") {\n let resourceAmount = this._calculateResourceAmount(x, y, copperMap._map, \"copper\");\n tile.addResources(\"copper\", resourceAmount);\n }\n }\n }\n }\n }", "function addTile(mouseEvent) {\n var clicked = getCoords(mouseEvent);\n var key = clicked[0] + \"-\" + clicked[1];\n\n if (mouseEvent.shiftKey) {\n delete layers[currentLayer][key];\n } else {\n layers[currentLayer][key] = [selection[0], selection[1]];\n }\n draw();\n}", "function generateTiles() { \n\tposArr = [];\n\tvar tilArr = [];\n\tvar finArr = [];\n\tfor(var i = 0; i < 24; i++){\n\t\tvar temp = randInt(0, 23);\n\t\twhile(posArr.indexOf(temp) >= 0){\n\t\t\ttemp = randInt(0, 23);\n\t\t}\n\t\tposArr[i] = temp;\n\t}\n\tfor(var i = 0; i < 24; i++) {\n\t\tvar temp = new Tile(\"tile\", TextureFrame(posArr[i] + \".png\"), i);\n\t\ttilArr.push(temp);\n\t\ttiles.set(i, tilArr[i]);\n\t\tpuzzleC.addChild(tilArr[i]);\n\t}\n\t\n\temptyTile = new Tile(\"emptyTile\", TextureFrame(\"24.png\"), 24);\n\tposArr.push(24)\n\temptyTile.visible = false;\n\ttiles.set(24, emptyTile);\n\tpuzzleC.addChild(emptyTile);\n\t\n\tconsole.log(posArr);\n\tconsole.log(tilArr);\n}", "createGameBoard() {\n function tileClickHandler() {\n let row, col;\n \n row = game.getRowFromTile(this.id);\n col = game.getColFromTile(this.id);\n\n //If is not your turn\n if (!player.getCurrentTurn() || !game) {\n alert('Its not your turn!');\n return;\n }\n\n //In gomoku first move for blacks have to be in the middle tile\n if(game.moves == 0 && !(row == 7 && col == 7)){\n alert('You have to put pawn in the middle of grid!');\n return;\n }\n //In gomoku second move for blacks have to be beyond 5x5 grid in the middle\n else if(game.moves == 2 && (row >= 5 && row <= 9 && col >= 5 && col <= 9)){\n alert('You have to put pawn beyond 5x5 grid in the middle!');\n return;\n }\n //If tile has been already played\n else{\n if ($(this).prop('disabled')) {\n alert('This tile has already been played on!');\n return;\n }\n\n //Update board after player turn.\n game.playTurn(this);\n game.updateBoard(player.getPlayerColor(), row, col, this.id);\n\n //Check if player win\n game.checkWinner();\n \n player.setCurrentTurn(false);\n }\n } \n $('#color').css(\"background-color\", `${player.getPlayerColor()}`);\n game.createTiles(tileClickHandler);\n if(player.getPlayerColor() != \"white\" && this.moves == 0){\n game.setTimer();\n }else{\n $(\".center\").prop(`disabled`, true);\n }\n }", "function doPaintTile($element){\n\t\t$element.type = paintTile.type;\n\n\t\tif(paintTile.type === 'color'){\n\t\t\t$element.style.backgroundColor = paintTile.background;\n\t\t\t$element.style.backgroundImage = '';\n\t\t\t$element.setAttribute(\"class\", defaultTile.classes);\n\t\t}else if(paintTile.type === 'texture'){\n\t\t\t$element.style.backgroundColor = defaultColor;\n\t\t\t$element.style.backgroundImage = '';\n\t\t\t$element.setAttribute(\"class\", defaultTile.textureclass+paintTile.texture);\n\t\t}else if(paintTile.type === 'image'){\n\t\t\t$element.style.backgroundColor = '';\n\t\t\t$element.style.backgroundImage = 'url('+paintTile.background+')';\n\t\t}\n\n\t\t$element.background = paintTile.background;\n\n\t}", "function addTileColor() {\n\n for (var i=0; i<numberOfTiles; i++) {\n var tileAtIndex = $('.tile').eq(i);\n tileAtIndex.css('background', colorTiles(i));\n }\n\n}", "function createTiles(){\n\t\n\t\n // figure out how wide and tall each tile should be based on the image with and height\n // then ceiling the float that will result from dividing the total size of the image\n // by the number of rows and columns needed\n \t_tile_width = Math.ceil(_image_width/_num_cols); // divide the total number of divs needed by the number of columns to get\n\t\t\t\t\t\t\t\t\t\t\t\t\t// the tile width\n \n\t_tile_height = Math.ceil(_image_height/_num_rows); // divide the total number of divs needed by the number of rows to get\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// the tile height\n\n \n\t//Create the two dimensional array needed to save the tiles in\n\t tile_array = doubleArray(_num_rows, _num_cols);\n\t\n // add all of the tiles to your page using nested for loops and\n\tfor(var r=0; r<_num_rows ; r++) // to loop over each row\n\t{\n\t\tfor(var c=0; c<_num_cols ; c++) // to loop over each column\n\t\t{\n\t\t\tif(r === c && c === 0) // if we are in the first row and column, we mark it as the empty tile\n\t\t\t{\n\t\t\t\ttile_array[r][c] = 0; // we mark it by adding zero\n\t\t\t\tcontinue; //continue to the loop\n\t\t\t}\n\t\t\t\n\t\t\tvar container = document.getElementById(\"cont\"); // get the container div which we will place the other divs in\n\t\t\ttile_array[r][c] = createDiv(r,c); //save each div created into the array\n\t\t\tcontainer.appendChild(tile_array[r][c]); //append the div created and saved to the container\n\t\t\t\n\t\t}\n\t}\n\n\n\t\n}", "function MakeTiles(myBoard = document.getElementById(\"myBoard\")) {\n\n //Loop eje X\n for (var y = 0; y < boardSize.y; y++) {\n\n //Loop eje Y\n for (var x = 0; x < boardSize.x; x++) {\n\n //crear elemento web\n var item = document.createElement('div');\n\n //añadir data info sobre posicion de la tile\n item.setAttribute('data-row', x);\n item.setAttribute('data-column', y);\n\n // //añadir clase al elemento\n item.classList.add(\"tile\", \"undigged\");\n\n //añadimos eventos del raton\n item.addEventListener(\"click\", this.tileClick);\n\n //añadir el item al div principal\n myBoard.appendChild(item);\n }\n }\n}", "evaluate(tile) {\n let tileLen = $(\"#row\").val() * $(\"#col\").val();\n let placedRight = 0;\n for (let j = 0; j < tile.length; j++) {\n if (`tile t${j}` === tile[j].className) {\n placedRight++;\n if (tileLen - 1 == placedRight) {\n $(\"#info\").html(\"Solved!\");\n $(`.tile.t${tileLen - 1}`).css({ \"opacity\": 1 });\n $(\".tile\").off(\"click\");\n }\n }\n }\n }", "function startGame() {\n myGameArea.start();\n\n //ylempi vaakasuora laatta rivi \n var i = 1;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n //alempi vaakasuora laatta rivi \n i = 1;\n posX = 20;\n posY = 560;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n i = 1;\n posX = 20;\n posY = 1160;\n while(i < 11){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posX = posX + 60;\n tilesArray.push(tileName)\n i++;\n }\n\n // vasen laatta palkki \n i = 1;\n posX = 20;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n \n // oikea laatta palkki \n i = 1;\n posX = 560;\n posY = 80;\n while(i < 20){\n var tileName = tile + posX + posY; \n tileName = new Component(40, 40, \"white\", posX, posY, false);\n posY = posY + 60;\n tilesArray.push(tileName)\n i++;\n }\n //console.log(tilesArray);\n //pelaaja\n player = new Component(20, 20, \"red\", 30, 30);\n}", "function declareTiles() {\n\n t1 = new Tile(parseInt(document.getElementById(\"t1n\").value), parseInt(document.getElementById(\"t1m\").value))\n t2 = new Tile(parseInt(document.getElementById(\"t2n\").value), parseInt(document.getElementById(\"t2m\").value))\n t3 = new Tile(parseInt(document.getElementById(\"t3n\").value), parseInt(document.getElementById(\"t3m\").value))\n t4 = new Tile(parseInt(document.getElementById(\"t4n\").value), parseInt(document.getElementById(\"t4m\").value))\n t5 = new Tile(parseInt(document.getElementById(\"t5n\").value), parseInt(document.getElementById(\"t5m\").value))\n t6 = new Tile(parseInt(document.getElementById(\"t6n\").value), parseInt(document.getElementById(\"t6m\").value))\n t7 = new Tile(parseInt(document.getElementById(\"t7n\").value), parseInt(document.getElementById(\"t7m\").value))\n t8 = new Tile(parseInt(document.getElementById(\"t8n\").value), parseInt(document.getElementById(\"t8m\").value))\n t9 = new Tile(parseInt(document.getElementById(\"t9n\").value), parseInt(document.getElementById(\"t9m\").value))\n t10 = new Tile(parseInt(document.getElementById(\"t10n\").value), parseInt(document.getElementById(\"t10m\").value))\n t11 = new Tile(parseInt(document.getElementById(\"t11n\").value), parseInt(document.getElementById(\"t11m\").value))\n t12 = new Tile(parseInt(document.getElementById(\"t12n\").value), parseInt(document.getElementById(\"t12m\").value))\n t13 = new Tile(parseInt(document.getElementById(\"t13n\").value), parseInt(document.getElementById(\"t13m\").value))\n t14 = new Tile(parseInt(document.getElementById(\"t14n\").value), parseInt(document.getElementById(\"t14m\").value))\n t15 = new Tile(parseInt(document.getElementById(\"t15n\").value), parseInt(document.getElementById(\"t15m\").value))\n t16 = new Tile(parseInt(document.getElementById(\"t16n\").value), parseInt(document.getElementById(\"t16m\").value))\n t17 = new Tile(parseInt(document.getElementById(\"t17n\").value), parseInt(document.getElementById(\"t17m\").value))\n t18 = new Tile(parseInt(document.getElementById(\"t18n\").value), parseInt(document.getElementById(\"t18m\").value))\n t19 = new Tile(parseInt(document.getElementById(\"t19n\").value), parseInt(document.getElementById(\"t19m\").value))\n\n tilesList = [t1, t2, t3, t4, t5, t6, t7, t8, t9, t10, t11, t12, t13, t14, t15, t16, t17, t18, t19]\n}", "mergeTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[b] * 2;\n this.gameState.board[a] = 0;\n }", "function Tile() {\n this.x=0;\n this.y=0;\n this.z=0;\n this.type='';\n this.selected = false;\n this.isConstructible = true;\n this.building = 0;\n if (typeof(Tile.initialized) == 'undefined') {\n // Definition des coordonnée sur l'écran par rapport aux coordonnées dans le tableau\n Tile.prototype.toScreen = function () {\n var screen = [];\n screen.x = offsetX - (this.y * tileWidth / 2) + (this.x * tileWidth / 2) - (tileWidth / 2);\n screen.y = offsetY + (this.y * visualHeight / 2) + (this.x * visualHeight / 2);\n return screen;\n };\n // Affichage de la tile\n Tile.prototype.print = function (context) {\n context.drawImage(tileSet, tileWidth * (this.type+tilesetOffset), 0 * tileHeight, tileWidth, tileHeight, this.toScreen().x, ((this.toScreen().y) - this.z), tileWidth, tileHeight);\n var j;\n if (this.selected) {\n if (!this.isConstructible){\n context.drawImage(tileSet, tileWidth * 1, 0 * tileHeight, tileWidth, tileHeight, this.toScreen().x, ((this.toScreen().y) - this.z), tileWidth, tileHeight);\n } else {\n context.drawImage(tileSet, tileWidth * 0, 0 * tileHeight, tileWidth, tileHeight, this.toScreen().x, ((this.toScreen().y) - this.z), tileWidth, tileHeight);\n }\n j = 1;\n }\n else {\n j = 0;\n }\n\n if (this.building !== 0) {\n context.drawImage(buildings, tileWidth * this.building, j * buildingHeight, tileWidth, buildingHeight, this.toScreen().x, this.toScreen().y - (buildingHeight - visualHeight) - this.z, tileWidth, buildingHeight);\n }\n };\n }\n }", "function drawTile1() {\n ctx.clearRect(95, 125, 65, 70);\n ctx.fillStyle = palette[2][1];\n ctx.fillRect(95, 125, 65, 70)\n }", "function draw() {\n for (let i=0; i<tiles.length; i++) {\n tiles[i].display();\n }\n}", "function buildTiles() {\n for (var i = 0; i < queue.length; i++) {\n buildTile(queue[i]);\n }\n }", "function moveOneTile(tile) {\n\tvar left = tile.getStyle(\"left\");\n\tvar top = tile.getStyle(\"top\");\n\n\tif(canMove(tile)) {\n\t\t// updating id's while moving tiles\n\t\tvar row_id = parseInt(col) % TILE_AREA + 1;\n\t\tvar col_id = parseInt(row) % TILE_AREA + 1;\n\t\ttile.id = \"square_\" + row_id + \"_\" + col_id;\n\t\t\n\t\t// swapping location of the tile clicked with the empty square tile\n\t\ttile.style.left = parseInt(row) * TILE_AREA + \"px\";\n\t\ttile.style.top = parseInt(col) * TILE_AREA + \"px\";\n\t\trow = left;\n\t\tcol = top;\n\t\t\n\t\t// scaling down row and column\n\t\trow = parseInt(row) / TILE_AREA;\n\t\tcol = parseInt(col) / TILE_AREA;\n\t\taddClass(); // update tiles that can be moved\n\t}\n}", "createTiles()\n {\n //add tileset to map layer\n this.mapLayer = this.tilemap.createLayer('walls');\n this.mapLayer.resizeWorld();\n\n //add p2 physics to tilemap\n this.tilemap.setCollisionByExclusion([]);\n game.physics.p2.convertTilemap(this.tilemap, this.mapLayer);\n \n this.player.setTilemapCollisionGroup(this.collisionGroup);\n \n this.tilemapBodies = game.physics.p2.convertTilemap(this.tilemap, this.mapLayer, true, false);\n \n for(let body of this.tilemapBodies)\n {\n this.configureBody(body, 16, 16);\n }\n }", "function Tiles(){\n \n }", "function updateTiles(){\r\n let temp = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]];\r\n for (let i = 0; i < temp.length; i++){\r\n // Grabs the i'th tile in the HTML\r\n let divElement = document.getElementById(`grid-item${i}`);\r\n // Sets the text of the HTML to the value in the gameboard\r\n divElement.innerHTML = temp[i];\r\n if (temp[i] === 0){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-0\");\r\n } else if (temp[i] === 2){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-2\");\r\n } else if (temp[i] === 4){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-4\");\r\n } else if (temp[i] === 8){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-8\");\r\n } else if (temp[i] === 16){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-16\");\r\n } else if (temp[i] === 32){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-32\");\r\n } else if (temp[i] === 64){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-64\");\r\n } else if (temp[i] === 128){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-128\");\r\n } else if (temp[i] === 256){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-256\");\r\n } else if (temp[i] === 512){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-512\");\r\n } else if (temp[i] === 1024){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-1024\");\r\n } else if (temp[i] === 2048){\r\n document.getElementById(`grid-item${i}`).classList.remove(document.getElementById(`grid-item${i}`).classList.item(0));\r\n document.getElementById(`grid-item${i}`).classList.add(\"tile-2048\");\r\n }\r\n }\r\n}", "function tile() {\n tiles = document.createElement(\"div\");\n tiles.classList.add(\"tiles\");\n tiles.style.cssText += `\n width: 6.6%;\n background-color: rgb(246, 250, 232);\n height: 0vh;\n `;\n return tiles;\n }", "function drawTile0() {\n ctx.clearRect(25, 125, 65, 70);\n ctx.fillStyle = palette[2][0];\n ctx.fillRect(25, 125, 65, 70)\n }", "collectCoin(sprite, tile) {\n\n }", "function createTile(i) {\n\n\t\t //Create element and give it proper classes, attached tile element\n\t\t //var element = $(\".box-\"+i);\n\n\t\t //create list of scrambled nubmers (outside this loop)\n\t\t //assign the index of the scrambled number below, ie, scrambled[i]\n\n\n\t\t //var innerHtml = \"Box \"+i;\n\t\t var innerHtml = \"\";\n\t\t var element = $(\"<div></div>\").addClass(\"box box\"+i+\"\").html(innerHtml).attr('data-order', G.shuffledOrder[i]);;\n\t\t var varname = \"box\"+i+\"draggable\";\n\t\t G[varname] = Draggable.create(element, {\n\t\t\tonDrag : onDrag,\n\t\t\tonPress : onPress,\n\t\t\tonRelease : onRelease,\n\t\t\tzIndexBoost : true\n\t\t });\n\n\n\t\t\t//console.log(G[varname][0]._eventTarget);\n\t\t var tile = {\n\t\t\telement : element,\n\t\t\theight : 0,\n\t\t\tinBounds : false,\n\t\t\tindex : i,\n\t\t\torder : G.shuffledOrder[i],\n\t\t\t/*order : i,*/\n\t\t\tisDragging : false,\n\t\t\tlastIndex : null,\n\t\t\twidth : 0,\n\t\t\tx : 0,\n\t\t\ty : 0\n\t\t };\n\n\t\t //Add the tile for easy lookup\n\t\t element[0].tile = tile;\n\n\t\t //add the tiles to the container\n\t\t $(\"#slide-\"+G.currentSlide+\"\").append(element);\n\n\t\t layoutInvalidated();\n\n\t\t function onPress() {\n\n\t\t\t//console.log(\"pressing\");\n\n\t\t\tif (tile.positioned) {\n\t\t\t\t//console.log(\">>tile is positioned\");\n\t\t\t \t\t\telement[0].tile.fromX = element[0].tile.x;\n\t\t\t\t\t\telement[0].tile.fromY = element[0].tile.y;\n\t\t\t\t\t\telement[0].tile.toX = element[0].tile.x;\n\t\t\t\t\t\telement[0].tile.toY = element[0].tile.y;\n\t\t\t \t} else {\n\t\t\t \t\t//console.log(\">>INTERCEPTED! tile is NOT positioned, so assign its values to where it was headed...\");\n\t\t\t \t\t//here, assumt it's being positioned, so assign the FROM to the current X and Y vals\n\t\t\t \t\t//alert(\"not positioned\");\n\t\t\t \t\telement[0].tile.fromX = element[0].tile.toX;\n\t\t\t\t\telement[0].tile.fromY = element[0].tile.toY;\n\t\t\t\t\telement[0].tile.x = element[0].tile.toX;\n\t\t\t\t\telement[0].tile.y = element[0].tile.toY;\n\t\t\t \t}\n\n\t\t\ttile.isDragging = true;\n\n\t\t\t$(element).addClass(\"dragging\");\n\n\t\t\tTweenLite.to(element, 0.3, {\n\t\t\t scale : 0.92,\n\t\t\t ease\t\t: Elastic.easeOut\n\t\t\t});\n\n\n\t\t }\n\n\t\t function onDrag() {\n\n\t\t \t//TODO - make this into a function, NOTE: it's also in the OnClick event\n\t\t\tthis._eventTarget.tile.swapPartner = null;\n\t\t\ttile.positioned = false;\n\t\t\t//debugger;\n\n\t\t\tfor (var i = 0; i < G.tiles.length; i++) {\n\t\t\t if (this.hitTest(G.tiles[i], G.dragThreshhold)) {\n\n\t\t\t\ttile.swapPartner = i;\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//console.log(\"currently hitting \"+G.hitting);\n\n\t\t }\n\n\t\t function onRelease() {\n\n\t\t \t//debugger;\n\t\t \t//console.log(\"releasing\");\n\n\t\t \ttile.isDragging = false;\n\t\t\t//todo: check if the tile's dragging is not true!!!\n\n\t\t\t$(element).removeClass(\"dragging\");\n\n\t\t\tTweenLite.to(element, .2, {\n\t\t\t scale : 1,\n\t\t\t ease\t\t: Strong.easeOut\n\t\t\t});\n\n\t\t\t//if it's hitting something and that something is positioned = true\n\n\t\t\tif (G.swapHappening == true) {\n\t\t\t\t//alert(\"Swap happening!\");\n\t\t\t\t//alert(\"don't do it\");\n\t\t\t} else {\n\n\t\t\t}\n\n\t\t\t/*\n\t\t\tif (G.tiles[G.hitting] != null) {\n\t\t\t\t//console.log(\">>G.hitting is true, hitting index: \"+G.tiles[G.hitting].tile.index);\n\t\t\t\t//console.log(\">>target is positioned and is: \"+G.tiles[G.hitting].tile.positioned);\n\t\t\t\tif (G.tiles[G.hitting].tile.positioned) {\n\t\t\t\t\t//if it's released on a tile that's positioned, ie, stationary AND there's not a swap happening\n\t\t\t\t\tconsole.log(\">>changePosition: \"+tile.index+\" \"+G.hitting);\n\t\t\t\t\tchangePosition(tile.index, G.hitting);\n\t\t\t\t} else {\n\t\t\t\t\tconsole.log(\"hitting something, but it's on motion - GO BACK TO START\");\n\t\t\t\t\treturnHome();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tconsole.log(\">>not hitting anything - GO BACK TO START\");\n\t\t\t\treturnHome();\n\t\t\t}\n\t\t\t*/\n\n\t\t\tif (tile.swapPartner != null) {\n\t\t\t\t//alert(\"swap!\");\n\t\t\t\tif (G.tiles[tile.swapPartner].tile.positioned) {\n\t\t\t\t\t//if it's released on a tile that's positioned, ie, stationary\n\t\t\t\t\tchangePosition(tile.index, tile.swapPartner);\n\t\t\t\t} else {\n\t\t\t\t\t//console.log(\"hitting something, but it's on motion - GO BACK TO START\");\n\t\t\t\t\treturnHome();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\treturnHome();\n\t\t\t}\n\n\n\t\t\tfunction returnHome() {\n\t\t\t\t\t//alert('hi');\n\t\t\t\t\t//if there's a toY, go there. If not, go to the built-in X or Y\n\t\t\t\t\tvar myToX = element[0].tile.toX;\n\t\t\t\t\tvar myToY = element[0].tile.toY;\n\t\t\t\t\telement[0].tile.positioned = false;\n\t\t\t\t\tvar myTween = TweenLite.to(element, G.returnHomeTime, {\n\t\t\t\t\t\t scale : 1,\n\t\t\t\t\t\t x : Math.floor(myToX),\n\t\t\t\t\t\t y : Math.floor(myToY),\n\t\t\t\t\t\t ease\t\t: Elastic.easeOut,\n\t\t\t\t\t\tonComplete:function(){\n\t\t\t\t\t\telement[0].tile.positioned = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\n\n\t\t\t//alert(targetIsPositioned);\n\t\t\t//debugger;\n\t\t\tif (G.tiles[G.hitting]) {\n\t\t\t\t//var isPositioned = true;\n\t\t\t} else {\n\t\t\t\t//var isPositioned = false;\n\t\t\t}\n\t\t\t//alert(targetIsPositioned);\n\n\t\t }\n\n\t\t}", "mapNewItems() {\n let adjustedFrame = this.frameCounter - 150\n if ((adjustedFrame >= 0) && (adjustedFrame % this.fpb == 0)) { //always start with first block on inital 150th frame\n let mapIndex = adjustedFrame / this.fpb\n let newItemValue = this.mapArray[mapIndex]\n if (newItemValue == 1) {\n this.blocksArray.push( new this.blockClass(this.canvas, this.loadedImages['stoneBlockImage']) )\n } \n else if (newItemValue == 2) {\n this.groundArray = this.groundArray.concat(this._createGroundFeature())\n }\n else if (newItemValue == 3) {\n this.cratesArray.push( new this.crateClass(this.canvas, this.loadedImages['crateImageArray']) )\n }\n }\n }", "function addGrid(strtLat, strtLang, width, height){\n for(var i = 0; i < .0005 * width; i += .0005){\n\tfor(var j = 0; j < .001 * height; j += .001){\n\n\t var\ttile = {\n\t\tlat: strtLat + i,\n\t\tlang: strtLang + j,\n\t\tstatus: -1,\n\t\tspecies: []};\n\t tileArray.tiles.push(tile);\n\t}}\n}", "function makeTileRender(gl) {\n let currentTile = -1;\n let numTiles = 1;\n let tileWidth;\n let tileHeight;\n let columns;\n let rows;\n\n let firstTileTime = 0;\n\n let width = 0;\n let height = 0;\n\n // initial number of pixels per rendered tile\n // based on correlation between system performance and max supported render buffer size\n // adjusted dynamically according to system performance\n let pixelsPerTile = pixelsPerTileEstimate(gl);\n\n let pixelsPerTileQuantized = pixelsPerTile;\n\n let desiredTimePerTile = 22; // 45 fps\n\n let timePerPixelSum = desiredTimePerTile / pixelsPerTile;\n let samples = 1;\n let resetSum = true;\n\n function addToTimePerPixel(t) {\n if (resetSum) {\n timePerPixelSum = 0;\n samples = 0;\n resetSum = false;\n }\n\n timePerPixelSum += t;\n samples++;\n }\n\n function getTimePerPixel() {\n return timePerPixelSum / samples;\n }\n\n function reset() {\n currentTile = -1;\n firstTileTime = 0;\n resetSum = true;\n }\n\n function setSize(w, h) {\n width = w;\n height = h;\n reset();\n }\n\n function setTileDimensions(pixelsPerTile) {\n const aspectRatio = width / height;\n\n // quantize the width of the tile so that it evenly divides the entire window\n tileWidth = Math.ceil(width / Math.round(width / Math.sqrt(pixelsPerTile * aspectRatio)));\n tileHeight = Math.ceil(tileWidth / aspectRatio);\n pixelsPerTileQuantized = tileWidth * tileHeight;\n\n columns = Math.ceil(width / tileWidth);\n rows = Math.ceil(height / tileHeight);\n numTiles = columns * rows;\n }\n\n function initTiles() {\n if (firstTileTime) {\n const timeElapsed = Date.now() - firstTileTime;\n const timePerTile = timeElapsed / numTiles;\n const error = desiredTimePerTile - timePerTile;\n\n // higher number means framerate converges to targetRenderTime faster\n // if set too high, the framerate fluctuates rapidly with small variations in frame-by-frame performance\n const convergenceStrength = 1000;\n\n pixelsPerTile = pixelsPerTile + convergenceStrength * error;\n addToTimePerPixel(timePerTile / pixelsPerTileQuantized);\n }\n\n firstTileTime = Date.now();\n\n pixelsPerTile = clamp(pixelsPerTile, 8192, width * height);\n\n setTileDimensions(pixelsPerTile);\n }\n\n function nextTile() {\n currentTile++;\n\n if (currentTile % numTiles === 0) {\n initTiles();\n currentTile = 0;\n }\n\n const x = currentTile % columns;\n const y = Math.floor(currentTile / columns) % rows;\n\n return {\n x: x * tileWidth,\n y: y * tileHeight,\n tileWidth,\n tileHeight,\n isFirstTile: currentTile === 0,\n isLastTile: currentTile === numTiles - 1\n };\n }\n\n return {\n setSize,\n reset,\n nextTile,\n getTimePerPixel,\n restartTimer() {\n firstTileTime = 0;\n },\n setRenderTime(time) {\n desiredTimePerTile = time;\n },\n };\n }", "function renderTiles() {\n var map_index = 0;\n\n // increment by actual TILE_SIZE to avoid multiplying on every iteration\n for (var top = 0; top < MAP.height; top += TILE_SIZE) {\n for (var left = 0; left < MAP.width; left += TILE_SIZE) {\n\n // if statement to draw the correct sprite to the correct idx position on the tile map\n if (MAP.tiles[map_index] === 0) {\n\n // draw background\n ctx.drawImage(background, left, top);\n\n } else if (MAP.tiles[map_index] === 2) {\n\n // draw platform\n ctx.drawImage(platform, left, top);\n\n new Obstacle(100, 100, left, top);\n\n } else if (MAP.tiles[map_index] === 3) {\n\n // draw ring\n ctx.drawImage(ring, left, top);\n //new Obstacle(100, 100, left, top);\n\n } else if (MAP.tiles[map_index] === 1) {\n\n // draw floor\n ctx.drawImage(floor, left, top);\n } else if (MAP.tiles[map_index] === 4) {\n\n ctx.drawImage(floor, left, top);\n new Obstacle(100, 100, left, top);\n }\n\n map_index++;\n }\n }\n}", "function initTiles(){\n\t\tgetOffset(div);\n\t\tvar r, c, tile;\n\t\tmaskRect = {x:-border, y:-border, width:border * 2 + COLS * scale, height:trayDepth + border * 2 + ROWS * scale}\n\t\tfor(r = 0; r < ROWS; r++){\n\t\t\tslots[r] = [];\n\t\t\tfor(c = 0; c < COLS; c++){\n\t\t\t\tslots[r][c] = undefined;\n\t\t\t\ttile = new Tile(r, c, SPRITE_SHEET, maskRect);\n\t\t\t\ttile.update();\n\t\t\t\tdiv.appendChild(tile.div);\n\t\t\t\ttiles.push(tile);\n\t\t\t}\n\t\t}\n\t\trandomiseTiles();\n\t}", "function dibujaEscenario() {\r\n for (y = 0; y < 10; y++) {\r\n for (x = 0; x < 15; x++) {\r\n //7\r\n var tile = escenario[y][x];\r\n ctx.drawImage(pared, tile * 45, 80, 30, 30, anchoF * x, altoF * y, anchoF, altoF);\r\n }\r\n }\r\n}", "function substitutionTT(tile) {\r\n switch (tile.id[0]) {\r\n case \"triangle0\":\r\n var newtiles = [];\r\n\r\n var new_tri1 = tile.myclone();\r\n new_tri1.tri0to1();\r\n new_tri1.id.push(\"fils_0to1\");\r\n newtiles.push(new_tri1);\r\n\r\n return newtiles;\r\n case \"triangle1\":\r\n var newtiles = [];\r\n\r\n var new_tri2 = tile.myclone();\r\n new_tri2.tri1to2();\r\n new_tri2.id.push(\"fils_1to2\");\r\n newtiles.push(new_tri2);\r\n\r\n return newtiles;\r\n case \"triangle2\":\r\n var newtiles = [];\r\n\r\n var A = new THREE.Vector2(tile.bounds[0], tile.bounds[1]);\r\n var B = new THREE.Vector2(tile.bounds[2], tile.bounds[3]);\r\n var C = new THREE.Vector2(tile.bounds[4], tile.bounds[5]);\r\n var AB_center = ((new THREE.Vector2()).addVectors(A, B)).divideScalar(2);\r\n var AC_center = ((new THREE.Vector2()).addVectors(A, C)).divideScalar(2);\r\n var BC_center = ((new THREE.Vector2()).addVectors(B, C)).divideScalar(2);\r\n var AC_quarter = ((((new THREE.Vector2()).add(A)).multiplyScalar(3)).add(C)).divideScalar(4);\r\n var ABC_center = ((new THREE.Vector2()).addVectors(AC_center, B)).divideScalar(2);\r\n\r\n var new_tri2 = tile.myclone();\r\n\t\t\tnew_tri2.limit = 3\r\n new_tri2.bounds = triangleVectorsToBounds(C, AC_center, B);\r\n new_tri2.id.push(\"fils0\");\r\n newtiles.push(new_tri2);\r\n\r\n var new_tri0_0 = tile.myclone();\r\n new_tri0_0.tri2to0();\r\n new_tri0_0.id.push(\"fils1\");\r\n new_tri0_0.bounds = triangleVectorsToBounds(AB_center, AC_quarter, A);\r\n newtiles.push(new_tri0_0);\r\n\r\n var new_tri0_1 = tile.myclone();\r\n new_tri0_1.tri2to0();\r\n new_tri0_1.id.push(\"fils2\");\r\n new_tri0_1.bounds = triangleVectorsToBounds(B, ABC_center, AB_center);\r\n newtiles.push(new_tri0_1);\r\n\r\n var new_tri0_2 = tile.myclone();\r\n new_tri0_2.tri2to0();\r\n new_tri0_2.id.push(\"fils3\");\r\n new_tri0_2.bounds = triangleVectorsToBounds(AC_center, AC_quarter, AB_center);\r\n newtiles.push(new_tri0_2);\r\n\r\n var new_tri0_3 = tile.myclone();\r\n new_tri0_3.tri2to0();\r\n new_tri0_3.id.push(\"fils4\");\r\n new_tri0_3.bounds = triangleVectorsToBounds(AC_center, ABC_center, AB_center);\r\n newtiles.push(new_tri0_3);\r\n\r\n return newtiles;\r\n default:\r\n console.log(\"caution: undefined tile type for substitutionTT, id = \" + tile.id);\r\n }\r\n}", "register(name, tile) {\n if (Array.isArray(name)) {\n name.forEach((n) => this.tiles.set(n, tile))\n } else {\n this.tiles.set(name, tile)\n }\n }", "function put_one_element(pcanvas, layer, ptile, pedge, pcorner, punit, \n pcity, canvas_x, canvas_y, citymode)\n{\n\n var tile_sprs = fill_sprite_array(layer, ptile, pedge, pcorner, punit, pcity, citymode);\n\t\t\t\t \n var fog = (ptile != null && draw_fog_of_war\n\t && TILE_KNOWN_UNSEEN == tile_get_known(ptile));\t\t\t\t \n\n put_drawn_sprites(pcanvas, canvas_x, canvas_y, tile_sprs, fog);\n \n \n}", "function tile(t, sl, st, bt, sol)\r\n{\r\n\tthis.tile_index = t;\r\n\tthis.top_slope = sl;\r\n\tthis.top_start = st;\r\n\tthis.top_bottom = bt;\r\n\tthis.solid = sol;\r\n}", "function tileClicked(e){\n // check if the tile can move to the empty spot\n // if the tile can move, move the tile to the empty spot\n\n\tvar curr_tile = e.target; // setting the curr_tile to the tile that has been clicked\n\t\n\tvar curr_row = curr_tile.row; // setting the curr_row to the row of the tile clicked\n\tvar curr_col = curr_tile.col; //setting the curr_col to the column of the tile clicked\n\t\n\t/*\n\t* check the tile in the row before the tile clicked , if the tile from the row before it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\tif( ! (curr_row - 1 < 0 )) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row-1][curr_col] == 0) //check if the item before the tile clicked is the empty tile\n\t\t{\n\t\t\tvar temp1 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\tcurr_tile.row = curr_row - 1; // setting the tile new row\n\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp1; //saving the div in the new position\n\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t\t\n\t\t}\n\t}\n\t\n\n\t/*\n\t* check the tile in the row after the tile clicked , if the tile from the row after it is the empty one , we move the tile \n\t* to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t*/\n\t\n\tif(!(curr_row + 1 > _num_rows - 1)) // checking if the row number is valid and didnt exceed the boundaries\n\t{\n\t\tif(tile_array[curr_row + 1][curr_col] == 0) //check if the item after the tile clicked is the empty tile\n\t\t{\n\t\t\t\tvar temp2 = tile_array[curr_row][curr_col]; // save the div currently clicked into the temp variable\n\t\t\t\ttile_array[curr_row][curr_col] = 0; // set the current tile position to the empty tile\n\t\t\t\tcurr_tile.row = curr_row + 1; // setting the tile new row\n\t\t\t\tcurr_tile.col = curr_col; // setting the tile new col\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp2; //saving the div in the new position\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\"; //setting the left position for the tile \n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\"; //setting the top position for the tile\n\t\t}\n\t\n\t}\n\t\n\t\t/*\n\t\t* check the tile in the column before the tile clicked , if the tile from the row before it is the empty one \n\t\t* , we move the tile to the position of the empty tile, and set the empty tile to the position where the curr_tile was\n\t\t*/\n\n\t\tif(!(curr_col - 1 < 0))\n\t\t{\n\t\t\tif(tile_array[curr_row][curr_col-1] == 0)\n\t\t\t{\n\t\t\t\tvar temp3 = tile_array[curr_row][curr_col];\n\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\tcurr_tile.col = curr_col - 1;\n\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp3;\n\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t}\n\t\t}\n\t\t\n\t\n\t\t\tif(!(curr_col + 1 > _num_cols))\n\t\t\t{\n\t\t\t\tif(tile_array[curr_row][curr_col+1] == 0)\n\t\t\t\t{\n\t\t\t\t\tvar temp4 = tile_array[curr_row][curr_col];\n\t\t\t\t\ttile_array[curr_row][curr_col] = 0;\n\t\t\t\t\tcurr_tile.col = curr_col+1;\n\t\t\t\t\tcurr_tile.row = curr_row;\n\t\t\t\t\ttile_array[curr_tile.row][curr_tile.col] = temp4;\n\t\t\t\t\tcurr_tile.style.left = curr_tile.col * _tile_width+\"px\";\n\t\t\t\t\tcurr_tile.style.top = curr_tile.row * _tile_height+\"px\";\n\t\t\t\t}\n\t\t\t}\n\t\n\t\n}", "function createTiles(){\n var numberOfTiles = $scope.levels.numberOfTiles;\n $scope.tiles = [];\n for(var i = 0; i < numberOfTiles; i++){\n $scope.tiles.push(\n {\n tileNumber: i+1\n ,tileData: i+1\n ,clicked: false\n ,color: \"#FFFFFF\"\n ,colored: false\n }\n );\n }\n }", "function drawTiles(){\n for (var i = 0; i < ground.length; i++){\n image(tile, ground[i], 320);\n \n ground[i] -= 1;\n \n if (ground[i] <= -50){\n ground[i] = width;\n }\n }\n\n}", "updatePlant(){\r\n // Set to decor layer then remove the plant sprites\r\n this.map.setLayer(3);\r\n this.map.removeTileAt(5, 1);\r\n this.map.removeTileAt(5, 0);\r\n // Set the plant sprite according to the right score\r\n if (this.current_score < 125){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(17, 5, 0);\r\n }\r\n if (125 <= this.current_score && this.current_score < 250){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(18, 5, 0);\r\n }\r\n if (250 <= this.current_score && this.current_score < 375){\r\n this.map.putTileAt(16, 5, 1);\r\n this.map.putTileAt(19, 5, 0);\r\n }\r\n if (375 <= this.current_score && this.current_score < 500){\r\n this.map.putTileAt(20, 5, 1);\r\n }\r\n if (500 <= this.current_score){\r\n this.map.putTileAt(21, 5, 1);\r\n }\r\n }", "function spawnNewTile(game, coord){\n var tile = generateRandomTile(coord);\n game.addTile(tile);\n setTimeout(function() {\n drawTile(tile);\n }, NEWTILESPAWNSPEED);\n return tile;\n}", "processDealBonusTiles(tiles) {\n this.tiles = this.tiles.concat(tiles);\n this.checkDealBonus();\n }" ]
[ "0.77908856", "0.7364638", "0.71191174", "0.6857791", "0.6789964", "0.67565113", "0.6755169", "0.67516005", "0.67269", "0.66869366", "0.66544044", "0.66258484", "0.6590509", "0.6589216", "0.65753096", "0.65384907", "0.65145385", "0.64770585", "0.645853", "0.6451343", "0.6444603", "0.6444603", "0.64410686", "0.64373606", "0.64231795", "0.64190096", "0.64087224", "0.64082533", "0.6384235", "0.63525575", "0.633941", "0.6339293", "0.6337829", "0.63340354", "0.6319819", "0.63184446", "0.63156307", "0.6313095", "0.631261", "0.63109237", "0.63088536", "0.63051057", "0.6301109", "0.6296218", "0.62924707", "0.6289095", "0.62735397", "0.6260284", "0.625587", "0.62504745", "0.6247955", "0.62436205", "0.6237565", "0.62280154", "0.62013775", "0.61951214", "0.61896366", "0.6185529", "0.6178002", "0.6167708", "0.616259", "0.6161776", "0.6161671", "0.6154668", "0.61410105", "0.6137149", "0.6129112", "0.61288595", "0.6126362", "0.61235434", "0.61232007", "0.612012", "0.6119974", "0.61113966", "0.6084653", "0.60827225", "0.60743386", "0.60714155", "0.60689294", "0.6068847", "0.6052842", "0.6044372", "0.6039741", "0.60353315", "0.60283935", "0.60271776", "0.60199285", "0.60182965", "0.6016133", "0.60149723", "0.60143244", "0.60107297", "0.60065734", "0.6001946", "0.59988815", "0.5995733", "0.59956783", "0.59809804", "0.59751236", "0.5974744" ]
0.6740896
8
Check to see if there are any doubles
function checkDoubles() { if (removals == 2) { for (var row = 0; row <= 3; row++) { for (var column = 0; column <= 3; column++) { if (tileArray[row][column] != null && ((row != 1 && row != 2) || (column != 1 & column != 2))) { if (tileArray[row][column].style.backgroundColor == doubleColor) { removeArray[row][column] = "remove"; removals++; doubleAchieved = true; } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function wt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function St(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function mt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function _isDouble(v) {\n return _isNumber(v) && String(v).indexOf('.') !== -1;\n}", "function searchDoubles(arr) {\n for(i = 0; i < x.length; i++) {\n console.log(\"x[\" + i + \"] = \" + x[i]);\n for(j = i; j >= 0; j--) {\n if (x[i] = x[j]) {\n console.log(x[i] + \" has double\");\n break;\n };\n };\n };\n}", "isDoubleDensity() {\n return (this.flags & Flags.DOUBLE_DENSITY) !== 0;\n }", "supportsDoubleValues() {\n return true;\n }", "function le(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function J(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function yt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([0, 0x7FF80000]);\n } else {\n var bytes = new Uint32Array([0x7FF80000, 0]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "function checkLineForDbl(line) {\n return line.some(function(e, i) {\n if (e.val == ' ') {\n return false\n };\n return line.some(function(v, j) {\n return (e.val == v.val && i !== j)\n });\n });\n }", "function f() {\n if(isLittleEndian()) {\n var bytes = new Uint32Array([1, 0x7FF00000]);\n } else {\n var bytes = new Uint32Array([0x7FF00000, 1]);\n }\n var doubles = new Float64Array(bytes.buffer);\n assertTrue(isNaN(doubles[0]));\n assertTrue(isNaN(doubles[0]*2.0));\n assertTrue(isNaN(doubles[0] + 0.5));\n }", "function At(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function isTautology(results){\r\n for (var i= 0; i < results.length; i++) if (results[i] == 0) return false;\r\n return true;\r\n}", "function hasXOrY(item) {\n return !(isNaN(parseFloat(item.x)) && isNaN(parseFloat(item.y)));\n}", "settled(arr) {\n for (let i = 0; i < arr.length; i++) {\n if (Math.abs(arr[i]) > 0.1) {\n return false;\n }\n }\n return true;\n }", "function isDataValid() {\n var test = freqArray[0];\n for (var i = 0; i < freqArray.length; i++) {\n if (freqArray[i] !== test) return true;\n }\n return false;\n }", "function isDataValid () {\n var test = freqArray[0];\n for (let i = 0; i < freqArray.length; i++) {\n if (freqArray[i] !== test) return true;\n }\n return false;\n }", "function countDoublesMH(){\n\t\tfor (i = 0; i < window.targetsToAttackMH.length; i++) { \n\t\t\t\n\t\t\tvar isDouble = false;\n\t\t\tvar xi = window.targetsToAttackMH[i].x;\n\t\t\tvar yi = window.targetsToAttackMH[i].y;\n\t\t\t\n\t\t\tfor(j = 0; j < window.targetsToAttackMH.length; j++){\n\t\t\t\t\n\t\t\t\tvar xj = window.targetsToAttackMH[j].x;\n\t\t\t\tvar yj = window.targetsToAttackMH[j].y;\n\t\t\t\t\n\t\t\t\tif(i != j && xi == xj && yi == yj){\n\t\t\t\t\tisDouble = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isDouble)\n\t\t\t\talert(xi + \"|\" + yi);\n\t\t}\n}", "function gt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function validateTotalMeasurement() {\n\ttry {\n\t\tvar _total_measure_invoice \t\t= parseFloat($('.DSP_total_measure').text().replace(/,/g, ''));\n\t\t_total_measure_invoice \t\t= !isNaN(_total_measure_invoice) ? _total_measure_invoice : 0;\n\t\tvar _total_measure_carton \t\t= parseFloat($('.DSP_total_measure_carton').text().replace(/,/g, ''));\n\t\t_total_measure_carton \t\t= !isNaN(_total_measure_carton) ? _total_measure_carton : 0;\n\t\t//\n\t\tvar is_flag = true;\n\t\tif (_total_measure_invoice != _total_measure_carton) {\n\t\t\tis_flag = false;\n\t\t}\n\t\treturn is_flag;\n\t} catch(e) {\n console.log('validateTotalCartonInvoice' + e.message)\n }\n}", "function Gt(t) {\n return !!t && \"doubleValue\" in t && isNaN(Number(t.doubleValue));\n}", "function countDoublesYS(){\n\t\tfor (i = 0; i < window.targetsToAttackYS.length; i++) { \n\t\t\t\n\t\t\tvar isDouble = false;\n\t\t\tvar xi = window.targetsToAttackYS[i].x;\n\t\t\tvar yi = window.targetsToAttackYS[i].y;\n\t\t\t\n\t\t\tfor(j = 0; j < window.targetsToAttackYS.length; j++){\n\t\t\t\t\n\t\t\t\tvar xj = window.targetsToAttackYS[j].x;\n\t\t\t\tvar yj = window.targetsToAttackYS[j].y;\n\t\t\t\t\n\t\t\t\tif(i != j && xi == xj && yi == yj){\n\t\t\t\t\t\n\t\t\t\t\tisDouble = true;\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(isDouble)\n\t\t\t\talert(xi + \"|\" + yi);\n\t}\n}", "supportsDoubleArrayValues() {\n return true;\n }", "function isAbsurdity(results) {\r\n for (var i= 0; i < results.length; i++) if (results[i] == 1) return false;\r\n return true;\r\n}", "function katilimSaati(dersSayisi, dersSuresi){\n let nonValidEntries = [true,false,null,undefined,NaN,\"\"]; // all the possible non-numbers.\n const checkExists = (item) => {return item === dersSayisi || item === dersSuresi}; // function for .some method.\n \n if(nonValidEntries.some(checkExists) || isNaN(dersSayisi) || isNaN(dersSuresi)) {\n console.log(\"Your entries are not a number.\");\n return false;\n } else {\n return dersSayisi * dersSuresi;\n }\n}", "function linearOK(array) {\n\t if(!array) return false;\n\t\n\t for(var i = 0; i < array.length; i++) {\n\t if(isNumeric(array[i])) return true;\n\t }\n\t\n\t return false;\n\t}", "function linearOK(array) {\n\t if(!array) return false;\n\t\n\t for(var i = 0; i < array.length; i++) {\n\t if(isNumeric(array[i])) return true;\n\t }\n\t\n\t return false;\n\t}", "function countDoublesPR(){\n for(i = 0; i < window.targetsToAttackPR.length; i++){\n \n var isDouble = false;\n var xi = window.targetsToAttackPR[i].x;\n var yi = window.targetsToAttackPR[i].y;\n \n for(j = 0; j < window.targetsToAttackPR.length; j++){\n \n var xj = window.targetsToAttackPR[j].x;\n var yj = window.targetsToAttackPR[j].y;\n \n if(i != j && xi == xj && yi == yj){\n isDouble = true;\n break;\n }\n }\n \n if(isDouble)\n alert(xi + \"|\" + yi);\n }\n}", "function is_float(object)\n{\n return object != undefined && object.toFixed != undefined && parseInt(object) != object;\n}", "function noDoubles() {\n for (var i = 0; i < cycles.length - 1; i++) {\n if (equals(cycles[i], cycles[i + 1])) {\n cycles.splice(i + 1, 1);\n i--;\n }\n }\n}", "function checkIsDouble(elem){\nif(!elem.hasAttribute(\"data-id\"))\nreturn true;\n}", "function check_number(nb) {\n return nb.nb$float !== undefined;\n }", "function testInputs(scores){\n\n for(var i=0; i<scores.length; i++){\n if(scores[i]<0|| isNaN(scores[i])){\n return false;\n }\n }\n return scores;\n\n}", "function isNumeric(obj) {\n return !isArray(obj) && obj - Number.parseFloat(obj) + 1 >= 0;\n }", "function checkForDoubles(arr, needle1, needle2){\n\t\t\n\t\tvar isInArray = false;\n\t\t\n\t\tif(arr.length != 0){\n\t\t\tfor(var i = 0; i < arr.length; i++){\n\t\t\t\t\n\t\t\t\tif (arr[i][0] == needle1 && arr[i][1] == needle2) {\n\t\t\t\t\tisInArray = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}\n\t\treturn isInArray;\n\t}", "get hasValues() {\n return this.arrayWidth > 0 && this.arrayHeight > 0;\n }", "hasValues() {\n\t\treturn this.data.length > 0;\n\t}", "static isSingle(coordinates) {\n return !Array.isArray(coordinates[0]);\n }", "checkValues(firstValue, secondValue) {\n firstValue = firstValue % 1 === 0 ? parseInt(firstValue) : parseFloat(firstValue);\n secondValue = secondValue % 1 === 0 ? parseInt(secondValue) : parseFloat(secondValue);\n\n if(!isNaN(firstValue + secondValue)){\n this.outputSum(firstValue,secondValue);\n }else {\n alert('Do you need a sum, or you need a NaN?')\n }\n\n }", "function findDouble(digits) {\n const n1 = digits[digits.length - 1];\n const sumPerfectTriSeries = (n1 ** 2 + n1) / 2;\n const sumImperfectTriSeries = digits.reduce((sum, next) => sum + next, 0);\n console.log(sumImperfectTriSeries, sumPerfectTriSeries);\n return sumPerfectTriSeries - sumImperfectTriSeries;\n}", "function isNumeric(obj) {\n return !isArray(obj) && obj - Number.parseFloat(obj) + 1 >= 0;\n }", "function isNumber(x) \n{ \n return ( (x != null) && (typeof(x) === typeof(1.0)) && isFinite(x) );\n}", "function isThisActuallyANumber(data) {\n return (typeof data === \"number\" && !isNaN(data)); // is the type of data a number AND is the data not NOT (double positive) a number\n} // first part makes sure it's a number or NaN, second part makes sure it's not NaN", "isFull(){\n let isFull = true;\n for(let i=0; i<this.data.length; i++){\n if(typeof this.data[i] === \"undefined\"){\n isFull = false;\n }\n }\n return isFull;\n }", "verifyNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n }", "function linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}", "function linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}", "function linearOK(array) {\n if(!array) return false;\n\n for(var i = 0; i < array.length; i++) {\n if(isNumeric(array[i])) return true;\n }\n\n return false;\n}", "function betterIsNaN(s) {\n if (typeof s === \"symbol\") {\n return true;\n }\n return isNaN(s);\n}", "isFloat(val) {\n return !isNaN(Number(val)) && Number(val) % 1 !== 0;\n }", "function isMeasurementValue(value) {\n\t return typeof value === 'number' && isFinite(value);\n\t}", "function validateTotalGrossWeight() {\n\ttry {\n\t\tvar _total_gross_weight_invoice = parseFloat($('.DSP_total_gross_weight').text().replace(/,/g, ''));\n\n\t\tvar _total_gross_weight_carton \t= parseFloat($('.DSP_total_gross_weight_carton').text().replace(/,/g, ''));\n\n\t\tvar is_flag = true;\n\t\tif (_total_gross_weight_invoice != _total_gross_weight_carton) {\n\t\t\tis_flag = false;\n\t\t}\n\t\treturn is_flag;\n\t} catch(e) {\n console.log('validateTotalCartonInvoice' + e.message)\n }\n}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "isEmpty(){\n let isEmpty = true;\n for(let i=0; i<this.data.length; i++){\n if(typeof this.data[i] !== \"undefined\"){\n isEmpty = false;\n }\n }\n return isEmpty;\n }", "function numOfFloat(array) {\r\n var count = 0;\r\n\r\n for (var i = 0; i < array.length; i++) {\r\n var y = parseFloat(array[i], 10) // 23,1\r\n var x = parseInt(array[i], 10) // 23\r\n\r\n if (!isNaN(x) && x != y) {\r\n count++\r\n }\r\n }\r\n return count;\r\n}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "function didDoubleTap() {\n\t\t //Enure we dont return 0 or null for false values\n\t\t\treturn !!(validateDoubleTap() && hasDoubleTap());\n\t\t}", "function nummy(x) { return !isNaN(parseFloat(x)) && isFinite(x) }", "validateDouble(valid)\n {\n var arrDoNo = [];\n var errCounter = 0;\n for(var data of valid.items)\n {\n arrDoNo.push(data.deliveryOrder.doNo);\n }\n\n arrDoNo.forEach((v,i,a) => \n {\n if(a.indexOf(v) != i)\n {\n errCounter++;\n alert(\"Terdapat Duplikasi Nomor Surat Jalan \" + a[i] + \". Mohon Menghapus Salah Satu Data Duplikat\");\n }\n })\n return errCounter;\n }", "isRational() {\r\n return !!this.weights;\r\n }", "isRational() {\r\n return !!this.weights;\r\n }", "function isFloat(n){\n\t return parseFloat(n.match(/^-?\\d*(\\.\\d+)?$/))>0;\n\t}", "noFeatureElementsInAxis() {\n const {\n timeAxis\n } = this.scheduler;\n return this.store && !this.store.storage.values.some(t => timeAxis.isTimeSpanInAxis(t));\n }", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n}", "function validateTotalNetWeight() {\n\ttry {\n\t\tvar _total_net_weight_invoice \t= parseFloat($('.DSP_total_net_weight').text().replace(/,/g, ''));\n\t\tvar _total_net_weight_carton \t= parseFloat($('.DSP_total_net_weight_carton').text().replace(/,/g, ''));\n\n\t\tvar is_flag = true;\n\t\tif (_total_net_weight_invoice != _total_net_weight_carton) {\n\t\t\tis_flag = false;\n\t\t}\n\t\treturn is_flag;\n\t} catch(e) {\n console.log('validateTotalCartonInvoice' + e.message)\n }\n}", "function isMeasurementValue(value) {\n return typeof value === 'number' && isFinite(value);\n }", "function isFloat(n){ //fonction pour n'avoir que des chiffres.\n return n != \"\" && !isNaN(n) && n !==0;\n}//fin de la fonction", "function hasDoubleTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.doubleTap) ;\n\t\t}", "function hasDoubleTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.doubleTap) ;\n\t\t}", "function hasDoubleTap() {\n\t\t\t//Enure we dont return 0 or null for false values\n\t\t\treturn !!(options.doubleTap) ;\n\t\t}", "function didDoubleTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateDoubleTap() && hasDoubleTap());\n }", "static isDecimalOrBlank(string) {\n return string.match(/^\\d+(\\.\\d{0,2})?$|^$/)\n }", "function checkEmptyNumber(id_d,message)\r\n{\r\n\tvar data_d = getValue(id_d);\r\n\t\r\n\tif(checkEmptyAll(id_d,message))\r\n\t{\r\n\t\tif(parseFloat(data_d)<=0)\r\n\t\t{\r\n\t\t\ttakeCareOfMsg(message);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\t\treturn false;\r\n}", "function test_native_NaN_equivalent (){ assertFalse( NaN == NaN ); }", "function isAllElementsDatatype(elements) {\n\t\tvar result = true;\n\t\telements.each(function() {\n\t\t\tvar propertyElement = d3.select(this);\n\t\t\tif (propertyElement.attr('class').indexOf('type-data') === -1) {\n\t\t\t\tresult = false;\n\t\t\t}\n\t\t});\n\n\t\treturn result;\n\t}", "function isNumeric(val) {\n\t return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n\t}", "function number (data) {\n return typeof data === 'number' && isNaN(data) === false &&\n data !== Number.POSITIVE_INFINITY &&\n data !== Number.NEGATIVE_INFINITY;\n }", "function isNumber(val) {\n\t // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\n\t // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\n\t // subtraction forces infinities to NaN\n\t // adding 1 corrects loss of precision from parseFloat (#15100)\n\t return !isArray(val) && (val - parseFloat(val) + 1) >= 0;\n\t}", "function didDoubleTap() {\n //Enure we dont return 0 or null for false values\n return !!(validateDoubleTap() && hasDoubleTap());\n }", "function isFull() {\n for (var i = 0; i < 4; i++) {\n for (var j = 0; j < 4; j++) {\n // not full if there is a 0\n if (all_numbers[i][j] === 0) {\n return false;\n }\n }\n }\n return true;\n}", "noFeatureElementsInAxis() {\n const { timeAxis } = this.scheduler;\n return !this.store.storage.values.some((t) => timeAxis.isTimeSpanInAxis(t));\n }", "function checkNotZero(figure) {\n if (figure !== 0){\n return true;\n }else {return false;}\n }", "function areNumbers() {\n var val = true;\n for (i = 0; i < arguments.length; i++) {\n if (isNaN(arguments[i])) {\n val = false;\n break;\n }\n }\n return val;\n }", "isEpsilon() {\n let RHS = this.getRHS();\n return RHS.length === 1 && RHS[0].isEpsilon();\n }", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "anyProgress() {\n let oc = this.orbCounts;\n return (oc.speed > 0 || oc.stamina > 0 || oc.accel > 0 || oc.vigor > 0);\n }", "matchJSONValue(obj) {\n return hasOwn(obj, \"$InfNaN\") && lengthOf(obj) === 1;\n }", "isPriceValid(price){\n\n if(isNaN(parseFloat(price))){\n return false;\n }\n \n if(price.length > 0){\n return true;\n } else {\n return false;\n }\n }", "function isEmpty() {\n return ( 0 === dataset.length );\n }" ]
[ "0.65419596", "0.6404784", "0.6147087", "0.6108118", "0.6108118", "0.6108118", "0.6108118", "0.6108118", "0.5971159", "0.5955504", "0.5906189", "0.5902372", "0.5897305", "0.5834508", "0.5652023", "0.5634096", "0.56276983", "0.56192017", "0.55845326", "0.55735224", "0.55661243", "0.5559674", "0.5530058", "0.55062896", "0.5478538", "0.5475599", "0.5432865", "0.54317254", "0.54299694", "0.5350978", "0.5341787", "0.5310045", "0.5310045", "0.528703", "0.52809626", "0.52710986", "0.52549845", "0.5251764", "0.5246934", "0.52460223", "0.52349406", "0.522979", "0.52175605", "0.521456", "0.5193825", "0.51827043", "0.51800007", "0.5169131", "0.5165962", "0.5164551", "0.5151832", "0.51516443", "0.51516443", "0.51516443", "0.51513946", "0.5127449", "0.51158893", "0.5111966", "0.5100873", "0.5100873", "0.50929046", "0.5090792", "0.5089943", "0.5089943", "0.5089943", "0.508571", "0.5078381", "0.50678086", "0.50678086", "0.5058016", "0.5047038", "0.5045311", "0.50352347", "0.5026598", "0.50158125", "0.5012997", "0.5012997", "0.5012997", "0.50067294", "0.50058615", "0.50022274", "0.499877", "0.4994744", "0.49920812", "0.49861935", "0.49840206", "0.49819663", "0.49816144", "0.49778086", "0.49774006", "0.49723336", "0.49713677", "0.49664688", "0.49621972", "0.49621972", "0.49621972", "0.49599704", "0.49497816", "0.49440157", "0.493752" ]
0.55850255
18
Remove the "remove"marked tiles
function removeRemoves() { if (doubleAchieved == true) { for (var doubleRow = 0; doubleRow <= 3; doubleRow++) { for (var doubleColumn = 0; doubleColumn <= 3; doubleColumn++) { if (removeArray[doubleRow][doubleColumn] == "remove") { $(document.getElementById("tile-" + (4 * doubleRow + doubleColumn + 1).toString())).remove(); tileArray[doubleRow][doubleColumn] = null; removeArray[doubleRow][doubleColumn] = null; } } } doubleAchieved = false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function removeHelper(tile){\n\t \tif(parseInt(tile.attr('sizex')) <= 0 || parseInt(tile.attr('sizey')) <= 0){\n\t \t\t$.when(tile.fadeOut()).then(function(){\n\t \t\t\ttile.remove();\n\t \t\t});\n\t \t\tfor (var i = tiles.length - 1; i >= 0; i--) {\n\t \t\t\tif(tiles[i] == tile.attr('id')){\n\t \t\t\t\ttiles.splice(i, 1);\n\t \t\t\t\tbreak;\n\t \t\t\t}\n\t \t\t};\n\t \t}\n\t }", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n for (i = 0; i < heatmaps.length; i++) {\r\n heatmaps[i].setMap(null)\r\n }\r\n heatmaps = [];\r\n}", "static async clearAllMarkers() {\r\n let tiles = canvas.scene.getEmbeddedCollection('Tile');\r\n\r\n for (var tile of tiles) {\r\n if (tile.flags.turnMarker || tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }", "function editorDestroyTile(map, px, py) {\n var list = edTiles[px + py*map.x]; // list of list\n list.forEach(s => s.destroy());\n list.splice(0, list.length);\n}", "function removeTemporaryTiles(ignoreId) {\n //console.log('........ removeTemporaryTiles');\n var haveTemps = false;\n $(\".tile\").each(function(index, element) {\n var tile = this.tile;\n\n if(element.id !== ignoreId && tile.isTemp){\n //console.log('removeTemporaryFiles() - removing: ' + element.id);\n haveTemps = true;\n var id = element.id;\n\n // kill draggable\n try{\n Draggable.get('#' + id).kill();\n }catch(e){}\n try{\n $(element).remove();\n }catch(e){}\n var removeIdx = loadedCharts.indexOf(id);\n if(removeIdx != -1) {\n loadedCharts.splice(removeIdx, 1);\n }\n //toggleOptionButton(id, true);\n }\n });\n if(haveTemps){\n layoutInvalidated();\n }\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n for(i = 0; i < heatmaps.length; i++){\r\n heatmaps[i].setMap(null)\r\n }\r\n heatmaps = [];\r\n crimeID = [];\r\n }", "unhighlightTile () { \n this.tile.clearTint()\n }", "removeObstacle(x, y, width, height) {\n for (let i = 0; i < width; i++) {\n for (let j = 0; j < height; j++) {\n this.setTile(1, x+i, y+j, 0);\n }\n }\n }", "function clearBoard() {\n\tbgTileLayer.removeChildren();\n\tpieceLayer.removeChildren();\n\tfgTileLayer.removeChildren();\n}", "clearTileCache() {\n this.i.mu();\n }", "function camUnmarkTiles(label)\n{\n\tif (camIsString(label))\n\t{\n\t\tdelete __camMarkedTiles[label];\n\t}\n\telse\n\t{\n\t\tfor (var i = 0, l = label.length; i < l; ++i)\n\t\t{\n\t\t\tdelete __camMarkedTiles[label[i]];\n\t\t}\n\t}\n\t// apply instantly\n\t__camUpdateMarkedTiles();\n}", "function removeAllMarkers() {\n displayAllMarkers(null);\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "clear() {\n for (let x = 0; x < this._width; x++) {\n for (let y = 0; y < this._height; y++) {\n this.getTile(x, y).backgroundImage = \"\";\n this.getTile(x, y).transform = \"\";\n this.getTile(x, y).color = \"#eeeeee\";\n }\n }\n }", "function clearEndangeredTiles(isSafeTile)\n{\n // Loop through all the endangered tiles and set them to SAFE_ZONE\n for (var i = 0; i < endangeredTiles.length; i++)\n {\n // stored as ['1,1', '2,2', 3,5']\n var x = parseInt(endangeredTiles[i].split(\",\")[0]);\n var y = parseInt(endangeredTiles[i].split(\",\")[1]);\n\n updateMapTile(x, y, isSafeTile);\n }\n\n // Reset the endangered tiles array\n endangeredTiles = [];\n}", "removePice() {\n let ocubiedTile = document.getElementById(`tile${this.position.getPosX()},${this.position.getPosY()}`);\n ocubiedTile.innerHTML = '';\n }", "removeAll(occupant, layer) {\n for (var x=0; x < this.width; x++) {\n for (var y=0; y < this.height; y++) {\n this.remove(occupant, x, y, layer)\n }\n }\n }", "_removeTile(key) {\n const tile = this._tiles[key]\n if (!tile) {\n return\n }\n\n const clusters = this._tileClusters[key]\n\n if (clusters) {\n clusters.forEach(layer => this._clusters.removeLayer(layer))\n }\n\n delete this._tiles[key]\n\n this.fire('tileunload', {\n tileId: key,\n coords: this._keyToTileCoords(key),\n })\n }", "function removeMarkers()\n{\n // TODO\n // удаление всех маркеров\n for (var i = 0, n = markers.length; i < n; i++) \n {\n markers[i].setMap(null);\n }\n \n // обнуление указателя размера массива существующих маркеров\n markers.length = 0;\n}", "function unHighlightTile() {\n this.classList.remove(\"highlight\");\n }", "function clearGrid(){\n\t$(\"div.pixel\").remove();\n}", "function ClearPixels(){\n for(const p of prev_pixels){\n p.attr('type','tile');\n }\n prev_pixels = [];\n}", "function nullifyClickedTiles(){\n\tCLICKED_TILE_1 = null;\n\tCLICKED_TILE_2 = null;\n}", "_cleanupTile(tx, ty) {\n if (this._getTileVersion(tx, ty) < this.versionHash) {\n this._clearTile(tx, ty);\n }\n }", "function removeAllMarkers() {\n for(var i = 0 ; i < allMarkers.length ; i++)\n map.removeLayer(allMarkers[i]);\n \n allMarkers = [];\n}", "function removeTempMarkers(){\n for(var r = 0; r < temporary_markers.length; r++){\n temporary_markers[r].remove();\n }\n}", "function deleteMarkers() {\n clearMarkers();\n}", "function removeTmpMarkers(){\n\t$('#comment-page').hide();\n $('#modify-comment').hide();\n\t$('#add-comment').hide();\n if(tmpMarker != \"t\")\n mymap.removeLayer(tmpMarker);\n //if(selectedMarker != \"s\")\n // mymap.removeLayer(selectedMarker);\n canPlaceMarker=true;\n}", "remove() {\n this.setMap(null);\n }", "_clearTrajectories() {\n this.elem.selectAll('.intention').remove();\n\n for (let i = 0; i < this.gridSize; i++) {\n for (let j = 0; j < this.gridSize; j++) {\n if (!this._isCornerCell(i, j)) {\n this.grid[i][j].hexagon.attr('fill', 'none');\n }\n }\n }\n }", "function removeMapImage() {\n $(\".story-container-item--active .image-map\").remove();\n $(\"#map-caption\").remove();\n}", "function clearMapTileLayers() {\r\n stopFlicker(); // stop the flickering and reset the button if we change sections - do it regardless - should check to see if it was the previous open or actively flickering\r\n if (drawControl === 1) {\r\n map.removeControl(drawControl);\r\n }\r\n}", "function removeTruckMarkers()\n{\n for (var i = 0; i < truckMarkers.length; i++) {\n truckMarkers[i].setMap(null);\n }\n}", "cleanupTiles(levelIndex) {\n // Place walls around floor\n for (let j = 0; j < this.tiles.length; j++) {\n for (let i = 0; i < this.tiles[0].length; i++) {\n if (this.tiles[j][i] === 'F') {\n for (let k = -1; k <= 1; k++) {\n this.tryWall(k + i, j - 1);\n this.tryWall(k + i, j);\n this.tryWall(k + i, j + 1);\n }\n }\n }\n }\n // Place start and end points\n if (levelIndex % 2 === 0) {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'Start';\n } else {\n this.tiles[WORLD_HEIGHT - 2][WORLD_WIDTH - 2] = 'End';\n }\n for (let j = WORLD_HEIGHT - 2; j >= WORLD_HEIGHT - 2 - 5; j--) {\n for (let i = WORLD_WIDTH - 2; i >= WORLD_WIDTH - 2 - 5; i--) {\n this.floor.remove({ x: i, y: j });\n }\n }\n this.placeEnd(levelIndex);\n console.log('[World] Cleaned up tiles');\n }", "function removeUnseenImages() {\r\n\t\tvar images = $(\"#images img\");\r\n\t\t$.each(images, function(i,item) {\r\n\t\t\tvar $item=$(item);\r\n\t\t\tvar pos = $item.attr('class').replace('file','').split('-');\r\n\t\t\tvar point = new Point(parseInt($item.css('left')), parseInt($item.css('top')));\r\n\t\t\tif(notInRange(pos[0],point)) {\r\n\t\t\t\t$item.remove();\r\n\t\t\t\t$['mapsettings'].loaded[pos[0]+\"-\"+pos[1]+\"-\"+pos[2]+\"-\"+pos[3]] = false;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function luz(pj, distancia, mapa) {\n\n var dist = -(distancia - 1);\n for (var i = dist; i < distancia; i++) {\n for (var j = dist; j < distancia; j++) {\n mapa.removeTile(Math.trunc(pj.x / 32) + i, Math.trunc(pj.y / 32) + j, 'Capa3');\n }\n }\n\n}", "function removeMarkers()\n{\n setMapOnAll(null);\n \n // TODO\n function setMapOnAll(map){\n for (var i = 0; i < markers.length; i++)\n {\n markers[i].setMap(map);\n }\n }\n \n \n}", "function removerMarcas(){\n markerInicioFin.clearMarkers();\n}", "function removeAllMarkers(){\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n}", "function removeMarkers(){\n for(i=0; i<gmarkers.length; i++){\n gmarkers[i].setMap(null);\n }\n }", "function removeMarkers()\n{\n if (markers.length != 0)\n {\n for (let i = 0; i < markers.length;i++)\n {\n markers[i].remove();\n }\n }\n}", "function eliminateSingleTiles()\r\n{\r\n for(var y = 3; y < WORLD_SIZE_MAX-3; ++y)\r\n {\r\n for(var x = 3; x < WORLD_SIZE_MAX-3; ++x)\r\n {\r\n if(worldMapArray[y][x].isStatic == false)\r\n {\r\n singleTileCoastEliminationCheck(x, y, 2);\r\n\r\n if(worldMapArray[y][x].biomeType == BIOME_DESERT)\r\n {\r\n singleTileDesertEliminationCheck(x, y, 2);\r\n }\r\n }\r\n }\r\n }\r\n}", "function removeMarkers(){\n for(i=0; i<gmarkers.length; i++){\n gmarkers[i].setMap(null);\n }\n }", "function removeAllGSighting(){\n \tremoveAllObjectMarker(SIGHTING);\n }", "function CleanMap() {\n\tRemoveMarkers();\n\tRemovePolylines();\n}", "function clearMarkers() {\n markers.forEach(function(marker) {\n marker.removeFrom(mymap);\n });\n markers = [];\n}", "function remove_markers() {\n\t//Loop through all the markers and remove\n for (var i = 0; i < map.markers.length; i++) {\n\t\t map.markers[i].setMap(null);\n }\n markers = [];\n}", "static async deleteStartMarker() {\r\n for (var tile of canvas.scene.getEmbeddedCollection('Tile')) {\r\n if (tile.flags.startMarker) {\r\n await canvas.scene.deleteEmbeddedEntity('Tile', tile._id);\r\n }\r\n }\r\n }", "mapRemove() {\n\n\t\tthis.map.remove();\n\n\t}", "removeItem(x,y) { this.getCell(x,y)._mapItem = null; }", "function deleteMarkers() {\n clearMarkers();\n markers1 = [];\n }", "function deleteMarkers() {\n\n clearMarkers();\n markers = [];\n\n}", "function removeMarkers() {\n for (i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }", "function removeMarkers() {\n for (i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n }", "function removeMarkers(){\n for(var i=0; i<markers.length; i++){\n markers[i].setMap(null);\n }\n markers.length = 0;\n}", "function DeleteMap() {\n document.body.removeChild(map);\n}", "function deleteMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n }", "function removeMarkers()\n{\n // for each marker, remove it from the map\n markers.forEach(function(marker) {\n marker.setMap(null);\n });\n \n // set the matches array length to 0 because: performance™\n markers.length = 0;\n}", "function doTileErase($element){\n\t\t$element.type = defaultTile.type;\n\t\t$element.background = defaultTile.background;\n\t\t$element.style.backgroundColor = defaultTile.background;\n\t\t$element.style.backgroundImage = '';\n\t\t$element.setAttribute(\"class\", defaultTile.classes);\n\t}", "removeMarkers() {\n this.control.rotateSpeed = 0.1;\n if (this.markers && this.markers.length) {\n for (var i = this.markers.length - 1; i >= 0; i--) {\n this.scene.remove(this.markers[i]);\n }\n }\n }", "removeSprites() {\n\t\t\t\t// prevent rebuilding the quadTree multiple times\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = false;\n\t\t\t\twhile (this.length > 0) {\n\t\t\t\t\tthis[0].remove();\n\t\t\t\t}\n\t\t\t\tthis.p.quadTree.rebuildOnRemove = true;\n\n\t\t\t\tthis.p.allSprites._rebuildQuadtree();\n\t\t\t}", "function removeIncidentMarkers()\n{\n for (var i = 0; i < incidentMarkers.length; i++) {\n incidentMarkers[i].setMap(null);\n }\n}", "function removeOldTiles() {\r\n mapList.forEach(function (key) { //for(key in lyrGroups){\r\n var dataLayers = lyrGroups[key].data.getLayers();\r\n if (dataLayers.length > 2) { // TODO: if you change the year fast with arrow, the loading can't keep up - could set this value higher, or put a timer on the remove layer function in next line\r\n for (var i = 0; i < (dataLayers.length - 2); i++) {\r\n lyrGroups[key].data.removeLayer(dataLayers[i])\r\n }\r\n //console.log('n layers: '+lyrGroups[key].data.getLayers().length.toString())\r\n }\r\n })\r\n}", "function removeMarkers() {\n for (var i = 0; i < markers.length; i++) {\n if (markers[i]) {\n markers[i].setMap(null);\n }\n }\n markers = [];\n}", "function removeMapIcons() {\n deleteMarkers();\n if ($('[name=direction]').val() == 'available') {\n directions1Display.setMap(null);\n directions1Display.setPanel(null);\n }\n}", "function markerDelAgain() {\n for(i=0;i<listeMarker.length;i++) \n {\n map.removeLayer(listeMarker[i]);\n } \n}", "function deleteMarkers() {\n for (var i = 0; i < allMarkers.length; i++) {\n allMarkers[i].setMap(null);\n }\n allMarkers = [];\n}", "function clearMarkers() {\n\n setAllMap(null);\n\n}", "function deleteMarkers() {\n for (var i = 0; i < markers.length; i++) {\n markers[i].setMap(null);\n }\n markers = [];\n}", "function removeTreeMap() {\r\n d3.select(\"#the_treeMap\").remove();\r\n d3.select(\"#the_toolTip\").remove();\r\n}", "function deleteMarkers() {\n displayAllMarkers(null);\n markers = [];\n }", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n // remove bounds values from boundsArray\n boundsArray = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function deleteMarkers() {\r\n clearMarkers();\r\n markers = [];\r\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}", "function deleteMarkers() {\n clearMarkers();\n markers = [];\n}" ]
[ "0.7442869", "0.7130446", "0.71193093", "0.7031106", "0.700747", "0.6990069", "0.6916172", "0.6899759", "0.6811951", "0.6783727", "0.67684627", "0.6762249", "0.67551816", "0.67551816", "0.67507064", "0.67451876", "0.67447823", "0.6722273", "0.66993564", "0.66795224", "0.66774833", "0.6636313", "0.66338235", "0.6576061", "0.6574848", "0.6570467", "0.6566964", "0.6546506", "0.65361315", "0.6530747", "0.64873725", "0.6472502", "0.6466205", "0.6461621", "0.6437789", "0.64322203", "0.6427646", "0.6421328", "0.64083433", "0.6407049", "0.6403799", "0.6395362", "0.63928974", "0.638504", "0.63839704", "0.63831526", "0.63814306", "0.6369037", "0.6367075", "0.6366703", "0.6363042", "0.63549227", "0.6351766", "0.6351766", "0.63467115", "0.6346447", "0.63405704", "0.6338677", "0.6334412", "0.63330984", "0.63315874", "0.6314456", "0.63144076", "0.63114554", "0.63059014", "0.63050383", "0.6301307", "0.63003147", "0.62954175", "0.6294437", "0.6293736", "0.62928045", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.6288712", "0.62838095", "0.62838095", "0.62838095", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715", "0.62781715" ]
0.7422738
1
Pick a random color from the available options
function pickColor() { if (colorArray.length > 1) { var oldColorIndex = colorArray.indexOf(document.getElementById("center-tile").style.backgroundColor); if (freshStart == true) { oldColorIndex = -1; } if (oldColorIndex > -1) { var oldColor = colorArray[oldColorIndex]; colorArray.splice(oldColorIndex, 1); } var colorToReturn = colorArray[Math.floor(Math.random() * colorArray.length)]; if (oldColorIndex > -1) { colorArray.push(oldColor); } return colorToReturn; } else { return colorArray[Math.floor(Math.random() * colorArray.length)]; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pickColor() {\n let colorOptions = ['#FF6F61', '#D69C2F', '#343148', '#7F4145', '#BD3D3A', '#766F57'];\n let max = colorOptions.length - 1;\n let min = 0;\n let pickRandom = Math.random() * (max - min) + min\n let randomColor = colorOptions[Math.floor(pickRandom)]\n return randomColor;\n}", "function pickcolor() {\n\tvar random=Math.floor(Math.random()*color.length);\n\t return color[random];\n\t// body...\n}", "function pickColor(){\n\tlet random = Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor(){\n\tvar random = Math.floor(Math.random() * difficulty);\n\treturn colors[random];\n}", "function pickColor () {\r\n let random = Math.floor(Math.random() * colors.length)\r\n return colors[random];\r\n}", "function pickColor(){\n\tlet random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\t\n\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length); \n return colors[random];\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor() {\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n\tvar random=Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor(){\n\tvar random=Math.floor(Math.random()*colors.length);\n\treturn colors[random];\n}", "function pickColor() {\n\tvar random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\n}", "function pickColor() {\n const random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n\tvar random = Math.floor(Math.random() * colors.length);\n\n\treturn colors[random];\n}", "function pickColor(){\n\treturn colors[(Math.floor(Math.random() * difficulty))]\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\r\n\tvar random = Math.floor(Math.random()*colors.length);\r\n\treturn colors[random];\r\n}", "function pickColor(){\n var rand = Math.floor(Math.random()*color.length);\n return color[rand];\n}", "function pickColor(){\r\n\tvar random=Math.floor(Math.random() * colors.length);\r\n\treturn colors[random];\r\n}", "function pickColor() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor() {\n return (color[Math.floor(Math.random() * color.length)]);\n}", "function randomColorSelector() {\n let red = Math.random() * (255 - 0);\n let green = Math.random() * (255 - 0);\n let blue = Math.random() * (255 - 0);\n return [\"rgb(\", red, \",\", green, \",\", blue, \")\"].join(\"\");\n\n}", "function setRandomColor() {\n colorPicker = round(random(colorChoices.length - 1))\n console.log(\"Color picker chose: colorChoices[\" + colorPicker + \"] -> \" + colorChoices[colorPicker]);\n}", "function pickColor() {\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random()* colors.length);\n return colors[random];\n}", "function pickRandomColor () {\n\tvar random = Math.floor(Math.random() * colors.length);\n\treturn colors[random];\n}", "function RandChooseColor()\n{\n var randId = floor(\n random(ColorPallette.length-0.00001));\n var cr = ColorPallette[randId];\n \n return cr;\n}", "function pickColor(){\n\tvar random = Math.floor(Math.random() * colors.length);\n\t//Return random colour from array\n\treturn colors[random];\n}", "function pickColor()\n{\n\tvar rand = Math.floor((Math.random() * colors.length));\n\treturn colors[rand];\n}", "function pickColor(){\n var random = Math.floor(Math.random()*colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickColor(){\n var random=Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickRandomColor() {\n var rando = Math.floor(Math.random() * colors.length);\n return colors[rando];\n}", "function getColor(selectedColor){\n return (selectedColor === 'r') ? ['w','b'][Math.floor(Math.random() * 2)] : selectedColor;\n }", "function chooseRandomColor() {\n let randomColor = colorArray[Math.floor(Math.random() * colorArray.length)];\n return randomColor;\n }", "function pickcolor(){\r\n var randomOneColor=Math.floor(Math.random()*colors.length);\r\n return colors[randomOneColor];\r\n}", "function pickColor(){\n\treturn colors[Math.floor((Math.random() *6) + 0)];\n}", "function pickColor() {\n var index = Math.floor(Math.random() * colors.length);\n return colors[index];\n}", "function pickColor(){\n return Math.floor(Math.random()*numColors);\n}", "chooseColor() {\n let colors = ['#E55F5D', '#FA8455', '#FFC670', '#51CD99', '#7FD6D8', '#8E97DA', '#E3AEC9'];\n let color = colors[Math.round(Math.random() * 6)];\n \n return color;\n }", "function pickColor() {\n var rand = Math.floor(Math.random() * 11);\n if (rand == curcolor) {\n pickColor();\n } else {\n curcolor = rand;\n return colors[rand];\n }\n}", "function pickColor() {\n // floor number so no decimals, random number\n var random = Math.floor(Math.random() * colors.length);\n // this picks a random number, so it retuns colors[3] for example \n return colors[random];\n}", "function pickColor(colors){\r\n\tvar random = Math.floor(Math.random() * colors.length);\r\n\treturn colors[random];\r\n}", "function pickColor() {\n return colors[Math.floor(Math.random() * numSquares)];\n}", "function pickColor(){\n //generate a number between 1 and the length of our color array\n var random = Math.floor(Math.random() * color.length);\n //return that index in our color array\n return color[random];\n}", "function RandomPick() {\r\n // Randomly select one colour and return it back\r\n var picks = [\"Red\", \"Green\", \"Yellow\", \"Blue\"];\r\n return picks[Math.floor(Math.random()*picks.length)];\r\n}", "function chooseColors() {\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function pickedColor() {\n var random = Math.floor(Math.random() * differentColors.length);\n return differentColors[random];\n}", "function pickColor(){\n //Pick a random number\n var random = Math.floor(Math.random() * colors.length);\n return colors[random];\n}", "function selectColor() {\n index = Math.floor(Math.random() * colors.length);\n return colors[index];\n}", "function chooseColor() {\n const colorPalette = [\n \"#ffb25d\",\n \"#21f3c5\",\n \"#217bf3\",\n \"#ecf321\",\n \"#f32192\",\n \"#a621f3\",\n ];\n\n let index = Math.floor(Math.random() * 6);\n let color = colorPalette[index];\n return color;\n }", "function pickColor() {\n\n // Array containing colors \n var colors = [\n '#A6A1D0', '#D77790', '#E17142',\n '#66C3C1', '#939D18', '#E1AC3E' , 'black'\n ];\n\n // selecting random color \n var random_color = colors[Math.floor(\n Math.random() * colors.length)];\n\n var x = document.getElementById('pick');\n x.style.color = random_color;\n }", "function randomColorFromPalette() { return palette[Math.floor(Math.random() * palette.length)][2]; }", "function determineColor(){\n var red = randomInt(255);\n var green = randomInt(255);\n var blue = randomInt(255);\n}", "function pickColor(){\n //store a random index in a var\n let random = Math.floor(Math.random() * colors.length);\n //return that index color \n return colors[random];\n}", "function randomColor(){\n\nlet colorPick = [\n '#E52424',\n '#243EE5',\n '#C2A453', \n '#D591CA',\n '#21D567'\n]\nlet color_Number = Math.floor(Math.random() * colorPick.length);\nlet color_Choice = colorPick[color_Number];\ndocument.body.style.backgroundColor = color_Choice;\n\n}", "function chooseNewRandomColor() {\n var randomNumberSelected = randomNumber(0, numberOfColors - 1);\n randomColor = colorArray[randomNumberSelected];\n $('#userColorPrompt').text(randomColor);\n}", "function randomColor() {\n const len = colors.length;\n return colors[Math.floor(Math.random() * len)];\n}", "function RandomColor() { \n\n let a = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n let c = Math.floor(Math.random() * 256);\n let colorPick = \"rgb(\" + a + \", \" + b + \", \" + c + \")\"; \n\n return colorPick; \n\n}", "function randomColor() {\n colors = [\"red\", \"yellow\", \"blue\", \"green\"];\n return colors[Math.floor(Math.random() * 7)];\n }", "function pickRandomColour() {\n var randomNumber = Math.floor( Math.random() * colours.length );\n return colours[ randomNumber ];\n}", "function selectRandomColour() {\n\n let random = Math.floor(Math.random() * colours.length);\n \n return colours[random];\n}", "function getRandomColor(){\n var rndNbr = Math.floor(Math.random()*4);\n return colors[rndNbr];\n}", "function random(options) {\n if (options === void 0) {\n options = {};\n }\n // Check if we need to generate multiple colors\n if (options.count !== undefined && options.count !== null) {\n var totalColors = options.count;\n var colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n var h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n var s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n var v = pickBrightness(h, s, options);\n var res = { h: h, s: s, v: v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new _index__WEBPACK_IMPORTED_MODULE_0__['TinyColor'](res);\n }", "function random(options) {\n if (options === void 0) { options = {}; }\n // Check if we need to generate multiple colors\n if (options.count !== undefined &&\n options.count !== null) {\n var totalColors = options.count;\n var colors = [];\n options.count = undefined;\n while (totalColors > colors.length) {\n // Since we're generating multiple colors,\n // incremement the seed. Otherwise we'd just\n // generate the same color each time...\n options.count = null;\n if (options.seed) {\n options.seed += 1;\n }\n colors.push(random(options));\n }\n options.count = totalColors;\n return colors;\n }\n // First we pick a hue (H)\n var h = pickHue(options.hue, options.seed);\n // Then use H to determine saturation (S)\n var s = pickSaturation(h, options);\n // Then use S and H to determine brightness (B).\n var v = pickBrightness(h, s, options);\n var res = { h: h, s: s, v: v };\n if (options.alpha !== undefined) {\n res.a = options.alpha;\n }\n // Then we return the HSB color in the desired format\n return new __WEBPACK_IMPORTED_MODULE_0__index__[\"b\" /* TinyColor */](res);\n}", "function pickWinningColor(){\r\n const result = Math.floor(Math.random() * colors.length);\r\n return colors[result];\r\n }", "function randomColor(){\r\n var random = Math.floor(Math.random() * colors.length);\r\n return colors[random];\r\n}", "function randomColor(){\n return colors[Math.floor(Math.random() * colors.length)]\n}", "function answer(){\n let random = Math.floor(Math.random() * colors.length);\n return colors[random];\n }", "function pickColor(){\r\n\tvar str = \"rgb(\" + Math.floor(Math.random()*256) + \", \" \r\n\t+ Math.floor(Math.random()*256) + \", \"\r\n\t+ Math.floor(Math.random()*256) + \")\"; \r\n\treturn str;\r\n}", "function colorPicker () {\n var randomizer = Math.floor(Math.random() * 2);\n if (randomizer === 0) {\n return 'rgba(248, 158, 49, .8)';\n } else {\n return 'rgba(0, 114, 188, .95)'\n }\n }", "function getRandomColor() {\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function randomColor() {\n //pick a \"red\" from 0 -255\n const r = Math.floor(Math.random() * 256);\n //pick a \"green\" from 0 -255\n const g = Math.floor(Math.random() * 256);\n //pick a \"blue\" from 0 -255\n const b = Math.floor(Math.random() * 256);\n\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function colorPicker(num) {\r\n let i = Math.floor(Math.random() * colors.length);\r\n return colors[i];\r\n}", "function randomColor() {\n\t//pick r, g, b from 0 - 255\n\tvar r = Math.floor(Math.random() * 256);\n\tvar g = Math.floor(Math.random() * 256);\n\tvar b = Math.floor(Math.random() * 256);\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function pickColor() {\r\n\tvar random = Math.floor(Math.random() * colors.length);\r\n\t//Use this variable (random number) to access an element from the array at that index (the random\r\n\t//number that is picked, e.g. 3, is the index number of the array above:\r\n\treturn colors[random];\r\n}", "function pickColour() {\r\n\tvar rand = Math.floor(Math.random() * colours.length)\r\n\treturn colours[rand]\r\n}", "function getRandomColor() {\r\n let randomColor = Math.floor(Math.random() * colors.length);\r\n\r\n return colors[randomColor];\r\n}", "function randomColor(color){\n return color[Math.floor((Math.random() * 3))];\n }", "pickColor() {\n const bgColor = Math.floor(Math.random() * 16777215).toString(16);\n this.color = '#' + ('000000' + bgColor).slice(-6);\n }", "function randomColor(){\r\n\t//pick a \"red\" from 0 - 255\r\n\tconst r = Math.floor(Math.random() * 256);\r\n\t//pick a \"green\" from 0 -255\r\n\tconst g = Math.floor(Math.random() * 256);\r\n\t//pick a \"blue\" from 0 -255\r\n\tconst b = Math.floor(Math.random() * 256);\r\n\treturn \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\r\n}", "function randomColor() {\n var randomNum = Math.floor(Math.random()*colors.length);\n return colors[randomNum];\n}", "function randomColor() {\n colors = [red, blue, yellow, green];\n index = Math.floor(Math.random() * 4);\n\n return colors[index];\n }", "function getRandomColor() {\n\tvar randomNumber = Math.floor(Math.random() * randomColor.length); \n\tusedColors.push(randomColor[randomNumber]);\n\treturn randomColor[randomNumber];\n}", "function randomColor(){\n var randomNumber = Math.floor(Math.random()* colors.length);\n var randomRGB = colors[randomNumber];\n\n return randomRGB;\n}", "function getRandomColor() {\n let randomNumber = Math.floor(Math.random() * colors.length);\n return colors[randomNumber];\n}", "function getRandomColor()\n{\n let randNumber = Math.floor(Math.random() * colors.length);\n return colors[randNumber];\n}", "function randColor() {\n const colors = [\"black\", \"dodgerblue\", \"cadetblue\", \"aquamarine\", \"green\", \"blue\", \"red\", \"maroon\", \"brown\"];\n return colors[Math.floor(Math.random() * colors.length)];\n}", "function pickColor(){\r\n r = Math.random() * (254 - 0) + 0;\r\n g = Math.random() * (254 - 0) + 0;\r\n b = Math.random() * (254 - 0) + 0;\r\n\r\n logoColor = 'rgb('+r+','+g+', '+b+')';\r\n}", "pickColor(colorArray) {\n let randomColor = Math.floor(Math.random() * colorArray.length);\n return colorArray[randomColor];\n }", "function randomPickedColorIndex()\r\n{\r\n\treturn Math.floor(Math.random()*arr.length);\r\n}", "function getRandomColor() {\n var random = (Math.round(Math.random() * (colors.length -1)));\n return colors[random];\n}", "function chooseColor(){\n//Store available css classes\nvar colors = [\"red\", \"blue\", \"yellow\", \"navy\", \"orange\", \"green\", \"purple\"];\n//Give a random number from 0 to 6\nvar randomNumber = Math.floor(Math.random()*7);\nreturn colors[randomNumber];\n}", "function promptRGB() {\n let colorsIndex = Math.floor(Math.random() * colors.length);\n rgbCode.textContent = colors[colorsIndex];\n pickedColor = colors[colorsIndex];\n return;\n}", "function getRandomColor() {\n var i = Math.floor(Math.random() * colors.length);\n return colors[i];\n}", "function generateRandomColor() {\n // return '#'+Math.floor(Math.random()*16777215).toString(16);\n return myColors[Math.floor(Math.random()*myColors.length)];\n}", "function randomColor () {\nreturn Math.floor (Math.random() * 256) ;\n}", "function randomColor() {\n return \"rgb(\" + random(0, 235) +\n \", \" + random(0, 235) +\n \", \" + random(0, 235) + \")\";\n}", "function randomColor() {\n //pick red/blue/green from 0 to 255\n let r = Math.floor(Math.random() * 256);\n let g = Math.floor(Math.random() * 256);\n let b = Math.floor(Math.random() * 256);\n return \"rgb(\" + r + \", \" + g + \", \" + b + \")\";\n}", "function getRandomColor () { \n var colours = ['#349e72', '#c78a29', '#269bbd', '#b04600', '#DA70D6', '#76ab76']\n return colours[getRandomNumber(0, 5)]\n}" ]
[ "0.83027124", "0.8246643", "0.8227273", "0.81926966", "0.8187323", "0.8177419", "0.815972", "0.81530535", "0.81469685", "0.8146544", "0.8146544", "0.8143488", "0.8134871", "0.81300324", "0.8119088", "0.8110944", "0.8108727", "0.8097088", "0.8093781", "0.8093238", "0.808617", "0.8067917", "0.8045923", "0.80432314", "0.80428225", "0.8038066", "0.8035854", "0.8034885", "0.79919666", "0.79918885", "0.79834276", "0.79834276", "0.7981147", "0.79604393", "0.79331005", "0.7929235", "0.7927303", "0.79258865", "0.7910083", "0.7883215", "0.78809774", "0.78604424", "0.78535753", "0.78429806", "0.78264207", "0.7809639", "0.7804756", "0.7803243", "0.7799623", "0.7799021", "0.7782776", "0.77800745", "0.77678573", "0.77473253", "0.773833", "0.77319354", "0.7711968", "0.77051437", "0.7684141", "0.7678958", "0.76716864", "0.766966", "0.76579785", "0.7649497", "0.76435256", "0.7637412", "0.7627379", "0.7624071", "0.7620961", "0.7615565", "0.76148653", "0.75985926", "0.75882316", "0.7585461", "0.7570522", "0.7559154", "0.75508755", "0.75493205", "0.7545656", "0.75449413", "0.7540746", "0.75381553", "0.7522993", "0.75138736", "0.7509691", "0.7504926", "0.7504279", "0.7502823", "0.74950796", "0.7494056", "0.7492038", "0.7479059", "0.7464715", "0.74590397", "0.7448903", "0.744239", "0.7439741", "0.7438894", "0.74342203", "0.74259686", "0.7423191" ]
0.0
-1
Add new tile colors to the colorArray
function addColors() { var currentScore = parseInt(document.getElementById("current-score").innerHTML); if (currentScore >= 10 && !yellowActivated) { yellowActivated = true; colorArray.push("gold"); } if (currentScore >= 20 && !greenActivated) { greenActivated = true; colorArray.push("green"); } if (currentScore >= 50 && !purpleActivated) { purpleActivated = true; colorArray.push("darkmagenta"); } if (currentScore >= 100 && !orangeActivated) { orangeActivated = true; colorArray.push("darkorange"); } if (currentScore >= 200 && !pinkActivated) { pinkActivated = true; colorArray.push("deeppink"); } if (currentScore >= 500 && !tealActivated) { tealActivated = true; colorArray.push("#33ADD6"); } if (currentScore >= 1000 && !brownActivated) { brownActivated = true; colorArray.push("saddlebrown"); } if (currentScore >= 2000 && !grayActivated) { grayActivated = true; colorArray.push("dimgrey"); } if (currentScore >= 5000 && !blackActivated) { blackActivated = true; colorArray.push("black"); } if (currentScore >= 10000 && !whiteActivated) { whiteActivated = true; colorArray.push("ghostwhite"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateColorArray () {\n // IF USER IN IN MIDDLE OF COLOR ARRAY\n // REMOVE ALL ELEMENTS BEYOND THEIR POSITION\n var l = colors.length - 1;\n if (colorsIndex < l) {\n colors.splice(colorsIndex + 1, l - colorsIndex);\n }\n\n // ADD NEW COLOR TO ARRAY\n colors.push([r, g, b]);\n colorsIndex++;\n}", "function addTileColor() {\n\n for (var i=0; i<numberOfTiles; i++) {\n var tileAtIndex = $('.tile').eq(i);\n tileAtIndex.css('background', colorTiles(i));\n }\n\n}", "populateGridColorArrays() {\n //for every column..\n for (let i = 0; i < this.colNum; i++) {\n\n // //Generate colors based on a split complementry palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 95;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 59;\n // this.sVal = 96;\n // this.bVal = 87;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 240;\n // this.sVal = 57;\n // this.bVal = 89;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n // //Generate colors based on a triad palette\n // if (i % 2 == 0) {\n // this.hVal = 19;\n // this.sVal = 91;\n // this.bVal = 100;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // } else if (i % 3 == 0) {\n // this.hVal = 173;\n // this.sVal = 96;\n // this.bVal = 40;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }else{\n // this.hVal = 259;\n // this.sVal = 82;\n // this.bVal = 90;\n // this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n // }\n\n //Generate colors based on a analogus palette\n\n //based on the row number push one of three possible colors into the right hand side color array\n if (i % 3 === 0) {\n this.hVal = 261;\n this.sVal = 75;\n this.bVal = 91;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else if (i % 2 === 0) {\n this.hVal = 231;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 202;\n this.sVal = 90;\n this.bVal = 89;\n this.colorsRight[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n\n //based on the row number push one of two possible colors (white or black) into the left hand side color array\n //two possible colors linearly interpolate to three possible colors creating and asnyschronus relation between the left and right hand sides\n if (i % 2 == 0) {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 20;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n } else {\n this.hVal = 0;\n this.sVal = 0;\n this.bVal = 85;\n this.colorsLeft[i] = color(this.hVal, this.sVal, this.bVal, this.mouduleAlpha);\n }\n }\n\n }", "newColors(){\n for (let i = 0; i < this.colorCount; i++) {\n this.addColorToObject()\n }\n this.updateGradientString()\n }", "function setColors(colorArr){ //removed \"[]\"\n let i = 0;\n let len = colorArr.length;\n for(i = 0; i < len; i++){\n colorArr[i] = {red: randomInt(255), green: randomInt(255), blue: randomInt(255)};\n //TODO we will need to add a function that makes sure that no two colors are the same.\n //Maybe use a while loop? (RON)\n }\n}", "function createColorArr(color){\n\n if(color == 'light'){ runner = boardArr.length-1}\n else{ runner = 0;}\n for(var i = 0; i < initPieceAmt; i++){\n const tmpPce = new Object;\n tmpPce.val = \"piece\";\n tmpPce.color = color;\n tmpPce.crowned = false;\n while(!boardArr[runner].empty || !boardArr[runner].legalPlay){\n if(color == 'light'){ runner--}\n else{ runner++}\n }\n tmpPce.tileLocation = boardArr[runner].tileLocation;\n tmpPce.x = boardArr[runner].x;\n tmpPce.y = boardArr[runner].y;\n boardArr[runner].empty = false;\n if(color == 'light'){ tmpPce.currPieceLight = 1; tmpPce.oppColor = darkArr; lightArr.push(tmpPce);}\n else{ tmpPce.currPieceLight = -1; tmpPce.oppColor = lightArr; darkArr.push(tmpPce);}\n }\n}", "function addColor(){\n var color = vec4(Math.random(), Math.random(), Math.random(), 1.0);\n tempColors.push(color);\n colors.push(color);\n}", "function fillColorArray() {\n return randomColor({\n count: 100\n });\n }", "updateColors(data) {\n for (let i = 0; i < data.length; i++) {\n this.map.setFeatureState({\n source: 'pbdb',\n sourceLayer: 'hexgrid',\n id: data[i].hex_id\n }, {\n color: this.colorScale(parseInt(data[i].count))\n })\n }\n }", "add(color) {\n if(!this.contains(color)){\n this._coloring.push(color);\n }\n }", "function addColor(array){\r\n const ArrayColor = [\"red\",\"green\",\"yellow\"];\r\n array.forEach((element, index)=>{\r\n\r\n if (element.type==\"animal\"){\r\n array[index]={\r\n ...element,\r\n color:ArrayColor[0],\r\n }\r\n }else if (element.type==\"vegetable\"){\r\n\r\n array[index]={\r\n ...element,\r\n color:ArrayColor[1],\r\n }\r\n\r\n } else {\r\n array[index]={\r\n ...element,\r\n color:ArrayColor[2],\r\n }\r\n }\r\n });\r\n\r\n return array;\r\n}", "function setColors() {\n var len = points.length / 3;\n for (var i = 0; i < len; i++) {\n colors.push(1.0);\n colors.push(0.0);\n colors.push(0.0);\n colors.push(1.0);\n }\n}", "set_colors()\r\n {\r\n /* colors */\r\n let colors = [\r\n Color.of( 0.9,0.9,0.9,1 ), /*white*/\r\n Color.of( 1,0,0,1 ), /*red*/\r\n Color.of( 1,0.647,0,1 ), /*orange*/\r\n Color.of( 1,1,0,1 ), /*yellow*/\r\n Color.of( 0,1,0,1 ), /*green*/\r\n Color.of( 0,0,1,1 ), /*blue*/\r\n Color.of( 1,0,1,1 ), /*purple*/\r\n Color.of( 0.588,0.294,0,1 ) /*brown*/\r\n ]\r\n\r\n this.boxColors = Array();\r\n for (let i = 0; i < 8; i++ ) {\r\n let randomIndex = Math.floor(Math.random() * colors.length);\r\n this.boxColors.push(colors[randomIndex]);\r\n colors[randomIndex] = colors[colors.length-1];\r\n colors.pop();\r\n }\r\n\r\n }", "function refreshEasyColors(){\n\t\tcolors = createColors(squares.length);\n\t\treset();\n\n}", "function pushRGB(num) {\n for (let i = 0; i < num; i++) {\n newValue = colors.push(newRGB());\n }\n return newValue;\n}", "dedupeColors(){\n let pixCount = this.pattern.width == 32 ? 1024 : 4096;\n let indexMap = [];\n let colorMap = {};\n //Calculate new indexes from old indexes\n for (let i = 0; i < 15; ++i){\n const c = this.getPalette(i);\n if (colorMap.hasOwnProperty(c)){\n indexMap[i] = colorMap[c];\n }else{\n colorMap[c] = i;\n indexMap[i] = i;\n }\n }\n //Change pixels to their respective indexes\n for (let i = 0; i < pixCount; ++i){\n const c = this.pixels[i];\n if (c >= 15){continue;}\n this.pixels[i] = indexMap[c];\n }\n }", "set rgb (rgbaArray) { this.setColor(...rgbaArray) }", "function change_color(oldIndex, color) {\n var newColor = hex2rgb(color)\n\n // Pixel array is four parts: R, G, B, A\n var length = originalPixelArray.length / 4;\n var newPixelArray = Uint8ClampedArray.from(imageData.data)\n for (var i = 0; i < length; i++) {\n var index = 4 * i;\n\n var r = originalPixelArray[index];\n var g = originalPixelArray[index + 1];\n var b = originalPixelArray[index + 2];\n\n if (r == original_palette[oldIndex][0] && g == original_palette[oldIndex][1] && b == original_palette[oldIndex][2]) {\n newPixelArray[index] = newColor[0];\n newPixelArray[index + 1] = newColor[1];\n newPixelArray[index + 2] = newColor[2];\n }\n }\n imageData.data.set(newPixelArray)\n ctx.putImageData(imageData, 0, 0);\n ctx.drawImage(canvas, 0, 0, img.width, img.height, 0, 0, canvas.width, canvas.height);\n}", "function setColors () {\r\n for (let i = 0; i<squares.length; i++) {\r\n squares[i].style.backgroundColor = colors[i];\r\n}}", "function updateTiles() {\n forEachTile(function update(row, col) {\n setTimeout(function () {\n tileColor = jQuery.Color().hsla({\n hue: (tileColor.hue() + (Math.random() * tileMaxHueShift)) % 360,\n saturation: tileMinSaturation + (Math.random() * tileSaturationSpread),\n lightness: tileMinLightness + (Math.random() * tileLightnessSpread),\n alpha: tileOpacity\n });\n\n var currentColor = jQuery.Color($(\"#\" + row + \"-\" + col), \"backgroundColor\");\n\n // when to update the Tiles\n if (currentColor.lightness() < tileLightnessDeadZoneLowerBound() ||\n currentColor.lightness() > tileLightnessDeadZoneUpperBound() ||\n currentColor.lightness() == 1) {\n $(\"#\" + row + \"-\" + col).animate({\n backgroundColor: tileColor\n }, tileFadeDuration);\n }\n }, getTileDelayTime(row, col));\n });\n }", "@autobind\n processColors(data) {\n var self = this;\n var colorsetindex = 0;\n var colorindex = 0;\n\n for (var i=0; i<data.colors.length; i++) {\n this.colors[i] = new Array();\n for (var a=0; a<4; a++) {\n this.colors[i][a] = new Array();\n }\n }\n\n data.colors.forEach(function(colset) {\n colorindex = 0;\n colset.colors.forEach(function(col){\n switch (col.label) {\n case \"red\":\n colorindex = 1;\n break;\n case \"green\":\n colorindex = 3;\n break;\n case \"blue\":\n colorindex = 0;\n break;\n case \"yellow\":\n colorindex = 2;\n break;\n }\n col.colors.forEach(function(color) {\n self.colors[colorsetindex][colorindex].push(self.hexToRgb(color));\n });\n });\n\n colorsetindex++;\n });\n }", "function loopThroughColors() {\n\tcolorTiles.forEach(function(tile){ // turns off click function for tiles\n\t\ttile.off('click');\n\t})\n\tnewArray.forEach(function(target, index, arr){\n\t\tshowColor(target, (index+1), arr);\n\t});\n}", "assignColor() {\n let name = arguments[arguments.length-1]; // color distribution\n for (let i = 0; i < name.length; ++i) {// for each color to be assigned\n let array = arguments[i * 2];\n let index = arguments[i * 2 + 1];\n array[index] = name[i];\n }\n }", "function setColor(colNr){\r\n currentColor = colNr;\r\n\r\n pixels.children.forEach(pixel => {\r\n pixel.tweenTo({ fillColor: colors[currentColor][pixel.colStep]}, { duration: _.random(200, 1000)});\r\n });\r\n}", "function reddify(rgbArr){ //todo3 //needs to take in an array parameter\n rgbArr[RED] = 255 //use array with this\n }", "set extraColors(colors) {\n const final = [];\n colors.forEach(color => {\n const col = this._validHex(color);\n if (col) {\n final.push(col);\n }\n });\n this.extraColorsInner = final;\n }", "function addColor(treeDataArr, green, lightGreen, yellow, orange) {\n const totalTime = treeDataArr[0].renderTime;\n const workToBeDone = [treeDataArr[0]];\n while (workToBeDone.length > 0) {\n const percentTime = workToBeDone[0].individualTime / totalTime;\n if (percentTime < green) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#80b74c' } };\n } else if (percentTime < lightGreen) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#a1c94f' } };\n } else if (percentTime < yellow) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e6cc38' } };\n } else if (percentTime < orange) {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#f69d27' } };\n } else {\n workToBeDone[0].nodeSvgShape = { shape: 'ellipse', shapeProps: { rx: 20, ry: 20, fill: '#e74e2c' } };\n }\n for (let i = 0; i < workToBeDone[0].children.length; i += 1) {\n workToBeDone.push(workToBeDone[0].children[i]);\n }\n workToBeDone.shift();\n }\n return treeDataArr;\n }", "colorSeccion(x, y, wd, ht, color){ //Pintamos los pixeles, de una seccion.\n for (let j = 0; j < ht; j++){ //Recorremos la seccion de anchura x altura.\n for (let i = 0; i < wd; i++){\n let place = ((x+i) + (y+j)*this.imgWidth)*4; //Posicion del pixel en el arreglo data.\n if (i + x < this.imgWidth && j + y < this.imgHeight) { //Verificamos fronteras.\n this.data[place] = color[0];\n this.data[place+1] = color[1];\n this.data[place+2] = color[2];\n }\n }\n }\n }", "_mapDataToColors() {\n // switch rendering destination to our framebuffer\n twgl.bindFramebufferInfo(this._gl, this._framebuffers.gridded);\n\n glDraw(this._gl, this._programs.colormap, this._buffers.colormap, {\n u_data: this._textures.data,\n u_colormap: this._textures.colormap,\n u_colormapN: this._colormap.lut.length,\n u_domain: this._domain,\n u_scale: this._scale === 'log' ? 1 : 0,\n u_baseColor: this._baseColor.map((v, i) => i === 3 ? v : v / 255),\n });\n\n // switch rendering destination back to canvas\n twgl.bindFramebufferInfo(this._gl, null);\n }", "function refreshHardColors(){\n\t colors = createHardColors(squares.length , range);\n\t\treset();\n}", "function newRound(numToAppend) {\n $('#tiles').empty();\n let colorArr = [];\n for (let i = 0; i < numToAppend; i++) {\n colorArr.push(randomRGB());\n let colorTile = $(\n `<div class = 'colorTile' data-color='${colorArr[i]}' style='background: ${colorArr[i]}'</div>`\n );\n $('#tiles').append(colorTile);\n }\n winner = getWinningColor(colorArr);\n $('#clue').text(winner);\n console.log(colorArr);\n}", "function add(color1) {\n\t var result = color1.slice();\n\n\t for (var _len2 = arguments.length, colors = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n\t colors[_key2 - 1] = arguments[_key2];\n\t }\n\n\t for (var i = 0; i < 3; i++) {\n\t for (var j = 0; j < colors.length; j++) {\n\t result[i] += colors[j][i];\n\t }\n\t }\n\n\t return result;\n\t }", "function replace_color() {\n const new_body = parseInt(nes_vals[0], 16)\n const new_feet = parseInt(nes_vals[1], 16)\n const new_border = parseInt(nes_vals[2], 16)\n\n for (var i = 0; i < color_locations.length; i++) {\n var colorAddress = color_locations[i]\n // Palette data is encoded as Body-Feet-Border indices\n rom[colorAddress] = new_body\n rom[colorAddress + 1] = new_feet\n rom[colorAddress + 2] = new_border\n }\n}", "function generateColor () {\n // GENERATE RANDOM RGB VALUES\n generateRandomColorValues();\n\n // USE THESE COLORS TO UPDATE APP\n setColors();\n\n // ADD NEW COLOR TO THE ARRAY\n updateColorArray();\n}", "function newColors() {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = randomColor();\n }\n}", "function setAllTractColors(data) {\n\t\t//\tconsole.log(\"setAllTractColors()\",data);\n\n\n\t\t// update the color scale for the map\n\n\t}", "function start()\n{\n _map = {}, _tiles = [];\n for (var i = 0; i < 10; i++) {\n for (var j = 0; j < 10; j++) {\n\n\n\n var x =_map[0 + ':' + 0];\n console.log(_tiles[j]);\n // console.log(_map);\n new Tile((Math.floor(Math.random() * colors.length))).insert(i, j);\n\n\n }\n }\n }", "function populateEntryTile(entryNode,nodeArray){\n for (var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].id == entryNode){\n nodeArray[i].distance = 0;\n nodeArray[i].visited = true;\n nodeArray[i].backgroundcolor = nodeArray[i].backgroundcolor[nodeArray[i].distance];\n document.getElementById(entryNode).style.backgroundColor = nodeArray[i].backgroundcolor;\n }\n }\n return nodeArray; \n}", "function ColorList() {}", "function arrayToColors() {\n\tfor (var i = 0; i < circles.length; i++) {\n\t\tcircles[i].style.backgroundColor = arrayOfColors[i];\n\t}\n}", "function colorMap(fraction,rgbarray){\n\n if (fraction<0.33) { rgbarray[0] = 0.0; }\n else if (fraction>0.67) { rgbarray[0] = 255.0; }\n else { rgbarray[0] = interpolate(fraction,0.33,0.67,0.0,255.0); }\n \n if (fraction<0.33) { rgbarray[1] = interpolate(fraction,0.0,0.33,0.0,255.0); }\n else if (fraction>0.67) { rgbarray[1] = interpolate(fraction,0.67,1.0,255.0,0.0); }\n else { rgbarray[1] = 255.0; }\n \n if (fraction<0.33) { rgbarray[2] = 255.0; }\n else if (fraction>0.67) { rgbarray[2] = 0.0; }\n else { rgbarray[2] = interpolate(fraction,0.33,0.67,255.0,0.0); }\n\n}", "addColor(){ \n let duplicate = false;\n if (this.state.colors.length > 0){\n for(let i = 0; i < this.state.colors.length; i ++){\n if (this.formatColor(this.state.color) === this.state.colors[i])\n duplicate = true;\n }\n }\n if (!duplicate){\n this.setState({\n colors: this.state.colors.concat(this.formatColor(this.state.color)) \n });\n toast.success(\"Color added!\", {\n position: toast.POSITION.BOTTOM_CENTER,\n autoClose: 1500,\n hideProgressBar: true,\n className: \"toastr-success\"\n });\n } \n }", "function createColorArray (int) {\n\tCOLORS = [];\n\tlet xCOLORS = [];\n\tif (int === 10) {\n\t\tCOLORS = [ 'red', 'red', 'blue', 'blue', 'limegreen', 'limegreen', 'yellow', 'yellow', 'purple', 'purple' ];\n\t}\n\tif (int === 20) {\n\t\tCOLORS = [\n\t\t\t'red',\n\t\t\t'red',\n\t\t\t'blue',\n\t\t\t'blue',\n\t\t\t'limegreen',\n\t\t\t'limegreen',\n\t\t\t'yellow',\n\t\t\t'yellow',\n\t\t\t'purple',\n\t\t\t'purple',\n\t\t\t'orange',\n\t\t\t'orange',\n\t\t\t'aquamarine',\n\t\t\t'aquamarine',\n\t\t\t'black',\n\t\t\t'black',\n\t\t\t'white',\n\t\t\t'white',\n\t\t\t'gray',\n\t\t\t'gray'\n\t\t];\n\t}\n\tif (int === 30) {\n\t\tCOLORS = [\n\t\t\t'red',\n\t\t\t'red',\n\t\t\t'blue',\n\t\t\t'blue',\n\t\t\t'limegreen',\n\t\t\t'limegreen',\n\t\t\t'yellow',\n\t\t\t'yellow',\n\t\t\t'purple',\n\t\t\t'purple',\n\t\t\t'orange',\n\t\t\t'orange',\n\t\t\t'aquamarine',\n\t\t\t'aquamarine',\n\t\t\t'black',\n\t\t\t'black',\n\t\t\t'white',\n\t\t\t'white',\n\t\t\t'gray',\n\t\t\t'gray',\n\t\t\t'rgb(170, 139, 255)',\n\t\t\t'rgb(170, 139, 255)',\n\t\t\t'hotpink',\n\t\t\t'hotpink',\n\t\t\t'rgb(119, 74, 20)',\n\t\t\t'rgb(119, 74, 20)',\n\t\t\t'lightblue',\n\t\t\t'lightblue',\n\t\t\t'darkgreen',\n\t\t\t'darkgreen'\n\t\t];\n\t}\n\treturn COLORS;\n}", "addColorToObject(){\n let color = new Color(this.colorID)\n this.colors[this.colorID] = color\n this.colorID++\n }", "createColorsArray() {\n const _hexadecimals = '0,1,2,3,4,5,6,7,8,9,a,b,c,d,e,f';\n const hexadecimals = _hexadecimals.split(',');\n const colorsArray = [];\n\n // mesaure time needed to create an array\n const startTime = performance.now();\n\n while (colorsArray.length < this.pairs) {\n let hexColor = '';\n\n for (let j = 0; j < 6; j++) {\n const randomIndex = Math.floor(Math.random() * hexadecimals.length);\n hexColor += hexadecimals[randomIndex];\n }\n\n hexColor = `#${hexColor}`;\n\n // if that color does not exist yet, push it to the array\n // else iterate again\n if (colorsArray.indexOf(hexColor) === -1)\n colorsArray.push(hexColor);\n }\n\n const endTime = performance.now();\n const creationTime = endTime - startTime;\n\n // double array to make every color have a pair\n const pairedColorsArray = colorsArray.concat(colorsArray);\n\n // function returns object maybe for future purposes\n return {\n pairedColors: pairedColorsArray,\n colors: colorsArray,\n time: creationTime,\n };\n }", "function mkColorArray(num, color) {\n // Color array for #222c3c: Use #db7f67 (coolors red in the palette)\n // Alternatively a little bit darker c8745e\n let c = d3.hsl(color === undefined ? '#c8745e' : color);\n let r = [];\n for (i = 0; i < num; i++) {\n r.push(c + \"\");\n c.h += (360 / num);\n }\n return r;\n}", "function pushColor() {\n\t const rgb = getRGB();\n\t changeRGB(rgb, [10, 10, 10]);\n\t applyTargetColor(rgb);\n\t}", "function setPixelColor(pixels, index, color) {\n\tpixels[index+0]=pixelProcess(color.r);\n\tpixels[index+1]=pixelProcess(color.g);\n\tpixels[index+2]=pixelProcess(color.b);\n\tpixels[index+3]=255; // alpha channel is always 255*/\n}", "function createColor(number) {\n var colors = [];\n\n for (var i = 0; i < number; i++) {\n /*\n ==================================================\n 1. Declare three variables with name r, g, b\n 2. Each initialize to a random value from 0 to 255 with the function getRandom()\n ==================================================\n */\n\n\n\n\n /*\n ==================================================\n Concatenate and append (push) the new color into array colors\n ==================================================\n */\n\n }\n\n return colors;\n}", "setTileColor(x, y, color) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height) \n this.getTile(x, y).color = color;\n }", "setTileColor(x, y, color) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height) \n this.getTile(x, y).color = color;\n }", "function addToGamePattern() {\n //generates a number in the range [0,3]\n var randNum = Math.round((Math.random() * 3) );\n gamePattern.push( colors[randNum] );\n return colors[randNum];\n}", "function setUpRed() {\n for(j = 0 ; j < 3; j += 1){\n if( j === 1){\n for(i = 1; i < 8; i += 2){\n checkerboard[j][i] = 'R';\n }\n } else {\n for(i =0 ; i < 8; i += 2){\n checkerboard[j][i] ='R';\n }\n }\n }\n}", "function add_(color1) {\n\t for (var _len3 = arguments.length, colors = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {\n\t colors[_key3 - 1] = arguments[_key3];\n\t }\n\n\t for (var i = 0; i < 3; i++) {\n\t for (var j = 0; j < colors.length; j++) {\n\t color1[i] += colors[j][i];\n\t }\n\t }\n\n\t return color1;\n\t }", "addColors(canvas, mainColor) {\n canvas.requestRenderAll();\n localStorage.setItem('canvas', JSON.stringify(canvas))\n }", "function assignColors() {\r\n\t// assign the right color\r\n\trightColor = colors[Math.floor(Math.random()*mode)];\r\n\t// display it\r\n\tcolorDisplay.textContent = rightColor;\r\n\r\n\t// loop through colors array and assign rgb to squares\r\n\tfor(var i = 0; i < colors.length; i++){\r\n\t\tsquares[i].style.backgroundColor = colors[i];\r\n\t} \r\n}", "function changeEveryColorToRed(colors) {\n}", "function setColors(gl) {\n\n var int8Arr = initializeColorGrid(4, 3);\n gl.bufferData(gl.ARRAY_BUFFER, int8Arr, gl.STATIC_DRAW);\n\n}", "function catColors(array, color){\n //your code here!\n}", "function assignNodeProperties(allTiles,nodeArray){\n var myNode = {};\n var backgroundcolor = {\n '0': 'green', '1': '#1e12bc'\n };\n \n for(i=0; i<allTiles.length; i++){\n myNode = new Node(i,backgroundcolor,0,false,false,-1);\n nodeArray.push(myNode);\n };\nreturn nodeArray;\n}", "function checkColors() {\n for (let i = 0; i < wireAmount; i++) {\n for (let ii = 0; ii < colorArray.length; ii++) {\n if (wireArray[i].style.stroke == colorArray[ii].color) {\n colorArray[ii].amount = colorArray[ii].amount + 1;\n }\n }\n }\n }", "calculateColors() {\n // find node with the maximum stress\n let max_stress = 0;\n for (let i = 0; i < this.n * this.m; ++i) {\n if (this.stress[i] > max_stress) max_stress = this.stress[i];\n }\n\n // normilize coefficient\n let coeff = 1 / max_stress;\n\n let color_row_delta = 3 * this.m;\n let color_column_delta = 3;\n\n // iterate over colours array and set colour between blue and red based on stress value\n for (let i = 0; i < this.n; ++i) {\n for (let j = 0; j < this.m; ++j) {\n this.color[i * color_row_delta + j * color_column_delta] = this.stress[i * this.m + j] * coeff;\n this.color[i * color_row_delta + j * color_column_delta + 1] = 0;\n this.color[i * color_row_delta + j * color_column_delta + 2] = 1 - this.stress[i * this.m + j] * coeff;\n }\n }\n }", "function makeColors() {\n colors.push([\"rgb(205,230,245)\",\"rgb(141,167,190)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(72,67,73)\"])\n colors.push([\"rgb(24,169,153)\",\"rgb(242,244,243)\"])\n colors.push([\"rgb(237,242,244)\",\"rgb(43,45,66)\"])\n colors.push([\"rgb(192,248,209)\",\"rgb(189,207,181)\"])\n colors.push([\"rgb(141,177,171)\",\"rgb(88,119,146)\"])\n colors.push([\"rgb(80,81,104)\",\"rgb(179,192,164)\"])\n colors.push([\"rgb(34,34,34)\",\"rgb(99,159,171)\"])\n}", "function colorify (arrayColor, array){\n let iconsCopy = [];\n for (const obj of array) {\n switch (obj.type) {\n case \"animal\":\n iconsCopy.push({ ...obj, color: arrayColor[0] });\n break;\n case \"vegetable\":\n iconsCopy.push({ ...obj, color: arrayColor[1] });\n break;\n case \"user\":\n iconsCopy.push({ ...obj, color: arrayColor[2] });\n break;\n }\n }\n return iconsCopy;\n }", "randomizeColors(){\n for (const [key, color] of Object.entries(this.colors)) {\n color.newColor()\n }\n this.updateGradientString()\n }", "addColorToGradient(){\n this.colorCount++\n this.addColorToObject()\n this.updateGradientString()\n }", "function add() {\n arr.push(color[Math.floor(Math.random() * 4)]);\n arr.push(\" \");\n }", "function changeColors(color) {\n for (let i = 0; i < colors.length; i++) {\n squares[i].style.backgroundColor = color\n }\n}", "sortColors(){\n let pixCount = this.pattern.width == 32 ? 1024 : 4096;\n let indexMap = [];\n let colorMap = [];\n //Check pixel counts\n for (let i = 0; i < 15; ++i){\n colorMap.push({color: this.getPalette(i), count: this.countPixelsWithColor(i), prev:i});\n }\n //Sort by pixel count\n colorMap.sort((a,b)=>(b.count-a.count));\n //Create mapping, update palette colors\n for (let i = 0; i < 15; ++i){\n indexMap[colorMap[i].prev] = i;\n this.setPalette(i, colorMap[i].color);\n }\n //Change pixels to their respective indexes\n for (let i = 0; i < pixCount; ++i){\n const c = this.pixels[i];\n if (c >= 15){continue;}\n this.pixels[i] = indexMap[c];\n }\n }", "function changeColor(tmp_stage,tmp_arr){\n tmp_arr.forEach(function (item) {\n tmp_stage.find(\"#\" + item[0]).fill(DICT_COLORS[item[1]]);\n tmp_stage.find(\"#main_l\").draw();\n });\n}", "createColors(color, num) {\n //receive hex color from parent, return array of colors for gradient\n //num is # of generated color in return array\n let a = []\n let red = parseInt( color.substring(1, 3), 16)\n let green = parseInt(color.substring(3, 5), 16)\n let blue = parseInt(color.substring(5,7), 16)\n \n let k = 0.8 \n //from lighter colder to darker warmer\n // console.log(red, green, blue)\n for (i=0;i<num;i++) {\n let new_red = (Math.floor(red*k)).toString(16)\n let new_green = (Math.floor(green*k)).toString(16)\n let new_blue = (Math.floor(blue*k)).toString(16)\n let new_color = '#'+new_red+new_green+new_blue\n k += 0.1\n a.push(new_color)\n }\n return a\n\n }", "function createArray() {\n\tvar temp = [];\n\n\tfor (var i = 1; i <= circles.length; i++) {\n\t\ttemp.push(addColors());\n\t}\n\treturn temp;\n}", "function updateColors() {\n\tfor (var i=0; i<allTissues.length; i++){\n\t\tchangeFillColor(allTissues[i].tissue, allTissues[i].color);\n\t\t//console.log(allTissues[i].tissue+\" \"+allTissues[i].value+\" \"+allTissues[i].color);\n\t}\n\tif(searchByTable){\n\t\tgenerateSelectionTable();\n\t}\n}", "function populateNodesNextToEntry(nodeArray){\n for (var i=0; i<nodeArray.length; i++){\n if (nodeArray[i].visited == true){ \n if (nodeArray[i].distance == 1){ \n //IN TESTING\n nodeArray[i].backgroundcolor = nodeArray[i].backgroundcolor[nodeArray[i].distance];\n //nodeArray[i].backgroundcolor = Maze.getBackgroundColor(nodeArray[i].distance);\n document.getElementById(nodeArray[i].id).style.backgroundColor = nodeArray[i].backgroundcolor;\n }\n }\n }\n return nodeArray; \n}", "function changeSquareColors(colors){\n\tfor(var i = 0; i < squares.length; i++){\n\t\tsquares[i].style.background = colors[i];\n\t}\n}", "function reddify(array){\n array[RED] = 225; //makes the entire picture really red\n }", "function changeColors(x) {\n for (var i = colors.length - 1; i >= 0; i--) {\n squares[i].style.backgroundColor = x;\n }\n}", "function changeColors(color){\n for (var i = 0; i<colors.length; i++){\n squares[i].style.backgroundColor = color;\n }\n}", "function changeColors(color){\n\tfor(i = 0; i < 6; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function updateColors(index, color) {\n var colors = getColors();\n\n colors[index] = color;\n chartInstance.update({\n colors: colors\n });\n }", "generateColors(itemCount) {\r\n let colors = [];\r\n let number = Math.round(360 / itemCount);\r\n //this loop splits the colour spectrum evenly and gives each\r\n //div a colour so that when in order, they resemble the colour spectrum\r\n for (let i = 0; i < itemCount; i++) {\r\n let color = chroma(\"#ff0000\");\r\n colors.push(color.set(\"hsl.h\", i * number));\r\n }\r\n return colors;\r\n }", "setTileGradient(x, y, ...colors) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height)\n this.getTile(x, y).gradient = colors;\n }", "setTileGradient(x, y, ...colors) {\n // bounds checking\n if (x >= 0 && x < this._width && y >= 0 && y < this._height)\n this.getTile(x, y).gradient = colors;\n }", "function addColor(color1, color2){\n // Split string and parse to Integers.\n let rgb1Array = color1.split(\",\").map((value) => parseInt(value, 10) );\n let rgb2Array = color2.split(\",\").map((value) => parseInt(value, 10) );\n\n // Init array to store results\n let newColorArray = [];\n\n //Loop Through RGB, check if numbers are higher than 255, add together values r+r, g+g ,b+b\n for(let i = 0; i <= 2 ;i++ ){\n if(rgb1Array[i] <= 255 && rgb2Array <= 255 || (rgb1Array[i] + rgb2Array[i]) - 45 <= 255){\n // last number is value of dim light.\n newColorArray[i] = rgb1Array[i] + rgb2Array[i] - 45;\n }else{\n newColorArray[i] = 255;\n }\n }\n // Convert values back to String values.\n newColorArray = newColorArray.map((value) => value.toString());\n\n // Join array of Strings back to one String value.\n globalState.color = newColorArray.join();\n}", "function pickColor() {\n if (colorArray.length > 1) {\n var oldColorIndex = colorArray.indexOf(document.getElementById(\"center-tile\").style.backgroundColor);\n if (freshStart == true) {\n oldColorIndex = -1;\n }\n if (oldColorIndex > -1) {\n var oldColor = colorArray[oldColorIndex];\n colorArray.splice(oldColorIndex, 1);\n }\n var colorToReturn = colorArray[Math.floor(Math.random() * colorArray.length)];\n if (oldColorIndex > -1) {\n colorArray.push(oldColor);\n }\n return colorToReturn;\n } else {\n return colorArray[Math.floor(Math.random() * colorArray.length)];\n }\n }", "function deepCopyColor(){\r\n for(let i=0;i<FILL_STYLES.length;i++){\r\n leftColor.push(FILL_STYLES[i]);\r\n }\r\n}", "function setColor (arr); {\n\n}// CODE HERE", "function changeColors(color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.background = color;\n\t}\n}", "function changeColors(color) {\n for (var i = 0; i < squares.length; i++) {\n squares[i].style.backgroundColor = color;\n }\n}", "function setColors(rgbList, totalColors) {\n var color = \"\";\n for (let i = 0; i < totalColors; i++) {\n var curr = rgbList[i];\n color = \"rgb(\" + curr[0] + \", \" + curr[1] + \", \" + curr[2] + \")\";\n labelList[i].style.background = color;\n }\n if (totalColors == 3) {\n for (let i = 3; i < 6; i++) {\n labelList[i].classList.add(\".hidden\");\n }\n }\n}", "function addToAllChannels(rgb, value) {\n var r = rgb[0] + value;\n var g = rgb[1] + value;\n var b = rgb[2] + value;\n\n if (r > 255) { r = 255; }\n if (g > 255) { g = 255; }\n if (b > 255) { b = 255; }\n if (r < 0) { r = 0; }\n if (g < 0) { g = 0; }\n if (b < 0) { b = 0; }\n\n return [r, g, b];\n}", "function changeColors ( color ) {\n // loop through all colors.\n // change each color to match given color. \n\n for ( var i=0 ; i < colors.length ; i++ ) {\n squares[i].style.background = color ; \n }\n\n}", "function sumColors() {\n console.log(\"original color: \", this.origColor);\n color = [...Array(3).keys()].map(function(n) {\n return palindromeModulus(this.origColor[n]+this.userColor[n]);\n });\n console.log('new color; ', color);\n return color;\n}", "function changeColors(color){\n\tfor(var i = 0; i < squares.length ; i++){\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}", "function setColours() {\r\n\tfor(var i = 0; i < colours.length; i++) {\r\n\t\tsquares[i].style.backgroundColor = colours[i]\r\n\t}\r\n}", "function createColorArray() {\n\tcardColorArray = [];\n\tcolorMapObject = {};\n\n\tlet count = 0;\n\tfor (let card = 0; card < inputCardNumber; card += 2) {\n\t\tcount++;\n\t\tcardColorArray.push('cardtype' + count);\n\t\tcardColorArray.push('cardtype' + count);\n\t\t// selectRandomColor();\n\t\tcolorMapObject['cardtype' + count] = selectRandomColor();\n\t}\n}", "function generateColor(red, green, blue)\n{\n paintColor[0] = red;\n paintColor[1] = green;\n paintColor[2] = blue;\n}", "function buildColorArray(colorScale, data, header) {\n var colorArray = [];\n for(var key in data) {\n\n var tempFloat = parseFloat(data[key]);\n var colorScaled = colorScale(tempFloat);\n\n tempColor = d3.color(colorScaled);\n\n // We want a 0 to 1 scale for the colors.\n red = tempColor.r / 256;\n green = tempColor.g / 256;\n blue = tempColor.b / 256;\n\n colorArray[key] = [red, green, blue];\n }\n return colorArray;\n }", "function updateColors () {\n // ADJUST COLOR VARIABLES FOR COLOR VALUE\n r = redSlider.value;\n g = greenSlider.value;\n b = blueSlider.value;\n\n // UPDATE ALL COLORS WITH NEW VALUES\n setColors(r, g, b);\n}", "function colorChange (color) {\n\tfor (var i = 0; i < squares.length; i++) {\n\t\tsquares[i].style.backgroundColor = color;\n\t}\n}" ]
[ "0.6962366", "0.6930402", "0.6530913", "0.6521381", "0.64124763", "0.6340911", "0.63011795", "0.62997216", "0.62706476", "0.62381256", "0.62065375", "0.61399883", "0.6120787", "0.6118701", "0.6065621", "0.6060733", "0.6052911", "0.60239565", "0.6018926", "0.60079074", "0.60069335", "0.5981091", "0.59788555", "0.5968954", "0.59575444", "0.5952176", "0.5926481", "0.592337", "0.5921406", "0.59157676", "0.5915302", "0.5913403", "0.5874909", "0.5871345", "0.5870678", "0.5859845", "0.58524835", "0.58471584", "0.5840864", "0.583569", "0.58201665", "0.5801738", "0.5795718", "0.5791073", "0.57865065", "0.5784713", "0.5780394", "0.5760094", "0.57575375", "0.5757011", "0.5757011", "0.57549095", "0.57511556", "0.5746883", "0.5741769", "0.5737695", "0.57375884", "0.5724992", "0.5722354", "0.57198966", "0.57178426", "0.57131267", "0.5710385", "0.57032555", "0.5702726", "0.56932396", "0.569237", "0.5691872", "0.5686559", "0.5676325", "0.56728435", "0.5670465", "0.5663466", "0.56626207", "0.5660325", "0.5660303", "0.565752", "0.5650352", "0.5642933", "0.56421024", "0.5639879", "0.5629051", "0.5629051", "0.56248844", "0.56223905", "0.56215674", "0.562062", "0.5620194", "0.5617588", "0.5611781", "0.5602787", "0.55953616", "0.5595187", "0.5594847", "0.5589821", "0.5586491", "0.5584018", "0.55836743", "0.5578994", "0.5575902" ]
0.5692077
67
get button value and send it to be processed
function getBtnValue(e) { var entry = e.currentTarget.value; processInput(entry); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleButton(data) {\r\n console.log('Button: ', data);\r\n buttonValue = Number(data);\r\n}", "btnClick() {\n\t\tthis.socket.emit(\"btn state\", this.props.btnValue);\n\t}", "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "function handleBtn() {\r\n let inputValue = inputElement.value;\r\n getDataFromApi(inputValue);\r\n}", "function callWxBtn() {\n let btnValue = ($(this).data('name'))\n callWxData(btnValue)\n }", "function valButton(btn) {\n\t\t\tvar cnt = -1;\n\t\t\tfor (var i=btn.length-1; i > -1; i--) {\n\t\t\t\tif (btn[i].checked) {cnt = i; i = -1;}\n\t\t\t}\n\t\t\tif (cnt > -1) return btn[cnt].value;\n\t\t\telse return null;\n\t\t}", "function onButtonClick() {\n\tmessageEl.innerHTML = '';\n\n\tconst printValues = function(){\n\t\tbuttonEls.forEach(function(buttonEl){\n\t\t\tmessageEl.innerHTML = buttonEl.value + \" from button # \"\n\t\t\t\n\t\t});\n\t}\n\treturn printValues(); \n}", "function rawSubmitKomodo(thisbtn) {\n\n}", "function processButton(param) {\n switch (param.element) {\n case \"조회\":\n processRetrieve({});\n break;\n case \"닫기\":\n processClose({});\n break;\n case \"실행\":\n processRetrieve({});\n break;\n }\n }", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "function buttonHandler(){\n if (expression === 0 || expression === \"0\" || done){\n expression = \"\";\n done = false;\n }\n // get value of clicked button\n var char = $(this).attr(\"value\");\n // add value to expression\n expression += String(char);\n if (expression == \".\"){\n expression = \"0.\";\n }\n drawResult();\n}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "function handleClick(e) {\n let dataButton = e.target.getAttribute(\"data-button\");\n displayValue(dataButton);\n}", "function getValue() {\n var buttonValue = $(this).data('value');\n\n if (MathForm.type === '') {\n if (MathForm.x === '') {\n MathForm.x = MathForm.x + buttonValue.toString();\n $('#x').val(MathForm.x);\n } else {\n var xVal = $('input[id=x]').val();\n MathForm.x = xVal;\n MathForm.x = MathForm.x + buttonValue.toString();\n $('#x').val(MathForm.x);\n }\n } else {\n var yVal = $('input[id=y]').val();\n MathForm.y = yVal;\n MathForm.y = MathForm.y + buttonValue.toString();\n $('#y').val(MathForm.y);\n }\n}", "function submitFunction() {\n var cartoon = $('<button type=\"button\" class=\"border-white btnClass btn btn-dark p-2 mt-1 mr-1 ml-1 float-left\">').text(input.val());\n cartoon.attr('data-name', input.val());\n btnHolder.append(cartoon);\n input.val(\" \");\n }", "function processButton(param) {\n\n if (param.object == \"lyrMenu\") {\n switch (param.element) {\n case \"저장\":\n if(v_global.logic.pstat == \"대여\")\n processRetrieve({ chk: true });\n else\n processSave({});\n break;\n case \"닫기\":\n processClose();\n break;\n }\n }\n\n}", "function clickButton()\n {\n // Update requested value\n var btn = this ;\n var setval = \"\" ;\n if ( btn.toggle )\n {\n switch (btn.request)\n {\n case \"Off\": btn.request = \"On\" ; setval = \"F\" ; break ;\n case \"On\": btn.request = \"Off\" ; setval = \"N\" ; break ;\n }\n }\n logDebug(\"clickButton: \", btn, \n \", target: \", btn.target, \", request: \", btn.request) ;\n // Now proceed to set requested value\n if ( btn.target != null )\n {\n // Send update command, refresh selector state when done\n setButtonState(btn, \"Pending\") ;\n var def = doTimedXMLHttpRequest(btn.target+setval, 4.9) ;\n def.addBoth(pollNow) ;\n }\n else\n {\n logError(\"clickButton (no target)\") ;\n }\n return false ; // Suppresss any default onClick action\n }", "function sendData() {\n\t\t$.ajax({\n\t\t\ttype: 'POST',\n\t\t\turl: 'scripts/save.php',\n\t\t\tdata: {\n\t\t\t\t'tellSeverTheButtonValue': whatButtonWasPressed\n\t\t\t},\n\t\t\tsuccess: function() {\n\t\t\t\twindow.console.log(\"success\");\n\t\t\t}\n\t\t});\n\t}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"취소\":\n {\n closeOption({});\n }\n break;\n }\n\n }", "function processButtonClick() {\n let buttonValue = this.innerText\n // check if decimal is being used AND is enabled\n if (buttonValue === \".\" && !decimalEnabled) {\n console.log('cannot use decimal again');\n return;\n }\n // check which variable we are working on AND\n // concatenate calculator data to correct variable\n if (isFirstNumSet) {;\n num2 += buttonValue;\n }\n else {\n num1 += buttonValue;\n }\n // display data on the DOM calculator display\n updateCalculatorDisplay();\n}", "handleButton() {}", "function updatingButtonLabel(self, val){\n self.val(val);\n self.callback(val);\n }", "get button () {return this._p.button;}", "function set_processing_cmd(thisForm, thisButton, cmdValue) {\n var processing_string = \"Processing...\" ;\n if (thisButton.value == processing_string)\n {\n alert(\"Processing...\") ;\n return false;\n }\n thisButton.value = processing_string ;\n if (cmdValue != null && cmdValue != '') \n thisForm.cmd.value = cmdValue;\n thisForm.submit();\n setAllInputStatus(thisForm,true,'');\n}", "get btnSubmit () { return $('#submit-button') }", "function buttonClick(clicked_id){\n\n if (clicked_id == \"1\"){\n $.get('/post', {command: '/relay', core: 'core', params: '1'});\n } \n\n if (clicked_id == \"2\"){\n $.get('/post', {command: '/relay', core: 'core', params: '0'});\n } \n\n}", "function getButtonDetails(e) {\n let eventId, splitId, type, id;\n eventId = e.target.id;\n if (eventId) {\n splitId = eventId.split('-');\n type = splitId[0];\n id = parseInt(splitId[1]);\n buttonAction(type, id);\n }\n}", "function buttonText(){\n return document.getElementById(\"go-button\").innerText;\n}", "function send_button_state(hex_state) {\n $.ajax({\n url: \"webpower/set/\" + hex_state,\n success: function() {\n console.log(\"sent: \" + hex_state)\n },\n });\n }", "updateButtonValue() {\n const shadow = this.shadowRoot;\n const buttonInput = shadow.querySelector(\"button\");\n\n // Set native type of button\n buttonInput.setAttribute(\"type\", this.getAttribute(\"native-type\") ? this.getAttribute(\"native-type\"): \"button\");\n if (this.hasAttribute(\"autofocus\")) {\n buttonInput.setAttribute(\"autofocus\", \"\");\n }\n\n // Update button color, size and shape\n this.updateButtonColor();\n this.updateButtonShape();\n this.updateButtonSize();\n this.updateDisabled();\n }", "function display(btn){\n return result.value+= event.target.value;\n}", "function changeValue(button) {\n button.innerText = conversion[button.innerText] || \"0\";\n }", "function processBtn (event) {\n\n // event.target gives you the button that was clicked\n // <button data-type=\"num\">7</button>\n var button = event.target;\n\n // gives you the data type of each button element\n var type = button.dataset.type;\n\n // if statements direct each type of button to execute a specific function\n if (type === 'num') return processNum(button);\n if (type === 'opp') return processOpp(button);\n if (type === 'negative') return processNegative(button);\n if (type === 'equal') return processEqual(button);\n if (type === 'clear') return processClear(button);\n}", "function buttonPressed(text) {\n console.log(text);\n setResultText(resultText + text);\n if (text === '=') {\n setResultText('');\n calculationText();\n }\n }", "function buttonInputClickHandler(eventArg) {\n var display = document.getElementById(\"display\");\n display.value = display.value + eventArg.target.value;\n }", "buttonHandler(){\n\t\tvar items = this.props.hey.questions.present;\n\t\tlet conditions = this.props.hey.conditions.present;\n\t\tlet counter = this.props.hey.counter.present;\n\t\tconst action = this.props.action;\n\t\tconst increment = this.props.increment;\n\t\tconst hide = this.props.hideState;\n\t\tsendButtonHandler(items,conditions,counter,action,increment,hide);\n\t}", "function buttonClick(value) {\n if (isNaN(parseInt(value))) {\n handleSymbol(value);\n } else {\n handleNumber(value);\n }\n reRender();\n}", "static get BUTTON_X() {\n return \"x\";\n }", "static get BUTTON_B() {\n return \"b\";\n }", "bindSubmitPressureFlow(handler) {\n this.setButton.addEventListener('click', e => {\n const flow = parseInt(U.getElement('#flow-rate').value, 10)\n const pressure = U.getElement('#pressure').value\n e.preventDefault()\n handler(pressure, flow)\n })\n }", "function breadChoice(){\n button.setAttribute(\"data-item-custom1-value\", bread.value);\n}", "function sendSize(size,productId){\n size = size\n productId = productId\n var button = document.getElementById(\"button-1\")\n button.value = size\n button.setAttribute(\"productid\",productId)\n console.log(button)\n}", "function btnPress() {\n if (result > 0) {\n clear();\n }\n currentVal += this.value;\n updateDisplay();\n}", "function getDisplayValue () {\n //document.getElementById('display').innerText = \"\"\n //document.getElementById('display').innerText = display\n document.querySelectorAll('.buttons').forEach(button => {button.onclick = function () { \n // continue to add numbers to the display screen \n document.getElementById('display').innerText += button.value;\n // adds display screen string to display variable, then convert to int\n display = parseInt(document.getElementById('display').innerText)\n }\n });\n }", "getAnsBtnID(){\n let choise = event.srcElement.id\n this.answer(choise)\n }", "function buttonClickHandler(el) {\n removeLeadingZero(el)\n lastValue = el.value\n\n let basicOperator = evalBasicOperator(el)\n if (calculatePower(el)) {\n\n }\n else if (basicOperator != null) {\n display += basicOperator\n evaluationString += basicOperator\n if(basicOperator == \"-\" || basicOperator ==\"+\"){\n lastDigitClicked += basicOperator\n }\n } else if (!evalComplexOperator(el)) {\n if(!isNaN(el.value)){\n if(!isNaN(lastValue)){\n lastDigitClicked += el.value\n }else{\n lastDigitClicked = el.value\n }\n }\n display += el.value\n evaluationString += el.value\n }\n document.getElementById(\"output\").value = display\n}", "function clickButton(event) {\n\tbar.value = bar.value + event.srcElement.innerHTML;\n}", "butonSubmitRechercher() {\n return cy.get('.Search--button');\n }", "function processVariableEditButtonCallback() { \n \n }", "function buttonClick(){\r\n\r\n var buttonTriggered = this.innerHTML;\r\n clickPress(buttonTriggered);\r\n buttonAnimation(buttonTriggered);\r\n\r\n}", "function processButton(param) {\n\n if (param.object == \"lyrMenu\") {\n switch (param.element) {\n case \"저장\":\n processSave();\n break;\n case \"닫기\":\n processClose();\n break;\n }\n }\n\n}", "function onClickBtnComentar()\n{\n var name=$('#name');\n var content=$('#commit');\n\tpostComentario(currentGameId, name.val(), content.val());\n console.log(name.val());\n \n}", "function NumRecButtons_getValue()\r\n{\r\n var retVal = \"all\";\r\n \r\n if (this.radioObj[0].checked == true)\r\n retVal = this.textFieldObj.value;\r\n \r\n return retVal;\r\n}", "function buttonPublish(evt) {\n var btn = evt.currentTarget;\n btn.blur(); // Allow button to be defocused without clicking elsewhere\n $.publish(btn.id);\n }", "function updateSubmitButtonText(){\n if( EVENT.type === 'free' ){\n $form.find('[type=\"submit\"]').val('Confirm');\n }\n else{\n $form.find('[type=\"submit\"]').val('Pay $' + calcAmount());\n }\n }", "function updateSubmitButtonText(){\n if( EVENT.type === 'free' ){\n $form.find('[type=\"submit\"]').val('Confirm');\n }\n else{\n $form.find('[type=\"submit\"]').val('Pay $' + calcAmount());\n }\n }", "function rawSubmit1x2Coin(thisbtn) {\n\n}", "function volButton(op)\n {\n var volValue = document.getElementById('vol').value;\n\n switch (op) {\n case \"-\":\n volValue-=5;\n break;\n case \"+\":\n volValue = parseInt(volValue, 10)+5;\n break;\n default:\n alert(\"Bad vol() data\");\n }\n\n if (volValue < 10){\n connection.send('Vol'+' '+'MV0'+volValue);\n }\n else{\n connection.send('Vol'+' '+'MV'+volValue)\n }\n document.getElementById('sliderVal').innerHTML = volValue;\n document.getElementById('vol').value=volValue;\n}", "render(){\n return(\n <input className=\"calc-btn\" type=\"button\" value={this.props.label} onClick={this.clickHandler}/>\n )\n }", "handleRB(evt) {\n this.setState({ selectedButton: evt.target.value });\n }", "function rawSubmitInfiniteRick(thisbtn) {\n\n}", "function markButton(){\n//store value of letter in the selected button \nlet selection = event.target.innerHTML; \n//pass button into games handle interaction function \ngameOne.handleInteraction(selection);\n}", "_buttonClickHandler() { }", "function button(b) {\n var pressed, value;\n if (typeof(b) == \"object\") {\n pressed = b.pressed; value = b.value;\n } else { // Old API\n pressed = (b == 1.0); value = b;\n }\n return {\n _: {},\n pressed: pressed,\n value: round(value)\n };\n }", "function buttonClicked(value) {\n\tif (isNaN(parseInt(value))) {\n\t\thandleOperators(value);\n\t\tclear(value);\n\t} else {\n\t\tnumberManage(value);\n\t}\n\trerender();\n}", "function handleClick()\n\t{\n\t\tvar count = buttons.length,\n\t\t clicked = window.event.srcElement,\n\t\t form = clicked.form;\n\t\t \n\t\t// Disable all the buttons\n\t\tfor (var i = 0; i < count; i++)\n\t\t\tbuttons[i].disabled = true;\n\t\t\t\n\t\t// Set the hidden field to have the details of the clicked button\n\t\tvalueEl.type = 'hidden';\n\t\tvalueEl.name = clicked.name;\n\t\tvalueEl.value = clicked.attributes.getNamedItem('value').nodeValue;\n\t\t// Insert it into the form containing the clicked button\n\t\tform.appendChild(valueEl);\n\t\n\t\tform.submit();\t\n\t\t\n\t\t// Re-enable all the buttons after the form is submitted\n\t\tsetTimeout(function()\n\t\t{\n\t\t\tfor (var i = 0; i < count; i++)\n\t\t\t\tbuttons[i].disabled = false;\n\t\t}, 50);\n\t}", "function onButtonPress(e) {\n\t\tvar $button = $(e.currentTarget),\n\t\t\t action = $button.data(\"action\"), //look for data-action = \"...\" and applies the action in \"...\"\n\t\t\t value = $display.value(); //might be .val but that doesn't highlight blue\n\n\t\tif (value == 0) {\n\t\t\tvalue = action;\n\t\t} else {\n\t\t\tvalue += action;\n\t\t}\n\n\t\tupdateDisplay(value); // ** updateDisplay didn't highlight **\n\n}", "function clickButton(text) {\n let field = document.getElementById(\"res\");\n let fieldText = field.innerHTML;\n switch (text) {\n case '0':\n case '1':\n field.innerHTML += text;\n break;\n case '+':\n case '-':\n case '/':\n case '*':\n if(validOperRE.test(fieldText)) {\n field.innerHTML += text; \n selectedOper = text;\n }\n break;\n case 'С':\n field.innerHTML = \"\";\n break;\n case '=':\n if (validEqualRE.test(fieldText)) {\n calculate(fieldText);\n }\n break;\n default:\n break;\n }\n}", "*pressButtonSelect() {\n yield this.sendEvent({ type: 0x01, code: 0x13a, value: 1 });\n }", "function handle_click() {\n\tcalculation = $(\"#calculation\").val().split(\" \");\n\n\tsend_request(calculation.shift(), calculation.shift(), calculation.shift());\n}", "get btnBuscar () { return $('//input[@value=\"Buscar\"]') }", "get buttonNumber() {\n return this.button + 1;\n }", "function changeButtonVal(rowNum){\n\tif(rowNum == 1){\n\t\tvar myButton1 = document.getElementById(\"myButton1\");\n\t\tif (myButton1.value == 'Trusted'){\n\t\t\tmyButton1.value = 'Rated';\n\t\t\t$(\"button#myButton1\").attr(\"data-original-title\",\"Highly Voted Question\");\n\t\t\tmyButton1.innerHTML = 'Rated';\n\t\t\n\t\t}else {\n\t\t\tmyButton1.value = 'Trusted';\n\t\t\t$(\"button#myButton1\").attr(\"data-original-title\",\"Highly Reputed User\");\n\t\t\tmyButton1.innerHTML = 'Trusted';\n\t\t}\n\tajaxrequestRowWise('phpfiles/processrec.php', 'row1');\n\t} else {\n\t\tvar myButton2 = document.getElementById(\"myButton2\");\n\t\tif (myButton2.value == 'Verbatim'){\n\t\t\tmyButton2.value = 'Popular';\n\t\t\t$(\"button#myButton2\").attr(\"data-original-title\",\"Many Answers\");\n\t\t\tmyButton2.innerHTML = 'Popular';\n\t\t\n\t\t}else {\n\t\t\tmyButton2.value = 'Verbatim';\n\t\t\t$(\"button#myButton2\").attr(\"data-original-title\",\"Maximal String Match\");\n\t\t\tmyButton2.innerHTML = 'Verbatim';\n\t\t}\n\tajaxrequestRowWise('phpfiles/processrec.php', 'row2');\n\t}\n}", "changeInputValue(e){\n e.preventDefault();\n var target = e.target;\n var parent = target.parentNode;\n var input = parent.getElementsByClassName('timer-value')[0];\n if (target.nodeName == 'BUTTON'){\n if (target.classList.contains('value-increase')){\n this.inputValueIncrease(input);\n }\n if (target.classList.contains('value-decrease')){\n this.inputValueDecrease(input);\n }\n }\n this.view.render(this.getOptions());\n }", "function llenarBotonEvaluacion(){\n var retorno='<button type=\"button\" class=\"btn btn-xs btn-default btn-block\"><span class=\"glyphicon glyphicon-pencil\"></span> Evaluación</button>'\n return retorno\n }", "unsignedButtonClicked()\n\t{\n\t\tthis.db.set( 'letterType', 3 );\n\t\treturn this.router.navigateToRoute( 'voting-form' );\n\t}", "function compareBtn3() {\n btnValue = document.getElementById('button-3').innerHTML;\n comparer(btnValue);\n}", "function button_total() {\r\n\t\tvar button_no = document.getElementById(\"btnbadge\").value;\r\n\t\t\r\n\t\tbadgNumber = parseInt(button_no);\r\n\t\t\t\t//alert(\"in button_total - badgNumber \" + badgNumber);\r\n\t\tvar button_text = document.getElementById(\"btn_label\").textContent;\r\n\t\t//alert( \"in button_total button_text is \" + button_text);\r\n\t\t//alert(\"button_text \" + button_text);\r\n\r\n\t\tupdateButtonBasket(badgNumber, button_text);\r\n\t\tsetCookie(\"button_total\", badgNumber,1);\r\n\t\t//updateDisplayMerch();\t\r\n\t\t//alert(\"go to updateButtonBasket\");\r\n\t}", "function handleOnButtonClick(asBtn) {\r\n switch (asBtn) {\r\n case 'SAVE':\r\n saveOutputOption();\r\n break;\r\n }\r\n}", "function onButtonClick(e) {\n var elem = e.target;\n // Here we send a button click event, letting the server know which button was clicked\n socket.emit('button_click', { id: elem.id });\n}", "buttonClick(ev) {\n\n\t\t// Get the button using the index\n\t\tvar btn = this.props.buttons[ev.currentTarget.dataset.index];\n\n\t\t// If there's a callback\n\t\tif(typeof btn.callback == 'function') {\n\t\t\tbtn.callback(btn);\n\t\t} else {\n\t\t\tthis.props.close();\n\t\t}\n\t}", "function radioButtonValue(button) {\n\tfor (var i = 0; i < button.length; i++) {\n\t\tif (button[i].checked) {\n\t\t\treturn button[i].value;\n\t\t}\n\t}\n\treturn \"\";\n}", "processButtonEvent( buttonEvent )\n {\n this.transport.processButtonEvent( buttonEvent );\n }", "function writeOnInput(event){\n\tvar result = document.getElementById('result');\n\tif(event.target.matches('button')){\n\t\tvar x = event.target.textContent\n\t\tresult.value +=x;\n\t}\n}", "function onButton(){\n input();\n output();\n\n}", "click() {\n console.log('the input', this.theInput, this.theInput.value);\n getData(this.theInput.value);\n }", "function enter(val) {\n // this places the \"result\" text bar into a variable\n // named result\n result = window.document.getElementById(\"result\");\n\n // Appends the value of the clicked button to the text\n // in the \"result\" bar (using variable result)\n result.value += val.target.value;\n}", "_handleButtonExport()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOW_EXPORT, {workflow: this.model});\n }", "function onButtonClickEvent(btn){\n var value = btn.dataset.value;\n\n if(value == '='){ // Equals sign\n $('#answer-display').value = calculate.getAnswer();\n }\n else{\n var results = calculate.insert(value);\n\n $('#number-display').value += results.value;\n $('#calc-btn-3-1').disabled = !results.decimalEnabled;\n\n // Set cursor to end\n setCursorToEnd($('#number-display'));\n }\n}", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function submitButtonClicked() {\n var userContribution = $('#animal-blank').val();\n\n if (userContribution) {\n $('#animal-buttons').append(\"<button type='button' onclick='searchGif(\\\"\" + userContribution + \"\\\")' class='btn btn-primary' value=' \" + userContribution + \"'> \" + userContribution + \" </button>\");\n }\n}", "function buttonClick(value) {\n if (isNaN(parseInt(value))) {\n handleSymbol(value);\n } else {\n handleNumber(value);\n }\n rerender();\n}", "function setNiveauParameterXML(select,button,ValueTyp){\r\n\r\n\tvar Value = document.getElementById(select).value;\t\t\r\n\t\r\n\t\tgetData(\"post\",\"NiveauControl.php\",function()\r\n\t\t{\r\n\t\t\tif (xhttp.readyState==4 && xhttp.status==200)\r\n\t\t\t{\r\n\t\t\t\tdocument.getElementById(button).setAttribute(\"class\",\"btn btn-success\");\r\n\t\t\t\tsetTimeout(function(){document.getElementById(button).setAttribute(\"class\",\"btn btn-default\")},500);\r\n\t\t\t}\r\n\t\t},\r\n\t\t\"Value=\"+Value+\r\n\t\t\"&ValueTyp=\"+ValueTyp);\r\n}", "function compareBtn1() {\n btnValue = document.getElementById('button-1').innerHTML;\n comparer(btnValue);\n}", "function getButtonClicked(e) {\n if (e.target.nodeName === \"BUTTON\") {\n categoryName = e.target.getAttribute(\"id\");\n loadQuestionsRandom(categoryName);\n showSection(sectionQuestion);\n setTimeout(() => {\n $(\"#category\").text(categoryName);\n loadQuiz();\n }, 500);\n }\n }", "function buttonClick() {\n\tvar id = event.target.id;\n\tswitch(id) {\n\tcase \"Load\":\n\t\tbtRead.disabled = false;\n\t\tloadParams();\n\tbreak;\n\tcase \"Read\":\n\t\tbtStart.disabled = false;\n\t\treadParams();\n\tbreak;\n\tcase \"Start\":\n\t\tif(btStart.innerHTML == \"Start\") {\n\t\t\tbtLoad.disabled = true;\n\t\t\tbtRead.disabled = true;\n\t\t\tbtInfo.disabled = true;\n\t\t\tbtStart.innerHTML = \"Stop\";\n\t\t\tproc = setInterval(simulate, Tproc);\n\t\t} else {\n\t\t\tbtLoad.disabled = false;\n\t\t\tbtRead.disabled = false;\n\t\t\tbtInfo.disabled = false;\n\t\t\tbtStart.innerHTML = \"Start\";\n\t\t\tclearInterval(proc);\n\t\t}\n\tbreak;\n\tcase \"Info\":\n\t\tvar info = \"\";\n\t\tinfo += \"cppcmf.js\\n\";\n\t\tinfo += \"Charged particle in perpendicular \";\n\t\tinfo += \"constant magnetic field\\n\";\n\t\tinfo += \"Sparisoma Viridi\\n\";\n\t\tinfo += \"https://github.com/dudung/butiran.js\\n\"\n\t\tinfo += \"Load load parameters\\n\";\n\t\tinfo += \"Read read parameters\\n\";\n\t\tinfo += \"Start start simulation\\n\";\n\t\tinfo += \"Info show this messages\\n\";\n\t\tinfo += \"\\n\";\n\t\taddText(info).to(taOut);\n\tbreak;\n\tdefault:\n\t}\n}", "function getButton() {\n\t\tvar button = document.getElementById(\"--nucalendar-download-button\");\n\t\tif (button)\n\t\t\treturn button;\n\n\t\treturn createButton();\n\t}", "getPendingReleaseCount() {\n const element = this.buttons.pendingFileReleaseCount\n I.grabTextFrom(element)\n}", "click(e) {\n\n // type==custom a hack for version_select type\n if (this.type == 'button' || this.type == 'custom') {\n var url = '/api/parameters/' + this.props.p.id + '/event';\n var eventData = {'type': 'click'};\n fetch(url, {\n method: 'post',\n credentials: 'include',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRFToken': csrfToken\n },\n body: JSON.stringify(eventData)\n }).then(response => {\n if (!response.ok) {\n store.dispatch(wfModuleStatusAction(this.props.wf_module_id, 'error', response.statusText))\n } \n });\n }\n\n if (this.type == 'checkbox') {\n this.paramChanged(e.target.checked)\n }\n }", "static get BUTTON_START() {\n return \"start\";\n }" ]
[ "0.7202997", "0.70763826", "0.6636706", "0.6595606", "0.6515036", "0.64495564", "0.64141", "0.6387366", "0.6357575", "0.6326639", "0.6323272", "0.6304418", "0.6219654", "0.6204986", "0.6149941", "0.60825926", "0.6076404", "0.60505676", "0.60413074", "0.6036376", "0.60333276", "0.6020859", "0.6002722", "0.59947306", "0.59395564", "0.5930887", "0.5898592", "0.5892776", "0.5891744", "0.5891564", "0.58908695", "0.5886801", "0.5873653", "0.5855224", "0.58543986", "0.5837749", "0.5807804", "0.5801776", "0.5790627", "0.57865757", "0.57782066", "0.57752717", "0.57522905", "0.57501626", "0.5749709", "0.5745111", "0.5712201", "0.5711255", "0.5694102", "0.5692237", "0.56917304", "0.56892484", "0.5686925", "0.56832945", "0.5672559", "0.5672559", "0.56714547", "0.565475", "0.5645156", "0.5618678", "0.5617485", "0.56174356", "0.56118906", "0.5610925", "0.5601539", "0.559779", "0.5596993", "0.5596132", "0.55903876", "0.5583747", "0.5583242", "0.55814284", "0.55811465", "0.5574097", "0.5573836", "0.5567111", "0.5563156", "0.5559776", "0.55487496", "0.55428225", "0.5533955", "0.5532664", "0.5532164", "0.55310744", "0.5528176", "0.5523968", "0.5522246", "0.5518972", "0.5516432", "0.5514894", "0.5505086", "0.55040854", "0.5494391", "0.54915094", "0.5488871", "0.5487859", "0.54836345", "0.5482842", "0.5482299", "0.54791397" ]
0.7282178
0
process input based on button pressed, perform next appropriate operation
function processInput(input) { switch (input) { case "=": calculate(); break; case "ce": clearEntry(); break; case "ac": clearAll(); break; case "/": case "*": case "+": case "-": case ".": case "0": validateInput(input); break; default: updateDisplay(input); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function onButton(){\n input();\n output();\n\n}", "function input(btn) {\n // If button is number or'.'\n if (!isNaN(btn) || btn === '.') {\n // If button is a '.'\n if (btn === '.') {\n if (preButton === '=' || mathOpPressed) {\n currentNum = '0';\n currentNum += btn;\n } else if (isFunction) {\n currentNum = '0';\n currentNum += btn;\n historyValue = '';\n } else if (btn === '.' && /^\\d+$/.test(currentNum)) {\n currentNum += btn;\n }\n }\n // If button is a digit\n else if (!isNaN(btn)) {\n if (preButton === '=' || preButton === 'sqr' || preButton === 'sqrt' || preButton === 'cube' || preButton === 'fraction' || preButton === 'percentage') {\n currentNum = '0';\n updateMainScreen(0);\n historyValue = '';\n }\n if (mainScreen.value === '0' || mathOpPressed || mainScreen.value === 'Cannot divide by zero' || mainScreen.value === 'Invalid input') {\n currentNum = btn;\n\n } else\n currentNum += btn;\n }\n currentNum = maxValue(currentNum);\n isFunction = false;\n mathOpPressed = false;\n isResult = false;\n isNumber = true;\n updateMainScreen(currentNum);\n updateHistoryScreen(historyValue);\n }\n\n //If button is sign, Math operation and etc ...\n else {\n // Math Operation '+', etc.\n if (btn === '-' || btn === '+' || btn === '*' || btn === '/') {\n\n switch (btn) {\n case '+':\n mathOp = addition;\n break;\n case '-':\n mathOp = subtraction;\n break;\n case '/':\n mathOp = division;\n break;\n case '*':\n mathOp = multiplication;\n break;\n }\n mathOpPressed = true;\n\n //History Screen\n if (mainScreen.value.indexOf('.') === mainScreen.value.length - 1) {\n mainScreen.value = mainScreen.value.slice(0, length - 1);\n }\n if (mainScreen.value === '0') {\n historyValue = '0' + btn;\n } else if (!isNaN(preButton)) {\n historyValue += mainScreen.value + btn;\n } else if (preButton === '+' || preButton === '-' || preButton === '*' || preButton === '/') {\n historyValue = historyValue.slice(0, historyValue.length - 1);\n historyValue += btn;\n } else if (isFunction) {\n historyValue += btn;\n } else if (preButton === '=') {\n historyValue = mainScreen.value + btn;\n } else if (preButton === 'negate') {\n historyValue += mainScreen.value + btn;\n } else if (!isNaN(currentNum)) {\n historyValue += mainScreen.value + btn;\n }\n isFunction = false;\n }\n\n // Clear and Clear Entry\n if (btn === 'C' || btn === 'CE') {\n init();\n updateMainScreen(currentNum);\n return;\n }\n\n // plus-minus '+-' button\n if (btn === 'negate') {\n if (preButton === '+' || preButton === '-' || preButton === '*' || preButton === '/') {\n currentNum = result;\n }\n if (mainScreen.value === '0')\n return;\n var str;\n var mainScreenValue = mainScreen.value;\n mainScreenValue = mainScreenValue.split(',').join('');\n if (mainScreenValue == currentNum || result === null)\n str = String(currentNum);\n else\n str = String(result);\n if (str.indexOf('-') === 0) {\n str = str.substring(1);\n } else {\n str = str.splice(0, 0, '-');\n }\n if (mainScreenValue == currentNum)\n currentNum = Number(str);\n else\n result = Number(str);\n updateMainScreen(str);\n // History\n if (isFunction) {\n historyValue = historyValue.slice(-historyValue.length, -strFunction.length);\n strFunction = btn + '(' + strFunction + ')';\n historyValue += strFunction;\n }\n\n }\n\n // Functions like sqr, sqrt, cube and etc.\n if (btn === 'sqr' || btn === 'sqrt' || btn === 'cube' || btn === 'fraction' || btn === 'percentage') {\n // History except percentage\n if (btn !== 'percentage') {\n if (preButton !== 'sqr' && preButton !== 'sqrt' && preButton !== 'cube' && preButton !== 'fraction' && preButton !== 'negate') {\n firstCuurentNum = currentNum;\n strFunction = btn === 'fraction' ? '1/(' + mainScreen.value + ')' : btn + '(' + mainScreen.value + ')';\n historyValue += strFunction;\n } else {\n historyValue = historyValue.slice(-historyValue.length, -strFunction.length);\n strFunction = btn === 'fraction' ? '1/(' + strFunction + ')' : btn + '(' + strFunction + ')';\n historyValue += strFunction;\n }\n }\n isFunction = true;\n mainScreenValue = mainScreen.value;\n mainScreenValue = mainScreenValue.split(',').join('');\n var str = currentNumOrResult(mainScreenValue);\n switch (btn) {\n case 'sqr':\n str = square(str);\n break;\n case 'sqrt':\n str = squareRoot(str);\n break;\n case 'cube':\n str = cube(str);\n break;\n case 'fraction':\n str = fraction(str);\n break;\n case 'percentage':\n str = percentage(str);\n break;\n }\n if (isInvalidInput) {\n init();\n mainScreen.value = 'Invalid input';\n } else if (isDivideByZero) {\n init();\n mainScreen.value = 'Cannot divide by zero';\n } else {\n if (mainScreenValue == currentNum)\n currentNum = Number(str);\n else\n result = Number(str);\n updateMainScreen(str);\n }\n // History percentage\n if (btn === 'percentage') {\n str = String(str);\n if (preButton != 'percentage' && (preButton != 'sqr' && preButton != 'sqrt' && preButton != 'cube' && preButton != 'fraction')) {\n strPercentage = str;\n historyValue += str;\n } else if (preButton == 'percentage') {\n historyValue = historyValue.slice(-historyValue.length, -strPercentage.length);\n historyValue += str;\n } else {\n historyValue = historyValue.slice(-historyValue.length, -strFunction.length);\n historyValue += str;\n }\n }\n }\n\n // Assign current number to result if initial \n if ((mathOp && result === null)) {\n result = Number(currentNum);\n }\n\n // Equal button\n if (btn === '=') {\n isResult = true;\n if (preButton === '+' || preButton === '-' || preButton === '*' || preButton === '/')\n currentNum = result;\n if (mathOp) {\n mathOpPressed = false;\n isFunction = false;\n isResult = true;\n mathOpCount = 0;\n mathOp(Number(currentNum));\n result = roundResult(result);\n updateMainScreen(result);\n historyValue = '';\n }\n }\n\n // Count Math operation\n if (mathOpPressed && btn !== 'fraction' && btn !== 'percentage' && btn !== 'sqr' && btn != 'sqrt' && btn != 'negate' && btn != 'cube' &&\n btn != 'backSpace' && btn != 'C' && btn != 'CE' && preButton != '+' && preButton != '-' && preButton != '/' && preButton != '*') {\n mathOpCount++;\n }\n\n // Result in row\n if (mathOpCount >= 2) {\n isResult = true;\n mathOpCount--;\n preMathOp(Number(currentNum));\n result = roundResult(result);\n updateMainScreen(result);\n currentNum = result;\n }\n\n // BackSpace button\n if (btn === 'backSpace') {\n var str = mainScreen.value;\n str = str.split(',').join('');\n if (isResult || isFunction || mathOpPressed) {\n return;\n } else {\n str = str.slice(0, -1);\n if (!str.length || str === '-' || str === '-0')\n str = 0;\n currentNum = str;\n updateMainScreen(currentNum);\n }\n }\n\n // Update history screen\n if (btn !== 'CE' && btn !== 'CS') {\n updateHistoryScreen(historyValue);\n }\n }\n preButton = btn;\n preMathOp = mathOp;\n isInit = false;\n}", "function handleButtons(event) {\r\n // the button pressed in found in the click event under the value of event.target.dataset.value\r\n // using the data attribute included for this purpose in the HTML\r\n let buttonPressed = event.target.dataset.value;\r\n\r\n // trigger different functions based on the button pressed\r\n if(buttonPressed == \"ec\") {\r\n clearMainDisplay();\r\n }\r\n else if(buttonPressed == \"ac\") {\r\n clearMainDisplay(); \r\n clearChainDisplay();\r\n }\r\n else if(regexDigits.test(buttonPressed)) {\r\n displayDigit(buttonPressed);\r\n }\r\n else if(buttonPressed == \".\") {\r\n displayDecimalPoint();\r\n }\r\n else if(regexOperators.test(buttonPressed)) {\r\n displayOperator(buttonPressed);\r\n } \r\n else if(buttonPressed == \"=\") {\r\n displayResult();\r\n }\r\n else {\r\n fourOhFour();\r\n }\r\n}", "function processBtn (event) {\n\n // event.target gives you the button that was clicked\n // <button data-type=\"num\">7</button>\n var button = event.target;\n\n // gives you the data type of each button element\n var type = button.dataset.type;\n\n // if statements direct each type of button to execute a specific function\n if (type === 'num') return processNum(button);\n if (type === 'opp') return processOpp(button);\n if (type === 'negative') return processNegative(button);\n if (type === 'equal') return processEqual(button);\n if (type === 'clear') return processClear(button);\n}", "function handleButtons () {\n handleStartButton();\n handleSubmitButton();\n handleNextButton();\n handleShowAllQandA();\n handleRestartButton();\n }", "function processButtonClick() {\n let buttonValue = this.innerText\n // check if decimal is being used AND is enabled\n if (buttonValue === \".\" && !decimalEnabled) {\n console.log('cannot use decimal again');\n return;\n }\n // check which variable we are working on AND\n // concatenate calculator data to correct variable\n if (isFirstNumSet) {;\n num2 += buttonValue;\n }\n else {\n num1 += buttonValue;\n }\n // display data on the DOM calculator display\n updateCalculatorDisplay();\n}", "function processInputCommand()\n {\n var inputText = my.html.input.value\n var goodChars = my.current.correctInputLength\n\n if (inputCommandIs('restart') || inputCommandIs('rst')) {\n location.href = '#restart'\n } else if (inputCommandIs('fix') || inputCommandIs('xxx')){\n my.html.input.value = inputText.substring(0, goodChars)\n updatePracticePane()\n } else if (inputCommandIs('qtpi')) {\n qtpi()\n }\n }", "function buttonHandler(){\n if (expression === 0 || expression === \"0\" || done){\n expression = \"\";\n done = false;\n }\n // get value of clicked button\n var char = $(this).attr(\"value\");\n // add value to expression\n expression += String(char);\n if (expression == \".\"){\n expression = \"0.\";\n }\n drawResult();\n}", "function handleSymbol(symbol){\n// if(symbol === 'C') {\n// buffer = '0';\n// runningTotal = 0;\n// }instead of doing a bunch of if-else statements for buttons, do switch as below for each case-with break after each switch case\n switch (symbol) {\n case 'C':\n buffer = '0';\n runningTotal = 0;\n break; \n case '=':\n if (previousOperator === null) {\n //so above is user hasn't entered anything yet - so screen is null\n //you need two numbers to do math\n return;\n }\n flushOperation(parseInt(buffer)); //this does the math part of equal\n previousOperator = null; //clear the button out after\n buffer = runningTotal;\n runningTotal = 0; //after math is done reassign to zero\n break;\n case '←': //tip copy and paste symbols from the DOM\n if(buffer.length === 1){ //backspace 1 character\n buffer = '0';\n }else {\n buffer = buffer.substring(0, buffer.length - 1); //-1 is stop 1 short of going all the way to the end\n }\n break;\n case '+': //note these need to be the signs not the &plus that is in the html\n case '−':\n case '×':\n case '÷':\n handleMath(symbol);\n break;\n }\n}", "handleButton() {}", "function btnEnter_click() {\n var userText = document.getElementById(\"txtCommand\").value;\n var response = \"\";\n if (userText === \"N\" || userText === \"n\") {\n response = btnNorth();\n } else {\n if (userText === \"S\" || userText === \"s\") {\n response = btnSouth();\n } else {\n if (userText === \"E\" || userText === \"e\") {\n response = btnEast();\n } else {\n if (userText === \"W\" || userText === \"w\") {\n response = btnWest();\n } else {\n if (userText === \"help\") {\n HelpMessage();\n } else {\n if (userText === \"take\") {\n TakeItem();\n } else {\n if (userText === \"inventory\") {\n listInventory();\n } else {\n if (userText === \"open\") {\n rescueDog();\n } else {\n ErrorMessage();\n }\n }\n }\n }\n }\n }\n }\n }\n }", "function process_calculator(){\n console.log(\"function process_calculator\");\n const calc_keys = document.querySelector(\".calculator_buttons\");\n //console.log(calc_keys);\n calc_keys.addEventListener('click', (event) => {\n console.log(\"-------- Button Pressed ---------\");\n // Object deconstruction getting target property of click event.\n // Equivalent to const target = event.target;\n const {target} = event;\n let val = target.value;\n\n // doing the check if i just finished the expression, in which the next button pressed should then\n // reset the current display\n if(calculator.exp_completed === true){\n calculator.exp_completed = false;\n calculator.curr_display = \"\";\n }\n\n // temporary check if there is a bracket in teh current display\n if(calculator.bracket_used === true){\n console.log(\"There is a bracket in my input\");\n }\n // If I clicked in the calculator area, but not an actual button, just do nothing\n if(!target.matches(\"button\")){\n console.log(\"Button was not pressed\");\n return;\n }\n if(target.className === \"operator\"){\n console.log(\"Operator\", val);\n input_operator(val);\n\n }else if(target.className === \"decimal\") {\n console.log(\"Decimal\", val);\n input_decimal();\n }else if(target.className === \"bracket\"){\n console.log(\"Bracket\", val);\n input_bracket(val);\n }else if(target.className === \"clear\"){\n console.log(\"Clear\", val);\n input_clear(val);\n\n }else if(target.className === \"all-clear\"){\n console.log(\"All Clear\", val);\n input_clear(val);\n\n }else if(target.className === \"equal-sign\"){\n // this case is special, since I'm not just updating display\n // but also \"resetting it\". Hence, i update_display in the actual function\n console.log(\"Equal Sign\", val);\n input_equal();\n console.log(\"Current number: \", calculator.curr_num);\n\n return;\n\n }else{\n console.log(\"Digit\", val);\n input_digit(val);\n }\n\n update_display();\n console.log(\"Current number: \", calculator.curr_num);\n });\n}", "function handleBtn() {\r\n let inputValue = inputElement.value;\r\n getDataFromApi(inputValue);\r\n}", "function calculateInput() {\n $(\".button\").on(\"click\", function () {\n // user types in a number\n if (this.id.match(/\\d/)) {\n currentEntry += this.id.match(/\\d/)[0];\n previousEntry = currentEntry;\n if (potentialMinusOperation) potentialMinusOperation = false; // since no minus operation has been done.\n renderAll();\n }\n else {\n // clear entire input\n if ((calculate.length !== 0 || currentEntry !== 0) && this.id === \"button_ac\") {\n calculate = \"\";\n currentEntry = \"\";\n previousEntry = \"\";\n renderAll();\n }\n // first element is a dot, so put a \"0\" in front of it\n else if (currentEntry.length === 0 && this.id === \"button_dot\") {\n currentEntry = \"0.\";\n previousEntry = \"0.\";\n if (potentialMinusOperation) potentialMinusOperation = false;\n renderAll();\n }\n // determine which button was pressed in order to perform the correct calculation\n else if (currentEntry.length !== 0) {\n if (this.className === \"button button-operator\") {\n calculate += currentEntry + this.dataset.value;\n currentEntry = \"\";\n renderSecondary(calculate);\n if (this.id === \"button_mult\" || this.id === \"button_div\") potentialMinusOperation = true;\n }\n else switch (this.id) {\n case \"button_ce\": // only clear current entry, not entire calculation\n previousEntry = \"\";\n currentEntry = \"\";\n renderAll();\n break;\n case \"button_dot\":\n if (currentEntry.match(/\\./) === null) {\n currentEntry += \".\";\n previousEntry += \".\";\n }\n renderAll();\n break;\n case \"button_enter\":\n case \"button_hide_enter\":\n calculate += currentEntry;\n result = stringToCalculation(calculate);\n previousEntry = result;\n renderResult(result);\n calculationFinished = true;\n calculate = \"\";\n currentEntry = \"\";\n break;\n }\n }\n // of the potential minus flag is set to true, allow \"-\" to be pressed\n if (potentialMinusOperation && this.id === \"button_minus\") {\n calculate += \" - \";\n renderSecondary(calculate + currentEntry);\n potentialMinusOperation = false;\n }\n // post-calculation options\n if (calculationFinished) {\n if (this.id === \"button_ce\") {\n // when calculation is finished, CE has same functionality as AC\n calculate = \"\";\n currentEntry = \"\";\n previousEntry = \"\";\n renderAll();\n calculationFinished = false;\n }\n if (this.className === \"button button-operator\") {\n // use result for next calculation\n calculate = previousEntry + this.dataset.value;\n renderSecondary(calculate + currentEntry);\n calculationFinished = false;\n // allowing for negative operations\n if (this.id === \"button_mult\" || this.id === \"button_div\") {\n potentialMinusOperation = true;\n }\n }\n }\n }\n });\n}", "function operatorPress() {\n\n determineNumber();\n determineOperation(this);\n}", "function processClick(event) {\n\t\t\t\tif (hasJustGotFocus) return;\n\t\t\t\tif (inputElement[0].selectionStart >= 3) {\n\t\t\t\t\tif (selectionMode == 'HOUR' && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\tswitchToMinuteMode();\n\t\t\t\t\tselectMinuteOnInputElement();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (selectionMode == 'MINUTE' && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\tswitchToHourMode();\n\t\t\t\t\tselectHourOnInputElement();\n\t\t\t\t}\n\t\t\t}", "function buttonPressed(keyPressed)\n{\n//\tvar keyPressed = String.fromCharCode(event.keyCode);\n //console.log(keyPressed);\n\ncode_refresh();\n\nif (keyPressed == \"up\") {\n clearTimeout(up_timer);\n key_interpreter(dataSplit(up_code), \"up_timer\");\n}\nif (keyPressed == \"down\") {\n clearTimeout(down_timer);\n key_interpreter(dataSplit(down_code), \"down_timer\");\n}\nif (keyPressed == \"left\") {\n clearTimeout(left_timer);\n key_interpreter(dataSplit(left_code), \"left_timer\");\n}\nif (keyPressed == \"right\") {\n clearTimeout(right_timer);\n key_interpreter(dataSplit(right_code), \"right_timer\");\n}\nif (keyPressed == \"stop\") {\n clearTimeout(space_timer);\n key_interpreter(dataSplit(space_code), \"space_timer\");\n}\nif (keyPressed == \"A\") {\n clearTimeout(a_timer);\n key_interpreter(dataSplit(a_code), \"a_timer\");\n}\nif (keyPressed == \"B\") {\n clearTimeout(b_timer);\n key_interpreter(dataSplit(b_code), \"b_timer\");\n}\n\n}", "function checkEntered(e) {\r\n //to check that if the tags class list contain mustShow class\r\n if (e.target.classList.contains(\"mustShow\")) {\r\n //to check button with mustShow class we use display function\r\n display(e.target);\r\n //to check that if the button contain equal class\r\n } else if (\r\n e.target.classList.contains(\"equal\") &&\r\n displayResult.textContent != \"Error\"\r\n ) {\r\n /* if user clicks on equal button, the result will be replaced in users entered num and ops\r\n and user can use that result for next calculation */\r\n showResult(displayResult.textContent);\r\n //check that if the btn contain backspace class\r\n } else if (\r\n e.target.classList.contains(\"backspace\") ||\r\n e.target.parentElement.classList.contains(\"backspace\")\r\n ) {\r\n /* we have two btn that their classlist contain backspace\r\n one for remove just one char, and one for remove all the string in result section */\r\n // check if the button text content is C\r\n if (e.target.textContent == \"C\") {\r\n //remove all string in result section and live result section\r\n displayResult.textContent = \"\";\r\n displayLiveResult.textContent = \"\";\r\n } else {\r\n //this condition is for an other backSpace button that removes only one char from last of string\r\n //if result sections text content is Error, all string in result and live result section and check will be remove\r\n if (displayResult.textContent == \"Error\") {\r\n displayResult.textContent = \"\";\r\n displayLiveResult.textContent = \"\";\r\n check = \"\";\r\n } else {\r\n //else only one char from last of string will be removed\r\n displayResult.textContent = displayResult.textContent.substr(\r\n 0,\r\n displayResult.textContent.length - 1\r\n );\r\n check = check.substr(0, check.length - 1);\r\n /*show live result we send results to show live result function after each click\r\n on operators and numbers and backspace*/\r\n showLiveResult(displayResult.textContent);\r\n }\r\n }\r\n }\r\n}", "function onOperatorButtonClicked(value)\n {\n //Current value doesn't equal zero and we can do stuff with it\n if(!runningTotal == 0){\n\n switch(value){\n case \"+\":\n //Set operator to clicked button\n currentOperator = \"+\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"-\":\n //Set operator to clicked button\n currentOperator = \"-\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"x\":\n //Set operator to clicked button\n currentOperator = \"*\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"/\":\n //Set operator to clicked button\n currentOperator = \"/\";\n //Set operator press to true\n hasPressedOperator = true;\n //Update the display to reflect the change\n updateDisplay();\n break;\n case \"=\":\n //Check for a number and operator \n if(hasPressedOperand && hasPressedOperator){ \n //Set it so that we know they have just pressed the equals symbol\n hasPressedEquals = true;\n\n //Check currentOperator\n if(currentOperator == \"+\"){\n runningTotal += parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"-\"){\n runningTotal -= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"*\"){\n runningTotal *= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else if (currentOperator == \"/\"){\n runningTotal /= parseInt(currentOperand);\n //Reset the variables used\n hasPressedOperand = false;\n hasPressedOperator = false;\n currentOperand = 0;\n currentOperator = \"\";\n updateDisplay();\n } else {\n // runningTotal /= parseInt(currentOperand);\n }\n } else {\n\n }\n // -------\n }\n }\n }", "function numberButtons(input) {\n // 1) Check if equal button was just clicked\n if (operationArray.length == 3) {\n // if so clear\n display.textContent = 0;\n topLine.textContent = \"\";\n outputNum = \"\";\n operationArray = [];\n storedOperator = \"\";\n decimalBtn.disabled = false;\n\n // and add first number to output\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n\n // 2) Check if calculation is ongoing...\n } else if (storedOperator != \"\") {\n \n console.log(outputNum);\n\n // on first click...\n if (topLine.textContent == \"\") {\n // add calculated number and stored operator to topline\n topLine.textContent = `${outputNum} ${storedOperator}`;\n \n // reset input counter\n outputNum = \"\";\n }\n\n // grow input number until operator is selected\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n\n // 3) Otherwise begin entering number...\n } else {\n // grow input number until operator is selected\n outputNum += input;\n display.textContent = outputNum;\n disableDecimal(outputNum);\n }\n}", "function doClick(button) {\r\n\r\n inputBox.focus();\r\n\r\n if (button.textOp) {\r\n\r\n if (undoManager) {\r\n undoManager.setCommandMode();\r\n }\r\n\r\n var state = new TextareaState(panels);\r\n\r\n if (!state) {\r\n return;\r\n }\r\n\r\n var chunks = state.getChunks();\r\n\r\n // Some commands launch a \"modal\" prompt dialog. Javascript\r\n // can't really make a modal dialog box and the WMD code\r\n // will continue to execute while the dialog is displayed.\r\n // This prevents the dialog pattern I'm used to and means\r\n // I can't do something like this:\r\n //\r\n // var link = CreateLinkDialog();\r\n // makeMarkdownLink(link);\r\n // \r\n // Instead of this straightforward method of handling a\r\n // dialog I have to pass any code which would execute\r\n // after the dialog is dismissed (e.g. link creation)\r\n // in a function parameter.\r\n //\r\n // Yes this is awkward and I think it sucks, but there's\r\n // no real workaround. Only the image and link code\r\n // create dialogs and require the function pointers.\r\n var fixupInputArea = function () {\r\n\r\n inputBox.focus();\r\n\r\n if (chunks) {\r\n state.setChunks(chunks);\r\n }\r\n\r\n state.restore();\r\n previewManager.refresh();\r\n };\r\n\r\n var noCleanup = button.textOp(chunks, fixupInputArea);\r\n\r\n if (!noCleanup) {\r\n fixupInputArea();\r\n }\r\n\r\n }\r\n\r\n if (button.execute) {\r\n button.execute(undoManager);\r\n }\r\n }", "constructor(ui_element_) {\n this.ui_element = ui_element_\n\n this.operator_display = this.ui_element.getElementsByClassName('current_operator')[0];\n this.output_display = this.ui_element.getElementsByClassName('current_result')[0];\n this.input_display = this.ui_element.getElementsByClassName('current_input')[0];\n\n this.ui_element.addEventListener('click', event => {\n try {\n ui_element_.focus(); // Change the focus from key into the whole calculator.\n const key = event.target;\n if (!key.matches('button')) {\n return;\n }\n key.classList.add(\"active\");\n delay(50).then(() =>\n key.classList.remove(\"active\"));\n\n if (key.matches('.key_operator')) {\n this.operator_input(key.dataset.action);\n } else if (key.matches('.key_action')) {\n this.action_input(key.dataset.action);\n } else if (key.matches('.key_digit')) {\n this.digit_input(key.textContent);\n } else {\n console.log(key);\n }\n this.update_display();\n } catch (err) {\n this.all_clear();\n this.update_display();\n this.output_display.textContent = err;\n }\n event.stopPropagation();\n });\n\n this.ui_element.addEventListener('keydown', event => {\n try {\n let key = event.key;\n if (key >= '0' && key <= '9') {\n this.digit_input(key)\n } else if (key === '+' || key === '-' || key === '*' || key === '/') {\n this.operator_input(key);\n } else if (key === 'Backspace' || key === '=' || key === 'Enter' || key === '.') {\n this.action_input(key)\n } else {\n console.log(key)\n return;\n }\n key = key === 'Enter' ? '=' : key;\n let button = this.ui_element.getElementsByClassName(\"key_\" + key)[0];\n button.classList.add(\"active\");\n delay(50).then(() =>\n button.classList.remove(\"active\"));\n this.update_display();\n } catch (err) {\n this.all_clear();\n this.update_display();\n this.output_display.textContent = err;\n }\n event.stopPropagation();\n });\n\n this.all_clear();\n }", "function executeInput(event){\n // get input and put into array, filter out empty cell at end due to extra space\n let input = display.textContent.split(' ').filter(item => item !== '' && item);\n // if not enough inputs return immediately\n if (input.length < 3) {\n return;\n }\n // if the last input was an operator trim it off the end\n if (operators.includes(input[input.length - 1])) {\n input.splice(input.length - 1, 1);\n }\n // generate ratings array, element at each index will correspond to MDAS rating of each element in input array, numbers will be 0\n let ratings = input.map(item => operators.includes(item) ? mdas[item] : 0);\n // run calculations \n result = calculateResults(input, ratings);\n // if the result is a solid number display it, otheriwse trim to 5 decimal places then display, when sent as number to string it will also trim trailing zeros \n if (Number.isInteger(result)) {\n display.textContent = `${result} `;\n } else {\n display.textContent = `${Number(result.toFixed(5))} `;\n }\n }", "function processButtonPress(aButtonData) {\n\n\t// deep copy the button data\n\tvar myButtonData = $.extend({}, aButtonData);\n\t// console.log(myButtonData);\n\n\tswitch (myButtonData.name) {\n\n\t\tcase 'key_00':\n\t\tcase 'key_0':\n\t\tcase 'key_1':\n\t\tcase 'key_2':\n\t\tcase 'key_3':\n\t\tcase 'key_4':\n\t\tcase 'key_5':\n\t\tcase 'key_6':\n\t\tcase 'key_7':\n\t\tcase 'key_8':\n\t\tcase 'key_9':\n\t\tcase 'key_period':\n\n \t\tif (CALC_STATE.lastkey == 'key_equals') {\n \t\t\tCALC_STATE.lastMultTop = null;\n \t\t}\n\n \t\tif (\n \t\t\tCALC_STATE.lastkey == 'key_plus' ||\n \t\t\tCALC_STATE.lastkey == 'key_minus' || \n \t\t\tCALC_STATE.lastkey == 'key_times' ||\n \t\t\tCALC_STATE.lastkey == 'key_divide' ||\n \t\t\tCALC_STATE.lastkey == 'key_equals' ||\n \t\t\tCALC_STATE.lastkey == 'key_total'\n \t\t\t) {\n CALC_STATE.display = '0';\n }\n\n\t \t// ignore the keypress if the display number is already 12 digits\n\t \tif (CALC_STATE.display.replace(/\\./, '').length >= 12) {\n\t \t\tbreak;\n\t \t}\n\n\t \tif (CALC_STATE.lastkey == 'key_total') {\n\t \t\tCALC_STATE.total = 0;\n\t \t}\n\n\t \tif (CALC_STATE.display == '0') {\n\t \t\tCALC_STATE.display = '';\n\t \t}\n\n\t \t// ignore any duplicate periods\n\t \tif (myButtonData.name === 'key_period' && CALC_STATE.display.indexOf('.') > -1) break;\n\n\t \tCALC_STATE.display += myButtonData.item;\n\t \tCALC_STATE.curval = parseFloat(CALC_STATE.display);\n\n\t \t// minor display tweak\n\t \tif (CALC_STATE.display === '.') CALC_STATE.display = '0.';\n\n\t \tupdateDisplay();\n\n\t \tbreak;\n\n \tcase 'key_backspace':\n\n\t \tif (CALC_STATE.lastkey == 'key_00' ||\n\t \t\tCALC_STATE.lastkey == 'key_0' ||\n\t \t\tCALC_STATE.lastkey == 'key_1' ||\n\t \t\tCALC_STATE.lastkey == 'key_2' ||\n\t \t\tCALC_STATE.lastkey == 'key_3' ||\n\t \t\tCALC_STATE.lastkey == 'key_4' ||\n\t \t\tCALC_STATE.lastkey == 'key_5' ||\n\t \t\tCALC_STATE.lastkey == 'key_6' ||\n\t \t\tCALC_STATE.lastkey == 'key_7' ||\n\t \t\tCALC_STATE.lastkey == 'key_8' ||\n\t \t\tCALC_STATE.lastkey == 'key_9' ||\n\t \t\tCALC_STATE.lastkey == 'key_period') {\n\n\t \t\tvar currentDisplay = CALC_STATE.display;\n if (currentDisplay != '0') CALC_STATE.display = currentDisplay.substring(0, currentDisplay.length-1);\n if (CALC_STATE.display == '') CALC_STATE.display = '0';\n CALC_STATE.curval = parseFloat(CALC_STATE.display);\n\n updateDisplay();\n }\n return;\n break;\n\n\t case 'key_plus':\n\n if (CALC_STATE.lastkey != 'key_total') {\n\n var currentVal = CALC_STATE.curval;\n\n if (CALC_STATE.lastkey == 'key_times' || CALC_STATE.lastkey == 'key_divide') {\n \tcurrentVal = CALC_STATE.subtotal;\n }\n\n if (CALC_STATE.lastkey == 'key_equals') {\n \tCALC_STATE.curval = CALC_STATE.subtotal;\n \tcurrentVal = CALC_STATE.subtotal;\n \t\t// CALC_STATE.subtotal = CALC_STATE.multiplier;\n }\n \t\n \tCALC_STATE.total += currentVal;\n \taddTapeRow(currentVal, '+', false);\n\n } else {\n \taddTapeRow(CALC_STATE.total, '+', false);\n }\n\n CALC_STATE.display = numberToString(CALC_STATE.total);\n\n CALC_STATE.lastop = '+';\n break;\n\n\t\tcase 'key_minus':\n\n\t\t\tif (CALC_STATE.lastkey != 'key_total') {\n\n\t\t\t\tvar currentVal = CALC_STATE.curval;\n\n\t\t\t\tif (CALC_STATE.lastkey == 'key_times' || CALC_STATE.lastkey == 'key_divide') {\n\t\t\t\t\tcurrentVal = CALC_STATE.subtotal;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (CALC_STATE.lastkey == 'key_equals') {\n\t\t\t\t\tCALC_STATE.curval = CALC_STATE.subtotal;\n\t\t\t\t\tcurrentVal = CALC_STATE.subtotal;\n\t\t\t\t\t// CALC_STATE.subtotal = CALC_STATE.multiplier;\n\t\t\t\t}\n\n\t\t\t\tCALC_STATE.total -= currentVal;\n\t\t\t\taddTapeRow(currentVal, '-', false);\n\n\t\t\t} else {\n\t\t\t\taddTapeRow(CALC_STATE.total, '-', false);\n\t\t\t}\n\n\t\t\tCALC_STATE.display = numberToString(CALC_STATE.total);\n\t\t\t\n\t\t\tCALC_STATE.lastop = '-';\n\t\t\tbreak;\n\n\t\tcase 'key_times':\n\n\t\t\tif (CALC_STATE.lastkey == 'key_plus' || CALC_STATE.lastkey == 'key_minus' ||\n\t\t\t\t CALC_STATE.lastkey == 'key_equals')\n\t\t\t\tCALC_STATE.curval = CALC_STATE.total;\n\n\t\t\tif (!CALC_STATE.lastMultTop) {\n\t\t\t\tCALC_STATE.subtotal = CALC_STATE.curval;\n\t\t\t\taddTapeRow(CALC_STATE.curval, '*', true);\n\t\t\t} else {\n\t\t\t\tif (CALC_STATE.lastkey != 'key_equals' && CALC_STATE.lastkey != 'key_percent') {\n\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\taddTapeRow(CALC_STATE.curval, '*', true);\n\t\t\t\t} else {\n\t\t\t\t\taddTapeRow(CALC_STATE.subtotal, '*', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCALC_STATE.multiplier = CALC_STATE.subtotal;\n\t\t\tCALC_STATE.lastMultTop = '*';\n\t\t\t\n\t\t\tCALC_STATE.display = numberToString(CALC_STATE.subtotal);\n\t\t\tCALC_STATE.lastop = '*';\n\t\t\t\n\t\t\tbreak;\n\n\t\tcase 'key_divide':\n\n\t\t\tif (CALC_STATE.lastkey == 'key_plus' || CALC_STATE.lastkey == 'key_minus' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_equals')\n\t\t\t\tCALC_STATE.curval = CALC_STATE.total;\n\n\t\t\tif (!CALC_STATE.lastMultTop) {\n\t\t\t\tCALC_STATE.subtotal = CALC_STATE.curval;\n\t\t\t\taddTapeRow(CALC_STATE.curval, '/', true);\n\t\t\t} else {\n\t\t\t\tif (CALC_STATE.lastkey != 'key_equals' && CALC_STATE.lastkey != 'key_percent') {\n\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\taddTapeRow(CALC_STATE.curval, '/', true);\n\t\t\t\t} else {\n\t\t\t\t\taddTapeRow(CALC_STATE.subtotal, '/', true);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tCALC_STATE.multiplier = CALC_STATE.curval;\n\t\t\tCALC_STATE.lastMultTop = '/';\n\t\t\t\n\t\t\tCALC_STATE.display = numberToString(CALC_STATE.subtotal);\n\t\t\tCALC_STATE.lastop = '/';\n\t\t\t\n\t\t\tbreak;\n\n\t\tcase 'key_percent':\n\n\t\t\tif (CALC_STATE.lastop == '*') {\n\n\t\t\t\taddTapeRow(CALC_STATE.curval, '%', true);\n\n\t\t\t\t/*\n\t\t\t\tif (CALC_STATE.lastkey == 'key_plus' || CALC_STATE.lastkey == 'key_minus' ||\n CALC_STATE.lastkey == 'key_equals')\n\t\t\t\t\tCALC_STATE.curval = CALC_STATE.total;\n\t\t\t\t*/\n\n\t\t\t\tCALC_STATE.curval = CALC_STATE.curval / 100;\n\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\tCALC_STATE.lastMultTop = '*';\n\n\t\t\t\taddTapeRow(CALC_STATE.subtotal, 'total', true);\n\t\t\t\tCALC_STATE.display = numberToString(CALC_STATE.subtotal);\n\t\t\t\tCALC_STATE.lastop = '*';\n\n\t\t\t}\n\n\t\t\tif (CALC_STATE.lastop == '/') {\n\n\t\t\t\taddTapeRow(CALC_STATE.curval, '%', true);\n\n /*\n if (CALC_STATE.lastkey == 'key_plus' || CALC_STATE.lastkey == 'key_minus' ||\n\t\t\t\t CALC_STATE.lastkey == 'key_equals')\n\t\t\t\tCALC_STATE.curval = CALC_STATE.total;\n\t\t\t\t*/\n\n\t\t\t\tCALC_STATE.curval = CALC_STATE.curval / 100; \n\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\tCALC_STATE.lastMultTop = '/';\n\n\t\t\t\taddTapeRow(CALC_STATE.subtotal, 'total', true);\n\t\t\t\tCALC_STATE.display = numberToString(CALC_STATE.subtotal);\n\t\t\t\tCALC_STATE.lastop = '/';\n\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'key_equals':\n\n\t\t\tif (CALC_STATE.lastMultTop) {\n\n\t\t\t\tif (CALC_STATE.lastkey == 'key_plus' || CALC_STATE.lastkey == 'key_minus') {\n\n\t\t\t\t\tif (CALC_STATE.lastMultTop == '*') {\n\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.multiplier, CALC_STATE.lastMultTop, CALC_STATE.total);\n\t\t\t\t\t\taddTapeRow(CALC_STATE.multiplier, 'equals', true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.total, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\t\taddTapeRow(CALC_STATE.total, 'equals', true);\n\n\t\t\t\t\t}\n\n\t\t\t\t} else if (CALC_STATE.lastkey == 'key_equals') {\n\n\t\t\t\t\tif (CALC_STATE.lastMultTop == '*') {\n\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.multiplier, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\t\taddTapeRow(CALC_STATE.multiplier, 'equals', true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\t\taddTapeRow(CALC_STATE.curval, 'equals', true);\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\n\t\t\t\t\tif (CALC_STATE.lastkey != 'key_percent') {\n\t\t\t\t\t\tif (CALC_STATE.lastop != '+' && CALC_STATE.lastop != '-') {\n\t\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.subtotal);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tCALC_STATE.subtotal = executeOp(CALC_STATE.curval, CALC_STATE.lastMultTop, CALC_STATE.multiplier);\n\t\t\t\t\t\t}\n\t\t\t\t\t\taddTapeRow(CALC_STATE.curval, 'equals', true);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (CALC_STATE.lastop == '/') {\n\t\t\t\t\t\tCALC_STATE.divider = CALC_STATE.curval;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tCALC_STATE.display = numberToString(CALC_STATE.subtotal);\n\t\t\taddTapeRow(CALC_STATE.subtotal, 'total', false);\n\n\t\t\tbreak;\n\n\n\t\tcase 'key_total':\n\n\t\t\tCALC_STATE.display = numberToString(CALC_STATE.total);\n\t\t\tCALC_STATE.curval = CALC_STATE.total;\n // CALC_STATE.total = 0;\n\t\t\t\n\t\t\tCALC_STATE.lastMultTop = null;\n\t\t\tCALC_STATE.lastop = '=';\n\n\t\t\tif (CALC_STATE.lastkey == 'key_total') {\n\t\t\t\tCALC_STATE.display = '0';\n\t\t\t\tCALC_STATE.curval = 0;\n\t\t\t\tCALC_STATE.total = 0;\n\t\t\t\tCALC_STATE.lastMultTop = null;\n\t\t\t\tCALC_STATE.subtotal = null;\n\t\t\t\tCALC_STATE.lastop = null;\n\n\t\t\t\taddTapeRow(0, 'total', false);\n\n\t\t\t} else {\n\t\t\t\taddTapeRow(CALC_STATE.total, 'total', false);\n\t\t\t}\n\n\t\t\tbreak;\n\n\t\tcase 'key_clear':\n\n\t\t\tCALC_STATE.display = '0';\n\t\t\tCALC_STATE.curval = 0;\n\t\t\t\n\t\t\tif (CALC_STATE.lastkey == 'key_clear' || \n\t\t\t\tCALC_STATE.lastkey == 'key_plus' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_minus' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_times' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_divide' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_equals' ||\n\t\t\t\tCALC_STATE.lastkey == 'key_total') {\n\n\t\t\t\tif (CALC_STATE.lastkey == 'key_clear') clearTape();\n\t\t\t\tCALC_STATE.total = 0;\n\t\t\t\taddTapeRow(CALC_STATE.total, 'total', false);\n\t\t\t\tCALC_STATE.lastMultTop = null;\n\t\t\t\tCALC_STATE.subtotal = null;\n\t\t\t\tCALC_STATE.lastop = null;\n\t\t\t}\n\t\t\n\t}\n\n\tCALC_STATE.lastkey = myButtonData.name;\n\n\tif (debug) {\n\t\tconsole.debug('after operation:');\n\t\tconsole.debug(JSON.stringify(CALC_STATE, null, 4));\n\t}\n\t\n\tupdateDisplay();\n\n\treturn;\n\n}", "function handleClick(e) {\n input = {\n value: e.currentTarget.getAttribute(\"keypad\"),\n type: e.currentTarget.getAttribute(\"type\")\n }\n setOutput(output => (handleDisplay(input, output)))\n }", "function operator_clicked(operation) {\n\n if (operator_pressed == false) { // This is the first time an operator was pressed\n previous_number = parseInt(display);\n operator_pressed = true;\n\n switch (operation) {\n case \"+\": current_operation = \"add\"; break;\n case \"-\": current_operation = \"subtract\"; break;\n case \"x\": current_operation = \"multiply\"; break;\n case \"/\": current_operation = \"divide\"; break;\n }\n } else { // This is NOT the first time an operator was pressed e.g., the equal button was not applied\n // Do the calculation and display it\n let result = window[current_operation](parseInt(previous_number), parseInt(display));\n display = result;\n\n // Set the new previous number to the the new display\n previous_number = parseInt(display);\n document.getElementById(\"display\").value = display;\n \n // Keep the operator pressed to be true\n operator_pressed = true;\n\n switch (operation) {\n case \"+\": current_operation = \"add\"; break;\n case \"-\": current_operation = \"subtract\"; break;\n case \"x\": current_operation = \"multiply\"; break;\n case \"/\": current_operation = \"divide\"; break;\n }\n }\n}", "handleInput() {}", "function _buttonListener(event) {\n codeMirror.focus();\n var msgObj;\n try {\n msgObj = JSON.parse(event.data);\n } catch (e) {\n return;\n }\n\n if(msgObj.commandCategory === \"menuCommand\"){\n CommandManager.execute(Commands[msgObj.command]);\n }\n else if (msgObj.commandCategory === \"viewCommand\") {\n ViewCommand[msgObj.command](msgObj.params);\n }\n }", "controlButtonPressed(buttonPressed) {\n if (buttonPressed === 'power') {\n this.togglePowerState();\n } else if (buttonPressed === 'start') {\n this.toggleGameStarted();\n } else if (buttonPressed === 'strict') {\n this.toggleStrictMode();\n } else if (buttonPressed === 'count') {\n // do something?\n }\n }", "function processButtonPress (buttonPress) {\r\n\t\t\t\r\n\t\t\t// if parameter is a number type\r\n\t\t\tif ( typeof buttonPress === \"number\" ) {\r\n\t\t\t\t\r\n\t\t\t\tif ( regFluid === \"\" ) {\r\n\t\t\t\t\tregFluid = buttonPress;\r\n\t\t\t\t\t\r\n\t\t\t\t// here we force regFluid into a number type (redundent), and mod by 1 for a remainder. if a remainder exists we have a floating point value...\r\n\t\t\t\t} else if ( +regFluid === regFluid && !(regFluid % 1) ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\t// ...except for if the user started their number with a decimal, so let's check for string type\r\n\t\t\t\t\tif ( typeof regFluid === \"string\" ) {\r\n\t\t\t\t\t\tregFluid += buttonPress;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t// simple math to handle building on screen value\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tif ( regFluid < 0 ) {\r\n\t\t\t\t\t\t\tregFluid = ((Math.abs(regFluid) * 10) + buttonPress) * -1;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tregFluid = (regFluid * 10) + buttonPress;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t// if a decimal is in the mix we are treating it like a string for now, which mean character concats\r\n\t\t\t\t} else {\r\n\t\t\t\t\tregFluid += buttonPress;\r\n\t\t\t\t}\r\n\t\t\t\treturn regFluid;\r\n\t\t\t\t\t\r\n\t\t\t} else if ( typeof buttonPress === \"string\" ) {\r\n\r\n\t\t\t\tif ( buttonPress === \"toggleSign\" ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( regFluid === \"\" || regFluid === 0 ) { return; }\r\n\t\t\t\t\t\r\n\t\t\t\t\telse { regFluid *= -1; }\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn regFluid;\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"decimal\" ) {\r\n\t\t\t\t\t// if user tries to use a second decimal place, just ignore it\r\n\t\t\t\t\tif ( typeof regFluid === \"string\" && regFluid.indexOf('.') > -1 ) { return; }\r\n\t\t\t\t\t// if user starts with a decimal, we'll tweak the UI to show it\r\n\t\t\t\t\telse if ( regFluid === \"\" || regFluid == 0 ) { regFluid = \"0.\"; }\r\n\t\t\t\t\t\r\n\t\t\t\t\telse { regFluid += \".\"; }\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn regFluid;\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"add\" ) {\r\n\t\t\t\t\t// use case one: user's first move is to hit an operator button, so ignore it\r\n\t\t\t\t\tif ( regFluid === \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t// use case two: user has typed a number, and now they are hitting operator button for the first time\r\n\t\t\t\t\t} else if ( regFluid != \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"add\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t// use case two (and a half): handling zero\r\n\t\t\t\t\t} else if ( regFluid === 0 && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"add\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t// use case three: user has already hit the equal key, and now wants to continue using operator button on existing value\r\n\t\t\t\t\t} else if ( regFluid === \"\" && opReg != \"\" ) {\r\n\t\t\t\t\t\tregFixed = $screen.text();\r\n\t\t\t\t\t\topReg = \"add\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t// use case four: user has not hit the equal key, they just keep on trucking, hitting the operator / number / operator...\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttempReg = calculate(opReg);\r\n\t\t\t\t\t\tregFixed = tempReg;\r\n\t\t\t\t\t\topReg = \"add\";\r\n\t\t\t\t\t\treturn regFixed;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"subtract\" ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( regFluid === \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t} else if ( regFluid != \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"subtract\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === 0 && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"subtract\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === \"\" && opReg != \"\" ) {\r\n\t\t\t\t\t\tregFixed = $screen.text();\r\n\t\t\t\t\t\topReg = \"subtract\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttempReg = calculate(opReg);\r\n\t\t\t\t\t\tregFixed = tempReg;\r\n\t\t\t\t\t\topReg = \"subtract\";\r\n\t\t\t\t\t\treturn regFixed;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"multiply\" ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( regFluid === \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t} else if ( regFluid != \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"multiply\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === 0 && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"multiply\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === \"\" && opReg != \"\" ) {\r\n\t\t\t\t\t\tregFixed = $screen.text();\r\n\t\t\t\t\t\topReg = \"multiply\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttempReg = calculate(opReg);\r\n\t\t\t\t\t\tregFixed = tempReg;\r\n\t\t\t\t\t\topReg = \"multiply\";\r\n\t\t\t\t\t\treturn regFixed;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"divide\" ) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ( regFluid === \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\treturn;\r\n\t\t\t\t\t} else if ( regFluid != \"\" && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"divide\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === 0 && opReg === \"\" ) {\r\n\t\t\t\t\t\tregFixed = regFluid;\r\n\t\t\t\t\t\tregFluid = \"\";\r\n\t\t\t\t\t\topReg \t = \"divide\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else if ( regFluid === \"\" && opReg != \"\" ) {\r\n\t\t\t\t\t\tregFixed = $screen.text();\r\n\t\t\t\t\t\topReg = \"divide\";\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\ttempReg = calculate(opReg);\r\n\t\t\t\t\t\tregFixed = tempReg;\r\n\t\t\t\t\t\topReg = \"divide\";\r\n\t\t\t\t\t\treturn regFixed;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t} else if ( buttonPress === \"equal\" ) {\r\n\t\t\t\t\t// user his the equal key without touching a number button, so ignore\r\n\t\t\t\t\tif ( regFluid === \"\" ) { return; }\r\n\t\t\t\t\t\r\n\t\t\t\t\telse if ( regFluid === \"0.\" ) {\r\n\t\t\t\t\t\tregFluid = 0;\r\n\t\t\t\t\t\treturn regFluid;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else if ( regFluid != \"\" && opReg != \"\" && regFixed === \"\" ) {\r\n\t\t\t\t\t\treturn \"Error\";\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tnukeFlag = true;\r\n\t\t\t\t\t\treturn calculate(opReg);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tconsole.log(\"Unrecognized parameter type: \"+typeof(buttonPress)+\". Please check function.\");\r\n\t\t\t}\r\n\t\t}", "function operation(e) {\n if (!equalPressed) {\n // is equal is not pressed, every time operant is pressed, do calculation\n calculate();\n }\n equalPressed = false;\n // when operant is pressed, save operant (only remembers the operant last pressed)\n operant = e.target.id;\n // record current number on screen to previous\n previous = viewer.textContent;\n // set rePrint to true\n rePrint = true;\n}", "function handleChange(e) {\n if (buttonData.map(item => item.keypad).includes(e.key)) {\n input = {\n value: e.key,\n type: buttonData.filter(item => item.keypad === e.key)[0].type\n }\n setOutput(output => (handleDisplay(input, output)))\n }\n }", "function commandButtonHandle(){\n\t\tswitch(this.id){\n\t\t\tcase \"commandbutton_1\":\n\t\t\t\tonDealCardsClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_2\":\n\t\t\t\tonMaxBetClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_3\":\n\t\t\t\tonAddFiveClicked();\n\t\t\t\tbreak;\n\t\t\tcase \"commandbutton_4\":\n\t\t\t\tonRemoveFiveClicked();\n\t\t\t\tbreak;\n\t\t}\n\t}", "function equal_button_clicked() {\n operate(current_operation, previous_number, display);\n current_operation = \"\";\n operator_pressed = false;\n}", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('right.scpt');\n\t\t\t}\n\t });\n\t}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }", "function btnPress() {\n if (result > 0) {\n clear();\n }\n currentVal += this.value;\n updateDisplay();\n}", "function operClicked(){\n\tif((chain === false)){\n\t\tfirstMemory = Number($display.val());\n\t} else if(numEntered){\n\t\tif(operator === \"+\"){\n\t\t\tfirstMemory = add(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"-\"){\n\t\t\tfirstMemory = substract(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"×\"){\n\t\t\tfirstMemory = multiply(firstMemory, Number($display.val()));\n\t\t} else if(operator === \"÷\"){\n\t\t\tfirstMemory = divide(firstMemory, Number($display.val()));\t\n\t\t}\n\t} \n\n\toperator = $(this).text();\n\tconsole.log(operator);\n\tchain = true;\n\tneedNewNum = true;\n\tisThereDot = false;\n\tnumEntered = false;\n}", "function actionButton() {\n\t\t\tif ($('#status').hasClass('play')) {\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\t// capture screenshot\n\t\t\t\t\tvar xml = capture.captureXml();\n\n\t\t\t\t\t// log screenshot data to database\n\t\t\t\t\tdbService.saveProgram(xml);\n\n\t\t\t\t\t// capture blockly and run generated code\n\t\t\t\t\tvar code = Blockly.JavaScript.workspaceToCode(vm.workspace);\n\t\t\t\t\teval(code);\n\t\t\t\t} else {\n\t\t\t\t\t// capture screenshot and save to database\n\t\t\t\t\tcapture.capturePng('.program-inner');\n\n\t\t\t\t\t// convert program in to list of instructions\n\t\t\t\t\tvar program = [];\n\n\t\t\t\t\tfor (var i = 0; i < vm.program.length; i++) {\n\t\t\t\t\t\tvar ins = vm.program[i];\n\t\t\t\t\t\tprogram.push(ins.name);\n\t\t\t\t\t}\n\n\t\t\t\t\tdbService.saveProgram(program);\n\t\t\t\t}\n\n\t\t\t\t// run program\n\t\t\t\trun();\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('play');\n\n\t\t\t} else if ($('#status').hasClass('stop')) {\n\n\t\t\t\t// stop program\n\t\t\t\tstate.current = state.STOPPED;\n\n\t\t\t\tif (common.type == 'blockly') {\n\t\t\t\t\tvm.program.length = 0;\n\t\t\t\t}\n\n\t\t\t\t// log button press\n\t\t\t\tdbService.buttonPress('stop');\n\n\t\t\t} else if ($('#status').hasClass('rewind')) {\n\t\t\t\trewind();\n\t\t\t}\n\t\t}", "handleInstructionsLocal(event){\n var curText = this.state.currentInstructionText;\n var whichButton = event.currentTarget.id;\n \n if(whichButton===\"left\" && curText > 1){\n this.setState({currentInstructionText: curText-1});\n }\n else if(whichButton===\"right\" && curText < 6){\n \n this.setState({currentInstructionText: curText+1});\n }\n\n if(whichButton===\"right\" && curText === 1){\n this.setState({readyToValidate: true});\n }\n\n if(whichButton===\"left\" && curText === 2){\n this.setState({readyToValidate: false});\n }\n\n if(whichButton===\"right\" && curText === 4){\n this.setState({readyToProceed: true});\n }\n\n if (whichButton==\"left\" && curText==4){\n this.setState({\n readyToProceed: false})\n }\n\n if (whichButton==\"left\" && curText==5){\n this.setState({\n readyToProceed: false})\n }\n\n \n }", "function keyPressed(event) {\n const digits = \"0123456789\";\n const operators = \"+-x*/\";\n if (digits.indexOf(event.key) !== -1) {\n digitPressed(event.key);\n } else if (operators.indexOf(event.key) !== -1) {\n operatorPressed(event.key);\n } else if (event.key === \"=\" || event.key === \"Enter\") {\n computeResult();\n } else if (event.key === \"c\" || event.key === \"C\") {\n clearDisplay();\n } else if (event.key === \".\") {\n addDecimal();\n } else if (event.key === \"m\" || event.key === \"M\") {\n flipSign();\n } else if (event.key === \"Backspace\") {\n deleteLastDigit();\n }\n}", "function operatorButtons(input) {\n // 1) Check if array is already populated (perform calculation without = button)...\n if (operationArray.length > 0) {\n \n // if no new number entered don't allow to continue...\n if (doubleOperatorCheck == 1 && topLine.textContent == \"\") {\n return;\n }\n\n // push entered number to 3rd array element\n operationArray.push(outputNum);\n\n // clear topline text\n topLine.textContent = '';\n\n // calculate and display answer\n outputNum = round(operate(operationArray));\n display.textContent = outputNum;\n\n // set array first value to answer\n operationArray = [outputNum, input];\n\n // store operator for next calculation\n storedOperator = input;\n \n // don't allow another operator to be passed until new number entered\n doubleOperatorCheck = 1;\n\n // 2) Otherwise prepare for first calculation...\n } else {\n // push entered number and operator to array\n operationArray.push(outputNum);\n operationArray.push(input);\n\n // add number and operator to topline\n topLine.textContent = `${outputNum} ${input}`;\n\n // reset bottom display \n outputNum = \"\";\n display.textContent = 0;\n }\n}", "function instructionHandler(event)\n\t\t{\n\t\t\tg.instruct();\n\t\t\thideButtons(this);\n\t\t}", "function buttonClickHandler(el) {\n removeLeadingZero(el)\n lastValue = el.value\n\n let basicOperator = evalBasicOperator(el)\n if (calculatePower(el)) {\n\n }\n else if (basicOperator != null) {\n display += basicOperator\n evaluationString += basicOperator\n if(basicOperator == \"-\" || basicOperator ==\"+\"){\n lastDigitClicked += basicOperator\n }\n } else if (!evalComplexOperator(el)) {\n if(!isNaN(el.value)){\n if(!isNaN(lastValue)){\n lastDigitClicked += el.value\n }else{\n lastDigitClicked = el.value\n }\n }\n display += el.value\n evaluationString += el.value\n }\n document.getElementById(\"output\").value = display\n}", "function input(e){\n\tlet code = e.keyCode;\n\tif(code == 38) // Up arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\n\t\tplayer.vel = -10;\n\t}\n\telse if(code == 40) // Down arrow\n\t{\n\t\tif(!started)\n\t\t{\n\t\t\tstarted = true;\n\t\t\tif(result != \"\")\n\t\t\t{\n\t\t\t\tAI.points = 0;\n\t\t\t\tplayer.points = 0;\n\t\t\t\tdocument.getElementById('computerScore').innerHTML = AI.points;\n\t\t\t\tdocument.getElementById('userScore').innerHTML = player.points;\n\t\t\t\tstressLevel = 50;\n\t\t\t\tstressLevelSystem();\n\t\t\t\tfor(i = 0; i < universityHidden.length; i++) universityHidden[i] = true;\n\t\t\t\tfor(i = 0; i < lifeHidden.length; i++) lifeHidden[i] = true;\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t\tdocument.getElementById('gameInfo').style.color = 'rgba(0,0,0,0)';\n\t\t}\n\t\tplayer.vel = 10;\n\t}\n}", "buttonHandler(button) {\n console.log(button);\n switch (button) {\n // game buttons\n case 'green':\n this.addToPlayerMoves('g');\n break;\n case 'red':\n this.addToPlayerMoves('r');\n break;\n case 'yellow':\n this.addToPlayerMoves('y');\n break;\n case 'blue':\n this.addToPlayerMoves('b');\n break;\n // control buttons\n case 'c-blue':\n this.controlButtonPressed('power');\n break;\n case 'c-yellow':\n this.controlButtonPressed('start');\n break;\n case 'c-red':\n this.controlButtonPressed('strict');\n break;\n case 'c-green':\n this.controlButtonPressed('count');\n break;\n // default\n default:\n break;\n }\n }", "function listenForButton() {\n\t\ttag.on('simpleKeyChange', function(left, right) {\n\t\t\t// if both buttons are pressed, disconnect:\n\t\t\tif (left && right) {\n\t\t\t\tconsole.log('both');\n\t\t\t\ttag.disconnect();\n\t\t\t} else\t\t\t\t// if left, send the left key\n\t\t\tif (left) {\n\t\t\t\tconsole.log('left: ' + left);\n\t\t\t\trunFile('applescript/left.scpt');\n\t\t\t} else\n\t\t\tif (right) {\t\t// if right, send the right key\n\t\t\t\tconsole.log('right: ' + right);\n\t\t\t\trunFile('applescript/right.scpt');\n\t\t\t}\n\t });\n\t}", "function handleNumbers(event){\n var clickedNum = event.target.innerHTML;\n\n if (calculated === true && operating === false){\n outPut.innerHTML = \"Press an operator to continue calculating\"\n }\n else if (calculated === false && operating === false ){\n if (num1 === 0){\n num1 = clickedNum;\n } else {\n num1 += clickedNum;\n }\n outPut.innerHTML = num1;\n }\n else if (calculated === false && operating === true ){\n if (num2 === 0){\n num2 = clickedNum;\n } else {\n num2 += clickedNum;\n }\n outPut.innerHTML = num2;\n } else {\n outPut.innerHTML = \"Error. Press '=' to continue, or Clear.\"\n }\n }", "function populate_input(button) {\n\n // 1. Get value of button\n let button_val = button.innerText;\n\n // 2. Display this value in the input, if it is a number or operand\n let input = document.querySelector('#input_text');\n\n\n // CALCULATING VALUE -----\n // 1. If value is 'C', clear calculator & the variables\n if (button_val == 'C') {\n input_one = undefined;\n input_two = undefined;\n operator = undefined;\n decimal = 1;\n decimal_flag = false;\n input.innerText = '';\n\n // 2. Premature '=': don't do anything\n } else if ((input_one == undefined || input_two == undefined)\n && (button_val == \"=\")) {\n\n // 3. Decimal (only one)\n } else if (button_val == \".\") {\n\n if (input.innerText.includes(\".\")) {\n return;\n\n } else {\n if (isNaN(input.innerText)) {\n input.innerText = \".\";\n } else {\n input.innerText = input.innerText + \".\";\n }\n decimal_flag = true;\n }\n\n // 4. If input_one is undefined, set input_one variable\n } else if ((input_one == undefined) && (!isNaN(button_val))) {\n input_one = (button_val * decimal);\n input.innerText = parseFloat(input_one.toFixed(6));\n\n // 5. If input_one is defined but nothing else, add more numbers\n } else if ((input_one !== undefined) && (input_two == undefined) &&\n (operand == undefined) && (!isNaN(button_val))) {\n input_one = input_one + (button_val * decimal);\n input.innerText = input.innerText + button_val;\n\n // 6. If input_one is defined and user clicks on a non-value, set operand\n // equal to the value\n } else if ((input_one !== undefined) && (input_two == undefined) &&\n (isNaN(button_val))) {\n operand = button_val;\n input.innerText = operand;\n\n // Reset decimals\n decimal_flag = false;\n decimal = 1;\n\n // 7. If input_two is defined, operand is defined and user clicks on a value,\n // set value of input_two\n } else if ((input_one !== undefined) && (operand !== undefined) &&\n (input_two == undefined) && (!isNaN(button_val))) {\n input_two = button_val * decimal;\n input.innerText = parseFloat(input_two.toFixed(6));\n\n // 8. If input_two is defined but nothing else, add more numbers\n } else if ((input_one !== undefined) && (input_two !== undefined) &&\n (operand !== undefined) && (!isNaN(button_val))) {\n input_two = input_two + (button_val * decimal);\n input.innerText = input.innerText + button_val;\n }\n\n // If all of them are defined, calculate\n if ((input_one !== undefined) && (input_two !== undefined) &&\n (operand !== undefined) && button_val == \"=\") {\n let result = operate(operand, parseFloat(input_one),\n parseFloat(input_two));\n\n // Trim super long integers\n if ((String(result).replace(/[^0-9]/g,\"\").length >= 9) &&\n (Math.abs(result) >= 1)) {\n result = result.toExponential();\n\n } else if ((String(result).replace(/[^0-9]/g,\"\").length >= 9) &&\n (Math.abs(result) <= 1)) {\n result = parseFloat(result.toFixed(6));\n }\n\n input.innerText = result;\n\n // Edgecase: division by 0\n if (String(result).includes(\"error\")) {\n input_one = undefined;\n input_two = undefined;\n operand = undefined;\n\n // Reset: set result = input_one, reset other variables\n } else {\n input_one = result;\n input_two = undefined;\n operand = undefined;\n }\n }\n\n // Decimal Reset\n if (decimal_flag) {\n decimal = decimal * (1/10);\n }\n}", "function clickButton(text) {\n let field = document.getElementById(\"res\");\n let fieldText = field.innerHTML;\n switch (text) {\n case '0':\n case '1':\n field.innerHTML += text;\n break;\n case '+':\n case '-':\n case '/':\n case '*':\n if(validOperRE.test(fieldText)) {\n field.innerHTML += text; \n selectedOper = text;\n }\n break;\n case 'С':\n field.innerHTML = \"\";\n break;\n case '=':\n if (validEqualRE.test(fieldText)) {\n calculate(fieldText);\n }\n break;\n default:\n break;\n }\n}", "function buttonpressed() {\n // Start by clearing screen\n clear();\n background(0, 0, 0);\n textAlign(CENTER);\n textSize(16);\n fill(255);\n\n // Get the type of pokemon selected from the radio buttons and put into \"elt\" variable\n elt = document.getElementById(\"form1\")[\"poketype\"].value;\n // Initial counters\n x = 1;\n pos = 0;\n y = 0;\n amountdrawn = 0;\n\n // Call loadingText function to display \"loading...\" whilst screen is being filled with data\n loadingText();\n // Call preloadagain function to load a pokemon from api\n preloadagain();\n }", "function nextButtonHandler() {\n switch (currentState) {\n case \"SelectAnomalyTypes\":\n saveAnomalyTypesForm();\n loadElementSelectionForm();\n break;\n case \"SelectElementTypes\":\n saveElementTypesForm();\n loadTerrainModificationSelectionForm();\n break;\n case \"SelectTerrainModificationTypes\":\n saveTerrainModificationTypesForm();\n loadNextElementSeedForm();\n break;\n case \"ElementSeedForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveElementSeedForm();\n loadNextElementSeedForm();\n }\n break;\n case \"TerrainModificationForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveTerrainModificationForm();\n loadNextTerrainModificationForm();\n }\n break;\n case \"AnomalyForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveAnomalyForm();\n loadNextAnomalyForm();\n }\n break;\n case \"ReviewForm\":\n if (_FormValidators.checkBasicInputs) submitCustomEnvironment();\n }\n}", "function keyPressed() {\n\n if (key == KEY_MODEL_TRAIN) {\n //train data\n neuralNetwork.normalizeData();\n neuralNetwork.train({ epochs: 100 }, trainingFinished);\n\n } else if (key == JUMPINGJACK_DOWN || key == JUMPINGJACK_UP) {\n\n targetLabel = key;\n\n //two-callback system to toggle state variable from collecting to waiting\n setTimeout(() => {\n console.log(`Collecting data for ${key} pose ...`);\n state = STATES.COLLECTING;\n setTimeout(() => {\n console.log('Finished collecting.');\n state = STATES.WAITING;\n }, 15000);\n }, 3000);\n\n }\n\n}", "_onInputButtonPressed(input) {\n switch (typeof input) {\n case 'number':\n if (input==1) {\n this.state.freq[0][0]+=3\n }\n if (input==2) {\n this.state.freq[0][1]+=3\n }\n if (input==3) {\n this.state.freq[0][2]+=3\n }\n if (input==4) {\n this.state.freq[1][0]+=3\n }\n if (input==5) {\n this.state.freq[1][1]+=3\n }\n if (input==6) {\n this.state.freq[1][2]+=3\n }\n if (input==7) {\n this.state.freq[2][0]+=3\n }\n if (input==8) {\n this.state.freq[2][1]+=3\n }\n if (input==9) {\n this.state.freq[2][2]+=3\n }\n if (input==0) {\n this.state.freq[3][0]+=3\n }\n return this._handleNumberInput(input)\n case 'string':\n return this._handleStringInput(input)\n }\n }", "function operation() {\n languageChecks('what operation');\n operationNeeded = readline.question();\n while (!['1', '2', '3', '4'].includes(operationNeeded)) {\n languageChecks('choose number');\n operationNeeded = readline.question();\n }\n}", "function buttonClick(e) {\n\n // calcValue variable will have the value attribute of the calcWindow text area box\n var calcValue = document.getElementById(\"calcWindow\").value;\n\n // calcDecimal variable will have the value attribute of the decimals input box \n var calcDecimal = document.getElementById(\"decimals\").value;\n\n // buttonValue variable will have the value attribute of the event object target \n var buttonValue = e.target.value; \n\n // switch-case structure for the possible values of the buttonValue variable \n switch (buttonValue) {\n case \"del\":\n // delete the contents of the calculate window by changing calcValue to an empty string\n calcValue = \"\";\n break;\n case \"bksp\":\n // erase the last character in the calculator window by changing calcValue to the \n // value return by the eraseChar() function using calcValue as the parameter \n calcValue = eraseChar(calcValue);\n break;\n case \"enter\":\n // calculate the value of the current expression by changing calcValue to...\n calcValue += \" = \" + evalEq(calcValue, calcDecimal) + \"\\n\";\n break;\n case \"prev\":\n // copy the last equation in the calculator window by changing calcValue \n // to the value returned by the lastEq() function using calcValue as a parameter\n calcValue = lastEq(calcValue);\n break;\n default:\n // otherwise, append the calculator button character to the calculator window by \n // letting calcValue equal calcValue plus buttonValue\n calcValue = calcValue + buttonValue;\n }\n\n // set the value attribute of the calcWindow text area box to calcValue\n document.getElementById(\"calcWindow\").value = calcValue;\n\n // run this command to put cursor focus within the calculator window\n document.getElementById(\"calcWindow\").focus();\n}", "function run() {\n // Clean up Input to lowercase\n\n inputNew = inputRaw.value;\n inputNew = inputNew.toLowerCase();\n console.log(\"action requested: \" + inputNew);\n\n // Clear message field\n\n message = mapText[here];\n\n // Directional Manipulation Options\n\n if (\n inputNew === \"north\" &&\n (here == 2 ||\n here == 3 ||\n here == 4 ||\n (here == 7 && spikes[2] == 1) ||\n here == 10)\n ) {\n here += 4;\n message = mapText[here];\n } else if (\n inputNew === \"south\" &&\n (here == 6 || here == 7 || here == 8 || here == 11 || here == 14)\n ) {\n here -= 4;\n message = mapText[here];\n } else if (\n inputNew === \"east\" &&\n ((here >= 0 && here < 3) ||\n (here >= 4 && here < 6) ||\n (here >= 8 && here < 11) ||\n (here == 14 && axe[2] === 1))\n ) {\n here += 1;\n message = mapText[here];\n } else if (\n inputNew === \"west\" &&\n ((here > 0 && here <= 3) ||\n (here > 4 && here <= 6) ||\n (here > 8 && here <= 11) ||\n here == 15)\n ) {\n here -= 1;\n message = mapText[here];\n } else if (\n inputNew === \"north\" ||\n inputNew === \"south\" ||\n inputNew === \"east\" ||\n inputNew === \"west\"\n ) {\n message = \"Impossible to travel \" + inputNew;\n }\n\n // Action Manipulation Options\n else if (\n inputNew === \"use axe\" ||\n inputNew === \"use spikes\" ||\n inputNew === \"use snacks\" ||\n inputNew === \"use shovel\"\n ) {\n useF();\n } else if (\n inputNew === \"take axe\" ||\n inputNew === \"take spikes\" ||\n inputNew === \"take snacks\" ||\n inputNew === \"take shovel\"\n ) {\n takeF();\n } else if (\n inputNew === \"check axe\" ||\n inputNew === \"check spikes\" ||\n inputNew === \"check mail\" ||\n inputNew === \"check snacks\" ||\n inputNew === \"check shovel\" ||\n inputNew === \"check outback\" ||\n inputNew === \"check logs\" ||\n inputNew === \"check gate\" ||\n inputNew === \"check sign\"\n ) {\n checkF();\n }\n\n // Miscellaneous\n else if (inputNew === \"pack\") {\n if (pack[0] === undefined) {\n message = \"Pack: empty\";\n } else {\n message = \"Pack: \" + pack;\n }\n } else if (inputNew === \"ronaustin\") {\n window.open(\"images/mailboxMap.png\");\n } else if (inputNew === \"reset\") {\n endGame();\n } else if (inputNew === \"credits\") {\n credits();\n } else if (inputNew === \"\") {\n display();\n } else {\n message = \"Unacceptable Request\";\n }\n\n display(); // necessary to map navigation\n}", "chooseOperation(operation){\n if (this.currentOperand === '') return\n //to get a displaying figure or answer to continue another computation\n if (this.previousOperand !== '') {\n this.compute()\n }\n //to get the actual operation clicked\n this.operation = operation\n // the previous operand now equals current operand for new input\n this.previousOperand = this.currentOperand\n this.currentOperand = ''\n }", "handleInteraction(button) {\n //(1) Disables the selected letter's onscreen keyboard button\n button.setAttribute('disabled', true);\n\n //if the button clicked by the player does match a letter in the phrase\n if (this.activePhrase.checkLetter(button.innerText) === true) {\n //the CHOSEN CSS class is added to the selected letter's keyboard button\n button.className = 'chosen';\n //the 'showMatchedLetter()' method is called on the phrase\n this.activePhrase.showMatchedLetter(button.innerText);\n\n //if the button clicked by the player does not match a letter in the phrase\n } else {\n //the 'removeLie()' method is called\n this.removeLife();\n //the WRONG CSS class is added to the selected letter's keyboard button\n button.className = 'wrong';\n }\n //if all letters in the phrase are set to show - win\n if (this.checkForWin()) {\n //the 'gameOver()' method is called\n this.gameOver(true);\n }\n }", "function init() {\n let calc={ \n inputA:\"\", //Input done in strings to avoid calculating values \n inputB:\"\", //of each multi-digit input since they will be entered \n operator:\"\", //backwards (Left To Right)\n result:\"\",\n };\n //Binding DOM elements to variables \n const numberBtn=document.querySelectorAll('.numbers'); //binds a 'nodelist' of all numbers to the variable\n const dotBtn=document.querySelector('#dot'); //binds \".\" Button to variable\n const operatorBtn=document.querySelectorAll('.operation'); //binds a 'nodelist' of all operations to the variable\n const equalsBtn=document.querySelector('#equal'); //binds \"=\" Button to variable\n const allClearBtn=document.querySelector('#allClear'); //binds \"AC\" Button to variable\n const clearBtn=document.querySelector('#clear'); //binds \"C\" Button to variable\n const extraBtn=document.querySelector('.extra');\n //Binding DOM elements to variables \n \n //Event Handlers///////////////////////////////////////\n //waits for when a 'number' is clicked\n numberBtn.forEach((button)=>{ //Goes through each element in the node list and add an event listener to it\n button.addEventListener('click',(event)=>{ \n inputHandling(calc,event.target.textContent);\n });\n });\n\n //waits for when the decimal point button is clicked\n dotBtn.addEventListener('click',()=>{\n dotHandling(calc);\n });\n\n ////waits for when the operation button(+,-,*,/,%) is clicked\n operatorBtn.forEach((button)=>{ //Goes through each element in the node list and add an event listener to it\n button.addEventListener('click',(event)=>{\n operatorHandling(calc,event.target.textContent)\n });\n });\n\n //waits for when the 'Equals to'(=) button is clicked\n equalsBtn.addEventListener('click',()=>{\n equalsHandling(calc);\n });\n \n //waits for when the 'All Clear'(AC) button is clicked\n allClearBtn.addEventListener('click',()=>{\n allClearHandling(calc);\n });\n\n //waits for when the 'Clear'(C) button is clicked\n clearBtn.addEventListener('click',()=>{\n backspaceHandling(calc);\n });\n\n //waits for when the 'EXTRA' button is clicked\n extraBtn.addEventListener('click',()=>{\n extraBtn.classList.add(\"lock\");\n advancedPanel(calc)\n });\n\n //waits for when the user presses a key using a keyboard\n document.addEventListener('keydown',(event)=>{\n keyboardInputs(calc,event.key)\n });\n //End of Event Handlers\n}", "handleClick(event) {\r\n const value = event.target.value; // get the value from the target element (button)\r\n switch (value) {\r\n case '=':\r\n { // if it's an equal sign, use the eval module to evaluate the question\r\n // convert the answer (in number) to String\r\n const answer = eval(this.state.question).toString();\r\n // update answer in our state.\r\n this.setState({ answer });\r\n break;\r\n }\r\n case 'Clear All':\r\n {\r\n // if it's the CA sign, just clean our question and answer in the state\r\n this.setState({ question: '', answer: '' });\r\n break;\r\n }\r\n case 'Delete':\r\n {\r\n var str = this.state.question;\r\n str = str.substr(0, str.length - 1);\r\n this.setState({ question: str });\r\n break;\r\n }\r\n default:\r\n {\r\n // for every other commmand, update the answer in the state\r\n this.setState({ question: this.state.question += value })\r\n break;\r\n }\r\n }\r\n }", "function pressed(num){\n\tif (num == 1) {\n\t\teensButton.style.background = \"green\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = true;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse if (num == 2) {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"green\";\n\t\thuidig = false;\n\t\tsubmitButton.style.display = \"inline-block\"\n\t}\n\telse {\n\t\teensButton.style.background = \"grey\";\n\t\toneensButton.style.background = \"grey\";\n\t\thuidig = null;\n\t\tsubmitButton.style.display = \"none\"\n\t}\n}", "function operatorPressed(){\n if(num1 == this){\n return;\n }\n if(num1 == null){\n ++i;\n num1 = totalInt1;\n }\n if(num2 == null) {\n num2 = totalInt2;\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n ++i;\n // inputs[i] = val;\n }else{\n var val = $(this).text();\n inputs.push(val);\n $(\"#displayScreen p\").text(val);\n\n }\n if(inputs[0] == \"\"){\n inputs = [\"\"];\n i = 0;\n return;\n }\n operator = $(this).text();\n}", "function chooseAction(){\n text.innerHTML += '<p><br> Vad vill du göra? <br> - Slå <br> - Ge upp <br> - Korgen </p>'\n button.onclick = chosenAction\n\n function chosenAction(){\n switch (input.value.toLowerCase()){\n case 'slå': \n chooseHitWitchOrWolf()\n break\n\n case 'ge upp':\n text.innerHTML += '<p> Pressen är för stor för dig. Du ger upp</p>'\n youDied()\n break\n\n case 'korgen':\n checkBasket()\n break\n\n default:\n text.innerHTML += wrongInput\n button.onclick = chosenAction\n }\n }\n\n}", "handleButtonPress(button) {\n const {isResult} = this.state;\n let {first, second, operator} = this.state;\n\n switch (button) {\n case '0':\n if (!isResult) {\n if (!operator) {\n if (first[0] !== '0' || first.length !== 1) {\n first += '0';\n }\n } else if (second[0] !== '0' || second.length !== 1) {\n second += '0';\n } else {\n second = '0';\n }\n\n this.setState({first, second, operator});\n } else {\n this.setState({\n first: '0',\n second: '',\n operator: '',\n result: 0,\n isResult: false,\n });\n }\n\n break;\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 (!isResult) {\n if (!operator) {\n if (first[0] === '0' && first.length === 1) {\n first = button;\n } else {\n first += button;\n }\n } else if (second[0] === '0' && second.length === 1) {\n second = button;\n } else {\n second += button;\n }\n\n this.setState({first, second, operator});\n } else {\n this.setState({\n first: button,\n second: '',\n operator: '',\n result: 0,\n isResult: false,\n });\n }\n\n break;\n case '.':\n if (!operator) {\n if (!first.includes('.')) {\n first += button;\n }\n } else if (!second.includes('.')) {\n second += button;\n }\n\n this.setState({first, second, operator});\n\n break;\n case '+':\n case '−':\n case '×':\n case '÷':\n if (!operator) {\n operator = button;\n\n this.setState({first, second, operator});\n } else {\n this.getResult();\n }\n break;\n case '=':\n this.getResult();\n break;\n default:\n }\n }", "function numberPressed() {\n\n //all of my values that I am getting from the button pressing I am storing in an array (inputs[]).\n //the variable totalInt1 is used as a snapshot of what the current index in the array is at that time.\n if($(this).text() == '.'){\n if(inputs[i].includes(\".\")){\n return;\n }\n }\n if(num1 == null) {\n var val = $(this).text();\n inputs[i] += val;\n totalInt1 = inputs[i];\n $(\"#displayScreen p\").text(totalInt1);\n }\n else if(num1 != null && num2 !=null){\n var ogOperator = inputs[inputs.length-3];\n num1 = doMath(num1 , num2 , ogOperator);\n num2 = null;\n ++i;\n ogOperator = operator;\n }\n else if(num2 == null) {\n var val = $(this).text();\n if(inputs[i] == null){\n inputs[i] = \"\";\n }\n inputs[i] += val;\n totalInt2 = inputs[i];\n $(\"#displayScreen p\").text(totalInt2);\n }\n equalFire = false;\n}", "function min1() {\n\n /***** ACTION *****/\n buttonPress(-1);\n}", "function processInput() {\r\n let construction = $(\"#opaqueThick\").val();\r\n let constructionType = $(\"#insulationOptions option:selected\").val();\r\n let window = $(\"#windowSlider\").val();\r\n let chapters = $(\"#chapters\").val()\r\n \r\n\r\n draw(construction, window);\r\n opaqueThick(construction, constructionType);\r\n calculateOutputBoxes(construction, window);\r\n concept();\r\n\r\n \r\n\r\n}", "function callNextActionOrExit(answer) {\n if (answer.userSelection === \"View Products for Sale\") {\n console.log(\"You want to view products\");\n viewProducts();\n } else if (answer.userSelection === \"View Low Inventory\") {\n console.log(\"You want to view inventory\")\n viewLowInventory();\n } else if (answer.userSelection === \"Add to Inventory\") {\n console.log(\"You want to add to inventory\")\n addToInventory();\n } else if (answer.userSelection === \"Add New Product\") {\n console.log(\"You want to add a new product\")\n getNewItem();\n } else {\n database.endConnection();\n }\n}", "function run() {\n app.selection = null;\n btnsState = [bezierBtn.value, flushBtn.value, cornerBtn.value, brokenBtn.value, flatBtn.value];\n processPoints(btnsState, selPaths, tolValue.text * 1);\n sPoints.text = 'Selected Points: ' + getSelectedPoints(selPaths);\n }", "function events() {\r\n\taddition();\r\n\tcounter();\r\n\tcheckForm();\r\n}", "_buttonClickHandler() { }", "function clickDigit(number) {\n if (active==\"input\") {\n\n if ((decimalPoints + digitPoints) > 9) {\n return;\n }\n\n if (decimalActive) {\n decimalPoints ++;\n\n if (input >= 0) {\n input += number*Math.pow(10,(-1)*(decimalPoints));\n }\n\n else {\n input -= number*Math.pow(10,(-1)*(decimalPoints));\n }\n }\n\n else {\n\n if (input == 0 && number ==0) {\n return\n }\n\n else {\n digitPoints ++;\n\n if (input >= 0) {\n input = (input*10)+number;\n }\n\n else {\n input = (input*10)-number;\n }\n\n }\n\n }\n\n setScreen(\"input\");\n\n }\n\n else if (active==\"calculation\") {\n input = number;\n digitPoints=1;\n\n setScreen(\"input\");\n }\n\n else {\n setScreen(\"ERROR\");\n }\n\n}", "function handlePasteButtonPressed() {\n let q = $$('question');\n q.innerText = 'Your average reading speed is ' + (parseFloat(global_wpm)).toFixed(1) +\n ' words per minute.\\nPaste the text you would like to read below and press calculate.\\n' +\n 'If you also have a link, press the corresponding button to enter it.'\n if ($$('link_button') != null){\n $$('link_button').remove();\n }\n if ($$('link_input') != null){\n $$('link_input').remove();\n }\n if ($$('link_submit_button') != null){\n $$('link_submit_button').remove();\n }\n if ($$('time_to_read') != null){\n $$('time_to_read').remove();\n }\n $$('paste_button').remove();\n let paste_box = makePasteBox();\n let calculate_button = makeCalculatePastedButton();\n let link_button = makeLinkButton();\n q.after(paste_box);\n paste_box.after(calculate_button);\n calculate_button.after(link_button)\n}", "handleInteraction(e) {\n // If the event is coming from physical keyboard and catching with 'keydown'\n if (e.type == \"keydown\") {\n const char = qwerty.querySelectorAll(\"button\"); //find all the buttons\n for (let i = 0; i < char.length; i++) {\n const button = char[i];\n const buttonText = button.innerText;\n if (e.key.toLowerCase() == buttonText) {\n // if the buttons has the text of the key pressed\n\n button.disabled = true; //disable the button\n\n if (this.activePhrase.checkLetter(buttonText)) {\n //if active phrase has the button text\n button.className = \"chosen\"; //change the class of button to chosen\n this.activePhrase.showMatchedLetter(buttonText); //display the matched letter\n if (this.checkForWin()) {\n this.gameOver(true); //check if the user is won. then display gameOver\n }\n } else {\n if (button.className != \"wrong\") {\n //if the button class is not already wrong\n button.className = \"wrong\"; //set it to wrong\n this.removeLife(); //remove life\n }\n }\n }\n }\n //If the event is coming the mouse click\n } else if (e.type == \"click\") {\n e.disabled = true;\n const button = e.target;\n\n const buttonText = button.textContent;\n\n if (this.activePhrase.checkLetter(buttonText)) {\n //if active phrase has the button text\n button.className = \"chosen\"; //change the class of button to chosen\n this.activePhrase.showMatchedLetter(buttonText); //display the matched letter\n if (this.checkForWin()) {\n this.gameOver(true); //check if the user is won. then display gameOver\n }\n } else {\n if (button.className != \"wrong\") {\n //if the button class is not already wrong\n button.className = \"wrong\"; //set it to wrong\n this.removeLife(); //remove life\n }\n }\n }\n }", "function buttonPressed(event) {\n choice = event.target.id\n \n // Check if the id of the button matches the answer field of the prompt.\n if (choice == game_data.comparison) {\n correctResponse();\n } \n else {\n wrongResponse();\n }\n}", "function startButton(){\n hunger();\n happy();\n knowledge();\n \n}", "function submitConsoleInput(event, $value){\n var input = $('#input');\n\n switch (event.keyCode) {\n case 13: //enter\n document.getElementById(\"input\").value = \"\";\n Module.print(\"> \" + $value);\n commandsArray.push($value);\n commandsArrayIndex = commandsArray.length;\n\n switch ($value) {\n //If submitted command is 'time' toggle the button.\n case 'time':\n toggleTime();\n break;\n default:\n interpret($value);\n break;\n }\n break;\n\n //Handle command history\n case 38: //arrow up\n if (commandsArrayIndex > 0){\n commandsArrayIndex--;\n }\n input.val(commandsArray[commandsArrayIndex]);\n input.caretToEnd();//Place the text cursor at the end of the line.\n break;\n case 40: //arrow down\n if (commandsArrayIndex < commandsArray.length){\n commandsArrayIndex++;\n }\n input.val(commandsArray[commandsArrayIndex]);\n break;\n }\n\n}", "function onButtonPress(e) {\n\t\tvar $button = $(e.currentTarget),\n\t\t\t action = $button.data(\"action\"), //look for data-action = \"...\" and applies the action in \"...\"\n\t\t\t value = $display.value(); //might be .val but that doesn't highlight blue\n\n\t\tif (value == 0) {\n\t\t\tvalue = action;\n\t\t} else {\n\t\t\tvalue += action;\n\t\t}\n\n\t\tupdateDisplay(value); // ** updateDisplay didn't highlight **\n\n}", "function submitHandler() {\n\tconst index = selectedPianoKey();\n\tif (index < 0) return;\n\tanswer['shown'] = true;\n\tpianoKeys[answer['index']].classList.add('correct');\n\tconst distance = answerDistance(index);\n\tif (distance == 0) {\n\t\tresultText.textContent = 'Correct!';\n\t\tconst scale = Math.round(100 * (1 - ramp));\n\t\tdetailsText.textContent = `Next one will be ${scale}% harder`;\n\t\tsetError(false);\n\t\tcontinueButton.classList.remove('hidden');\n\t\tcontinueButton.focus();\n\t} else {\n\t\tresultText.textContent = 'Game Over';\n\t\tcheckHighScore();\n\t\tpianoKeys[index].classList.add('incorrect');\n\t\ttryAgainButton.classList.remove('hidden');\n\t}\n\tsubmitButton.disabled = true;\n\tsubmitButton.classList.add('hidden');\n}", "handleInstructionsLocal(event){\n var curText = this.state.currentInstructionText;\n var whichButton = event.currentTarget.id;\n \n if(whichButton===\"left\" && curText > 1){\n this.setState({currentInstructionText: curText-1});\n }\n else if(whichButton===\"right\" && curText < 4){ // this only for the 1st part of instructions right now: to be changed \n \n this.setState({currentInstructionText: curText+1});\n }\n if(whichButton===\"right\" && curText === 3){\n this.setState({readyToProceed: true});\n }\n }", "handleInput(keyPressed){\n // don't handle input when game is not running or when player is hit\n if (gameStarted === false || player.hit === true){\n return;\n }\n switch (keyPressed) {\n case 'left':\n if (this.col > 1) {\n this.col -= 1;\n }\n break;\n case 'right':\n if (this.col < 5) {\n this.col += 1;\n }\n break;\n case 'up':\n if (this.row > 1) {\n this.row -= 1;\n } else {\n levelUp();\n this.col = 3;\n this.row = 4;\n }\n break;\n case 'down':\n if (this.row < 5) {\n this.row += 1;\n }\n break;\n }\n // only check if fruit is taken when player changes posiion\n checkFruitTaken();\n }", "function runCalculator() {\n document.querySelector(\".main\").addEventListener(\"click\", function(event) {\n if (event.target.tagName === \"BUTTON\") {\n buttonClick(event.target.innerText);\n }\n });\n}", "handleInteraction(clickedElement, method) {\n\n // define checkLetter to be used \n // to hold if the letter guessed is correct or not\n let checkLetter;\n if(method === \"virtual\") { // virtual keyboard used\n\n // check to see if guessed correct letter\n checkLetter = this.activePhrase.checkLetter(clickedElement.textContent);\n \n // disable the letter button clicked\n clickedElement.disabled = true;\n \n\n if (checkLetter) { // guessed correct letter\n // add css class \"chosen\"\n clickedElement.classList.add(\"chosen\");\n\n // show guessed letter on the UI\n this.activePhrase.showMatchedLetter(clickedElement.textContent);\n\n // check if player won the game\n if(this.checkForWin()) {\n // end the game\n this.gameOver(\"won\");\n }\n\n } else {\n // add css class \"wrong\"\n clickedElement.classList.add(\"wrong\");\n\n // remove a life\n this.removeLife();\n\n }\n } else { // physical keyboard used\n \n // virtualButton will hold the virtual button that holds the letter that was guessed\n let virtualButton;\n\n // reference all qwerty buttons\n const $qwertyButtons = $(\"#qwerty button\");\n\n // iterate through the virtual buttons to compare with the letter guessed\n $qwertyButtons.each( (i, el) => {\n\n // let's find the button that holds the letter guessed\n if(clickedElement === el.textContent) {\n virtualButton = el;\n }\n });\n\n // disable button \n if(virtualButton.disabled === false) {\n\n // check to see if guessed correct letter\n checkLetter = this.activePhrase.checkLetter(clickedElement);\n if(checkLetter) {\n // add css class \"chosen\"\n virtualButton.classList.add(\"chosen\");\n \n // show guessed letter\n this.activePhrase.showMatchedLetter(clickedElement);\n \n // check if player won game\n if(this.checkForWin()) {\n this.gameOver(\"won\");\n }\n } else {\n // add css class \"wrong\"\n virtualButton.classList.add(\"wrong\");\n \n // remove a life for wrong guesses\n this.removeLife();\n }\n }\n\n // disable virtual key\n virtualButton.disabled = true;\n }\n }", "function letterPressedLogic() {\n let letter = buttonP.target.value;\n switch (letter) {\n case 'a':\n handleLetterPress('a');\n break;\n case 'b':\n handleLetterPress('b');\n break;\n case 'c':\n handleLetterPress('c');\n break;\n case 'd':\n handleLetterPress('d');\n break;\n case 'e':\n handleLetterPress('e');\n break;\n case 'f':\n handleLetterPress('f');\n break;\n case 'g':\n handleLetterPress('g');\n break;\n case 'h':\n handleLetterPress('h');\n break;\n case 'i':\n handleLetterPress('i');\n break;\n case 'j':\n handleLetterPress('j');\n break;\n case 'k':\n handleLetterPress('k');\n break;\n case 'l':\n handleLetterPress('l');\n break;\n case 'm':\n handleLetterPress('m');\n break;\n case 'n':\n handleLetterPress('n');\n break;\n case 'o':\n handleLetterPress('o');\n break;\n case 'p':\n handleLetterPress('p');\n break;\n case 'q':\n handleLetterPress('q');\n break;\n case 'r':\n handleLetterPress('r');\n break;\n case 's':\n handleLetterPress('s');\n break;\n case 't':\n handleLetterPress('t');\n break;\n case 'u':\n handleLetterPress('u');\n break;\n case 'v':\n handleLetterPress('v');\n break;\n case 'w':\n handleLetterPress('w');\n break;\n case 'x':\n handleLetterPress('x');\n break;\n case 'y':\n handleLetterPress('y');\n break;\n case 'z':\n handleLetterPress('z');\n break;\n default:\n console.log(\"Invalid character entered. Ignoring...\")\n }\n }", "function inputHandler(event) {\n let card = document.querySelector(\".input-button\").value;\n document.querySelector(\".result-output\").value = countCards(card);\n}", "function opPress(opCase) {\n strToNum();\n if (typeof stack[0] == 'undefined' || isNaN(activeNum)) {\n return;\n };\n if (!isNaN(activeNum)) {\n stack.unshift(activeNum);\n };\n y = stack.shift();\n x = stack.shift();\n switch (opCase) {\n case \"a\":\n answer = x + y;\n break;\n case \"s\":\n answer = x - y;\n break;\n case \"m\":\n answer = x * y;\n break;\n case \"d\":\n answer = x / y;\n break;\n }\n clearActive();\n stack.unshift(answer);\n displayStack();\n }", "function userButtonPressAction() {\n $(\".btn\").click(function() {\n if(!isClickPatternOrderedSubsetOfGamePattern()) {\n gameOver();\n return;\n }\n if(userClickPattern.length < gamePattern.length)\n return;\n\n /*if user gets to this point, then the clickPattern must equal the\n gamePattern. So, the user will go on to the next level*/\n userClickPattern = [];\n setTimeout(nextLevel, 1000);\n\n });\n}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n {\n var args = {\n target: [{ id: \"frmOption\", focus: true }]\n };\n gw_com_module.objToggle(args);\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"취소\":\n {\n closeOption({});\n }\n break;\n }\n\n }", "function dispatcher(event){\n\t\n\tif (event.target.id === \"dot\"){\n\t\tcalculation['operand'] += '.'\n\t\tdisplay.textContent = calculation['operand']\n\t\treturn;\n\t}\n\t\n\t// Operands triggers when number is pressed\n\tif (event.target.classList.contains(\"operand\")){\n\t\tlet operand = parseFloat(event.target.firstChild.nodeValue);\n\t\thandleOperand(operand);\n\t\treturn;\n\t\t\n\n\t// Operators triggers when +-*/= is pressed\n\t}else if (event.target.classList.contains(\"operator\")){\n\t\tlet operator = event.target;\n\t\thandleOperator(operator.firstChild.nodeValue);\n\t\treturn;\n\t\n\t// Inverse the number\n\t}else if (event.target.id === \"inverse\"){\n\t\tinverse();\n\n\t}else if (event.target.id === \"backspace\"){\n\t\tbackspace();\n\t\t\n\t// Clear the display and calculation object\t\n\t}else if (event.target.id === \"clear\"){\n\t\tclear();\n\t}\n\n}", "function UserInputs(action, input) {\n switch (action) {\n case \"concert-this\":\n runBandsInTown(input);\n fixString(input)\n break;\n case \"spotify-this-song\":\n runSpotify(input);\n fixString(input)\n break;\n case \"movie-this\":\n runOmdb(input);\n fixString(input)\n break;\n case \"do-what-it-says\":\n runRandom(input);\n break;\n default:\n console.log(\"\\n--------------------------------------------------------\");\n console.log(\n \"Please enter a valid argument, such as:\\n\\nnode liri.js movie-this [MOVIE TITLE]\\n\\nnode liri.js spotify-this-song [SONG TITLE]\\n\\nnode liri.js concert-this [ARTIST NAME]\\n\\nnode liri.js do-what-it-says\"\n );\n console.log(\n \"--------------------------------------------------------\\n\\n\"\n );\n }\n}", "function operatorUsed(operatorButtonPressed)\n{ //first if statement doesn't allow an operator to be pressed without a number pressed first\n if (number1 != \"\")\n \n //switch statement to take the operator button pressed\n //on the calculator and change the operator variable accordingly\n if (number2 == \"\")\n {\n switch(operatorButtonPressed){\n case \"+\":\n operator = \"+\";\n break;\n\n case \"-\":\n operator = \"-\";\n break;\n\n case \"*\":\n operator = \"*\";\n break;\n\n case \"/\":\n operator = \"/\";\n break;\n }\n console.log(\"this is the first section\")\n operatorClicked = true;\n document.getElementById(\"screenTextTop\").textContent = number1 + \" \" + operator + \" \" + number2;\n } \n\n if (number2 != \"\")\n {\n switch(operatorButtonPressed){\n case \"+\":\n operator = \"+\";\n break;\n\n case \"-\":\n operator = \"-\";\n break;\n\n case \"*\":\n operator = \"*\";\n break;\n\n case \"/\":\n operator = \"/\";\n break;\n }\n\n \n console.log(\"this is the second section\")\n number1 = number3;\n number3 = \"\";\n number2 = \"\";\n\n document.getElementById(\"screenTextTop\").textContent = number1 + \" \" + operator + \" \" + number2;\n document.getElementById(\"screenTextBottom\").textContent = \"\"; \n }\n\n \n}", "handleInteraction(button){\n const key = button.textContent;\n const checkKey = this.activePhrase.checkLetter(key);\n\n if (checkKey) {\n button.disabled = true;\n button.className = 'chosen';\n this.activePhrase.showMatchedLetter(key);\n this.checkForWin()\n \n if (this.checkForWin() === true) {\n this.gameOver();\n }\n \n \n } else if (!checkKey) {\n this.removeLife()\n button.disabled = true;\n button.className = 'wrong';\n \n }\n this.resetGame()\n \n }", "handleInteraction(button) {\n let letter = button.textContent;\n if(this.activePhrase.checkLetter(letter)) {\n if(!button.classList.contains('chosen')) {\n button.classList.add('chosen');\n button.disabled = true;\n this.activePhrase.showMatchedLetter(letter);\n if(this.checkForWin()) {\n this.gameOver(true);\n }\n }\n \n } else {\n if(!button.classList.contains('wrong')) {\n button.classList.add('wrong');\n button.disabled = true;\n this.removeLife();\n }\n }\n }", "handleInteraction(button) {\r\n // Disable on screen button\r\n button.disabled = true;\r\n\r\n if(this.activePhrase !== null) {\r\n if (this.activePhrase.checkLetter(button.textContent)) {\r\n // if selected letter was correct: add 'chosen' class to the on screen keyboard letter and call showMatchedLetter()\r\n button.classList.add('chosen');\r\n this.activePhrase.showMatchedLetter(button.textContent);\r\n } else {\r\n // if selected letter was wrong: add 'wrong' class to the on screen keyboard letter and call removeLife()\r\n button.classList.add('wrong');\r\n this.removeLife();\r\n }\r\n\r\n // Check if the player has won (checkForWIn()) and call gmaeOver()\r\n if (this.checkForWin()) {\r\n this.gameOver();\r\n }\r\n }\r\n }", "function setupButtons(){\n //speak(quiz[currentquestion]['question'])\n\t\t$('.choice').on('click', function(){\n\t\tsynth.cancel();\n is_on = 0;\n\t\tpicked = $(this).attr('data-index');\n\t\tspeak(quiz[currentquestion]['choices'][picked], LINGUA_RISPOSTA);\n\t\tshow_button();\n\t\t// risposte in francese\n\t\t$('.choice').removeAttr('style').off('mouseout mouseover');\n\t\t$(this).css({'font-weight':'900', 'border-color':'#51a351', 'color':'#51a351', 'background' : 'gold'});\n\t\tif(submt){\n\t\t\t\tsubmt=false;\n\t\t\t\t$('#submitbutton').css({'color':'#fff','cursor':'pointer'}).on('click', function(){\n\t\t\t\t$('.choice').off('click');\n\t\t\t\t$(this).off('click');\n\t\t\t\tprocessQuestion(picked);\n //\n\t\t\t\t});\n\t\t\t}\n\t\t})\n\t}", "function handleInput() {\n process(input.value());\n}", "function handleInput() {\n process(input.value());\n}", "handleInput(input) {\n\t\t\n\t}", "function processButton(param) {\n\n switch (param.element) {\n case \"조회\":\n case \"실행\":\n {\n processRetrieve({});\n }\n break;\n case \"닫기\":\n {\n processClose({});\n }\n break;\n }\n\n }" ]
[ "0.719733", "0.6718038", "0.66552764", "0.66339606", "0.6568104", "0.648824", "0.6469685", "0.6455676", "0.6441677", "0.6415753", "0.64050627", "0.6402349", "0.63438404", "0.63095206", "0.63086486", "0.62896854", "0.62779814", "0.62677115", "0.62342805", "0.6220707", "0.62156266", "0.6214454", "0.6213186", "0.61795384", "0.61781883", "0.6174435", "0.61707413", "0.61607724", "0.6152123", "0.61094624", "0.61001843", "0.6087144", "0.6064848", "0.60646516", "0.6060416", "0.60524887", "0.6049947", "0.6049939", "0.6042266", "0.6041645", "0.6040701", "0.6032498", "0.60258657", "0.6008352", "0.5986052", "0.5978869", "0.59618515", "0.5959047", "0.59523815", "0.5951914", "0.5948215", "0.5934686", "0.59337103", "0.5930243", "0.5929296", "0.5921471", "0.5917684", "0.5910609", "0.58950835", "0.5878765", "0.58768874", "0.58672315", "0.5864185", "0.58627874", "0.58584803", "0.5855055", "0.5845663", "0.5845346", "0.5841053", "0.58404016", "0.58334273", "0.5831394", "0.58254504", "0.5821952", "0.581892", "0.5815952", "0.58086205", "0.58075833", "0.58030754", "0.5796018", "0.5795817", "0.57857704", "0.5779854", "0.5775717", "0.5773711", "0.57674277", "0.576623", "0.57658803", "0.57655257", "0.5763326", "0.57598376", "0.5752457", "0.57449794", "0.5739095", "0.5736223", "0.57359576", "0.57329595", "0.57329595", "0.5732578", "0.5732017" ]
0.57955366
81
function determines how display will be updated
function updateDisplay(input) { //if display is blank and input isn't zero or solution has been returned if ((display.innerHTML === "0" && input !== "0") || opChain === 0 || solutionReturned === true) { //if solution is displayed and input is an operator or display is blank and input is an operator if ((solutionReturned === true && !isNumeric(input)) || (display.innerHTML === "0" && !isNumeric(input))) { //set solution to false because operation chain is increasing solutionReturned = false; //add input to the chain chainOperation(input); //add input to the display display.innerHTML += input; } else { //if above conditions not met, clear the chain, input replaces blank display state of 0 and replaces default 0 in operation chain solutionReturned = false; clearOpChain(); display.innerHTML = input; opChain.push(input); } } else { //if not starting from blank state, add input to display and operation chain display.innerHTML += input; chainOperation(input); } displaySub.innerHTML = opChain.join(""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_onUpdateDisplay() {}", "function changeDisplay(){\n}", "function updateDisplay () {\n\n showValue('.held-value',heldValue);\n showValue('.next-Value',nextValue);\n}", "function updateDisplay() {\n\tshowValue(\".next-value\", nextValue);\n\tshowValue(\".held-value\", heldValue);\n}", "function updateDisplay() { \n setBoundaries();\n showFinish();\n\n //Set tracking display\n setText(\"tracking\", index + 1 + \"of\" + list.length);\n setText(\"text\", list[index]);\n\n\n}", "function update_display(){\n // canvas\n draw();\n // DOM displaying results\n display_questions_list();\n}", "function updateDisplay() {\n if (view == 'assignments') {\n $('#graded-items').hide();\n\n $('#assignments').show();\n $('.assignment-progress-bar').show();\n updateAssignments((a) => {\n assignments = a;\n displayAssignments(assignments);\n });\n } else if (view == 'gradedItems') {\n $('#assignments').hide();\n $('.assignment-progress-bar').hide();\n\n $('#graded-items').show();\n updateGradedItems((g) => {\n gradedItems = g;\n displayGradedItems(gradedItems);\n });\n }\n }", "function updateDisplay() {\n if (buffer.trigonometry){\n displaySwitches.style.display = \"flex\";\n } else if ( displaySwitches.style.display !== \"none\"){\n displaySwitches.style.display = \"none\";\n }\n if (buffer.operationType === \"Unary\"){\n display.innerHTML = `${buffer.operation}(${buffer.firstOperand})`;\n if (buffer.operation === \"x!\") { display.innerHTML = `${buffer.firstOperand}!`; }\n } else\n display.innerHTML = buffer.firstOperand+buffer.operation+buffer.secondOperand;\n\n for( let i in historyArr){\n historyItems[i].style.display = \"flex\";\n historyItems[i].innerHTML = historyArr[i];\n }\n}", "async updateDisplay(changed) {\n this.modifierStack = game.user.getFlag('gurps', 'modifierstack')\n this.sum()\n if (this.SHOWING) {\n this.editor.render(true)\n }\n this.refresh()\n }", "function updateDisplay(value) {\n\t\t$display.value(value);\n\t}", "function updateDisplay(info) {\n\n display.innerHTML = info;\n\n }", "function updateDisplay() {\n $(\"#display\").html(displayValue);\n}", "function updateDisplay() {\n\t/*$(\"#launched\").text(\"Application launched: \" + launched_count);\n\t$(\"#resumed\").text(\"Application paused: \" + paused_count);\n\t$(\"#paused\").text(\"Application resumed: \" + resumed_count); //A fucntion to update the display when an event happens*/\n\t\n\tdocument.getElementById (\"launched\").innerHTML = \"Application launched: \" + launched_count;\n\tdocument.getElementById (\"resumed\").innerHTML = \"Application paused: \" + paused_count;\n\tdocument.getElementById (\"paused\").innerHTML = \"Application resumed: \" + resumed_count;\n}", "function update_displays() {\n dispAperture.innerHTML = \"\" + apertureList[apertureIndex];\n dispShutter.innerHTML = \"\" + shutterList[shutterIndex];\n dispIso.innerHTML = \"\" + isoList[isoIndex];\n }", "doodle() {\n this.update()\n this.display()\n }", "_initDisplay(value) {}", "updateDisplay() {\n const ttDisplay = this.player_.getChild('textTrackDisplay');\n\n if (ttDisplay) {\n ttDisplay.updateDisplay();\n }\n this.saveSettings();\n }", "updateDisplay() {\n this.d1.value = this.twoDigitNum(this.app.t1);\n this.d2.value = this.twoDigitNum(this.app.t2);\n this.d3.value = this.twoDigitNum(this.app.t3);\n }", "updateDisplay() {\n this.currentText.innerText = this.formatNumber(this.currentTextValue);\n if (this.operation !== undefined) {\n this.previousText.innerText = `${this.previousTextValue} ${this.operation} `;\n } else {\n this.previousText.innerText = \"\";\n }\n }", "function show()\n{\n update();\n}", "function updateDisplays() {\n $(\"#wins-text\").text(wins);\n $(\"#losses-text\").text(losses);\n $(\"#crystal-core-text\").text(crystalValue);\n }", "function updateDisplay()\n {\n //We need to build a string to show. The first item is the current running total:\n var string = runningTotal;\n\n //Then we add the operator if they have pressed this\n if(hasPressedOperator)\n string += \" \" + currentOperator;\n \n //And finally we add the right operand, the value to add when equals is pressed.\n if(hasPressedOperand)\n string += \" \" + currentOperand;\n \n //We then simply set the value of the output field to the string we built\n document.getElementById(\"output\").value = string;\n }", "function Interpreter_UpdateDisplay()\n{\n\t//helpers\n\tvar uidObject, theObject;\n\t//loop through all of our iframes\n\tfor (uidObject in this.LoadedIFrames)\n\t{\n\t\t//get the object\n\t\ttheObject = this.LoadedIFrames[uidObject];\n\t\t//valid?\n\t\tif (theObject && theObject.HTML)\n\t\t{\n\t\t\t//purge all css data\n\t\t\tBrowser_RemoveCSSData_Purge(theObject.HTML.contentDocument);\n\t\t}\n\t}\n\t//purge all css data from main doc too\n\tBrowser_RemoveCSSData_Purge(document);\n\t//loop through all toplevel objects\n\tfor (uidObject in this.TopLevelObjects)\n\t{\n\t\t//get the object\n\t\ttheObject = this.TopLevelObjects[uidObject];\n\t\t//valid?\n\t\tif (theObject)\n\t\t{\n\t\t\t//update it with full recursion\n\t\t\ttheObject.UpdateDisplay(true);\n\t\t}\n\t}\n\t//rearrange the forms\n\tForm_RearrangeForms(this.FocusedFormId);\n\t//and reset this\n\tthis.FocusedFormId = [];\n\t//have we got a focused object id? (AND NOT IN DESIGNER)\n\tif (this.State && this.State.FocusedObjectId > 0)\n\t{\n\t\t//memorise it\n\t\tthis.FocusedObjectId = this.State.FocusedObjectId;\n\t}\n\t//we need to handle the tabs here\n\tthis.PreUpdatePostDisplay();\n}", "function updateDisplay(elem){\n \n activeContent = elem.innerHTML.replace(/<.+?>/g,\"\");\n if(activeContent == \"profiles\"){\n activeContent = \"SearchSpan\"\n toggle_visibility(\"SearchSpan\", \"SEARCHdiv\");\n } else if (activeContent == \"barplot\"){\n toggle_visibility(\"barplot\", \"VISUALIZEdiv\")\n } \n }", "function updateWhatToShow() {\n\tvar whatToShow = getValue(\"whatToShow\");\n\tvar showSinglePeriod = false;\n\tvar showCompare2periods = false;\n\tvar showThroughTime = false;\n\tvar showDistribution = false;\n\tvar showAllNoneGraphsTD = true;\n\tswitch (whatToShow) {\n\t\tcase \"SINGLE_PERIOD\":\n\t\t\tshowSinglePeriod = true;\n\t\t\tshowAllNoneGraphsTD = false;\n\t\t\tbreak;\n\t\tcase \"COMPARE_PERIODS\":\n\t\t\tshowCompare2periods = true;\n\t\t\tbreak;\n\t\tcase \"THROUGH_TIME\":\n\t\t\tshowThroughTime = true;\n\t\t\tswitchThroughTimeRange();\n\t\t\tbreak;\n\t\tcase \"DISTRIBUTION\":\n\t\t\tshowDistribution = true;\n\t\t\tshowAllNoneGraphsTD = false;\n\t\t\tbreak;\n\t}\n\t$$('td.singlePeriod').each(function(td) {td[showSinglePeriod ? 'show' : 'hide']()});\n\t$$('td.compare2periods').each(function(td) {td[showCompare2periods ? 'show' : 'hide']()});\n\t$$('td.throughTime').each(function(td) {td[showThroughTime ? 'show' : 'hide']()});\n\t$$('td.distribution').each(function(td) {td[showDistribution ? 'show' : 'hide']()});\n\t$('selectAllNoneGraphsTD')[showAllNoneGraphsTD ? 'show' : 'hide']();\n\tswitchAllItemCheckboxes(false);\n}", "changeDisplay() {\n this.displayMarkup = !this.displayMarkup;\n }", "function updateDisplay(){\n var num = $(this).text();\n var displayText = display.text();\n if (display.text() == '0'){\n display.text(num);\n } else {\n var output = display.text()+num;\n display.text(output);\n }\n }", "firstUpdated() {\n super.firstUpdated();\n this.updateDisplayValue();\n }", "function updateDisplay () {\n display.textContent = currentNum;\n}", "function displayChange() {\n now = new Date();\n\n if (display.on && nsConfigured && (bgNext < now.getTime())) {\n wakeupFetch();\n }\n}", "function updateDisplay(){\n currentElement.innerText = convertNumber(currentValue);\n\n if(operation != null) previousElement.innerText = `${convertNumber(previousValue)} ${operation}`; \n}", "function updateDisplay () {\n if (isGameOver()) {\n\n } else {\n $('h1.question').text(quiz.questions[quiz.currentQuestion].qn)\n $('h2.answer').text(quiz.questions[quiz.currentQuestion].factMsg)\n // hard coded display, only has 4 answers at a time. Each is displayed as a button, so can use the order (eg) that they appear in the dom to select them\n $('button').eq(0).text(quiz.questions[quiz.currentQuestion].options[0])\n $('button').eq(1).text(quiz.questions[quiz.currentQuestion].options[1])\n if (quiz.questions[quiz.currentQuestion].options[2]) {\n $('button').eq(2).text(quiz.questions[quiz.currentQuestion].options[2])\n } else {\n }\n $('button').eq(3).text(quiz.questions[quiz.currentQuestion].options[3])\n }\n}", "updateDisplayString() {\n this.displayString = 'Increase ' + this.name + ' by ' + this.value + ' ' + this.measuringUnit;\n }", "function refresh() {\n display.innerText = currentCalculation;\n}", "_replaceDisplay(value) {}", "function updateDisplays() {\n $(\"#displayQuestion\").html(response.results[questionNum].question);\n $(\"#displayAnswer\" + answerOrder[0]).html(response.results[questionNum].incorrect_answers[0]);\n $(\"#displayAnswer\" + answerOrder[1]).html(response.results[questionNum].incorrect_answers[1]);\n $(\"#displayAnswer\" + answerOrder[2]).html(response.results[questionNum].incorrect_answers[2]);\n $(\"#displayAnswer\" + answerOrder[3]).html(response.results[questionNum].correct_answer);\n $(\"#displayQuestionNumber\").html(questionNum + 1);\n $(\"#displayIncorrect\").html(incorrectCounter);\n $(\"#displayCorrect\").html(correctCounter);\n $(\"#displayTimeOut\").html(timeoutCounter);\n }", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}", "updateDisplay() {\n $('#steps .value').text(this.stepCounter);\n }", "function refreshDisplay(){\n env.disp.render() ;\n env.plot.render() ;\n}", "function updateScoreDisplay()\n{\n\tif(isP2Mode)\n\t{\n\t\t$(\"#best_score\").text(\"\");\n\t\t$(\"#p1_score\").text(\"Blue : \" + snake1.score);\n\t\t$(\"#p2_score\").text(\"Purple : \" + snake2.score);\n\t\t$(\"#tie_score\").text(\"Ties : \" + tie_score);\n\t}\n\telse\n\t{\n\t\t$(\"#best_score\").text(\"High score : \" + highscore);\n\t\t$(\"#p1_score\").text(\"\");\n\t\t$(\"#p2_score\").text(\"\");\n\t\t$(\"#tie_score\").text(\"\");\n\t}\n}", "function display(){\r\n\r\n \r\n}", "function updateDisplay () {\n if (isGameOver()) {\n if (whoWon() === 1) {\n $('#gameStatus').text('Gameover. The winner is Player1!')\n } else if (whoWon() === 2) {\n $('#gameStatus').text('Gameover. The winner is Player2!')\n } else {\n $('#gameStatus').text('Gameover. It\\'s a draw!')\n }\n }\n\n if (!isGameOver()) {\n $('#gameStatus').text('Q' + (quiz.currentQuestion + 1) + ') ' + 'It\\'s Player' + (quiz.currentQuestion % 2 + 1) + '\\'s turn')\n // update question\n var flagIndex = quiz.currentQuestion + 1\n $('#flag').css('background-image', 'url(./img/flag' + flagIndex + '.gif)')\n $('#choice1').text(quiz.questions[quiz.currentQuestion].choices[0])\n $('#choice2').text(quiz.questions[quiz.currentQuestion].choices[1])\n $('#choice3').text(quiz.questions[quiz.currentQuestion].choices[2])\n $('#choice4').text(quiz.questions[quiz.currentQuestion].choices[3])\n // update sccore\n $('#player1Score').text(quiz.player1Score)\n $('#player2Score').text(quiz.player2Score)\n }\n}", "updateDisplay() {\n this.currentValueElement.innerHTML = this.convertNumber(this.currentOperand);\n\n if (this.currentOperand.toString().length > 10) {\n this.currentValueElement.classList.add(`${this.selectors.smallClass}`);\n } else {\n this.currentValueElement.classList.remove(`${this.selectors.smallClass}`);\n }\n\n if (this.operation != null) {\n this.previousValueElement.innerHTML = \n `${this.convertNumber(this.previousOperand)} ${this.operation}`;\n } else {\n this.previousValueElement.innerHTML = '';\n }\n }", "function displayChanged() {\n if (display.on) {\n startTimer();\n } else {\n stopTimer();\n }\n}", "function refreshDisplayNoOver() {\n p.getBubbleDrawer().clear();\n drawScales();\n p.getBubbleDrawer().drawDate(year.current);\n drawBubbles();\n drawBubblesNames();\n p.getBubbleDrawer().display();\n}", "function onchange()\r\n{\r\n window.updateHeatmap();\r\n window.updateBar();\r\n window.updateLine();\r\n}", "function displayToScreen() {\n\n\n\t}", "function updateDisplay(){\n const display = document.querySelector('.calculator-screen');\n // update the value of screen from displayValue in calculator object\n display.value = calculator.displayValue;\n}", "updateDisplay() {\n this.currentOperandElement[0].value = this.getDisplayValue( this.currentOperand ) ;\n if ( this.operation != null ) {\n this.previousOperandElement[0].innerText = `${this.getDisplayValue(this.previousOperand)} ${this.operation}` ;\n } else {\n this.previousOperandElement[0].innerText = '' ;\n }\n }", "function updateOutput() { //\n\tfor (var i = 1; i <= numMonitors; i++) { //updates all output for only the monitors that are show\n\t\tcheckIfCustom(i);\n\t\tupdateResolution(i);\n\t\tdrawMonitor(i); //with animation\n\t\tdisplaySize(i);\n\t\tdisplayHeight(i);\n\t\tdisplayWidth(i);\n\t\tdisplayArea(i)\n\t\tdisplayAspectRatio(i);\n\t\tdisplayResolution(i);\n\t\tdisplayPixels(i);\n\t\tdisplayPPI(i);\n\t\tsearchMonitor(i);\n\t}\n displayTotalNumPixels();\n displayTotalWidth();\n displayTotalArea();\n \n displayTotalMonitorsCost();\n displayTotalSetupCost();\n}", "function updateTimerDisplay(){\n // Update current time text display.\n $('#current-time').text(formatTime( player.getCurrentTime() ));\n $('#duration').text(formatTime( player.getDuration() ));\n }", "function Interpreter_UpdatePostDisplay()\n{\n\tif (this.PostDisplayActive)\n\t\treturn;\n\tthis.PostDisplayActive = true;\n\t//loop through post displays (the array might be increased as we process commands)\n\tfor (var i = 0; i < this.PostDisplayCmds.length; i++)\n\t{\n\t\t//valid?\n\t\tif (this.PostDisplayCmds[i] !== null)\n\t\t{\n\t\t\t//get the interpreter object if already loaded\n\t\t\tvar theObject = this.LoadedObjects[this.PostDisplayCmds[i].Id];\n\t\t\t//object already loaded?\n\t\t\tif (theObject && theObject.HTML)\n\t\t\t{\n\t\t\t\t//switch on the command\n\t\t\t\tswitch (this.PostDisplayCmds[i].Command)\n\t\t\t\t{\n\t\t\t\t\tcase __INTERPRETER_CMD_TAB_ARRANGE:\n\t\t\t\t\t\t//arrange this tab\n\t\t\t\t\t\ttheObject.HTML.Arrange();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_TAB_SELECTION:\n\t\t\t\t\t\t//activate selection (notify its from us so no need to update post display)\n\t\t\t\t\t\ttheObject.HTML.Select(true);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_NOTIFY_LOADED:\n\t\t\t\t\t\t//notify\n\t\t\t\t\t\ttheObject.HTML.NotifyLoaded();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_SCROLL_POSITION:\n\t\t\t\t\t\t//update its scroll positions\n\t\t\t\t\t\tBasic_UpdateProperties(theObject, [__NEMESIS_PROPERTY_VERTICAL_SCROLL_POS, __NEMESIS_PROPERTY_HORIZONTAL_SCROLL_POS]);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_GROUPBOX_ARRANGE:\n\t\t\t\t\t\t//update its child area\n\t\t\t\t\t\tGroupBox_UpdateChildArea(theObject.HTML, theObject);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_EDIT_FOCUS:\n\t\t\t\t\t\t//get our id\n\t\t\t\t\t\tvar id = this.PostDisplayCmds[i].Id;\n\t\t\t\t\t\t//use the timeout\n\t\t\t\t\t\t__EVENTS_QUEUE.AddEvent(\"Edit_UpdateFocusLookAndFeelDelayed('\" + id + \"');\", 0);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_RESET_FONT:\n\t\t\t\t\t\t//has caption?\n\t\t\t\t\t\tif (theObject.HTML.CAPTION)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t//correct its font\n\t\t\t\t\t\t\ttheObject.HTML.CAPTION.style.fontFamily = \"'\" + theObject.HTML.CAPTION.style.fontFamily + \"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\t//report this\n\t\t\t\t\t\tCommon_Error(\"ProcessPostDisplay: Unknown Command->\" + this.PostDisplayCmds[i].Command);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t//empty the post display\n\tthis.PostDisplayCmds = [];\n\tthis.PostDisplayMap = {};\n\tthis.PostDisplayActive = false;\n\t//ask history for this variation\n\tvar variation = __SIMULATOR.History.Variations[this.State.UniqueId];\n\t//and obtain current order form\n\tvar aIds = variation && variation.FormRearrange ? variation.FormRearrange : [];\n\t//valid?\n\tif (aIds)\n\t{\n\t\t//rearrange the forms\n\t\t__SIMULATOR.NotifyControllerRequestRearrangeForms(aIds);\n\t}\n\t//and finalise with an update of the fixed objects\n\tthis.UpdateFixedObjectPositions();\n}", "function setDisplayText() {\n if (scoreboardCount <= scroreboardFetched) {\n footerViewLabel.setText(Alloy.Globals.PHRASES.showningPlayersTxt + ': ' + scoreboardCount + '/' + scoreboardCount + ' ');\n } else {\n footerViewLabel.setText(Alloy.Globals.PHRASES.showningPlayersTxt + ': ' + scroreboardFetched + '/' + scoreboardCount + ' ');\n }\n}", "function updateDisplay() {\n\n crawlerModel.user = _useVenueData ? _venueData.messages : _deviceData.messages;\n $scope.mode = ( _useVenueData ? _venueData.mode : _deviceData.mode ) || 'full-size';\n $scope.mode = 'full-size';\n\n getTVGrid();\n\n ogAds.getCurrentAd()\n .then( function ( currentAd ) {\n crawlerModel.ads = currentAd.textAds || [];\n } )\n .then( reloadTweets )\n .then( function () {\n\n $log.debug( \"Rebuilding hz scroller feed\" );\n var tempArr = [];\n crawlerModel.user.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ffffff' } } )\n } );\n\n crawlerModel.twitter.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#87CEEB' } } )\n } );\n\n crawlerModel.ads.forEach( function ( um ) {\n tempArr.push( { text: um, style: { color: '#ccf936' } } )\n } );\n\n tempArr = tempArr.filter( function ( x ) {\n return (x !== (undefined || !x.message));\n } );\n\n $scope.crawlerMessages = _.shuffle( tempArr );\n } );\n\n }", "function refreshDisplay(){\r\n resultsScreen.html(pressed);\r\n}", "updateDisplay() {\n Object(_yuion_svg_viewer__WEBPACK_IMPORTED_MODULE_3__[\"updateViewer\"])(this.viewer, {\n zoom: this.zoom,\n desired_zoom: this.zoom,\n center: this.center,\n desired_center: this.center,\n });\n }", "function update() {\n\t\tvar f = self.fm.getSelected(0);\n\t\treset();\n\n\t\tself._hash = f.hash;\n\t\tself.title.text(f.name);\n\t\tself.win.addClass(self.fm.view.mime2class(f.mime));\n\t\tself.name.text(f.name);\n\t\tself.kind.text(self.fm.view.mime2kind(f.link ? 'symlink' : f.mime)); \n\t\tself.size.text(self.fm.view.formatSize(f.size));\n\t\tself.date.text(self.fm.i18n('Modified')+': '+self.fm.view.formatDate(f.date));\n\t\tf.dim && self.add.append('<span>'+f.dim+' px</span>').show();\n\t\tf.tmb && self.ico.css('background', 'url(\"'+f.tmb+'\") 0 0 no-repeat');\n\t\tif (f.url) {\n\t\t\tself.url.text(f.url).attr('href', f.url).show();\n\t\t\tfor (var i in self.plugins) {\n\t\t\t\tif (self.plugins[i].test && self.plugins[i].test(f.mime, self.mimes, f.name)) {\n\t\t\t\t\tself.plugins[i].show(self, f);\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tself.url.hide();\n\t\t}\n\t\t\n\t\tself.win.css({\n\t\t\twidth : '420px',\n\t\t\theight : 'auto'\n\t\t});\n\t}", "function update_display() {\n var time_left = get_time_left();\n var time, hours, minutes, seconds;\n var price_display;\n if (time_left > 0) {\n\n hours = Math.floor(time_left / 3600);\n hours = hours < 10 ? '0' + hours : hours;\n\n minutes = Math.floor((time_left % 3600) / 60);\n minutes = minutes < 10 ? '0' + minutes : minutes;\n\n seconds = Math.floor(time_left % 60);\n seconds = seconds < 10 ? '0' + seconds : seconds;\n\n time = hours + ':' + minutes + ':' + seconds;\n\n } else {\n\n time = \"00:00:00\";\n hours = '00';\n minutes = '00';\n seconds = '00';\n\n }\n var money = (total_paid / 100) + ' uBTC' + '<br>';\n if (USD_price !== undefined)\n {\n money += '$' + (convert_satoshis_to_usd(total_paid)).toFixed(4);\n }\n\n if (price_per_second !== undefined)\n {\n var satoshis_per_hour = price_per_second * 3600;\n var price_amount, price_unit;\n if (satoshis_per_hour >= 100) {\n price_unit = 'uBTC';\n price_amount = satoshis_per_hour / 100;\n } else {\n price_unit = 'satoshis';\n price_amount = price_per_second;\n }\n price_display = price_amount + ' ' + price_unit + '<br />';\n if (USD_price !== undefined)\n {\n price_display += '$' + (convert_satoshis_to_usd(satoshis_per_hour)).toFixed(4);\n }\n }\n else\n {\n price_display = '?';\n }\n\n jQuery('#price_display').html(price_display);\n jQuery('#money_spent').html(money);\n jQuery('#hours').html(hours+\"<br />Hrs\");\n jQuery('#minutes').html(minutes+\"<br />Mins\");\n jQuery('#seconds').html(seconds+\"<br />Secs\");\n jQuery('#title_display').html(time);\n}", "function update() {\n if (oldNum == 0) {\n dispLastText.textContent = ``;\n dispCurrentText.textContent = `${newNum}`;\n } else {\n dispLastText.textContent = `${oldNum} ${operator}`;\n dispCurrentText.textContent = `${newNum}`;\n }\n}", "function update() {\n redrawView(evalContainer, evalVis, evalData);\n redrawView(detailContainer, detailVis, detailData);\n redrawView(messageContainer, messageVis, messageData);\n }", "function updateDisplay(values) {\n if(values.icon) {\n icon.setAttribute('data-icon', getIconCharacter(values.icon)); //set the icon\n stat_str.innerHTML = \"\";\n condition_str.innerHTML = values.condition_string;\n temp_str.innerHTML = values.feelslike_c + \"&deg;C/\" + values.feelslike_f + \"&deg;F\";\n location_str.innerHTML = values.location_string;\n }\n else {\n showStatus(\"oops, a tmprtr for your location could not be found.<br /><a href='/'>refresh</a>\");\n }\n}", "function updateDisplay() {\r\n const display = document.querySelector('.calculator-screen');\r\n display.value = calculator.displayValue;\r\n}", "function updateDisplay () {\n if (isGameOver()) {\n $('h1').text(' gameover. winner is ' + whoWon())\n } else {\n $('h1').text(quiz.currentQuestion + ') ' + quiz.questions[quiz.currentQuestion].prompt)\n // hard coded display, only has 4 answers at a time. Each is displayed as a button, so can use the order (eg) that they appear in the dom to select them\n $('button').eq(0).text(quiz.questions[quiz.currentQuestion].choices[0])\n $('button').eq(1).text(quiz.questions[quiz.currentQuestion].choices[1])\n $('button').eq(2).text(quiz.questions[quiz.currentQuestion].choices[2])\n $('button').eq(3).text(quiz.questions[quiz.currentQuestion].choices[3])\n }\n // update player scores regardless\n $('h3').eq(0).text('Player1: ' + quiz.player1Points)\n $('h3').eq(1).text('Player2: ' + quiz.player2Points)\n}", "function doDocDisplayScreenFor(display, newstate) {\n\n\t// backup initial color\n\tif (! display.attr(\"original-background-color\")) {\n\t\tdisplay.attr(\"original-background-color\", \n\t display.css(\"background-color\"))\n\t}\n\tif (! display.attr(\"original-border-color\")) {\n\t\tdisplay.attr(\"original-border-color\", \n\t\tdisplay.css(\"border-color\"))\n\t}\n\tswitch(newstate) {\n\tcase \"relations\":\n\t\tdisplay.animate({ backgroundColor: \"#aaaaaa\"}, 500)\n\t\tdisplay.css(\"border-color\",\"#888888\");\n\tbreak;\n\t\n\tcase \"edit\":\n\t\tdisplay.animate({ backgroundColor: \"#ffe0e0\"}, 500);\n\t\tdisplay.css(\"border-color\",\"#ff0000\");\n\tbreak;\n\t\n\tcase \"select\":\n\t\tdisplay.animate({ backgroundColor: \"#d8F5FF\"}, 500);\n\t\tdisplay.css(\"border-color\",\"#7AC5CD\");\n\tbreak;\n\t}\n\tdisplay.attr(\"status\",newstate)\t\n}", "function updateHPDisplay() {\n\t// Update the HP label\n\tvar temp = document.getElementById('currentHP');\n\ttemp.innerHTML = parseInt(displayedHP + 0.5);\n\n\t// Update the HP width\n\thpBoxCurrent.style.width = displayedHP / maxHP * 100 + '%';\n\n\t// Update the HP color\n\thpUpdateColor();\n}", "function updateElements() { //Main loop logic here.\r\n updateResourceDisplay();\r\n updateCoreDisplay();\r\n}", "function updateFunction() {\n \tupdatePreview();\n \tupdateHTMLCode();\n }", "function refreshDisplay() {\r\n\r\n if (useOfflineSync) {\r\n syncLocalTable().then(displayItems);\r\n } else {\r\n displayItems();\r\n }\r\n }", "function updateDisplay() {\n let input = document.getElementById(\"inputSpace\");\n input.innerHTML = calculator.displayValue;\n }", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\t\t\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false;\n\t\t }\n\t\t\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t return false;\n\t\t\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\t\t\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\t\t\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\t\t\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\t\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t return false;\n\t\t\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var focused = activeElt();\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\t\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\t\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\t\t\n\t\t display.updateLineNumbers = null;\n\t\t\n\t\t return true;\n\t\t }", "function updateDisplay(changes, suppressCallback) {\n if (!scroller.clientWidth) {\n showingFrom = showingTo = displayOffset = 0;\n return;\n }\n // Compute the new visible window\n var visible = visibleLines();\n // Bail out if the visible area is already rendered and nothing changed.\n if (changes !== true && changes.length == 0 && visible.from >= showingFrom && visible.to <= showingTo) return;\n var from = Math.max(visible.from - 100, 0), to = Math.min(doc.size, visible.to + 100);\n if (showingFrom < from && from - showingFrom < 20) from = showingFrom;\n if (showingTo > to && showingTo - to < 20) to = Math.min(doc.size, showingTo);\n\n // Create a range of theoretically intact lines, and punch holes\n // in that using the change info.\n var intact = changes === true ? [] :\n computeIntact([{from: showingFrom, to: showingTo, domStart: 0}], changes);\n // Clip off the parts that won't be visible\n var intactLines = 0;\n for (var i = 0; i < intact.length; ++i) {\n var range = intact[i];\n if (range.from < from) {range.domStart += (from - range.from); range.from = from;}\n if (range.to > to) range.to = to;\n if (range.from >= range.to) intact.splice(i--, 1);\n else intactLines += range.to - range.from;\n }\n if (intactLines == to - from) return;\n intact.sort(function(a, b) {return a.domStart - b.domStart;});\n\n var th = textHeight(), gutterDisplay = gutter.style.display;\n lineDiv.style.display = gutter.style.display = \"none\";\n patchDisplay(from, to, intact);\n lineDiv.style.display = \"\";\n\n // Position the mover div to align with the lines it's supposed\n // to be showing (which will cover the visible display)\n var different = from != showingFrom || to != showingTo || lastSizeC != scroller.clientHeight + th;\n // This is just a bogus formula that detects when the editor is\n // resized or the font size changes.\n if (different) lastSizeC = scroller.clientHeight + th;\n showingFrom = from; showingTo = to;\n displayOffset = heightAtLine(doc, from);\n mover.style.top = (displayOffset * th) + \"px\";\n code.style.height = (doc.height * th + 2 * paddingTop()) + \"px\";\n\n // Since this is all rather error prone, it is honoured with the\n // only assertion in the whole file.\n if (lineDiv.childNodes.length != showingTo - showingFrom)\n throw new Error(\"BAD PATCH! \" + JSON.stringify(intact) + \" size=\" + (showingTo - showingFrom) +\n \" nodes=\" + lineDiv.childNodes.length);\n\n if (options.lineWrapping) {\n maxWidth = scroller.clientWidth;\n var curNode = lineDiv.firstChild;\n doc.iter(showingFrom, showingTo, function(line) {\n if (!line.hidden) {\n var height = Math.round(curNode.offsetHeight / th) || 1;\n if (line.height != height) {updateLineHeight(line, height); gutterDirty = true;}\n }\n curNode = curNode.nextSibling;\n });\n } else {\n if (maxWidth == null) maxWidth = stringWidth(maxLine);\n if (maxWidth > scroller.clientWidth) {\n lineSpace.style.width = maxWidth + \"px\";\n // Needed to prevent odd wrapping/hiding of widgets placed in here.\n code.style.width = \"\";\n code.style.width = scroller.scrollWidth + \"px\";\n } else {\n lineSpace.style.width = code.style.width = \"\";\n }\n }\n gutter.style.display = gutterDisplay;\n if (different || gutterDirty) updateGutter();\n updateCursor();\n if (!suppressCallback && options.onUpdate) options.onUpdate(instance);\n return true;\n }", "function update() {\n\n\tupdateFocus();\n\tupdateFamilyTooltip();\n\tupdateHighlights();\n}", "function mouveMove() {\n refreshDisplay();\n}", "function updateDisplayIfNeeded(cm, update) {\n\t\t var display = cm.display, doc = cm.doc;\n\n\t\t if (update.editorIsHidden) {\n\t\t resetView(cm);\n\t\t return false\n\t\t }\n\n\t\t // Bail out if the visible area is already rendered and nothing changed.\n\t\t if (!update.force &&\n\t\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t\t { return false }\n\n\t\t if (maybeUpdateLineNumberWidth(cm)) {\n\t\t resetView(cm);\n\t\t update.dims = getDimensions(cm);\n\t\t }\n\n\t\t // Compute a suitable new viewport (from & to)\n\t\t var end = doc.first + doc.size;\n\t\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t\t if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); }\n\t\t if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); }\n\t\t if (sawCollapsedSpans) {\n\t\t from = visualLineNo(cm.doc, from);\n\t\t to = visualLineEndNo(cm.doc, to);\n\t\t }\n\n\t\t var different = from != display.viewFrom || to != display.viewTo ||\n\t\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t\t adjustView(cm, from, to);\n\n\t\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t\t // Position the mover div to align with the current scroll position\n\t\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\n\t\t var toUpdate = countDirtyView(cm);\n\t\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t\t { return false }\n\n\t\t // For big changes, we hide the enclosing element during the\n\t\t // update, since that speeds up the operations on most browsers.\n\t\t var selSnapshot = selectionSnapshot(cm);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"none\"; }\n\t\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t\t if (toUpdate > 4) { display.lineDiv.style.display = \"\"; }\n\t\t display.renderedView = display.view;\n\t\t // There might have been a widget with a focused element that got\n\t\t // hidden or updated, if so re-focus it.\n\t\t restoreSelection(selSnapshot);\n\n\t\t // Prevent selection and cursors from interfering with the scroll\n\t\t // width and height.\n\t\t removeChildren(display.cursorDiv);\n\t\t removeChildren(display.selectionDiv);\n\t\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\n\t\t if (different) {\n\t\t display.lastWrapHeight = update.wrapperHeight;\n\t\t display.lastWrapWidth = update.wrapperWidth;\n\t\t startWorker(cm, 400);\n\t\t }\n\n\t\t display.updateLineNumbers = null;\n\n\t\t return true\n\t\t }", "function updateDisplay() {\n\t$(\"#launched\").text(\"Application launched: \" + launched_count);\n}", "update (dt) {\n // This thing is called over and over again byt the game engine. If it's not there, nothing shows\n }", "updateDisplay(){\r\n this.currentOperandTextElement.innerText = this.getDisplayNumber(this.currentOperand);\r\n // if the operation doesn't exist\r\n if (this.operation != null){\r\n this.previousOperandTextElement.innerText = `${this.previousOperand} ${this.operation}`\r\n } else{\r\n this.previousOperandTextElement.innerText = '';\r\n }\r\n }", "function updateScreen(){\t//funcio (bucle) que s'executa per actualitzar l'estat de la pantalla del joc\n\tcuttingSegments();\t//mira si hi ha segments que es creuin\n\tdrawAll();\t\t\t//dibuixa al canvas\n\tupdateState();\t\t//reescriu el nivell i el % completat\n}", "updateListShow() {\n }", "function htmlUpdateDisplay(runLength){\n //* set the text to the number of pairs in the run area\n $('#notifier').text(runLength);\n\n //* check if all cards have been matched\n if(runLength === 16){\n //* call the function that handles all win behavior\n htmlIndicateWin();\n }\n}", "function updateDisplay() {\n \n if (isFinite(currentValue)) {\n document.getElementById(\"screen\").innerText = getDisplayNumber(currentValue);\n }\n else {\n document.getElementById(\"screen\").innerText = \"ERROR... Not possible to divide by 0...\"\n }\n \n\n if (operator != null) {\n document.getElementById(\"previousScreen\").innerText = \n `${getDisplayNumber(previousValue)} ${operator}`\n \n }\n else {\n document.getElementById(\"previousScreen\").innerText = \"\"; \n }\n}", "function update() {\n \n \n}", "update() {\n\t\tif(this.checkWin()){\n\t\t\tthis.logWin();\n\t\t} else {\n\t\t\tthis.render();\n\t\t}\n\t}", "function updatePopperDisplay (name, count, cost, display, countDisplay, costDisplay, sellDisplay) {\n\tcountDisplay.innerHTML = name + \": \" + count;\n\tcostDisplay.innerHTML = \"Cost: \" + commas(cost);\n\tif (Game.popcorn - cost >= 0) {\n\t\tdisplay.style.backgroundColor = \"blue\";\n\t\tdisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tdisplay.style.backgroundColor = \"#000066\";\n\t\tdisplay.style.cursor = \"default\";\n\t}\n\tif (count > 0) {\n\t\tsellDisplay.style.backgroundColor = \"red\";\n\t\tsellDisplay.style.color = \"white\";\n\t\tsellDisplay.style.cursor = \"pointer\";\n\t} else {\n\t\tsellDisplay.style.backgroundColor = \"#990000\";\n\t\tsellDisplay.style.color = \"#999999\";\n\t\tsellDisplay.style.cursor = \"default\";\n\t}\n}", "function UpdateDisplay(){\n\tfor (var key in Stats){\n\t\tvar area=document.getElementById(\"stats\"+key);\n\t\tarea.innerHTML=Stats[key];\n\t}\n}", "function displayContentUpdate() {\n display.textContent = displayContent.join('');\n}", "function display() {\n // Update the display of the target rate text boxes, if needed.\n for (var i = 0; i < build_targets.length; i++) {\n build_targets[i].getRate()\n }\n var totals = globalTotals\n\n window.location.hash = \"#\" + formatSettings()\n\n if (currentTab == \"graph_tab\") {\n renderGraph(totals, spec.ignore)\n }\n recipeTable.displaySolution(totals)\n if (showDebug) {\n renderDebug()\n }\n\n timesDisplayed = timesDisplayed.add(one)\n var dc = document.getElementById(\"display_count\")\n dc.textContent = timesDisplayed.toDecimal()\n}", "function updateDisplayIfNeeded(cm, update) {\n\t var display = cm.display, doc = cm.doc;\n\t\n\t if (update.editorIsHidden) {\n\t resetView(cm);\n\t return false;\n\t }\n\t\n\t // Bail out if the visible area is already rendered and nothing changed.\n\t if (!update.force &&\n\t update.visible.from >= display.viewFrom && update.visible.to <= display.viewTo &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo) &&\n\t display.renderedView == display.view && countDirtyView(cm) == 0)\n\t return false;\n\t\n\t if (maybeUpdateLineNumberWidth(cm)) {\n\t resetView(cm);\n\t update.dims = getDimensions(cm);\n\t }\n\t\n\t // Compute a suitable new viewport (from & to)\n\t var end = doc.first + doc.size;\n\t var from = Math.max(update.visible.from - cm.options.viewportMargin, doc.first);\n\t var to = Math.min(end, update.visible.to + cm.options.viewportMargin);\n\t if (display.viewFrom < from && from - display.viewFrom < 20) from = Math.max(doc.first, display.viewFrom);\n\t if (display.viewTo > to && display.viewTo - to < 20) to = Math.min(end, display.viewTo);\n\t if (sawCollapsedSpans) {\n\t from = visualLineNo(cm.doc, from);\n\t to = visualLineEndNo(cm.doc, to);\n\t }\n\t\n\t var different = from != display.viewFrom || to != display.viewTo ||\n\t display.lastWrapHeight != update.wrapperHeight || display.lastWrapWidth != update.wrapperWidth;\n\t adjustView(cm, from, to);\n\t\n\t display.viewOffset = heightAtLine(getLine(cm.doc, display.viewFrom));\n\t // Position the mover div to align with the current scroll position\n\t cm.display.mover.style.top = display.viewOffset + \"px\";\n\t\n\t var toUpdate = countDirtyView(cm);\n\t if (!different && toUpdate == 0 && !update.force && display.renderedView == display.view &&\n\t (display.updateLineNumbers == null || display.updateLineNumbers >= display.viewTo))\n\t return false;\n\t\n\t // For big changes, we hide the enclosing element during the\n\t // update, since that speeds up the operations on most browsers.\n\t var focused = activeElt();\n\t if (toUpdate > 4) display.lineDiv.style.display = \"none\";\n\t patchDisplay(cm, display.updateLineNumbers, update.dims);\n\t if (toUpdate > 4) display.lineDiv.style.display = \"\";\n\t display.renderedView = display.view;\n\t // There might have been a widget with a focused element that got\n\t // hidden or updated, if so re-focus it.\n\t if (focused && activeElt() != focused && focused.offsetHeight) focused.focus();\n\t\n\t // Prevent selection and cursors from interfering with the scroll\n\t // width and height.\n\t removeChildren(display.cursorDiv);\n\t removeChildren(display.selectionDiv);\n\t display.gutters.style.height = display.sizer.style.minHeight = 0;\n\t\n\t if (different) {\n\t display.lastWrapHeight = update.wrapperHeight;\n\t display.lastWrapWidth = update.wrapperWidth;\n\t startWorker(cm, 400);\n\t }\n\t\n\t display.updateLineNumbers = null;\n\t\n\t return true;\n\t }", "function Update_Display() {\n const display = document.querySelector('.calculator-screen');\n display.value = Calculator.Display_Value;\n}", "function Update_Display() {\n const display = document.querySelector('.calculator-screen');\n display.value = Calculator.Display_Value;\n}", "function Interpreter_PreUpdatePostDisplay()\n{\n\tif (this.PostDisplayActive)\n\t\treturn;\n\tthis.PostDisplayActive = true;\n\t//loop through post displays (the array might be increased as we process commands)\n\tfor (var i = 0; i < this.PostDisplayCmds.length; i++)\n\t{\n\t\t//valid?\n\t\tif (this.PostDisplayCmds[i] !== null)\n\t\t{\n\t\t\t//get the interpreter object if already loaded\n\t\t\tvar theObject = this.LoadedObjects[this.PostDisplayCmds[i].Id];\n\t\t\t//object already loaded?\n\t\t\tif (theObject && theObject.HTML)\n\t\t\t{\n\t\t\t\t//switch on the command\n\t\t\t\tswitch (this.PostDisplayCmds[i].Command)\n\t\t\t\t{\n\t\t\t\t\tcase __INTERPRETER_CMD_TAB_ARRANGE:\n\t\t\t\t\t\t//arrange this tab\n\t\t\t\t\t\ttheObject.HTML.Arrange();\n\t\t\t\t\t\t//remove this post display (do not remove from map as its already done and we dont want to redo it)\n\t\t\t\t\t\tthis.PostDisplayCmds[i] = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase __INTERPRETER_CMD_TAB_SELECTION:\n\t\t\t\t\t\t//activate selection (notify its from us so no need to update post display)\n\t\t\t\t\t\ttheObject.HTML.Select(true);\n\t\t\t\t\t\t//remove this post display (do not remove from map as its already done and we dont want to redo it)\n\t\t\t\t\t\tthis.PostDisplayCmds[i] = null;\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tthis.PostDisplayActive = false;\n}", "function updateDisplayTime() {\n\t\tvar date = new Date();\n\n\t\tvar hours = date.getHours();\n\t\tvar minutes = date.getMinutes();\n\t\tvar seconds = date.getSeconds();\n\t\tvar year = date.getFullYear();\n\t\tvar month = date.getMonth() + 1;\n\t\tvar day = date.getDate();\n\t\tvar ampm = \"AM\";\n\n\t\tif (hours > 11) {\n\t\t\tampm = \"PM\";\n\t\t}\n\n\t\tif (hours > 12) {\n\t\t\thours -=12;\n\t\t}\n\n\t\tif(minutes < 10) {\n\t\t\tminutes = \"0\" + minutes;\n\t\t}\n\n\t\tif (seconds < 10) {\n\t\t\tseconds = \"0\" + seconds;\n\t\t}\n\n\t\tvar displayTime = hours + \":\" + minutes + \":\" + seconds + \" \" + ampm;\n\n\t\t$(\"#displayTime\").html(displayTime)\n\t}", "function updateDisplay(data) {\n if (viewer.textContent.length >= 21) {\n // if exceeds viewer digit limit, reset state\n viewer.textContent = 'Digit Limit Met';\n return;\n }\n if (viewer.textContent === '0') {\n // if current number is 0, set the pressed number to value (prevents leading zero)\n viewer.textContent = data;\n return;\n }\n if (rePrint) {\n viewer.textContent = data;\n rePrint = false;\n return;\n }\n viewer.textContent = viewer.textContent + data;\n return;\n}", "setDisplayManually() {\n if(!this.app.isRunning){\n this.app.t1 = parseInt(this.d1.value);\n this.app.t2 = parseInt(this.d2.value);\n this.app.t3 = parseInt(this.d3.value); \n } \n }", "updateDisplay(){\n this.currentOperandTextElement.innerText = this.getDisplayNumber(this.currentOperand)\n if(this.operation != null){\n this.previousOperandTextElement.innerText = `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandTextElement.innerText = ''\n }\n }", "function Update_Display() {\n const display = document.querySelector(\".calculator-screen\");\n display.value = Calculator.Display_Value;\n}", "function Update_Display() {\n const display = document.querySelector(\".calculator-screen\");\n display.value = Calculator.Display_Value;\n}", "function updateDisplay () {\n const display = document.querySelector('.calculatorDisplay');\n // update value of screen element with content of `displayValue`\n display.value = calcDisplay.displayValue;\n}", "function updateScreen() {\n _currSec = truncAtTwo(_currSec + _secPerRow);\n _progress = getProgress();\n updateProgress();\n drawCanvas();\n checkIfCompleted();\n }", "updateDisplay(){\n this.currentOperandTextElement.innerText = \n this.getDisplayNumber(this.currentOperand)\n if(this.operation != null) {\n this.previousOperandTextElement.innerText = \n `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandTextElement.innerText= \"\"\n }\n }", "function updateDisplay(value){\n\tif(displayLength+1 < LIMIT){ \n\t\tif(value == '0' && prevValue == '/')\n\t\t\talert('You can\\'t divide by zero')\n\t\telse if(value >= '0' && value <= '9'){\n\t\t\tdisplayedContent.textContent += value;\n\t\t\tdisplayLength++;\n\t\t\tprevValue = value;\n\t\t}\n\t\telse if((prevValue >= '0' && prevValue <= '9') || (displayedContent.textContent=='' && value == '-')){\n\t\t\tif(value == '.'){\n\t\t\t\tdisplayedContent.textContent += value;\n\t\t\t\tdisplayLength++;\n\t\t\t\tprevValue = value;\n\t\t\t\tdocument.querySelector(\"#dot\").disabled = true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdisplayedContent.textContent += value;\n\t\t\t\tdisplayLength++;\n\t\t\t\tprevValue = value;\n\t\t\t\tdocument.querySelector(\"#dot\").disabled = false;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\talert ('You can\\'t input operator that way!');\n\t}\n\telse\n\t\talert('There is no space for that!');\n}" ]
[ "0.82514054", "0.75685805", "0.7340831", "0.72750336", "0.71918446", "0.71705085", "0.7140407", "0.70949256", "0.69561136", "0.6907062", "0.68984854", "0.68923265", "0.6882047", "0.68600696", "0.685814", "0.67818236", "0.67525893", "0.6725731", "0.67174685", "0.670241", "0.6675072", "0.66723377", "0.66660744", "0.665746", "0.6652632", "0.6646111", "0.663973", "0.6630977", "0.66089344", "0.66010123", "0.660045", "0.6599852", "0.65738255", "0.6566125", "0.6565977", "0.65601486", "0.65590245", "0.6537661", "0.65352416", "0.6530712", "0.6518781", "0.65142596", "0.6506398", "0.6504303", "0.6500023", "0.6484685", "0.6479001", "0.647106", "0.64539367", "0.64535385", "0.6444662", "0.6437512", "0.6432901", "0.6426462", "0.642422", "0.6394523", "0.638725", "0.63853943", "0.6381184", "0.6380304", "0.63556373", "0.6353903", "0.6347329", "0.6346214", "0.63445944", "0.63441014", "0.63439435", "0.6341407", "0.63338417", "0.6328971", "0.6321142", "0.6319277", "0.6316519", "0.6309657", "0.6307027", "0.63068837", "0.6305211", "0.6304006", "0.6297313", "0.6292358", "0.6290054", "0.6289339", "0.6287946", "0.62875104", "0.6280223", "0.627728", "0.6272265", "0.6264918", "0.6260162", "0.6260162", "0.6259335", "0.6258564", "0.62458223", "0.62455875", "0.62445503", "0.6244188", "0.6244188", "0.62416965", "0.623262", "0.62310624", "0.6216171" ]
0.0
-1
function validates 0, operators, and decimals
function validateInput(input) { var currentDisplay = display.innerHTML; //if input is zero and display isn't, or input is the first decimal in display and solution is not displayed if ((input === "0" && currentDisplay !== "0") || (input === "." && currentDisplay.indexOf(".") < 0 && solutionReturned === false)) { //update display updateDisplay(input); } //if input is an operator if (input === "/" || input === "*" || input === "-" || input === "+") { var lastChar = opChain[opChain.length - 1]; //if last character was a number if (isNumeric(lastChar)) { //update display updateDisplay(input); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function testFloat(valueOFinput, plusORnegative, decimal){\r\n\tvalueOFinput = valueOFinput.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\tplusORnegative = plusORnegative.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\tdecimal = decimal.replace(/(^\\s*)|(\\s*$)/g, \"\");\r\n\t\r\n\tif(valueOFinput==null || valueOFinput==\"\"){\r\n\t\talert(\"Illegimate number input!\");\r\n\t\treturn false;\r\n\t}\r\n\tif(plusORnegative==null && plusORnegative!=\"+\" && plusORnegative!=\"-\" && plusORnegative!=\"\"){\r\n\t\talert(\"Illegimate sign input!\");\r\n\t\treturn false;\r\n\t}\r\n\tvar dec = parseInt(decimal);\r\n\tif(typeof(dec)==\"undefine\" || dec == null){\r\n\t\talert(\"Illegimate decimal number input!\");\r\n\t\treturn false;\r\n\t}else if(dec < 0){\r\n\t\talert(\"negative decimal number input! Make it positive number\");\r\n\t}\r\n\t\r\n\tvar rg = \"\";\r\n\t\r\n\tif(plusORnegative==\"+\"){\r\n\t\trg += '^([+|]?';\r\n\t}else if(plusORnegative==\"-\"){\r\n\t\trg += '^([-]';\r\n\t}else{\r\n\t\trg += '^([+|-|]?';\r\n\t}\r\n\t\r\n\tvar pp = new RegExp(rg + '[0-9]{1,9})+(.[0-9]{0,'+dec+'})?$');\r\n\t//alert(pp);\r\n\t\t\r\n if(!pp.exec(valueOFinput)){\r\n\t\talert(\"Illegimate value input with \"+dec+\" decimal!\");\r\n\t\treturn false;\r\n\t}else{\r\n\t\talert(\"Legimate value input with \"+dec+\" decimal!\");\r\n\t\treturn true;\r\n\t}\r\n}", "function validate_decimal (id) {\n\tvar num = document.getElementById(id).value;\n\tvar decimal = /^[-+]?[0-9]+\\.[0-9]+$/;\n\tif (num.match(decimal) || num < 0) {\n\t\terror_msg_alert('Please enter valid information.');\n\t\t$('#' + id).css({ border: '1px solid red' });\n\t\tdocument.getElementById(id).value = '';\n\t\t$('#' + id).focus();\n\t\tg_validate_status = false;\n\t\treturn false;\n\t}\n\telse {\n\t\t$('#' + id).css({ border: '1px solid #ddd' });\n\t\treturn true;\n\t}\n}", "function numericTypeCheck(input) {\r\n return /^-?[0-9]\\d*(\\.\\d+)?$/.test(input);\r\n}", "function validate(args) {\n let validOperator = false;\n let validNumbers = null;\n\n const operators = ['add', 'subtract', 'multiply'];\n if (operators.includes(args[0])) validOperator = true;\n\n // args[1] ...\n for (let i = 1; i < args.length; i++) {\n if (isNaN(parseInt(args[i]))) validNumbers = false;\n }\n\n if (validNumbers !== false) {\n validNumbers = true;\n }\n\n return validNumbers && validOperator;\n}", "function validateInput(value) {\n\tvar integer = Number.isInteger(parseFloat(value));\n\tvar sign = Math.sign(value);\n\n\tif (integer && (sign === 1)) {\n\t\treturn true;\n\t} else {\n\t\treturn 'Please enter a whole non-zero number.';\n\t}\n}", "function validateInput(value) {\n var integer = Number.isInteger(parseFloat(value));\n var sign = Math.sign(value);\n\n if (integer && (sign === 1)) {\n return true;\n } else {\n return 'Please enter a whole non-zero number.';\n }\n}", "function validateInput(value) {\n var integer = Number.isInteger(parseFloat(value));\n var sign = Math.sign(value);\n\n if (integer && (sign === 1)) {\n return true;\n } else {\n return 'Please enter a whole number larger than zero.';\n }\n}", "function validate(operator, num1, num2){\n var num1 = parseInt(num1);\n var num2 = parseInt(num2);\n if (operator !== \"+\" && operator !== \"-\" && operator !== \"*\" && operator !== \"/\"){\n return \"Sorry, that is not a valid operator\";\n } else if (isNaN(num1) === false || isNaN(num2) === false){\n return \"Sorry, one of those is not a valid number!\";\n }\n else { result(operator, num1, num2);}\n\n}", "function checkDecimalMisc(op) {\r\n\tfor (element of splitBySymbol(op)) {\r\n\t\tif (!element.match(/[-+*/%]/) && element % 1 != 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t} \r\n\treturn false;\r\n}", "function validateDecimals(root, id, errorMsg) {\r\n\tvar strData = $(root+':'+id).value;\t\r\n\tvar errorObj = $(errorMsg);\r\n\tvar iCount, iDataLen;\r\n\tvar strCompare = \"0123456789\";\r\n\tiDataLen = strData.length;\r\n\t\r\n\tif (iDataLen > 0) {\t\r\n\t\tfor (iCount=0; iCount < iDataLen; iCount+=1) {\r\n\t\t\tvar cData = strData.charAt(iCount);\r\n\t\t\r\n\t\t\tif (strCompare.indexOf(cData) < 0 ){\r\n\t\t\t\terrorObj.innerHTML=\"Please enter non-decimal number values\";\t\t\t\t\r\n\t\t\t\treturn false;\r\n\t\t\t} \r\n\t\t}\r\n\t\t\r\n\t\terrorObj.innerHTML=\"\";\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\terrorObj.innerHTML=\"\";\r\n\t}\r\n}", "function validateNumber(val) {\n if(Number.isInteger(parseFloat(val)) == true && Math.sign(val) == 1) {\n return true\n } else {\n return 'Invalid quantity input!!'\n } \n}", "function validate(expr) {\n function checkNum(i) {\n if (isNaN(parseFloat(expr[i]))) {\n throw ('Term at [' + i + '] is not a number: \"' + expr[i] + '\"');\n }\n }\n for (var i=1; i < expr.length; i += 2) {\n checkNum(i-1);\n if (!ops[expr[i]]) {\n throw ('Element at [' + i + '] is not an operator.');\n }\n }\n checkNum(expr.length - 1);\n }", "function checkDecimalAndPrecision(theInputField, val)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\t//alert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return flagExtraDecimal;\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\t//alert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn flagOnlyDecimal;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n if(theInput.charAt(i) != '.' && theInput.charAt(i) != ',')\r\n {\r\n // alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return flagNonNumeric;\r\n }\r\n }\r\n }// for ends\r\n\tif(theInputField.value >= val)\r\n\t{\r\n // alert(\"This field cannot be greater than or equal to\" + val);\r\n\t\ttheInputField.focus();\r\n\t\ttheInputField.select();\r\n\t\treturn flagMaxLimit;\r\n\t}\r\n\telse\r\n\t{\r\n\t\treturn flagFieldValid;\r\n\t}\r\n}", "function OperandValidator(operand, id){\n var validPattern = new RegExp(/^[0-9]+(\\.[0-9]+){0,1}$/);\n \n if (!validPattern.test(operand) && _AllValide[id]){\n _AllValide[id] = false;\n ShowNotifications($(\"#notifications\"), \"The operand must be a squance of numbers!\", \"danger\", id);\n DisableEnableOperations(true);\n } else if (validPattern.test(operand) || _AllValide[id]) {\n _AllValide[id] = true;\n $(\"#\" + id + \"-notification\").remove();\n DisableEnableOperations(false);\n return operand\n }\n }", "function Validar_Decimal(obj){\n\t jq(obj).validCampoAPP('0123456789.');\n}", "function checkDecimal(id) {\n\t\t\tvar str = document.getElementById(id).value;\n\t\t\tvar flag = true;\n\t\t\tvar found = false;\t\t\t\n\t\t\tfor(var i = 0; i < str.length; i++) {\n\t\t\t\tvar temp_code = str.charCodeAt(i);\t\n\t\t\t\t\t\t\n\t\t\t\tif((temp_code == 46 || temp_code == 110 || temp_code == 190) && found == true) {\n\t\t\t\t\tflag = false;\n\t\t\t\t}else if((temp_code == 46 || temp_code == 110 || temp_code == 190) && found == false){\n\t\t\t\t\tfound = true;\n\t\t\t\t}else {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(flag == false) {\n\t\t\t\tvar new_val = str.substring(0,str.length-1);\n\t\t\t\tdocument.getElementById(id).value = new_val;\t\n\t\t\t}\n\t\t\t\n\t\t\tvar value = parseFloat(str);\n\t\t\tconsole.log(\"Value = \", value);\n\t\t\tif(value < 0) {\n\t\t\t\t//alert(\"You can not put value less than 0\");\n\t\t\t\t$('#errormsgBody').show();\n\t\t\t\t$('#errormsgBody').text(\"You can not put value less than 0\"); \n\t\t\t\tdocument.getElementById(id).value = 0;\t\t\t\t\n\t\t\t}else if(value > 100) {\n\t\t\t\t//alert(\"You can not put value greater than 100\");\n\t\t\t\t$('#errormsgBody').show();\n\t\t\t\t$('#errormsgBody').text(\"You can not put value greater than 100\"); \n\t\t\t\tdocument.getElementById(id).value = 100;\t\t\t\t\n\t\t\t\t\n\t\t\t}else if(isNaN(value)) {\t\t\t\n\t\t\t\t//alert(\"Please enter a value\");\n\t\t\t\t$('#errormsgBody').show();\n\t\t\t\t$('#errormsgBody').text(\"Please enter a value\"); \n\t\t\t\tdocument.getElementById(id).value = 0;\n\t\t\t\tvar elem = document.getElementById(id);\n\t\t\t\t$(elem).focus();\t\t\t\t\n\t\t\t}else {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "function validarNota() {\r\n var n = $(\"#txtNota\").val();\r\n if (n < 0.0 || n > 10.0) {\r\n bandera= 1 ;\r\n }\r\n else {\r\n bandera = 0;\r\n }\r\n }", "function validateInput(value) {\n\tvar integer = Number.isInteger(parseFloat(value));\n\tvar sign = Math.sign(value);\n\tif (integer && (sign === 1)) {\n\t\treturn true;\n\t} else {\n\t\treturn \"You must enter a positive number higher than zero.\";\n\t}\n}", "function validNumber(value) {\n const intNumber = Number.isInteger(parseFloat(value));\n const sign = Math.sign(value);\n\n if (intNumber && (sign === 1)) {\n return true;\n } else {\n return 'Please use whole non-zero numbers only.';\n }\n}", "function valInput(value) {\r\n var integer = Number.isInteger(parseFloat(value));\r\n var sign = Math.sign(value);\r\n\r\n if (integer && (sign === 1)) {\r\n return true;\r\n } else {\r\n return 'Please enter a whole number.';\r\n }\r\n}", "function checkDecimalWithPrecesion (field, totalDecimal, allowedPrecision)\r\n{\r\n\r\n\t//alert('inside checkDecimalWithPrecision');\r\n var value = field.value;\r\n if (value.length == 0) {\r\n //value is empty / field is blank\r\n\treturn flagIsBlank;\r\n } \r\n \r\n if (isDecimal(field)) \r\n {\r\n dindex = value.indexOf(\".\", 0);\r\n\tvar s1 = value;\r\n var adj = 0;\r\n\t\r\n\tif (dindex > 0) {\r\n\t s1 = value.substring (0, dindex);\r\n\t var adj = (dindex > 0)?1:0;\r\n\r\n\t var s2 = value.substring (dindex + 1, value.length);\r\n\r\n\t if (s2.length > allowedPrecision) {\r\n\t return flagExceedNumericLimit;\r\n\t }\r\n\t} \r\n\t\r\n\tif (s1.length > (totalDecimal - allowedPrecision + adj)) {\r\n\t //alert (\"Exceeds allowed numerical length\");\t\r\n\t return flagExceedPecisionLimit;\r\n\t}\r\n }\r\n else\r\n\t{\r\n\t return flagIsBlank;\r\n\t}\r\n return flagIsValid; \r\n}", "isPriceValid(price){\n\n if(isNaN(parseFloat(price))){\n return false;\n }\n \n if(price.length > 0){\n return true;\n } else {\n return false;\n }\n }", "function validate_importe(value,decimal)\n {\n if(decimal==undefined)\n decimal=0;\n \n if(decimal==1)\n {\n // Permite decimales tanto por . como por ,\n var patron=new RegExp(\"^[0-9]+((,|\\.)[0-9]{1,2})?$\");\n }else{\n // Numero entero normal\n var patron=new RegExp(\"^([0-9])*$\")\n }\n \n if(value && value.search(patron)==0)\n {\n return true;\n }\n return false;\n }", "function verifyInputs() {\n // Creacion de una expresion regular para verificar los inputs\n const reg = /^-?\\d+$/;\n\n // Verificacion de los inputs\n try {\n if (funcion === \"\") {\n throw new Error(\"Por favor escriba una función.\");\n }\n if (!reg.test(x_from)) {\n throw new Error(\n \"Por favor escriba un número entero en el valor de inicio de la integral.\"\n );\n }\n if (!reg.test(x_to)) {\n throw new Error(\n \"Por favor escriba un número entero en el valor final de la integral.\"\n );\n }\n if (!reg.test(cant_points)) {\n throw new Error(\n \"Por favor escriba un número entero para la cantidad de puntos a evaluar.\"\n );\n }\n } catch (error) {\n alert(error);\n return false;\n }\n\n // Pasar los inputs a integer\n x_from = parseInt(x_from);\n x_to = parseInt(x_to);\n cant_points = parseInt(cant_points);\n\n return true;\n }", "function verifyFrac(test00)\n {\n \n if (/^(\\d{1,10}[.,]\\d{1,5})$/.test(test00) && !/^(\\d{1,10}[.,][0])$/.test(test00)\n && !/^(\\d{1,10}[.,][0][0])$/.test(test00) && !/^(\\d{1,10}[.,][0][0][0])$/.test(test00) \n && !/^(\\d{1,10}[.,][0][0][0][0])$/.test(test00) && !/^(\\d{1,10}[.,][0][0][0][0][0])$/.test(test00))\n {\n var msg0 = \"It's a fraction!\";\n \n message(msg0);\n return msg0; \n \n }\n else {\n var msg0 = \"It's not a fraction!\";\n \n message(msg0);\n return msg0;\n \n }\n\n }", "function operator(x)\r\n{\r\n form.display.value=form.display.value+x;\r\n var y=form.display.value;\r\n \r\n for(var i=1;i<y.length;i++)\r\n {\r\n if(y[i]==\"/\" || y[i]==\"*\")\r\n {\r\n if(y[i-1]==\"/\" || y[i-1]==\"+\" || y[i-1]==\"-\")\r\n {\r\n alert(\"sorry not possible :)\");\r\n form.display.value=\"\";\r\n }\r\n }\r\n }\r\n for(var j=0;j<y.length-1;j++)\r\n {\r\n if(y[j]==\".\")\r\n {\r\n if(y[j+1]==\"+\" || y[j+1]==\"-\" || y[j+1]==\"/\" || y[j+1]==\"*\")\r\n {\r\n alert(\"INVALID EXPRESSION\");\r\n form.display.value=\"\";\r\n break;\r\n }\r\n }\r\n } \r\n}", "function isNumber(elem)\n {\n // saves entry text\n var str = elem.value;\n\n // initially set to false\n var decimalDetected = false;\n\n // variable used for character comparison\n var oneCharacter = 0; \n\n // casting to string to compare with ASCII table\n str = str.toString();\n\n // cycles trougth all input text\n for(var i = 0; i < str.length; i++)\n {\n // getting the first char unicode\n var oneCharacter = str.charAt(i).charCod\n // allowing first char to be a minus sign\n if(oneCharacter == 45) \n {\n if(i == 0)\n {\n continue;\n }\n else\n {\n //alert(\"minus sign must be the first character\");\n return false;\n }\n }\n\n // allowing one decimal point only (can be either ',' or '.')\n if(oneCharacter == 46 || oneCharacter == 44)\n {\n // if we still didn't have any decimal character we accept it\n if(!decimalDetected)\n {\n decimalDetected = true;\n continue;\n }\n else\n {\n //alert(\"only one decimal placeholder is allowed\");\n return false;\n }\n }\n\n // allowing 0-9 range only\n if(oneCharacter < 48 || oneCharacter > 57)\n {\n //alert(\"insert numbers only!\");\n return false;\n }\n }\n return true;\n}", "function isDecimal(element)\n{\nreturn (/^\\d+(\\.\\d)?$/.test(element.value) || /^\\d+(\\.\\d\\d)?$/.test(element.value)\n\t\t || /^(\\.\\d\\d)?$/.test(element.value) || /^\\d+(\\.)?$/.test(element.value));\n}", "isValid(value){\n return !isNaN(value);\n }", "function isValidPositiveNumber(val){\r\n if(val==null){return false;}\r\n if (val.length==0){return false;}\r\n var DecimalFound = false;\r\n for (var i = 0; i < val.length; i++) {\r\n var ch = val.charAt(i)\r\n if (ch == \".\" && !DecimalFound) {\r\n DecimalFound = true;\r\n continue;\r\n }\r\n if (ch < \"0\" || ch > \"9\") {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "isOperator(op) {\n if( isNaN(op) ) { //If it is not a number\n if( op == \"+\" || op == \"-\" || op == \"*\" || op == \"/\") { //and is one of the defined operators //TODO add more operators\n return true;\n } else { return false; } //not a defined operator\n } else { return false; } //is a number\n }", "static get negativeDecimals() {\n return /^\\-\\d*\\.\\d+$/;\n }", "validateValue (value) {\n return TypeNumber.isNumber(value) && !isNaN(value)\n }", "function ControlData(pu, qte){\n try {\n if(isNaN(pu)) throw \"Entrer un Prix Unitaire correct\";\n if(isNaN(qte)) throw \"Entrer une Quantité correct\";\n if(parseFloat(pu) == NaN) throw \"Le Prix Unitaire n'est pas correct\";\n if(parseFloat(qte) != parseInt(qte)) throw \"La Quantité doit être un nombre entier\";\n \n }\n catch(error){\n alert(error);\n return;\n }\n return true;\n}", "function isOperatorValid(Look) {\n try {\n if (isBasicOperator(Look[0]) || isBasicOperator(Look[Look.length-2])) throw \"Operator can not be at the beginning or at the last\";\n var OperatorSub = new Array();\n for (var i = 0; i < Look.length; i++) {\n if (isBasicOperator(Look[i])) {\n OperatorSub.push(i);\n }\n }\n for (var j = 0; j < OperatorSub.length; j++) {\n if (j > 0) {\n if (OperatorSub[j] - OperatorSub[j-1] == 1) throw \"Operator can not be close to each other\";\n }\n }\n for (i = 0; i < Look.length; i++) {\n if ((Look[i] == \"(\" && isBasicOperator(Look[i+1]))) {\n throw \"Operator are wrong with Bracket\";\n }\n if (i > 0) {\n if ((Look[i] == \")\" && isBasicOperator(Look[i-1]))||(Look[i] == \")\" &&Look[i+1] == \".\")) {\n throw \"Operator are wrong with Bracket\";\n }\n if (Look[i] == \"(\" && Look[i-1] == \".\") {\n throw \"Operator error with dot\";\n }\n }\n }\n return true;\n }\n catch(Error) {\n alert(Error);\n ClearAll();\n }\n}", "function validNumber(obj){\n\tvar formObj = document.getElementById(obj.id);\n var filter = /^([0-9\\.])+$/;\n if (!filter.test(formObj.value)) {\n// \talert(\"Please input number !\");\n \tComShowCodeMessage('COM12178');\n \tformObj.value=\"\";\n }\n return true;\n}", "function validaValoresCampo(campo) {\r\n var validacao = true;\r\n for (let item of campo) {\r\n if (parseFloat($(item).val()) < 0.0 || parseFloat($(item).val()) == 0.0) {\r\n validacao = false;\r\n }\r\n }\r\n return validacao;\r\n}", "function checkInput(input) {\n for (var i = 0; i < input.length - 1; i++) { //loops over the input characters \n if (input[0].match(/[\\/\\+\\*\\%]/)) { // matches the first character against the operators\n console.log('Invalid Operator at the start'); \n newError('Invalid Operator at the start'); // Alerts user that they can't put certian operators at the start of the equation.\n } \n if ((input[i].match(/[\\/\\+\\-\\*\\%]/)) && (input[i + 1].match(/[\\/\\+\\-\\*\\%]/))) { // If the iteration and the next itteration match the operators\n console.log('terrible maths'); // it throws an error that you are terrible at math.\n newError(\"You're terrible at the maths\");\n }\n }\n}", "verifyNumeric(value) {\n return !isNaN(parseFloat(value)) && isFinite(value);\n }", "function isDecimal(theInputField)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n var dec_count = 0 ;\r\n\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n if(theInput.charAt(i) == '.')\r\n // the text field has decimal point entry\r\n {\r\n dec_count = dec_count + 1;\r\n }\r\n }\r\n //check if number field contains more than one decimal points '.'\r\n if(dec_count > 1)\r\n {\r\n\talert('The field cannot contain two decimal points');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n return(false);\r\n }\r\n //check if decimal field contains just a '.'\r\n if (dec_count == 1 && dec_count == theLength)\r\n {\r\n\talert('The field cannot contain just a decimal');\r\n\ttheInputField.focus();\r\n\ttheInputField.select();\r\n \treturn false;\r\n }\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if decimal field contains laphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n\t if(theInput.charAt(i) == '-'){\r\n\t\t continue;\r\n\t }\r\n if(theInput.charAt(i) != '.')\r\n {\r\n alert(\"This field cannot contain alphabets or spaces\");\r\n theInputField.focus();\r\n\t theInputField.select();\r\n return(false);\r\n }\r\n }\r\n }// for ends\r\n return (true);\r\n}", "static get decimal() {\n return /^[\\+\\-]?\\d*\\.\\d+$/;\n }", "function validar(num1){\n if(isNaN(num1)){\n return false;\n } else {\n return true;\n }\n}", "function decimals(evt,id)\n{\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode;\n \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\talert(w);\n\t}\n}", "function custom(theValue) {\n //+ - 1 sau mai multe\n // 0 sau mai multe\n //? sursa : https://stackoverflow.com/questions/19715303/regex-that-accepts-only-numbers-0-9-and-no-characters\n //?sursa pt nr cu , : https://stackoverflow.com/questions/12643009/regular-expression-for-floating-point-numbers\n if(/^([0-9]+[.])?[0-9]+$/.test(theValue)) {\n ctrl.$setValidity(\"doarCifre\",true);\n }else {\n ctrl.$setValidity(\"doarCifre\",false);\n } \n return theValue;\n }", "function isFloat(n){ //fonction pour n'avoir que des chiffres.\n return n != \"\" && !isNaN(n) && n !==0;\n}//fin de la fonction", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "function esNumeroDecimalValido(strNumeroDecimal) {\n\treturn (/^[\\-]*[0-9]+\\.[0-9][0-9]$/.test(strDecimal));\n}", "isValid() {\n let value = this.input.value;\n return !isNaN(value);\n }", "function div()\r\n{\r\n if(form.display.value==0)\r\n {\r\n form.display.value=\"Cannot divide by zero\";\r\n }\r\n\r\n else if(form.display.value==\".\" ||form.display.value==\"-\"||form.display.value==\"+\"||form.display.value==\"*\"||form.display.value==\"/\")\r\n {\r\n form.display.value=\"Invalid Expression\";\r\n }\r\n else\r\n {\r\n form.display.value=1/form.display.value;\r\n }\r\n}", "function decimals(evt,id)\n{\t\n\ttry{\n var charCode = (evt.which) ? evt.which : event.keyCode; \n if(charCode==46){\n var txt=document.getElementById(id).value;\n if(!(txt.indexOf(\".\") > -1)){\n\t\n return true;\n }\n }\n if (charCode > 31 && (charCode < 48 || charCode > 57) )\n return false;\n\n return true;\n\t}catch(w){\n\t\t//alert(w);\n\t}\n}", "function validateValue(input_value) {\n\t\tif (input_value===0) return true; //show limit when value===0\n\t\tif (input_value != '') {\n\t\t\tif (input_value.length > 9) {\n\t\t\t\treturn false;\n\t\t\t} else if ((input_value < 0) || (input_value.match(/^0+[,.]0+$/) != null)){\n\t\t\t\treturn false;\n\t\t\t} else if (input_value >= 1000000){\n\t\t\t\treturn false;\n\t\t\t} else if ((input_value.match(/^\\d{1,6}[,.]?\\d{0,2}$/) != null) \n\t\t\t\t\t\t\t&& (input_value.match(/^\\d{1,6}[,.]$/) == null)) {\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\treturn false;\n\t}", "function validateForm() {\r\n let regex = /^\\d*\\.?\\d*$/;\r\n if (\r\n regex.test(people.value) === false ||\r\n regex.test(priceB4Tip.value) === false ||\r\n regex.test(tipChoice.value) === false\r\n ) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }", "validate() {\n let value = parseFloat(this.field);\n return (value < this.max);\n }", "function check_rate(obj){\n if (isNaN(obj.value)){\n alert('Please enter only number');\n obj.value=''\n obj.focus();\n return;\n }\n var rate = obj.value;\n var frate = parseFloat(rate);\n if ((rate.indexOf('.') != -1) && ((rate.length - rate.indexOf('.') -1) > 2)){\n frate = frate.toFixed(2);\n jQuery('#'+obj.id).val(frate);\n }\n if (frate > 9999.99 || frate < 0.01){\n obj.value=''\n obj.focus();\n alert(\"Rate should be between 0.01 and 9999.99\");\n }\n}", "function validNumberAboveZero(inputNumber){\n inputNumber = inputNumber.replace(/\\s+/,\"\");\n inputNumber = inputNumber.replace(/\\,+/,\".\");\n if(isNaN(parseFloat(+inputNumber))){\n return false;\n }\n if(parseFloat(+inputNumber)<=0){\n return false;\n }\n return true;\n }", "validate(value){\n value = parseInt(value)\n if(!isNaN(value)){\n throw new Error (\"Tidak boleh angka\")\n }\n }", "function validatePower(inputElement) {\n\t\tvar value = parseFloat(inputElement.val());\n\t\tinputElement.val(formatPower(inputElement.val()));\n\t\tvar errorText = '';\n\n\t\t// PLANO or null value is fine, but all following assume numerical input\n\t\tif (inputElement.val() == 'PLANO' || inputElement.val() === '') {\n\t\t\tdisplayError(inputElement, '');\n\t\t\tcompensatePower(inputElement);\n\t\t\treturn;\n\t\t}\n\n\t\t// Not a number\n\t\tif (typeof value == 'NaN') {\n\t\t\terrorText = 'Not a number';\n\t\t}\n\n\t\t// very large power error\n\t\tif (value > 40 || value < -40) {\n\t\t\terrorText = 'Power out of normal range';\n\t\t}\n\n\t\t// Not multiple of 0.25 error\n\t\tif (value * 4 != Math.floor(value * 4)) {\n\t\t\terrorText = 'Power not multiple of 0.25';\n\t\t}\n\n\t\tdisplayError(inputElement, errorText);\n\t\tcompensatePower(inputElement);\n\t}", "function isIntDecimal(value)\r\n{\r\n //var res = value.match(/^\\d+(\\.\\d+)?$/);\r\n if(!value.match(/^\\d+(\\.\\d+)?$/))\r\n\t\treturn false;\r\n else\t\r\n\t\treturn true;\r\n}", "function validNumber(input){\r\n\treturn (input.length == 10 || input[0] == \"0\");\r\n}", "function CheckFloatDataType(field, rules, i, options) {\n ///Assign a Reguler experassion in a variable\n var regex = /([\\d\\w]+?:\\/\\/)?([\\w\\d\\.\\-]+)(\\.\\w+)(:\\d{1,5})?(\\/\\S*)?/;\n //Match Reguler expression with user input data\n if (!regex.test(field.val())) {\n ///Show Message if Invalid Information\n return \"Please Enter Numbers Only.\"\n }\n}", "function isValid(x) {\n return !isNaN(x);\n\n}", "function recValidate() {\n var recvalue = document.getElementById(\"rectscale\");\n sum = Number(recvalue.value)\n if(Number(sum)) {\n \n } else {\n alert(\"Numbers only, please!\");\n };\n}", "get numeric() {\n return this.addValidator({\n message: (value, label) => `Expected ${label} to be numeric, got \\`${value}\\``,\n validator: value => /^[+-]?\\d+$/i.test(value)\n });\n }", "function CheckForFloat(i)\n{\n if(i.value.length>0)\n {\n i.value = i.value.replace(/[^\\d\\.]+/g, '');\n }\n}", "function isEmptyDecimal(value) {\n return value === \"\" || value === \"-\" || value === \".\" || value === \"-.\";\n}", "function isValid(v) {\n return v || v === 0;\n}", "function checkPrice()\r\n {\r\n //check if integer\r\n var reg1 = new RegExp(/^[0-9]+$/);\r\n //check if double\r\n //accepts 1.10 or 1.1\r\n var reg2 = new RegExp(/^[0-9]+\\.[0-9]{1,2}$/);\r\n \r\n if($(\"#price\").val()){ \r\n if(reg1.test($(\"#price\").val())){ \r\n return true;\r\n }\r\n else if(reg2.test($(\"#price\").val())){ \r\n return true;\r\n } \r\n else{\r\n alert(\"Invalid price input.\"); \r\n return false;\r\n }\r\n }\r\n else if($(\"#price\").val() == \"\"){ \r\n alert(\"Please input the rental price.\"); \r\n $(\"#price\").focus();\r\n return false;\r\n }\r\n else{\r\n alert(\"Please input the rental price.\"); \r\n $(\"#price\").focus();\r\n return false;\r\n }\r\n }", "static test07() {\n let cal = new Calc();\n cal.receiveInput(2);\n cal.receiveInput('.');\n cal.receiveInput(1);\n return cal.getDisplayedNumber() === '2.1';\n }", "function validate(num) {\r\n // return Number.isInteger(num);\r\n\r\n //return num !== isNaN && num >= 0 && num <= 100;\r\n return typeof num === \"number\" && num >= 0 && num <= 100;\r\n\r\n\r\n\r\n}", "function validateNumber (inputVal) {\n let inputNum = Number(inputVal);\n if (inputNum || inputVal === '' || inputVal === '.' || Number.isInteger(inputNum)) {\n return true;\n }\n return false;\n}", "function validateFormAndCalculatePl() {\n addCommas(\"rp-annual-input\");\n addCommas(\"rp-annual-save-input\");\n addCommas(\"rp-month-input\");\n addCommas(\"rp-expense-input\");\n }", "function validateNumber(value) {\n if (value % 1 === 0 && value > 0) {\n return true;\n } else {\n console.log(\" **** Please enter a whole number above zero. ****\");\n }\n}", "function isFloatValue(e,obj)\n {\n\t\tif ([e.keyCode||e.which]==8) //this is to allow backspace\n\t\t\treturn true;\n\t\tif ([e.keyCode||e.which]==46) {\n\t var val = obj.value;\n\t if(val.indexOf(\".\") > -1)\n\t {\n\t e.returnValue = false;\n\t return false;\n\t }\n\t return true;\n\t }\n\t\t\n\t var charCode = (e.which) ? e.which : event.keyCode\n if (charCode > 31 && (charCode < 48 || charCode > 57)){\n return false;\n }\n return true;\n }", "function validarNumeros(parametro) {\r\n\tif (!/^([0-9])*$/.test(parametro)) {\r\n\t\treturn false;\r\n\t}else {\r\n\t\treturn true;\r\n\t}\r\n}", "function vatFrmValidation()\n\t{\t\n\t\tvatpattern = /^[0-9][0-9]*\\.?[0-9]*$/; //define patteren for valide vat value \n\t\tif(document.getElementById(\"txtVatValue\").value == \"\")\n\t\t{\n\t\t\t\talert(\"Please enter vat value.\");\n\t\t\t\tdocument.getElementById(\"txtVatValue\").focus();\n\t\t\t\treturn false;\n\t\t}\n\t\tif(vatpattern.test(document.getElementById(\"txtVatValue\").value) == false)\n\t\t{\n\t\t\t alert(\"Please enter valid vat value.\");\n\t\t\t document.getElementById(\"txtVatValue\").focus();\n\t\t\t return false;\n\t\t}\n\t\t\n\t\treturn true;\n\t\t\n\t\n\t}", "function isdecimal(num) {\n return (/^\\d+(\\.\\d+)?$/.test(num + \"\"));\n}", "function validateNumber(value) {\n var valid = Number.isInteger(parseFloat(value));\n var sign = Math.sign(value);\n\n if (valid && (sign === 1)) {\n return true;\n } else {\n return \"Please enter a number\";\n }\n}", "function isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n }", "function validate()\r\n{\r\n var bValid = false;\r\n var dAirChangeRate = positiveNumber(\"airchangerate\",MESSAGES.air_change_rate_numeric,MESSAGES.air_change_rate_positive);\r\n if (dAirChangeRate != null)\r\n bValid = true;\r\n return bValid;\r\n}", "function validateNumbers(el, evt) {\n \n var charCode = (evt.which) ? evt.which : event.keyCode;\n var number = el.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n //just one dot\n if(number.length > 1 && charCode == 46) {\n return false;\n }\n //get the carat position\n var caratPos = getSelectionStart(el);\n var dotPos = el.value.indexOf(\".\");\n if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){\n return false;\n }\n return true;\n}", "function isStringNumGreatZeroObj(obj)\n{\n\tvar result = false;\n\tif (obj == null) return false;\n\t\n\tvar value = obj.value.trim();\n\tif (value == \"\") return true;\n\t\n\t\n\tresult = isStringNum(value);\n\tif (!result || parseInt(value) <= 0)\n\t{\n\t\talert(getMessage(\"MSG_SYS_030\"));\n\t\tobj.focus();\n\t\tobj.select();\n\t\tresult = false;\n\t}\n\treturn result;\n}", "validate(args) {\n const argArray = args.split(\" \");\n const arg = argArray.shift();\n const num = parseFloat(arg);\n if (!(/^-?\\d+(\\.\\d+)?$/).test(arg) || isNaN(num))\n throw new ParseError_1.ParseError(`\"${arg}\" is not a valid number`, this);\n if (this.min !== null && this.min > num)\n throw new ParseError_1.ParseError(`Number not greater or equal! Expected at least ${this.min}, but got ${num}`, this);\n if (this.max !== null && this.max < num)\n throw new ParseError_1.ParseError(`Number not less or equal! Expected at least ${this.max}, but got ${num}`, this);\n if (this.int && num % 1 !== 0)\n throw new ParseError_1.ParseError(`Given Number is not an Integer! (${num})`, this);\n if (this.forcePositive && num <= 0)\n throw new ParseError_1.ParseError(`Given Number is not Positive! (${num})`, this);\n if (this.forceNegative && num >= 0)\n throw new ParseError_1.ParseError(`Given Number is not Negative! (${num})`, this);\n return [num, argArray.join(\" \")];\n }", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n\t}", "function isOperator(value){\n return value === \"÷\" || value === \"x\" || value === \"+\" || value === \"-\"\n}", "static isDecimalOrBlank(string) {\n return string.match(/^\\d+(\\.\\d{0,2})?$|^$/)\n }", "function validateNumber() {\n var min = $(this).attr('min'); if (!$.isNumeric(min)) min = Number.NEGATIVE_INFINITY;\n var max = $(this).attr('max'); if (!$.isNumeric(max)) max = Number.POSITIVE_INFINITY;\n var step = $(this).attr('step'); if (!$.isNumeric(step)) step = 1;\n this.value = parseFloat((Math.round(parseFloat(this.value)/step)*step).toPrecision(12));\n this.value = Math.max(min, Math.min(max, this.value));\n}", "function validateNumbers(el, evt) {\n\n var charCode = (evt.which) ? evt.which : event.keyCode;\n var number = el.value.split('.');\n if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {\n return false;\n }\n //just one dot\n if(number.length > 1 && charCode == 46) {\n return false;\n }\n //get the carat position\n var caratPos = getSelectionStart(el);\n var dotPos = el.value.indexOf(\".\");\n if( caratPos > dotPos && dotPos>-1 && (number[1].length > 1)){\n return false;\n }\n return true;\n}", "function checkOperator()\n{\n if (operator === `+`)\n { \n additionValue = inputArray.join(``);\n additionValue = parseFloat(additionValue);\n\n addition(additionValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `-`)\n {\n subtractionValue = inputArray.join(``);\n subtractionValue = parseFloat(subtractionValue);\n\n subtraction(subtractionValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `X`)\n {\n multiplicationValue = inputArray.join(``);\n multiplicationValue = parseFloat(multiplicationValue);\n\n multiplication(multiplicationValue);\n\n updateDisplay(total);\n resetArray();\n }\n else if (operator === `/`)\n {\n divisionValue = inputArray.join(``);\n divisionValue = parseFloat(divisionValue);\n\n division(divisionValue);\n\n updateDisplay(total);\n resetArray();\n }\n}", "function validate()\n{\n if(fraction_in.value == \"\" && whole_in.value == \"\")\n {\n console.log(\"empty input\");\n error_message.className = \"panel panel-danger display\";\n error_invalid_syntax.className--;\n error_empty.className += \" display\";\n error_divide_zero.className--;\n }\n else if(fraction_in.value.includes(\"/0\"))\n {\n console.log(\"cannot divide by 0\");\n error_message.className = \"panel panel-danger display\";\n error_empty.className--;\n error_invalid_syntax.className--;\n error_divide_zero.className += \" display\";\n }\n else if(fraction_in.value.match(/[a-z]/i) || (!fraction_in.value.includes(\"/\") && !(fraction_in.value == \"0\" || fraction_in.value == \"\")))\n {\n console.log(\"invalid syntax\");\n error_message.className = \"panel panel-danger display\";\n error_empty.className--;\n error_invalid_syntax.className += \" display\";\n error_divide_zero.className--;\n }\n else\n {\n console.log(\"input submitted correctly\");\n error_message.className--;\n error_empty.className--;\n error_invalid_syntax.className--;\n error_divide_zero.className--;\n \n include();\n }\n} // end validate()", "function valSearchGirviByFixedAmountInputs(obj) {\r\n if (validateEmptyField(document.srch_girvi_fixedAmt.grvFixedAmt.value, \"Please enter girvi principal amount!\") == false ||\r\n validateNum(document.srch_girvi_fixedAmt.grvFixedAmt.value, \"Accept only Numbers without space character!\") == false) {\r\n document.srch_girvi_fixedAmt.grvFixedAmt.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function checkWhole(name, value){\n\t if (value.lastIndexOf('.') > -1){\n\t\t errMessages += \"<li>\" + name + \" - Must be whole number.</li>\";\n\t\t return false;\n\t }\n\t else{\n\t\t return true;\n\t }\n}", "function isOperator(value) {\r\n if (value == \"\") {\r\n return false;\r\n }\r\n\r\n switch (value) {\r\n case \"/\": \r\n return true;\r\n break;\r\n case \"x\": \r\n return true;\r\n break;\r\n case \"+\": \r\n return true;\r\n break;\r\n case \"-\": \r\n return true;\r\n break;\r\n \r\n default:\r\n return false;\r\n break;\r\n }\r\n}", "function operator(op)\n{\n if(op=='+' || op=='-' || op=='^' || op=='*' || op=='/' || op=='(' || op==')')\n {\n return true;\n }\n else\n return false;\n}", "function isNumber(n) { return !isNaN(parseFloat(n)) && !isNaN(n - 0) }", "function nummy(x) { return !isNaN(parseFloat(x)) && isFinite(x) }", "function checkDecimals(fieldName, fieldValue) {\r\n\t \r\n\tdecallowed = 2; // how many decimals are allowed?\r\n\t \r\n\tif (isNaN(fieldValue) || fieldValue == \"\") {\r\n\talert(\"Eso no parece ser un número válido. Prueba de nuevo.\");\r\n\tfieldName.select();\r\n\tfieldName.focus();\r\n\t}\r\n\telse {\r\n\tif (fieldValue.indexOf('.') == -1) fieldValue += \".\";\r\n\tdectext = fieldValue.substring(fieldValue.indexOf('.')+1, fieldValue.length);\r\n\t \r\n\tif (dectext.length > decallowed)\r\n\t{\r\n\talert (\"Por favor, entra un número con \" + decallowed + \" números decimales.\");\r\n\tfieldName.select();\r\n\tfieldName.focus();\r\n\t }\r\n\telse {\r\n\talert (\"Número validado satisfactoriamente.\");\r\n\t }\r\n\t }\r\n\t}", "function isOnePointZero(n) {\n\t\t\treturn typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t\t\treturn typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}", "function isOnePointZero(n) {\n\t return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n\t}" ]
[ "0.69139385", "0.6816431", "0.67309296", "0.6696356", "0.66922146", "0.66899997", "0.6625281", "0.6612892", "0.66054374", "0.66033256", "0.6542331", "0.6487446", "0.64622116", "0.63859946", "0.6340719", "0.63181967", "0.6305245", "0.62423027", "0.62367165", "0.6158495", "0.61520094", "0.61445385", "0.613839", "0.6125168", "0.61242485", "0.6117958", "0.6115544", "0.6111713", "0.6110972", "0.6108298", "0.6094763", "0.6084616", "0.60836244", "0.6081446", "0.6068598", "0.606564", "0.6061403", "0.6059311", "0.6052923", "0.6038418", "0.6034789", "0.6021622", "0.6015131", "0.60117435", "0.600996", "0.6008619", "0.6008619", "0.5996706", "0.599642", "0.5995303", "0.5992375", "0.5983518", "0.5982643", "0.5969849", "0.59676695", "0.5963887", "0.5958781", "0.59583765", "0.5952287", "0.5950048", "0.5944381", "0.59222984", "0.5921769", "0.5921716", "0.5920222", "0.59168565", "0.5916021", "0.5913884", "0.5912785", "0.5905515", "0.59046096", "0.59027004", "0.5901915", "0.5896618", "0.5880528", "0.58787704", "0.5874765", "0.58614933", "0.58589226", "0.58582217", "0.58558255", "0.58533233", "0.5845626", "0.5843954", "0.5841868", "0.58397907", "0.58387583", "0.583567", "0.5833745", "0.58259666", "0.5823132", "0.5815567", "0.58149266", "0.58079803", "0.58026546", "0.579952", "0.5795546", "0.5795546", "0.5793793", "0.5793793" ]
0.688854
1
checks whether given character is a number
function isNumeric(value) { return (value == Number(value)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isNumber(character) {\n return Number.isInteger(parseInt(character))\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumeric (c) {\n // FIXME: is this correct? Seems to work\n return (c >= '0') && (c <= '9')\n}", "function isNumberChar(char) {\n\treturn char.charCodeAt(0) >= 48 && char.charCodeAt(0) <= 57;\n}", "function isNumeric (c) {\n\t // FIXME: is this correct? Seems to work\n\t return (c >= '0') && (c <= '9')\n\t}", "function is_digit(char) {\n return /[0-9]/i.test(char);\n }", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDigit (c)\r\n{ return ((c >= \"0\") && (c <= \"9\"))\r\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit_(char) {\n return char >= '0' && char <= '9';\n}", "function isDigit(character)\n{\n return (1 == character.length) && (!isNaN(parseInt(character), 10));\n}", "function isDigit(char) {\n return char >= '0' && char <= '9';\n}", "function isNumber(character){\n return !isNaN(character);\n}", "function isNumeric(c) \n\t{\n\t\tif (c >= '0' && c <= '9') \n\t\t{\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}", "function isDigit (c)\n{ return ((c >= \"0\") && (c <= \"9\"))\n}", "function isDigit(c) {\n return c >= '0' && c <= '9';\n}", "function isDigit(ch) {\n return /^[0-9]$/.test(ch);\n }", "function isNumeral(ch) {\n const Ascii_0 = 48;\n const Ascii_9 = 57;\n let code = ch.charCodeAt(0);\n return Ascii_0 <= code && code <= Ascii_9;\n }", "function sc_isCharNumeric(c)\n { return sc_isCharOfClass(c.val, SC_NUMBER_CLASS); }", "function charIsDigit(charCode)\n{\n return (charCode >= 48 && charCode <= 57);\n}", "function isDigit(s) { return Number.isInteger(parseInt(s)); }", "function isValidNumberChar(ch) {\n return isNumeral(ch) || ch === '.';\n }", "function isDigit(c)\n{\n return !isNaN(parseFloat(c)) && isFinite(c);\n}", "function isDigit(charVal)\r\n{\r\n\treturn (charVal >= '0' && charVal <= '9');\r\n}", "function isDigit(num) {\r\n var string=\"1234567890\";\r\n if (string.indexOf(num) != -1) {\r\n return true;\r\n }\r\n return false;\r\n }", "function isNumeric(str) {\r\n\tvar re = /[\\D]/g;\r\n\tif (re.test(str)) {\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isDigit(num) {\r\n\tif (num.length>1){return false;}\r\n\tvar string=\"1234567890\";\r\n\tif (string.indexOf(num)!=-1){return true;}\r\n\treturn false;\r\n\t}", "isNumeric(value) {\n return /^-{0,1}\\d+$/.test(value);\n }", "function hasNumber(str) {\n return /\\d/.test(str);\n}", "function isDigit( x ) {\n\n\t\treturn /^[0-9]$/.test( x );\n\n\t}", "function isNumeric(input) { return (input - 0) == input && input.length > 0;}", "function isDigit(value) {\n return !isNaN(parseInt(value, 10));\n}", "static isDigit(ch) {\n return ch >= 0x30 && ch < 0x3A;\n }", "function is_digit(str)\n{\n\tif (str.length==0) return false;\n\tfor (var i=0;i < str.length;i++)\n\t{\n\t\tif (str.charAt(i) < '0' || str.charAt(i) > '9') return false;\n\t}\n\treturn true;\n}", "function fc_IsNumberInt(num){\n if(num==\"\"){\n return false;\n }else{ \n m = \"0123456789\";\n for(i=0;i<num.length;i++){\n if(m.indexOf(num.split('')[i])==-1)\n return false;\n }\n } \n return true;\n}", "function isdigit(s)\n{\n var r,re;\n re = /\\d*/i; \n r = s.match(re);\n return (r==s)?1:0;\n}", "function isDigit(num) {\n if (num.length>1){return false;}\n var string=\"1234567890\";\n if (string.indexOf(num)!=-1){return true;}\n return false;\n}", "hasNumber(inputString) {\r\n return /\\d/.test(inputString);\r\n }", "function containsNumber(s) {\n return s.match(/[1-9]/);\n}", "function hasNumber(string) {\n\t return(/[\\]\\\\_+-.,!?@#$%^&*():=;/|<>\"'0-9]+/g.test(string));\n\t}", "function hasNumber(string) {\n return /\\d/.test(string);\n}", "function isDigit(num) {\r\n if (num.length > 1) {\r\n return false;\r\n }\r\n var string = \"1234567890\";\r\n if (string.indexOf(num) != -1) {\r\n return true;\r\n }\r\n return false;\r\n}", "function isnumeric(val){\n\tvar check = /^[\\d]+$/;\n\treturn check.test(trim(val));\n}", "function isNumeric(input) {\n return (input - 0) == input && (''+input).trim().length > 0;\n}", "function isnum(num) {\n return (/^\\d+$/.test(num + \"\"));\n}", "function isNumeric(value){\n return (/^[\\d]+$/g).test(value);\n }", "function zisNumber(e) {\n k = (document.all) ? e.keyCode : e.which;\n if (k === 8 || k === 0)\n return true;\n patron = /\\d/;\n n = String.fromCharCode(k);\n return patron.test(n);\n}", "function isNumeric(value) {\n return /^-?\\d+$/.test(value);\n}", "function IsNumber(e) {\n\ttecla = (document.all) ? e.keyCode : e.which;\n\tif(tecla==0){\n\t\treturn true;\n\t}else{\n\t\tif (tecla==8) return true;\n\t\tpatron = /\\d/; // Solo acepta números\n\t\tte = String.fromCharCode(tecla);\n\t\treturn patron.test(te);\n\t}\n}", "function isNumber(input) {\n if (input.match(/[0-9]+/)) {\n return true;\n } else {\n return false;\n }\n}", "function _isDecimalDigit(ch) {\n return ch >= 48 && ch <= 57; // 0...9\n }", "function isNumber(input){\n\tif (input.match(/[0-9]+/)) {\n return true;\n } else {\n return false;\n }\n}", "function isValidCharToStartNumber(ch) {\n return isNumeral(ch) || ch == '-';\n }", "function num_d(event){\n var char = event.which;\n if (char > 31 && (char < 48 || char > 57) && char != 68) {\n return false;\n }\n}", "function isNumeric(s) {\n return !/[^0-9]/.test(s);\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character;\n return code >= 48 && code <= 57; /* 0-9 */\n}", "function hasNumber(myString) {\n return /\\d/.test(myString);\n }", "function is_number(e) {\n\tvar c = e.which ? e.which : e.keyCode;\n\treturn (c <= 32 || (c >= 48 && c <= 57) || c == 40 || c == 41 || c == 45 || c == 46)\n}", "function isNumeric(string) {\n\treturn isNumeric1(string, false);\n}", "function isDigit(s) {\n return s.trim() ? !isNaN(s) : false;\n }", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function decimal(character) {\n var code = typeof character === 'string' ? character.charCodeAt(0) : character\n\n return code >= 48 && code <= 57 /* 0-9 */\n}", "function checkStrToNum(phone_number)\r\n{\r\n\tfor(var n=0;n<phone_number.length;n++)\r\n\t{\r\n\t\tvar chr = phone_number.charAt(n);\r\n\r\n\t\tif(isNaN(chr))\r\n\t\t{\r\n \t\treturn false;\r\n \t\t}\r\n\t}\r\n\treturn true;\r\n}", "function isNum(str) {\r\n\t\t\tif(str) {\r\n\t\t\t\treturn str.match(/^-?(\\d+|\\d+\\.?\\d*|\\d*\\.?\\d+)$/);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}", "function hasNumber(myString) {\n return (/\\d/.test(myString));\n}", "function isAlphaNumeric(char){\n let code = char.charCodeAt(0);\n if(!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)){\n return false;\n }\n return true;\n}", "function isNumber(codepoint) {\n return codepoint >= Character._0 && codepoint <= Character._9;\n}", "function verifyNonNumericCharacters(input) {\n if (/\\D/.test(input)) {\n return false;\n } else {\n return true;\n }\n}", "function isDigit(code) {\n return code >= 0x0030 && code <= 0x0039;\n}", "function isNumeric(input) {\n return (typeof input) == \"number\";\n}", "function isNum(str) {\n return !isNaN(str.toString());\n}", "function isNum(argvalue) \n{\n\targvalue = argvalue.toString();\n\tif (argvalue.length == 0)\n\treturn false;\n\tfor (var n = 0; n < argvalue.length; n++)\n\t\tif (argvalue.substring(n, n+1) < \"0\" || argvalue.substring(n, n+1) > \"9\")\n\t\t\treturn false;\n\treturn true;\n}", "function hasNumbers(string){\n\t\tvar regex = /\\d/g;\n\t\treturn regex.test(string);\n\t}", "function isDigitOrBar( str ) {\n\tfor(var i=0; i < str.length; i++) {\n\t\tvar ch= str.charAt(i);\n\t\tif((ch < \"0\" || ch > \"9\") && ch!=\"-\") {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function ___R$$priv$project$rome$$internal$codec$config$json$parse_ts$isNumberChar(\n\t\tchar,\n\t) {\n\t\treturn (\n\t\t\t___R$project$rome$$internal$parser$core$utils_ts$isDigit(char) ||\n\t\t\tchar === \"_\"\n\t\t);\n\t}", "function isAlphaNumericCharacter(character) {\n const characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n}", "function isAlphaNumericCharacter(character) {\n const characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n}", "function isNumeric(number) {\n\tfor (var i = 0; i < number.length; i++) {\n\t\tif (isFigure(number.charAt(i)) == false) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function numericCheck(inputString) {\n return /^[0-9]+$/.test(inputString);\n}", "function isAlphaNumeric(char) {\n var code = char.charCodeAt(0);\n if (!(code > 47 && code < 58) &&\n !(code > 64 && code < 91) &&\n !(code > 96 && code < 123)) {\n return false\n }\n return true\n}", "function isAlphaNumericCharacter(character) {\n var characterCode = character.charCodeAt(0);\n return ((48 /* '0' */ <= characterCode && characterCode <= 57) /* '9' */ ||\n (65 /* 'A' */ <= characterCode && characterCode <= 90) /* 'Z' */ ||\n (97 /* 'a' */ <= characterCode && characterCode <= 122) /* 'z' */);\n }", "function isNum(strSrc){\r\n\tvar strNum = \"0123456789\";\r\n\tvar len = strSrc.length;\r\n\tfor(var i=0;i<len;i++){\r\n\t\tif (strNum.indexOf(strSrc.charAt(i))<0){\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}\r\n\treturn true;\r\n}", "function IsCharCodeNumeric(charCode)\n{\n return ((charCode > 47) && (charCode < 58));\n}", "function isNumber()\n{\n var validNum = false;\n if ( parseInt(numInString) )\n {\n validNum = true;\n }\n return validNum;\n}", "function isNumeric(num) {\n if (/^\\d+$/.test(num)) {\n //.log(\"test passed\");\n return true;\n } else {\n return false;\n }\n}", "function CHMisNumber(theInputField)\r\n{\r\n\r\n theInput = theInputField.value;\r\n theLength = theInput.length ;\r\n for (var i = 0 ; i < theLength ; i++)\r\n {\r\n\t//check if number field contains alphabets or spaces\r\n if (theInput.charAt(i) < '0' || theInput.charAt(i) > '9')\r\n {\r\n\t return false;\r\n\t}\r\n }// for ends\r\n return true;\r\n}// function isNumber ends", "function validNumber(input){\r\n\treturn (input.length == 10 || input[0] == \"0\");\r\n}" ]
[ "0.8518806", "0.84560513", "0.84560513", "0.84560513", "0.8431379", "0.83283424", "0.8242123", "0.82182574", "0.82069254", "0.82069254", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8205346", "0.8203583", "0.81995386", "0.81980187", "0.81810784", "0.817938", "0.8175296", "0.8093602", "0.7987422", "0.7977604", "0.79152995", "0.78640425", "0.7860486", "0.78012383", "0.777428", "0.76858646", "0.7595727", "0.7571592", "0.755309", "0.7518773", "0.7509496", "0.75007266", "0.74980277", "0.74627066", "0.7462381", "0.74483013", "0.7432043", "0.7417763", "0.7415365", "0.7394107", "0.73893183", "0.738251", "0.7357684", "0.7337889", "0.7328176", "0.7322524", "0.7320402", "0.7315787", "0.7305483", "0.73052", "0.72995", "0.7294669", "0.7290512", "0.7281434", "0.7269008", "0.72600234", "0.7259521", "0.7257533", "0.7255601", "0.72543937", "0.7252271", "0.72366714", "0.72322387", "0.72322387", "0.72322387", "0.72322387", "0.72322387", "0.72322387", "0.72322387", "0.7224389", "0.72126794", "0.71897256", "0.71869695", "0.71833503", "0.7179363", "0.7177465", "0.7169458", "0.71607363", "0.7155291", "0.71485835", "0.7133299", "0.71247", "0.71129954", "0.71129954", "0.70963395", "0.7091971", "0.7088926", "0.7084654", "0.70798284", "0.70767516", "0.7074856", "0.70648515", "0.7060994", "0.70579904" ]
0.0
-1
clears chain of operations
function clearOpChain() { opChain.length = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "clear() {\n this.currOperand = ''\n this.prevOperand = ''\n this.operation = undefined\n }", "clear() {\n this.currentOperand = ''\n this.previousOperand = ''\n this.operation = undefined\n }", "clear() {\n this.currentOperand = '', this.previousOperand = '', this.operation = '' ;\n }", "clear(){\r\n this.currentOperand = '';\r\n this.previousOperand = '';\r\n this.operation = undefined;\r\n }", "allClear() {\n this.currentOperand = ''\n this.previousOperand = ''\n this.operation = undefined \n }", "clear() {\n // clearing the viewers and setting the operation to undefined\n this.readyToReset = true;\n this.currentOperand = '';\n this.previousOperand = undefined;\n this.operation = undefined;\n this.espSymbol = undefined;\n }", "clear() {\r\n //empty string as default\r\n this.currentOperand = ''\r\n this.previousOperand = ''\r\n //allClear has no operation selected, so it's defined\r\n this.operation = undefined\r\n }", "function clearAll() {\n opChain = [0];\n display.innerHTML = \"0\";\n displaySub.innerHTML = \"\";\n}", "function clear() {\n state = {\n operandOne: \"0\",\n operandTwo: undefined,\n operation: undefined,\n result: undefined\n };\n }", "clearOperations() {\n this._Operations = undefined;\n }", "clear() {\n this._clear();\n this._clearPlus();\n }", "clear() {\n this.lastOperand = \"\";\n this.currOperand = \"\";\n this.operator = undefined;\n }", "function clearAll () {\n\n heldValue = null;\n heldOperation = null;\n nextValue = null;\n\n}", "clear() {\n\t\tlet e = this.first();\n\t\twhile (e != 0) { this.delete(e); e = this.first(); }\n\t}", "clearAll() {\n this._operation = [];\n this._lastNumber = 0;\n this._lastOperator = '';\n this.setLastNumberToDisplay();\n }", "function clearCalc() {\n clearNum();\n clearOp();\n}", "static clear() {\n curr_o = \"\";\n prev_o = \"\";\n oppr = \"\";\n res = 0;\n check = 0;\n return;\n }", "clear() {\n assert(!this.written, 'Already written.');\n this.ops = [];\n return this;\n }", "function clear() {\n current = null;\n previous = null;\n operant = null;\n rePrint = true;\n updateDisplay('0');\n}", "clearAll() {\n this._operation = [];\n this._lastNumber = '';\n this._lastOperator = '';\n this.setLastNumberToDisplay();\n }", "clear() {\n this.operation = [];\n this.updateDisplay();\n }", "clear() {}", "clear() {}", "clear() {}", "destroy() {\n this.ops.length = 0;\n this.offset = 0;\n return this;\n }", "function resetOperations() {\n currentOperation = -1;\n operations.length = 0;\n saveOperation();\n}", "function clearScreen(){\n currentOperand='';\n previousOperand='';\n operation=undefined;\n}", "clear() {\n\t\treturn this.update( state => {\n\t\t\t\treturn { name: \"clear()\", nextState: {} };\n\t\t\t});\n\t}", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "reset () {\n chainCache = {}\n }", "function allClear () {\n left = \"\";\n operator = \"\";\n right = \"\";\n // clearLog(); // Commented out clearLog function so that the log can now never be deleted\n enableDecimal();\n setDisplay(left);\n}", "clear() { }", "clear () { }", "clear() {\n this._exec(CLEAR);\n return this._push(CLEAR);\n }", "function clear() {\n screen.textContent = \"0\";\n firstOperand = \"\";\n secondOperand = \"\";\n currentOperation = null;\n}", "function clearAllHandler() {\n\theldValue = null;\n\theldOperation = null;\n\tnextValue = null;\n\t$(\".next-operation\").text(\"\");\n\tupdateDisplay();\n}", "function allClear () {\n calcDisplay.displayValue = '0';\n calcDisplay.firstOperand = null;\n calcDisplay.waitForSecondOperand = false;\n calcDisplay.operator = null;\n console.log('All Cleared');\n}", "clearAll() {\n this.clearGraphic()\n this.clearData()\n }", "reset() {\n for (let i = 0; i < this.allNodes.length; i++) { this.allNodes[i].reset(); }\n for (let i = 0; i < this.Splitter.length; i++) {\n this.Splitter[i].reset();\n }\n for (let i = 0; i < this.SubCircuit.length; i++) {\n this.SubCircuit[i].reset();\n }\n }", "clear() {\n this.rows.forEach(row => {\n row.forEach(algedonode => {\n algedonode.clear()\n })\n })\n this.dials.forEach(dial => {\n dial.clear()\n })\n }", "function clear()\n{\n\twhile(list.length){\n\t\tlist.pop();\n\t}\n\twhile(list_out.length){\n\t\tlist_out.pop();\n\t}\n\twhile(steps.length){\n\t\tsteps.pop();\n\t}\t\n\tvar num_steps = 0;\n}", "clear() {\n this.active = -1\n this.outputs.forEach(output => output.clear())\n }", "function clearValue() {\n firstSet = \"\";\n secondSet = \"\";\n toggleSet = false;\n operation = \"\";\n \n display();\n}", "function clear() {\n operActual = \"\";\n operAnterior = \"\";\n operacion = undefined;\n}", "function clear() {\n\t//this function will clear all stored data for the following varible\n //allowing the user to start fresh and NOT conintue with the same 1st equation\n calDisplay.value = 0;\n\t\tnum1 = null;\n num2 = null;\n operator = undefined;\n}", "clear() {\n this.dialOutputs.forEach(dialOutput => {\n dialOutput.clear()\n })\n }", "function clearScreen(){\n calculator.displayValue='0';\n calculator.firstOperand=null;\n calculator.waitingForSecondOperand=true;\n calculator.operator=null;\n \n}", "function clear() {\n input.textContent = '';\n operand1 = '';\n operand2 = '';\n operator = '';\n}", "clear() {\n\n }", "clear() {\n\n }", "function clearAll() {\n shouldAutoClear = false;\n expressionElm.empty();\n tokensElm.empty();\n treeElm.empty();\n resultElm.empty();\n }", "clear() {\n this.destroy();\n }", "function clear(){\n\n\tdisplay.textContent = '';\n\tcalculation['operand'] = '';\n\tcalculation['operand2'] = '';\n\tcalculation['operator'] = '';\n\tcalculation['operator2'] = '';\n}", "clear() {\n this._clear();\n }", "clear() {\n this._unmarkAll();\n\n this._emitChangeEvent();\n }", "clear() {\n this._count = 0;\n this._root = null;\n }", "function clearChainDisplay() {\r\n displayChain.textContent = \"\";\r\n}", "function clear() {\n\t\tcontext.clear();\n\t}", "function clear() {\n\t\tcontext.clear();\n\t}", "clear() {\n this.sendAction('clear');\n }", "clear() {\n // hello from the other side\n }", "function CLEAR(state) {\n if (exports.DEBUG) {\n console.log(state.step, 'CLEAR[]');\n }\n\n state.stack.length = 0;\n }", "clear() {\n\t\t\tthis.mutate('');\n\t\t}", "function clear() {\n $log.debug(\"kyc-flow-state clear()\");\n clearCurrent();\n states = [];\n }", "function clear() {\r\n\t\tcontext.clear();\r\n\t}", "clear() {\n var _a;\n if ((_a = this.canvas.flow) === null || _a === void 0 ? void 0 : _a.rootStep) {\n this.canvas.flow.rootStep.destroy(true, false);\n this.canvas.reRender();\n }\n }", "function clear() {\n op = '';\n a = '';\n b = '';\n displayValue = '0';\n}", "function clear(operation = '') {\r\n history += current+ ' ' + operation + ' ';\r\n historyDisplay.innerText = history;\r\n currentDisplay.innerText = '';\r\n current = '';\r\n tempDisplay.innerText = result;\r\n}", "function clearAll() {\n clearInputs();\n num1 = '';\n num2 = '';\n inputOperator = '';\n updateCalculatorDisplay();\n}", "function onClearClick()\n {\n //Reset all the variables back to their initial state.\n runningTotal = 0;\n currentOperand = 0;\n currentOperator = \"\";\n hasPressedOperand = false;\n hasPressedOperator = false;\n \n //Update the display to show the changes.\n updateDisplay();\n }", "clear () {\n this.control.disable();\n while (this.nodes.length) this.nodes[this.nodes.length-1].remove();\n this.control.enable();\n }", "clear() {\r\n this._clear();\r\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "clear() {\n this._unmarkAll();\n this._emitChangeEvent();\n }", "function CLEAR(state) {\n if (DEBUG) console.log(state.step, 'CLEAR[]');\n\n state.stack.length = 0;\n}", "function sirenClear() {\n var elm;\n\n elm = d.find(\"dump\");\n d.clear(elm);\n elm = d.find(\"links\");\n d.clear(elm);\n elm = d.find(\"actions\");\n d.clear(elm);\n elm = d.find(\"entities\");\n d.clear(elm);\n elm = d.find(\"properties\");\n d.clear(elm);\n }", "clear(){\n\t\tif(this.disposed)\n\t\t\treturn;\n\t\tthis.disposables.clear();\n\t}", "function clear() {\n context.clear();\n }", "_clear() {}", "reset() {\n this.router.clear();\n this.calls.clear();\n }", "function clearAll () {\n\tfor (var i = 0; i < num; i++) {\n\t\tp[i].finish();\n\t\tdelete p[i];\n\t}\n\tPelota.prototype.ID = 0;\n\tnum = 0;\n\tsetTimeout(function () {\n\t\tctx.clearRect(0, 0, can.width, can.height);\n\t}, 100);\n}", "clear() {\n\t\tif (this.state && this.state.root) {\n\t\t\tthis.state.root.empty()\n\t\t}\n\t}", "function clear() {\r\n context.clear();\r\n }", "clear() {\n this.literals = new Set();\n this.state.forEach((row, y) => row.forEach((_, x) => this.setClear(x, y)));\n }", "function CLEAR(state) {\n if (exports.DEBUG) console.log(state.step, 'CLEAR[]');\n\n state.stack.length = 0;\n}", "clear() {\n // Set canvas to clear\n this.getContext().clearRect(0, 0, this.width, this.height);\n // Set UIntVector to zeros\n this.intermediateVector.fill(0);\n this.originalIntermediateVector.fill(0);\n }", "clear() {\n // !!!! IMPLEMENT ME !!!!\n }", "function calcClear() {\n firstNumb = null;\n secondNumb = null;\n totalSum = 0;\n operator = null;\n calcHistory = ''\n inputHistory.textContent = '';\n clearDisplay();\n}", "deleteChain() {\n this.props.removeChain(\n this.props.results[this.props.resultIdx][\"id\"],\n this.props.refreshResults,\n this.props.resultsPerPage,\n this.props.pageNumber\n );\n }", "function ani_clear() {\n while(ani_stack.length > 0) {\n ani_stack.pop();\n }\n}", "clear() {\n this.requests = [];\n this.decoders = [];\n this.accountNextNonces = {};\n this.accountUsedNonces = {};\n }", "function clear(){\n firstNumber = \"\";\n secondNumber = \"\";\n result = 0;\n operator = \"\";\n operatorClicked = false;\n $(\"#first-number\").empty();\n $(\"#second-number\").empty();\n $(\"#operator\").empty();\n $(\"#result\").empty();\n }", "function clearPaths() {\n path = new dwv.math.Path();\n currentPath = new dwv.math.Path();\n }", "clearAll() {\n return this.clear();\n }", "function theclear () {\n this.top = 0;\n this.dataStore.length = 0;\n}", "clear() {\n wipe_1.wipe(this.data);\n }", "clear() {\n // clear all three canvas\n this.clearBg();\n this.clearObj();\n this.clearGr();\n }", "@action clearUndo() {\n let that = this;\n that.undoHistory = A();\n }", "clear() {\n const me = this,\n {\n stores\n } = me,\n children = me.children && me.children.slice(); // Only allow for root node and if data is present\n\n if (!me.isRoot || !children) {\n return;\n }\n\n for (const store of stores) {\n if (!store.isChained) {\n if (store.trigger('beforeRemove', {\n parent: me,\n records: children,\n isMove: false,\n removingAll: true\n }) === false) {\n return false;\n }\n }\n }\n\n me.children.length = 0;\n stores.forEach(store => {\n children.forEach(child => {\n if (child.stores.includes(store)) {\n // this will drill down the child, unregistering whole branch\n child.unJoinStore(store);\n }\n\n child.parent = child.parentIndex = child.nextSibling = child.previousSibling = null;\n });\n store.storage.suspendEvents();\n store.storage.clear();\n store.storage.resumeEvents();\n store.added.clear();\n store.modified.clear();\n store.trigger('removeAll');\n store.trigger('change', {\n action: 'removeall'\n });\n });\n }", "reset() {\n this._lastDir = null;\n this._lastFilterIndex = null;\n }" ]
[ "0.7352157", "0.73210645", "0.7275615", "0.72470576", "0.71738577", "0.70581996", "0.6985693", "0.6970416", "0.696341", "0.69626373", "0.68605435", "0.6835106", "0.6824505", "0.6766492", "0.67252326", "0.671317", "0.6704351", "0.6685185", "0.66244817", "0.6595804", "0.65949255", "0.65923864", "0.65923864", "0.65923864", "0.65304464", "0.64889", "0.6481359", "0.6428422", "0.64216524", "0.63947076", "0.6389002", "0.6377094", "0.63748646", "0.63596505", "0.628786", "0.6270106", "0.6256441", "0.6239566", "0.62249935", "0.6219296", "0.6217156", "0.6206745", "0.61946535", "0.6173618", "0.6158596", "0.6158465", "0.61468357", "0.61292535", "0.61284983", "0.61284983", "0.6102702", "0.60988474", "0.60971427", "0.6081894", "0.60768074", "0.6067402", "0.6048941", "0.6043555", "0.6043555", "0.6031148", "0.60279006", "0.6023742", "0.60202104", "0.6018582", "0.60152966", "0.60134596", "0.5994353", "0.5987907", "0.5977669", "0.59743106", "0.5973072", "0.59472764", "0.5939736", "0.5939736", "0.59374404", "0.59350044", "0.5927243", "0.591127", "0.5909584", "0.5907622", "0.5898948", "0.5889334", "0.5880477", "0.5878172", "0.58777046", "0.58639157", "0.586104", "0.58564097", "0.5834569", "0.58207", "0.5799466", "0.5799082", "0.57873285", "0.578673", "0.5786066", "0.5783087", "0.5780096", "0.5779849", "0.5777577", "0.5774136" ]
0.81701005
0
clears display, sub display, and sets chain of operations to default 0
function clearAll() { opChain = [0]; display.innerHTML = "0"; displaySub.innerHTML = ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearDisplay() {\n result = 0;\n recentOp = \"\";\n keySelect.display.value = \"\";\n newNum = true;\n }", "function clearDisplay(){\n display.textContent = '0'\n num1=0;\n num2 =0;\n chosen_operator =''\n}", "function allClear () {\n calcDisplay.displayValue = '0';\n calcDisplay.firstOperand = null;\n calcDisplay.waitForSecondOperand = false;\n calcDisplay.operator = null;\n console.log('All Cleared');\n}", "function clear() {\n screen.textContent = \"0\";\n firstOperand = \"\";\n secondOperand = \"\";\n currentOperation = null;\n}", "function clearDisplay() {\n display = 0;\n operator_pressed = false;\n previous_number = 0;\n current_operation = \"\";\n document.getElementById(\"display\").value = display;\n}", "clearDisplay() {\n this.current.innerHTML = '0';\n this.last.innerHTML = '';\n return\n }", "function clearScreen(){\n calculator.displayValue='0';\n calculator.firstOperand=null;\n calculator.waitingForSecondOperand=true;\n calculator.operator=null;\n \n}", "function clear() {\n op = '';\n a = '';\n b = '';\n displayValue = '0';\n}", "function clear(){\n\n\tdisplay.textContent = '';\n\tcalculation['operand'] = '';\n\tcalculation['operand2'] = '';\n\tcalculation['operator'] = '';\n\tcalculation['operator2'] = '';\n}", "function clear() {\n current = null;\n previous = null;\n operant = null;\n rePrint = true;\n updateDisplay('0');\n}", "resetCalculator() {this.display = 0; this.runningTotal = 0; this.operands = []; this.operandCount = 0; this.hasRunningTotal = false;}", "function clearClick() {\n displayString = \"\";\n lowerDisplayString = \"\";\n $('#display').text(\"0\");\n $('#lower-display').text(\"0\");\n mathObject.firstNumber = 0;\n firstOperator = true;\n console.log(mathObject);\n}", "function flushOperation(intCalcDisplay) {\n switch (previousOperator) {\n case 'opPlus':\n runningTotal += intCalcDisplay;\n break;\n case 'opMinus':\n runningTotal -= intCalcDisplay;\n break;\n case 'opMultiply':\n runningTotal *= intCalcDisplay;\n break;\n case 'opDivide':\n runningTotal /= intCalcDisplay;\n break;\n default:\n }\n}", "function displayClear() {\n displayOutput = \"\";\n num1 = \"\";\n num2 = \"\";\n operator = \"\";\n displayNumbering = \"\";\n computation = \"\";\n document.getElementById(\"decimal\").disabled = false;\n document.getElementById(\"displayString\").innerHTML = displayOutput.substring((displayOutput.length - 9), displayOutput.length + 1);\n document.getElementById(\"displayNumber\").innerHTML = displayNumbering;\n for (i = 0; i < operatorsList.length; i++) {\n operatorsList[i].disabled = false;\n }\n}", "function clearCalc() {\n document.getElementById(\"calcDisplay\").innerHTML = 0;\n currentValue = \"\";\n saveNumber = \"\";\n useOperator = \"\";\n}", "function calcClear() {\n firstNumb = null;\n secondNumb = null;\n totalSum = 0;\n operator = null;\n calcHistory = ''\n inputHistory.textContent = '';\n clearDisplay();\n}", "function clearButton() {\n display.textContent = 0;\n topLine.textContent = \"\";\n outputNum = \"\";\n operationArray = [];\n storedOperator = \"\";\n decimalBtn.disabled = false;\n}", "function clr() {\n document.getElementById(\"display\").innerHTML = \"\";\n document.getElementById(\"display1\").innerHTML = \"0\";\n console.log(\"clear\");\n}", "function allClear () {\n left = \"\";\n operator = \"\";\n right = \"\";\n // clearLog(); // Commented out clearLog function so that the log can now never be deleted\n enableDecimal();\n setDisplay(left);\n}", "function clear() {\n\t//this function will clear all stored data for the following varible\n //allowing the user to start fresh and NOT conintue with the same 1st equation\n calDisplay.value = 0;\n\t\tnum1 = null;\n num2 = null;\n operator = undefined;\n}", "function clearScreen() {\n buffer = \"0\";\n total = 0;\n operator = null;\n}", "function clearCalc() {\n clearNum();\n clearOp();\n}", "function clearScreen(){\n currentOperand='';\n previousOperand='';\n operation=undefined;\n}", "setZeroDisplay(){\n this.displayCalc = \"0\";\n }", "function clickClearButton(event) {\n setDisplay('0')\n setFirstOperand('')\n setOperator(null)\n setSecondOperand('')\n }", "function reset() {\n\tvar firstNumber, secondNumber, operator = null;\n\tdisplayText(0);\n}", "function clearValue() {\n firstSet = \"\";\n secondSet = \"\";\n toggleSet = false;\n operation = \"\";\n \n display();\n}", "function clear() {\n num1 = '';\n num2 = '';\n operand = '';\n displayWindow.innerHTML = 0;\n equalTemp = undefined;\n eqPress = false;\n}", "function onClearClick()\n {\n //Reset all the variables back to their initial state.\n runningTotal = 0;\n currentOperand = 0;\n currentOperator = \"\";\n hasPressedOperand = false;\n hasPressedOperator = false;\n \n //Update the display to show the changes.\n updateDisplay();\n }", "function reset () {\n\tthis.num1 = 0;\n\tthis.num2 = 0;\n\tthis.operator = \"\";\n\tdisplayNum.innerHTML = 0;\n\tdecimal = 0;\n}", "clearDisplay(){\n\nconsole.log(\"inside clear display\");\nthis.setState({\n displayValue : 0,\n waiting : false,\n oldnum : 0,\n operator : null\n})\n\n }", "function clear(operation = '') {\r\n history += current+ ' ' + operation + ' ';\r\n historyDisplay.innerText = history;\r\n currentDisplay.innerText = '';\r\n current = '';\r\n tempDisplay.innerText = result;\r\n}", "function clearChainDisplay() {\r\n displayChain.textContent = \"\";\r\n}", "function Calculator_Reset() {\n Calculator.Display_Value = '0';\n Calculator.First_Operand = null;\n Calculator.Wait_Second_Operand = false;\n Calculator.operator = null;\n}", "function clear() {\n state = {\n operandOne: \"0\",\n operandTwo: undefined,\n operation: undefined,\n result: undefined\n };\n }", "function clearAll() {\n tempNumber = '';\n firstNumber = '';\n secondNumber = '';\n displayNum = '';\n opperator = '';\n display.textContent = 0;\n subDisplay.textContent = \"\";\n}", "function clearDisplay(){\n firstNumber = 0;\n lastNumber = 0;\n memory = 0;\n operatorSign = '';\n operatorSignMemory = '';\n firstTextValue.textContent = '';\n secondTextValue.textContent = '';\n displayOperator.textContent = '';\n \n\n firstTextValue.classList.remove('text-muted');\n}", "function ac() {\n display = true;\n document.getElementById(\"display\").innerText = 0;\n document.getElementById(\"calculation-display\").innerText = \"\";\n}", "clear() {\n this.operation = [];\n this.updateDisplay();\n }", "function clearDisplay(){\n\tvar inputScreen = document.querySelector('.screen');\n\t//blank display\n\tinputScreen.innerHTML = '';\n\t//factorials allowed\n\tfactorialBool = true;\n\t//start new screen on next button\n\tstartNew = true;\n\t//allow decimal point to be placed again\n\tif (document.getElementById(\"decimal\").classList.contains(\"selected\")){\n\t\tdecimalBool = true;\n\t\tdocument.getElementById(\"deci\").classList.remove(\"disabled\");\n\t}\n\t//Disable operators; can't be the first thing entered\n\tvar elements = document.getElementsByClassName(\"operator\");\n\tfor (var i = 0, len = elements.length; i < len; i++) {\n\t\tif(elements[i].innerHTML != '-'){\n \t\t\telements[i].classList.add('disabled');\n\t\t}\n\t}\n}", "function clearDisplay() {\n\tTi.API.info('called clearDisplay');\n // set the display to empty string\n $.lbl_display.text = '';\n $.lbl_mstore.text = '';\n $.lbl_arabic.text = '';//(0).toString(); //(current_num.arabic).toString();\n // reset the characters pressed variables to empty string\n last0_char = '',\n last1_char = '',\n last2_char = '',\n last_3_chars = '';\n dimChars(null);\n}", "function clearDisplay() {\n hideContainers();\n resetCopyNotes();\n resetClipboardNote();\n }", "function clear(){\n getNum.value = \"0\";\n storeInput = 0;\n operatorSymbol = \"\";\n}", "function clearAll() {\n calculation.textContent = \"\";\n calcDisplay.textContent = 0;\n return;\n}", "updateDisplay(){\r\n this.currentOperandTextElement.innerText = this.getDisplayNumber(this.currentOperand);\r\n // if the operation doesn't exist\r\n if (this.operation != null){\r\n this.previousOperandTextElement.innerText = `${this.previousOperand} ${this.operation}`\r\n } else{\r\n this.previousOperandTextElement.innerText = '';\r\n }\r\n }", "function clear() {\n firstNumber = null;\n secondNumber = null;\n operator = null;\n output.textContent = \"\";\n decimalButton.addEventListener('click', inputDecimal);\n}", "function cAllClear() {\n // AC\n zeroValues();\n document.getElementById(\"total\").textContent = \"0\";\n document.getElementById(\"outputTyped\").textContent = \"0\";\n oldTotal = 0;\n}", "function clearDisplay()\n{\n const clear = document.querySelector(`#clear`);\n\n clear.addEventListener(`click`, function()\n {\n resetArray();\n resetTotal();\n resetOperator();\n\n updateDisplay(inputArray);\n });\n}", "function clearOutput() {\n document.getElementById(\"output\").value = \"0\"\n display = evaluationString = lastDigitClicked = \"0\"\n isPowerPressed = false\n}", "updateDisplay(){\n this.currentOperandTextElement.innerText = this.getDisplayNumber(this.currentOperand)\n if(this.operation != null){\n this.previousOperandTextElement.innerText = `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandTextElement.innerText = ''\n }\n }", "function clearClickHandler(e) {\n calculator.clear();\n document.querySelector('#display').innerText = '';\n}", "function clearAll() {\n clearEntry();\n previousValue = 0;\n currentValue = 0;\n operatorPressed = \"\";\n result = 0;\n hasDoneMath = false;\n hasPrevValue = false;\n hasTooManyDigits = false;\n showBreadcrumbs(\"\");\n showNumberInDisplay(currentValue);\n}", "clearBothDisplay () {\n this.setState({display: [], cumDisplay: []});\n }", "function onClickClearAll() {\n strDisplay = \"\";\n opHidden = [];\n opHiddenIndex = 0;\n operandoType = 0;\n openParIndex = 0;\n closeParIndex = 0;\n refreshDisplay();\n}", "function clear(){\n\tdisp.textContent='0';\n\tdecPressed = 0;\n\tdocument.getElementById(\"back1\").disabled = false;\n\tansPressed = false;\n}", "function clearClicked() {\n\tlet displayText = document.getElementById('displayText')\n\tdisplayText.textContent = '0';\n}", "function clearCalacuator() {\n\n calaculator.displayNumber='0';\n calaculator.operator=null;\n calaculator.firstName=null;\n calaculator.waitingForSecondNumber=false;\n}", "function updateDisplay(input) {\n //if display is blank and input isn't zero or solution has been returned\n if ((display.innerHTML === \"0\" && input !== \"0\") || opChain === 0 || solutionReturned === true) {\n //if solution is displayed and input is an operator or display is blank and input is an operator\n if ((solutionReturned === true && !isNumeric(input)) || (display.innerHTML === \"0\" && !isNumeric(input))) {\n //set solution to false because operation chain is increasing\n solutionReturned = false;\n //add input to the chain\n chainOperation(input);\n //add input to the display\n display.innerHTML += input;\n } else {\n //if above conditions not met, clear the chain, input replaces blank display state of 0 and replaces default 0 in operation chain\n solutionReturned = false;\n clearOpChain();\n display.innerHTML = input;\n opChain.push(input);\n }\n } else {\n //if not starting from blank state, add input to display and operation chain\n display.innerHTML += input;\n chainOperation(input);\n }\n displaySub.innerHTML = opChain.join(\"\");\n}", "reset() {\n this.currentOperand = '0';\n this.previousOperand = '';\n this.operation = undefined;\n }", "function displayCalc(){\n // if display has no operator add number to numA\n // else to numB\n if (!checkOperator()){\n isCalculated();\n showAns('second');\n // if display shows 0 and user clicks 0, show 0\n if (display.innerText === '0'){\n display.textContent = this.innerText;\n } \n // if display number has a dot and user presses dot\n else if (display.innerText.includes('.') && this.innerText === '.'){\n // do nothing\n }\n else { \n display.textContent = display.innerText + this.innerText;\n }\n changeObject(calculator, 'numA', this.innerText);\n }\n else {\n // if display number has a dot and user presses dot\n if (calculator.numB != null || calculator.numB === ''){\n if (calculator.numB.includes('.') && this.innerText === '.'){\n // do nothing\n }\n display.textContent = display.innerText + this.innerText;\n }\n else { \n display.textContent = display.innerText + ' ' + this.innerText;\n }\n changeObject(calculator, 'numB', this.innerText);\n }\n}", "function clear() {\n displayValue = '';\n storeCurrent = '';\n storedValues = [];\n display('');\n decimalBtn.disabled = false;\n}", "updateDisplay() {\n this.currentOperandElement[0].value = this.getDisplayValue( this.currentOperand ) ;\n if ( this.operation != null ) {\n this.previousOperandElement[0].innerText = `${this.getDisplayValue(this.previousOperand)} ${this.operation}` ;\n } else {\n this.previousOperandElement[0].innerText = '' ;\n }\n }", "function resetScreen() {\n currentOperationScreen.textContent = '0';\n lastOperationScreen.textContent = 'xxx';\n holdOne = '';\n holdTwo = '';\n currentOperation = null;\n}", "updateDisplay(){\n this.currentOperandTextElement.innerText = \n this.getDisplayNumber(this.currentOperand)\n if(this.operation != null) {\n this.previousOperandTextElement.innerText = \n `${this.getDisplayNumber(this.previousOperand)} ${this.operation}`\n } else {\n this.previousOperandTextElement.innerText= \"\"\n }\n }", "function clear(){\n x = 0\n y = 0\n numberArray = []\n number = 0\n setX = true\n operand = ''\n display(number)\n\n}", "function reset() {\n calculatorData.isAtSecondValue = false;\n calculatorData.displayValue = '';\n calculatorData.result = '';\n calculatorData.isValueDecimal = false;\n updateDisplay();\n}", "function clickedDec() {\n if (state.result !== undefined) {\n clear();\n }\n\n if (state.operation === undefined) {\n if (state.operandOne.includes(\".\")) return; // do nothing\n state.operandOne += \".\";\n panel.textContent = state.operandOne;\n } else {\n if (state.operandTwo.includes(\".\")) return; // do nothing\n state.operandTwo += \".\";\n panel.textContent = state.operandTwo;\n }\n }", "function clearScreen() {\n activeNumber = '';\n activeOperator = '';\n storedNumber = '';\n result = '';\n updateScreen();\n}", "function clearDisplay() {\n rmNodes(document.getElementById('wolframAlphaResponses'));\n rmNodes(document.getElementById('progressDisplay'));\n}", "function clearScreen() {\n currentOperationScreen.textContent = '';\n clearDisplay = false;\n}", "function clearNumber() {\n changeDisplay(resultDisplay.innerText.slice(0, -1));\n if (resultDisplay.innerText == '') {\n changeDisplay('0');\n }\n}", "function clearScreen () {\n $('.output').html('');\n inputArray = [];\n buttonClick = null;\n operatorClick = null;\n equateClick = null;\n decimalClick = null;\n operand = '';\n console.log('clear');\n}", "function resetear(){\n resultado.innerHTML = \"0\";\n operandoa = 0;\n operandob = 0;\n operacion = \"\";\n control_punto = 0;\n }", "function clearDisplay() {\n display.textContent = \"\";\n}", "function display(inputValue) {\n \n\n if((inputValue == \" + \" || inputValue == \" - \" ||inputValue == \" / \" || inputValue == \" x \") && (operand1 == \"\")&& firstTime == true){\n return 0;\n }\n if((inputValue == \" + \" || inputValue == \" - \" ||inputValue == \" / \" || inputValue == \" x \")){\n if(lastOperator == \" + \" || lastOperator == \" - \" || lastOperator == \" / \" || lastOperator == \" x \"){\n return;\n }\n }\n\n if (inputValue == \"clear\") {\n displayValue = 0;\n inputValue = 0;\n \n }\n else if (displayValue == 0) {\n displayValue = inputValue;\n \n\n }\n else if (displayValue == 0 && operand1 == 0) {\n displayValue += inputValue;\n \n\n }\n else if (displayValue == 0 && operand1 != \"\") {\n displayValue += inputValue;\n \n }\n \n \n \n // case if operand2 is blank and user input is zero\n else if(operand2 == \"\" && inputValue == 0){\n return;\n }\n\n else {\n displayValue += inputValue;\n lastOperator = inputValue;\n }\n\n\n displayContainer.innerText = (displayValue)\n}", "function clearMainDisplay() {\r\n displayMain.textContent = \"\";\r\n}", "function clearAll() {\r\r\n calcNum = [];\r\r\n currentNum = \"\";\r\r\n lastButton = \"\";\r\r\n lastNum = \"\";\r\r\n lastOper = \"\";\r\r\n isPercentage = false;\r\r\n isDecimal = false;\r\r\n $(\".viewport\").html(\"\");\r\r\n}", "function clearScreen() {\n isFloat = false;\n isLastInputOperation = false;\n display.innerHTML = '';\n}", "function clearAll() {\n x = null;\n y = null;\n total = null;\n number.length = 0;\n sign = \"\";\n isSign = false;\n output.textContent = \"0\";\n decimalToggle = false;\n unaryToggle = false;\n isPercent = false;\n runningTotal = false;\n lastEquals = false;\n}", "function update_display() {\n //if no divid by zero case is found, this for loop runs through each index of the equation array and concatenates it to the display_val variable\n if (!divid_by_zero) {\n display_val = '';\n for (i = 0; i < equation_array.length; i++) {\n display_val += equation_array[i];\n }\n }\n //if a divid by zero case is found this else statement re-initializes variables. Same as calling the all clear (AC()) function but does not clear the display.\n else {\n equation_array = [];\n new_operand = \"\";\n digit_click_num = 0;\n divid_by_zero = false;\n }\n\n //this function updates the value of the screen by targeting the DOM with id \"display_input\" with the contents of the variable display_val\n $(\"#display_input\").val(display_val);\n\n //console log to keep track of data\n console.log(\"Equation Array is:\", equation_array);\n console.log(\"Display value is:\", display_val);\n}", "clear() {\n // clearing the viewers and setting the operation to undefined\n this.readyToReset = true;\n this.currentOperand = '';\n this.previousOperand = undefined;\n this.operation = undefined;\n this.espSymbol = undefined;\n }", "function clear() {\n input.textContent = '';\n operand1 = '';\n operand2 = '';\n operator = '';\n}", "function clickedClear() {\n clear();\n panel.textContent = \"0\";\n }", "function actionOperators() {\n if (this.id == \"clear\") {\n setCalculation(\"\");\n setOutput(\"\");\n }\n else if (this.id == \"CE\") {\n outputData = unformatNum(getOutput()).toString(); //remove commas and convert back to string\n outputData = outputData.substring(0, outputData.length-1);\n if(isNaN(outputData)) { // lines to remove initial emoji value etc\n outputData = 0;\n setCalculation(\"\");\n }\n setOutput(outputData);\n }\n else {\n outputData = unformatNum(getOutput())\n if(isNaN(outputData)) { // lines to remove initial emoji value etc\n setCalculation(\"0\"+this.id);\n output.innerText = \"\";\n }\n else {\n if (this.id == \"=\") {\n calcData = getCalculation() + outputData;\n let result = eval(calcData);\n setOutput(result);\n setCalculation(\"\");\n sumDone = true;\n }\n else {\n calcData = getCalculation() + outputData + this.id;\n setCalculation(calcData);\n output.innerText = \"\";\n }\n }\n }\n}", "static clear() {\n curr_o = \"\";\n prev_o = \"\";\n oppr = \"\";\n res = 0;\n check = 0;\n return;\n }", "function initialize() {\n\n numbers = [\"\", \"\", \"\"];\n currentNumber = \"0\";\n currentOperation = undefined;\n display.innerHTML = currentNumber;\n\n}", "function updateDisplay(){\n currentElement.innerText = convertNumber(currentValue);\n\n if(operation != null) previousElement.innerText = `${convertNumber(previousValue)} ${operation}`; \n}", "clear() {\n this.currentOperand = '', this.previousOperand = '', this.operation = '' ;\n }", "updateDisplay() {\n this.currentText.innerText = this.formatNumber(this.currentTextValue);\n if (this.operation !== undefined) {\n this.previousText.innerText = `${this.previousTextValue} ${this.operation} `;\n } else {\n this.previousText.innerText = \"\";\n }\n }", "function clea() {\n document.getElementById('result').value = ' ';\n document.getElementById('oper').innerHTML = ' ';\n displayVal = \" \";\n result = 0;\n previousVal = \" \";\n opt = '+';\n\n}", "function updateDisplay()\n {\n //We need to build a string to show. The first item is the current running total:\n var string = runningTotal;\n\n //Then we add the operator if they have pressed this\n if(hasPressedOperator)\n string += \" \" + currentOperator;\n \n //And finally we add the right operand, the value to add when equals is pressed.\n if(hasPressedOperand)\n string += \" \" + currentOperand;\n \n //We then simply set the value of the output field to the string we built\n document.getElementById(\"output\").value = string;\n }", "function clear() {\n $('#result-add').text(\"\");\n $('#result-mult').text(\"\");\n }", "function resetDisplay() {\n\t\tctx.clearRect(0,0,610,550);\n\t\tctx.strokeRect(40, 10, 530, 539);\n\t\t$(\"#controls button\").button(\"disable\");\n\t\t$(\"#seeker\").slider(\"disable\");\n\t\t$(\"#display-options input\").attr(\"disabled\",\"disabled\");\n\t\t$(\".game-status .p1, .game-status .p2, .game-status .message\").empty();\n\t\t$(\".game-status .message\").removeClass(\"neutral-text p1-text p2-text\").css(\"visibility\",\"hidden\");\n\t\t$(\".display .p1-text, .display .p2-text\").html(1000);\n\t\t$(\".names-time .time\").html(0);\n\t\t$(\"#canvas-alt\").remove();\n\t}", "function stringOfOperations() {\n if (a === undefined) {\n storeFirstNumber();\n clearNumbers();\n } else if (a !== undefined) {\n storeSecondNumber();\n clearNumbers();\n display.textContent = operate(a, b, pickedOperator)\n }\n}", "clear() {\n this.currOperand = ''\n this.prevOperand = ''\n this.operation = undefined\n }", "function updateCalculatorDisplay() {\n let displayEl = $('#calcDisplay');\n displayEl.empty();\n displayEl.append(`${num1} ${inputOperator} ${num2}`);\n}", "function resetControls(){\n $('.output b').text(0);\n}", "function updateDisplay(){\n var num = $(this).text();\n var displayText = display.text();\n if (display.text() == '0'){\n display.text(num);\n } else {\n var output = display.text()+num;\n display.text(output);\n }\n }", "function onClickUno() {\n if (operandoType != 1) { opHiddenIndex++; }\n operandoType = 1;\n strDisplay += \"1\";\n\n insertOpHidden(\"1\");\n refreshDisplay();\n}", "clear() {\n this.currentOperand = ''\n this.previousOperand = ''\n this.operation = undefined\n }" ]
[ "0.7642439", "0.7552297", "0.74829113", "0.7460566", "0.73396623", "0.72979945", "0.72206306", "0.7214373", "0.7211371", "0.7208351", "0.7188226", "0.7113221", "0.71071565", "0.7026092", "0.6990063", "0.6955391", "0.6926576", "0.6892196", "0.6890156", "0.6865154", "0.6855168", "0.68425727", "0.6824886", "0.6809322", "0.68056464", "0.6778577", "0.67756367", "0.67747766", "0.6765223", "0.6703866", "0.6631391", "0.66214114", "0.66077363", "0.6589431", "0.65793574", "0.6571595", "0.6559542", "0.652669", "0.6507552", "0.6503022", "0.6501511", "0.64893866", "0.6478529", "0.6463255", "0.6458273", "0.6451334", "0.64502054", "0.64408386", "0.64342797", "0.6420748", "0.6418294", "0.641768", "0.6412044", "0.63924843", "0.6387747", "0.63853824", "0.6383516", "0.6374431", "0.63677216", "0.63593364", "0.6356231", "0.634534", "0.6344066", "0.6343598", "0.6340792", "0.63399243", "0.63341045", "0.6325726", "0.6299748", "0.6281075", "0.6277602", "0.6268057", "0.62429273", "0.62318015", "0.6217789", "0.62089634", "0.620622", "0.6201517", "0.6199819", "0.61919683", "0.61904615", "0.6178367", "0.6177449", "0.61678994", "0.6164428", "0.61213577", "0.6104496", "0.6093033", "0.60912627", "0.6088771", "0.60853", "0.6085139", "0.6072508", "0.60695887", "0.6062009", "0.6052723", "0.60477805", "0.6042682", "0.6033665", "0.6031678" ]
0.75701004
1
adds to chain of operations
function chainOperation(input) { opChain.push(input); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "chain(operator, expression) {\n\n this.operators.push(operator);\n this.operands.push(expression);\n return this;\n }", "chain (_) {\n return this \n }", "chain(_) {\n return this\n }", "add (commands) {\n if (isArray(commands)) {\n let len = commands.length\n while (len--) this.add(commands[len])\n } else {\n this.operators.push(toOperator(commands))\n }\n return this\n }", "function ModifierChain() {\n this._chain = [];\n if (arguments.length) this.addModifier.apply(this, arguments);\n }", "buildChain (chain){ // chain is an array\n chain.forEach(link => this.addLink (link, this));\n }", "chain(chainFn) {\n return this.andThen(chainFn);\n }", "addOperation(operation) {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n }\n catch (error) {\n this.emitter.emit(\"error\", error);\n }\n });\n }", "addOperation(operation) {\n this.operations.push(async () => {\n try {\n this.actives++;\n await operation();\n this.actives--;\n this.completed++;\n this.parallelExecute();\n }\n catch (error) {\n this.emitter.emit(\"error\", error);\n }\n });\n }", "chain() {\n return this.commandManager.chain();\n }", "set chain (chain) {\n // Reset the chain\n this._chain.length = 0\n\n // And concat the new one,\n // never re-assign `this._chain`\n // or namespaces will loose reference\n this._chain.push(...chain)\n }", "add() {\n for (let i = 0; i < arguments.length; i++) {\n this.result += arguments[i];\n }\n return this.result;\n }", "function add() {\n const result = [];\n return function () {\n if (arguments.length === 0) {\n return result.reduce(function (a, b) {\n return a + b;\n }, 0);\n }\n [].push.apply(result, [].slice.call(arguments));\n return arguments.callee;\n }\n }", "function addOp(prev, maxOps) {\n if (maxOps < 1) {\n finalResults.push(prev);\n } else {\n for (let op of ops) {\n for (let i = 0; i < MAX_VAL; i++) {\n addOp([...prev, op, i + 1], maxOps - 1);\n }\n }\n }\n}", "function add(x) {\n \nreturn function(y) {\n return function(z) {\n return x + y + z\n }\n}\n\n \n}", "chain(chainFn) {\n return chain(chainFn, this);\n }", "function Left$prototype$chain(f) {\n return this;\n }", "add(op) {\r\n this.dirty();\r\n this._paths.push(op);\r\n return this.lastIndex;\r\n }", "async execPipeline(operation, scope) {\n scope = await fetch(scope, operation, this.fetcher, this) // eslint-disable-line no-param-reassign\n const ops = operation.operations.slice()\n const firstOp = ops.shift()\n debug('first op', firstOp)\n let current = await this.exec(firstOp, scope)\n debug('first op result:', current)\n while (ops.length > 0) {\n debug('current:', current)\n const nextOp = ops.shift()\n debug('nextOp:', nextOp)\n current = await this.pipe(nextOp, current) // eslint-disable-line no-await-in-loop\n }\n debug('current:', current)\n return current\n }", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n }", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function chainedInstruction(reference, calls, span) {\n let expression = importExpr(reference, null, span);\n if (calls.length > 0) {\n for (let i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n }\n else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n return expression;\n}", "function add(...args) {\n return args.reduce((previous, current) => previous + current);\n}", "function chainedInstruction(reference, calls, span) {\n var expression = importExpr(reference, null, span);\n\n if (calls.length > 0) {\n for (var i = 0; i < calls.length; i++) {\n expression = expression.callFn(calls[i], span);\n }\n } else {\n // Add a blank invocation, in case the `calls` array is empty.\n expression = expression.callFn([], span);\n }\n\n return expression;\n}", "function add(a) {\n return self => add_(self, a);\n}", "chain(f) {\n return f(this.value)\n }", "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f (chain (x)) (x); };\n }", "static concatResult(existing, next) {\n return {\n nextContext: next.nextContext,\n resultOps: existing.resultOps.concat(next.resultOps),\n scheduledActions: existing.scheduledActions.concat(next.scheduledActions)\n };\n }", "chain (fnA) {\n return fnA(this.value)\n }", "apply (ops) {\n this.opsReceivedTimestamp = new Date()\n for (var i = 0; i < ops.length; i++) {\n var o = ops[i]\n if (o.id == null || o.id[0] !== this.y.connector.userId) {\n var required = Y.Struct[o.struct].requiredOps(o)\n if (o.requires != null) {\n required = required.concat(o.requires)\n }\n this.whenOperationsExist(required, o)\n }\n }\n }", "['fantasy-land/chain'](f) {\n return this.chain(f);\n }", "function Function$prototype$chain(f) {\n var chain = this;\n return function(x) { return f(chain(x))(x); };\n }", "add(other) {\n return this.__add__(other);\n }", "function chain( x, y){\r\n\tthis.X = x;\r\n\tthis.Y = y;\r\n\treturn this;\r\n}", "function add() {}", "function Chain () {\n // Steps array\n this.stack = []\n this.steps = []\n this.currentStepIndex = 0\n}", "chain(fn) {\n return fn(this._val);\n }", "function add(...args) {\n return args.reduce((previous, current) => {\n return previous + current;\n });\n console.log(args);\n}", "chain(...nodes) {\n connectSeries(this, ...nodes);\n return this;\n }", "append(param, value) {\n return this.clone({\n param,\n value,\n op: 'a'\n });\n }", "function nonMutatingConcat(original, attach) {\n // Add your code below this line\n\n\n // Add your code above this line\n}", "function add(x) {\n // Add your code below this line - done\n return function(y) {\n return function(z) {\n return x+y+z;\n }\n }\n // Add your code above this line\n}", "chain(cb) {\n cb = this.wrap(cb)\n this._callbacks.push(cb)\n if (!this._isQueueRunning) {\n if (this.start) {\n this.start()\n } else this.next()\n // this.start()\n }\n return this\n }", "function chainRec(typeRep, f, x) {\n return ChainRec.methods.chainRec (typeRep) (f, x);\n }", "requiredOperations1() {}", "function nonMutatingConcat(original, attach) {\n // Add your code below this line - done\n return original.concat(attach);\n \n // Add your code above this line\n}", "function Nothing$prototype$chain(f) {\n return this;\n }", "pushOperator(value) {\n this.operation.push(value);\n }", "constructor() {\r\n let useCalled = false;\r\n\r\n this.run = async (...args) => {\r\n if (useCalled) {\r\n const next = args.pop();\r\n\r\n next();\r\n }\r\n return args;\r\n };\r\n\r\n addProp(this, 'use',\r\n /**\r\n * Agrega un middleware al workflow\r\n * @param {Function} fn - función middleware a agregar\r\n *\r\n * @return {this} - Retorna la actual instancia\r\n */\r\n (fn) => {\r\n useCalled = true;\r\n\r\n this.run = ((stack) => (async (...args) => {\r\n const next = args.pop();\r\n\r\n return stack.call(this, ...args, async () => fn.call(this, ...args, next.bind(this, ...args)));\r\n }).bind(this))(this.run);\r\n\r\n return this;\r\n }\r\n );\r\n }", "function add(x) {\n return function (y) {\n return function (z) {\n return x + y + z\n }\n }\n}", "addMany(codes, state, action, next) {\n for (let i = 0; i < codes.length; i++) {\n this.table[state << 8 /* INDEX_STATE_SHIFT */ | codes[i]] = action << 4 /* TRANSITION_ACTION_SHIFT */ | next;\n }\n }", "function PebbleChain () {}", "function chainNext(p) {\n if (tasks.length) {\n const arg = tasks.shift();\n return p.then(() => {\n const operationPromise = self.func(arg.data);\n self.dequeue()\n return chainNext(operationPromise);\n })\n }\n return p;\n }", "batchAdd(method, args) {\n if (!me.record) {\n react({alert: \"You can't do onchain tx if you are not registred\"})\n return false\n }\n\n let mergeable = ['withdraw', 'deposit']\n\n if (mergeable.includes(method)) {\n let exists = me.batch.find((b) => b[0] == method && b[1][0] == args[0])\n\n if (exists) {\n // add to existing array\n exists[1][1].push(args[1])\n } else {\n // create new set, withdrawals go first\n me.batch[method == 'withdraw' ? 'unshift' : 'push']([\n method,\n [args[0], [args[1]]]\n ])\n }\n } else if (method == 'revealSecrets') {\n let exists = me.batch.find((b) => b[0] == method)\n // revealed secrets are not per-assets\n\n if (exists) {\n // add to existing array\n exists[1].push(args)\n } else {\n // create new set\n me.batch.push([method, [args]])\n }\n } else {\n me.batch.push([method, args])\n }\n\n return true\n }", "compileChain(o) {\r\n\t\t\t\t\tvar fragments, fst, shared;\r\n\t\t\t\t\t[this.first.second, shared] = this.first.second.cache(o);\r\n\t\t\t\t\tfst = this.first.compileToFragments(o, LEVEL_OP);\r\n\t\t\t\t\tfragments = fst.concat(this.makeCode(` ${this.invert ? '&&' : '||'} `), shared.compileToFragments(o), this.makeCode(` ${this.operator} `), this.second.compileToFragments(o, LEVEL_OP));\r\n\t\t\t\t\treturn this.wrapInParentheses(fragments);\r\n\t\t\t\t}", "function makeBinaryOp (operation) {\r\n return function (self, other) {\r\n console.log(operation, self, other);\r\n };\r\n }", "function transformChainExpression(node) {\n if (node.type === \"CallExpression\") {\n node.type = \"OptionalCallExpression\";\n node.callee = transformChainExpression(node.callee);\n } else if (node.type === \"MemberExpression\") {\n node.type = \"OptionalMemberExpression\";\n node.object = transformChainExpression(node.object);\n }\n // typescript\n else if (node.type === \"TSNonNullExpression\") {\n node.expression = transformChainExpression(node.expression);\n }\n return node;\n}", "function e(e){return (0, F[e.operation])(...e.parameters)}", "function add() {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var acc = args[0];\n for (var i = 1; i < args.length; i++) {\n acc = _add_two(acc, args[i]);\n }\n return acc;\n}", "addOperation(value) {\n if (isNaN(this.getLastOperation())) {\n\n if (this.isOperator(value)) {\n this.setLastOperation(value);\n } else {\n this.pushOperation(value);\n this.setLastNumberToDisplay();\n }\n\n } else {\n if (this.isOperator(value)) {\n this.pushOperation(value);\n } else {\n let newValue = this.getLastOperation().toString() + value.toString();\n this.setLastOperation(newValue);\n this.setLastNumberToDisplay();\n }\n }\n }", "addRestChain (identifier){\n local_RestChains.push(identifier);\n }", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n // Add your code above this line\n}", "function chainRec(typeRep, f, x) {\n return ChainRec.methods.chainRec(typeRep)(f, x);\n }", "function add(x) {\n // Add your code below this line\n return function(y){\n return function(z){\n return x + y + z;\n }\n }\n\n // Add your code above this line\n}", "* tryCombineWithLeft (op) {\n if (\n op != null &&\n op.left != null &&\n op.content != null &&\n op.left[0] === op.id[0] &&\n Y.utils.compareIds(op.left, op.origin)\n ) {\n var left = yield* this.getInsertion(op.left)\n if (left.content != null &&\n left.id[1] + left.content.length === op.id[1] &&\n left.originOf.length === 1 &&\n !left.gc && !left.deleted &&\n !op.gc && !op.deleted\n ) {\n // combine!\n if (op.originOf != null) {\n left.originOf = op.originOf\n } else {\n delete left.originOf\n }\n left.content = left.content.concat(op.content)\n left.right = op.right\n yield* this.os.delete(op.id)\n yield* this.setOperation(left)\n }\n }\n }", "function nonMutatingConcat(original, attach) {\n // Add your code below this line\n return original.concat(attach);\n // Add your code above this line\n}", "append(name, value) {\n return this.clone({\n name,\n value,\n op: 'a'\n });\n }", "* applyCreatedOperations (ops) {\n var send = []\n for (var i = 0; i < ops.length; i++) {\n var op = ops[i]\n yield* this.store.tryExecute.call(this, op)\n if (op.id == null || typeof op.id[1] !== 'string') {\n send.push(Y.Struct[op.struct].encode(op))\n }\n }\n if (send.length > 0) { // TODO: && !this.store.forwardAppliedOperations (but then i don't send delete ops)\n // is connected, and this is not going to be send in addOperation\n this.store.y.connector.broadcastOps(send)\n }\n }", "function chain(f) {\n return self => chain_(self, f);\n}", "function addPrevToChain(n, chain) {\n\t chain.push(n);\n\t if ((0, _pipeline.isPipeline)(n.prev())) {\n\t chain.push(n.prev().in());\n\t return chain;\n\t } else {\n\t return addPrevToChain(n.prev(), chain);\n\t }\n\t}", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "function chainResult(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n }", "concat(other) {\n return this.append(other)\n }", "function add() {\n return a +90; // the callable object returns an expression (a) which is \n // defined outside of the callable object \n }", "function nonMutatingConcat(original, attach) {\n // Add your code below this line\n return original.concat(attach);\n\n // Add your code above this line\n}", "function chain(f, chain_) {\n return Chain.methods.chain(chain_)(f);\n }", "function chain(f, chain_) {\n return Chain.methods.chain (chain_) (f);\n }", "add(q) {\n this[0] = this[0] + q[0];\n this[1] = this[1] + q[1];\n this[2] = this[2] + q[2];\n this[3] = this[3] + q[3];\n this[4] = this[4] + q[4];\n this[5] = this[5] + q[5];\n this[6] = this[6] + q[6];\n this[7] = this[7] + q[7];\n return this;\n }", "add(...exprs) {\n const source = RuleBuilder.joinSources(\"\", ...exprs);\n this.setFlags(RuleBuilder.joinFlags(this, ...exprs));\n this._source += source;\n return this;\n }", "ChainSelector() {\n\n }", "function add(a, b) {\n // We duplicate Add here to avoid a circular dependency with add.ts.\n const inputs = { a, b };\n return ENGINE.runKernel(_kernel_names__WEBPACK_IMPORTED_MODULE_3__[\"Add\"], inputs);\n}", "egg() { return this.add(9); }", "function add() {\n var args = Array.prototype.slice.call(arguments);\n if (args.length !== 2) {\n if (typeof args[0] !== 'number') {\n return undefined;\n }\n return function(a) {\n if (typeof a !== 'number') {\n return undefined;\n }\n return (a + args[0]);\n };\n } else {\n if (typeof args[1] !== \"number\") {\n return undefined;\n }\n return args[0] + args[1];\n }\n}", "addToInputsLogic(input) {\n const lastIndex = (this.inputs.length - 1);\n\n\n // you can't add operation before digit\n if (\n this.operations.indexOf(this.inputs[lastIndex]) !== -1 &&\n this.operations.indexOf(input) !== -1\n ) {\n return;\n }\n\n if (this.operations.indexOf(input) !== -1) {\n // operation\n if (this.inputs[0] === '') {\n return;\n }\n this.addInput(input);\n } else if (this.operations.indexOf(this.inputs[lastIndex]) !== -1) {\n // first digit after operation\n this.floatNumber.resetInput();\n this.floatNumber.inputAction(input);\n this.addInput(this.floatNumber.getFloat());\n } else {\n // digits\n this.floatNumber.inputAction(input);\n this.inputs.splice(lastIndex, 1, this.floatNumber.getFloat());\n }\n }", "append(...append) {\n return this.forEach((el => recursiveAppend(el, ...append))), this;\n }", "function addTogether() {\n var params = [].slice.call(arguments);\n if(!params.every(function(param){\n return typeof param === 'nuber';\n })){\n return undefined;\n }\n if(params.length === 2){\n return params[0] + params[1];\n }\n else{\n var firstParam = params[0];\n var addOneMore=function(secondParam){\n return addTogether(firstParam, secondParam);\n };\n return addOneMore;\n }\n }", "function additiveExpr(stream, a) { return binaryL(multiplicativeExpr, stream, a, ['+','-']); }", "function additiveExpr(stream, a) { return binaryL(multiplicativeExpr, stream, a, ['+','-']); }", "chain(fn) {\n //Lifts the function into our context, calls it with our wrapped value(fmap) and then flattens it(join)\n return this.map(fn).join();\n }", "transform(path, operation) {\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n return fn(path, p => {\n var {\n affinity = 'forward'\n } = options; // PERF: Exit early if the operation is guaranteed not to have an effect.\n\n if (!path || (path === null || path === void 0 ? void 0 : path.length) === 0) {\n return;\n }\n\n if (p === null) {\n return null;\n }\n\n switch (operation.type) {\n case 'insert_node':\n {\n var {\n path: op\n } = operation;\n\n if (Path.equals(op, p) || Path.endsBefore(op, p) || Path.isAncestor(op, p)) {\n p[op.length - 1] += 1;\n }\n\n break;\n }\n\n case 'remove_node':\n {\n var {\n path: _op\n } = operation;\n\n if (Path.equals(_op, p) || Path.isAncestor(_op, p)) {\n return null;\n } else if (Path.endsBefore(_op, p)) {\n p[_op.length - 1] -= 1;\n }\n\n break;\n }\n\n case 'merge_node':\n {\n var {\n path: _op2,\n position\n } = operation;\n\n if (Path.equals(_op2, p) || Path.endsBefore(_op2, p)) {\n p[_op2.length - 1] -= 1;\n } else if (Path.isAncestor(_op2, p)) {\n p[_op2.length - 1] -= 1;\n p[_op2.length] += position;\n }\n\n break;\n }\n\n case 'split_node':\n {\n var {\n path: _op3,\n position: _position\n } = operation;\n\n if (Path.equals(_op3, p)) {\n if (affinity === 'forward') {\n p[p.length - 1] += 1;\n } else if (affinity === 'backward') ; else {\n return null;\n }\n } else if (Path.endsBefore(_op3, p)) {\n p[_op3.length - 1] += 1;\n } else if (Path.isAncestor(_op3, p) && path[_op3.length] >= _position) {\n p[_op3.length - 1] += 1;\n p[_op3.length] -= _position;\n }\n\n break;\n }\n\n case 'move_node':\n {\n var {\n path: _op4,\n newPath: onp\n } = operation; // If the old and new path are the same, it's a no-op.\n\n if (Path.equals(_op4, onp)) {\n return;\n }\n\n if (Path.isAncestor(_op4, p) || Path.equals(_op4, p)) {\n var copy = onp.slice();\n\n if (Path.endsBefore(_op4, onp) && _op4.length < onp.length) {\n copy[_op4.length - 1] -= 1;\n }\n\n return copy.concat(p.slice(_op4.length));\n } else if (Path.isSibling(_op4, onp) && (Path.isAncestor(onp, p) || Path.equals(onp, p))) {\n if (Path.endsBefore(_op4, p)) {\n p[_op4.length - 1] -= 1;\n } else {\n p[_op4.length - 1] += 1;\n }\n } else if (Path.endsBefore(onp, p) || Path.equals(onp, p) || Path.isAncestor(onp, p)) {\n if (Path.endsBefore(_op4, p)) {\n p[_op4.length - 1] -= 1;\n }\n\n p[onp.length - 1] += 1;\n } else if (Path.endsBefore(_op4, p)) {\n if (Path.equals(onp, p)) {\n p[onp.length - 1] += 1;\n }\n\n p[_op4.length - 1] -= 1;\n }\n\n break;\n }\n }\n });\n }", "function add(){\n let sumFunc = sumOfThirty(30, 2, 20)\n let divFunc = divideProductFunc(sumFunc, 10, 2)\n return divFunc \n }", "addInPlace(right) {\n this.r += right.r;\n this.g += right.g;\n this.b += right.b;\n this.a += right.a;\n return this;\n }" ]
[ "0.6641294", "0.6493197", "0.64390445", "0.61071974", "0.5921481", "0.5884627", "0.5813475", "0.57667667", "0.57667667", "0.5704637", "0.5665793", "0.5635599", "0.5581032", "0.5575363", "0.5545236", "0.55403394", "0.55314416", "0.5528152", "0.5498994", "0.5491902", "0.54831713", "0.54831713", "0.54831713", "0.5473994", "0.5468611", "0.54656845", "0.5452223", "0.54197997", "0.5411037", "0.54016113", "0.53731877", "0.5364406", "0.53639555", "0.5351521", "0.5343817", "0.53188026", "0.53131044", "0.5309966", "0.5293442", "0.5288121", "0.5286429", "0.5279354", "0.5276656", "0.5262004", "0.52382004", "0.5233143", "0.52261704", "0.52194", "0.5201382", "0.5198072", "0.5194315", "0.5191075", "0.51876837", "0.5182947", "0.51762396", "0.5175614", "0.5173866", "0.5169475", "0.51692766", "0.51685375", "0.5164957", "0.5163879", "0.51488423", "0.51398486", "0.51367617", "0.5119139", "0.51146996", "0.5114171", "0.5111547", "0.5110852", "0.51105785", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51105714", "0.51098645", "0.5104375", "0.5099326", "0.50924784", "0.50915974", "0.5088345", "0.5086607", "0.50857645", "0.50784075", "0.5065644", "0.5065496", "0.5057732", "0.50525045", "0.50500286", "0.5046397", "0.5046397", "0.5044027", "0.5040656", "0.50237596", "0.5022569" ]
0.7090993
0
Initializes the gameplay mode.
function mode_distance_init(playerLocation) { loadQuests(function(response) { // Parse JSON string into object var questLog = JSON.parse(response); questLog.forEach(function(e,i){ var x = Math.random() < 0.5 ? -1 : 1; var y = Math.random() < 0.5 ? -1 : 1; spawnQuestPoint(playerLocation, 'Quest Start', questLog[i].action[0].icon, x*10*(Math.floor(Math.random() * 24) + 1), y*10*(Math.floor(Math.random() * 24) + 1), function(err, marker) { if (err) { console.log(err); return; } markersPos.push({ marker: marker, lat: marker.getPosition().lat(), lng: marker.getPosition().lng() }); marker.addListener('click', function() { if (questInRange(playerCircle, marker)) { checkPosition(questLog, marker, markersPos, map); } }); }); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function init() {\n setupModeButtons();\n setupSquares();\n resetGame();\n}", "function initialize(){\n playing=true;\n lhor=false;\n lver=false;\n victory=false;\n turns=0;\n}", "init() {\n this.isCanvasSupported() ? this.ctx = this.canvas.getContext('2d') : false;\n\n if (this.ctx) {\n this.playBtn.addEventListener('click', () => {\n this.playBtn.classList.add('active');\n this.startTheGame();\n });\n\n this.retryBtn.addEventListener('click', () => {\n this.reset();\n this.retryBtn.classList.add('inactive');\n this.startTheGame();\n });\n }\n }", "function init() {\n enablePlayAgain(reset);\n reset();\n lastTime = Date.now();\n main();\n }", "init() {\r\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\r\n //console.log(result);\r\n\r\n this.assignPlayer();\r\n gameView.init();\r\n }", "function init() {\n\tdocument.getElementById(\"play\").blur();\n\t//call function inside the object to start the game\n\tmyGame.start();\n}", "function initializeGame()\r\n{\r\n\tintroducing=false;\r\n\t\r\n\tinitializeLevels();\r\n\tinitializePlayer();\r\n\t\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'custom', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'secondary', immediate : true});\r\n\taudio.setProperty({name : 'loop', value : true, channel : 'tertiary', immediate : true});\r\n\t\r\n\tsetInterval(draw, 1000/FPS);\r\n}", "function Init() {\n \n playGame = false;\n\n statusTab.hide();\n board.hide();\n gameEnd.hide();\n \n startButton.click(function(event) {\n event.preventDefault();\n StartPlaying();\n });\n\n resetButton.click(function(event) {\n event.preventDefault();\n RestartGame();\n });\n}", "function init() {\n\t\t// reset will display start game screen when screen is designed\n\t\treset();\n\n\t\t// lastTime required for game loop\n\t\tlastTime = Date.now();\n\n\t\tmain();\n\t}", "function init() {\n if (game.init())\n game.start();\n}", "function initGame(){\n resetGameStats()\n setLevel()\n gBoard = buildBoard()\n renderBoard(gBoard)\n gGame.isOn = true\n\n}", "function init() {\n setCircleVisibility(false);\n isPlayingGame = false;\n id(\"start-button\").addEventListener(\"click\", () => {\n isPlayingGame = !isPlayingGame;\n if (isPlayingGame) {\n startGame();\n } else {\n endGame();\n }\n });\n id(\"game-frame\").style.borderWidth = FRAME_BORDER_PIXELS + \"px\";\n }", "function init() {\n //go through menus\n menus = true;\n //choosing play style\n choosingStyle = true;\n //Display text and buttons\n AI.DecidePlayStyle();\n //load the board and interactable cubes\n LoadBoard();\n LoadInteractables();\n}", "function onInit() {\n const game = new Game();\n game.start();\n\n document.querySelector(`#restart`).addEventListener(\"click\", (event) => {\n game.start();\n });\n \n document.querySelector(`#play-again`).addEventListener(\"click\", (event) => {\n game.onPlayAgain();\n });\n}", "function initGame()\n{\n\tturn = 0;\n\tgame_started = 0;\n player = 0;\n}", "function initGame() {\r\n renderLevels()\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n\r\n }\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n startTimer()\r\n\r\n}", "function initializeGame() {\n setupCards();\n playMatchingGame();\n}", "function initGame() {\n let storedState;\n try {\n storedState = JSON.parse(localStorage.getItem('Game.State'));\n } catch (e) {\n console.log('Unable to deserialize state. State will be reset')\n }\n \n if (!storedState) {\n resetGame();\n } else {\n restoreGame(storedState);\n }\n \n document.querySelector('.restart').addEventListener(\"click\", (e) => {\n resetGame();\n }, false);\n \n document.querySelector('.play-again').addEventListener(\"click\", (e) => {\n resetGame();\n }, false);\n \n let intervalID = window.setInterval((state, cardDeck) => {\n handleTimeIntervar()\n }, 1000, state, cardDeck);\n \n handleTimeIntervar()\n updateScreenMode(true);\n }", "function init() {\r\n // Hide the loading bar\r\n const loading = document.getElementById('loading');\r\n loading.style.display = 'none';\r\n\r\n // Show canvas (initially hidden to show loading)\r\n canvas.style.display = 'inherit';\r\n\r\n // Add listener on window resize\r\n window.addEventListener('resize', resizeCanvas, false);\r\n // Adapt canvas size to current window\r\n resizeCanvas();\r\n\r\n // Add static models to the scene\r\n addStaticModels();\r\n\r\n // Show Play button\r\n const play = document.getElementById('playBtn');\r\n play.style.display = 'inherit';\r\n\r\n play.onclick = function () {\r\n // Create audio context after a user gesture\r\n const audioCtx = new AudioContext();\r\n\r\n // Create an AudioListener and add it to the camera\r\n listener = new THREE.AudioListener();\r\n camera.add(listener);\r\n\r\n // Hide Play button and start the game\r\n play.style.display = \"none\";\r\n start();\r\n }\r\n }", "init() {\n this.toggle.addEventListener('click', event => {\n if (this.toggle.classList.contains('pause-game')) {\n this.paused = false;\n if (this.pauseTime) {\n this.frameTime = new Date() - this.pauseTime;\n }\n this.controls.playPause(true);\n this.startGame();\n } else {\n window.clearInterval(this.dropInterval);\n this.paused = true;\n this.pauseTime = new Date() - this.frameTime;\n this.controls.playPause();\n }\n });\n }", "function gameInit() {\r\n // disable menu when right click with the mouse.\r\n dissRightClickMenu();\r\n resetValues();\r\n // switch emoji face to normal.\r\n switchEmoji();\r\n gBoard = createBoard(gLevel.SIZE);\r\n renderBoard(gBoard);\r\n}", "function initialiseGame() {\n enableAnswerBtns();\n hideGameSummaryModal();\n showGameIntroModal();\n selectedStories = [];\n score = 0;\n round = 1;\n resetGameStats();\n}", "function initPlayDemo()\n{\n\tdemoRecordIdx = demoGoldIdx = demoBornIdx = 0;\n\tdemoTickCount = 0;\n\tplayTickTimer = 0; //modern mode time counter\n\tgameState = GAME_RUNNING;\n\t\n\tif(playMode == PLAY_DEMO_ONCE) {\n\t\tdemoIconObj.disable(1);\n\t\tselectIconObj.disable(1);\n\t}\n}", "init() {\n //const result = this.isGameEnd([4],gameModeStevenl.wining_positions);\n //console.log(result);\n\n this.assignPlayer();\n gameView.init(this);\n registerView.init(this);\n }", "initGame() {\n\n //--setup user input--//\n this._player.initControl();\n\n //--add players to array--//\n this._players.push(this._player, this._opponent);\n\n //--position both players--//\n this._player.x = -Game.view.width * 0.5 + this._player.width;\n this._opponent.x = Game.view.width * 0.5 - this._opponent.width;\n }", "function initGame (){\n\n resetData();\n \n //Update content\n\n \n //Pick a new country and display info\n pickCountry();\n getcountryText();\n UpdateContent();\n\n //hide background image\n\n dispGame.classList.add(\"gameStarted\");\n dispGame.style.display = \"block\";\n dispGame.style.visibility = \"visible\";\n \n //hide start button\n startGame.style.display = \"none\";\n\n //Set isGameOver to false\n isgameOver = false;\n\n}", "function initGame(){\n\t// show pickers and new game button\n\tnewGameBtn.classList.remove('hide')\n\tselectX.classList.remove('hide')\n\tselectO.classList.remove('hide')\n\n\t// enable pickers and new game button\n\tnewGameBtn.removeAttribute('disabled')\n\tselectXhuman.removeAttribute('disabled')\n\tselectXcomputer.removeAttribute('disabled')\n\tselectOhuman.removeAttribute('disabled')\n\tselectOcomputer.removeAttribute('disabled')\n\n\t// add event lister for new game button\n\tnewGameBtn.addEventListener('click', newGame, {once : true})\n}", "function initPlayDemo()\n{\n\tdemoRecordIdx = demoGoldIdx = demoBornIdx = 0;\n\tdemoTickCount = 0;\n\tgameState = GAME_RUNNING;\n}", "function init() {\n gameStart();\n}", "function init() {\r\n var levelData = document.querySelector('input[name=\"level\"]:checked')\r\n gLevel.size = levelData.getAttribute('data-inside');\r\n gLevel.mines = levelData.getAttribute('data-mines');\r\n gLevel.lives = levelData.getAttribute('data-lives');\r\n var elHints = document.querySelector('.hints')\r\n elHints.innerText = 'hints: ' + HINT.repeat(3)\r\n var elButton = document.querySelector('.start-button')\r\n elButton.innerText = NORMAL\r\n document.querySelector('.timer').innerHTML = 'Time: 00:00:000'\r\n gBoard = createBoard()\r\n clearInterval(gTimerInterval);\r\n gGame = { isOn: false, shownCount: 0, markedCount: 0, isFirstClick: true, isHintOn: false }\r\n renderBoard()\r\n renderLives()\r\n}", "function initializeGame() {\n console.log(\"initialize Game\");\n fadeIn(\"prestart\"); // start slide shows \n //playIt(song); // start woodstock song\n ramdomize(gameArray); // randomize order of artist names for each game\n roundsMax = 2; // gameArray.length; ******************************************************\n}", "function init() {\r\n\t\t\t// if there is an override stream, set it to the current stream so that it plays upon startup\r\n\t\t\tif (self.options.overrideStream) {\r\n\t\t\t\tsetCurrentStream(self.options.overrideStream);\r\n\t\t\t}\r\n\t\t\tif (self.options.config && self.options.config.length > 0) {\r\n\t\t\t\tloadConfiguration();\r\n\t\t\t} else {\r\n\t\t\t\tinitializePlayer();\r\n\t\t\t}\r\n\t\t}", "function initGame() {\r\n clearInterval(gTimerInterval)\r\n gTimeCounter = 0;\r\n renderLevelButton()\r\n resetHints();\r\n resetSafeClick();\r\n var elLive = document.querySelector('.lives')\r\n elLive.innerText = LIVE + LIVE + LIVE\r\n gGame = {\r\n isOn: true,\r\n isFirstClick: true,\r\n shownCount: 0,\r\n markedCount: 0,\r\n mines: [],\r\n gLives: 0,\r\n gHint: false,\r\n isCanClick: true,\r\n minesExposed: 0\r\n\r\n }\r\n renderIcon(NORMAL_FACE);\r\n renderScoreStart()\r\n gBoard = buildBoard();\r\n renderBoard(gBoard);\r\n document.querySelector('.records').style.display = 'none';\r\n var elTimer = document.querySelector(\".timer\");\r\n elTimer.innerText = 0;\r\n}", "function initGame(){\n // Bind the keys for the title screen\n bindTitleKeys();\n\n // Initialize the audio helper\n audioHelper = new AudioHelper(audioHelper ? audioHelper.isMuted() : false);\n\n audioHelper.stopGameMusic();\n // Play the intro music\n audioHelper.startIntroMusic();\n\n // Setup the title screen\n titleScene.visible = true;\n gameScene.visible = false;\n gameOverScene.visible = false;\n renderer.backgroundColor = GAME_TITLE_BACKGROUND_COLOR;\n\n // Set the game state\n gameState = title;\n}", "function init() {\n \n document.getElementById('play-again').addEventListener('click', function() {\n reset();\n });//Add click to play-again button --HTML\n\n reset(); // reset the game state\n lastTime = Date.now();\n main(); // start game // Why do we need a main function and then an init function?\n}", "function startGame() {\n init();\n}", "start() {\n this._state = 'RUNNING'\n this._start_time = _.now()\n Logger.info('Enabling the game modes')\n _.forEach(this._games, (game) => game._enable())\n Logger.info(`The game(${this._id}) has started as ${moment(this._start_time).format('l LTS')}...`)\n this.event_manager.trigger('game_start', [this])\n // spectators and players should be handle differently\n this._teams.forEach((team) => team.start())\n }", "constructor() {\n this.gameState = GAME_STATE.START;\n }", "function init() {\n lobby.init();\n game.init();\n}", "function init() {\n reset();\n menu = new GameMenu();\n /* Initialize the level */\n initLevel();\n\n lastTime = Date.now();\n main();\n }", "start(){\n if (this.scene.reset == true) {\n if (this.gameCount > 0 && this.model.playsCoords.length > 0) {\n this.undoAllPlays();\n this.state = 'SMALL_WAIT';\n }\n else {\n this.state = 'UPDATE_CONFIGS';\n }\n this.restart_values();\n this.gameCount++;\n }\n }", "function init()\r\n{\r\n\tconsole.log('init');\r\n\tinitView(); \t\r\n OSnext(); \r\n \t \t\t\r\n// \tdeleteGame();\r\n// \tloadGame();\r\n// \t\r\n// \tif (game==null) {\r\n// \t\tstartNewGame();\r\n// \t} else {\r\n// \t UI_clear(); \r\n// \t UI_closeOverlay(); \r\n// \t UI_hideActions();\r\n// \t \tUI_hideCard();\r\n// \t UI_updateFront('Sinai');\r\n// \t UI_updateFront('Mesopotamia');\r\n// \t UI_updateFront('Caucasus');\r\n// \t UI_updateFront('Arab');\r\n// \t UI_updateFront('Gallipoli');\r\n// \t UI_updateFront('Salonika');\r\n// \t UI_updateNarrows();\r\n// \t UI_updateCounters();\t\t\t\r\n// \t\tconsole.log('loaded previous game');\r\n// \t}\r\n\t\t \r\n}", "function GameMode() {\n this.start = function() {\n // Called when the game starts\n }\n this.tick = function() {\n // Called every frame update\n }\n}", "function init () {\r\n initAllVars();\r\n gameLoop();\r\n}", "function initialize() {\n console.log('game initializing...');\n\n document\n .getElementById('game-quit-btn')\n .addEventListener('click', function() {\n network.emit(NetworkIds.DISCONNECT_GAME);\n network.unlistenGameEvents();\n menu.showScreen('main-menu');\n });\n\n //\n // Get the intial viewport settings prepared.\n graphics.viewport.set(\n 0,\n 0,\n 0.5,\n graphics.world.width,\n graphics.world.height\n ); // The buffer can't really be any larger than world.buffer, guess I could protect against that.\n\n //\n // Define the TiledImage model we'll be using for our background.\n background = components.TiledImage({\n pixel: {\n width: assets.background.width,\n height: assets.background.height,\n },\n size: { width: graphics.world.width, height: graphics.world.height },\n tileSize: assets.background.tileSize,\n assetKey: 'background',\n });\n }", "function __initGame() {\n\n __HUDContext = canvasModalWidget.getHUDContext();\n\n __showTitleScreen();\n __bindKeyEvents();\n\n // reset the FPS meter\n canvasModalWidget.setFPSVal(0);\n\n __resetGame();\n\n return __game;\n }", "function initGame(){\n\tdragging = snapping = false;\n\tcurrentlyAnimating = true;\n\ttriggerDetectSquares = true;\n\tspawnNewPoly = polyMoved = false;\n\tgameWon = gameWonOverlayShown = false;\n\tgameLost = gameLostOverlayShown = false;\n\tcomboActiveCtr = 0;\n\tscore = goalScore;\n\tmaxCombo = parseInt(localStorage.getItem(\"maxCombo\")) || 0;\n\tmaxComboScore = parseInt(localStorage.getItem(\"maxComboScore\")) || 0;\n\tshapeCountAllTime = JSON.parse(localStorage.getItem(\"shapeCount\")) || shapeCountCurrentGame;\n\n\tselection = new grid(gridSize);\n\tfor(var i=0;i<selection.size;++i)for(var j=0;j<selection.size;++j)\n\t\tselection.setCell(i,j,0);\n}", "function initGame() {\n players = [];\n teams = [];\n orbs = [];\n bases = [];\n createOrbs(defaultOrbs);\n createBases(defaultBases);\n}", "function startGame () {\n\tplay = true;\n\n}", "function initialiseGame(){\n\n\t/* ------------------\n\t\tRESET GAME OBJECT\n\t--------------------*/\n\tgame = new Game();\n\n\t/* ------------------\n\t\tCONTEXT SETTINGS\n\t--------------------*/\n\tvar fgCanv = document.getElementById('canvas');\n\tvar fgCtx = fgCanv.getContext('2d');\n\tfgCtx.translate(0.5, 0.5);\n\tclearCanvas(fgCtx);\n\n\tvar bgCanv = document.getElementById('bgCanvas');\n\tvar bgCtx = bgCanv.getContext('2d');\n\tbgCtx.translate(0.5, 0.5);\n\tclearCanvas(bgCtx);\n\n\t//WHY HERE? game.restart();\n\t//towers = enemies = bullets = [];\n\n\tlevelSetup();\n\n\t/* ------------------\n\t\tSCREEN VARIABLES\n\t--------------------*/\n\n\t//var level_data = levelMaps[game.level];\n\t//level = new Level(fgCtx, level_data.rows, level_data.columns, level_data.grid, level_data.start, level_data.end);\n\n\t//level.path = plotPath(level.grid, level.start, level.end);\n\t//if (level.path.length == 0){\n\t//\tconsole.log('Path error');\n\t\t//resetGame();\n\t//}\n\t//console.log(level);\n\n\t//resizeCanvas();\n\n\t// Check for cookie\n\tvar cookieName = 'privacyOptOut=';\n\n\t// Check document cookies for this flag\n var ca = document.cookie.split(';');\n for(var i=0;i < ca.length;i++) {\n var c = ca[i];\n while (c.charAt(0)==' ') c = c.substring(1,c.length);\n if (c.indexOf(cookieName) == 0){\n\t\t\tvar cookieVal = c.substring(cookieName.length,c.length);\n\t\t}\n }\n\n\t// If cookie value found and true\n\tif (cookieVal === true){\n\t\tshowModal(\"Privacy Flag\", 0);\n\t}else{\n\t\tshowModal(\"Privacy Opt-Out\",0);\n\t}\n\n\t//showModal(\"Introduction\",0);\n\n\t/* ------------------\n\t\tEVENT LISTENERS\n\t--------------------*/\n\tfgCanv.addEventListener('touchstart', function(event){touchCanvas(event);});//,false );\n\tfgCanv.addEventListener('click', function(event){mouseCanvas(event);});//,false); //stopHover();},false );\n\n\t // Trying to work out what the fuck happens when the window is minimized - enemies seem to vanish off the canvas! :-/\n\t//focus = 1;\n\t//window.addEventListener('visibilitychange', function(){ focus *= -1; if (focus){ console.log(enemies); } });\n\n\tmainLoopRequest = window.requestAnimationFrame(mainLoop);\n\n}", "function initGame(){\n gamemode = document.getElementById(\"mode\").checked;\n \n fadeForm(\"user\");\n showForm(\"boats\");\n \n unlockMap(turn);\n \n player1 = new user(document.user.name.value);\n player1.setGrid();\n \n turnInfo(player1.name);\n bindGrid(turn);\n}", "function Init() { \n board.resetBoard(); \n if(board.gameMode === SINGLE_PLAYER && board.playerTurn === CPU) {\n board.aiTurn();\n board.changeTurn(); \n } \n Drawer.Draw(board);\n}", "init() {\n let g = this,\n _main = window._main;\n window.addEventListener(\"keydown\", function (event) {\n g.keydowns[event.keyCode] = \"down\";\n });\n window.addEventListener(\"keyup\", function (event) {\n g.keydowns[event.keyCode] = \"up\";\n });\n g.registerAction = function (key, callback) {\n g.actions[key] = callback;\n };\n // Set polling timer\n g.timer = setInterval(function () {\n g.setTimer(_main);\n }, 1000 / g.fps);\n // Register mouse movement events\n document.getElementById(\"canvas\").onmousemove = function (event) {\n let e = event || window.event,\n scrollX =\n document.documentElement.scrollLeft ||\n document.body.scrollLeft,\n scrollY =\n document.documentElement.scrollTop ||\n document.body.scrollTop,\n x = e.pageX || e.clientX + scrollX,\n y = e.pageY || e.clientY + scrollY;\n // Set current mouse coordinate position\n g.mouseX = x;\n g.mouseY = y;\n };\n // Start game button click event\n document.getElementById(\"js-startGame-btn\").onclick = function () {\n menuBackground.loop = true;\n menuBackground.play();\n document.getElementById(\"restartGame\").style.display = \"block\";\n document.getElementById(\"goHome\").style.display = \"block\";\n document.getElementsByClassName(\"cards-list\")[0].style.display =\n \"block\";\n\n // Play Start animation\n g.state = g.stateStart;\n // Set a timer to switch to the start game state\n setTimeout(function () {\n g.state = g.stateRunning;\n // Show control buttons\n document.getElementById(\"goHome\").className += \" show\";\n document.getElementById(\"restartGame\").className += \" show\";\n document.getElementsByClassName(\"systemSun\")[0].style.display =\n \"block\";\n // Set the global sun and zombie timer\n _main.clearTiemr();\n _main.setTimer();\n }, 3000);\n // Display card list information\n document.getElementsByClassName(\"cards-list\")[0].className +=\n \" show\";\n // Show control button menu\n document.getElementsByClassName(\"menu-box\")[0].className += \" show\";\n // Hide start game button, game introduction, view update log button\n document.getElementById(\"js-startGame-btn\").style.display = \"none\";\n };\n // Plant card click event\n document.querySelectorAll(\".cards-item\").forEach(function (card, idx) {\n card.onclick = function () {\n let plant = null, // Mouse to place plant objects\n cards = _main.cards;\n // When the card is clickable\n if (cards[idx].canClick) {\n // Set the current plant category with the mouse\n g.cardSection = this.dataset.section;\n // Can draw plants with mouse\n g.canDrawMousePlant = true;\n // Set the idx of the currently selected plant card and the amount of sunlight required\n g.cardSunVal = {\n idx: idx,\n val: cards[idx].sunVal,\n };\n }\n };\n });\n // Mouse click on canvas event\n document.getElementById(\"canvas\").onclick = function (event) {\n let plant = null, // Mouse to place plant objects\n cards = _main.cards,\n x = g.mouseX,\n y = g.mouseY,\n plant_info = {\n // Initialization information of mouse placed plant object\n type: \"plant\",\n section: g.cardSection,\n x: _main.plants_info.x + 80 * (g.mouseCol - 1),\n y: _main.plants_info.y + 100 * (g.mouseRow - 1),\n row: g.mouseRow,\n col: g.mouseCol,\n canSetTimer: g.cardSection === \"sunflower\" ? true : false,\n };\n // Determine whether plants can be placed at the current location\n for (let item of _main.plants) {\n if (g.mouseRow === item.row && g.mouseCol === item.col) {\n g.canLayUp = false;\n g.mousePlant = null;\n }\n }\n // When placed, draw plants\n if (g.canLayUp && g.canDrawMousePlant) {\n let cardSunVal = g.cardSunVal;\n if (cardSunVal.val <= _main.allSunVal) {\n // Draw when there is enough sunlight\n // Disable the current card\n cards[cardSunVal.idx].canClick = false;\n // Change the clickable state of the card regularly\n cards[cardSunVal.idx].changeState();\n // draw countdown\n cards[cardSunVal.idx].drawCountDown();\n // Place corresponding plants\n plant = Plant.new(plant_info);\n _main.plants.push(plant);\n // Change the amount of sunlight\n _main.sunnum.changeSunNum(-cardSunVal.val);\n // Prohibit drawing plants that move with the mouse\n g.canDrawMousePlant = false;\n } else {\n // Insufficient sunshine\n // Prohibit drawing plants that move with the mouse\n g.canDrawMousePlant = false;\n // Clear to move plant objects with the mouse\n g.mousePlant = null;\n }\n } else {\n // Prohibit drawing plants that move with the mouse\n g.canDrawMousePlant = false;\n // Clear to move plant objects with the mouse\n g.mousePlant = null;\n }\n };\n // Takes to the game screen again!\n document.getElementById(\"goHome\").onclick = function (event) {\n _main.clearTiemr();\n clearInterval(g.timer);\n\n window.level = 1;\n window.takeMeHome();\n };\n // Restart game button event\n document.getElementById(\"restartGame\").onclick = function (event) {\n _main.clearTiemr();\n clearInterval(g.timer);\n window.takeMeHome();\n };\n }", "init (ctx) {\n this.ctx = ctx;\n this.pause = false;\n this.surfaceWidth = this.ctx.canvas.width;\n this.surfaceHeight = this.ctx.canvas.height;\n this.startInput();\n\n console.log('game initialized');\n }", "function startGame() {\n\n\t\tvar gss = new Game(win.canvas);\n\n\t\t// shared zone used to share resources.\n gss.set('keyboard', new KeyboardInput());\n gss.set('loader', loader);\n\n\t\tgss.start();\n\t}", "function init() {\n STAGE_WIDTH = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"width\"));\n STAGE_HEIGHT = parseInt(document.getElementById(\"gameCanvas\").getAttribute(\"height\"));\n\n // init state object\n stage.mouseEventsEnabled = true;\n stage.enableMouseOver(); // Default, checks the mouse 20 times/second for hovering cursor changes\n\n setupManifest(); // preloadJS\n startPreload();\n\n score = 0; // reset game score\n gameStarted = false;\n\n stage.update();\n\n muted = false;\n}", "function initialize() {\n setupModeButtons();\n setupSquares();\n reset();\n}", "function initGame() {\r\n initPelota();\r\n initNavecilla();\r\n initLadrillos();\r\n}", "function startGame(){\n\tvar game = new Game();\n\tgame.init();\n}", "function start()\r\n{\r\ninit();\r\ngame.start();\r\n}", "function init() {\n\n\t// initial global variables\n\ttime = 0;\n\ttotalPlay = 0;\n\tplayed = [];\n\tstop = false;\n\tstarted = true;\n\tnumLife = 3;\n\n\t// set contents and start the timer\n\tsetScenario();\n\ttimer.text(time);\n\tlife.text(numLife);\n\tcountTime();\n}", "function init() {\n \"use strict\";\n \n resizeCanvas();\n \n background = new CreateBackground();\n Player = new CreatePlayer();\n \n if (window.innerHeight <= 768) {\n background.setup(resources.get(imgFileBackground_small));\n } else {\n background.setup(resources.get(imgFileBackground));\n }\n\n gameArray.splice(0,gameArray.length);\n \n // HTML Components\n htmlBody.addEventListener('keydown', function() {\n uniKeyCode(event);\n });\n \n btnNewGame.addEventListener('click', function() {\n setGameControls(btnNewGame, 'new');\n }); \n \n btnPauseResume.addEventListener('click', function() {\n setGameControls(btnPauseResume, 'pauseResume');\n }); \n \n btnEndGame.addEventListener('click', function() {\n setGameControls(btnEndGame, 'askEnd');\n }); \n \n btnOptions.addEventListener('click', function() {\n setGameControls(btnOptions, 'options');\n });\n \n btnJournal.addEventListener('click', function() {\n setGameControls(btnJournal, 'journal');\n }); \n \n btnAbout.addEventListener('click', function() {\n setGameControls(btnAbout, 'about');\n });\n \n window.addEventListener('resize', resizeCanvas);\n \n setGameControls(btnNewGame, \"init\");\n \n }", "function begin_game(){\n\tload_resources();\n\tController = new Control();\n\n\tPlayerGame = new Game(ctx, gameWidth, gameHeight, 10);\t\t// (context, x_boundary, y_boundary, ms_delay)\n\tPlayerGame.clearColor = \"rgb(50,43,32)\";\n\tCurrPlayer = new Player(50, 400);\t\t\t\t// (x-position, y-position)\n\n\tloadGame();\n\tframe();\n}", "function initGame() {\n correctGuesses = 0;\n incorrectGuesses = 0;\n gameInProgress = false;\n $(\"#gameStart\").html(\"<button>\" + \"START\" + \"</button>\")\n .click(playGame);\n}", "init() {\n\n this.assignPlayer();\n gameView.init(this);\n gameView.hide();\n scoreBoardView.init(this);\n registerView.init(this);\n this.registerSW();\n }", "function init() {\n\t\tclearBoard();\n\t\tprintBoard(board);\n\t\ttopPlayerText.innerHTML = `- ${game.currentPlayer.name}'s turn -`;\n\t\tgame.currentPlayer = game.playerOne;\n\t\tgame.squaresRemaining = 9;\n\t\tgame.winner = false;\n\t\tclickSquares();\n\t}", "function init()\n{\n game = new Phaser.Game(768, 432, Phaser.CANVAS, '', null, false, false);\n\n\tgame.state.add(\"MainGame\", MainGame);\n\tgame.state.start(\"MainGame\");\n}", "init() {\n\t\tif (this.isStart) {\n\t\t\tthis.world = new World(this.ctx);\n\t\t\tthis.world.init();\n\n\t\t\tthis.ctx.drawImage(flappyBird, 69, 100, FLAPPY_BIRD_WIDTH, FLAPPY_BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(birdNormal, 120, 145, BIRD_WIDTH, BIRD_HEIGHT);\n\t\t\tthis.ctx.drawImage(getReady, 72, 220, GET_READY_WIDTH, GET_READY_HEIGHT);\n\t\t\tthis.ctx.drawImage(tap, 72, 300, TAP_WIDTH, TAP_HEIGHT);\n\n\t\t\tthis.ctx.font = '500 30px Noto Sans JP';\n\t\t\tthis.ctx.fillStyle = 'white';\n\t\t\tthis.ctx.fillText('Click To Start', 60, 450);\n\n\t\t\tthis.getHighScore();\n\t\t\tthis.drawScore();\n\n\t\t\tthis.container.addEventListener('click', this.playGame);\n\t\t}\n\t}", "function init() {\n setUpModeButtons();\n setUpSquares();\n reset();\n}", "function startGame() {\n if(gameState.gameDifficulty === 'easy')\n {\n easyMode();\n } \n if(gameState.gameDifficulty ==='normal'){\n normalMode();\n }\n\n if(gameState.gameDifficulty ==='hard'){\n hardMode();\n }\n\n}", "init(game) {\n\n }", "function init() {\n stage = new createjs.Stage(document.getElementById(\"gameCanvas\"));\n game = new createjs.Container();\n stage.enableMouseOver(20);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n\n // When game begins, current state will be opening menu (MENU_STATE)\n //scoreboard = new objects.scoreBoard(stage, game);\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function initialiseGame() {\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\n document.getElementById(\"github\").classList.toggle(\"hidden\");\n document.getElementById(\"start\").play();\n document.getElementById(\"music\").play();\n\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\n for (var i = 0; i < numberOfSprites; i++) {\n spritesArray[i] = new Sprite(\n centreOfX,\n centreOfY,\n Math.random() * cnvsWidth\n );\n }\n\n // Triggers main loop animations\n update();\n}", "start() {\n this.gameStart = true;\n }", "function startGame(){\n getDictionary();\n var state = $.deparam.fragment();\n options.variant = state.variant || options.variant;\n makeGameBoard();\n loadState();\n }", "function init() {\n gameFieldsEl.forEach(el => {\n el.innerText = '';\n el.className = 'game-board__field';\n });\n displayScores();\n logic.initLogic(myTurn); \n player0.className = 'player player0';\n player1.className = 'player player1';\n player0Name.innerText = 'Player 1';\n player1Name.innerText = 'Player 2';\n if(logic.getActivePlayer() === 1) player0.classList.add('active');\n else player1.classList.add('active');\n gameFieldsEl.forEach(el => el.style = 'none');\n if(!myTurn) logic.makeMoveAI();\n myTurn = myTurn ? false : true;\n \n \n //Event listeners\n logic.getActivePlayer() === 1 ? gameBoardEl.addEventListener('click', makeMove) : gameBoardEl.removeEventListener('click', makeMove);\n newGame.addEventListener('click', init);\n reset.addEventListener('click', resetScores);\n }", "function init()\n\t{\n\t\t\n\t\t\n\t//////////\n\t///STATE VARIABLES\n\tloadMainMenu();\n\t\n\t//////////////////////\n\t///GAME ENGINE START\n\t//\tThis starts your game/program\n\t//\t\"paint is the piece of code that runs over and over again, so put all the stuff you want to draw in here\n\t//\t\"60\" sets how fast things should go\n\t//\tOnce you choose a good speed for your program, you will never need to update this file ever again.\n\n\t//if(typeof game_loop != \"undefined\") clearInterval(game_loop);\n\t//\tgame_loop = setInterval(paint, 60); //old value 130\n\t}", "function initiateGameType(gameMode, globalPlayer1, globalPlayer2) {\n\t\tif(gameMode == 'pve') {\n\t\t\tconsole.log('started a pve game');\n\t\t} else {\n\t\t\tconsole.log('started a pvp game');\n\t\t\t// Mutate currentGame object in order to prevent memory leaks with future games / lack of gc support\n\t\t\tcurrentGame = new pvpGame(globalPlayer1, globalPlayer2);\n\t\t}\n\t\treturn;\n\t}", "function init() {\n\t// Page elements that we need to change\n\tG.currTitleEl = document.getElementById('current-title');\n\tG.currImageEl = document.getElementById('current-image');\n\tG.currTextEl = document.getElementById('current-text');\n\tG.currChoicesEl = document.getElementById('current-choices-ul');\n\tG.audioEl = document.getElementById('audio-player');\n\t\n\t// Start a new game\n\tnewGame(G);\n}", "function initGame() {\n guesses = [];\n displayHistory();\n resetResultContent();\n}", "function initialiseGame()\n{\n\tclear();\n\tmainText.draw();\n\tscoreText.draw();\n\t\n\tstartButtonDraw();\n\tdifficultyButtonDraw();\n}", "function init_game() {\r\n // init canvas for drawing\r\n canvas = document.getElementById('canvas');\r\n canvas.focus(); \r\n ctx = canvas.getContext('2d');\r\n\r\n // reset game elements, including hiscore (reset_hiscore=true)\r\n reset_game(true);\r\n\r\n // init start status, we ar enot playing yet, but haning in the welcome screen\r\n playing = false;\r\n\r\n var message1 = new Message(\"Welcome to Kunterbunt's Flappy!\",160,100,0,'24px serif'); // setting TTL ndless\r\n var message2 = new Message(\"Press <RETURN> key to start\",160,130,0,'12px serif');\r\n messageMgr.add(message1);\r\n messageMgr.add(message2);\r\n\r\n // add event handlers\r\n canvas.addEventListener('mouseover', canvas_on_mouseover);\r\n canvas.addEventListener('mouseout', canvas_on_mouseout);\r\n canvas.addEventListener('keydown', canvas_on_keydown);\r\n\r\n // draw it for the first time\r\n draw_scene();\r\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n this.soundtrack = createjs.Sound.play('soundtrack', createjs.Sound.INTERRUPT_NONE, 0, 0, -1, 1, 0);\n optimizeForMobile();\n\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init(){\n console.log(\"init game\");\n resizeCanvas();//scale canvas \n gameInterval = self.setInterval(function(){mainGameLoop();},16);//call mainGameLoop() evry 16 ms\n \n /**************\n * Create eventlisener for when there is clicked on the screen\n * It also checks if it has touchscreen like iPad, that makes it work better on those devices\n * 1f u c4n r34d th1s u r34lly n33d t0 g37 l41d\n ************/\n if ('ontouchstart' in document.documentElement) {\n c.addEventListener(\"touchstart\", mainMouseDown, false);\n }\n else {\n c.addEventListener(\"click\", mainMouseDown, false);\n }\n}", "function preInitialize() {\n preInitialization.style.display = 'block';\n game.style.display = 'none';\n}", "function initializeGame() {\n createArray();\n initializeArray();\n shipLocator();\n }", "function init() {\n\t\tscore = 0;\n\t\tdirection = \"right\";\n\t\tsnake_array = [];\n\t\tcreate_snake();\n\t\tmake_food();\n\t\tactiveKeyboard();\n\t\t$(\"#message\").css(\"display\",\"none\");\n\t\tgame_loop = setInterval(paint,100);\n\t}", "function init() {\n initValues();\n initEngine();\n initLevel();\n initTouchHandlers();\n startTurn();\n initEffects();\n setInterval(tick, 10);\n\t}", "function startGame(){\n initialiseGame();\n}", "function init() {\n id(\"roll\").addEventListener(\"click\", startGame);\n id(\"stop\").addEventListener(\"click\", endGame);\n }", "constructor() { \n \n Game.initialize(this);\n }", "function init() {\n /*Add click event to refresh / restart button*/\n document.querySelector('.restart').addEventListener(\"click\", function(event) {\n refreshGame();\n });\n createDeck();\n }", "function gameMode(mode) {\n gameType = mode;\n activePlayerIndex = 0;\n toggle($('[data-menu]'), 'is-open');\n clearScore();\n clearBoard();\n}", "function initialiseGame() {\r\n // Hides start panel and GitHub icon, shows direction buttons, plays audio\r\n document.getElementById(\"start-panel\").classList.toggle(\"hidden\");\r\n document.getElementById(\"bottom-banner\").classList.toggle(\"hidden\");\r\n document.getElementById(\"github\").classList.toggle(\"hidden\");\r\n document.getElementById(\"start\").play();\r\n document.getElementById(\"music\").play();\r\n\r\n // Generates new Sprite object per array iteration and maintains Sprite numbers to numberOfSprites\r\n for (var i = 0; i < numberOfSprites; i++) {\r\n spritesArray[i] = new Sprite(\r\n centreOfX,\r\n centreOfY,\r\n Math.random() * cnvsWidth\r\n );\r\n }\r\n\r\n // Triggers main loop animations\r\n update();\r\n}", "function initGame() {\r\n\tinitFE();\r\n\tinitGP();\r\n\tsetTimeout(startLoader, 250);\r\n}", "function initGame() {\n first_item_timestamp = Math.round((new Date().getTime()) / 100) / 10;\n initializeSetsOfChoices();\n adjustSlider(set[round][stage][1], set[round][stage][2], set[round][stage][3], set[round][stage][4], set[round][stage][5], set[round][stage][6]);\n\n // we store some data\n itemLowvalYou[stage] = set[round][stage][1];\n itemHighvalYou[stage] = set[round][stage][2];\n itemDescYou[stage] = set[round][stage][3];\n itemLowvalOther[stage] = set[round][stage][4];\n itemHighvalOther[stage] = set[round][stage][5];\n itemDescOther[stage] = set[round][stage][6];\n itemID[stage] = set[round][stage][7];\n\n initSlider();\n if (storeSearchPath == 1) {\n trackTicks();\n }\n gameMsg = '';\n dispGame();\n }", "start() {\n this.createBoard();\n this.pause();\n this.play();\n this.reset();\n }", "function initGame(continued) {\n game_on = true;\n\n let canvas = document.getElementById('canvas');\n canvas.setAttribute('width', BOARDER_WIDTH.toString());\n canvas.setAttribute('height', BOARDER_HEIGHT.toString());\n CANVAS_CTX = canvas.getContext('2d');\n\n setDefaults();\n keySettings = [];\n keySettings.push(up_key, down_key, left_key, right_key);\n\n lives = 3;\n score = 0;\n if (continued) {\n game_time = new_time_bonus_bar * 2;\n }\n else\n new_time_bonus_bar = Math.round(game_time * 0.5);\n ball_count = 0;\n\n intervals = {};\n\n initBoard();\n initSound();\n setPointBalls();\n initPacman();\n initGhosts();\n initApple();\n initTimeBonus();\n initTime();\n playGameMusic();\n\n setGameIntervals();\n}", "function init() {\n stage = new createjs.Stage(document.getElementById(\"canvas\"));\n stage.enableMouseOver(30);\n createjs.Ticker.setFPS(60);\n createjs.Ticker.addEventListener(\"tick\", gameLoop);\n optimizeForMobile();\n //set the current game staate to MENU_STATE\n currentState = constants.MENU_STATE;\n changeState(currentState);\n}", "function init(difficulty) {\r\n\r\n // set stat fields\r\n setTowerStatFields();\r\n\r\n // Model\r\n game = new Game(difficulty);\r\n \r\n // update all game pieces\r\n update();\r\n // draw all updated piecesw\r\n draw();\r\n\r\n pausePanel.setPanel('pause');\r\n\r\n gameboard.style.display = 'flex';\r\n\r\n}", "initGame() {\n\t\t//gameservices hangmnGuessWord\n\t\t//gameServices placeHodlerGenerator\n\t}" ]
[ "0.73185444", "0.72844154", "0.7277071", "0.7221245", "0.72065634", "0.71785426", "0.71742207", "0.7157667", "0.7115493", "0.71100134", "0.7105247", "0.7063858", "0.7056287", "0.7055043", "0.7039079", "0.701134", "0.69453603", "0.6911621", "0.6891891", "0.68816084", "0.686559", "0.6860913", "0.6857764", "0.68476635", "0.68407655", "0.68321663", "0.68181396", "0.67885745", "0.67536956", "0.6748769", "0.6743256", "0.67429495", "0.6732179", "0.6731358", "0.67245287", "0.67193544", "0.6706499", "0.6700196", "0.6687143", "0.6680462", "0.6670501", "0.66627884", "0.66562426", "0.6653821", "0.6645225", "0.6641405", "0.66299075", "0.66236734", "0.66075665", "0.6601476", "0.6592247", "0.65803087", "0.65732545", "0.65620327", "0.6560932", "0.65605366", "0.65331763", "0.65166205", "0.6515438", "0.65115714", "0.65094143", "0.65057844", "0.64909583", "0.6481083", "0.64729375", "0.6467898", "0.6467093", "0.6465747", "0.64594364", "0.6455994", "0.6453651", "0.6451937", "0.6430624", "0.6430087", "0.6429583", "0.64290965", "0.6428423", "0.6423255", "0.6423069", "0.641975", "0.64185417", "0.6406315", "0.64031076", "0.6400636", "0.6398025", "0.6395335", "0.63907003", "0.638542", "0.63828236", "0.6375105", "0.63682973", "0.63681674", "0.6367313", "0.6365362", "0.6358872", "0.6351529", "0.6346002", "0.63449085", "0.6336736", "0.63321495", "0.63311505" ]
0.0
-1
Updates the gameplay elements according to the player's current location. This gets called whenever the player's location changes.
function mode_distance_update(playerLocation) { // Currently, we don't do anything special // when the location gets updated. }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateLocation() {\n \"use strict\";\n\n var location = g.player.location;\n $(\"title\").text(location.name);\n $(\"#location-header\").text(location.name);\n $(\"#location-description1\").text(location.descA);\n $(\"#location-description2\").text(location.descB);\n}", "function UpdateLocalPlayerPos()\n{\n if (!map_ui) {return;}\n const pos = jcmp.localPlayer.position;\n UpdateMapPos(pos);\n}", "function positionUpdater(player, oldY, oldX) {\n mapArrays[player.y + oldY][player.x + oldX].playerHere = false;\n mapArrays[player.y][player.x].playerHere = true;\n}", "function updateGame(key) {\r\n\tif(key.keyCode == 37)\r\n\t{\r\n\t\tif(playerLocation[0] >= 2)\r\n\t\t{\r\n\t\tplayerLocation[0] = playerLocation[0] - 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 38) {\r\n\t\tif(playerLocation[1] >= 2)\r\n\t\t{\r\n\t\tplayerLocation[1] = playerLocation [1] - 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 39) {\r\n\t\tif(playerLocation[0] <= 9)\r\n\t\t{\r\n\t\tplayerLocation[0] = playerLocation [0] + 1;\r\n\t\t}\r\n\t}\r\n\tif(key.keyCode == 40) {\r\n\t\tif(playerLocation[1] <=9)\r\n\t\t{\r\n\t\tplayerLocation[1] = playerLocation [1] + 1;\r\n\t\t}\r\n\t}\r\n\tdocument.getElementById('playerLocation').innerHTML = playerLocation;\r\n}", "refreshPos() {\n\t\tlet player = this;\n\t\tif (!this.idle) {\n\t\t\tswitch (this.last_direction) {\n\t\t\t\tcase DIRECTION.DOWN: //based on direction, the characters position in the matrix is updated\n\t\t\t\t\tthis.position.row += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.UP:\n\t\t\t\t\tthis.position.row -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.RIGHT:\n\t\t\t\t\tthis.position.col += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.LEFT:\n\t\t\t\t\tthis.position.col -= 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tboard.items.forEach(function (item, index, object) {\n\t\t\t\tif (item.position.row == player.position.row &&\n\t\t\t\t\titem.position.col == player.position.col) {\n\t\t\t\t\titem.updatePlayer(player, item); // trigger the effect on the player\n\t\t\t\t\taudioPickupItem.play();\n\t\t\t\t\tobject.splice(index, 1); // destroy the item\n\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = this.player.x;\n this.y = this.player.y;\n }\n }", "function updateScreen() {\n\t// Transform the player\n\tif(PLAYER_FACE_RIGHT) {\n\t\tplayer.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\n\t} else {\n player.node.setAttribute(\"transform\", \"translate(\"+ (parseFloat(player.position.x) + 40)+\",\"+player.position.y+\") \"+\"scale(\" + -1 + \",\" + 1 + \")\");\n\t}\n\t\n // Calculate the scaling and translation factors\t\n var scale = new Point(zoom, zoom);\n var translate = new Point();\n \n translate.x = SCREEN_SIZE.w / 2.0 - (player.position.x + PLAYER_SIZE.w / 2) * scale.x;\n if (translate.x > 0) \n translate.x = 0;\n else if (translate.x < SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x)\n translate.x = SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x;\n\n translate.y = SCREEN_SIZE.h / 2.0 - (player.position.y + PLAYER_SIZE.h / 2) * scale.y;\n if (translate.y > 0) \n translate.y = 0;\n else if (translate.y < SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y)\n translate.y = SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y;\n \n // Transform the game area\n svgdoc.getElementById(\"gamearea\").setAttribute(\"transform\", \"translate(\" + translate.x + \",\" + translate.y + \") scale(\" + scale.x + \",\" + scale.y + \")\");\t\n}", "function update() {\n // Only send position when it's updated\n var playerUpdate = JSON.stringify(Global.player.properties());\n if (playerUpdate !== lastPlayerUpdate) {\n lastPlayerUpdate = playerUpdate;\n socket.emit('update player', Global.player.properties());\n }\n }", "function update() {\n updatePosition();\n checkBounds();\n }", "update() {\n // initialize next move\n let nextPosition = this.getNextPosition();\n // if next position is not blocked by an object\n if (this.isPositionFree(nextPosition)) {\n this.position.x = nextPosition.x;\n this.position.y = nextPosition.y;\n\n // if successful, send movement to server\n this.game.broadcastPosition({id: this.id, x: this.position.x, y: this.position.y, direction: this.direction});\n }\n\n }", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "updatePosition() {\n this.position = getPositionForPopup(this.mapFeature);\n this.draw();\n }", "function update(){\n\t$(\"#characters\").children().each(function(index) {\n\t\tif( !$(this).hasClass(\"character-removed\") )\n\t\t{\n\t\t\tvar srcPos = $(this).attr(\"srcPos\"), destPos = $(this).attr(\"destPos\");\n\t\t\tvar destX = getPosX(destPos), srcX = getPosX(srcPos);\n\t\t\tvar movDistance = (destX - srcX) / 32;\n\t\t\tvar curPos = $(this).css(\"left\");\n\t\t\tvar nPosGap = Math.abs(destPos-srcPos);\n\t\t\n\t\t\tif(nPosGap == 0 ) // stay\n\t\t\t{\n\t\t\t\t//if(Math.random() > 0.5)\n\t\t\t\t{\n\t\t\t\t\tjumpMario($(this));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if(nPosGap <= 2) // walking\n\t\t\t{\n\t\t\t\twalkMario($(this));\n\t\t\t}\n\t\t\telse if(nPosGap <4) // jump\n\t\t\t{\n\t\t\t\tjumpMario($(this));\n\t\t\t}\n\t\t\telse // run\n\t\t\t{\n\t\t\t\trunMario($(this));\n\t\t\t}\n\t\t}\n\t});\n\t\n\tmarioGame.nFrame++;\n\tif(marioGame.nFrame > 31){\n\t\tmarioGame.nFrame = 0;\n\t\tmarioGame.nTurn++;\n\t}\n}", "update() {\n // Check if the player has reached the goal\n if (this.isReady && this.y === -25) {\n this.isReady = false;\n this.updateScore(); // Increment score by 1\n setTimeout(() => {\n // Reposition the player at the starting spot after brief delay\n [this.x, this.y] = this.startPos;\n this.isReady = true;\n }, 500);\n } else if (this.isReady && this.wantsToMove) {\n this.move(this.direction); // Move the player\n this.wantsToMove = false;\n }\n }", "function gamePlay() {\n\t\t\n\t\tTi.API.debug('****************************************************************');\n\n\t\t//gets the current location of the user\n\t\tgetPlayerLocation();\n\t\n\t\t//listens for the user's location\n\t\tTi.App.addEventListener(\"app:got.Playerlocation\", gotPlayerLocation = function(input) {\n\t\t\tTi.App.removeEventListener(\"app:got.Playerlocation\", gotPlayerLocation);\n\t\t\t\n\t\t\t//update the web\n\t\t\tvar webAPI = new globals.xml.PlayerData({playerID:playerID, gameID:gameID, latitude:input.coords.latitude, longitude:input.coords.longitude});\n\t\t\t\n\t\t\tTi.App.addEventListener('playerData', function(input) {\n\t\t\t\t\n\t\t\t\t//annotate the map\n\t\t\t\tannotateMap(input.data);\n\t\t\t\t\n\t\t\t\t//update the score\n\t\t\t\tupdateScore(input.data['flags']);\n\t\t\t\t\n\t\t\t});\t\t\n\t\t});\n\t}", "function updateGameArea() {\r\n myGameArea.clear();\r\n myGamePiece.newPos();\r\n myGamePiece.update();\r\n}", "function updateGame() {\n updateGameState();\n updateDirection();\n }", "function update(){\n rover.lives = 3; // update hearts (show it in a modal)\n\n showLives(); // show 3 lives again in panel\n\n message2(); // update coordinates of the rover in panel\n\n $(\"div[data-num='[\" + [0,0] +\"]']\").append( $(\".rover\")); // re-position rover in [0,0]\n\n rover.position = [0,0]; // updates the new location\n\n newGame();\n}", "function updateScreen() {\r\n // Transform the player\r\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\r\n\r\n // Calculate the scaling and translation factors\r\n var scale = new Point(zoom, zoom);\r\n var translate = new Point();\r\n\r\n translate.x = SCREEN_SIZE.w / 2.0 - (player.position.x + PLAYER_SIZE.w / 2) * scale.x;\r\n if (translate.x > 0)\r\n translate.x = 0;\r\n else if (translate.x < SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x)\r\n translate.x = SCREEN_SIZE.w - SCREEN_SIZE.w * scale.x;\r\n\r\n translate.y = SCREEN_SIZE.h / 2.0 - (player.position.y + PLAYER_SIZE.h / 2) * scale.y;\r\n if (translate.y > 0)\r\n translate.y = 0;\r\n else if (translate.y < SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y)\r\n translate.y = SCREEN_SIZE.h - SCREEN_SIZE.h * scale.y;\r\n\r\n // Transform the game area\r\n svgdoc.getElementById(\"gamearea\").setAttribute(\"transform\", \"translate(\" + translate.x + \",\" + translate.y + \") scale(\" + scale.x + \",\" + scale.y + \")\");\r\n}", "update() {\n this.location.add(this.velocity);\n\t}", "function update(){\n\t\tsetTimeout(function(){\n\t\t\taddPlayer();\n\t\t\tupdatePlayer();\n\t\t\tchecks();\n\t\t\t$('#roomPlayers').children('.player').each(function(){\n\t\t\t\tvar playerID = $(this).attr('player-id');\n\t\t\t\tcheckPlay(playerID);\n\t\t\t\tplayerChecks(playerID);\n\t\t\t});\n\t\tupdate();\n\t\t}, 1000);\n\t}", "function update() {\n if (localPlayer.update(keys)) {\n socket.emit('move player', {\n x: localPlayer.getX(),\n y: localPlayer.getY(),\n });\n }\n}", "function onUpdatePosition() {\n gridDotUpper.position = position;\n gridDot.position = position;\n gridDotMiddle.position = position;\n\n if (guitarString) {\n guitarString.updateDotPosition(self);\n }\n }", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "update() {\n if (this.y > 380) { //if player attempts to go over the 380 limit, player will remain at the 380 position\n this.y = 380;\n } else if (this.y < 0) { //if player a reaches to the top of the canvas (where the water is), player will be relocated to the default location\n this.x = 202;\n this.y = 380;\n\n score++; //score increments by 1 when player gets in range of the water\n $('.num').text(score); //updated score then gets appended to .num span\n }\n\n if (this.x > 400) { //if player attempts to go over 400 on the right or 0 on the left, player's position with remain at the 400 or 0 position\n this.x = 400;\n } else if (this.x < 0) {\n this.x = 0;\n }\n }", "function gamePlay() {\r\n // Check collisions\r\n collisionDetection();\r\n\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n\r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n\r\n // Move the bullets\r\n moveBullets();\r\n\tmonsterMove();\r\n updateScreen();\r\n}", "function updatePlayer(player) {\n playerDisplay.textContent = `${player}'s Move`;\n}", "function getPlayerLocation() {\n\t\tTitanium.Geolocation.getCurrentPosition( updatePlayerPosition );\n\t}", "function updatePlayer(map){\n if(map[16]){ //Shift\n self.terminal=5;\n }else{\n self.terminal=1;\n }\n setPlayerVelocity(map); // Set the player velocity based on key presses\n self.look=[Math.cos(theta)*Math.sin(phi),Math.cos(phi),Math.sin(theta)*Math.sin(phi)]; // 3D Polar coordinates\n self.lookXY=[Math.cos(theta),Math.sin(theta)]; // 2D polar coordinates, for horizontal velocity\n self.strafe=[Math.cos(theta+Math.PI/2),Math.sin(theta+Math.PI/2)]; // Perpendicular, for strafing\n self.position[1]+=self.velocity[1]; // Set the vertical velocity\n self.position[0]+=self.velocity[0]*self.lookXY[0] + self.velocity[2]*self.strafe[0]; // Set the horizontal velocities\n self.position[2]+=self.velocity[0]*self.lookXY[1] + self.velocity[2]*self.strafe[1]; // Set the horizontal velocities\n}", "play(){\r\n form.hide()\r\n\r\n Player.getPlayerInfo()\r\n \r\n if(allPlayers !== undefined){\r\n var index = 0\r\n var x = 0\r\n var y\r\n\r\n for(var p in allPlayers){\r\n\r\n console.log(\"hello\")\r\n\r\n index = index + 1\r\n x = x + 200\r\n y = displayHeight - allPlayers[p].distance\r\n\r\n cars[index - 1].x = x\r\n cars[index - 1].y = y\r\n }\r\n }\r\n\r\n if(keyDown(UP_ARROW) && player.index !== null){\r\n player.distance = player.distance + 50\r\n player.update()\r\n }\r\n\r\n drawSprites()\r\n }", "update() {\n this.player.update(this.cursors);\n }", "function updatePlayerInfo() {\n\t\tdocument.getElementById(\"player1name\").innerText = `Name: ${player1.name}`;\n\t\tdocument.getElementById(\"player2name\").innerText = `Name: ${player2.name}`;\n\t\tdocument.getElementById(\n\t\t\t\"player1score\"\n\t\t).innerText = `Score: ${player1.getScore()}`;\n\t\tdocument.getElementById(\n\t\t\t\"player2score\"\n\t\t).innerText = `Score: ${player2.getScore()}`;\n\t\tdocument.getElementById(\"current-player\").innerText = `Current Player: ${\n\t\t\tgameFlow.getCurrentPlayer().name\n\t\t} (${gameFlow.getCurrentPlayer().sign})`;\n\t}", "function updateGame(user, loc) {\n\tvar message;\n\t\n\n\t//below takes the player object with attribute playerLocation and tells the function its a location\n\tplayer.playerLocation = loc;\n\tplayer.userBread.push(loc);\n\tconsole.log(player.userBread.length);\n\n\t//Update buttons\n\tupdateButtons();\n\n\t//If the player has been there display appropriate message and update score\n\tif (player.playerLocation.visited === false) {\n\t\tplayer.playerLocation.visited = true;\n\t \tmessage = player.playerLocation.descript;\n\t\tdisplayUpdate(message);\n\t\tconsole.log(loc.visited);\n\t\tplayer.userPointsEarned = player.userPointsEarned + 5;\n\t\tdisplayScore(player.userPointsEarned);\n\n\t} else if (player.playerLocation.visited === true) {\n\t\t\n\t\tmessage = \"Welcome back to \" + player.playerLocation;\n\t\tdisplayUpdate(message);\n\n\t }\n\n\tlastFiveMoves();\n\tuseItemsCollected();\n\n}", "function updatePosition() {\n\tcheckConnection();\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n console.log(\"geolocation start: \" + watchID);\n}", "function updateScreen() {\n // Transform the player\n player.node.setAttribute(\"transform\", \"translate(\" + player.position.x + \",\" + player.position.y + \")\");\n \n // Calculate the scaling and translation factors\t\n \n // Add your code here\n\t\n}", "function update_position() {\r\n if (!error_state) {\r\n if (prev_time + 50 < Date.now()) {\r\n prev_time = Date.now();\r\n //50 ms + 5ms to account for drift, measured to be around 5ms per update cycle.\r\n local_track.position += 55;\r\n update_controls_UI();\r\n }\r\n }\r\n }", "update() {\n // if the player touches the top of the screen...\n if (this.player.y < 0) {\n // gmae over man, restart the game\n this.scene.start(\"PlayGame\");\n }\n }", "function update() {\n playerMove();\n cooldowns.call(this);\n moveEnemies();\n // this.cameras.main.centerOn(player.x, player.y);\n}", "function gamePlay() {\n // Check collisions\n collisionDetection();\n\t\n // Check whether the player is on a platform\n var isOnPlatform = player.isOnPlatform();\n \n // Update player position\n var displacement = new Point();\n\n // Move left or right\n if (player.motion == motionType.LEFT)\n displacement.x = -MOVE_DISPLACEMENT;\n if (player.motion == motionType.RIGHT)\n displacement.x = MOVE_DISPLACEMENT;\n\n // Fall\n if (!isOnPlatform && player.verticalSpeed <= 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\n }\n\n // Jump\n if (player.verticalSpeed > 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\n if (player.verticalSpeed <= 0)\n player.verticalSpeed = 0;\n }\n\n // Get the new position of the player\n var position = new Point();\n position.x = player.position.x + displacement.x;\n position.y = player.position.y + displacement.y;\n\n // Check collision with platforms and screen\n player.collidePlatform(position);\n player.collideScreen(position);\n\n // Set the location back to the player object (before update the screen)\n player.position = position;\n\n moveBullets();\n updateScreen();\n}", "function gamePlay() {\n collisionDetection();\n moveVerticalPlatform();\n movePlayer();\n updateScreen();\n moveBullets();\n moveMonsterBullets();\n moveMonsters();\n}", "update()\n {\n if(this.player.y > 175 && this.playerCanMove)\n {\n this.player.y+=-this.stroming;\n }\n // MOVE PLAYER\n if(this.playerCanMove)\n {\n if( this.cursorKeys.left.isDown || this.leftButPressed)\n {\n this.LeftButtonDown();\n }\n else if( this.cursorKeys.right.isDown || this.rightButPressed)\n {\n this.RightButtonDown();\n }\n else if( this.cursorKeys.down.isDown || this.downButPressed)\n {\n this.DownButtonDown();\n }\n else if( this.cursorKeys.up.isDown || this.upButPressed)\n {\n this.UpButtonDown();\n }\n else\n {\n this.player.body.setVelocity(0);\n this.player.setAngle(0);\n this.player.anims.play('player-idle',false);\n }\n }\n else\n {\n if(!this.playerIsDead)\n {\n this.player.anims.play('player-idle',false);\n }\n this.player.body.setVelocity(0);\n }\n \n if(this.playerCanMove)\n {\n this.timer += 1;\n while (this.timer > this.spawndelay) {\n this.SpawnObject();\n this.timer = 0;\n }\n this.CheckOutOfBoundsObjects();\n }\n }", "function updatePlayer() {\n player.update();\n player.draw();\n\n // game over\n if (player.y + player.height >= canvas.height) {\n gameOver();\n }\n }", "function updateCurrentLocation(roomLat,roomLng) {\n if (!userHasGPSCoordinates ){\n userHasGPSCoordinates = true;\n currentPosition = new google.maps.LatLng(roomLat, roomLng);\n }\n}", "function playersMove(){\n\tfor(let player of Object.keys(players)){\n\t\tlet changed = false;\n\t\tif (keys[player].includes(87) && keys[player].includes(68)){\t//W D\n\t\t\tplayers[player].y -= Math.sqrt(2)*5;\n\t\t\tplayers[player].x += Math.sqrt(2)*5;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if (keys[player].includes(83) && keys[player].includes(68)){\t//S D\n\t\t\tplayers[player].y += Math.sqrt(2)*5;\n\t\t\tplayers[player].x += Math.sqrt(2)*5;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if (keys[player].includes(83) && keys[player].includes(65)){\t// A S\n\t\t\tplayers[player].y += Math.sqrt(2)*5;\n\t\t\tplayers[player].x -= Math.sqrt(2)*5;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if (keys[player].includes(87) && keys[player].includes(65)){\t//W A\n\t\t\tplayers[player].y -= Math.sqrt(2)*5;\n\t\t\tplayers[player].x -= Math.sqrt(2)*5;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if(keys[player].includes(87)){\t//W\n\t\t\tplayers[player].y -= 10;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if(keys[player].includes(65)){\t//A\n\t\t\tplayers[player].x -= 10;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if(keys[player].includes(83)){\t//S\n\t\t\tplayers[player].y += 10;\n\t\t\tchanged = true;\n\t\t}\n\t\telse if(keys[player].includes(68)){\t//D\n\t\t\tplayers[player].x += 10;\n\t\t\tchanged = true;\n\t\t}\n\t\tif(changed){\n\t\t\t//Screen wrap (PacMan style)\n\t\t\tscreenWrap(player);\n\t\t\tio.emit(\"updatePlayer\", {\n\t\t\t\tindex: player,\n\t\t\t\tdata: players[player]\n\t\t\t});\n\t\t}\n\t}\n}", "update(x, y){\n this.location.x = x\n this.location.y = y\n }", "update(spacePressed, players) {\n if (!spacePressed) return;\n players.forEach((player) => {\n this.teleport(player, this.positions[0], this.positions[1])\n this.teleport(player, this.positions[1], this.positions[0])\n })\n this.resetPositions();\n\n }", "function update(){\n // ========== update planets ==============\n if (playing){\n for (let i = 0; i < simSpeed; i++){\n for (const p of allPlanets){\n p.update();\n }\n for (const p of allPlanets){\n p.lateUpdate();\n }\n }\n } else {\n if (grab.grabbing && sPlanetIndex != -1 && !navigateMode.checked){\n allPlanets[sPlanetIndex].initX = mouse.x + grab.xDiff;\n allPlanets[sPlanetIndex].initY = mouse.y + grab.yDiff;\n allPlanets[sPlanetIndex].applyInitValues();\n clearVelsInPaths();\n }else if (grab.grabbing && navigateMode.checked){\n xTranslate = mouse.x - xTranslate + grab.xDiff;\n yTranslate = mouse.y - yTranslate + grab.yDiff;\n }\n\n if (pathOpacityInput.value != 0 && pathStats.size < pathStats.maxSize)\n calculateNextVelInPaths();\n }\n}", "function updatePlayer (player) {\n if (player.inputs.up) player.y -= 5;\n if (player.inputs.down) player.y += 5;\n if (player.inputs.left) player.x -= 5;\n if (player.inputs.right) player.x += 5;\n}", "update() {\r\n this.position.y += this.speed;\r\n if (this.position.y >= this.gameHeight - this.height) {\r\n // Parachutist touching bottom of screen\r\n this.touchedBottomOfScreen = true;\r\n this.view.sendEvent(VIEW_CFG.PARACHUTIST_EVENT_DROWNED);\r\n } else if (this.isParachutistTouchingBoat()) {\r\n // Parachutist touching the boat at parts which are logical\r\n this.touchedBoat = true;\r\n this.view.sendEvent(VIEW_CFG.PARACHUTIST_EVENT_SAVED);\r\n }\r\n }", "update() {\n let pos = CosmoScout.state.pointerPosition;\n if (pos !== undefined) {\n this._pointerContainer.innerText =\n `${CosmoScout.utils.formatLongitude(pos[0]) + CosmoScout.utils.formatLatitude(pos[1])}(${\n CosmoScout.utils.formatHeight(pos[2])})`;\n } else {\n this._pointerContainer.innerText = ' - ';\n }\n\n pos = CosmoScout.state.observerLngLatHeight;\n if (pos !== undefined) {\n this._userContainer.innerText =\n `${CosmoScout.utils.formatLongitude(pos[0]) + CosmoScout.utils.formatLatitude(pos[1])}(${\n CosmoScout.utils.formatHeight(pos[2])})`;\n } else {\n this._userContainer.innerText = ' - ';\n }\n\n if (CosmoScout.state.observerSpeed !== undefined) {\n this._speedContainer.innerText = CosmoScout.utils.formatSpeed(CosmoScout.state.observerSpeed);\n }\n }", "function updateCurrentLatLng(latLng) {\n // update the coordinates\n lat.innerHTML = latLng.lat();\n lng.innerHTML = latLng.lng();\n}", "function updateBoard(){\n draw(levelMap);\n\n /*\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 1;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 2;\n\n if(player.getCurrentPosition().y == levelMap.length - 1) player.setGoalReached(true);\n if(enemy.getCurrentPosition().y == 0) enemy.setGoalReached(true);\n\n draw(levelMap);\n\n //Clean the cells where the player was standed\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 0;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 0;\n\n //Read the x and y positions of player and enemy to put them in the board\n if(!player.getGoalReached()){\n player.setCurrentPosition(player.getCurrentPosition().x,player.getCurrentPosition().y+1);\n }\n\n if(!enemy.getGoalReached()){\n enemy.setCurrentPosition(enemy.getCurrentPosition().x,enemy.getCurrentPosition().y-1);\n }\n */\n}", "function gamePlay() {\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n \r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n\r\n player.checkEnterPortal(position)\r\n updateScreen();\r\n\r\n processCoin(player.findCoin(player.position))\r\n if(!cheatMode && bumpIntoGhost(player.position)!=-1){\r\n gameOver()\r\n console.log(\"bumpIntoGhost\")\r\n }\r\n\r\n if (player.findExit(player.position)){\r\n proceedToNextRound()\r\n }\r\n}", "update() {\n\n // Configura botao e altura do pulo\n if (this.pointer.isDown || this.cursors.space.isDown) {\n if (this.player.body.touching.down) {\n this.player.setVelocityY(this.gameOptions.playerJump * - 2);\n }\n }\n\n this.player.x = this.gameOptions.playerStartXY[0];\n\n // Removendo plataformas\n var minDistance = game.config.width;\n var rightmostPlatformHeight = 0;\n this.platformGroup.getChildren().forEach(function (platform) {\n var platformDistance = game.config.width - platform.x - platform.displayWidth / 3;\n if (platformDistance < minDistance) {\n minDistance = platformDistance;\n rightmostPlatformHeight = platform.y;\n }\n if (platform.x < - platform.displayWidth / 3) {\n this.platformGroup.killAndHide(platform);\n this.platformGroup.remove(platform);\n }\n }, this);\n\n // Adicionando plataformas\n if (minDistance > this.nextPlatformDistance) {\n this.addPlatform(this.gameOptions.platformWidth, this.gameOptions.platformX, this.gameOptions.platformY);\n }\n }", "function update() {\n\t/**\n\t * Flickers player when he's invincible\n\t */\n\tif (invincible && new Date().getTime() - gracePeriodFlickerTime > 250) {\n\t\tif (gracePeriodAlpha) {\n\t\t\tplayer.alpha = 0.1;\n\t\t\tgracePeriodAlpha = false;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t} else {\n\t\t\tplayer.alpha = 1;\n\t\t\tgracePeriodAlpha = true;\n\t\t\tgracePeriodFlickerTime = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * Moves all penguins\n\t */\n\tif (started) {\n\t\tpenguinsLEFT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed * -1;\n\t\t});\n\t\tpenguinsRIGHT.forEach((el, i) => {\n\t\t\tel.body.velocity.x = boundingWidth * modus.penguinConfig.speed;\n\t\t});\n\t}\n\n\t/**\n\t * Debug code which enables cursors for testing\n\t */\n\tif (!gyroscope && alive) {\n\t\t/**\n\t\t * When pressing left button\n\t\t */\n\t\tif (cursors.left.isDown && !cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * -0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('left' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: -1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: -1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * When pressing right button\n\t\t\t */\n\t\t} else if (cursors.right.isDown) {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = boundingWidth * 0.3;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('right' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: true,\n\t\t\t\t\tdirection: 1\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning || beforePlayerData.direction !== newPlayerData.direction) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: true,\n\t\t\t\t\t\t\tdirection: 1,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// player.anims.play('right', true);\n\t\t} else {\n\t\t\t//set velocity\n\t\t\tplayer.body.velocity.x = 0;\n\n\t\t\t//play the correct animation\n\t\t\tplayer.anims.play('turn' + avatars.indexOf(avatar));\n\t\t\t//crop if avatar needs it\n\t\t\tif (avatar.crop) {\n\t\t\t\tplayer.height = 286.752;\n\t\t\t\tplayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t}\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisRunning: false,\n\t\t\t\t\tdirection: 0\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isRunning !== newPlayerData.isRunning) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisRunning: false,\n\t\t\t\t\t\t\tdirection: 0,\n\t\t\t\t\t\t\tstatus: 'movement',\n\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// player.anims.play('turn');\n\t\t}\n\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * When the up button is being pressed -> jump\n\t\t */\n\t\tif (cursors.up.isDown && player.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\tplayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//if multiplayer send player data to other users\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: true\n\t\t\t\t};\n\t\t\t\t//check if player data is not a duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: true,\n\t\t\t\t\t\t\tstatus: 'movement',\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t/**\n\t\t * When player is not touching the floor\n\t\t */\n\t\tif (!player.body.touching.down) {\n\t\t\t//Disable crop for normal state\n\t\t\tplayer.isCropped = false;\n\t\t\tplayer.height = 359;\n\n\t\t\t//Play correct animation\n\t\t\tif (player.body.velocity.x === 0) {\n\t\t\t\tplayer.anims.play('turnJump' + avatars.indexOf(avatar));\n\t\t\t} else {\n\t\t\t\tif (player.body.velocity.x > 0) player.anims.play('rightJump' + avatars.indexOf(avatar));\n\t\t\t\tif (player.body.velocity.x < 0) player.anims.play('leftJump' + avatars.indexOf(avatar));\n\t\t\t}\n\t\t} else {\n\t\t\t//Player is touching the floor -> send update if multiplayer\n\t\t\tif (connectedCloud) {\n\t\t\t\tlet newPlayerData = {\n\t\t\t\t\tclientId: clientId,\n\t\t\t\t\tisJumping: false\n\t\t\t\t};\n\t\t\t\t//Check if not duplicate\n\t\t\t\tif (beforePlayerData.isJumping !== newPlayerData.isJumping) {\n\t\t\t\t\t//Make x,y positions relative for other resolutions and aspect ratios\n\t\t\t\t\tlet [x, y] = getNormalizedPositions(player.body.x, player.body.y);\n\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tisJumping: false,\n\t\t\t\t\t\t\tstatus: 'movement',\n\t\t\t\t\t\t\tx: x,\n\t\t\t\t\t\t\ty: y\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t\tbeforePlayerData = newPlayerData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * If client is host and game has started -> spawn new objects\n\t */\n\tif ((host || !multiplayer) && started) {\n\t\t/**\n\t\t * Randomize when an object is being spawned\n\t\t */\n\t\tlet random = Math.random() * (modus.maxSpawnTime - modus.minSpawnTime) + modus.minSpawnTime;\n\t\tif (new Date().getTime() - lastTimeSpawn > random) {\n\t\t\t/**\n\t\t\t * 80% chance for icicle\n\t\t\t * 20% chance for penguin\n\t\t\t */\n\t\t\tlet spawnChance = Math.random();\n\t\t\tif (spawnChance <= modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn icicle\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tice = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'icicle');\n\t\t\t\tice.scaleY = ice.scaleX = boundingWidth / 6000;\n\n\t\t\t\t//Set custom gravity (Icicle speed)\n\t\t\t\tice.setGravityY(gravity * modus.icicleConfig.gravity);\n\n\t\t\t\t//Icicle should always be on top of player\n\t\t\t\tice.setDepth(1000);\n\t\t\t\tice.setOrigin(0.5, 0);\n\n\t\t\t\t//Add the Icicle to the enemies list\n\t\t\t\tenemies.push(ice);\n\n\t\t\t\t//If alive addScore\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'icicle',\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else if (spawnChance <= modus.penguinChance + modus.icicleChance) {\n\t\t\t\t/**\n\t\t\t\t * Spawn penguin\n\t\t\t\t */\n\t\t\t\tlet x;\n\t\t\t\tlet list;\n\t\t\t\tlet flip = true;\n\n\t\t\t\t//Randomize left/right\n\t\t\t\tif (Math.random() <= 0.5) {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85;\n\t\t\t\t\tlist = penguinsLEFT;\n\t\t\t\t\tflip = false;\n\t\t\t\t} else {\n\t\t\t\t\tx = (width - boundingWidth * 0.85) / 2;\n\t\t\t\t\tlist = penguinsRIGHT;\n\t\t\t\t}\n\n\t\t\t\t//Add penguin to the canvas\n\t\t\t\tlet penguin = this.physics.add.sprite(x, height - height * 0.2, 'penguin');\n\n\t\t\t\t//Scaling\n\t\t\t\tpenguin.scaleY = penguin.scaleX = boundingWidth / 16500;\n\n\t\t\t\t//Penguin should be flipped when going to the left\n\t\t\t\tpenguin.flipX = flip;\n\t\t\t\tpenguin.setOrigin(0.5, 0);\n\n\t\t\t\t//Set gravity\n\t\t\t\tpenguin.setGravityY(gravity);\n\n\t\t\t\tpenguin.setDepth(1000);\n\n\t\t\t\tpenguin.body.bounce.x = 0.5;\n\t\t\t\tpenguin.body.bounce.y = 0.5;\n\n\t\t\t\t//Penguins should be able to stand on the platform not fall through it\n\t\t\t\tthis.physics.add.collider(penguin, platforms);\n\n\t\t\t\t//Add penguin to enemy list\n\t\t\t\tenemies.push(penguin);\n\n\t\t\t\t//Add penguin to the list if it should go right or left\n\t\t\t\tlist.push(penguin);\n\n\t\t\t\t//Add score if still alive\n\t\t\t\tif (alive) addScore();\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, height - height * 0.2);\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newEnemy',\n\t\t\t\t\t\t\ttype: 'penguin',\n\t\t\t\t\t\t\tflip: flip,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\n\t\t\t\t\t\t})\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * Spawn healthPowerup\n\t\t\t\t */\n\n\t\t\t\t//Randomize spawn location\n\t\t\t\tlet x =\n\t\t\t\t\tMath.random() *\n\t\t\t\t\t\t(((width - boundingWidth * 0.85) / 2 + boundingWidth * 0.85) * modus.icicleConfig.maxSpawnOffset - ((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset) +\n\t\t\t\t\t((width - boundingWidth * 0.85) / 2) * modus.icicleConfig.minSpawnOffset;\n\n\t\t\t\t//Add sprite to the canvas\n\t\t\t\tlet health = this.physics.add.sprite(x, -1 * (boundingHeight * 0.4), 'heart');\n\t\t\t\thealth.scaleY = health.scaleX = boundingWidth / 22000;\n\n\t\t\t\t//Set gravity\n\t\t\t\thealth.setGravityY(gravity);\n\n\t\t\t\t//HealthPowerup should always be on top of player\n\t\t\t\thealth.setDepth(1000);\n\t\t\t\thealth.setOrigin(0.5, 0);\n\t\t\t\thealth.name = ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, c => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));\n\n\t\t\t\t//HealthPowerup should stand on the platform, not fall through\n\t\t\t\tthis.physics.add.collider(health, platforms);\n\n\t\t\t\t//Add the HealthPowerup to the powerup list\n\t\t\t\thealthPowerups.push(health);\n\n\t\t\t\t//Make x,y positions relative so other players with different resolution or aspect ratio get the correct position\n\t\t\t\tlet [xb, yb] = getNormalizedPositions(x, -1 * (boundingHeight * 0.4));\n\t\t\t\tif (connectedCloud) {\n\t\t\t\t\tmqttClient.publish(\n\t\t\t\t\t\t`afloat/lobby/${lobbyId}/game`,\n\t\t\t\t\t\tJSON.stringify({\n\t\t\t\t\t\t\tclientId: clientId,\n\t\t\t\t\t\t\tstatus: 'newPowerup',\n\t\t\t\t\t\t\ttype: 'health',\n\t\t\t\t\t\t\tid: health.name,\n\t\t\t\t\t\t\tx: xb,\n\t\t\t\t\t\t\ty: yb\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//Update when an enemy has spawned\n\t\t\tlastTimeSpawn = new Date().getTime();\n\t\t}\n\t}\n\n\t/**\n\t * When multiplayer -> update player position\n\t */\n\tif (multiplayer && otherPlayerData.alive && otherPlayer !== undefined) {\n\t\t/**\n\t\t * If running to the left\n\t\t */\n\t\tif (otherPlayerData.isRunning && otherPlayerData.direction == -1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * -0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('left' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If running to the right\n\t\t\t */\n\t\t} else if (otherPlayerData.isRunning && otherPlayerData.direction == 1) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = boundingWidth * 0.3;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('right' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * If standing still\n\t\t\t */\n\t\t} else {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.x = 0;\n\t\t\t//Play animation\n\t\t\totherPlayer.anims.play('turn' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.setCrop(0, 72.248, player.width, 286.752);\n\t\t\t\totherPlayer.height = 286.752;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If other player is jumping\n\t\t */\n\t\tif (!otherPlayer.body.touching.down) {\n\t\t\t//Play animation\n\t\t\tif (otherPlayer.body.velocity.x === 0) otherPlayer.anims.play('turnJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x > 0) otherPlayer.anims.play('rightJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayer.body.velocity.x < 0) otherPlayer.anims.play('leftJump' + avatars.indexOf(otherPlayerData.avatar));\n\t\t\tif (otherPlayerData.avatar.crop) {\n\t\t\t\totherPlayer.isCropped = false;\n\t\t\t\totherPlayer.height = 359;\n\t\t\t}\n\t\t}\n\t\t/**\n\t\t * If the other player is about to jump\n\t\t */\n\t\tif (otherPlayerData.isJumping && otherPlayer.body.touching.down) {\n\t\t\t//Set velocity\n\t\t\totherPlayer.body.velocity.y = (boundingHeight / 2) * 1.5 * -1;\n\n\t\t\t//Set jumping to false so the player won't jump twice\n\t\t\totherPlayerData.isJumping = false;\n\t\t}\n\t}\n\n\t/**\n\t * If player fell of the platform -> hit\n\t */\n\tif (player.body.y > height) {\n\t\thit();\n\t}\n\n\t/**\n\t * Update highscore missions\n\t */\n\n\tif (leaderboard !== undefined) {\n\t\tif (leaderboard.length !== 0) {\n\t\t\tlet lowestScoreToBeat;\n\t\t\tlet position = 1;\n\t\t\tleaderboard.forEach((el, i) => {\n\t\t\t\tif ((el.score < lowestScoreToBeat && el.score > score) || lowestScoreToBeat === undefined) {\n\t\t\t\t\tlowestScoreToBeat = el.score;\n\t\t\t\t\tposition = i + 1;\n\t\t\t\t}\n\t\t\t});\n\t\t\thighscorePositionObject.innerHTML = `${position}e`;\n\t\t\thighscoreScoreObject.innerHTML = lowestScoreToBeat;\n\t\t} else {\n\t\t\thighscorePositionObject.innerHTML = `1e`;\n\t\t\thighscoreScoreObject.innerHTML = 0;\n\t\t}\n\t} else {\n\t\thighscorePositionObject.innerHTML = `1e`;\n\t\thighscoreScoreObject.innerHTML = 0;\n\t}\n}", "function placePlayer() {\n player.position = {\n row: Math.floor(board.length / 2),\n column: Math.floor(board[0].length / 2),\n };\n getPlayerPosition().push(player);\n}", "function moveTracker() {\n moveTrack.push({\n \"x\" : x , \n \"y\" : y , \n \"loc\": player.loc\n })\n }", "function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}", "setPlayers() {\n\n GameElements.players[0].xPos = 50;\n GameElements.players[0].yPos = 50;\n GameElements.players[0].position = 17;\n GameElements.players[0].state = Player.STATES.PLAYING;\n GameElements.players[0].color = Player.COLORS.WHITE;\n\n if (REQUIRED_PLAYERS > 1) {\n GameElements.players[1].xPos = 650;\n GameElements.players[1].yPos = 50;\n GameElements.players[1].position = 29;\n GameElements.players[1].state = Player.STATES.PLAYING;\n GameElements.players[1].color = Player.COLORS.BLACK;\n }\n if (REQUIRED_PLAYERS > 2) {\n GameElements.players[2].xPos = 50;\n GameElements.players[2].yPos = 550;\n GameElements.players[2].position = 167;\n GameElements.players[2].state = Player.STATES.PLAYING;\n GameElements.players[2].color = Player.COLORS.BLUE;\n }\n if (REQUIRED_PLAYERS > 3) {\n GameElements.players[3].xPos = 650;\n GameElements.players[3].yPos = 550;\n GameElements.players[3].position = 179;\n GameElements.players[3].state = Player.STATES.PLAYING;\n GameElements.players[3].color = Player.COLORS.YELLOW;\n }\n\n }", "updatePosition() {\n // set the new plane sizes and positions relative to document by triggering getBoundingClientRect()\n this._setDocumentSizes();\n\n // apply them\n this._applyWorldPositions();\n }", "function update() {\n // Test for game over, make the score bigger with a game over message\n if (gameOver) {\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('red');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nGame over');\n this.scene.pause('default');\n } // Check if the player got the amount of points selected in the form -> Win\n else if (score >= document.getElementById('winScore').value) {\n player.setTint(0x008000);\n lastScoreText = scoreText.text;\n scoreText.setPosition(150, 40);\n scoreText.setFill('green');\n scoreText.setFontSize(100);\n scoreText.setText(lastScoreText + '\\nYou won!!');\n this.scene.pause('default');\n }\n\n // Check if space or up arrow are pressed and the player is on the floor to perform a jump\n if ((cursors.space.isDown || cursors.up.isDown) && player.body.onFloor())\n {\n player.body.setVelocityY(-400); // jump up\n }\n // Checking if the left arrow key is pressed\n if (cursors.left.isDown) {\n player.body.setVelocityX(-200); // move left\n player.flipX= true; // flip the sprite to the left\n if (player.body.onFloor()) {\n player.anims.play('left', true); // play walk animation\n }\n } // Check if the right arrow key is pressed\n else if (cursors.right.isDown) {\n player.body.setVelocityX(200); // move right\n player.flipX = false; // use the original sprite looking to the right\n if (player.body.onFloor()) {\n player.anims.play('right', true); // play walk animation\n }\n } else {\n // Checks if the player is not moving anymore to stop the movement\n player.body.setVelocityX(0);\n player.anims.play('idle', true);\n }\n }", "function update(){\n winSong.pause();\n soundtrack.play();\n gameLoop = requestAnimationFrame(update);\n getInput();\n enemyMovement();\n physics();\n wrapPlayers();\n drawGame();\n}", "function updatePlayerPosition() {\n avatar.x = mouseX;\n avatar.y = mouseY;\n avatar.currentSize = avatar.currentSize - SHRINK;\n avatar.currentSize = constrain(avatar.currentSize,0,avatar.maxSize);\n if (avatar.currentSize === 0) {\n avatar.isPlayerAlive = false;\n }\n else {\n avatar.isPlayerAlive = true;\n }\n}", "function Update()\n{\n\t\t// show the correct image\n\tmapScreen.renderer.material = mapList[DataTransfer.activeLevel-1];\n\t\n\t\t// show the correct name\n\t//mapName.text = LanguageHandler.mapNames[DataTransfer.activeLevel-1];\n\t\t// trigger localize refresh\n\t//NGUI_Handler.locUpdate = true;\n\t//Debug.Log (\"mapNext\");\n\t\t// if the current map is locked, show our lock symbol and switch for the buy button...\n\tif (!DataTransfer.trackUnlocks[(DataTransfer.activeLevel-1)])\n\t{\n\t\tbtn_select.localPosition = Vector3(0,200,0);\n\t\tbtn_buy.localPosition = Vector3(0,0,0);\n\t\ticon_lock.localPosition = Vector3(0,0,0);\n\t}\n\telse\n\t{\n\t\tbtn_select.localPosition = Vector3(0,0,0);\n\t\tbtn_buy.localPosition = Vector3(0,200,0);\n\t\ticon_lock.localPosition = Vector3(0,-2000,0);\n\t}\n}", "function update() {\n player.update(gameInput.inputs);\n\n render();\n}", "update(){\n // Prevent player from moving off canvas\n if(this.y > startY){\n this.y = startY;\n }\n if(this.x < 3){\n this.x = 3;\n }\n if(this.x > xPos[xPos.length - 1]){\n this.x = xPos[xPos.length - 1];\n }\n if(this.y < -50){\n this.y = -50;\n }\n\n // When the player reaches the top of the canvas, reset player positon\n if(this.y === -50 && this.x === goal.x){\n this.goalReached();\n }\n\n }", "function handleGamePlay(){\n if (this.readyState == 4 && this.status == 200) {\n var response = JSON.parse(this.responseText);\n // Update the board with this data\n for (var id in response) {\n var el = document.getElementById(id)\n if (el !== null) {\n el.innerHTML = response[id];\n }\n }\n \n kikuNotify(\"<div class='player-move'>\" + response['player-move-description'] + \"</div><div class='computer-move'>\" + response['computer-move-description'] + \"</div>\", true)\n }\n }", "function updateHowlerPosition() {\n\tlet cameraPosition = (new THREE.Vector3(0, 1.6, 0)).add(document.querySelector(\"a-scene\").camera.position);\n\tHowler.pos(cameraPosition.x, cameraPosition.y, cameraPosition.z, radioPlayingSound);\n}", "update() {\n let approxXpos = this.x + 20;\n let approxYpos = this.y + 20;\n if ((player.x >= this.x && player.x <= approxXpos) && (player.y >= this.y && player.y <= approxYpos)) {\n this.firstTime = false;\n this.conquer = true;\n }\n if (this.firstTime === false && this.count === 0) {\n player.lives++;\n player.livesText.textContent = player.lives;\n this.count++;\n }\n }", "update() {\n // Add points to score if win\n function addPoints() {\n score += 10;\n points.innerHTML = score;\n }\n if (this.y <= 0) {\n addPoints();\n this.x = 200;\n this.y = 380;\n }\n }", "function update() {\r\n\r\n // update game\r\n game.update();\r\n\r\n // toggle tower clickable depending on the user's money\r\n updateTowerStore();\r\n\r\n let { type, lives, money, level, difficulty } = game.getLevelStats();\r\n\r\n // update lives and money based on game stats \r\n livesLabel.innerHTML = 'Lives: ' + lives;\r\n moneyLabel.innerHTML = '$' + money;\r\n levelLabel.innerHTML = 'Level: ' + level; \r\n difficultyLabel.innerHTML = 'difficulty: ' + difficulty;\r\n nextLevelLabel.innerHTML = '';\r\n\r\n if (type) nextLevelLabel.appendChild(ENEMY_IMAGES[type]);\r\n else nextLevelLabel.style.display = 'none';\r\n\r\n // increase flashing transparency\r\n flashingTransparency = flashingTransparency + .2;\r\n}", "function updateUserLocationOnMap() {\n\n\t//clear existing markers\n\tclearMarkers();\n\n\tvar currentUser = getCurrentUser();\n\tvar currentUserPosition;\n\tif (currentUser != null) {\n\t\tcurrentUserPosition = [currentUser.Latitude, currentUser.Longitude];\n\t} else {\n\t\t//set the location to Tech Tower\n\t\tcurrentUserPosition = [33.772457, -84.394699];\n\t}\n\n\tvar newPosition = new google.maps.LatLng(currentUserPosition[0], currentUserPosition[1]);\n\t/*\n\t var infowindow = new google.maps.InfoWindow({\n\t map: map,\n\t position: newPosition,\n\t content: 'You are here.'\n\t });\n\t */\n\tvar marker = new google.maps.Marker({\n\t\tposition : newPosition,\n\t\tmap : map,\n\t\tanimation : google.maps.Animation.BOUNCE, //or DROP\n\t\ttitle : 'You are here.'\n\t});\n\n\tmarkers.push(marker);\n\n\tsetMarkers();\n\n\tmap.setCenter(newPosition);\n\tmap.setZoom(16);\n\n}", "function setPlayerPosition() {\n $('#player')\n .css('margin-top', player.top)\n .css('margin-left', player.left)\n}", "function update() {\n // board movement.\n board.update();\n\n // arrow movement.\n updateArrow();\n}", "function onPlayerMove(id, position) {\n\taoi_st.update(id, position.x, position.y);\n}", "function update()\n{\n\t// Ensure looping behaviour.\n\trequestAnimationFrame(update);\n\n\t// Whatever we want to happen in the loop.\n\tif(isplaying)\n\t{\n\t\t// Update the player\n\t\tP_Controller.Update();\n\t\t// Make the camera follow the player\n\t\tFollowPosition(P_Controller.gameobject.position, cameraOffset, camera);\n\t\tcamera.position.x = 0;\n\t\t// Make the floor follow the player\n\t\tFollowPosition(P_Controller.gameobject.position, floorOffset, plane);\n\t\tplane.position.x = 0;\n\t\t\n\n\t\t// Handle the obstacles\n\t\tfor(var i = 0; i < numberOfObstacles; i++)\n\t\t{\n\t\t\tobstacleArray[i].update(P_Controller.currentLane, player.position.z);\n\t\t}\n\t}else\n\t{\n\n\t}\n\t\t\n\t// Re-render the scene.\n\trenderer.render(scene,camera);\n}", "function updatedLocation() { \n console.log(\"now checking for location changes\"); //needs to write to DOM??\n navigator.geolocation.watchPosition(onGetGeolocationSuccess, onGetGeolocationError); \n}", "function update(pos) {\n var x = pos.x;\n var y = pos.y;\n var z = pos.z;\n var tile = world.get(pos); \n var tileElem = tileElems[x*world.yw*world.zw + y*world.zw + z];\n \n if (tile == Tile.Player || tile == Tile.PlayerWon) {\n playerPos = pos;\n scroll();\n }\n \n updateImage(tileElem, tile);\n updateShadows(pos);\n }", "function place_player()\n{\n\tvar col;\n\tvar row;\n\t\n\tswitch(player_number)\n\t{\n\t\tcase 0:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 19;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 21;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcol = 29;\n\t\t\trow = 19;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcol = 27;\n\t\t\trow = 21;\n\t\t\tbreak;\n\t}\n\t\n\tvar player_text = Crafty.e(\"2D, DOM, Text\")\n\t\t.attr({x: col * 16, y: row * 16 - 15, w: 75})\n\t\t.textColor('#FFFFFF')\n\t\t.text(list_of_users[player_number]);\n\t\t\n\tplayer = Crafty.e('PlayerCharacter').at(col, row).attach(player_text);\n}", "update() {\n this.game.world.bringToTop(items);\n this.game.world.bringToTop(gui);\n this.game.world.bringToTop(menuGroup);\n }", "update () {\n this.position = [this.x, this.y];\n }", "function updateScreen() {\n\n if (mode === 'player1') { //Player is player 1\n // console.log(\"Player is player 1\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").show();\n $(\"#p1v\").hide();\n $(\"#p2p\").hide();\n $(\"#p2v\").show();\n\n } else if (mode === 'player2') { //Player is player 2\n // console.log(\"Player is player 2\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").show();\n $(\"#viewerSection\").hide();\n\n //Hide/show the elements on player bars\n $(\"#p1p\").hide();\n $(\"#p1v\").show();\n $(\"#p2p\").show();\n $(\"#p2v\").hide();\n\n } else if (mode === 'viewer') { //Player is just watching\n // console.log(\"Just watching\")\n\n // Hide/show sections depending on game mode\n $(\"#welcomeSection\").hide();\n $(\"#userSection\").hide();\n $(\"#gameSection\").hide();\n $(\"#viewerSection\").show();\n }\n\n if (player1.name) { // If a PLAYER1 exists\n\n // Hide the button to play as PLAYER 1\n $(\".buttonP1\").hide();\n\n // Display the username in the wing\n $(\".player1Name\").text(\"Player: \" + player1.name);\n\n } else {\n $(\".buttonP1\").show();\n $(\".player1Name\").text(\"Waiting for player\");\n }\n\n if (player2.name) { // If a PLAYER2 exists\n\n // Hide the button to play as PLAYER 2\n $(\".buttonP2\").hide();\n\n // Display the username in the wing\n $(\".player2Name\").text(\"Player: \" + player2.name);\n\n } else {\n $(\".buttonP2\").show();\n $(\".player2Name\").text(\"Waiting for player\");\n }\n\n if (player1.choice) { // If player 1 make choice\n // Show choice to viewers only\n $(\"#player1choice\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player1choice\").html('');\n $(\".oponentChoice1\").html('');\n }\n\n if (player2.choice) { // If player 2 make choice\n // Show to viewers only\n $(\"#player2choice\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n } else {\n //If no choice then clear\n $(\"#player2choice\").html('');\n $(\".oponentChoice2\").html('');\n }\n\n if (player1.choice && player2.choice) {\n // If both players have chosen then test who wins?\n\n // Winner return who wins (player1, player2 or tie)\n var winner = whoWin(player1.choice, player2.choice);\n\n //show their oponent's choice\n $(\".oponentChoice1\").html('<img src=\"./assets/images/icon_' + player1.choice + '.png\" id=\"' + player1.choice + '\" alt=\"' + player1.choice + '\"></img>');\n $(\".oponentChoice2\").html('<img src=\"./assets/images/icon_' + player2.choice + '.png\" id=\"' + player2.choice + '\" alt=\"' + player2.choice + '\"></img>');\n\n // Depending who wins\n switch (winner) {\n case 'player1': // If PLAYER1 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n // Message for VIEWERS\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'player2': // If PLAYER2 wins\n\n // Message for PLAYERS\n if (mode == winner) {\n $(\".resultMessageP\").text(\"You won!\");\n wins++;\n } else {\n $(\".resultMessageP\").text(\"You lost!\");\n loses++;\n }\n\n $(\".resultMessageV\").text(eval(winner).name + \" wins!\");\n // console.log(eval(winner).name + \" wins!\");\n break;\n\n case 'tie': // If it's a tie\n // Message for PLAYERS\n $(\".resultMessageP\").text(\"Same choice... its a tie\");\n\n // Message for PLAYERS\n $(\".resultMessageV\").text(\"Same choice... its a tie\");\n // console.log(\"Same choice... its a tie\");\n break;\n }\n\n // Wait some time to show the winner and clear all games\n setTimeout(function () {\n prepareForNewGame();\n // console.log(\"NEW GAME\");\n\n }, 5000); // Wait this many miliseconds after staring a new match\n }\n\n // Update stats\n $(\".playerStats\").text(\"WINS: \" + wins + \" - LOSES: \" + loses);\n\n }", "function updateGame() {\n if (game_play) {\n clearCanvas();\n enemy_check_collision();\n player_check_collision();\n let check = check_border();\n if (check === true) {\n direction *= -1;\n invaders.forEach(function (element) {\n element.y += 5\n })\n }\n draw_player();\n draw_bullets();\n draw_enemy_bullets();\n invaders.forEach(function (element) {\n element.x += direction;\n element.update()\n });\n }\n}", "function refreshPlayerInfo() {\r\n if (player.gameState === GameState.Night) {\r\n setNightPlayerInfo();\r\n }\r\n else {\r\n setDayPlayerInfo();\r\n }\r\n}", "function SetPosition(){\r\n\tvar ratio = window.innerWidth / window.innerHeight;\r\n\tleftAmt = ratio/0.005;\r\n\ttopAmt = parseInt(window.innerHeight*0.789);\r\n\tdocument.getElementById(\"player\").style.left=ratio/0.005 + \"px\";\r\n\tpositionY = topAmt-200;\r\n\t\r\n\t//if the game hasnt started move the starting block to match the players position\r\n\tif(started == false){\r\n\t\tif(document.getElementById(\"startBlock\") != null){\r\n\t\t\tdocument.getElementById(\"startBlock\").style.left=ratio/0.005 + \"px\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tif(ratio < 1.236){\r\n\t\tdocument.getElementById(\"tutorial\").innerHTML=\"Tap to start\";\r\n\t} else {\r\n\t\tdocument.getElementById(\"tutorial\").innerHTML=\"Click or space to start\";\r\n\t}\r\n}", "function update(){\n updateSnakeMovement();\n updateGameFinishedState();\n updateFoodAcquiredState();\n }", "updatePlayerPosition(player, newPos) { //7-1\n const x = parseInt(newPos.charAt(0));\n const y = parseInt(newPos.charAt(newPos.length - 1));\n player.x = x;\n player.y = y;\n }", "function update() {\n\t\t\t\tplayer.update();\n\t\t\t\tcomputer.update(ball);\n\t\t\t\tball.update(player.paddle, computer.paddle);\n\t\t\t\tdocument.getElementById(\"pongScore\").innerHTML = \"Score = \" + score;\n\t\t\t}", "updateCurrentTileUi() {\n let theTile = this.map[this.player.getPositionKey()];\n currentTilePositionElement.innerText = `[${theTile.getPositionKey()}]`;\n if (theTile.hasBuilding()) {\n let buildingText = theTile.actor.getName() + \" \" + theTile.actor?.inventory?.getSummary();\n currentTileBuildingElement.innerText = buildingText;\n } else {\n currentTileBuildingElement.innerText = \"None\";\n }\n if (theTile.tileType != \"empty\") {\n currentTileResourcesElement.innerText = `${theTile.getType()}: ${theTile.countResources()}`;\n } else {\n currentTileResourcesElement.innerText = \"No Resources\";\n }\n }", "movePlayer() {\r\n const cellX = ~~$(this).get(0).dataset.x;\r\n const cellY = ~~$(this).get(0).dataset.y;\r\n const _map = this.map;\r\n _map.game.currentPlayer.moveTo(this, cellX, cellY);\r\n }", "SetPlayerPosition(playerX, playerY) {\n const playerPosition = this.m_player.GetTransform().p;\n const currentPlayerX = [0];\n const currentPlayerY = [0];\n Fracker.WorldToTile(playerPosition, currentPlayerX, currentPlayerY);\n playerX = b2.Clamp(playerX, 0, FrackerSettings.k_worldWidthTiles - 1);\n playerY = b2.Clamp(playerY, 0, FrackerSettings.k_worldHeightTiles - 1);\n // Only update if the player has moved and isn't attempting to\n // move through the well.\n if (this.GetMaterial(playerX, playerY) !== Fracker_Material.WELL &&\n (currentPlayerX[0] !== playerX ||\n currentPlayerY[0] !== playerY)) {\n // Try to deploy any fracking fluid that was charging.\n this.DeployFrackingFluid();\n // Move the player.\n this.m_player.SetTransformVec(Fracker.TileToWorld(playerX, playerY), 0);\n }\n }", "function update () {\n\n\n //Adds callback to event listener for clicking\n //Uncomment this if you want to move one step at a time with a mouse click\n //game.input.onTap.add(moveCharactersQuadrantAbsolute, this);\n\n // //Uncomment this if you want to move the characters by pushing the up arrow\n // if(game.input.keyboard.isDown(Phaser.Keyboard.UP)){\n // //moveCharacters();\n // moveCharactersQuadrant();\n // }\n\n}", "function giveLocation() {\n divLocation.innerHTML = locations[currentLocation];\n myDescription.innerHTML = descriptions[currentLocation];\n imageLocation.src = \"media/\" + images[currentLocation];\n myDirections = \"\";\n for (let i = 0; i < directions[currentLocation].length; i++) {\n myDirections += \"<li>\" + directions[currentLocation][i] + \"</li>\";\n }\n myPossibilities.innerHTML = myDirections;\n // myInventory.innerHTML = \"Your inventory: \"\n myKeys.innerHTML = \"Keys: \" + keys;\n}", "updatePosition() {\n this.position = Utils.convertToEntityPosition(this.bmp);\n }", "updateGame() {\r\n grid.updateInfos(); // Met à jour les cases armes et force si besoin\r\n newGame.nextTurn(); // Change le joueur actif\r\n $('#playerName').html(currentPlayer.name).prop(\"class\", \"name-\" + currentPlayer.className);\r\n\r\n newGame.resetTrajectory(); // Efface l'ancienne trajectoire\r\n\r\n if (!this.isAdjacent()) { // Si les deux joueurs ne sont pas côte à côte, on exécute\r\n newGame.setTrajectory();\r\n grid.highlightTraj(); // Met en évidence sur le plateau les cases accessibles\r\n newGame.movePlayer(); // Déplace le joueur\r\n } else {\r\n if (panneauAffiche !== 1) {\r\n $('#annonce-fight').fadeIn(\"slow\", function () {\r\n $(this).delay(3000).fadeOut(\"fast\")\r\n panneauAffiche = 1\r\n })\r\n grid.fighting()\r\n\r\n }\r\n }\r\n\r\n }", "updateLocation() {\n this.apiList.map.clearMarkers();\n $('.eventsContainer').empty();\n $('.businessContainer').empty();\n $('.weatherContainer').empty();\n $('.destinationsAdded').empty();\n $('.directionsPanel').empty();\n $('.calculateRoute').removeClass('hidden');\n var userMarker = new Marker(this.apiList.map.mapObj, { name: \"You\" }, undefined, this.apiList.map.updateLocation, this.apiList.map.closeWindows, this.apiList.map.expandClickHandler);\n userMarker.renderUser({\n lat: this.userPositionLat,\n lng: this.userPositionLong\n });\n this.apiList.map.markers.user = userMarker;\n this.initAJAX();\n }", "function update() {\n miRectangulo.update();\n}", "updateStatus () {\n // make sure Sprite in world..\n let alY = Math.cos(this.direction*Math.PI/180) * this.speed * 0.001,\n lat = this.lat + alY;\n if (lat > 84 || lat < -84) {\n alY = -alY;\n this.direction += 180;\n console.warn(\"latitude out of bbox, turn back..\");\n }\n this.lon += Math.sin(this.direction*Math.PI/180) * this.speed * 0.001;\n this.lat += alY;\n // updateStatusView. toDO in maintask.js\n }" ]
[ "0.71629494", "0.70017856", "0.67695576", "0.67542666", "0.6727447", "0.6599812", "0.65100306", "0.65043557", "0.65041083", "0.6487639", "0.6445459", "0.64274156", "0.6424457", "0.64056915", "0.6399257", "0.6381615", "0.63728845", "0.637215", "0.63614714", "0.6353402", "0.63435507", "0.6342754", "0.63084275", "0.62899834", "0.6284395", "0.6266741", "0.6236551", "0.6228123", "0.62260365", "0.6220931", "0.6217152", "0.621575", "0.6211103", "0.62088954", "0.6204616", "0.6151771", "0.6144516", "0.6138463", "0.613266", "0.6114352", "0.6111941", "0.60996336", "0.60940814", "0.6088077", "0.6066576", "0.6064159", "0.6062953", "0.6048911", "0.6036734", "0.6009755", "0.6008616", "0.60057676", "0.60025376", "0.59998393", "0.5987115", "0.59842545", "0.59824127", "0.5981963", "0.5977704", "0.5964556", "0.5960499", "0.59561676", "0.5954857", "0.59527254", "0.59476054", "0.5945863", "0.5945782", "0.59415704", "0.5935261", "0.59341705", "0.5932878", "0.5932576", "0.5930173", "0.59247714", "0.59245783", "0.59240735", "0.59197253", "0.5907252", "0.5903257", "0.59023124", "0.589907", "0.58973765", "0.58960223", "0.5894338", "0.5893034", "0.5890903", "0.5885715", "0.5885315", "0.58794177", "0.5878784", "0.5868773", "0.58639306", "0.586062", "0.58578086", "0.58536273", "0.5850494", "0.58345914", "0.5828974", "0.58271533", "0.58210903" ]
0.6179953
35
Loads all quests from a file resource.
function loadQuests(callback) { var xobj = new XMLHttpRequest(); xobj.overrideMimeType("application/json"); xobj.open('GET', './js/quests.json', true); xobj.onreadystatechange = function () { if (xobj.readyState == 4 && xobj.status == "200") { // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode callback(xobj.responseText); } }; xobj.send(null); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadWholeQuestion(){\n\t\tloadQuestion();\n\t\tloadChoices();\n\t\tloadHint();\n\t\tshowQuestionNumber();\n\t}", "function loadReminders(cb) {\n fs.readFile(reminderFile(), 'utf8', (err, data) => {\n if(err) {\n if(err.code == 'ENOENT') {\n clearReminders()\n cb()\n } else cb(err)\n }\n else {\n clearReminders()\n let d = archieml.load(data)\n for(let i = 0;i < d.reminders.length;i++) {\n addReminder(d.reminders[i])\n }\n cb()\n }\n })\n}", "function arrayLoad(){\n var info, qtext, i;\n info = text.split(\"\\n\");//info is an array of every line of text in the file \n var q = [];//primative array (non OOP arrays in js act like java arraylists) of questions for this page\n var arraycounter=0;\n for(i = 0; i<info.length;i++){\n var ans = info[i];\n i++;\n qtext=\"\";\n while((info[i].trim()) !== \"ZzZ\"){\n qtext+=info[i] + \"<br>\";\n i++;\n }\n i++;//to get out of the ZzZ indicator\n\n q[arraycounter] = new quest(ans, qtext, info[i], info[i+1], info[i+2], info[i+3], info[i+4]);\n arraycounter++; \n \n i+=4;\n }\n //all questions from the doc are now in the array q\n q = shuffle(q);\n return q;\n}", "async load() {\n // Read file, separate into action array\n let lines;\n try {\n const json = await fs.readFile(this.filepath, 'utf8');\n this._nBytes = json.length;\n lines = json.split('\\n');\n } catch (err) {\n if (err.code != 'ENOENT') throw err;\n lines = [];\n }\n\n // Apply each action\n super.clear();\n lines.forEach((line, i) => {\n line = line.trim();\n if (!line) return;\n let action;\n try {\n action = JSON.parse(line);\n } catch (err) {\n console.warn(`PersistentMap load() error @ line ${i + 1}: ${err.message}`, line);\n return;\n }\n\n this._exec(...action);\n });\n\n return this;\n }", "function loadResources() {\n var images = [];\n images = images.concat(Player.getSprites());\n images = images.concat(Block.getSprites());\n images = images.concat(Gem.getSprites());\n\n images.push(Enemy.sprite);\n images.push(Heart.sprite);\n images.push(Star.sprite);\n images.push(Key.sprite);\n\n Resources.load(images);\n Resources.onReady(init);\n }", "function loadStories() {\n req.keys().forEach((filename) => req(filename));\n}", "function loadStories() {\n req.keys().forEach(filename => req(filename));\n}", "function getQuestions(){\n\t$.getJSON(\"questions.json\", function(json){\n\tquestions = json.questions;\n\tstartQuiz();\n\t})\n}", "async getQuestions() {\n this.questions = [[], [], []];\n let rows = await TSVread(\"questions.txt\");\n for (let i = 0; i < rows.length; i++) {\n let row = rows[i];\n let level = parseInt(row.Level);\n if (level < 1 || level > 3) continue;\n let q = new Question();\n q.q = row.Q;\n q.aa = row.A.map(x => { return { a: x } });\n let correct = parseInt(row.Correct) - 1;\n if (!q.q || isNaN(correct) || correct < 0 || correct >= q.aa.length) continue;\n q.aa[correct].c = true;\n q.pic = row.Pic;\n this.questions[level - 1].push(q);\n }\n }", "static async _loadQuestions() {\n // Load TSV.\n const questionsTsv = await $.get(`data/questions.tsv?timestamp=${new Date()}`);\n\n // Parse into Question objects.\n const rows = questionsTsv.split('\\n');\n const headers = rows[0].split('\\t');\n const questions = [];\n for (let i = 1; i < rows.length; i++) {\n const question = Game._parseQuestion(rows[i], headers);\n questions.push(question);\n }\n\n // Pick one question for double Jeopardy.\n const randomIndex = Math.floor(Math.random() * questions.length);\n questions[randomIndex].isDoubleJeopardy = true;\n\n return questions;\n }", "function loadStories() {\n require(\"./welcomeStory\");\n req.keys().forEach(file => req(file));\n}", "loadResources(){\n\n const directory = \"./assets/images/\";\n\n //Load Character-related textures\n this.gameContent.skins.forEach(({skin,texture}) => {\n this.loader.add(`skin_${skin}`,`${directory}/skins/${texture}`);\n });\n\n //Load Map textures\n this.gameContent.maps.forEach(({map,source,obstacle}) => {\n\n this.loader\n .add(`map_${map}`,`${directory}/${source}`)\n .add(`obstacle_${map}`,`${directory}/${obstacle.texture}`);\n\n });\n\n //Load UI-related textures\n this.loader\n .add(\"ui_background\", `${directory}/${this.gameContent.ui.background}`)\n .add(\"ui_button\", `${directory}/${this.gameContent.ui.button}`)\n .add(\"ui_button2\", `${directory}/${this.gameContent.ui.button2}`)\n .add(\"ui_button3\", `${directory}/${this.gameContent.ui.button3}`)\n .add(\"ui_arrow\", `${directory}/${this.gameContent.ui.arrow}`)\n .add(\"ui_loader\", `${directory}/${this.gameContent.ui.loader}`)\n .add(\"ui_sound\", `${directory}/${this.gameContent.ui.sound}`)\n .add(\"ui_muted\", `${directory}/${this.gameContent.ui.muted}`);\n\n //Load Sounds *****\n\n }", "function loadAssets() {\n\thasLoaded = false;\n\tgame.load.onLoadComplete.add(loadComplete, this);\n\n\t// Load enemies defined for this level\n\tfor (const enemy of enemyChoices) {\n\t\tgame.load.image(enemy, getEnemySprite(enemy));\n\t}\n\n\tgame.load.start();\n}", "function loadSoundBoard (fileName, audioContext) {\n const soundBoard = new SoundBoard(audioContext);\n\n return loadJSON(`SoundFX/${fileName}.json`) // Parses JSON file\n .then (audioSheet => {\n const soundEffects = audioSheet.soundFX\n const listOfSounds = [];\n\n Object.keys(soundEffects).forEach(name => {\n const url = soundEffects[name].url;\n\n const sound = loadAudio(url, audioContext)\n .then(audioFile => {\n soundBoard.addAudio(name, audioFile);\n })\n \n\n listOfSounds.push(sound);\n })\n\n return Promise.all(listOfSounds).then(() => soundBoard) // Returns a soundBoard with all of the sounds from the JSON file ready to play\n })\n}", "async read()\n {\n let json = (await RPM.parseFileJSON(RPM.FILE_SKILLS)).skills;\n this.list = RPM.readJSONSystemList(json, Skill);\n }", "loadStory(file) {\n // if we are already loading something\n // set the desired thing to load as the new thing\n // for use when load completes.\n if (this._pending) {\n this._pending= file;\n } else {\n const { path } = file;\n let story= this.store.getStory(path);\n if (story) {\n file.story= story;\n } else {\n this._pending= file;\n this._get(path, (storyData)=>{\n if (storyData) {\n story= this.store.storeStory(path, storyData);\n file.story= story;\n const reload= this._pending;\n this._pending= false;\n this.loadStory(reload);\n }\n });\n }\n }\n }", "function loadDB()\n{\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"./../Academic-Resources2.txt\", true);\n\n xhr.onload = function(e) \n { \n console.log(xhr.responseText);\n db.run(xhr.responseText); // run the query without returning anything\n };\n\n xhr.send();\n}", "function readQuestionsFile(file)\n\t{\n\t\tvar reader = new FileReader();\n\t\treader.onloadend = function(evt){\n\t\t\tvar questionsFileContent = evt.target.result;\n\t\t\tparseQuestionsFileContent(questionsFileContent);\n\t\t};\n\n\t\t// This call will invoke the onloaded callback above.\n\t\treader.readAsText(file);\n\t}", "readPokemonFromFile(fileName) {\n fetch(fileName).then(response => response.text()).then(text => this.getPokemonHelper(text));\n }", "async load () {}", "function loadCommands() {\n bot.commandFile = (fs.readdirSync(`./commands`).filter(file => file.endsWith('.js')))\n bot.commands = new Discord.Collection()\n\n q = ''\n bot.commandFile.forEach(file => {\n try {\n const command = require(`./commands/${file}`)\n bot.commands.set(command.name, command)\n q += (`${command.name.toUpperCase()} `)\n } catch (error) {\n console.log(` ${error} while reading ${file}`)\n }\n })\n console.log(q)\n console.log(`${(bot.commands.size)} total loaded`)\n}", "function loadQuestionData() {\n\t\t\tquestionService.getQuestions().then(function(question) {\n\t\t\t\tapplyQuestionData(question);\n\t\t\t});\n\t\t}", "function loadCountries() {\n return loadFileAsArray('allCountries.txt');\n}", "load(fname) {\n let s = fs.readFileSync(fname, \"utf8\");\n let memento = JSON.parse(s);\n this._results = memento.results;\n this._params = memento.params;\n this._combinations = memento.combinations;\n }", "readInFile() {\n //Goes through the json files and populate the pokemon list\n for (var i = 0; i < pokemon.length; ++i) {\n var currentPokemon = pokemon[i];\n\n var id = currentPokemon.id\n var name = currentPokemon.name;\n var type = currentPokemon.type;\n var species = currentPokemon.species;\n var height = currentPokemon.height;\n var weight = currentPokemon.weight;\n var abilities = currentPokemon.abilities;\n var stats = currentPokemon.stats;\n var desc = currentPokemon.desc;\n\n var newPokemon = new Pokemon(id, name, type, species, height, weight, abilities, stats);\n newPokemon.setDesc(desc);\n this.fullList.push(newPokemon);\n }\n }", "load(file) {\n this._loading = file;\n\n // Read file and split into lines\n const map = {};\n\n const content = fs.readFileSync(file, 'ascii');\n const lines = content.split(/[\\r\\n]+/);\n\n lines.forEach(line => {\n // Clean up whitespace/comments, and split into fields\n const fields = line.replace(/\\s*#.*|^\\s*|\\s*$/g, '').split(/\\s+/);\n map[fields.shift()] = fields;\n });\n\n this.define(map);\n\n this._loading = null;\n }", "function loadQuestion(){\n\t\t$(\".lyrics\").append(questions[questionNumber].q);\n\t}", "loadCards(){\n let cards = require(\"C:\\\\Users\\\\Tony\\\\Desktop\\\\Programming\\\\Yugiosu\\\\Yugiosu - Python (Discord)\\\\yugiosu discord bot\\\\cogs\\\\Yugiosu\\\\cards.json\");\n for(let card of cards){\n this.cards[card[\"id\"]] = new Card(card['id'], card[\"name\"], card[\"cardtype\"], card[\"copies\"], card[\"description\"], card[\"properties\"]);\n }\n }", "function loadQuestion(difficulty) {\n $.getJSON('src/questions.json', function(data) { // for file location, use location relative to position of blockedSite.html\n var dataObj = JSON.parse(JSON.stringify(data));\n var question;\n var idx = getRandomIntInclusive(0, dataObj.questions_basic.length - 1);\n // maintain invariant in questions.json that each difficulty set has same # of questions\n if (difficulty == \"Basic\") {\n question = dataObj.questions_basic[idx].question;\n answer = dataObj.questions_basic[idx].answer;\n } else if (difficulty == \"Intermediate\") {\n question = dataObj.questions_intermediate[idx].question;\n answer = dataObj.questions_intermediate[idx].answer;\n } else {\n question = dataObj.questions_advanced[idx].question;\n answer = dataObj.questions_advanced[idx].answer;\n }\n $('.question').append(question);\n });\n }", "function loadAnimalPlurals() {\n return loadFileAsArray('allAnimalPlurals.txt');\n}", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "load() {\n return __awaiter(this, undefined, undefined, function* () {\n yield Promise.all([\n this._strings.load(),\n this._pedal.load(),\n this._keybed.load(),\n this._harmonics.load(),\n ]);\n this._loaded = true;\n });\n }", "function importQuest(resource) {\n classroom.courses.courseWork.get(\n {\n courseId: resource.courseId,\n id: resource.id,\n }, (err, res) => {\n console.log(res.data)\n })\n // quest.findOne({coursework_id: id}, (err, result) => {\n // if (err) {\n\n // }\n // else {\n // if(!result) {\n\n // console.log(`assignment ${element.title} is not in the db yet`)\n // let newEntry = new quest({\n // classroom_id: req.query.class_id,\n // coursework_id: element.id,\n // due_date: element.due_date ? new Date(element.due_date.year, element.due_date.month - 1, element.due_date.day) : null,\n // creation_date: new Date(element.creationTime),\n // last_modified: new Date(element.updateTime),\n // name: element.title,\n // reward_amount: 5,\n // type: 1\n // })\n // newEntry.save((err, result) => {\n // if (err) {console.log(\"oops\")}\n // else \n // {\n // // result.status(201).send()\n // console.log(\"Assignment entry saved!\")\n // }\n // })\n // }\n // else {\n // console.log(`assignment ${element.title} already exists in the db`)\n // }\n\n // }\n // })\n}", "function loadSounds() {\n createjs.Sound.on(\"fileload\", handleLoad, this);\n // register sounds, which will preload automatically\n createjs.Sound.registerSound(\"/audio/drone.mp3\", soundProximity);\n createjs.Sound.registerSound(\"/audio/water-drop.mp3\", soundClick);\n createjs.Sound.registerSound(\"/audio/snare-2.mp3\", soundSnare);\n}", "function loadFile() {\n loadStrings('rainbow.txt', fileLoaded);\n}", "function loadFile() {\n loadStrings('rainbow.txt', fileLoaded);\n}", "function loadQuestions () {\n\n // setup question HTML\n questions[currentTheme].map( (question, currentIndex) => {\n\n // setup step indicator\n setupStepIndicator(currentIndex);\n\n // setup main question text\n setupQuestionText();\n\n // setup images and answers\n setupAnswers(question, currentIndex);\n\n });\n\n // wait for an answer\n listenForAnswer();\n\n // wait for continue click\n onContinueBtnClick();\n\n // listen for starting over click\n listenForStartOverClick();\n\n}", "function loadStories() {\n require('./welcomeStory');\n require('../stories');\n // req.keys().forEach(filename => req(filename));\n}", "function loadQuotes() {\n const quotesPath =\n fs.appPath([ \"Collection\" ])\n\n return fs\n // List collection.\n // If the path doesn't exist, return an empty object.\n .ls(quotesPath)\n .catch(_ => {})\n .then(a => a || {})\n\n // Transform the object into a list,\n // and retrieve each quote.\n .then(Object.keys)\n .then(links => Promise.all(\n links\n .filter(name => name.endsWith(\".json\"))\n .map(name => fs.cat(`${quotesPath}/${name}`).then(JSON.parse))\n ))\n}", "function loadXMLDoc() {\r\n var xmlhttp = new XMLHttpRequest();\r\n xmlhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n getQuestionsXml(this);\r\n }\r\n };\r\n xmlhttp.open(\"GET\", \"questions.xml\", true);\r\n xmlhttp.send();\r\n}", "function loadVocab(file) {\n $.get(file, function (data) {\n var lines = data.split('\\n');\n for (index in lines) {\n words.push(new Word(lines[index]));\n }\n\n $('#correctCount').html(correctCount);\n $('#wrongCount').html(words.length - correctCount);\n $('#totalCount, #total2Count').html(words.length);\n\n //Start the test\n order === ORDERED ? nextWrd() : rndWord();\n });\n}", "function LoadDeckFromFile(path)\n{\n\tlet loaded = JSON.parse(ReadFile(path)).deck;\n\tlet deck = [];\n\t\n\tfor(let i = 0, n = loaded.length; i < n; i++)\n\t{\n\t\tdeck.push(new Card(loaded[i].suit, loaded[i].type));\n\t}\n\t\n\treturn deck;\n}", "function loadFile() {\n dialog.showOpenDialog({ filters: [\n { name: 'txt', extensions: ['txt'] },\n ]}, function(filenames) {\n if(filenames === undefined) return;\n var filename = filenames[0];\n readFromFile(editor, filename);\n loadedfs = filename;\n })\n}", "function preload(){\n rawtext = loadStrings(\"data/Tale_of_Two_cities.txt\");\n}", "function loadChores() {\r\n // variables\r\n xmlhttp = new XMLHttpRequest();\r\n\r\n // open file\r\n xmlhttp.open(\"GET\", \"chores.json\", true);\r\n\r\n // load file\r\n xmlhttp.onreadystatechange = function() {\r\n if(this.readyState == 4 && this.status == 200) {\r\n localStorage.setItem(\"chores\", this.responseText);\r\n }\r\n };\r\n\r\n // Display information\r\n xmlhttp.send();\r\n // alert(\"Chores are Loaded\");\r\n}", "function loadCountries() {\n var countries = \"countries.txt\";\n $.ajax({\n url: countries,\n type: 'GET',\n dataType: 'text',\n async: false,\n success: function (data) {\n countryList = data;\n },\n cache: false,\n error: apiLoadError,\n\n });\n }", "function loadFiles() {\n loadConfig();\n loadDictionary();\n loadBlacklist();\n loadBonusPhrases();\n\n console.log('All files loaded');\n}", "function loadAnimals() {\n return loadFileAsArray('allAnimals.txt');\n}", "function loadBible(path) {\n \t\t$$invalidate(4, loadingBible = true);\n \t\tconsole.log('Loading Bible', path);\n \t\tlet request = new XMLHttpRequest();\n \t\trequest.open('GET', path);\n \t\trequest.responseType = 'json';\n \t\trequest.send();\n\n \t\trequest.onload = function () {\n \t\t\t$$invalidate(26, books = request.response.books || []);\n\n \t\t\tfor (let i = 0; i < books.length; i++) {\n \t\t\t\t$$invalidate(26, books[i].index = i, books);\n \t\t\t\t$$invalidate(27, booksByAbbr[books[i].abbreviation] = books[i], booksByAbbr);\n \t\t\t}\n\n \t\t\t/* Redraw */\n \t\t\t$$invalidate(1, lastAddresses);\n\n \t\t\t$$invalidate(4, loadingBible = false);\n \t\t};\n \t}", "async loadFile(file) {\n const data = await promises_1.readFile(file, \"utf8\");\n return JSON.parse(data);\n }", "function loadQuiz(req, res){\n let jsonLocation = `client/topics/${req.query.id}/quiz.json`;\n let jsonFile = JSON.parse(fs.readFileSync(jsonLocation, 'utf8'));\n res.json(jsonFile);\n}", "function _load (q, i, f, m) {\n\n\t\t_loadQ.push(q);\n\n\t\tfor (i = 0; i < q.f.length; i ++) {\n\t\t\tf = q.f[i];\n\t\t\tm = q.m[i];\n\t\t\tif (f && !_loadedFiles[f]) {\n\t\t\t\t_loadedFiles[f] = 1;\n\t\t\t\t_inject(f, m);\n\t\t\t}\n\t\t}\n\t}", "function loadNewQuestion() {\n message = questions[done].question;\n answerList = [questions[done].answer,\n questions[done].wrong_answer_1,\n questions[done].wrong_answer_2\n ];\n answerList = shuffle(answerList);\n}", "async load() {\n let dir = path_1.default.dirname(this.file);\n try {\n mkdirp_1.default.sync(dir);\n if (!fs_1.default.existsSync(this.file)) {\n fs_1.default.writeFileSync(this.file, '', 'utf8');\n }\n let content = await util_1.default.promisify(fs_1.default.readFile)(this.file, 'utf8');\n content = content.trim();\n return content.length ? content.trim().split('\\n') : [];\n }\n catch (e) {\n return [];\n }\n }", "function loadItens()\r\n{\r\n\tfor (let i = 0; i < todo.length; i++) \r\n\t{\r\n\t\taddItemToDOM(todo[i]);\r\n\t}\r\n\tfor (var i = 0; i < completed.length; i++) {\r\n\t\taddItemToDOM(completed[i],true);\r\n\t}\r\n\r\n}", "async initialize() {\n const __dirname = dirname(fileURLToPath(import.meta.url));\n const filepath = path.join(__dirname, 'npc.json');\n this.npcObj = JSON.parse(await fs.promises.readFile(filepath, 'utf8'));\n }", "function loadText(fileName) {\n\n loading[fileName] = true;\n getData(fileName, 'txt', {\n headers: { \n 'Cache-Control': 'no-cache, must-revalidate, no-store',\n 'Pragma': 'no-cache'\n }\n }).then(function(data) {\n \n register(fileName, data);\n delete loading[fileName];\n forEach(uninitialised, function(module, moduleName) {\n define(moduleName, module.dependencies, module.def);\n });\n });\n\n }", "function categoryLanguageFileReadingFinished(entries)\n\t{\n\t\tfor(var i in entries)\n\t\t{\n\t\t\tvar name = _difficulty + \".xml\";\n\t\t\tif(entries[i].name == name && entries[i].isFile)\n\t\t\t{\n\t\t\t\t_textResourcesFile = entries[i];\n\t\t\t\tif(null !== _questionsResourcesFile)\n\t\t\t\t{\n\t\t\t\t\treadQuestionsFile(_questionsResourcesFile);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "function LoadInteractions() {\n\tReadCSV(\"CurrentIntro\", CurrentChapter, CurrentScreen, \"Intro\", GetWorkingLanguage());\n\tReadCSV(\"CurrentStage\", CurrentChapter, CurrentScreen, \"Stage\", GetWorkingLanguage());\n\tLoadText();\n}", "static LoadFromFile() {}", "async read_resources(file_path) {\n try {\n const file_json = await this.kubectl(`apply -f ${file_path} --dry-run='client' -o json`);\n const resources = JSON.parse(file_json);\n return resources.items;\n } catch (err) {\n console.error(`failed to load noobaa resources from ${file_path}. error:`, err);\n throw err;\n }\n }", "function loadLangs() \n{\n\tif (jsonObject.phraseArray.length)\n\t{\n\t\tchrome.storage.sync.get({\n\t\t\tfrom: 'en',\n\t\t\tto: 'es',\n\t\t}, function(items) {\n\t\t\tjsonObject.fromLang = items.from;\n\t\t\tjsonObject.toLang = items.to;\n\t\t\tgetTranslation();\n\t\t});\n\t}\n}", "function loadLvls (filename)\n\t\t{\n\t\t\tlet lvls = [\"lvl1\", \"lvl2\", \"lvl3\"];\n\t\t\tlet lvlsPromises = lvls.map (function (lvl)\n\t\t\t{\n\t\t\t\treturn new Promise ( (ok, error) =>\n\t\t\t\t{\n\t\t\t\t\tlet request = new XMLHttpRequest();\n\t\t\t\t\trequest.open(\"GET\", \"lvl/\"+lvl+\".json\");\n\t\t\t\t\trequest.onreadystatechange = function ()\n\t\t\t\t\t{\n\t\t\t\t\t\tif (request.readyState == 4)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (request.status == 200)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tok (JSON.parse(request.responseText));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tconsole.log(request.status);\n\t\t\t\t\t\t\t\terror (\"chargement du fichier json\");\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\trequest.send();\n\t\t\t\t});\n\t\t\t});\n\t\t\treturn (Promise.all(lvlsPromises));\n\t\t}", "function loadAssets () {\n game.load.image(\"Tesla\", \"assets/sprites/tesla2.png\");\n game.load.image(\"Barrier\", \"assets/sprites/barrier.png\");\n game.load.image(\"Cloud\", \"assets/sprites/cloud.png\");\n game.load.audio(\"meow1\", [\"assets/sounds/meow1.mp3\", \"assets/sounds/meow1.ogg\"]);\n game.load.audio(\"meow2\", [\"assets/sounds/meow2.mp3\", \"assets/sounds/meow2.ogg\"]);\n game.load.audio(\"meow3\", [\"assets/sounds/meow3.mp3\", \"assets/sounds/meow3.ogg\"]);\n game.load.audio(\"meow4\", [\"assets/sounds/meow4.mp3\", \"assets/sounds/meow4.ogg\"]);\n game.load.audio(\"meow5\", [\"assets/sounds/meow5.mp3\", \"assets/sounds/meow5.ogg\"]);\n game.load.audio(\"meow6\", [\"assets/sounds/meow6.mp3\", \"assets/sounds/meow6.ogg\"]);\n game.load.audio(\"flap\", [\"assets/sounds/Jump9.mp3\", \"assets/sounds/Jump9.ogg\"]);\n game.load.audio(\"hit\", [\"assets/sounds/Hit_Hurt2.mp3\", \"assets/sounds/Hit_Hurt2.ogg\"]);\n game.load.bitmapFont(\"font\", \"assets/fonts/font.png\", \"assets/fonts/font.fnt\");\n}", "function loadingWords() {\n $.ajax({\n type: \"GET\",\n dataType: 'json',\n url: wordsFile,\n //cache: true,\n error: function () {\n console.error('[EasyPage] Error loading data file @data.json');\n }\n }).done(function (data) {\n //\n if (data != undefined) {\n wordsJson = data;\n startReplacing();\n }\n });\n }", "function loadItens() {\r\n // for loop\r\n for (let i = 0; i < todos.length; i = i + 1) {\r\n // adds 'todos' to the to-do list\r\n addItemToDOM(todos[i]);\r\n }\r\n //adds 'completed' to the completed list\r\n for (let i = 0; i < completed.length; i = i + 1) {\r\n addItemToDOM(completed[i], true);\r\n }\r\n}", "function loadQuestionsData(data) {\n questions = data;\n}", "async load() {\n try {\n this.buf = await fsPromises.readFile(this.path);\n } catch (err) {\n let newErr = new Error('Failed to read the file: ' + err.message);\n if (err.code) newErr.code = err.code;\n throw newErr;\n }\n }", "async load (fileName) {\n let obj = null;\n if (fileName.includes('.gz')) {\n obj = JSON.parse(zlib.gunzipSync(await fs.promises.readFile(fileName)));\n } else {\n obj = JSON.parse(await fs.promises.readFile(fileName));\n }\n\n this._isOptimized = true;\n this._strings = obj.d;\n this._index = obj.t;\n\n for (let [ idx, str ] of Object.entries(this._strings)) {\n this._dictionary[`${str}`] = idx;\n }\n }", "function loadTodos() {\n const content = fs.readFileSync('./todos.json');\n // content ist ein Objekt vom Typ Buffer\n // toString() liefert uns den Inhalt im Text-Format\n // JSON.parse macht aus einem String/Text ein JS-Objekt\n const loadedTodos = JSON.parse(content.toString());\n // Hinzufügen unserer geladenen Todos in unser Todos-Array\n for (const loaded of loadedTodos) {\n todos.push(loaded);\n }\n // Ausgabe Anzahl der geladenen Todos\n console.log(`Loaded ${todos.length} Todos!`);\n}", "function loadCards() {\n\tfs.readFile(cardsFile, 'utf8', function(err, contents) {\n\t\tif (err) {\n\t\t\treturn console.log('Failed to read card tokens from disk: ' + err);\n\t\t}\n\t\ttry {\n\t\t\tcards = contents ? JSON.parse(contents) : {};\n\t\t}\n\t\tcatch (err) {\n\t\t\tconsole.log('Failed to parse card tokens data: ' + err);\n\t\t}\n\t});\n}", "function doWhatItSays() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (!error) {\n doWhatItSaysResults = data.split(\",\");\n songLookup(doWhatItSaysResults[0], doWhatItSaysResults[1]);\n } else {\n console.log(\"Error occurred\" + error);\n }\n });\n}", "function questSet() {\n\t\n\t// Storage for Quest references\n\tthis.playingCards = [];\n}", "function load() {\n m_data.load(APP_ASSETS_PATH + \"ded_moroz_06.json\", load_cb, preloader_cb);\n}", "function MaidQuartersLoad() {\n\n\t// Creates the maid that gives work\n\tMaidQuartersMaid = CharacterLoadNPC(\"NPC_MaidQuarters_Maid\");\n\tMaidQuartersMaidInitiation = CharacterLoadNPC(\"NPC_MaidQuarters_InitiationMaids\");\n\tInventoryWear(MaidQuartersMaidInitiation, \"WoodenPaddle\", \"ItemMisc\");\n\tMaidQuartersPlayerInMaidUniform = ((CharacterAppearanceGetCurrentValue(Player, \"Cloth\", \"Name\") == \"MaidOutfit1\") && (CharacterAppearanceGetCurrentValue(Player, \"Hat\", \"Name\") == \"MaidHairband1\"));\n\n}", "async function loadQuestions(id) {\n const response = await fetch(url + \"/api/questions/\" + id)\n const questions = await response.json()\n return questions\n}", "loadPages() {\n this._pages = utility.getJSONFromFile(this._absoluteFile);\n }", "async function loadPassages(_filename) {\n console.log(\"Start fetch\");\n let response = await fetch(_filename);\n let text = await response.text();\n let json = JSON.parse(text);\n console.log(json);\n for (let i = 0; i <= json.length - 1; i++) {\n console.log(json);\n let passageLeadsTo = JSON.stringify(json[i].leadsTo);\n let leadsToNumber = Number(passageLeadsTo);\n console.log(passageLeadsTo);\n let passageDirection = JSON.stringify(json[i].direction);\n console.log(passageDirection);\n let passageIsPassable = JSON.stringify(json[i].isPassable);\n console.log(passageDirection);\n passageArray[i] = new Abschlussarbeit.Passage(leadsToNumber, passageDirection, passageIsPassable);\n console.log(passageArray[i]);\n }\n console.log(\"Done fetch\");\n }", "function setup() {\n // finding the associated file name with the user level\n var fileToRead = \"\";\n switch(wordlistLevel) {\n case \"Beginner\":\n fileToRead = \"Beginner.txt\";\n break;\n case \"Intermediate\":\n fileToRead = \"Intermediate.txt\";\n break;\n case \"Advanced\":\n fileToRead = \"Advanced.txt\";\n break;\n }\n\n // read the file and append to word data\n // when it's appended to word data, I then\n // check to see if a question in progress is loaded otherwise,\n // generate a new one\n fetch(fileToRead)\n .then(response => response.text())\n .then((text) => {\n var lines = text.split(\"\\n\");\n for (line of lines) {\n var lineData = line.split(\",\");\n wordData[lineData[0]] = [lineData[1], lineData[2]]\n }\n var correctAnswer = localStorage.getItem('questionAnswer');\n if (correctAnswer === null) {\n generateQuestion(); \n } else {\n displayQuestion(correctAnswer);\n }\n })\n}", "function from_file(page) {\n let str = require('fs').readFileSync('./tests/cache/' + page.toLowerCase() + '.txt', 'utf-8');\n // console.log(wtf.plaintext(str));\n let r = wtf.parse(str);\n console.log(r.translations);\n // console.log(JSON.stringify(r.sections, null, 2));\n}", "function loadExercises () {\n $scope.promise = ExerciseService.getAllExercises();\n\n var successCallback = function (response) {\n var data = response.data;\n \n var models = [];\n for (var i in data) {\n models.push(new ExerciseModel().fromJSON(data[i]));\n }\n\n $scope.allExercises = models;\n } \n\n var errorCallback = function (response) {\n console.log('Error: ', response);\n }\n\n $scope.promise.then(successCallback, errorCallback);\n }", "function loadUserQuiz(){\n \n \n\n var amountOfQuestions = localStorage.getItem(\"amt\"); \n for(var i = 0; i < amountOfQuestions; i++){\n var q = new Question();\n q = JSON.parse(localStorage.getItem(\"allQuestions\"))[i];\n console.log(q)\n var last = false;; \n if(i == amountOfQuestions -1) {\n last = true; \n }\n\n document.getElementById('quizTitle').innerHTML = localStorage.getItem('quizTitle')\n\n\n addUserQuest(q, last);\n \n }\n}", "static async read() {\n let json = (await IO.parseFileJSON(Paths.FILE_SONGS)).list;\n let l = json.length;\n this.list = new Array(l);\n let i, j, m, n, jsonHash, k, jsonList, jsonSong, id, list, song;\n for (i = 0; i < l; i++) {\n jsonHash = json[i];\n k = jsonHash.k;\n jsonList = jsonHash.v;\n // Get the max ID\n m = jsonList.length;\n n = 0;\n for (j = 0; j < m; j++) {\n jsonSong = jsonList[j];\n id = jsonSong.id;\n if (id > n) {\n n = id;\n }\n }\n // Fill the songs list\n list = new Array(n + 1);\n for (j = 0; j < n + 1; j++) {\n jsonSong = jsonList[j];\n if (jsonSong) {\n id = jsonSong.id;\n song = new System.Song(jsonSong, k);\n if (k !== SongKind.Sound) {\n song.load();\n }\n if (id === -1) {\n id = 0;\n }\n list[id] = song;\n }\n }\n this.list[k] = list;\n }\n }", "static load_all() {\n server.log(\"Loading rooms...\", 2);\n\n server.modules.fs.readdirSync(server.settings.data_dir + '/rooms/').forEach(function(file) {\n if (file !== 'room_connections.json') {\n var data = server.modules.fs.readFileSync(server.settings.data_dir +\n '/rooms/' + file, 'utf8');\n\n data = JSON.parse(data);\n server.log(\"Loading room \" + data.name, 2);\n Room.load(data);\n }\n });\n\n server.log(\"Loading Room Connections\", 2);\n try {\n var connections = JSON.parse(server.modules.fs.readFileSync(server.settings.data_dir +\n '/rooms/room_connections.json'));\n\n for (var room_id in connections) {\n var room = Room.get_room_by_id(room_id);\n for (let adj_id of connections[room_id]) {\n var adj = Room.get_room_by_id(adj_id);\n room.connect_room(adj, false);\n }\n }\n }\n catch(err) {\n server.log(err, 1);\n }\n\n server.log(\"Rooms loaded.\", 2);\n }", "function loadStories() {\n const req = require.context(__PACKAGES__, true, /story\\.jsx$/);\n req.keys().forEach(filename => req(filename));\n}", "LoadAllAssets() {}", "loadFromFile(scenesFileLocation) {\n if (this.scenesFileLocation == null || this.scenesFileLocation == undefined) {\n console.warn(\"Warning! No scenesFileLocation file specified in config\")\n return\n }\n\n if (!fs.existsSync(this.scenesFileLocation)) {\n try {\n this.saveToFile()\n } catch (e) {\n console.error(e.message)\n console.warn(`Warning! Was not able to create scenes file at: ${this.scenesFileLocation}`)\n return\n }\n\n return\n }\n\n let scenesContent = []\n\n try {\n scenesContent = JSON.parse(fs.readFileSync(this.scenesFileLocation, 'utf8'));\n } catch (e) {\n console.error(e.message)\n console.warn(`Warning! Was not able to read contents of ${this.scenesFileLocation}`)\n return\n }\n\n for (const scene of scenesContent) {\n this.scenes.push(scene)\n }\n }", "function loadAll (cb) {\n var tex = {}\n tex.atlas = load('textures/atlas-p9.png')\n tex.skinHerobrine = load('textures/skin-herobrine.png')\n tex.skinSkeletor = load('textures/skindex-skeletor.png')\n tex.skinOcean = load('textures/skindex-ocean-dusk.png')\n tex.skinPurple = load('textures/skindex-purple-dragongirl.png')\n tex.skinGamer = load('textures/skindex-gamer-boy.png')\n tex.hud = load('textures/hud.png')\n\n var keys = Object.keys(tex)\n var promises = keys.map(function (key) { return tex[key] })\n var loaded = module.exports.loaded\n\n Promise.all(promises)\n .then(function (textures) {\n keys.forEach(function (key, i) { loaded[key] = textures[i] })\n cb()\n })\n .catch(function (err) {\n cb(err)\n })\n}", "static loadJournal() {\n fetch(`${baseURL}/entries`)\n .then(resp => resp.json())\n .then(entries => {\n entries.forEach(entry => {\n let newEntry = new Entry(entry, entry.word, entry.user) \n Entry.all.push(newEntry)\n newEntry.display()\n })\n })\n }", "function preload() {\n data = loadJSON(\"data/clean_speech_pop_20.json\");\n table = loadTable(\"data/mturk_task_sortedcity.csv\", \"csv\", \"header\");\n}", "function loadIslands() {\n var request = new XMLHttpRequest();\n request.open('GET', 'juice.json', true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n // Success!\n var data = JSON.parse(request.responseText);\n processIslands(data);\n } else {\n // We reached our target server, but it returned an error\n\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n };\n\n request.send();\n}", "function init() {\n questions().then(answers => writeToFile(answers))\n}", "load() {}", "load() {}", "function loadDansWords(){\n\n ajaxCallback = putDansWordsInDictionary;\n\tajaxRequest(\"danswordlist.txt\");\n\n}", "function play_quest(quest) {\n\tif(quest.script) {\n\t\t$.globalEval(quest.script);\n\t} else {\n\t\tdisplay_output(false,\"Getting Quest Info...\");\n\t\tvar getQuestInfo = new make_AJAX();\n\t\tgetQuestInfo.callback = function(response) {\n\t\t\tvar temp = $.parseJSON(response);\n\t\t\tquest.text = temp[0];\n\t\t\tquest.script = temp[1];\n\t\t\tplay_quest(quest);\n\t\t};\n\t\tgetQuestInfo.get(\"/AIWars/GodGenerator?reqtype=command&command=bf.getQuestLog(\"+quest.qid+\");\");\n\t}\n}", "function loadAnalytes(scope) {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t\tif ( xmlhttp.readyState == 4 && xmlhttp.status == 200 ) {\n\t\t\tretrieveData(xmlhttp,scope)\n\t\t}\n\t};\n\txmlhttp.open(\"GET\", \"./xml/electrogravimetry.xml\", true);\n\txmlhttp.send();\t\n}", "function load()\n {\n populateMap(gameInfo.jediList);\n init();\n gameInfo.gameState = \"pickChar\";\n }", "async loadFile(path) {\n const buf = await fs_extra_1.readFile(path);\n await this.client.raw(buf.toString());\n }", "function loadToDos() {\n const loadedToDos = localStorage.getItem(TODO_LS);\n if (loadedToDos !== null) {\n const parsedToDos = JSON.parse(loadedToDos);\n parsedToDos.forEach(function (toDo) {\n paintToDo(toDo.text);\n });\n }\n }" ]
[ "0.5813219", "0.5687898", "0.5666737", "0.5622956", "0.56163317", "0.55856526", "0.55742043", "0.5552638", "0.5504943", "0.55047065", "0.5498483", "0.54903716", "0.5488381", "0.5447533", "0.5399579", "0.5355739", "0.53542084", "0.534991", "0.53460056", "0.53425", "0.5315725", "0.5310341", "0.5306803", "0.5300444", "0.5292445", "0.52813643", "0.5273546", "0.52714324", "0.52686316", "0.52651966", "0.52447593", "0.5229231", "0.52245307", "0.52204216", "0.52119464", "0.52119464", "0.5207757", "0.51907", "0.51901424", "0.5185486", "0.5184618", "0.51776576", "0.5171963", "0.5165711", "0.5151217", "0.51358753", "0.5131661", "0.51215225", "0.5117563", "0.5110735", "0.51061755", "0.5106174", "0.50968796", "0.5087317", "0.5079377", "0.5079302", "0.5078376", "0.5057532", "0.5045585", "0.504011", "0.50362265", "0.5034302", "0.5032832", "0.5032074", "0.502604", "0.5025075", "0.5006948", "0.50041467", "0.4989676", "0.49824157", "0.49685043", "0.49545917", "0.49524227", "0.49487823", "0.49451676", "0.49358827", "0.49240237", "0.49228895", "0.492201", "0.4916213", "0.49114597", "0.49101776", "0.49023932", "0.49014193", "0.49009758", "0.49009353", "0.48995596", "0.48980677", "0.48973727", "0.48945403", "0.4889829", "0.48889366", "0.48848972", "0.48848972", "0.48820844", "0.48795664", "0.4878012", "0.4875779", "0.4875239", "0.48731613" ]
0.67883503
0
Helpers to create specific types of items
function canInsert(state, nodeType) { let $from = state.selection.$from for (let d = $from.depth; d >= 0; d--) { let index = $from.index(d) if ($from.node(d).canReplaceWith(index, index, nodeType)) return true } return false }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _makeItem(){\n var index = Utils.randMath(0, allItems.length - 1);\n var item = allItems[index];\n var retItem = undefined;\n\n if ((item.type == Melee)||(item.type == Ranged)) {\n if (item.type == Ranged) {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.damage, item.range, item.level);\n }\n else {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.damage,item.level);\n }\n }\n else if ((item.type == Head)||(item.type == Body)||(item.type == Leg)) {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.damageresist,item.level);\n }\n else if (item.type == Potion) {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.damage,item.level);\n }\n else {\n retItem = new item.type(item.name,item.icon,item.desc,item.value,item.type,item.level);\n }\n return retItem;\n}", "static createItem(typeName, ctx=null) {\n console.debug(\"Types.createItem\", typeName);\n if (typeof typeName !== 'string') {\n throw new Error(\"expected type string\");\n }\n var ret;\n const type= allTypes.get( typeName );\n if (!type ) {\n throw new Error(`unknown type '${typeName}'`);\n }\n const { uses } = type;\n switch (uses) {\n case \"flow\": {\n const data= {};\n const spec= type.with;\n const { params } = spec;\n for ( const token in params ) {\n const param= params[token];\n if (!param.optional || param.repeats) {\n const val= (!param.optional) && Types.createItem( param.type, {\n token: token,\n param: param\n });\n // if the param repeats then we'll wind up with an array (of items)\n data[token]= param.repeats? (val? [val]: []): val;\n }\n }\n ret= allTypes.newItem(type.name, data);\n }\n break;\n case \"slot\":\n case \"swap\": {\n // note: \"initially\", if any, is: object { string type; object value; }\n // FIX: \"initially\" wont work properly for opts.\n // slots dont have a $TOKEN entry, but options do.\n const pair= Types._unpack(ctx);\n if (!pair) {\n ret= allTypes.newItem(type.name, null);\n } else {\n const { type:slatType, value:slatValue } = pair;\n ret= Types.createItem(slatType, slatValue);\n }\n }\n break;\n case \"str\":\n case \"txt\": {\n // ex. Item(\"trait\", \"testing\")\n // determine default value\n let defautValue= \"\";\n const spec= type.with;\n const { tokens, params }= spec;\n if (tokens.length === 1) {\n const t= tokens[0];\n const param= params[t];\n // FIX: no .... this is in the \"flow\"... the container of the str.\n // if (param.filterVals && ('default' in param.filterVals)) {\n // defaultValue= param.filterVals['default'];\n // } else {\n // if there's only one token, and that token isn't the \"floating value\" token....\n if (param.value !== null) {\n defautValue= t; // then we can use the token as our default value.\n }\n // }\n }\n const value= Types._unpack(ctx, defautValue);\n // fix? .value for string elements *can* be null,\n // but if they are things in autoText throw.\n // apparently default String prop validation allows null.\n ret= allTypes.newItem(type.name, value);\n }\n break;\n case \"num\": {\n const value= Types._unpack(ctx, 0);\n ret= allTypes.newItem(type.name, value);\n }\n break;\n default:\n throw new Error(`unknown type ${uses}`);\n break;\n }\n return ret;\n }", "function itemCreator (itemInfo){\n this.name = itemInfo.name;\n this.desc = itemInfo.desc;\n this.useText = itemInfo.useText;\n this.effect = itemInfo.effect;\n this.equip = false;\n this.worn = false;\n this.type = 'item';\n // this.effectText = \"\";\n items.push(this);\n } //end of item constructor", "function createItem(attrs) {\n var units = '';\n if (attrs.units) {\n units = ' ('\n + attrs.units\n + ' ud'\n + (attrs.units != 1 ? 's' : '')\n + '.)';\n }\n\n var kind = '';\n if (attrs.kind) {\n kind = '<span class=\"kind\" style=\"background:'\n + kinds[attrs.kind].color\n + '\">' + kinds[attrs.kind].name + \"</span>\";\n }\n\n $(\"#itemlist\").append($('<div class=\"item selectable\"> <span class=\"icon\"> <img alt=\"\" src=\"objects/' + attrs.icon + '\"></span> <div class=\"text\"><span class=\"description\">'+kind+attrs.description + '</span> <span class=\"location\">' + attrs.location + units + '</span> <input type=\"hidden\" class=\"roomNo\" value=\"' + attrs.room + '\"> <input type=\"hidden\" class=\"id\" value=\"' + attrs.id + '\"> </div> </div>').css(\"opacity\", \"0.2\"));\n}", "function asItem(x) { return toType('item', x) }", "initItem() {\n let item = {}\n\n Object.keys(this.setNewItemFields()).map((Key) => {\n if (Key === 'translatables') {\n this.setNewItemFields()[Key].map((key) => {\n // generate translatable items\n item[key] = Object.fromEntries(this.getLocalesList().map(locale => [locale, '']))\n }, this)\n } else {\n this.setNewItemFields()[Key].map((key) => {\n // generate items\n // if array means you don`t want default value from type\n if (Array.isArray(key)) {\n item[key[0]] = key[1]\n } else {\n item[key] = window[`${Key.charAt(0).toUpperCase() + Key.slice(1)}`]()\n }\n }, Key)\n }\n }, this)\n\n return item\n }", "function _factoryItem (title, start, end, options) {\n\t\t\treturn this.items[this.items.length] = new Item(this, title, start, end, options);\n\t\t}", "function WitnessItem_fromType(id, type) {\n switch(type) {\n case WitnessType.ROOM:\n return new RoomItem(id);\n case WitnessType.CHARACTER:\n return new CharacterItem(id);\n case WitnessType.WEAPON:\n return new WeaponItem(id);\n default:\n throw \"Unrecognized type: \" + type;\n }\n}", "function Item(type, name, price) {\n var type = [\n 'accessory',\n 'smart-phone',\n 'notebook',\n 'pc',\n 'tablet'\n ];\n this._type = type;\n this.name = name;\n this.price = price;\n console.log(this._type);\n}", "function createItem(iType, position, background, top, left, width, height){\n //create item\n let item = document.createElement(iType);\n //set style\n item.style.position = position;\n item.style.top = top + 'px';\n item.style.left = left + 'px';\n item.style.width = width + 'px';\n item.style.fontSize = '25px'\n item.style.textAlign = 'center';\n item.style.height = height + 'px';\n item.style.backgroundColor = background;\n //display the item to screen\n document.body.appendChild(item);\n return item;\n}", "function makeItems() {\n var i;\n var items = [];\n for (i = 0; i < 5; i++) {\n items.push({\n title: makeName(\"option\")\n });\n }\n return items;\n }", "function createItem(draggable, todoType) {\n let item = gen(\"div\");\n item.classList.add(\"todo-item\");\n item.classList.add(todoType === \"todo\" ? \"todo\": \"goal\");\n item.draggable = \"true\"; // item div\n return item;\n }", "function makeItem(itemName, itemPrice) {\n return {\n name: itemName,\n price: itemPrice,\n };\n}", "function genItems(){\n for (var i = 0; i < allItems.length; i++){\n var newItem = new Item(allItems[i]);\n items.push(newItem);\n }\n}", "function createItems(){\n\t//Library Items\n\tancientBook = new Item('Ancient Book', 'Wow looks like it is a thousand years old!.', 4, 'ancient', false);\n\thiddenTreasureMap = new Item('Hidden Treasure Map', 'A barely decipherable looking old map.', 5, 'map');\n\tbookOnDecipheringCode = new Item('Book on Deciphering Code', 'Black leather bound book. Tons of useless information on breaking codes.', 4, 'code', false);\n\tscienceBook = new Item('Science Book', 'Chemistry book.', 1, 'science', false);\n\tmathBook = new Item('Math Book', 'Math book on Calculus.', 1, 'math', false);\n\n\t//Hotel Items\n\troomKeySet = new Item('Room Key Set', 'A huge ring with keys on it, you can access everyone room in the hotel with this key set.', 5, 'room', false);\n\tluggage = new Item('Luggage', 'A large luggage bag with wheels and Nike Backpack.', 1, 'luggage', false);\n\tluggageCart = new Item('Luggage Cart', 'Big rolling luggage cart.', 1, 'cart', false);\n\tpillow = new Item('Pillow', 'A real comforatble down pillow.', 1, 'pillow', false);\n\televatorKey = new Item('Elevator Key', 'A key to turn the elevators on and off.', 4, 'elevator', false);\n\n\t//Grocery Store Items\n\tshoppingBasket = new Item('Shopping Basket', 'A large basket to fit whatever items you want into it.', 1, 'basket', false);\n\tboxOfCereal = new Item('Box of Cereal', 'Frosted mini wheats, sounds like a good breakfast to me.', 1, 'cereal', false);\n\trawSteak = new Item('Raw Steak', 'A delicous porter house steak, find a grill so you can cook a nice meal.', 1, 'steak', false);\n\tpriceGun = new Item('Price Gun', 'Take this price gun and use it to mark down the prices on groceries.', 4, 'price', false);\n\tcashRegister = new Item('Cash Register', 'Full of money, imagine how much this is worth with all the money in it.', 5, 'register', false);\n\n\t//Coffee Shop Items\n\thotCoffee = new Item('Hot Coffee', 'Hot! Be careful!', 1, 'hot', false);\n\ticedCoffee = new Item('Iced Coffee', 'Ice cold, perfect for hot days.', 1, 'iced', false);\n\tdoughnut = new Item('Doughnut', 'Delicous chocalate covered donut, perfect for breakfast.', 1, 'doughnut', false);\n\tmuffin = new Item('Muffin', 'Yummy chocolate chip muffin, warm right out of the oven.', 1, 'muffin', false);\n\tthermos = new Item('Thermos', 'Stainless steel thermos used to keep your coffee hot.', 2, 'thermos', false);\n\n\t//Hardware Store Items\n\thammer = new Item('Hammer', 'One of the best tools in carpentry, used for many jobs.', 3, 'hammer', false);\n\tscrewdriver = new Item('Screwdriver', 'You will used this tool for a lot of small jobs.', 2, 'screwdriver', false);\n\twrench = new Item('Wrench', 'Stainless steel adjustable wrench will help you tighten up bolts.', 3, 'wrench', false);\n\tshovel = new Item('Shovel', 'Use this to do some digging!', 2, 'shovel', false);\n\tsaw = new Item('Saw', 'Hand saw that can be used to cut through small items.', 3, 'saw', false);\n\n\t//Police Station Items\n\thandcuffs = new Item('Handcuffs', 'This is what the officers use to detain the bad guys when arresting them.', 2, 'handcuffs', false);\n\tnightstick = new Item('Nightstick', 'One of the items officers always carry with them to subdue crooks.', 4, 'nightstick', false);\n\thandcuffKey = new Item('Handcuff Key', 'The key to a set of handcuffs. Hopefully you will never need this', 3, 'key', false);\n\ttaser = new Item('Taser', 'A very effective tool for self defense.', 5, 'taser', false);\n\tpoliceReport = new Item('Police Report', 'This is used to put the arrested ones on file.', 1, 'report', false);\n\n\t//Auto Shop Items\n\ttire = new Item('Tire', 'You can not drive with out good tires on your vehicle.', 1, 'tire', false);\n\tengine = new Item('Engine', 'The engine is the most essential item to operate a car.', 5, 'engine', false);\n\ttorqueWrench = new Item('Torque Wrench', 'A perfect tool that is great for working on vehicles.', 3, 'wrench', false);\n\tcarJack = new Item('Car Jack', 'Use this to jack the car up to perform certain work on a vehicle.', 2, 'jack', false);\n\talternator = new Item('Alternator', 'Keeps a charge on your battery and operates the vehicles electrical system.', 2, 'alternator', false);\n}", "function getNewItem() {\n return {name: 'TBD', // <== getNameTypeItemInfo\n type: 'TBD', // <== getNameTypeItemInfo\n dmg: 'TBD', // <== getStatInfo\n acc: 'TBD', // <== getStatInfo\n quality: 'TBD', // <== getStatInfo\n buy: 'TBD', // <== getPricingInfo\n sell: 'TBD', // <== getPricingInfo\n value: 'TBD', // <== getPricingInfo\n circ: 'TBD', // <== getPricingInfo\n asking: 'N/A', // <== getPricingInfo\n id: 'N/A', // <== buildUi\n hash: 0,\n };\n }", "static _processType(typeItem) {\n switch (typeItem.kind) {\n case 'variable-type':\n return Type.newVariableReference(typeItem.name);\n case 'reference-type':\n return Type.newManifestReference(typeItem.name);\n case 'list-type':\n return Type.newSetView(Manifest._processType(typeItem.type));\n default:\n throw `Unexpected type item of kind '${typeItem.kind}'`;\n }\n }", "static resolveItem(item, client) {\n switch (item.type) {\n case Constants_1.ChatItemType.date: return new DateChatItem_1.DateChatItem(client, item.payload);\n case Constants_1.ChatItemType.sender: return new SenderChatItem_1.SenderChatItem(client, item.payload);\n case Constants_1.ChatItemType.participantChange: return new ParticipantChangeChatItem_1.ParticipantChangeChatItem(client, item.payload);\n case Constants_1.ChatItemType.attachment: return new AttachmentChatItem_1.AttachmentChatItem(client, item.payload);\n case Constants_1.ChatItemType.status: return new StatusChatItem_1.StatusChatItem(client, item.payload);\n case Constants_1.ChatItemType.groupAction: return new GroupActionChatItem_1.GroupActionChatItem(client, item.payload);\n case Constants_1.ChatItemType.plugin: return new PluginChatItem_1.PluginChatItem(client, item.payload);\n case Constants_1.ChatItemType.text: return new TextChatItem_1.TextChatItem(client, item.payload);\n case Constants_1.ChatItemType.acknowledgment: return new AcknowledgmentChatItem_1.AcknowledgmentChatItem(client, item.payload);\n case Constants_1.ChatItemType.associated: return new AssociatedChatItem_1.AssociatedChatItem(client, item.payload);\n case Constants_1.ChatItemType.message: return new Message_1.Message(client, item.payload);\n case Constants_1.ChatItemType.phantom: return new StubChatItem_1.StubChatItem(client, item.payload);\n case Constants_1.ChatItemType.groupTitle: return new GroupTitleChatItem_1.GroupTitleChatItem(client, item.payload);\n case Constants_1.ChatItemType.typing: return new TypingChatItem_1.TypingChatItem(client, item.payload);\n case Constants_1.ChatItemType.sticker: return new StickerChatItem_1.StickerChatItem(client, item.payload);\n default: return null;\n }\n }", "function itemToObject(item) {\n var data = {};\n \n data.type = item.getType().toString();\n \n // Downcast items to access type-specific properties\n \n var itemTypeConstructorName = snakeCaseToCamelCase(\"AS_\" + item.getType().toString() + \"_ITEM\"); \n var typedItem = item[itemTypeConstructorName]();\n \n // Keys with a prefix of \"get\" have \"get\" stripped\n \n var getKeysRaw = Object.keys(typedItem).filter(function(s) {return s.indexOf(\"get\") == 0});\n \n getKeysRaw.map(function(getKey) { \n var propName = getKey[3].toLowerCase() + getKey.substr(4);\n \n // Image data, choices, and type come in the form of objects / enums\n if ([\"image\", \"choices\", \"type\", \"alignment\"].indexOf(propName) != -1) {return};\n \n // Skip feedback-related keys\n if (\"getFeedbackForIncorrect\".equals(getKey) || \"getFeedbackForCorrect\".equals(getKey)\n || \"getGeneralFeedback\".equals(getKey)) {return};\n \n var propValue = typedItem[getKey]();\n \n data[propName] = propValue;\n });\n \n // Bool keys are included as-is\n \n var boolKeys = Object.keys(typedItem).filter(function(s) {\n return (s.indexOf(\"is\") == 0) || (s.indexOf(\"has\") == 0) || (s.indexOf(\"includes\") == 0);\n });\n \n boolKeys.map(function(boolKey) {\n var propName = boolKey;\n var propValue = typedItem[boolKey]();\n data[propName] = propValue;\n });\n \n // Handle image data and list choices\n \n switch (item.getType()) {\n case FormApp.ItemType.LIST:\n case FormApp.ItemType.CHECKBOX:\n case FormApp.ItemType.MULTIPLE_CHOICE:\n data.choices = typedItem.getChoices().map(function(choice) {\n return choice.getValue();\n });\n break;\n \n case FormApp.ItemType.IMAGE:\n data.alignment = typedItem.getAlignment().toString();\n \n if (item.getType() == FormApp.ItemType.VIDEO) {\n return;\n }\n \n var imageBlob = typedItem.getImage();\n \n data.imageBlob = {\n \"dataAsString\": imageBlob.getDataAsString(),\n \"name\": imageBlob.getName(),\n \"isGoogleType\": imageBlob.isGoogleType()\n };\n \n break;\n \n case FormApp.ItemType.PAGE_BREAK:\n data.pageNavigationType = typedItem.getPageNavigationType().toString();\n break;\n \n default:\n break;\n }\n \n // Have to do this because for some reason Google Scripts API doesn't have a\n // native VIDEO type\n if (item.getType().toString() === \"VIDEO\") {\n data.alignment = typedItem.getAlignment().toString();\n }\n \n return data;\n}", "function item (type, props) {\n return Object.assign({type, id:id()}, props)\n}", "function getNewItem() {\n return {name: 'TBD', // <== getNameTypeItemInfo\n type: 'TBD', // <== getNameTypeItemInfo\n dmg: 'TBD', // <== getStatInfo\n acc: 'TBD', // <== getStatInfo\n quality: 'TBD', // <== getStatInfo\n buy: 'TBD', // <== getPricingInfo\n sell: 'TBD', // <== getPricingInfo\n value: 'TBD', // <== getPricingInfo\n circ: 'TBD', // <== getPricingInfo\n asking: 'N/A', // <== getPricingInfo\n id: profileId, // <== buildUi\n hash: 0,\n };\n }", "static initialize(obj, type, items) { \n obj['type'] = type;\n obj['items'] = items;\n }", "constructor(type, star, item_type, item_value=null) {\n super(type)\n this.item_type = item_type\n this.item_value = item_value\n this.star = star\n }", "function createItem(itemData, container, array, tooltipOn, quantity) {\n let itemExists = false;\n for (let i = 0; i < array.length; i++) {\n if (itemData.itemName == array[i].item) {\n array[i].increaseQuantity(quantity);\n itemExists = true;\n break;\n }\n }\n if (itemExists != true) {\n let item = new InventoryItem(itemData.itemSprite, itemData.itemName,\n itemData.useableOn, itemData.infectionRisk,\n itemData.effect, itemData.itemText, container,\n array, tooltipOn, quantity);\n array.push(item);\n }\n}", "function createCargoTypeItem(cargoObj) {\n const cargoTypeItem = document.createElement(\"li\");\n cargoTypeItem.classList.add(\n \"legend__cargo-types-item\",\n `legend__cargo-types-item--${cargoObj.type}`,\n `legend__cargo-types-item--${cargoObj.id}`\n );\n\n const colorBox = document.createElement(\"span\");\n colorBox.classList.add(\"color-box\", \"color-box--legend\");\n colorBox.style.background = cargoObj.color;\n\n const cargoName = document.createElement(\"span\");\n cargoName.classList.add(\"legend__cargo-type-name\");\n cargoName.textContent = cargoObj.type;\n\n cargoTypeItem.appendChild(colorBox);\n cargoTypeItem.appendChild(cargoName);\n\n return cargoTypeItem;\n}", "function createItem(name,img,shortDescription,price,longDescription){\n this.name=name;\n this.img=img;\n this.shortDescription=shortDescription;\n this.price=price;\n this.longDescription=longDescription;\n}", "onNewItem(item, type) {\n const { items, itemMaps } = this.state;\n\n items[type].push(item);\n Form.updateItemMap(type, itemMaps[type], items[type].length - 1,\n item.r, item.c, item.h, item.w);\n\n this.setState({\n items, itemMaps,\n });\n }", "function transformItemTypes(itemTypes) {\n const list = [];\n for (let item of itemTypes) {\n list.push({\n \"id\": item.key,\n \"name\": item.name,\n \"_color\": \"green\"\n });\n }\n return list;\n}", "parseItem(item) {\n const name = item.name;\n const description = item.description;\n let isKey = false;\n let isTreasure = false;\n let isWeapon = false;\n if (item.key) {\n isKey = true;\n }\n if (item.treasure) {\n isTreasure = true;\n }\n if (item.weapon) {\n isWeapon = true;\n }\n return new Item_1.default(name, description, isWeapon, isKey, isTreasure);\n }", "createItemNode(item, typeMap, orderedTypes) {\n let li = document.createElement('li');\n li.className = ITEM_CLASS;\n // Set the raw, un-marked up value as a data attribute.\n li.setAttribute('data-value', item.raw);\n let matchNode = document.createElement('code');\n matchNode.className = 'jp-Completer-match';\n // Use innerHTML because search results include <mark> tags.\n matchNode.innerHTML = apputils_1.defaultSanitizer.sanitize(item.text, {\n allowedTags: ['mark']\n });\n // If there are types provided add those.\n if (!coreutils_1.JSONExt.deepEqual(typeMap, {})) {\n let typeNode = document.createElement('span');\n let type = typeMap[item.raw] || '';\n typeNode.textContent = (type[0] || '').toLowerCase();\n let colorIndex = (orderedTypes.indexOf(type) % N_COLORS) + 1;\n typeNode.className = 'jp-Completer-type';\n typeNode.setAttribute(`data-color-index`, colorIndex.toString());\n li.title = type;\n let typeExtendedNode = document.createElement('code');\n typeExtendedNode.className = 'jp-Completer-typeExtended';\n typeExtendedNode.textContent = type.toLocaleLowerCase();\n li.appendChild(typeNode);\n li.appendChild(matchNode);\n li.appendChild(typeExtendedNode);\n }\n else {\n li.appendChild(matchNode);\n }\n return li;\n }", "function createCalendarDomItem(\n itemDate, itemWhat, itemWith, itemPhone, itemWhere, itemNotes\n){\n const itemElement = document.createElement('li');\n\n // tag name date for date\n\n // tag name h2 for title\n\n // tag name with for with\n\n // tag name phone for phone number\n\n // tag name where for address\n\n // tag name notes for notes\n\n\n calendarElement.appendChild(itemElement);\n}", "function ResItem(type, content, name = \"\") {\n this.type = type;\n this.content = content;\n this.name = name;\n\n // Returns a string with the name of this item's type.\n this.typeName = function() {\n if (this.type == ResType.MISC)\n return ResType.miscTypes.names[this.content];\n return ResType.names[this.type];\n }\n\n // Returns a new copy of this object. Recursively deep-copies NAMESPACEs and\n // LISTs; otherwise simply copies over the content.\n this.copy = function() {\n let newObj = new ResItem(this.type, null);\n\n switch (this.type) {\n case ResType.LIST:\n newObj.content = [];\n for (let elem of this.content)\n newObj.content = newObj.content.concat(elem.copy());\n break;\n\n case ResType.NAMESPACE:\n newObj.content = {};\n for (let k in this.content) {\n newObj.content[k] = this.content[k].copy();\n }\n break;\n\n default:\n newObj.content = this.content;\n }\n\n return newObj;\n }\n\n // Returns a string representation of this object.\n // For data items, displays the contents; otherwise just returns (TYPENAME).\n this.display = function(pad = '') {\n let str = pad;\n switch (this.type) {\n case ResType.LIST:\n str += \"[\";\n let first = true;\n for (let elem of this.content) {\n str += elem.display(first ? '' : ' ');\n first = false;\n }\n str += \"]\";\n break;\n case ResType.NUM:\n str += this.content;\n break;\n case ResType.CHAR:\n str += \"'\" + this.content + \"'\";\n break;\n default:\n str += \"(\" + this.typeName() + \")\";\n }\n return str;\n }\n}", "function item (name, consumable, type, armor, potion){\n this.name = name;\n this.consumable = consumable;\n this.type = type;\n this.armor = armor;\n this.potion = potion;\n}", "function createInfo (typeOfContent, title, header, content){\n var id = ((app.info.length) + 1) *4;\n var item ={};\n item.id = id;\n item.title = title;\n item.header = header;\n item.content = content;\n item.typeOfContent = typeOfContent;\n console.log(item, \"new itmeeeee\");\n app.info.push(item);\n return item;\n}", "function createItem(item, position) {\n let object = clone(item);\n object.position = position;\n object.type = 'item';\n object.visual = 'I';\n print('Creating item...');\n return object;\n}", "function itemCreator(itemName, category, quantity) {\n let invalidObj = { notValid: true };\n\n if (itemName.split(' ').join('').length < 5) {\n return invalidObj;\n } else if (!(category.match(/\\b[a-z]{5,}$/i)) || category.match(/\\s/)) {\n return invalidObj;\n } else if (quantity === undefined) {\n return invalidObj;\n }\n\n return {\n itemName,\n category,\n quantity,\n skuCode: (itemName.split(' ').join('').slice(0, 3) +\n category.slice(0, 2)).toUpperCase(),\n }\n}", "function Item(title,\n price_per_kle,\n kle,\n unit_price,\n unit_volume,\n amount)\n{\n return {\n title: title,\n price_per_kle: price_per_kle,\n kle: kle,\n unit_price: unit_price,\n unit_volume: unit_volume,\n amount: amount\n };\n}", "addItem(count, unit, ingredient) {\n const item = {\n // we need each item to have a unique id, so that we can update/delete them. We are including a library to add unique ids\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n // push newly-created item into items array and return the newly created item\n this.items.push(item)\n return item\n }", "function makeItem(name, price, count) {\n if (count == undefined) {\n count = 1;\n }\n return {name: name, price: price, count: count};\n}", "_createItemClass(name)\n {\n const _Item = class extends CollectionItem\n {\n static get KEY()\n {\n return name;\n }\n };\n CollectionItem.register(_Item.KEY, _Item);\n }", "function createOTBMItem(id) {\r\n \r\n /* FUNCTION createOTBMItem\r\n * Creates OTBM_ITEM object for OTBM2JSON\r\n */\r\n \r\n return {\r\n \"type\": otbm2json.HEADERS.OTBM_ITEM,\r\n \"id\": id\r\n }\r\n \r\n }", "function createHTML(item) {\n return '<li class=\"item\" >\\n' +\n ' <img src=\"'+item.image+'\" alt=\"image\" class=\"itemPoint\" data-key=\"image\" data-value=\"'+item.image+'\">' +\n ' <span class=\"itemDetail\">'\n +item.gender+' / '+item.size+' / '+item.color+\n '</span>\\n' +\n ' </li>';\n}", "function createItemString(data) {\n\t return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n\t}", "function createItemString(data) {\n\t return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n\t}", "function createItem(itemName, id, done, trash) {\n const position = \"beforeend\";\n const check = \"fa-check-circle\";\n const uncheck = \"fa-circle\";\n const line = \"lineThrough\";\n const opacity = \"item-checked\";\n\n const iconStyle = done ? check : uncheck;\n const textStyle = done ? line : \"\";\n const itemOpacity = done ? opacity : \"\";\n\n const itemHtml = `<li class=\"item ${itemOpacity}\">\n <i class=\"far ${iconStyle} complete\" id=\"${id}\"></i>\n <p class=\"text ${textStyle}\">${itemName}</p>\n <i class=\"far fa-trash-alt delete\" id=\"${id}\"></i>\n </li>`;\n\n listElement.insertAdjacentHTML(position, itemHtml);\n}", "function addItem(method, ...args) {\n if (method == 'dropdown') {\n genDropDown(...args);\n } else if (method == 'shortinput') {\n genShortInput(...args);\n } else if (method == 'checkbox') {\n genCheckbox(...args);\n } else if (method == 'separator') {\n genSeparator(...args);\n }\n}", "function generateListItem(itemJson){\n\n var itemList = document.createElement(\"li\");\n itemList.classList.add(\"productLine\");\n\n itemList.appendChild(formatListItem(itemJson.imagem, \"productImage\"));\n itemList.appendChild(formatListItem(itemJson.titulo, \"productHeader\"));\n itemList.appendChild(formatListItem(itemJson.descricao, \"productParagraph\"));\n\n return itemList;\n\n}", "function createItemElement(item) {\n const itemElement =\n `<section class=\"col-md-6\">\n <div class=\"row dish\">\n <div class=\"col-md-3\">\n <img alt=\"${item.name}\" src=\"${item.picture}\" class=\"img-rounded img-responsive\" />\n </div>\n <div class=\"col-md-6\">\n <h4>\n ${item.name}\n </h4>\n <p>\n ${item.description}\n </p>\n </div>\n <div class=\"col-md-3\">\n <h4>$${item.price}</h4>\n <div class=\"input-group\">\n <span class=\"input-group-btn\">\n <button class=\"add-item btn btn-success\" data-name=\"${item.name}\" type=\"button\">Add</button>\n </span>\n <input type=\"text\" class=\"form-control\" placeholder=\"1\" value=\"1\">\n </div>\n </div>\n </div>\n </section>`;\n return itemElement;\n }", "function convertItemsToObjects(itemData) {\n const classes = {\"message\": Message, \"listener\": Listener};\n return itemData.map(data => new classes[data.type](data));\n }", "function createItemNode(dataType, itemData){\n // Create containe structure and information\n var divTag = document.createElement(\"div\");\n if (dataType == \"name\") {\n divTag.setAttribute(\"class\", \"prodName\");\n }\n else {\n divTag.setAttribute(\"class\", \"prodPrice\");\n }\n // Creating the elements of the node\n var spanTag = document.createElement(\"span\");\n if (dataType == \"name\") {\n spanTag.innerHTML = itemData;\n }\n else {\n spanTag.innerHTML = \"$\"+itemData;\n }\n // Adding the span tag to the container\n divTag.appendChild(spanTag);\n // Adding the item Node to the product container.\n var containerTag = document.getElementsByClassName(\"product\");\n containerTag[containerTag.length-1].appendChild(divTag);\n}", "function createItem(item){\n const {truck_id, item_name, item_description, item_photo_url, item_price} = item\n return db('items')\n .insert({truck_id, item_name, item_description, item_photo_url, item_price})\n}", "createTypes(){\n }", "async function createPackingList(type, items){\n //validates number of arguments\n if (arguments.length != 2) {\n throw new Error(errorMessages.wrongNumberOfArguments);\n }\n //validates argument(s) type\n if(!type || !items) throw new Error(errorMessages.packingListArgumentMissing);\n if(typeof type !== 'string' || !Array.isArray(items)) throw new Error(errorMessages.packingListArgumentTypeError);\n\n const packingCollection = await packing();\n let newList = {\n type: type,\n items: items\n };\n\n const listExists = await packingCollection.findOne({\"type\" : type});\n //checks if packing list exists already or not\n if(listExists) throw new Error(errorMessages.packingListAlreadyExists);\n //adds the new packing list into database\n const insertInfo = await packingCollection.insertOne(newList);\n if(insertInfo == null || insertInfo.insertedCount === 0) throw new Error(errorMessages.packingListAddError);\n\n return true;\n}", "function getItemType(item, def, buckets) {\n var type = def.itemTypeName;\n var name = def.itemName;\n\n if (def.bucketTypeHash === 3621873013) {\n return null;\n }\n\n if (def.bucketTypeHash === 2422292810) {\n if (item.location !== 4)\n return null;\n }\n\n if (def.bucketTypeHash === 375726501) {\n if (type.indexOf(\"Message \") != -1) {\n return 'Messages';\n }\n\n if (type.indexOf(\"Package\") != -1) {\n return 'Messages';\n }\n\n if ([\"Public Event Completed\"].indexOf(name) != -1) {\n return \"Messages\";\n }\n\n return 'Missions';\n }\n\n\n if (_.isUndefined(type) || _.isUndefined(name)) {\n return {\n 'general': 'General',\n 'weaponClass': 'General'\n };\n }\n\n //if(type.indexOf(\"Engram\") != -1 || name.indexOf(\"Marks\") != -1) {\n if (name.indexOf(\"Marks\") != -1) {\n return null;\n }\n\n if (type === 'Mission Reward') {\n return null;\n }\n\n // Used to find a \"weaponClass\" type to send back\n var typeObj = {\n general: '',\n weaponClass: type.toLowerCase().replace(/\\s/g, ''),\n weaponClassName: type\n };\n\n if ([\"Pulse Rifle\", \"Scout Rifle\", \"Hand Cannon\", \"Auto Rifle\", \"Primary Weapon Engram\"].indexOf(type) != -1)\n typeObj.general = 'Primary';\n if ([\"Sniper Rifle\", \"Shotgun\", \"Fusion Rifle\", \"Sidearm\", \"Special Weapon Engram\"].indexOf(type) != -1) {\n typeObj.general = 'Special';\n\n // detect special case items that are actually primary weapons.\n if ([\"Vex Mythoclast\", \"Universal Remote\", \"No Land Beyond\"].indexOf(name) != -1) {\n typeObj.general = 'Primary';\n }\n\n if (def.itemHash === 3012398149) {\n typeObj.general = 'Heavy';\n }\n }\n if ([\"Rocket Launcher\", \"Sword\", \"Machine Gun\", \"Heavy Weapon Engram\"].indexOf(type) != -1)\n typeObj.general = 'Heavy';\n if ([\"Titan Mark\", \"Hunter Cloak\", \"Warlock Bond\", \"Class Item Engram\"].indexOf(type) != -1)\n return 'ClassItem';\n if ([\"Gauntlet Engram\"].indexOf(type) != -1)\n return 'Gauntlets';\n if (type==='Mask') {\n return 'Helmet';\n }\n if ([\"Gauntlets\", \"Helmet\", 'Mask', \"Chest Armor\", \"Leg Armor\", \"Helmet Engram\", \"Leg Armor Engram\", \"Body Armor Engram\"].indexOf(type) != -1)\n return (type.split(' ')[0] === 'Body') ? \"Chest\" : type.split(' ')[0];\n if ([\"Titan Subclass\", \"Hunter Subclass\", \"Warlock Subclass\"].indexOf(type) != -1)\n return 'Class';\n if ([\"Restore Defaults\"].indexOf(type) != -1)\n return 'Armor';\n if ([\"Currency\"].indexOf(type) != -1) {\n if ([\"Vanguard Marks\", \"Crucible Marks\"].indexOf(name) != -1)\n return '';\n return 'Material';\n }\n if ([\"Commendation\", \"Trials of Osiris\", \"Faction Badge\"].indexOf(type) != -1) {\n if (name.indexOf(\"Redeemed\") != -1) {\n return null;\n }\n\n return 'Missions';\n }\n\n if (type.indexOf(\"Summoning Rune\") != -1) {\n return \"Material\";\n }\n\n if (type.indexOf(\"Emote\") != -1) {\n return \"Emote\";\n }\n\n if (type.indexOf(\"Artifact\") != -1) {\n return \"Artifact\";\n }\n\n if (type.indexOf(\" Bounty\") != -1) {\n if (def.hasAction === true) {\n return 'Bounties';\n } else {\n return null;\n }\n }\n\n if (type.indexOf(\"Treasure Map\") != -1) {\n return 'Bounties';\n }\n\n if (type.indexOf(\"Bounty Reward\") != -1) {\n return 'Bounties';\n }\n\n if (type.indexOf(\"Queen's Orders\") != -1) {\n return 'Bounties';\n }\n\n if (type.indexOf(\"Curio\") != -1) {\n return 'Bounties';\n }\n if (type.indexOf(\"Vex Technology\") != -1) {\n return 'Bounties';\n }\n\n if (type.indexOf(\"Horn\") != -1) {\n return \"Horn\";\n }\n\n if (type.indexOf(\"Quest\") != -1) {\n return 'Quests';\n }\n\n if (type.indexOf(\"Relic\") != -1) {\n return 'Bounties';\n }\n\n if (type.indexOf(\"Message \") != -1) {\n return 'Messages';\n }\n\n if (type.indexOf(\"Package\") != -1) {\n return 'Messages';\n }\n\n if (type.indexOf(\"Armsday Order\") != -1) {\n switch (def.bucketTypeHash) {\n case 2465295065:\n return 'Special';\n case 1498876634:\n return 'Primary';\n case 953998645:\n return 'Heavy';\n default:\n return 'Special Orders';\n }\n }\n\n if (typeObj.general !== '') {\n return typeObj;\n }\n\n if ([\"Public Event Completed\"].indexOf(name) != -1) {\n return \"Messages\";\n }\n\n if ([\"Vehicle Upgrade\"].indexOf(type) != -1) {\n return \"Consumable\";\n }\n\n if ([\"Armor Shader\", \"Emblem\", \"Ghost Shell\", \"Ship\", \"Vehicle\", \"Consumable\", \"Material\", \"Ship Schematics\"].indexOf(type) != -1)\n return type.split(' ')[0];\n\n return null;\n }", "function transform(item, type){\n var itm = loader.res.items[type];\n if (itm){\n item.type = type;\n item.name = itm.name;\n item.sprite = itm.image;\n }\n}", "initItem(item) {\n if (!item || typeof(item)!==\"object\") item = {};\n return item;\n }", "static factoryNextSongOptions(className, items, placeForWidget){\n \n const {marked, render} = calculateWidgetCoverage()\n if(render)\n for(let i = marked; i < items.length; i++){\n var itemObject = {};\n itemObject.url = items[i].href;\n itemObject.title = items[i].parentElement\n .nextElementSibling\n .firstElementChild\n .firstElementChild\n .innerText;\n\n items[i].parentElement.appendChild(new className(itemObject, placeForWidget))\n }\n return items;\n }", "function create_item( s ){\n\n\tlet this_item = template_item_dom.cloneNode(true);\n\tthis_item.id = \"item\" + (now_item_top);\n\tthis_item.children[1].textContent = s ;\n\tthis_item.children[2].id = now_item_top + '_img' ;\n\tthis_item.children[0].children[0].id = \"\" + (now_item_top);\n\tthis_item.children[0].children[1].htmlFor = \"\" + (now_item_top);\n\n\tif ( now_mode != 'Completed' ){\n\t\t\n\t\tthis_item.children[1].style['opacity']='0';\n\t\tthis_item.children[0].style['opacity']='0';\n\t\tlet item_main = document.getElementById(\"todo-list\");\n\t\tlet temp_li = document.createElement(\"LI\");\n\t\ttemp_li.classList.add('todo-app__item_2');\n\t\ttemp_li.classList.add('heightTranslate');\n\t\titem_main.prepend(temp_li);\n\t\ttemp_li.style['min-height'] = 0;\n\t\tsetTimeout(function(){\n\t\t\ttemp_li.style['min-height'] = '5em';\n\t\t\tsetTimeout(function(){\n\t\t\t\titem_main.prepend(this_item);\n\t\t\t\tsetTimeout(function(){\n\t\t\t\t\tthis_item.children[1].style['opacity']='1';\n\t\t\t\t\tthis_item.children[0].style['opacity']='1';\n\t\t\t\t},100)\n\t\t\t\titem_main.removeChild(temp_li);\n\t\t\t},1500)\n\t\t},300);\n\t}\n\tnow_exist_items[now_item_top] = this_item;\n\tnow_item_top ++ ;\n\tupdate_left();\n}", "function generateLineItems(items) {\n const lineItems = items.map(item => {\n return {\n price_data: {\n currency: 'usd',\n product_data: {\n name: item.name,\n images: item.imageUrls,\n },\n unit_amount: item.hasOwnProperty('salePrice') ? parseInt(item.salePrice) * 100 : parseInt(item.Price) * 100 ,\n },\n quantity: item.quantity,\n // Description of item for admin\n description: `${item.name} | ${item.colorName}`\n }\n })\n return lineItems\n}", "addListItem(type, inputObj) {\r\n let html, elContainer;\r\n if (type === \"inc\") {\r\n elContainer = getDOMstrings.containerInc;\r\n html = `<div class=\"item clearfix\" id=\"inc-${inputObj.id}\">\r\n <div class=\"item__description\">${inputObj.description}</div>\r\n <div class=\"right clearfix\">\r\n <div class=\"item__value\">${formatNumber(\r\n inputObj.value,\r\n \"inc\"\r\n )} $</div>\r\n <div class=\"item__delete\">\r\n <button class=\"item__delete--btn\"><i class=\"ion-ios-close-outline\"></i></button>\r\n </div>\r\n </div>\r\n </div>`;\r\n } else {\r\n elContainer = getDOMstrings.containerExp;\r\n html = ` <div class=\"item clearfix\" id=\"exp-${inputObj.id}\">\r\n <div class=\"item__description\">${inputObj.description}</div>\r\n <div class=\"right clearfix\">\r\n <div class=\"item__value\">${formatNumber(\r\n inputObj.value,\r\n \"exp\"\r\n )} $</div>\r\n <div class=\"item__percentage\">21%</div>\r\n <div class=\"item__delete\">\r\n <button class=\"item__delete--btn\"><i class=\"ion-ios-close-outline\"></i></button>\r\n </div>\r\n </div>\r\n </div>`;\r\n }\r\n\r\n document.querySelector(elContainer).insertAdjacentHTML(\"beforeend\", html);\r\n }", "function createItem(id, size, color, quantity, code){\n\tlet i = catalog.findIndex(function(e){if (e.id == id) return e;});\n\tlet div = document.createElement('div');\n div.className = 'item';\n div.id = code;\n let p = '£' + catalog[i].price;\n if (catalog[i].price != catalog[i].discountedPrice)p = '£' + catalog[i].discountedPrice;\n\n div.innerHTML = '<div class=\"table\"><a href=\"item.html?id=' + id + '\"><div class=\"hoverPhoto photo\"><span class=\"view\">View Item</span><img src=\"'+ catalog[i].preview[0] + '\" alt=\"'+ catalog[i].title + '\"></div></a><div class=\"text\"><p class=\"itemTitle\">'+ catalog[i].title +'</p><p class=\"price\">' + p + '</p><p class=\"color\">Color: <span>' + color + '</span></p><p class=\"size\">Size: <span>' + size + '</span></p><p class=\"quantity\">Quantity:<span class=\"minus\">–</span><span class=\"number\">' + quantity +'</span><span class=\"plus\">+</span></p><p class=\"removeItem\">Remove item</p></div></div>';\n wrapItems.insertBefore(div, wrapItems.lastChild);\n}", "function createItemString(data) {\n return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n}", "function createItemString(data) {\n return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n}", "function createItemString(data) {\n return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n}", "function createItemString(data) {\n return data.length + ' ' + (data.length !== 1 ? 'items' : 'item');\n}", "function createNewItem(item) { \n return $(`\n <li>\n <span class=\"shopping-item\">${item}</span>\n <div class=\"shopping-item-controls\">\n <button class=\"shopping-item-toggle\">\n <span class=\"button-label\">check</span>\n </button>\n <button class=\"shopping-item-delete\">\n <span class=\"button-label\">delete</span>\n </button>\n </div>\n </li>\n `);\n}", "function createItemNode(item) {\n var node = document.createElement('div');\n var icon = document.createElement('span');\n var text = document.createElement('span');\n node.className = createItemClassName(item);\n icon.className = exports.ICON_CLASS;\n text.className = exports.TEXT_CLASS;\n if (!item.isSeparatorType) {\n text.textContent = item.text.replace(/&/g, '');\n }\n node.appendChild(icon);\n node.appendChild(text);\n return node;\n}", "dataForItem(item) {\n // console.log(item)\n let newData = {data: ''}\n switch (item.dataSource) {\n case 'todoist':\n newData['data'] = this.todoist.dataForScreenItem(item)\n break\n case 'pinboard':\n newData['data'] = this.pinboard.unreadItems()\n break\n case 'gcal':\n newData['data'] = this.gcal.eventsThisMonth()\n break\n case 'gmail':\n newData['data'] = this.gmail.starredMessages()\n break\n case 'github':\n newData['data'] = this.github.items()\n break\n case 'creativeai':\n newData['data'] = this.creativeai.items()\n break\n case 'hackernews':\n newData['data'] = this.hackernews.items()\n break\n case 'evernote':\n newData['data'] = this.evernote.scratchPadNote(item)\n break\n case 'pocket':\n newData['data'] = this.pocket.favoritedItems()\n break\n }\n return newData\n }", "addItem(count, unit, ingredient){\n const item = {\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n this.items.push(item);\n return item;\n }", "copyItem(inName, inOldType, inNewType,\n inOldFlags, inNewFlags) {\n\n var objNewItem = new Item(inNewType, inName, { _s: this._s }).newItem();\n var objOldItem = this._s[inOldType + \"_\" + inName];\n\n var propsOldItem = this.arrNonFlagProperties(objOldItem);\n // excluding flag items and element objects\n for (var i = 0, len = propsOldItem.length; i < len; i++)\n if (propsOldItem[i] in objNewItem)\n objNewItem[propsOldItem[i]] =\n objOldItem[propsOldItem[i]];\n\n // both flag items inFlags and objFlags\n // are already in objNewItem thanks to\n // the above constructor: this.newItem\n var objFlags = new Flags(inNewFlags);\n\n // reset random memory, not for lists!! (save space)\n if (objFlags.isList)\n objNewItem._arrRandomMemory = [];\n else\n objNewItem._arrRandomMemory = objNewItem._arrOrder;\n\n // instead of copying element objects,\n // create new elements and copy their properties\n var arrOrder = objNewItem._arrOrder;\n var prop; // strict\n\n // ideally want to prevent extra properties for lists\n // but there's the chance users will want to convert\n // buttons to lists and back, in which case, all must stay\n for (var i = 0, len = arrOrder.length; i < len; i++) {\n objNewItem[arrOrder[i]] =\n new Element(inNewType, inName, arrOrder[i],\n { _s: this._s }).newElement();\n\n for (prop in objNewItem[arrOrder[i]]) {\n if (prop in objOldItem[arrOrder[i]]) {\n objNewItem[arrOrder[i]][prop]\n = objOldItem[arrOrder[i]][prop];\n }\n }\n }\n\n delete this._s[inOldType + \"_\" + inName];\n this._s[inNewType + \"_\" + inName] = objNewItem;\n\n return this._s;\n }", "function createItem(id,title,promozione,attivabile,desciption,img){\n var divElement = document.createElement(\"DIV\"); \n divElement.setAttribute(\"class\",\"product clearfix\");\n divElement.appendChild(addDivImg(id,title,img,promozione));\n divElement.appendChild(addDivProduct(id,title,attivabile,desciption));\n \n return divElement;\n}", "function create(items, isIncomplete) {\n return {\n items: items ? items : [],\n isIncomplete: !!isIncomplete\n };\n }", "function create(items, isIncomplete) {\n return {\n items: items ? items : [],\n isIncomplete: !!isIncomplete\n };\n }", "function create(items, isIncomplete) {\n return {\n items: items ? items : [],\n isIncomplete: !!isIncomplete\n };\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function CreateItem(name, fileExtension = 'jpg'){\n //properties from arugments\n this.name = name;\n this.src = `img/${name}.${fileExtension}`;\n //other properties\n this.viewed = 0;\n this.clicked = 0;\n allItems.push(this);\n}", "function _createItem(item, border) {\n\t\t\t\t// generate container\n\t\t\t\tvar timetable = this._timetable,\n\t\t\t\t\tvocab = getVocab.call(timetable),\n\t\t\t\t\titemPos = _valToPos.call(this, item.start),\n\t\t\t\t\titemLength = _valToPos.call(this, item.end) - itemPos,\n\t\t\t\t\titemElm = $dom.create(itemHolderTemplate),\n\t\t\t\t\titemContent = item.getContent() || _itemDefaultContent(item);\n\n\t\t\t\t// add class name & id\n\t\t\t\titemElm.attr(\"id\", item.id);\n\t\t \t\titemContent[0].className = \"timetable-itemContent \" + item._opts.className;\n\n\t\t \t\tvar self = this;\n\n\t\t\t\titem.element = this.items[item.id] = itemElm;\n\t\t\t\tthis.itemContent[item.id] = itemContent;\n\t\t\t\tthis.itemInstance[item.id] = item;\n\n\t\t\t\t// we need to deduct borders from the item length. We deduct 2 borders if we're not collapsing. One otherwise.\n\t\t\t\titemLength -= border * ((!timetable._opts.collapseItemBorders) + 1);\n\t\t\t\t// size and position\n\n\t\t\t\t// it's possible the itemLength has gone below 0, which it shouldn't\n\t\t\t\tif (itemLength < 0) {\n\t\t\t\t\titemLength = 0;\n\t\t\t\t}\n\n\t\t\t\titemElm.css(vocab.pos, itemPos)\n\t\t\t\t\t.css(vocab.length, itemLength);\n\n\t\t\t\t// add content\n\t\t \t\titemElm.append(itemContent);\n\t\t\t\t// return container\n\t\t\t\treturn itemElm;\n\t\t\t}", "addItems(predicate){\n\n\t\tlet sentences = predicate.split(\",\");\n\t\tsentences.forEach((sentence)=>{\n\t\t\tlet items = sentence.trim().split(\" \");\n\t\t\tlet amount = items[0];\n\t\t\tlet itemType = items[1].replace(/s$/, '');\n\t\t\tfor(let i = 0; i < amount; i++){\n\t\t\t\tthis.addItem(new Items[itemType]);\n\t\t\t}\n\t\t}, this);\n\n\t}", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function create(items, isIncomplete) {\r\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\r\n }", "function addItem() {\n\tvar msgFrame = document.querySelector(\"div#msg\");\n\tvar msg = msgFrame.getElementsByTagName(\"ul\");\n\tif (msg.length > 0) {\n\t\tmsgFrame.removeChild(msg[0]);\n\t}\n\tmsg = document.createElement(\"ul\");\n\tmsgFrame.appendChild(msg);\n\tmsg.style.display = \"none\";\n\tvar msgItems = msg.childNodes;\n\tfor (var i = 0; i < msgItems.length; i++) {\n\t\tmsg.removeChild(msgItems[i]);\n\t}\n\tvar newItem = itemFactory();\n\tvar valid = true;\n\tvar name = document.getElementById(\"iname\").value;\n\tif (name.length < 1) {\n\t\tvar nMsg = document.createElement(\"li\");\n\t\tnMsg.innerHTML = \"Please specify a name for the item.\";\n\t\tmsg.appendChild(nMsg);\n\t\tvalid = false;\n\t} else {\n\t\tnewItem.name = name;\n\t}\n\tvar type = document.getElementById(\"itype\").value;\n\tif (type.length < 1) {\n\t\tvar tMsg = document.createElement(\"li\");\n\t\ttMsg.innerHTML = \"Please specify a type for the item\";\n\t\tvalid = false;\n\t} else if (/ /.test(type)) {\n\t\tvar tMsg = document.createElement(\"li\"); tMsg = \"Please specify a type for the item\";\n\t\ttMsg.innerHTML = \"The value for type must not contain any white spaces.\";\n\t} else if (type === \"types\") {\n\t\tvar tMsg = document.createElement(\"li\"); \n\t\ttMsg.innerHTML = \"The keyword \\\"types\\\" is reserved and may not be used for as type.\";\n\t\tvalid = false;\n\t} else {\n\t\tnewItem.type = type;\n\t}\n\tif (tMsg) {\n\t\tmsg.appendChild(tMsg);\n\t}\n\tif (baseItems.get(type, name) !== undefined || optionalItems.get(type, name) !== undefined) {\n\t\tvar stMsg = document.createElement(\"li\");\n\t\tstMsg.innerHTML = \"An item of the same type and name already exists.\";\n\t\tmsg.appendChild(stMsg);\n\t\tvalid = false;\n\t} \n\tif (document.getElementById(\"ibase\").checked) {\n\t\tnewItem.isBase = true;\n\t} else {\n\t\tnewItem.isBase = false;\n\t}\n\tvar numberFields = document.querySelectorAll('form#newitem input[type=\"number\"]');\n\tfor (var i = 0; i < numberFields.length; i++) {\n\t\tif (numberFields[i].value.length < 1 || isNaN(numberFields[i].value) || numberFields[i].value < 0) {\n\t\t\tvar numMsg = document.createElement(\"li\");\n\t\t\tnumMsg.innerHTML = \"Value in the field for \" + numberFields[i].name + \" Must be a positive number.\";\n\t\t\tmsg.appendChild(numMsg);\n\t\t\tvalid = false;\n\t\t} else {\n\t\t\tnewItem[numberFields[i].name] = Number(numberFields[i].value);\n\t\t}\n\t}\n\tvar created;\n\tif (valid && newItem.isValidInventory()) {\n\t\tif (newItem.isBase) {\n\t\t\tcreated = baseItems.add(newItem);\n\t\t} else {\n\t\t\tcreated = optionalItems.add(newItem)\n\t\t}\n\t}\n\tif (created) {\n\t\tvar successMsg = document.createElement(\"li\");\n\t\tsuccessMsg.innerHTML = \"Item successfully added!\";\n\t\tmsg.append(successMsg);\n\t\tsyncToStorage();\n\t\tdocument.getElementById(\"newitem\").reset();\n\t\tdocument.querySelector(\"form#newitem input\").focus();\n\t\tpopulateInventory();\n\t}\n\tmsg.style.display = \"block\";\n}", "function addItem(type, id, text, value) {\n\n // Value with Curency Format\n let amount = usd(value);\n\n // Assign to different containers based on type\n if (type === 'inc') {\n element = \".income__list\";\n html = `<div class=\"item clearfix\" id=\"income-${id}\"> \n <div class=\"item__description\">${text}</div>\n <div class=\"right clearfix\"><div class=\"item__value\">+ ${amount}</div>\n <div class=\"item__delete\"><button class=\"item__delete--btn\"><i class=\"ion-ios-close-outline\"></i></button></div></div>\n </div>`;\n } else if (type === 'exp') {\n // Calculate value percentage\n let perc = Math.round( ( value / budget ) * 100 );\n element = \".expenses__list\";\n html = `<div class=\"item clearfix\" id=\"expense-${id}\">\n <div class=\"item__description\">${text}</div>\n <div class=\"right clearfix\"><div class=\"item__value\">- ${amount}</div>\n <div class=\"item__percentage\">${perc}%</div>\n <div class=\"item__delete\"><button class=\"item__delete--btn\"><i class=\"ion-ios-close-outline\"></i></button></div></div>\n </div>`;\n }\n document.querySelector(element).insertAdjacentHTML('beforeend', html);\n\n}", "function createNewUpsaleItem(item ,price) {\n\t\t\t\tvar new_portion_li = document.createElement(\"li\");\n\t\t\t\tnew_portion_li.className = \"food_item_info_li substitutions_and_extras\";\n\t\t\t\tnew_portion_li.innerHTML = '<span class=\"food_item_info_span_L substitutions_and_extras\">'+\n\t\t\t\t\t\t\t\t\t\t\t\tenterHtml(item)+\n\t\t\t\t\t\t\t\t\t\t '</span>'+\n\t\t\t\t \t\t\t '<span class=\"food_item_info_span_R substitutions_and_extras\">'+\n\t\t\t\t \t\t\t \t\tenterHtml(price)+\n\t\t\t\t \t\t\t \t'</span>';\n\t\t\t\t \n\t\t\t\treturn new_portion_li;\n\t\t\t}", "function populateItemList(type) {\n let item_list = document.getElementById(type+\"-items\");\n for (const item of itemLists.get(type)) {\n let item_obj = itemMap.get(item);\n if (item_obj[\"restrict\"] && item_obj[\"restrict\"] === \"DEPRECATED\") {\n continue;\n }\n let el = document.createElement(\"option\");\n el.value = item;\n item_list.appendChild(el);\n }\n}", "function create(items, isIncomplete) {\n return { items: items ? items : [], isIncomplete: !!isIncomplete };\n }", "function createEntry(itemText) {\n\tconsole.log(\"Creating item '\" + itemText + \"'...\");\n\tvar entry = handle + checkYes;\n\tentry += '<div class=\"item-display unchecked\">' + itemText + '</div>';\n\tentry += editBox + edit + delButton;\n\t$('<li class=\"item-box\"></div>').appendTo('.item-list').html(entry);\n}", "function liCreator(itemText, itemID, toDoStatus, classArray=[]) \n{\n\tlet list;\t\n\tlet newToDoItem = document.createElement(\"li\");\n\tlet liTextContainer = document.createElement(\"span\");\n\n\tliTextContainer.textContent = itemText;\n\tnewToDoItem.appendChild(liTextContainer);\n\n\tfor(let i = 0; i < classArray.length; i++) {\n\t\tnewToDoItem.classList.add(classArray[i]);\n\t}\n\tnewToDoItem.setAttribute(\"id\", itemID);\n\n\n\tif(toDoStatus === \"In Progress\")\n\t{\n\n\t\tnewToDoItem.classList.add(\"to-do-list-item\");\n\t\tlist = document.querySelector(\"#toDoUL\");\n\t\tlist.appendChild(newToDoItem);\n\t\tcheckboxCreator(itemID);\n\t}\n\telse\n\t{\n\t\tnewToDoItem.classList.add(\"done-list-item\");\n\t\tlist = document.querySelector(\"#doneUL\");\n\t\tlist.appendChild(newToDoItem);\n\t}\n}", "function listButton(type) {\n for (let i = 0; i < listItem.length; i++) {\n listItem[i].appendChild(type);\n }\n }", "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function createGenericItem(item) {\n var output = \"\";\n\n // create the output\n output += \"<tr><td style='width: 200px;'><span onmouseover=\\'showToolTip(\\\"\";\n output += \"<b>\" + item.name + \"</b><br>\" + item.description;\n output += \"\\\");\\' onmouseout=\\\"hideToolTip()\\\" onclick=\\\"removeToolTip();\\\" \";\n output += \"style=\\\"cursor: pointer; width: 200px; display: inline-block; \";\n output += \"font-size: 12px; line-height: 160%\\\">\";\n output += item.name + \"</span></td>\";\n output += \"<td style='width: 300px;'>x\" + item.quantity + \"</td></tr>\";\n \n return output;\n}", "function createHTMLString(item) {\r\n return `\r\n <li class=\"item\">\r\n <img src=\"${item.image}\" alt=\"${item.type}\" class=\"item__thumbnnail\">\r\n <span class=\"item__desctiption\">${item.gender}, ${item.size}</span>\r\n </li>\r\n `;\r\n}", "createItem(id, props) {\n // Create a Section or a generic ComponentController?\n const Constructor = (props.type === \"Component\" ? ComponentController : Section);\n const item = new Constructor({\n id,\n projectId: project.projectId,\n account: project.account,\n ...props,\n });\n\n // Set generic ComponentControllers.parent dynamically.\n // This makes loading/etc work.\n if (Constructor === ComponentController) {\n Object.defineProperties(item, {\n parent: {\n get: () => project.account.getProject(project.projectId)\n }\n });\n }\n\n return item;\n }", "function addItem(itemType){\n console.log($(itemType).attr(\"class\"));\n switch($(itemType).attr(\"class\")){\n case \"add-section\":\n var template = $(\"#education-template\").html();\n console.log(\"adding a new section...education\");\n console.log($(itemType).parent().parent());\n $(itemType).parent().parent().before(template);\n break;\n case \"add-something-else\":\n // code block\n break;\n default:\n console.log(\"we've added an invalid class\");\n }\n // var temp = document.getElementsByTagName(\"template\")[0];\n // var clon = temp.content.cloneNode(true);\n // document.body.appendChild(clon);\n\n}", "renderItem(item) { return item; }", "addItem (count, unit, ingredient) {\n const item = {\n id: uniqid(),\n count,\n unit,\n ingredient\n }\n this.items.push(item);\n\n //persist data in local storage\n this.persistData();\n\n return item;\n }", "function createListItem(item) {\n text += '<li>' + item + '</li>\\n';\n}" ]
[ "0.7197482", "0.7146529", "0.68308496", "0.67928225", "0.6587072", "0.653712", "0.6481185", "0.64514804", "0.64091825", "0.6336129", "0.6305419", "0.6256475", "0.62311375", "0.6228659", "0.6220129", "0.62082875", "0.6174438", "0.6171067", "0.6159202", "0.61288214", "0.611361", "0.60945046", "0.60558325", "0.6036215", "0.6023502", "0.602184", "0.5991857", "0.5986061", "0.5973766", "0.59504986", "0.5929564", "0.592448", "0.59055305", "0.5895305", "0.5889004", "0.5850541", "0.58498263", "0.5840884", "0.5810916", "0.5808034", "0.5803118", "0.5795265", "0.5778171", "0.5778171", "0.5769237", "0.5765356", "0.5764955", "0.57642275", "0.5749487", "0.5748791", "0.57381254", "0.57373077", "0.5717284", "0.57025814", "0.5698658", "0.56916136", "0.56799006", "0.56793255", "0.5674813", "0.56654924", "0.5645452", "0.5644872", "0.5644872", "0.5644872", "0.5644872", "0.56310785", "0.56263846", "0.56242496", "0.5620293", "0.5613786", "0.56118083", "0.5604168", "0.5604168", "0.5604168", "0.55973274", "0.55973274", "0.55866414", "0.558485", "0.55840296", "0.5577135", "0.5577135", "0.5577135", "0.5577135", "0.55714786", "0.5566642", "0.55616695", "0.5557118", "0.55567384", "0.5537525", "0.55374134", "0.5529837", "0.5523376", "0.5523376", "0.5523376", "0.55155206", "0.5513556", "0.55052304", "0.55040324", "0.55011064", "0.54948324", "0.54879194" ]
0.0
-1
add a request promise property to the object
getAppointments() { return rp(`${BASE_URL}/appointments`); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }", "function PromiseRequest() {\n superagent.Request.apply(this, arguments);\n }", "function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}", "promise({ payload, request }) {\n return request.update(payload)\n }", "function wrapRequest(request) {\n return new __WEBPACK_IMPORTED_MODULE_2__persistence_promise__[\"a\" /* PersistencePromise */](function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\n return new __WEBPACK_IMPORTED_MODULE_2__persistence_promise__[\"a\" /* PersistencePromise */](function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\n return new __WEBPACK_IMPORTED_MODULE_2__persistence_promise__[\"a\" /* PersistencePromise */](function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n resolve(result);\r\n };\r\n request.onerror = function (event) {\r\n reject(event.target.error);\r\n };\r\n });\r\n}", "promise({ payload, request }) {\n return request.create({ data: payload })\n }", "_cartRequest(path, options, method, prop) {\n // Return a promisse\n return new RSVP.Promise((resolve, reject) => {\n Store.fetch(path, assign(this._requestProperties, options), method).then((res) => {\n // Store the order number\n if( res.order.real )\n this._number = res.order.number;\n\n // Store the token\n this._token = res.order.number;\n\n // Send it to the public Promise\n if( prop !== undefined )\n resolve(res[prop]);\n else\n resolve(res);\n }).catch(reject);\n });\n }", "function wrapRequest(request) {\n return new PersistencePromise(function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\n return new PersistencePromise(function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\n return new PersistencePromise(function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function wrapRequest(request) {\n return new PersistencePromise(function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n\n request.onerror = function (event) {\n reject(event.target.error);\n };\n });\n}", "function asyncifyRequest (request)\n {\n return new Promise((res, rej) => {\n request.onsuccess = () => res(request.result);\n request.onerror = () => rej(request.error);\n });\n }", "requestObject(request) {\n return request; \n }", "function wrapRequest(request) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n resolve(result);\r\n };\r\n request.onerror = function (event) {\r\n var error = checkForAndReportiOSError(event.target.error);\r\n reject(error);\r\n };\r\n });\r\n}", "function wrapRequest(request) {\r\n return new PersistencePromise(function (resolve, reject) {\r\n request.onsuccess = function (event) {\r\n var result = event.target.result;\r\n resolve(result);\r\n };\r\n request.onerror = function (event) {\r\n var error = checkForAndReportiOSError(event.target.error);\r\n reject(error);\r\n };\r\n });\r\n}", "deferred() {\n const struct = {}\n struct.promise = new MyPromise((resolve, reject) => {\n struct.resolve = resolve\n struct.reject = reject\n })\n return struct\n }", "then(onFulfilled, onRejected, label) {\n const child = super.then(onFulfilled, onRejected, label);\n child.xhr = this.xhr;\n return child;\n }", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function promisify(request) {\r\n return new Promise(function (resolve, reject) {\r\n request.onsuccess = function () {\r\n resolve(request.result);\r\n };\r\n request.onerror = function () {\r\n reject(request.error);\r\n };\r\n });\r\n}", "function makePromiseRequest(request, route, arg) {\n var args = [route];\n var i = 1;\n // the number of arguments depends on the type of the request (only for POST and PUT)\n if (arg !== undefined) {\n args[1] = arg\n i++;\n }\n return new Promise(resolve => {\n args[i] = (err, req, res, result) => {\n resolve(result);\n };\n request.apply(client, args);\n });\n}", "function wrapRequest(request) {\n return new PersistencePromise(function (resolve, reject) {\n request.onsuccess = function (event) {\n var result = event.target.result;\n resolve(result);\n };\n\n request.onerror = function (event) {\n var error = checkForAndReportiOSError(event.target.error);\n reject(error);\n };\n });\n } // Guard so we only report the error once.", "function r(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "constructor() {\n this._requests = {};\n }", "get request() { return this._request; }", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "function promisify(request) {\n return new Promise(function (resolve, reject) {\n request.onsuccess = function () {\n resolve(request.result);\n };\n request.onerror = function () {\n reject(request.error);\n };\n });\n}", "enableAsyncRequest() {\n this._asyncRequest = true;\n }", "constructor() {\n this.promise = Promise.resolve();\n this.queued = 0;\n this.complete = 0;\n }", "function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n }", "constructor() {\n this.promise = new Promise((resolve, reject) => {\n this.resolve = resolve;\n this.reject = reject;\n });\n }", "trackRequestPromise(handle, promise) {\n this.startRequest(handle);\n promise.then(() => this.endRequest(handle)).catch(() => this.endRequest(handle));\n }", "trackRequestPromise(handle, promise) {\n this.startRequest(handle);\n promise.then(() => this.endRequest(handle)).catch(() => this.endRequest(handle));\n }", "function wrap(superagent, Promise) {\n\t /**\n\t * Request object similar to superagent.Request, but with end() returning\n\t * a promise.\n\t */\n\t function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }\n\n\t // Inherit form superagent.Request\n\t PromiseRequest.prototype = Object.create(superagent.Request.prototype);\n\n\t /** Send request and get a promise that `end` was emitted */\n\t PromiseRequest.prototype.end = function (cb) {\n\t var _end = superagent.Request.prototype.end;\n\t var self = this;\n\n\t return new Promise(function (accept, reject) {\n\t _end.call(self, function (err, response) {\n\t if (cb) {\n\t cb(err, response);\n\t }\n\n\t if (err) {\n\t err.response = response;\n\t reject(err);\n\t } else {\n\t accept(response);\n\t }\n\t });\n\t });\n\t };\n\n\t /** Provide a more promise-y interface */\n\t PromiseRequest.prototype.then = function (resolve, reject) {\n\t var _end = superagent.Request.prototype.end;\n\t var self = this;\n\n\t return new Promise(function (accept, reject) {\n\t _end.call(self, function (err, response) {\n\t if (err) {\n\t err.response = response;\n\t reject(err);\n\t } else {\n\t accept(response);\n\t }\n\t });\n\t }).then(resolve, reject);\n\t };\n\n\t /**\n\t * Request builder with same interface as superagent.\n\t * It is convenient to import this as `request` in place of superagent.\n\t */\n\t var request = function request(method, url) {\n\t return new PromiseRequest(method, url);\n\t };\n\n\t /** Helper for making an options request */\n\t request.options = function (url) {\n\t return request('OPTIONS', url);\n\t };\n\n\t /** Helper for making a head request */\n\t request.head = function (url, data) {\n\t var req = request('HEAD', url);\n\t if (data) {\n\t req.send(data);\n\t }\n\t return req;\n\t };\n\n\t /** Helper for making a get request */\n\t request.get = function (url, data) {\n\t var req = request('GET', url);\n\t if (data) {\n\t req.query(data);\n\t }\n\t return req;\n\t };\n\n\t /** Helper for making a post request */\n\t request.post = function (url, data) {\n\t var req = request('POST', url);\n\t if (data) {\n\t req.send(data);\n\t }\n\t return req;\n\t };\n\n\t /** Helper for making a put request */\n\t request.put = function (url, data) {\n\t var req = request('PUT', url);\n\t if (data) {\n\t req.send(data);\n\t }\n\t return req;\n\t };\n\n\t /** Helper for making a patch request */\n\t request.patch = function (url, data) {\n\t var req = request('PATCH', url);\n\t if (data) {\n\t req.send(data);\n\t }\n\t return req;\n\t };\n\n\t /** Helper for making a delete request */\n\t request.del = function (url) {\n\t return request('DELETE', url);\n\t };\n\n\t // Export the request builder\n\t return request;\n\t}", "function addMethod(method) {\n\t\tPromise.prototype[method] = function () {\n\t\t\tvar args = slice.call(arguments);\n\t\t\treturn this.then(function (object) {\n\t\t\t\tvar fn = object[method];\n\t\t\t\tif (typeof object[method] === 'function')\n\t\t\t\t\tvar result = fn.apply(object, args);\n\t\t\t\treturn result !== undefined ? result : object;\n\t\t\t});\n\t\t};\n\t}", "get promise() {\n return this.deferred.promise;\n }", "function PromiseDelegate() {\n var _this = this;\n this._promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n _this._reject = reject;\n });\n }", "function promisifyRequest(request) {\n return new Promise((resolve, reject) => {\n // @ts-ignore - file size hacks\n request.oncomplete = request.onsuccess = () => resolve(request.result);\n // @ts-ignore - file size hacks\n request.onabort = request.onerror = () => reject(request.error);\n });\n}", "get request() {\n return this._request;\n }", "function PromiseDelegate() {\r\n var _this = this;\r\n this.promise = new Promise(function (resolve, reject) {\r\n _this._resolve = resolve;\r\n _this._reject = reject;\r\n });\r\n }", "function PromiseDelegate() {\n var _this = this;\n this.promise = new Promise(function (resolve, reject) {\n _this._resolve = resolve;\n _this._reject = reject;\n });\n }", "function Promise() {\n this._thens = [];\n }", "function createRequestTask(url, property, component) {\r\n return function(done) {\r\n axios.get(url).then(function(response) {\r\n if(response.data.constructor === Array) {\r\n // case where data is a collection, like for /people\r\n component.setData(response.data)\r\n } else {\r\n component.addDataItem(response.data)\r\n }\r\n done()\r\n }).catch(function() { done() })\r\n //ignoring failure; in context it is just a data item not gotten\r\n }\r\n}", "enqueueRequest(url, method, query) {\n return new Promise((resolve, reject) => {\n this.createObjectForQueue(\n {\n \"url\" : url,\n \"method\" : method,\n \"query\" : query || null\n },\n (error, response, data) => {\n if (error) {\n reject(error);\n }\n resolve({response, data})\n }\n )\n });\n }", "Promise(item, options = {}) {\r\n return { ...options, type: 'promise', kind: exports.PromiseKind, item };\r\n }", "addPromise(promise) {\n\t\t\t\tsequences.push(\n\t\t\t\t\tcancellablePromise(promise)\n\t\t\t\t)\n\t\t\t}", "setRequestProperties (req) {\n const uri = this.parseUri(req.url)\n for (const key in uri) {\n req[key] = uri[key]\n }\n }", "_wrapAndRequest(request, resolve, reject) {\n if (this.getAuthToken()) {\n request.set('Authorization', this.getAuthToken());\n }\n request.end(function (err, result) {\n if (err) {\n reject({status: err.status, result: (result) ? result.body : null});\n } else {\n resolve(result.body);\n }\n });\n }", "setRequestPropertyOnWebViewNode (request) {\n Object.defineProperty(this.webviewNode, 'request', {\n value: request,\n enumerable: true\n })\n }", "function Promise() {\n}", "function Def(){this.promise=new Promise((function(a,b){this.resolve=a,this.reject=b}).bind(this))}", "request(url, options) {\n const hash = this.options(url, options);\n const internalPromise = this._makeRequest(hash);\n const ajaxPromise = new _promise.default((resolve, reject) => {\n internalPromise.then(({ response }) => {\n resolve(response);\n }).catch(({ response }) => {\n reject(response);\n });\n }, `ember-ajax: ${hash.type} ${hash.url} response`);\n ajaxPromise.xhr = internalPromise.xhr;\n return ajaxPromise;\n }", "_createExtendedPromise(promise, callsite) {\n const extendedPromise = promise.then(lodash_1.identity);\n const observedCallsites = this.testRun.observedCallsites;\n const markCallsiteAwaited = () => observedCallsites.callsitesWithoutAwait.delete(callsite);\n extendedPromise.then = function () {\n markCallsiteAwaited();\n return originalThen.apply(this, arguments);\n };\n (0, delegated_api_1.delegateAPI)(extendedPromise, TestController.API_LIST, {\n handler: this,\n proxyMethod: markCallsiteAwaited,\n });\n return extendedPromise;\n }", "function Promise()\n{\n\tthis.listeners = [];\n}", "function Promise(fn) {\n this.call_in = fn;\n }", "addResponse( result ) {\n\n const save = Object.assign( {}, result );\n this.responses.set( save.url, save );\n return Promise.resolve();\n\n }", "function makePromise(tgt) {\n return new Ember.RSVP.Promise(function (resolve) {\n resolve(tgt);\n });\n }", "_request(resource) {\n let fqdn = this.DOMAIN + resource;\n\n return axios.get(fqdn)\n .then(req => {\n return req.data;\n })\n }", "constructor(request) {\n this.request = request;\n }", "sendRequest(request) {\n return new Promise(function (fulfill, reject) {\n var reqGuid = Guid.create();\n // If we are using sockets, we emit on the 'request' topic, and wrap\n // the request in an object withe guid and payload\n var reqObj = {\n guid: reqGuid.value,\n payload: request\n };\n\n // Set out the timeout\n var timeoutToken = setTimeout(function() {\n reject({\n guid: reqGuid.value,\n payload: {\n reason: 'Request timed out'\n }\n });\n }, TIMEOUT_DURATION);\n\n // Register the callback function\n this.requestCallbacks[reqGuid.value] = function(response) {\n if (timeoutToken) {\n clearTimeout(timeoutToken);\n timeoutToken = undefined;\n }\n\n if (response.success) {\n fulfill({\n guid: response.guid,\n payload: response.payload\n });\n }\n else {\n reject({\n guid: response.guid,\n payload: response.payload\n });\n }\n };\n\n if (this.socket) {\n this.socket.emit('request', reqObj);\n }\n else {\n console.error('Socket not ready');\n }\n\n }.bind(this));\n }", "function updatePromo() { }", "function Promise(then) {\n\t\tthis.then = then;\n\t}", "function Promise(then) {\n\t\tthis.then = then;\n\t}", "function createPromisefunction(event, item) {\r\n return function (resolve, reject) {\r\n // Message to set the storage\r\n var deferredHash = randomHash(),\r\n message = JSON.stringify({\r\n 'event': event,\r\n 'storageKey': storageKey,\r\n 'deferredHash': deferredHash,\r\n 'item': item\r\n });\r\n // Set the deferred object reference\r\n deferredObject[deferredHash] = {\r\n resolve: resolve,\r\n reject: reject\r\n };\r\n // Send the message and target URI\r\n //proxyWindowObject.postMessage(message, '*');\r\n if (usePostMessage) {\r\n // Post the message as JSON\r\n proxyWindowObject.postMessage(message, '*');\r\n } else {\r\n // postMessage not available so set hash\r\n if (iframe !== null) {\r\n // Cache bust messages with the same info\r\n cacheBust += 1;\r\n message.cacheBust = ((+new Date()) + cacheBust);\r\n hash = '#' + JSON.stringify(message);\r\n if (iframe.src) {\r\n iframe.src = proxyDomain + proxyPage + hash;\r\n } else if (iframe.contentWindow !== null && iframe.contentWindow.location !== null) {\r\n iframe.contentWindow.location = proxyDomain + proxyPage + hash;\r\n } else {\r\n iframe.setAttribute('src', proxyDomain + proxyPage + hash);\r\n }\r\n }\r\n }\r\n };\r\n }", "constructor (promise /* : Promise */) {\n this.then = function (onFulfilled/* : Function */, onRejected /* : Function */) /* : Thenable */ {\n const Promise = require('./promise')\n const next = new Promise()\n\n promise.chain.push({\n onFulfilled,\n onRejected,\n promise: next\n })\n\n return next.thenable\n }\n }", "function promiseRequest(params) {\n console.log(params.url);\n return new Promise((resolve, reject) => {\n request(params, function (err, data) {\n if(err) {\n reject(err);\n } else {\n resolve(data);\n }\n })\n });\n}", "get request() {\n return this._request;\n }", "function promiseOf(type) {\n var self = getInstance(this, promiseOf);\n self.type = type;\n return self;\n}", "_request(request) {\n return request\n .set('X-Parse-Application-Id', this.applicationId)\n .set('X-Parse-Master-Key', this.masterKey)\n .set('Accept', 'application/json');\n }", "function requestObject(iUrl, iMethod, iAsync, iType)\r\n{\r\n\tthis.url = iUrl;\r\n\tthis.method = iMethod;\r\n\tthis.async = iAsync;\r\n\tthis.type = iType;\r\n}", "init() {\n module_utils.patchModule(\n 'aws-sdk',\n 'send',\n AWSSDKWrapper,\n AWSmod => AWSmod.Request.prototype\n );\n module_utils.patchModule(\n 'aws-sdk',\n 'promise',\n AWSSDKWrapper,\n AWSmod => AWSmod.Request.prototype\n );\n\n // This method is static - not in prototype\n module_utils.patchModule(\n 'aws-sdk',\n 'addPromisesToClass',\n wrapPromiseOnAdd,\n AWSmod => AWSmod.Request\n );\n }", "_startRequest() {\n if (this._timeoutID !== undefined)\n clearTimeout(this._timeoutID);\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this.isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,)max-age=([0-9]+)($|,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this.isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n });\n }", "function new_promise() {\n var resolve, promise = new Promise((res, rej)=>{resolve = res;});\n return [promise, resolve];\n }", "function getRequestObject() {\n \n httpRequest = new XMLHttpRequest();\n return httpRequest;\n}", "request( method, endpoint, query = true, data = {}, loading = this.loading ) { \n\n // Validate the endpoint.\n if( this.utils().validate(method, endpoint) ) {\n\n // Save the endpoint and method.\n this.method = method;\n this.endpoint = endpoint;\n\n // Start loading.\n if( loading ) event.trigger('loading', true);\n \n // Generate a unique ID for the request.\n const pid = this.utils().pid();\n\n // Send the request.\n const request = $.ajax({\n dataType: 'json',\n url: this.utils().url(pid, query),\n method: method,\n data: data,\n context: this,\n cache: false\n }).always((response) => {\n \n // Capture response data.\n if( response.hasOwnProperty('paging') ) {\n \n const paging = {increments: this.paging.increments};\n \n this.$set(this, 'paging', $.extend(true, {}, paging, response.paging));\n \n }\n if( response.hasOwnProperty('filter') ) {\n \n this.$set(this, 'filter', $.extend(true, {}, response.filter));\n \n }\n if( response.hasOwnProperty('sort') ) {\n \n this.$set(this, 'sort', $.extend(true, {}, response.sort));\n \n }\n if( response.hasOwnProperty('index') ) {\n \n this.$set(this, 'indexing', $.extend(true, {}, response.index.data));\n this.index.order = response.index.order;\n \n }\n \n // Add the query string to the response data.\n response.query = query ? this.utils().query() : {};\n \n // End the loading animation.\n if( loading ) setTimeout(() => {\n \n event.trigger('loading', false);\n \n }, 250);\n\n });\n\n // Poll for request progress.\n this.progress(pid);\n \n // Return the request.\n return request;\n\n }\n\n }", "function adaptFetchPromise(promise) {\n\t\t\tvar adaptedPromise = Object.create(promise);\n\n\t\t\tadaptedPromise.success = function (fn) {\n\t\t\t\tpromise.success(function (data, status, headers, options) {\n\t\t\t\t\tfn(data, status);\n\t\t\t\t});\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\tadaptedPromise.error = function (fn) {\n\t\t\t\tpromise.error(function (data, status, headers, options) {\n\t\t\t\t\tfn(status);\n\t\t\t\t});\n\t\t\t\treturn this;\n\t\t\t};\n\n\t\t\treturn adaptedPromise;\n\t\t}", "addRequest(state, payload) {\n state.requests.push(payload);\n }", "get request() {\n\t\treturn this.__request;\n\t}", "get request () {\n\t\treturn this._request;\n\t}", "get request () {\n\t\treturn this._request;\n\t}", "makeRequest(opts, callback) {\n this.requestQueue.push(opts, callback);\n }", "function NotifyPolicyRequest(policy, deferred) {\n this.policy = policy;\n this.deferred = deferred;\n}", "_addHeaders(request) {\n request.headers = new Headers(this.headers);\n return request;\n }", "promiseParams() {\n return {};\n }", "function requestPromise(urlAddress) {\n //return promise\n return new Promise(function (resolve, reject) {\n var xhr = new XMLHttpRequest()\n xhr.open('GET', urlAddress)\n xhr.send(null)\n\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {//pronto\n if (xhr.status === 200) {//status 200 == OK\n const objet = JSON.parse(xhr.responseText)\n resolve(objet)\n } else {\n reject('Error on request')\n }\n }\n }\n })\n}", "function usePromise(PromiseConstructor) {\n nativePromise = PromiseConstructor;\n}", "signRequest(webResource) {\n if (!webResource) {\n return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type \"object\".`));\n }\n if (this.inHeader) {\n if (!webResource.headers) {\n webResource.headers = new HttpHeaders();\n }\n for (const headerName in this.inHeader) {\n webResource.headers.set(headerName, this.inHeader[headerName]);\n }\n }\n if (this.inQuery) {\n if (!webResource.url) {\n return Promise.reject(new Error(`url cannot be null in the request object.`));\n }\n if (webResource.url.indexOf(\"?\") < 0) {\n webResource.url += \"?\";\n }\n for (const key in this.inQuery) {\n if (!webResource.url.endsWith(\"?\")) {\n webResource.url += \"&\";\n }\n webResource.url += `${key}=${this.inQuery[key]}`;\n }\n }\n return Promise.resolve(webResource);\n }", "signRequest(webResource) {\n if (!webResource) {\n return Promise.reject(new Error(`webResource cannot be null or undefined and must be of type \"object\".`));\n }\n if (this.inHeader) {\n if (!webResource.headers) {\n webResource.headers = new HttpHeaders();\n }\n for (const headerName in this.inHeader) {\n webResource.headers.set(headerName, this.inHeader[headerName]);\n }\n }\n if (this.inQuery) {\n if (!webResource.url) {\n return Promise.reject(new Error(`url cannot be null in the request object.`));\n }\n if (webResource.url.indexOf(\"?\") < 0) {\n webResource.url += \"?\";\n }\n for (const key in this.inQuery) {\n if (!webResource.url.endsWith(\"?\")) {\n webResource.url += \"&\";\n }\n webResource.url += `${key}=${this.inQuery[key]}`;\n }\n }\n return Promise.resolve(webResource);\n }", "function Promise() {\n this._status = Promise.PENDING;\n this._value = undefined;\n this._onSuccessHandlers = [];\n this._onErrorHandlers = [];\n\n // Debugging help\n this._id = Promise._nextId++;\n Promise._outstanding[this._id] = this;\n}", "push (promise) {\n let self = this\n self.pending += 1\n return promise.then((data) => {\n self.values.push(data)\n self.end(1)\n })\n .catch((err) => {\n self.errors.push(err)\n self.end(1)\n })\n }", "async prepareRequest(httpRequest) {\n const requestInit = {};\n // Set the http(s) agent\n requestInit.agent = this.getOrCreateAgent(httpRequest);\n requestInit.compress = httpRequest.decompressResponse;\n return requestInit;\n }", "async function makerequest() {\r\n \r\n}", "function request1() {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve ({\n data: 'Data',\n makeAnotherRequest: true\n }), 2000);\n });\n }", "requestDidStart () { //to use put as argument -> requestContext\n // console.log('Request started! Query:\\n');\n // console.log(requestContext.request)\n return {\n didEncounterErrors (rc) {\n console.log(rc.errors);\n },\n\n };\n }", "function _createRequestFacade(request, loadEndCallback) {\n var loaded = 0;\n var total = 0;\n var responseHeaders = {};\n var status = 0;\n var response = null;\n var error = null;\n\n function _getCurrentProgress() {\n // posiiton and totalSize are aliases for FF\n // found here: http://www.opensource.apple.com/source/WebCore/WebCore-1298/xml/XMLHttpRequestProgressEvent.h\n return {\n loaded: loaded,\n total: total,\n position: loaded,\n totalSize: total\n };\n }\n\n return {\n url: request.url,\n origin: request.origin,\n requestHeaders: request.headers,\n data: request.data,\n getResponse: function getResponse() {\n return {\n loaded: loaded,\n total: total,\n headers: responseHeaders,\n status: status,\n response: response,\n error: error\n };\n },\n sendHeaders: function sendHeaders(_responseHeaders_) {\n responseHeaders = mapValues(_responseHeaders_, function (value) {\n if (!Array.isArray(value)) {\n return value.split(',').map(function (header) {\n return header.trim();\n });\n } else {\n return value;\n }\n });\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onheaders(responseHeaders);\n\n resolve();\n });\n } else {\n request.onheaders(responseHeaders);\n\n resolve();\n }\n });\n },\n sendProgress: function sendProgress(_loaded_) {\n loaded = _loaded_;\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onprogress(_getCurrentProgress());\n\n resolve();\n });\n } else {\n request.onprogress(_getCurrentProgress());\n\n resolve();\n }\n });\n },\n sendResponse: function sendResponse(_status_, _response_) {\n status = _status_;\n response = _response_ + '';\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onresponse(status, response);\n\n resolve();\n });\n } else {\n request.onresponse(status, response);\n\n resolve();\n }\n }).then(loadEndCallback);\n },\n sendError: function sendError(_error_) {\n error = _error_;\n\n return new Promise(function (resolve) {\n if (request.async) {\n queuedRandomAsync(function () {\n request.onerror(error, _getCurrentProgress());\n\n resolve();\n });\n } else {\n request.onerror(error, _getCurrentProgress());\n\n resolve();\n }\n }).then(loadEndCallback);\n }\n };\n}", "function createLiftedPromise(value) {\n const promise = Promise.resolve(value);\n Object.assign(promise, value);\n return promise;\n}", "function Passed(promise) {\n this.promise = promise;\n}" ]
[ "0.65106565", "0.64869684", "0.6383279", "0.6112009", "0.603034", "0.603034", "0.603034", "0.6021356", "0.60123956", "0.59619546", "0.59558696", "0.59558696", "0.59558696", "0.5939239", "0.5891431", "0.5884499", "0.5836", "0.5836", "0.58249813", "0.5726395", "0.5718238", "0.5718238", "0.5718238", "0.5685879", "0.568494", "0.5644874", "0.5635571", "0.56190664", "0.5617069", "0.5616774", "0.5616774", "0.5596542", "0.553901", "0.55257165", "0.5494135", "0.5488965", "0.5488965", "0.5482454", "0.54665315", "0.5461273", "0.54484975", "0.5444474", "0.5429272", "0.54238033", "0.5413251", "0.540567", "0.5384392", "0.53682697", "0.536428", "0.5355122", "0.53175884", "0.53161716", "0.5300853", "0.5291701", "0.52857065", "0.52837783", "0.52784944", "0.52761775", "0.52541703", "0.52512175", "0.5250423", "0.52311605", "0.522172", "0.52064145", "0.5201695", "0.5195192", "0.5195192", "0.5182943", "0.51822424", "0.51697683", "0.5152333", "0.51329577", "0.51139015", "0.51124746", "0.51080614", "0.5107647", "0.5098916", "0.5098632", "0.50978446", "0.5097224", "0.5092961", "0.50849533", "0.50818443", "0.50818443", "0.50817704", "0.50769234", "0.5068582", "0.50597626", "0.50580704", "0.504785", "0.5033484", "0.5033484", "0.5030064", "0.5020662", "0.49672866", "0.49600205", "0.49555537", "0.49505204", "0.49418035", "0.49363422", "0.49245584" ]
0.0
-1
add a request promise property to the object. The id determines the customer that is be queried
getInformationById(id) { let url = `${BASE_URL}/customer_byId/${id}`; console.log("The URL is: ", url); return rp(url); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getRequest(id){\n let dfr = Q.defer();\n Request.findOne({_id: id, status: Data.getRequestStatus().pending})\n .populate({\n path: 'verifyTransactionUser1',\n })\n .populate({\n path: 'user1',\n populate: {path: 'community'},\n select: '_id community email'\n })\n .populate({\n path: 'user2',\n populate: {path: 'community'},\n select: '_id community email'\n })\n .exec(function (err, request) {\n if (err || !request) {\n let msg = err;\n if(!request){\n msg = 'No relevant request found';\n }\n dfr.reject(msg);\n }\n else {\n dfr.resolve(request);\n }\n });\n return dfr.promise;\n}", "getCustomer(id, query) {\n return rp({\n ...this._baseRequest,\n ...{\n qs: query,\n url: `/customers/${id}.json`,\n },\n });\n }", "_cartRequest(path, options, method, prop) {\n // Return a promisse\n return new RSVP.Promise((resolve, reject) => {\n Store.fetch(path, assign(this._requestProperties, options), method).then((res) => {\n // Store the order number\n if( res.order.real )\n this._number = res.order.number;\n\n // Store the token\n this._token = res.order.number;\n\n // Send it to the public Promise\n if( prop !== undefined )\n resolve(res[prop]);\n else\n resolve(res);\n }).catch(reject);\n });\n }", "function getConfirmedRequest(id){\n let dfr = Q.defer();\n //populate transactions in order to cancel them\n Request.findOne({_id: id})\n .populate({\n path: 'transactionUser1',\n })\n .populate({\n path: 'transactionUser2',\n })\n .populate({\n path: 'user1',\n })\n .populate({\n path: 'user2',\n })\n .exec(function (err, request) {\n if (err || !request) {\n let msg = err;\n if(!request){\n msg = 'No relevant request found';\n }\n dfr.reject(msg);\n }\n else {\n dfr.resolve(request);\n }\n });\n return dfr.promise;\n}", "function callAPI(id) {\n const age = 20;\n return new Promise((resolve, reject) => {\n resolve({ id, name: \"Woody\", age })\n });\n}", "promise({ payload, request }) {\n return request.create({ data: payload })\n }", "async addRejUser(id, data) {\n let value = {\n rejectedBy: data\n };\n let response = await axios.patch(`${API_URL}/requests/${id}`, value);\n return response;\n }", "getById(id) {\n return this.get(id).then(response => {\n const item = response.data.data;\n this.setCid(item);\n return item;\n });\n }", "promise({ payload, request }) {\n return request.update(payload)\n }", "async attach(id, request) {\n var _a, _b;\n this.lastPayload = void 0;\n await this.mapper.updateByIdEx(Requests.Attach, id, request, { method: RestDB.Method.POST });\n this.lastPayload = RestDB.Outputer.createFull(Responses.Attach, (_a = this.client.payload) === null || _a === void 0 ? void 0 : _a.subscription, []);\n return (_b = this.lastPayload) === null || _b === void 0 ? void 0 : _b.id;\n }", "function processRequest(id, res) {\n const customer = customers.find(item => item.id === id);\n if (!customer) {\n return res.sendStatus(404);\n }\n return res.json(customer);\n }", "getCustomer(id) {\n this.CustomerService.fetch(id)\n .then(data => {\n });\n }", "async addEndUser(id, data) {\n let value = {\n endorsedBy: data\n };\n let response = await axios.patch(`${API_URL}/requests/${id}`, value);\n return response;\n }", "async getOne(id) {\n let data = {};\n\n\n data.result = await this._getOneResource(id);\n\n data.result = this._mapAttributes(data.result);\n\n\n return data;\n }", "function requestFun(data, id) {\n return new Promise(function(resolve, reject) {\n request(data, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n var airport = [];\n var $ = cheerio.load(body);\n $(\".address-list\")\n .find(\"li\")\n .find(\"p\")\n .each(function(ele) {\n airport.push(\n $(this)\n .text()\n .trim()\n );\n });\n var obj = {\n id,\n airport\n };\n resolve(obj)\n }\n });\n });\n}", "add(id) {\r\n return this.clone(Senders, \"$ref\").postCore({\r\n body: jsS({\r\n \"@odata.id\": id,\r\n }),\r\n });\r\n }", "function load(req, res, next, id) {\n Customer.get(id)\n .then((customer) => {\n req.customer = customer; // eslint-disable-line no-param-reassign\n return next();\n })\n .catch(e => next(e));\n}", "hospitalGetInjured(id) { \n return new Promise((resolve, reject) => {\n Injured.update({'id': id}, \n {$set:{\"InHospital\": true}}, (err) => {\n if (err) reject (err);\n else resolve(` ${id} in hospital`);\n });\n })\n }", "function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }", "function executeCall(id) {\n promises[id] = fetch(`restaurants/${id}`)\n .then(response => {\n if (response instanceof Promise) {\n response.then(() => executeCall(id))\n throw new Error('Unathorized by Token')\n }\n return response\n })\n .then(data => mapData(Object.assign(data, { id })))\n\n return promises[id]\n}", "async approveOrder(id){\n return await fetch(ORDER_API_BASE_URI+\"/approve/\"+id,{\n method:'GET',\n }).then(response =>{\n return response;\n }).catch(reason => {\n return reason;\n })\n }", "function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}", "function crearSolicitud(id) {\n var solicitud = {\n id: id,\n nombre: obtenerValor(nombre),\n descripcion: obtenerValor(descripcion),\n fechaRecibida: obtenerFecha(),\n cliente: obtenerValor(cliente),\n brm: obtenerValor(brm),\n adm: obtenerValor(adm),\n reqObligatorios: obtenerValor(reqObligatorios),\n reqDeseables: obtenerValor(reqDeseables),\n perfil: obtenerValor(perfil),\n ingles: obtenerValor(ingles),\n viajar: obtenerValor(viajar),\n guardias: obtenerValor(guardias),\n consultorasContactadas: obtenerValor(consultorasContactadas),\n estado: obtenerValor(estado)\n };\n\n return solicitud;\n }", "function getUser(id){\n return new Promise((resolve, reject)=>{\n setTimeout(()=>{\n console.log('Readding a user from a database.....');\n resolve({ id: id , gitHubUsername: 'Data'});\n }, 2000);\n }); \n}", "function setCustomerId(id) {\r\n this.customer_id = id;\r\n}", "async getCustomerByID(_data) {\r\n\t\tlet data = {};\r\n\t\tlet customerData = _data.customer_id;\r\n\t\tObject.assign(data, customerData);\r\n\t\treturn customerModel.getCustomerProfile({\r\n\t\t\twhere: { id: _data.customer_id }\r\n\t\t})\r\n\r\n\t\t\t.then(async (customer_result) => {\r\n\t\t\t\tif (customer_result.length >= 1) {\r\n\t\t\t\t\tcustomer_result[0]['total_points'] = await customerModel.get_locked_points({ customer_id: _data.customer_id, total_points: customer_result[0]['total_points'] });\r\n\t\t\t\t\treturn responseMessages.success(\"customer_found\", customer_result);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tthrow new Error(\"customer_not_found\")\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t\t.catch(function (err) {\r\n\t\t\t\tconsole.log(\"Error : \", err)\r\n\t\t\t\t// return failed response to controller\r\n\t\t\t\tlet error = (typeof err.errors != 'undefined') ? err.errors : err.message;\r\n\t\t\t\treturn responseMessages.failed(responseMessages.hasOwnProperty(err.message) ? err.message : \"customer_fetch_error\", error)\r\n\t\t\t});\r\n\r\n\t}", "function addPerson(object) {\n var promise = $http({\n method: 'POST',\n url: '/lovedones-add',\n data: {\n name: object.name,\n weight: object.weight,\n age: object.age,\n userid: object.userid\n }\n }).then(function successfulCallback(response) {\n lovedones = response.data;\n }, function(error) {\n console.log(error);\n });\n return promise;\n }", "function PromiseRequest() {\n superagent.Request.apply(this, arguments);\n }", "requestObject(request) {\n return request; \n }", "fetch( options = {parse: true} ) {\n const req = this.sync(type.GET, this, options);\n\n return new Promise(( resolve, reject )=> {\n req.then(( resp )=> {\n //store our response\n\n let serverAttrs = options.parse ? this.parse(resp.data) : resp.data;\n\n //set id\n this.id = serverAttrs[this.idAttribute] || this[this.idAttribute];\n\n //set the attributes\n assign(this.attributes, serverAttrs);\n\n //resolve with the new attributes\n resolve(this.attributes);\n\n }, ( err )=> {\n reject(err);\n });\n })\n\n }", "async getOrder(request) {\n return new Promise(async (resolve, reject) => {\n try {\n if (request.id) {\n let result = await Order.findOne({\n _id: request.id,\n isDeleted: false,\n user: request.owner\n }).populate(\"payment\").populate([{\n path: 'cart',\n model: 'cart',\n populate: {\n path: 'item',\n model: 'items'\n }\n }]);\n resolve(this.prepareOrderData(result));\n } else {\n let query = {\n isDeleted: false,\n user: request.owner\n };\n if (request.status) {\n query[\"status\"] = request.status;\n }\n const count = await Order.find(query).countDocuments();\n let result = await Order.find(query).sort({_id: -1}).skip(parseInt(request.offset)).limit(parseInt(request.limit)).populate(\"payment\");\n resolve({total: count, records: this.prepareOrdersData(result)})\n }\n } catch (error) {\n log.error(\"OrderService-->getOrder-->\", error);\n reject(errorFactory.dataBaseError(error));\n }\n\n\n });\n }", "async function resolveObject (id) {\n let object\n if (this.validateObject(id)) {\n // already an object\n object = id\n } else {\n object = await this.store.getObject(id)\n if (object) {\n return object\n }\n // resolve remote object from id\n object = await this.requestObject(id)\n }\n // cache\n await this.store.saveObject(object)\n return object\n}", "constructor(service) {\n this._service = service;\n Request.idCounter++; // id:1 is reserved!\n this._id = Request.idCounter.toString();\n }", "async function getIndividualInfo(id){\n \n const idObject = {id}\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(idObject)\n }\n\n\n return await fetch('/api/PlantID', options)\n .then(resp => resp.json())\n .then(data => {\n console.log(data);\n return data;\n });\n}", "get promise() {\n return this.deferred.promise;\n }", "getProfileForPerson(id) {\n return this.#fetchAdvanced(this.#getProfileForPersonURL(id))\n .then((responseJSON) => {\n let profileBOs = ProfileBO.fromJSON(responseJSON);\n return new Promise(function(resolve){\n resolve(profileBOs);\n })\n })\n }", "addResponse( result ) {\n\n const save = Object.assign( {}, result );\n this.responses.set( save.url, save );\n return Promise.resolve();\n\n }", "function fetch(req, res, next, id) {\n Result.get(id)\n .then((result) => {\n req.result = result; // eslint-disable-line no-param-reassign\n return next();\n })\n .error((e) => next(e));\n}", "static getById(request, response) {\r\n\r\n clientsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n response.json(data); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Client not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error getting client by ID: ', request.params.id, err);\r\n });\r\n }", "addRequest(state, payload) {\n state.requests.push(payload);\n }", "async getAdminOrder(request) {\n return new Promise(async (resolve, reject) => {\n try {\n if (request.id) {\n let result = await Order.findOne({\n isDeleted: false,\n _id: request.id\n }).populate(\"payment\").populate([{\n path: 'cart',\n model: 'cart',\n populate: {\n path: 'item',\n model: 'items'\n }\n }]);\n resolve(this.prepareOrderData(result));\n } else {\n let query = {isDeleted: false};\n if (request.status) {\n query[\"status\"] = request.status;\n }\n const count = await Order.find(query).countDocuments();\n let result = await Order.find(query).sort({modifiedAt: -1}).skip(parseInt(request.offset)).limit(parseInt(request.limit)).populate(\"payment\");\n resolve({total: count, records: this.prepareOrdersData(result)})\n }\n } catch (error) {\n log.error(\"OrderService-->getCart-->\", error);\n reject(errorFactory.dataBaseError(error));\n }\n\n\n });\n }", "function get_single_cargo(id){\n console.log(\"inside get_single_cargo: \" + id);\n const key = datastore.key([CARGO, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n var cargo = result[0];\n cargo.id = id; //Add id property to ship\n return cargo;\n }).catch( err => {\n console.log(\"ERR\");\n return false;\n });\n}", "setId(id){\n this.id=id;\n }", "then(onFulfilled, onRejected, label) {\n const child = super.then(onFulfilled, onRejected, label);\n child.xhr = this.xhr;\n return child;\n }", "add(request) {\n var exists = false;\n for(var i = 0; i< this.list.length; i++) {\n if (request.uid == this.list[i].uid) {\n exists = this.list[i];\n break;\n }\n }\n\n request.sessionId = extractSessionId(request);\n\n if (request.sessionId && this.deletedSessions.indexOf(request.sessionId) > -1) {\n return;\n }\n\n if (exists) {\n for (var k in request) {\n if (request.hasOwnProperty(k)) {\n exists[k] = request[k];\n }\n }\n exists._respondedDate = new Date().getTime();\n delete exists._requested;\n } else {\n request._requested = true;\n request._requestedDate = new Date().getTime();\n this.list.push(request);\n }\n }", "constructor() {\n this._requests = {};\n }", "reviewRequest(request_id) {\r\n console.log(request_id);\r\n \r\n var requestObj = {\r\n request_status: \"Confirmed\",\r\n confirm_freelancer_id: this.props.auth.user.id\r\n }\r\n // send freelancer_id to confirm the request of ondemand\r\n axios.post(\"/request/ondemand/confirm/\" + request_id, requestObj)\r\n .then(response => {\r\n this.ShowNotification(response.data.message);\r\n this.componentWillMount();\r\n })\r\n .catch(function (error) {\r\n console.error(error);\r\n });\r\n }", "setAsyncContextIdPromise(contextId, promise) {\n const promiseId = getPromiseId(promise);\n\n // if (!promiseId) {\n\n // }\n\n const context = executionContextCollection.getById(contextId);\n if (context) {\n this.setAsyncContextPromise(context, promiseId);\n }\n\n // old version\n // TODO: remove the following part → this does not work if async function has no await!\n const lastAwaitData = this.lastAwaitByRealContext.get(contextId);\n\n // eslint-disable-next-line max-len\n // this.logger.warn(`[traceCallPromiseResult] trace=${traceCollection.makeTraceInfo(trace.traceId)}, lastContextId=${executionContextCollection.getLastRealContext(this._runtime.getLastPoppedContextId())?.contextId}`, calledContext?.contextId,\n // lastAwaitData);\n\n if (lastAwaitData) {\n lastAwaitData.asyncFunctionPromiseId = promiseId;\n\n // NOTE: the function has already returned -> the first `preAwait` was already executed (but not sent yet)\n // [edit-after-send]\n const lastUpdate = asyncEventUpdateCollection.getById(lastAwaitData.updateId);\n lastUpdate.promiseId = promiseId;\n }\n return lastAwaitData;\n }", "user(obj) {\n\n // Perform action and return promise\n return user.getUser({id: obj.author});\n }", "fetchRestaurantById(id) {\n return this._updateFromService()\n .then(() => this.db)\n .then(db => {\n const store = this._getStore(db, 'restaurants', false);\n const request = store.get(id);\n return new Promise((resolve, reject) => {\n request.onsuccess = () => { resolve(request.result); };\n request.onerror = reject;\n });\n });\n }", "deferred() {\n const struct = {}\n struct.promise = new MyPromise((resolve, reject) => {\n struct.resolve = resolve\n struct.reject = reject\n })\n return struct\n }", "async function CreateNewMerchantRecord(data, id) {\n // NOTIFY PROGESS\n console.log(\"Creating a new merchant record\");\n\n if(id != undefined) {\n return await _set(\"Merchants/\" + id, data);\n } else {\n return await _push('Merchants', data);\n }\n \n}", "function makePromise(tgt) {\n return new Ember.RSVP.Promise(function (resolve) {\n resolve(tgt);\n });\n }", "addRequest(key, data) {\n this.requests[key] = {\n query_key: data.query_key,\n timestamp: data.timestamp,\n data_hash: data.data_hash,\n };\n }", "async function payment(id){\n if(id === undefined){\n throw 'input is empty';\n }\n if(id.constructor != ObjectID){\n if(ObjectID.isValid(id)){\n id = new ObjectID(id);\n }\n else{\n throw 'Id is invalid!(in data/reservation.payment)'\n }\n } \n\n const reservationCollections = await reservations();\n const target = await this.getbyid(id);\n const updatedata = {\n $set:{ \n _id: id,\n patientid: target.patientid,\n doctorid: target.doctorid,\n date: target.date,\n roomid: target.room,\n days: target.days,\n prescriptionid: target.prescriptionid,\n status: 'completed' \n }\n }\n\n const updateinfo = await reservationCollections.update({ _id: id } , updatedata);\n if(updateinfo.modifiedCount === 0) throw 'Update fail!';\n //console.log(updateinfo)\n return await this.getbyid(id);\n}", "static dSTIdNotePOST({ id, inlineObject1 }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "async updateRequest(publicKey, requestId, requestResult) {\n let result = await this.getUserByPublicKey(publicKey);\n let user = result.value;\n\n for(let request of user.requests) {\n if(request.id == requestId) {\n request.Result = requestResult;\n }\n }\n\n return await this.state.put(result.key, user);\n }", "updateId(id) {\n this._id = id;\n }", "static getID( id )\r\n {\r\n return new Promise(async resolve =>{\r\n try {\r\n let inforUser = await USER_COLL.findById({ _id : id });\r\n if( !inforUser ) return resolve({erro : true , message : 'can not find'});\r\n return resolve({ error : true, data : inforUser})\r\n } catch ( error ) {\r\n return resolve({error : true, message : error.message})\r\n }\r\n })\r\n}", "getPersonId() {\n return this.#fetchAdvanced(this.#getPersonIdURL()).then((responseJSON) => {\n let personBOs = PersonBO.fromJSON(responseJSON);\n return new Promise(function (resolve) {\n resolve(personBOs);\n })\n })\n }", "async function requestId() {\n const res = await fetch(`http://pets-v2.dev-apis.com/pets?id=${id}`);\n const json = await res.json();\n setIds(json.pets);\n }", "static getId(promise) {\n return Promise.resolve(promise).then(o => o.id);\n }", "resolve(parentValue, args) {\n\t\t\t\treturn axios\n\t\t\t\t\t.get(`http://localhost:3000/users/${args.id}`)\n\t\t\t\t\t.then(res => res.data); // because axios returns { data :{ firstName:....}}\n\t\t\t}", "async getCustomer() {\n const customer = this.ctx.request.body;\n\n this.ctx.body = await this.service.customers.query(customer);\n }", "_saveRequest(request) {\n request.set('status', 'Completed');\n request.set('completedBy', request.getUserName());\n request.save().then(function() {\n this.send('update', true);\n this.send('closeModal');\n this.getTransactions();\n }.bind(this));\n }", "add(object) {\n return this.addWithID(object, Juggler.getNextID())\n }", "set id(id) {\n this._id = id;\n }", "function userAppr(id) {\r\n var deferred = $q.defer();\r\n console.log('Approve method start');\r\n $http.post(userUrl + '/user/approv/' + id).then (\r\n\r\n function(response) {\r\n deferred.resolve(response.data);\r\n }, \r\n function (errResponse) {\r\n deferred.reject(errResponse);\r\n }\r\n );\r\n console.log('Approve method end');\r\n return deferred.promise;\r\n }", "function loadUserWithPromise(id){\n\t//return a promise object that wraps async task's code\n\treturn new Promise(function(resolve, reject){\n\t\t//mocking a database search query\n\t\tUser.findById(id, function(err, user){\n\t\t\tif(err){\n\t\t\t\treject(err);\n\t\t\t}\n\n\t\t\tresolve(user);\n\t\t});\n\t});\n}", "static initialize(obj, id, integrationRequestUuid, webhookId, url, request, requestTime) { \n obj['id'] = id;\n obj['integrationRequestUuid'] = integrationRequestUuid;\n obj['webhookId'] = webhookId;\n obj['url'] = url;\n obj['request'] = request;\n obj['requestTime'] = requestTime;\n }", "getExistingPerson (per) {\r\n console.log(\"Searching in records...\");\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n }\r\n });\r\n return promise;\r\n }", "resolve(parent, args, req, info) {\n return productAPI.getProductById(args.id, info);\n }", "async getCustomerById(id) {\n if (!id) {\n return {msg: 'No id was specified.', payload: 1}\n }\n\n let result = await customers.findById(id);\n\n if (!(!!result)) {\n return {msg: 'No customer was found with that id..', customer: {id: null}, payload: 1};\n }\n\n return {msg: 'Success', payload: 0, customer: result.dataValues};\n }", "requestCreate (per){\r\n let promise = fetch (`http://localhost:4070/api/tempPerson`,{\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "setId(id) {\n this.id = id;\n return this;\n }", "#_loading() {\n const ressourceUrl = `http://${REST_BASE_URL}${Product.RESSOURCE_NAME}/${this.#id}`\n const promise = fetch(ressourceUrl);\n promise.then(\n (response) => { return response.json() },\n (unsuccessResponse) => { console.error('Une errur de chargement') }\n ).then((obj) => {\n console.log(obj);\n this.loadValues(this.#id,obj.name,obj.price);\n return obj;\n })\n \n }", "function addIds(url, req) {\n req = JSON.parse(req);\n let current_id = 1;\n if (req.data instanceof Array) {\n for (let datum of req.data) {\n datum.id = current_id++;\n }\n } else {\n req.data.id = current_id++;\n }\n\n if (req.included) {\n for (let datum of req.included) {\n datum.id = current_id++;\n }\n }\n\n return req;\n}", "add(properties) {\r\n return this.postCore({\r\n body: jsS(properties),\r\n }).then(r => {\r\n return {\r\n data: r,\r\n event: this.getById(r.id),\r\n };\r\n });\r\n }", "patch (id, data, query) {\r\n let model = this.model.findOne({ [this.key]: id })\r\n return model\r\n .then((modelInstance) => {\r\n for (var attribute in data) {\r\n if (data.hasOwnProperty(attribute) && attribute !== this.key && attribute !== '_id') {\r\n modelInstance[attribute] = data[attribute]\r\n }\r\n }\r\n return modelInstance.save()\r\n })\r\n .then(modelInstance => modelInstance)\r\n }", "createModel(id, min, max) {\n return new Promise((resolve, reject) => {\n const url = this.url + '/' + id;\n const data = {\n url,\n method: 'PUT',\n json: {\n min,\n max\n }\n };\n\n request(url, data, (err, res) => {\n if (err) return reject(err);\n return resolve(res);\n });\n });\n }", "static getProductById(id) {\n return new Promise(async (resolve, reject) => {\n try {\n const res = await axios.get(`${url}` + 'id=' + id);\n const data = res.data;\n resolve(data);\n } catch (err) {\n reject(err)\n }\n })\n }", "static async get(id) {\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n last_name AS \"lastName\", \n phone, \n notes \n FROM customers WHERE id = $1`,\n [id]\n );\n\n const customer = results.rows[0];\n\n if (customer === undefined) {\n const err = new Error(`No such customer: ${id}`);\n err.status = 404;\n throw err;\n }\n\n return new Customer(customer);\n }", "enqueueRequest(url, method, query) {\n return new Promise((resolve, reject) => {\n this.createObjectForQueue(\n {\n \"url\" : url,\n \"method\" : method,\n \"query\" : query || null\n },\n (error, response, data) => {\n if (error) {\n reject(error);\n }\n resolve({response, data})\n }\n )\n });\n }", "request(request_id, ...args) {\n MxI.$raiseNotImplementedError(ISubject, this);\n }", "function addAPIReq(userGUID, apiName){\n return new Promise(async (resolve, reject) => {\n var request = JSON.parse(templates.req_API);\n\n request.status = 1;\n request.req_date = new Date();\n request.info.clientGUID = userGUID;\n request.info.project_name = apiName;\n\n try{\n var add = await redis.SADDSync('req_api', JSON.stringify(request));\n resolve(add);\n } catch(reject) {\n reject({\"Error\" : reject, \"Method\" : \"addAPIReq()\", \"Code\" : 1});\n }\n });\n}", "async getRequestById(caller, id) {\n\t\treturn await this.rpc.get_table_rows({\n\t\t\tjson: true,\n\t\t\tcode: this.options.ala_data.oracle_contract_name,\n\t\t\tscope: caller,\n\t\t\ttable: 'requests',\n\t\t\tlower_bound: id,\n\t\t})\n\t}", "function searchProductById(id){\n var promise = new Promise(function(resolve,reject){\n var i = 0;\n setTimeout(function(){\n while (i < catalog.length){\n if (catalog[i].id == id){\n resolve({id:id,price:catalog[i].price,type:catalog[i].type});\n }\n i++;\n }\n reject(\"Invalid ID: \" + id);\n },1000);\n });\n return promise;\n }", "resolve(inner, outer, rootId, promiseLinkType, traceId, asyncPromisifyPromiseId) {\n // const rootId = this.getCurrentVirtualRootContextId();\n const from = getPromiseId(inner);\n const to = getPromiseId(outer);\n // if (!from || !to) {\n // this.logger.error(`resolve link failed: promise did not have an id, from=${from}, to=${to}, trace=${traceCollection.makeTraceInfo(traceId)}`);\n // }\n // else {\n return nestedPromiseCollection.addLink(promiseLinkType, from, to, traceId, rootId, asyncPromisifyPromiseId);\n }", "editInjured(InjuredDetails) { \n var headers = InjuredDetails; \n return new Promise((resolve, reject) => {\n Injured.update({'id': headers.id}, \n {$set:{\"gender\": headers.gender,\n \"age\" : headers.age,\n \"name\":headers.name}}, (err) => {\n if (err) reject (err);\n else resolve(` ${headers.id}`);\n });\n })\n }", "getCreditByPersonId(id) {\n return new Promise((fulfill, reject) => {\n https.get(restHost + \"/person/\" + id + pathTail + \"&append_to_response=movie_credits\", function (res) {\n var _data = '';\n res.on('data', (d) => {\n _data += d;\n });\n\n res.on('end', () => {\n var rs = JSON.parse(_data);\n fulfill(rs);\n });\n });\n });\n }", "constructor(id) {\n if(id) this.id = id;\n }", "editTaskCaller(id) {\n fetch('http://localhost:9000/task/:id', {\n method: 'GET',\n headers: { \"Content-Type\": \"application/json\" }\n }).then(function (response) {\n return response.json()\n });\n }", "fetchSpecificCustomers(id) {\r\n return Api().get('/customers/' + id)\r\n }", "function loadUserWithPromise(id){\n\treturn new Promise((resolve, reject) => {\n\t\tif(typeof id !== 'string' || Number.isNaN(Number.parseInt(id))){\n\t\t\tthrow new TypeError(\"Invalid user id format\");\n\t\t}\n\t\t//load user operation \n\t\t//if succeed\n\t\tresolve(user);\n\t\t//if fail\n\t\treject(err);\n\t});\n}", "static async add(data) {\n const mockPromise = new Promise(function(resolve, reject) {\n if (typeof data == 'object') {\n resolve(testScenarioID);\n } else {\n reject('Invalid Data Object');\n }\n });\n return mockPromise; //if the promise is solved, it returns a String\n }", "function obtenerPersonaje(id) {\n return new Promise( (resolve,reject) => {\n const url = `${API_URL}${PEOPLE_URL.replace(':id',id)}`;\n $.get(url, opts, function (data) {\n resolve(data);\n }).fail( () => {\n reject(id);\n });\n });\n}", "resolve(parentValue, args) {\n return axios.get(`http://localhost:3000/users/${args.id}`)\n .then(response => response.data);\n }", "async function addAction(request) {\n log(\n \"administratorDB.addAction: request = \" + JSON.stringify(request, null, 2),\n \"admn\",\n \"info\"\n );\n\n let actionResult = {};\n\n let actionUuid = null;\n let tgt = tgtByClientToken.get(request.tgtClientToken);\n if (tgt) {\n log(\"....tgt=\" + JSON.stringify(tgt, null, 2));\n actionUuid = uuidv4();\n const action = { actionUuid, request };\n tgt.actions.push(action);\n log(\n \"administratorDB.addAction: actions = \" +\n JSON.stringify(tgt.actions, null, 2),\n \"admn\",\n \"info\"\n );\n\n if (actionUuid) actionResult = await wait(actionUuid);\n }\n\n log(\"<<<administratorDB.addAction\", \"admn\", \"info\");\n\n return actionResult;\n}", "static async get(id) {\n const results = await db.query(\n `SELECT id, \n first_name AS \"firstName\", \n middle_name AS \"middleName\",\n last_name AS \"lastName\", \n phone, \n notes \n FROM customers WHERE id = $1`,\n [id]\n );\n\n const customer = results.rows[0];\n\n if (customer === undefined) {\n const err = new Error(`No such customer: ${id}`);\n err.status = 404;\n throw err;\n }\n\n return new Customer(customer);\n }", "headersForRequest() {\n return get(this, 'headersWithEphemeralId');\n }" ]
[ "0.57371026", "0.5726311", "0.56998897", "0.56142217", "0.5473995", "0.5470161", "0.546724", "0.53741705", "0.53485656", "0.5319109", "0.5238272", "0.51673985", "0.5058932", "0.50512016", "0.5049005", "0.5038349", "0.50360566", "0.5020217", "0.50159633", "0.4987162", "0.4968679", "0.49686643", "0.4947476", "0.4938223", "0.4919592", "0.48984203", "0.48970214", "0.48837143", "0.48815808", "0.4881282", "0.4875325", "0.48729512", "0.48676422", "0.48672438", "0.48639703", "0.48458052", "0.48452199", "0.4839319", "0.48367465", "0.48229477", "0.48196325", "0.48186114", "0.48162413", "0.4796288", "0.47926036", "0.479029", "0.47824082", "0.477883", "0.4778785", "0.47767285", "0.47750154", "0.4774784", "0.47710302", "0.47701442", "0.476803", "0.47614327", "0.4757873", "0.4751295", "0.47512388", "0.47483626", "0.4747847", "0.47279325", "0.47256786", "0.47228652", "0.47205767", "0.47189122", "0.47154662", "0.4711709", "0.4708585", "0.47063518", "0.4702815", "0.46955484", "0.4695008", "0.46937016", "0.4687794", "0.4686019", "0.46853706", "0.4679889", "0.46795774", "0.46761855", "0.46743122", "0.4673995", "0.46729365", "0.46669048", "0.46628192", "0.46608645", "0.46558708", "0.46540198", "0.4653678", "0.46518755", "0.4650722", "0.46496144", "0.46484205", "0.46473795", "0.46445686", "0.46434227", "0.46398216", "0.4636615", "0.46365917", "0.46357015" ]
0.5070518
12
add a request promise property to the object. The id is being sent to the server and a prediction is being conducted
doPrediction(options) { return rp(options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "promise({ payload, request }) {\n return request.create({ data: payload })\n }", "promise({ payload, request }) {\n return request.update(payload)\n }", "function PromiseRequest() {\n\t superagent.Request.apply(this, arguments);\n\t }", "function addPerson(object) {\n var promise = $http({\n method: 'POST',\n url: '/lovedones-add',\n data: {\n name: object.name,\n weight: object.weight,\n age: object.age,\n userid: object.userid\n }\n }).then(function successfulCallback(response) {\n lovedones = response.data;\n }, function(error) {\n console.log(error);\n });\n return promise;\n }", "function PromiseRequest() {\n superagent.Request.apply(this, arguments);\n }", "requestCreate (per){\r\n let promise = fetch (`http://localhost:4070/api/tempPerson`,{\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "addResponse( result ) {\n\n const save = Object.assign( {}, result );\n this.responses.set( save.url, save );\n return Promise.resolve();\n\n }", "then(onFulfilled, onRejected, label) {\n const child = super.then(onFulfilled, onRejected, label);\n child.xhr = this.xhr;\n return child;\n }", "trackRequestPromise(handle, promise) {\n this.startRequest(handle);\n promise.then(() => this.endRequest(handle)).catch(() => this.endRequest(handle));\n }", "trackRequestPromise(handle, promise) {\n this.startRequest(handle);\n promise.then(() => this.endRequest(handle)).catch(() => this.endRequest(handle));\n }", "await() {\n this.model.await = true;\n }", "function wrapRequest(request){return new PersistencePromise(function(resolve,reject){request.onsuccess=function(event){var result=event.target.result;resolve(result);};request.onerror=function(event){reject(event.target.error);};});}", "addRequest(state, payload) {\n state.requests.push(payload);\n }", "_saveRequest(request) {\n request.set('status', 'Completed');\n request.set('completedBy', request.getUserName());\n request.save().then(function() {\n this.send('update', true);\n this.send('closeModal');\n this.getTransactions();\n }.bind(this));\n }", "newRequest(payload){\n this.milestones = new Milestones\n this.milestones.Reported();\n let miles = JSON.stringify(this.milestones.stringify())\n \n payload.append('milestones',miles);\n console.log(payload);\n fetch('../api/requests/new',{\n 'method':'POST',\n 'body':payload\n })\n // .then(r=>(r.json()))\n .then(r=>console.log(r))\n }", "function addTask(event) {\n event.preventDefault();\n const number = form.task.value;\n const task = {\n userId: 1,\n title: form.task.value,\n completed: false\n }\n const data = JSON.stringify(task);\n const url = 'https://jsonplaceholder.typicode.com/todos';\n const headers = new Headers({\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n });\n const request = new Request(url,\n {\n method: 'POST',\n header: headers,\n body: data\n }\n )\n fetch(request)\n .then( response => response.json() )\n .then( task => console.log(`Task saved with an id of ${task.id}`) )\n .catch( error => console.log('There was an error:', error))\n}", "_cartRequest(path, options, method, prop) {\n // Return a promisse\n return new RSVP.Promise((resolve, reject) => {\n Store.fetch(path, assign(this._requestProperties, options), method).then((res) => {\n // Store the order number\n if( res.order.real )\n this._number = res.order.number;\n\n // Store the token\n this._token = res.order.number;\n\n // Send it to the public Promise\n if( prop !== undefined )\n resolve(res[prop]);\n else\n resolve(res);\n }).catch(reject);\n });\n }", "async attach(id, request) {\n var _a, _b;\n this.lastPayload = void 0;\n await this.mapper.updateByIdEx(Requests.Attach, id, request, { method: RestDB.Method.POST });\n this.lastPayload = RestDB.Outputer.createFull(Responses.Attach, (_a = this.client.payload) === null || _a === void 0 ? void 0 : _a.subscription, []);\n return (_b = this.lastPayload) === null || _b === void 0 ? void 0 : _b.id;\n }", "addRequest(key, data) {\n this.requests[key] = {\n query_key: data.query_key,\n timestamp: data.timestamp,\n data_hash: data.data_hash,\n };\n }", "async addRejUser(id, data) {\n let value = {\n rejectedBy: data\n };\n let response = await axios.patch(`${API_URL}/requests/${id}`, value);\n return response;\n }", "async function makerequest() {\r\n \r\n}", "requestObject(request) {\n return request; \n }", "constructor() {\n this._requests = {};\n }", "updateData(per) {\r\n console.log(\"Updating \");\r\n console.log (\"PER\"+per);\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"PUT\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "async function requestId() {\n const res = await fetch(`http://pets-v2.dev-apis.com/pets?id=${id}`);\n const json = await res.json();\n setIds(json.pets);\n }", "addRequest(e) {\n var that = this;\n e.preventDefault();\n\n coder.find( this.refs.voter_address.value , function handleResults(status, result) {\n console.log(result);\n \n let latLng = result[0].location.lat.toString() + ', ' + result[0].location.lng.toString()\n // process voter with geocoded address\n let voter_data = {\n 'title': that.refs.voter_name.value,\n 'address' : latLng, \n 'approves' : that.refs.voter_choice.checked\n };\n\n var request = new Request('http://localhost:3000/api/voting', {\n method: 'POST', \n headers: new Headers({ 'Content-Type': 'application/json'}), \n body: JSON.stringify(voter_data)\n })\n\n fetch(request)\n .then(function(response) {\n return response.json()\n })\n .then(function(body) {\n console.log(body);\n let voters = that.state.voters;\n voters.concat(body);\n console.log(voters);\n that.setState({\n voters: voters\n });\n })\n .catch(function(err) {\n console.log(err);\n });\n });\n\n }", "fetch( options = {parse: true} ) {\n const req = this.sync(type.GET, this, options);\n\n return new Promise(( resolve, reject )=> {\n req.then(( resp )=> {\n //store our response\n\n let serverAttrs = options.parse ? this.parse(resp.data) : resp.data;\n\n //set id\n this.id = serverAttrs[this.idAttribute] || this[this.idAttribute];\n\n //set the attributes\n assign(this.attributes, serverAttrs);\n\n //resolve with the new attributes\n resolve(this.attributes);\n\n }, ( err )=> {\n reject(err);\n });\n })\n\n }", "async updateRequest(publicKey, requestId, requestResult) {\n let result = await this.getUserByPublicKey(publicKey);\n let user = result.value;\n\n for(let request of user.requests) {\n if(request.id == requestId) {\n request.Result = requestResult;\n }\n }\n\n return await this.state.put(result.key, user);\n }", "constructor() {\n this.promise = Promise.resolve();\n this.queued = 0;\n this.complete = 0;\n }", "createModel(id, min, max) {\n return new Promise((resolve, reject) => {\n const url = this.url + '/' + id;\n const data = {\n url,\n method: 'PUT',\n json: {\n min,\n max\n }\n };\n\n request(url, data, (err, res) => {\n if (err) return reject(err);\n return resolve(res);\n });\n });\n }", "function Promise() {\n this._status = Promise.PENDING;\n this._value = undefined;\n this._onSuccessHandlers = [];\n this._onErrorHandlers = [];\n\n // Debugging help\n this._id = Promise._nextId++;\n Promise._outstanding[this._id] = this;\n}", "handleRecipeGen(id) {\n this.setState({ spinner: true });\n // console.log(id);\n //post the generated id to server\n fetch('/api/recipes', {\n method: 'POST',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(id)\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 this.getMetaData(res);\n })\n .catch(err => {\n console.error(err);\n window.location = '/';\n });\n }", "putTaskForMake(nameExecutor, surnameExecutor, phoneExecutor, executionTime, commentExecutor, id) {\n return instance.put(`profile/${id}`, {\n nameExecutor,\n surnameExecutor,\n phoneExecutor,\n executionTime,\n commentExecutor\n }).then(response => { \n return response.data;\n })\n }", "function add(r) {\n\t//console.log(r);\n\treturn new Promise((resolv, reject) => {\n\tvar newData = new myModel(r);\n\tnewData.save(function(err,v) {\n\t\tif (err) {\n\t\t\treject(err);\n\t\t} else {\n\t\t//console.log(\"Saved\");\n\t\tresolv();\n\t\t}\n\t});\n\t});\n}", "request() {\n // We should have prop URL, or have a connection as prop.\n fetch(this.props.url + this.state.itemObj.ItemID).then((response) => {\n let resultObj = response.json();\n //TODO: once we fetch the item info, set missing field (atm it is desc)\n });\n }", "startRequest(handle) {\n this.activeRequestCount++;\n }", "startRequest(handle) {\n this.activeRequestCount++;\n }", "request(request_id, ...args) {\n MxI.$raiseNotImplementedError(ISubject, this);\n }", "static dSTIdNotePOST({ id, inlineObject1 }) {\n return new Promise(\n async (resolve) => {\n try {\n resolve(Service.successResponse(''));\n } catch (e) {\n resolve(Service.rejectResponse(\n e.message || 'Invalid input',\n e.status || 405,\n ));\n }\n },\n );\n }", "createData (per){\r\n console.log (\"Creating...\");\r\n let promise = fetch (`http://localhost:4070/api/person`,{\r\n method: \"POST\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n },\r\n body: JSON.stringify (per)\r\n });\r\n return promise;\r\n }", "addOrUpdate (attr) {\n return request({\n url: `${api_name}/saveAttrInfo`,\n method: 'post',\n data: attr\n })\n \n\n }", "async function postRequest(id) {\n fetch(`https://thecrew.cc/news/create.php`, {\n method: 'POST',\n body: JSON.stringify({\n UUID: id\n })\n })\n .then(response => {\n return response.json();\n })\n .then(data => {\n console.log(data);\n onLoad();\n });\n\n}", "function add(requestIdActive, httpMethod, requestTitle, urlRequest, requestBody, requestHeadersKey1, requestHeadersValue1, requestDescription) {\n\n //TESTING to double confirm this func triggered by new request, not existing (update).\n //check either requestIdActive has value or not. has value = update, no value = save\n if (requestIdActive) {\n //means update\n alert(\"requestIdActive has a value!\");\n } else {\n //means save a new data\n alert(\"requestIdActive has no value!\");\n }\n\n const uuidV4 = require('uuid/v4');\n var idRequest = uuidV4();\n\n alert(idRequest + \" \" + httpMethod + \" \" + requestTitle + \" \" + urlRequest + \" \" + requestHeadersKey1 + \" \" + requestHeadersValue1 + \" \" + requestBody + \" \" + requestDescription);\n var request = db.transaction([\"requestlist\"], \"readwrite\")\n\n .objectStore(\"requestlist\")\n .add(\n {\n id: idRequest,\n method: httpMethod,\n title: requestTitle,\n url: urlRequest,\n headers: [{key : requestHeadersKey1, value: requestHeadersValue1}],\n body: requestBody,\n description: requestDescription\n // body: \"{ \\\"id\\\": \\\"3a08a161-80ef-44bf-a23e-9cf47d821bba\\\", \\\"name\\\": \\\"James Burke\\\"}\"\n }\n );\n\n request.onsuccess = function(event) {\n // alert(\"Data has been added to your database.\");\n };\n\n request.onerror = function(event) {\n // alert(\"Unable to add data\\r\"+ idRequest +\"is aready exist in your database! \");\n }\n\n // savetoMongoDB();\n // notifyClient(id);\n\n //check if sync = On\n if(sync==='on') {\n savetoMongoDBSelfHosted(idRequest)\n }\n else {\n //TODO : need to reload new data in left menu if sync is OFF!\n alert(\"sync is not on, this will not be saved to server!\")\n menuLoadNewlyAddedRequest(idRequest)\n }\n\n}", "function NotifyPolicyRequest(policy, deferred) {\n this.policy = policy;\n this.deferred = deferred;\n}", "patch (id, data, query) {\r\n let model = this.model.findOne({ [this.key]: id })\r\n return model\r\n .then((modelInstance) => {\r\n for (var attribute in data) {\r\n if (data.hasOwnProperty(attribute) && attribute !== this.key && attribute !== '_id') {\r\n modelInstance[attribute] = data[attribute]\r\n }\r\n }\r\n return modelInstance.save()\r\n })\r\n .then(modelInstance => modelInstance)\r\n }", "add (key, promise) {\n let self = this\n self.pending += 1\n return promise.then((data) => {\n self.keyset[key] = data\n self.end(1)\n })\n .catch((err) => {\n self.errset[key] = err\n self.end(1)\n })\n }", "function requestImagePromise(imgID){\n return $.ajax({\n url: \"https://api.nasa.gov/planetary/apod?api_key=A2WsxudHGixiEWIX6tMDmCKa0SiyIUN9NENLN0WK\",\n dataType:'json',\n }).then(data => {\n let p = new Nasa(imgID,data.name);\n console.log(`We have ${imgID} - ${p.name}`);\n return p;\n }).catch( e => console.log(e));\n }", "function callAPI(id) {\n const age = 20;\n return new Promise((resolve, reject) => {\n resolve({ id, name: \"Woody\", age })\n });\n}", "add(request) {\n var exists = false;\n for(var i = 0; i< this.list.length; i++) {\n if (request.uid == this.list[i].uid) {\n exists = this.list[i];\n break;\n }\n }\n\n request.sessionId = extractSessionId(request);\n\n if (request.sessionId && this.deletedSessions.indexOf(request.sessionId) > -1) {\n return;\n }\n\n if (exists) {\n for (var k in request) {\n if (request.hasOwnProperty(k)) {\n exists[k] = request[k];\n }\n }\n exists._respondedDate = new Date().getTime();\n delete exists._requested;\n } else {\n request._requested = true;\n request._requestedDate = new Date().getTime();\n this.list.push(request);\n }\n }", "function buildPromise(entryEvent, event) {\n\n var myPromise;\n if (entryEvent) {\n console.log('aalatief buildPromise Case entryEvent '); \n myPromise = $q.resolve({\n data: {\n entries: [{\n entryServerId: entryEvent.entry || entryEvent.entryServerId,\n _id: entryEvent._id,\n itemServerId: entryEvent.entry.itemServerId\n }\n ],\n items: entryEvent.item,\n retailers: entryEvent.retailer\n }\n })\n ;\n } else {\n console.log('aalatief buildPromise Case Not entryEvent '); \n var data = {\n userServerId: global.userServerId,\n deviceServerId: global.deviceServerId\n };\n var url = global.serverIP + \"/api/entry/\" + (event == \"CREATE\" ? \"getpending\" : \"getUpdates\");\n\n myPromise = $http.post(url, data);\n }\n return myPromise;\n\n }", "async addDrug(requestObj) {\n const drugCompositeKey = this.ctx.stub.createCompositeKey(this.name, requestObj.getKeyArray());\n const requestBuffer = requestObj.toBuffer();\n await this.ctx.stub.putState(drugCompositeKey, requestBuffer);\n }", "async execute(request_model) { // EntityRequestModel: id, entity(=table)\n // 2. validation\n let validation_result = this.validator.validate(request_model);\n if(!validation_result.isValid) {\n const response_model = new ResponseModel(null,\n null,\n null,\n validation_result.error_msg,\n 400);\n return response_model;\n }\n\n // 3. DB interaction\n let response_model;\n let assign = new Assign(request_model.location_id,\n request_model.table_id,\n Date.now(),\n request_model.guest.name.split(' ')[0],\n request_model.guest.name.split(' ')[1],\n request_model.guest.phoneNumber,\n request_model.guest.email);\n try {\n await this.repository.save_assign(assign);\n response_model = new ResponseModel(request_model.guest.phoneNumber,\n request_model.guest.name,\n request_model.guest.email,\n null,\n 200);\n } catch (e) {\n response_model = new ResponseModel(null, null, null, e.message, 400);\n }\n\n // 4. return response\n return response_model;\n }", "function request1() {\n return new Promise((resolve, reject) => {\n setTimeout(() => resolve ({\n data: 'Data',\n makeAnotherRequest: true\n }), 2000);\n });\n }", "async postRequest(publicKey, request) {\n let result = await this.getUserByPublicKey(publicKey);\n let user = result.value;\n\n user.requests.push(request);\n\n return await this.state.put(result.key, user);\n }", "async request(config) {\n return await new Response(this.model, await this.axios.request(config), config).commit();\n }", "addRequest(id, name, device, pfp, out) {\n if (id === this.id) {\n return false;\n }\n \n if (out) {\n if (this.isRequesting(id)) {\n return false;\n }\n this.requestout.push(new Friend(id, name, device, pfp));\n return true;\n } else {\n this.requestin.push(new Friend(id, name, device, pfp));\n return true;\n }\n }", "sendRequest(rubricTitle, data) {\n return new Promise(() => {\n const newdata = {\n \"name\": rubricTitle,\n \"cards\": data,\n \"user_id\": this.props.user.id\n };\n let dataString = JSON.stringify(newdata);\n fetch('/api/rubrics', {\n method: 'POST',\n body: dataString,\n mode: 'cors',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n }).then(function (response) {\n if (response.status === 201 || response.ok ){\n alert(\"Rubric Added\");\n }\n else {\n alert(\"could not add rubric\");\n }\n }).then(()=> this.props.history.push('/tasks/rubric'));\n });\n }", "function update() {\n // DEFINE LOCAL VARIABLES\n // RETURN RESPONSE\n return new Promise(function (resolve, reject) {\n\n });\n}", "function editar(obj)\n{\n CarregandoLoading()\n fetch(URL_BASE+obj,{\n cache:'no-store'\n })\n .then(response => response.json()) \n .then(json => {\n console.log(json)\n id.value = json[0].ID\n nome.value= json[0].NOME\n email.value = json[0].EMAIL\n tipo.value = json[0].TIPO\n })\n .catch(erro => console.log(erro))\n .finally( final => ParandoLoading())\n \n}", "function Promise() {\n this._thens = [];\n }", "get request() { return this._request; }", "async update({ params, request, response }) {}", "static async add(data) {\n const mockPromise = new Promise(function(resolve, reject) {\n if (typeof data == 'object') {\n resolve(testScenarioID);\n } else {\n reject('Invalid Data Object');\n }\n });\n return mockPromise; //if the promise is solved, it returns a String\n }", "function asyncifyRequest (request)\n {\n return new Promise((res, rej) => {\n request.onsuccess = () => res(request.result);\n request.onerror = () => rej(request.error);\n });\n }", "makeRequest(opts, callback) {\n this.requestQueue.push(opts, callback);\n }", "async addAttrNameMethod() {\n const endpoint = `${ApplicationMainHost}/api/product/attributes/`;\n const data = {\n name: this.addAtrName,\n };\n let response = await apiService(endpoint, 'POST', data);\n //console.log(response)\n this.attributeList.push({\n attribute_text_name: response.name,\n attribute_value: '',\n id: null,\n product: this.part.id,\n attribute_name: response.id,\n });\n this.addAtrName = null;\n this.addAttributeName = false;\n }", "reviewRequest(request_id) {\r\n console.log(request_id);\r\n \r\n var requestObj = {\r\n request_status: \"Confirmed\",\r\n confirm_freelancer_id: this.props.auth.user.id\r\n }\r\n // send freelancer_id to confirm the request of ondemand\r\n axios.post(\"/request/ondemand/confirm/\" + request_id, requestObj)\r\n .then(response => {\r\n this.ShowNotification(response.data.message);\r\n this.componentWillMount();\r\n })\r\n .catch(function (error) {\r\n console.error(error);\r\n });\r\n }", "makeRequest() {\r\n // Get Parameter Values\r\n let requestString = [];\r\n\r\n // Make Request\r\n this.getPrologRequest(requestString, this.handleReply);\r\n }", "postRequest(person) {\n axios.post(`https://putmeonthelist-a86b4.firebaseio.com/${this.props.url}/people/.json`, person)\n .then((response) => {\n let people = {...this.state.people};\n let personId = response.data.name;\n people[personId] = person;\n this.setState({ people })\n this.calculateConfirms();\n })\n .catch((response) => {\n console.log(response)\n })\n }", "voteComment(event) {\n let page = this\n\n let data = event.currentTarget.dataset;\n let votes = data.votes;\n let new_votes = { votes: votes + 1 }\n\n //making the PUT request\n wx.request({\n url: `https://cloud.minapp.com/oserve/v1/table/85188/record/${data.id}`,\n method: 'PUT',\n header: {'Authorization':'Bearer 7a82a2b76c38e309ae34ff3c83c87f8409748b0e'}, // API key from Above\n data: new_votes,\n\n success(res) {\n let new_comment = res.data\n let comments = page.data.comments\n let comment = comments.find(comment => comment._id == new_comment.id)\n comment.votes = new_comment.votes\n page.setData({comments:comments})\n console.log(res)\n }\n });\n }", "function createRequestTask(url, property, component) {\r\n return function(done) {\r\n axios.get(url).then(function(response) {\r\n if(response.data.constructor === Array) {\r\n // case where data is a collection, like for /people\r\n component.setData(response.data)\r\n } else {\r\n component.addDataItem(response.data)\r\n }\r\n done()\r\n }).catch(function() { done() })\r\n //ignoring failure; in context it is just a data item not gotten\r\n }\r\n}", "async createNewEntry() {\r\n //will generate random prompts\r\n //will create the data object to create the new entry.\r\n //will post it to the db\r\n //let date= new Date(); //will need to figure out this date thing and where i source it from. probs create date obj here\r\n let prompt = prompts[Math.floor(Math.random() * prompts.length)]\r\n let newEntry = {\r\n prompt: prompt,\r\n date: this.date ,\r\n diaryID :this.diaryID,\r\n text: \"\"\r\n }\r\n let fetchOptions = {\r\n method: \"POST\",\r\n headers: {\r\n 'Accept': 'application/json',\r\n 'Content-Type': 'application/json'\r\n },\r\n body: JSON.stringify(newEntry)\r\n }\r\n let result = await fetch(\"/edit-entry\", fetchOptions);\r\n let json= await result.json();\r\n let id= json._id;\r\n //id= result._id;\r\n //console.log(\"createNewEntry: \",json);\r\n return json;\r\n }", "addToCartUsingPost(prodID) { \n\n let cartID = this.state.cartID; \n const url = WebshopEndpoint + \"/ShoppingCartController/AddItemToCart\"; \n // object som vi sender afsted i vores post request. \n var cartObj = {cartID : cartID, productID: prodID}; \n fetch(url, {\n method: \"POST\", \n headers: {\n \"Content-Type\": \"application/json\",\n dataType: \"application/json\"\n }, \n body: JSON.stringify(cartObj)\n }).then(\n // ved at benytte anonym arrow func så bliver funktionen først kaldt efter \n // at fetch(url) er færdig behandlet (callback)\n () => this.updateTotalCartItemQuan()\n ) \n .catch(() => { \n console.log(\"An error occured\");\n }); \n }", "static initialize(obj, id, integrationRequestUuid, webhookId, url, request, requestTime) { \n obj['id'] = id;\n obj['integrationRequestUuid'] = integrationRequestUuid;\n obj['webhookId'] = webhookId;\n obj['url'] = url;\n obj['request'] = request;\n obj['requestTime'] = requestTime;\n }", "function makePromiseRequest(request, route, arg) {\n var args = [route];\n var i = 1;\n // the number of arguments depends on the type of the request (only for POST and PUT)\n if (arg !== undefined) {\n args[1] = arg\n i++;\n }\n return new Promise(resolve => {\n args[i] = (err, req, res, result) => {\n resolve(result);\n };\n request.apply(client, args);\n });\n}", "function updatePromo() { }", "async putVote(questionId, answerId) {\n let url = `${this.API_URL}/questions/`\n .concat(questionId)\n .concat(\"/answers/\")\n .concat(answerId)\n .concat(\"/vote\");\n fetch(url, {\n method: \"PUT\",\n headers: {\n \"Content-type\": \"application/json; charset=UTF-8\"\n }\n })\n .then(response => response.json())\n .then(json => {\n console.log(\"Result of posting a new question:\");\n console.log(json);\n this.getData();\n }); // Get the data\n }", "async function requestAddPoints(setAddPoints) {\n try {\n const response = await fetch(`${API_URL}/user/points`, {\n method:\"POST\",\n body:JSON.stringify({ amount:\"1000\" }),\n headers: {\n \"content-type\": \"application/json\",\n Accept: \"application/json\",\n Authorization: \"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJfaWQiOiI2MTFkMzIwYmMxZDFhNzAwMjE5ZjNjM2YiLCJpYXQiOjE2MjkzMDMzMDd9.hQvbprVSC3iqDFNO9_xGgb-95zLRg3KFwGUstJmCew4\",\n }\n });\n const data = await response.json();\n setAddPoints(data);\n }\n catch (e) {\n console.error(\"error\",e);\n }\n}", "httpPost(reqObj) {\n reqObj.jar = this.jar\n return new Promise((resolve, reject) => {\n this.request.post(reqObj)\n .then(function(body) {\n resolve(body)\n })\n .catch(function(e) {\n console.log('http post failed : ' + e.message)\n console.log(reqObj)\n process.exit(1)\n })\n })\n }", "_startRequest() {\n if (this._timeoutID !== undefined)\n clearTimeout(this._timeoutID);\n \n this._makeRequest()\n .then(({ request }) => {\n if (!this.isStarted)\n return;\n \n let delay = this._defaultTimeout;\n \n // Read ResponseHeader\n let cacheControl = request.getResponseHeader('Cache-Control');\n if (cacheControl !== null) {\n let maxAges = /(^|,)max-age=([0-9]+)($|,)/.exec(cacheControl);\n if (maxAges !== null &&\n maxAges[2] > 0)\n delay = Math.round(maxAges[2]*1000);\n }\n \n this.trigger('success:request', { request });\n \n if (delay !== undefined)\n this._planRequest({ delay });\n }, ({ request } = {}) => {\n if (!this.isStarted)\n return;\n \n if (request === undefined)\n return;\n \n this.trigger('error:request', { request });\n \n if (this._timeoutOnError !== undefined)\n this._planRequest({ delay: this._timeoutOnError });\n });\n }", "save(resource, object) {\n const url = `${baseUrl}/${resource}/`\n return this.fetchFactory(url, \"POST\", object)\n }", "postData(id, value, timestamp) {\n return new Promise((resolve, reject) => {\n const url = this.url + '/' + id;\n const body = value + ' ' + timestamp;\n\n request.post(url, {body}, (err, res) => {\n if (err) return reject(err);\n return resolve(res);\n });\n });\n }", "function addAPIReq(userGUID, apiName){\n return new Promise(async (resolve, reject) => {\n var request = JSON.parse(templates.req_API);\n\n request.status = 1;\n request.req_date = new Date();\n request.info.clientGUID = userGUID;\n request.info.project_name = apiName;\n\n try{\n var add = await redis.SADDSync('req_api', JSON.stringify(request));\n resolve(add);\n } catch(reject) {\n reject({\"Error\" : reject, \"Method\" : \"addAPIReq()\", \"Code\" : 1});\n }\n });\n}", "request (type, options) {\n return this.queue.push(this._requestTask, {\n client: this,\n options,\n type\n })\n }", "createRecord(){\n const logObject = {...this.response };\n var db = admin.database();\n var submissions = db.ref(\"advice/submissions\");\n const newSubmission = submissions.push(logObject);\n this.submissionId = newSubmission.key;\n this.response.submissionId = newSubmission.key;\n }", "async addEndUser(id, data) {\n let value = {\n endorsedBy: data\n };\n let response = await axios.patch(`${API_URL}/requests/${id}`, value);\n return response;\n }", "function requestObject(iUrl, iMethod, iAsync, iType)\r\n{\r\n\tthis.url = iUrl;\r\n\tthis.method = iMethod;\r\n\tthis.async = iAsync;\r\n\tthis.type = iType;\r\n}", "function create(request) {\n return request.$save(function (data) {\n service.reqeuests.push(data);\n });\n }", "function sendRequest(obj, request, httpService, action, error) {\n obj.running = true;\n obj.valid = null;\n obj.raw = null;\n\n // action and error are functions for the promise. if defined they'll be run after the default action and error functions\n let _action = function (result) {\n obj.raw = result;\n obj.valid = true;\n\n if (action) {\n action(result);\n }\n\n obj.running = false;\n };\n\n let _error = function (result) {\n obj.raw = result;\n obj.valid = false;\n\n if (error) {\n error(result);\n }\n\n obj.running = false;\n };\n\n httpService(request).then(_action).catch(_error);\n}", "add(properties) {\r\n return this.postCore({\r\n body: jsS(properties),\r\n }).then(r => {\r\n return {\r\n data: r,\r\n event: this.getById(r.id),\r\n };\r\n });\r\n }", "deferred() {\n const struct = {}\n struct.promise = new MyPromise((resolve, reject) => {\n struct.resolve = resolve\n struct.reject = reject\n })\n return struct\n }", "function product(product_id) {\n var productid = product_id\n console.log(productid)\n fetch(`http://127.0.0.1:5000/product/${productid}`)\n .then(response => {\n return response.json();\n }).then(data => {\n console.log(data);\n addProductToart(productid, userid)\n }).catch(error => {\n console.log(error);\n });\n}", "enqueueRequest(url, method, query) {\n return new Promise((resolve, reject) => {\n this.createObjectForQueue(\n {\n \"url\" : url,\n \"method\" : method,\n \"query\" : query || null\n },\n (error, response, data) => {\n if (error) {\n reject(error);\n }\n resolve({response, data})\n }\n )\n });\n }", "async add () {\n\t\t// send this back to the collection class, it will handle caching\n\t\tawait this.collection._addModelsToCache(this.fetchedModels);\n\t}", "function apiAdd(request, response, next) {\r\n const body = request.body\r\n\r\n const person = new Person({\r\n name: body.name,\r\n number: body.number\r\n })\r\n\r\n person\r\n .save()\r\n .then(newPerson => newPerson.toJSON())\r\n .then(newAndFormattedPerson => {\r\n response.json(newAndFormattedPerson)\r\n })\r\n .catch(error => next(error))\r\n}", "async function getIndividualInfo(id){\n \n const idObject = {id}\n const options = {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json'\n },\n body: JSON.stringify(idObject)\n }\n\n\n return await fetch('/api/PlantID', options)\n .then(resp => resp.json())\n .then(data => {\n console.log(data);\n return data;\n });\n}", "add(object) {\n return this.addWithID(object, Juggler.getNextID())\n }", "updateRequest(rubricTitle, data) {\n return new Promise(() => {\n const newdata = {\n \"name\": rubricTitle,\n \"cards\": data,\n \"user_id\": this.props.user.id\n };\n let dataString = JSON.stringify(newdata);\n fetch('/api/rubrics/' + this.props.selectedRubric, {\n method: 'PUT',\n body: dataString,\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n },\n }).then(function (response) {\n if (response.status === 201 || response.ok ){\n alert(\"Rubric Updated\");\n }\n else {\n alert(\"could not update rubric\");\n }\n }).then(()=> this.props.history.push('/tasks/rubric'));\n });\n }", "acceptFriendRequest(requestId){\n AsyncStorage.getItem('@MySuperStore:token', (err, token) => {\n var message = {requestId:requestId};\n fetch('http://journal-app-mundane-unicorns.herokuapp.com/api/friendreq', {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/json',\n 'x-access-token': token\n },\n body: JSON.stringify(message)\n })\n .then((response) => {\n this.getFriendRequests();\n this.getFriends();\n })\n .catch((error) => {\n console.log(\"fetch error:\", error)\n });\n });\n }", "function onRequest() {\n req = new Request(head, body);\n res = new Response();\n\n return runLayer(0).then(onResponse);\n }", "_makeRequest(hash) {\n const method = hash.method || hash.type || 'GET';\n const requestData = { method, type: method, url: hash.url };\n if (isJSONStringifyable(method, hash)) {\n hash.data = JSON.stringify(hash.data);\n }\n pendingRequestCount = pendingRequestCount + 1;\n const jqXHR = (0, _ajax.default)(hash.url, hash);\n const promise = new _promise.default((resolve, reject) => {\n jqXHR.done((payload, textStatus, jqXHR) => {\n const response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n if ((0, _errors.isAjaxError)(response)) {\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n } else {\n const resolutionParam = {\n payload,\n textStatus,\n jqXHR,\n response\n };\n Ember.run.join(null, resolve, resolutionParam);\n }\n }).fail((jqXHR, textStatus, errorThrown) => {\n Ember.runInDebug(function () {\n const message = `The server returned an empty string for ${requestData.type} ${requestData.url}, which cannot be parsed into a valid JSON. Return either null or {}.`;\n const validJSONString = !(textStatus === 'parsererror' && jqXHR.responseText === '');\n (true && Ember.warn(message, validJSONString, {\n id: 'ds.adapter.returned-empty-string-as-JSON'\n }));\n });\n const payload = this.parseErrorResponse(jqXHR.responseText) || errorThrown;\n let response;\n if (textStatus === 'timeout') {\n response = new _errors.TimeoutError();\n } else if (textStatus === 'abort') {\n response = new _errors.AbortError();\n } else {\n response = this.handleResponse(jqXHR.status, (0, _parseResponseHeaders.default)(jqXHR.getAllResponseHeaders()), payload, requestData);\n }\n const rejectionParam = {\n payload,\n textStatus,\n jqXHR,\n errorThrown,\n response\n };\n Ember.run.join(null, reject, rejectionParam);\n }).always(() => {\n pendingRequestCount = pendingRequestCount - 1;\n });\n }, `ember-ajax: ${hash.type} ${hash.url}`);\n promise.xhr = jqXHR;\n return promise;\n }" ]
[ "0.6012331", "0.5901183", "0.5692562", "0.55865765", "0.5539898", "0.5520077", "0.5489616", "0.54841393", "0.54266644", "0.54266644", "0.5402808", "0.53662944", "0.5362702", "0.5324244", "0.5316133", "0.5299805", "0.52629435", "0.5257433", "0.52171266", "0.520496", "0.5204188", "0.5191231", "0.5186172", "0.517612", "0.51749986", "0.51693267", "0.51612264", "0.51566285", "0.5136819", "0.5132726", "0.5101434", "0.509706", "0.50831676", "0.5075666", "0.50555307", "0.50528145", "0.50528145", "0.5047921", "0.5045599", "0.50433606", "0.50354433", "0.5032826", "0.50295514", "0.5028234", "0.502", "0.5016325", "0.50119233", "0.5004298", "0.50039685", "0.4977679", "0.49758574", "0.49750057", "0.4974352", "0.49732035", "0.4968475", "0.49643177", "0.4961501", "0.49561802", "0.4955116", "0.4952102", "0.49454314", "0.494157", "0.49344677", "0.4924517", "0.49184594", "0.49141055", "0.49122754", "0.49104804", "0.49062917", "0.4899731", "0.4896292", "0.488772", "0.48817772", "0.48788345", "0.48755977", "0.48750255", "0.4871793", "0.48697025", "0.48674574", "0.48623118", "0.48621428", "0.4861869", "0.48592958", "0.48579335", "0.48574418", "0.48574093", "0.4851814", "0.4846758", "0.4845979", "0.48433128", "0.48412472", "0.48394448", "0.48388553", "0.48356128", "0.48260534", "0.48236862", "0.4820179", "0.48167917", "0.47994196", "0.47993997", "0.47992548" ]
0.0
-1
getter get the current player time
function getCurrentTime() { var currentTime = editor.player.prop("currentTime"); currentTime = isNaN(currentTime) ? 0 : currentTime.toFixed(4); return parseFloat(currentTime); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get currentTime () {\n return this.player.currentTime();\n }", "getPlayTime() {\n return this.time;\n }", "function getCurrentTime(playerId){\n\t\treturn mPlayers[playerId].currentTime;\n\t}", "getCurrentTime() {\r\n\t\treturn new Promise(res => {\r\n\t\t\tswitch (this.source) {\r\n\t\t\t\tcase 'vimeo': this.player.getCurrentTime().then(secs => res(Math.floor(secs))); break;\r\n\t\t\t\tcase 'yt': res(Math.floor(this.player.getCurrentTime()));\r\n\t\t\t\tcase 'n': res(Math.floor(this.player.currentTime)); break;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "get time () {\n\t\treturn this._time;\n\t}", "function getCurrentTIME() {\n\t\t\tvar player_time = Processing.getInstanceById('raced');\n\t\t\t\t$('#jquery_jplayer_1').bind($.jPlayer.event.timeupdate, function(event) { // Adding a listener to report the time play began\n\t\t\t\t\tvar jstime = event.jPlayer.status.currentTime;\n\t\t\t\t\tvar percentduration = event.jPlayer.status.currentPercentAbsolute;\t\n\t\t\t\t\t\t\tplayer_time.timecurrent(jstime);\n\t\t\t\t\t\t\tplayer_time.timepercent(percentduration);\n\t\t\t\t});\n\t\t\t}", "get time () { throw \"Game system not supported\"; }", "get time() {}", "get time() {\n return this._time;\n }", "getGameTime() {\n return this.time / 1200;\n }", "getPlaybackTime()\n {\n return this.transport.getPlaybackTime();\n }", "getCurrentTime() {\n return Math.floor(Date.now() / 1000);\n }", "getCurrentTime() {\n const today = new Date();\n var time = today.getHours() + \":\" + today.getMinutes();\n if (today.getMinutes() < 10) {\n time = today.getHours() + \":0\" + today.getMinutes();\n }\n return time;\n }", "function get_time() {\n return Date.now();\n}", "getTime(){return this.time;}", "function currentTime () {\n return new Date().toLocaleTimeString()\n}", "currentTime() {\n this.time24 = new Time();\n this.updateTime(false);\n }", "getCurrentTime(){\n //Declaring & initialising variables\n\t\tlet crnt = new Date();\n\t\tlet hr = \"\";\n\t\tlet min = \"\";\n\n\t\t//checking if the hours are sub 10 if so concatenate a 0 before the single digit\n\t\tif (crnt.getHours() < 10){\n\t\t\thr = \"0\" + crnt.getHours();\n\t\t}\n\t\telse{\n\t\t\thr = crnt.getHours();\n\t\t}\n\n\t\t//checking if mins are sub 10 if so concatenate a 0 before the single digit\n\t\tif (crnt.getMinutes() < 10){\n\t\t\tmin = \"0\" + crnt.getMinutes()\n\t\t\treturn hr + \":\" + min\n\t\t}\n\t\telse{\n\t\t\tmin = crnt.getMinutes();\n\t\t\treturn hr + \":\" + min\n\t\t}\n\t}", "function getTime() {\r\n var currentTime = new Date();\r\n var hours = currentTime.getHours();\r\n var minutes = currentTime.getMinutes();\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes;\r\n }\r\n return hours + \":\" + minutes;\r\n}", "function time() {\r\n var data = new Date();\r\n var ora = addZero( data.getHours() );\r\n var minuti = addZero( data.getMinutes() );\r\n return orario = ora + ':' + minuti;\r\n }", "function currentTime() {\n return Math.floor((new Date).getTime());\n}", "time() {\n return (new Date()).valueOf() + this.offset;\n }", "get time() {\n return (process.hrtime()[0] * 1e9 + process.hrtime()[1]) / 1e6;\n }", "function getCurrentPlayer (){\r\n return _currentPlayer;\r\n }", "get_current_time(video) {\n\n /* currentTime には、現在時刻が入っているため使用できない */\n return -1;\n }", "function get_time(){\n const today = new Date()\n let time = today.getHours() + \":\" + today.getMinutes();\n return time;\n }", "get timeOrigin() {\n return this[kTimeOriginTimestamp];\n }", "function output_time() { // output the current time\r\n\ttime.value = player_data.current_time;\r\n}", "getCurrentPlayer() {\n return this.players[this.currentPlayerIndex]\n }", "static get_time() {\n return (new Date()).toISOString();\n }", "function currentTime() {\n const today = new Date();\n let hours = today.getHours();\n let mins = today.getMinutes();\n let ampm = \"am\";\n\n if (hours >= 12) {\n ampm = \"pm\";\n }\n if (mins < 10) {\n mins = '0' + mins;\n }\n hours = hours % 12;\n let time = hours + \":\" + mins + ampm;\n return time;\n}", "get() {\n let date = new Date();\n\n Object.assign(this.currentTime, {\n hours : date.getHours(),\n minutes : date.getMinutes(),\n seconds : date.getSeconds()\n })\n }", "function currentTime() {\n return Math.round(Date.now() / 1000);\n}", "function currentTime() {\n return Math.round(Date.now() / 1000);\n}", "function currentTime(){\n let now = new Date();\n\n const hh = String(now.getHours()).padStart(2, '0');\n const mm = String(now.getMinutes()).padStart(2, '0');\n\n now = hh + ':' + mm;\n\n return now; \n}", "function getCurrentTime(){\n\t//get timestamp and format it\n\t\tvar date = new Date();\n\t\tvar hours = date.getHours()\n\t\tvar ampm = (hours >= 12) ? \"PM\" : \"AM\";\n\t\thours = hours% 12||12;\n\t\tvar minutes =date.getMinutes();\n\t\tminutes = (minutes <10) ? \"0\" + minutes:minutes;\n\t\treturn \"(\" + hours + \":\" + minutes + ampm + \")\";\n}", "function get_time() {\n let d = new Date();\n if (start_time != 0) {\n d.setTime(Date.now() - start_time);\n } else {\n d.setTime(0);\n }\n return d.getMinutes().toString().padStart(2,\"0\") + \":\" + d.getSeconds().toString().padStart(2,\"0\");\n }", "function getCurrentTime() {\r\n //returns time in minutes\r\n return Math.round(new Date().getTime() / 1000 / 60);\r\n}", "function getCurrentTime() {\r\n //returns time in minutes\r\n return Math.round(new Date().getTime() / 1000 / 60);\r\n}", "function time() {\n var date = new Date();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n var time = hours + \":\" + minutes\n return time;\n}", "function returnTime(){\n let d = new Date();\n // Get the time settings\n let min = d.getMinutes();\n let hour = d.getHours();\n let time = hour + \":\" + min;\n return time;\n}", "function o2ws_get_time() { return o2ws_get_float(); }", "currentTime(time) {\n\t\tconst cTime = Moment(time).format('LTS');\n\t\tthis.setState({\n\t\t\ttime: cTime\n\t\t});\n\t\treturn cTime;\n\t}", "function GetCurrentTime() {\n var sentTime = new Date();\n var dateTime = sentTime.toLocaleString();\n return dateTime;\n}", "getRealTime() {\n return Math.floor(this.time / 1000);\n }", "function gettime() {\n //return Math.round(new Date().getTime() / 1000);\n return Math.round(Date.now() / 1000);\n}", "function currentTime() {\n\tvar d = new Date();\n var x = document.getElementById(\"demo\");\n var h = addZero(d.getHours());\n var m = addZero(d.getMinutes());\n var current = h+\":\"+m;\n return current;\t\n}", "getCurrentTime() {\n // Creating variables to hold time.\n var totalSeconds, date, hour, minutes, seconds;\n\n // Creating Date() function object.\n date = new Date();\n\n // Getting current hour from Date object.\n hour = date.getHours();\n totalSeconds = hour * 3600;\n\n // Getting the current minutes from date object.\n minutes = date.getMinutes();\n totalSeconds += minutes * 60;\n\n //Getting current seconds from date object.\n seconds = date.getSeconds();\n totalSeconds += seconds;\n\n //gives us total seconds to perform arithmetic\n return totalSeconds;\n }", "function returnCurrentTime()\n{\n\t//YYYY-MM-DD HH:MM:SS\n\tvar d = new Date();\n\tvar time=d.getFullYear()+'-'+if0((d.getMonth()+1))+'-'+if0(d.getDate())+' '+if0(d.getHours())+':'+if0(d.getMinutes())+':'+if0(d.getSeconds());\n\treturn time;\n}", "function get_time() {\n return new Date().getTime();\n}", "function get_time() {\n return new Date().getTime();\n}", "function GetCurrentTime() {\n var date = new Date();\n var hours = date.getHours() > 12 ? date.getHours() - 12 : date.getHours();\n var am_pm = date.getHours() >= 12 ? \"PM\" : \"AM\";\n hours = hours < 10 ? \"0\" + hours : hours;\n var minutes = date.getMinutes() < 10 ? \"0\" + date.getMinutes() : date.getMinutes();\n var seconds = date.getSeconds() < 10 ? \"0\" + date.getSeconds() : date.getSeconds();\n return hours + \":\" + minutes + \":\" + seconds + \" \" + am_pm;\n}", "get displayTime() {\n return this._timeEl.innerHTML;\n }", "getCurrentPlayer() {}", "getCurrentTime(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let playerId = options.playerId;\n if (playerId == null || playerId.length === 0) {\n playerId = 'fullscreen';\n }\n if (this._players[playerId]) {\n const seekTime = this._players[playerId].videoEl.currentTime;\n return Promise.resolve({\n method: 'getCurrentTime',\n result: true,\n value: seekTime,\n });\n }\n else {\n return Promise.resolve({\n method: 'getCurrentTime',\n result: false,\n message: 'Given PlayerId does not exist)',\n });\n }\n });\n }", "function getCurrentTime() {\n var minutes = minC.innerHTML;\n var seconds = secC.innerHTML;\n return parseInt(minutes)*60*1000 + parseInt(seconds)*1000;\n\n }", "function currentTime() { //returns current time in \"[HH:MM] \" 24hr format (string)\n var d = new Date();\n return '['+d.toTimeString().substr(0,5)+'] ';\n}", "function currentTime() {\n return +new Date() / 1000;\n}", "function getTimeNow () {\n\tvar x = new Date();\n\tvar h = x.getHours();\n\tvar m = x.getMinutes()/60;\n\tselectedTime = h + m;\n\treturn (h + m);\n}", "function getCurTime () {\n var myDate = new Date();\n return myDate.toLocaleTimeString();\n }", "function time() {\n return (Date.now() / 1000);\n }", "get(){\n\t\t// debug\n\t\t// console.log(\"atomicGLClock::get\");\t\n\t\treturn this.elapsed;\n\t}", "function getTime() {\n\ttest = new Date();\n\thour = test.getHours();\n\tminutes = test.getMinutes();\n\tvar suffix = hour >= 12 ? \"pm\":\"am\";\n\thour = ((hour + 11) % 12 + 1);\n\ttime = hour + \":\" + minutes + suffix;\n\treturn time;\n}", "function getCurrentTime() {\n\tconst time = performance.now() / 1000;\n\tconst secs = Math.floor(time % 60);\n\tconst mins = Math.floor((time / 60) % 60);\n\tconst hrs = Math.floor(time / 60 / 60);\n\n\treturn { hrs: (hrs < 10 ? '0' : '') + hrs,\n\t\tmins: (mins < 10 ? '0' : '') + mins,\n\t\tsecs: (secs < 10 ? '0' : '') + secs};\n}", "function currTime(){\n let timeout = new Date();\n return timeout.toString();\n}", "function curr_time(){\n return Math.floor(Date.now());\n}", "getTime() {\n\t\tlet progressWidth = this.progressBar.clientWidth / 100;\n\t\tthis.currentPosition.innerHTML =\n\t\t\tMath.floor(this.audio.currentTime.toFixed(0) / 60) +\n\t\t\t\":\" +\n\t\t\t(this.audio.currentTime.toFixed(0) < 10\n\t\t\t\t? `0${this.audio.currentTime.toFixed(0)}`\n\t\t\t\t: this.audio.currentTime.toFixed(0) % 60 < 10\n\t\t\t\t? `0${this.audio.currentTime.toFixed(0) % 60}`\n\t\t\t\t: this.audio.currentTime.toFixed(0) % 60\n\t\t\t\t? this.audio.currentTime.toFixed(0) % 60\n\t\t\t\t: \"00\");\n\t\tthis.getDuration();\n\t\tthis.progressBar.value =\n\t\t\t(this.audio.currentTime / this.audio.duration) * 100;\n\t\tthis.progressButton.style.left = `${\n\t\t\tthis.progressBar.value * progressWidth - 4\n\t\t}px`;\n\t}", "getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n }", "now () {\n return this.t;\n }", "function currentServerTime() {\n return firstServerTimestamp + (Date.now() - gameStart) - RENDER_DELAY;\n}", "get time ()\n\t{\n\t\tlet speed = parseInt (this.token.actor.data.data.attributes.movement.walk, 10);\n\t\t\n\t\tif (! speed)\n\t\t\tspeed = 30;\n\n\t\treturn speed / this.gridDistance;\n\t}", "function getTime(){ // gets time from HTML\r\n\t\treturn document.querySelector('#task-time').value;\r\n\t}", "function getTime() {\n\t\tvar currentTime = new Date();\n\t\tvar day = getDay(currentTime.getDay());\n\t\tvar month = getMonth(currentTime.getMonth());\n\t\tvar date = currentTime.getDate();\n\t\tvar year = currentTime.getFullYear();\n\n\t\treturn day + \" \" + month + \" \" + date + \" \" + year;\n\n\t\t/*var currentTime = new Date();\n\t\t var hours = currentTime.getHours();\n\t\t var minutes = currentTime.getMinutes();\n\t\t return hours + \":\" + minutes;*/\n\t}", "get_presenceMinTime()\n {\n return this.liveFunc._presenceMinTime;\n }", "function getTime() {\n\n var currentTime = new Date();\n var hours = currentTime.getHours();\n var minutes = currentTime.getMinutes();\n var amOrPm = (hours > 11 ? 'PM':'AM');\n \n if( hours===0 ) hours = 12;\n else if( hours>12 ) hours = hours - 12;\n\n minutes = ( minutes < 10 ? '0' + minutes : minutes );\n\n return hours + ':' + minutes + amOrPm;\n}", "set currentTime (time) {\n this.player.currentTime(time);\n }", "function getTime() {\r\n\ttime = new Date();\r\n\treturn time.getTime();\r\n}", "function getCurrentPlayer() {\n\treturn gameState.players[gameState.turnIndex];\n}", "function currentTime(type,showSeconds) {\r\n\tvar d = new Date();\r\n\tvar curr_hour = d.getHours();\r\n\tif (curr_hour < 10) curr_hour = '0'+curr_hour;\r\n\tvar curr_min = d.getMinutes();\r\n\tif (curr_min < 10) curr_min = '0'+curr_min;\r\n\tvar curr_sec = d.getSeconds();\r\n\tif (curr_sec < 10) curr_sec = '0'+curr_sec;\r\n\tif (type=='m') return curr_min;\r\n\telse if (type=='h') return curr_hour;\r\n\telse if (type=='s') return curr_sec;\r\n\telse return curr_hour+':'+curr_min+(showSeconds ? ':'+curr_sec : '');\r\n}", "get timeLeft(){\n return this.getSeconds(this.currentTimeInput.value);\n \n }", "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "function getCurrentTime(){\n return '[' + moment.format(\"HH:mm\") + '] ';\n}", "function currentTime() {\r\n let time = new Date();\r\n let h = time.getHours();\r\n let m = time.getMinutes();\r\n let s = time.getSeconds();\r\n if (m < 10) m = \"0\" + m;\r\n if (s < 10) s = \"0\" + s;\r\n document.getElementById('currentTime').innerHTML = h + \":\" + m + \":\" + s;\r\n}", "function currentTime() {\n var timeNow = moment().format('h:mm a')\n $(\"#currentTime\").text(timeNow)\n }", "time() {\n\n var d = new Date();\n\n t = d.getTime()\n\n return t;\n\n }", "now() {\n // Copy-Constructor, otherwise it'd return a live reference to the original time\n return new Date(this.time.getTime());\n }", "function getCurrentTime() {\n return new Date().getTime();\n}", "function now() {\n return new Time(new Date());\n}", "function printTime(){\n var currentTime = new Date();\n var time = currentTime.getHours() + \":\" + currentTime.getMinutes() + \":\" + currentTime.getSeconds();\n return time;\n}", "function getCurrentTime() {\n\n \t\tvar now = new Date();\n \t\tvar dayMonth = now.getDate();\n \t\tvar meridien = \"AM\";\n \t\tvar hours = now.getHours();\n \t\tvar minutes = now.getMinutes();\n \t\tvar month = (now.getMonth()) + 1;\n \t\tvar start = new Date(now.getFullYear(), 0, 0);\n \t\tvar diff = now - start;\n \t\tvar oneDay = 1000 * 60 * 60 * 24;\n \t\tvar day = Math.floor(diff / oneDay);\n \t\tvar seconds = now.getSeconds();\n \n \t\tif ( hours >= 12 ) {\n \t\t \n \t\t\tmeridien = \"PM\"\n \t\t\thours = hours - 12; \n \t\t\t\n \t\t}//end of if statement\n \n \t\tif (minutes < 10 ){\n \t\t\tminutes = \"0\"+minutes;\n \t\t} //end of if statement\n \n \t\treturn{\n \t\t hours : hours,\n \t\t\tminutes : minutes,\n \t\t\tmeridien : meridien,\n \t\t\tmonth : month,\n \t\t\tday : day,\n \t\t\tseconds : seconds,\t\n\t\t\t\tdayMonth : dayMonth\t\t\n\t\t\t}//end of return\n }", "getMinutes() {\n\n let minutes = Math.floor(this.currentTime / 60)\n return minutes\n // ... your code goes here\n }", "getCurrentPlayer() {\n return this.findPlayerByName(this.props.playerName);\n }", "function currentTime() {\n var now = new Date();\n var offset = now.getTimezoneOffset();\n var actual = now - offset;\n var str_date = new Date(actual).toLocaleDateString();\n var str_time = new Date(actual).toLocaleTimeString();\n return str_date + ' ' + str_time;\n}", "get requestTime() {\n return this.get('x-request-time');\n }", "function getCurrTime() {\r\n let currentDate = new Date();\r\n return currentDate.getTime(); \r\n}", "function getTime() {\n\tvar Time = new Date();\n\treturn Time.toISOString().slice(0,10) + \" \" + Time.getHours() + \":\" + Time.getMinutes() + \":\" + Time.getSeconds();\n}", "getWinner() {\n // le gagnant est le dernier joueur à avoir joué\n return this.getCurrentPlayer();\n }", "function getTimeStamp(){\n\treturn document.getElementsByClassName(\"video-stream html5-main-video\")[0].currentTime\n}", "function getTime() {\n var date = new Date();\n var hours = date.getHours();\n var minutes = date.getMinutes();\n return \"(\" +hours + \":\" + minutes + \")\";\n}", "get currentHour(){\n //returning in the format 01 - 24 \n return this._moment.format(`HH`); \n }" ]
[ "0.80028486", "0.7827482", "0.7630825", "0.7301636", "0.73012066", "0.72712994", "0.72541434", "0.72366214", "0.7227915", "0.7201809", "0.7123555", "0.7030311", "0.6959288", "0.6953379", "0.69412917", "0.685612", "0.6833286", "0.67971516", "0.67957175", "0.67777544", "0.67711747", "0.6765547", "0.6761128", "0.67337656", "0.67063296", "0.669523", "0.6669294", "0.66621953", "0.6634319", "0.66173774", "0.6613601", "0.6604489", "0.6595585", "0.6595585", "0.65785074", "0.6575929", "0.6573687", "0.6552156", "0.6552156", "0.65503067", "0.654546", "0.6534119", "0.649672", "0.64806485", "0.64792985", "0.6476603", "0.6472547", "0.64683294", "0.64583325", "0.64548886", "0.64548886", "0.64548457", "0.643653", "0.64228517", "0.64028907", "0.6398693", "0.63973916", "0.6373356", "0.6363084", "0.6361513", "0.63606447", "0.6342876", "0.63311535", "0.6329636", "0.63150275", "0.6306629", "0.62989867", "0.62967956", "0.62927985", "0.6290251", "0.62826836", "0.6282275", "0.6273315", "0.6269586", "0.6266433", "0.62653446", "0.6264176", "0.62636644", "0.62608486", "0.6248384", "0.6236533", "0.62294555", "0.62240237", "0.6211499", "0.619716", "0.6189895", "0.6187322", "0.618709", "0.61786944", "0.6177666", "0.61733854", "0.6171038", "0.6169393", "0.6169363", "0.61509424", "0.6150356", "0.61493254", "0.61458004", "0.6141936", "0.61376023" ]
0.75910133
3
get the media duration
function getDuration() { var duration = editor.player.prop("duration"); duration = isNaN(duration) ? 0 : parseFloat(duration).toFixed(4); return duration; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "duration() {\n return this.d || (this.context && this.context.song && this.context.song.duration())\n }", "getDuration() {\n return this.video.duration;\n }", "function getMediaFileDuration (filePath, cb) {\n getMetaData(filePath, function (metadata) {\n cb(metadata ? metadata['format']['duration'] : 0)\n })\n}", "_audioDuration() {\n if (this.live) {\n return Infinity\n }\n else {\n return this.video.duration * 1000;\n }\n }", "function getDuration() {\n\t\tvar displayLength = document.getElementById('vidLength');\n\t\t\n\t\t// Gets the duration of the video\n\t\tvar vidLength = video.duration;\n\t\t\n\t\t// Rounds down video length and displays it\n\t\tvidLength = Math.floor(vidLength);\n\t\tvidLength = '00:' + vidLength;\n\t\tdisplayLength.textContent = vidLength;\n\t}", "get duration() {\n if (!this.endedLocal) {\n return null;\n }\n const ns = this.diff[0] * 1e9 + this.diff[1];\n return ns / 1e6;\n }", "getDuration() {\n this.duration = this.api.video.duration\n }", "duration() {\n return this.tracks.reduce((trackMax, track) => Math.max(trackMax, track.keyframes.reduce((kfMax, kf) => Math.max(kfMax, kf.time), 0)), 0);\n }", "get duration () {\n return this.player.duration();\n }", "duration() {\n return this.d\n }", "get duration() {\n\t\tconst items = this.items;\n\t\tlet item;\n\t\tlet time = 0;\n\t\tlet id;\n\n\t\tfor (id in items) {\n\t\t\titem = items[id];\n\t\t\ttime = Math.max(time, item.totalDuration / item.playSpeed);\n\t\t}\n\t\treturn time;\n\t}", "get duration() {\n\t\treturn this.__duration;\n\t}", "duration() {\n let now = (this.end!==null)\n ? this.end\n : new Date().valueOf();\n return (this.since!==null)\n ? now - this.since.valueOf()\n : 0;\n }", "get durationMS() {\n if (this.endDate && this.startDate) {\n return this.endDateMS - this.startDateMS;\n } else {\n return DateHelper.asMilliseconds(this.duration || 0, this.durationUnit);\n }\n }", "get durationMS() {\n if (this.endDate && this.startDate) {\n return this.endDateMS - this.startDateMS;\n } else {\n return DateHelper.asMilliseconds(this.duration || 0, this.durationUnit);\n }\n }", "duration() {\n if (this.end) return this.end.getTime() - this.start.getTime();\n else return new Date().getTime() - this.start.getTime();\n }", "get videoLengthInSeconds() {\n return getVideoLengthInSeconds(this.videoLength);\n }", "getDuration() {\n\t\tlet time =\n\t\t\tMath.floor(this.audio.duration.toFixed(0)) -\n\t\t\tMath.floor(this.audio.currentTime.toFixed(0));\n\t\tthis.timeRemaining.innerHTML =\n\t\t\tMath.floor(time / 60) +\n\t\t\t\":\" +\n\t\t\t(time < 10\n\t\t\t\t? `0${time}`\n\t\t\t\t: time % 60 < 10\n\t\t\t\t? `0${time % 60}`\n\t\t\t\t: time % 60\n\t\t\t\t? time % 60\n\t\t\t\t: \"00\");\n\t\tif (this.audio.duration - this.audio.currentTime === 0) {\n\t\t\tthis.buttons.src = \"images/playbutton.svg\";\n\t\t}\n\t}", "get duration() {\n var _a, _b;\n const current = (_b = (_a = this.current) === null || _a === void 0 ? void 0 : _a.duration) !== null && _b !== void 0 ? _b : 0;\n return this\n .reduce((acc, cur) => acc + (cur.duration || 0), current);\n }", "get duration() {\n return this._duration;\n }", "function get_video_duration()\n{\n\tvar result = $.ajax({\n\t\tasync:false,\n\t\tcache:false,\n\t\ttype: \"GET\",\n\t\tdata: \"\",\n\t\tdataType: \"json\",\n\t\turl: site_url+\"video/video_duration/\"\t\t\n\t}).responseText;\n\t\n\t//alert(result);\n\treturn result;\t\n}", "get duration() {\n return this._duration + 's';\n }", "getDuration() {\nreturn this.duration;\n}", "get timingDuration () {\n\t\treturn this._timingDuration;\n\t}", "function getDuration(playerId){\n\t\treturn mPlayers[playerId].duration;\n\t}", "updateDuration() {\n let oldDuration = this.mediaSource.duration;\n let newDuration = Hls.Playlist.duration(this.masterPlaylistLoader_.media());\n let buffered = this.tech_.buffered();\n let setDuration = () => {\n this.mediaSource.duration = newDuration;\n this.tech_.trigger('durationchange');\n\n this.mediaSource.removeEventListener('sourceopen', setDuration);\n };\n\n if (buffered.length > 0) {\n newDuration = Math.max(newDuration, buffered.end(buffered.length - 1));\n }\n\n // if the duration has changed, invalidate the cached value\n if (oldDuration !== newDuration) {\n // update the duration\n if (this.mediaSource.readyState !== 'open') {\n this.mediaSource.addEventListener('sourceopen', setDuration);\n } else {\n setDuration();\n }\n }\n }", "function getDurationStr(elem){\n var style = window.getComputedStyle(elem);\n var browserDurationName = xtag.prefix.js+\"TransitionDuration\";\n \n if(style.transitionDuration){\n return style.transitionDuration;\n }\n else{\n return style[browserDurationName];\n }\n }", "function getDuration(measureName) {\n return measures && measures[measureName] || 0;\n }", "getDuration(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let playerId = options.playerId;\n if (playerId == null || playerId.length === 0) {\n playerId = 'fullscreen';\n }\n if (this._players[playerId]) {\n let duration = this._players[playerId].videoEl.duration;\n return Promise.resolve({\n method: 'getDuration',\n result: true,\n value: duration,\n });\n }\n else {\n return Promise.resolve({\n method: 'getDuration',\n result: false,\n message: 'Given PlayerId does not exist)',\n });\n }\n });\n }", "get fullDuration() {\n return {\n unit: this.durationUnit,\n magnitude: this.duration\n };\n }", "getDuration() { return this.endTime - this.startTime; }", "function getDurationOfDrink() {\n\n\tvar lastDrink = allDrinks[allDrinks.length -1];\n\n\tvar durationMillis = (dateSplitter(lastDrink.endTime)) - (dateSplitter(lastDrink.startTime));\n\n\tvar durationMinutes = Math.round(durationMillis / (1000 * 60));\n\n\treturn durationMinutes\n\n}", "getDuration(){\n // coefficient to increase or reduce the default animation duration\n var coeff = 1 / this.getSpeed()\n\n var duration = coeff * this.durationAnim\n\n // check if the duration is different from the one that has been used\n if (this.oldDuration !== duration){\n // duration is different. Therefore, the disks have to be re-rendered because\n // speed is one of their property\n this.oldDuration = duration\n this.setState({})\n\n }else{}\n\n return(duration)\n }", "function calculateDuration(milliseconds) { //function invoked programmatically when processing the Spotify server's response to a request for an artist's popular tracks\n let seconds = Math.round(milliseconds/1000); //let the 'seconds' variable represent the rounded result of the 'milliseconds' argument divided by 1000\n let mins = Math.floor(seconds/60); //let the 'mins' variable represent the rounded-down integer value of seconds divided by 60\n seconds = seconds % 60; //set 'seconds' equal to the remainder of 'seconds' divided by 60\n if(mins < 10) { //if 'mins' is less than 10\n mins = \"0\" + mins; //set 'mins' equal to \"0\" + mins\n }\n if (seconds < 10) { //if 'seconds' is less than 10\n seconds = \"0\" + seconds; //set 'seconds' equal to \"0\" + seconds\n }\n return mins + \":\" + seconds; //return the track duration in the format mm:ss (mins:seconds)\n}", "_getAnimationDuration(el) {\n let duration = window.getComputedStyle(el).transitionDuration\n\n return parseFloat(duration) * (duration.indexOf('ms') !== -1 ? 1 : 1000)\n }", "getAnimationDuration() {\n const itemsWidth = this.items.reduce((sum, item) => sum + getWidth(item), 0);\n\n // prettier-ignore\n const factor = itemsWidth / (this.initialItemsWidth * 2);\n return factor * this.options.duration;\n }", "function getNoteDuration(note){\n return Math.abs(note.stopTime - currTime);\n}", "function convertSongLengthToSecs() {\n var parts = _curr.songLength.split(\":\");\n return Math.round(parts[0] * 60) + (parts[1] * 1);\n }", "findDuration() {\n this.duration = 0;\n for(var i=0; i<this.sections.length; i++) {\n var sectionEnd = this.sections[i].getEndTime();\n if(sectionEnd > this.duration) {\n this.duration = sectionEnd;\n }\n }\n }", "getCharacterDuration(data) {\n const duration = (data - this.calculatePercent(this.getDomTransform())) / this._charatcerConfig.config.durationGlobal;\n const durationDef = duration === 0 ? duration + 0.1 : duration;\n return durationDef < 0 ? -durationDef : durationDef;\n }", "function gnc_getDuration(timeText) {\n if (!timeText) {\n return 0;\n }\n\n var duration;\n if (timeText.indexOf('ms') !== -1) {\n duration = parseInt(timeText);\n } else {\n duration = Math.round(parseFloat(timeText) * 1000.0);\n }\n return isNaN(duration) ? 0 : duration;\n}", "function getNoteDuration(measure, noteNumber) {\n var durations = measure.getElementsByTagName(\"duration\");\n var noteDuration = durations[noteNumber].childNodes[0].nodeValue;\n return noteDuration;\n}", "updateDuration(isLive) {\n if (this.updateDuration_) {\n this.mediaSource.removeEventListener('sourceopen', this.updateDuration_);\n this.updateDuration_ = null;\n }\n if (this.mediaSource.readyState !== 'open') {\n this.updateDuration_ = this.updateDuration.bind(this, isLive);\n this.mediaSource.addEventListener('sourceopen', this.updateDuration_);\n return;\n }\n\n if (isLive) {\n const seekable = this.seekable();\n\n if (!seekable.length) {\n return;\n }\n\n // Even in the case of a live playlist, the native MediaSource's duration should not\n // be set to Infinity (even though this would be expected for a live playlist), since\n // setting the native MediaSource's duration to infinity ends up with consequences to\n // seekable behavior. See https://github.com/w3c/media-source/issues/5 for details.\n //\n // This is resolved in the spec by https://github.com/w3c/media-source/pull/92,\n // however, few browsers have support for setLiveSeekableRange()\n // https://developer.mozilla.org/en-US/docs/Web/API/MediaSource/setLiveSeekableRange\n //\n // Until a time when the duration of the media source can be set to infinity, and a\n // seekable range specified across browsers, the duration should be greater than or\n // equal to the last possible seekable value.\n\n // MediaSource duration starts as NaN\n // It is possible (and probable) that this case will never be reached for many\n // sources, since the MediaSource reports duration as the highest value without\n // accounting for timestamp offset. For example, if the timestamp offset is -100 and\n // we buffered times 0 to 100 with real times of 100 to 200, even though current\n // time will be between 0 and 100, the native media source may report the duration\n // as 200. However, since we report duration separate from the media source (as\n // Infinity), and as long as the native media source duration value is greater than\n // our reported seekable range, seeks will work as expected. The large number as\n // duration for live is actually a strategy used by some players to work around the\n // issue of live seekable ranges cited above.\n if (isNaN(this.mediaSource.duration) || this.mediaSource.duration < seekable.end(seekable.length - 1)) {\n this.sourceUpdater_.setDuration(seekable.end(seekable.length - 1));\n }\n return;\n }\n\n const buffered = this.tech_.buffered();\n let duration = Vhs.Playlist.duration(this.mainPlaylistLoader_.media());\n\n if (buffered.length > 0) {\n duration = Math.max(duration, buffered.end(buffered.length - 1));\n }\n\n if (this.mediaSource.duration !== duration) {\n this.sourceUpdater_.setDuration(duration);\n }\n }", "function getPlayerDownloadTime() {\n try {\n var timings = performance['getEntries']('resource');\n var re = /playercore.*js/;\n var downloads = timings.filter(function(t) {\n return re.exec(t['name']) !== null;\n });\n\n if (downloads && (downloads.length > 0)) {\n var playerDownloadTime = Math$round(downloads[0]['duration']);\n return JSON.stringify(playerDownloadTime);\n }\n } catch (e) {\n //performance getEntries is not supported\n }\n}", "totalTime() {\n return this.duration() / (this.tempo() / 60)\n }", "get timeRemaining(){\n\t\treturn parseFloat(this.durationInput.value);\n\t}", "function getDuration(unit, count) {\n if (!_utils_Type__WEBPACK_IMPORTED_MODULE_0__[\"hasValue\"](count)) {\n count = 1;\n }\n return timeUnitDurations[unit] * count;\n}", "convertDuration(note) {\n\t\tswitch (note.duration) {\n\t\t\tcase 'w':\n\t\t\t\treturn '1';\n\t\t\tcase 'h':\n\t\t\t\treturn note.isDotted() ? 'd2' : '2';\n\t\t\tcase 'q':\n\t\t\t\treturn note.isDotted() ? 'd4' : '4';\n\t\t\tcase '8':\n\t\t\t\treturn note.isDotted() ? 'd8' : '8';\n\t\t}\n\n\t\treturn note.duration;\n\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function _getTotalPlayTime() {\n _sliceAll(playback.mediaTime.value);\n // use video for calculating total\n var totalPlayTime = 0;\n var i = _playedVideo.length;\n while (i--) {\n totalPlayTime += (_playedVideo[i].endTime - _playedVideo[i].startTime);\n }\n debug$assert(totalPlayTime === Math$floor(totalPlayTime), \"Value of totalPlayTime is not an integer.\");\n return parseInt(Math$floor(totalPlayTime));\n }", "$mediaplayerProgress({ currentTime, duration }) {\n // console.log(currentTime, duration);\n}", "function getVideoDuration(){\n var durian=document.getElementById('videoAction').duration;\n console.log(parseInt(durian));\n if(parseInt(durian)){\n\n if(document.getElementById('range-1b').max!=Math.ceil(durian)){\n document.getElementById('range-1b').value=Math.ceil(durian);\n document.getElementById('range-1b').max=Math.ceil(durian);\n document.getElementById('range-1a').max=Math.ceil(durian);\n }\n\n return Math.ceil(durian);\n\n }\n else\n return 100;\n}", "get fullDuration() {\n // Used for formatting during export\n return new Duration({\n unit: this.durationUnit,\n magnitude: this.duration\n });\n }", "get timeRemaining() {\n return parseFloat(this.numberDurationInput.value);\n }", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function getLongestDuration() {\n\n let longestDuration = bufferList.reduce((longestDuration, buffer) => {\n return buffer.duration > longestDuration ? buffer.duration : longestDuration\n }, 0);\n\n return longestDuration * 1000; // Convert to ms\n }", "function calculateDuration() {\n return endTime - startTime;\n }", "function duration(s) {\n if (typeof(s) == 'number') return s;\n var units = {\n days: { rx:/(\\d+)\\s*d/, mul:86400 },\n hours: { rx:/(\\d+)\\s*h/, mul:3600 },\n minutes: { rx:/(\\d+)\\s*m/, mul:60 },\n seconds: { rx:/(\\d+)\\s*s/, mul:1 }\n };\n var result = 0, unit, match;\n if (typeof(s) == 'string') for (var key in units) {\n unit = units[key];\n match = s.match(unit.rx);\n if (match) result += parseInt(match[1])*unit.mul;\n }\n return result*1000;\n}", "function calculateDuration() {\n return endTime - startTime;\n }", "function handlePlayerDuration(startTime, endTime) {\r\n var duration = endTime.getTime() - startTime.getTime();\r\n\r\n var result = {\r\n durationInMilliseconds: duration,\r\n durationDescription: null\r\n };\r\n\r\n result.durationDescription = getDurationDescription(duration);\r\n return result;\r\n }", "function durationInMinutes(start, end) {\n var duration = end - start;\n return Math.round(duration/MINUTES);\n}", "function getAudioEditorGlobalPreviewTime() {\n var selected_component = $('._audio_editor_component._selected');\n if(selected_component.length == 0) {\n return 0;\n } else {\n var flag = true;\n var tot = 0;\n $('._audio_editor_component').each(function() {\n if($(this).hasClass('_selected')) {\n flag = false;\n tot += ($(this).find('._media_player_slider').slider('value') - $(this).data('from'));\n } else if(flag) {\n tot += $(this).data('duration');\n }\n });\n return tot;\n }\n}", "get timeRemaining() {\n return parseFloat(this.durationInput.value);\n }", "function getTime() {\n var video = document.getElementsByTagName( \"video\" )[0];\n if( video != null ) {\n var s = video.currentTime;\n return secondsTimeSpanToHMS( s );\n }\n return -1;\n}", "function computeTimeUnitSize(duration){\n\treturn $(\"#diagram\").width()/duration ;\n}", "async function getFileDuration(filePath, fileFolder) {\n console.log(\"************************************\");\n console.log(\"getFileDuration in Conversion Util Endpoint: \");\n\n try {\n //then we save a list of the durations of each recording\n console.log('INFORMATION OF THE RECORDING')\n await shell.cd(fileFolder)\n const { stdout, stderr, code } = await shell.exec('sudo ffmpeg -i ' + filePath, { silent: true })\n\n console.log('RESULT AUDIO DURATION>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>')\n\n var duration = stderr.substring(\n stderr.lastIndexOf(\"Duration:\") + 1,\n stderr.lastIndexOf(\", bitrate\")\n );\n duration = duration.replace('uration: ', '');\n console.log(duration)\n\n return duration;\n } catch (error) {\n console.error(error);\n }\n}", "function timeGetNoteDuration(frameCount, framerate) {\r\n // multiply and devide by 100 to get around floating precision issues\r\n return ((frameCount * 100) * (1 / framerate)) / 100;\r\n }", "function getSecondsTime(duration) {\n if(typeof duration === \"number\") return duration;\n if(typeof duration !== \"string\") return 0;\n\n duration = duration.split(\":\");\n let time = 0;\n\n if(duration.length === 2) {\n time += Number(duration[0]) * 60;\n time += Number(duration[1]);\n } else if(duration.length === 3) {\n time += Number(duration[0]) * 3600;\n time += Number(duration[1]) * 60;\n time += Number(duration[2]);\n }\n\n return time;\n}", "function getDuration(input) {\n let runCommand = `\"${ffprobe}\" -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 -sexagesimal \"${input}\"`;\n return runCommand;\n}", "function durationInMinutes(duration) {\n const match = duration.match(/((\\d+)\\shrs?)?\\s?((\\d+)\\smin)?/);\n const durationString = `${match[2] || '0'}:${match[4] || '00'}`;\n return moment.duration(durationString).asMinutes();\n}", "function duration(ms) {\n\t\t\tconst sec = Math.floor((ms / 1000) % 60).toString();\n\t\t\tconst min = Math.floor((ms / (1000 * 60)) % 60).toString();\n\t\t\tconst hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString();\n\t\t\tconst day = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString();\n\t\t\treturn `${day.padStart(1, \"0\")} days, ${hrs.padStart(2, \"0\")} hours, ${min.padStart(\n\t\t\t\t2,\n\t\t\t\t\"0\"\n\t\t\t)} minutes, ${sec.padStart(2, \"0\")} seconds`;\n\t\t}", "function duration_ms(durations) {\n\n durations = durations.toString();\n durations = durations.replace(/ms/g, \"\");\n\n // result\n var duration = 0;\n var ms;\n\n // Is multi durations?\n if (durations.indexOf(\",\") != -1) {\n\n var durationsArray = durations.split(\",\");\n\n for (var i = 0; i < durationsArray.length; i++) {\n\n var val = durationsArray[i];\n\n // Has dot?\n if (val.indexOf(\".\") != -1) {\n\n ms = parseFloat(val).toString().split(\".\")[1].length;\n val = val.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n val = val.replace(/s/g, \"0\");\n } else if (ms == 1) {\n val = val.replace(/s/g, \"00\");\n }\n\n } else {\n val = val.replace(/s/g, \"000\");\n }\n\n duration = parseFloat(duration) + parseFloat(val);\n\n }\n\n return duration;\n\n } else {\n\n // Has dot?\n if (durations.indexOf(\".\") != -1) {\n\n ms = parseFloat(durations).toString().split(\".\")[1].length;\n durations = durations.replace(\".\", \"\").toString();\n\n if (ms == 2) {\n durations = durations.replace(/s/g, \"0\");\n } else if (ms == 1) {\n durations = durations.replace(/s/g, \"00\");\n }\n\n } else {\n durations = durations.replace(/s/g, \"000\");\n }\n\n return durations;\n\n }\n\n }", "get seek() {\n return this.api.video.time\n }", "get defaultValueDuration() {\n\t\treturn this.__defaultValueDuration;\n\t}", "function calcTime(dist){\n\t//Get duration of the video\n\tvar dur = Popcorn(\"#video\").duration();\n\t//Get width of timeline in pixels\n\tvar wdth = document.getElementById(\"visualPoints\").style.width;\n\t//Trim for calculations\n\twdth = wdth.substr(0,wdth.length - 2);\n\t//Calculate pixel/total ratio\n\tvar ratio = dist / wdth;\n\t//Return time value in seconds calculated using ratio\n\treturn (ratio * dur);\n}", "get trackingDuration(){\n return this._trackingDuration;\n }", "getAnimationDuration() {\n let min = Streak.durations.min,\n max = Streak.durations.max;\n \n return Number.parseFloat((min + (max - min) * Math.random()).toFixed(2));\n }", "computeDuration() {\n let period;\n switch (this.periodType) {\n case 'weeks':\n period = this.timeToElapse * 7;\n break;\n case 'months':\n period = this.timeToElapse * 30;\n break;\n default:\n period = this.timeToElapse;\n }\n return period;\n }", "function getTransformTransitionDurationInMs(element) {\n var computedStyle = getComputedStyle(element);\n var transitionedProperties = parseCssPropertyValue(computedStyle, 'transition-property');\n var property = transitionedProperties.find(function (prop) {\n return prop === 'transform' || prop === 'all';\n }); // If there's no transition for `all` or `transform`, we shouldn't do anything.\n\n if (!property) {\n return 0;\n } // Get the index of the property that we're interested in and match\n // it up to the same index in `transition-delay` and `transition-duration`.\n\n\n var propertyIndex = transitionedProperties.indexOf(property);\n var rawDurations = parseCssPropertyValue(computedStyle, 'transition-duration');\n var rawDelays = parseCssPropertyValue(computedStyle, 'transition-delay');\n return parseCssTimeUnitsToMs(rawDurations[propertyIndex]) + parseCssTimeUnitsToMs(rawDelays[propertyIndex]);\n }", "duration(val) {\n this._duration = val;\n return this;\n }", "duration(val) {\n this._duration = val;\n return this;\n }", "CD(){\n\t\tswitch(this.duration){\n\t\t\tcase ('DL'):\n\t\t\t\treturn 0.9\n\t\t\t\tbreak\n\t\t\tcase ('LL'):\n\t\t\t\treturn 1\n\t\t\t\tbreak\n\t\t\tcase ('SL'):\n\t\t\t\treturn 1.15\n\t\t\t\tbreak\n\t\t\tcase ('Const'):\n\t\t\t\treturn 1.25\n\t\t\t\tbreak\n\t\t\tcase ('WL'):\n\t\t\t\treturn 1.6\n\t\t\t\tbreak\n\t\t\tcase ('EL'):\n\t\t\t\treturn 1.6\n\t\t\t\tbreak\n\t\t\tcase ('Impact'):\n\t\t\t\treturn 2\n\t\t\t\tbreak\n\t\t}//SWITCH\n\t}", "function convertDurationToMinutes (durationStr){\n\n var totalMinutes = 0; \n\n var numHours = getNumHours(durationStr);\n var numMinutes = getNumMinutes(durationStr); \n //alert ('h ' + numHours + ' m ' + numMinutes); \n\n totalMinutes = parseInt ((numHours * 60)) + parseInt (numMinutes); \n return totalMinutes; \n} // convertDurationToMinutes", "convertSecondsToMinutes(songDuration) {\n const minutes = Math.floor(parseInt(songDuration) / 60000);\n const seconds = ((parseInt(songDuration % 60000) / 1000).toFixed(0));\n const duration = (seconds === 60 ? (minutes + 1) + \":00\" : minutes + \":\" + (seconds < 10 ? \"0\" : \"\") + seconds);\n\n return duration\n }", "get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }", "get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }", "get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }", "get leaseDuration() {\n return this.originalResponse.leaseDuration;\n }", "function MediaDesc() {\n\tthis.name = ''; // name of media file -- this always set automatically according to real media file name\n\tthis.loc = ''; // path to the location of the media file (the directory)\n\tthis.type = ''; // type of media: video vs. audio\n\tthis.relLoc = ''; // relative path to the location of the media file\n\tthis.duration = ''; // length of media\n\tthis.realFile = ''; // real file name of media on disk\n}", "function getProgressDurationInMinutes(d1, d2) {\n\n const date1 = new Date(d1);\n const date2 = new Date(d2);\n let millisec, seconds, minutes = 0\n\n if(d1 && d2) {\n millisec = date2.getTime() - date1.getTime()\n seconds = millisec / 1000\n minutes = seconds * ( 1/60 )\n minutes = minutes.toFixed(2)\n }\n\n return minutes;\n}", "function getClipLength() {\n var liveSet = new LiveAPI(callback, \"live_set tracks \" + trackNumber + \" clip_slots \" + currentClip + \" clip\");\n clipLength = liveSet.get(\"loop_end\");\n clipLength = parseFloat(clipLength);\n log(\"Clip Length:\", clipLength);\n}", "getElapsedTime() {\n\t\tthis.getDelta();\n\t\treturn this.elapsedTime;\n\t}", "static obtainTotalActualVideoDuration(startTime, endTime) {\n\t\tconst actualVideoDuration = endTime - startTime;\n\t\treturn actualVideoDuration;\n\t}", "get animationDuration() { return this._animationDuration; }", "function duration(ms) {\n const sec = Math.floor((ms / 1000) % 60).toString()\n const min = Math.floor((ms / (1000 * 60)) % 60).toString()\n const hrs = Math.floor((ms / (1000 * 60 * 60)) % 60).toString()\n const days = Math.floor((ms / (1000 * 60 * 60 * 24)) % 60).toString()\n return `${days.padStart(1, '0')} jour(s), ${hrs.padStart(2, '0')} heure(s), ${min.padStart(2, '0')} minutes, ${sec.padStart(2, '0')} secondes.`\n }", "getTotalMilliseconds() {\n return this._quantity;\n }", "function format_video_length(milliseconds) {\n var timeInSeconds = milliseconds > 0 ? milliseconds / 1000 : 0;\n var minutes = Math.floor(timeInSeconds / 60);\n var minutesString = minutes < 10 ? \"0\" + minutes : minutes;\n var seconds = Math.floor(timeInSeconds % 60);\n var secondsString = seconds < 10 ? \"0\" + seconds : seconds;\n\t\treturn minutesString + \":\" + secondsString;\n}", "getPlaybackTime()\n {\n return this.transport.getPlaybackTime();\n }" ]
[ "0.78902626", "0.785044", "0.7828204", "0.7708677", "0.76273453", "0.76043266", "0.7511164", "0.72955537", "0.72340304", "0.719466", "0.71198857", "0.71154904", "0.70839185", "0.7070688", "0.7070688", "0.7039953", "0.6942243", "0.6933155", "0.69329107", "0.69018793", "0.6881764", "0.6831704", "0.6719553", "0.65882504", "0.65233713", "0.6516458", "0.6495941", "0.648849", "0.6472485", "0.6447592", "0.6374457", "0.6369811", "0.63071007", "0.63040715", "0.6298925", "0.62788326", "0.62637544", "0.6256162", "0.6175363", "0.6170576", "0.6161617", "0.6133996", "0.61231357", "0.6116928", "0.6100631", "0.60913765", "0.6091355", "0.6040844", "0.6032137", "0.6032137", "0.6032137", "0.6013116", "0.600388", "0.5993317", "0.5990519", "0.598427", "0.5949346", "0.5943054", "0.59264845", "0.5923156", "0.589033", "0.5877242", "0.5858189", "0.5857382", "0.58424264", "0.58315396", "0.58260095", "0.5818566", "0.58083314", "0.58068776", "0.57900685", "0.57768583", "0.5775199", "0.5760177", "0.5759436", "0.5757513", "0.5739526", "0.5683943", "0.56679016", "0.5666025", "0.56546825", "0.5645679", "0.5645679", "0.56421536", "0.5636829", "0.5632411", "0.5613833", "0.5613833", "0.5613833", "0.5613833", "0.5611472", "0.55928123", "0.5578259", "0.5564685", "0.5561285", "0.55565894", "0.555276", "0.554356", "0.5540959", "0.5540777" ]
0.7805124
3
get whether the player has been paused or not
function getPlayerPaused() { var paused = editor.player.prop("paused"); return paused; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isPaused() {\n return this._isPaused;\n }", "function isPaused() {\n\n return dom.wrapper.classList.contains('paused');\n\n }", "get isPaused() {\n return this._isPaused;\n }", "get isPaused() {\n return this._isPaused;\n }", "get isPaused() {\n return this._isPaused;\n }", "get paused() {\n return __classPrivateFieldGet(this, _paused);\n }", "videoIsPaused() {\n const video = this.refs.HTML5StreamPlayerVideo;\n\n if (!video) {\n return true;\n }\n\n const videoIsReady = (video.readyState === 3 || video.readyState === 4);\n const videoLoadedSuccessfully = video.error === null;\n\n const videoIsPlaying = !video.paused && !video.ended && videoIsReady && videoLoadedSuccessfully;\n return !videoIsPlaying;\n }", "get paused() {\n return this._paused;\n }", "function isCarouselPaused() {\n return playPauseButton.getAttribute('aria-pressed') === 'true';\n }", "function isPaused()\n{\n if(!dead)\n {\n if (!paused)\n {\n paused = true;\n } \n else if (paused)\n {\n paused = false;\n }\n\n if(paused)\n {\n clearInterval(interval);\n document.getElementById(\"pause\").innerHTML=\"Paused!! (Press 'p' again to continue!!)\";\n }\t\n else if(!paused)\n {\n interval=setInterval(update,speed);\t\n document.getElementById(\"pause\").innerHTML=\"\";\n }\n } \t\n}", "function pause() {\n if (!paused) {\n paused = true;\n } else {\n paused = false;\n }\n}", "pause() {\n this._isPaused = true;\n }", "pause() {\n this._isPaused = true;\n }", "pause() {\n this._isPaused = true;\n }", "get isPlaying() {}", "get producerPaused() {\n return __classPrivateFieldGet(this, _producerPaused);\n }", "function _pause() {\n\t\t\ttry {\n\t\t\t\tif (_model.playlist[0].levels[0].file.length > 0) {\n\t\t\t\t\tswitch (_model.state) {\n\t\t\t\t\t\tcase jwplayer.api.events.state.PLAYING:\n\t\t\t\t\t\tcase jwplayer.api.events.state.BUFFERING:\n\t\t\t\t\t\t\t_model.getMedia().pause();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t} catch (err) {\n\t\t\t\t_eventDispatcher.sendEvent(jwplayer.api.events.JWPLAYER_ERROR, err);\n\t\t\t}\n\t\t\treturn false;\n\t\t}", "isPlaying() {\n return this.player.isPlaying();\n }", "function togglePause() {\n\tisPaused=!isPaused;\n\t\n\tif(!isPaused)\n\t\trefreshValues();\n\t\t\n\treturn isPaused;\n}", "togglepaused() {\n if (this.gamestate == GAMESTATE.PAUSED) {\n this.gamestate = GAMESTATE.RUNNING;\n }\n else {\n this.gamestate = GAMESTATE.PAUSED;\n }\n\n }", "IsPlaying() {}", "pause() {\n paused = true;\n }", "function pause() {\n if (running) {\n togglePlay();\n }\n}", "suspendOrResumeGame() {\n this._game.suspendOrResume();\n return this._game.isRun();\n }", "function pauseToggle(){\n\n\t\t//test if the video is currently playign or paused\n\t\t// posted propter - boolen\n\n\t\tif(vid.paused){\n\n\t\t\t//if paused then play the video\n\t\t\tvid.play();\n\n\t\t}else{\n\n\t\t\t//video is the\n\t\t}\n}", "function togglePause() {\n isGamePaused = !isGamePaused;\n }", "function pauseCallBack(paused)\r\n{\r\n\tisGameRunning=!paused;\r\n}", "status() {\n return this.pause?'Paused':'Active';\n }", "pause(){\n if(this._isRunning && !this._isPaused){\n this._isPaused = true;\n this._togglePauseBtn.classList.add(\"paused\");\n this.onPause();\n }\n }", "isPlaying() {\n return this.playing;\n }", "paused() {\n\n }", "paused() {\n\n }", "paused() {\n\n }", "paused() {\n\n }", "paused() {\n\n }", "proccessPlaybackPause() {\n // update UI\n this.changePlayerIsPlaying({playerPosition: this.activePlayer.position, status: false})\n this.changePlayerIsPaused({playerPosition: this.activePlayer.position, status: true})\n this.changePlayerIsStopped({playerPosition: this.activePlayer.position, status: false})\n\n // update active player\n this.updateActivePlayer({playerPosition: this.activePlayer.position})\n }", "function pause() {\n\tif (pause_status === false && talk_status === true) {\n\t\tconsole.log('The voice of the system is paused.');\n\t\tassistant.pause();\n\t\tpause_status = true;\n\t\tresume_status = false;\n\t} else {\n\t\tconsole.log('The voice of the system is already paused.');\n\t}\n}", "function isPlaying(playerId)\n{\n \n var player = document.getElementById(playerId);\n return !player.paused && !player.ended && 0 < player.currentTime;\n \n}", "isPlaying(){\n return this.play;\n }", "function checkForGamePaused() {\n if (keysPressed[KEYS.E]) {\n gameIsPaused = !gameIsPaused;\n }\n if (gameIsPaused) {\n sceneManager.changeScenes(gameScene, pauseScene);\n } else {\n sceneManager.changeScenes(pauseScene, gameScene);\n gameScene.updateSprites();\n }\n}", "function playPause() {\n setIsTimerRunning((prevState) => !prevState);\n }", "function checkPause(event, game, canvas) {\n\tsetMousePos(event, game, canvas);\n\tif (650 >= game.mouse_x && game.mouse_x >= 600 && 30 >= game.mouse_y && game.mouse_y >= 10) {\n\t\tif (game.state == \"start\") {\n\t\t\tgame.state = \"pause\";\n\t\t\t\n\t\t} else {\n\t\t\tgame.state = \"start\";\n\n\t\t}\n\t\t\n\t}\n\n}", "resume() {this.paused = false;}", "pause() { this.setPaused(true); }", "togglePause() {\n if (this.gamestate === GAMESTATE.RUNNING) {\n this.gamestate = GAMESTATE.PAUSED;\n } else if (\n this.gamestate === GAMESTATE.PAUSED ||\n this.gamestate === GAMESTATE.MENU ||\n this.gamestate === GAMESTATE.GAMEOVER\n ) {\n this.gamestate = GAMESTATE.RUNNING;\n }\n }", "getPlaybackState() {\n if (this.video.hasEnded) return \"ended\";\n if (this.video.isPlaying) return \"playing\";\n return \"paused\";\n }", "function setPlayerPaused(isPaused){\n if (isPaused) {\n dom.play.classList.add('paused');\n } \n else {\n dom.play.classList.remove('paused');\n }\n}", "toggle() {\n return this.paused ? this.resume() : this.pause();\n }", "function is_playing(player)\n{\n\tif(player['OPP'])\n\t\treturn true;\n\treturn false;\n}", "function isPausedAtStart()\n {\n if( !pauseVideoOnStart ) return;\n\n pauseVideoOnStart = false;\n scope.pauseVideo();\n sendVideoEvent( Constants.VIDEO_READY );\n }", "function pauseOn()\n\t\t\t{\n\t\t\t\tpause = true;\n\t\t\t\tq.find(\".x-controls .pause\").hide();\n\t\t\t\tq.find(\".x-controls .play\").show();\n\t\t\t}", "function playPause(){\n //Checks to see if the song is paused, if it is, play it from where it left off otherwise pause it.\n if (p.paused){\n p.play();\n }else{\n p.pause();\n }\n}", "function onPause(){\n\talert(\"paused!\");\n}", "function togglePlayPause(){\n if(audioCtx.state === 'running') {\n audioCtx.suspend().then(function() {\n console.log(\"suspended\");\n });\n } else if(audioCtx.state === 'suspended') {\n audioCtx.resume().then(function() {\n console.log(\"running\");\n });\n }\n}", "pause() {\n this.paused = true;\n }", "function _onPaused(res) {\n\t\t// res = {callFrames, reason, data}\n\t\t_callFrames = res.callFrames;\n\t\t$exports.trigger(\"paused\", res);\n\t}", "function onPause() {\n}", "function onPause() {\n }", "resume() { this.setPaused(false); }", "function pause() {\n paused = true;\n clearTimeout(timeout);\n }", "function togglePause() {\n\n if (isPaused()) {\n resume();\n }\n else {\n pause();\n }\n\n }", "function pause() {\r\n player.pause();\r\n }", "toggle_paused() {\n this.paused = !this.paused\n\n // update the button\n let display_text = this.paused ? \"Play\" : \"Pause\";\n $(\"#pause\").html(display_text);\n\n // Update this value so when we unpause we don't add a huge\n // chunk of time.\n this.last_update = AnimationManager.epoch_seconds();\n }", "function pauseGame(){\n\tif(!pause){\n\t\tpause = true;\n\t\tprintSideConsole('Game is PAUSED');\n\t\tfor(var i in unitArray){\n\t\t\tclearInterval(unitArray[i].pathInterval);\n\t\t}\n\t}\n\telse{\n\t\tpause = false;\n\t\tprintSideConsole('Game is UNPAUSED');\n\t}\n}", "togglePlayPause() {\n let state = this.player.paused || this.player.ended;\n if (state) {\n this.play();\n } else {\n this.pause();\n }\n\n MediaPlayer.changeButtonState({\n button: this.playBtn,\n removeClass: (state) ? PLAYBTN_STATES.PLAY : PLAYBTN_STATES.PAUSE,\n addClass: (!state) ? PLAYBTN_STATES.PLAY : PLAYBTN_STATES.PAUSE,\n title: (state) ? 'Pause' : 'Play'\n });\n return state;\n }", "function pause() {\n _isGamePaused = true;\n\n Frogger.observer.publish(\"game-paused\");\n }", "function gamePause() {\n\n if(territory.game.paused==false){\n state=1;\n prepauseturn=turn;\n turn=3;\n players_turn(territory.game);\n territory.game.paused = true;\n button_return.visible = true;\n button_retry.visible = true;\n button_exit.visible = true;\n pause_label.visible = true;\n frame.visible = true;\n\n }else{\n turn=prepauseturn;\n button_return.visible = false;\n button_retry.visible = false;\n button_exit.visible = false;\n pause_label.visible = false;\n frame.visible = false;\n\n territory.game.paused = false;\n }\n }", "function togglePause() {\r\n //Toggle play state\r\n //Pause\r\n if (paused === true) {\r\n //Update playing boolean\r\n paused = false;\r\n //Change play button text\r\n pauseBtn.innerText = \"Pause\";\r\n }\r\n //Play\r\n else {\r\n //Update paused boolean\r\n paused = true;\r\n //Change play button text\r\n pauseBtn.innerText = \"Resume\";\r\n }\r\n}", "function playPause() {\n\tconst isPlaying = player.classList.contains('play');\n\tisPlaying ? pauseSong() : playSong(currentSong);\n}", "pause () {\n this.playing = false;\n }", "pause () {\n this.playing = false;\n }", "function pausePlayer() {\r\n\r\n\tif(currentState == 3 || currentState == 2 ) {\r\n\t\tcurrentState = 2;\t\t\r\n } else {\r\n\r\n\t\treturn;\t\r\n }//fi\r\n\t\t\t\r\n}//end method", "pause() {\n if (this.paused || !this.hashing) return false;\n this.paused = true;\n\n this.streamGroup.getStreams().forEach((rs) => {\n rs.pause();\n });\n\n return true;\n }", "isPlaying(options) {\n return __awaiter(this, void 0, void 0, function* () {\n let playerId = options.playerId;\n if (playerId == null || playerId.length === 0) {\n playerId = 'fullscreen';\n }\n if (this._players[playerId]) {\n let playing = false;\n if (!this._players[playerId].videoEl.paused)\n playing = true;\n return Promise.resolve({\n method: 'isPlaying',\n result: true,\n value: playing,\n });\n }\n else {\n return Promise.resolve({\n method: 'isPlaying',\n result: false,\n message: 'Given PlayerId does not exist)',\n });\n }\n });\n }", "function playpauseTrack(){\n\n // Switch between play & pause depending on the current state\n if(!isPlaying) playTrack();\n else pauseTrack();\n\n}", "get Pause() {}", "play() {\n this.paused = false;\n }", "function togglePause() {\n if (!Engine.GetGUIObjectByName(\"pauseButton\").enabled) return;\n\n closeOpenDialogs();\n\n pauseGame(!g_Paused, true);\n}", "function playPause() {\n setSession(true);\n setIsTimerRunning((prevState) => !prevState);\n }", "function pausefunc() {\n pause = true;\n}", "function pp(){\n if(config.site ==='twitch'){\n $(\".qa-pause-play-button\").click();\n } else if(config.site ==='netflix'){\n return;\n }\n else {\n if(myPlayer.paused){\n myPlayer.play();\n } else {\n myPlayer.pause();\n }\n }\n log(\"play/pause triggered\");\n}", "async _togglePause() {\n if (this.state.done) {\n if (this.state.paused) {\n this._play()\n } else {\n this._pause()\n }\n }\n }", "function playpauseTrack() {\r\n // switch between playing and pausing \r\n // depending on the current state \r\n if (!isPlaying) playTrack();\r\n else pauseTrack();\r\n\r\n}", "pause() {\n this.playing = false;\n this.speaker.removeAllListeners('close');\n return this.speaker.end();\n }", "function pauseGame() {\n\tpause = true;\n\tstart = false;\n}", "function pause () {\n if (globalVariables.whichGame !== \"opening scene\" && globalVariables.whichGame !== \"victory scene\") {\n globalVariables.paused = true;\n $(\"#pause_button\").html(\"&#9658;\");\n }\n }", "function isPlaying(playElem) {\n return !playElem.paused && !playElem.ended && 0 < playElem.currentTime;\n}", "function unpause() {\n _isGamePaused = false;\n\n Frogger.observer.publish(\"game-unpaused\");\n }", "function playPause() {\n setIsTimerRunning((prevState) => {\n const nextState = !prevState;\n if (nextState) {\n setSession((session) => {\n return {\n ...session,\n label: \"Focusing\",\n timeRemaining: session.focusDuration * 60,\n }\n });\n }\n return nextState;\n });\n}", "handleAudioPaused() {\n const { activeTrackIndex } = this.props;\n if(activeTrackIndex !== undefined) this.props.actions.togglePlaying(false);\n }", "function playPauseAudio() {\n if (!player.paused) {\n player.pause();\n setPauseInfo(true);\n } else {\n if (player.src !== '') {\n player.play();\n setPauseInfo(false);\n }\n }\n}", "function trackPlayPause() {\n // Can't play/pause no song !\n if (!opened) {\n return;\n }\n\n playing ^= true;\n if (playing) {\n console.log(\"track play\");\n audioPlay();\n }\n else {\n console.log(\"track pause\");\n audioPause();\n }\n}", "function togglePausePlay() {\n\n // If we are in the middle of demonstrating the step button (see tutorial.js)\n // then disable the pause/play button\n if (TUTORIAL_STEP_BUTTON_ACTIVE) {\n return\n }\n\n if (PLAY_STATUS == PlayStatus.INITAL_STATE_PAUSED) {\n doRun()\n } else if (PLAY_STATUS == PlayStatus.PAUSED) {\n doResume()\n } else {\n doPause()\n }\n}", "_shouldCheckForUpdateOnResume() {\n // In case a pause event was missed, assume it didn't make the cutoff\n if (!localStorage.getItem('reloaderLastPause')) {\n return false;\n }\n\n // Grab the last time we paused\n const lastPause = Number(localStorage.getItem('reloaderLastPause'));\n\n // Calculate the cutoff timestamp\n const idleCutoffAt = Number( Date.now() - this._options.idleCutoff );\n\n return (\n this._options.idleCutoff &&\n lastPause < idleCutoffAt &&\n this._options.check === 'everyStart'\n );\n }", "togglePause () {\n this.paused = !this.paused\n }", "function isPlaying() {\n return state.isPlaying && state.view == \"slide\";\n}", "function checkPlayPause() {\n if (audio.paused) {\n playToggle.classList.toggle(\"fa-pause-circle\");\n }\n}", "function unansweredPause() {\n pauseTimer = false;\n timeLeftPlay = initialTimePlay;\n currentQuestionIndex++;\n\n if (currentQuestionIndex < trivia.length) {\n displayQuestionAnswers(trivia[currentQuestionIndex]);\n }\n else {\n if (currentQuestionIndex === trivia.length) {\n pauseTimer = true;\n $(\"#gameDiv\").hide();\n $(\"#gameStatDiv\").hide();\n setTimeout(function () {\n $(\"#endingStatDiv\").show();\n }, 3000);\n\n }\n }\n }", "function onPause() {\n\t\talert(\"pause\");\n\t\tpaused_count++;\n\t\tupdateDisplay();\n }", "function onPause() {\n\t\talert(\"pause\");\n\t\tpaused_count++;\n\t\tupdateDisplay();\n }" ]
[ "0.8146443", "0.7982244", "0.7923395", "0.7923395", "0.78216994", "0.76568264", "0.7545798", "0.75006855", "0.71019584", "0.70721483", "0.70696163", "0.70139784", "0.70139784", "0.70109344", "0.7008581", "0.69728094", "0.6925451", "0.6913184", "0.688491", "0.68564856", "0.6855836", "0.6847413", "0.68307245", "0.68160516", "0.6806454", "0.67539316", "0.6711144", "0.6687828", "0.667141", "0.66501284", "0.66429746", "0.66429746", "0.66429746", "0.66429746", "0.66429746", "0.6625002", "0.6587017", "0.6579016", "0.65588325", "0.65547734", "0.65546405", "0.65529466", "0.6534449", "0.65298945", "0.6529497", "0.65137136", "0.6512609", "0.6457048", "0.6453109", "0.64507353", "0.6442068", "0.64021015", "0.6393041", "0.63781995", "0.63647586", "0.63620996", "0.63562965", "0.63486123", "0.6346128", "0.63303006", "0.6328614", "0.6316302", "0.63143283", "0.6314211", "0.6298319", "0.62849784", "0.62760955", "0.62757826", "0.62752926", "0.62745786", "0.62745786", "0.6274479", "0.6272898", "0.6248611", "0.62485576", "0.62481016", "0.62463367", "0.6245847", "0.6244596", "0.6202097", "0.6185615", "0.6182216", "0.61808854", "0.6167233", "0.6165068", "0.6163774", "0.6155626", "0.61426824", "0.6129147", "0.61286706", "0.6111608", "0.6094901", "0.60924417", "0.6090837", "0.6085353", "0.6071902", "0.6066452", "0.60656196", "0.6057925", "0.6057925" ]
0.80056185
1
get the current split item by time
function getCurrentSplitItem() { if (editor.splitData && editor.splitData.splits) { var currentTime = getCurrentTime(); for (var i = 0; i < editor.splitData.splits.length; ++i) { var splitItem = editor.splitData.splits[i]; if ((splitItem.clipBegin <= (currentTime + 0.1)) && (currentTime < (splitItem.clipEnd - 1))) { splitItem.id = i; return splitItem; } } } return currSplitItem; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get itemTime(){ return this._itemTime; }", "function playCurrentSplitItem() {\n var splitItem = getCurrentSplitItem();\n if (splitItem != null) {\n pauseVideo();\n var duration = (splitItem.clipEnd - splitItem.clipBegin) * 1000;\n setCurrentTime(splitItem.clipBegin);\n\n clearEvents();\n editor.player.on(\"play\", {\n duration: duration,\n endTime: splitItem.clipEnd\n }, onPlay);\n playVideo();\n }\n}", "getItemCleanStart (id) {\n var ins = this.getItem(id);\n if (ins === null || ins._length === 1) {\n return ins\n }\n const insID = ins._id;\n if (insID.clock === id.clock) {\n return ins\n } else {\n return ins._splitAt(this.y, id.clock - insID.clock)\n }\n }", "function selectCurrentSplitItem(excludeDeletedSegments) {\n if (!continueProcessing && !isSeeking) {\n excludeDeletedSegments = excludeDeletedSegments || false;\n\n var splitItem = getCurrentSplitItem();\n\n if (splitItem != null) {\n var idFound = false;\n var id = -1;\n if (excludeDeletedSegments) {\n if (splitItem.enabled) {\n id = splitItem.id;\n idFound = true;\n } else if (editor.splitData && editor.splitData.splits) {\n for (var i = splitItem.id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n if (!idFound) {\n for (var i = splitItem.id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n }\n }\n } else {\n id = splitItem.id;\n idFound = true;\n }\n if (idFound) {\n currSplitItemClickedViaJQ = true;\n if (!zoomedIn()) {\n $('#splitSegmentItem-' + id).click();\n }\n lastId = -1;\n $('#descriptionCurrentTime').html(formatTime(getCurrentTime()));\n } else {\n ocUtils.log(\"Could not find an enabled ID\");\n }\n }\n }\n}", "readTimePosition(v) {\n return this.timePosition;\n }", "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "function getCurrentlyPlayingSegment(tech) {\n const targetMedia = tech.vhs.playlists.media();\n const snapshotTime = tech.currentTime();\n let segment;\n\n // Iterate trough available segments and get first within which snapshot_time is\n // eslint-disable-next-line no-plusplus\n for (let i = 0, l = targetMedia.segments.length; i < l; i++) {\n // Note: segment.end may be undefined or is not properly set\n if (snapshotTime < targetMedia.segments[i].end) {\n segment = targetMedia.segments[i];\n break;\n }\n }\n\n if (!segment) {\n [segment] = targetMedia.segments;\n }\n\n return segment;\n}", "function TimeLine() {\n this.items = [];\n this.goalFps = 10;\n this.realFps = \"--\";\n var time = 0;\n var self = this;\n this.run = function() {\n var loop = setInterval(function() {\n time += 1000/self.goalFps;\n\n self.items.forEach(function(item, index) {\n if (time >= item.startTime) {\n item.actions.forEach(function(action, actionIndex) {\n if (!action.done) {\n\n if (time >= action.time + item.startTime) {\n $(item.dom)[action.action.split(\"(\")[0]](action.action.match(/('\\S+'|\"\\S\")/)[0].slice(1,-1));\n action.done = true;\n }\n }\n });\n\n }\n });\n\n // console.log(time);\n }, 1000/self.goalFps);\n }\n this.addItem = function (dom, startTime, actions) {\n self.items.push({\n dom: dom,\n startTime: startTime,\n actions: actions\n });\n }\n this.run();\n }", "getFirstCome() {\n var lowestTime = this.queue[0].getArrivalTime();\n var jobFinal = this.queue[0];\n for(var i=0; i<this.queue.length; i++) {\n var job = this.queue[i];\n if(lowestTime > job.getArrivalTime()) {\n lowestTime = job.getArrivalTime();\n jobFinal = job;\n }\n }\n return jobFinal;\n }", "getTime(){return this.time;}", "get time () {\n\t\treturn this._time;\n\t}", "get time() {\n return this._time;\n }", "function printSplit() {\n listToComplete = document.getElementById(\"splits\");\n splitToAdd = document.createElement(\"li\");\n splitToAdd.textContent =\n chronometer.twoDigitsNumber(chronometer.getMinutes())[0] +\n chronometer.twoDigitsNumber(chronometer.getMinutes())[1] +\n \":\" +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[0] +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[1];\n listToComplete.appendChild(splitToAdd);\n}", "function get () {\n\t\treturn queue.slice(nowPlaying);\n\t}", "function setTimeColor(item) {\n //Set block to past\n if (item.time < now) {\n return \"past\";\n }\n //Set block to present\n else if (item.time == now) {\n return \"present\";\n }\n //Set block to future\n else {\n return \"future\";\n }\n }", "function updateResults(clue, _time) {\n let currentResults = [];\n currentResults = result;\n result[clue].time = _time;\n return currentResults;\n }", "setActiveLap(){ \n return this.timeStampData.filter(time => !time.timefinished) \n }", "function getLatestTime() {\n fakeNow = new Date();\n fakeNow.setTime(fakeNow.getTime() + (hourOffset*3600*1000) + (minuteOffset*60*1000));\n latestTime = radarKeys[0];\n for (var i=0; i<radarKeys.length; i++) {\n if (fakeNow > radarTimes[radarKeys[i]]) {\n latestTime = radarKeys[i];\n } else {\n break;\n\t}\n }\n}", "function getSliceAroundTime(data, time, before, after) {\n var from = moment(time).subtract(before, 'seconds');\n var to = moment(time).add(after, 'seconds');\n\n return getSliceBetweenTimes(data, from, to);\n }", "getPlayTime() {\n return this.time;\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "getCurrent() {\n return this.entries[this.currentIndex];\n }", "getItem (id) {\n var item = this.findWithUpperBound(id);\n if (item === null) {\n return null\n }\n const itemID = item._id;\n if (id.user === itemID.user && id.clock < itemID.clock + item._length) {\n return item\n } else {\n return null\n }\n }", "_byTimeKey(): string {\n return this.data.date + this.data.guid;\n }", "function currTime() {\n var dt = dateFilter(new Date(), format,'-0800');\n element.text(dt);\n // element point to line 11 span element\n }", "timeString (index) {return this.weatherJson.dwml.data[\"time-layout\"][\"start-valid-time\"][index]._text}", "async current() {\n return await this.client.get(`me/time_entries/current`);\n }", "function getFirstTime(data) {\n const times = Object.keys(data);\n const now = new Date().getTime();\n const [firstTime] = times.filter(time => now < (time * 1000))\n return firstTime;\n }", "get time() {}", "getItemCleanEnd (id) {\n var ins = this.getItem(id);\n if (ins === null || ins._length === 1) {\n return ins\n }\n const insID = ins._id;\n if (insID.clock + ins._length - 1 === id.clock) {\n return ins\n } else {\n ins._splitAt(this.y, id.clock - insID.clock + 1);\n return ins\n }\n }", "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].clipBegin);\n }\n}", "getCurrent() {\n return this.history.slice(this.index.start, this.index.end);\n }", "function getTrackedItem(key) {\n return DataCollectorService.retrieveLocal(key);\n }", "_getThumbIndexForTime(time) {\n var thumbs = this._thumbs\n for(let i=thumbs.length-1; i>=0; i--) {\n let thumb = thumbs[i]\n if (thumb.time <= time) {\n return i\n }\n }\n // stretch the first thumbnail back to the start\n return 0\n }", "function getFirstTime(data) {\n const times = Object.keys(data);\n const now = new Date().getTime();\n const [firstTime] = times.filter(time => now < (time * 1000))\n return firstTime;\n }", "_navigateToNextTimePart() {\n const that = this;\n\n that._highlightTimePartBasedOnIndex(that._highlightedTimePart.index + 1);\n }", "function getStandupTime(channel, cb) {\n controller.storage.teams.get('standupTimes', function(err, standupTimes) {\n if (!standupTimes || !standupTimes[channel]) {\n cb(null, null);\n } else {\n cb(null, standupTimes[channel]);\n }\n });\n}", "function findPos(time, i) {\n var obj = { \"ok\":true, \"move\":true, \"time\":time, \"speed\":0 };\n var first = DataStorage[i].first;\n var last = DataStorage[i].last;\n\n if (time === first.time) {\n obj.speed = first.speed || 0;\n }\n else if (time === last.time) {\n obj.speed = last.speed || 0;\n }\n\n if( time <= first.time ){// before first\n obj.x = first.lon;\n obj.y = first.lat;\n obj.move = false;\n obj.trip = {move:false, tripIndex:-1};\n } else if (time >= last.time ){// after last\n obj.x = last.lon;\n obj.y = last.lat;\n obj.move = false;\n } else {\n\n var msgInt;\n // check previous\n var lp = DataStorage[i].lastPos;\n // if stil in same interval\n if( lp && DataStorage[i].msgIntervals[lp.msgInt]<=time && DataStorage[i].msgIntervals[lp.msgInt+1]>time){\n msgInt = lp.msgInt;\n } else { // else - have to find interval\n msgInt = findMsgInterval(DataStorage[i].msgIntervals, time);\n if(!DataStorage[i].messages[msgInt]){ // messages not loaded\n clearTimeout(DataStorage[i].getMessagesId); // stop load\n freeze();\n loadMessages(i, msgInt);\n obj.ok = false;\n return obj;\n }\n }\n // if messages not loaded yet\n if(!DataStorage[i].messages[msgInt] || !DataStorage[i].messages[msgInt].length){\n obj.ok = false;\n return obj;\n }\n\n obj.msgInt = msgInt; // save interval index for next time\n\n var index; // index of message in message[] array\n // check previous\n if(lp && lp.ind>0 && lp.ind < DataStorage[i].messages[msgInt].length &&\n DataStorage[i].messages[msgInt][lp.ind].t<time && DataStorage[i].messages[msgInt][lp.ind+1].t>=time)\n { // if still between same points (messages)\n index = lp.ind;\n } else { // else - need to find //OPTIMIZATION - check next message\n index = findRightPlace( DataStorage[i].messages[msgInt], 0, DataStorage[i].messages[msgInt].length-1, time);\n }\n\n if(index == -1) { obj.ok = false; return obj; }\n\n if(!DataStorage[i].trips || ! DataStorage[i].trips.length) {\n obj.ok = false;\n return obj;\n }\n var trip = isMove( DataStorage[i].trips, 0, DataStorage[i].trips.length-1, time);\n\n // get \"begin\" and \"end\" of line where unit in cur time\n var m1 = DataStorage[i].messages[msgInt][index], m2 = DataStorage[i].messages[msgInt][index+1];\n\n // save message index for next time\n obj.ind = index;\n obj.message = m1;\n obj.trip = trip;\n\n var move = trip.move;\n if(!move && trip.pos){ // not move (not in trip) and position was found in trip info\n obj.x = trip.pos.to.p.x;\n obj.y = trip.pos.to.p.y;\n obj.move = false;\n } else { // msgInt - index of interval of messages where unit in time\n\n var t = index, tt = msgInt;\n while( !m1.pos ){\n if(t>=0) m1 = DataStorage[i].messages[tt][t--];\n else if(tt>0) {\n tt--;\n if(DataStorage[i].messages[tt] && DataStorage[i].messages[tt].length)\n t=DataStorage[i].messages[tt].length-1;\n else break;\n } else break;\n }\n\n t = index+1, tt = msgInt;\n while( !m2.pos ){\n if(t<DataStorage[i].messages[tt].length) m2 = DataStorage[i].messages[tt][t++];\n else if(tt<DataStorage[i].messages.length-2) {\n tt++;\n if(DataStorage[i].messages[tt] && DataStorage[i].messages[tt].length)\n t=0;\n else break;\n } else break;\n }\n\n if( !m1.pos || !m2.pos ){ // if position unknown - leave...\n obj.ok = false;\n } else if(move){ // if unit moves - calculate point on line\n var ko = (time-m1.t)/(m2.t-m1.t);\n obj.x = m1.pos.x + (m2.pos.x-m1.pos.x)*ko;\n obj.y = m1.pos.y + (m2.pos.y-m1.pos.y)*ko;\n obj.speed = m1.pos.s + (m2.pos.s-m1.pos.s)*ko;\n\n if(Math.abs(m2.pos.y-m1.pos.y)<0.00001 && Math.abs(m2.pos.x-m1.pos.x)<0.00001)\n obj.course = m1.pos.c;\n else{\n var p1 = getMeters(obj.x, obj.y);\n var p2 = getMeters(m2.pos.x, m2.pos.y);\n var angle = Math.atan2(p2.x-p1.x, p2.y-p1.y);\n var degrees = (angle*180/Math.PI);\n\n obj.course = degrees;\n }\n } else { // unit doesnt move\n obj.x = m1.pos.x;\n obj.y = m1.pos.y;\n obj.move = false;\n }\n }\n }\n return obj;\n}", "getStartTime() {\n return this.startTime;\n }", "function getItems() {\n\t\tvar newItems = get('get-items.php?startDate='+$scope.startDate+';duration='+$scope.duration);\n\t\tconsole.log(newItems);\n\t}", "function getTopRated(time) {\n\tconst index = _closestHour(time)\n\treturn db[index]\n}", "getMinutes() {\n\n let minutes = Math.floor(this.currentTime / 60)\n return minutes\n // ... your code goes here\n }", "find_frame(time, off) {\r\n off = off === undefined ? 0 : off;\r\n\r\n var flist = this.framelist;\r\n for (var i=0; i<flist.length-1; i++) {\r\n if (flist[i] <= time && flist[i+1] > time) {\r\n break;\r\n }\r\n }\r\n \r\n if (i === flist.length) return frames[i-1]; //return undefined;\r\n return frames[i];\r\n }", "function currentTimeSegment(timeFrame) {\n\t\tvar step = $scope.timeSegmentsList[0].segmentRange;\n\t\tvar indexInTimeSegments = Math.floor(timeFrame / step);\n\t\tif (indexInTimeSegments == $scope.timeSegmentsList.length) indexInTimeSegments--;\n\t\treturn indexInTimeSegments;\n\t}", "nowPlaying() {\n if (this.playing) {\n return {\n track: this.currentSong,\n timestamp: this.startTime\n };\n } else {\n throw new Error('No song is currently playing.');\n }\n }", "get startTime() { return this._startTime; }", "function getSlideTime(time){\n arraySlidesTimes.forEach(\n function(id,index){\n var timeData=(Math.floor(parseFloat(id.duration))*1000)\n window.setTimeout(arrayWhile(id.starTime,id.duration,time),timeData)}\n )\n}", "get time () { throw \"Game system not supported\"; }", "function getNowWithFilter(time,unit){\n switch(unit) {\n case \"day\":\n return time.date(); //per mostrare il giorno del mese\n case \"month\":\n return time.get($scope.indexDefaultUnit) + 1; //i mesi sono da 0 a 11, io voglio da 1 a 12\n default:\n return time.get($scope.indexDefaultUnit);\n }\n }", "findFirstValidHold (currentAudioTime) {\n\n let listActiveHolds = this.activeHolds.asList() ;\n for ( var i = 0 ; i < listActiveHolds.length ; i++) {\n\n let step = listActiveHolds[i] ;\n\n if ( step !== null && step.beginHoldTimeStamp <= currentAudioTime) {\n return step ;\n }\n\n }\n\n return null ;\n\n }", "_current() {\n return this._history[this.index];\n }", "function now() {\n return Object.assign({}, place)\n }", "_indexTime(index) {\n return new TicksClass(this.context, index * (this._subdivision) + this.startOffset).toSeconds();\n }", "function getSensorLastTime(timeKey) {\n\tif(!sensorID) {\n\t\tconsole.log('The sensor key is not gotten.');\n\t}\n\tvar categoryName = categories[0];\n\tvar categoryRef = db.ref(`/${SENSORDATA_TABLE}/${categoryName}/${sensorID}/series`);\n\tcategoryRef.orderByChild('timestamp').limitToLast(1).once(\"value\", function(snapshot) {\n\t\tsnapshot.forEach(function(childSnap) {\n\t\t\tvar categoryData = childSnap.val();\n\t\t\tconsole.log('---Last time at ---');\n\t\t\tconsole.log(categoryData['value'][timeKey]);\n\t\t});\n\t});\n}", "get timeOrigin() {\n return this[kTimeOriginTimestamp];\n }", "function updateTopRated(time, list) {\n\tconst index = _closestHour(time)\n\tdb[index] = list\n}", "constructor(index, time, todo) {\n this.index = index;\n this.time = time;\n this.todo = todo;\n \n }", "function getSectionDetails(listItem){\n var sectionLocation = null,\n sectionDays = null,\n sectionTimes = {\n start: 'TBA',\n end: 'TBA'\n };\n\n //Find the meeting time information\n var fullSectionTime = listItem.find('span.meetingtime').text();\n\n //Explode by spaces\n var fullSectionTimeArray = fullSectionTime.split(' ');\n\n //Get the first \"word\" which will be like MWF\n sectionDays = fullSectionTimeArray[0];\n\n //Remove Days\n fullSectionTimeArray.shift();\n //Create our new time string\n var fullTime = fullSectionTimeArray.join();\n var parsedTimes = parseTimeString(fullTime);\n sectionTimes.start = parsedTimes.start;\n sectionTimes.end = parsedTimes.end;\n\n //Find the title in the span\n sectionLocation = listItem.find('span[title]').attr('title');\n if(sectionLocation){\n sectionLocation += \" - \" + listItem.find('span[title]').text().split(' ')[1];\n }else{\n sectionLocation = \"TBA\";\n }\n\n return {\n sectionLocation: sectionLocation,\n sectionDays: sectionDays,\n sectionTimes: sectionTimes\n };\n}", "time() {\n return (new Date()).valueOf() + this.offset;\n }", "get lastChunkSaved() {\n return this.fileInfo.ctime;\n }", "StunPlayer(time){\nthis.player.getStunned(time);\n }", "function getStart(index)\n\t{\n\t\treturn levels[index].start.get();\n\t}", "function getCurrentTIME() {\n\t\t\tvar player_time = Processing.getInstanceById('raced');\n\t\t\t\t$('#jquery_jplayer_1').bind($.jPlayer.event.timeupdate, function(event) { // Adding a listener to report the time play began\n\t\t\t\t\tvar jstime = event.jPlayer.status.currentTime;\n\t\t\t\t\tvar percentduration = event.jPlayer.status.currentPercentAbsolute;\t\n\t\t\t\t\t\t\tplayer_time.timecurrent(jstime);\n\t\t\t\t\t\t\tplayer_time.timepercent(percentduration);\n\t\t\t\t});\n\t\t\t}", "function getMinutes(time) {\n return time.split(\":\")[1];\n}", "function getNext(now) {\n var n = game.timePoints.findIndex(function(tp) {\n return now < tp.time;\n });\n //console.log('getNext', now, n, game.timePoints[n]);\n return game.timePoints[n];\n}", "function onTimeEnter() {\n // get get-train-time HH:mm\n let _strTime = inputElements.time.value;\n // split will return array index [0] will be hour\n data.time.firstTime.hour = parseInt(_strTime.split(':')[0]);\n // and index [1] will be minutes\n data.time.firstTime.minute = parseInt(_strTime.split(':')[1]);\n //console.dir(trainInfo);\n}", "get timeSlicingMode() {}", "function firstCurrent(){\n let currents = allCurrents();\n return currents[0];\n}", "get latest() {\n return this.movements.slice(-1).pop();\n }", "function logCurrentLap () {\n if (timerStartFinishTimestamp && !timerPauseTimestamp) {\n lapContainer.classList.remove('hide');\n var listNode = document.createElement('li');\n listNode.innerHTML = getTimeString(Date.now() - timerStartFinishTimestamp);\n lapLog.appendChild(listNode);\n lapListWrapper.scrollTop = lapListWrapper.scrollHeight;\n };\n}", "function timerFetch(element, tp) {\n\t\tvar ret = null;\n\t\tvar i = owl.Property.Get(element, tp);\n\t\tif (i !== null) ret = timer[i];\n\t\treturn ret;\n\t}", "_navigateToPreviousTimePart() {\n const that = this;\n\n that._highlightTimePartBasedOnIndex(that._highlightedTimePart.index - 1);\n }", "function sortByTime(selectedTime){\n $(\".gridTile\").remove();\n $(data.ProductData).each( function (i){\n if ( data.ProductData[i].Time == selectedTime ) {\n dataShowing.push(data.ProductData[i]);\n }\n })\n}", "function getTask() {\n var text = $(\".timeSlot\")\n text.each(function () {\n var task = localStorage.getItem($(this).attr(\"id\"))\n if (task) {\n $(this).children(\".task\").val(task)\n }\n })\n}", "function getLatestValue() {\n latestValue = sortedByTime[sortedByTime.length - 1].value;\n\n }", "function setTimer() {\n // get the shortRest\n // get the largeRest\n }", "function getrecent(info) {\n return info[info.length - 1]\n}", "function currentTime() {\n var currentHour = moment().hour();\n\n // goes through each time block and adds or remove present/future/past class\n $(\".timeblocks\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\"));\n\n if (blockTime < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (blockTime === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n }", "function getActionsStartingAt(time){\n\tvar result = [];\n\tvar actions = currentActions;\n\tfor(var i in actions){\n\t\tvar action = actions[i];\n\t\tif( action.start == time ){\n\t\t\tresult.push(action);\n\t\t}\n\t}\n\treturn result;\n}", "function getPoll() {\n for(var i = 0; i < that.queue.length; i++) {\n var item = that.queue[i];\n if(item.isPoll) {\n that.queue.splice(i, 1);\n return item;\n }\n }\n return null;\n }", "function splitBusy(day,start,end){\n\n\t\t\t\t\tvar l = busyList.length;\n\n\t\t\t\t\tfor(var i = 0 ; i<l ; i++){\n\n\t\t\t\t\t\tif(busyList[i].start.day() == start.day()){\n\n\t\t\t\t\t\t\tvar toSplit = busyList[i];\n\n\t\t\t\t\t\t\tif(toSplit.start >= start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//move begining to the end of end\n\n\t\t\t\t\t\t\t\ttoSplit.start.hour(end.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.end <= end && toSplit.start < start){\n\n\t\t\t\t\t\t\t\t//move the end to the begining of start\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.start < start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//split in two\n\n\t\t\t\t\t\t\t\tbusyList.push({id:busyList.length,\n\n\t\t\t\t\t\t\t\t\ttitle:\"No disponible\",\n\n\t\t\t\t\t\t\t\t\tcolor:\"#000\",\n\n\t\t\t\t\t\t\t\t\tstart: new moment(end),\n\n\t\t\t\t\t\t\t\t\tend: new moment(toSplit.end),\n\n\t\t\t\t\t\t\t\t\teditable:false\n\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\tbusyList.splice(i,1);\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}", "function gatherSavedData(){\n \n for(var i =0; i < timeSlots.length; i++){\n apptTime = timeSlots[i];\n \n let info = localStorage.getItem(apptTime);\n desriptDiv.innerHTML+=info;\n console.log(apptTime+ \" time \"+\" desript \" +info);\n }\n\n }", "getVideoIdFromHash(){\n if (!this.firstRun) {\n var hashBang_arr = window.location.hash.split('/');\n var video_id = hashBang_arr[2];\n var feed = this.feed;\n\n for (var i = 0; i < feed.length; i++) {\n if (feed[i].id == video_id) {\n this.selectedTimeIndex = i;\n log('HASH CHANGE selectedTimeIndex: '+this.selectedTimeIndex);\n\n // need a timout to run after mounted (JQuery issue)\n setTimeout(() => {\n bus.$emit('selectThumbnail', this.selectedTimeIndex);\n }, 1000); // 4ms browser standard?\n }\n }\n }\n }", "static getItemByPoolName(poolName, prefab, time) {\n if (this._pool[poolName] == null) {\n this._pool[poolName] = [];\n }\n\n const pool = this._pool[poolName];\n let node = null;\n\n if (pool.length > 0) {\n node = pool.pop();\n } else {\n node = instantiate(prefab);\n }\n\n if (time != null) {\n // delay recover node with pool name\n setTimeout(() => {\n if (isValid(node)) {\n node.parent = null;\n this.recoverItemByPoolName(poolName, node);\n }\n }, time * 1000);\n }\n\n return node;\n }", "function readtime(data)\n{\n lastFedtime = data.val();\n foodObject.fedtime = lastFedtime;\n console.log(lastFedtime);\n}", "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "getItemsFromCurrentList(grabbed) {\n\n let filter = (grabbed != null) ? ('?grabbed=' + grabbed) : '';\n\n return new TotoAPI().fetch('/supermarket/currentList/items' + filter).then((response) => response.json());\n }", "function getLapTime() {\r\n\r\n if (initTime !== 0 && timerControl) {\r\n // get lap time\r\n clickTime = getCurrTime();\r\n let passedTime = calcPassedTime(initTime, clickTime)\r\n let lapTime = passedTime - lapInitialTimer;\r\n\r\n lapInitialTimer = passedTime;\r\n // update and store lap times array, unless laptime == 0\r\n if (lapTime !== 0) {\r\n lapTimesArray.unshift(lapTime);\r\n lapHistory(lapTimesArray);\r\n localStorage[\"laps\"] = JSON.stringify(lapTimesArray);\r\n }\r\n }\r\n}", "function getSlotItem(slots){\r\n\tvar numero = getNumeroAlAzar(slots.length);\r\n\treturn slots[numero];\r\n}", "manageTimeSlice(currentProcess, time) { // manages and keeps track of how much time has elapsed; similar to the function executeProcess in Process.js\n if (currentProcess.isStateChanged()) { // check if process is in the blocking queue or not\n this.quantumClock = 0; \n return;\n }\n\n this.quantumClock += time;\n if (this.quantumClock >= this.quantum) { // check if process has used up its alloted time\n this.quantumClock = 0; // reset the quantum clock to 0 for the next process\n const process = this.dequeue(); // dequeue\n\n if (!process.isFinished ()) { // if process is not finished\n this.scheduler.handleInterrupt(this, process, SchedulerInterrupt.LOWER_PRIORITY); // call the interrupt function and move process to lower priority queue\n }\n }\n }", "getItem(key) {\n let hash = this.hash(key);\n let slot = this.internalArray[hash];\n\n while (slot && slot.key !== key) {\n slot = this.internalArray[++hash % this.INTERNAL_ARRAY_SIZE];\n }\n\n return slot;\n }", "get timeDetails() {\n let now = new Date().getTime();\n return {\n quizTime: this._time,\n start: this._startTime,\n end: this._endTime,\n elapsedTime: ((this._endTime || now) - this._startTime) / 1000, // ms to sec\n remainingTime: secToTimeStr(this._remainingTime),\n timeOver: this[TIME_OVER_SYM]\n }\n }", "get start() {\n return this[this._start];\n }", "function timeSlots() {\n\n var currentTime = moment().hour();\n \n $(\".time-block\").each(function () {\n var timeBlock = parseInt($(this).attr(\"id\").split(\"time\")[1]);\n\n \n if (timeBlock < currentTime) {\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"past\");\n }\n else if (timeBlock === currentTime) {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).addClass(\"present\");\n }\n else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n\n }\n })\n }", "function GetItem()\n\t{\n\n\t\tquestionNum++;\n\n\t\tif(questionNum<ItemList.length)\n\t\t{\n\t\t\tparent.GetWorldEvent(\"Continue\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\tparent.GetWorldEvent(\"Stop\");\n\t\t}\n\t}", "getCurrentTime() {\n return Math.floor(Date.now() / 1000);\n }", "function curr_time(){\n return Math.floor(Date.now());\n}", "function getInitialTime() {\n changeTime();\n}", "function insertByTime(state, task) {\n state = [\n ...state,\n {\n taskName: task.taskName,\n tID: Math.floor(Math.random() * 900000),\n pID: 1,\n startTime: task.startTime,\n endTime: task.endTime,\n isComplete: false,\n taskNotes: task.taskNotes,\n isCurrent: false,\n subtasks: task.subtasks,\n },\n ];\n state.sort(function (a, b) {\n let hoursA = Number(a.startTime.substring(0, 2));\n let hoursB = Number(b.startTime.substring(0, 2));\n let minutesA = Number(a.startTime.substring(3, 5));\n let minutesB = Number(b.startTime.substring(3, 5));\n\n if (hoursA < hoursB || (hoursA === hoursB && minutesA < minutesB)) {\n return -1;\n }\n if (hoursB < hoursA) {\n return 1;\n }\n\n return 0;\n });\n return [...state];\n}", "function firstCurrent() {\n let currents = allCurrents();\n return currents[0];\n}" ]
[ "0.62600136", "0.591658", "0.5677979", "0.5582088", "0.54742885", "0.5412713", "0.53113586", "0.52732044", "0.5257456", "0.5254671", "0.5227693", "0.52125865", "0.52115387", "0.52070105", "0.5190759", "0.5184162", "0.51258206", "0.5114176", "0.51020133", "0.50994325", "0.50614494", "0.50614494", "0.5043241", "0.5029653", "0.5002945", "0.4986183", "0.49842167", "0.49777508", "0.4966603", "0.4959817", "0.4945911", "0.49366385", "0.493306", "0.49328655", "0.49282876", "0.4900367", "0.4890514", "0.4886217", "0.4885617", "0.48775458", "0.48772848", "0.48676428", "0.48660097", "0.48646235", "0.4862894", "0.48606622", "0.4859455", "0.4843379", "0.4828731", "0.48200145", "0.4811532", "0.47970277", "0.47953498", "0.47917247", "0.47908798", "0.47847092", "0.47822955", "0.4781927", "0.4776239", "0.47673902", "0.47649285", "0.47580758", "0.47561738", "0.47467735", "0.47395036", "0.4737718", "0.47349942", "0.4730324", "0.4717038", "0.47167248", "0.47044352", "0.47039035", "0.47024435", "0.4697101", "0.4696579", "0.46938348", "0.46891505", "0.4680134", "0.46778926", "0.46729535", "0.4672449", "0.46711987", "0.46540573", "0.46527335", "0.46525025", "0.46524954", "0.46521902", "0.46521106", "0.46436283", "0.46405464", "0.46389347", "0.46356252", "0.46348155", "0.46321648", "0.46303913", "0.46275273", "0.46269482", "0.46253625", "0.46213105", "0.46210715" ]
0.70029855
0
get the timefield begin time
function getTimefieldTimeBegin() { return parseFloat($('#clipBegin').timefield('option', 'value')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getStartTime() {\n // YYYY-MM-DD-HH.MM.SS.XXXXXX\n return this.transactionMetaData[TransMeta.TIME_START];\n }", "function timeStart()\n{\n var ds = new Date();\n var hs = addZero(ds.getHours());\n var ms = addZero(ds.getMinutes());\n var ss = addZero(ds.getSeconds());\n return hs + \":\" + ms + \":\" + ss;\n}", "function get_time() {\n let d = new Date();\n if (start_time != 0) {\n d.setTime(Date.now() - start_time);\n } else {\n d.setTime(0);\n }\n return d.getMinutes().toString().padStart(2,\"0\") + \":\" + d.getSeconds().toString().padStart(2,\"0\");\n }", "function getBeginTime(layer) {\n var time;\n var times = getLayerTimes(layer);\n if (times && times.length) {\n time = times[0];\n // Check if the time value is actually a string that combines\n // begin and end time information into one string instead of\n // providing separate time values for every step.\n if (1 === times.length && undefined !== time && null !== time) {\n // Make sure time is string before checking syntax.\n time = time + \"\";\n var timeSplits = time.split(\"/\");\n if (timeSplits.length) {\n // Begin time is the first part of the split.\n time = timeSplits[0];\n }\n }\n // Time is expected to be time format string if it is not a number.\n // Convert time value into Date object.\n time = new Date(isNaN(time) ? time : parseInt(time, TIME_RADIX));\n }\n return time;\n }", "getStartTime() {\n return this.startTime;\n }", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function str_start_time(vm){\n return pretty_time(vm.STIME);\n}", "function getInitialTime() {\n changeTime();\n}", "get startTime() { return this._startTime; }", "function setTimefieldTimeBegin(time) {\n if (!continueProcessing) {\n $('#clipBegin').timefield('option', 'value', time);\n }\n}", "getTime(){return this.time;}", "get time () {\n\t\treturn this._time;\n\t}", "get time() {}", "start_time(val) {\n this._start_time = val;\n return this;\n }", "function get_time() {\n return Date.now();\n}", "get timeOrigin() {\n return this[kTimeOriginTimestamp];\n }", "function startTime() {\r\n var delta = Date.now() - start_time; // in milliseconds\r\n time.seconds = Math.floor((delta % (1000 * 60)) / 1000);\r\n time.minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\r\n time.hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n\r\n if(time.seconds < 10) {\r\n seconds_display.textContent = '0' + time.seconds; \r\n }\r\n else {\r\n seconds_display.textContent = time.seconds; \r\n }\r\n\r\n if(time.minutes < 10) {\r\n minutes_display.textContent = '0' + time.minutes;\r\n }\r\n else {\r\n minutes_display.textContent = time.minutes;\r\n }\r\n\r\n if(time.hours < 10) {\r\n hours_display.textContent = '0' + time.hours;\r\n }\r\n else {\r\n hours_display.textContent = time.hours;\r\n }\r\n}", "function getTime(){ // gets time from HTML\r\n\t\treturn document.querySelector('#task-time').value;\r\n\t}", "function tStart(end){\n\t\t\tvar t = new Date(), f = $scope.event,\n\t\t\tds = f.dateStart, ts = f.timeStart,\n\t\t\tde = f.dateEnd, te = f.timeEnd;\n\t\t\tif(!end){\n\t\t\t\tt.setFullYear(ds.getFullYear(), ds.getMonth(), ds.getDate(), ts.getHours(), ts.getMinutes(), 0, 0);\n\t\t\t\tt.setHours(ts.getHours(), ts.getMinutes(), 0, 0);\n\t\t\t}else{\n\t\t\t\tt.setFullYear(de.getFullYear(), de.getMonth(), de.getDate());\n\t\t\t\tt.setHours(te.getHours(), te.getMinutes(), 0, 0);\n\t\t\t}\n\t\t\treturn roundMinutes(t);\n\t\t}", "get startMoment() {\n if (!this._startMoment) \n this._startMoment = moment.tz(this.startTime, \"hh:mm a\", false, this.timezone)\n\n return this._startMoment\n }", "function o2ws_get_time() { return o2ws_get_float(); }", "get time() {\n return (process.hrtime()[0] * 1e9 + process.hrtime()[1]) / 1e6;\n }", "function getStart(type) {\n\treturn moment().startOf(type).utc().format();\n}", "getTime() {\n return this.startTime ? Math.floor((Date.now() - this.startTime) / 1000) : 0;\n }", "get displayTime() {\n return this._timeEl.innerHTML;\n }", "get time() {\n return this._time;\n }", "get loopStart() {\n return new TimeClass(this.context, this._loopStart, \"i\").toSeconds();\n }", "time() {\n return (new Date()).valueOf() + this.offset;\n }", "function gettime() {\n //return Math.round(new Date().getTime() / 1000);\n return Math.round(Date.now() / 1000);\n}", "function getTimerTime(){\n return Math.floor((new Date() - startTime) / 1000); // Get current time and subtract from start time. Since this is in miliseonds we need to convert to miliseconds nad round down.\n}", "now () {\n return this.t;\n }", "static get_time() {\n return (new Date()).toISOString();\n }", "function getStartTime (string) {\n var time = new Date(string)\n return Math.floor(time.valueOf() / 1000)\n}", "function recordStartTime() {\n\tthis._startAt = process.hrtime()\n\tthis._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function startTime()\n{\t\n\tvar today=new Date();\n\tvar h=today.getUTCHours();\n\tvar m=today.getUTCMinutes();\n\tvar s=today.getUTCSeconds();\n\tvar day=today.getUTCDate();\n\tvar month=today.getUTCMonth()+1;\n\tvar year=today.getUTCFullYear()\n\t\n\t// add a zero in front of numbers<10\n\tm=if0(m);\n\ts=if0(s);\n\th=if0(h);\n\tday=if0(day);\n\tmonth=if0(month);\n\t$('.showUTCTime').text(day+\".\"+month+\".\"+year+\" \"+h+\":\"+m+\":\"+s);\n\tsetTimeout(\"startTime()\",1000);\n}", "getArrivalTime(type) {\n let time = this.arrival_time.value;\n time = new Date(time*1000)\n if (type === 'text') {\n time = this._formatTime(time);\n }\n return time;\n }", "function getTimeNow () {\n\tvar x = new Date();\n\tvar h = x.getHours();\n\tvar m = x.getMinutes()/60;\n\tselectedTime = h + m;\n\treturn (h + m);\n}", "getRealTime() {\n return Math.floor(this.time / 1000);\n }", "getPlayTime() {\n return this.time;\n }", "getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n }", "function getTimefieldTimeEnd() {\n return parseFloat($('#clipEnd').timefield('option', 'value'));\n}", "function elementSelectedStartTime(){\r\n\tvar choice,filler,hour,minute,timeDate;\r\n\tchoice = document.form.startTime.value;\r\n\tif (!(choice == \"\")) filler = \"12/12/2000 \";\r\n\t//Date portion of Date object is thrown away, only the hours and minutes are used\r\n\ttimeDate=new Date(filler + choice);\r\n\tif(isNaN(timeDate.getHours())) \r\n\thour = \"<Var>StartHour</Var>\\n \"; else hour = \"<Ind type=\\\"integer\\\">\"+ timeDate.getHours() + \"</Ind>\\n \";\r\n\tif(isNaN(timeDate.getMinutes())) \r\n\tminute = \"<Var>StartMinute</Var>\\n \"; else minute = \"<Ind type=\\\"integer\\\">\"+ timeDate.getMinutes() + \"</Ind>\\n \";\r\n\tif (choice == \"\") englishStartTime = \"any time\";\t\r\n\telse englishStartTime = choice;\r\n\tstartTime = hour + minute + \"</Expr>\\n \";\r\n\telementErrorDateTimeCheck();\r\n\tcreateRuleML();\r\n}", "function getTimeSetted() {\n let h = existOrDefault($('#timer-start-hours').val(), 0);\n let m = existOrDefault($('#timer-start-minutes').val(), 0);\n let s = existOrDefault($('#timer-start-seconds').val(), 0);\n return ((h * 60 * 60) + (m * 60) + s) * 1000;\n}", "get generationTime() {\n return this.id.readInt32BE(0);\n }", "set startTime(value) { this._startTime = value || new Date(); }", "get defaultValueTime() {\n\t\treturn this.__defaultValueTime;\n\t}", "get startingPositionTimestampInput() {\n return this._startingPositionTimestamp;\n }", "function get_time() {\n return new Date().getTime();\n}", "function get_time() {\n return new Date().getTime();\n}", "begin() {\n return this.timestamp();\n }", "get startMS() {\n return this._startMS;\n }", "get startMS() {\n return this._startMS;\n }", "function startTime() {\n s = (s+1) % 60;\n if (s == 0)\n m = (m+1) % 60;\n var ms=checkTime(m);\n var ss=checkTime(s);\n document.getElementById('time').innerHTML=ms+\":\"+ss;\n t=setTimeout(function(){startTime()},1000);\n }", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function startTime() {\n setTimer();\n}", "renderStartTime()\n{\n if(this.state.startTime === \"\")\n {\n return(\"Start Time*\");\n }\n else\n {\n return(this.state.startTime.toString());\n } \n}", "getCurrentTime() {\n return Math.floor(Date.now() / 1000);\n }", "function getStartDateTimeFromInput() {\n\t\n\tvar startDateTimeArray = document.getElementById(\"start_date_time_input\").value.split(\":\");\n\t\n\tif (startDateTimeArray.length != 2) {\n\t\treturn;\n\t}\n\n\tvar startDateTime = new Date(currentDate());\n\tstartDateTime.setHours(parseInt(startDateTimeArray[0]));\n\tstartDateTime.setMinutes(parseInt(startDateTimeArray[1]));\n\t\n\treturn startDateTime;\n}", "get timingDateTime() {\n\t\treturn this.__timingDateTime;\n\t}", "function get_time(){\n const today = new Date()\n let time = today.getHours() + \":\" + today.getMinutes();\n return time;\n }", "function currTime() {\n var dt = dateFilter(new Date(), format,'-0800');\n element.text(dt);\n // element point to line 11 span element\n }", "get timeSignature() {\n return this._timeSignature;\n }", "function startTime() {\n\tvar now = new Date();\n\tvar hour = ('0' + now.getHours()).slice(-2);\n\tvar mins = now.getMinutes();\n\tvar secs = now.getSeconds();\n\tvar ampm = hour >= 12 ? 'PM' : 'AM';\n\tvar day = ('0' + now.getDate()).slice(-2);\n\tvar month = ('0' + (now.getMonth()+1)).slice(-2);\n\tvar year = now.getFullYear();\n \thour = hour ? hour : 12;\n\tmins = mins < 10 ? '0' + mins : mins;\n\tsecs = secs < 10 ? '0' + secs : secs;\n\tvar timeString = hour + ':' + mins;\n\tvar dateString = month + '/' + day + '/' + year;\n\tdocument.getElementById('time').innerHTML = timeString;\n\tdocument.getElementById('date').innerHTML = dateString;\n\tvar t = setTimeout(startTime, 500);\n}", "function startTime(){\n if(start)\n clearInterval(start);\n\n start = setInterval(updateTime, 1000); //essa funçao faz o delay em cada 1000 milisegundos actualiza o time\n }", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function begin_format(obj,counter){\n var begin = find_time(([obj.begin.hour,obj.begin.min,0]).toString())\n if(check_time(begin._milliseconds) == true){\n dom_format('start',counter,begin,true)\n }else if(check_time(begin._milliseconds) == false){\n dom_format('start',counter,begin,false,\"Started\")\n }else{\n console.log(\"We’re gonna need a bigger boat!\")\n }\n }", "time() {\n\n var d = new Date();\n\n t = d.getTime()\n\n return t;\n\n }", "function curr_time(){\n return Math.floor(Date.now());\n}", "function getTime() {\n\ttest = new Date();\n\thour = test.getHours();\n\tminutes = test.getMinutes();\n\tvar suffix = hour >= 12 ? \"pm\":\"am\";\n\thour = ((hour + 11) % 12 + 1);\n\ttime = hour + \":\" + minutes + suffix;\n\treturn time;\n}", "function getTime(){\n \n hr = hour();\n mn = minute();\n sc = second();\n}", "function time() {\n return dateFormat(\"isoUtcDateTime\");\n}", "get_presenceMinTime()\n {\n return this.liveFunc._presenceMinTime;\n }", "function timeNow() {\n var d = new Date(),\n h = (d.getHours()<10?'0':'') + d.getHours(),\n m = (d.getMinutes()<10?'0':'') + d.getMinutes(),\n s = (d.getSeconds()<10?'0':'') + d.getSeconds();\n return h + ':' + m + ':' + s;\n }", "getTime(){\n var date = new Date();\n var heure= date.getHours().toString(); //l'heure\n var minute= date.getMinutes().toString();//a la minute\n if(heure===\"0\"){\n heure=\"00\";\n }\n if(heure.length===1 && heure!=\"0\"){\n heure=\"0\"+heure;\n }\n if(minute===\"0\"){\n minute=\"00\";\n }\n if(minute.length===1 && minute!=\"0\"){\n minute = \"0\"+minute;\n }\n\n var time = heure+\":\"+minute;\n return time;\n }", "function getCurTime () {\n var myDate = new Date();\n return myDate.toLocaleTimeString();\n }", "tmpGetPendingStart() {\n const getSecondsDiff = (date) => {\n return date !== null ? Math.round((new Date() - date) / 1000) : null;\n }\n return {\n startingResName: this.activeStartingResource,\n startingElapsedSecs: getSecondsDiff(this.activeStartingTime),\n lastStartElapsedSecs: getSecondsDiff(this.lastResourceStartTime),\n };\n }", "_getTime () {\r\n return (Date.now() - this._startTime) / 1000\r\n }", "function getFormattedTime() {\n var today = new Date();\n\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "get total_time() { return this._total_time; }", "function time() {\r\n var data = new Date();\r\n var ora = addZero( data.getHours() );\r\n var minuti = addZero( data.getMinutes() );\r\n return orario = ora + ':' + minuti;\r\n }", "function getTime() {\r\n var currentTime = new Date();\r\n var hours = currentTime.getHours();\r\n var minutes = currentTime.getMinutes();\r\n if (minutes < 10) {\r\n minutes = \"0\" + minutes;\r\n }\r\n return hours + \":\" + minutes;\r\n}", "get timingDateTime () {\n\t\treturn this._timingDateTime;\n\t}", "get timingDateTime () {\n\t\treturn this._timingDateTime;\n\t}", "function get_time(long) {var date=new Date().addHours(0);var hour=date.getHours();hour=(hour<10?\"0\":\"\")+hour;var min=date.getMinutes();min=(min<10?\"0\":\"\")+min;return hour+((long)?\":\":\"\")+min;}", "get hourStart() {\n\t\treturn this.nativeElement ? this.nativeElement.hourStart : undefined;\n\t}", "getCurrentTime(){\n //Declaring & initialising variables\n\t\tlet crnt = new Date();\n\t\tlet hr = \"\";\n\t\tlet min = \"\";\n\n\t\t//checking if the hours are sub 10 if so concatenate a 0 before the single digit\n\t\tif (crnt.getHours() < 10){\n\t\t\thr = \"0\" + crnt.getHours();\n\t\t}\n\t\telse{\n\t\t\thr = crnt.getHours();\n\t\t}\n\n\t\t//checking if mins are sub 10 if so concatenate a 0 before the single digit\n\t\tif (crnt.getMinutes() < 10){\n\t\t\tmin = \"0\" + crnt.getMinutes()\n\t\t\treturn hr + \":\" + min\n\t\t}\n\t\telse{\n\t\t\tmin = crnt.getMinutes();\n\t\t\treturn hr + \":\" + min\n\t\t}\n\t}", "function time(){\n\tvar d = new Date();\n\tvar hours = function() {\n\t\th = d.getHours();\n\t\tif (h <= 9) {\n\t\t\th = 0 + \"\" + h;\n\t\t}\n\t\treturn h;\n\t};\n\tvar mins = function() {\n\t\tvar m = d.getMinutes();\n\t\tif (m <= 9 ) {\n\t\t\tm = 0 + \"\" + m;\n\t\t}\n\t\treturn m\n\t}\n\tt = hours() + \"\" + mins();\n\tt = parseFloat(t);\n\treturn t;\n}", "get requestTime() {\n return this.get('x-request-time');\n }", "get _timestamp() {\n\t\tlet timestamp = this.timestamp !== undefined ? this.timestamp : getTodayUTCTimestamp(this._primaryCalendarType);\n\t\tif (timestamp < this._minTimestamp || timestamp > this._maxTimestamp) {\n\t\t\ttimestamp = this._minTimestamp;\n\t\t}\n\t\treturn timestamp;\n\t}", "function updateStartTime(){\n if(mode == \"play\"){\n startTime = millis();\n }\n}", "function getTime() {\n var dt = new Date();\n var curTime = zeroFill(dt.getHours(),2) + \":\" + zeroFill(dt.getMinutes(),2) + \":\" + zeroFill(dt.getSeconds(),2);\n return (dt.getMonth() + 1) + \"/\" + dt.getDate() + \" - \" + curTime;\n}", "function startTime() {\n\ttime = setInterval(() => {\n\t\tseconds = seconds + 1;\n\t\tif (seconds == 59) {\n\t\t\tseconds = 0;\n\t\t\tmin = min + 1;\n\t\t}\n\t\tif (min == 60) {\n\t\t\tmin = 0;\n\t\t\thour = hour + 1;\n\t\t}\n\t\ttimeSpace.innerHTML = \"h\" + hour + \":\" + min + \"m : \" + seconds + \"s\";\n\t\t// to Show time\n\t}, 1000)\n}", "function getRealSelectedTimeString() {\n return models[\"ChesapeakeBay_ADCIRCSWAN\"][\"lastForecast\"].clone().add(currentHourSetting, \"hours\").format(\"YYYY-MM-DD HH:MM:SS\")\n}", "function getBlockStart(period){\n var start = '';\n switch(period){\n /* block 1 */\n case '2': \n start = \"08:35:00\";\n break;\n /* block 2 */\n case '3': \n start = \"09:30:00\";\n break;\n /* block 3 */\n case '5': \n start = \"10:45:00\";\n break;\n /* block 4 */\n case '6': \n start = \"11:40:00\";\n break;\n /* block 5 */\n case '7': \n start = \"12:35:00\";\n break;\n /* block 6 */\n case '9': \n start = \"14:20:00\";\n break;\n }\n return start;\n}" ]
[ "0.74440545", "0.7116336", "0.71033245", "0.7048362", "0.69733655", "0.678038", "0.678038", "0.67653894", "0.66260076", "0.6594966", "0.64558536", "0.638636", "0.63836277", "0.63806134", "0.6375121", "0.63515353", "0.6351411", "0.6349188", "0.6327187", "0.63231933", "0.63164765", "0.6276693", "0.62677705", "0.62501216", "0.6248124", "0.62336206", "0.6199058", "0.6198035", "0.61382776", "0.6129139", "0.6119961", "0.6100469", "0.60965866", "0.6072031", "0.60536736", "0.60536736", "0.60536736", "0.60536736", "0.60536736", "0.6052413", "0.6039775", "0.6022649", "0.60209846", "0.60100573", "0.5990614", "0.5990511", "0.59708065", "0.5954157", "0.59473825", "0.59365946", "0.59311575", "0.59180635", "0.5915409", "0.5915409", "0.59123015", "0.59116304", "0.59116304", "0.5909481", "0.589755", "0.58974606", "0.589283", "0.58922946", "0.58894795", "0.5871596", "0.58684295", "0.5856842", "0.5853466", "0.5843482", "0.5843125", "0.58368224", "0.5835695", "0.58337647", "0.58242685", "0.5819525", "0.5819396", "0.5806389", "0.5799433", "0.5790721", "0.5778772", "0.5772653", "0.5770438", "0.5768406", "0.5767496", "0.5761926", "0.5759758", "0.575737", "0.57550526", "0.57550395", "0.57550395", "0.5738642", "0.5734239", "0.5732782", "0.57211196", "0.57195663", "0.57020664", "0.57005835", "0.56995", "0.5694591", "0.5690758", "0.56902796" ]
0.76334107
0
get the timefield end time
function getTimefieldTimeEnd() { return parseFloat($('#clipEnd').timefield('option', 'value')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "get endTime() {\n let result = null;\n if (this.ended) {\n result = new Date(this.startTime.getTime() + this.duration);\n }\n return result;\n }", "function getEndBackendTime () {\n return testPlayerService.getServerEndTime()\n .then(function (response) {\n self.endBackendTime = response.data;\n self.endBackendTime = parseInt(self.endBackendTime);\n });\n }", "function getTimefieldTimeBegin() {\n return parseFloat($('#clipBegin').timefield('option', 'value'));\n}", "function getEndTime(layer) {\n var time;\n var times = getLayerTimes(layer);\n if (times && times.length) {\n time = times[times.length - 1];\n // Check if the time value is actually a string that combines\n // begin and end time information into one string instead of\n // providing separate time values for every step.\n if (undefined !== time && null !== time && 1 === times.length) {\n // Make sure time is string before checking syntax.\n time = time + \"\";\n var timeSplits = time.split(\"/\");\n if (timeSplits.length > 1) {\n // End time is the second part of the split.\n time = timeSplits[1];\n }\n }\n // Time is expected to be time format string if it is not a number.\n // Convert time value into Date object.\n time = new Date(isNaN(time) ? time : parseInt(time, TIME_RADIX));\n }\n return time;\n }", "function getEndTimer() {\n if (secs >= 10) {\n return `${mins}:${secs}`;\n } else {\n return `${mins}:0${secs}`;\n }\n}", "function getEndTime(request){\r\n request.endTime = new Date(request.date);\r\n switch (request.duration){\r\n case \"30 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 30);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"45 minutes\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 45);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"1 hour\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 60);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n case \"2 hours\":\r\n request.endTime.setMinutes(request.date.getMinutes() + 120);\r\n request.endTimeString = request.endTime.toLocaleTimeString();\r\n break;\r\n }\r\n}", "get loopEnd() {\n return new TimeClass(this.context, this._loopEnd, \"i\").toSeconds();\n }", "get endTime() { return this.startTime.plus(this.duration); }", "function setTimefieldTimeEnd(time) {\n if (!continueProcessing) {\n $('#clipEnd').timefield('option', 'value', time);\n }\n}", "function tpEndSelect( time, startTimePickerInst ) {\n $('#eventStartTime').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "function getEnd(type) {\n\treturn moment().endOf(type).utc().format();\n}", "getEndTime() {\n var lastRunnerInfo = this._runners[this._runnerIds.indexOf(this._lastRunnerId)];\n\n var lastDuration = lastRunnerInfo ? lastRunnerInfo.runner.duration() : 0;\n var lastStartTime = lastRunnerInfo ? lastRunnerInfo.start : 0;\n return lastStartTime + lastDuration;\n }", "function fetchEndTime() {\n\t\treturn localStorage['endTime'];\n\t}", "function get_time() {\n let d = new Date();\n if (start_time != 0) {\n d.setTime(Date.now() - start_time);\n } else {\n d.setTime(0);\n }\n return d.getMinutes().toString().padStart(2,\"0\") + \":\" + d.getSeconds().toString().padStart(2,\"0\");\n }", "getDepartureTime(type) {\n let time = this.departure_time.value;\n time = new Date(time*1000)\n if (type === 'text') {\n time = this._formatTime(time);\n }\n return time;\n }", "function getRemainingTime(endtime) {\n let t = Date.parse(endtime) - Date.parse(new Date()),//difference between the date when timer expires and the moment when the function is executed (ms)\n seconds = Math.floor((t/1000) % 60),\n minutes = Math.floor((t/1000/60) % 60),\n hours = Math.floor((t/(1000*60*60)));\n\n if (t < 0){ //making the timer look nice on the page in case the date has expired\n seconds = 0;\n minutes = 0;\n hours = 0;\n }\n\n return {\n 'total' : t,\n 'seconds' : seconds,\n 'minutes' : minutes,\n 'hours' : hours\n };\n }", "hourEnd(s) {\n return s.dateTimeEnd.getHours();\n }", "get mmEnd(){\n return moment(this.end)\n }", "function getEndTime(unixTime) {\n let currentDay = moment.unix(unixTime).tz(localTZ);\n currentDay.hour(hoursOfOpEndArr[0]);\n currentDay.minute(hoursOfOpEndArr[1]);\n currentDay.second(0).millisecond(0);\n return currentDay.unix();\n }", "function o2ws_get_time() { return o2ws_get_float(); }", "get remainingTime() {\r\n return Math.ceil((this.maxTime - this.timeTicker) / 60);\r\n }", "get elapsedTime() {\n return this._t;\n }", "getDuration() { return this.endTime - this.startTime; }", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function tStart(end){\n\t\t\tvar t = new Date(), f = $scope.event,\n\t\t\tds = f.dateStart, ts = f.timeStart,\n\t\t\tde = f.dateEnd, te = f.timeEnd;\n\t\t\tif(!end){\n\t\t\t\tt.setFullYear(ds.getFullYear(), ds.getMonth(), ds.getDate(), ts.getHours(), ts.getMinutes(), 0, 0);\n\t\t\t\tt.setHours(ts.getHours(), ts.getMinutes(), 0, 0);\n\t\t\t}else{\n\t\t\t\tt.setFullYear(de.getFullYear(), de.getMonth(), de.getDate());\n\t\t\t\tt.setHours(te.getHours(), te.getMinutes(), 0, 0);\n\t\t\t}\n\t\t\treturn roundMinutes(t);\n\t\t}", "endTime(){\r\n var duration = (Math.random() * (2*60 - 1)*1000 + 1000);\r\n var now = new Date().getTime();\r\n return (now + duration);\r\n }", "get endMS() {\n return this._endMS;\n }", "get endMS() {\n return this._endMS;\n }", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function getTimeRemaining(endtime) {\n let total = Date.parse(endtime) - Date.parse(new Date());\n let seconds = Math.floor((total / 1000) % 60);\n let minutes = Math.floor((total / 1000 / 60) % 60);\n return {\n total,\n minutes,\n seconds\n };\n }", "function getTime(){ // gets time from HTML\r\n\t\treturn document.querySelector('#task-time').value;\r\n\t}", "time() {\n return (new Date()).valueOf() + this.offset;\n }", "get total_time() { return this._total_time; }", "get timeDetails() {\n let now = new Date().getTime();\n return {\n quizTime: this._time,\n start: this._startTime,\n end: this._endTime,\n elapsedTime: ((this._endTime || now) - this._startTime) / 1000, // ms to sec\n remainingTime: secToTimeStr(this._remainingTime),\n timeOver: this[TIME_OVER_SYM]\n }\n }", "getTime(){\n this.time = millis();\n this.timeFromLast = this.time - this.timeUntilLast;\n }", "function findEndTime(string) {\n\t\tconst endTimeRegex = /-T(0[0-9]|1[0-9]|2[0-3]|[0-9]):([0-5][0-9]):([0-5][0-9])$/;\n\t\tif (endTimeRegex.test(string)) {\n\t\t\treturn string.match(endTimeRegex);\n\t\t}\n\t\treturn null;\n\t}", "get hourEnd() {\n\t\treturn this.nativeElement ? this.nativeElement.hourEnd : undefined;\n\t}", "function findStartEndTime () {\n if (temperatureData[0].time.getTime() > phData[0].time.getTime()) {\n dataStartTime = phData[0].time.getTime();\n //console.log(\"took pH start time\");\n } else {\n dataStartTime = temperatureData[0].time.getTime();\n }\n if (temperatureData[temperatureData.length-1].time.getTime() < phData[phData.length-1].time.getTime()) {\n dataEndTime = phData[phData.length-1].time.getTime();\n //console.log(\"took pH end time\");\n } else {\n dataEndTime = temperatureData[temperatureData.length-1].time.getTime();\n }\n\n console.log(\"Start: \" + new Date(dataStartTime) + \" End: \" + new Date(dataEndTime));\n}", "end() {\n return this.timestamp();\n }", "function getTimerTime(){\n return Math.floor((new Date() - startTime) / 1000); // Get current time and subtract from start time. Since this is in miliseonds we need to convert to miliseconds nad round down.\n}", "getTime(){return this.time;}", "function remaining_time() {\n let delta_time = Date.parse(end_date) - Date.parse(new Date()), //get quantity of the milliseconds from now to the end date\n seconds = Math.floor((delta_time/1000) % 60), //get seconds\n minutes = Math.floor((delta_time/1000/60) % 60), //get minutes\n hours = Math.floor((delta_time/1000/60/60)); //get hours\n\n //the time object\n return {\n 'total': delta_time,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n }\n }", "get time () {\n\t\treturn this._time;\n\t}", "get time() {\n return this._time;\n }", "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n\n return {\n 'total': t,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "get max_time_allowed() { return this._max_time_allowed; }", "function getTimeRemaining(endtime) {\n const tech = Date.parse(endtime) - Date.parse(new Date()), //при запуске функции мы получим разницу в миллисекундах между датами\n days = Math.floor(tech / (1000 * 60 * 60 * 24)), //получаем количество дней до окончания акции(в скобках получили количетво миллисекунд в одних сутках)(1000 миллисекунд умножаем на 60 секунд, после умножаем на 60 минут и умножаем на 24 часа в сутках)\n hours = Math.floor((tech / (1000 * 60 * 60) % 24)),\n minutes = Math.floor((tech / 1000 / 60) % 60),\n seconds = Math.floor((tech / 1000) % 60);\n\n return {\n 'total': tech,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n }", "getRealTime() {\n return Math.floor(this.time / 1000);\n }", "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n return {\n 'total': t,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "function displayEndTime(timestamp) {\n\tconst end = new Date(timestamp); //grab and convert calc-ed end time\n\tconst hour = end.getHours();\n\tconst adjustedHour = hour > 12 ? hour - 12 : hour; //change to 12-hour system\n\tconst minutes = end.getMinutes();\n\n\t//display end time on page and add leading '0' if less than 10mins left\n\tendTime.textContent = `Be Back At ${adjustedHour}:${minutes < 10 ? '0' : ''}${minutes}`; \n}", "getPlayTime() {\n return this.time;\n }", "function get_time(long) {var date=new Date().addHours(0);var hour=date.getHours();hour=(hour<10?\"0\":\"\")+hour;var min=date.getMinutes();min=(min<10?\"0\":\"\")+min;return hour+((long)?\":\":\"\")+min;}", "function elementSelectedEndTime(){\r\n\tvar choice, throwAwayDate, hour, minute,timeDate;\r\n\tchoice = document.form.endTime.value;\r\n\tif (!(choice == \"\")) throwAwayDate = \"12/12/2000 \";\r\n\t//Date portion of Date object is not used, only the hours and minutes are used. Date object parses time fairly well.\r\n\ttimeDate=new Date(throwAwayDate + choice);\r\n\tif(isNaN(timeDate.getHours())) hour = \"<Var>EndHour</Var>\\n \"; else hour = \"<Ind type=\\\"integer\\\">\"+ timeDate.getHours() + \"</Ind>\\n \";\r\n\tif(isNaN(timeDate.getMinutes())) minute = \"<Var>EndMinute</Var>\\n \"; else minute = \"<Ind type=\\\"integer\\\">\"+ timeDate.getMinutes() + \"</Ind>\\n \";\r\n\tendTime = hour + minute + \" \" + \"</Expr>\\n \";\r\n\tif (choice == \"\") englishEndTime = \"any time\";\t\r\n\telse englishEndTime = choice;\r\n\telementErrorDateTimeCheck();\r\n\tcreateRuleML();\r\n}", "function end_format(obj,counter){\n var end = find_time(([obj.end.hour,obj.end.min,0]).toString())\n if(check_time(end._milliseconds) == true){\n dom_format('end',counter,end,true)\n }else if(check_time(end._milliseconds) == false){\n dom_format('end',counter,end,false,\"Ended\")\n }else{\n console.log(\"Luke, I am your father.\")\n }\n }", "get time() {\n return (process.hrtime()[0] * 1e9 + process.hrtime()[1]) / 1e6;\n }", "function handleTime() {\r\n // times\r\n const minutes = parseInt(this.dataset.time) * 60;\r\n const today = Date.now();\r\n console.log(minutes);\r\n // converting\r\n const ms = minutes * 1000;\r\n // calculation\r\n const together = today + ms;\r\n const newTime = new Date(together);\r\n //displaying\r\n const displayUno = newTime.getHours();\r\n const displayTwo = newTime.getMinutes();\r\n endTime.textContent = `U should be back at ${displayUno < 10 ? '0': ''}${displayUno}:${displayTwo < 10 ? '0':''}${displayTwo}`\r\n}", "function getTimeRemaining(endtime){\n var t = Date.parse(endtime) - Date.now(); // parse zet datum \n var seconds = Math.floor( (t/1000) % 60 );\n var minutes = Math.floor( (t/1000/60) % 60 );\n var hours = Math.floor( (t/(1000*60*60)) % 24 );\n var days = Math.floor( t/(1000*60*60*24) );\n\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "get timeSpan() {\n return this._timeSpan;\n }", "function endTimeDate(starttime, endtime) {\n\tvar result = \"\";\n\tvar endtimeDate = new Date(parseInt(endtime));\n\tvar starttimeDate = new Date(parseInt(starttime));\n\n\tvar formattedDate = endtimeDate.getDate() + \"-\" + (endtimeDate.getMonth() + 1) + \"-\" + endtimeDate.getFullYear();\n\n\tvar hours = (endtimeDate.getHours() < 10) ? \"0\" + endtimeDate.getHours() : endtimeDate.getHours();\n\tvar minutes = (endtimeDate.getMinutes() < 10) ? \"0\" + endtimeDate.getMinutes() : endtimeDate.getMinutes();\n\tvar formattedTime = hours + \":\" + minutes;\n\n\tif (endtimeDate.getDate() == starttimeDate.getDate()) {\n\t\tresult = \" til \" + formattedTime;\n\t} else if (endtimeDate.getDate() > starttimeDate.getDate()) {\n\t\tformattedDate = \"<br> Slut \" + formattedDate + \", kl. \" + formattedTime;\n\t\tresult = formattedDate;\n\t} else {\n\t\tresult = \"Wrong date object\";\n\t}\n\treturn result;\n}", "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var days = Math.floor(t / (1000 * 60 * 60 * 24));\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n }", "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var days = Math.floor(t / (1000 * 60 * 60 * 24));\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n }", "function renderTimeLabel() {\n renderText(\"TIME\", \"end\", \"#FF0\", Frogger.drawingSurfaceWidth, Frogger.drawingSurfaceHeight);\n }", "function irdTime()\n{\n\tvar ctdate = new Date();\n\tvar endResult = \"\";\n\t\n\tvar hrs = ctdate.getHours();\n\tvar mins = ctdate.getMinutes();\n\t\n\tif(ctdate.getHours()<10){\n\t\thrs = \"0\" + hrs;\n\t}\n\tif(ctdate.getMinutes()<10){\n\t\tmins = \"0\" + mins;\n\t}\n\tendResult = (hrs+\":\"+mins);\n\treturn endResult;\n}", "function windowEnd(num) {\n num = num + 1;\n if (num < 12) {\n timeEnd = num + \":00 AM\"; //Morning\n } else if (num == 12) {\n timeEnd = num + \":00 PM\"; //Midday\n } else if (num > 12) {\n num = num - 12;\n timeEnd = num + \":00 PM\"; //Afternoon\n }\n return timeEnd;\n}", "get displayTime() {\n return this._timeEl.innerHTML;\n }", "get valueTime () {\r\n\t\treturn this._valueTime;\r\n\t}", "get time() {}", "function getTimeRemaining(endtime) {\n const total = Date.parse(endtime) - Date.parse(new Date());\n const seconds = Math.floor((total / 1000) % 60);\n const minutes = Math.floor((total/1000/60) % 60);\n const hours = Math.floor((total/1000*60*60) % 24);\n const days = Math.floor((total/1000*60*60*24));\n return {\n total, days, hours, minutes, seconds\n };\n }", "function getCompataibaleTime(time){\n \tvar tArr=time.split(\":\");\n \tvar finalTime= tArr[0]+\":\"+tArr[1];\n \treturn finalTime;\n }", "get loopEnd() {\n return new TicksClass(this.context, this._loopEnd).toSeconds();\n }", "get valueTime () {\r\n\t\treturn this.__valueTime;\r\n\t}", "getArrivalTime(type) {\n let time = this.arrival_time.value;\n time = new Date(time*1000)\n if (type === 'text') {\n time = this._formatTime(time);\n }\n return time;\n }", "get timeOrigin() {\n return this[kTimeOriginTimestamp];\n }", "function getRealSelectedTimeString() {\n return models[\"ChesapeakeBay_ADCIRCSWAN\"][\"lastForecast\"].clone().add(currentHourSetting, \"hours\").format(\"YYYY-MM-DD HH:MM:SS\")\n}", "function calculateEndTime(startTime, message) {\n const reg = /(\\d+):(\\d+):(\\d+),000/;\n const match = startTime.match(reg);\n let addTime = 5 + (0.2 * message.length);\n let seconds = parseInt(match[3]) + addTime;\n let minutes = Math.floor(parseInt(match[2]) + Math.floor(seconds / 60));\n seconds %= 60;\n let millis = Math.floor((seconds % 1) * 100);\n seconds = Math.floor(seconds)\n let hours = Math.floor(parseInt(match[1]) + Math.floor(minutes / 60));\n minutes %= 60;\n return `${hours}:${minutes}:${seconds},${millis}`;\n}", "getStartTime() {\n return this.startTime;\n }", "duration() {\n if (this.end) return this.end.getTime() - this.start.getTime();\n else return new Date().getTime() - this.start.getTime();\n }", "function getRemainingTime() {\n return new Date().getTime() - startTimeMS;\n}", "function displayEndTime(timestamp) {\n const end = new Date() // used new date method to get current time \n\n const hour = end.getHours() // get the hours using new Date() method\n\n const minutes = end.getMinutes() // get the minutes using minutes \n\n const adjustedHourTo24h = hour > 12 ? hour - 12 : hour; // adjusting hour to 24h format\n\n // displaying conntent to user using textContent\n\n endTime.textContent = `Be back at ${adjustedHourTo24h}:${minutes < 10 ? '0': ''}${minutes}`;\n}", "function endGame(){\n var end = new Date();\n endTime = end.getTime();\n startTime = start.getTime();\n console.log(\"start Time: \" + startTime + \" End Time \" + endTime);\n var finalTime = (end.getTime() - start.getTime())/1000;\n $(\"#timing\").show();\n document.getElementById(\"timing\").innerHTML = \"It took you \" + finalTime + \" seconds! Tell your friends.\";\n\n }", "function isWithinTimeWindow(starttime, endtime) { \r\n //Dummy Record to get current timeof day\r\n var dummyConfig = record.create({type: \"customrecord_flo_spider_configuration\", isDynamic: true});\r\n currenttime = dummyConfig.getValue({fieldId: 'custrecord_flo_conf_current_tod'})\r\n \r\n\r\n var ret = false;\r\n\r\n //Compare by Hour and Minutes because Timezone is a mess.\r\n\r\n if(starttime != null && starttime != \"\" && endtime != null && endtime != \"\" && currenttime) {\r\n\r\n log.debug(\"currenttime\",currenttime.getHours() + \" : \" + currenttime.getMinutes());\r\n log.debug(\"starttime\",starttime.getHours() + \" : \" + starttime.getMinutes());\r\n log.debug(\"endtime\",endtime.getHours() + \" : \" + endtime.getMinutes());\r\n\r\n if(starttime.getHours() > endtime.getHours()) {\r\n if(currenttime.getHours() > starttime.getHours()) { \r\n ret = true;\r\n } else if(currenttime.getHours() == starttime.getHours() && currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n } else if(currenttime.getHours() < endtime.getHours() ) {\r\n ret = true;\r\n } else if(currenttime.getHours() == endtime.getHours() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() >= starttime.getHours() && currenttime.getHours() <= endtime.getHours()) {\r\n if(currenttime.getHours() == starttime.getHours() && currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes() && currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == starttime.getHours()) {\r\n if(currenttime.getMinutes() >= starttime.getMinutes()) {\r\n ret = true;\r\n }\r\n } else if(currenttime.getHours() == endtime.getHours()) {\r\n if(currenttime.getMinutes() < endtime.getMinutes()) {\r\n ret = true;\r\n } \r\n } else {\r\n ret = true;\r\n }\r\n \r\n }\r\n } else {\r\n ret = true; \r\n }\r\n \r\n return ret;\r\n }", "function find_time(time) {\n // Saving Private Input\n var event = moment(time, 'H,m,s').unix(), // In Unix so you can do some operations\n // Getting the current time in unix time\n current = moment().unix(),\n // Computer is calculating the difference of the two\n diffTime = moment.duration((event - current) * 1000, 'milliseconds')\n // Are you kidding me, I'm still gonna send it\n return(diffTime)\n }", "get timingRange () {\n\t\treturn this._timingRange;\n\t}", "get elapsedTime() {\n\t\treturn this.__Internal__Dont__Modify__.elapsedTime;\n\t}", "function getTimeRemaining(endtime) {\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor((t / 1000) % 60);\n var minutes = Math.floor((t / 1000 / 60) % 60);\n var hours = Math.floor((t / (1000 * 60 * 60)) % 24);\n var days = Math.floor(t / (1000 * 60 * 60 * 24));\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "get remainTime(){ \n let remainTime =''\n if (this.scheduler) {\n if (this.isPaused) {\n remainTime = 'pause';\n } else {\n let breakType = this.nextBreakType()\n if (breakType) {\n console.log(this.scheduler.timeLeft);\n remainTime = `${Utils.formatTillBreak(this.scheduler.timeLeft)}`\n }\n }\n }\n return remainTime\n }", "function autoEndtime() {\n\n var OTFRAC = document.getElementById('ctl00_ContentPlaceHolder1_hfOTFRAC').value;\n\n shift = document.getElementById('ctl00_ContentPlaceHolder1_txtShift').value;\n\n var breakStartTime = shift.substring(16, 21);\n var breakStartHour = breakStartTime.substring(0, 2);\n var breakStartMin = breakStartTime.substring(3, 5);\n\n\n var breakEndTime = shift.substring(23, 28);\n var breakEndHour = breakEndTime.substring(0, 2);\n var breakEndMin = breakEndTime.substring(3, 5);\n\n //Convert hour in minutes\n breakStartHour = parseInt(breakStartHour, 10) * 60;\n breakStartMin = parseInt(breakStartMin, 10) + parseInt(breakStartHour, 10);\n\n breakEndHour = parseInt(breakEndHour, 10) * 60;\n breakEndMin = parseInt(breakEndMin, 10) + parseInt(breakEndHour, 10);\n\n var breakMin = breakEndMin - breakStartMin;\n\n var table = document.getElementById('tst');\n var tbody = table.getElementsByTagName('TBODY')[0];\n var oRow = table.rows[position];\n\n oRow.getElementsByTagName('INPUT')[1].value = formatTime(oRow.getElementsByTagName('INPUT')[1].value, OTFRAC);\n var start = oRow.getElementsByTagName('INPUT')[1].value;\n\n if (start.length == '5') \n {\n \n var startHourInMin = parseInt(start.substring(0, 2), 10) * 60;\n var startMin = parseInt(start.substring(3, 5), 10);\n\n var workHoursInMin = parseFloat(oRow.getElementsByTagName('INPUT')[3].value, 10) * 60;\n\n var startTimeInMin = startHourInMin + startMin;\n\n var endTimeInMin = startTimeInMin + workHoursInMin;\n\n if (startTimeInMin >= breakStartMin && startTimeInMin < breakEndMin) \n {\n// var hour = ((startTimeInMin + breakMin) / 60).toString();\n// if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n// hour = hour.substring(0, hour.indexOf(\".\", 0));\n// var min = startTimeInMin % 60;\n\n// if (hour < 10)\n// hour = '0' + hour;\n\n// if (min < 10)\n// min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[1].value = breakEndTime;\n }\n \n\n if (endTimeInMin > breakStartMin && startHourInMin <= breakStartMin)\n endTimeInMin += breakMin;\n\n //convert minutes back to hour\n var hour = (endTimeInMin / 60).toString();\n if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n hour = hour.substring(0, hour.indexOf(\".\", 0));\n var min = endTimeInMin % 60;\n\n\n if (hour < 10)\n hour = '0' + hour;\n\n if (min < 10)\n min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[2].value = hour + ':' + min;\n \n\n var nRow = table.rows[position + 1];\n if (nRow != undefined) \n {\n nRow.getElementsByTagName('INPUT')[1].value = hour + ':' + min;\n\n// var start = nRow.getElementsByTagName('INPUT')[1].value;\n// var end = nRow.getElementsByTagName('INPUT')[2].value;\n\n// var startHour = parseInt(start.substring(0, 2), 10) * 60;\n// var startMin = parseInt(start.substring(3, 5), 10);\n// start = startHour + startMin;\n\n// var endHour = parseInt(end.substring(0, 2), 10) * 60;\n// var endMin = parseInt(end.substring(3, 5), 10);\n// end = endHour + endMin;\n\n// var workHours = (end - start) / 60;\n\n// nRow.getElementsByTagName('INPUT')[3].value = workHours;\n\n// if (workHours <= 0) {\n nRow.getElementsByTagName('INPUT')[2].value = '';\n nRow.getElementsByTagName('INPUT')[3].value = '';\n// }\n }\n }\n}", "function displayEndTime(timestamp) {\n\t// create new Date, hours, mins based on passed argument\n\tconst end = new Date(timestamp);\n\tconst hour = end.getHours();\n\t// adjust hour from military time (values = 0 or > 12);\n\tconst adjustedHour = hour > 12 ? hour - 12 : hour === 0 ? 12 : hour;\n\tconst minutes = end.getMinutes();\n\tconst adjustedMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\t// Set text to adjusted time\n\tendTime.textContent = `Return at ${adjustedHour}:${adjustedMinutes}`;\n}", "function getTimeSelection() {\n return $(\"#timeselect\").val();\n }", "function getTimeRemaining(endtime){\n var t = Date.parse(endtime) - Date.parse(new Date());\n var seconds = Math.floor( (t/1000) % 60 );\n var minutes = Math.floor( (t/1000/60) % 60 );\n var hours = Math.floor( (t/(1000*60*60)) % 24 );\n var days = Math.floor( t/(1000*60*60*24) );\n return {\n 'total': t,\n 'days': days,\n 'hours': hours,\n 'minutes': minutes,\n 'seconds': seconds\n };\n}", "function calculateDuration() {\n return endTime - startTime;\n }", "function calculateDuration() {\n return endTime - startTime;\n }", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function ellapseTime (start, end) {\n var endTime;\n if (!start) {\n alert('ellapseTime on QUAD_LIB: Please tell me where to get the begin date(time).');\n } else {\n start = Date.parse(start);\n\n }\n // ALL DATES -> NUMERIC format since desde 1 de janeiro de 1970 00:00:00 UTC\n if (!end || end == 'undefined') {\n endTime = Date.now();\n } else {\n endTime = Date.parse(end);\n }\n\n var timeDiff = endTime - start, str=''; //in ms\n\n var seconds = parseInt(timeDiff/1000, 10);\n var days = Math.floor(seconds / (3600*24));\n seconds -= days*3600*24;\n var hrs = Math.floor(seconds / 3600);\n seconds -= hrs*3600;\n var mnts = Math.floor(seconds / 60);\n seconds -= mnts*60;\n //console.log(days+\" days, \"+hrs+\" Hrs, \"+mnts+\" Minutes, \"+seconds+\" Seconds\");\n if (days) {\n if (days === 1) {\n str += days + \" \" + JS_DAY + \" \";\n } else {\n str += days + \" \" + JS_DAYS + \" \";\n }\n }\n if (hrs) {\n if (!mnts && !seconds && str.length > 0) {\n str += \" \" + JS_AND + \" \"\n }\n if (mnts === 1) {\n str += hrs + \" \" + JS_HOUR + \" \";\n } else {\n str += hrs + \" \" + JS_HOURS + \" \";\n }\n }\n if (mnts) {\n if (!seconds && str.length > 0) {\n str += \" \" + JS_AND + \" \"\n }\n if (mnts === 1) {\n str += mnts + \" \" + JS_MINUTE + \" \";\n } else {\n str += mnts + \" \" + JS_MINUTES + \" \";\n }\n }\n if (seconds) {\n if (str.length > 0) {\n str += \" \" + JS_AND + \" \"\n }\n if (seconds === 1) {\n str += seconds + \" \" + JS_SECOND + \" \";\n } else {\n str += seconds + \" \" + JS_SECONDS + \" \";\n }\n }\n return (str);\n}", "function timeGo(){\n\t\t\tvar dateNow=new Date();\n\t\t\tvar arr=adddate(dateNow,dateEnd);\n\t\t\tfor (var i=0;i<arr.length;i++) {\n\t\t\t\tarr[i] = arr[i] < 10 ? '0'+arr[i]:arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tvar txt=arr[0]+\"天\"+arr[1]+\"小时\"+arr[2]+\"分\"+arr[3]+\"秒\";\n\t\t\t$('.timeRest b').text(txt);\n\t\t\t\n\t\t\tif(dateNow.getTime() >= dateEnd.getTime()){\n\t\t\t\tclearInterval(iCount);\n\t\t\t\tarr = [00,00,00,00];\n\t\t\t\t$('.timeRest').html(\"<p>众筹已结束</p><p>十月遵义不见不散</p>\").css(\"color\",\"red\").css(\"font-weight\",\"bolder\");\n\t\t\t}\n\t\t}", "function getTime(startTime){\n endTime = new Date();\n return (endTime-startTime)/1000;\n }", "get timingDateTime() {\n\t\treturn this.__timingDateTime;\n\t}", "function gettime() {\n //return Math.round(new Date().getTime() / 1000);\n return Math.round(Date.now() / 1000);\n}" ]
[ "0.7059088", "0.67957705", "0.6776984", "0.67444104", "0.6702129", "0.66810405", "0.667555", "0.66578704", "0.6602731", "0.6601408", "0.65993005", "0.646885", "0.646175", "0.643442", "0.63469785", "0.63437325", "0.63234955", "0.6297058", "0.62777525", "0.6275761", "0.62388605", "0.62324566", "0.6225291", "0.6206274", "0.6162121", "0.61237365", "0.61153483", "0.61153483", "0.6110859", "0.60961026", "0.6093222", "0.6091552", "0.60910445", "0.60826993", "0.60798067", "0.6076207", "0.60579175", "0.60408616", "0.60397315", "0.6029028", "0.6014805", "0.6010306", "0.60067105", "0.59862006", "0.5984214", "0.5980749", "0.5969992", "0.59659594", "0.5947855", "0.5899471", "0.5893153", "0.58927876", "0.5887638", "0.58635324", "0.5863134", "0.5860972", "0.58593166", "0.585659", "0.5849094", "0.5847303", "0.5847303", "0.5844447", "0.5841096", "0.58372355", "0.58363533", "0.5829886", "0.5809643", "0.57960707", "0.5784661", "0.5781684", "0.5780589", "0.57792974", "0.5768759", "0.57683265", "0.5766578", "0.5764558", "0.57521987", "0.5751571", "0.57495195", "0.5746763", "0.57433903", "0.57414424", "0.57390416", "0.57380986", "0.5737609", "0.5734997", "0.57322645", "0.5732072", "0.57075334", "0.5702759", "0.56980526", "0.56960887", "0.56924504", "0.56924504", "0.56924504", "0.56848335", "0.56786084", "0.56698555", "0.56676495", "0.56631136" ]
0.76559126
0
setter enable/disable a split item
function setEnabled(uuid, enabled) { if (!continueProcessing && editor.splitData && editor.splitData.splits) { editor.splitData.splits[uuid].enabled = enabled; editor.updateSplitList(false, !zoomedIn()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleSplitting() {\n\t\tvar splitOK = document.getElementById(\"split\").checked;\n\t\tif (splitOK) {\n\t\t\tsplitting.activate();\n\t\t} else {\n\t\t\tsplitting.deactivate();\n\t\t}\n}", "_enableDisableHandler() {\n const that = this;\n\n if (that.disabled) {\n for (let i = 0; i < that._items.length; i++) {\n that._items[i].disabled = true;\n }\n }\n else {\n for (let i = 0; i < that._items.length; i++) {\n that._items[i].disabled = false;\n }\n }\n }", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "set enabled(value) {}", "function setItemEnabled(enabled) {\n\t\tthis.enabled = enabled == null ? true : eval(enabled);\n\t}", "toggle() {\n this.enabled = !this.enabled;\n }", "function splitRemoverClick() {\n if (!continueProcessing) {\n item = $(this);\n var id = item.prop('id');\n if (id != undefined) {\n id = id.replace(\"splitItem-\", \"\");\n id = id.replace(\"splitRemover-\", \"\");\n id = id.replace(\"splitAdder-\", \"\");\n } else {\n id = \"\";\n }\n if (id == \"\" || id == \"deleteButton\") {\n id = $('#splitUUID').val();\n }\n id = parseInt(id);\n if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) {\n if (editor.splitData.splits[id].enabled) {\n $('#splitItemDiv-' + id).addClass('disabled');\n $('#splitRemover-' + id).hide();\n $('#splitAdder-' + id).show();\n $('.splitItem').removeClass('splitItemSelected');\n setEnabled(id, false);\n if (!zoomedIn()) {\n if (getCurrentSplitItem().id == id) {\n // if current split item is being deleted:\n // try to select the next enabled segment, if that fails try to select the previous enabled item\n var sthSelected = false;\n for (var i = id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n if (!sthSelected) {\n for (var i = id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n }\n }\n selectCurrentSplitItem();\n }\n } else {\n $('#splitItemDiv-' + id).removeClass('disabled');\n $('#splitRemover-' + id).show();\n $('#splitAdder-' + id).hide();\n setEnabled(id, true);\n }\n }\n cancelButtonClick();\n }\n}", "function _toggle() {\n var _editor = EditorManager.getCurrentFullEditor();\n _enabled = !_enabled;\n // Set the new state for the menu item.\n CommandManager.get(AUTOMATCH).setChecked(_enabled);\n \n // Register or remove listener depending on _enabled.\n if (_enabled) {\n _registerHandlers(_editor);\n } else {\n _deregisterHandlers(_editor);\n }\n }", "isSplit() { return this._isSplit; }", "isSplit() { return this._isSplit; }", "isSplit() { return this._isSplit; }", "set disabled(value) {\n const isDisabled = Boolean(value);\n if (isDisabled)\n this.shadowRoot.getElementById('toggle').setAttribute('disabled', '');\n else\n this.shadowRoot.getElementById('toggle').removeAttribute('disabled');\n }", "function setEnabled(enabled){_enabled=!!enabled;}", "function setEnabled(enabled){_enabled=!!enabled;}", "toggle() {\n if (!this.disabled) {\n this.expanded = !this.expanded;\n }\n }", "AddDisabledItem() {}", "setEnabled(enabled) {\n this.enabled_ = enabled;\n if (this.baseEl_) {\n if (enabled) {\n this.baseEl_.removeAttr('disabled');\n } else {\n this.baseEl_.attr('disabled', 'disabled');\n }\n }\n }", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "set isActiveAndEnabled(value) {}", "setIsEnabled(valueNew){let t=e.ValueConverter.toBoolean(valueNew);null===t&&(t=this.getAttributeDefaultValueInternal(\"IsEnabled\")),t!==this.__isEnabled&&(this.__isEnabled=t,this.__processIsEnabled())}", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "enable() {\n this.disabled = false;\n }", "_autoChanged(newValue){this.enabled=newValue}", "function handleEnableDisable(itemId) {\n var currentQty = parseInt($(`#id_qty_${itemId}`).val());\n var minusDisabled = currentQty < 2;\n var plusDisabled = currentQty > 49;\n $(`#decrease-qty_${itemId}`).prop('disabled', minusDisabled);\n $(`#increase-qty_${itemId}`).prop('disabled', plusDisabled);\n}", "toggleItem(prop, value) {\n\t\t\t\tif (value === undefined) {\n\t\t\t\t\tvalue = set({ prop, hidden: true });\n\t\t\t\t}\n\n\t\t\t\tset({ hidden: true, prop }, !value);\n\t\t\t}", "enable() {\n\t\tthis.toggle(true);\n\t}", "disable () {\n this.enabled= false;\n }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get enabled() { return this._enabled; }", "get isEnabled() { return !this.state.disabled }", "function ChangeMode(Sender) {\r\n\tvar res = true;\r\n\tif ( cbMode.Text == \"Delimiter\") res = false;\r\n\tlbDelimiter.Visible = !res;\r\n\tedDelimiter.Visible = !res;\r\n\tlbPosition.Visible = res;\r\n\tedPosition.Visible = res;\r\n}", "function handleEnableDisable(itemId, currentValue) {\n var minusDisabled = currentValue < 2;\n var plusDisabled = currentValue > 98;\n $(`#decrement-qty_${itemId}`).prop('disabled', minusDisabled);\n $(`#increment-qty_${itemId}`).prop('disabled', plusDisabled);\n $(`#mobile-decrement-qty_${itemId}`).prop('disabled', minusDisabled);\n $(`#mobile-increment-qty_${itemId}`).prop('disabled', plusDisabled);\n }", "toggleMovementDisabled(){\n if (this.movementDisabled) {\n this.movementDisabled = false;\n }\n else{\n this.movementDisabled = true;\n }\n console.log(\"toggle movement\", this.movementDisabled);\n }", "get disabled() { return this._disabled || (this.selectionList && this.selectionList.disabled); }", "get disabled() { return this._disabled || (this.selectionList && this.selectionList.disabled); }", "enable() {\n this.enabled_ = true;\n }", "setDisable() {\n const selection = window.getSelection();\n const string = selection.toString();\n this.isDisabled = string == \"\";\n }", "enable() {\n this._enabled = true;\n }", "get disabled() { return this._disabled || !!(this._list && this._list.disabled); }", "get disabled() { return this._disabled || !!(this._list && this._list.disabled); }", "enable() {\n this._readonly = false;\n }", "function setEnabledItemOfMenu(bdId, enabled) {\n\t\tvar item = this.getFutureItem(bdId);\n\t\tif (item != null) {\n\t\t\titem.setEnabled(enabled);\n\t\t\tthis.write(this.color);\n\t\t}\n\t}", "function handleEnableDisable(itemId, currentValue) {\n var minusDisabled = currentValue < 2;\n var plusDisabled = currentValue > 98;\n $(`form #decrement-qty_${itemId}`).prop('disabled', minusDisabled);\n $(`form #mobile-decrement-qty_${itemId}`).prop('disabled', minusDisabled);\n $(`form #increment-qty_${itemId}`).prop('disabled', plusDisabled);\n $(`form #mobile-increment-qty_${itemId}`).prop('disabled', plusDisabled);\n}", "function _toggle() {\n _enabled = !_enabled;\n \n // Set the new state for the menu item.\n CommandManager.get(QUICKSEARCH).setChecked(_enabled);\n \n var editor = EditorManager.getActiveEditor();\n \n // Register or remove listener depending on _enabled.\n if (_enabled) {\n _handlerOn(editor);\n } else {\n _handlerOff(editor);\n }\n }", "disable() {\n this.enabled_ = false;\n this.element.classList.add('disabled');\n this.element.setAttribute('aria-disabled', true);\n }", "toggle() {\n this.selected = !this.selected;\n }", "toggle() {\n this.selected = !this.selected;\n }", "get disabled() {return booleanAttribute.get(this, 'disabled');}", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "get disabled() { return this._disabled; }", "disable () {\n this.disabled = true\n }", "_toggle() {\n if (!this.disabled) {\n this.panel.toggle();\n }\n }", "enableItem (i) { this.toggDis(false, i); }", "enable() {\n if (!this.completed) {\n this.slotEl.droppable(\"enable\");\n this.pieceEl.draggable(\"enable\");\n }\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "function setDisable(value) {\n element.children().attr('disabled', value);\n element.find('input').attr('disabled', value);\n }", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "disable() {\n this.disabled = true;\n }", "function setDisable(value){element.children().attr('disabled',value);element.find('input').attr('disabled',value);}", "disable() {\n this._readonly = true;\n }", "get disabled() { return (this.group && this.group.disabled) || this._disabled; }", "get disabled() { return (this.group && this.group.disabled) || this._disabled; }", "get disabled() { return (this.group && this.group.disabled) || this._disabled; }", "disable() {\n this.disabled = true;\n }", "get disabled() {\n return !this.enabled;\n }", "function enableCustomSURBL(item) {\n var textField = document.getElementById(\"string.custom_surbl\");\n // .checked is updated after this event fires, so actions are pro-active\n if (item.checked) {\n document.getElementById(\"string.custom_surbl\").setAttribute(\"disabled\", true);\n }\n else {\n document.getElementById(\"string.custom_surbl\").removeAttribute(\"disabled\");\n } \n}", "get enabled() {}", "get enabled() {}", "get enabled() {}", "get enabled() {}", "function RecordsetColumnMenu_setDisabled(theValue)\r\n{\r\n if (this.listControl)\r\n {\r\n if (theValue && !this.listControl.object.getAttribute(\"disabled\"))\r\n {\r\n this.listControl.object.setAttribute(\"disabled\", true);\r\n }\r\n else if (!theValue && this.listControl.object.getAttribute(\"disabled\"))\r\n {\r\n this.listControl.object.removeAttribute(\"disabled\");\r\n }\r\n }\r\n}", "get enabled() {\n return this._enabled;\n }", "get enabled() {\n return this._enabled;\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "toggle() {\n this.collapsed = !this.collapsed\n }", "disable() {\n this.active = false;\n }", "handleSidebarElementChange(type, enabled) {\n var tempDisabledArray = this.state.disabledElements\n if(!enabled)\n tempDisabledArray.push(type)\n else\n tempDisabledArray.splice(this.state.disabledElements.indexOf(type), 1)\n\n this.setState({\n disabledElements: tempDisabledArray\n })\n\n }", "function setDisabled() {\n\t\t\t\tif (quickMenuObject.searchTerms.trim().indexOf(\" \") !== -1 || quickMenuObject.searchTerms.indexOf(\".\") === -1) {\n\t\t\t\t\ttile.dataset.disabled = true;\n\t\t\t\t} else {\n\t\t\t\t\ttile.dataset.disabled = false;\n\t\t\t\t}\n\t\t\t}" ]
[ "0.666054", "0.6252897", "0.6178935", "0.6178935", "0.6178935", "0.6178935", "0.6093752", "0.6026537", "0.59687215", "0.59179777", "0.59003985", "0.59003985", "0.59003985", "0.58593225", "0.5776507", "0.5776507", "0.5768296", "0.575326", "0.5749773", "0.56509095", "0.56509095", "0.56509095", "0.56460136", "0.5629867", "0.5629867", "0.5629867", "0.56096214", "0.55938613", "0.55837804", "0.5571569", "0.5565589", "0.55463946", "0.55463946", "0.55463946", "0.55463946", "0.55463946", "0.55463946", "0.55463946", "0.55202484", "0.5508428", "0.55073816", "0.5465232", "0.5453847", "0.5453847", "0.5435171", "0.5426349", "0.5419112", "0.5413557", "0.5413557", "0.5408925", "0.54059774", "0.5381423", "0.53743047", "0.5371644", "0.536515", "0.536515", "0.53644675", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.5329914", "0.53296745", "0.53278005", "0.53244793", "0.5307423", "0.52978325", "0.52978325", "0.52978325", "0.5294135", "0.5294135", "0.5294135", "0.52906245", "0.52860916", "0.52809024", "0.52809024", "0.52809024", "0.52725285", "0.5262237", "0.5253373", "0.52437603", "0.52437603", "0.52437603", "0.52437603", "0.5238723", "0.52315915", "0.52315915", "0.5231203", "0.5231203", "0.52227175", "0.5221187", "0.5220111" ]
0.6601855
1
set current time as the new inpoint of selected item
function setCurrentTimeAsNewInpoint() { if (!continueProcessing && (editor.selectedSplit != null)) { setTimefieldTimeBegin(getCurrentTime()); okButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentTimeAsNewOutpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeEnd(getCurrentTime());\n okButtonClick();\n }\n}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "set_time( t ){ this.current_time = t; this.draw_fg(); return this; }", "function onTimeSelectionChange() {\n drawTimeBlocks();\n drawInfoBox(timeSelectionControl.value);\n updateTimeSelectionIndicator(timeSelectionControl.value);\n }", "function setUpTime() {\n if ($scope.event) {\n $scope.time = {\n value: new Date($scope.event.time * 1000)\n };\n }\n else {\n $scope.time = {\n value: new Date()\n }\n }\n\n timeChanged();\n }", "set currentTime (time) {\n this.player.currentTime(time);\n }", "function updateTimeSelectionIndicator(selectedTimePosition) {\n timeSelectionIndicatorContainer.attr('transform', `translate(${ selectedTimePosition }, 0)`);\n timeSelectionIndicatorContainer.select('text').remove();\n timeSelectionIndicatorContainer.append('text')\n .text(moment(scaleX.invert(selectedTimePosition)).format('HH:mm'))\n .attr('fill', 'black')\n .attr('x', '-19')\n .attr('y', config.indicatorLine.timePos)\n .attr('font-size', '16')\n .attr('font-family', 'Arial');\n }", "changeTocurrentTime(_date=this.currentdate_time){\n this.currentdate_time = _date;\n }", "function selectTime() {\n var pos = d3.mouse(fullMareyForeground.node());\n var y = pos[1];\n var x = pos[0];\n if (x > 0 && x < fullMareyWidth) {\n var time = yScale.invert(y);\n select(time);\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "setTime(time) {\n this.time.setTime(time);\n }", "function setAt(e) {\r\n var at = document.getElementById(\"at\");\r\n if (at) {\r\n // d = 'top of the timeline time' \r\n var n = new Date();\r\n n.setTime(tl_t_time.getTime() + (tl_unwarp(e.pageY) - tl_scroll_offset) *60*1000);\r\n s=(n.getFullYear())+\"/\"+(n.getMonth()+1)+\"/\"+n.getDate()+\" \"+n.getHours()+\":\"+pad2(n.getMinutes())+\":\"+pad2(n.getSeconds());\r\n at.value=s;\r\n }\r\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "function currentTime() {\n var timeNow = moment().format('h:mm a')\n $(\"#currentTime\").text(timeNow)\n }", "function update() {\n $(\"#currentT-input\").html(moment().format(\"H:mm:ss\"));\n}", "function updateCurrentTime(currentTimeIndex) {\n timeLabel.update(availableTimes[currentTimeIndex]);\n\n // console.log('setting time to' + availableTimes[currentTimeIndex]);\n layerCollection.eachLayer(function(layer) {\n layer.setParams({\n time : availableTimes[currentTimeIndex].toISOString()\n });\n });\n }", "function changeTime() {\n\tselectedTime = $(\"#selectedTime\").val();\n\t//map.setView(center, 12)\n\teventCoords = [];\n\tvar x = selectedTime * 2;\n\tvar min = '';\n\tif (x % 2 === 1) {\n\t\tmin = '30';\n\t} else if (x % 2 === 0) {\n\t\tmin = '00';\n\t}\n\tvar ampm = '';\n\tif (x < 24) {\n\t\tampm = 'am';\n\t} else if (x >= 24) {\n\t\tampm = 'pm';\n\t};\n\n\tvar hours = '';\n\tif (x === 0 || x === 1 ||\n\t\tx === 24 ||x === 25 ||\n\t\tx === 48) {\n\t\thours = '12';\n\t} else {\n\t\thours = String(Math.floor(selectedTime) % 12)\n\t}\n\tvar prettyTime = \"Driver history from&nbsp;\" + hours + \":\" + min + \" \" + ampm;\n\tdocument.getElementById('timenavtime').innerHTML = prettyTime;\n\tgetData();\n}", "function currentTime() {\n var current = moment().format('LT');\n $(\"#current-time\").html(current);\n setTimeout(currentTime, 1000);\n }", "function selectHour(event) {\r\n var newDate = new Date(getRootDate());\r\n newDate.setHours(inputAMPM.checked ? parseInt(listHour.value) + 12 : listHour.value);\r\n setRootDate(newDate);\r\n listMinute.dispatchEvent(new Event('change'));\r\n }", "initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n // eslint-disable-next-line quote-props\n 'id': 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\n\n if (me.client.isPainted) {\n me.renderRanges();\n }\n }", "function setTimeColor(item) {\n //Set block to past\n if (item.time < now) {\n return \"past\";\n }\n //Set block to present\n else if (item.time == now) {\n return \"present\";\n }\n //Set block to future\n else {\n return \"future\";\n }\n }", "function handleTimePicker(time, inst) {\n\tif (_timeSelected) {\n\t\t_dataChegada = new Date(_dataChegada.getFullYear(), _dataChegada.getMonth(), _dataChegada.getDate(), inst.hours, inst.minutes);\n\t};\n\t_timeSelected = false;\n}", "initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n id: 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n\n me.currentTimeInterval = me.setInterval(() => {\n me.currentTimeLine.startDate = new Date();\n me.currentTimeLine.name = DateHelper.format(me.currentTimeLine.startDate, me.currentDateFormat);\n me.onStoreChanged({ action: 'update', record: me.currentTimeLine });\n }, me.updateCurrentTimeLineInterval);\n\n if (me.client.rendered) {\n me.renderRanges();\n }\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTimeLinePosition(newTime){\n\tvar newPos = newTime * TIME_UNIT_SIZE;\n\t$(\"#currentFrameLine\").css({left:Math.round(newPos)});\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function select(time) {\n var y = yScale(time);\n bar.attr('transform', 'translate(0,' + y + ')');\n timeDisplay.text(moment(time).zone(0).format('MMM Do YY h:mm a'));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n\n\t\t\t//Set the time & date for the current timezone\n\t\t\t$scope.currentTime = moment().format('HH:mm');\n\t\t\t$scope.date = moment().format(\"DD\");\n\t\t\t$scope.month = moment().format(\"MMMM\");\n\t\t\t$scope.day = moment().format(\"dddd\");\n \n\t\t\t//Set the time for the different timezones\n\t\t\t$scope.AlekTime = moment().format('HH:mm');\n\t\t\t$scope.RussiaTime = moment().tz('Europe/Moscow').format('HH:mm');\n\t\t\t$scope.TokyoTime = moment().tz('Asia/Tokyo').format('HH:mm');\n\t\t\t$scope.$apply();\n\t\t}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function currTime() {\n var dt = dateFilter(new Date(), format,'-0800');\n element.text(dt);\n // element point to line 11 span element\n }", "function updateSelectedTimestamp( name )\n{\n\n var obj = timeObj[name];\n\n var ts_depth = 10/60;\n var timestamps = obj.parent.children;\n\n for( var c=0; c<timestamps.length; c++ )\n {\n if( timestamps[c].type != \"timestamp_cover\" )\n {\n timestamps[c].material.color.setHex( 0xffffff );\n if( timestamps[c].type != \"REALTIME\" )\n timestamps[c].position.z = 0;\n }\n }\n\n obj.material.color.setHex( 0x00ff00 );\n\n if( obj.type == \"timestamp\" )\n obj.translateZ( ts_depth * 0.1 );\n\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "currentTime() {\n this.time24 = new Time();\n this.updateTime(false);\n }", "setNewTime(selectedDateFrom, selectedDateTo) {\n this.setState({\n selectedDateFrom: selectedDateFrom,\n selectedDateTo: selectedDateTo\n });\n\n this.onChange(selectedDateFrom, selectedDateTo);\n }", "function updateTime() {\n var video = document.getElementById(\"video\");\n var i = this.getAttribute(\"id\");\n var clickedCaption = captions[i];\n video.currentTime = clickedCaption.startTime;\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime() {\n\n}", "function updateTimeInfo(currentTimeIndex) {\n timeLabel.update(availableTimes[currentTimeIndex]);\n }", "function updateTime() {\n var nowTime = moment().format('LTS');\n $(\"#currentTime\").html(nowTime);\n}", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "get selectedDateTime() {\n return this.selectedDate + ' ' + this.selectedTime;\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "updateCurrentMSecs () {\n this.currentMSecs = Date.now();\n }", "showTime(time) {\n const current = new Date(time.time);\n\n const currentMonth = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][current.getMonth()];\n const currentDay = current.getDate();\n const currentYear = current.getFullYear();\n\n const curTime = ui.formatTime(current);\n\n\n this.sunrise.innerHTML = ui.formatTime(new Date(time.sunrise));\n this.sunset.innerHTML = ui.formatTime(new Date(time.sunset));\n this.currentTime.innerHTML = `${curTime}, ${currentMonth} ${currentDay}, ${currentYear}`;\n }", "function timeChartMouseClick(d,i)\n{\n\tvar selectedDateTime = new Date(d.attributes[dimension]);\n\teventSliderTimeChartDotClicked.selectedDateTime = selectedDateTime;\n\t\n\t//Update Chart to Select this new date\n\tselectActivePoint(selectedDateTime);\n\n\t//Fire off an event so that the other layout controls can update\n\tdocument.dispatchEvent(eventSliderTimeChartDotClicked);\n}", "function processTimeSelection(x, y, clicked) {\n\t\t\t\tvar selectorAngle = (360 * Math.atan((y - clockCenterY)/(x - clockCenterX)) / (2 * Math.PI)) + 90;\n\t\t\t\tvar selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));\n\t\t\t\t\n\t\t\t\tvar hour = 0;\n\t\t\t\tvar min = 0;\n\t\t\t\tif ((new RegExp('^([0-9]{2}):([0-9]{2})$')).test(inputElement.val())) {\n\t\t\t\t\thour = parseInt(RegExp.$1);\n\t\t\t\t\tmin = parseInt(RegExp.$2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (selectionMode == 'HOUR') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 30);\n\t\t\t\t\tvar h = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 28) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle == 0) h = 12;\n\t\t\t\t\t\t\telse h = selectorAngle;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 6;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (selectorLength < clockRadius - 28 && selectorLength > clockRadius - 65) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle != 0) h = selectorAngle + 12;\n\t\t\t\t\t\t\telse h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 18;\n\t\t\t\t\t\t\tif (h == 24) h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (h > -1) {\n\t\t\t\t\t\tvar newVal = (h < 10 ? '0' : '') + h + ':' + (min < 10 ? '0' : '') + min;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockHourCanvas(h == 0 ? 24 : h);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockHourCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (selectionMode == 'MINUTE') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 6);\n\t\t\t\t\tvar m = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 40) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tm = selectorAngle;\n\t\t\t\t\t\t} else if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\tm = selectorAngle + 30;\n\t\t\t\t\t\t\tif (m == 60) m = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (m > -1) {\n\t\t\t\t\t\tvar newVal = (hour < 10 ? '0' : '') + hour + ':' + (m < 10 ? '0' : '') + m;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockMinuteCanvas(m == 0 ? 60 : m);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockMinuteCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function setCurrent(){\n\t\t//set ls items\n\t\tlocalStorage.setItem('currentMiles', $(this).data('miles'));\n\t\tlocalStorage.setItem('currentDate', $(this).data('date'));\n\n\t\t//insert into the edit form\n\t\t$('#editMiles').val(localStorage.getItem('currentMiles'));\n\t\t$('#editDate').val(localStorage.getItem('currentDate'));\n\t}", "function getTimeNow () {\n\tvar x = new Date();\n\tvar h = x.getHours();\n\tvar m = x.getMinutes()/60;\n\tselectedTime = h + m;\n\treturn (h + m);\n}", "currentTime(time) {\n\t\tconst cTime = Moment(time).format('LTS');\n\t\tthis.setState({\n\t\t\ttime: cTime\n\t\t});\n\t\treturn cTime;\n\t}", "function setTime(timeSelection) {\r\n localStorage.setItem('timeSpeed', timeSelection);\r\n document.getElementById('normal').setAttribute('class', 'time-btn');\r\n document.getElementById('fast').setAttribute('class', 'time-btn');\r\n document.getElementById('hyper').setAttribute('class', 'time-btn');\r\n document.location.reload(); \r\n }", "updateTime() {\n\t\tthis.setState({\n\t\t\ttime: hrOfDay(),\n\t\t\tday: timeOfDay()\n\t\t});\n\t}", "selectedTimeIndex(){\n log('----------------------------------------------');\n log('[watch:selectedTimeIndex] - selectedTimeIndex changed to: '+this.selectedTimeIndex);\n log('----------------------------------------------');\n this.selectVideo();\n }", "set timeLeft(time){\n this.currentTimeInput.value = this.renderTime(time);\n }", "setTime () {\n this.clock.time = moment()\n .local()\n .format(\"dddd, MMMM Do YYYY, h:mm:ss A\")\n }", "_changeToMinuteSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n that._inInnerCircle = false;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = that.minuteInterval;\n\n that.$hourContainer.removeClass('jqx-selected');\n that.$minuteContainer.addClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderMinutes();\n\n that._drawArrow(true, undefined, true);\n }", "get itemTime(){ return this._itemTime; }", "function _setTimes(position, duration) {\n\t\t\tvar time = _convertTime(position/1000);\n\t\t\tif(currentTime != time) {\n\t\t\t\t$main.find('#fap-current-time').text(time);\n\t\t\t\t$main.find('#fap-total-time').text(_convertTime(duration / 1000));\n\t\t\t\t_setSliderPosition(position / duration);\n\t\t\t}\n\t\t\tcurrentTime = time;\n\t\t}", "set selected(value) {\n this._selected = value;\n this._selectedTimestamp = value ? new Date() : undefined;\n }", "function tpStartSelect( time, endTimePickerInst ) {\n $('#eventEndTime').timepicker('option', {\n minTime: {\n hour: endTimePickerInst.hours,\n minute: endTimePickerInst.minutes\n }\n });\n}", "function updateTime() {\n if (typeof envData === 'undefined') {\n return;\n }\n else if (scope.currenttime > envData[envData.length -1].time) {\n timeData[0].time = envData[envData.length -1].time;\n timeData[1].time = envData[envData.length -1].time;\n }\n else if (scope.currenttime < envData[0].time) {\n timeData[0].time = envData[0].time;\n timeData[1].time = envData[0].time;\n }\n else if (typeof timeData !== 'undefined') { \n timeData[0].time = scope.currenttime;\n timeData[1].time = scope.currenttime;\n }\n \n svg.select('#timeLine')\n .datum(timeData)\n .transition() \n .attr(\"d\", currentTimeLine)\n .ease(\"linear\")\n .duration(150); \n }", "changeStartTime(startTime){\n this.startTime = startTime;\n }", "function setTimefieldTimeBegin(time) {\n if (!continueProcessing) {\n $('#clipBegin').timefield('option', 'value', time);\n }\n}", "function handleTimePickerVolta(time, inst) {\n if (_timeReturnSelected) {\n _dataRetorno = new Date(_dataRetorno.getFullYear(), _dataRetorno.getMonth(), _dataRetorno.getDate(), inst.hours, inst.minutes);\n };\n _timeReturnSelected = false;\n}", "function setCurrentItem(item)\n{\n selectedObject = item;\n}", "function setTimeString(){\n let strEls = Toolbar.curTime.toUTCString().split(\":\");\n strEls.pop();\n Quas.getEl(\".post-publish-time-text\").text(strEls.join(\":\"));\n}", "setCurrentDate(current) {\n self.datePicker.current = new Date(current);\n }", "onTimeChanged () {\n this.view.renderTimeAndDate();\n }", "increaseTime(t) {\n this.currentTime += t;\n this.timeElement.textContent = this.currentTime;\n }", "function update(selectedTime){\n\n if (!map.tilesloading) {\n\n document.getElementById(\"buttonWeekday_\"+selectedWeekday).focus();\n selectedTime = getNewSelectedTime(selectedTime) \n \n // 1. step: Highlight calendar\n var previousSelectedDiv = document.getElementById(\"hour_\" + previousSelectedTime);\n previousSelectedDiv.style.background = '#1F407A';\n var selectedDiv = document.getElementById(\"hour_\" + selectedTime);\n selectedDiv.style.background = '#91056A';\n previousSelectedTime = selectedTime;\n\n // 2. step: Move timeslider\n document.getElementById(\"slider\").value = selectedTime;\n TimeBubble = document.getElementById('TimeBubble');\n \n pos = (document.getElementById(\"slider\").getBoundingClientRect().left-document.body.getBoundingClientRect().left) + (selectedTime-8)*document.getElementById(\"slider\").clientWidth/12;\n TimeBubble.style.left = pos.toString() + 'px' ;\n TimeBubble.innerText = selectedTime.toString() + \":00\";\n \n // 3.step: Highlight building \n if (calenderData[selectedWeekday] != null){\n highlightBuilding(selectedTime);\n }\n }\n}", "updateTime () {\n const time = moment().utc().format(timeFormat).toString();\n this.setState({ currentTime: time });\n }", "setTime(time) {\n\t\tapp.audioObject.currentTime = time;\n\t}", "set time(value) {}", "function updateCurrentTime() {\n $('#current_time').html(formatTime(getCurrentTime()));\n}", "function set(obj) {\n obj.time = util.time();\n }", "function Calendar_incHours() {\n\tthis.dtCurrentDate.setHours(this.dtCurrentDate.getHours() + 1);\n\tthis.dtSelectedDate.setHours(this.dtSelectedDate.getHours() + 1);\n}", "function setTimes()\n{\n\tvar dateJan = new Date(2012, 0, 1);\n\tvar dateNow = new Date();\n\n var fid = document.getElementById(\"Day\").selectedIndex;\n \n dateNow.setTime(forecasts[fid].date)\n\n\tif(dateNow.getTimezoneOffset() == dateJan.getTimezoneOffset())\n\t\ttimes = tzArray[\"STD\"];\n\telse\n\t\ttimes = tzArray[\"DST\"];\n\n // Keep the same time selected\n\tTindex = document.getElementById(\"Time\").selectedIndex;\n\n\tfor(var i = 0; i < times.length; i++) {\n\t\tdocument.getElementById(\"Time\").options[i] = new Option(times[i], times[i]);\n\t\tif(Tindex == i || (Tindex == -1 && times[i] == forecasts[fid].default_t))\n\t\t\tdocument.getElementById(\"Time\").options[i].selected = true;\n\t}\n\n}", "function setCurrent(){\n //Set local storage items\n \n localStorage.setItem('currentMiles', $(this).data('miles'));\n localStorage.setItem('currentDate', $(this).data('date'));\n \n \n //Insert the above values in edit form\n $('#editMiles').val(localStorage.getItem('currentMiles'));\n $('#editDate').val(localStorage.getItem('currentDate'));\n }", "function time() {\n\t$('#currentDay').text(moment().format('LLLL'));\n}", "function timeUpdate() {\n (setInterval(function () {\n currentTime = moment().format('HH');\n updatePlanner()\n }, 1000))\n}", "function timeChanged() {\n // if they clear the datetime value, reset the time and hide the keyboard on native\n if (!$scope.time.value) {\n setUpTime();\n\n if (window.Keyboard && window.Keyboard.hide) {\n Keyboard.hide();\n }\n }\n\n // update the time text and unix timestamo for this date\n var thisMoment = moment($scope.time.value);\n $scope.time.text = getTimeText(thisMoment);\n $scope.time.unix = thisMoment.unix();\n\n // show a message when the time selected is in the future\n $scope.future = isInTheFuture(thisMoment);\n }", "function setTime( t ){\n\n this.time = t;\n\n }", "function tick() {\n setTime(howOld(createdOn));\n }", "changeTimeValue(e, timeValue) {\n if (e.target.textContent === '+') {\n timer[timeValue]++;\n ui.updateUiElement(ui[timeValue], timer[timeValue])\n console.log(timer[timeValue]);\n } else {\n timer[timeValue]--;\n if (timer[timeValue] < 1) {\n timer[timeValue] = 1;\n }\n ui.updateUiElement(ui[timeValue], timer[timeValue])\n console.log(timer[timeValue]);\n }\n }", "function processTimeSelection(x, y, clicked) {\r\n\t\t\t\tvar selectorAngle = (360 * Math.atan((y - clockCenterY)/(x - clockCenterX)) / (2 * Math.PI)) + 90;\r\n\t\t\t\tvar selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));\r\n\t\t\t\tvar hour = 0;\r\n\t\t\t\tvar min = 0;\r\n\t\t\t\tvar negative = false;\r\n\t\t\t\tif ((new RegExp('^(-|\\\\+)?([0-9]+).([0-9]{2})$')).test(getInputElementValue())) {\r\n\t\t\t\t\tnegative = settings.duration && settings.durationNegative && RegExp.$1 == '-' ? true : false;\r\n\t\t\t\t\thour = parseInt(RegExp.$2);\r\n\t\t\t\t\tmin = parseInt(RegExp.$3);\r\n\t\t\t\t}\r\n\t\t\t\tif (selectionMode == 'HOUR') {\r\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 30);\r\n\t\t\t\t\tvar h = -1;\r\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 28) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tif (selectorAngle == 0) h = 12;\r\n\t\t\t\t\t\t\telse h = selectorAngle;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\th = selectorAngle + 6;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (selectorLength < clockRadius - 28 && selectorLength > clockRadius - 65) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tif (selectorAngle != 0) h = selectorAngle + 12;\r\n\t\t\t\t\t\t\telse h = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\th = selectorAngle + 18;\r\n\t\t\t\t\t\t\tif (h == 24) h = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (settings.afternoonHoursInOuterCircle) {\r\n\t\t\t\t\t\th = h + (h >= 12 ? -12 : 12);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (h > -1) {\r\n\t\t\t\t\t\tvar newVal = (negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + (min < 10 ? '0' : '') + min;\r\n\t\t\t\t\t\tif (isDragging || clicked) {\r\n\t\t\t\t\t\t\tvar isMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\tif (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\t\tif (!isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\t\tif (settings.maximum && isTimeSmallerOrEquals((negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + '00', settings.maximum)) {\r\n\t\t\t\t\t\t\t\t\tnewVal = formatTime(settings.maximum);\r\n\t\t\t\t\t\t\t\t\tisMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, (negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + '00')) {\r\n\t\t\t\t\t\t\t\t\tnewVal = formatTime(settings.minimum);\r\n\t\t\t\t\t\t\t\t\tisMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\t\tvar oldVal = getInputElementValue();\r\n\t\t\t\t\t\t\t\tif (newVal != oldVal) {\r\n\t\t\t\t\t\t\t\t\tif (settings.vibrate) navigator.vibrate(10);\r\n\t\t\t\t\t\t\t\t\telement.attr('value', newVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\t\tsettings.onAdjust.call(element.get(0), newVal.replace(/^\\+/, ''), oldVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tsetInputElementValue(formatTime(newVal));\r\n\t\t\t\t\t\t\t\tautosize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tisTimeChanged = true;\r\n\t\t\t\t\t\trepaintClockHourCanvas(h == 0 ? 24 : h, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trepaintClockHourCanvas(null, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (selectionMode == 'MINUTE') {\r\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 6);\r\n\t\t\t\t\tvar m = -1;\r\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 40) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tm = selectorAngle;\r\n\t\t\t\t\t\t} else if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\tm = selectorAngle + 30;\r\n\t\t\t\t\t\t\tif (m == 60) m = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (m > -1) {\n\t\t\t\t\t\tif (settings.precision != 1) {\n\t\t\t\t\t\t\tvar f = Math.floor(m / settings.precision);\n\t\t\t\t\t\t\tm = f * settings.precision + (Math.round((m - f * settings.precision) / settings.precision) == 1 ? settings.precision : 0);\n\t\t\t\t\t\t\tif (m >= 60) m = 0;\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar newVal = (negative ? '-' : '') + (hour < 10 && !settings.duration ? '0' : '') + hour + settings.separator + (m < 10 ? '0' : '') + m;\r\n\t\t\t\t\t\tvar isMinMaxFullfilled = true;\r\n\t\t\t\t\t\tif (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\tif ((isDragging || clicked) && isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\tvar oldVal = getInputElementValue();\r\n\t\t\t\t\t\t\tif (newVal != oldVal) {\r\n\t\t\t\t\t\t\t\tif (settings.vibrate) navigator.vibrate(10);\r\n\t\t\t\t\t\t\t\telement.attr('value', newVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\tsettings.onAdjust.call(element.get(0), newVal.replace(/^\\+/, ''), oldVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsetInputElementValue(formatTime(newVal));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tisTimeChanged = true;\r\n\t\t\t\t\t\trepaintClockMinuteCanvas(m == 0 ? 60 : m, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trepaintClockMinuteCanvas(null, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "function displayCurrentTime() {\n\tsetInterval(function(){\n\t\t$('#current-time').html(moment().format('hh:mm A'))\n\t }, 1000);\n\t}", "function setTimeBlock() {\n timeBlock.each(function () {\n $thisBlock = $(this);\n var currentHour = d.getHours();\n var dataHour = parseInt($thisBlock.attr(\"dataHour\"));\n\n if (dataHour < currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"past\").removeClass(\"present\", \"future\");\n }\n if (dataHour == currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"present\").removeClass(\"past\", \"future\");\n }\n if (dataHour > currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"future\").removeClass(\"past\", \"present\");\n }\n })\n\n }", "function setTime()\n {\n\t\t\tfor(var i = 0; i <$scope.task_list.length; i++){\n\t\t\t\t$scope.task_list[i].formatted = pad(parseInt($scope.task_list[i].seconds/60)) + ':' + pad($scope.task_list[i].seconds%60);\n\t\t\t\t$scope.$apply();\t\t\t\t\n\t\t\t}\n }", "function updateTime(time) {\n //console.log(time)\n transNetwork.activeTime = time;\n transNetwork.updateNet();\n\n powNetwork.activeTime = time;\n powNetwork.updateNet();\n\n table.activeTime = time;\n table.createTable();\n }" ]
[ "0.62714416", "0.62331015", "0.6183065", "0.61612344", "0.6085788", "0.6074017", "0.60612965", "0.604484", "0.60360765", "0.5992111", "0.5984996", "0.59785086", "0.59667486", "0.5951836", "0.5931392", "0.5917668", "0.5917668", "0.59151584", "0.5908623", "0.59054035", "0.5893177", "0.5870861", "0.5865996", "0.58418316", "0.583505", "0.58063984", "0.5796933", "0.5787768", "0.57614714", "0.57567734", "0.57567734", "0.575643", "0.5751188", "0.57489294", "0.57476455", "0.57469916", "0.57450193", "0.57397807", "0.57383555", "0.57302225", "0.57265043", "0.572356", "0.57224745", "0.57002115", "0.57002115", "0.57002115", "0.57002115", "0.5698016", "0.56752586", "0.5674387", "0.5663025", "0.56552255", "0.5637165", "0.5637022", "0.5616809", "0.56096816", "0.5598333", "0.5593072", "0.5592762", "0.5591418", "0.55724114", "0.5569806", "0.5562613", "0.5550011", "0.5549139", "0.55471355", "0.55465084", "0.5543784", "0.5541585", "0.55259466", "0.55184615", "0.55112773", "0.5510875", "0.55097085", "0.549906", "0.54952455", "0.5482935", "0.5471758", "0.54675645", "0.5466027", "0.5459091", "0.54572564", "0.5451367", "0.54482615", "0.54460466", "0.5442336", "0.5437493", "0.5430003", "0.5428263", "0.5427011", "0.54257464", "0.5423075", "0.5420382", "0.54179704", "0.5413836", "0.54053944", "0.5401909", "0.5400709", "0.5394823", "0.5391934" ]
0.6974967
0
set current time as the new outpoint of selected item
function setCurrentTimeAsNewOutpoint() { if (!continueProcessing && (editor.selectedSplit != null)) { setTimefieldTimeEnd(getCurrentTime()); okButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "function selectTime() {\n var pos = d3.mouse(fullMareyForeground.node());\n var y = pos[1];\n var x = pos[0];\n if (x > 0 && x < fullMareyWidth) {\n var time = yScale.invert(y);\n select(time);\n }\n }", "function setTimeColor(item) {\n //Set block to past\n if (item.time < now) {\n return \"past\";\n }\n //Set block to present\n else if (item.time == now) {\n return \"present\";\n }\n //Set block to future\n else {\n return \"future\";\n }\n }", "set_time( t ){ this.current_time = t; this.draw_fg(); return this; }", "function onTimeSelectionChange() {\n drawTimeBlocks();\n drawInfoBox(timeSelectionControl.value);\n updateTimeSelectionIndicator(timeSelectionControl.value);\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate === undefined ||\n compareDates(new Date(), self.config.minDate) >= 0\n ? new Date()\n : new Date(self.config.minDate.getTime());\n var defaults = getDefaultHours(self.config);\n defaultDate.setHours(defaults.hours, defaults.minutes, defaults.seconds, defaultDate.getMilliseconds());\n self.selectedDates = [defaultDate];\n self.latestSelectedDateObj = defaultDate;\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function changeTime() {\n\tselectedTime = $(\"#selectedTime\").val();\n\t//map.setView(center, 12)\n\teventCoords = [];\n\tvar x = selectedTime * 2;\n\tvar min = '';\n\tif (x % 2 === 1) {\n\t\tmin = '30';\n\t} else if (x % 2 === 0) {\n\t\tmin = '00';\n\t}\n\tvar ampm = '';\n\tif (x < 24) {\n\t\tampm = 'am';\n\t} else if (x >= 24) {\n\t\tampm = 'pm';\n\t};\n\n\tvar hours = '';\n\tif (x === 0 || x === 1 ||\n\t\tx === 24 ||x === 25 ||\n\t\tx === 48) {\n\t\thours = '12';\n\t} else {\n\t\thours = String(Math.floor(selectedTime) % 12)\n\t}\n\tvar prettyTime = \"Driver history from&nbsp;\" + hours + \":\" + min + \" \" + ampm;\n\tdocument.getElementById('timenavtime').innerHTML = prettyTime;\n\tgetData();\n}", "function setAt(e) {\r\n var at = document.getElementById(\"at\");\r\n if (at) {\r\n // d = 'top of the timeline time' \r\n var n = new Date();\r\n n.setTime(tl_t_time.getTime() + (tl_unwarp(e.pageY) - tl_scroll_offset) *60*1000);\r\n s=(n.getFullYear())+\"/\"+(n.getMonth()+1)+\"/\"+n.getDate()+\" \"+n.getHours()+\":\"+pad2(n.getMinutes())+\":\"+pad2(n.getSeconds());\r\n at.value=s;\r\n }\r\n }", "function updateTimeSelectionIndicator(selectedTimePosition) {\n timeSelectionIndicatorContainer.attr('transform', `translate(${ selectedTimePosition }, 0)`);\n timeSelectionIndicatorContainer.select('text').remove();\n timeSelectionIndicatorContainer.append('text')\n .text(moment(scaleX.invert(selectedTimePosition)).format('HH:mm'))\n .attr('fill', 'black')\n .attr('x', '-19')\n .attr('y', config.indicatorLine.timePos)\n .attr('font-size', '16')\n .attr('font-family', 'Arial');\n }", "function updateTimeLinePosition(newTime){\n\tvar newPos = newTime * TIME_UNIT_SIZE;\n\t$(\"#currentFrameLine\").css({left:Math.round(newPos)});\n}", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "function setTimeBlock() {\n timeBlock.each(function () {\n $thisBlock = $(this);\n var currentHour = d.getHours();\n var dataHour = parseInt($thisBlock.attr(\"dataHour\"));\n\n if (dataHour < currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"past\").removeClass(\"present\", \"future\");\n }\n if (dataHour == currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"present\").removeClass(\"past\", \"future\");\n }\n if (dataHour > currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"future\").removeClass(\"past\", \"present\");\n }\n })\n\n }", "setTime(time) {\n this.time.setTime(time);\n }", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 5000);\n }\n this.time_now = Date.now();\n }", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 10000);\n }\n this.time_now = Date.now();\n }", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function select(time) {\n var y = yScale(time);\n bar.attr('transform', 'translate(0,' + y + ')');\n timeDisplay.text(moment(time).zone(0).format('MMM Do YY h:mm a'));\n }", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 8000);\n }\n this.time_now = Date.now();\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n var defaultDate = self.config.minDate !== undefined\n ? new Date(self.config.minDate.getTime())\n : new Date();\n var _a = getDefaultHours(), hours = _a.hours, minutes = _a.minutes, seconds = _a.seconds;\n defaultDate.setHours(hours, minutes, seconds, 0);\n self.setDate(defaultDate, false);\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime() {\n if (typeof envData === 'undefined') {\n return;\n }\n else if (scope.currenttime > envData[envData.length -1].time) {\n timeData[0].time = envData[envData.length -1].time;\n timeData[1].time = envData[envData.length -1].time;\n }\n else if (scope.currenttime < envData[0].time) {\n timeData[0].time = envData[0].time;\n timeData[1].time = envData[0].time;\n }\n else if (typeof timeData !== 'undefined') { \n timeData[0].time = scope.currenttime;\n timeData[1].time = scope.currenttime;\n }\n \n svg.select('#timeLine')\n .datum(timeData)\n .transition() \n .attr(\"d\", currentTimeLine)\n .ease(\"linear\")\n .duration(150); \n }", "function setUpTime() {\n if ($scope.event) {\n $scope.time = {\n value: new Date($scope.event.time * 1000)\n };\n }\n else {\n $scope.time = {\n value: new Date()\n }\n }\n\n timeChanged();\n }", "function update(selectedTime){\n\n if (!map.tilesloading) {\n\n document.getElementById(\"buttonWeekday_\"+selectedWeekday).focus();\n selectedTime = getNewSelectedTime(selectedTime) \n \n // 1. step: Highlight calendar\n var previousSelectedDiv = document.getElementById(\"hour_\" + previousSelectedTime);\n previousSelectedDiv.style.background = '#1F407A';\n var selectedDiv = document.getElementById(\"hour_\" + selectedTime);\n selectedDiv.style.background = '#91056A';\n previousSelectedTime = selectedTime;\n\n // 2. step: Move timeslider\n document.getElementById(\"slider\").value = selectedTime;\n TimeBubble = document.getElementById('TimeBubble');\n \n pos = (document.getElementById(\"slider\").getBoundingClientRect().left-document.body.getBoundingClientRect().left) + (selectedTime-8)*document.getElementById(\"slider\").clientWidth/12;\n TimeBubble.style.left = pos.toString() + 'px' ;\n TimeBubble.innerText = selectedTime.toString() + \":00\";\n \n // 3.step: Highlight building \n if (calenderData[selectedWeekday] != null){\n highlightBuilding(selectedTime);\n }\n }\n}", "function updateSelectedTimestamp( name )\n{\n\n var obj = timeObj[name];\n\n var ts_depth = 10/60;\n var timestamps = obj.parent.children;\n\n for( var c=0; c<timestamps.length; c++ )\n {\n if( timestamps[c].type != \"timestamp_cover\" )\n {\n timestamps[c].material.color.setHex( 0xffffff );\n if( timestamps[c].type != \"REALTIME\" )\n timestamps[c].position.z = 0;\n }\n }\n\n obj.material.color.setHex( 0x00ff00 );\n\n if( obj.type == \"timestamp\" )\n obj.translateZ( ts_depth * 0.1 );\n\n}", "shiftView() {\n const stime = (configRepo.get(currentConfig).scenarioStartTime);\n const levent = scenarioRepo.getLastEventOf(currentScenario);\n const etime = levent == null ? stime : stime + levent.pointInTime;\n this.line.setWindow(stime, etime, null, function () {\n timeline.line.zoomOut(0.3)\n });\n }", "function selectHour(event) {\r\n var newDate = new Date(getRootDate());\r\n newDate.setHours(inputAMPM.checked ? parseInt(listHour.value) + 12 : listHour.value);\r\n setRootDate(newDate);\r\n listMinute.dispatchEvent(new Event('change'));\r\n }", "_navigateToNextTimePart() {\n const that = this;\n\n that._highlightTimePartBasedOnIndex(that._highlightedTimePart.index + 1);\n }", "changeTocurrentTime(_date=this.currentdate_time){\n this.currentdate_time = _date;\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function update_global_time(time_idx)\n{\n\tglobal_time_idx = time_idx \n\t\n\t// TODO: REDRAW ENTITIES AT NEW TIME??\n}", "_changeToHourSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = 1;\n\n that.$hourContainer.addClass('jqx-selected');\n that.$minuteContainer.removeClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderHours();\n\n if (that.format === '24-hour' && (that.value.getHours() === 0 || that.value.getHours() > 12)) {\n that._inInnerCircle = true;\n }\n\n that._drawArrow(true, undefined, true);\n that._inInnerCircle = false;\n }", "function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "set timeLeft(time){\n this.currentTimeInput.value = this.renderTime(time);\n }", "function takeItem(item,currentX,currentY){\n item.style.transition=\"ease-in 0.3s\";\n item.style.left=currentX+\"px\";\n item.style.top=currentY-15+\"px\";\n carryCabbage=true;\n carryItem=true;\n }", "function updateTime() {\n\n\t\t\t//Set the time & date for the current timezone\n\t\t\t$scope.currentTime = moment().format('HH:mm');\n\t\t\t$scope.date = moment().format(\"DD\");\n\t\t\t$scope.month = moment().format(\"MMMM\");\n\t\t\t$scope.day = moment().format(\"dddd\");\n \n\t\t\t//Set the time for the different timezones\n\t\t\t$scope.AlekTime = moment().format('HH:mm');\n\t\t\t$scope.RussiaTime = moment().tz('Europe/Moscow').format('HH:mm');\n\t\t\t$scope.TokyoTime = moment().tz('Asia/Tokyo').format('HH:mm');\n\t\t\t$scope.$apply();\n\t\t}", "onTimeChanged () {\n this.view.renderTimeAndDate();\n }", "showTime(time) {\n const current = new Date(time.time);\n\n const currentMonth = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"][current.getMonth()];\n const currentDay = current.getDate();\n const currentYear = current.getFullYear();\n\n const curTime = ui.formatTime(current);\n\n\n this.sunrise.innerHTML = ui.formatTime(new Date(time.sunrise));\n this.sunset.innerHTML = ui.formatTime(new Date(time.sunset));\n this.currentTime.innerHTML = `${curTime}, ${currentMonth} ${currentDay}, ${currentYear}`;\n }", "selectedTimeIndex(){\n log('----------------------------------------------');\n log('[watch:selectedTimeIndex] - selectedTimeIndex changed to: '+this.selectedTimeIndex);\n log('----------------------------------------------');\n this.selectVideo();\n }", "set currentTime (time) {\n this.player.currentTime(time);\n }", "get itemTime(){ return this._itemTime; }", "initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n // eslint-disable-next-line quote-props\n 'id': 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n me.updateCurrentTimeLine = me.updateCurrentTimeLine.bind(me);\n me.currentTimeInterval = me.setInterval(me.updateCurrentTimeLine, me.updateCurrentTimeLineInterval);\n\n if (me.client.isPainted) {\n me.renderRanges();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "_changeToMinuteSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n that._inInnerCircle = false;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = that.minuteInterval;\n\n that.$hourContainer.removeClass('jqx-selected');\n that.$minuteContainer.addClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderMinutes();\n\n that._drawArrow(true, undefined, true);\n }", "function currTime() {\n var dt = dateFilter(new Date(), format,'-0800');\n element.text(dt);\n // element point to line 11 span element\n }", "function handleTimePicker(time, inst) {\n\tif (_timeSelected) {\n\t\t_dataChegada = new Date(_dataChegada.getFullYear(), _dataChegada.getMonth(), _dataChegada.getDate(), inst.hours, inst.minutes);\n\t};\n\t_timeSelected = false;\n}", "currentTime() {\n this.time24 = new Time();\n this.updateTime(false);\n }", "function updateTime() {\n\n}", "setNewTime(selectedDateFrom, selectedDateTo) {\n this.setState({\n selectedDateFrom: selectedDateFrom,\n selectedDateTo: selectedDateTo\n });\n\n this.onChange(selectedDateFrom, selectedDateTo);\n }", "updateCurrentMSecs () {\n this.currentMSecs = Date.now();\n }", "function updateTime() {\n var datetime = tizen.time.getCurrentDateTime(),\n hour = datetime.getHours(),\n minute = datetime.getMinutes(),\n second = datetime.getSeconds();\n\n // update the hour/minute/second hands and shadows.\n rotateElement((hour + (minute / 60) + (second / 3600)) * 30, \"body-hr-hand\");\n rotateElement((hour + (minute / 60) + (second / 3600)) * 30, \"body-hr-hand-shadow\");\n rotateElement((minute + second / 60) * 6, \"body-min-hand\");\n rotateElement((minute + second / 60) * 6, \"body-min-hand-shadow\");\n }", "function currentTime() {\n var timeNow = moment().format('h:mm a')\n $(\"#currentTime\").text(timeNow)\n }", "get selectedDateTime() {\n return this.selectedDate + ' ' + this.selectedTime;\n }", "function updateCurrentTime(currentTimeIndex) {\n timeLabel.update(availableTimes[currentTimeIndex]);\n\n // console.log('setting time to' + availableTimes[currentTimeIndex]);\n layerCollection.eachLayer(function(layer) {\n layer.setParams({\n time : availableTimes[currentTimeIndex].toISOString()\n });\n });\n }", "function moveToCurrentTime() {\n timeline.setVisibleChartRangeNow();\n}", "function _setTimes(position, duration) {\n\t\t\tvar time = _convertTime(position/1000);\n\t\t\tif(currentTime != time) {\n\t\t\t\t$main.find('#fap-current-time').text(time);\n\t\t\t\t$main.find('#fap-total-time').text(_convertTime(duration / 1000));\n\t\t\t\t_setSliderPosition(position / duration);\n\t\t\t}\n\t\t\tcurrentTime = time;\n\t\t}", "function setTime(timeSelection) {\r\n localStorage.setItem('timeSpeed', timeSelection);\r\n document.getElementById('normal').setAttribute('class', 'time-btn');\r\n document.getElementById('fast').setAttribute('class', 'time-btn');\r\n document.getElementById('hyper').setAttribute('class', 'time-btn');\r\n document.location.reload(); \r\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "initCurrentTimeLine() {\n const me = this,\n now = new Date();\n\n if (me.currentTimeLine || !me.showCurrentTimeLine) {\n return;\n }\n\n me.currentTimeLine = new me.store.modelClass({\n id: 'currentTime',\n cls: 'b-sch-current-time',\n startDate: now,\n name: DateHelper.format(now, me.currentDateFormat)\n });\n\n me.currentTimeInterval = me.setInterval(() => {\n me.currentTimeLine.startDate = new Date();\n me.currentTimeLine.name = DateHelper.format(me.currentTimeLine.startDate, me.currentDateFormat);\n me.onStoreChanged({ action: 'update', record: me.currentTimeLine });\n }, me.updateCurrentTimeLineInterval);\n\n if (me.client.rendered) {\n me.renderRanges();\n }\n }", "function update() {\n $(\"#currentT-input\").html(moment().format(\"H:mm:ss\"));\n}", "function updateTime(time) {\n //console.log(time)\n transNetwork.activeTime = time;\n transNetwork.updateNet();\n\n powNetwork.activeTime = time;\n powNetwork.updateNet();\n\n table.activeTime = time;\n table.createTable();\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "updateTime() {\n\t\tthis.setState({\n\t\t\ttime: hrOfDay(),\n\t\t\tday: timeOfDay()\n\t\t});\n\t}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function processTimeSelection(x, y, clicked) {\n\t\t\t\tvar selectorAngle = (360 * Math.atan((y - clockCenterY)/(x - clockCenterX)) / (2 * Math.PI)) + 90;\n\t\t\t\tvar selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));\n\t\t\t\t\n\t\t\t\tvar hour = 0;\n\t\t\t\tvar min = 0;\n\t\t\t\tif ((new RegExp('^([0-9]{2}):([0-9]{2})$')).test(inputElement.val())) {\n\t\t\t\t\thour = parseInt(RegExp.$1);\n\t\t\t\t\tmin = parseInt(RegExp.$2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (selectionMode == 'HOUR') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 30);\n\t\t\t\t\tvar h = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 28) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle == 0) h = 12;\n\t\t\t\t\t\t\telse h = selectorAngle;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 6;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (selectorLength < clockRadius - 28 && selectorLength > clockRadius - 65) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle != 0) h = selectorAngle + 12;\n\t\t\t\t\t\t\telse h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 18;\n\t\t\t\t\t\t\tif (h == 24) h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (h > -1) {\n\t\t\t\t\t\tvar newVal = (h < 10 ? '0' : '') + h + ':' + (min < 10 ? '0' : '') + min;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockHourCanvas(h == 0 ? 24 : h);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockHourCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (selectionMode == 'MINUTE') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 6);\n\t\t\t\t\tvar m = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 40) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tm = selectorAngle;\n\t\t\t\t\t\t} else if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\tm = selectorAngle + 30;\n\t\t\t\t\t\t\tif (m == 60) m = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (m > -1) {\n\t\t\t\t\t\tvar newVal = (hour < 10 ? '0' : '') + hour + ':' + (m < 10 ? '0' : '') + m;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockMinuteCanvas(m == 0 ? 60 : m);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockMinuteCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "onMouseDown(day, e) {\n // i want to save the moment/or the day cell here.\n // const { days } = this.state;\n const selectStartHeight = e.target.offsetTop;\n const selectStartCell = day.timeslots[Math.floor(selectStartHeight/CELL_HEIGHT) + 1];\n this.setState({\n selecting: true,\n selectingDay: day,\n selectStartHeight,\n selectStartCell\n });\n }", "set displayTime(time) {\n this._timeEl.innerHTML = time;\n }", "function tpEndSelect( time, startTimePickerInst ) {\n $('#eventStartTime').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "updateComplete(selected) {\n if(selected) {\n\n this.timeSelected += deltaTime;\n if(this.timeSelected >= this.timeToComplete*1000) {\n this.complete = true;\n }\n } else {\n this.resetTimer();\n }\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function update(timeDiff) {\n ant.setLocation(mouseLocation);\n board.update();\n objects.forEach(function(value,index) {\n value.update(board);\n })\n}", "function setDatetimeDefault() {\n\t$(\"#nav\").css({\"display\": \"none\"});\n\tvar x = new Date();\n\tvar formattedDate = new Date();\n\tvar dateString = (formattedDate.getDate().toString());\n\tvar monthString = ((formattedDate.getMonth()+1).toString());\n\tvar dateMonthString = (monthString + '/' + dateString);\n\tvar n = formattedDate.getDay();\n\tvar minutesLow = '';\n\tvar minutesHigh = '';\n\tvar ampmLow = '';\n\tvar ampmHigh = '';\n\tvar hoursLow = '';\n\tvar hoursHigh = '';\n\teventCoords = [];\t\n\tdateTime = getDayNow();\n\t// getDayNow();\n\t// getTimeNow();\n\tdocument.getElementById(\"selectedTime\").value = x.getHours() + (x.getMinutes()/60);\n\tdocument.getElementById('dayofweek').innerHTML = (days[n]+'&nbsp;'+dateMonthString);\n\tif (x.getMinutes() < 10) {\n\t\tminutes = '0' + String(x.getMinutes());\n\t} else {\n\t\tminutes = String(x.getMinutes());\n\t}\n\tif (selectedTime < 12) {\n\t\tampm = 'am';\n\t} else {\n\t\tampm = 'pm';\n\t}\n\n\n\tif ((Math.floor(selectedTime) % 12) === 0) {\n\t\thours = 12;\n\t} else {\n\t\thours = String(Math.floor(selectedTime) % 12);\n\t}\n\n\tvar prettyTime = \"Driver history from&nbsp;\" + hours + \":\" + minutes + \" \" + ampm;\n\tdocument.getElementById('timenavtime').innerHTML = (prettyTime);\n\tgetData();\n}", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}", "function currentTime() {\n var currentHour = moment().hour();\n\n // goes through each time block and adds or remove present/future/past class\n $(\".timeblocks\").each(function () {\n var blockTime = parseInt($(this).attr(\"id\"));\n\n if (blockTime < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"future\");\n $(this).removeClass(\"present\");\n } else if (blockTime === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n } else {\n $(this).removeClass(\"present\");\n $(this).removeClass(\"past\");\n $(this).addClass(\"future\");\n }\n });\n }", "update_() {\n var current = this.tlc_.getCurrent();\n this.scope_['time'] = current;\n var t = new Date(current);\n\n var coord = this.coord_ || MapContainer.getInstance().getMap().getView().getCenter();\n\n if (coord) {\n coord = olProj.toLonLat(coord, osMap.PROJECTION);\n\n this.scope_['coord'] = coord;\n var sets = [];\n\n // sun times\n var suntimes = SunCalc.getTimes(t, coord[1], coord[0]);\n var sunpos = SunCalc.getPosition(t, coord[1], coord[0]);\n\n // Determine dawn/dusk based on user preference\n var calcTitle;\n var dawnTime;\n var duskTime;\n\n switch (settings.getInstance().get(SettingKey.DUSK_MODE)) {\n case 'nautical':\n calcTitle = 'Nautical calculation';\n dawnTime = suntimes.nauticalDawn.getTime();\n duskTime = suntimes.nauticalDusk.getTime();\n break;\n case 'civilian':\n calcTitle = 'Civilian calculation';\n dawnTime = suntimes.dawn.getTime();\n duskTime = suntimes.dusk.getTime();\n break;\n case 'astronomical':\n default:\n calcTitle = 'Astronomical calculation';\n dawnTime = suntimes.nightEnd.getTime();\n duskTime = suntimes.night.getTime();\n break;\n }\n\n var times = [{\n 'label': 'Dawn',\n 'time': dawnTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Sunrise',\n 'time': suntimes.sunrise.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Solar Noon',\n 'time': suntimes.solarNoon.getTime(),\n 'color': '#FFD700'\n }, {\n 'label': 'Sunset',\n 'time': suntimes.sunset.getTime(),\n 'color': '#FFA500'\n }, {\n 'label': 'Dusk',\n 'time': duskTime,\n 'title': calcTitle,\n 'color': '#87CEFA'\n }, {\n 'label': 'Night',\n 'time': suntimes.night.getTime(),\n 'color': '#000080'\n }];\n\n this.scope_['sun'] = {\n 'altitude': sunpos.altitude * geo.R2D,\n 'azimuth': (geo.R2D * (sunpos.azimuth + Math.PI)) % 360\n };\n\n // moon times\n var moontimes = SunCalc.getMoonTimes(t, coord[1], coord[0]);\n var moonpos = SunCalc.getMoonPosition(t, coord[1], coord[0]);\n var moonlight = SunCalc.getMoonIllumination(t);\n\n this.scope_['moonAlwaysDown'] = moontimes.alwaysDown;\n this.scope_['moonAlwaysUp'] = moontimes.alwaysUp;\n\n if (moontimes.rise) {\n times.push({\n 'label': 'Moonrise',\n 'time': moontimes.rise.getTime(),\n 'color': '#ddd'\n });\n }\n\n if (moontimes.set) {\n times.push({\n 'label': 'Moonset',\n 'time': moontimes.set.getTime(),\n 'color': '#2F4F4F'\n });\n }\n\n var phase = '';\n for (var i = 0, n = PHASES.length; i < n; i++) {\n if (moonlight.phase >= PHASES[i].min && moonlight.phase < PHASES[i].max) {\n phase = PHASES[i].label;\n break;\n }\n }\n\n this.scope_['moon'] = {\n 'alwaysUp': moontimes.alwaysUp,\n 'alwaysDown': moontimes.alwaysDown,\n 'azimuth': (geo.R2D * (moonpos.azimuth + Math.PI)) % 360,\n 'altitude': moonpos.altitude * geo.R2D,\n 'brightness': Math.ceil(moonlight.fraction * 100) + '%',\n 'phase': phase\n };\n\n times = times.filter(filter);\n times.forEach(addTextColor);\n googArray.sortObjectsByKey(times, 'time');\n sets.push(times);\n\n this.scope_['times'] = times;\n ui.apply(this.scope_);\n }\n }", "function processTimeSelection(x, y, clicked) {\r\n\t\t\t\tvar selectorAngle = (360 * Math.atan((y - clockCenterY)/(x - clockCenterX)) / (2 * Math.PI)) + 90;\r\n\t\t\t\tvar selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));\r\n\t\t\t\tvar hour = 0;\r\n\t\t\t\tvar min = 0;\r\n\t\t\t\tvar negative = false;\r\n\t\t\t\tif ((new RegExp('^(-|\\\\+)?([0-9]+).([0-9]{2})$')).test(getInputElementValue())) {\r\n\t\t\t\t\tnegative = settings.duration && settings.durationNegative && RegExp.$1 == '-' ? true : false;\r\n\t\t\t\t\thour = parseInt(RegExp.$2);\r\n\t\t\t\t\tmin = parseInt(RegExp.$3);\r\n\t\t\t\t}\r\n\t\t\t\tif (selectionMode == 'HOUR') {\r\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 30);\r\n\t\t\t\t\tvar h = -1;\r\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 28) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tif (selectorAngle == 0) h = 12;\r\n\t\t\t\t\t\t\telse h = selectorAngle;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\th = selectorAngle + 6;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} else if (selectorLength < clockRadius - 28 && selectorLength > clockRadius - 65) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tif (selectorAngle != 0) h = selectorAngle + 12;\r\n\t\t\t\t\t\t\telse h = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\th = selectorAngle + 18;\r\n\t\t\t\t\t\t\tif (h == 24) h = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (settings.afternoonHoursInOuterCircle) {\r\n\t\t\t\t\t\th = h + (h >= 12 ? -12 : 12);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (h > -1) {\r\n\t\t\t\t\t\tvar newVal = (negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + (min < 10 ? '0' : '') + min;\r\n\t\t\t\t\t\tif (isDragging || clicked) {\r\n\t\t\t\t\t\t\tvar isMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\tif (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\t\tif (!isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\t\tif (settings.maximum && isTimeSmallerOrEquals((negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + '00', settings.maximum)) {\r\n\t\t\t\t\t\t\t\t\tnewVal = formatTime(settings.maximum);\r\n\t\t\t\t\t\t\t\t\tisMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, (negative ? '-' : '') +(h < 10 && !settings.duration ? '0' : '') + h + settings.separator + '00')) {\r\n\t\t\t\t\t\t\t\t\tnewVal = formatTime(settings.minimum);\r\n\t\t\t\t\t\t\t\t\tisMinMaxFullfilled = true;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif (isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\t\tvar oldVal = getInputElementValue();\r\n\t\t\t\t\t\t\t\tif (newVal != oldVal) {\r\n\t\t\t\t\t\t\t\t\tif (settings.vibrate) navigator.vibrate(10);\r\n\t\t\t\t\t\t\t\t\telement.attr('value', newVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\t\tsettings.onAdjust.call(element.get(0), newVal.replace(/^\\+/, ''), oldVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tsetInputElementValue(formatTime(newVal));\r\n\t\t\t\t\t\t\t\tautosize();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tisTimeChanged = true;\r\n\t\t\t\t\t\trepaintClockHourCanvas(h == 0 ? 24 : h, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trepaintClockHourCanvas(null, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (selectionMode == 'MINUTE') {\r\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 6);\r\n\t\t\t\t\tvar m = -1;\r\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 40) {\r\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\r\n\t\t\t\t\t\t\tm = selectorAngle;\r\n\t\t\t\t\t\t} else if (x - clockCenterX < 0) {\r\n\t\t\t\t\t\t\tm = selectorAngle + 30;\r\n\t\t\t\t\t\t\tif (m == 60) m = 0;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (m > -1) {\n\t\t\t\t\t\tif (settings.precision != 1) {\n\t\t\t\t\t\t\tvar f = Math.floor(m / settings.precision);\n\t\t\t\t\t\t\tm = f * settings.precision + (Math.round((m - f * settings.precision) / settings.precision) == 1 ? settings.precision : 0);\n\t\t\t\t\t\t\tif (m >= 60) m = 0;\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tvar newVal = (negative ? '-' : '') + (hour < 10 && !settings.duration ? '0' : '') + hour + settings.separator + (m < 10 ? '0' : '') + m;\r\n\t\t\t\t\t\tvar isMinMaxFullfilled = true;\r\n\t\t\t\t\t\tif (settings.maximum && !isTimeSmallerOrEquals(newVal, settings.maximum)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\tif (settings.minimum && !isTimeSmallerOrEquals(settings.minimum, newVal)) isMinMaxFullfilled = false;\r\n\t\t\t\t\t\tif ((isDragging || clicked) && isMinMaxFullfilled) {\r\n\t\t\t\t\t\t\tvar oldVal = getInputElementValue();\r\n\t\t\t\t\t\t\tif (newVal != oldVal) {\r\n\t\t\t\t\t\t\t\tif (settings.vibrate) navigator.vibrate(10);\r\n\t\t\t\t\t\t\t\telement.attr('value', newVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t\tsettings.onAdjust.call(element.get(0), newVal.replace(/^\\+/, ''), oldVal.replace(/^\\+/, ''));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsetInputElementValue(formatTime(newVal));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tisTimeChanged = true;\r\n\t\t\t\t\t\trepaintClockMinuteCanvas(m == 0 ? 60 : m, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\trepaintClockMinuteCanvas(null, settings.duration && settings.durationNegative && selectorLength <= 12);\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "function update_time(index, time) {\n var history = document.getElementById(\"history\");\n var entry = history.rows[history.rows.length - 1];\n var time_cell = entry.insertCell(index);\n var time_text = document.createTextNode(time_repr(time));\n time_cell.appendChild(time_text);\n}", "_changeSelection(event, noAnimation) {\n const that = this,\n x = event.pageX,\n y = event.pageY,\n center = that._getCenterCoordinates(),\n distanceFromCenter = Math.sqrt(Math.pow(center.x - x, 2) + Math.pow(center.y - y, 2));\n\n that._measurements.center = center;\n\n if (event.type === 'down') {\n if (distanceFromCenter > that._measurements.radius) {\n event.stopPropagation();\n return;\n }\n else {\n that._dragging = true;\n }\n }\n\n if (that.format === '24-hour' && that.selection === 'hour' && distanceFromCenter < that._measurements.radius - 50) {\n that._inInnerCircle = true;\n }\n else {\n that._inInnerCircle = false;\n }\n\n const angleRadians = Math.atan2(y - center.y, x - center.x);\n let angleDeg = -1 * angleRadians * 180 / Math.PI;\n\n if (angleDeg < 0) {\n angleDeg += 360;\n }\n\n that._angle = angleDeg;\n\n let newValue = that._numericProcessor.getValueByAngle(that._angle);\n\n if (that.selection === 'hour') {\n if (that.format === '24-hour') {\n if (that._inInnerCircle) {\n if (newValue !== 0 && newValue !== 12) {\n newValue += 12;\n }\n else {\n newValue = 0;\n }\n }\n else if (newValue === 0) {\n newValue = 12;\n }\n }\n else {\n if (newValue === 0) {\n newValue = 12;\n }\n }\n\n that._updateHours(newValue);\n }\n else {\n if (newValue === 60) {\n newValue = 0;\n }\n\n that._updateMinutes(newValue);\n }\n\n if (that._oldTimePart === undefined) {\n return;\n }\n\n cancelAnimationFrame(that._animationFrameId);\n that._drawArrow(true, newValue, noAnimation);\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function selectObj(e){\n if(time === 0) {\n let p = getEventPosition(e);\n x1 = p.x;\n y1 = p.y;\n time++;\n } else {\n let p = getEventPosition(e);\n x2 = p.x;\n y2 = p.y;\n cutObj(x1,y1,x2,y2);\n time = 0;\n }\n}", "function updateTime() {\n time -= 1000;\n showTime(); \n}", "setTime () {\n this.clock.time = moment()\n .local()\n .format(\"dddd, MMMM Do YYYY, h:mm:ss A\")\n }", "function mouseClicked() {\n\n //el tiempo del segundo clic se corre a la segunda posicion\n tiempo[0] = tiempo[1];\n\n //se guarda el tiempo del primer clic en el arreglo\n tiempo[1] = millis();\n}", "refreshTimeline() {\n this.items.clear();\n\n scenarioRepo.getAllPhases(currentScenario).forEach(p => {\n if (selectedPhases.includes(p.phaseID)) {\n this.addNewData(p.events, true);\n } else {\n this.addNewData(p.events, false);\n }\n });\n\n const time = configRepo.get(currentConfig).scenarioStartTime;\n this.startTime = time;\n this.currentTime = time;\n this.line.setCustomTime(time, 0);\n }", "function setTimeString(){\n let strEls = Toolbar.curTime.toUTCString().split(\":\");\n strEls.pop();\n Quas.getEl(\".post-publish-time-text\").text(strEls.join(\":\"));\n}", "function tick() {\n setTime(howOld(createdOn));\n }", "function timeChanged() {\n // if they clear the datetime value, reset the time and hide the keyboard on native\n if (!$scope.time.value) {\n setUpTime();\n\n if (window.Keyboard && window.Keyboard.hide) {\n Keyboard.hide();\n }\n }\n\n // update the time text and unix timestamo for this date\n var thisMoment = moment($scope.time.value);\n $scope.time.text = getTimeText(thisMoment);\n $scope.time.unix = thisMoment.unix();\n\n // show a message when the time selected is in the future\n $scope.future = isInTheFuture(thisMoment);\n }", "function updateTime() {\n var video = document.getElementById(\"video\");\n var i = this.getAttribute(\"id\");\n var clickedCaption = captions[i];\n video.currentTime = clickedCaption.startTime;\n }", "changeTimeValue(e, timeValue) {\n if (e.target.textContent === '+') {\n timer[timeValue]++;\n ui.updateUiElement(ui[timeValue], timer[timeValue])\n console.log(timer[timeValue]);\n } else {\n timer[timeValue]--;\n if (timer[timeValue] < 1) {\n timer[timeValue] = 1;\n }\n ui.updateUiElement(ui[timeValue], timer[timeValue])\n console.log(timer[timeValue]);\n }\n }", "function updateTimeInfo(currentTimeIndex) {\n timeLabel.update(availableTimes[currentTimeIndex]);\n }", "function updateTimeDisplay(newTime) {\n $(\".timer\").text(time);\n time = newTime;\n}", "function currentTime() {\n var current = moment().format('LT');\n $(\"#current-time\").html(current);\n setTimeout(currentTime, 1000);\n }", "function updateTime(time) {\n domVideo.currentTime = time;\n}" ]
[ "0.635821", "0.6237138", "0.6138255", "0.6116868", "0.6115421", "0.58868694", "0.58804727", "0.58680177", "0.5820091", "0.58084935", "0.5727909", "0.5727909", "0.5710188", "0.5709297", "0.5661444", "0.56611395", "0.56587696", "0.56521726", "0.5648474", "0.56421804", "0.5619002", "0.55938274", "0.5569287", "0.5558858", "0.5558756", "0.5542155", "0.552298", "0.5520522", "0.5513889", "0.55081594", "0.55049956", "0.54933167", "0.54865944", "0.5479909", "0.5479909", "0.5479909", "0.5479909", "0.54783577", "0.547706", "0.546512", "0.54563695", "0.54431015", "0.5443037", "0.5433284", "0.543273", "0.5416749", "0.54162", "0.54027134", "0.5396288", "0.5389767", "0.5380744", "0.53573924", "0.53550535", "0.5342537", "0.53411525", "0.5324852", "0.5316748", "0.53081405", "0.5301418", "0.5298415", "0.5282896", "0.5280736", "0.52753", "0.52735114", "0.52667207", "0.5264391", "0.5263334", "0.52579117", "0.52579117", "0.5251281", "0.5248664", "0.5246986", "0.52443206", "0.5243924", "0.52430654", "0.5238854", "0.52363855", "0.5231387", "0.52312326", "0.5229158", "0.5225576", "0.5224122", "0.5222056", "0.52186924", "0.52105165", "0.5210491", "0.5208873", "0.52070457", "0.5206805", "0.52028173", "0.5200374", "0.51995206", "0.51963335", "0.51953226", "0.5194107", "0.51883525", "0.5179145", "0.51687807", "0.5165194", "0.51603574" ]
0.6594209
0
set timefield begin time
function setTimefieldTimeBegin(time) { if (!continueProcessing) { $('#clipBegin').timefield('option', 'value', time); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "set time(value) {}", "function setTime( t ){\n\n this.time = t;\n\n }", "start_time(val) {\n this._start_time = val;\n return this;\n }", "set_time( t ){ this.current_time = t; this.draw_fg(); return this; }", "set startTime(value) { this._startTime = value || new Date(); }", "chronoReset(){\n document.getElementById(\"chronotime\").innerHTML = \"00:00:000\";\n this.start = new Date();\n }", "setTime(time) {\n this.time.setTime(time);\n }", "function setTime() {\n\t\tseconds += 500;\n\t}", "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "changeStartTime(startTime){\n this.startTime = startTime;\n }", "function startTime() {\n setTimer();\n}", "function getTimefieldTimeBegin() {\n return parseFloat($('#clipBegin').timefield('option', 'value'));\n}", "function setTime()\n {\n ++totalSeconds;\n $('#timer > #seconds').html(pad(totalSeconds%60));\n $('#timer > #minutes').html(pad(parseInt(totalSeconds/60)));\n }", "function setStartTime(state, level, time) {\n state.levels[level].startTime = time;\n return state;\n}", "function startSetTime() { \n if (t == 1) {\n sSetTime++;\n if (sSetTime > 59) { //When sSetTime reaches 1 minute it resets to 0 the mSetTime value increases by 1\n mSetTime++;\n sSetTime = 0;\n }\n if (mSetTime > 59) { //When mSetTime reaches 1 hour it resets to 0 the hSetTime value increases by 1\n hSetTime++;\n mSetTime = 0;\n }\n if (hSetTime > 23) { //When hSetTime reaches 24 hours its value resets\n hSetTime = 0;\n } \n }\n setTimeTO = setTimeout(function () { startSetTime() }, 1000); //1 second intervals\n }", "function setStartTime(newStart) {\n if (newStart < 0 || newStart < (snipWin / 2)) {\n songStart = 0;\n songEnd = snipWin;\n } else {\n songStart = parseFloat(newStart) - (snipWin / 2);\n songEnd = Math.abs(songStart) + snipWin\n }\n}", "function setUpTime() {\n if ($scope.event) {\n $scope.time = {\n value: new Date($scope.event.time * 1000)\n };\n }\n else {\n $scope.time = {\n value: new Date()\n }\n }\n\n timeChanged();\n }", "function setTimefieldTimeEnd(time) {\n if (!continueProcessing) {\n $('#clipEnd').timefield('option', 'value', time);\n }\n}", "function setTime(){\n let hr = Quas.getEl(\"#time-picker-hr\").val();\n let min = Quas.getEl(\"#time-picker-min\").val();\n\n //validate time\n if( isNaN(hr) || isNaN(min) ||\n min < 0 || min > 59 || hr < 0 || hr > 23 ||\n hr=== \"\" || min === \"\"){\n new Notification(\"Invalid Time\", 4).render();\n }\n else{\n Toolbar.curTime.setHours(Number(hr), Number(min), 0);\n setTimeString();\n Toolbar.publishNow = false;\n closeToolModals();\n }\n}", "function startTime() {\n var m_name = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'June', 'July', 'Aug', 'Sept', 'Oct', 'Nov', 'Dec'];\n var today = new Date();\n var date = today.getDate();\n var month = m_name[today.getMonth()];\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n var year = today.getFullYear();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').value =\n date + \"-\" + month + \"-\" + year + \" \" + h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n}", "setTime(time) {\n this.time = time;\n this.fieldsComputed = false;\n this.complete();\n }", "function startTime() {\n\tvar now = new Date();\n\tvar hour = ('0' + now.getHours()).slice(-2);\n\tvar mins = now.getMinutes();\n\tvar secs = now.getSeconds();\n\tvar ampm = hour >= 12 ? 'PM' : 'AM';\n\tvar day = ('0' + now.getDate()).slice(-2);\n\tvar month = ('0' + (now.getMonth()+1)).slice(-2);\n\tvar year = now.getFullYear();\n \thour = hour ? hour : 12;\n\tmins = mins < 10 ? '0' + mins : mins;\n\tsecs = secs < 10 ? '0' + secs : secs;\n\tvar timeString = hour + ':' + mins;\n\tvar dateString = month + '/' + day + '/' + year;\n\tdocument.getElementById('time').innerHTML = timeString;\n\tdocument.getElementById('date').innerHTML = dateString;\n\tvar t = setTimeout(startTime, 500);\n}", "function setCurrentTime(){\n let now = new Date();\n let hours = now.getHours();\n let setHours = hours > 9 ? hours : `0${hours}`\n let minutes = now.getMinutes();\n let setMinutes = minutes > 9 ? minutes : `0${minutes}`;\n TIME.textContent = `${setHours}:${setMinutes}`;\n DATE.textContent = `${now.toLocaleDateString('en-US', { weekday: 'short', year: 'numeric', month: 'short', day: 'numeric'})}`;\n }", "function setTimeFirst()\n {\n if(timeFormat === \"12\")\n {\n now = moment().format(\"dddd, MMMM Do YYYY, h:mm a\");\n }\n else\n {\n now = moment().format(\"dddd, MMMM Do YYYY, H:mm\");\n }\n }", "function startTime() {\n s = (s+1) % 60;\n if (s == 0)\n m = (m+1) % 60;\n var ms=checkTime(m);\n var ss=checkTime(s);\n document.getElementById('time').innerHTML=ms+\":\"+ss;\n t=setTimeout(function(){startTime()},1000);\n }", "function setPlayTime(t) {\n console.log(\"setPlayTime \" + t);\n pano.setPlayTime(t);\n if (PC)\n PC.sendMessage({ 'type': 'pano.control', time: t });\n}", "function startTime() {\r\n var delta = Date.now() - start_time; // in milliseconds\r\n time.seconds = Math.floor((delta % (1000 * 60)) / 1000);\r\n time.minutes = Math.floor((delta % (1000 * 60 * 60)) / (1000 * 60));\r\n time.hours = Math.floor((delta % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\r\n\r\n if(time.seconds < 10) {\r\n seconds_display.textContent = '0' + time.seconds; \r\n }\r\n else {\r\n seconds_display.textContent = time.seconds; \r\n }\r\n\r\n if(time.minutes < 10) {\r\n minutes_display.textContent = '0' + time.minutes;\r\n }\r\n else {\r\n minutes_display.textContent = time.minutes;\r\n }\r\n\r\n if(time.hours < 10) {\r\n hours_display.textContent = '0' + time.hours;\r\n }\r\n else {\r\n hours_display.textContent = time.hours;\r\n }\r\n}", "EDIT_DATE_TIME_START(state, date) {\n if (isValidDate(date)) {\n state.dateTimeStart = date;\n }\n }", "function startTime(){\n if(start)\n clearInterval(start);\n\n start = setInterval(updateTime, 1000); //essa funçao faz o delay em cada 1000 milisegundos actualiza o time\n }", "function setTime(){\n ++totalSeconds; //increment seconds\n var seconds = totalSeconds%60 + \"\"; //get seconds string \n\tif(seconds.length < 2) seconds = \"0\" + seconds; //to display a \"0\" in front of single-digit seconds\n var minutes = Math.floor(totalSeconds/60); //minutes string\n\ttimeString = (minutes + \":\" + seconds);\n}", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function getInitialTime() {\n changeTime();\n}", "function startTime() {\n\ttime = setInterval(() => {\n\t\tseconds = seconds + 1;\n\t\tif (seconds == 59) {\n\t\t\tseconds = 0;\n\t\t\tmin = min + 1;\n\t\t}\n\t\tif (min == 60) {\n\t\t\tmin = 0;\n\t\t\thour = hour + 1;\n\t\t}\n\t\ttimeSpace.innerHTML = \"h\" + hour + \":\" + min + \"m : \" + seconds + \"s\";\n\t\t// to Show time\n\t}, 1000)\n}", "set timeLeft(time){\n this.currentTimeInput.value = this.renderTime(time);\n }", "function onInit()\n{\n\tscene.setTimer(\"clock\", 1);\n\t\n scenes.scene_1.objects.txTime.text = \"Time: \" + minutes + \":\" + seconds;\n\n}", "function setTimeDisplay() {\n timeDisplay.textContent = formattedFocusTime;\n}", "function initTime()\r\n{\r\n\ttempoDiv = document.getElementById(\"time\");\r\n\ttempoDiv.style.display = \"inline\";\r\n\ttime=0;\r\n\ttimeIncrement(time);\r\n}", "function startTime()\n{\t\n\tvar today=new Date();\n\tvar h=today.getUTCHours();\n\tvar m=today.getUTCMinutes();\n\tvar s=today.getUTCSeconds();\n\tvar day=today.getUTCDate();\n\tvar month=today.getUTCMonth()+1;\n\tvar year=today.getUTCFullYear()\n\t\n\t// add a zero in front of numbers<10\n\tm=if0(m);\n\ts=if0(s);\n\th=if0(h);\n\tday=if0(day);\n\tmonth=if0(month);\n\t$('.showUTCTime').text(day+\".\"+month+\".\"+year+\" \"+h+\":\"+m+\":\"+s);\n\tsetTimeout(\"startTime()\",1000);\n}", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('txt').innerHTML =\n h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n }", "function set(obj) {\n obj.time = util.time();\n }", "function setTime(){\n let dt = new Date();\n currScene.timeInScene = dt.getTime();\n}", "function startTime() {\r\n var today=new Date();\r\n var h=today.getHours();\r\n var m=today.getMinutes();\r\n var s=today.getSeconds();\r\n m = checkTime(m);\r\n s = checkTime(s);\r\n document.getElementById('currentTime').innerHTML = h+\":\"+m+\":\"+s;\r\n var t = setTimeout(function(){startTime()},500);\r\n}", "function timeStart() {\r\n secSaved = ++centiSec;\r\n sec = secSaved / 60;\r\n secHtml.innerText = parseInt(sec);\r\n secSaved = secSaved % 60;\r\n centiSecHtml.innerText = secSaved;\r\n}", "function setTime() {\n //increments timer\n ++totalSeconds;\n //temporarily stops timer at 5 seconds for my sanity\n if (totalSeconds === 59) {\n totalMinutes += 1;\n totalSeconds = 0;\n }\n\n //stops timer when game is won\n if (gameWon === true) {\n return;\n }\n //calls function to display timer in DOM\n domTimer();\n }", "function setTime(value) {\n // console.log('value...', value, new Date(uwb_start + (value * 1000)).getTime())\n sliderValue.innerHTML = Math.floor(value);\n slider.value = Math.floor(value);\n layer.renderer = createRenderer(value);\n }", "function updateStartTime(){\n if(mode == \"play\"){\n startTime = millis();\n }\n}", "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }", "function startTime() {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n document.getElementById('time').innerHTML = \"Horário: \" + h + \":\" + m + \":\" + s;\n var t = setTimeout(startTime, 500);\n}", "function tpStartSelect( time, endTimePickerInst ) {\n $('#eventEndTime').timepicker('option', {\n minTime: {\n hour: endTimePickerInst.hours,\n minute: endTimePickerInst.minutes\n }\n });\n}", "function startTime() {\n var t = moment().format(\"h:mm:ss\");\n document.getElementById(\"clock\").innerHTML = t\n t=setTimeout('startTime()', 1500)\n// console.log(\"db clock: \" + t);\n\n}", "function setAt(e) {\r\n var at = document.getElementById(\"at\");\r\n if (at) {\r\n // d = 'top of the timeline time' \r\n var n = new Date();\r\n n.setTime(tl_t_time.getTime() + (tl_unwarp(e.pageY) - tl_scroll_offset) *60*1000);\r\n s=(n.getFullYear())+\"/\"+(n.getMonth()+1)+\"/\"+n.getDate()+\" \"+n.getHours()+\":\"+pad2(n.getMinutes())+\":\"+pad2(n.getSeconds());\r\n at.value=s;\r\n }\r\n }", "increaseTime(t) {\n this.currentTime += t;\n this.timeElement.textContent = this.currentTime;\n }", "function handleInputTimeChange(event) {\n const { name, value } = event.target;\n setStartTime({ ...starttime, [name]: value });\n }", "function SetTime() {\r\n let date = new Date();\r\n let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());\r\n \r\n document.querySelector('.order--timer').textContent = time;\r\n // console.log('updated at',time)\r\n setTimeout(SetTime, 60000);\r\n }", "changeTocurrentTime(_date=this.currentdate_time){\n this.currentdate_time = _date;\n }", "function startTime() {\n let today = new Date(),\n hrs = today.getHours(),\n mins = today.getMinutes(),\n secs = today.getSeconds(),\n hh = hrs;\n\n if (hrs > 12) {\n hrs = hh - 12;\n }\n if (hrs == 0) {\n hrs = 12;\n }\n \n mins = checkTime(mins);\n document.getElementById('time').innerHTML = `${hrs}:${mins}`;\n\n var t = setTimeout(startTime, 500);\n}", "function startTime(autostart) {\n var today = new Date();\n var h = today.getHours();\n var m = today.getMinutes();\n var s = today.getSeconds();\n m = checkTime(m);\n s = checkTime(s);\n $('#startClock').html(\"@\" + h + \":\" + m + \":\" + s + \" Uhr\");\n var t = setTimeout(startTime, 1000);\n\n}", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function startTime2() {\n if (t == 0) {\n //h, m and s are assigned to the real time\n var today = new Date();\n h = today.getHours();\n m = today.getMinutes();\n s = today.getSeconds();\n }\n if (t == 1) { \n //h, m and s are assigned to the set time\n h = hSetTime;\n m = mSetTime;\n s = sSetTime; \n }\n\n\t\t\tseconds.animate({transform: [ 'r',((s*6) + 180),200,200]}); //secondhand animation\n\t\t\tminutes.animate({transform: ['r',((m*6) + 180),200,200]}); //minute hand animation\n\t\t\thours.animate({transform: ['r',((h*30) + 180),200,200]}); //hours hand animation\t\t\n\t\t\t\n\t\t\tsetTimeout(function(){startTime2()}, 250); //funtion refreshes at 1/4 second intervals\n\n //Changes the AM/PM text depending on the time\n\t\t\tif (h < 12){\n ampmtxt.attr({text: \"AM\", \"font-size\": 15, fill: outline1 });\n\t\t\t} else {\n ampmtxt.attr({text: \"PM\" , \"font-size\": 15, fill: outline1});\n\t\t\t}\t\n\t\t}", "function updateTime(time) {\n //console.log(time)\n transNetwork.activeTime = time;\n transNetwork.updateNet();\n\n powNetwork.activeTime = time;\n powNetwork.updateNet();\n\n table.activeTime = time;\n table.createTable();\n }", "set displayTime(time) {\n this._timeEl.innerHTML = time;\n }", "get startTime() { return this._startTime; }", "function updateTime() {\n\n}", "function setTime(time) {\n timeout = time;\n}", "function onStartFrame(t, state) {\n // (KTR) TODO implement option so a person could pause and resume elapsed time\n // if someone visits, leaves, and later returns\n let tStart = t;\n if (!state.tStart) {\n state.tStart = t;\n state.time = t;\n }\n\n tStart = state.tStart;\n\n let now = (t - tStart);\n // different from t, since t is the total elapsed time in the entire system, best to use \"state.time\"\n state.time = now;\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n gl.uniform1f(state.uTimeLoc, now / 1000.0);\n\n gl.enable(gl.DEPTH_TEST);\n}", "setDefaultTimePickerState() {\n this.withTime = this.thyMustShowTime;\n }", "function fillTimes() {\n let now = new Date();\n startTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n endTime.value = now.toLocaleDateString(\"en-US\") +\" \"+ now.toTimeString().slice(0,8);\n}", "startTimer() {\n this.startTime = Date.now();\n }", "setTimeWrite ( value ) {\n this.time = value;\n }", "function setScreenTime(minut) {\n $('#lcd').val(addZero(minut) + ':00')\n }", "function updateTime(){\n setTimeContent(\"timer\");\n}", "function setNowDateTime(name,showSeconds,valType) {\r\n\teval(\"document.form.\"+name+\".value='\"+getCurrentDate(valType)+' '+currentTime('both',showSeconds)+\"';\");\n\t// If user modifies any values on the data entry form, set flag to TRUE\n\tdataEntryFormValuesChanged = true;\r\n\t// Trigger branching/calc fields, in case fields affected\r\n\t$('[name='+name+']').focus();\r\n\tsetTimeout(function(){try{calculate();doBranching();}catch(e){}},50); \r\n}", "function startTime() {\n var today = new Date();\n var hourNow = today.getHours();\n var h = formatHour(hourNow);\n var m = today.getMinutes();\n var ap = formatAmPm(hourNow);\n if(m==0) {\n writeDate();\n }\n m = checkTime(m);\n document.getElementById('clock').innerHTML = h + ':' + m + ap;\n var t = setTimeout(startTime, 10000);\n}", "async setStartTime( time ) {\n\n // Set the start date so we know when to fire another notification\n var timestamp = String( ( typeof time === 'undefined' ) ? Date.now() : time );\n \n try {\n App._log( 'setting the \"start time\" to check against: ' + new Date( parseInt( timestamp ) ).toLocaleString() );\n\n await AsyncStorage.setItem( this.STORAGE_KEYS.NOTIFICATION_START_TIME, timestamp );\n\n } catch (error) {\n \n // Error saving data\n console.log( error );\n }\n\n return timestamp;\n }", "setTime(time) {\n this.time = time;\n return this;\n }", "function checkInitialTime() {\n if (moment().format('HHmm') > 1700 && (moment().format('HHmm') < 0900)) {\n $('#eventText').addClass('past');\n $('#eventText').attr(\"readonly\", \"readonly\");\n }\n }", "_resetTimePart() {\n const that = this,\n code = that._highlightedTimePart.code,\n index = that._codeToIndex[code],\n newValueConstructorParameters = JQX.Utilities.DateTime.getConstructorParameters(that._value);\n let value;\n\n if (index > 2) {\n value = 0;\n }\n else if (index > 0) {\n value = 1;\n }\n else {\n value = that.min.year();\n }\n\n newValueConstructorParameters[index] = value;\n newValueConstructorParameters.unshift(null);\n\n that._validateValue(new (Function.prototype.bind.apply(JQX.Utilities.DateTime, newValueConstructorParameters)));\n }", "function handleChangeBegin(ev) {\n if (!ev.target['validity'].valid) return;\n const dt= ev.target['value'];\n\n setDatetimeBegin(dt);\n }", "function setTime() {\n\t++secondsCounter; //incrementer\n\ttimerSeconds.innerHTML = pad(secondsCounter % 60);\n\ttimerMinutes.innerHTML = pad(parseInt(secondsCounter / 60));\n}", "function setAlarmTime(value) {\r\n alarmTime = value;\r\n}", "function startTime() {\n const today = new Date();\n let hour = today.getHours();\n let minute = today.getMinutes();\n let second = today.getSeconds();\n hour = formatTime(hour);\n minute = formatTime(minute);\n second = formatTime(second);\n\n document.querySelector(\"#current-time\").innerHTML = hour + \":\" + minute + \":\" + second;\n setTimeout(function () {\n startTime();\n }, 500);\n}", "function SetStartTime(custid) {\n\n\n //TimeStamp - Capture Start Time\n var currentTime = new Date();\n var month = currentTime.getMonth() + 1;\n var day = currentTime.getDate();\n var year = currentTime.getFullYear();\n\n var hours = currentTime.getHours();\n var minutes = currentTime.getMinutes();\n\n if (minutes < 10) {\n minutes = '0' + minutes\n }\n\n var seconds = currentTime.getSeconds();\n if (seconds < 10) {\n seconds = '0' + seconds\n }\n\n var daTime = (month + \"/\" + day + \"/\" + year + \" \" + hours + \":\" + minutes + \":\" + seconds);\n\n //alert(\"Start Time \"+ daTime);\n document.forms[0].timestamp.value = daTime;\n\n\n //saveReport (custid, \"timestamp\", document.forms[0].timestamp.value);\n saveReport(custid, \"StartTime\", daTime);\n\n //\n\n}", "function recordStartTime() {\n\tthis._startAt = process.hrtime()\n\tthis._startTime = new Date()\n}", "onFieldChange() {\n const me = this;\n if (me._time) {\n me.value = me.pickerToTime();\n }\n }", "function reset(){\n running = 0;\n time = 0;\n document.getElementById(\"start\").innerHTML = \"Start\";\n document.getElementById(\"output\").innerHTML = \"0:00:00\";\n var d1 = new Date();\n document.getElementById(\"end_time\").value = d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds();\n console.log(d1.getTime())\n console.log( d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds());\n console.log( d1.toUTCString())\n}", "function setTimeController(controller) {\n _timeController = controller;\n }", "async updateTimebar() {\n this.timeText = await this.time.getCurrentTime();\n this.tag('Time').patch({ text: { text: this.timeText } });\n }", "function reset1(){\n running = 0;\n time = 0;\n document.getElementById(\"start1\").innerHTML = \"Start\";\n document.getElementById(\"output1\").innerHTML = \"0:00:00\";\n var d1 = new Date();\n document.getElementById(\"end_time1\").value = d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds();\n console.log(d1.getTime())\n console.log( d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds());\n console.log( d1.toUTCString())\n}", "function setNowTime(name) {\r\n\teval(\"document.form.\"+name+\".value='\"+currentTime('both')+\"';\");\n\t// If user modifies any values on the data entry form, set flag to TRUE\n\tdataEntryFormValuesChanged = true;\r\n\t// Trigger branching/calc fields, in case fields affected\r\n\t$('[name='+name+']').focus();\r\n\tsetTimeout(function(){try{calculate();doBranching();}catch(e){}},50); \r\n}", "function Start () {\nTOD = -400;//5 O'clock PM\n}", "function updateTime() {\r\n\ttimeSec += 1;\r\n\t\r\n\tif (timeSec > 60) {\r\n\t\ttimeSec = 0;\r\n\t\ttimeMin += 1;\r\n\t}\r\n\t\r\n\tvar t = document.getElementById(\"time\");\r\n\t\r\n\tif (timeSec < 10) {\r\n\t\tt.innerHTML = \"Time \" + timeMin + \":0\" + timeSec;\r\n\t} else {\r\n\t\tt.innerHTML = \"Time \" + timeMin + \":\" + timeSec;\r\n\t}\r\n}", "function setTime() {\n var hours = $('input[name=\"schedule_hour_submit\"]').val();\n var minutes = $('input[name=\"schedule_minute_submit\"]').val();\n if (!_.isEmpty(hours) && !_.isEmpty(minutes)) {\n schedule.scheduleTime = $('input[name=\"schedule_hour_submit\"]').val() + ':' + $('input[name=\"schedule_minute_submit\"]').val() + ' ' + $('select[name=\"schedule_ampm_submit\"] option:selected').val();\n }\n\n if (!_.isNull(schedule.scheduleDate) && !_.isNull(schedule.scheduleTime)) {\n var date = moment(schedule.scheduleDate).format('DD-MM-YYYY');\n var datetime = date + ' ' + schedule.scheduleTime;\n schedule.scheduleDateTime = moment(datetime, 'DD-MM-YYYY hh:mm a');\n }\n\n }", "handleSetStartTime() {\n let newStartTime;\n\n if (this.props.startTime) {\n // pause the timer and clear the interval\n newStartTime = { elapsedTime: this.state.elapsedTime, startTime: null };\n clearInterval(this.interval);\n } else {\n // start the timer and create an interval\n newStartTime = { elapsedTime: this.state.elapsedTime, startTime: Date.now() };\n this.interval = setInterval(this.incrementTime, 1000);\n }\n\n // pass params onto parent\n this.props.onSetStartTime(newStartTime, this.props.uuid);\n }", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function recordStartTime () {\n this._startAt = process.hrtime()\n this._startTime = new Date()\n}", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}" ]
[ "0.70391136", "0.6932435", "0.6772772", "0.6754524", "0.6752003", "0.6709831", "0.67033005", "0.66664654", "0.662759", "0.6590096", "0.65732306", "0.6529109", "0.64972186", "0.64684945", "0.6466609", "0.6464031", "0.6460689", "0.6431454", "0.6429534", "0.6400319", "0.6389779", "0.6381783", "0.63814133", "0.6375666", "0.63188946", "0.63179725", "0.6295952", "0.62792695", "0.6260118", "0.62574494", "0.62439036", "0.6239738", "0.6238031", "0.62146306", "0.61923856", "0.618075", "0.6178184", "0.61752313", "0.61708283", "0.61678463", "0.6136229", "0.61299473", "0.6123738", "0.6122427", "0.6118998", "0.61184174", "0.6117631", "0.6097327", "0.607824", "0.6076074", "0.60738355", "0.60572284", "0.60386664", "0.60318637", "0.60214466", "0.6016533", "0.60110044", "0.600807", "0.60070026", "0.59890705", "0.59878534", "0.59736925", "0.5964714", "0.595773", "0.5951417", "0.59408575", "0.5940702", "0.59386253", "0.593296", "0.5925537", "0.59201247", "0.5914935", "0.5908379", "0.59058917", "0.5901625", "0.58964914", "0.58884287", "0.58879673", "0.588462", "0.58840543", "0.5880122", "0.58765715", "0.5875992", "0.58637315", "0.5853539", "0.5852589", "0.58483154", "0.5846935", "0.5837657", "0.5837405", "0.58337533", "0.58320117", "0.58315104", "0.582875", "0.582411", "0.582411", "0.582411", "0.582411", "0.582411", "0.5821509" ]
0.8049476
0
set timefield end time
function setTimefieldTimeEnd(time) { if (!continueProcessing) { $('#clipEnd').timefield('option', 'value', time); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tpEndSelect( time, startTimePickerInst ) {\n $('#eventStartTime').timepicker('option', {\n maxTime: {\n hour: startTimePickerInst.hours,\n minute: startTimePickerInst.minutes\n }\n });\n}", "set time(value) {}", "function setTimefieldTimeBegin(time) {\n if (!continueProcessing) {\n $('#clipBegin').timefield('option', 'value', time);\n }\n}", "function setTime(time) {\n timeout = time;\n}", "setTime(time) {\n this.time.setTime(time);\n }", "function setEndTime(state, level, time) {\n state.levels[level].endTime = time;\n return state;\n}", "function setCurrentTimeAsNewOutpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeEnd(getCurrentTime());\n okButtonClick();\n }\n}", "function setTime( t ){\n\n this.time = t;\n\n }", "function getTimefieldTimeEnd() {\n return parseFloat($('#clipEnd').timefield('option', 'value'));\n}", "function setTime(){\n let hr = Quas.getEl(\"#time-picker-hr\").val();\n let min = Quas.getEl(\"#time-picker-min\").val();\n\n //validate time\n if( isNaN(hr) || isNaN(min) ||\n min < 0 || min > 59 || hr < 0 || hr > 23 ||\n hr=== \"\" || min === \"\"){\n new Notification(\"Invalid Time\", 4).render();\n }\n else{\n Toolbar.curTime.setHours(Number(hr), Number(min), 0);\n setTimeString();\n Toolbar.publishNow = false;\n closeToolModals();\n }\n}", "setTime(time) {\n this.time = time;\n this.fieldsComputed = false;\n this.complete();\n }", "updateTimeField(timeField) {\n const me = this;\n timeField.on({\n change({\n userAction,\n value\n }) {\n if (userAction && !me.$settingValue) {\n const dateAndTime = me.dateField.value;\n me._isUserAction = true;\n me.value = dateAndTime ? DateHelper.copyTimeValues(dateAndTime, value) : null;\n me._isUserAction = false;\n }\n },\n\n thisObj: me\n });\n }", "setTimeWrite ( value ) {\n this.time = value;\n }", "function checkTime(field) {\n\t\tFeld = eval('document.poform.'+field);\n\t\tFeldLength = Feld.value.length;\n\t\tFeldValue = Feld.value;\n\t\tif (FeldLength == 1) {\n\t\tFeld.value = \"0\"+FeldValue;\n\t\t}\n\t\tif (FeldLength == 0) {\n\t\tFeld.value = \"00\";\n\t\t}\n\t\tvar t1 = document.poform.start_hour.value+':'+document.poform.start_min.value;\n\t\tvar t2 = document.poform.end_hour.value+':'+document.poform.end_min.value;\n\t\tvar m = ((t2.substring(0,t2.indexOf(':'))-0) * 60 +\n\t\t\t\t(t2.substring(t2.indexOf(':')+1,t2.length)-0)) - \n\t\t\t\t((t1.substring(0,t1.indexOf(':'))-0) * 60 +\n\t\t\t\t(t1.substring(t1.indexOf(':')+1,t1.length)-0));\n\t\tvar h = Math.floor(m / 60);\n\t\tdocument.poform.length.value = h + ':' + (m - (h * 60));\n}", "function end(task_id, time) {\n if (TIME_ID == \"\") {\n alert(\"You haven't started the task yet.\");\n }\n\n else {\n let text = JSON.stringify({\n time_block: {\n start: START_TIME,\n end: time,\n convert: true\n },\n });\n\n $.ajax(time_block_path + \"/\" + TIME_ID, {\n method: \"put\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { set_time_link(task_id, \"End\"); },\n error: (resp) => { console.log(resp); }\n });\n }\n}", "function setAlarmTime(value) {\r\n alarmTime = value;\r\n}", "function setTime() {\n\t\tseconds += 500;\n\t}", "onFieldChange() {\n const me = this;\n if (me._time) {\n me.value = me.pickerToTime();\n }\n }", "onFieldChange() {\n const me = this;\n\n if (me._time) {\n me.value = me.pickerToTime();\n }\n }", "onFieldChange() {\n const me = this;\n if (me._time) {\n me.value = me.pickerToTime();\n }\n }", "function handleTime() {\r\n // times\r\n const minutes = parseInt(this.dataset.time) * 60;\r\n const today = Date.now();\r\n console.log(minutes);\r\n // converting\r\n const ms = minutes * 1000;\r\n // calculation\r\n const together = today + ms;\r\n const newTime = new Date(together);\r\n //displaying\r\n const displayUno = newTime.getHours();\r\n const displayTwo = newTime.getMinutes();\r\n endTime.textContent = `U should be back at ${displayUno < 10 ? '0': ''}${displayUno}:${displayTwo < 10 ? '0':''}${displayTwo}`\r\n}", "set_time( t ){ this.current_time = t; this.draw_fg(); return this; }", "function tpStartSelect( time, endTimePickerInst ) {\n $('#eventEndTime').timepicker('option', {\n minTime: {\n hour: endTimePickerInst.hours,\n minute: endTimePickerInst.minutes\n }\n });\n}", "setEndValue(value) {\n this.setState({ endValue: value });\n this.checkTimeE(value);\n }", "function startSetTime() { \n if (t == 1) {\n sSetTime++;\n if (sSetTime > 59) { //When sSetTime reaches 1 minute it resets to 0 the mSetTime value increases by 1\n mSetTime++;\n sSetTime = 0;\n }\n if (mSetTime > 59) { //When mSetTime reaches 1 hour it resets to 0 the hSetTime value increases by 1\n hSetTime++;\n mSetTime = 0;\n }\n if (hSetTime > 23) { //When hSetTime reaches 24 hours its value resets\n hSetTime = 0;\n } \n }\n setTimeTO = setTimeout(function () { startSetTime() }, 1000); //1 second intervals\n }", "function setUpTime() {\n if ($scope.event) {\n $scope.time = {\n value: new Date($scope.event.time * 1000)\n };\n }\n else {\n $scope.time = {\n value: new Date()\n }\n }\n\n timeChanged();\n }", "function setEndTime(mins) {\n let time = new Date();\n return new Date(time.getTime() + Number(mins) * 60000)\n }", "function setTime() {\n var hours = $('input[name=\"schedule_hour_submit\"]').val();\n var minutes = $('input[name=\"schedule_minute_submit\"]').val();\n if (!_.isEmpty(hours) && !_.isEmpty(minutes)) {\n schedule.scheduleTime = $('input[name=\"schedule_hour_submit\"]').val() + ':' + $('input[name=\"schedule_minute_submit\"]').val() + ' ' + $('select[name=\"schedule_ampm_submit\"] option:selected').val();\n }\n\n if (!_.isNull(schedule.scheduleDate) && !_.isNull(schedule.scheduleTime)) {\n var date = moment(schedule.scheduleDate).format('DD-MM-YYYY');\n var datetime = date + ' ' + schedule.scheduleTime;\n schedule.scheduleDateTime = moment(datetime, 'DD-MM-YYYY hh:mm a');\n }\n\n }", "setEnd(pDateTime)\n\t{\n\t\t// If this is a Luxon DateTime, we are golden.\n\t\tif (typeof(pDateTime) === 'number')\n\t\t\tthis.EndTime = pDateTime;\n\t\telse if (typeof(pDateTime) === 'string')\n\t\t{\n\t\t\tthis.EndTime = Date.parse(pDateTime);\n\t\t}\n\t\telse\n\t\t\tthis.EndTime = Date.now();\n\n\t\t// If the StartTime isn't set or is greater than the EndTime, reset it to EndTime.\n\t\tif (!this.EndTime || this.EndTime < this.EndTime)\n\t\t\tthis.EndTime = this.StartTime;\n\n\t\treturn true;\n\t}", "function resetAppointmentField(){\r\n\tvar duration = document.getElementById('duration').value;\r\n\t\t\t\r\n\t\t\ttotal = \"00:00:00\";\r\n\t//globalEndTime = etime;\r\n\t\r\n\tvar stime = document.getElementById('sTime').value;\r\n\t\r\n\tvar total = getTimeTotal(duration,stime);\r\n\t//alert(total)\r\n\tdocument.getElementById('endTime').value = total;\r\n\t\r\n}", "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "function setTimer() {\n time--;\n\n timerEl.textContent = time;\n\n if (time <=0)\n endQuiz()\n }", "changeTimeField(config) {\n const me = this,\n result = new TimeField(ObjectHelper.assign({\n flex: '0 0 45%',\n\n updateInvalid() {\n const updatingInvalid = me.updatingInvalid;\n TimeField.prototype.updateInvalid.apply(this, arguments);\n me.timeField && !updatingInvalid && me.updateInvalid();\n }\n\n }, config)); // Must set *after* construction, otherwise it becomes the default state\n // to reset readOnly back to\n\n if (me.readOnly) {\n result.readOnly = true;\n }\n\n return result;\n }", "function setMinEnd() {\n var startInput = $('#startTime').val();\n var minEndHoursI = parseInt(startInput.substr(0,2)) + 1;\n var minEndHours = minEndHoursI.toString();\n var minEnd = minEndHours + ':00';\n\n if(minEndHoursI < 10) {\n minEnd = '0' + minEnd;\n }\n\n $('#endTime').attr('min', minEnd);\n}", "function set(obj) {\n obj.time = util.time();\n }", "set timeLeft(time){\n this.currentTimeInput.value = this.renderTime(time);\n }", "function setPlayTime(t) {\n console.log(\"setPlayTime \" + t);\n pano.setPlayTime(t);\n if (PC)\n PC.sendMessage({ 'type': 'pano.control', time: t });\n}", "set timeRemaining(time){\n\t\tthis.durationInput.value = time.toFixed(2);\n\t}", "setTimeLimits(startTime, endTime) {\n if (startTime && endTime) {\n if (typeof startTime == \"object\" && typeof endTime == \"object\") {\n this.startTime = h.toTimestamp(startTime);\n this.endTime = h.toTimestamp(endTime);\n } else {\n this.startTime = startTime;\n this.endTime = endTime;\n }\n } else {\n this.startTime = ''\n this.endTime = ''\n }\n }", "function autoEndtime() {\n\n var OTFRAC = document.getElementById('ctl00_ContentPlaceHolder1_hfOTFRAC').value;\n\n shift = document.getElementById('ctl00_ContentPlaceHolder1_txtShift').value;\n\n var breakStartTime = shift.substring(16, 21);\n var breakStartHour = breakStartTime.substring(0, 2);\n var breakStartMin = breakStartTime.substring(3, 5);\n\n\n var breakEndTime = shift.substring(23, 28);\n var breakEndHour = breakEndTime.substring(0, 2);\n var breakEndMin = breakEndTime.substring(3, 5);\n\n //Convert hour in minutes\n breakStartHour = parseInt(breakStartHour, 10) * 60;\n breakStartMin = parseInt(breakStartMin, 10) + parseInt(breakStartHour, 10);\n\n breakEndHour = parseInt(breakEndHour, 10) * 60;\n breakEndMin = parseInt(breakEndMin, 10) + parseInt(breakEndHour, 10);\n\n var breakMin = breakEndMin - breakStartMin;\n\n var table = document.getElementById('tst');\n var tbody = table.getElementsByTagName('TBODY')[0];\n var oRow = table.rows[position];\n\n oRow.getElementsByTagName('INPUT')[1].value = formatTime(oRow.getElementsByTagName('INPUT')[1].value, OTFRAC);\n var start = oRow.getElementsByTagName('INPUT')[1].value;\n\n if (start.length == '5') \n {\n \n var startHourInMin = parseInt(start.substring(0, 2), 10) * 60;\n var startMin = parseInt(start.substring(3, 5), 10);\n\n var workHoursInMin = parseFloat(oRow.getElementsByTagName('INPUT')[3].value, 10) * 60;\n\n var startTimeInMin = startHourInMin + startMin;\n\n var endTimeInMin = startTimeInMin + workHoursInMin;\n\n if (startTimeInMin >= breakStartMin && startTimeInMin < breakEndMin) \n {\n// var hour = ((startTimeInMin + breakMin) / 60).toString();\n// if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n// hour = hour.substring(0, hour.indexOf(\".\", 0));\n// var min = startTimeInMin % 60;\n\n// if (hour < 10)\n// hour = '0' + hour;\n\n// if (min < 10)\n// min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[1].value = breakEndTime;\n }\n \n\n if (endTimeInMin > breakStartMin && startHourInMin <= breakStartMin)\n endTimeInMin += breakMin;\n\n //convert minutes back to hour\n var hour = (endTimeInMin / 60).toString();\n if (hour.indexOf(\".\", 0) > 0) // convert hour into a whole number\n hour = hour.substring(0, hour.indexOf(\".\", 0));\n var min = endTimeInMin % 60;\n\n\n if (hour < 10)\n hour = '0' + hour;\n\n if (min < 10)\n min = '0' + min;\n\n oRow.getElementsByTagName('INPUT')[2].value = hour + ':' + min;\n \n\n var nRow = table.rows[position + 1];\n if (nRow != undefined) \n {\n nRow.getElementsByTagName('INPUT')[1].value = hour + ':' + min;\n\n// var start = nRow.getElementsByTagName('INPUT')[1].value;\n// var end = nRow.getElementsByTagName('INPUT')[2].value;\n\n// var startHour = parseInt(start.substring(0, 2), 10) * 60;\n// var startMin = parseInt(start.substring(3, 5), 10);\n// start = startHour + startMin;\n\n// var endHour = parseInt(end.substring(0, 2), 10) * 60;\n// var endMin = parseInt(end.substring(3, 5), 10);\n// end = endHour + endMin;\n\n// var workHours = (end - start) / 60;\n\n// nRow.getElementsByTagName('INPUT')[3].value = workHours;\n\n// if (workHours <= 0) {\n nRow.getElementsByTagName('INPUT')[2].value = '';\n nRow.getElementsByTagName('INPUT')[3].value = '';\n// }\n }\n }\n}", "function changeTime ( time, logout ) {\r\n __TIMER = time;\r\n __EXITM = logout;\r\n document.getElementsByClassName('toptime')[0].innerHTML = '</a> <div class=\"toptime\">Time remaining: <span>' + __TIMER + '</span> <a href=\"/logout\">[' + __EXITM + ']</a></div>';\r\n}", "ontimeout() {}", "function resetTime(){\n\t$(\"#time\").html(\"25:00\");\n}", "function handleInputTimeChange(event) {\n const { name, value } = event.target;\n setStartTime({ ...starttime, [name]: value });\n }", "function updateTime(time) {\n //console.log(time)\n transNetwork.activeTime = time;\n transNetwork.updateNet();\n\n powNetwork.activeTime = time;\n powNetwork.updateNet();\n\n table.activeTime = time;\n table.createTable();\n }", "function setTime() {\n // Create date instance\n var date = new Date();\n // Get hours and minutes and store in variables\n var hours = date.getHours(),\n minutes = date.getMinutes();\n // If number of minutes < 10, the time looks like this: 6:6. We want 6:06 instead, so add a 0\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n // Define elements where to put hours and minutes\n var $hoursElement = $('#time .time-hours'),\n $minutesElement = $('#time .time-minutes');\n // Put hours and minutes in the elements\n $hoursElement.text(hours);\n $minutesElement.text(minutes);\n }", "function setTimeDisplay(time) {\n if (time <= 12) {\n toDoHour = time + \"am\";\n } else {\n toDoHour = (time - 12) + \"pm\";\n }\n}", "setValue(new_value) {\n this.time = new_value;\n if (this._onChange) {\n const time = (this.time || '00:00').split(':');\n const date = dayjs__WEBPACK_IMPORTED_MODULE_4__(this.date)\n .hour(+time[0])\n .minute(+time[1])\n .startOf('m');\n this._onChange(date.valueOf());\n }\n }", "function setTime(value) {\n // console.log('value...', value, new Date(uwb_start + (value * 1000)).getTime())\n sliderValue.innerHTML = Math.floor(value);\n slider.value = Math.floor(value);\n layer.renderer = createRenderer(value);\n }", "get endTime() { return this.startTime.plus(this.duration); }", "function updateTime() {\n\t\tlet time = $(\"#time\").text();\n\t\tlet hour = parseInt(time.substring(0, 2));\n\t\tlet min = parseInt(time.substring(3, 5));\n\t\tmin += TIME_INTERVAL;\n\t\tif (min >= 60) {\n\t\t\thour += 1;\n\t\t\tmin -= 60;\n\t\t}\n\t\tif (min < 10) {\n\t\t\tmin = \"0\" + min;\n\t\t}\n\t\tif (hour < 10) {\n\t\t\thour = \"0\" + hour;\n\t\t}\n\t\tif (hour >= 24) {\n\t\t\thour -= 24;\n\t\t}\n\t\ttime = \"\" + hour + \":\" + min;\n\t\t$(\"#time\").text(time);\n\t}", "function setTime() {\n var minutes;\n\n if (status === \"Working\") {\n minutes = workMinutesInput.value.trim();\n } else {\n minutes = restMinutesInput.value.trim();\n }\n\n clearInterval(interval);\n totalSeconds = minutes * 60;\n}", "function setSecond() {\n\n $('#timepicker2').timepicker({\n timeFormat: 'HH:mm',\n minTime: '00:30',\n maxTime: '18:00',\n defaultTime: \"00:30\",\n dynamic: false,\n dropdown: true,\n scrollbar: false,\n change: function (time) {\n var hours = time.getHours()\n var minutes = time.getMinutes() / 30\n\n var totalCost = (hours * 10) + (minutes * 5)\n\n document.getElementById(\"cost\").value = \"$\" + totalCost + \".00\"\n\n\n }\n });\n}", "noon() {\n this.time.setHours(12);\n }", "morning() {\n this.time.setHours(4);\n }", "function updateTime() {\n\t\tvar dateTime = tizen.time.getCurrentDateTime(), secondToday = dateTime.getSeconds() + dateTime.getMinutes() * 60 + dateTime.getHours() * 3600,\n\t\tminDigitLeft = document.querySelector(\"#time-min-digit-left\"),\n\t\tminDigitRight = document.querySelector(\"#time-min-digit-right\"),\n\t\thourDigitLeft = document.querySelector(\"#time-hour-digit-left\"), \n\t\thourDigitRight = document.querySelector(\"#time-hour-digit-right\");\n\n\t\tvar minutesNow = (secondToday % 3600) / 60;\n\t\tvar hourNow = (secondToday / 3600);\n\t\tslideDigit(minDigitRight, minutesNow % 10.0);\n\t\tslideDigit(minDigitLeft, minutesNow / 10.0);\n\t\tslideDigit(hourDigitRight, hourNow % 10.0);\n\t\tslideDigit(hourDigitLeft, hourNow / 10.0);\n\t}", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "function updateTime() {\n\n}", "function updateTime(time) {\n domVideo.currentTime = time;\n}", "function setTime()\n {\n ++totalSeconds;\n $('#timer > #seconds').html(pad(totalSeconds%60));\n $('#timer > #minutes').html(pad(parseInt(totalSeconds/60)));\n }", "function syncTimeFields(parentTimesElt) {\n $(parentTimesElt).each(function () {\n var holder = $(this);\n\n //Times are displayed in duration mode (cocorico.times_display_mode: duration)\n if (holder.find(\"#time_range_nb_minutes\").length) {\n var $fromHour = holder.find(\"#time_range_start_hour\");\n var $fromMinute = holder.find(\"#time_range_start_minute\");\n var $toHour = holder.find(\"#time_range_end_hour\");\n var $toMinute = holder.find(\"#time_range_end_minute\");\n var $nbMinutes = holder.find(\"#time_range_nb_minutes\");\n\n $fromHour.add($fromMinute).add($nbMinutes).on(\"change\", function () {\n setEndTime($fromHour, $fromMinute, $toHour, $toMinute, $nbMinutes);\n });\n\n setEndTime($fromHour, $fromMinute, $toHour, $toMinute, $nbMinutes);\n }\n });\n}", "function SetTime() {\r\n let date = new Date();\r\n let time = (date.getHours()+1) + ':' + (date.getMinutes() < 10 ? '0' : '') + (date.getMinutes());\r\n \r\n document.querySelector('.order--timer').textContent = time;\r\n // console.log('updated at',time)\r\n setTimeout(SetTime, 60000);\r\n }", "function setStartTime(newStart) {\n if (newStart < 0 || newStart < (snipWin / 2)) {\n songStart = 0;\n songEnd = snipWin;\n } else {\n songStart = parseFloat(newStart) - (snipWin / 2);\n songEnd = Math.abs(songStart) + snipWin\n }\n}", "changeStartTime(startTime){\n this.startTime = startTime;\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function renderTimeLabel() {\n renderText(\"TIME\", \"end\", \"#FF0\", Frogger.drawingSurfaceWidth, Frogger.drawingSurfaceHeight);\n }", "function setTimeString(){\n let strEls = Toolbar.curTime.toUTCString().split(\":\");\n strEls.pop();\n Quas.getEl(\".post-publish-time-text\").text(strEls.join(\":\"));\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function timeChanged() {\n // if they clear the datetime value, reset the time and hide the keyboard on native\n if (!$scope.time.value) {\n setUpTime();\n\n if (window.Keyboard && window.Keyboard.hide) {\n Keyboard.hide();\n }\n }\n\n // update the time text and unix timestamo for this date\n var thisMoment = moment($scope.time.value);\n $scope.time.text = getTimeText(thisMoment);\n $scope.time.unix = thisMoment.unix();\n\n // show a message when the time selected is in the future\n $scope.future = isInTheFuture(thisMoment);\n }", "function setupTimer(end) {\n\t\tvar interval = setInterval(function() {\n\t\t\tvar now = moment.utc();\n\t\t\tif (now > end) {\n\t\t\t\t// time's up! reset ui elements\n\t\t\t\t$('#timer').text('Voting Over');\n\t\t\t\t$(\"#decisionbox\").html('');\n\t\t\t\tdisableVoteButtons();\n\t\t\t\tclearInterval(interval);\n\t\t\t} else {\n\t\t\t\tvar diff = end.diff(now, 'seconds');\n\t\t\t\t$('#timer').text(diff + ' seconds');\n\t\t\t}\n\t\t}, 1000);\n\t}", "function getTimefieldTimeBegin() {\n return parseFloat($('#clipBegin').timefield('option', 'value'));\n}", "function reset(){\n running = 0;\n time = 0;\n document.getElementById(\"start\").innerHTML = \"Start\";\n document.getElementById(\"output\").innerHTML = \"0:00:00\";\n var d1 = new Date();\n document.getElementById(\"end_time\").value = d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds();\n console.log(d1.getTime())\n console.log( d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds());\n console.log( d1.toUTCString())\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "chronoReset(){\n document.getElementById(\"chronotime\").innerHTML = \"00:00:000\";\n this.start = new Date();\n }", "checkEndValue(value) {\n // if end label smaller start label (14:00 < 18:00)\n if (this.state.endValue <= value) {\n // reset end label\n this.setState({ endValue: '' });\n this.setState({ expandedSec: false });\n // if end time exists ... reset the return timer\n if (this.state.endThis !== null) {\n this.state.endThis.resetTime();\n }\n } else {\n this.checkTimeS(value);\n }\n }", "function updateTime() {\n const newTime = new Date().toLocaleTimeString();\n setTime(newTime);\n }", "function updateTime() {\n let updatedTime = new Date().toLocaleTimeString();\n setTime(updatedTime);\n }", "function onTimeChange() {\r\n if(hr*60+min>=range[1]) {\r\n onHourChange();\r\n }\r\n else {\r\n updateTimer();\r\n } \r\n }", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "setTime(time) {\n this.time = time;\n return this;\n }", "function setTimeBlock() {\n timeBlock.each(function () {\n $thisBlock = $(this);\n var currentHour = d.getHours();\n var dataHour = parseInt($thisBlock.attr(\"dataHour\"));\n\n if (dataHour < currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"past\").removeClass(\"present\", \"future\");\n }\n if (dataHour == currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"present\").removeClass(\"past\", \"future\");\n }\n if (dataHour > currentHour) {\n $thisBlock.children(\"textarea\").addClass(\"future\").removeClass(\"past\", \"present\");\n }\n })\n\n }", "function setTime() {\n //increments timer\n ++totalSeconds;\n //temporarily stops timer at 5 seconds for my sanity\n if (totalSeconds === 59) {\n totalMinutes += 1;\n totalSeconds = 0;\n }\n\n //stops timer when game is won\n if (gameWon === true) {\n return;\n }\n //calls function to display timer in DOM\n domTimer();\n }", "function setUITime(input, dateElement, timeElement){\n\tinput.setTime(input.getTime() - input.getTimezoneOffset() * 60000);\n\tvar dateString = (input.getMonth() + 1) + \"-\" + input.getDate() + \"-\" + input.getFullYear();\n\t$(\"#\" + dateElement).datepicker('setDate', dateString);\n\tvar timeString = leadingZero(input.getHours()) + \":\" + leadingZero(input.getMinutes());\n\t$(\"#\" + timeElement).val(timeString);\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "function updateTime(e) {\n if (self.selectedDates.length === 0) {\n setDefaultTime();\n }\n\n if (e !== undefined && e.type !== \"blur\") {\n timeWrapper(e);\n }\n\n var prevValue = self._input.value;\n setHoursFromInputs();\n updateValue();\n\n if (self._input.value !== prevValue) {\n self._debouncedChange();\n }\n }", "function resetTime() {\n maxTimeInMs = Math.round(timeMax/1000);\n timeSlider.attr('max', maxTimeInMs);\n timeSlider.attr('value', maxTimeInMs);\n $(\"#timeRange\").val(maxTimeInMs)\n updateTimeLabel(formatToMinuteSecond(timeMax));\n //timeSlider.attr(\"visibility\", \"hidden\");\n}", "function timeGo(){\n\t\t\tvar dateNow=new Date();\n\t\t\tvar arr=adddate(dateNow,dateEnd);\n\t\t\tfor (var i=0;i<arr.length;i++) {\n\t\t\t\tarr[i] = arr[i] < 10 ? '0'+arr[i]:arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tvar txt=arr[0]+\"天\"+arr[1]+\"小时\"+arr[2]+\"分\"+arr[3]+\"秒\";\n\t\t\t$('.timeRest b').text(txt);\n\t\t\t\n\t\t\tif(dateNow.getTime() >= dateEnd.getTime()){\n\t\t\t\tclearInterval(iCount);\n\t\t\t\tarr = [00,00,00,00];\n\t\t\t\t$('.timeRest').html(\"<p>众筹已结束</p><p>十月遵义不见不散</p>\").css(\"color\",\"red\").css(\"font-weight\",\"bolder\");\n\t\t\t}\n\t\t}", "function changeTime(newTime) {\n if (isDead)\n\treturn;\n if (participantRole == \"Villager\") {\n\tchangeAVStatusForNewTime(newTime);\n//\tif (newTime == \"Day\")\n//\t timeout = setTimeout(\"voteForSelfToDie()\", 60000);\n }\n getNumberOfLiveMafia();\n timeOfDay = newTime;\n}", "function handleTimePickerVolta(time, inst) {\n if (_timeReturnSelected) {\n _dataRetorno = new Date(_dataRetorno.getFullYear(), _dataRetorno.getMonth(), _dataRetorno.getDate(), inst.hours, inst.minutes);\n };\n _timeReturnSelected = false;\n}", "function setTime(){\n var myDate = new Date();\n var heure = myDate.getHours();\n var minute = myDate.getMinutes(); \n if(heure < 10){ \n heure = \"0\"+ heure.toString();\n } \n if(minute < 10){\n minute = \"0\"+ minute.toString();\n }\n\n return heure.toString() +\":\"+ minute.toString(); \n }", "set displayTime(time) {\n this._timeEl.innerHTML = time;\n }", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function reset1(){\n running = 0;\n time = 0;\n document.getElementById(\"start1\").innerHTML = \"Start\";\n document.getElementById(\"output1\").innerHTML = \"0:00:00\";\n var d1 = new Date();\n document.getElementById(\"end_time1\").value = d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds();\n console.log(d1.getTime())\n console.log( d1.getUTCHours() +\" : \"+ d1.getUTCMinutes() +\" : \"+ d1.getUTCSeconds());\n console.log( d1.toUTCString())\n}", "function handleTimePicker(time, inst) {\n\tif (_timeSelected) {\n\t\t_dataChegada = new Date(_dataChegada.getFullYear(), _dataChegada.getMonth(), _dataChegada.getDate(), inst.hours, inst.minutes);\n\t};\n\t_timeSelected = false;\n}" ]
[ "0.6944746", "0.6912715", "0.68328804", "0.6588861", "0.65853816", "0.65724087", "0.65648", "0.65302044", "0.64314586", "0.63855743", "0.63351274", "0.6267155", "0.62645155", "0.62510645", "0.62456816", "0.6239142", "0.62227875", "0.62070245", "0.6161373", "0.6156201", "0.61280364", "0.61099213", "0.6075756", "0.6065587", "0.6039598", "0.60034364", "0.60000104", "0.5998696", "0.5998028", "0.59709203", "0.59690857", "0.5964379", "0.59187317", "0.5901081", "0.58950406", "0.5888413", "0.5880411", "0.58796227", "0.587341", "0.5872768", "0.58678734", "0.586697", "0.5854655", "0.58497155", "0.5846632", "0.58461535", "0.5845031", "0.5825861", "0.58236337", "0.58205265", "0.58124506", "0.58044094", "0.5801885", "0.5793616", "0.57871324", "0.57818186", "0.57742685", "0.5757225", "0.5752542", "0.57521975", "0.5750095", "0.57475704", "0.5746226", "0.5744763", "0.57412034", "0.57361823", "0.57323104", "0.57323104", "0.57323104", "0.57323104", "0.57284826", "0.5721812", "0.5718189", "0.57165354", "0.57158715", "0.5714512", "0.571392", "0.57122254", "0.57122254", "0.5710286", "0.5702877", "0.56989074", "0.5695418", "0.56946546", "0.56902283", "0.568797", "0.5686946", "0.56708044", "0.56693715", "0.5668838", "0.5665639", "0.5660717", "0.5658806", "0.56475645", "0.56466687", "0.56437624", "0.564099", "0.5633942", "0.562786", "0.5622003" ]
0.79997814
0
helper return all strings in str starting with startStr and ending with endStr
function getAllStringsOf(str, startStr, endStr) { var result = new Array(); var strCpy = str; while ((strCpy.indexOf(startStr) != -1) && (strCpy.indexOf(endStr) != -1)) { var tmp = strCpy.substring(strCpy.indexOf(startStr), strCpy.indexOf(endStr) + endStr.length); if (tmp && (tmp != "")) { result[result.length] = tmp; } strCpy = strCpy.substring(str.indexOf(endStr) + endStr.length, strCpy.length); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function substringByStartAndEnd(input, start, end) {}", "function between(string, start, end){\n var startAt = string.indexOf(start) + start.length;\n var endAt = string.indexOf(end, startAt);\n \n return string.slice(startAt, endAt);\n}", "function substring(str, start, end) {\n var result = '';\n var temp;\n\n if (end === undefined) end = str.length;\n start = fixIndex(str, start);\n end = fixIndex(str, end);\n if (start > end) {\n temp = end;\n end = start;\n start = temp;\n }\n\n for (; start < end; start++) {\n result += str[start];\n }\n\n return result;\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function substring(str, startIdx, endIdx = startIdx) {\n let results = \"\";\n\n for (let idx = startIdx; idx <= endIdx; idx += 1) {\n if (idx > str.length - 1) break;\n results += str[idx];\n }\n\n return results;\n}", "function SubstringMe(str,start, end){\r\n\r\n return str.substring(start,end);\r\n\r\n\r\n\r\n }", "function pgp_substringSearch(string, stringStart, stringEnd, bIncluding){\r\n\t//opt params\r\n\tif(arguments.length<4)\tbIncluding=false;\r\n\tvar start = string.indexOf(stringStart) + stringStart.length;\r\n\tif(arguments.length<3)\t{\r\n\t\tvar end = string.length-1;\r\n\t} else {\r\n\t\tvar end = string.indexOf(stringEnd, start);\r\n\t\tif(bIncluding)\tend+=stringEnd.length;\r\n\t}\r\n\tif(bIncluding)\tstart-=stringStart.length;\r\n\treturn string.substring(start, end);\r\n}", "static between($str, $start, $end, $fromEnd = false)\n {\n let $length, $index;\n\n $str = ' ' + $str;\n $index = $str.indexOf($start);\n\n if ($index == 0) {\n return '';\n }\n\n $index += $start.length;\n $length = $fromEnd\n ? $str.substr($index).lastIndexOf($end)\n : $str.indexOf($end, $index) - $index;\n\n return $str.substr($index, $length);\n }", "function substringsAtStart(str) {\n // define the reducer method to return strings\n var reducer = (accumulator, currentEl) => accumulator + currentEl;\n // split string into array\n var strArr = str.split('');\n // return a new array of substrings\n var substringArr = [];\n for (i = 0; i < strArr.length; i++) {\n // push each substring into the new array\n // each element of the new array is made up of substring sets put together\n // each subset of characters is pulled from the broken array and then put back together through the reducer method\n substringArr.push(strArr.slice(0, i+1).reduce(reducer));\n }\n return substringArr;\n}", "function substring(string, start, end) {\n var newString = \"\",\n temp;\n\n if (end === undefined) {\n end = string.length;\n }\n\n if (start < 0 || isNaN(start)) {\n start = 0;\n }\n\n if (end < 0 || isNaN(end)) {\n end = 0;\n }\n\n if (start > end) {\n temp = start;\n start = end;\n end = temp;\n }\n\n if (start > string.length) {\n start = string.length;\n }\n\n if (end > string.length) {\n end = string.length;\n }\n\n if (start === end) {\n return \"\";\n }\n\n for (var i = start; i < end; i++) {\n newString += string[i];\n }\n\n return newString;\n}", "function getSubset(start, stop) {\n\tvar inputString = input.value;\n\tvar startPoint = inputString.indexOf(start) + start.length;\n\tvar afterStart = inputString.substring(startPoint);\n\tvar stopPoint = afterStart.indexOf(stop) + startPoint;\n\tvar output = inputString.substring(startPoint, stopPoint);\n\toutput = output.replace(/\\s+/g, \" \");//removes extra spaces\n\treturn output;\n\n}", "function substringByStartAndLength(input, start, length) {}", "function extractStringBetween(str, prefix, suffix) {\n try {\n \tlet i = str.indexOf(prefix);\n \tif (i >= 0) {\n \t\tstr = str.substring(i + prefix.length);\n \t}\n \telse {\n \t\treturn '';\n \t}\n \tif (suffix) {\n \t\ti = str.indexOf(suffix);\n \t\tif (i >= 0) {\n \t\t\tstr = str.substring(0, i);\n \t\t}\n \t\telse {\n \t\t return '';\n \t\t}\n \t}\n }\n catch(err) {\n logException('extractStringBetween', err.message);\n }\n\treturn str;\n}", "function startWith(string1, string2){\n return string1.slice(0, string2.length) == string2;\n}", "function sc_substring(s, start, end) {\n return s.substring(start, (!end || end < 0) ? s.length : end);\n}", "function substrings(str) {\n let result = [];\n str.split(\"\").forEach((_, idx) => {\n result = result.concat(substringsAtStart(str.slice(idx)));\n });\n return result;\n}", "function slice(str, start, end) {\n return Array.from(str).slice(start, end).join('');\n }", "substring(start, end) {\n start = Math.max(this.start, start)\n end = Math.min(this.end, end)\n return this.input.substring(start,end)\n }", "function beginsWithStr(s1,s2)\r\n{\r\nreturn s1.slice(0,s2.length) == s2;\r\n}", "substring(start,end) { return this.input.substring(start,end) }", "function extract(text, start, end, endIsOptional = true, inclusive = false) {\n let from = 0;\n let to = 0;\n if (start) {\n from = text.indexOf(start);\n if (from === -1) {\n throw new StringExtractException(`${start} not found`);\n }\n if (!inclusive) {\n from += start.length;\n }\n }\n if (!end) {\n return text.substring(from);\n }\n to = text.indexOf(end, from);\n if (to === -1) {\n if (endIsOptional) {\n return text.substring(from);\n }\n throw new StringExtractException(`${end} not found`);\n } else if (inclusive) {\n to += end.length;\n }\n return text.substring(from, to);\n}", "function substringsAtStart(string) {\n return string.split('').map(function (char, i) {\n return string.slice(0, i + 1)\n });\n}", "function substring(str, start, end) {\n\tstart = start || 0;\n\tstr = str || 'default';\n\tend = end || str.length;\n\t// function code\n\tconsole.log(str);\n}", "match(input, start, end) {\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if( !this.startsWith(input.get(start)) )\n return this.error(input, start, start+1)\n var n = end\n end=start+1\n while(end<n && this.startsWith(input.get(end))) end++\n return this.token(input,start,end,\" \")\n }", "function substrings(str) {\n let result = [];\n for (let idx = 0; idx < str.length; idx++) {\n for ( let jdx = idx + 1; jdx <= str.length; jdx++) {\n result.push(str.slice(idx, jdx));\n }\n}\n return result;\n}", "function substring(str, startIdx, endIdx = startIdx) {\n return str.slice(startIdx, endIdx + 1);\n}", "function substring(str, start, end) {\n\treturn str == null ? null : end === undefined ? String(str)\n\t\t\t.substring(start) : String(str).substring(start, end);\n}", "function sc_stringContains(s1,s2,start) {\n return s1.indexOf(s2,start ? start : 0) >= 0;\n}", "function substringsAtStart(string) {\n let substrings = [];\n for (let idx = 1; idx <= string.length; idx += 1) {\n substrings.push(string.slice(0, idx));\n }\n return substrings;\n}", "function substringsAtStart(string) {\n let substrings = [];\n for (let idx = 1; idx <= string.length; idx += 1) {\n substrings.push(string.slice(0, idx));\n }\n return substrings;\n}", "function startsWith(str, substr) {\n return str.indexOf(substr) === 0;\n}", "function startsWith(src, str) {\n return src.slice(0, str.length) === str\n }", "function startsWith(src, str) {\n return src.slice(0, str.length) === str\n}", "function startsWithIgnoringCase(string, value, start) {\n for (var i = 0, n = value.length; i < n; i++) {\n var ch1 = toLowerCase(string.charCodeAt(i + start));\n var ch2 = value.charCodeAt(i);\n if (ch1 !== ch2) {\n return false;\n }\n }\n return true;\n }", "function allAboutStrings(str) {\n const length = str.length;\n const firstChar = str.charAt(0);\n const secondChar = str.charAt(1);\n const lastChar = str.charAt(length -1);\n const middle = function() {\n return length % 2 === 0 ? str.slice(length / 2 - 1, length / 2 + 1) : str[Math.floor(length / 2)]\n }\n const index = function() {\n const indexOfChar = str.indexOf(secondChar, 2)\n return indexOfChar > -1 ? `@ index ${indexOfChar}` : 'not found'\n }\n return [length, firstChar, lastChar, middle(), index()]\n}", "function startsWith (substr) {\n\treturn this.lastIndexOf(substr, 0) === 0\n}", "match(input, start, end){}", "_startWith (string, prefix) {\n if (typeof string != 'string') {\n return false;\n\n } else {\n for (var i = 0, length = prefix.length; i < length; i += 1) {\n var p = prefix[i];\n var s = string[i];\n if (p !== s) {\n return false;\n }\n }\n }\n return true;\n }", "function substrings(str) {\r\n let result = [];\r\n let startingIndex = 0;\r\n while (startingIndex <= str.length - 2) {\r\n let numChars = 2;\r\n while (numChars <= str.length - startingIndex) {\r\n let substring = str.slice(startingIndex, startingIndex + numChars);\r\n result.push(substring);\r\n numChars += 1;\r\n }\r\n startingIndex += 1;\r\n }\r\n return result;\r\n}", "function startsWith(str, start) {\n var tr = str;\n\n if (tr.toLowerCase().startsWith(start)) {\n tr = str + 'pe';\n }\n\n return tr;\n}", "function startsWith(str, pattern){\n\treturn str.lastIndexOf(pattern, 0) === 0\n}", "function testStartsEndsWith(callback)\n{\n\ttesting.assert('pepito'.startsWith('pe'), 'Failed to match using startsWith()', callback);\n\ttesting.assert(!'pepito'.startsWith('po'), 'Invalid match using startsWith()', callback);\n\ttesting.assert('pepito'.endsWith('to'), 'Failed to match using endsWith()', callback);\n\ttesting.assert(!'pepito'.startsWith('po'), 'Invalid match using endsWith()', callback);\n\ttesting.success(callback);\n}", "function solution(str, ending){\n // TODO: complete\n return str.endsWith(ending)\n}", "function getDates( dateStr ){\n var re = /\\s*(?:to|$)\\s*/;\n var dates = dateStr.split(re);\n var start = new Date( dates[0] );\n if (dates.length >1 ) {\n var end = new Date( dates[1] ); } else {var end= null; }\n\n return{ startDate: start, endDate: end };\n}", "function starts_with(str, prefix) {\n\t\treturn str.lastIndexOf(prefix, 0) === 0;\n\t}", "function substring(string1, string2){\n let pattern = \"\";\n for(let i = 0; i < string1.length; i++){\n pattern += string1[i];\n }\n for(let i = 0; i < string2.length; i++){\n if(string2.includes(pattern)){\n return true;\n }\n }\n return false;\n}", "function stringBetween(string, substring1, substring2) {\r\n\tvar first_index = string.indexOf(substring1);\r\n\treturn string.substring(first_index + substring1.length, string.indexOf(substring2, first_index));\r\n}", "function startsWith(str, pattern) {\n return str.slice(0, pattern.length) == pattern\n}", "function includesSubstr(str1, str2) {\n return str1.includes(str2)\n}", "function isSubstring(s1, s2) {\r\n return s1.includes(s2);\r\n}", "function strBeginsWith(str, prefix) {\n return str.indexOf(prefix) === 0;\n}", "function xStrStartsWith( s, beg )\r\n{\r\n if( !xStr(s,beg) ) return false;\r\n var l = s.length;\r\n var r = beg.length;\r\n if( r > l ) return false;\r\n if( r == l ) return s.substring( 0, r ) == beg;\r\n return s == beg;\r\n}", "function leadingSubstrings(string) {\n let result = [];\n for (let length = 1; length <= string.length; length += 1) {\n result.push(string.slice(0, length))\n }\n return result\n}", "function searchAll(str, search, substr = null, resultArr = []){\n const result = substr ? substr.search(search) : str.search(search);\n if(result === -1) {return resultArr}\n // difference is used to account for the decreasing length of the substring when computing the index\n const difference = substr ? str.length - substr.length : 0;\n // the next search will start right after the starting position of the current match instead of the last position like in String.matchAll\n const slicedStr = str.slice(result + difference + 1);\n return searchAll(str, search, slicedStr, [...resultArr, result + difference])\n}", "function getSubStr(str, a, b) {\n var ai = -1;\n var bi = -1;\n for (var i = 0; i < str.length; i++) {\n\n if (ai == -1 && str[i] == a) {\n ai = i;\n }\n else if (bi == -1 && str[i] == b) {\n bi = i;\n break;\n }\n }\n if (ai != -1 && bi != -1) {\n var retStr = str.substring(ai + 1, bi);\n return retStr;\n }\n return null;\n}", "function strStartsWith(str, prefix)\n{\n if(typeof str != \"string\")\n {\n return false;\n }\n return str.indexOf(prefix) === 0;\n}", "function sliceIt(string,start,end){\n console.log(string.slice(start,end));\n console.log(string)\n}", "function startWith(str) {\n var j = 0, count = str.length;\n for (; j < count; j++) {\n if (tpl.charAt(i + j) !== str.charAt(j)) {\n return false;\n }\n }\n return true;\n }", "function leadingSubstrings(inputString) {\n let outputArray = [];\n\n for (let char = 1; char <= inputString.length; char += 1) {\n outputArray.push(inputString.substring(0, char));\n }\n\n return outputArray;\n}", "function substrMe(str,start,length){\r\n \r\n return str.substr(start,length);\r\n\r\n }", "function getSubstr(strSource,intStartPosition,intOverPosition,cPosition)\r\n{\r\n\tvar strTarget = \"\";\r\n\tvar cTemp = \"\";\r\n\tvar intLoop = 0;\r\n\tvar intCount = 0;\r\n\ttry\r\n\t{\r\n\t strSource = trim(strSource);\r\n\t\tintCount = strSource.length;\r\n\t\tif (intStartPosition>intCount) intStartPosition = intCount;\r\n\t\tif (intOverPosition>intCount) intOverPosition = intCount;\r\n\t\tif (cPosition==null)\r\n\t\t{\r\n\t\t\tstrTarget = strSource.substring(intStartPosition,intOverPosition);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t if (intStartPosition<=intOverPosition)\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition;intLoop<intOverPosition;intLoop++)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = strTarget + cTemp;\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tfor (intLoop=intStartPosition-1;intLoop>intOverPosition;intLoop--)\r\n\t\t\t\t{\r\n\t\t\t\t\tcTemp = strSource.substr(intLoop,1);\r\n\t\t\t\t\tif (cTemp==cPosition) break;\r\n\t\t\t\t\telse strTarget = cTemp+strTarget;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t}\r\n\treturn strTarget;\r\n}", "function startsWith(str, prefix)\n{\n return (str.substr(0, prefix.length) == prefix);\n}", "function xBeforeYOnTheRight(str, startingIdx, x, y) {\n for (var i = startingIdx, len = str.length; i < len; i++) {\n if (str.startsWith(x, i)) {\n // if x was first, Bob's your uncle, that's truthy result\n return true;\n }\n\n if (str.startsWith(y, i)) {\n // since we're in this clause, x failed, so if y matched,\n // this means y precedes x\n return false;\n }\n } // default result\n\n\n return false;\n}", "function solution(str, ending){\n return str.endsWith(ending);\n}", "function solution(str, ending){\n return str.endsWith(ending);\n}", "function sc_stringCIContains(s1,s2,start) {\n return s1.toLowerCase().indexOf(s2.toLowerCase(),start ? start : 0) >= 0;\n}", "function solution(str, ending){\n return str.endsWith(ending)\n}", "function solution(str, ending){\n return str.endsWith(ending);\n }", "function startsWith(str, prefix) {\n\t str = toString(str);\n\t prefix = toString(prefix);\n\n\t return str.indexOf(prefix) === 0;\n\t }", "function get_shared_start(strs) {\n\tif (strs.length <= 1) return ''\n\n\tconst A = [...strs].sort()\n\tconst a1 = A[0]\n\tconst a2 = A[A.length - 1]\n\tconst L = a1.length\n\n\tlet i = 0\n\twhile (i < L && a1.charAt(i) === a2.charAt(i)) { i++ }\n\n\treturn a1.substring(0, i)\n}", "function allWithPro (arr,substr) {\n return arr.filter(function(element) { \n return element.toLowerCase().startsWith(substr);\n })\n}", "function verifySubstrs(mainStr, head, body, tail) {\n if(mainStr.startsWith(head) && mainStr.includes(body) && mainStr.endsWith(tail)){\n return 'My head, body, and tail.';\n }\n return 'Incomplete.'\n}", "function range_letters(start, end){\n if(start.charCodeAt(0) === end.charCodeAt(0)) return [start]\n return [start, ...range_letters(String.fromCharCode(start.charCodeAt(0)+1),end)];\n}", "function startsWith(haystack, needle) {\n if (haystack.length < needle.length) {\n return false;\n }\n for (var i = 0; i < needle.length; i++) {\n if (haystack[i] !== needle[i]) {\n return false;\n }\n }\n return true;\n}", "function substr(str, start, end) {\n\treturn str == null ? null : end === undefined ? String(str)\n\t\t\t.substr(start) : String(str).substr(start, end);\n}", "function getToAndFrom(str, ind) {\r\n const m = str.match(/^Step (.) must be finished before step (.) can begin\\.$/);\r\n return [m[1], m[2]];\r\n}", "function isSubstring(str1, str2) {\n // check to see if str2 is a subtring of str1\n return str1.includes(str2);\n}", "function solution(str, ending){\n return ending === str.substring(str.length - ending.length)\n}", "function stringStartsWith(str, prefix) {\r\n // returns false for empty strings too\r\n if ((!str) || !prefix) return false;\r\n return str.indexOf(prefix, 0) === 0;\r\n }", "function solution(str, ending) {\n return str.endsWith(ending);\n}", "match(input, start, end){\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if(!this.startsWith(input.get(start)))\n return this.error(input,start,start+1)\n var n=end\n end=start+1\n while(end<n && this.valid(input.get(end))) end++\n var s = (this.useStarter)?start+1:start\n var m = (end-s)%4\n if(s==end || m==1) return this.error(input,start,end)\n if(m>0) {\n while(end<n && m<4 && input.get(end)=='=') {\n end++\n m++\n }\n if(m<4) return this.error(input,start,end)\n }\n return this.token(input,start,end,Base64.decode(input.substring(s,end)))\n }", "strHasPrefix (str, prefix) {\n if (str && prefix && str.indexOf(prefix) === 0) {\n return true;\n }\n\n return false;\n }", "function startswith (string, prefix)\n{\n\treturn string.indexOf(prefix) == 0;\n}", "function split(str, substrings) {\n var parts = []\n substrings.map(function(sub, i) {\n\n // push matched expression and part before it\n i = str.indexOf(sub)\n parts.push(str.slice(0, i), sub)\n str = str.slice(i + sub.length)\n })\n\n // push the remaining part\n return parts.concat(str)\n }", "function dictionary(str, arr) {\n const result = [];\n for (let i = 0; i < arr.length; i++) {\n if (arr[i].startsWith(str)) {\n result.push(arr[i]);\n }\n }\n return result;\n}", "function startsWith(stringA, stringB, position) {\n\t\t\tposition = position || 0;\n\t\t\treturn stringA.indexOf(stringB, position) === position;\n\t\t}", "generate_ip_range(range) {\n var result = [];\n\n // split range and determine prefix and range\n var pos = range.lastIndexOf(\".\");\n var prefix = range.substr(0, pos);\n var rng = range.substr(pos + 1);\n\n // split the range and determine first and last index\n var parts = rng.split(\"-\");\n var first = parseInt(parts[0], 10);\n var last = parseInt(parts[1], 10);\n\n // construct the result\n for (var index = first; index <= last; index++) {\n result.push(prefix + \".\" + index);\n }\n\n // completed\n return result;\n }", "function split(str, substrings) {\n var parts = [];\n substrings.map(function (sub, i) {\n // push matched expression and part before it\n i = str.indexOf(sub);\n parts.push(str.slice(0, i), sub);\n str = str.slice(i + sub.length)\n });\n if (str)\n parts.push(str);\n // push the remaining part\n return parts\n }", "function find(s, sub, start = 0, end = undefined) {\n if (!s || !sub) {\n return -1;\n }\n\n return s.slice(start, end).search(escapeRegExp(sub));\n}", "function _getDateRange(dateStr, granularity) {\n var start = new Date(dateStr);\n var end = new Date(dateStr);\n\n switch (granularity) {\n case 'year':\n end.setUTCFullYear(end.getUTCFullYear() + 1);\n break;\n case 'month':\n end.setUTCMonth(end.getUTCMonth() + 1);\n break;\n case 'day':\n end.setUTCDate(end.getUTCDate() + 1);\n break;\n }\n return {\n inclusiveStart: start,\n exclusiveEnd: end\n };\n}", "match(input, start, end) {\n start = start || 0\n end = end || input.length\n if(typeof input === 'string') input = new Source(input)\n if(this.startsWith(input.get(start)))\n return this.token(input,start,start+1,input.get(start))\n else \n return this.error(input,start,start+1)\n }", "function getBetween(doc, start, end) {\n\t\t var out = [], n = start.line;\n\t\t doc.iter(start.line, end.line + 1, function (line) {\n\t\t var text = line.text;\n\t\t if (n == end.line) { text = text.slice(0, end.ch); }\n\t\t if (n == start.line) { text = text.slice(start.ch); }\n\t\t out.push(text);\n\t\t ++n;\n\t\t });\n\t\t return out\n\t\t }", "function split(str, substrings) {\n var parts = []\n substrings.map(function(sub, i) {\n\n // push matched expression and part before it\n i = str.indexOf(sub)\n parts.push(str.slice(0, i), sub)\n str = str.slice(i + sub.length)\n })\n if (str) parts.push(str)\n\n // push the remaining part\n return parts\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function getBetween(doc, start, end) {\n var out = [], n = start.line\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text\n if (n == end.line) { text = text.slice(0, end.ch) }\n if (n == start.line) { text = text.slice(start.ch) }\n out.push(text)\n ++n\n })\n return out\n}", "function stringStartsWith(string, prefix) {\n return string.slice(0, prefix.length) == prefix;\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }", "function getBetween(doc, start, end) {\n var out = [], n = start.line;\n doc.iter(start.line, end.line + 1, function (line) {\n var text = line.text;\n if (n == end.line) { text = text.slice(0, end.ch); }\n if (n == start.line) { text = text.slice(start.ch); }\n out.push(text);\n ++n;\n });\n return out\n }" ]
[ "0.77393335", "0.6890976", "0.68833405", "0.68177956", "0.68177956", "0.6675158", "0.641572", "0.64070594", "0.6401717", "0.63012564", "0.6281236", "0.62812346", "0.6237426", "0.62294114", "0.62258595", "0.6225195", "0.62236726", "0.6216225", "0.61335677", "0.61140746", "0.61026555", "0.6002797", "0.5948877", "0.5880476", "0.58729637", "0.58675224", "0.58664745", "0.58465266", "0.5842198", "0.5842198", "0.5839115", "0.5834635", "0.58156407", "0.5791816", "0.5789113", "0.57711875", "0.57161283", "0.57052994", "0.5700452", "0.5664833", "0.5658827", "0.5633213", "0.5631503", "0.5616047", "0.56049335", "0.560356", "0.5590553", "0.55476", "0.5531521", "0.55025446", "0.5497911", "0.5496817", "0.5492618", "0.54925495", "0.5482083", "0.5462305", "0.5458988", "0.5451063", "0.5438956", "0.5431441", "0.54282314", "0.5407215", "0.54014057", "0.5401366", "0.5401366", "0.53975415", "0.5382541", "0.5377659", "0.536716", "0.5366736", "0.5366676", "0.53585905", "0.5357709", "0.5357411", "0.53367734", "0.5319739", "0.53181285", "0.52922314", "0.5287955", "0.5276853", "0.52767664", "0.5273953", "0.52736425", "0.5273405", "0.5265825", "0.525574", "0.52522856", "0.5246528", "0.52432674", "0.52427584", "0.5234608", "0.5221929", "0.52177316", "0.52066445", "0.52066445", "0.5200764", "0.51982105", "0.51982105", "0.51982105", "0.51982105" ]
0.7948158
0
formatting a time string to hh:MM:ss.mm
function formatTime(seconds) { if (typeof seconds == "string") { seconds = parseFloat(seconds); } var h = "00"; var m = "00"; var s = "00"; if (!isNaN(seconds) && (seconds >= 0)) { var tmpH = Math.floor(seconds / 3600); var tmpM = Math.floor((seconds - (tmpH * 3600)) / 60); var tmpS = Math.floor(seconds - (tmpH * 3600) - (tmpM * 60)); var tmpMS = seconds - tmpS; h = (tmpH < 10) ? "0" + tmpH : (Math.floor(seconds / 3600) + ""); m = (tmpM < 10) ? "0" + tmpM : (tmpM + ""); s = (tmpS < 10) ? "0" + tmpS : (tmpS + ""); ms = tmpMS + ""; var indexOfSDot = ms.indexOf("."); if (indexOfSDot != -1) { ms = ms.substr(indexOfSDot + 1, ms.length); } ms = ms.substr(0, 2); while (ms.length < 2) { ms += "0"; } } return h + ":" + m + ":" + s + "." + ms; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function formatTime(time) {\n if (time == -1) { return \"N/A\" }\n time = +time;\n let cs = time % 1000;\n let s = time % (1000 * 60) - cs;\n let m = time - s - cs;\n\n // Since the values returned above is suffixed\n // we have to divide afterwards\n cs = Math.floor(cs / 10);\n s = Math.floor(s / 1000);\n m = Math.floor(m / (1000 * 60));\n\n return (m > 0 ? m + \":\" : \"\") + (s < 10 && m > 0 ? \"0\" + s : s) + \".\" + (cs < 10 ? \"0\" + cs : cs);\n}", "function format_time(t) {\n var mins = Math.floor(t / 60);\n var secs = Math.floor(t) % 60;\n var out = \"\";\n \n if (secs < 10)\n out = mins + \":0\" + secs;\n else\n out = mins + \":\" + secs; \n \n return out; \n}", "function formatTime(tm) {\r\n\tvar str = (Math.floor(tm / 1000)).toString(10);\r\n\tvar d = Math.floor((tm % 1000) / 100);\r\n\treturn str + \".\" + d;\r\n}", "function formatTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = time % 60;\n\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n\n return `${minutes}:${seconds}`;\n}", "function formatTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = time % 60;\n \n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n \n return `${minutes}:${seconds}`;\n}", "function timeSetFormat(time){\r\n let tempArr = time.split(\":\");\r\n for(var i=0; i<tempArr.length; i++){\r\n tempArr[i] = +tempArr[i];\r\n }\r\n tempArr = roundTime(tempArr);\r\n\r\n //reformat by adding starting 0's\r\n if(tempArr[1] == '0'){\r\n tempArr[1] = '00';\r\n }\r\n if(tempArr[0] < 10){\r\n tempArr[0] = '0' + tempArr[0];\r\n }\r\n\r\n tempArr = tempArr.join(':');\r\n return tempArr;\r\n}", "function formatTime(time){\n\ttime = Math.round(time);\n\n\tvar minutes = Math.floor(time / 60),\n\t\tseconds = time - minutes * 60;\n\n\tseconds = seconds < 10 ? '0' + seconds : seconds;\n\n\treturn minutes + \":\" + seconds;\n}", "function formattedTime(time) {\n let mins = 0;\n let seconds = 0;\n mins = Math.floor(time/60)\n seconds = time%60\n if (String(mins).length<2) mins=\"0\"+String(mins)\n if (String(seconds).length<2) seconds=\"0\"+String(seconds)\n return `${mins}:${seconds}`\n}", "function fancyTimeFormat(time)\n{ \n // Hours, minutes and seconds\n var hrs =Math.floor(time / 3600);\n var mins = Math.floor((time % 3600) / 60);\n var secs = time % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function formatTime(s) {\n var i = 2;\n var a = new Array();\n do {\n a.push(s.substring(0, i));\n } while((s = s.substring(i, s.length)) != \"\");\n return a.join(':');\n }", "function formatTime (time) {\n const hours = Math.floor(time / 3600)\n let mins = Math.floor((time - hours * 3600) / 60)\n let secs = Math.floor(time - (hours * 3600) - (mins * 60))\n\n if (secs < 10) secs = '0' + secs\n\n if (hours > 0) {\n if (mins < 10) mins = '0' + mins\n return hours + ':' + mins + ':' + secs\n } else {\n return mins + ':' + secs\n }\n}", "function fancyTimeFormat(time)\r\n\t\t{ \r\n \t\tvar hrs = ~~(time / 3600);\r\n \t\tvar mins = ~~((time % 3600) / 60);\r\n \t\tvar secs = time % 60;\r\n\t\t\tvar ret = \"\";\r\n \t\tif (hrs > 0) {\r\n \tret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\r\n \t\t}\r\n \t\tret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\r\n \t\tret += \"\" + secs;\r\n \t\treturn ret;\r\n\t\t}", "function formatTime (t) {\n if (isNaN(t)) return ('');\n var m = Math.floor(t/60/1000),\n s = Math.floor(t/1000 - m * 60);\n\n return m + ':' + (s > 9 ? s : '0' + s);\n}", "function formatTime(time) {\n const secconds = parseInt(time % 60);\n const minute = parseInt(time / 60);\n\n return (minute < 10 ? '0' : '') + minute + (secconds < 10 ? ':0' : ':') + secconds;\n}", "function formatTimeString(h, m, s) {\n m = checkTime(m);\n s = checkTime(s);\n\n return h + \":\" + m + \":\" + s;\n}", "function formatTime(val) {\n var a = new Number(val.substring(0,val.indexOf(\":\")));\n if (a > 12) {\n a -= 12;\n }\n var b = val.substring(val.indexOf(\":\"),val.length);\n return a + b;\n}", "formatTime(time) {\n var sec_num = parseInt(time, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\" + hours; }\n if (seconds < 10) { seconds = \"0\" + seconds; }\n return (hours < 1 ? '' : hours + ':') + (minutes < 1 ? '0:' : minutes + ':') + seconds;\n }", "function formatTime(time) {\n // The largest round integer less than or equal to the result of time divided being by 60.\n const minutes = Math.floor(time / 60);\n // Seconds are the remainder of the time divided by 60 (modulus operator)\n let seconds = time % 60;\n // If the value of seconds is less than 10, then display seconds with a leading zero\n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n // The output in MM:SS format\n return `${minutes}:${seconds}`;\n}", "formatTime(n) {\n if ((n + '').length > 2) {\n\treturn n;\n }\n const padding = new Array(2).join('0');\n return (padding + n).slice(-2);\n }", "function formatTime(time) {\n // converts the time in hours\n var hours = Math.floor(time / (1000 * 60 * 60));\n // converts the time to minutes\n var minutes = Math.floor(time / (1000 * 60)) % 60;\n // converts the time to seconds\n var seconds = Math.floor(time / 1000) % 60;\n\n // formatting for seconds\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n seconds = \":\" + seconds\n\n // formatting for hours\n if (hours == 0) {\n hours = \"\";\n } else {\n hours += \":\";\n }\n\n // formatting for minutes\n if (minutes == 0) {\n minutes = \"\";\n }\n // returns the final result as a string\n return hours + minutes + seconds;\n}", "function timeConverter(time)\n{\n\tif(time == 0 || time == 24)\n\t\treturn \"12:00a.m.\"\n\tif(time < 12)\t\n\t\treturn time + \":00a.m.\";\t\n\telse if(time == 12)\n\t\treturn time + \":00p.m.\";\n\telse if(time > 12 && time < 24)\n\t\treturn (time - 12) + \":00p.m.\";\n}", "function timeFormatString() {\n return is24HourTime() ? 'HH:mm' : 'hh:mm a';\n}", "function formatTime(time) {\n let seconds = time % 60;\n if (seconds < 10) {\n seconds = \"0\" + seconds.toString();\n }\n let minutes = Math.floor(time / 60);\n if (minutes < 10) {\n minutes = \"0\" + minutes.toString();\n }\n let hours = Math.floor(time / 3600);\n return hours.toString() + \":\" + minutes + \":\" + seconds;\n}", "function timeFormat(timeInFormat){\n var mSeconds = Math.floor((timeInFormat%(1000)));\n var seconds = Math.floor((timeInFormat%(1000*60))/1000);\n var minute = Math.floor((timeInFormat % (1000 * 60 * 60)) / (1000 * 60));\n return `${minute}:${seconds}:${mSeconds}`;\n}", "function timeFormatter (time) {\n\tvar timeArr = time.split('T');\n\tvar finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n\treturn finalTime;\n}", "function timeFormat(seconds){\n var m = Math.floor(seconds/60)<10 ? \"0\"+Math.floor(seconds/60) : Math.floor(seconds/60);\n var s = Math.floor(seconds-(m*60))<10 ? \"0\"+Math.floor(seconds-(m*60)) : Math.floor(seconds-(m*60));\n return m+\":\"+s;\n}", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "function formatTime(time) {\n if (time > 9) {\n return time;\n } else {\n return \"0\" + time;\n }\n }", "function fancyTimeFormat(time) {\n var hrs= ~~(time/3600);\n var min= ~~((time%3600)/60);\n var sec= time%60;\n var ret=\"\";\n if(hrs>0)\n {\n ret+=\"\"+hrs+\":\"+(min<10?\":\":\"\");\n }\n ret+=\"\"+min+\":\"+(sec<10?\"0\":\"\");\n ret+=\"\"+sec;\n return ret;\n}", "function timeformat(time) {\r\n\t//calculate the time in hours, minutes and seconds\r\n\tmin = time / 60000;\r\n\tsec = min % 1;\r\n\tmin -= sec;\r\n\tsec *= 60;\r\n\tremainder = sec % 1;\r\n\tsec -= remainder;\r\n\tif( min < 10 ) { min = \"0\" + min; }\r\n\tif( sec < 10 ) { sec = \"0\" + sec; }\r\n\tformattedtime = min + \":\" + sec;\r\n\treturn formattedtime;\r\n}", "function formatTime(time) {\n var hour = time.substr(0, 2);\n var minute = time.substr(3, 2);\n var ret;\n\n if (hour == 0) {\n ret = \"12:\" + minute + \"am\";\n }\n else if (hour == 12) {\n ret = hour + \":\" + minute + \"pm\";\n }\n else if (hour > 12) {\n hour -= 12;\n ret = hour + \":\" + minute + \"pm\";\n } else {\n ret = hour * 1 + \":\" + minute + \"am\";\n }\n if (hour < 10) {\n ret = \"&nbsp;\" + ret;\n }\n return ret;\n }", "function format_time_output(time) {\n var h = 0; \n var m = 0;\n var s = 0;\n var ms = 0;\n var formated_time;\n\n h = Math.floor( time / (60 * 60 * 1000) );\n time = time % (60 * 60 * 1000);\n m = Math.floor( time / (60 * 1000) );\n time = time % (60 * 1000);\n s = Math.floor( time / 1000 );\n ms = time % 1000;\n\n newTime = pad(h, 2) + ':' + pad(m, 2) + ':' + pad(s, 2) + ':' + pad(ms,3);\n return newTime;\n}", "function formatTime() {\n\n // get whole minutes\n var minutes = Math.floor(timer / 60);\n\n // get remaining seconds\n var seconds = timer % 60;\n\n // add leading \"0\"s\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n return minutes + \":\" + seconds;\n}", "function formatTime(){\r\n var response = \"\",\r\n hours = 0,\r\n mins = 0,\r\n secs = time;\r\n\r\n while (secs >= 60){\r\n secs -= 60;\r\n mins += 1;\r\n }\r\n\r\n while (mins >= 60){\r\n mins -= 60;\r\n hours += 1;\r\n }\r\n\r\n if (secs == 0) {\r\n secs = \"\";\r\n } else if (secs == 1) {\r\n secs += \" second\";\r\n } else if (secs > 1) {\r\n secs += \" seconds\";\r\n }\r\n\r\n if (mins == 0) {\r\n mins = \"\";\r\n } else if (mins == 1) {\r\n mins += \" minute\";\r\n } else if (mins > 1) {\r\n mins += \" minutes\";\r\n }\r\n\r\n if (hours == 0) {\r\n hours = \"\";\r\n } else if (hours == 1) {\r\n hours += \" hour\";\r\n } else if (hours > 1) {\r\n hours += \" hours\";\r\n }\r\n\r\n if (hours != \"\"){\r\n response += hours + \" \";\r\n }\r\n\r\n if (mins != \"\"){\r\n response += mins + \" \";\r\n }\r\n\r\n if (secs != \"\"){\r\n response += secs;\r\n }\r\n\r\n return response;\r\n }", "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "function _timeFormat(sec) {\n\t\t\tstr = \"00:00\";\n\t\t\tif (sec > 0) {\n\t\t\t\tstr = Math.floor(sec / 60) < 10 ? \"0\" + Math.floor(sec / 60) + \":\" : Math.floor(sec / 60) + \":\";\n\t\t\t\tstr += Math.floor(sec % 60) < 10 ? \"0\" + Math.floor(sec % 60) : Math.floor(sec % 60);\n\t\t\t}\n\t\t\treturn str;\n\t\t}", "function fmtMSS(s) {\n return (s - (s %= 60)) / 60 + (9 < s ? ':' : ':0') + s;\n }", "function format_time(secs)\n{\n\tvar min = Math.floor(secs / 60);\n\tvar sec = secs % 60;\n\t\n\tif (sec < 10)\n\t\tsec = \"0\" + sec;\n\t\n\treturn min + \":\" + sec;\n}", "function timeConversion(s) {\n\tlet hh = s.slice(0, 2)\n\tlet mm = s.slice(3, 5)\n\tlet ss = s.slice(6, 8)\n\n\tif (s.slice(8, 10) === 'PM') {\n\t\tif (hh === '12') return `${hh}:${mm}:${ss}`\n\t\treturn `${+hh + 12}:${mm}:${ss}`\n\t}\n\tif (s.slice(8, 10) === 'AM') {\n\t\tif (hh === '12') return `00:${mm}:${ss}`\n\t\treturn `${hh}:${mm}:${ss}`\n\t}\n}", "function formatTime(string) {\n return string.slice(0, 5);\n }", "function reFormatTime(time) {\n const ampm = time.substr(-2, 2);\n let formattedTime;\n let formattedHour;\n const colon = time.indexOf(':');\n\n if (ampm === 'PM') {\n formattedHour = time.substr(0, 2);\n\n if (formattedHour == '12') { formattedHour = 12; } else { formattedHour = 12 + parseInt(time.substr(0, 2)); }\n\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n } else {\n formattedHour = parseInt(time.substr(0, 2));\n if (formattedHour < 10) {\n formattedHour = `0${formattedHour}`;\n }\n if (formattedHour == 12) {\n formattedHour = '00';\n }\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n }\n return formattedTime;\n }", "function formatTime(t) {\n return padZeros(t.getHours(), 2) + ':' + padZeros(t.getMinutes(), 2) + ':' + padZeros(t.getSeconds(), 2);\n}", "function formatTime(time) {\n // TODO This will fail for times that have hour value of 0 - 9\n let hour = Number.parseInt(time.substring(0, 2));\n if (hour < 12) {\n if (hour == 0) {\n return \"12\" + time.substring(2) + \" AM\";\n }\n else {\n return hour + time.substring(2) + \" AM\";\n }\n }\n else {\n if (hour == 12) {\n return \"12\" + time.substring(2) + \" PM\";\n }\n else {\n return (hour % 12) + time.substring(2) + \" PM\";\n }\n }\n}", "function format_time(time){\n\tvar h,m,s;\n\th=(time/360)|0;time%=360;\n\tm=(time/60)|0;time%=60;\n\ts=time|0;\n\t\n\treturn (h?h+\":\": \"\")+(m>=10?m: \"0\"+m)+\":\"+(s>=10?s: \"0\"+s);\n}", "formatTime(seconds) {\n\t\t// Minutes\n\t\tlet minutes = Math.floor(seconds / 60);\n\t\t// Seconds\n\t\tlet partInSeconds = seconds % 60;\n\t\t// Adds left zeros to seconds\n\t\tthis.partInSeconds = partInSeconds.toString().padStart(2, \"0\");\n\t\t// Returns formated time\n\t\treturn `${minutes}:${partInSeconds}`;\n\t}", "function formattedTime(seconds){\n var minute = parseInt(seconds / 60, 10);\n var seconds = seconds % 60\n seconds = seconds > 9 ? seconds : '0' + seconds;\n return (minute + \":\" + seconds);\n}", "function format_time( time_in_seconds ) {\n\n var hours, minutes, seconds\n\n // calculate hours\n hours = Math.floor( time_in_seconds / 3600 );\n\n // calculate minutes\n minutes = Math.floor( time_in_seconds / 60 );\n if ( hours > 0 ) {\n minutes = minutes % 60;\n }\n\n // calculate seconds\n seconds = Math.floor( time_in_seconds % 60 );\n\n // generate minutes part\n if ( !isNaN( minutes ) ) {\n minutes = ( minutes >= 10 )? minutes : \"0\" + minutes;\n } else {\n minutes = \"--\";\n }\n \n\n // generate seconds part\n if ( !isNaN( seconds ) ) {\n seconds = ( seconds >= 10 )? seconds : \"0\" + seconds;\n } else {\n seconds = \"--\";\n }\n \n\n return ( hours > 0 )? hours + \":\" + minutes + \":\" + seconds : minutes + \":\" + seconds;\n\n}", "function parseTime(time) {\n var st = '';\n var h = 0,\n m = 0,\n s = 0;\n if (time > 3600) {\n h = Math.floor(time / 3600);\n time -= 3600 * h;\n st += h + ':';\n }\n if (time > 60) {\n m = Math.floor(time / 60);\n time -= 60 * m;\n st += m + ':';\n } else {\n st += '0:';\n }\n s = Math.floor(time);\n st += s;\n return st;\n }", "function formatTime(timeString) {\n const H = +timeString.substr(0, 2);\n const h = H % 12 || 12;\n const ampm = H < 12 ? \"AM\" : \"PM\";\n return h + timeString.substr(2, 3) + ampm;\n}", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n \n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n \n if (minutes === 0) {\n minutes = \"00\";\n }\n \n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n \n return minutes + \":\" + seconds;\n }", "function formatSecondsToTime(s) {\n\n\tvar time='';\n\n\tvar h = Math.floor(s / 3600);\n\tif (h > 0)\n\t\ts = s - (h * 3600);\n\n\tvar m = Math.floor(s / 60);\n\tif (m > 0)\n\t\ts = s - (m * 60);\n\t\n\tif (h < 10)\n\t\ttime += '0';\n\t\t\n\ttime += h + ':';\n\t\n\tif (m < 10)\n\t\ttime += '0';\n\t\t\n\ttime += m + ':';\n\n\tif (s < 10)\n\t\ttime += '0';\n\t\n\ttime += s;\n\n\treturn time;\n}", "function timeFormat(time) {\n return time < 10 ? \"0\"+time : time;\n }", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n if (minutes === 0) {\n minutes = \"00\";\n }\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n return minutes + \":\" + seconds;\n }", "formatTime(time) {\r\n var timeString = \"\";\r\n if (time < 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 AM\";\r\n } else {\r\n timeString = time + \"0 AM\";\r\n }\r\n } else if (time === 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n } else {\r\n time = (time - 1200) / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n }\r\n return timeString;\r\n }", "function timeConverter(t) {\n\n var minutes = Math.floor(t/60);\n var seconds = t - (minutes*60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n }\n\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds; \n}", "function timeConverter(t) {\n\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n\n } else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n }", "function ConvertTimeformat(format) {\n\tvar time = format;\n\tvar hours = Number(time.match(/^(\\d+)/)[1]);\n\tvar minutes = Number(time.match(/:(\\d+)/)[1]);\n\tvar AMPM = time.match(/\\s(.*)$/)[1];\n\tif (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n\tif (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n\tvar sHours = hours.toString();\n\tvar sMinutes = minutes.toString();\n\tif (hours < 10) sHours = \"0\" + sHours;\n\tif (minutes < 10) sMinutes = \"0\" + sMinutes;\n\treturn (sHours + \":\" + sMinutes + \":00\");\n}", "function _formatTime(time) {\n var timeFormatted = time.toISOString();\n if (timeFormatted.indexOf(\"T\") > 0)\n timeFormatted = timeFormatted.split('T')[1];\n if (timeFormatted.length > 8)\n timeFormatted = timeFormatted.substr(0, 8);\n return timeFormatted;\n}", "function timeConverter(t) {\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n }\n else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n}", "function formatTime(t) {\n\tif (t < 10) {t = '0' + t}; \n\treturn t;\n}", "function formatTime(time){\r\n //Incoming Time format hh:mm:ss\r\n splitTime = time.split(\":\");\r\n hour = splitTime[0];\r\n minute = splitTime[1];\r\n\r\n //Determine if the hour is AM or PM\r\n if (hour > 12){\r\n amPM = \"PM\";\r\n hour = hour - 12;\r\n }else{\r\n amPM = \"AM\";\r\n }\r\n\r\n //return time in hh:mm AM/PM\r\n return hour +\":\" + minute + \" \" + amPM;\r\n}", "function timeFormat(seconds) {\n var m = Math.floor(seconds / 60) < 10 ? \"0\" + Math.floor(seconds / 60) : Math.floor(seconds / 60);\n var s = Math.floor(seconds - (m * 60)) < 10 ? \"0\" + Math.floor(seconds - (m * 60)) : Math.floor(seconds - (m * 60));\n return m + \":\" + s;\n }", "function formatTime(time) {\n hour = time.getHours();\n minute = time.getMinutes();\n afternoon = false;\n if (hour > 11) {\n afternoon = true;\n }\n formattedHour = hour % 12;\n if (formattedHour == 0) {\n formattedHour = 12;\n }\n if (afternoon) {\n return addLeadingZeros(formattedHour) + \":\" + addLeadingZeros(minute) + \" p.m.\";\n }\n return addLeadingZeros(formattedHour) + \":\" + addLeadingZeros(minute) + \" a.m.\";\n}", "function formatTime(sec_num){\n sec_num = Math.round(sec_num);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n if (0 < hours && hours < 10) {hours = \"0\"+hours;}\n if (0 < minutes && minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n var time = [minutes,seconds];\n if(hours){ time.push(hours); }\n return time.join(':');\n}", "function formatTime(time) {\r\n if ( time < 10 ) {\r\n return '0' + time;\r\n }\r\n return time;\r\n}", "formatTime(time) {\n time = parseInt(time, 10);\n if (time < 10) return '0' + time;\n return time;\n }", "function toMMSSFormat(time){\n var sec, min;\n\n sec = parseInt((time % 60), 10);\n sec = formatTime(sec);\n\n min = parseInt((time / 60), 10);\n min = formatTime(min);\n\n return min +\":\"+ sec;\n }", "tConvert(time, format) {\n if (format == 12) {\n let timeArr = time.split(\":\");\n let hours = timeArr[0];\n let _ext = \"AM\";\n if (hours >= 12) {\n hours = timeArr[0] % 12;\n _ext = \"PM\";\n }\n return hours + \":\" + timeArr[1] + \":\" + timeArr[2] + \" \" + _ext;\n } else {\n }\n }", "function TIME_FORMAT(time) {\n var sec_num = parseInt(time, 10); // don't forget the second param\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n \n if(time==Infinity || isNaN(time)){\n return '--';\n } else {\n return minutes+':'+seconds;\n }\n}", "function formatTime(time) {\r\n return time < 10 ? `0${time}` : time;\r\n}", "function formatTime(time) {\n if (time < 10) {\n time = \"0\" + time;\n }\n return time;\n }", "function formatTime(time) {\n var hr = Math.floor(time / 60), //Important to use math.floor with hours\n min = Math.round(time % 60);\n\n if (hr < 1 && min < 1) {\n return \"\";\n }\n else if (hr < 1) {\n return min + \" minute(s)\";\n }\n\n return hr + \" hour(s) \" + min + \" minute(s)\";\n}", "function convertTime(time) {\n\n \t\tvar time = time.toString();\n\t\tstrArray = time.split(\"\");\n\t\tnewString = \"\";\n\t\tfor (var i = 0; i < strArray.length; i++) {\n\t\t\tif ( i === strArray.length - 2) {\n\t\t\t\tnewString += \":\";\n\t\t\t}\n\t\t\tnewString += strArray[i]\n\t\t};\n\n\t\treturn newString;\n\t}", "function formatTime(time) {\n const timeArr = []\n if (isNaN(time) || time < 1) {\n return '00 00'\n } else if (time >= 3600) {\n const hr = Math.floor(time / (60 * 60)).toString()\n const min = Math.round(time - hr * 60).toString()\n const sec = Math.round(time - hr - min * 60).toString()\n timeArr.push(hr, min, sec)\n } else {\n const min = Math.floor(time / 60).toString()\n const sec = Math.round(time - min * 60).toString()\n timeArr.push(min, sec)\n }\n\n const formattedTime = timeArr.map(i => {\n if (i.length < 2) {\n return `0${i}`\n } else {\n return i\n }\n })\n\n return formattedTime.length === 3\n ? `${formattedTime[0]} ${formattedTime[1]} ${formattedTime[2]}`\n : `${formattedTime[0]} ${formattedTime[1]}`\n }", "function formatTime(value)\n{\n \"use strict\";\n var totalSeconds, asdf\n asdf = parseFloat(value);\n totalSeconds = Math.floor(asdf);\n \n var seconds = Math.floor(totalSeconds % 60);\n var minutes = Math.floor((totalSeconds / 60) % 60);\n var hours = Math.floor(totalSeconds / 3600);\n \n if (seconds < 10) { seconds = \"0\" + seconds; }\n if (minutes < 10) { minutes = \"0\" + minutes; }\n if (hours < 10) { hours = \"0\" + hours; }\n \n return hours + \":\" + minutes + \":\" + seconds;\n}", "function fmtMSS(s){return(s-(s%=60))/60+(9<s?':':':0')+s}", "function formatTime(timedif) {\n\tlet ms = timedif%1000;\n\ttimedif = (timedif-timedif%1000)/1000;\n\tlet s = timedif%60;\n\ttimedif = (timedif-timedif%60)/60;\n\tlet m = timedif;\n\tif(ms < 10) {\n\t\tms = \"00\" + ms;\n\t} else if(ms < 100) {\n\t\tms = \"0\" + ms;\n\t}\n\tif(s < 10) {\n\t\ts = \"0\" + s;\n\t}\n\treturn m + \":\" + s +\".\" + ms;\n}", "function timeConvert(time) {\n // Define minutes as 60 seconds or less\n let minutes = Math.floor(time / 60);\n // Display \"0\" infront of number of minutes if minutes is less than 10\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n // Define seconds as remainder of 60 seconds\n let seconds = time % 60;\n // Display \"0\" infront of number of seconds if seconds is less than 10\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n return minutes + \":\" + seconds;\n}", "function convertTimeStringformat(format, str) {\n var time = $(\"#clock\").val();\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours < 10) sHours = \"0\" + sHours;\n if (minutes < 10) sMinutes = \"0\" + sMinutes;\n return (sHours + \":\" + sMinutes);\n}", "function parseForDisplay(timeT){\n var hours = Math.floor(timeT/3600);\n var minutes = Math.floor((timeT - (hours * 3600)) / 60);\n var seconds = timeT - (hours * 3600) - (minutes * 60);\n var time = \"\";\n\n if (hours !== 0) {\n time = hours+\":\";\n }\n if (minutes !== 0 || time !== \"\") {\n minutes = (minutes < 10 && time !== \"\") ? \"0\"+minutes : minutes;\n time += minutes+\":\";\n }\n if (time === \"\") {\n time = seconds;\n }\n else {\n time += (seconds < 10) ? \"0\"+seconds : seconds;\n }\n return time;\n }", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function fancyTimeFormat(duration)\n{ \n // Hours, minutes and seconds\n var hrs = ~~(duration / 3600);\n var mins = ~~((duration % 3600) / 60);\n var secs = ~~duration % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function getTimeString(time) {\n let result = ''\n let format = time.split('.')[0].split(':')\n let hour = parseInt(format[0], 10)\n let meridiem = (hour / 12) >= 1 ? 'PM' : 'AM'\n\n result += hour % 12 === 0 ? 12 : hour % 12\n result += ':'\n result += format[1]\n\n return result + ' ' + meridiem\n}", "function formatTime (seconds) {\n var minutes = ((seconds / 60) | 0);\n var seconds = ((seconds % 60) | 0);\n minutes = '' + minutes;\n seconds = seconds < 10 ? '0' + seconds : '' + seconds;\n return '' + minutes + ':' + seconds;\n}", "function formatTime(time) {\n var initialFormat = time.tz(timeZone).format().split('T')[1],\n timeTrim = initialFormat.match(/[^:]+(\\:[^:]+)?/g)[0],\n hour = hourAdjust(Number(timeTrim.split(':')[0])),\n min = timeTrim.split(':')[1];\n\n return hour + ':' + min;\n}", "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10){ \n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "function toMilitaryTime(time) {\n var timeParse = time.split(\" \");\n var half = timeParse[1]\n var timeParse2 = timeParse[0].split(\":\");\n var milTime = \"{0}:{1}\";\n var hour = parseInt(timeParse2[0]);\n if (hour >= 24)\n hour = 0 \n if (half == 'PM') {\n if (hour != 12)\n hour += 12 \n }\n else {\n if (hour == 12)\n hour = 0 \n }\n return milTime.format(hour, timeParse2[1])\n}", "function formatTime(seconds) {\n let min = Math.floor((seconds / 60));\n let sec = Math.floor(seconds - (min * 60));\n if (sec < 10) {\n sec = `0${sec}`;\n };\n return `${min}:${sec}`;\n}", "function formatTime() {\n var time = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;\n var displayHours = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n var inverted = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;\n\n // Bail if the value isn't a number\n if (!is$1.number(time)) {\n return formatTime(undefined, displayHours, inverted);\n } // Format time component to add leading zero\n\n\n var format = function format(value) {\n return \"0\".concat(value).slice(-2);\n }; // Breakdown to hours, mins, secs\n\n\n var hours = getHours(time);\n var mins = getMinutes(time);\n var secs = getSeconds(time); // Do we need to display hours?\n\n if (displayHours || hours > 0) {\n hours = \"\".concat(hours, \":\");\n } else {\n hours = '';\n } // Render\n\n\n return \"\".concat(inverted && time > 0 ? '-' : '').concat(hours).concat(format(mins), \":\").concat(format(secs));\n }", "function formatTime(seconds) {\n var time = Math.round(seconds);\n var min = Math.floor(time / 60);\n var seconds = time - (min * 60);\n var extraXero = (seconds < 10) ? '0' : '';\n return `${min} : ${extraXero} ${seconds}`;\n}", "function toTimeFormat(num) {\n const hours = Math.floor(num / 3600);\n const minutes = (num % 3600) / 60;\n return hours + \":\" + minutes;\n }", "function formatTime(seconds) {\n return Math.floor(seconds/60) + \":\" + Math.round(seconds % 60)\n}", "function formatTime(seconds) {\n minutes = Math.floor(seconds / 60);\n minutes = (minutes >= 10) ? minutes : \"0\" + minutes;\n seconds = Math.floor(seconds % 60);\n seconds = (seconds >= 10) ? seconds : \"0\" + seconds;\n return minutes + \":\" + seconds;\n }", "function timesimpler(s) {\n aa = s.split('T');\n t1 = aa[0]\n t2 = aa[1].split(':')[0];\n //console.log(t1+' '+t2+':00');\n return t1 + ' ' + t2 + ':00';\n}", "function formatTime(time) {\n return time >= 10 ? time : `0${time}`;\n}", "function convertTimeString(time) {\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12)\n hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12)\n hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours < 10)\n sHours = \"0\" + sHours;\n if (minutes < 10)\n sMinutes = \"0\" + sMinutes;\n return (sHours + ':' + sMinutes + ':00');\n}", "function timeConvert(num) { \n if (num < 60) {\n return \"0:\" + String(num);\n }\n else {\n return String(Math.floor(num / 60)) + \":\" + String(num % 60); \n } \n}", "function formatTime(seconds) {\n\tvar time = \"\";\n\n\tif (Math.floor(seconds/60) != 0) {\n\t\ttime = \"\" + Math.round(seconds/60)+ \" min \";\n\t}\n\telse {\n\t\tvar s = Math.round((seconds % 60)/10)*10;\n\t\tif (s == 0)\n\t\t\ttime = \"5 sec\";\n\t\telse\n\t\t\ttime = \"\" + s + \" sec\";\t\n\t}\n\n\treturn time;\n}", "function formatTime(sec) {\n let minutes = Math.floor(sec / 60);\n let seconds = sec - (minutes * 60);\n\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n return `${minutes}:${seconds}`;\n}", "function formatTime(secs) {\n var min = Math.floor(secs/60.0);\n var sec = Math.floor(secs%60);\n var sec_padding = (sec<10 ? '0' : '');\n return min+':'+sec_padding+sec;\n}" ]
[ "0.7658685", "0.7616554", "0.7511847", "0.7473244", "0.7466628", "0.74091184", "0.7402683", "0.738053", "0.7376499", "0.73480487", "0.73474777", "0.7342646", "0.732661", "0.7291758", "0.7290072", "0.72811013", "0.7273684", "0.7263158", "0.72305983", "0.72154325", "0.71999687", "0.7188937", "0.7183352", "0.7170841", "0.7161895", "0.7150992", "0.7123568", "0.71052897", "0.71007895", "0.70963615", "0.70906734", "0.70781934", "0.7074962", "0.7066058", "0.70653075", "0.7042726", "0.7039465", "0.7030875", "0.70238984", "0.7022031", "0.7016253", "0.70026433", "0.6997496", "0.69944364", "0.6988541", "0.69856656", "0.6972786", "0.6966267", "0.69650406", "0.6962473", "0.6961619", "0.69600046", "0.6953355", "0.69490874", "0.6944606", "0.6942332", "0.69388795", "0.69380677", "0.6935091", "0.6933713", "0.69331217", "0.69281584", "0.69087183", "0.68984675", "0.6895171", "0.6891797", "0.688074", "0.685344", "0.684225", "0.68408316", "0.68405116", "0.68400973", "0.6834948", "0.6828004", "0.68276", "0.6825188", "0.6822168", "0.6815863", "0.68102515", "0.6806636", "0.68043476", "0.68043476", "0.6774227", "0.67652494", "0.67572814", "0.67534167", "0.67499775", "0.67494017", "0.67493063", "0.67489845", "0.67474747", "0.6747302", "0.6743218", "0.6740787", "0.6733889", "0.67320704", "0.67134047", "0.6706996", "0.67060286", "0.67049485" ]
0.69667846
47
checks check whether toCheck is in Interval [lower, upper]
function isInInterval(toCheck, lower, upper) { return (toCheck >= lower) && (toCheck <= upper); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isInRanges(value) {\n if (typeof value !== 'number') {\n return false;\n }\n return value >= this.lower && value <= this.upper;\n}", "function isBetween(lowerBound, upperBound, value)\n{\n\treturn (lowerBound < value && value < upperBound);\n}", "between(num, lower, upper) {\n return num > lower && num <= upper;\n }", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n }", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n }", "function rangeChecker(op, target, range){\r\n return op < target + range && op > target - range;\r\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n }\n else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n } else {\n return !value;\n }\n}", "function checkRange(value, lowerBounds, upperBounds) {\n if (value >= lowerBounds && value <= upperBounds) {\n return value;\n } else {\n return !value;\n }\n}", "inRange (number, start, end){\r\n // if end is undefined, start = 0 and end = start, then check if in range\r\n if (typeof end === 'undefined'){\r\n end = start;\r\n start = 0;\r\n } else if ( start > end ){\r\n // swap the two values around\r\n let temp = start;\r\n start = end;\r\n end = temp;\r\n }\r\n if ((number > start) && (number < end)){\r\n return true;\r\n }\r\n else\r\n return false;\r\n }", "function testRange(v:number, range:Range):boolean {\n const { min, max, intervals:_intervals} = range;\n const intervals = _intervals?_intervals:'[]';\n switch (intervals) {\n case '[]':\n //javascript's ?: treat 0 as false,so must check min!=null\n return ((min!=null)? v>=min :true) && ((max!=null)? v<=max :true);\n // seems the express above could not be resolved by flow.\n // return (min || v>=min) && (max || v<= max);\n case '[)':\n return ((min!=null)? v>=min :true) && ((max!=null)? v<max :true);\n case '(]':\n return ((min!=null)? v>min :true) && ((max!=null)? v<=max :true);\n case '()':\n return ((min!=null)? v>min :true) && ((max!=null)? v<max :true);\n default:\n throw new RunTimeCheckE('The range.intervals must be ' +\n ' [] | [) | (] | () .Please check the passed in' +\n `range: ${ePrint(range)}`);\n }\n}", "inRange (number, start, end) {\n if(end == null) {\n end = start;\n start = 0;\n }\n if(start > end) {\n const temp = start;\n start = end;\n end = temp;\n }\n const isInRange = (start <= number && number < end);\n return isInRange;\n }", "between( between, dependentVal){\n if( dependentVal > between[0] && dependentVal < between[1]){\n return true;\n }else{\n return false;\n }\n\n}", "inRange2(num, start, end) {\n if (end === undefined) {\n end = start;\n start = 0;\n }\n\n if (start > end) {\n const tmpEnd = end;\n end = start;\n start = tmpEnd;\n }\n\n const isInRange = num >= start && num < end;\n return isInRange;\n }", "function inRange(start, end, value) {\n\t\t\treturn (value>= start && value <= end);\n\t\t}", "function intervalContainsInterval(interval1, interval2) {\n\t\t\treturn interval1.start <= interval2.start && interval2.end <= interval1.end;\n\t\t}", "function inRange(min, number, max){\n\t\t\t\t\treturn number >= min && number <= max;\n\t\t\t\t}", "function assertWithinRange(low, high, actual, testName) {\n // your code here\n if ( actual >= low && actual <= high ) {\n console.log( 'passed' );\n } else {\n console.log( 'FAILED ' + testName + ': ' + actual + ' should be between: ' + low + ' and ' + high )\n }\n}", "function intWithinBounds(n, lower, upper) {\n if (n >= lower && n < upper && Number.isInteger(n) === true) {\n return true;\n } else {\n return false;\n }\n}", "function isBetween (x, from, to){\n if(x<to || x>from){\n return true;\n } else {\n return false;\n }\n}", "function inRange (data, x, y) {\n if (x < y) {\n return greaterOrEqual(data, x) && data <= y;\n }\n\n return lessOrEqual(data, x) && data >= y;\n }", "function valueInRange (start, value, finish) {\n return (start <= value) && (value <= finish);\n}", "function valueInRange (start, value, finish) {\n return (start <= value) && (value <= finish);\n}", "function inInterval(unixTime, interval) {\n return (\n unixTime >= getUnix(interval[START]) &&\n unixTime < getUnix(interval[END])\n );\n }", "inBounds(low, high) {\n if (this.x < low || this.x > high) return false;\n if (this.y < low || this.y > high) return false;\n return true;\n }", "inRange(result, range) {\n var a, inFloatRange, inIntRange, inStrRange;\n if (range.includes(\",\")) {\n return this.inRanges(result, this.toRanges(range));\n }\n if (!this.isType(range)) { // @isRange(range)\n return false;\n }\n a = this.toRangeArray(range); // Convers the range to an array\n inStrRange = function(string, a) {\n return a[0] <= string && string <= a[1];\n };\n inIntRange = function(int, a) {\n return a[0] <= int && int <= a[1];\n };\n inFloatRange = function(float, a) {\n return a[0] - a[2] <= float && float <= a[1] + a[2];\n };\n switch (this.toType(result)) {\n case \"string\":\n return inStrRange(result, a);\n case \"int\":\n return inIntRange(result, a);\n case \"float\":\n return inFloatRange(result, a);\n default:\n return false;\n }\n }", "function inRangeCheck(intervalIdx, currIdx) {\n if (cleanedLineInterval.length !== 0\n && cleanedLineInterval[intervalIdx].left <= currIdx\n && cleanedLineInterval[intervalIdx].right >= currIdx) {\n return true;\n } else {\n return false;\n }\n }", "function checkRange(int1,int2,range){\n let diff = Math.abs(int1-int2)\n if (diff <= range) {\n return true\n } else {\n return false\n }\n}", "function isIn(bp, bpRange) {\n\t\t\t\tvar satisfiesLower = CONFIG[bpRange.lower].min <= CONFIG[bp].min,\n\t\t\t\t\tsatisfiesUpper = true;\n\n\t\t\t\tif (bpRange.upper) {\n\t\t\t\t\tsatisfiesUpper = CONFIG[bp].min <= CONFIG[bpRange.upper].min;\n\t\t\t\t}\n\n\t\t\t\treturn satisfiesLower && satisfiesUpper;\n\t\t\t}", "function isBetween(start, end, val) {\n return (start < val && val < end) || (start > val && val > end);\n }", "function inRange(x, min, max) {\n return x >= min && x <= max;\n}", "function rangeCheck(input, min, max) {\r\n return ((input > min) && (input < max));\r\n}", "function isBetween(num, low, high){\n return (num >= low) && (num <= high);\n}", "function range(val, lo, hi, message) {\n var result = (val>=lo) && (val<=hi);\n message = message || (result ? \"okay\" : \"failed\");\n if (typeof val == \"string\") { val = parseFloat(val); };\n QUnit.ok( result, \n ( result \n ? message + \": \" + val \n : message + \", value \" + val + \" not in range [\"+lo+\"..\"+hi+\"]\"\n ));\n}", "function within(min1, max1, min2, max2) {\n return (min1 <= max2 && max1 >= min2);\n}", "function range(a, b) {\n if ((a >= 40 && a <= 60) && (b >= 40 && b <= 60)) {\n console.log('given numbers are in range of 40 and 60')\n } else if ((a >= 70 && a <= 100) && (b >= 70 && b <= 100)) {\n console.log('given numbers are in range of 70 and 100')\n } else {\n console.log('one or both the numbers are not in range')\n }\n}", "function inRange(x, min, max) {\n return (x - min) * (x - max) <= 0;\n}", "function betweenRange(value, range) {\n if (Array.isArray(range)) {\n if (value <= range[1] && value >= range[0]) {\n return true;\n }\n } else {\n if (value === range) {\n return true;\n }\n }\n return false;\n}", "function inrange(value, range, left, right) {\n var r0 = range[0], r1 = range[range.length-1], t;\n if (r0 > r1) {\n t = r0;\n r0 = r1;\n r1 = t;\n }\n left = left === undefined || left;\n right = right === undefined || right;\n\n return (left ? r0 <= value : r0 < value) &&\n (right ? value <= r1 : value < r1);\n }", "function between(first, last, value)\n{\n\treturn (first < last ? value >= first && value <= last : value >= last && value <= first);\n}", "static contains(testSel, selStart, selEnd) {\n const geStart =\n selStart.measure < testSel.measure ||\n (selStart.measure === testSel.measure && selStart.tick <= testSel.tick);\n const leEnd =\n selEnd.measure > testSel.measure ||\n (selEnd.measure === testSel.measure && testSel.tick <= selEnd.tick);\n\n return geStart && leEnd;\n }", "checkInRange(obj1, obj2, range) \n {\n return this.getDistance(obj1, obj2) <= range;\n }", "check_hv_range(space) {\r\n const xd = Math.abs(this.x - space.x);\r\n const yd = Math.abs(this.y - space.y);\r\n\r\n if(xd <= this.straight || yd <= this.stright) {\r\n return true;\r\n } else {\r\n return false;\r\n };\r\n }", "inRange1(num, start, end) {\n if (end === undefined) {\n end = start;\n start = 0;\n }\n\n if (start > end) {\n const tmpEnd = end;\n end = start;\n start = tmpEnd;\n }\n\n return num >= start && num < end;\n }", "isCoveredBy(ranges: Interval[]): boolean {\n var remaining = this.clone();\n for (var i = 0; i < ranges.length; i++) {\n var r = ranges[i];\n if (i && r.start < ranges[i - 1].start) {\n throw 'isCoveredBy must be called with sorted ranges';\n }\n if (r.start > remaining.start) {\n return false; // A position has been missed and there's no going back.\n }\n remaining.start = r.stop + 1;\n if (remaining.length() <= 0) {\n return true;\n }\n }\n return false;\n }", "inRange(num, endNum, startNum = 0) {\n [endNum, startNum] = [startNum, endNum];\n if (startNum > endNum) {\n [startNum, endNum] = [endNum, startNum];\n }\n return num >= startNum && num < endNum;\n }", "function inRange(num1,num2){\n // If these two numbers aren't greater than 50 - 99\n // dont proceed\n if(num1 >= 50 && num1 <= 99 ){\n // output something saying it is \n console.log(num1 + \" is in Range\")\n if(num2 >= 50 && num2 <= 99){\n // output something saying it is\n console.log(num2 + \" is in Range\")\n }\n }\n}", "function between(num, bound1, bound2){\n return (((bound1 >= num) && (bound2 <= num)) || ((bound1 <= num) && (bound2 >= num)))\n}", "function isWithinRange(target, startRange, endRange, lessThanAndEquals=false) {\n if (typeof target === \"number\" && typeof startRange === \"number\" && \n typeof endRange === \"number\") {\n // if lessThanAndEquals is true, first default operator checks if startRange <= target\n if (lessThanAndEquals) {\n console.log(\"check within range: \" + startRange + \" <= \" + target + \" < \" + endRange);\n if ((startRange <= target) && (target < endRange)) {\n return true;\n } else {\n return false;\n }\n }\n console.log(\"check within range: \" + startRange + \" < \" + target + \" < \" + endRange);\n // Otherwise, first default operator checks if startRange < target\n if ((startRange < target) && (target < endRange)) {\n return true;\n } else {\n return false;\n }\n }\n return false;\n}", "function inBetween(a, b) {\n return function (x) {\n return x >= a && x <= b;\n };\n}", "function inBetween(a, b) {\n return function(x) {\n return x >= a && x <= b;\n };\n}", "function isInRange(nodeRange,ranges){\n return ranges.some(function(range){\n return nodeRange[0] >= range[0] && nodeRange[1] <= range[1];\n });\n}", "function isInRange(value, start, end, rangeEnabled) {\n return rangeEnabled && start !== null && end !== null && start !== end && value >= start && value <= end;\n}", "function isInRange(numToCheck = 0, array = []){\n for(let i = 0 ; i < array.length ; i++){\n if(typeof array[i] == \"number\"){\n if(numToCheck == array[i]){\n return true ; \n }\n }else{\n if((array[i][0] <= numToCheck) && (array[i][1] >= numToCheck)){\n return true ; \n }\n }\n }\n return false;\n}", "function rangeIn(range, i) {\n return range.reduce((isIn, [a, b]) => isIn || (i >= a && i <= b), false);\n}", "function _isInRange(start, stop) {\n\t\tvar curTime = Date.now();\n\t\tvar startTime = _getTime(start);\n\t\tvar stopTime = _getTime(stop);\n\t\tvar ret = false;\n\n\t\tif (start === stop) {\n\t\t\treturn true;\n\t\t}\n\n\t\tif (stopTime > startTime) {\n\t\t\tif ((curTime >= startTime) && (curTime <= stopTime)) {\n\t\t\t\tret = true;\n\t\t\t}\n\t\t} else {\n\t\t\tif ((curTime >= startTime) || (curTime <= stopTime)) {\n\t\t\t\tret = true;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "function checkRange(param,min,max){\n\tif(param>=min && param <= max ){\n\t\n\treturn true;\n\t\n }else{\n\t\talert('Invalid value: '+param );\n }\t\n\n}", "function in_range(num1, num2) {\n if ((50 <= num1 && num1 <= 99) && (50 <= num2 && num2 <= 99)) return true;\n return false;\n\n}", "function numbers_ranges(x, y) {\n if ((x >= 40 && x <= 60 && y >= 40 && y <= 60) \n || \n (x >= 70 && x <= 100 && y >= 70 && y <= 100))\n {\n return true;\n } \n else \n {\n return false;\n }\n }", "function targetInBetween(min, max, target){\n if (target>min && target<max){\n return true;\n }\n\n else {\n return false;\n }\n}", "function inBetween(min, max, array){\n let inBetween = array.filter(n => n < max && n > min)\n return inBetween\n}", "inRanges(results, ranges) {\n var i, j, k, len, min, pass, ref, result;\n pass = true;\n switch (false) {\n case !(this.isArray(results) && this.isArray(ranges)):\n min = Math.min(results.length, ranges.length); // Ony apply the ranges we ga\n for (i = j = 0, ref = min; (0 <= ref ? j < ref : j > ref); i = 0 <= ref ? ++j : --j) {\n pass = pass && this.inRange(results[i], ranges[i]);\n }\n break;\n case !this.isArray(results):\n for (k = 0, len = results.length; k < len; k++) {\n result = results[k];\n pass = pass && this.inRange(results, ranges);\n }\n break;\n default:\n pass = false;\n }\n return pass;\n }", "function testInterval(datum, entry) {\n var ivals = entry.intervals,\n n = ivals.length,\n i = 0,\n getter, extent, value;\n\n for (; i<n; ++i) {\n extent = ivals[i].extent;\n getter = ivals[i].getter || (ivals[i].getter = field(ivals[i].field));\n value = getter(datum);\n if (!extent || extent[0] === extent[1]) return false;\n if (isDate(value)) value = toNumber(value);\n if (isDate(extent[0])) extent = ivals[i].extent = extent.map(toNumber);\n if (isNumber(extent[0]) && !inrange(value, extent)) return false;\n else if (isString(extent[0]) && extent.indexOf(value) < 0) return false;\n }\n\n return true;\n }", "function between(x, min, max) {\n return (x >= min && x <= max)\n}", "function testInterval(datum, entry) {\n var ivals = entry.intervals,\n n = ivals.length,\n i = 0,\n getter, extent, value;\n\n for (; i<n; ++i) {\n extent = ivals[i].extent;\n getter = ivals[i].getter || (ivals[i].getter = (0,vega_util__WEBPACK_IMPORTED_MODULE_4__.field)(ivals[i].field));\n value = getter(datum);\n if (!extent || extent[0] === extent[1]) return false;\n if ((0,vega_util__WEBPACK_IMPORTED_MODULE_4__.isDate)(value)) value = (0,vega_util__WEBPACK_IMPORTED_MODULE_4__.toNumber)(value);\n if ((0,vega_util__WEBPACK_IMPORTED_MODULE_4__.isDate)(extent[0])) extent = ivals[i].extent = extent.map(vega_util__WEBPACK_IMPORTED_MODULE_4__.toNumber);\n if ((0,vega_util__WEBPACK_IMPORTED_MODULE_4__.isNumber)(extent[0]) && !(0,_inrange__WEBPACK_IMPORTED_MODULE_2__.default)(value, extent)) return false;\n else if ((0,vega_util__WEBPACK_IMPORTED_MODULE_4__.isString)(extent[0]) && extent.indexOf(value) < 0) return false;\n }\n\n return true;\n}", "function inAnimationRange(element) {\n\t\tvar elementTop = $(element).offset().top;\n\t\tvar elementBottom = elementTop + $(element).height();\n\n\t\treturn ((elementBottom < lowerThreshold) && (elementTop > upperThreshold));\n\t}", "function isWithin(value, minInclusive, maxInclusive) {\n return value >= minInclusive && value <= maxInclusive;\n }", "function inRange(v1, v2, val) {\n if (val >= Math.min(v1, v2) && val <= Math.max(v1, v2)) {\n return true;\n } else {\n return false;\n }\n}", "function inRange(x, min = 0, max) {\n return (x - min) * (x - max) <= 0;\n}", "function isInRange(value, start, end, rangeEnabled) {\n return rangeEnabled && start !== null && end !== null && start !== end &&\n value >= start && value <= end;\n}", "function isInRange(value, start, end, rangeEnabled) {\n return rangeEnabled && start !== null && end !== null && start !== end &&\n value >= start && value <= end;\n}", "function between(min, max, num) {\n return (num >= min && num <= max);\n}", "function boundsCheck(value) {\n\t\tif (base == 10)\tvalue = parseFloat(value);\t\t\t\t\t\t// value is a string, if in base 10, parseFloat() it\n\t\telse value = parseInt(value, 16);\t\t\t\t\t\t\t\t// value is a string, if in base 16, parseInt() it with 16 as parameter (converts to base 10)\n\t\t\n\t\tif (minValue === null && maxValue === null) return true;\t\t// if both min and max is null, there is no limit, simple return true\n\t\telse if (minValue !== null && maxValue !== null) {\t\t\t\t// if both of the values aren't null, check both bounds\n\t\t\tif (value <= maxValue && value >= minValue) return true;\n\t\t}\n\t\telse if (minValue === null && maxValue !== null) {\t\t\t\t// if only the min is null, then there is no lower bound; check the upper bound\n\t\t\tif (value <= maxValue) return true;\n\t\t}\n\t\telse if (minValue !== null && maxValue === null) {\t\t\t\t// if only the max is null, then there is no upper bound; check the lower bound\n\t\t\tif (value >= minValue) return true;\n\t\t}\n\t\t\n\t\treturn false;\t// if we made it here, the number isn't valid; return false\n\t}", "function between(x, min, max) {\n\treturn x >= min && x <= max;\n }", "function numbers_ranges(x, y) {\n if ((x >= 0 && x <= 15 && y >= 0 && y <= 15))\n {\n return true;\n }\n else\n {\n return false;\n }\n }", "function in3050(a, b) {\n if (a >= 30 && a <= 40 && b >= 30 && b <= 40) {\n return true;\n } else if (a >= 40 && a <= 50 && b >= 40 && b <= 50) {\n return true;\n } else {\n return false;\n }\n}", "function inRange(value, minVal, maxVal) {\n\t\tif ((value > minVal) && (value < maxVal)) {\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function testInterval(datum, entry) {\n var ivals = entry.intervals,\n n = ivals.length,\n i = 0,\n getter, extent, value;\n\n for (; i<n; ++i) {\n extent = ivals[i].extent;\n getter = ivals[i].getter || (ivals[i].getter = Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"p\" /* field */])(ivals[i].field));\n value = getter(datum);\n if (!extent || extent[0] === extent[1]) return false;\n if (Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"v\" /* isDate */])(value)) value = Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"L\" /* toNumber */])(value);\n if (Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"v\" /* isDate */])(extent[0])) extent = ivals[i].extent = extent.map(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"L\" /* toNumber */]);\n if (Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"x\" /* isNumber */])(extent[0]) && !Object(__WEBPACK_IMPORTED_MODULE_2__inrange__[\"a\" /* default */])(value, extent)) return false;\n else if (Object(__WEBPACK_IMPORTED_MODULE_4_vega_util__[\"A\" /* isString */])(extent[0]) && extent.indexOf(value) < 0) return false;\n }\n\n return true;\n}", "function constrain(x,lower,upper) {\n if (x > upper) {\n return upper;\n } else if (x < lower) {\n return lower;\n } else {\n return x;\n }\n }", "function checkRange (min, max, number) {\r\n var result = false;\r\n if (number >= min && number <= max) {\r\n result = true;\r\n }\r\n return result;\r\n}", "function isWithinRange(value1, value2, range) {\n if (Math.abs(value1 - value2) <= range) return true;\n return false;\n}", "function isInRange(num) {\n if (num>20 && num<50) {return true;}\n else {return false;}\n}", "function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (typeof end == 'number') {\n return (pos >= start && pos <= end);\n } else {\n return pos == start;\n }\n }\n }", "function selectionCheck(selections, left, right) {\n for (var i = 0; i < selections.length; i++) {\n var sl = selections[i][0];\n var sr = selections[i][1];\n\n if (sl <= left && left <= sr && sl <= right && right <= sr) return [\"inside\", [sl, sr]];\n\n if (sr < left || sl > right) continue;\n\n return [\"invalid\"];\n }\n return [\"valid\"];\n}", "validateInterval(interval) {\n const that = this.context,\n range = that._maxObject.subtract(that._minObject);\n\n that._validInterval = new JQX.Utilities.BigNumber(interval);\n that._validInterval = this.round(that._validInterval);\n\n if (that._validInterval.compare(range) === 1) {\n that._validInterval = range;\n }\n\n that.interval = that._validInterval.toString();\n }", "function inRange(l, h, v) {\n let svar = false;\n if (v > l && v < h) {\n svar = true;\n return svar;\n } else {\n return svar;\n }\n }", "function isValid(from, to) {\n var today = Date();\n\n return (today >= from && today < to);\n}", "function checkRange(number, obj) {\n return (number >= obj.min && number <= obj.max);\n}", "function checkNumberBetween(num, from, to, vali){\n\n\tif(num <= to && num >= from){\t//Check between \"from\"-\"to\"\n\t\treturn true;\n\t}else if(num == \"\"){\t\t\t\t// Allow null!\n\t\treturn true;\n\t}\n\telse{\n//\t\talert(vali + \" - Must specify a number between \" + from + \"-\" + to);\n\t\t//elem.focus();\n\t\treturn false;\n\t}\n}", "function checkBounds(posn, leftBound, rightBound) {\n var x = posn[0];\n return x > leftBound && x < rightBound;\n }", "function between (a) {\n \tif (100<a && 200>a) {\n \t\treturn true;\n \t}\n \telse \n \t\treturn false;\n }", "function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (end) {\n return (pos >= start && pos <= end);\n } else {\n return pos == start;\n }\n }\n }", "contains(low, high, value){\n // Immediately abort if the tree is empty\n if(!this.root) return null;\n // Validate interval bounds\n low = IntervalTree.validate(low, \"Low bound\", true);\n high = IntervalTree.validate(high, \"High bound\", true);\n // Exit immediately if the input interval isn't valid\n if(high !== high || low !== low || high < low) return null;\n // Get the node that should contain this interval\n const node = this.root.getNodeWithInterval(low, high, value);\n // Count the number of matching intervals\n return node && node.contains(low, high, value);\n }", "function checkNumRange(n1, n2) {\n if (\n (n1 >= 40 && n1 <= 60 && n2 >= 40 && n2 <= 60) ||\n (n1 >= 70 && n1 <= 100 && n2 >= 70 && n2 <= 100)\n ) {\n return true;\n } else {\n return false;\n }\n}", "function checkProblem(firstXMarker, lastXMarker) {\n\n var flagUpper = false;\n var flagLower = false;\n\n var upperBoundProblem = dangerValues[0];\n var lowerBoundProblem = dangerValues[1];\n\n for(var i = 0; i < upperBoundProblem.length; i++) {\n\n firstXProblem = upperBoundProblem[i][0];\n lastXProblem = upperBoundProblem[i][1];\n if(firstXProblem <= lastXMarker && lastXProblem >= firstXMarker) {\n flagUpper = true;\n break;\n }\n }\n\n for(var i = 0; i < lowerBoundProblem.length; i++) {\n firstXProblem = lowerBoundProblem[i][0];\n lastXProblem = lowerBoundProblem[i][1];\n if(firstXProblem <= lastXMarker && lastXProblem >= firstXMarker) {\n flagLower = true;\n break;\n }\n }\n\n if(flagUpper === true) {\n if(flagLower === true) {\n // Supera sia sopra che sotto\n return 3;\n } else {\n // Supera solo sopra\n return 1;\n }\n } else {\n if(flagLower === true) {\n // Supera solo sotto\n return 2;\n } else {\n // Nessun problema\n return 0;\n }\n }\n}", "contains(low, high, value){\n const interval = new Interval(low, high, value);\n const index = this.intervals.indexOf(interval);\n return index < 0 ? null : this.intervals[index];\n }", "function fir(num, start, end) {\n let isInRange = false;\n\n if (end === undefined) {\n end = start;\n start = 0;\n }\n\n if (start > end) {\n let t = start;\n start = end;\n end = t;\n }\n\n if (num >= start && num < end) {\n isInRange = true;\n }\n\n return isInRange;\n}", "function is_in_range(str_val, min, max)\n{\n\tvar d = decstr2int(str_val);\n\tif ( d > max || d < min ) return false;\n\treturn true;\n}", "function between_values(x, min, max) {\r\n return {'passed': x.value >= min && x.value <= max,\r\n 'value': x.value};\r\n }" ]
[ "0.69556093", "0.681553", "0.68121004", "0.6519247", "0.6519247", "0.6497305", "0.6477554", "0.6477554", "0.64601785", "0.64601785", "0.64577633", "0.64570135", "0.6412107", "0.6401274", "0.63492453", "0.63332367", "0.62239164", "0.6223806", "0.62148833", "0.62131405", "0.62045527", "0.6203676", "0.6175344", "0.6175344", "0.6163979", "0.6159059", "0.6151558", "0.61336964", "0.61303717", "0.60884887", "0.60682154", "0.6058179", "0.60366476", "0.601299", "0.6011258", "0.6004719", "0.5987124", "0.5986546", "0.59669495", "0.59370613", "0.5934667", "0.5933501", "0.5922402", "0.5921717", "0.59135264", "0.5907837", "0.59068084", "0.59044975", "0.5899016", "0.5888375", "0.5886712", "0.58857614", "0.58697194", "0.58551234", "0.5854182", "0.58307034", "0.58277065", "0.5827651", "0.5822042", "0.58046967", "0.5793632", "0.57909364", "0.5785601", "0.5783845", "0.5778491", "0.5771024", "0.57703733", "0.57683074", "0.5767597", "0.5764328", "0.5746086", "0.5746086", "0.57414633", "0.5734595", "0.5733422", "0.5728271", "0.57213396", "0.57143915", "0.57086223", "0.5707124", "0.5697585", "0.5690188", "0.568784", "0.5682234", "0.5678858", "0.56765455", "0.5662602", "0.5655858", "0.56464493", "0.5640293", "0.56388324", "0.5637138", "0.5635004", "0.56347066", "0.56120276", "0.561008", "0.5601848", "0.55986106", "0.55959284", "0.5595041" ]
0.85438925
0
check whether clipBegin is in the right format
function checkClipBegin() { if (!continueProcessing) { var clipBegin = getTimefieldTimeBegin(); if (isNaN(clipBegin) || (clipBegin < 0)) { displayMsg("The inpoint is too low or the format is not correct. Correct format: hh:MM:ss.mm. Please check.", "Check inpoint"); return false; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkClipEnd() {\n if (!continueProcessing) {\n var clipEnd = getTimefieldTimeEnd();\n var duration = getDuration();\n if (isNaN(clipEnd) || (clipEnd > duration)) {\n displayMsg(\"The outpoint is too high or the format is not correct. Correct format: hh:MM:ss.mm. Please check.\",\n \"Check outpoint\");\n return false;\n }\n return true;\n }\n}", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n var firstNonOneAxis = size.length;\n for (var i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (var i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "function isSliceContinous(shape, begin, size) {\n // Index of the first axis that has size > 1.\n let firstNonOneAxis = size.length;\n for (let i = 0; i < size.length; i++) {\n if (size[i] > 1) {\n firstNonOneAxis = i;\n break;\n }\n }\n for (let i = firstNonOneAxis + 1; i < size.length; i++) {\n if (begin[i] > 0 || size[i] !== shape[i]) {\n return false;\n }\n }\n return true;\n}", "clipSegment(start, end) {\n const quadrantStart = this.pointLocation(start)\n const quadrantEnd = this.pointLocation(end)\n\n if (quadrantStart === 0b0000 && quadrantEnd === 0b0000) {\n // The line is inside the boundaries\n return [start, end]\n }\n\n if (quadrantStart === quadrantEnd) {\n // We are in the same box, and we are out of bounds.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart & quadrantEnd) {\n // These points are all on one side of the box.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart === 0b000) {\n // We are exiting the box. Return the start, the intersection with the boundary, and the closest\n // boundary point to the exited point.\n let line = [start]\n line.push(this.boundPoint(start, end))\n line.push(this.nearestVertex(end))\n return line\n }\n\n if (quadrantEnd === 0b000) {\n // We are re-entering the box.\n return [this.boundPoint(end, start), end]\n }\n\n // We have reached a terrible place, where both points are oob, but it might intersect with the\n // work area. First, define the boundaries as lines.\n const sides = [\n // left\n [Victor(-this.sizeX, -this.sizeY), new Victor(-this.sizeX, this.sizeY)],\n // right\n [new Victor(this.sizeX, -this.sizeY), new Victor(this.sizeX, this.sizeY)],\n // bottom\n [new Victor(-this.sizeX, -this.sizeY), new Victor(this.sizeX, -this.sizeY)],\n // top\n [new Victor(-this.sizeX, this.sizeY), new Victor(this.sizeX, this.sizeY)],\n ]\n\n // Count up the number of boundary lines intersect with our line segment.\n let intersections = []\n for (let s=0; s<sides.length; s++) {\n const intPoint = this.intersection(start,\n end,\n sides[s][0],\n sides[s][1])\n if (intPoint) {\n intersections.push(new Victor(intPoint.x, intPoint.y))\n }\n }\n\n if (intersections.length !== 0) {\n if (intersections.length !== 2) {\n // We should never get here. How would we have something other than 2 or 0 intersections with\n // a box?\n console.log(intersections)\n throw Error(\"Software Geometry Error\")\n }\n\n // The intersections are tested in some normal order, but the line could be going through them\n // in any direction. This check will flip the intersections if they are reversed somehow.\n if (Victor.fromObject(intersections[0]).subtract(start).lengthSq() >\n Victor.fromObject(intersections[1]).subtract(start).lengthSq()) {\n let temp = intersections[0]\n intersections[0] = intersections[1]\n intersections[1] = temp\n }\n\n return [...intersections, this.nearestVertex(end)]\n }\n\n // Damn. We got here because we have a start and end that are failing different boundary checks,\n // and the line segment doesn't intersect the box. We have to crawl around the outside of the\n // box until we reach the other point.\n // Here, I'm going to split this line into two parts, and send each half line segment back\n // through the clipSegment algorithm. Eventually, that should result in only one of the other cases.\n const midpoint = Victor.fromObject(start).add(end).multiply(new Victor(0.5, 0.5))\n\n // recurse, and find smaller segments until we don't end up in this place again.\n return [...this.clipSegment(start, midpoint),\n ...this.clipSegment(midpoint, end)]\n }", "function isValidPlacement(newStartFrame, newEndFrame) {\n const frameCount = editorService.song.durationFrames;\n const inBounds = newStartFrame >= 0 && newEndFrame < frameCount;\n return inBounds && !isColliding(newStartFrame, newEndFrame);\n }", "set clip(value) {}", "function clipIt(){\n\t\tvar theFile \t\t\t= $('#eFile').val(),\n\t\t\ttheWidth \t\t\t= +($('#eWidth').val()),\n\t\t\ttheHeight\t\t\t= +($('#eHeight').val()),\n\t\t\ttheTop\t\t\t\t= +($('#theTop').val()),\n\t\t\ttheRight\t\t\t= +($('#theRight').val()),\n\t\t\ttheBottom\t\t\t= +($('#theBottom').val()),\n\t\t\ttheLeft\t\t\t\t= +($('#theLeft').val()),\n\t\t\ttheClipArea\t\t\t= 'rect('+ theTop + 'px ' + theRight + 'px ' + theBottom + 'px ' + theLeft + 'px)',\n\t\t\tcssPosition\t\t\t= $('#theFocusArea').css('position'),\n\t\t\ttheRectangleWidth\t= theRight - theLeft,\n\t\t\ttheRectangleHeight\t= theBottom - theTop,\n\t\t\ttheRectangleTop\t\t= theTop + parseInt($('#theFocusArea').css('top')),\n\t\t\ttheRectangleLeft\t= theLeft + parseInt($('#theFocusArea').css('left')),\n\n\t\t//console.log('top: ' + theRectangleTop + ' = ' + theTop + ' + ' + parseInt($('#theFocusArea').css('top')) + ' left: ' + theRectangleLeft + ' = ' + theLeft + ' + ' + parseInt($('#theFocusArea').css('left')));\n\n\t\t\tspriteLeft = theLeft > 0 ? theLeft * -1 : 0,\n\t\t\tspriteTop = theTop > 0 ? theTop * -1 : 0;\n\t\t$('#cssDisplayed').html('<p>for sprite:<br>cssSelectorWrapper {<br>background-image: url(\\'' + theFile + '\\') '+ spriteLeft + ' ' + spriteTop + ';<br>'+\n\t\t\t\t\t\t\t'position: absolute;<br>' +\n\t\t\t\t\t\t\t'height: ' + (theBottom - theTop) + ' px;<br>' +\n\t\t\t\t\t\t\t'width: ' + (theRight - theLeft) + 'px;}</p>' +\n\t\t\t\t\t\t\t'<p>for clipped area:<br>cssSelector {<br>' +\n\t\t\t\t\t\t\t'background-image: url(\\'' + theFile + '\\');<br>' +\n\t\t\t\t\t\t\t'position: ' + cssPosition + ';<br>' +\n\t\t\t\t\t\t\t'width: ' +\t\ttheWidth + 'px;<br>' +\n\t\t\t\t\t\t\t'height: ' +\ttheHeight + 'px;<br>' +\n\t\t\t\t\t\t\t'clip:' +\t\ttheClipArea + ';}</p>');\n\n\t\ttheFileName = document.getElementById('eFile').value;\n\t\t$('#theFullImage').css({'backgroundImage': 'url(\"'+theFileName+'\")', 'width': theWidth, 'height': theHeight});\n\t\t$('#theFocusArea').css({'backgroundImage': 'url(\"'+theFileName+'\")', 'width': theWidth, 'height': theHeight, 'clip': theClipArea});\n\t\t$('#theRectangle').css({'top': theRectangleTop, \n\t\t\t\t\t\t\t 'height': theRectangleHeight,\n\t\t\t\t\t\t\t 'left': theRectangleLeft, \n\t\t\t\t\t\t\t 'width': theRectangleWidth});\n\t}", "clipSegment(start, end, log=false) {\n const size = this.settings.maxRadius\n const radStart = start.magnitude()\n const radEnd = end.magnitude()\n\n if (radStart < size && radEnd < size) {\n if (log) { console.log('line is inside limits') }\n return []\n }\n\n const intersections = this.getIntersections(start, end)\n if (!intersections.intersection) {\n if (log) { console.log('line is outside limits') }\n return [end]\n }\n\n if (intersections.points[0].on && intersections.points[1].on) {\n let point = intersections.points[0].point\n let otherPoint = intersections.points[1].point\n\n if (log) { console.log('line is outside limits, but intersects within limits') }\n return [\n ...this.tracePerimeter(point, otherPoint),\n otherPoint,\n end\n ]\n }\n\n if (radStart <= size) {\n const point1 = (intersections.points[0].on && Math.abs(intersections.points[0].point - start) > 0.0001) ? intersections.points[0].point : intersections.points[1].point\n if (log) { console.log('start is inside limits') }\n return [ point1, end ]\n } else {\n const point1 = intersections.points[0].on ? intersections.points[0].point : intersections.points[1].point\n if (log) { console.log('end is inside limits') }\n return [ start, point1 ]\n }\n }", "function isCornerBlock(){\n return ((xCo == 0 || xCo == MAX_X - 1) && (yCo == 0 || yCo == MAX_Y - 1));\n }", "function getHasClipCount() {\n hasClipCount = 0;\n var clipSlotCount = track.getcount(\"clip_slots\");\n var clipSlot = new LiveAPI();\n // GET HAS CLIP\n for (var j = 0; j < clipSlotCount; j++) {\n var clip_slot_path = track.path.replace(/['\"]+/g, '') + \" clip_slots \" + j; //'\n clipSlot.path = clip_slot_path;\n var hasClip = parseInt(clipSlot.get(\"has_clip\"));\n if (hasClip == 1) {\n var clip_path = clip_slot_path + \" clip\";\n var clip = new LiveAPI(null, clip_path);\n hasClipCount = hasClipCount + 1;\n }\n }\n //\toutlet(2, hasClipCount);\n log(\"clipF - ClipCount\", hasClipCount, \"- Last:\", clip_path);\n}", "isInBounds() {\n\n if(this.position['x'] >= SnakeGame.NUM_COLS) {\n return false;\n }else if(this.position['x'] < 0) {\n return false;\n }else if(this.position['y'] >= SnakeGame.NUM_ROWS) {\n return false;\n }else if(this.position['y'] < 0) {\n return false;\n }\n\n return true;\n\n }", "isValidPos(pos) {\n try {\n let x = pos[0];\n let y = pos[1];\n return ( (x > -1 && x < 8) && (y > -1 && y < 8) );\n } catch (error) {\n \n }\n }", "get clip() {}", "_isInPreview(value) {\n return isInRange(value, this.previewStart, this.previewEnd, this.isRange);\n }", "_isInPreview(value) {\n return isInRange(value, this.previewStart, this.previewEnd, this.isRange);\n }", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "function check_pos(){\n\t//Write our checking of all positions\n\n\tif (blob_pos_x > c_canvas.width - 20){\n\tblob_pos_x = blob_pos_x - 4;\n\t}\n\tif (blob_pos_x < 0){\n\tblob_pos_x = blob_pos_x + 4;\n\t}\n\tif (blob_pos_y > c_canvas.height - 20){\n\tblob_pos_y = blob_pos_y - 4;\n\t}\n\tif (blob_pos_y < 0){\n\tblob_pos_y = blob_pos_y + 4;\n\t}\n\n\n\t}", "_isPreviewStart(value) {\n return isStart(value, this.previewStart, this.previewEnd);\n }", "_isPreviewStart(value) {\n return isStart(value, this.previewStart, this.previewEnd);\n }", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "isOver() {\n return !( this.hasMove('white') || this.hasMove('black') );\n }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "intersects(bounds) {\n // Some size & offset adjustments to allow passage with bigger icon\n return this.sprite.offsetLeft + this.sprite.clientWidth - 20 > bounds.x\n && this.sprite.offsetLeft + 10 < bounds.x + bounds.width\n && this.sprite.offsetTop + this.sprite.clientHeight - 20 > bounds.y\n && this.sprite.offsetTop + 10 < bounds.y + bounds.height;\n }", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "set originalClip(value) {}", "function scaleClip(model) {\n var xScale = model.getScaleComponent('x');\n var yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('domainRaw')) ||\n (yScale && yScale.get('domainRaw')) ? true : false;\n }", "function clipLine(stream){var point0,// previous point\nc0,// code for previous point\nv0,// visibility of previous point\nv00,// visibility of first point\nclean;// no intersections\nreturn{lineStart:function(){v00=v0=false;clean=1},point:function(lambda,phi){var point1=[lambda,phi],point2,v=visible(lambda,phi),c=smallRadius?v?0:code(lambda,phi):v?code(lambda+(lambda<0?pi:-pi),phi):0;if(!point0&&(v00=v0=v))stream.lineStart();\n// Handle degeneracies.\n// TODO ignore if not clipping polygons.\nif(v!==v0){point2=intersect(point0,point1);if(!point2||pointEqual(point0,point2)||pointEqual(point1,point2)){point1[0]+=epsilon;point1[1]+=epsilon;v=visible(point1[0],point1[1])}}if(v!==v0){clean=0;if(v){\n// outside going in\nstream.lineStart();point2=intersect(point1,point0);stream.point(point2[0],point2[1])}else{\n// inside going out\npoint2=intersect(point0,point1);stream.point(point2[0],point2[1]);stream.lineEnd()}point0=point2}else if(notHemisphere&&point0&&smallRadius^v){var t;\n// If the codes for two points are different, or are both zero,\n// and there this segment intersects with the small circle.\nif(!(c&c0)&&(t=intersect(point1,point0,true))){clean=0;if(smallRadius){stream.lineStart();stream.point(t[0][0],t[0][1]);stream.point(t[1][0],t[1][1]);stream.lineEnd()}else{stream.point(t[1][0],t[1][1]);stream.lineEnd();stream.lineStart();stream.point(t[0][0],t[0][1])}}}if(v&&(!point0||!pointEqual(point0,point1))){stream.point(point1[0],point1[1])}point0=point1,v0=v,c0=c},lineEnd:function(){if(v0)stream.lineEnd();point0=null},\n// Rejoin first and last segments if there were intersections and the first\n// and last points were visible.\nclean:function(){return clean|(v00&&v0)<<1}}}", "function cohenSutherlandClip(x1, y1, x2, y2,color){\n //calcular regiões P1, P2\n let dots = [];\n let code1 = computeCode(x1, y1);\n let code2 = computeCode(x2, y2);\n let accept = false;\n\n while(true){\n if((code1 == 0) && (code2 == 0)){\n accept = true;\n break;\n }\n else if(code1 & code2){\n break;\n }\n else {\n //Linha precisa de recorte\n //Pelo menos um dos pontos está fora\n let x, y, code_out;\n\n if (code1 != 0)\n code_out = code1;\n else\n code_out = code2;\n\n if (code_out & TOP) {\n x = x1 + (x2 - x1) * (y_max - y1) / (y2 - y1);\n y = y_max;\n } else if (code_out & BOTTOM) {\n x = x1 + (x2 - x1) * (y_min - y1) / (y2 - y1);\n y = y_min;\n } else if (code_out & RIGHT) {\n y = y1 + (y2 - y1) * (x_max - x1) / (x2 - x1);\n x = x_max;\n } else if (code_out & LEFT) {\n y = y1 + (y2 - y1) * (x_min - x1) / (x2 - x1);\n x = x_min;\n }\n\n if (code_out == code1) {\n x1 = x;\n y1 = y;\n code1 = computeCode(x1, y1);\n } else {\n x2 = x;\n y2 = y;\n code2 = computeCode(x2, y2);\n }\n }\n }\n console.log(accept);\n if (accept){\n desenha_linha(Math.round(x1), Math.round(y1),Math.round(x2),Math.round(y2),'black');\n\n return dots;\n\n }\n else{\n console.log('Line rejected');\n }\n\n}", "hasOrigin() {\n\t\treturn (this.origin.x < 0 && this.origin.x + this.width > 0)\n\t\t&& (this.origin.y < 0 && this.origin.y + this.height > 0);\n\t}", "inBounds(){\n if (this.pos.x <= 0) {\n this.pos.x = 0;\n }\n if (this.pos.y <= 0) {\n this.pos.y = 0;\n }\n if (this.pos.x >= width ) {\n this.pos.x = width;\n }\n if (this.pos.y >= height) {\n this.pos.y = height;\n }\n }", "validate() {\n\t\tif ( this.foreground.width != this.background.width ||\n\t\t this.foreground.height != this.foreground.width ) {\n\t\t\t\tthrow \"KameraError: Vordergrund und Hintergrund sind nicht gleich groß\";\n\t\t} else\n\t\t\treturn true\n\t}", "isValidPosition(pos){\n return pos.x >=0 && pos.y >= 0 && pos.x < this.props.width && pos.y < this.props.height; \n }", "isStart(editor, point, at) {\n // PERF: If the offset isn't `0` we know it's not the start.\n if (point.offset !== 0) {\n return false;\n }\n\n var start = Editor.start(editor, at);\n return Point.equals(point, start);\n }", "isStart(editor, point, at) {\n // PERF: If the offset isn't `0` we know it's not the start.\n if (point.offset !== 0) {\n return false;\n }\n\n var start = Editor.start(editor, at);\n return Point.equals(point, start);\n }", "function isClippedSquare(tile, extent, buffer) {\n\n\t var features = tile.source;\n\t if (features.length !== 1) return false;\n\n\t var feature = features[0];\n\t if (feature.type !== 3 || feature.geometry.length > 1) return false;\n\n\t var len = feature.geometry[0].length;\n\t if (len !== 5) return false;\n\n\t for (var i = 0; i < len; i++) {\n\t var p = transform.point(feature.geometry[0][i], extent, tile.z2, tile.x, tile.y);\n\t if ((p[0] !== -buffer && p[0] !== extent + buffer) ||\n\t (p[1] !== -buffer && p[1] !== extent + buffer)) return false;\n\t }\n\n\t return true;\n\t}", "clipLine(start, end) {\n const s = Victor.fromObject(start)\n const e = Victor.fromObject(end)\n const bounds = [-this.sizeX, -this.sizeY, this.sizeX, this.sizeY]\n\n clip(s, e, bounds)\n return [s, e]\n }", "function isClippedSquare(tile, extent, buffer) {\n\t\n\t var features = tile.source;\n\t if (features.length !== 1) return false;\n\t\n\t var feature = features[0];\n\t if (feature.type !== 3 || feature.geometry.length > 1) return false;\n\t\n\t var len = feature.geometry[0].length;\n\t if (len !== 5) return false;\n\t\n\t for (var i = 0; i < len; i++) {\n\t var p = transform.point(feature.geometry[0][i], extent, tile.z2, tile.x, tile.y);\n\t if ((p[0] !== -buffer && p[0] !== extent + buffer) ||\n\t (p[1] !== -buffer && p[1] !== extent + buffer)) return false;\n\t }\n\t\n\t return true;\n\t}", "isBehindLowerLimit(pos) {\n return pos - this.cursor.clientWidth/2 <= 0;\n }", "blackPawnDoubleSteppedFrom(position){\n return this.previousLayouts.length && this.positionEmpty(position) && this.pieceObjectFromLastLayout(position).color === \"black\" && this.pieceObjectFromLastLayout(position).species === \"Pawn\"\n }", "_isRangeStart(value) {\n return isStart(value, this.startValue, this.endValue);\n }", "_isRangeStart(value) {\n return isStart(value, this.startValue, this.endValue);\n }", "isValid(position) {\n\t\treturn position.x >= 0 && position.x < this.width\n\t\t && position.y >= 0 && position.y < this.height;\n\t}", "function isMoveValid(fromTube,candidateTube){\n if (fromTube.length == 0 || candidateTube.length == 4) return false\n numFirstColor = fromTube.filter(x => x == fromTube[fromTube.length-1]).length\n if (numFirstColor == 4) return false\n if(candidateTube.length == 0){\n if (numFirstColor == fromTube.length) return false\n return true\n }\n return fromTube[0]===candidateTube[0]\n\n}", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "isFilled(i_check, j_check){\n let currentView = this.state.layout.length-1;\n if(i_check>=8 || j_check>=8 || i_check<0 || j_check<0){\n return \"stop\";\n }\n let square_value = this.state.layout[currentView][i_check][j_check];\n if(square_value === 32){\n return \"empty\";\n }\n if(this.state.whitesMove){\n if(square_value < 9818 ) {\n return \"stop\";\n }else{\n return \"capture\";\n }\n }else{\n if(square_value >= 9818){\n return \"stop\";\n }else{\n return \"capture\";\n }\n }\n\n }", "function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (typeof end == 'number') {\n return (pos >= start && pos <= end);\n } else {\n return pos == start;\n }\n }\n }", "function ComputeOutCode(x, y, xmin, ymin, xmax, ymax)\n{\n var code;\n\n code = INSIDE; // initialised as being inside of [[clip window]]\n\n if (x < xmin) // to the left of clip window\n code |= LEFT;else\n if (x > xmax) // to the right of clip window\n code |= RIGHT;\n if (y < ymin) // below the clip window\n code |= BOTTOM;else\n if (y > ymax) // above the clip window\n code |= TOP;\n\n return code;\n}", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "spriteOverlap(a, b) {\n let ab = a.getBounds();\n let bb = b.getBounds();\n return ab.x + ab.width > bb.x && ab.x < bb.x + bb.width && ab.y + ab.height > bb.y && ab.y < bb.y + bb.height;\n }", "get nearClipPlane() {}", "function parseGlyph(glyph, data, start) {\r\n\t const p = new parse.Parser(data, start);\r\n\t glyph.numberOfContours = p.parseShort();\r\n\t glyph._xMin = p.parseShort();\r\n\t glyph._yMin = p.parseShort();\r\n\t glyph._xMax = p.parseShort();\r\n\t glyph._yMax = p.parseShort();\r\n\t let flags;\r\n\t let flag;\r\n\r\n\t if (glyph.numberOfContours > 0) {\r\n\t // This glyph is not a composite.\r\n\t const endPointIndices = glyph.endPointIndices = [];\r\n\t for (let i = 0; i < glyph.numberOfContours; i += 1) {\r\n\t endPointIndices.push(p.parseUShort());\r\n\t }\r\n\r\n\t glyph.instructionLength = p.parseUShort();\r\n\t glyph.instructions = [];\r\n\t for (let i = 0; i < glyph.instructionLength; i += 1) {\r\n\t glyph.instructions.push(p.parseByte());\r\n\t }\r\n\r\n\t const numberOfCoordinates = endPointIndices[endPointIndices.length - 1] + 1;\r\n\t flags = [];\r\n\t for (let i = 0; i < numberOfCoordinates; i += 1) {\r\n\t flag = p.parseByte();\r\n\t flags.push(flag);\r\n\t // If bit 3 is set, we repeat this flag n times, where n is the next byte.\r\n\t if ((flag & 8) > 0) {\r\n\t const repeatCount = p.parseByte();\r\n\t for (let j = 0; j < repeatCount; j += 1) {\r\n\t flags.push(flag);\r\n\t i += 1;\r\n\t }\r\n\t }\r\n\t }\r\n\r\n\t check.argument(flags.length === numberOfCoordinates, 'Bad flags.');\r\n\r\n\t if (endPointIndices.length > 0) {\r\n\t const points = [];\r\n\t let point;\r\n\t // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0.\r\n\t if (numberOfCoordinates > 0) {\r\n\t for (let i = 0; i < numberOfCoordinates; i += 1) {\r\n\t flag = flags[i];\r\n\t point = {};\r\n\t point.onCurve = !!(flag & 1);\r\n\t point.lastPointOfContour = endPointIndices.indexOf(i) >= 0;\r\n\t points.push(point);\r\n\t }\r\n\r\n\t let px = 0;\r\n\t for (let i = 0; i < numberOfCoordinates; i += 1) {\r\n\t flag = flags[i];\r\n\t point = points[i];\r\n\t point.x = parseGlyphCoordinate(p, flag, px, 2, 16);\r\n\t px = point.x;\r\n\t }\r\n\r\n\t let py = 0;\r\n\t for (let i = 0; i < numberOfCoordinates; i += 1) {\r\n\t flag = flags[i];\r\n\t point = points[i];\r\n\t point.y = parseGlyphCoordinate(p, flag, py, 4, 32);\r\n\t py = point.y;\r\n\t }\r\n\t }\r\n\r\n\t glyph.points = points;\r\n\t } else {\r\n\t glyph.points = [];\r\n\t }\r\n\t } else if (glyph.numberOfContours === 0) {\r\n\t glyph.points = [];\r\n\t } else {\r\n\t glyph.isComposite = true;\r\n\t glyph.points = [];\r\n\t glyph.components = [];\r\n\t let moreComponents = true;\r\n\t while (moreComponents) {\r\n\t flags = p.parseUShort();\r\n\t const component = {\r\n\t glyphIndex: p.parseUShort(),\r\n\t xScale: 1,\r\n\t scale01: 0,\r\n\t scale10: 0,\r\n\t yScale: 1,\r\n\t dx: 0,\r\n\t dy: 0\r\n\t };\r\n\t if ((flags & 1) > 0) {\r\n\t // The arguments are words\r\n\t if ((flags & 2) > 0) {\r\n\t // values are offset\r\n\t component.dx = p.parseShort();\r\n\t component.dy = p.parseShort();\r\n\t } else {\r\n\t // values are matched points\r\n\t component.matchedPoints = [p.parseUShort(), p.parseUShort()];\r\n\t }\r\n\r\n\t } else {\r\n\t // The arguments are bytes\r\n\t if ((flags & 2) > 0) {\r\n\t // values are offset\r\n\t component.dx = p.parseChar();\r\n\t component.dy = p.parseChar();\r\n\t } else {\r\n\t // values are matched points\r\n\t component.matchedPoints = [p.parseByte(), p.parseByte()];\r\n\t }\r\n\t }\r\n\r\n\t if ((flags & 8) > 0) {\r\n\t // We have a scale\r\n\t component.xScale = component.yScale = p.parseF2Dot14();\r\n\t } else if ((flags & 64) > 0) {\r\n\t // We have an X / Y scale\r\n\t component.xScale = p.parseF2Dot14();\r\n\t component.yScale = p.parseF2Dot14();\r\n\t } else if ((flags & 128) > 0) {\r\n\t // We have a 2x2 transformation\r\n\t component.xScale = p.parseF2Dot14();\r\n\t component.scale01 = p.parseF2Dot14();\r\n\t component.scale10 = p.parseF2Dot14();\r\n\t component.yScale = p.parseF2Dot14();\r\n\t }\r\n\r\n\t glyph.components.push(component);\r\n\t moreComponents = !!(flags & 32);\r\n\t }\r\n\t if (flags & 0x100) {\r\n\t // We have instructions\r\n\t glyph.instructionLength = p.parseUShort();\r\n\t glyph.instructions = [];\r\n\t for (let i = 0; i < glyph.instructionLength; i += 1) {\r\n\t glyph.instructions.push(p.parseByte());\r\n\t }\r\n\t }\r\n\t }\r\n\t}", "function parseGlyph(glyph, data, start) {\n var p = new parse.Parser(data, start);\n glyph.numberOfContours = p.parseShort();\n glyph._xMin = p.parseShort();\n glyph._yMin = p.parseShort();\n glyph._xMax = p.parseShort();\n glyph._yMax = p.parseShort();\n var flags;\n var flag;\n\n if (glyph.numberOfContours > 0) {\n // This glyph is not a composite.\n var endPointIndices = (glyph.endPointIndices = []);\n for (var i = 0; i < glyph.numberOfContours; i += 1) {\n endPointIndices.push(p.parseUShort());\n }\n\n glyph.instructionLength = p.parseUShort();\n glyph.instructions = [];\n for (var i$1 = 0; i$1 < glyph.instructionLength; i$1 += 1) {\n glyph.instructions.push(p.parseByte());\n }\n\n var numberOfCoordinates = endPointIndices[endPointIndices.length - 1] + 1;\n flags = [];\n for (var i$2 = 0; i$2 < numberOfCoordinates; i$2 += 1) {\n flag = p.parseByte();\n flags.push(flag);\n // If bit 3 is set, we repeat this flag n times, where n is the next byte.\n if ((flag & 8) > 0) {\n var repeatCount = p.parseByte();\n for (var j = 0; j < repeatCount; j += 1) {\n flags.push(flag);\n i$2 += 1;\n }\n }\n }\n\n check.argument(flags.length === numberOfCoordinates, 'Bad flags.');\n\n if (endPointIndices.length > 0) {\n var points = [];\n var point;\n // X/Y coordinates are relative to the previous point, except for the first point which is relative to 0,0.\n if (numberOfCoordinates > 0) {\n for (var i$3 = 0; i$3 < numberOfCoordinates; i$3 += 1) {\n flag = flags[i$3];\n point = {};\n point.onCurve = !!(flag & 1);\n point.lastPointOfContour = endPointIndices.indexOf(i$3) >= 0;\n points.push(point);\n }\n\n var px = 0;\n for (var i$4 = 0; i$4 < numberOfCoordinates; i$4 += 1) {\n flag = flags[i$4];\n point = points[i$4];\n point.x = parseGlyphCoordinate(p, flag, px, 2, 16);\n px = point.x;\n }\n\n var py = 0;\n for (var i$5 = 0; i$5 < numberOfCoordinates; i$5 += 1) {\n flag = flags[i$5];\n point = points[i$5];\n point.y = parseGlyphCoordinate(p, flag, py, 4, 32);\n py = point.y;\n }\n }\n\n glyph.points = points;\n } else {\n glyph.points = [];\n }\n } else if (glyph.numberOfContours === 0) {\n glyph.points = [];\n } else {\n glyph.isComposite = true;\n glyph.points = [];\n glyph.components = [];\n var moreComponents = true;\n while (moreComponents) {\n flags = p.parseUShort();\n var component = {\n glyphIndex: p.parseUShort(),\n xScale: 1,\n scale01: 0,\n scale10: 0,\n yScale: 1,\n dx: 0,\n dy: 0\n };\n if ((flags & 1) > 0) {\n // The arguments are words\n if ((flags & 2) > 0) {\n // values are offset\n component.dx = p.parseShort();\n component.dy = p.parseShort();\n } else {\n // values are matched points\n component.matchedPoints = [p.parseUShort(), p.parseUShort()];\n }\n } else {\n // The arguments are bytes\n if ((flags & 2) > 0) {\n // values are offset\n component.dx = p.parseChar();\n component.dy = p.parseChar();\n } else {\n // values are matched points\n component.matchedPoints = [p.parseByte(), p.parseByte()];\n }\n }\n\n if ((flags & 8) > 0) {\n // We have a scale\n component.xScale = component.yScale = p.parseF2Dot14();\n } else if ((flags & 64) > 0) {\n // We have an X / Y scale\n component.xScale = p.parseF2Dot14();\n component.yScale = p.parseF2Dot14();\n } else if ((flags & 128) > 0) {\n // We have a 2x2 transformation\n component.xScale = p.parseF2Dot14();\n component.scale01 = p.parseF2Dot14();\n component.scale10 = p.parseF2Dot14();\n component.yScale = p.parseF2Dot14();\n }\n\n glyph.components.push(component);\n moreComponents = !!(flags & 32);\n }\n if (flags & 0x100) {\n // We have instructions\n glyph.instructionLength = p.parseUShort();\n glyph.instructions = [];\n for (var i$6 = 0; i$6 < glyph.instructionLength; i$6 += 1) {\n glyph.instructions.push(p.parseByte());\n }\n }\n }\n }", "function isInRange(pos, start, end) {\n if (typeof pos != 'number') {\n // Assume it is a cursor position. Get the line number.\n pos = pos.line;\n }\n if (start instanceof Array) {\n return inArray(pos, start);\n } else {\n if (end) {\n return (pos >= start && pos <= end);\n } else {\n return pos == start;\n }\n }\n }", "function isCCW() {\n if (area2D(_model.points, _model.points.count) < 0) {\n return false;\n } else {\n return true;\n }\n}", "static _checkRangesForContainment(rangeA, rangeB, collisionInfo, flipResultPositions)\n {\n if (flipResultPositions)\n {\n if (rangeA.max < rangeB.max || rangeA.min > rangeB.min) collisionInfo.shapeAContained = false;\t\t\t\t\n if (rangeB.max < rangeA.max || rangeB.min > rangeA.min) collisionInfo.shapeBContained = false;\t\n }\n else\n {\n if (rangeA.max > rangeB.max || rangeA.min < rangeB.min) collisionInfo.shapeAContained = false;\n if (rangeB.max > rangeA.max || rangeB.min < rangeA.min) collisionInfo.shapeBContained = false;\n }\n }", "function isRect(value) {\n return (typeof value) === \"object\";\n }", "touchesRange(from, to = from) {\n for (let i = 0, pos = 0; i < this.sections.length && pos <= to;) {\n let len = this.sections[i++], ins = this.sections[i++], end = pos + len;\n if (ins >= 0 && pos <= to && end >= from)\n return pos < from && end > to ? \"cover\" : true;\n pos = end;\n }\n return false;\n }", "set nearClipPlane(value) {}", "function isStartOrEnd(x, y) {\n\tif (x == currSX && y == currSY) {\n\t\treturn true\n\t} else if (x == currEX && y == currEY) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "borders() {\n if ((this.pos.x < 0) || (this.pos.y < 0) || (this.pos.x > width) || (this.pos.y > height)) {\n return true;\n } else {\n return false;\n }\n }", "function validarContinuacion(posX,posY){\n var valorActual = arregloPosiciones[posX][posY];\n\n if((posY-2)>=0){\n valorPosArriba1 = arregloPosiciones[posX][posY-1];\n valorPosArriba2 = arregloPosiciones[posX][posY-2];\n if(valorActual == valorPosArriba1 && valorActual == valorPosArriba2){\n return true;\n }\n }\n if((posX-2)>=0){\n valorPosIzq1 = arregloPosiciones[posX-1][posY];\n valorPosIzq2 = arregloPosiciones[posX-2][posY];\n if(valorActual == valorPosIzq1 && valorActual == valorPosIzq2){\n return true;\n }\n }\n return false;\n}", "function checkStandingFLC(pos) {\n let legX = bodyParts[PartEnums.TORSO].x - bodyParts[PartEnums.TORSO].width / 2.5;\n let legY = bodyParts[PartEnums.TORSO].y;\n return pos.x >= legX && pos.x <= (legX + 30) && pos.y >= legY && pos.y <= legY + 100;\n}", "function scaleClip(model) {\n var xScale = model.getScaleComponent('x');\n var yScale = model.getScaleComponent('y');\n return (xScale && xScale.get('domainRaw')) ||\n (yScale && yScale.get('domainRaw')) ? true : false;\n}", "function shapeIsSelected(shape)\n{\n if (GC.shape && shape && shape.type == \"rect\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= (shape.startX + shape.w) &&\n (GC.shape.startY + GC.shape.h) >= (shape.startY + shape.h))\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"circ\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= shape.endX &&\n (GC.shape.startY + GC.shape.h) >= shape.endY)\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"poly\")\n {\n for (var i = 0; i < shape.points.length; i++)\n {\n if (shape.points[i].x <= GC.shape.startX ||\n shape.points[i].y <= GC.shape.startY ||\n shape.points[i].x >= (GC.shape.startX + GC.shape.w) ||\n shape.points[i].y >= (GC.shape.startY + GC.shape.h))\n {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "isRange(value) {\n return isPlainObject(value) && Point.isPoint(value.anchor) && Point.isPoint(value.focus);\n }", "isControlSolo(control, layoutData) {\n let findOverlap = layoutData.find(layoutCtrl => \n {\n if (layoutCtrl.i === control.i) {\n return false;\n }\n\n // if one rect is on top of the other, there is no overlap\n // if (rect2.bottom < rect1.top || rect2.top > rect1.bottom) {\n if ((layoutCtrl.y + layoutCtrl.h - 1) < control.y || layoutCtrl.y > (control.y + control.h - 1)) {\n return false\n }\n \n return true;\n });\n return !findOverlap;\n }", "checkCollide(pos1, pos2){\n if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n pos1[1] === pos2[1]){\n\n return true;\n } else {\n return false;\n }\n }", "AddClip() {}", "function displayCheck(face) {\n //if in bounds\n if (!inBounds(face.x,face.y)) {\n return false;\n }\n\n return true;\n\n }", "RemoveClip() {}", "function css__RECT_ques_(cssPrimitiveType) /* (cssPrimitiveType : cssPrimitiveType) -> bool */ {\n return (cssPrimitiveType === 25);\n}", "get originalClip() {}", "function inBounds(x, y){\r\n\t\t\t\tvar bounds = courseSlot.courseBox.getBoundingClientRect();\r\n\t\t\t\tif (x > bounds.left && x < bounds.right && y > bounds.top && y < bounds.bottom)\r\n\t\t\t\t\treturn true;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn false;\r\n\t\t\t}", "function hasCrossedBreakpoint(prevResize, curWidth, targetBp) {\n if (curWidth >= targetBp && prevResize <= targetBp || curWidth <= targetBp && prevResize >= targetBp) {\n return true;\n }\n\n return false;\n} // Plurize (russian)", "function valid(offsetX, offsetY, newCurrent) {\n offsetX = offsetX || 0;\n offsetY = offsetY || 0;\n offsetX = currentX + offsetX;\n offsetY = currentY + offsetY;\n newCurrent = newCurrent || current;\n\n for (let y = 0; y < 4; ++y) {\n for (let x = 0; x < 4; ++x) {\n if (newCurrent[y][x]) {\n if (typeof board[y + offsetY] == 'undefined'\n || typeof board[y + offsetY][x + offsetX] == 'undefined'\n || board[y + offsetY][x + offsetX]\n || x + offsetX < 0\n || y + offsetY >= ROWS\n || x + offsetX >= COLS) {\n if (offsetY == 1 && freezed) {\n lose = true; // lose if the current shape is settled at the top most row\n document.getElementById('playbutton').disabled = false;\n }\n return false;\n }\n }\n }\n }\n return true;\n}", "podeMoverParaCima() {\n return this.getBird().getPosHeigth() > 0;\n }", "function isHeartFilled(heart) {\n var css = $(heart).css(\"background-position\");\n\n if (parseInt(css.substring(0, 3)) < -15) {\n return true;\n } else {\n return false;\n }\n}", "function enableClipping(player, clip) {\n if (!clip.clipping) {\n context.save();\n clip.clipping = true;\n\n context.beginPath();\n context.arc(player.vision.x * 4800, player.vision.y * 4800, player.vision.radius * canvas.width,\n player.vision.start - (Math.PI/4), player.vision.end + (Math.PI/4));\n context.closePath();\n context.clip();\n }\n }", "function isClippedSquare(tile, extent, buffer) {\n\n var features = tile.source;\n if (features.length !== 1) return false;\n\n var feature = features[0];\n if (feature.type !== 3 || feature.geometry.length > 1) return false;\n\n var len = feature.geometry[0].length;\n if (len !== 5) return false;\n\n for (var i = 0; i < len; i++) {\n var p = transform.point(feature.geometry[0][i], extent, tile.z2, tile.x, tile.y);\n if ((p[0] !== -buffer && p[0] !== extent + buffer) ||\n (p[1] !== -buffer && p[1] !== extent + buffer)) return false;\n }\n\n return true;\n}", "function isClippedSquare(tile, extent, buffer) {\n\n var features = tile.source;\n if (features.length !== 1) return false;\n\n var feature = features[0];\n if (feature.type !== 3 || feature.geometry.length > 1) return false;\n\n var len = feature.geometry[0].length;\n if (len !== 5) return false;\n\n for (var i = 0; i < len; i++) {\n var p = transform.point(feature.geometry[0][i], extent, tile.z2, tile.x, tile.y);\n if ((p[0] !== -buffer && p[0] !== extent + buffer) ||\n (p[1] !== -buffer && p[1] !== extent + buffer)) return false;\n }\n\n return true;\n}", "function check_border() {\n for (let i = 0; i < invaders.length; i++) {\n return invaders[i].x <= 0 || invaders[i].x >= 155;\n }\n}", "inEdit(line) {\n return line >= this.baseFrom && line <= this.baseTo;\n }", "valid(index) { return (this.start<=index && index<this.end) }", "function inRangeCheck(intervalIdx, currIdx) {\n if (cleanedLineInterval.length !== 0\n && cleanedLineInterval[intervalIdx].left <= currIdx\n && cleanedLineInterval[intervalIdx].right >= currIdx) {\n return true;\n } else {\n return false;\n }\n }", "function checkOverlap(spriteA, spriteB) {\n\n var overlapping = 0;\n try {\n\n for (var i = 0; i < spriteB.children.entries.length; i++) {\n var boundsA = spriteA.getBounds();\n var boundsB = spriteB.children.entries[i].getBounds();\n\n if (Phaser.Geom.Rectangle.Intersection(boundsA, boundsB).width > 0) {\n overlapping = 1;\n break;\n }\n }\n\n return overlapping;\n }\n catch (e) {\n console.log(e);\n return false;\n }\n\n}", "function hasCropCoords(index) {\n var imgAttrs = imgData[index];\n \n if (typeof imgAttrs != 'undefined' && typeof imgAttrs.cropCoords != 'undefined') {\n var cropCoords = imgAttrs.cropCoords;\n \n if ('x1' in cropCoords && 'y1' in cropCoords && 'x2' in cropCoords && 'y2' in cropCoords) {\n return true;\n }\n } \n \n return false;\n }", "function checkRange(value) {\n if (value == DOT_INDEX || value == COMMA_INDEX || (value >= NUM_LOW && value <= NUM_HI) || (value >= LET_HI_LOW && value <= LET_HI_HI) || (value >= LET_LOW_LOW && value <= LET_LOW_HI)) {\n return true;\n }\n return false;\n}", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi : -pi), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon;\n\t point1[1] += epsilon;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "checkCollide(pos1, pos2){\n\t if (Math.abs(pos1[0] - pos2[0]) < 50 &&\n\t pos1[1] === pos2[1]){\n\t\n\t return true;\n\t } else {\n\t return false;\n\t }\n\t }", "clipEar(listofseg){\n\t\tlet copypoint = listofseg.map(function(e){\n\t\t\treturn e.a\n\t\t})\n\t\tfor (let i=0; i<listofseg.length;i++){\n\t\t\tlet sega = listofseg[i];\n\t\t\tlet segb;\n\t\t\tlet copy = copypoint.map((x=>x));\n\t\t\tif (i=== listofseg.length-1){\n\t\t\t\tsegb = listofseg[0]\n\t\t\t\tcopy.splice(i,1)\n\t\t\t\tcopy.splice(0,1)\n\t\t\t\tcopy.splice(0,1)\n\t\t\t}\n\t\t\telse {\n\t\t\t\tsegb = listofseg[i+1]\n\t\t\t\tcopy.splice(i,1)\n\t\t\t\tcopy.splice(i,1)\n\t\t\t\tcopy.splice(i,1)\n\t\t\t}\n\t\t\tlet notfound = true;\n\t\t\tfor (let j=0; j<copy.length;j++){\n\t\t\t\tif (this.checkTriangle(sega, segb, copy[j])){\n\t\t\t\t\tnotfound = false\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (notfound){\n\t\t\t\tthis.segList.push([sega, segb])\n\t\t\t\tif (i=== listofseg.length-1){\n\t\t\t\t\tlistofseg.pop();\n\t\t\t\t\tlistofseg.shift();\n\t\t\t\t\treturn listofseg.splice(0,0,{a:sega.a,b:segb.b})\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\treturn listofseg.splice(i,2,{a:sega.a,b:segb.b})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "can_move(start, end) {\n\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\tvar start_col = (start % 8) + 1;\n\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\tvar end_col = (end % 8) + 1;\n\n\t\tvar row_diff = end_row - start_row;\n\t\tvar col_diff = end_col - start_col;\n\n\t\tif (row_diff == col_diff) { //diagonale \"/\"\n\t\t return true;\n\t\t} else if (row_diff == -col_diff) { //diagonale \"\\\"\n\t\t return true;\n\t\t}\n\t\treturn false;\n\t }", "static surely_formatted (file, debug = false) {\n let answer = true;\n const is_io = !!file.is_io; // Probably IO.\n if (!is_io) {\n file = new IO(file, 'r');\n }\n\n try {\n file.seek(file.size());\n file.seek(0);\n\n if (file.read(4, 'a') !== 'RIFF') {\n throw new Error('RIFF sign is not found');\n }\n\n // Ignore file size.\n file.read(4, 'V');\n\n if (file.read(4, 'a') !== 'AVI ') {\n throw new Error('AVI sign is not found');\n }\n\n while (file.read(4, 'a').match(/^(?:LIST|JUNK)$/)) {\n file.move(file.read(4, 'V'));\n }\n\n file.move(-4);\n\n // we require idx1\n if (file.read(4, 'a') !== 'idx1') {\n throw new Error('idx1 is not found');\n }\n\n file.move(file.read(4, 'V'));\n }\n catch (err) {\n // console.log(err);\n if (debug) {\n console.error(`ERROR: ${err.message}`);\n }\n answer = false;\n }\n finally {\n if (!is_io) {\n file.close();\n }\n }\n\n return answer;\n }", "set overrideClip(value) {}", "function isPolyrect( coords ) {\n var baseline = $(coords).siblings('.Baseline');\n if ( ! $(coords).hasClass('Coords') ||\n baseline.length === 0 ||\n baseline[0].points.length*2 !== coords.points.length )\n return false;\n var n, m, baseline_n, coords_n, coords_m,\n offup = 0,\n offdown = 0,\n rot = getTextOrientation(baseline),\n rotmat = rot !== 0 ? self.util.svgRoot.createSVGMatrix().rotate(rot) : null;\n baseline = baseline[0].points;\n coords = coords.points;\n for ( n = 0; n < baseline.length; n++ ) {\n m = coords.length-1-n;\n baseline_n = rot !== 0 ? baseline[n].matrixTransform(rotmat) : baseline[n];\n coords_n = rot !== 0 ? coords[n].matrixTransform(rotmat) : coords[n];\n coords_m = rot !== 0 ? coords[m].matrixTransform(rotmat) : coords[m];\n if ( n === 0 ) {\n offup = baseline_n.y-coords_n.y;\n offdown = coords_m.y-baseline_n.y;\n }\n else if ( Math.abs( baseline_n.x - coords_n.x ) > 1 ||\n Math.abs( baseline_n.x - coords_m.x ) > 1 ||\n Math.abs( (baseline_n.y-coords_n.y) - offup ) > 1 ||\n Math.abs( (coords_m.y-baseline_n.y) - offdown ) > 1 )\n return false;\n }\n return [ offup+offdown, offdown/(offup+offdown) ];\n }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$4 : -pi$4), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$4;\n\t point1[1] += epsilon$4;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function check_overlap(x,y)\n{\n var detect=0;\n \n for (var i=0;i<no_of_elements;i++)\n {\n if (cli===i)\n break;\n \n if((Math.abs(x-elems[i].start)<elems[cli].width) &&(Math.abs(y-elems[i].end)<elems[cli].height))\n detect=1;\n \n }\n writeMessage(canvas,detect);\n \n return detect;\n \n }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$2;\n\t point1[1] += epsilon$2;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }", "function clipLine(stream) {\n\t var point0, // previous point\n\t c0, // code for previous point\n\t v0, // visibility of previous point\n\t v00, // visibility of first point\n\t clean; // no intersections\n\t return {\n\t lineStart: function() {\n\t v00 = v0 = false;\n\t clean = 1;\n\t },\n\t point: function(lambda, phi) {\n\t var point1 = [lambda, phi],\n\t point2,\n\t v = visible(lambda, phi),\n\t c = smallRadius\n\t ? v ? 0 : code(lambda, phi)\n\t : v ? code(lambda + (lambda < 0 ? pi$3 : -pi$3), phi) : 0;\n\t if (!point0 && (v00 = v0 = v)) stream.lineStart();\n\t // Handle degeneracies.\n\t // TODO ignore if not clipping polygons.\n\t if (v !== v0) {\n\t point2 = intersect(point0, point1);\n\t if (pointEqual(point0, point2) || pointEqual(point1, point2)) {\n\t point1[0] += epsilon$2;\n\t point1[1] += epsilon$2;\n\t v = visible(point1[0], point1[1]);\n\t }\n\t }\n\t if (v !== v0) {\n\t clean = 0;\n\t if (v) {\n\t // outside going in\n\t stream.lineStart();\n\t point2 = intersect(point1, point0);\n\t stream.point(point2[0], point2[1]);\n\t } else {\n\t // inside going out\n\t point2 = intersect(point0, point1);\n\t stream.point(point2[0], point2[1]);\n\t stream.lineEnd();\n\t }\n\t point0 = point2;\n\t } else if (notHemisphere && point0 && smallRadius ^ v) {\n\t var t;\n\t // If the codes for two points are different, or are both zero,\n\t // and there this segment intersects with the small circle.\n\t if (!(c & c0) && (t = intersect(point1, point0, true))) {\n\t clean = 0;\n\t if (smallRadius) {\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t } else {\n\t stream.point(t[1][0], t[1][1]);\n\t stream.lineEnd();\n\t stream.lineStart();\n\t stream.point(t[0][0], t[0][1]);\n\t }\n\t }\n\t }\n\t if (v && (!point0 || !pointEqual(point0, point1))) {\n\t stream.point(point1[0], point1[1]);\n\t }\n\t point0 = point1, v0 = v, c0 = c;\n\t },\n\t lineEnd: function() {\n\t if (v0) stream.lineEnd();\n\t point0 = null;\n\t },\n\t // Rejoin first and last segments if there were intersections and the first\n\t // and last points were visible.\n\t clean: function() {\n\t return clean | ((v00 && v0) << 1);\n\t }\n\t };\n\t }" ]
[ "0.6477681", "0.5709964", "0.56755257", "0.5662904", "0.5561524", "0.5528435", "0.54918784", "0.5472061", "0.5451166", "0.54392606", "0.5405298", "0.53580517", "0.53441745", "0.5315367", "0.5315367", "0.52833945", "0.52833945", "0.52623165", "0.5254665", "0.5254665", "0.5246618", "0.5244778", "0.5235808", "0.5235808", "0.5228481", "0.5222426", "0.52179086", "0.52153677", "0.5213385", "0.5208146", "0.5200734", "0.5197226", "0.51929337", "0.5188919", "0.51797503", "0.51797503", "0.51628816", "0.51564515", "0.5154387", "0.5147001", "0.5137327", "0.5135018", "0.5135018", "0.51312584", "0.51289105", "0.5114408", "0.51118803", "0.5091727", "0.50830823", "0.5080471", "0.5080471", "0.5076048", "0.50659055", "0.5064015", "0.50623304", "0.505516", "0.50500643", "0.5047966", "0.5044296", "0.5043623", "0.50397485", "0.50314367", "0.5024794", "0.5018447", "0.5017535", "0.50172895", "0.5009151", "0.5000095", "0.4995706", "0.49935973", "0.4986273", "0.4984022", "0.49832717", "0.49798062", "0.49761087", "0.49671623", "0.49670818", "0.4964129", "0.49526665", "0.49469247", "0.49430063", "0.49430063", "0.49419868", "0.49338084", "0.4929209", "0.4927592", "0.4920132", "0.49173605", "0.4915916", "0.49145147", "0.4913696", "0.49114215", "0.49020252", "0.4901908", "0.4895605", "0.48927826", "0.48800856", "0.48787642", "0.48751026", "0.48751026" ]
0.74173105
0
check whether clipEnd is in the right format
function checkClipEnd() { if (!continueProcessing) { var clipEnd = getTimefieldTimeEnd(); var duration = getDuration(); if (isNaN(clipEnd) || (clipEnd > duration)) { displayMsg("The outpoint is too high or the format is not correct. Correct format: hh:MM:ss.mm. Please check.", "Check outpoint"); return false; } return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkClipBegin() {\n if (!continueProcessing) {\n var clipBegin = getTimefieldTimeBegin();\n if (isNaN(clipBegin) || (clipBegin < 0)) {\n displayMsg(\"The inpoint is too low or the format is not correct. Correct format: hh:MM:ss.mm. Please check.\",\n \"Check inpoint\");\n return false;\n }\n return true;\n }\n}", "function isEnd() {\n\t\tlet flag = true;\n\t\tfor (let i = 0; i < pieceCount.length; i++) {\n\t\t\t//for each puzzle piece\n\t\t\tlet top = parseInt(pieceCount[i].style.top);\n\t\t\tlet left = parseInt(pieceCount[i].style.left);\n\t\t\tif (left != (i % 4 * PIECESIZE) || top != parseInt(i / 4) * PIECESIZE) {\n\t\t\t\t//checks if each piece matches its left and top position\n\t\t\t\tflag = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn flag;\n\t}", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "function clipEnds(d) {\n\t var p = ax.l2p(d.x);\n\t return (p > 1 && p < ax._length - 1);\n\t }", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "isEnd(editor, point, at) {\n var end = Editor.end(editor, at);\n return Point.equals(point, end);\n }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "function clipEnds(d) {\n var p = ax.l2p(d.x);\n return (p > 1 && p < ax._length - 1);\n }", "clipEnd(substr) {\n if (this.content.endsWith(substr)) {\n this.content = clipStringEnd(this.content, substr);\n return true;\n }\n\n return false;\n }", "_isPreviewEnd(value) {\n return isEnd(value, this.previewStart, this.previewEnd);\n }", "_isPreviewEnd(value) {\n return isEnd(value, this.previewStart, this.previewEnd);\n }", "function isValidPlacement(newStartFrame, newEndFrame) {\n const frameCount = editorService.song.durationFrames;\n const inBounds = newStartFrame >= 0 && newEndFrame < frameCount;\n return inBounds && !isColliding(newStartFrame, newEndFrame);\n }", "get isEnd() {\n\t\treturn (this.state.sourcePosition >= this.state.sourceEnd);\n\t}", "_isRangeEnd(value) {\n return isEnd(value, this.startValue, this.endValue);\n }", "_isRangeEnd(value) {\n return isEnd(value, this.startValue, this.endValue);\n }", "function checkAttheEnd(player) {\n return (player.y > OBJ_PIXEL && player.y < OBJ_PIXEL * 2);\n}", "function checkMove() {\n var discToMove = startPeg[startPeg.length - 1];\n var topDisc = endPeg[endPeg.length - 1];\n var moveAvailable = false;\n if (discToMove < topDisc || endPeg.length === 0) {\n moveAvailable = true;\n }\n return moveAvailable;\n }", "function validateStartEnd(start, end) {\n return !!start && !!end && start.isValid && end.isValid && start <= end;\n}", "function getHasClipCount() {\n hasClipCount = 0;\n var clipSlotCount = track.getcount(\"clip_slots\");\n var clipSlot = new LiveAPI();\n // GET HAS CLIP\n for (var j = 0; j < clipSlotCount; j++) {\n var clip_slot_path = track.path.replace(/['\"]+/g, '') + \" clip_slots \" + j; //'\n clipSlot.path = clip_slot_path;\n var hasClip = parseInt(clipSlot.get(\"has_clip\"));\n if (hasClip == 1) {\n var clip_path = clip_slot_path + \" clip\";\n var clip = new LiveAPI(null, clip_path);\n hasClipCount = hasClipCount + 1;\n }\n }\n //\toutlet(2, hasClipCount);\n log(\"clipF - ClipCount\", hasClipCount, \"- Last:\", clip_path);\n}", "clipSegment(start, end, log=false) {\n const size = this.settings.maxRadius\n const radStart = start.magnitude()\n const radEnd = end.magnitude()\n\n if (radStart < size && radEnd < size) {\n if (log) { console.log('line is inside limits') }\n return []\n }\n\n const intersections = this.getIntersections(start, end)\n if (!intersections.intersection) {\n if (log) { console.log('line is outside limits') }\n return [end]\n }\n\n if (intersections.points[0].on && intersections.points[1].on) {\n let point = intersections.points[0].point\n let otherPoint = intersections.points[1].point\n\n if (log) { console.log('line is outside limits, but intersects within limits') }\n return [\n ...this.tracePerimeter(point, otherPoint),\n otherPoint,\n end\n ]\n }\n\n if (radStart <= size) {\n const point1 = (intersections.points[0].on && Math.abs(intersections.points[0].point - start) > 0.0001) ? intersections.points[0].point : intersections.points[1].point\n if (log) { console.log('start is inside limits') }\n return [ point1, end ]\n } else {\n const point1 = intersections.points[0].on ? intersections.points[0].point : intersections.points[1].point\n if (log) { console.log('end is inside limits') }\n return [ start, point1 ]\n }\n }", "function isMoveValid(fromTube,candidateTube){\n if (fromTube.length == 0 || candidateTube.length == 4) return false\n numFirstColor = fromTube.filter(x => x == fromTube[fromTube.length-1]).length\n if (numFirstColor == 4) return false\n if(candidateTube.length == 0){\n if (numFirstColor == fromTube.length) return false\n return true\n }\n return fromTube[0]===candidateTube[0]\n\n}", "function checkValidEnd(point) {\n var valid = true;\n var payload = {\n msg: \"INVALID_END_NODE\",\n body: {\n newLine: null,\n heading: \"Player \"+gameState.player,\n message: \"Invalid Move!\"\n }\n };\n\n if (isEqual(point, gameState.firstPoint)) {\n gameState.click = 1;\n return payload;\n }\n\n if (gameState.startSegment.inner.x === -1) {\n var slope = Math.abs(getSlope(point, gameState.firstPoint));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"start\") {\n var slope = Math.abs(getSlope(point, gameState.startSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"end\") {\n var slope = Math.abs(getSlope(point, gameState.endSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n\n // Check for intersections with existing segments\n if (checkIntersection(point, gameState.endPoint, gameState)){\n gameState.click = 1;\n return payload;\n }\n\n // If new line is an extension of an existing line, update startSegment and endSegment\n // If new line is not an extension, push the old startSegment and endSegment to the segments array and replace startSegment and endSegment\n if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"start\" && extension(point, gameState.startSegment)) {\n gameState.startSegment.outer = point;\n }\n else if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"end\" && extension(point, gameState.endSegment)) {\n gameState.endSegment.outer = point;\n }\n else {\n // Checks if 1st line segment in game\n if (gameState.startSegment.inner.x === -1) {\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n gameState.endSegment = {inner: gameState.firstPoint, outer: gameState.firstPoint};\n }\n else if (gameState.endPoint === \"start\") {\n gameState.segments.push(gameState.startSegment);\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n }\n else if (gameState.endPoint === \"end\") {\n gameState.segments.push(gameState.endSegment);\n gameState.endSegment = {inner: gameState.firstPoint, outer: point};\n }\n }\n gameState.player = -1*gameState.player+3;\n\n payload = {\n msg: \"VALID_END_NODE\",\n body: {\n newLine: {\n start: gameState.firstPoint,\n end: point\n },\n heading: \"Player \"+gameState.player,\n message: \"Awaiting Player \"+gameState.player+\"'s Move\"\n }\n }\n gameState.click = 1;\n\n if (checkGameOver(gameState)) {\n payload.msg = \"GAME OVER\";\n payload.body.heading = \"Game Over\";\n payload.body.message = \"Player \"+(-1*gameState.player+3)+\" Wins\"\n }\n\n return payload;\n}", "isEnd() {\n return this.data.rounds.end(); \n }", "function lineEnd(){if(segments){linePoint(x__,y__);if(v__&&v_)bufferStream.rejoin();segments.push(bufferStream.result())}clipStream.point=point;if(v_)activeStream.lineEnd()}", "clipSegment(start, end) {\n const quadrantStart = this.pointLocation(start)\n const quadrantEnd = this.pointLocation(end)\n\n if (quadrantStart === 0b0000 && quadrantEnd === 0b0000) {\n // The line is inside the boundaries\n return [start, end]\n }\n\n if (quadrantStart === quadrantEnd) {\n // We are in the same box, and we are out of bounds.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart & quadrantEnd) {\n // These points are all on one side of the box.\n return [this.nearestVertex(start), this.nearestVertex(end)]\n }\n\n if (quadrantStart === 0b000) {\n // We are exiting the box. Return the start, the intersection with the boundary, and the closest\n // boundary point to the exited point.\n let line = [start]\n line.push(this.boundPoint(start, end))\n line.push(this.nearestVertex(end))\n return line\n }\n\n if (quadrantEnd === 0b000) {\n // We are re-entering the box.\n return [this.boundPoint(end, start), end]\n }\n\n // We have reached a terrible place, where both points are oob, but it might intersect with the\n // work area. First, define the boundaries as lines.\n const sides = [\n // left\n [Victor(-this.sizeX, -this.sizeY), new Victor(-this.sizeX, this.sizeY)],\n // right\n [new Victor(this.sizeX, -this.sizeY), new Victor(this.sizeX, this.sizeY)],\n // bottom\n [new Victor(-this.sizeX, -this.sizeY), new Victor(this.sizeX, -this.sizeY)],\n // top\n [new Victor(-this.sizeX, this.sizeY), new Victor(this.sizeX, this.sizeY)],\n ]\n\n // Count up the number of boundary lines intersect with our line segment.\n let intersections = []\n for (let s=0; s<sides.length; s++) {\n const intPoint = this.intersection(start,\n end,\n sides[s][0],\n sides[s][1])\n if (intPoint) {\n intersections.push(new Victor(intPoint.x, intPoint.y))\n }\n }\n\n if (intersections.length !== 0) {\n if (intersections.length !== 2) {\n // We should never get here. How would we have something other than 2 or 0 intersections with\n // a box?\n console.log(intersections)\n throw Error(\"Software Geometry Error\")\n }\n\n // The intersections are tested in some normal order, but the line could be going through them\n // in any direction. This check will flip the intersections if they are reversed somehow.\n if (Victor.fromObject(intersections[0]).subtract(start).lengthSq() >\n Victor.fromObject(intersections[1]).subtract(start).lengthSq()) {\n let temp = intersections[0]\n intersections[0] = intersections[1]\n intersections[1] = temp\n }\n\n return [...intersections, this.nearestVertex(end)]\n }\n\n // Damn. We got here because we have a start and end that are failing different boundary checks,\n // and the line segment doesn't intersect the box. We have to crawl around the outside of the\n // box until we reach the other point.\n // Here, I'm going to split this line into two parts, and send each half line segment back\n // through the clipSegment algorithm. Eventually, that should result in only one of the other cases.\n const midpoint = Victor.fromObject(start).add(end).multiply(new Victor(0.5, 0.5))\n\n // recurse, and find smaller segments until we don't end up in this place again.\n return [...this.clipSegment(start, midpoint),\n ...this.clipSegment(midpoint, end)]\n }", "eoi() { return this.pos==this.end }", "function validateEndPoint() {\n //We have an end value for the finger\n\t\t return fingerData[0].end.x !== 0;\n }", "function validateEndPoint() {\n //We have an end value for the finger\n\t\t return fingerData[0].end.x !== 0;\n }", "function validateEndPoint() {\n //We have an end value for the finger\n\t\t return fingerData[0].end.x !== 0;\n }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function validateEndPoint() {\n //We have an end value for the finger\n return fingerData[0].end.x !== 0;\n }", "function endCheck() {\r\n let isOver = false;\r\n if ((snake[0].x < 0 || snake[0].x >= width) || (snake[0].y < 0 || snake[0].y >= height))\r\n isOver = true;\r\n if (!isOver)\r\n isOver = snakeObCheck(vertOb);\r\n if (!isOver)\r\n isOver = snakeObCheck(horOb);\r\n if (!isOver)\r\n isOver = snakeObCheck(xOb);\r\n if (!isOver)\r\n isOver = snakeObCheck(seWall);\r\n return isOver;\r\n }", "function validateEndPoint() {\n //We have an end value for the finger\n return fingerData[0].end.x !== 0;\n }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function lineEnd() {\n\t if (segments) {\n\t linePoint(x__, y__);\n\t if (v__ && v_) bufferStream.rejoin();\n\t segments.push(bufferStream.result());\n\t }\n\t clipStream.point = point;\n\t if (v_) activeStream.lineEnd();\n\t }", "function isEnd(value, start, end) {\n return start !== null && start !== end && value >= start && value === end;\n}", "function isEnd(value, start, end) {\n return start !== null && start !== end && value >= start && value === end;\n}", "function isEnd(value, start, end) {\n return start !== null && start !== end && value >= start && value === end;\n}", "function end__TO__START_ques_(rangeExceptionCompareHow) /* (rangeExceptionCompareHow : rangeExceptionCompareHow) -> bool */ {\n return (rangeExceptionCompareHow === 4);\n}", "function checkAndUpdate() {\n\t\tconsole.log('playing video'+vm_playingVideoId);\n\t\tvar video = document.getElementById(vm_playingVideoId);\n\t\tconsole.log(currentClip[\"end\"]);\n\t\tif(video.currentTime > currentClip[\"end\"]) {\n\t\t\n\t\t\tif(i < intervals.length-1) {\n\t\t\t\ti = i+1;\n\t\t\t\tcurrentClip = intervals[i];\t\t\t\n\t\t\t\tstartTime = currentClip[\"start\"];\n\t\t\t\tvideo.currentTime = startTime;\t\t\t\t\t\t\n\t\t\t} else {\n\t\t\t\tvideo.pause();\n\t\t\t}\n\t\t}\n\t}", "set clip(value) {}", "function isStartOrEnd(x, y) {\n\tif (x == currSX && y == currSY) {\n\t\treturn true\n\t} else if (x == currEX && y == currEY) {\n\t\treturn true\n\t} else {\n\t\treturn false\n\t}\n}", "function checkEndGame() {\n var endGame = findOnBoard(p2Mark, 3);\n if (endGame == null)\n endGame = findOnBoard(p1Mark, 3);\n\n if (endGame != null || timesPlayed >= 9) {\n if (endGame != null) {\n for (var i = 0; i < endGame.length; i++) {\n $(\"#\" + endGame[i][0]).parent().addClass(\"red\");\n }\n } else {\n talker.notice(\"draw\");\n }\n\n UIActive = true;\n $(\"#UI\").show();\n $(\"#screen3\").children().show();\n return true;\n }\n return false;\n}", "function checkOverlap (shifts) {\n var width = 0;\n _.each(shifts, function (shift, i) {\n width += (shift.end-shift.start)\n });\n if (width > 1440) {\n return true;\n } else {\n return false;\n }\n }", "function inRange() {\n var currentHeight = Math.round(ellipsisContainer.getBoundingClientRect().height * 100) / 100;\n return currentHeight - 0.1 <= maxHeight; // -.1 for firefox\n }", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function inRange() {\n return ellipsisContainer.offsetHeight < maxHeight;\n } // Skip ellipsis if already match", "function isEndgame() {\n\treturn player.points.gte(\"e6e9\")\n}", "clipLine(start, end) {\n const s = Victor.fromObject(start)\n const e = Victor.fromObject(end)\n const bounds = [-this.sizeX, -this.sizeY, this.sizeX, this.sizeY]\n\n clip(s, e, bounds)\n return [s, e]\n }", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "function isEndgame() {\n\treturn player.points.gte([800, 2, 0, 1])\n}", "function checkTimeFrames() {\n\n var start = new Date(settings.start),\n end = new Date(settings.stop),\n delta = (end - start) / (1000 * 60 * 60 * 24),\n min_delta = 10,\n max_delta = 60;\n\n if (isNaN(start.getTime())) {\n console.warn(\"Invalid start date.\");\n return false;\n }\n\n if (isNaN(end.getTime())) {\n console.warn(\"Invalid stop date.\");\n return false;\n }\n\n // overwrite the end date if survey is too short\n if (delta < min_delta) {\n end = new Date(start.getTime() + (min_delta * 24 * 60 * 60 * 1000));\n console.warn(\"Survey duration was too short. Minimum of \" + min_delta + \" days.\\nOverwrote survey end to \" + datestamp(end));\n }\n\n // overwrite the end date if survey is too long\n if (delta > max_delta) {\n end = new Date(start.getTime() + (max_delta * 24 * 60 * 60 * 1000));\n console.warn(\"Survey duration was too long. Maximum of \" + max_delta + \" days.\\nOverwrote survey end to \" + datestamp(end));\n }\n\n if (now < start) {\n console.log(\"Survey is not yet within the active timeframe.\");\n return false;\n }\n\n if (now > end) {\n\n if (!checkDurationExceptionStatus()) {\n console.log(\"Survey has passed the active timeframe.\");\n return false;\n }\n\n console.log(\"Survey has passed the active timeframe. But duration exception granded.\");\n return true;\n }\n return true;\n }", "checkValidMove(origin, destination)\n {\n\n if(this.checkEmptyStack(origin))\n {\n return false;\n }\n else if(this.posting[origin-1][this.posting[origin-1].length-1] > this.posting[destination-1][this.posting[destination-1].length-1])//checks for big disks that are on top of smaller disks\n {\n console.log(this.posting[origin-1][this.posting[origin-1].length-1]);\n console.log(this.posting[destination-1][this.posting[destination-1].length-1]);\n return false;\n }\n else\n {\n return true;\n }\n }", "trim(start, end) {\n const trackStart = this.getStartTime();\n const trackEnd = this.endTime;\n const offset = this.cueIn - trackStart;\n\n if ((trackStart <= start && trackEnd >= start) ||\n (trackStart <= end && trackEnd >= end)) {\n const cueIn = (start < trackStart) ? trackStart : start;\n const cueOut = (end > trackEnd) ? trackEnd : end;\n\n this.setCues(cueIn + offset, cueOut + offset);\n if (start > trackStart) {\n this.setStartTime(start);\n }\n }\n }", "function checkEnd() {\n\n if (activeIndex >= sequence.length) {\n lockBoard();\n nextRound();\n }\n}", "function clipToLine(cm, curStart, curEnd) {\n var selection = cm.getRange(curStart, curEnd);\n // Only clip if the selection ends with trailing newline + whitespace\n if (/\\n\\s*$/.test(selection)) {\n var lines = selection.split('\\n');\n // We know this is all whitespace.\n lines.pop();\n\n // Cases:\n // 1. Last word is an empty line - do not clip the trailing '\\n'\n // 2. Last word is not an empty line - clip the trailing '\\n'\n var line;\n // Find the line containing the last word, and clip all whitespace up\n // to it.\n for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {\n curEnd.line--;\n curEnd.ch = 0;\n }\n // If the last word is not an empty line, clip an additional newline\n if (line) {\n curEnd.line--;\n curEnd.ch = lineLength(cm, curEnd.line);\n } else {\n curEnd.ch = 0;\n }\n }\n }", "function clipToLine(cm, curStart, curEnd) {\n var selection = cm.getRange(curStart, curEnd);\n // Only clip if the selection ends with trailing newline + whitespace\n if (/\\n\\s*$/.test(selection)) {\n var lines = selection.split('\\n');\n // We know this is all whitespace.\n lines.pop();\n\n // Cases:\n // 1. Last word is an empty line - do not clip the trailing '\\n'\n // 2. Last word is not an empty line - clip the trailing '\\n'\n var line;\n // Find the line containing the last word, and clip all whitespace up\n // to it.\n for (var line = lines.pop(); lines.length > 0 && line && isWhiteSpaceString(line); line = lines.pop()) {\n curEnd.line--;\n curEnd.ch = 0;\n }\n // If the last word is not an empty line, clip an additional newline\n if (line) {\n curEnd.line--;\n curEnd.ch = lineLength(cm, curEnd.line);\n } else {\n curEnd.ch = 0;\n }\n }\n }", "function start__TO__END_ques_(rangeExceptionCompareHow) /* (rangeExceptionCompareHow : rangeExceptionCompareHow) -> bool */ {\n return (rangeExceptionCompareHow === 2);\n}", "function end__TO__END_ques_(rangeExceptionCompareHow) /* (rangeExceptionCompareHow : rangeExceptionCompareHow) -> bool */ {\n return (rangeExceptionCompareHow === 3);\n}", "function IsForwardComplete(x, y, sh, sp) {\n return x === settings.endX && y === settings.endY && sh === settings.endBlur && sp === settings.endSpread;\n }", "function outOfRange(narrativeID, sentence){\n\tif(sentence < narrativeFrames[narrativeID]-250){\n\t\treturn true;\n\t}else if (sentence > narrativeFrames[narrativeID]+250){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}", "validate() {\n\t\tif ( this.foreground.width != this.background.width ||\n\t\t this.foreground.height != this.foreground.width ) {\n\t\t\t\tthrow \"KameraError: Vordergrund und Hintergrund sind nicht gleich groß\";\n\t\t} else\n\t\t\treturn true\n\t}", "can_move(start, end) {\n\t\tvar start_row = 8 - Math.floor(start / 8);\n\t\tvar start_col = (start % 8) + 1;\n\t\tvar end_row = 8 - Math.floor(end / 8);\n\t\tvar end_col = (end % 8) + 1;\n\n\t\tvar row_diff = end_row - start_row;\n\t\tvar col_diff = end_col - start_col;\n\n\t\tif (row_diff == col_diff) { //diagonale \"/\"\n\t\t return true;\n\t\t} else if (row_diff == -col_diff) { //diagonale \"\\\"\n\t\t return true;\n\t\t}\n\t\treturn false;\n\t }", "function time_check(e, api, time) {\n if(check) {\n (api.cuepoints || []).forEach(function(cue, index) { // Find subtitle which wasnt shown\n var entry = cue.subtitle;\n\n // skip the subtitle if it was just shown\n if (entry && currentPoint != index) {\n // if the playback position falls between subtitle line start and end time\n if (time >= cue.time && (!entry.endTime || time <= entry.endTime)) {\n // show the subtitle\n api.trigger('cuepoint', [api, cue]);\n }\n }\n });\n }\n }", "_isComparisonEnd(value) {\n return isEnd(value, this.comparisonStart, this.comparisonEnd);\n }", "_isComparisonEnd(value) {\n return isEnd(value, this.comparisonStart, this.comparisonEnd);\n }", "function cohenSutherlandClip(x1, y1, x2, y2,color){\n //calcular regiões P1, P2\n let dots = [];\n let code1 = computeCode(x1, y1);\n let code2 = computeCode(x2, y2);\n let accept = false;\n\n while(true){\n if((code1 == 0) && (code2 == 0)){\n accept = true;\n break;\n }\n else if(code1 & code2){\n break;\n }\n else {\n //Linha precisa de recorte\n //Pelo menos um dos pontos está fora\n let x, y, code_out;\n\n if (code1 != 0)\n code_out = code1;\n else\n code_out = code2;\n\n if (code_out & TOP) {\n x = x1 + (x2 - x1) * (y_max - y1) / (y2 - y1);\n y = y_max;\n } else if (code_out & BOTTOM) {\n x = x1 + (x2 - x1) * (y_min - y1) / (y2 - y1);\n y = y_min;\n } else if (code_out & RIGHT) {\n y = y1 + (y2 - y1) * (x_max - x1) / (x2 - x1);\n x = x_max;\n } else if (code_out & LEFT) {\n y = y1 + (y2 - y1) * (x_min - x1) / (x2 - x1);\n x = x_min;\n }\n\n if (code_out == code1) {\n x1 = x;\n y1 = y;\n code1 = computeCode(x1, y1);\n } else {\n x2 = x;\n y2 = y;\n code2 = computeCode(x2, y2);\n }\n }\n }\n console.log(accept);\n if (accept){\n desenha_linha(Math.round(x1), Math.round(y1),Math.round(x2),Math.round(y2),'black');\n\n return dots;\n\n }\n else{\n console.log('Line rejected');\n }\n\n}", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function checkRange(value) {\n if (value == DOT_INDEX || value == COMMA_INDEX || (value >= NUM_LOW && value <= NUM_HI) || (value >= LET_HI_LOW && value <= LET_HI_HI) || (value >= LET_LOW_LOW && value <= LET_LOW_HI)) {\n return true;\n }\n return false;\n}", "function isFull(event) {\n let candidate = event;\n return candidate !== undefined && candidate !== null &&\n typeof candidate.text === 'string' && candidate.range === undefined && candidate.rangeLength === undefined;\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point1;\n if (v_) activeStream.lineEnd();\n }", "function checkDraw() {\n if (playerOne.length + playerTwo.length === 9) {\n return true;\n }\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }", "function lineEnd() {\n if (segments) {\n linePoint(x__, y__);\n if (v__ && v_) bufferStream.rejoin();\n segments.push(bufferStream.result());\n }\n clipStream.point = point;\n if (v_) activeStream.lineEnd();\n }" ]
[ "0.69289625", "0.6233361", "0.5959626", "0.5959626", "0.5913432", "0.5913432", "0.5912402", "0.5912402", "0.5844448", "0.5832057", "0.5832057", "0.5774688", "0.57372904", "0.5627085", "0.5627085", "0.5604283", "0.54683375", "0.54639304", "0.54264635", "0.5424951", "0.5414993", "0.53903985", "0.5374149", "0.53637993", "0.5344642", "0.5344024", "0.53319097", "0.53319097", "0.53319097", "0.53130305", "0.53130305", "0.53130305", "0.53009313", "0.5282245", "0.5267072", "0.526587", "0.526587", "0.526587", "0.526587", "0.526587", "0.5257247", "0.5255471", "0.5255471", "0.52537477", "0.5247249", "0.519403", "0.51730984", "0.5167495", "0.51464796", "0.5137574", "0.51353717", "0.51353717", "0.51353717", "0.51353717", "0.51353717", "0.51353717", "0.5132997", "0.5127036", "0.51253176", "0.5114634", "0.5108177", "0.509153", "0.5086928", "0.5082939", "0.50771505", "0.50771505", "0.50763905", "0.50701195", "0.506813", "0.50653416", "0.5054073", "0.50531965", "0.5052683", "0.5048863", "0.5048863", "0.5040381", "0.5028723", "0.5028723", "0.5028723", "0.5028723", "0.5028723", "0.5012237", "0.5002687", "0.500152", "0.49995255", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574", "0.4993574" ]
0.78991425
0
checks previous and next segments
function checkPrevAndNext(id, checkTimefields) { if (!continueProcessing) { checkTimefields = checkTimefields || false; var inserted = false; if (editor.splitData && editor.splitData.splits) { var duration = getDuration(); var current = editor.splitData.splits[id]; // new first item if (id == 0) { var clipBegin = parseFloat(current.clipBegin); var clipEnd = parseFloat(current.clipEnd); if (editor.splitData.splits.length > 1) { var next = editor.splitData.splits[1]; next.clipBegin = clipEnd; } if ((!checkTimefields || (checkTimefields && (getTimefieldTimeBegin() != 0))) && (clipBegin > minSegmentLength)) { ocUtils.log("Inserting a first split element (cpan - auto): (" + 0 + " - " + clipBegin + ")"); var newSplitItem = { clipBegin: 0, clipEnd: clipBegin, enabled: true }; inserted = true; // add new item to front editor.splitData.splits.splice(0, 0, newSplitItem); insertedFirstItem = true; } else if (clipBegin > 0) { ocUtils.log("Extending the first split element to (cpan - auto): (" + 0 + " - " + clipEnd + ")"); current.clipBegin = 0; } } // new last item else if ((editor.splitData.splits.length > 0) && (id == editor.splitData.splits.length - 1)) { if ((!checkTimefields || (checkTimefields && (getTimefieldTimeEnd() != duration))) && (current.clipEnd < (duration - minSegmentLength))) { ocUtils.log("Inserting a last split element (cpan - auto): (" + current.clipEnd + " - " + duration + ")"); var newLastItem = { clipBegin: parseFloat(current.clipEnd), clipEnd: parseFloat(duration), enabled: true }; inserted = true; // add the new item to the end editor.splitData.splits.push(newLastItem); var prev = editor.splitData.splits[id - 1]; prev.clipEnd = parseFloat(current.clipBegin); insertedLastItem = true; } else { ocUtils.log("Extending the last split element to (cpan - auto): (" + current.clipBegin + " - " + duration + ")"); current.clipEnd = parseFloat(duration); } } // in the middle else if ((id > 0) && (id < (editor.splitData.splits.length - 1))) { var prev = editor.splitData.splits[id - 1]; var next = editor.splitData.splits[id + 1]; if (checkTimefields && (getTimefieldTimeBegin() <= prev.clipBegin)) { displayMsg("The inpoint is lower than the begin of the last segment. Please check.", "Check inpoint"); return { ok: false, inserted: false }; } if (checkTimefields && (getTimefieldTimeEnd() >= next.clipEnd)) { displayMsg("The outpoint is bigger than the end of the next segment. Please check.", "Check outpoint"); return { ok: false, inserted: false }; } prev.clipEnd = parseFloat(current.clipBegin); next.clipBegin = parseFloat(current.clipEnd); } } return { ok: true, inserted: inserted }; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (new_id < 0) ? (editor.splitData.splits.length - 1) : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id <= 0) ? editor.splitData.splits.length : new_id;\n for (var i = new_id - 1; i >= 0; --i) {\n\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = editor.splitData.splits.length - 1; i >= 0; --i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "hasPrev() {\n return this.state.offset < this.state.history.length - 1;\n }", "hasPrevious(path) {\n return path[path.length - 1] > 0;\n }", "function hasPrevious() {\n return (currentVideo > 0);\n }", "hasPreviousStep() {\n return this.hasStep(this.currentStepIndex - 1);\n }", "resolveSegmentSegment(ax1, ay1, ax2, ay2, bx1, by1, bx2, by2) {\n const result = [];\n const isHorizontal1 = ax2 - ax1 > ay2 - ay1;\n const isHorizontal2 = bx2 - bx1 > by2 - by1;\n\n if (isHorizontal1 && isHorizontal2 &&\n by1 === ay1 &&\n ((ax1 <= bx2 && ax1 >= bx1) || (ax2 <= bx2 && ax2 >= bx1) || (bx1 <= ax2 && bx1 >= ax1) || (bx2 <= ax2 && bx2 >= ax1))) {\n\n if (bx1 < ax1) result.push(bx1, by1, ax1, by1);\n if (bx2 > ax2) result.push(ax2, by2, bx2, by2);\n\n } else if (!isHorizontal1 && isHorizontal2 &&\n by1 >= ay1 && by1 < ay2 &&\n ((ax1 <= bx2 && ax1 >= bx1) || (ax2 <= bx2 && ax2 >= bx1) || (bx1 <= ax2 && bx1 >= ax1) || (bx2 <= ax2 && bx2 >= ax1))) {\n\n if (bx1 < ax1) result.push(bx1, by1, ax1, by1);\n if (bx2 > ax2) result.push(ax2 + 1, by2, bx2, by2);\n\n } else if (!isHorizontal1 && !isHorizontal2 &&\n ax1 === bx2 &&\n ((by1 <= ay2 && by1 >= ay1) || (by2 <= ay2 && by2 >= ay1) || (ay1 <= by2 && ay1 >= by1) || (ay2 <= by2 && ay2 >= by1))) {\n\n if (by1 < ay1) result.push(bx1, by1, bx1, ay1);\n if (by2 > ay2) result.push(bx2, ay2, bx2, by2);\n\n } else if (isHorizontal1 && !isHorizontal2 &&\n bx1 >= ax1 && bx1 < ax2 &&\n ((ay2 <= by2 && ay2 >= by1) || (ay1 <= by2 && ay1 >= by1) || (by2 <= ay2 && by2 >= ay1) || (by1 <= ay2 && by1 >= ay1))) {\n\n if (by1 < ay1) result.push(bx1, by1, bx1, ay1);\n if (by2 > ay2) result.push(bx2, ay2 + 1, bx2, by2);\n\n } else { // segments do not intersect\n result.push(bx1, by1, bx2, by2);\n }\n\n return result;\n }", "hasPreviousSibling() {\n return Array.isArray(this._containers.top()) && this._indexes.top() > 0;\n }", "prevExists() {\r\n\t\treturn this.curr.prev == null ? false : true;\r\n\t}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSlotSegs(seg1, seg2);\n}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSlotSegs(seg1, seg2);\n}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSlotSegs(seg1, seg2);\n}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSlotSegs(seg1, seg2);\n}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSlotSegs(seg1, seg2);\n}", "function onSegment(p, q, r) {\n if (\n q[0] <= Math.max(p[0], r[0]) &&\n q[0] >= Math.min(p[0], r[0]) &&\n q[1] <= Math.max(p[1], r[1]) &&\n q[1] >= Math.min(p[1], r[1])\n ) {\n return true;\n }\n\n return false;\n}", "function previousSteps() {\n\tcurrent_step = current_step - 1;\n\tnext_step = next_step - 1;\n}", "isPrevious(turn) {\n return JSON.stringify(JSON.stringify(Array.from(this.stateAfter))) === JSON.stringify(JSON.stringify(Array.from(turn.stateBefore)))\n }", "function findDiscontinuousReferenceFrag(prevDetails,curDetails){var prevFrags=prevDetails.fragments;var curFrags=curDetails.fragments;if(!curFrags.length||!prevFrags.length){logger_1.logger.log('No fragments to align');return;}var prevStartFrag=findFirstFragWithCC(prevFrags,curFrags[0].cc);if(!prevStartFrag||prevStartFrag&&!prevStartFrag.startPTS){logger_1.logger.log('No frag in previous level to align on');return;}return prevStartFrag;}", "function getDiffOffsets(prev, next) {\n if (prev === next) return null;\n var start = getDiffStart(prev, next);\n if (start === null) return null;\n var maxEnd = Math.min(prev.length - start, next.length - start);\n var end = getDiffEnd(prev, next, maxEnd);\n if (end === null) return null;\n return {\n start,\n end\n };\n}", "function hideNextPrev(el) {\n var lastIsVisible = (($(el).children('li').last().offset().left + $(el).children('li').last().outerWidth(true) - $(el).parent().offset().left) <= $(el).parent().outerWidth(true));\n if (lastIsVisible) {\n $(el).parent().find(\"a.move-next\").hide();\n }\n else {\n $(el).parent().find(\"a.move-next\").show();\n }\n\n var firstIsVisible = (($(el).children('li').first().offset().left - $(el).parent().offset().left) >= 0);\n if (firstIsVisible) {\n $(el).parent().find(\"a.move-prev\").hide();\n }\n else {\n $(el).parent().find(\"a.move-prev\").show();\n }\n }", "function nextSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id + 1;\n\n new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id;\n\n for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = 0; i < new_id; ++i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function compareForwardSlotSegs(seg1, seg2) {\n\t// put higher-pressure first\n\treturn seg2.forwardPressure - seg1.forwardPressure ||\n\t\t// put segments that are closer to initial edge first (and favor ones with no coords yet)\n\t\t(seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n\t\t// do normal sorting...\n\t\tcompareSegs(seg1, seg2);\n}", "function compareForwardSlotSegs(seg1, seg2) {\n // put higher-pressure first\n return seg2.forwardPressure - seg1.forwardPressure ||\n // put segments that are closer to initial edge first (and favor ones with no coords yet)\n (seg1.backwardCoord || 0) - (seg2.backwardCoord || 0) ||\n // do normal sorting...\n compareSegs(seg1, seg2);\n }", "hasPreviousPage() {\n return this.pageIndex >= 1 && this.pageSize != 0;\n }", "function _isPrevDay(d1, d2) {\n return _isNextDay(d2, d1);\n }", "function onSegment(p, q, r)\n{\n if (q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y))\n return true;\n\n return false;\n}", "edgeCheck() {\n\n // check if the selected segment has hit a vertical wall (left or right walls)\n if (this.segments[this.select].x + (this.segments[this.select].width /2) >= width || this.segments[this.select].x - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaX *= -1;\n }\n // check if the selected segment has hit a horizontal wall (top or bottom walls)\n if (this.segments[this.select].y + (this.segments[this.select].width /2) >= height || this.segments[this.select].y - (this.segments[this.select].width /2) <= 0) {\n this.segments[this.select].deltaY *= -1;\n }\n }", "function checkPreviousDiv(mas_a, mas_b, temp_a, temp_b) {\r\n for (var k = 0; k < mas_a.length; k++) {\r\n if (temp_a == mas_a[k] && temp_b == mas_b[k]) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n}", "previous() {\n const newIndex = this.index - 1;\n\n if (this.isOutRange(newIndex)) {\n return;\n }\n\n this.doSwitch(newIndex);\n }", "function onSegment(p, q, r) {\n if (\n q.x <= Math.max(p.x, r.x) &&\n q.x >= Math.min(p.x, r.x) &&\n q.y <= Math.max(p.y, r.y) &&\n q.y >= Math.min(p.y, r.y)\n )\n return true\n\n return false\n}", "function prevslid()\n {\n if (prevButton.classList.contains('disabled'))\n {\n return false;\n }\n else\n {\n currentslid--;\n thechecker();\n }\n }", "function condition() {\n const message = (previousBlockNumber == currentBlockNumber) ? 'not yet' : 'next block found';\n verbose(`waitNextBlock: condition: previous:${previousBlockNumber} current:${currentBlockNumber} - ${message}`);\n if (currentBlockNumber === undefined) return true;\n if (previousBlockNumber === undefined) return true;\n // keep going while current is same as previous\n return previousBlockNumber == currentBlockNumber ;\n }", "computeControlSegments() {\n if (this.controlSteps.length) {\n this.controlSegments = [];\n let segment = { start : 0, end : 0, human : this.controlSteps[0] }\n for (let i = 0; i < this.controlSteps.length; ++i) {\n const humanStep = this.controlSteps[i];\n if (humanStep != segment.human) {\n this.controlSegments.push(segment);\n segment = { start : i, end : i, human : humanStep };\n } else {\n segment.end = i;\n }\n }\n this.controlSegments.push(segment);\n }\n }", "valid(index) { return (this.start<=index && index<this.end) }", "function navigatePrev() {\n\n // Prioritize revealing fragments\n if (previousFragment() === false) {\n if (availableRoutes().up) {\n navigateUp();\n }\n else {\n // Fetch the previous horizontal slide, if there is one\n var previousSlide = document.querySelector(HORIZONTAL_SLIDES_SELECTOR + '.past:nth-child(' + indexh + ')');\n\n if (previousSlide) {\n var v = ( previousSlide.querySelectorAll('section').length - 1 ) || undefined;\n var h = indexh - 1;\n slide(h, v);\n }\n }\n }\n\n }", "check() {\n const {\n showNext: stateShowNext,\n showPrev: stateShowPrev,\n } = this.state;\n if (!this.carousel) return;\n const st = this.carousel.state;\n const showNext = st.currentSlide < st.slideCount - st.slidesToScroll;\n const showPrev = st.left < 0;\n if (showNext !== stateShowNext\n || showPrev !== stateShowPrev) {\n this.setState({ showPrev, showNext });\n }\n }", "shouldComponentUpdate(nextProps, nextState){\n const props = this.props;\n const state = this.state;\n if ((props.document !== nextProps.document)\n || (props.segmentId !== nextProps.segmentId)\n || (props.layers !== nextProps.layers)\n || (state.mode !== nextState.mode)) {\n return true;\n }\n\n // Compare visible segments\n var currentVisible = this.computeVisibleSegments(props.segments, props.currentTime);\n var nextVisible = this.computeVisibleSegments(nextProps.segments, nextProps.currentTime);\n if (currentVisible.length !== nextVisible.length) return true;\n for(var i=0; i<currentVisible.length; i++){\n if (currentVisible[i] !== nextVisible[i]) return true;\n }\n return false;\n }", "function destination(){\n prev=-1;\n flag1=0;\nv=1;\nflag2=1;\n}", "function isPreviousSlide(entryID) {\n\t\tvar slideExists = (indexes[currentIndex-1]);\n\t\tif (slideExists) {\n\t\t\treturn (entryID === indexes[currentIndex-1]);\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "function onSegment( p, q, r ) {\n\n\t\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n\t}", "function calcNextPrev(index, array, direction) {\n if (direction === 'next') {\n return array[index + 1] ? array[index + 1] : array[0];\n } else if (direction === 'prev') {\n return array[index - 1] ? array[index - 1] : array[array.length - 1];\n }\n\n return false;\n }", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function onSegment(p, q, r) {\n return q.x <= Math.max(p.x, r.x) && q.x >= Math.min(p.x, r.x) && q.y <= Math.max(p.y, r.y) && q.y >= Math.min(p.y, r.y);\n}", "function findDiscontinuousReferenceFrag(prevDetails, curDetails) {\n var prevFrags = prevDetails.fragments;\n var curFrags = curDetails.fragments;\n\n if (!curFrags.length || !prevFrags.length) {\n logger[\"b\" /* logger */].log('No fragments to align');\n return;\n }\n\n var prevStartFrag = findFirstFragWithCC(prevFrags, curFrags[0].cc);\n\n if (!prevStartFrag || prevStartFrag && !prevStartFrag.startPTS) {\n logger[\"b\" /* logger */].log('No frag in previous level to align on');\n return;\n }\n\n return prevStartFrag;\n}", "function findDiscontinuousReferenceFrag(prevDetails, curDetails) {\n var prevFrags = prevDetails.fragments;\n var curFrags = curDetails.fragments;\n\n if (!curFrags.length || !prevFrags.length) {\n logger[\"b\" /* logger */].log('No fragments to align');\n return;\n }\n\n var prevStartFrag = findFirstFragWithCC(prevFrags, curFrags[0].cc);\n\n if (!prevStartFrag || prevStartFrag && !prevStartFrag.startPTS) {\n logger[\"b\" /* logger */].log('No frag in previous level to align on');\n return;\n }\n\n return prevStartFrag;\n}", "function onSegment( p, q, r ) {\n\n\treturn q.x <= Math.max( p.x, r.x ) && q.x >= Math.min( p.x, r.x ) && q.y <= Math.max( p.y, r.y ) && q.y >= Math.min( p.y, r.y );\n\n}", "function brokenEdge(aprev, anext, bprev, bnext) {\n var apx = xx[aprev],\n anx = xx[anext],\n bpx = xx[bprev],\n bnx = xx[bnext],\n apy = yy[aprev],\n any = yy[anext],\n bpy = yy[bprev],\n bny = yy[bnext];\n if (apx == bnx && anx == bpx && apy == bny && any == bpy ||\n apx == bpx && anx == bnx && apy == bpy && any == bny) {\n return false;\n }\n return true;\n }", "function check_ends(img){\n // check for pictures before\n if (img.parent().prev().children().length <= 0){\n $('img#arrow-left').addClass('arrow-hide');\n } else {\n $('img#arrow-left').removeClass('arrow-hide');\n }\n // check before pictures after\n if (img.parent().next().children().length <= 0){\n $('img#arrow-right').addClass('arrow-hide');\n } else {\n $('img#arrow-right').removeClass('arrow-hide');\n }\n}", "hasNext() {\n return this.state.offset > 0 && this.state.history.length > 1;\n }", "endsBefore(path, another) {\n var i = path.length - 1;\n var as = path.slice(0, i);\n var bs = another.slice(0, i);\n var av = path[i];\n var bv = another[i];\n return Path.equals(as, bs) && av < bv;\n }", "endsBefore(path, another) {\n var i = path.length - 1;\n var as = path.slice(0, i);\n var bs = another.slice(0, i);\n var av = path[i];\n var bv = another[i];\n return Path.equals(as, bs) && av < bv;\n }", "function previousToken() {\n\t\tif (thisTokenNumber > 1) {\n\t\t\tthisTokenNumber--;\n\t\t\tthisToken = t[thisTokenNumber - 1];\n\t\t\tif (thisTokenNumber > 1) {\n\t\t\t\tlastToken = t[thisTokenNumber - 2];\n\t\t\t} else {\n\t\t\t\tlastToken = '';\n\t\t\t}\n\t\t\treturn true;\n\t\t} else\n\t\t\treturn false;\n\t}", "get reversed() {\n return \"prev\" === this._next;\n }", "checkValidMove(origin, destination)\n {\n\n if(this.checkEmptyStack(origin))\n {\n return false;\n }\n else if(this.posting[origin-1][this.posting[origin-1].length-1] > this.posting[destination-1][this.posting[destination-1].length-1])//checks for big disks that are on top of smaller disks\n {\n console.log(this.posting[origin-1][this.posting[origin-1].length-1]);\n console.log(this.posting[destination-1][this.posting[destination-1].length-1]);\n return false;\n }\n else\n {\n return true;\n }\n }", "function isDaySegCollision(seg,otherSegs){var i;var otherSeg;for(i=0;i<otherSegs.length;i++){otherSeg=otherSegs[i];if(otherSeg.leftCol<=seg.rightCol&&otherSeg.rightCol>=seg.leftCol){return true;}}return false;}// A cmp function for determining the leftmost event", "function checkOverlapse(direction) {\n\t\textraTop = newTop;\n\t\textraLeft = newLeft;\n\t\t\n\t\tlet overlapRows = false;\n\t\t let overlapCols = false;\n\t\t\n\t\tif (currTopPx % dimension != 0)\n\t\t\toverlapRows = true;\n\t\tif (currLeftPx % dimension != 0)\n\t\t\toverlapCols = true;\n\t\t\n\t\tswitch(direction) {\n\t\t\tcase leftKey:\n\t\t\tcase rightKey:\t \n\t\t\t\tif (overlapRows)\n\t\t\t\t\textraTop = newTop + 1;\n\t\t\t\tbreak;\n\t\n\t\t\tcase upKey:\n\t\t\tcase downKey: \n\t\t\t\tif (overlapCols)\n\t\t\t\t\textraLeft = newLeft + 1;\n\t\t\t\tbreak;\t\t\t\t\t\t\n\t\t}\n\t}", "function computeSlotSegCollisions(seg,otherSegs,results){if(results===void 0){results=[];}for(var i=0;i<otherSegs.length;i++){if(isSlotSegCollision(seg,otherSegs[i])){results.push(otherSegs[i]);}}return results;}// Do these segments occupy the same vertical space?", "shouldScheduleNavigation(previous, current) {\n if (!previous)\n return true;\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n return true;\n }", "shouldScheduleNavigation(previous, current) {\n if (!previous)\n return true;\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n return true;\n }", "shouldScheduleNavigation(previous, current) {\n if (!previous)\n return true;\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n return true;\n }", "shouldScheduleNavigation(previous, current) {\n if (!previous)\n return true;\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n return true;\n }", "shouldScheduleNavigation(previous, current) {\n if (!previous)\n return true;\n const sameDestination = current.urlTree.toString() === previous.urlTree.toString();\n const eventsOccurredAtSameTime = current.transitionId === previous.transitionId;\n if (!eventsOccurredAtSameTime || !sameDestination) {\n return true;\n }\n if ((current.source === 'hashchange' && previous.source === 'popstate') ||\n (current.source === 'popstate' && previous.source === 'hashchange')) {\n return false;\n }\n return true;\n }", "function isTherePreviousStep() {\n\tif ((recipe[(current_step - 1)]) == undefined) {\n\t\treturn false;\n\t}\n\telse {\n\t\treturn true;\n\t}\t\n}", "function isDestinyTheStartingSection(){\n var anchor = getAnchorsURL();\n var destinationSection = getSectionByAnchor(anchor.section);\n return !anchor.section || !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\n }", "function isDestinyTheStartingSection(){\n var anchor = getAnchorsURL();\n var destinationSection = getSectionByAnchor(anchor.section);\n return !anchor.section || !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\n }", "function isDestinyTheStartingSection(){\n var anchor = getAnchorsURL();\n var destinationSection = getSectionByAnchor(anchor.section);\n return !anchor.section || !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\n }", "function goPrev( event ){\n event.preventDefault();\n go( revOffset + 1 );\n return false;\n }", "nextSection() {\r\n this.setState({ prev: true });\r\n if (this.state.viewFirst) {\r\n this.setState({ viewFirst: false, viewSecond: true });\r\n }\r\n if (this.state.viewSecond) {\r\n this.setState({ viewSecond: false, viewThird: true, next: false });\r\n }\r\n }", "prevStep() {\n\n if (this.currStep > -1) {\n\n this.goTo(this.currSlide, this.currStep - 1);\n\n }\n\n }", "function onSegment (pi, pj, pk) {\n return Math.min(pi[0], pj[0]) <= pk[0] &&\n pk[0] <= Math.max(pi[0], pj[0]) &&\n Math.min(pi[1], pj[1]) <= pk[1] &&\n pk[1] <= Math.max(pi[1], pj[1]);\n}", "function hasPrevious(id) {\n\t\treturn getFilteredIndexOf(id) > 0;\n\t}", "function prev(){\n\tif(state == \"blank\") return;\n\tif(--cursched < 0) cursched = schedules.length-1;\n\tdraw();\n}", "function isDestinyTheStartingSection(){\r\n var anchor = getAnchorsURL();\r\n var destinationSection = getSectionByAnchor(anchor.section);\r\n return !anchor.section || !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\r\n }", "function _previousStep() {\n\t this._direction = 'backward';\n\n\t if (this._currentStep === 0) {\n\t return false;\n\t }\n\n\t var nextStep = this._introItems[--this._currentStep];\n\t if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n\t this._introBeforeChangeCallback.call(this, nextStep.element);\n\t }\n\n\t _showElement.call(this, nextStep);\n\t }", "checkForBeginning() {\n if (this.leftPage !== 1) {\n this.onFirstPage = false;\n } else {\n this.onFirstPage = true;\n }\n }", "decision () {\n\n // console.log('length: ', this.leves.length)\n if ((this.currentIndexLevel == this.leves.length - 1)) {\n return true\n }\n return false\n }", "function checkValidEnd(point) {\n var valid = true;\n var payload = {\n msg: \"INVALID_END_NODE\",\n body: {\n newLine: null,\n heading: \"Player \"+gameState.player,\n message: \"Invalid Move!\"\n }\n };\n\n if (isEqual(point, gameState.firstPoint)) {\n gameState.click = 1;\n return payload;\n }\n\n if (gameState.startSegment.inner.x === -1) {\n var slope = Math.abs(getSlope(point, gameState.firstPoint));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"start\") {\n var slope = Math.abs(getSlope(point, gameState.startSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n else if (gameState.endPoint === \"end\") {\n var slope = Math.abs(getSlope(point, gameState.endSegment.outer));\n if (slope !== 0 && slope !== 1 && Number.isFinite(slope)) {\n gameState.click = 1;\n return payload;\n }\n }\n\n // Check for intersections with existing segments\n if (checkIntersection(point, gameState.endPoint, gameState)){\n gameState.click = 1;\n return payload;\n }\n\n // If new line is an extension of an existing line, update startSegment and endSegment\n // If new line is not an extension, push the old startSegment and endSegment to the segments array and replace startSegment and endSegment\n if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"start\" && extension(point, gameState.startSegment)) {\n gameState.startSegment.outer = point;\n }\n else if (gameState.startSegment.inner.x !== -1 && gameState.endPoint === \"end\" && extension(point, gameState.endSegment)) {\n gameState.endSegment.outer = point;\n }\n else {\n // Checks if 1st line segment in game\n if (gameState.startSegment.inner.x === -1) {\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n gameState.endSegment = {inner: gameState.firstPoint, outer: gameState.firstPoint};\n }\n else if (gameState.endPoint === \"start\") {\n gameState.segments.push(gameState.startSegment);\n gameState.startSegment = {inner: gameState.firstPoint, outer: point};\n }\n else if (gameState.endPoint === \"end\") {\n gameState.segments.push(gameState.endSegment);\n gameState.endSegment = {inner: gameState.firstPoint, outer: point};\n }\n }\n gameState.player = -1*gameState.player+3;\n\n payload = {\n msg: \"VALID_END_NODE\",\n body: {\n newLine: {\n start: gameState.firstPoint,\n end: point\n },\n heading: \"Player \"+gameState.player,\n message: \"Awaiting Player \"+gameState.player+\"'s Move\"\n }\n }\n gameState.click = 1;\n\n if (checkGameOver(gameState)) {\n payload.msg = \"GAME OVER\";\n payload.body.heading = \"Game Over\";\n payload.body.message = \"Player \"+(-1*gameState.player+3)+\" Wins\"\n }\n\n return payload;\n}", "function isTerminating(cpNode) {\n // return this === this.next.prevOnCircle;\n return cpNode === cpNode.next.prevOnCircle;\n}", "function _isPrevMonth(d1, d2) {\n return _isNextMonth(d2, d1);\n }", "function previousPage () {\n var i, tab, elements = getElements();\n\n for (i = 0; i < elements.tabs.length; i++) {\n tab = elements.tabs[ i ];\n if (tab.offsetLeft + tab.offsetWidth >= ctrl.offsetLeft) break;\n }\n \n if (elements.canvas.clientWidth > tab.offsetWidth) {\n //Canvas width *greater* than tab width: usual positioning\n ctrl.offsetLeft = fixOffset(tab.offsetLeft + tab.offsetWidth - elements.canvas.clientWidth);\n } else {\n /**\n * Canvas width *smaller* than tab width: positioning at the *beginning* of current tab to let \n * pagination \"for loop\" to break correctly on previous tab when previousPage() is called again\n */\n ctrl.offsetLeft = fixOffset(tab.offsetLeft); \n }\n }", "function prev() {\n\t\t\treturn go(current-1);\n\t\t}", "function locallyInside(data, a, b) {\n return orient(data, a.prev.i, a.i, a.next.i) === -1 ?\n orient(data, a.i, b.i, a.next.i) !== -1 && orient(data, a.i, a.prev.i, b.i) !== -1 :\n orient(data, a.i, b.i, a.prev.i) === -1 || orient(data, a.i, a.next.i, b.i) === -1;\n}", "async loadPreviousPages() {\n logger.debug('AnnotationListWidget#loadPreviousPages', this._loading);\n try {\n if (this._loading) {\n return;\n }\n this._loading = true;\n const minHeight = this._rootElem.height() * this._minContentRelativeHeight;\n const numPages = this._nav.getNumPages();\n let scrollHeight = this._rootElem[0].scrollHeight;\n\n for (let nextPage = this._nav.getActiveRange().startPage - 1;\n nextPage >= 0 && scrollHeight < minHeight;\n scrollHeight = this._rootElem[0].scrollHeight, --nextPage)\n {\n logger.debug('AnnotationListWidget#_loadPreviousPages nextPage:', nextPage, 'scrollHeight:', scrollHeight, 'minHeight:', minHeight);\n await this._loadPage(nextPage);\n }\n } catch (e) {\n logger.error('AnnotationListWidget#loadPreviousPages failed', e);\n } finally {\n this._loading = false;\n }\n }", "function test(arr) {\n if (arr.length < 1) return;\n let prev = arr[0];\n let next = arr[0];\n let result = [];\n for (let i = 1; i < arr.length; ++i) {\n if (arr[i] - next > 1) {\n if (next !== prev) {\n result.push(prev.toString() + \"->\" + next.toString());\n } else {\n result.push(next.toString());\n }\n prev = arr[i];\n next = arr[i];\n } else {\n next = arr[i];\n }\n }\n if (next !== prev) {\n result.push(prev.toString() + \"->\" + next.toString());\n } else {\n result.push(next.toString());\n }\n return result;\n}", "hasStarted () {\r\n return Boolean(this._pastPos[this._pastPos.length-1])\r\n }", "handlePrevPage() {\n if (this.props.start - 20 <= 0) {\n return;\n }\n this.props.getPrevPage(this.props.page - 1);\n }", "function checkVert(curArray, posArray) {\n for (var iter = 0; iter < curArray.length; iter++) {\n for (var i = 0; i < posArray.length; i++) {\n if (posArray[i][1] === curArray[iter][1] &&\n (posArray[i][0] === curArray[iter][0] + 1 ||\n posArray[i][0] === curArray[iter][0] - 1 ||\n posArray[i][0] === curArray[iter][0])) {\n\n return true;\n }\n }\n }\n\n return false;\n\n}", "get isInMiddle() {\n return !this.isFirst && !this.isLast;\n }", "previous(){\n let previous = this.currentId - 1;\n if(previous <= 1){\n previous = 1;\n }\n this.goto(previous);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function _previousStep() {\n this._direction = 'backward';\n\n if (this._currentStep === 0) {\n return false;\n }\n\n var nextStep = this._introItems[--this._currentStep];\n if (typeof (this._introBeforeChangeCallback) !== 'undefined') {\n this._introBeforeChangeCallback.call(this, nextStep.element);\n }\n\n _showElement.call(this, nextStep);\n }", "function showprevious_slots(data,next){\n\t//alert('called');\n\t$('#'+data).css('display','block');\n\t$('#'+next).css('display','none');\n\t//$('#'+data+1).css('display','none');\n\t//$('#'+data).toggle('slow');\n}", "function isDestinyTheStartingSection(){\r\n var destinationSection = getSectionByAnchor(getAnchorsURL().section);\r\n return !destinationSection || destinationSection.length && destinationSection.index() === startingSection.index();\r\n }", "function check() {\n document.getElementById(\"next\").disabled = currentPage == numberOfPages ? true : false;\n document.getElementById(\"previous\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"first\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"last\").disabled = currentPage == numberOfPages ? true : false;\n}", "function check() {\n document.getElementById(\"next\").disabled = currentPage == numberOfPages ? true : false;\n document.getElementById(\"previous\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"first\").disabled = currentPage == 1 ? true : false;\n document.getElementById(\"last\").disabled = currentPage == numberOfPages ? true : false;\n}", "function isDestinyTheStartingSection(){\r\n var destinationSection = getSectionByAnchor(getAnchorsURL().section);\r\n return !destinationSection || typeof destinationSection !=='undefined' && index(destinationSection) === index(startingSection);\r\n }" ]
[ "0.6279939", "0.61847574", "0.6064243", "0.5875473", "0.5785764", "0.5714955", "0.56907463", "0.56884146", "0.5667187", "0.5667187", "0.5667187", "0.5667187", "0.5667187", "0.56662804", "0.566206", "0.5639163", "0.5626988", "0.5625037", "0.5624068", "0.5616481", "0.5615542", "0.56149036", "0.557644", "0.55724835", "0.55020905", "0.54981863", "0.54956865", "0.5494524", "0.5477924", "0.54683435", "0.5458145", "0.5451863", "0.5450782", "0.54458755", "0.5421325", "0.5383959", "0.5379728", "0.5379282", "0.53756946", "0.537402", "0.5370484", "0.5370484", "0.5370484", "0.5370484", "0.53667504", "0.53667504", "0.5362566", "0.5360818", "0.53544205", "0.53373283", "0.5312573", "0.5312573", "0.5310882", "0.5308596", "0.5273194", "0.52722836", "0.52699876", "0.52671593", "0.52565217", "0.52565217", "0.52565217", "0.52565217", "0.52565217", "0.52501506", "0.5244228", "0.5244228", "0.5244228", "0.5228807", "0.5225737", "0.5217086", "0.5216557", "0.52141434", "0.52077216", "0.520663", "0.5187391", "0.5178298", "0.5177145", "0.51741433", "0.51732814", "0.5173272", "0.51672", "0.5159783", "0.5157792", "0.5157749", "0.5150973", "0.514675", "0.51451623", "0.51428074", "0.514231", "0.5137297", "0.51306355", "0.51306355", "0.51306355", "0.51306355", "0.51306355", "0.51289713", "0.51289356", "0.51284194", "0.51284194", "0.51278234" ]
0.5889478
3
click click handler for saving data in editing box
function okButtonClick() { if (!continueProcessing && checkClipBegin() && checkClipEnd()) { id = $('#splitUUID').val(); if (id != "") { var current = editor.splitData.splits[id]; var tmpBegin = parseFloat(current.clipBegin); var tmpEnd = parseFloat(current.clipEnd); var duration = getDuration(); id = parseInt(id); if (getTimefieldTimeBegin() > getTimefieldTimeEnd()) { displayMsg("The inpoint is bigger than the outpoint. Please check and correct it.", "Check and correct inpoint and outpoint"); selectSegmentListElement(id); return; } if (checkPrevAndNext(id, true).ok) { if (editor.splitData && editor.splitData.splits) { current.clipBegin = getTimefieldTimeBegin(); current.clipEnd = getTimefieldTimeEnd(); if (id > 0) { if (current.clipBegin > editor.splitData.splits[id - 1].clipBegin) { editor.splitData.splits[id - 1].clipEnd = current.clipBegin; } else { displayMsg("The inpoint is bigger than the inpoint of the segment before this segment. Please check and correct it.", "Check and correct inpoint"); setTimefieldTimeBegin(editor.splitData.splits[id - 1].clipEnd); selectSegmentListElement(id); return; } } var last = editor.splitData.splits[editor.splitData.splits.length - 1]; if (last.clipEnd < duration) { ocUtils.log("Inserting a last split element (auto): (" + current.clipEnd + " - " + duration + ")"); var newLastItem = { clipBegin: parseFloat(last.clipEnd), clipEnd: parseFloat(duration), enabled: true }; // add the new item to the end editor.splitData.splits.push(newLastItem); } for (var i = 0; i < editor.splitData.splits.length; ++i) { if (checkPrevAndNext(i, false).inserted) { i = 0; } } } editor.updateSplitList(true, !zoomedIn()); $('#videoPlayer').focus(); selectSegmentListElement(id); } else { current.clipBegin = tmpBegin; current.clipEnd = tmpEnd; selectSegmentListElement(id); } } } else { selectCurrentSplitItem(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function save(e) {\n let saveBtn = e.target;\n let inputBox = event.target.parentNode.lastChild;\n event.target.parentNode.firstChild.textContent = inputBox.value;\n inputBox.style.display = \"none\";\n saveBtn.style.display=\"none\";\n let editBtn = event.target.nextSibling;\n editBtn.style.display = \"inline\";\n \n}", "function edit(e) {\n e.preventDefault()\n const editBox = document.createElement(\"input\")\n const saveButton = document.createElement(\"button\")\n editBox.value = e.currentTarget.parentElement.firstElementChild.innerText\n saveButton.innerText = \"save\"\n // saveButton.addEventListener(\"click\", save(e))\n e.currentTarget.parentElement.firstElementChild.appendChild(editBox)\n e.currentTarget.parentElement.firstElementChild.appendChild(saveButton)\n // e.target.remove(target)\n\n}", "save() {\n try {\n this._toggleSaveThrobber();\n this._readFromForm();\n this.dao.save();\n\n // make sure the edit input is showing the correct id, reload data from server\n document.getElementById('edit_id').value = this.dao.id;\n this.read();\n \n } catch(e) {\n console.log(e);\n alert(e);\n }\n this._toggleSaveThrobber();\n }", "function saveAction(){\n\t\tvar data = getInput();\n\t\tif(data.id == \"\") {\n\t\t\t// delete the id property as it's\n\t\t\t// automatically set by database.\n\t\t\tdelete data.id;\n\t\t\tupdateDB(\"add\", data);\n\t\t}\n\t\telse {\n\t\t\tdata.id = Number(data.id);\n\t\t\tupdateDB(\"edit\", data);\n\t\t}\n\t\tclearInput();\n\t}", "function handleSaveItem(event){\n //Console readout\n //console.log(\"Saving item...\")\n \n //Convert the button that was clicked to a jQuery DOM item\n var target = $(event.target);\n\n //Check if the save icon is clicked instead of the button itself and adjust handle accordingly\n if (target.hasClass(\"fas\")){\n saveButton = $(event.target).parent();\n }else{\n saveButton = target;\n }\n \n //Get index for data save from data attribute \n var index = saveButton.parent().children('textarea').data('index');\n\n //Get entered text for timeblock\n var text = saveButton.parent().children('textarea').val();\n\n //Enter item into local storage\n localStorage.setItem(index,text);\n\n}", "function saveEdited(){\n\tactiveDataSet = studentList.find( arr => arr.absenceId == activeElement ); \n\t$.post(\"\", {\n\t\t\t\t'type': 'editabsence',\n\t\t\t\t'console': '',\n\t\t\t\t'aid': activeDataSet['absenceId'],\n\t\t\t\t'id': activeElement,\n\t\t\t\t'start': formatDateDash(document.getElementById('esickstart').value),\n\t\t\t\t'end': formatDateDash(document.getElementById('esickend').value),\n\t\t\t\t'comment': document.getElementById('ecomment').value,\n\t\t\t\t'evia': document.querySelector('input[name=\"evia\"]:checked').value\n }, function (data,status) {\n\t\t\t\thandleServerResponse(data, status);\n\t\t\t});\t\n}", "function save() {\n $editors.find('.text').each(function () {\n $(this).closest('.fields').find('textarea').val(this.innerHTML);\n });\n }", "function Save() {\n if ($('#ab041AddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab041\",vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n } else {\n dataContext.upDate(\"/api/ab041\", vm.ab041).then(function (data) {\n notify.showMessage('success', \"ab041 record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab041/\";\n });\n }\n }\n }", "function handleEditButtonPress() {\n var listItemData = $(this).parent(\"td\").parent(\"tr\").data(\"review\");\n var id = listItemData.id;\n // Edit the review via the cms form\n inputReview(id);\n }", "function clickHandler(e) {\r\n saveOptions();\r\n}", "function Save() {\n if ($('#ab121sgAddEdit').valid()) {\n if (vm.isNew) {\n dataContext.add(\"/api/ab121sg\",vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record added successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n } else {\n dataContext.upDate(\"/api/ab121sg\", vm.ab121sg).then(function (data) {\n notify.showMessage('success', \"ab121sg record updated successfully!\");\n\t\t\t\t\t\twindow.location.hash = \"/ab121sg/\";\n });\n }\n }\n }", "function _saveAsPanelHandler(){\n\n $('#sm-editing-table--checkbox').on(\"click\", function() {\n // traverse the DOM up to the table and find all input checkboxes, mark as checked\n $(this).closest('table').find('td input:checkbox').prop('checked', this.checked);\n });\n\n $(\".showHistoryTable\").on(\"click\", function() {\n $('.sm-editing-table--history').toggle();\n });\n\n }", "function editClicked() {\n edit = true;\n}", "function editStudyInfoSave(e) {\r\n\r\n\t// console.log($('#editStudyInfoModal .form-control').serializeObject());\r\n\r\n\tvar newInfo = $('#editStudyInfoModal .form-control').serializeObject();\r\n\t// console.log(newInfo)\r\n\tvar study = $('#edit-study-page').data('editing');\r\n\r\n\t_.forEach(newInfo, function(item, key) {\r\n\t\tstudy[key] = item;\r\n\t});\r\n\r\n\t$('#edit-study-page').data('editing', study);\r\n\r\n\t$('#editStudyInfoModal').modal('hide');\r\n\r\n}", "function save(){\n\tid = -1;\n\t\n\tif (pos_comp != -1)//modificar\n\t\tid = positions[pos_comp][0];\n\t\t\n\t$(\"#btnGuardar\").hide();\n\t$(\"#mensajeTemporal\").show();\n\t$(\"#backImage\").css({cursor:\"wait\"});\n\t\n\t\n\t$(\"#idPagina\").val(id);\n\t$(\"#contenido\").val($(\"#contenido\").sceditor(\"instance\").val());\n\t\n\t\n\t$(\"#subirPagina\").ajaxSubmit({\n\t\tdataType: \"json\",\n\t\tsuccess: function(respuesta_json){\n\t\t\t$(\"#btnGuardar\").show();\n\t\t\t$(\"#mensajeTemporal\").hide();\n\t\t\t$(\"#backImage\").css({cursor:\"default\"});\n\t\t\n\t\t\t$(\"#resultados\").text(respuesta_json.mensaje);\n\t\t\tprincipalCerrarPopUp(pagina_cerrarPopUp);\n\t\t\tconsultarTuplasExistentes(nombrePHPConsultar, isBorrarTuplas, arrayCamposConsulta);\n\t\t}\n\t});\n}", "function saveEditedTaskButtonHandler(obj)\n{\n // first: grab the task ID and data\n const row = getGrandparent($(obj));\n const taskType = getRowsTable(row);\n const taskID = getSavedTaskID(row);\n const taskData = getNewTaskData(row);\n const taskObject = buildTaskData(taskData[0], taskData[1], taskData[2], taskData[3], taskData[4]);\n // save data to the DOM\n saveTaskData(taskID, taskObject);\n // update the task table\n updateTask(row, taskObject);\n saveToEdit($(obj), $(obj).parent());\n}", "function formContainerEditSaveHandler(){}", "function handleSaveButton() {\n $(\".main-area\").on(\"submit\", \"#js-edit-form\", function(e) {\n console.log(\"Save button clicked\");\n // stop from form submitting\n e.preventDefault();\n // create variable that holds title value\n let title = $(\"#journal-title\").val();\n // create variable that holds date value\n let travelDate = $(\"#travel-date\").val();\n // create variable that hold image value\n let coverPhoto = $(\"#main-image\").val();\n // if this (main-area) data method entry id equal undefined (meaning nothing inputted) is true\n if ($(this).data(\"entryid\") === undefined) {\n // call create entyr function with title, date and photo as parameter\n createEntry(title, travelDate, coverPhoto);\n } else {\n const id = $(this).data(\"entryid\");\n // create new entry object that has different keys\n const newEntry = {\n id,\n title,\n travelDate,\n coverPhoto\n };\n // call save entry with new entry object as a parameter\n saveEntry(newEntry);\n }\n });\n}", "function edit(e) {\n let editBtn = e.target;\n let saveBtn = e.target.previousSibling;\n editBtn.style.display = \"none\";\n saveBtn.style.display = \"inline\";\n let inputElement = document.createElement(\"input\");\n inputElement.classList.add(\"input\");\n inputElement.style.display = \"block\";\n inputElement.style.margin = \"5px auto\";\n inputElement.style.width = \"100%\";\n inputElement.value = e.target.parentNode.firstChild.textContent;\n e.target.parentNode.append(inputElement);\n \n}", "function editItem() {\n var value = localStorage.getItem($(this).attr(\"key\"));\n var item = jQuery.parseJSON(value);\n toggleControls(\"off\");\n $('#displayLink').hide();\n $('#rname').val(item.rname[1]);\n $('#dateadded').val(item.dateadded[1]);\n var radios = $('input[name=\"category\"]:checked').val();\n $('#rtype').val(item.rtype[1]);\n $('#ringredients').val(item.ringredients)[1];\n $('#rdirections').val(item.rdirections)[1];\n save.off(\"click\", storeData);\n $('#submit').val(\"Edit Recipe\");\n var editSubmit = $('#submit');\n editSubmit.on(\"click\");\n editSubmit.attr(\"key\", this.key);\n }", "function handleSaveChangesClick(e) {\n var foodId = $(this).parents('.food').data('food-id');\n var $foodRow = $('[data-food-id=' + foodId + ']');\n\n var data = {\n foodName: $foodRow.find('.edit-food-name').val(),\n calories: $foodRow.find('.edit-calories').val(),\n };\n // remove console logs from production\n console.log('PUTing data for food', foodId, 'with data', data);\n console.log(data);\n console.log(foodId);\n\n // todo: Extract your url to a variable and pass the variable\n $.ajax({\n method: 'PUT',\n url: '/api/food/' + foodId,\n data: data,\n success: handleFoodUpdatedResponse,\n error: onError\n });\n\n function onError(error1, error2, error3) {\n console.log('error on ajax for edit');\n }\n\n function handleFoodUpdatedResponse(potato) {\n // remove console logs from production\n console.log(potato);\n console.log('response to update', potato);\n\n var foodId = potato._id;\n console.log(foodId);\n // scratch this food from the page\n //TODO: Try changing text in-place\n $('[data-food-id=' + foodId + ']').remove();\n // and then re-draw it with the updates ;-)\n renderFood(data);\n }\n }", "editTodoSave() {\r\n delegate(\r\n this.listHolder,\r\n \"li .edit\",\r\n \"blur\",\r\n ({ target: { previousElementSibling }, target } = event) => {\r\n const id = itemId(target);\r\n const label = qs(`[id=\"${id}\"]`);\r\n\r\n if (!target.dataset.iscanceled && target.value !== label.textContent) {\r\n qs('input[name=\"title\"]', target.parentElement).value = target.value;\r\n previousElementSibling.submit(); // Submits update form. See todo.php\r\n } else {\r\n this.editTodoDone(itemId(target));\r\n }\r\n },\r\n true\r\n );\r\n /** Hitting enter should be the same as submitting **/\r\n delegate(this.listHolder, \"li .edit\", \"keypress\", ({ target, keyCode }) => {\r\n if (keyCode === ENTER_KEY) {\r\n target.blur();\r\n }\r\n });\r\n }", "onClickSave() {\n HashBrown.Helpers.SettingsHelper.setSettings(this.model.id, null, 'info', this.model.settings.info)\n .then(() => {\n this.close();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Save( 'generic_save_title' , 'save_confirm_msg' ) ;\r\n}", "function editAction(edit_row) {\r\n let editBtn = document.createElement('button')\r\n editBtn.innerHTML = 'Edit';\r\n editBtn.className = 'edit-btn';\r\n edit_row.appendChild(editBtn)\r\n editBtn.addEventListener('click', function() {\r\n btn.innerHTML = 'save'\r\n\r\n let x = newRow.children;\r\n for (let i = 0; i < x.length; i++) {\r\n if (x[i] === newtitle) {\r\n title.value = x[i].innerHTML;\r\n }\r\n if (x[i] === newAuthor) {\r\n author.value = x[i].innerHTML;\r\n }\r\n if (x[i] === newYear) {\r\n year.value = x[i].innerHTML;\r\n }\r\n }\r\n })\r\n }", "function onPlaceSave(element) {\r\n\t\t\tvar root = element.parents(\".mapsed-root\");\r\n\t\t\tvar $rw = root.find(\".mapsed-edit\");\r\n\t\t\tvar errors = \"\";\r\n\t\t\tvar place = getViewModel($rw);\r\n\r\n\t\t\t// see if the calling code is happy with what's being changed\r\n\t\t\terrors = settings.onSave(_plugIn, place);\r\n\r\n\t\t\tvar errCtx = $rw.find(\".mapsed-error\");\r\n\t\t\tif (errors && errors.length > 0) {\r\n\t\t\t\t// not happy, show errors returned\r\n\t\t\t\terrCtx.text(errors);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t// no errors\r\n\t\t\terrCtx.text(\"\");\r\n\r\n\t\t\t// find the marker, so we can update the model on the marker\r\n\t\t\tvar marker = findMarker(place.lat, place.lng);\r\n\r\n\t\t\t// update the model to reflect the changes made\r\n\t\t\tjQuery.extend(marker.details, place);\r\n\r\n\t\t\t// once an object has been edited successfully it becomes a normal editable \"custom\" object\r\n\t\t\troot.find(\".mapsed-marker-type\").val(\"custom\");\r\n\t\t\t// also need to save back the userData (which may have changed, but is outside the view)\r\n\t\t\troot.find(\".mapsed-user-data\").val(place.userData);\r\n\r\n\t\t\t// editing complete, go back to the \"Select\" mode\r\n\t\t\tmarker.showTooltip(false/*inRwMode*/);\r\n\r\n\t\t} // onPlaceSave", "function handleSave(){\n props.onAdd(qItems);\n props.toggle(); \n }", "function editMode() {\n name.html('<input value=\"' + name.html() + '\"></input>');\n details.html('<input value=\"' + details.html() + '\"></input>');\n actions.html('<button type=\"button\" class=\"btn btn-default btn-xs submit-btn\"><span title=\"Submit\" class=\"glyphicon glyphicon-ok\"></span></button>'\n + '<button type=\"button\" class=\"btn btn-default btn-xs cancel-btn\"><span title=\"Cancel\" class=\"glyphicon glyphicon-remove\"></span></button>');\n }", "function onEdit() {\n var editButton;\n editButton = document.getElementById('edit-button');\n var headingBlock = document.getElementById('edit-heading');\n var postContent = document.getElementById('edit-contentText');\n if(editButton.innerText==='Edit'){\n headingBlock.setAttribute('contenteditable','true');\n postContent.setAttribute('contenteditable','true');\n headingBlock.setAttribute('class','edit-heading editable');\n postContent.setAttribute('class','edit-contentText editable');\n editButton.innerHTML = 'Save<i class=\"fa fa-save\" style=\"padding-left: 4px;\"></i></button>';\n /*\n Mouse event listener added to ensure whether user clicks save button to save edited text\n else sets last edited text\n outer if else part track whether mouse click is on editing text or elsewhere\n inner else if -> changes content to last saved one\n */\n document.body.addEventListener('click', function (event) {\n if(headingBlock.contains(event.target)||postContent.contains(event.target)){\n\n }\n else{\n if (editButton.contains(event.target)) {\n postTitleText = headingBlock.innerText;\n postContenttext = postContent.innerText ;\n }\n else{\n headingBlock.innerText = postTitleText;\n postContent.innerText = postContenttext;\n onEdit();\n }\n }\n\n });\n\n }\n else{\n editButton.innerText = 'Edit' ;\n headingBlock.removeAttribute('contenteditable');\n postContent.removeAttribute('contenteditable');\n headingBlock.setAttribute('class','edit-heading');\n postContent.setAttribute('class','edit-contentText');\n editButton.innerHTML = 'Edit<i class=\"fa fa-edit\" style=\"padding-left: 4px;\"></i></button>';\n\n\n }\n}", "function editTask(event){\n const header = event.target.parentElement;\n const task = header.parentElement;\n const id = Number(task.getAttribute(\"data-id\"));\n const val = database.getField(id);\n val.onsuccess = () => {\n const {key, title, description} = val.result;\n var editTitle = document.getElementById(\"editTitle\");\n editTitle.setAttribute(\"value\",title);\n\n var editDescription = document.getElementById(\"editDescription\");\n editDescription.innerHTML = description;\n }\n modal.style.display = \"block\";\n var saveChange = document.querySelector(\"#btnsave\");\n saveChange.setAttribute(\"data-id\",id);\n saveChange.onclick = changeTask;\n }", "function click_edit() {\n\t document.getElementById('submit_edit_paciente').click();\n\t}", "function save() {\r\n //Modify\r\n for (i = 0; i < toModify.length; i++) {\r\n items[toModify[i]].description = document.getElementById(toModify[i]).value;\r\n serverPut(items[toModify[i]].id, items[toModify[i]].description);\r\n }\r\n //Delete\r\n toDelete.sort();\r\n toDelete.reverse();\r\n for (i = 0; i < toDelete.length; i++) {\r\n serverDelete(items[toDelete[i]]);\r\n items.splice(toDelete[i], 1);\r\n }\r\n //Add\r\n for (i = 0; i < toAdd.length; i++) {\r\n let newDescription = document.getElementById(toAdd[i]).value;\r\n let newID = serverPost(desc);\r\n items[items.length] = {\r\n description: newDescription,\r\n id: newID,\r\n };\r\n }\r\n\r\n //Display list\r\n displayList(items, true);\r\n document.getElementById(\"displayer\").className = \"shown\";\r\n document.getElementById(\"editor\").className = \"hidden\";\r\n}", "function saveChanges() {\n var note_id = $('.note-info').attr('id'),\n csrftoken = $.cookie('csrftoken'),\n title = $('#title').text(),\n note_title = title === \"\" ? \"Untitled note\" : title,\n note_content = $('.editor').html(),\n data = {\n id: note_id,\n title: note_title,\n body: note_content,\n csrfmiddlewaretoken: csrftoken\n };\n\n $.post(\"/notes/editnote/\", data).success(function (data) {\n var note = $('#notelist').find('a[data-noteid=' + note_id + ']');\n $(note).find('strong').html(data.title);\n $(note).find('.preview').html(data.preview);\n });\n }", "function onEditDialogSave(){\r\n\t\t\r\n\t\tif(!g_codeMirror)\r\n\t\t\tthrow new Error(\"Codemirror editor not found\");\r\n\t\t\r\n\t\tvar content = g_codeMirror.getValue();\r\n\t\tvar objDialog = jQuery(\"#uc_dialog_edit_file\");\r\n\t\t\r\n\t\tvar item = objDialog.data(\"item\");\r\n\t\t\r\n\t\tvar data = {filename: item.file, path: g_activePath, pathkey: g_pathKey, content: content};\r\n\t\t\r\n\t\tg_ucAdmin.setAjaxLoaderID(\"uc_dialog_edit_file_loadersaving\");\r\n\t\tg_ucAdmin.setErrorMessageID(\"uc_dialog_edit_file_error\");\r\n\t\tg_ucAdmin.setSuccessMessageID(\"uc_dialog_edit_file_success\");\r\n\t\t\r\n\t\tassetsAjaxRequest(\"assets_save_file\", data);\r\n\t\t\r\n\t}", "function onEditClick(){\n // Check if button is set to edit or save.\n if(editStatus==0){\n // if edit is set, then update display and border for title and content \n editStatus=1;\n var editButtonHtml ='Save <i class=\"fa fa-save\"></i>';\n document.getElementById(\"editButton\").innerHTML = editButtonHtml;\n document.getElementById(\"contentTitle\").style.display = \"none\";\n document.getElementById(\"editContentTitle\").style.display = \"block\";\n var updatedTitle = \"UPDATED:\" + document.getElementById('editContentTitle').value;\n document.getElementById('editContentTitle').value = updatedTitle;\n var contentText = \"UPDATED: \" + document.getElementById('contentText').value;\n\n document.getElementById('editContent').innerHTML = '<textarea id=\"contentText\" rows=\"5\" style=\"border-style: solid; border-color:pink\" >' + contentText + '</textarea>';\n \n }else{\n // if save is set, then update display and border for title and content \n editStatus=0;\n var editButtonHtml ='Edit <i class=\"fa fa-edit\"></i>';\n document.getElementById(\"editButton\").innerHTML = editButtonHtml;\n var newTitle = document.getElementById('editContentTitle').value;\n var newContent = document.getElementById('contentText').value;\n document.getElementById(\"contentTitle\").style.display = \"block\";\n document.getElementById(\"contentTitle\").innerHTML = newTitle;\n document.getElementById(\"editContentTitle\").style.display = \"none\";\n document.getElementById('contentText').setAttribute('disabled', 'true');\n document.getElementById('contentText').style.border = \"none\";\n document.getElementById('contentText').value=newContent;\n\n }\n}", "save () {\n\n // Validate\n if (this.checkValidity()) {\n\n // Collect input\n this.info.item = this.collectInput();\n\n // Show modal\n this.modal.show();\n }\n }", "function save() {\n //验证表单\n if (!$(\"#editForm\").validate())\n return false;\n var strData = \"{\";\n strData += \"'strItemID':'\" + $(\"#ItemID\").val() + \"',\";\n strData += \"'strCharge':'\" + $(\"#CHARGE\").val() + \"',\";\n strData += \"'strPowerFee':'\" + $(\"#TEST_POWER_FEE\").val() + \"',\";\n strData += \"'strPreFree':'\" + $(\"#PRETREATMENT_FEE\").val() + \"',\";\n strData += \"'strTestAnsyFree':'\" + $(\"#TEST_ANSY_FEE\").val() + \"',\";\n strData += \"'strTestPointNum':'\" + $(\"#TEST_POINT_NUM\").val() + \"',\";\n strData += \"'strAnsyNum':'\" + $(\"#ANALYSE_NUM\").val() + \"'\";\n strData += \"}\";\n\n $.ajax({\n cache: false,\n type: \"POST\",\n url: \"ItemPrice.aspx/EditItem\",\n data: strData,\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data, textStatus) {\n if (data.d == \"1\") {\n detailWin.hidden();\n manager.loadData();\n clearDialogValue();\n }\n else {\n $.ligerDialog.warn('保存项目数据失败!');\n }\n }\n });\n }", "function handleEditButton() {\n // select main-area class div, when clicked on listen for a click and edit button class and run e function\n $(\".main-area\").on(\"click\", \"#js-edit-button\", function() {\n console.log(\"Edit entry clicked\");\n // create variable id that holds this (main-area class) method and data method holding entry id\n const id = $(this).data(\"entryid\");\n // call get each entry function down below with id and display add edit entry function as parameter\n getEachEntry(id, displayAddEditEntry);\n });\n}", "function save(m){\n let value = m.previousElementSibling.querySelector(\"textarea\").value;\n let span = m.parentElement.parentElement;\n let id = span.dataset.id;\n fetch(\"/editpost\", {\n credentials: 'include',\n method: 'PUT',\n mode: 'same-origin',\n headers: {\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'X-CSRFToken': csrf\n },\n body: JSON.stringify({\n value: value,\n id: id,\n })\n })\n\n let llist = span.children;\n llist[3].style.color = \"#657ff0\";\n llist[5].style.display = \"inline-block\";\n llist[5].innerHTML = value;\n llist[6].remove();\n return false;\n}", "function Save(e) {\n\t// saveURL is a switch used to check whether this is a new feature request or an edit.\n\tif (saveURL === undefined) {\n\t saveURL = newURL;\n\t}\n\t\n\t$.ajax({\n type: \"POST\",\n url: saveURL,\n data: $('#feature-request-form').serialize(),\n success: function (data) {\n grid.reload();\n\t\t$('#feature-modal-form').modal('hide');\n\t\tclearForm('#feature-modal-form');\n },\n\t failure: function () {\n alert('Failed to save.');\n\t\t$('#feature-modal-form').modal('hide');\n\t }\n });\n\tsaveURL = newURL;\n e.preventDefault();\n }", "addEditListener() {\n this.editBtn.click(() => {\n $('#updateBtn').remove();\n $('.modal-footer').append(this.updateBtn);\n this.addUpdateListener();\n $('#exampleModalLongTitle').text(this.author);\n $('#modalText').val(this.text);\n $('#exampleModalCenter').modal('toggle');\n });\n }", "function clickEdit(eleObj){\n\t$(\"#feedBackTd\").html('');\n\tvar rowID=$(eleObj).closest('tr').attr('id');\n\t$(\"#merchantId\").val($(\"#merchantId\"+rowID).val());\n\t$(\"#locationId\").val($(\"#locationId\"+rowID).val());\n\t$(\"#productId\").val($(\"#productId\"+rowID).val());\n\t$(\"#stockSearch\").attr('action','showEditStock');\n\t$(\"#stockSearch\").submit();\n}", "_addActionEdit() {\n let btn = this._actions.getElementsByClassName('edit')[0];\n if (btn === undefined) {\n return;\n }\n\n btn.onclick = ((event) => {\n window.location.href = Service.editorUrl(this._api.getSlug());\n }).bind(this);\n\n this._btns.edit = btn;\n }", "function edit() {\n$('.activityMainContainer').on('click', '.edit_button1',function(e) {\n\t\n e.preventDefault();\n\t\n\tlet button = $(this).closest('.row').find('.save_button1');\n\t\n $(button).toggle();\n\t\n\t\n let arrayOfInput = $(this).closest('.row').find('input');\n for ( let i = 0; i < arrayOfInput.length; i ++ ){\n\t \n $(arrayOfInput[i]).prop(\"readonly\", false);\n\t } \n }); \n}", "function openSaveAs() {\n var ediv = $(\"#edit-widget-content\").get(0);\n if ($.data(ediv, \"assetid\")) {\n saveAssetContent(null,null);\n } else {\n if (contentEditCriteria.producesResource) {\n $.perc_browser({on_save:onSave, initial_val:\"\"});\n } else {\n saveAssetContent(contentEditCriteria.contentName,null);\n }\n }\n }", "function saveAndClose(){\n save_button.addEventListener('click', function(event){\n event.preventDefault();\n active_element.innerHTML = editable_content.value;\n let json = {\n project_id: iframe.attributes['data-project-id'].value,\n selector: getUniqueSelector(active_element),\n change_value: editable_content.value,\n comment: content_comment.value\n }\n let myJSON = JSON.stringify(json);\n // Send data to backend\n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"/savechanges\");\n xhr.setRequestHeader(\"Content-Type\", \"application/json\");\n xhr.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n // Typical action to be performed when the document is ready:\n console.log(\"Saved!\");\n }\n };\n xhr.send(myJSON);\n\n pu.style.display = 'none';\n editable_content.innerHTML = \"\";\n });\n close_button.addEventListener('click', function(){\n pu.style.display = \"none\";\n editable_content.innerHTML = \"\";\n });\n }", "function EditDataFunct() {\n\n //debugger;\n\n $(\"#tableRow_\" + Intern_LineEditedNum).html(GenerateTableLine(Intern_LineEditedNum));\n AddEvents(Intern_LineEditedNum);\n Intern_LineEditedNum = null;\n ClearAllInputs();\n $('#' + Intern_AddButtonId).html(Disp_TextAdd);\n Intern_InputFieldElems[0].focus();\n }", "function editUser(e) {\r\n if (e.target.className === \"save\") {\r\n let newUserData = prepareEditedUser(e);\r\n putEditedUser(newUserData);\r\n clearEditBox();\r\n }\r\n}", "function editEvent(){\n\t\n}", "handleEditBook(event)\n {\n let text = event.toElement.id.replace(\"adminEdit\", \"\");\n $(\"#editBookFormISBN\").val(text);\n $(\"#editBookFormID\").submit();\n }", "function saveInfo(e) {\n e.preventDefault();\n //console.log(\"click\")\n var text = $(this).siblings('textarea').val().trim();\n var id = $(this).siblings('textarea').attr('id');\n\n localStorage.setItem(id, JSON.stringify(text));\n\n}", "_handleButtonSave()\n {\n var element = this._getJQueryElement();\n if ($(element).is(':visible'))\n {\n this.model.set('job_settings', this._editor.getValue());\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__WORKFLOWJOB_SAVE, {workflowjob: this.model, workflow: this._workflow});\n }\n }", "function handleFoodEditClick(e) {\n var $foodRow = $(this).closest('.food');\n var foodId = $foodRow.data('food-id');\n // remove console logs from production\n console.log('edit food', foodId);\n console.log($foodRow);\n\n // show the save changes button\n $foodRow.find('.save-food').toggleClass('hidden');\n // hide the edit button\n $foodRow.find('.edit-food').toggleClass('hidden');\n\n\n // get the food name and replace its field with an input element\n var foodName = $foodRow.find('span.food-name').text();\n $foodRow.find('span.food-name').html('<input class=\"edit-food-name\" value=\"' + foodName + '\"></input>');\n\n // get the calories and replace its field with an input element\n var calories = $foodRow.find('span.calories').text();\n $foodRow.find('span.calories').html('<input class=\"edit-calories\" value=\"' + calories + '\"></input>');\n\n }", "edit() {\n this._enterEditMode();\n }", "function _edit() {\n $('name').value = this.name;\n $('key').value = this.key;\n $('action').value = this.action;\n switchToView('edit-form');\n}", "function saveClickEvent(e)\n {\n e.stopPropagation();\n e.stopImmediatePropagation();\n var rowID = e.target.id;\n var rowCostBox = document.getElementById(\"cost\"+rowID)\n var rowCost = rowCostBox.value;\n var rowQuantBox = document.getElementById(\"quant\"+rowID)\n var rowQuant = rowQuantBox.value;\n\n //validates as number\n if(isNaN(rowCost)){\n alert(\"Cost must be a number\");\n return;\n }\n if(isNaN(rowQuant)){\n alert(\"Quantity must be a number\");\n return;\n }\n //converts to numbers, 2 decimal place float and integer\n rowCost = + parseFloat(rowCost).toFixed(2);\n rowQuant = parseInt(rowQuant);\n //checks non-negative\n if(rowCost<0 || rowQuant<0){\n alert(\"Cannot enter negative values\");\n return;\n }\n //ajax for saving result of a row\n $.ajax({\n type: \"POST\",\n url: 'editRow.php',\n data: {editCost: rowCost, editQuantity: rowQuant, editID: rowID},\n success: function(data){\n //send confirmation msg and marks boxes as saved\n alert(data);\n rowCostBox.style.color = \"black\";\n rowQuantBox.style.color = \"black\";\n },\n error: function(xhr){\n alert(xhr.status);\n }\n });\n }", "function clickSaveButton() {\n\tif(this.innerHTML === savedButtText) {\n\t\tthis.innerHTML = notSavedButtText;\n\t} else {\n\t\tthis.innerHTML = savedButtText;\n\t}\n\n\tupdateAllSavedPCs();\n}", "function afterEdit(e) {\n record = e.record;\n if (record.id == 0) {\n draft_store.load({params: {field: e.field, value: e.value}});\n } else {\n save_store.load({params: {field: e.field, id: e.record.id, value: e.value}});\n }\n }", "function editModel(data) {\n /// start edit form data prepare\n /// end edit form data prepare\n dataSource.one('sync', function(e) {\n /// start edit form data save success\n /// end edit form data save success\n\n app.mobileApp.navigate('#:back');\n });\n\n dataSource.one('error', function() {\n dataSource.cancelChanges(itemData);\n });\n\n dataSource.sync();\n app.clearFormDomData('edit-item-view');\n }", "function setSaveEvent(data){\n\t\tvar theID = '#save_' + data.doc.index;\n\t\tscroll_id = '#save_' + data.doc.index;\n\t\t$(theID).click(function(){\n\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc.index == data.doc.index){\n\t\t\t\t\tconsole.log(\"we are SAVING \" + data.doc.index);\n\t\t\t\t\t// Update the video name to JSON database\n\t\t\t\t\tthis_video_name= document.getElementById(\"nameForSaving\").innerHTML + \"_\" + data.doc.index +\n\t\t\t\t\t\t\t\"_\" + data.doc._id + \".mp4\";\n\n\t\t\t\t\t$(\"#save-to-disk\").trigger('click');\n\t\t\t\t\tjsonData.rows[i].doc[\"video\"] = this_video_name;\n\t\t\t\t\tsendUpdateJSONRequest();\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\tsendUpdateJSONRequest();\n\t});\n}", "function edit_button_click_handler(e) {\n var row = e.target.closest(\"tr\");\n var first_col = row.children[0];\n\n // if we are already in a editing phase\n if(first_col.childNodes.length > 1) {\n return;\n }\n\n var prev_data = first_col.innerHTML;\n\n var user_name_feild = document.createElement('input');\n var shared_secret_feild = document.createElement('input');\n\n var save_new_data_button = document.createElement('button');\n var cancel_edit = document.createElement('button');\n\n save_new_data_button.textContent = \"save\";\n\n cancel_edit.textContent = \"cancel\";\n\n // handle a cancel edit\n cancel_edit.addEventListener('click', cancel_click => {\n first_col.innerHTML = prev_data;\n });\n\n // handle saving edit\n save_new_data_button.addEventListener('click', save_account_edits);\n\n user_name_feild.type = 'text'; shared_secret_feild.type = 'text';\n\n user_name_feild.class = \"edit_2fa_name\"; shared_secret_feild.class = \"edit_2fa_secret\";\n\n user_name_feild.placeholder = \"USERNAME\";\n shared_secret_feild.placeholder = \"SHARED SECRET\";\n\n first_col.innerHTML = \"\";\n first_col.appendChild(user_name_feild);\n first_col.appendChild(shared_secret_feild);\n first_col.appendChild(save_new_data_button);\n first_col.appendChild(cancel_edit);\n}", "onClickSave() {\n SettingsHelper.setSettings(this.projectId, null, 'info', this.model)\n .then(() => {\n this.modal.hide();\n\n this.trigger('change', this.model);\n })\n .catch(UI.errorModal);\n }", "function saveEditCaption(e, data) {\n var $wp = $('.write-pages li'), // the list of book pages\n $page = $($wp.get(editIndex)), // the current page\n $caption = $page.find('p.thr-caption'),\n tooLong = typeof(data.value) == 'string' &&\n data.value.length > maxCaptionLength;\n //console.log('saving', data.value, 'was', $caption.html());\n $caption.html(data.value).toggleClass('text-too-long', tooLong);\n setModified();\n $editDialog.find('p.thr-caption').toggleClass('text-too-long', tooLong);\n }", "function saveEdit(callback) {\n callback = callback || changes;\n var title = $('#editor > h1').text();\n if (title) {\n var text = $('textarea[name=text]').val()\n , tags = readTagView()\n , tiddler = {};\n tiddler.text = text;\n tiddler.tags = tags;\n tiddler.type = currentFields.type;\n delete currentFields.type;\n tiddler.fields = currentFields;\n\n // update content based on radio buttons\n var matchedType = $('[name=type]:checked').val();\n if (matchedType !== 'other') {\n if (matchedType === 'default') {\n delete tiddler.type;\n } else {\n tiddler.type = matchedType;\n }\n }\n\n var jsonText = JSON.stringify(tiddler);\n if (!currentBag) {\n currentBag = space + '_public';\n }\n $.ajax({\n beforeSend: function(xhr) {\n if (tiddler.fields['server.etag']) {\n xhr.setRequestHeader('If-Match',\n tiddler.fields['server.etag']);\n }\n },\n url: host + 'bags/' + encodeURIComponent(currentBag)\n + '/tiddlers/' + encodeURIComponent(title),\n type: \"PUT\",\n contentType: 'application/json',\n data: jsonText,\n success: callback,\n statusCode: {\n 412: function() {\n displayMessage('Edit Conflict');\n }\n }\n });\n } else {\n displayMessage('There is nothing to save');\n }\n}", "function editBtn(e){\n\t\n\tif (e.source.title == \"Edit\") {\n\t\t\n\t\t$.tbl.editing = true;\n\t\te.source.title = \"Done\";\n\t\t$.addTransect.enabled = false; \n\t\t\n\t} else { //text is 'Done', switch to 'Edit'\n\t\t\n\t\t$.tbl.editing = false;\n\t\te.source.title = \"Edit\";\n\t\t$.addTransect.enabled = true;\n\t\t\n\t}\n}", "function handleSave(e) {\r\n let target = e.target,\r\n query = target.dataset.query;\r\n\r\n if (query) {\r\n switch (query) {\r\n case \"saveSetting\": {\r\n let settings = list.map((item) => {\r\n return item.value;\r\n });\r\n\r\n settings.push(0); //current iteration\r\n\r\n Firebase.setValue(settings, \"settings\").then(() => {\r\n sessionStorage.setItem(\"isNewUser\", false);\r\n //Notification().showMessage(\"success\", \"Successfully saved!\");\r\n window.location.hash = \"#task-list\";\r\n });\r\n\r\n break;\r\n }\r\n }\r\n }\r\n }", "function save() {\n\n $('.activityMainContainer').on('click', '.save_button1',function(e) {\n e.preventDefault();\n\t//console.log('is this working');\n\tlet button = $(this).closest('.row').find('.save_button1');\n\t$(button).toggle();\n let arrayOfInput = $(this).closest('.row').find('input');\n for ( let i = 0; i < arrayOfInput.length; i ++ ){\n $(arrayOfInput[i]).prop(\"readonly\", true);\n }\n \n });\n}", "function save ()\n {\n $uibModalInstance.close(vm.item);\n }", "function doEdit(){\n\n\n if(validation() == false)\n return ;\n\n doEditInLocalstorage(prevli) ;\n doEditInShowList(prevli) ;\n\n\n /*********** Going back to again add Task Field ************/ \n \n document.getElementById(\"task\").value = \"\" ;\n document.getElementById(\"editButton\").style.display = 'none' ;\n document.getElementById(\"addButton\").style.display = 'block' ;\n\n /***************** End ***********************/\n\n\n }", "edit() {\n }", "onSaveButtonClick(eventObject) {\n let saveButton = eventObject.target;\n let savedType = saveButton.getAttribute(\"saved\") ? RoKA.Reddit.SaveType.UNSAVE : RoKA.Reddit.SaveType.SAVE;\n new RoKA.Reddit.SaveRequest(this.commentObject.name, savedType, function () {\n if (savedType === RoKA.Reddit.SaveType.SAVE) {\n saveButton.setAttribute(\"saved\", \"true\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_unsave\");\n }\n else {\n saveButton.removeAttribute(\"saved\");\n saveButton.textContent = RoKA.Application.localisationManager.get(\"post_button_save\");\n }\n });\n }", "function edit(val) {\n resetAll();\n try {\n var data = JSON.parse(val[1]);\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n \n if (data[0].image != \"\" && data[0].image != null) {\n $(\"#divuploadimage img\").prop(\"src\", data[0].image);\n $(\"#imgItemURL\").prop(\"src\", data[0].image);\n } else {\n $(\"#divuploadimage img\").prop(\"src\", \"\");\n $(\"#imgItemURL\").prop(\"src\", \"\");\n }\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#lblmainid\").val( data[0].id);\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n //implementers.GetWorkerInfo(data[0].id, function (val) {\n // if (val[0] == \"1\") {\n // var data = JSON.parse(val[1]);\n // $(\"#user_nm\").val(data[0].User_Name);\n // $(\"#password\").val(data[0].User_Password);\n // } else {\n // $(\"#user_nm\").val(\"\");\n // $(\"#password\").val(\"\");\n // }\n //});\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "function onSave(td) {\r\n let selectedRow = td.parentElement.parentElement;\r\n let tempIndex = (selectedRow.rowIndex - 1);\r\n let tempStd = students[tempIndex];\r\n\r\n //Hidding and showing buttons to prevent unexpected user clicking.\r\n saveBtn[tempIndex].hidden = true;\r\n \r\n for (let i=0; i<students.length; i++) {\r\n editBtn[i].hidden = false;\r\n delBtn[i].hidden = false;\r\n }\r\n\r\n //Altering the data context of the cells.\r\n selectedRow.cells[0].innerText = document.getElementById('editFname').value;\r\n selectedRow.cells[1].innerText = document.getElementById('editLname').value;\r\n selectedRow.cells[2].innerText = document.getElementById('editBirthdate').value;\r\n selectedRow.cells[3].innerText = document.getElementById('editFees').value;\r\n\r\n //Updating the object's values.\r\n tempStd['fname'] = selectedRow.cells[0].innerText;\r\n tempStd['lname'] = selectedRow.cells[1].innerText;\r\n tempStd['birthdate'] = selectedRow.cells[2].innerText;\r\n tempStd['fees'] = selectedRow.cells[3].innerText;\r\n\r\n //Checking\r\n console.log(students)\r\n}", "'.save click'() {\n this.saveContact();\n Navigator.openParentPage();\n\n // Prevent the default submit behavior\n return false;\n }", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.fields = data.fields;\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.renderGridView();\n\t\tthis.showGridView();\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function editzselex_save(action)\n{\n if (editing == true) {\n editing = false;\n Element.show('zselex_savezselex');\n\n // A manual onsubmit for xinha to update the textarea data again.\n if (typeof Xinha != \"undefined\") {\n $('zselex_ajax_modifyform').onsubmit();\n }\n var pars = $('zselex_ajax_modifyform').serialize(true);\n pars.action = action;\n new Zikula.Ajax.Request(\n 'ajax.php?module=Zselex&func=update',\n {\n parameters: pars,\n onComplete: editzselex_saveresponse\n });\n }\n return;\n}", "function edit(btn) {\n btn.innerHTML = 'save';\n btn.setAttribute('onclick', 'save(this)');\n const input = document.getElementById(btn.previousElementSibling.id);\n input.removeAttribute('disabled');\n}", "function editable($el, data) {\n \n $el.data('cms', data);\n\n $el.on('render', function () {\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].render($el, data.data);\n $el.trigger('rendered');\n });\n\n //add css edit styles\n $el.addClass('cms-edit-' + data.type);\n\n $el.on('click', function (e) {\n e.preventDefault();\n e.stopPropagation();\n var $el = $(this);\n var data = $el.data('cms');\n elements[data.type].edit($el, data);\n });\n\n }", "onClickSave() {\n let saveAction = this.$element.find('.editor__footer__buttons select').val();\n let postSaveUrl;\n\n let setContent = () => {\n // Use publishing API\n if(this.model.getSettings('publishing').connectionId) {\n // Unpublish\n if(saveAction === 'unpublish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/unpublish', this.model);\n\n // Publish\n } else if(saveAction === 'publish') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/publish', this.model);\n \n // Preview\n } else if(saveAction === 'preview') {\n return HashBrown.Helpers.RequestHelper.request('post', 'content/preview', this.model);\n\n }\n }\n\n // Just save normally\n return HashBrown.Helpers.RequestHelper.request('post', 'content/' + this.model.id, this.model);\n }\n\n this.$saveBtn.toggleClass('working', true);\n\n // Save content to database\n setContent()\n .then((url) => {\n postSaveUrl = url;\n \n return HashBrown.Helpers.RequestHelper.reloadResource('content');\n })\n .then(() => {\n this.$saveBtn.toggleClass('working', false);\n \n this.reload();\n \n HashBrown.Views.Navigation.NavbarMain.reload();\n\n this.dirty = false;\n\n if(saveAction === 'preview') {\n UI.iframeModal(\n 'Preview',\n postSaveUrl\n );\n }\n })\n .catch((e) => {\n this.$saveBtn.toggleClass('working', false);\n UI.errorModal(e);\n });\n }", "function inner_after_save()\n\t{\n\t\tthat.processCodeInScripts();\n\t\tthat.editor.focus();\n\t\tthat.showInFooter(\"saved\");\n\t\tLiteGUI.trigger( that, \"stored\" );\n\t}", "function saveText(event) {\n var saved = ( $(this).parent().children().eq(1) ).val();\n //console.log(saved);\n var index = $(this).parent().children().eq(1).attr(\"index\");\n //console.log(index);\n textStorage[index] = saved;\n \n $(this).parent().children().eq(2).attr(\"class\", \"saveBtn\");\n $(this).parent().children().eq(2).children().attr(\"class\", \"fas fa-save\");\n //console.log(save);\n //console.log(textStorage);\n localStorage.setItem(\"hour_planner\", JSON.stringify(textStorage));\n}", "function editButtonHandler(obj)\n{\n const row = getGrandparent($(obj)); \n const task = getRowData(row);\n openTask(row, task);\n editToSave($(obj), $(obj).parent());\n}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\t// update id's and scope in case they change\n\t\t// this happens when switching from global\n\t\t// to page specific fields (switching scope)\n\t\tthis.data.node.data = data;\n\t\tthis.data.node.data.originals = this.originals;\n\t\tthis.data.field = this.data.node.data;\n\n\t\tthis.view.empty();\n\t\tthis.view.append(this.renderField(this.data.field, true));\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tLiveUpdater.changedField(this.data.field);\n\t}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.data.field = data.field;\n\t\tLiveUpdater.changedModel(this.data.field);\n\t}", "function onSaveSuccess(data, response, xhr)\n\t{\n\t\tthis.createDefaultFields(this.data.creator);\n\t\tthis.sidebar.breadcrumbsView.back();\n\t\tthis.sidebar.layout.removeClass('saving');\n\t\tthis.showGridView();\n\t\t// LiveUpdater.refresh(); // decided to remove this for now\n\t}", "function handleEdit() {\n console.log(\"yes\");\n var currentEntry = $(this).parent(\"td\").parent(\"tr\").data(\"tableRow\");\n console.log(currentEntry);\n window.location.href = \"/update/\" + currentEntry\n }", "function CreateButtonClickListener() {\n \n $(\".editbutton\").click(function () {\n\n var id = $(this).attr('id');\n \n //we are getting id number from editbutton id to know which text to show into modal\n var idnumber = parseInt(id.replace(/^[^0-9]+/, ''), 10);\n \n var text = $(\"#textarea\" + idnumber).text();\n console.log(text);\n $(\"#textmodal\").val(text.trim());\n $(\"#modalsave\").hide();\n $(\"#modalupdate\").show();\n $(\"#modaldelete\").show();\n\n CreateUpdateButtonClickListener(idnumber);\n CreateDeleteButtonClickListener(idnumber);\n $('#myModal').modal('show');\n });\n\n }", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function OnBtnSave_Click( e )\r\n{\r\n Ti.App.fireEvent( \"form:save_from_section\" ) ;\r\n}", "function edtBtnFunc() {\r\n let id = this.id.slice(0,-8);\r\n console.log(id);\r\n /*点击了edit*/\r\n if($(this).html()===\"Edit\"){\r\n $(\"#\"+id+\"-row .my-editable\").each(function (i) {\r\n var value = $(this).html();\r\n $(this).html(\"\" +\r\n \"<input type='text' name=\\\"\"+ namelist[i] +\"\\\" class='text' value=\\\"\"+ value +\"\\\" required='required'>\"\r\n );\r\n });\r\n /*QA naming*/\r\n var qa_namelist = [\"title\",\"choiceA\",\"choiceB\",\"choiceC\",\"choiceD\",\"std\"];\r\n $(\"#\"+id+\"-question-row.obj-question-row .my-editable\").each(function (i) {\r\n var value = $(this).html();\r\n $(this).html(\"\" +\r\n \"<input type='text' name=\\\"\"+ qa_namelist[i%6] +\"\\\" class='text' value=\\\"\"+ value +\"\\\">\"\r\n );\r\n });\r\n /*QB naming*/\r\n var qb_namelist = [\"title\"];\r\n $(\"#\"+id+\"-question-row.sub-question-row .my-editable\").each(function (i) {\r\n var value = $(this).html();\r\n $(this).html(\"\" +\r\n \"<input type='text' name=\\\"\"+ qb_namelist[i%1] +\"\\\" class='text' value=\\\"\"+ value +\"\\\">\"\r\n );\r\n });\r\n /*button changing*/\r\n $(\"#\"+id+\"-row input[name='tid']\").attr(\"readonly\",true);\r\n $(\"#\"+id+\"-row input[name='type']\").attr(\"readonly\",true);\r\n $(\"#\"+id+\"-row [data-toggle='collapse']\").attr(\"href\",\"#\");\r\n $(\"#\"+id+\"-question-form\").attr({\"readonly\":true}).toggleClass(\"show\",true).parent().attr({\"colspan\":4})\r\n $(\"#\"+id+\"-row .my-del-btn\").hide();\r\n $(\"#\"+id+\"-question-list-add-btn\").show();\r\n $(this).html(\"Save\").toggleClass(\"bg-orange\");\r\n }\r\n /*点击了save*/\r\n else {\r\n let json = {};\r\n /*test input*/\r\n $.each($(\"#\"+id+\"-row .my-editable\"), function (i, item) {\r\n let input = item.children[0];\r\n json[input.getAttribute(\"name\")] = input.value;\r\n });\r\n /*QA input*/\r\n let qa_list = [];\r\n let cnt = 0;\r\n $.each($(\"#\"+id+\"-question-row .obj-question\"),function(){\r\n let qa_json = {};\r\n cnt++;\r\n $.each($(this).find(\".my-editable\"),function(j,item){\r\n let input = item.children[0];\r\n qa_json[input.getAttribute(\"name\")] = input.value;\r\n });\r\n qa_list.push(qa_json);\r\n });\r\n json[\"QA\"] = qa_list;\r\n /*QB input*/\r\n let qb_list = [];\r\n $.each($(\"#\"+id+\"-question-row .sub-question\"),function(){\r\n let qb_json = {};\r\n $.each($(this).find(\".my-editable\"),function(j,item){\r\n let input = item.children[0];\r\n qb_json[input.getAttribute(\"name\")] = input.value;\r\n });\r\n qb_list.push(qb_json);\r\n });\r\n json[\"QB\"] = qb_list;\r\n json[\"uid\"] = uid;\r\n json[\"cid\"] = cid;\r\n if(qa_list.length===0){\r\n json[\"ttype\"] = 1;\r\n json[\"cnt\"] = qb_list.length;\r\n }\r\n else {\r\n json[\"ttype\"] = 0;\r\n json[\"cnt\"] = qa_list.length;\r\n }\r\n console.log(json);\r\n $.ajax({\r\n url:add_url+\"?action=edit_user_list\",\r\n type:\"POST\",\r\n data:json,\r\n success:function(data){\r\n alert(\"success\");\r\n $.each($(\"#\"+id+\"-question-row .my-editable, #\"+id+\"-row .my-editable\"), function (i, item) {\r\n let input = item.children[0];\r\n item.innerHTML=(input.value);\r\n });\r\n $(\"#\"+id+\"-row [data-toggle='collapse']\").attr(\"href\",\"#\"+id+\"-question-form\");\r\n $(\"#\"+id+\"-question-form\").parent().attr({\"colspan\":5});\r\n $(\"#\"+id+\"-row .my-edt-btn\").html(\"Edit\").toggleClass(\"bg-orange\");\r\n $(\"#\"+id+\"-row .my-del-btn\").show();\r\n $(\"#\"+id+\"-question-list-add-btn\").hide();\r\n console.log(data);\r\n console.log(\"submited\");\r\n },\r\n error:function(){\r\n alert(\"Connection error, item cannot be updated ,please try again later\");\r\n }\r\n });\r\n }\r\n}", "handleEditClick(portfolioItem) {\n\t\tthis.setState({\n\t\t\teditData: portfolioItem,\n\t\t});\n\t}", "function handleSave() {\n setLoading(true);\n //console.log(props.editData.data.id);\n let formData = {\n title,\n text\n };\n console.log(formData);\n axios\n .post(\n `https://salesforce-blogs.herokuapp.com/blogs/api/${\n isEdit ? props.editData.data.id : ''\n }`,\n formData\n )\n .then(response => {\n toast.success('Post saved successfully.');\n setLoading(false);\n })\n .catch(err => {\n toast.error('Cannot save post, some error occured' + err);\n console.log('Cannot save post, some error occured' + err);\n setLoading(false);\n });\n }", "click() {\n let $saveIcon = $(\"#\" + this.recId + \" .save_button i\");\n\n RecButton.toggleIconFill($saveIcon);\n\n if ($saveIcon.hasClass(\"fas\")) {\n DatabaseUpdater.putRecToUserWatchlist(this.rec, CurrentUser);\n } else {\n DatabaseUpdater.deleteRecFromUserWatchlist(this.rec, CurrentUser);\n }\n }", "function editSnippet(e){\n if (editButton){\n $snippetBody = $(\"#modal-snippet-body\");\n $snippetNotes = $(\"#modal-snippet-notes\");\n $snippetBody.replaceWith($('<textarea>' + $snippetBody.html() + '</textarea>').attr(\"id\", \"modal-snippet-body\"));\n $snippetNotes.replaceWith($('<textarea>' + $snippetNotes.html() + '</textarea>').attr(\"id\", \"modal-snippet-notes\"));\n $('#snippet-modal').append($(\"<button class ='btn btn-secondary' id='edit-snippet-button'>\").html(\"Submit Edit\"));\n editButton = false;\n $(\"#edit-snippet-button\").on(\"click\", updateSnippet);\n }else{\n $snippetBody = $(\"#modal-snippet-body\");\n $snippetNotes = $(\"#modal-snippet-notes\");\n $snippetBody.replaceWith($(\"<p>\" + $snippetBody.html() + \"</p>\").attr(\"id\", \"modal-snippet-body\"));\n $snippetNotes.replaceWith($(\"<p>\" + $snippetNotes.html() + \"</p>\").attr(\"id\",\"modal-snippet-notes\"));\n $(\"#edit-snippet-button\").remove();\n editButton = true;\n }\n}", "function editSubmitHandler() {\n // grabs class of submitEdit button, converts from string to number\n let itemId = Number($(this).attr(\"class\"));\n console.log('item id is:', itemId)\n // passing this ID as argument for function to send edited item to server\n sendEditedItem(itemId);\n} // end editSubmitHandler", "livelyPrepareSave() {\n // this.setAttribute(\"data-mydata\", this.get(\"#textField\").value);\n }", "function edit(val) {\n resetAll();\n try {\n var data = JSON.parse(val[1]);\n if (val[0] != \"0\") {\n fillControlsFromJson(data[0]);\n \n if (data[0].image != \"\" && data[0].image != null) {\n $(\"#divuploadimage img\").prop(\"src\", data[0].image);\n $(\"#imgItemURL\").prop(\"src\", data[0].image);\n } else {\n $(\"#divuploadimage img\").prop(\"src\", \"\");\n $(\"#imgItemURL\").prop(\"src\", \"\");\n }\n $(\"#cmdSave\").prop(\"CommandArgument\", \"Update\");\n $(\"#lblmainid\").val( data[0].id);\n if (formOperation == \"update\") {\n setformforupdate();\n formOperation = \"\";\n }\n implementers.GetWorkerInfo(data[0].id, function (val) {\n if (val[0] == \"1\") {\n var data = JSON.parse(val[1]);\n $(\"#user_nm\").val(data[0].User_Name);\n $(\"#password\").val(data[0].User_Password);\n } else {\n $(\"#user_nm\").val(\"\");\n $(\"#password\").val(\"\");\n }\n });\n } else {\n showErrorMessage(\"No data found !!\");\n }\n } catch (err) {\n alert(err);\n }\n}", "function onSaveClick() {\n logger.info('save_button click event handler');\n closeKeyboards();\n clearAllErrors();\n var isValid = true;\n\n if (!($.customer_profile_first_name.value)) {\n showError($.customer_profile_first_name, $.first_name_error, _L('Please provide a first name.'), true);\n isValid = false;\n }\n if (!($.customer_profile_last_name.value)) {\n showError($.customer_profile_last_name, $.last_name_error, _L('Please provide a last name.'), true);\n isValid = false;\n }\n\n if (isValid) {\n var params = {\n first_name : $.customer_profile_first_name.value,\n last_name : $.customer_profile_last_name.value\n };\n\n var promise = currentCustomer.setProfile(params);\n Alloy.Router.showActivityIndicator(promise);\n promise.done(function(model, params, options) {\n notify(_L('Customer profile data successfully saved.'));\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n });\n }\n\n if (!isValid) {\n notify(_L('Please fill in all the required fields.'));\n }\n}" ]
[ "0.7242012", "0.71921414", "0.70357245", "0.6986772", "0.6932385", "0.6876298", "0.68186235", "0.6808715", "0.6793268", "0.6784878", "0.6772735", "0.67662305", "0.6670292", "0.6652917", "0.66483825", "0.663244", "0.66323435", "0.6631246", "0.66231805", "0.65830576", "0.65705836", "0.65602744", "0.6534423", "0.6530357", "0.6530357", "0.65282446", "0.6499427", "0.64959925", "0.64911747", "0.6481941", "0.6480201", "0.6472803", "0.6461888", "0.64554405", "0.64518213", "0.6440541", "0.64153737", "0.64146894", "0.641403", "0.64092106", "0.6386936", "0.63863724", "0.63826305", "0.6377773", "0.6377339", "0.6374837", "0.63703245", "0.6360606", "0.6351255", "0.63424134", "0.6342222", "0.6338803", "0.6336127", "0.63343567", "0.6325349", "0.63241667", "0.6321417", "0.6311233", "0.6309842", "0.630735", "0.6304999", "0.6300163", "0.6299674", "0.62987924", "0.6292389", "0.6284889", "0.6275492", "0.62706107", "0.62679034", "0.62589043", "0.62588716", "0.62508714", "0.6246909", "0.6244003", "0.6239434", "0.62378097", "0.62341577", "0.62264204", "0.6225282", "0.62176955", "0.62171483", "0.6216658", "0.62156665", "0.62003416", "0.6200058", "0.61929715", "0.61928815", "0.61918026", "0.6190366", "0.6190366", "0.6190366", "0.6190366", "0.6188647", "0.6178758", "0.6178644", "0.6176313", "0.6171547", "0.61709726", "0.6168647", "0.61617357", "0.61588293" ]
0.0
-1
click handler for canceling editing
function cancelButtonClick() { if (!continueProcessing) { $('#splitUUID').val(''); $('#splitDescription').val(""); setTimefieldTimeBegin(0); setTimefieldTimeEnd(0); $('#splitIndex').html('#'); $('.splitItem').removeClass('splitItemSelected'); $('.splitSegmentItem').removeClass('splitSegmentItemSelected'); editor.selectedSplit = null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function editCancelFunc(){\n setEdit(null);\n }", "function handleCancelEdit() {\n updateIsEditMode(false);\n }", "function cancelEdit(e){\n e.preventDefault();\n \n Session.set('editingPost', null);\n}", "function cancelEdit(){\n //close edit box\n closeEditBox();\n}", "function cancelEdit(e){\n if (e.target.classList.contains('post-cancel')) {\n ui.changeFormState('add');\n }\n\n e.preventDefault();\n}", "function cancelEdit() {\n var id = $(this).data(\"id\");\n var text = $(\"#span-\"+id).text();\n\n $(this)\n .children()\n .hide();\n $(this)\n .children(\"input.edit\")\n .val(text);\n $(this)\n .children(\"span\")\n .show();\n $(this)\n .children(\"button\")\n .show();\n }", "@action\n cancelEditRow() {\n set(this, 'isEditRow', false);\n }", "function cancelEditCard() {\n // 8-1 Set isEditing flag to update the view.\n this.isEditing = false\n\n // 8-2 Reset the id we want to edit.\n this.idToEdit = false\n\n // 8-3 Clear our form.\n this.clearForm()\n}", "cancelEditType() {\n this.type = this.editing;\n this.editing = '';\n }", "cancelEdit() {\n const me = this,\n {\n inputField,\n oldValue,\n lastAlignSpec\n } = me,\n {\n target\n } = lastAlignSpec,\n {\n value\n } = inputField;\n\n if (!me.isFinishing && me.trigger('beforeCancel', {\n value,\n oldValue\n }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', {\n value,\n oldValue\n });\n\n if (target.nodeType === 1) {\n target.classList.remove('b-editing');\n target.classList.remove('b-hide-visibility');\n }\n\n me.isFinishing = false;\n }\n }", "function cancelEdit() {\n\n for (let i = 0; i < addCommentButtons.length; i++)\n addCommentButtons[i].style.display = \"initial\";\n\n const articleId = this.id.replace('delete-', '');\n tinymce.activeEditor.remove();\n const content = document.querySelector(`#content-${articleId}`);\n content.innerHTML = initialText;\n resetButtonsFromEditing(articleId);\n }", "function cancelEdit() {\n resetForm();\n formTitle.innerHTML = 'Add Link';\n cancelButton.parentElement.removeChild(cancelButton);\n updateButton.parentElement.removeChild(updateButton);\n saveButton.classList.remove('hidden');\n }", "function editingCanceled() {\n\tlocation.reload();\n}", "cancelEdit() {\n const me = this,\n { inputField, oldValue } = me,\n { value } = inputField;\n\n if (!me.isFinishing && me.trigger('beforecancel', { value: value, oldValue }) !== false) {\n // Hiding must not trigger our blurAction\n me.isFinishing = true;\n me.hide();\n me.trigger('cancel', { value, oldValue });\n me.isFinishing = false;\n }\n }", "function cancelEditOpp() {\n clearEditOppForm();\n}", "cancelEdit () {\n this.editCache = null\n this.editingTrip = null\n this.editType = null\n }", "function cancelChange()\r\n\t{\r\n\r\n\t\tif ( editingRow !== -1 )\r\n\t\t{\r\n\r\n\t\t\tif ( wantClickOffEdit === true )\r\n\t\t\t{\r\n\t\t\t\t// get the updated value\r\n\t\t\t\tvar newValue = document.getElementById('editCell');\r\n\t\t\t\tif ( null !== newValue )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( class_myRows[editingRow].name !== newValue.value )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tsaveChange(editingRow);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tresetRowContents();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tresetRowContents();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t// set the flag\r\n\t\trowEditing = false;\r\n\t}", "cancelMe() {\n if (this.editFlag) {\n this.viewMe();\n } else {\n this.removeFromParentWithTransition(\"remove\", 400);\n }\n }", "cancelEdit() {\n this.set('isManage', false);\n this.folder.set('isEdit', false);\n this.folder.rollbackAttributes();\n }", "function cancel()\n {\n dirtyController.setDirty(false);\n hideWorkflowEditor();\n hideWorkflowUpdateEditor();\n selectWorflow(selectedWorkflow);\n }", "function editzselex_cancel()\n{\n Element.update('zselex_modify', '&nbsp;');\n Element.show('zselex_articlecontent');\n editing = false;\n return;\n}", "handleCancel(event){\n this.showMode=true;\n this.hideButton=false;\n this.setEdit = true;\n this.hideEdit=false; \n }", "cancel() {\n // Rollback edit badge changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editBadgeShow', false);\n }", "function cancelEdit(){\r\n\t//clears fields\r\n\t$(\"#edt-g-name\").val(\"\");\r\n\t$(\"#edt-g-time\").val(\"\");\r\n\t$(\"#auto-input-1\").val(\"\");\r\n\tvar selMin = $('#selEdtMin');\r\n\tselMin.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMin.selectmenu(\"refresh\", true);\r\n\tvar selMax = $('#selEdtmax');\r\n\tselMax.val('').attr('selected', true).siblings('option').removeAttr('selected');\r\n\tselMax.selectmenu(\"refresh\", true);\r\n\t//hides edit fields and shows games list\r\n\t$(\"#editList\").show();\r\n\t$(\"#editBlock\").hide();\r\n\t$(\"#frm1\").show();\r\n\t$(\"#para1\").show();\r\n\t//takes save function off button\r\n\tvar savBtn = $('#editSave');\r\n\tsavBtn.removeAttr('onClick');\r\n\t}", "function cancelEditLead() {\n clearEditLeadForm();\n}", "cancel() {\n this.disableEditMode();\n (this.props.onCancel || Function)();\n }", "cancelEdit(todo) {\n this.editTodo = null;\n todo.isEdited = false;\n }", "function cancelEditSale() {\n clearEditSaleForm();\n}", "editTodoCancel() {\r\n delegate(this.listHolder, \"li .edit\", \"keyup\", ({ target, keyCode }) => {\r\n if (keyCode === ESCAPE_KEY) {\r\n target.dataset.iscanceled = true;\r\n target.blur();\r\n }\r\n });\r\n }", "cancel() {\n // Rollback edit profile changes\n this.changeset.rollback(); //this.model.reload();\n\n this.set('editProjectShow', false);\n }", "function cancelEdit() {\n var id = $(this).parent().attr(\"id\");\n var type = id.split(\"-\");\n var index = findVM(id.split(\"-\")[0].toUpperCase());\n var value;\n \n if (type.length > 2) {\n /* A product resource has been modified */\n var prod = findProduct(index, type[1]);\n type = type[2];\n } else {\n /* A VM resource has been modified */\n type = type[1];\n }\n \n switch (type) {\n case \"status\":\n case \"alarm\":\n value = svm[index][type].toStr();\n break;\n case \"loc\":\n value = svm[index][type].lat + \", \" + svm[index][type].lng;\n break;\n case \"qty\":\n case \"price\":\n value = svm[index].products[prod][type];\n break;\n default:\n value = svm[index][type];\n break;\n }\n $(\"#\" + id).empty();\n $(\"#\" + id).text(value);\n $(\"#\" + id).mouseenter(showEditIcon);\n $(\"#\" + id).mouseleave(hideEditIcon);\n}", "function onCancelClick() {\n logger.info('cancel_button click event handler');\n clearAllErrors();\n closeKeyboards();\n $.edit_customer_profile.fireEvent('route', {\n page : 'profile',\n isCancel : true\n });\n}", "cancelEditing() {\n this.setState({ isEditing: false });\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "function cancel () {\n closeDialog();\n if (isEditPage) {\n table.restoreBackup();\n }\n }", "cancelRowEdit() {\n if (this._isSaving) {\n return;\n }\n\n const activeEditInfo = this._activeEditInfo;\n if (activeEditInfo) {\n const { onCancelRowEdit } = this.props;\n if (onCancelRowEdit) {\n onCancelRowEdit(activeEditInfo);\n }\n \n this.setActiveEditInfo();\n }\n }", "function cancel_score_edit()\n\t{\n\t\tdocument.getElementById('score_edit_form').reset();\n\t\t$('#score_edit').dialog('close');\n\t}", "cancelEdit() {\n this.folderUser.set('isEdit', false);\n this.set('isManage', false);\n }", "cancel(e) { }", "cancelEdit() {\n this.handsontableData = JSON.parse(JSON.stringify(this.handsontableDataBackup));\n this.hot.loadData(this.handsontableData);\n this.hot.render();\n\n // Change edit mode on redux\n this.props.setEdit();\n }", "function handleCancelButton() {\n\t\tconsole.log(\"Now cancelling action..\");\n\t\tCounterStart = 0; \t// reset counter\t\t\t\t\n\t\tcloseCancelPopup();\n\t\trevertChanges(command);\n\t\tconsole.log(\"Reverting changes..\");\t\n\t}", "function abortEditing() {\n\t\t$('.editing').removeClass('editing');\n\t\t$('.edit').val('').off('keyup');\n\t}", "onCancelButtonClick() {\n this.representedHTMLElement.parentNode.removeChild(this.representedHTMLElement);\n }", "cancelEdit() {\r\n const that = this,\r\n editingInfo = that._editing;\r\n\r\n if (!editingInfo) {\r\n return;\r\n }\r\n\r\n for (let i = 0; i < editingInfo.cells.length; i++) {\r\n const cell = editingInfo.cells[i];\r\n\r\n if (cell.editor.contains((that.shadowRoot || that.getRootNode()).activeElement)) {\r\n that._focusCell(cell.element);\r\n }\r\n\r\n cell.editor.remove();\r\n that._setCellContent(cell.element, that._formatCellValue(editingInfo.row, that.columnByDataField[cell.dataField], cell.element));\r\n cell.element.classList.remove('editing');\r\n }\r\n\r\n delete that._editing;\r\n }", "handleCancel() {\n\t\tthis.clearInputs();\n\n\t}", "editCancel() {\n\t \t\t\tconst { travel } = this.state;\n\t \t\t\t\tthis.props.cancel(travel.key);\n\t }", "cancelEdit() {\n if (this._editedLevel > 0) {\n this._editedLevel--;\n }\n\n // Cancel in sub-models\n if (this._editedLevel === 0) {\n _each(this._childCollections, childCollection => {\n childCollection.cancelEdit();\n });\n\n // Revert changes\n // TODO\n\n // Reset state\n this._editedEvents = [];\n }\n }", "cancel(){\n \t//this.state.edittable = -1;\n \tthis.setState({edittable:-1});\n\n }", "function cancelEditOperador(){\n\t\t $(\"#form_edit_operdor\")[0].reset();\n\t}", "function cancel(){\n $uibModalInstance.dismiss('delete');\n }", "function cancelAction(){\n $('#listcontent').css('display','block');\n $('#editorholder').html('');\n}", "function cancelAction(){\n $('#listcontent').css('display','block');\n $('#editorholder').html('');\n}", "modalCancel(){\n\t\t// save nothing\n this.setValues = null;\n\t\t// and exit \n this.modalEXit();\n }", "function cancelEditTodoList() {\n $(\"editListDiv\").style.display='none';\n}", "function cancelEditing() {\n $(\"#rightContainer\").html(\"\");\n}", "function actionCancelEditCategory()\n{\n\t// Revert field input data be null\n\t$('#txt_category_id').val(0);\n\t$('#cbo_parent').val(0);\n\t$('#txt_name').val('');\n\t$('#txt_description').val('');\n\t\n\t// Change button update become save\n\t$('.category.btn-update').fadeOut(500);\n\t$('.category.btn-cancel-edit').fadeOut(500);\n\tsetTimeout(function(){$('.category.btn-save').fadeIn(600).removeClass('hide');}, 500);\n}", "function outsideClickEdit(e) {\n if(e.target == modalEdit) closeModalEdit()\n }", "onEditURICanceled() {\n this.state.isEditURIConfirm = false;\n this.trigger(this.state);\n }", "function cancel(e) {\n titleTask.value = null;\n descriptionTask.value = null;\n e.target.parentElement\n .parentElement\n .parentElement\n .classList.toggle('show');\n root.classList.toggle('opacity');\n document.body.classList.toggle('stop-scrolling');\n}", "function cancelEditing(itemId){\n $('#'+itemId+'-desc').attr('disabled','disabled');\n $('#'+itemId+'-info').attr('disabled','disabled');\n $('#'+itemId+'-type').attr('disabled','disabled');\n $('#'+itemId+'-category').attr('disabled','disabled');\n $('#'+itemId+'-price').attr('disabled','disabled');\n $('#'+itemId+'-stock').attr('disabled','disabled');\n $('#'+itemId+'-save').attr('disabled','disabled');\n $('#'+itemId+'-edit').show();\n $('#'+itemId+'-cancel').hide();\n}", "handleCancel() {\n this.handleModalToggle();\n this.resetData();\n }", "_handleClickCancel(e) {\n if (DEBUG) {\n console.log('[*] ' + _name + ':_handleClickCancel ---');\n }\n\n e.preventDefault();\n }", "function handleCancelClick(){\n $('main').on('click', '.cancel-button', function(event){\n store.adding = false;\n render(); \n }); \n return;\n}", "function cancel() {\n scope.showCancelModal = true;\n }", "cancel(e) {\n // reset and close dialog\n this.close();\n }", "function cancel ()\n {\n $uibModalInstance.dismiss('cancel');\n }", "cancel() {\n this.modal.jQueryModalFade.removeClass('modal_fade_trick');\n this.modal.jQueryModalWindow.css('display', 'none');\n this.clear();\n this.clearInvalid();\n this.hideNotes();\n if(!this.good){\n this.initPlaceholders();\n }\n }", "handleCancelRow(event) {\n this.showInputSection = false;\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function cancel() {\n $uibModalInstance.dismiss('cancel');\n }", "function handle_cancel() {\n $(\"table.data-table tr.selected\").removeClass(\"selected\");\n $.featherlight.current().close();\n}", "function cancel(event) {\n let dialog = document.getElementById(\"dialog\");\n document.getElementById(\"title\").value = \"\";\n document.getElementById(\"post\").value = \"\";\n document.getElementById(\"submit-btn\").innerHTML = \"Submit\";\n dialog.open = false;\n console.log(\"cancel\");\n}", "onCancel() {\n this.resetForm();\n }", "cancelAction(){}", "function cancelAcademicRowChange(event) {\n let parent = $(this).parent().parent().parent();\n let tdPeriod = parent.children(\"td:nth-child(2)\");\n let tdClassName = parent.children(\"td:nth-child(3)\");\n let tdHonors = parent.children(\"td:nth-child(4)\");\n let tdAP = parent.children(\"td:nth-child(5)\");\n let tdTeacherName = parent.children(\"td:nth-child(6)\");\n let tdGrade = parent.children(\"td:nth-child(7)\");\n let tdModify = parent.children(\"td:nth-child(8)\");\n\n tdPeriod.html(event.data.period);\n tdClassName.html(event.data.className);\n tdHonors.html(event.data.honors);\n tdAP.html(event.data.ap);\n tdTeacherName.html(event.data.teacherName);\n tdGrade.html(event.data.grade);\n $('.sBtn').off();\n $('.cBtn').off();\n tdModify.html(getEditDeleteButtons());\n\n $('.eBtn').on(\"click\", editAcademicRow);\n $('.dBtn').on(\"click\", error_not_implemented);\n}", "function cancel(id) {\n var remove = document.getElementById('removeItem');\n if (remove) {\n remove.parentNode.removeChild(remove);\n }\n\n var edit = document.getElementById('editItem');\n if (edit) {\n edit.parentNode.removeChild(edit);\n }\n\n var input = document.getElementById('inputBox');\n if (input) {\n input.parentNode.removeChild(input);\n }\n\n var submit = document.getElementById('editSubmitBtn');\n if (submit) {\n submit.parentNode.removeChild(submit);\n }\n\n var cancel = document.getElementById('cancelItem');\n if (cancel) {\n cancel.parentNode.removeChild(cancel);\n }\n}", "function cancelBtnComment(){\n // au clic sur le bouton annuler\n $('.cancel-btn').on('click', function (e) {\n // empeche l'action prévue sur le bouton annuler\n e.preventDefault();\n // affiche les bouton répondre\n $('.btn-reply').fadeIn(\"fast\", function () {\n // Animation complete\n });\n // affiche le bouton Commenter\n $('#createComm').fadeIn(\"fast\", function () {\n // Animation complete\n });\n // supprime les bouton annuler\n $('.cancel-btn').replaceWith(\"\");\n // supprime le formulaire de commentaire\n $('form[name=\"reply_comment\"]').replaceWith(\"\");\n // supprime les formulaires de reponse\n $('form[name=\"new_comment\"]').replaceWith(\"\");\n // supprime les messages flash\n $('.flash-msg').replaceWith(\"\");\n })\n }", "function cancelEdit(curr){\r\n hideButton(curr);\r\n // resume refreshing\r\n livedata = setInterval(reload,2000);\r\n}", "function stopEditing() {\n editing = false;\n statusIndicator.remove();\n setStatus(\"\");\n sourceStatus = \"\";\n urlInput.removeEventListener(\"paste\", onURLChange);\n}", "function handleClose() {\n setOpen(false)\n setEditItem(null)\n }", "escFunction(e){\r\n if (this.state.editMode) {\r\n if(e.keyCode === 27) {\r\n this.cancelEdits(e);\r\n }\r\n }\r\n }", "cancelProfile(e) {\n e.preventDefault();\n this.setState({\n edit: !this.state.edit\n })\n\t\tthis.setState(prevState => ({readOnly: !prevState.readOnly}))\n }", "function coauthors_stop_editing( event ) {\n\n\t\tvar co = jQuery( this );\n\t\tvar tag = jQuery( co.next() );\n\n\t\tco.attr( 'value',tag.text() );\n\n\t\tco.hide();\n\t\ttag.show();\n\n\t//\tediting = false;\n\t}", "cancel() {\n this.dispatchEvent(new PayloadEvent(ModifyEventType.CANCEL, this.clone_));\n this.setActive(false);\n }", "function cancelRemove() {\n scope.showDeleteModal = false;\n }", "function cancelRemove() {\n scope.showDeleteModal = false;\n }", "function cancelAcademicRowChange(event) {\n let parent = $(this).parent().parent().parent();\n let tdPeriod = parent.children(\"td:nth-child(2)\");\n let tdClassName = parent.children(\"td:nth-child(3)\");\n let tdHonors = parent.children(\"td:nth-child(4)\");\n let tdAP = parent.children(\"td:nth-child(5)\");\n let tdTeacherName = parent.children(\"td:nth-child(6)\");\n let tdGrade = parent.children(\"td:nth-child(7)\");\n let tdModify = parent.children(\"td:nth-child(8)\");\n\n tdPeriod.html(event.data.period);\n tdClassName.html(event.data.className);\n tdHonors.html(event.data.honors);\n tdAP.html(event.data.ap);\n tdTeacherName.html(event.data.teacherName);\n tdGrade.html(event.data.grade);\n $('.sBtn').off();\n $('.cBtn').off();\n tdModify.html(getEditDeleteButtons());\n\n $('.eBtn').on(\"click\", editAcademicRow);\n $('.dBtn').on(\"click\", error_not_implemented);\n}", "undo() {\n\t\tthis.editing = false;\n\t\tthis.query('.edit').value = this.text;\n\t}", "function goCancel() {\n datacontext.revertChanges(vm.learningItem);\n goBack();\n }", "function resetEdit() {\n\t$('.icons').removeClass('editable');\n\t$('#save-recipe, #cancel-recipe').hide();\n\t$('#detail-description, #detail-name').attr('contenteditable', false);\n\t$('#detail-new-ingredient-input').hide();\n}", "function cancel() {\n\t\tdelete state.people[id]\n\t\temit(\"person modal canceled\")\n\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "function cancel() {\n\t\t\tfocusedControl.fire('cancel');\n\t\t}", "onCancelEditTeamDialog(e) {\n if (e.persist())\n e.preventDefault();\n this.props.dispatch(Action.getAction(adminActionTypes.SET_EDIT_TEAM_DIALOG_OPEN, { IsOpen: false }));\n }", "function cancelNodeEdit(callback) {\n clearNodeDialog();\n callback(null);\n}" ]
[ "0.8243242", "0.80517614", "0.8039719", "0.7993903", "0.790349", "0.77952075", "0.7659383", "0.76372707", "0.7633507", "0.7616949", "0.76094365", "0.7607123", "0.7562926", "0.7552121", "0.75511426", "0.7503841", "0.7441928", "0.74407935", "0.74384713", "0.74026483", "0.7381113", "0.7370844", "0.7368383", "0.73452556", "0.72857225", "0.72795767", "0.7263739", "0.72114027", "0.7207035", "0.7203489", "0.7167876", "0.7156223", "0.71368694", "0.71348315", "0.71348315", "0.7120053", "0.7106133", "0.71018344", "0.7099067", "0.70905674", "0.7080952", "0.70698756", "0.70186394", "0.70005035", "0.6957116", "0.6950805", "0.69439864", "0.6939846", "0.6931245", "0.69295007", "0.6903168", "0.6903168", "0.6902434", "0.6893476", "0.6888322", "0.68547446", "0.684177", "0.684101", "0.6825422", "0.682237", "0.6819516", "0.6816187", "0.68149686", "0.6794288", "0.67695516", "0.6767366", "0.6750722", "0.6749929", "0.673266", "0.673266", "0.673266", "0.673266", "0.673266", "0.673266", "0.673266", "0.6730497", "0.6729201", "0.6728977", "0.67229205", "0.671457", "0.6713212", "0.6703725", "0.6690747", "0.66854966", "0.66837996", "0.6652618", "0.66491914", "0.66382873", "0.6638151", "0.66343665", "0.66343665", "0.662226", "0.6617723", "0.6615665", "0.66132754", "0.6606964", "0.6602062", "0.6602062", "0.6602062", "0.65815693", "0.657849" ]
0.0
-1
click/shortcut handler for removing current split item
function splitRemoverClick() { if (!continueProcessing) { item = $(this); var id = item.prop('id'); if (id != undefined) { id = id.replace("splitItem-", ""); id = id.replace("splitRemover-", ""); id = id.replace("splitAdder-", ""); } else { id = ""; } if (id == "" || id == "deleteButton") { id = $('#splitUUID').val(); } id = parseInt(id); if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) { if (editor.splitData.splits[id].enabled) { $('#splitItemDiv-' + id).addClass('disabled'); $('#splitRemover-' + id).hide(); $('#splitAdder-' + id).show(); $('.splitItem').removeClass('splitItemSelected'); setEnabled(id, false); if (!zoomedIn()) { if (getCurrentSplitItem().id == id) { // if current split item is being deleted: // try to select the next enabled segment, if that fails try to select the previous enabled item var sthSelected = false; for (var i = id; i < editor.splitData.splits.length; ++i) { if (editor.splitData.splits[i].enabled) { sthSelected = true; selectSegmentListElement(i, true); break; } } if (!sthSelected) { for (var i = id; i >= 0; --i) { if (editor.splitData.splits[i].enabled) { sthSelected = true; selectSegmentListElement(i, true); break; } } } } selectCurrentSplitItem(); } } else { $('#splitItemDiv-' + id).removeClass('disabled'); $('#splitRemover-' + id).show(); $('#splitAdder-' + id).hide(); setEnabled(id, true); } } cancelButtonClick(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "removeItem(_item) { }", "remove(item) {\n const that = this;\n\n if (typeof (item) === 'number') {\n item = that._items[item];\n }\n else if (typeof item === 'string') {\n item = document.getElementById(item);\n }\n\n if (!(item instanceof JQX.TabsWindow)) {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n if (item.closest('jqx-docking-layout') !== that) {\n that.error(that.localize('invalidNodeRemove', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n that.removeChild(item);\n }", "takeout(item) {\n var index = this.item.indexOf(item);\n if (this.open = true && index > -1) {\n this.item.splice(index, 1);\n alert(\"Item has been removed from the backpack.\");\n }\n }", "function removeListItem() {\n\t\t\t\t$(this).parent().remove();\n\t\t\t}", "function deleteItem(event) {\n var myButton = event.currentTarget\n var myInput = myButton.previousSibling\n var myBr = myButton.nextSibling\n\n myInput.remove()\n myButton.remove()\n myBr.remove()\n}", "function removeItemAfterClick(e){\n\t // if (e.target.tag === deleteElementList){\n\t \t// console.log(e.target.tagName);\n\t \t// deleteElementList.querySelector(\"li\").remove();\n\t \te.target.parentNode.remove();\n\t\t// e.deleteElementList.remove();\n\t\t// deleteElementList.removeChild(deleteElementList.childNodes[i]);\n\t\n\n}", "function deleteListItem(){\n \t\t$(this).parent().remove();\n \t}", "function deleteItem(){ \n $(this).parent().remove();\n }", "function deleteListItem() {\n item.remove();\n }", "function removeItem(e) {\n e.target.parentElement.removeChild(e.target);\n}", "function liDoubleClicked() {\n removeListItem()\n }", "function handleDeleteItem(e) {\n console.log('click');\n if (e.target.nodeName === 'BUTTON') {\n // removeClass();\n // removeListener();\n localStorage.removeItem('json');\n }\n}", "function remove_item() {\n for (var i=0; i<selected_items.length; i++) {\n items.splice(selected_items[i],1);\n }\n $('#inventory_grid').html('');\n populate_inventory_grid();\n $('#item_action_menu').hide();\n selected_items = [];\n }", "function deleteListItem(e) {\n\t\te.remove();\n\t}", "function removeItem(button, myList, mySavedList, contentSection, myProject) {\n clearListItem(button.value, myList, mySavedList);\n loadHome(contentSection, myList, mySavedList, myProject);\n}", "function removeItem () {\n \tvar item = this.parentNode.parentNode; \n \tvar parent = item.parentNode; \n \tvar id = parent.id; \n \tvar value = item.innerText;\n\n \t//update data array - rem0ve from data array \n \tif (id === 'openTasks') {\n\tdata.openTasks.splice(data.openTasks.indexOf(value),1);\n\t} else {\n\tdata.doneTasks.splice(data.openTasks.indexOf(value),1);\n\t} \n\n\tdataObjectUpdated(); //update local storage \n \tparent.removeChild(item); //apply to DOM \n }", "function removeItem() {\n createListElement(completedList, this.parentElement.textContent);\n\tthis.parentElement.remove();\n\ttoggleListDisplay(activeList);\n}", "function deleteItem(e){\n}", "function cleanItem(event) {\n event.stopImmediatePropagation();\n $(this)\n .removeClass('fp-trail fp-active fp-hovered fp-clicked');\n }", "function removeItem(e) {\n var wdlist = Array.from(gList);\n let identifier = null;\n let idElement = e.currentTarget.id.split(\"-\")[0];\n console.log(idElement);\n for (var i = 0; i < list.length; i++) {\n if (list[i].id === parseInt(idElement)) {\n identifier = i;\n console.log(identifier);\n }\n }\n console.log(identifier);\n wdlist.splice(identifier, 1);\n gSetList(wdlist);\n }", "removeChild(node) {\n const that = this;\n\n if (!node) {\n that.error(that.localize('invalidNode', { elementType: that.nodeName.toLowerCase(), method: 'removeChild' }));\n return\n }\n\n if (!(node instanceof JQX.TabsWindow)) {\n that.error(that.localize('invalidNodeType', { elementType: that.nodeName.toLowerCase(), method: 'removeChild' }));\n return;\n }\n\n if (!that.isCompleted) {\n const args = Array.prototype.slice.call(arguments, 2);\n return HTMLElement.prototype.removeChild.apply(that, args.concat(Array.prototype.slice.call(arguments)));\n }\n\n const splitterItem = node.closest('jqx-splitter-item');\n\n if (!splitterItem) {\n return;\n }\n\n const splitter = splitterItem.closest('jqx-splitter');\n\n if (!splitter) {\n return;\n }\n\n splitterItem.closest('jqx-splitter').removeChild(splitterItem);\n\n that._items.splice(that._items.indexOf(node), 1);\n\n that._removeUnneccessaryItems(splitter);\n\n if (that._items.filter(item => item.opened).length === 0 && !that.$.placeholderItem.parentElement) {\n that.$.itemsContainer.appendChild(that.$.placeholderItem);\n }\n\n node.layout = that;\n that._handleAutoSave();\n that.$.fireEvent('stateChange', { type: 'remove', item: node });\n }", "function removeItem(){\r\n /////////////////////////////////////////////////////////\r\n //::::::::::::Deleting Element using DOM Traversal.::://\r\n var deleteBtn = $.querySelector('.deleteBtn');\r\n deleteBtn.addEventListener('click', (e) => {\r\n var clientDel = e.target.parentElement.parentElement;\r\n clientDel.parentNode.removeChild(clientDel);\r\n\r\n //////////////////////////////////////////////////////////////////\r\n //::::::::::::Adding A text after All Items are Deleted::::::::://\r\n\r\n var emptyResponses = $.querySelector('.responses').children;\r\n if(emptyResponses.length === 0) {\r\n var deletedRes = $.querySelector('.deletedRes').innerHTML;\r\n $.querySelector('.keepReading').innerHTML = deletedRes;\r\n inputsFun();\r\n }\r\n });\r\n\r\n }", "function removeItem(element) {\n $(element).parent().remove();\n }", "function removeLaboratoriesItem(laboratoryItem) {\n laboratoryItem.find(\"a.laboratories-remove-item\").click(function (e) {\n e.preventDefault();\n var item = this;\n var title = $(this).data('confirm-title');\n var text = $(this).data('confirm-text');\n var line = $(item).closest('tr.laboratories-item');\n $(line).remove();\n\n });\n}", "function removeThisListItem() {\n $(this).parent().remove();\n delCount();\n }", "function removeItem() {\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var text = item.innerText.trim();\n\n if (id === 'todo') {\n data.todo.splice(data.todo.indexOf(text), 1);\n } else if (id === 'done') {\n data.done.splice(data.done.indexOf(text), 1);\n }\n parent.removeChild(item);\n\n dataObjectUpdated();\n \n}", "remove(index) {\n const that = this;\n\n if (index instanceof JQX.SplitterItem && index.closest('jqx-splitter') === that) {\n that.removeChild(index);\n return;\n }\n\n if (typeof index !== 'number') {\n that.error(that.localize('invalidIndex', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n if (index > that._items.length || index < 0) {\n that.error(that.localize('indexOutOfBound', { elementType: that.nodeName.toLowerCase(), method: 'remove' }));\n return;\n }\n\n that.removeChild(that._items[index]);\n }", "function removeItem(element){\n \n}", "function handleClick(){\n props.removeItem(props.item.id)\n }", "function deleteLine(){\n\t\tul.removeChild(li);\n\t\tli.removeChild(btn);\n\t}", "function delitem(evt) {\n if (evt.keyCode == 46) ul.removeChild(ul.lastElementChild);\n}", "function minusItem(){\n let elem = event.currentTarget.dataset.index;\n let elemParent = event.currentTarget.parentElement;\n elemParent.remove();\n pushCameArray();\n cameArray.splice(elem, 1);\n localStorage.setItem(localStorageKey, JSON.stringify(cameArray));\n}", "function itmRemove(trig,item) {\n\t\ttrig.click(function() {\n\t\t\t$(this).parent(item).fadeOut();\n\t\t});\n\t}", "function deleteItem(e) {\n e.preventDefault();\n if (e.target.localName == 'svg') {\n let parentBtn = e.target.parentElement;\n parentBtn.parentElement.remove();\n } if (e.target.localName == 'button') {\n e.target.parentElement.remove();\n }\n }", "function deleteItem(event) {\r\n event.parentNode.remove();\r\n}", "remove(item){\n container.removeChild(item);\n }", "function removeItem(e) {\n\n // getting the item to be deleted \n let todoItem = e.target.previousSibling.textContent;\n let idx = allItems.indexOf(todoItem); // looking for item's index in the tasks list\n allItems.splice(idx, 1); // removing the found index from the tasks list\n // console.log(allItems);\n localStorage.setItem(\"tasks\", JSON.stringify(allItems)); // updating the local storage \n list.innerHTML = \"\"; \n show(); \n}", "function removeItem(event){\n if(event.target.classList.contains('del')){\n var li = event.target.parentElement;\n taskList.removeChild(li);\n }\n}", "function deleteBLItem(){\n var item = localStorage.getItem('item'); // Depending on the value of the key 'item', the respective value is retrieved\n var inBucketList = JSON.parse(localStorage.getItem('inBucketList')); // Array \"inBucketList\" is retrieved from local storage\n var blIndex = inBucketList.indexOf(item); // Respective item that has been clicked on to be deleted is retrieved from Array\n document.getElementById(item).style.display = \"none\"; // The item that has been removed from the array is no longer visible in the BL\n inBucketList.splice(blIndex, 1); // Item is removed from Bucket List Array\n localStorage.setItem('inBucketList', JSON.stringify(inBucketList)); // Array is stored in local storage\n}", "function removeButton(){\n $(\"#car-view\").empty();\n var topic = $(this).attr('data-name');\n var itemindex = topics.indexOf(topic);\n if (itemindex > -1) {\n topics.splice(itemindex, 1);\n renderButtons();\n }\n }", "function rmvClick(){\n let li = this.parentNode.parentNode;\n let ul = li.parentNode;\n ul.removeChild(li);\n}", "removeWebSharebutton() \n {\n $(\".webshare-list-item\").remove();\n }", "function deleteListItem() {\n\tthis.parentNode.remove();\n}", "function deleteItem(){\n\tul.removeChild(this.parentElement);\n}", "_removeItem(e) {\n e.preventDefault();\n e.stopPropagation();\n\n const $target = $(e.target);\n const $entry = $target.closest('.djblets-c-list-edit-widget__entry');\n\n if (this._numItems > 1) {\n $entry.remove();\n this._numItems -= 1;\n this._$list.find('.djblets-c-list-edit-widget__entry')\n .each((idx, el) => {\n const $el = $(el);\n $el.attr('data-list-index', idx);\n this._updateEntryInputName($el, idx);\n });\n $(`input[name=\"${this._fieldName}_num_rows\"]`)\n .val(this._numItems);\n } else {\n const $defaultEntry = this._createDefaultEntry(0);\n $entry.replaceWith($defaultEntry);\n }\n }", "function removeitem(e){\r\n\tconsole.log('Removing: ', e.target.name);\r\n\tbrowser.storage.sync.get().then(\r\n\t(storedSettings) => {\r\n\t\tvar details=storedSettings.details;\r\n\t\tdetails.sites.splice(e.target.name, 1);\r\n\t\tbrowser.storage.sync.set({details}).then(refresh, onError);\r\n\t},\r\n\tonError\r\n\t)\r\n}", "function removeItem(item){\r\n exec(\"py remove.py \" + item[0] + \" \" + item[1]);\r\n}", "function remove(event) {\n let button = event.target;\n let li = button.parentElement;\n li.remove();\n return false;\n}", "removeAction(){\n // Elimino el todo seleccionado\n removeTodo(this);\n }", "remove() {\n this._item = null;\n this.render();\n }", "_remove(event) {\n event.stopPropagation();\n this.remove();\n }", "function removeItem(){\n var item = this.parentNode.parentNode;\n var parent = item.parentNode;\n var id = parent.id;\n var value = item.innerText;\n \n \n data.todo.splice(data.todo.indexOf(value),1);\n \n \n dataObjectUpdated();\n \n parent.removeChild(item);\n}", "handleUndoRemove() {\n this.handleShelfUpdate(this.state.removedItem, this.state.removedItem.shelf);\n this.handleAlertDismiss();\n }", "function eliminarEntrada() {\n\tli.remove(); //remueve la entrada con el click del botoncito\n\t}", "static removeItem(el) {\n if (el.classList.contains('remove')) {\n el.parentElement.parentElement.remove();\n UI.showAlert('Item deleted','danger');\n }\n }", "function onClickRemoveQuestion(){\n let question = $(this).parent().parent();\n let index = $(\".question\").index(question);\n question.remove();\n surveyChanged[\"questions\"].splice(index,1);\n}", "function deleteItem(evt) {\n\tvar button = evt.target;\n\tvar row = button.parentNode.parentNode;\n\tvar cells = row.getElementsByTagName(\"td\");\n\tvar name = cells[1].innerHTML;\n\tvar type = cells[2].innerHTML;\n\tvar group = row.id.slice(0, row.id.indexOf(\"-\"));\n\tif (group === \"base\") {\n\t\tbaseItems.delete(type, name);\n\t} else {\n\t\toptionalItems.delete(type, name);\n\t}\n\trow.parentNode.removeChild(row);\n\tsyncToStorage();\n}", "static removeItem(id, e) {\n //if we get the id\n //we only have to search for the pos\n var pos;\n var li;\n var lu = document.getElementById(\"listTask\");\n if(id === undefined || id === null){\n var items = e.parentElement.parentNode.parentElement;\n var li = items.parentElement;\n\n //get the input, it is placed \n //in the 4 position\n var hiddenInput = items.childNodes[2];\n pos = getPositionStored(hiddenInput.value);\n }\n else{\n pos = getPositionStored(id);\n li = lu.childNodes[pos];\n }\n\n if (pos !== -1) {\n storedTask.data.splice(pos, 1);\n //update data in Local Storage\n localStorage.setItem(\"task\", JSON.stringify(storedTask));\n }\n lu.removeChild(li);\n }", "function removeButtonListener(div){\n var button = div.querySelector(\"button\"); \n button.addEventListener(\"click\", removeItem)\n}", "function handleElementRemove(evt) {\n const id = evt.model.attributes.metaData.pipelineStepMetaData.id;\n delete diagramStepToStepMetaLookup[id];\n}", "function removeItem(element) {\n $(element).parent().remove();\n}", "function deleteItem() {\n console.log(\"\\ndeleteItem clicked\");\n}", "function addRemoveTodoItemClickHandler(e) { \r\n var $el = $(this).off(\"click\", addRemoveTodoItemClickHandler);\r\n var $item = $el.parent().parent();\r\n var val = parseInt($item.find(\".work-todo-list-item-checkbox\").attr(\"data-item-id\"));\r\n var txt = $item.find(\".work-todo-list-item-title\").text();\r\n if(!isNaN(val) && val) {\r\n if(typeof SYNC == \"object\") SYNC.deleteToDo({id:val, title:txt});\r\n \r\n BRW_sendMessage({command: \"deleteTodoItemDb\", \"id\": val});\r\n \r\n $item.fadeOut(100, function() {\r\n $item.remove();\r\n \r\n reCalculateTodoItemsCount();\r\n $(\"#todo-footer-input\").focus();\r\n \r\n //todoPopupState(\"no-all-done\");\r\n todoPopupState();\r\n \r\n });\r\n }\r\n}", "function removeItem() {\n let value = this.parentNode.lastChild.textContent;\ntodo.splice(todo.indexOf(value), 1);\n this.parentNode.parentNode.removeChild(this.parentNode);\n saveTodos();\n}", "removeSlot() {\n this.closet.removeSlot();\n this.updateClosetGV();\n }", "function removeItems(){\n enableBtn();\n $inputName.removeChild(InputItem);\n $inputName.removeChild(btnGuardar);\n $inputName.removeChild(btnCancel);\n }", "function removeItem (){\n //grab the <li> by accessing the parent nodes \n let item = this.parentNode.parentNode; //the <li>\n let parent = item.parentNode; //in order to remove its child <li>\n let id = parent.id; //check id if its 'todo' or 'completed'\n let value = item.innerText;\n\n //if its an item to be completed...\n if(id === 'todo') {\n //remove one item from todo, based on index\n data.todo.splice(data.todo.indexOf(value, 1));\n //else if it was already completed...\n } else {\n //remove one item from completed, based on index\n data.completed.splice(data.completed.indexOf(value, 1));\n }\n\n //update localstorage\n dataObjectUpdated();\n\n //remove it\n parent.removeChild(item);\n\n}", "function deleteCurrentItem(event) {\n let item = event.target;\n courses.remove(item);\n}", "function closeAdd(li){\n console.log(li);\n li.remove();\n return false;\n}", "handleRemoveButtonPress(index) {\n //remove from index position in here\n console.log(\"button pressed - from parent\")\n }", "function deleteItem(item) {\n if(item.target.className === \"remove\") {\n item.target.parentElement.remove();\n }\n}", "function deleteItems() {\n\n $('div').on('click', 'button.shopping-item-delete', function () {\n \n console.log('clicked on a delete button');\n \n $(this).closest('li').remove();\n \n });\n}", "function processRemoval(e){\n\t\t\t\tchrome.bookmarks.remove(bookmarkId, function(x){\n\t\t\t\t\tconsole.log(x);\n\t\t\t\t});\n\t\t\t\t// console.log($('#'+elementId));\n\t\t\t\t$('#'+elementId).animate({height:'-=100px'},1500,'swing',removeItem(elementId));\n\t\t}", "function removeItem()\r\n{\r\n\tconst item = this.parentNode.parentNode;\r\n\tconst currentListId = item.parentNode.id;\r\n\tconst text = item.innerText;\r\n\r\n\titem.remove();\r\n\r\n\tif (currentListId === \"todo-list\") \r\n\t{\r\n\t\ttodo.splice(todo.indexOf(text),1);\r\n\t}\r\n\telse\r\n\t{\r\n\t\tcompleted.splice(completed.indexOf(text),1);\r\n\t}\r\n\r\n\tlocalStorage.setItem('todos',JSON.stringify(todo));\r\n\tlocalStorage.setItem('completed',JSON.stringify(completed));\r\n}", "function removeFromMylist() { return changeMylistState('remove',this); }", "function deleteListItem() {\n $('.close').on('click', function() {\n var self = $(this);\n self = self.parent();\n self = self.parent();\n self.remove();\n });\n}", "removeItem(event) {\n event.stopPropagation();\n this.props.removeOutfit(this.props.item.id);\n }", "function removeItemWithDoneBtn () {\n var li = this.parentNode;\n removeElementByID(li.id);\n}", "function removeItem(e) {\n if (e.target.classList.contains('delete-btn')) {\n // var litext = e.target.classList.contains('item-list');\n //var litext = document.getElementsByClassName('item-list').innerText;\n // var txt = litext.innerHTML;\n if (confirm('Are you sure you want delete')) {\n \n var btn = document.querySelector('delete-btn');\n btn = e.target.parentElement;\n itemlist.removeChild(btn);\n }\n }\n}", "function removeItem(event){\n const serializedItem = event.dataTransfer.getData('item');\n if (serializedItem !== null) {\n const item = Item.fromJSONString(serializedItem);\n let quan = instance.model.orderList.items[item.nr].quantity;\n // Remove the item from the order bar completely\n instance.model.undoManager.perform(\n instance.model.orderList.removeItemCommand(item.nr,quan)\n .augment(updateOrderBarCommand())\n );\n }\n}", "handleRemoveItem() {\n this.props.onRemoveItem(this.props.index);\n }", "function selectPair(e)\n\t{\n\t\tvar item=Number($(\".leaflet-contextmenu-item\").first().text().replace(\"Remove pair #\",\"\"));\n\t\t$(\".leaflet-contextmenu-item\").remove();\n\t\tvm.selectedPair=vm.markerPairList[item-1];\n\t\tvm.status.open = true;\n\t}", "function removeSingleItem(event) {\n event.preventDefault();\n // console.log(event.target);\n // console.log(event.target.parentElement);\n let link = event.target.parentElement;\n // console.log(\"Logged Output: removeSingleItem -> link\", link)\n if(link.classList.contains('grocery-item__link')){\n // previous element sibling <h4 class='grocery-item__title'>text</h4>\n let text = link.previousElementSibling.innerHTML;\n // parent element <div class='grocery-item'></div>\n let groceryItem = event.target.parentElement.parentElement;\n // remove groceryItem from the list\n list.removeChild(groceryItem);\n showAction(displayItemsAction, `${text} removed from the list`, true);\n // remove groceryItem from local storage\n editStorage(text);\n }\n}", "function delFromList () {\n /* get rid of the button and bullet from our arrays before deleting it */\n listItems.splice(delBtns.indexOf(this), 1)\n delBtns.splice(delBtns.indexOf(this), 1)\n\n /* also get rid of the drop zone below the element being deleted */\n dropZones.splice(delBtns.indexOf(this), 1)\n\n redrawList()\n}", "function removeItem() {\n var item = this.parentNode.parentNode,\n parent = item.parentNode,\n id = parent.id,\n value = item.innerText;\n\n if (id === 'todo') {\n data.todo.splice(data.todo.indexOf(value), 1);\n } else {\n data.completed.splice(data.completed.indexOf(value), 1);\n }\n\n // removes item node\n parent.removeChild(item);\n\n dataObjectUpDated();\n}", "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "function removeSelection(item) {\n //reset this item's grabbed state\n item.setAttribute('aria-grabbed', 'false');\n\n //then find and remove this item from the existing items array\n for (var len = selections.items.length, i = 0; i < len; i++) {\n if (selections.items[i] == item) {\n selections.items.splice(i, 1);\n break;\n }\n }\n}", "function deleteItem() {\n\tlet item = this.parentNode;\n\tdomStrings.todoList.removeChild(item);\n}", "function handleDeleteItemClicked() {\n // input\n $('ul.shopping-list').on('click', '.shopping-item-delete', function(event) {\n // update store\n const index = retrieveItemIndexFromDOM($(event.target));\n // Remove the array item at index\n removeItemFromStore(index);\n // rerender\n renderShoppingList();\n });\n}", "function deleteItem(e){\n const element=e.currentTarget.parentElement.parentElement;\n const id=element.dataset.id;\n list.removeChild(element);\n if (list.children.length===0) {\n container.classList.remove('show-container');\n }\n displayAlert('item removed','danger');\n setBackToDefault();\n removeFromLocalStorage(id);\n //remove from local storage\n // removeFromLocalStorage(id);\n \n}", "function removeListItem() {\n li.parentNode.removeChild(li);\n }", "function removeListEntry() {\n\t$(this).closest(\".list_entry\").remove();\n}", "function onRemoved() {\n console.log(\"Item removed successfully\");\n}", "function removeQuestionFromSidebar() {\n\tvar id = expandedQuestion.id.toString();\n\tvar questionItem = leftPane.querySelector('div[id=\"' + id + '\"]');\n\tvar li = questionItem.parentNode;\n\tli.parentNode.removeChild(li);\n }", "function deleteItem(e) {\n // Una vez que clickeemos el boton, queremos eliminar la Parent del item.\n // console.log('item Deleted');\n const element = e.currentTarget.parentElement.parentElement;\n const id = element.dataset.id; // Seleccionamos el ID\n // console.log(element); // Parent = Grocery-Item\n list.removeChild(element);\n if (list.children.length === 0) {\n container.classList.remove('show-container');\n }\n displayAlert('Item Removed', 'danger');\n setBackToDefault();\n // LOCAL STORAGE REMOVE\n removeFromLocalStorage(id);\n}", "deleteFlick(item, flick, ev){\n //remove fom DOM\n item.remove();\n\n //remove form array\n const i = this.flicks.indexOf(flick);\n this.flicks.splice(i,1);\n }", "function handleDeleteItem() {\r\n $('main').on('click', '#delete-button', event => {\r\n let id = getItemIdFromElement(event.target)\r\n api.deleteBookmark(id)\r\n .then(() => {\r\n store.findAndDelete(id);\r\n render();\r\n })\r\n .catch((error) => {\r\n store.setError(error.message);\r\n renderError();\r\n })\r\n })\r\n}", "function deleteListItem(e) {\n let myTarget = e.target.parentElement.parentElement.parentElement;\n myTarget.remove();\n\n const myTitle = myTarget.querySelector('.notes-list-item-title');\n const mySubtext = myTarget.querySelector('.notes-list-item-subtext');\n\n deleteFromLocalStorage(myTitle.textContent, mySubtext.textContent);\n}", "function removeItem() {\n const item = this.parentNode.parentNode\n const parent = item.parentNode\n parent.removeChild(item)\n}", "remove() {\n this.holder.remove()\n this.createAltRowBtn.remove()\n }" ]
[ "0.67586964", "0.67105514", "0.66337395", "0.65762204", "0.655698", "0.6534118", "0.6534021", "0.6523169", "0.64637107", "0.64483404", "0.6435547", "0.640026", "0.6388109", "0.6386598", "0.63692826", "0.6365542", "0.6363257", "0.63500273", "0.6345777", "0.634439", "0.63393974", "0.63363475", "0.62852997", "0.62806064", "0.6243454", "0.6240699", "0.6238034", "0.62364656", "0.6235181", "0.62195456", "0.62136185", "0.61938596", "0.61920565", "0.61898994", "0.6180532", "0.6180212", "0.6179935", "0.61772966", "0.61766875", "0.6171788", "0.61678505", "0.6161395", "0.6160011", "0.61587095", "0.61510146", "0.61495125", "0.6145966", "0.6141254", "0.61279976", "0.6118924", "0.6115686", "0.6111262", "0.6109179", "0.6096424", "0.6095735", "0.6079406", "0.60714865", "0.606565", "0.606066", "0.60575736", "0.6056317", "0.6054713", "0.6054176", "0.60535604", "0.6044114", "0.60426956", "0.6039608", "0.6038332", "0.6032713", "0.6019161", "0.60172504", "0.6010329", "0.6008208", "0.60066557", "0.60058707", "0.6005704", "0.600502", "0.6000543", "0.6000091", "0.59972876", "0.59950346", "0.5991776", "0.5972409", "0.59693", "0.595735", "0.5949544", "0.5947446", "0.59443486", "0.5943309", "0.59352905", "0.59318393", "0.59301895", "0.59145004", "0.5901583", "0.5893399", "0.5891443", "0.58908", "0.588904", "0.58881485", "0.5887348" ]
0.69454867
0
click handler for selecting a split item in segment bar or list
function splitItemClick() { if (!continueProcessing) { if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) { now = new Date(); } if ((now - lastTimeSplitItemClick) > 80) { lastTimeSplitItemClick = now; if (editor.splitData && editor.splitData.splits) { // if not seeking if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) { // get the id of the split item id = $(this).prop('id'); id = id.replace('splitItem-', ''); id = id.replace('splitItemDiv-', ''); id = id.replace('splitSegmentItem-', ''); $('#splitUUID').val(id); if (id != lastId) { if (!inputFocused) { lastId = id; // remove all selected classes $('.splitSegmentItem').removeClass('splitSegmentItemSelected'); $('.splitItem').removeClass('splitItemSelected'); $('.splitItemDiv').removeClass('splitSegmentItemSelected'); $('#clipItemSpacer').remove(); $('#clipBegin').remove(); $('#clipEnd').remove(); $('.segmentButtons', '#splitItem-' + id).append('<span class="clipItem" id="clipBegin"></span><span id="clipItemSpacer"> - </span><span class="clipItem" id="clipEnd"></span>'); setSplitListItemButtonHandler(); $('#splitSegmentItem-' + id).removeClass('hover'); // load data into the segment var splitItem = editor.splitData.splits[id]; editor.selectedSplit = splitItem; editor.selectedSplit.id = parseInt(id); setTimefieldTimeBegin(splitItem.clipBegin); setTimefieldTimeEnd(splitItem.clipEnd); $('#splitIndex').html(parseInt(id) + 1); // add the selected class to the corresponding items $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected'); $('#splitItem-' + id).addClass('splitItemSelected'); $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected'); currSplitItem = splitItem; if (!timeoutUsed) { if (!currSplitItemClickedViaJQ) { setCurrentTime(splitItem.clipBegin); } // update the current time of the player $('.video-timer').html(formatTime(getCurrentTime()) + "/" + formatTime(getDuration())); } } } } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function selectSegmentListElement(number, dblClick) {\n dblClick = dblClick ? dblClick : false;\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var spltItem = editor.splitData.splits[number];\n if (spltItem) {\n setCurrentTime(spltItem.clipBegin);\n currSplitItemClickedViaJQ = true;\n if ($('#splitItemDiv-' + number)) {\n if (dblClick) {\n $('#splitItemDiv-' + number).dblclick();\n } else {\n $('#splitItemDiv-' + number).click(); // TODO\n }\n }\n }\n }\n}", "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].clipBegin);\n }\n}", "function clickItem()\n{\n\tvar item = this.item;\n\n\tif (null == item) item = this.parent.item\n\tif (null == item) item = this.parent.parent.item;\n\n\timage_list.toggleSelect(item.index);\n}", "function splitButtonClick() {\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n\n splitItem.clipBegin = parseFloat(splitItem.clipBegin);\n splitItem.clipEnd = parseFloat(splitItem.clipEnd);\n if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) {\n newEnd = 0;\n if (editor.splitData.splits.length == (i + 1)) {\n newEnd = splitItem.clipEnd;\n } else {\n newEnd = editor.splitData.splits[i + 1].clipBegin;\n }\n var newItem = {\n clipBegin: parseFloat(currentTime),\n clipEnd: parseFloat(newEnd),\n enabled: true\n }\n\n splitItem.clipEnd = currentTime;\n editor.splitData.splits.splice(i + 1, 0, newItem);\n // TODO Make splitSegments clickable when zoomed in\n editor.updateSplitList(false, !zoomedIn());\n selectSegmentListElement(i + 1);\n return;\n }\n }\n }\n selectCurrentSplitItem();\n}", "selectedClickListener(d, i){\n var self = this;\n // ID Is selected from the the element tag field\n var id = self.selectedExtractID(d).split(\" \").join(\"-\");\n self.boxZoom(self.path.bounds(d), self.path.centroid(d), 20);\n self.applyStateSelection(id);\n self.ui.setDistrictInfo(id);\n self.ui.addLabel(); \n self.ui.retrievePoliticianImages(id);\n }", "onSelect() {\n // Do something when a section instance is selected\n }", "onSelect() {\n // Do something when a section instance is selected\n }", "function itemClick(event) {\n event.preventDefault();\n event.stopPropagation();\n $(this)\n .trigger('pathSelected')\n .addClass('fp-trail fp-clicked')\n .closest('ul')\n .trigger('debug');\n }", "function selectCurrentSplitItem(excludeDeletedSegments) {\n if (!continueProcessing && !isSeeking) {\n excludeDeletedSegments = excludeDeletedSegments || false;\n\n var splitItem = getCurrentSplitItem();\n\n if (splitItem != null) {\n var idFound = false;\n var id = -1;\n if (excludeDeletedSegments) {\n if (splitItem.enabled) {\n id = splitItem.id;\n idFound = true;\n } else if (editor.splitData && editor.splitData.splits) {\n for (var i = splitItem.id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n if (!idFound) {\n for (var i = splitItem.id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n }\n }\n } else {\n id = splitItem.id;\n idFound = true;\n }\n if (idFound) {\n currSplitItemClickedViaJQ = true;\n if (!zoomedIn()) {\n $('#splitSegmentItem-' + id).click();\n }\n lastId = -1;\n $('#descriptionCurrentTime').html(formatTime(getCurrentTime()));\n } else {\n ocUtils.log(\"Could not find an enabled ID\");\n }\n }\n }\n}", "function splitRemoverClick() {\n if (!continueProcessing) {\n item = $(this);\n var id = item.prop('id');\n if (id != undefined) {\n id = id.replace(\"splitItem-\", \"\");\n id = id.replace(\"splitRemover-\", \"\");\n id = id.replace(\"splitAdder-\", \"\");\n } else {\n id = \"\";\n }\n if (id == \"\" || id == \"deleteButton\") {\n id = $('#splitUUID').val();\n }\n id = parseInt(id);\n if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) {\n if (editor.splitData.splits[id].enabled) {\n $('#splitItemDiv-' + id).addClass('disabled');\n $('#splitRemover-' + id).hide();\n $('#splitAdder-' + id).show();\n $('.splitItem').removeClass('splitItemSelected');\n setEnabled(id, false);\n if (!zoomedIn()) {\n if (getCurrentSplitItem().id == id) {\n // if current split item is being deleted:\n // try to select the next enabled segment, if that fails try to select the previous enabled item\n var sthSelected = false;\n for (var i = id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n if (!sthSelected) {\n for (var i = id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n }\n }\n selectCurrentSplitItem();\n }\n } else {\n $('#splitItemDiv-' + id).removeClass('disabled');\n $('#splitRemover-' + id).show();\n $('#splitAdder-' + id).hide();\n setEnabled(id, true);\n }\n }\n cancelButtonClick();\n }\n}", "function NavBar_Item_Click(event)\n{\n\t//get html\n\tvar html = Browser_GetEventSourceElement(event);\n\t//this a sub component?\n\tif (html.Style_Parent)\n\t{\n\t\t//use the parent\n\t\thtml = html.Style_Parent;\n\t}\n\t//valid?\n\tif (html && html.Action_Parent && !html.IsSelected || __DESIGNER_CONTROLLER)\n\t{\n\t\t//get the data\n\t\tvar data = [\"\" + html.Action_Index];\n\t\t//trigger the event\n\t\tvar result = __SIMULATOR.ProcessEvent(new Event_Event(html.Action_Parent, __NEMESIS_EVENT_SELECT, data));\n\t\t//not blocking it?\n\t\tif (!result.Block)\n\t\t{\n\t\t\t//not an action?\n\t\t\tif (!result.AdvanceToStateId)\n\t\t\t{\n\t\t\t\t//notify that we have changed data\n\t\t\t\t__SIMULATOR.NotifyLogEvent({ Type: __LOG_USER_DATA, Name: html.Action_Parent.GetDesignerName(), Data: data });\n\t\t\t}\n\t\t\t//update selection\n\t\t\thtml.Action_Parent.Properties[__NEMESIS_PROPERTY_SELECTION] = html.Action_Index;\n\t\t\t//and update its state\n\t\t\tNavBar_UpdateSelection(html.Action_Parent.HTML, html.Action_Parent);\n\t\t}\n\t}\n}", "handleClick() {\n const currentIndex = this.adapter_.getFocusedElementIndex();\n\n if (currentIndex === -1) return;\n\n this.setSelectedIndex(currentIndex);\n }", "selectItem() {\n if (this.selectedItem !== this.item.Name) {\n const selectEvent = new CustomEvent(\"buttonclick\", {\n bubbles: true,\n detail: this.item\n });\n this.dispatchEvent(selectEvent);\n }\n }", "click(event){\n if(event.target.tagName === \"MULTI-SELECTION\"){\n const onContainerMouseClick = this.onContainerMouseClick;\n\n if(onContainerMouseClick){\n onContainerMouseClick();\n }\n }\n }", "selectItem (i) { this.toggSel(true, i); }", "function clickHandler(event) {\n\tindexChangeSections(event);\n\ttabChangeSections(event);\n}", "function clickedItem(e) {\n\t\tvar $li = $(e.target);\n\t\tvar label = $li.attr('data-label');\n\t\tvar value = $li.attr('data-value');\n\n\t\t// Forward to update function\n\t\tselectUpdateValue(e.data,$li);\n\n\t\tselectClose(e.data);\n\t}", "function clickFunction(e){\n var currLine = getCurrentLine(this);\n num_lines_selected = 1; //returns to default, in case just clicking, if it is selected that's taken care of in subsequent onselect\n prevLine = currLine;\n}", "function toggleSelection(item) {\n var idx = vm.selectedSizes.indexOf(item);\n // is currently selected\n if (idx > -1) {\n vm.selectedSizes.splice(idx, 1);\n }\n // is newly selected\n else {\n vm.selectedSizes.push(item);\n }\n console.log(\"Selected sizes: \" + vm.selectedSizes);\n\n selectionData.setSizes(vm.selectedSizes);\n }", "function clickOptiontoSelect(){\n\n}", "function selectItem(e) {\n removeBorder();\n removeShow();\n // Add border to current tab\n this.classList.add('tab-border');\n // Grab content item from DOM\n const tabContentItem = document.querySelector(`#${this.id}-content`);\n // Add show class\n tabContentItem.classList.add('show');\n}", "function suiSegmentedButtons() {\n const segmentedControls = document.querySelectorAll('.sui-segmented-button');\n for (let segControl of segmentedControls) {\n\n //initialize the first option as the selected option\n segControl.children[0].classList.add('sui-segmented-button-selected');\n\n // assign a click event listener to control the selected state\n for (let segment of segControl.children) {\n segment.addEventListener('click', () => {\n let selected = segControl.querySelector('.sui-segmented-button-selected');\n if (selected !== segment) {\n selected.classList.remove('sui-segmented-button-selected');\n segment.classList.add('sui-segmented-button-selected');\n }\n });\n }\n }\n}", "function scribblePoser() {\n\tvar $elt = $(\"#poser_chooser\");\n\t$elt.click();\n}", "handleClick(evt) {\n let currSel;\n if (evt.target.tagName === 'I') {\n currSel = evt.target.parentElement;\n } else if (evt.target.tagName === \"TD\") {\n currSel = evt.target.firstElementChild;\n } else if (evt.target.tagName === 'DIV') {\n currSel = evt.target;\n }\n \n if (currSel.classList.contains('covered')) {\n $(`#${currSel.id}`).hide();\n $(`#${this.idList[currSel.id[0]]}-${currSel.id[1]}`).css('display', 'flex');\n }\n if (currSel.classList.contains('question')) {\n console.log(currSel.id)\n $(`#${currSel.id}`).hide();\n $(`#${currSel.id}-${currSel.id[currSel.id.length - 1]}`).css('display', 'flex');\n }\n }", "function selectItem(e){\n removeBorder();\n removeShow();\n //Add border to current tab\n this.classList.add('tab-border');\n //Grab content item for Dom\n const tabContentItem=document.querySelector(`#${this.id}-content`)\n //Add show\n tabContentItem.classList.add('show');\n}", "function buttonClicked(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "clickItem(event) {\n\t\tconsole.log('Clicked item ' + JSON.stringify(event));\n\t\tthis.cursor = this.findCursorByID(event);\n\t\tconsole.log('Cursor is at ' + this.cursor);\n\t\tconsole.log('Selecting');\n\t\tthis.select();\n\t}", "function selectItem(e) {\r\n // remove bottom border from all the icons\r\n removeBorder();\r\n // hide all the tab content items\r\n removeShowClass();\r\n // add bottom border to the current clicked tab\r\n this.classList.add('tab-border');\r\n console.log(this.id);\r\n\r\n // grab the tabContentItem\r\n const tabContentItem = document.querySelector(`#${this.id}-content`);\r\n tabContentItem.classList.add('show');\r\n}", "function ClickBarra() {\n\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var planta = data.getValue(selectedItem.row, 0);\n click_grafica(planta);\n\n\n }\n }", "function selectItem(e) {\n removeBorder()\n removeShow()\n this.classList.add('tab-border');\n const tabContentItem = document.querySelector(`#${this.id}-content`);\n tabContentItem.classList.add('show');\n}", "selectSubCollection(e) {\n if (!e.detail.chart.getSelection()[0]) {\n return;\n }\n\n let targetItem = e.detail.chart.getSelection()[0].name;\n if (!targetItem || targetItem.match(/_\\(/)) {\n return;\n }\n const selectedTarget = targetItem.match(/ \\((.*?)\\)/);\n const setSelectionTarget = selectedTarget ? selectedTarget[1] : targetItem;\n if (targetItem === this.targetItem) {\n let win = window.open(\n `../${this.language}/text/${setSelectionTarget}`,\n '_blank'\n );\n win.focus();\n return;\n }\n this.targetItem = targetItem;\n this.setSelection(\n this.language + '_' + setSelectionTarget,\n this.selectedCollections\n );\n }", "function selectItem(e) {\n removeBorder();\n removeShow();\n // Put border on the current tab selected\n this.classList.add('tab-border');\n // Grab content from the DOM\n const tabContentItem = document.querySelector(`#${this.id}-content`);\n // Add the show class\n tabContentItem.classList.add('show');\n}", "function selectItem(e) {\n // Add border to current tab\n removeBorder();\n removeShow();\n this.classList.add('tab-border');\n // Grab content item from DOM\n const tabContentItem = document.querySelector(`#${this.id}-content`)\n // Add show class\n tabContentItem.classList.add('show1');\n}", "navBarSelectionEvent (e) {\n let target = e.currentTarget\n Array.from(target.parentNode.children).forEach(item => {\n if (item.classList.contains('sidebar-navigator')) {\n let open = item.getAttribute('open')\n item.classList.remove('selected')\n document.getElementsByClassName(open)[0].classList.remove('selected')\n }\n })\n target.classList.add('selected')\n document.getElementsByClassName(target.getAttribute('open'))[0].classList.add('selected')\n }", "function handleClick () {\n\t\tlet newSelectionOptions = {...selectionOptions};\n\t\tnewSelectionOptions.detailsSelected = type;\n\t\tsetSelectionOptions(newSelectionOptions);\n\t}", "function selectItem( e ) {\n // Remove all show and border classes\n removeBorder();\n removeShow();\n // Add border to current tab item\n this.classList.add( 'tab-border' );\n // Grab content item from DOM\n const tabContentItem = document.querySelector( `#${this.id}-content` );\n // Add show class\n tabContentItem.classList.add( 'show' );\n}", "clickAction(item) {\n this.selected = item.template;\n this.selected.args = [...item.args];\n }", "function selectItem(e) {\r\n\t// Remove all show and border classes\r\n\tremoveBorder();\r\n\tremoveShow();\r\n\t// Add border to current tab item\r\n\tthis.classList.add('tab-border');\r\n\t// Grab content item from DOM\r\n\tconst tabContentItem = document.querySelector(`#${this.id}-content`);\r\n\t// Add show class\r\n\ttabContentItem.classList.add('show');\r\n}", "handleContextClick(args){\n if(this.shapeSelectionEnabled) {\n this.selectShape(args);\n }\n }", "activeClick() {\n var $_this = this;\n var action = this.options.dblClick ? 'dblclick' : 'click';\n\n this.$selectableUl.on(action, '.SELECT-elem-selectable', function () {\n $_this.select($(this).data('SELECT-value'));\n });\n this.$selectionUl.on(action, '.SELECT-elem-selection', function () {\n $_this.deselect($(this).data('SELECT-value'));\n });\n\n }", "function onClickHandler(info, tab) {\n\tvar itemId = info.menuItemId;\n\tvar context = itemId.split('_', 1)[0];\n\t\n\tswitch (context) {\n\t\tcase 'selection':\n\t\t\tif (info.selectionText.length > 0) {\n\t\t\t\tconsole.log(JSON.stringify(info.selectionText));\n\t\t\t}\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log('Other context than selection');\n\t}\n\t\n\n}", "function start()\n{\n var splitButton = document.getElementById( \"splitButton\" );\n splitButton.addEventListener( \"click\", splitButtonPressed, false );\n} // end function start", "function selectItem(e) {\n removeBorder();\n removeShow();\n this.classList.add('mood-selected');\n const moodContentItem = document.querySelector(`#${this.id}-content`);\n moodContentItem.classList.add('show');\n}", "'click .list-selected' (event) {\n\t\tevent.preventDefault();\n\n\t\tvar list = $(event.currentTarget).attr('list-id');\n\t\tSession.set('listId', list);\n\t\tSession.set('active', list);\n\t\tFlowRouter.go('/list/'+ list);\n\t}", "onBlockSelect() {\n // Do something when a section block is selected\n }", "onBlockSelect() {\n // Do something when a section block is selected\n }", "handleClick(event) {\n const { location, isSelectable, onClick } = this.props;\n\n if (!isSelectable || event.target.closest('.c-finder-tree-leaf__btn--toggle-selection')) {\n return;\n }\n\n onClick(location);\n }", "onItemClick() {\n this.navigateTo(this.item.path);\n }", "function splitHoverIn(evt) {\n var id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n $('#splitItem-' + id).addClass('hover');\n $('#splitSegmentItem-' + id).addClass('hover');\n}", "function selectionHandler ( info, tab ) {\n sendItem( { 'message': info.selectionText } );\n}", "function clickList(ev) {\n\t\n\tvar sel = elList.selection.file_object;\n\tif(sel instanceof File) {\n\t\tpreview.image = thumbPath(sel);\n\t} else if(sel instanceof Folder) {\n\t\tsearch.text = \"\";\n\t\tcurrentFolder = sel;\n\t\tloadSubElements(sel);\n\t}\n\n}", "function selectHandler() \n {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) \n {\n var selectedLevel = data.getValue(selectedItem.row, 0);\n var hidData = $(\"#hid\"+title+\"PieChartContainer\").val();\n \n if(hidData != undefined){\n var hid_ids = JSON.parse(hidData); \n var selected_ele_ids = hid_ids[selectedLevel];\n ViewerHighLight(selected_ele_ids);\n }\n }\n }", "visitElementClicked() {\r\n this.props.visitListClick(this.props.index);\r\n }", "function delegateSapceshipSelectedEvent(ev){\n var target = ev.target;\n if( target &&\n target.tagName ==\"DIV\" &&\n target.classList.contains(\"spaceship-item\") \n ){\n var id = target.getAttribute(\"spaceship_id\");\n var ship = EntityManager.getInstance().getEntityFromID(id);\n if(ship !== null){\n if(ship.getSelected()){\n ship.setSelected(false);\n target.classList.remove(\"selected\");\n }else{\n ship.setSelected(true);\n target.classList.add(\"selected\");\n }\n }else{\n console.log(\"Warning: spaceship[\" +id+ \"] is not exist.\");\n }\n }\n}", "function onClick(event, value) {\n\t\t\tif (event === \"toggle\") {\n\t\t\t\t// UISelectionEvent\n\t\t\t\tregistry.callback({ type: \"selection\", icon: value });\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (event === \"select\" || event === \"deselect\") {\n\t\t\t\t// UISelectionEvent\n\t\t\t\tregistry.callback({\n\t\t\t\t\ttype: \"selection\",\n\t\t\t\t\ticon: value,\n\t\t\t\t\tselected: event === \"select\"\n\t\t\t\t});\n\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tregistry.router.action(event, value);\n\t\t}", "function fireSelectedEvent(){\n\t\t\tvar x1 = (selection.first.x <= selection.second.x) ? selection.first.x : selection.second.x;\n\t\t\tvar x2 = (selection.first.x <= selection.second.x) ? selection.second.x : selection.first.x;\n\t\t\tvar y1 = (selection.first.y >= selection.second.y) ? selection.first.y : selection.second.y;\n\t\t\tvar y2 = (selection.first.y >= selection.second.y) ? selection.second.y : selection.first.y;\n\t\t\t\n\t\t\tx1 = xaxis.min + x1 / hozScale;\n\t\t\tx2 = xaxis.min + x2 / hozScale;\n\t\t\ty1 = yaxis.max - y1 / vertScale;\n\t\t\ty2 = yaxis.max - y2 / vertScale;\n\n\t\t\ttarget.fire('flotr:select', [ { x1: x1, y1: y1, x2: x2, y2: y2 } ]);\n\t\t}", "click (event) {\n this.onSelectionChange([])\n }", "function start() {\n\tvar splitButton = document.getElementById('splitButton');\n\tsplitButton.addEventListener(\"click\", splitButtonPressed, false);\n} //end function start", "function click() {\r\n\t// if the piece is highlighted, move the piece\r\n\tif(this.className == \"highlight\") {\r\n\t\tmove(this);\r\n\t}\r\n}", "function objectSingleClicked(e) {\n var part = e.subject.part\n if (part.data.category === \"CommentBox\") {\n commentBoxKey = part.data.key\n setDefaultNaviBar(part)\n }\n}", "function selectItem(e) {\n //4b. call removeBorder() here, but create it 1st\n removeBorder();\n //6b. call removeShow() here\n removeShow();\n\n //3. add border to current tab\n this.classList.add('tab-border');\n\n //6 Grab content item from DOM\n //console.log(this.id);\n const tabContentItem = document.querySelector(`#${this.id}-content`);\n /*the content id we are expecting will be tab-1-content, tab-2-content hence #${this.id}-content (see our html) */\n //7. show class\n tabContentItem.classList.add('show');\n}", "clicked(panel) {\n\t}", "function clicked(d,i) {\n\n}", "function clicked(d,i) {\n\n}", "clicked(x, y) {}", "handle_click(e, item) {\n if (item.length > 0) {\n this.props.onclick_piechart(this.props.pie_chart_data[item[0]._index])\n }\n }", "function selectPair(e)\n\t{\n\t\tvar item=Number($(\".leaflet-contextmenu-item\").first().text().replace(\"Remove pair #\",\"\"));\n\t\t$(\".leaflet-contextmenu-item\").remove();\n\t\tvm.selectedPair=vm.markerPairList[item-1];\n\t\tvm.status.open = true;\n\t}", "select(e, value) {\n\t\tthis.setState(\n\t\t\t{\n\t\t\t\tcons:(this.second.current.state.selected.row[0] || ''), \n\t\t\t\tvowl: value\n\t\t\t}, this.props.onClick\n\t\t); \n\t}", "function selectItem(e) {\n\n for (var i = 0; i < e.currentTarget.parentNode.children.length; i++) {\n e.currentTarget.parentNode.children[i].classList.remove(\"selected\");\n }\n\n e.currentTarget.classList.add(\"selected\");\n console.log($(e.currentTarget).children().eq(1).text());\n updateP1Moves($(e.currentTarget).children().eq(1).text());\n \n}", "function switchSelectedPiece(e) {\n var pieceNumber = this.getElementsByTagName(\"P\")[0].firstChild.data - 1;\n console.log(\"selected Piece number: \" + (pieceNumber +1));\n selectedPiece = pieces[pieceNumber];\n\n if (isInDepot(selectedPiece)) {\n \tconsole.log(\"piece is in depot\");\n moveToStartPosition(selectedPiece);\n }\n\n removeActiveSelectorClass();\n this.classList.add(\"active\");\n\t\n\t\tconsole.log(\"dispatch pieceSelected event\");\n var pieceSelectedEvent = document.createEvent(\"Event\");\n pieceSelectedEvent.initEvent(\"pieceSelected\", true, true);\n document.dispatchEvent(pieceSelectedEvent);\n }", "async elementClicked(e) {\n this.cancelEvent(e);\n if (this.selectedInstance) {\n const parentInstances = await this.ctx.api.walkComponentParents(this.selectedInstance);\n this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK, { id: this.selectedInstance.__VUE_DEVTOOLS_UID__, parentIds: parentInstances.map(i => i.__VUE_DEVTOOLS_UID__) });\n }\n else {\n this.ctx.bridge.send(shared_utils_1.BridgeEvents.TO_FRONT_COMPONENT_PICK_CANCELED, null);\n }\n this.stopSelecting();\n }", "itemSelectionChanged(sender, args) {\n if (args == null) return\n let item = args.item\n\n if (INode.isInstance(item) && item.style instanceof UMLNodeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildNodeProperties(model, this.div)\n } else if (IEdge.isInstance(item) && item.style instanceof UMLEdgeStyle) {\n let model = item.style.model\n this.div.innerHTML = \"\"\n this.buildEdgeProperties(model, this.div);\n\n }\n }", "function SelectionChange() { }", "function SelectionChange() { }", "function handleElementClickFtn(action, element, index) {\n if(action === 'selected' || action === 'deselected') {\n objInst.notesHeader.notify(action, { 'elem': element, 'idx' : index });\n } \n }", "function buttonClick(e) {\n\tvar element = e.memo.element;\n\tif (this.options.singleSelect) {\n\t\tthis.select(element);\n\t} else {\n\t\tif (this.isSelected(element)) {\n\t\t\tthis.deselect(element);\t\n\t\t} else {\n\t\t\tthis.select(element);\n\t\t}\n\t}\n}", "function selectCategoryClickHandler(ev) {\n selectCategory(ev.target);\n}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "function SelectionChange() {}", "onSelect(event) {}", "function handleClick(d, i){\n\t\tclearSelectiont6()\n\n\t\tvar _fill = d3.select(this).style(\"fill\");\n\n\t\td3.select(this)\n\t\t\t.classed(\"selected\", true)\n\t\t\t.attr(\"data-fill\", _fill)\n\t\t\t.style(\"fill\", \"rgb(255, 86, 0)\")\n\n\t\tvar interval_val = d.interval.split(\"/\").map(function(d){ return parseFloat(d); })\n\t\tslice_util.setSlice(localstate.data_slices, \"t6\", \"Year_of_Release\", \n\t\t\t\t\t\t\t\t\t\t\t\tparseInt(d.year), parseInt(d.year))\n\t\tslice_util.setSlice(localstate.data_slices, \"t6\", \"Mean_UserCritic_Score\", \n\t\t\t\t\t\t\t\t\t\t\t\tinterval_val[0], interval_val[1])\n\n\t\tlocalstate.selectedRows = slice_util.sliceRows(localstate.data_slices, localstate.datasetRows);\n\n\t\tappdispatch.dataslice.call(\"dataslice\", this, \"t6\", localstate.selectedRows);\n\t}", "selectItemEvent(event) {\n\n var name = event.target.getAttribute('data-name')\n var boxid = event.target.getAttribute('id')\n var client = event.data.client\n var items = client.items\n var index = items.selected.indexOf(name);\n\n // If selected, we want to unselect it\n if ($(event.target).hasClass(client.selectedClass)) {\n $(event.target).removeClass(client.selectedClass);\n $(event.target).attr(\"style\", \"\");\n client.items.selected.splice(index, 1);\n\n // If unselected, we want to select it\n } else {\n $(event.target).attr(\"style\", \"background:\" + client.selectedColor);\n $(event.target).addClass(client.selectedClass);\n client.items.selected.push(name)\n }\n client.bingoCheck()\n }", "function markingMenuOnSelect(selectedItem) {\r\n\ttracker.recordSelectedItem(selectedItem.name);\r\n\tdocument.getElementById(\"selectedItem\").innerHTML = selectedItem.name;\r\n}", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function handleLayoutClick() {\r\n var lid = $(this).attr('lid');\r\n\r\n if (selected_layout_id === null || lid != selected_layout_id) {\r\n // other item selected, remove old selection\r\n if (selected_layout_id !== null) {\r\n $('.layout-list [lid=\"' + selected_layout_id + '\"]').attr('class', 'layout');\r\n }\r\n selected_layout_id = lid;\r\n $(this).attr('class', 'layout layout-active');\r\n } else {\r\n $(this).attr('class', 'layout');\r\n selected_layout_id = null;\r\n }\r\n }", "_onLabelClick(ev) {\n const $target = $(ev.currentTarget);\n this.trigger('revisionSelected', [0, $target.data('revision')]);\n }", "function group_click(d, i) {\n // Single Residue\n var resViewName = 'pickedRes_' + nodes[i].seg + nodes[i].resi\n pickedRes = window.structure.select({\n chain: nodes[i].seg,\n rnum: nodes[i].resi\n })\n if (viewer.get(resViewName) === null) {\n viewer.ballsAndSticks(resViewName, pickedRes);\n d3.select(\"#group\" + i)\n .classed(\"highlight\", true);\n\n } else {\n // Hide Spheres\n viewer.rm(resViewName);\n // Highlight Group\n d3.select(\"#group\" + i)\n .classed(\"highlight\", false);\n }\n viewer.requestRedraw();\n }", "function onListWidgetClick(id) {\r\n\r\n /// get the clicked asset\r\n let selectedAsset = getAssetFromClick(id);\r\n onPickedAsset(selectedAsset);\r\n\r\n /// close the slide list if is open\r\n onListButtonClick();\r\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, 0);\n openPopup(value);\n // console.log('The user selected - ' + value);\n }\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "function selectHandler() {\n var selectedItem = chart.getSelection()[0];\n if (selectedItem) {\n var value = data.getValue(selectedItem.row, selectedItem.column);\n alert('The user selected ' + value);\n }\n }", "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "on_item_clicked(id) {\n\t\tsetGlobalConstrainById(this.entity_name,id);\n\t\tpageEventTriggered(this.lowercase_entity_name+\"_clicked\",{id:id});\n\t}", "function onClickHandler(selectedIcon) {\n onSelect(selectedIcon);\n }", "function handleClick(e) {\n\tAlloy.Events.trigger('toggleLeft_Window');\n\n\tlet section = $.Left_elementsList.sections[e.sectionIndex];\n\t// Get the clicked item from that section\n\tlet item = section.getItemAt(e.itemIndex);\n\n\tif (item.label.text == \"Home\") {\n\n\t\tAlloy.Events.trigger('goToHome_fromDetailsWind');\n\t\tAlloy.Events.trigger('goToHome_frommenuListItemWin');\n\n\t} else {\n\n\n\t\t//let centerWin = require('appLevelVariable');\n\t\tlet menulistItemView = Alloy.createController('menuListItem').getView();\n\t\t// Get the section of the clicked item\n\n\t\trequire(\"loader_indica\").removeLoader();\n\t\trequire(\"loader_indica\").addLoader(menulistItemView, \"Loading Data..\");\n\n\t\tTi.API.info(\"Position\" + e.itemIndex);\n\t\t// Update the item's `title` property and set it's color to red:\n\t\tTi.API.info(item.label.text += \" (clicked)\");\n\t\t//Ti.API.info(centerWin_ios.getCenterwin());\n\t\t//centerWin.getCenterwin().add(menulistItemView);\n\t\tAlloy.Globals.centerWin.add(menulistItemView);\n\t\t//Ti.API.info(\"win\",centerWin_ios.getData());\n\t\trequire(\"animation\").rightToLeft(menulistItemView);\n\n\t}\n}", "_select(num) {\n this.selectedIndex = num;\n this._switcherList.highlight(num);\n\n // on item selected, switch/move to the workspace\n let workspaceManager = global.workspace_manager;\n let wm = Main.wm;\n let newWs = workspaceManager.get_workspace_by_index(this.selectedIndex);\n wm.actionMoveWorkspace(newWs);\n }", "_evtClick(event) {\n // only handle primary button clicks\n if (event.button !== 0 || this._selected) {\n return;\n }\n const inputElement = this.inputElement;\n event.preventDefault();\n event.stopPropagation();\n this._selected = true;\n const selectEnd = inputElement.value.indexOf('.');\n if (selectEnd === -1) {\n inputElement.select();\n }\n else {\n inputElement.setSelectionRange(0, selectEnd);\n }\n }", "function nodeClicked(d,i) {\n }" ]
[ "0.72758037", "0.6840291", "0.64373934", "0.63681453", "0.6326161", "0.62780905", "0.62780905", "0.62433374", "0.62055355", "0.61304724", "0.60904366", "0.60104275", "0.59891665", "0.5966041", "0.59533817", "0.5951616", "0.5951444", "0.5919155", "0.59091485", "0.5903462", "0.58779", "0.58586556", "0.5852261", "0.58490926", "0.5845921", "0.5830484", "0.58264863", "0.58061796", "0.5801919", "0.57837534", "0.5775403", "0.5774351", "0.5771432", "0.57644063", "0.5756777", "0.5741361", "0.57273114", "0.5715319", "0.5701112", "0.56826746", "0.5678505", "0.5656803", "0.5656528", "0.5642997", "0.56404924", "0.56404924", "0.56356055", "0.5626533", "0.5617332", "0.56137156", "0.56108135", "0.5605193", "0.56000376", "0.559963", "0.5575708", "0.55720603", "0.55695045", "0.5566876", "0.55490613", "0.55449736", "0.55389476", "0.553857", "0.55207646", "0.55207646", "0.5516437", "0.55053616", "0.5501257", "0.54998815", "0.54959714", "0.54901004", "0.5489753", "0.54888034", "0.5487329", "0.5487329", "0.54872173", "0.5480474", "0.54752284", "0.5475197", "0.5475197", "0.5475197", "0.5475197", "0.54688734", "0.54579353", "0.5451588", "0.54515827", "0.5451362", "0.54510987", "0.54416245", "0.54397345", "0.54367524", "0.54343766", "0.5432722", "0.5432722", "0.5428967", "0.5428967", "0.5427832", "0.542666", "0.5423339", "0.5420256", "0.54158765" ]
0.7076937
1
click/shortcut handler for adding a split item at current time
function splitButtonClick() { if (!continueProcessing && editor.splitData && editor.splitData.splits) { var currentTime = getCurrentTime(); for (var i = 0; i < editor.splitData.splits.length; ++i) { var splitItem = editor.splitData.splits[i]; splitItem.clipBegin = parseFloat(splitItem.clipBegin); splitItem.clipEnd = parseFloat(splitItem.clipEnd); if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) { newEnd = 0; if (editor.splitData.splits.length == (i + 1)) { newEnd = splitItem.clipEnd; } else { newEnd = editor.splitData.splits[i + 1].clipBegin; } var newItem = { clipBegin: parseFloat(currentTime), clipEnd: parseFloat(newEnd), enabled: true } splitItem.clipEnd = currentTime; editor.splitData.splits.splice(i + 1, 0, newItem); // TODO Make splitSegments clickable when zoomed in editor.updateSplitList(false, !zoomedIn()); selectSegmentListElement(i + 1); return; } } } selectCurrentSplitItem(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "function newLiButtonClicked(){\n createListItem();\n }", "function onInsertItemClick(event){\n var $el = $(this).closest('.scheduled-item-fields'),\n fields = setDynamicFieldIDs($(\"#add-event-button\").data('fields')),\n insertIndex = $items.index($el) + 1;\n\n $el.after(fields);\n $itemContainer.trigger('afterAppendScheduledItem', insertIndex);\n $(document).trigger('dynamic_fields_added', [$(fields)]);\n }", "function addListAfterClick() {\n\n\t\tcreateListElement();\n}", "function addItem() {\n var contents = document.getElementById('newTask').value;\n var item = new listItem(Date.now(), contents, false);\n masterList.push(item);\n showList(masterList);\n saveList();\n}", "putin(item) {\n if (this.open = true) {\n this.item.push(item);\n alert(\"Item has been added to the backpack.\");\n }\n }", "addNewItem(state, payload) {\n //update GUI\n state.items.unshift(payload)\n }", "click(){\n createAddItemWindow();\n }", "addItem(item) {\n\n item.onmouseleave();\n item.lock();\n\n this._items.push(item);\n\n if (this._items.length > 1) {\n let comma = new TextExpr(',');\n this.graphicNode.holes.splice(this.graphicNode.holes.length-1, 0, comma);\n }\n\n this.graphicNode.holes.splice(this.graphicNode.holes.length-1, 0, item);\n\n this.graphicNode.update();\n }", "_addItem(e) {\n e.preventDefault();\n e.stopPropagation();\n\n this._$list.append(this._createDefaultEntry(this._numItems));\n this._numItems += 1;\n }", "addNewListItem(panelName, title, text, value) {\n let panelIndex = this.getPanel(panelName);\n this.itemTitle(title);\n this.helpText(text);\n this.itemValue(value);\n this.saveButton.scrollIntoView();\n this.saveButton.click();\n }", "function appendNewCommand(item) {\n let iframe = null;\n let command = `BookMark-${item.name}:show`;\n app.commands.addCommand(command, {\n label: item.name,\n execute: () => {\n if (item.target == '_blank') {\n let win = window.open(item.url, '_blank');\n win.focus();\n }\n else if (item.target == 'widget') {\n if (!iframe) {\n iframe = new apputils_1.IFrame();\n iframe.url = item.url;\n iframe.id = item.name;\n iframe.title.label = item.name;\n iframe.title.closable = true;\n iframe.node.style.overflowY = 'auto';\n }\n if (iframe == null || !iframe.isAttached) {\n app.shell.addToMainArea(iframe);\n app.shell.activateById(iframe.id);\n }\n else {\n app.shell.activateById(iframe.id);\n }\n }\n }\n });\n }", "function EditLogItemInsert () {}", "function addItem() {\n\n}", "_addNewItem() {\n // Add new Item from Order's Items array:\n this.order.items = this.order.items.concat([this.item]);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeAddNewItem();\n }", "function addItem() {\n\t\t\tvar order = ordersGrid.selection.getSelected()[0];\n\n\t\t\titensStore.newItem({\n\t\t\t\tpi_codigo: \"new\" + itensCounter,\n\t\t\t\tpi_pedido: order ? order.pe_codigo : \"new\",\n\t\t\t\tpi_prod: \"\",\n\t\t\t\tpi_quant: 0,\n\t\t\t\tpi_moeda: \"R$\",\n\t\t\t\tpi_preco: 0,\n\t\t\t\tpi_valor: 0,\n\t\t\t\tpi_desc: 0,\n\t\t\t\tpi_valort: 0,\n\t\t\t\tpr_descr: \"\",\n\t\t\t\tpr_unid: \"\"\n\t\t\t});\n\t\t\t\n\t\t\titensCounter = itensCounter + 1;\n\t\t}", "function add() {\n\t\tvar item = document.getElementById(\"item\").value;\n\t\t$(\"#entry\").clone(true).appendTo(\"#list\").val('').removeClass(\"hidden\");\n\t\t$('li:last').text(item);\n\t\t}", "function addNewCompletedItem(label) {\n document.querySelector('.completed-items')\n .insertAdjacentHTML('afterbegin', newCompletedItemHTML(label));\n // Add EventListeners to New Items:\n let trashButton = document.querySelector('.btn-delete-item')\n trashButton.addEventListener('click', (event) => {\n event.currentTarget.parentElement.remove()\n });\n let checkBox = document.querySelector('.completed-items>li>.checkbox')\n checkBox.addEventListener('change', (event) => {\n if (checkBox.checked == false) {\n moveToPending(event);\n };\n\n \n });\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateListElement();\n\t}\n}", "function addItem(item) {\n groceries.push(\"item\");\n displayData();\n}", "addItem(_item) { }", "function handleAddingToggle() {\r\n $('main').on('click', '#js-new-item', event => {\r\n event.preventDefault();\r\n store.adding = true;\r\n render();\r\n\r\n })\r\n}", "function insertItem(){\n item = capitalizeFirstLetter(getInput())\n checkInputLength()\n myGroceryList.push(item)\n groceryItem.innerHTML += `\n <div class=\"item\">\n <p>${item}</p>\n <div class=\"item-btns\">\n <i class=\"fa fa-edit\"></i>\n <i class=\"fa fa-trash-o\"></i>\n </div>\n </div>`\n itemAddedSuccess()\n clearBtnToggle()\n clearInputField()\n // Create edit/delete buttons based on icons in <i> tags, above\n queryEditBtn()\n queryDeleteBtn()\n // Adds items to local Storage\n updateStorage()\n}", "_addNewTodo(item) {\n _todolistState.push(item);\n this.emit(CHANGE);\n }", "function addNewPendingItem(label) {\n document.querySelector('.pending-items')\n .insertAdjacentHTML('afterbegin', newPendingItemHTML(label));\n \n // Add EventListeners to New Pending Items:\n let trashButton = document.querySelector('.pending-items>li>.btn-delete-item')\n trashButton.addEventListener('click', (event) => {\n event.currentTarget.parentElement.remove()\n });\n let checkBox = document.querySelector('.pending-items>li>.checkbox')\n checkBox.addEventListener('change', (event) => {\n if (checkBox.checked == true) {\n moveToCompleted(event)\n }\n })\n pendingNote();\n completedNote();\n \n}", "function addToProdList(item)\n{\n //window.alert(JSON.stringify(item));\n var id = getProdId();\n \n var content = $('<div></div>').html(item.DESCRIP);\n \n var li = $('<li></li>').attr(\"id\", id).attr(\"class\", \"list-group-item\").html(content).click(function(){\n \n localStorage.setItem(\"prdescrip\", \"\");\n localStorage.setItem(\"prcantidad\", \"\");\n\n setPriceSelect(item);\n \n setStatLabel(\"info\", item.DESCRIP);\n $('#prodtb').val(item.ARTICULO);\n currentProd = item;\n\n \n $('#searchProdModal').modal('hide');\n saveState();\n\n $('#prodSearch ul').empty();\n \n })\n \n console.log(id + \";\");\n $('#prodSearch ul').append(li);\n \n}", "function addItemToListHandler (e) {\n\t\tvar curElement = this;\n\t\tshowOverlay(curElement,addItemToList);\n\t\te.preventDefault();\n\t}", "addNewItem() {\n\t \tlet task = this.state.task;\n\t \tlet updated_list = this.props.data;\n\t \t\n\t \tupdated_list = updated_list.concat(task);\n\t \tthis.props.onItemAdd(updated_list);\n\t \tthis.setState({task : ''});\n \t\n \t}", "function addItemBtn() {\n $('#')\n $('#add-list-item').show('fast', function() {\n\n });\n console.log ('add item clicked')\n }", "function addItemToBasket(item) {\n const parent = $(\"#order\");\n\n // Add item\n basket.push(item);\n parent.append(\"<li id='ordermenuitem-\" + item.id\n + \"' class='list-group-item list-group-item-action'>\\n\"\n + \" <span class='bold'>\" + item.name + \"</span>\"\n + \" <span class='span-right'>£\" + item.price + \"</span>\\n\"\n + \" <br>\\n\"\n + \" <span id='omi-instructions-\" + item.id\n + \"'><span id='omi-instructions-\" + item.id + \"-text'>\"\n + item.instructions + \"</span></span>\\n\"\n + \" <span class='span-right'><i id='omi-edit-\" + item.id\n + \"' class='fa fa-edit fa-lg edit' onclick='showEditOrderMenuItem(\"\n + item.id + \", \\\"\" + item.instructions\n + \"\\\");'></i><i class='fa fa-times fa-lg remove' onclick='confirmRemoveOrderMenuItem(\"\n + item.id + \");'></i></span>\\n\"\n + \"</li>\");\n}", "function insert_item (new_item, history)\r\n {\r\n // Add \\n at beginning and end\r\n var s = \"\\n\" + history.join (\"\\n\") + \"\\n\";\r\n // Delete the script's name from the history list (if it's there)\r\n s = s.replace (\"\\n\"+new_item+\"\\n\", \"\\n\");\r\n // Add the script's name at the beginning\r\n s = new_item+s;\r\n // If there are more than 15 items, chop off the last one\r\n if (s.match (/\\n/g).length > 15)\r\n s = s.replace (/\\n[^\\n]+\\n$/, \"\\n\");\r\n // Delete trailing returns\r\n s = s.replace (/[\\n]+$/, \"\");\r\n return s\r\n }", "function addNewItem() {\n \n const item = window.prompt('What is your new task?','');\n const count = document.getElementById('selectedListOl').\n getElementsByTagName('LI').length;\n \n // let newItem;\n \n if (item) {\n notesItems += `\n <LI><label id=\"label${(count+1)}\"><input type=\"checkbox\" \n id=\"item${(count+1)}\">${item}</label></LI>`;\n \n reRenderDashboard();\n\n // list updated\n edited = true;\n document.getElementById('saveList').disabled = false;\n }\n \n }", "function addToListItem (){\n // Capture value of this input field\n var newListItem = $('.new-list-item').val();\n \n // Render DOM element to the page with the above value\n $(\"#todo\").append(`<li class=\"list-item\">\n <span>${newListItem}</span>\n <button class=\"edit\">Edit</button>\n <button class=\"remove\">Remove</button></li>`);\n \n // Reset the input field to be blank for new submission\n $('.new-list-item').val('');\n\n addCount();\n }", "function addItem(evt){\n var self = evt.target;\n var template = dom.closest(self, 'wb-row');\n // we want to clone the row and it's children, but not their contents\n var newItem = template.cloneNode(true);\n template.parentElement.insertBefore(newItem, template.nextElementSibling);\n}", "onAddListPlanItem(e, index, key) {\n\t\tvar { header } = this.state;\n\t\tvar new_item = {\n\t\t\ttitle: 'New Option',\n\t\t\tno_title: 'Nytt alternativ'\n\t\t};\n\t\theader.list.items[index].options[key].items.push(new_item);\n\t\tthis.setState({ header });\n\t}", "function handleGoButtonClick(event) {\n \n addItem1ToList();\n \n domInput1(\"\");\n\n addItem2ToBeginningOfList();\n \n domInput2(\"\");\n \n printListToTextOutput();\n\n}", "_add(e) {\n\t\t// Assert component wasn't unrendered by another event handler\n\t\tif (!this._rel) {\n\t\t\treturn;\n\t\t}\n\n\t\tlet { item, idx } = e;\n\t\tlet component = this.componentFactory(item, idx);\n\t\tlet li = document.createElement(this.subTagName);\n\t\tlet cont = { model: item, component, li };\n\t\tthis.components.splice(idx, 0, cont);\n\t\tthis._setSubClassName(item, li);\n\n\t\tli.style.display = 'none';\n\t\t// Append last?\n\t\tif (this.components.length - 1 === idx) {\n\t\t\tthis._rel.appendChild(li);\n\t\t} else {\n\t\t\tthis._rel.insertBefore(li, this.components[idx + 1].li);\n\t\t}\n\n\t\tif (component) {\n\t\t\tcomponent.render(li);\n\t\t}\n\n\t\tcont.token = anim[this.animType](li, true, { reset: true, duration: this.duration });\n\t\tthis._checkSync();\n\t}", "function addNewStoryLine(){\n\n var name;\n var description;\n name = $(\"#storylineField\").val();\n description = $(\"#storylineDescription\").val();\n if(name){\n var storyline = new Storyline();\n if(description){\n $(\"#StorylinesList\").append('<li id=\"'+ current_id +'\" onclick=\"storylineClicked(this)\"><a href=\"#\">'+ name +'</br>' + description +'</a></li>' +\n '<ul id=\"'+ current_id +'_pointList\" class=\"list-group\"></ul>');\n }\n else{\n $(\"#StorylinesList\").append('<li id=\"'+ current_id +'\" onclick=\"storylineClicked(this)\"><a href=\"#\">'+ name +'</a></li>' +\n '<ul id=\"'+ current_id +'_pointList\" class=\"list-group\"></ul>');\n }\n $(\"#StorylinesList\").find(\".active\").removeClass(\"active\");\n $(\"#\"+current_id).addClass(\"active\");\n active_id = current_id;\n storyline.ID = current_id;\n\n storyline.title.set(name);\n storyline.description.set(description);\n\n $(\"#storylineField\").val(\"\");\n $(\"#storylineDescription\").val(\"\");\n storylineList.push(storyline);\n storylineClicked($(\"#\"+current_id));\n current_id++;\n\n // Add a sortable list to the storyline so that we can re-arrange storypoints\n addSortableToStoryline(storyline);\n }\n else{\n showWarningAlert(\"Enter a name for the storyline.\");\n }\n}", "function addListAfterClick() {\n\tif (inputLength() > 0) {\n\t\tcreateList();\n\t}\n}", "function insertItem() {\n\tlocalStorage.setItem(\"Todo List\", JSON.stringify(todoArr));\n\taddHTMLTodos(todoArr);\n}", "function addNewItem() {\n $('a#addNew').click(function(){\n // ajax call to get new id\n var u = hostName + '/quote_items/a/add?quoteID=' + quoteID;\n $.get(u, newNode,\"json\");\n });\n}", "function btnAddClick() {\n addItem(); \n}", "function ClickAdicionarItem(tipo_item) {\n gEntradas[tipo_item].push({ chave: '', em_uso: false });\n AtualizaGeralSemLerEntradas();\n}", "function printSplit() {\n listToComplete = document.getElementById(\"splits\");\n splitToAdd = document.createElement(\"li\");\n splitToAdd.textContent =\n chronometer.twoDigitsNumber(chronometer.getMinutes())[0] +\n chronometer.twoDigitsNumber(chronometer.getMinutes())[1] +\n \":\" +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[0] +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[1];\n listToComplete.appendChild(splitToAdd);\n}", "_addNewItem(event) {\n\t\tevent.preventDefault();\n\t\tthis.state.item.description = this.state.item.description || \"-\";\n\t\tthis.state.item.amount = this.state.item.amount || \"0\";\n\t\tWalletActions.addNewItem(this.state.item);\n\t\tthis.setState({ item: this._getFreshItem() });\n\t}", "onAddItem () {\n const newItem = this.get('bunsenModel').items.type === 'object' ? {} : ''\n const items = this.get('items')\n const index = items.length\n\n items.pushObject(newItem)\n this.notifyParentOfNewItem(newItem, index)\n }", "function addListAfterClick() {\r\n\tif (inputLength() > 0) {\r\n\t\tcreateListElement();\r\n\t}\r\n}", "function addItem()\n{\n\tvar message = {action: \"addItem\"};\n\tvar wrapper = $(this).parents(\".quantifier\");\n\n\tmessage.item = {};\n\tmessage.item.url = $(this).parents(\".market_listing_row_link\").attr(\"href\");\n\tmessage.item.price = parseFloat(wrapper.find(\".minPrice\").val());\n\tmessage.item.picture = $(this).parents(\".market_listing_row_link\").find(\".market_listing_item_img\").attr(\"src\");\n\tmessage.item.name = $(this).parents(\".market_listing_row_link\").find(\".market_listing_item_name\").html();\n\tmessage.item.quantity = parseInt(wrapper.find(\".quantity\").val());\n\n\tif (!validItem(message.item))\n\t\treturn false;\n\n\tchrome.runtime.sendMessage(message, function(response) {\n\t\twrapper.addClass(\"active\");\n\t\twrapper.find(\".blue\").css(\"display\", \"none\");\n\t\twrapper.find(\".green\").css(\"display\", \"inline-block\");\n\t});\n\treturn false;\n}", "function addListAfterClick() {\n if (inputlength() > 0) {\n addTask();\n }\n}", "function addItem(item) {\n\t\t// if the item is not empty or not spaces, then go forward.\n\t\tif (/\\S/.test(item)) {\n\t\t\t// do not add duplicates\n\t\t\tif (isDuplicate(item)) {\n\t\t\t\talert(\"'\" + item + \"' is already in the shopping list.\");\n\t\t\t\treturn;\n\t\t\t}\n\n \t\tvar str = \"<li><span class='label'>\" + item + \"</span>\"\n \t\t\t\t\t+\"<div class='actions'><span class='done'><button class='fa fa-check'><span class='element-invisible'>Done</span></button></span>\"\n \t\t\t\t\t+ \"</span><span class='delete'><button class='fa fa-times'><span class='element-invisible'>Delete</span></button></span></div></li>\";\n\n \t\t// adding the new li tag to the end of the list - you are actually adding html string, but jQuery will create elements for you\n\t\t\t$(\"#items\").append(str);\n\t\t}\n\t}", "function insertInto(){\n $(function() {\n var $newListItem = $('<li>BSc Operating Systems Design</li>');\n $('li:last').after($newListItem);}); \n}", "function okButtonClick() {\n if (!continueProcessing && checkClipBegin() && checkClipEnd()) {\n id = $('#splitUUID').val();\n if (id != \"\") {\n var current = editor.splitData.splits[id];\n var tmpBegin = parseFloat(current.clipBegin);\n var tmpEnd = parseFloat(current.clipEnd);\n var duration = getDuration();\n id = parseInt(id);\n if (getTimefieldTimeBegin() > getTimefieldTimeEnd()) {\n displayMsg(\"The inpoint is bigger than the outpoint. Please check and correct it.\",\n \"Check and correct inpoint and outpoint\");\n selectSegmentListElement(id);\n return;\n }\n\n if (checkPrevAndNext(id, true).ok) {\n if (editor.splitData && editor.splitData.splits) {\n current.clipBegin = getTimefieldTimeBegin();\n current.clipEnd = getTimefieldTimeEnd();\n if (id > 0) {\n if (current.clipBegin > editor.splitData.splits[id - 1].clipBegin) {\n editor.splitData.splits[id - 1].clipEnd = current.clipBegin;\n } else {\n displayMsg(\"The inpoint is bigger than the inpoint of the segment before this segment. Please check and correct it.\",\n \"Check and correct inpoint\");\n setTimefieldTimeBegin(editor.splitData.splits[id - 1].clipEnd);\n selectSegmentListElement(id);\n return;\n }\n }\n\n var last = editor.splitData.splits[editor.splitData.splits.length - 1];\n if (last.clipEnd < duration) {\n ocUtils.log(\"Inserting a last split element (auto): (\" + current.clipEnd + \" - \" + duration + \")\");\n var newLastItem = {\n clipBegin: parseFloat(last.clipEnd),\n clipEnd: parseFloat(duration),\n enabled: true\n };\n\n // add the new item to the end\n editor.splitData.splits.push(newLastItem);\n }\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n if (checkPrevAndNext(i, false).inserted) {\n i = 0;\n }\n }\n }\n\n editor.updateSplitList(true, !zoomedIn());\n $('#videoPlayer').focus();\n selectSegmentListElement(id);\n } else {\n current.clipBegin = tmpBegin;\n current.clipEnd = tmpEnd;\n selectSegmentListElement(id);\n }\n }\n } else {\n selectCurrentSplitItem();\n }\n}", "function handleAddItem() {\n // Listen for when users submit a new list item\n $('#js-shopping-list-form').submit(event => {\n event.preventDefault();\n // Get the name of the new item from the text input\n const inputObject = $('.js-shopping-list-entry');\n const newListItem = inputObject.val();\n // Clear out the value of the input so new items can be addeed\n inputObject.val('');\n // Update the store\n addItemToStore({ name: newListItem, completed: false });\n // Rerender the shopping list\n renderShoppingList();\n });\n}", "function addItemsClick() {\n var createItems = document.createElement(\"li\");\n // var dividor = document.createElement(\"hr\");\n createItems.setAttribute(\"id\", \"li\" + (liIdCounter++));\n var itemsNode = document.createTextNode(userInputBox.value);\n createItems.appendChild(itemsNode);\n\n // Form Validation: To make sure not to add empty items or spaces\n if (userInputBox.value.length > 0 && userInputBox.value.trim() != \"\") {\n addedItemsList.appendChild(createItems);\n // addedItemsList.appendChild(dividor);\n }\n\n userInputBox.value = \"\"; // Reset the Input box after adding the item\n\n // To Mark the item as completed and move it to the completed section\n var isClicked = false;\n function completeItem() {\n createItems.classList.toggle(\"completeItem\");\n if (!isClicked) {\n completedItemsList.appendChild(createItems);\n // completedItemsList.appendChild(dividor);\n\n isClicked = true;\n } else {\n addedItemsList.appendChild(createItems);\n // addedItemsList.appendChild(dividor);\n isClicked = false;\n }\n }\n createItems.addEventListener(\"click\", completeItem);\n\n // To Delete an item\n var deleteBtn = document.createElement(\"button\");\n var deleteBtnNode = document.createTextNode(\"x\");\n deleteBtn.appendChild(deleteBtnNode);\n createItems.appendChild(deleteBtn);\n\n function deleteItem() {\n createItems.classList.add(\"deleteItem\");\n }\n deleteBtn.addEventListener(\"click\", deleteItem);\n }", "function addBtnClick() {\r\n let itemTextInput = document.querySelector(\"#item\");\r\n let item = itemTextInput.value.trim();\r\n if (item.length > 0) {\r\n enableClearButton(true);\r\n showItem(item);\r\n groceryList.push(item);\r\n\r\n // Save groceryList to localStorage\r\n saveList(groceryList);\r\n }\r\n\r\n // Clear input\r\n itemTextInput.value = '';\r\n}", "click(){\n\t\t\t\tcreateAddWindow();\n\t\t\t}", "function pressAddBtn() {\n helpers.save('json', data);\n window.addEventListener('keydown', closeByPressEsc);\n\n sidebarHeaderMarkup();\n sidebar.classList.add('expanded');\n overlay.classList.add('overlay');\n\n cartQuantityMarkup();\n}", "function addNewItem () {\n\t\"use strict\";\n\tvar addInputText = addInput.value;\n\tif (addInputText !== \"\") {\n\t\t\n\t\tvar newLabel = addNewLabel(addInputText, this);\t\n\t\tvar newEditButton = addNewEditButton();\n\t\tvar newDeleteButton = addNewDeleteButton();\n\t\t\n\t\tinsertAfter(newLabel, h6List[1]);\n\t\tinsertAfter(newEditButton, newLabel);\n\t\tinsertAfter(newDeleteButton, newEditButton);\n\t\t\n\t\t//Attaching the event handlers to the new elements\n\t\tnewEditButton.onclick = toggleEdit;\n\t\tnewLabel.firstChild.onclick = toggleCompletion;\n\t\tnewDeleteButton.onclick = deleteItem;\n\t}\n}", "function addListener(item){\n item.addEventListener('click', (event) => {\n // console.log(item.innerHTML)\n // console.log(item.id)\n let beginning = item.id\n let end = '.html'\n let output = beginning + end\n ipcRenderer.invoke('perform-action', output)\n })\n}", "function addNewTodoItem(start, stop, content) {\n if (start !== \"\" && stop !== \"\" && content !== \"\") {\n let todo = new Todo(content, start, stop);\n let newTodos = [...todos];\n newTodos.push(todo);\n setTodos(newTodos);\n setSelectedRow(\"\");\n }\n }", "function insertItem(item, isFolder) {\n var insertIndex = findItemInsertIndex(item, isFolder);\n\n renderItem(item, isFolder, insertIndex);\n}", "addItem(item) {\n // Create new list of todos to not alter state directly\n let items = this.state.todo_list.slice();\n let id = this.state.start_id + 1;\n\n this.setState({start_id: id });\n items.push( {\n id: id,\n item: item\n });\n\n this.setState({ todo_list: items });\n }", "function add(item) {\n data.push(item);\n console.log('Item Added...');\n }", "addNewItem(itemId) {\n if(!itemId){\n itemId = this.nextListItemId++;\n }\n let newItem = new ToDoListItem(itemId);\n this.currentList.items.push(newItem);\n this.view.viewList(this.currentList);\n this.enableItemControls();\n return newItem;\n }", "function aq_sortable_list_add_item(action_id, items) {\n\t\t\n\t\tvar blockID = items.attr('rel'),\n\t\t\tnumArr = items.find('li').map(function(i, e){\n\t\t\t\treturn $(e).attr(\"rel\");\n\t\t\t});\n\t\tvar type_shortcode = items.attr('data-shortcode-type');\n\t\tvar maxNum = Math.max.apply(Math, numArr);\n\t\tif (maxNum < 1 ) { maxNum = 0};\n\t\tvar newNum = maxNum + 1;\n\t\t\n\t\tvar data = {\n\t\t\taction: 'aq_block_'+action_id+'_add_new',\n\t\t\tsecurity: $('#aqpb-nonce').val(),\n\t\t\tcount: newNum,\n\t\t\tblock_id: blockID,\n\t\t\ttype: type_shortcode\n\t\t};\n\t\t\n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\tvar check = response.charAt(response.length - 1);\n\t\t\t\n\t\t\t//check nonce\n\t\t\tif(check == '-1') {\n\t\t\t\talert('An unknown error has occurred');\n\t\t\t} else {\n\t\t\t\titems.append(response);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t});\n\t}", "function addToDoItem(){\n var todoText = getComponent('todo-text')\n var text = todoText.value;\n if(text === \"\"){\n return ;\n }\n var ddl = jsonFormat2showFormat(getNextHourJsonDate());\n console.log(text);\n var item = createToDoItem(model.data.id++,0,text,0,ddl);\n model.data.items.push(item);\n\n todoText.value = \"\";\n update();\n}", "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].clipBegin);\n }\n}", "function addItem(itemName) {\n // Add the item name to the internal list of selected items\n selectedItems.push(itemName)\n\n // Update the cookie\n localStorage.setItem(allItemNames[itemName], \"selected\")\n\n // Regenerate the list of required components\n updateSelectedItemComponents()\n}", "function add_new_segment(button_ref, segment_title, highlight_selection) {\n\t \n\tconsole.log(\"Adding a new segment\"); \n\t\n\tvar segment_title = segment_title || \"\";\t\n\tvar highlight_selection = highlight_selection || null;\t\n\tvar number_of_segments = $(\"#segments_list .segment_box\").length;\n\t\n\t// If the segment was added via a button click, find the segment box that contained the button.\n\t// Otherwise, get the last segment box\n\tvar this_segment;\n\tif (button_ref) {\n\t\tthis_segment = button_ref.closest(\".segment_box\");\n\t} else {\n\t\tthis_segment = $(\"#segments_list .segment_box\").last();\n\t}\n\n\t// Add the new segment, then renumber all the segments\n\tvar m = render(\"segment_template\", {segments:[{title:segment_title, highlight:highlight_selection}]});\n\tif (number_of_segments > 0) {\n\t\t$(m).insertAfter(this_segment).slideDown();\n\t} else {\n\t\t$(m).appendTo($(\"#segments_list\"));\n\t}\n\t\n\trenumber_segments();\n\tsetup_segment_buttons();\n\t$(\"#save_syllabus\").click();\t\n\n}", "function createHistoyItem() {\n /* List Item\n * <li class=\"SidebarListItem\">\n */\n let listItem = document.createElement(\"li\")\n listItem.setAttribute(\"class\", HISTORY_DIV_CLASS)\n\n /* Outer Div Element\n * <div class=\"DropTarget SidebarListItem__drop-target DropTarget--tracks DropTarget--albums DropTarget--artists DropTarget--playlists\">\n */\n let outer = document.createElement(\"div\")\n outer.setAttribute(\"class\", \"DropTarget SidebarListItem__drop-target\")\n\n /* Middle Div Element\n * <div class=\"SidebarListItem__inner\">\n */\n let inner = document.createElement(\"div\")\n inner.setAttribute(\"class\", \"SidebarListItem__inner\")\n\n /* Link Div Element\n * <div class=\"SidebarListItem__link\">\n */\n let link = document.createElement(\"div\")\n link.setAttribute(\"class\", \"SidebarListItem__link\")\n\n /* Anker\n * <a class=\"SidebarListItemLink SidebarListItemLink--tall spoticon-time-24\"\n * draggable=\"false\"\n * href=\"spotify:app:queue:history\"\n * data-sidebar-list-item-uri=\"spotify:app:queue:history\"\n * data-ta-id=\"sidebar-list-item-link\">\n */\n anker = document.createElement(\"a\")\n anker.setAttribute(\"class\", HISTORY_ANKER_CLASS)\n anker.setAttribute(\"draggable\", \"false\")\n anker.setAttribute(\"href\", \"spotify:app:queue:history\")\n anker.setAttribute(\"data-sidebar-list-item-uri\", \"spotify:app:queue:history\")\n anker.setAttribute(\"data-ta-id\", \"sidebar-list-item-link\")\n\n /* Item Text\n * <span class=\"SidebarListItem__label\"\n * dir=\"auto\">\n * History\n * </span>\n */\n span = document.createElement(\"span\")\n span.setAttribute(\"class\", \"SidebarListItem__label\")\n span.setAttribute(\"dir\", \"auto\")\n span.textContent = ITEM_LABEL\n\n\n anker.appendChild(span)\n link.appendChild(anker)\n inner.appendChild(link)\n outer.appendChild(inner)\n listItem.appendChild(outer)\n\n listItem.addEventListener(\"click\", onClickHistory)\n\n return {div: listItem, anker: anker}\n }", "appendNewListToView(newList) {\n // GET THE UI CONTROL WE WILL APPEND IT TO\n let listsElement = document.getElementById(\"todo-lists-list\");\n\n // MAKE AND ADD THE NODE\n let newListId = \"todo-list-\" + newList.id;\n let listElement = document.createElement(\"div\");\n listElement.setAttribute(\"id\", newListId);\n listElement.setAttribute(\"class\", \"todo_button\");\n listElement.appendChild(document.createTextNode(newList.name));\n listsElement.appendChild(listElement);\n\n // SETUP THE HANDLER FOR WHEN SOMEONE MOUSE CLICKS ON OUR LIST\n let thisController = this.controller;\n listElement.onmousedown = function() {\n thisController.handleLoadList(newList.id);\n }\n }", "function addItem(item) {\n backpack.push(item);\n}", "#addItem(item, floor) {\n this.floors[floor].add(item);\n }", "function addNewItem(){\n\tvar nItems = $(\"#items\").children().length;\n\tif(nItems < 7){\n\t\t$(\"#items\").append(\"<div class='item'></div>\");\n\t\tvar newItem;\n\t\tvar fRand = Math.random();\n\t\tif(fRand < 0.35){\n\t\t\t$(\".item:last-child\").addClass(\"bomb\");\n\t\t}\n\t\telse if(fRand < 0.65){\n\t\t\t$(\".item:last-child\").addClass(\"indicator\");\n\t\t}\n\t\telse{\n\t\t\t$(\".item:last-child\").addClass(\"eraser\");\n\t\t}\n\t\t\n\t\t$(\".item:last-child\").click(useItem);\n\n\t}\n}", "function start()\n{\n var splitButton = document.getElementById( \"splitButton\" );\n splitButton.addEventListener( \"click\", splitButtonPressed, false );\n} // end function start", "function addToOngo(text){\n const ongoLi = document.createElement(\"li\");\n const ongoSpan = document.createElement(\"span\");\n ongoSpan.innerText = text;\n const delBtn = document.createElement(\"button\");\n delBtn.innerHTML = `<i class=\"fas fa-trash-alt\"></i>`;\n delBtn.addEventListener(\"click\", delToDo);\n const finBtn = document.createElement(\"button\");\n finBtn.innerHTML = `<i class=\"fas fa-check-square\"></i>`;\n finBtn.addEventListener(\"click\",moveToEach);\n \n ongoLi.appendChild(ongoSpan);\n ongoLi.appendChild(finBtn);\n ongoLi.appendChild(delBtn);\n ongoList.appendChild(ongoLi);\n\n newId = ONGOING.length+1;\n ongoLi.id = newId;\n \n const ongoObj = {\n id : newId,\n value : text\n }\n\n ONGOING.push(ongoObj);\n saveOngo();\n}", "_insertAddNewTab() {\n const that = this,\n tabLabelContainer = that._addTabLabelContainer(undefined, true).tabLabelContainer;\n\n tabLabelContainer.$.addClass('jqx-add-new-tab');\n\n that.$.tabStrip.appendChild(tabLabelContainer);\n\n that._addNewTab = tabLabelContainer;\n }", "function handleCreateNewItem(itemName, todoAppData, todoService, todoViewSetter) {\n\t\n\t//add new item to the model\n\tlet newItem = todoAppData.selectedList.addItem(itemName);\n\t//persist new item to storage\n\ttodoService.saveListsToLocalStore(todoAppData.lists);\n\t//add new item to view\n\ttodoViewSetter.addNewItem(newItem, todoAppData.selectedList.items.length - 1);\n}", "function aq_sortable_list_add_item(action_id, items) {\n\t\t\n\t\tvar blockID = items.attr('rel'),\n\t\t\tnumArr = items.find('li').map(function(i, e){\n\t\t\t\treturn $(e).attr(\"rel\");\n\t\t\t});\n\t\t\t\t\n\t\tvar maxNum = Math.max.apply(Math, numArr);\n\t\tif (maxNum < 1 ) { maxNum = 0};\n\t\tvar newNum = maxNum + 1;\n\t\t\n\t\tvar data = {\n\t\t\taction: 'aq_block_'+action_id+'_add_new',\n\t\t\tsecurity: $('#aqpb-nonce').val(),\n\t\t\tcount: newNum,\n\t\t\tblock_id: blockID\n\t\t};\n\t\t\n\t\t$.post(ajaxurl, data, function(response) {\n\t\t\tvar check = response.charAt(response.length - 1);\n\t\t\t\n\t\t\t//check nonce\n\t\t\tif(check == '-1') {\n\t\t\t\talert('An unknown error has occurred');\n\t\t\t} else {\n\t\t\t\titems.append(response);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t});\n\t}", "function addOnBtnClick () {\n $('#add_todo').on('click', function(event) {\n appendToDo();\n });\n}", "processCreateNewList() {\n // MAKE A BRAND NEW LIST\n window.todo.model.loadNewList();\n\n // CHANGE THE SCREEN\n window.todo.model.goList();\n }", "addItem() {\n if(!this.todoItem) {\n alert('Input field is empty');\n return;\n }\n const list = JSON.parse(localStorage.getItem('todo-list'));\n this.todoList = list === null ? [] : list;\n this.todoList.push({\n id: new Date().valueOf(),\n todo: this.todoItem,\n done: false\n });\n localStorage.setItem('todo-list', JSON.stringify(this.todoList));\n this.dispatchEvent(new CustomEvent('addTodoItem', {\n bubbles: true,\n composed: true,\n detail: { \n todoList: this.todoList \n }\n }));\n this.todoItem = '';\n }", "function appendItem(obj) {\n todo_list.insertBefore(getTodoItem(obj), todo_list.firstChild);\n }", "function addEvent(e)\n{\n\te.preventDefault(); //values will appear in list - from jQuery library\n\tlet displayList = document.createElement('li');\n\tlet inputValue = document.getElementById('new-item').value;\n\n\tdisplayList.textContent = inputValue;\n\tdisplayList.className = 'list-group-item mb-2 w-75'; //bootstrap class\n\n\tlet completeTask = document.createElement(\"img\");\n\tcompleteTask.setAttribute('src', 'images/checkMark.png');\n\tcompleteTask.className = 'mr-2 img-margin btn btn-sm btn-info float-right'; //bootstrap button\n\tcompleteTask.style.height = '30px';\n\n\tlet deleteTask = document.createElement('button');\n\tdeleteTask.innerHTML = 'x';\n\tdeleteTask.className = 'btn btn-sm btn-danger float-right mr-2'; //bootstrap button\n\n\tif(inputValue)\n\t{\n\t\tdisplayList.appendChild(completeTask);\n\t\tdisplayList.appendChild(deleteTask);\n\t\tlistContainer.appendChild(displayList);\n\t\taddList.reset();\n\t}\n}", "function submitItem(item) {\n $.post(\"/addItem\", item)\n }", "function handleAddNewBookmark() {\n $(\"main\").on(\"click\", \"#add-bookmark\", function (event) {\n store.addNewBookmark = !store.addNewBookmark;\n render();\n })\n}", "function addListAfterClick() {\n if (inputLength() > 0) {\n createListElement();\n }\n}", "function addListAfterClick(){\n\tif (inputLength() > 0) { //makes sure that an empty input field doesn't create a li\n\t\tcreateListElement();\n\t}\n}", "function addItemList(text, target) {\n var list = document.getElementById(target);\n var item = document.createElement('li');\n\n item.innerText = text;\n\n var buttons = document.createElement('div');\n buttons.classList.add('buttons');\n\n var remove = document.createElement('button');\n remove.classList.add('remove');\n remove.innerHTML = removeSVG;\n //click event for remove button\n remove.addEventListener('click', removeItem);\n\n var complete = document.createElement('button');\n complete.classList.add('complete');\n complete.innerHTML = completeSVG;\n //click event for complete button\n complete.addEventListener('click', completeItem);\n\n buttons.appendChild(remove);\n buttons.appendChild(complete);\n item.appendChild(buttons);\n list.appendChild(item);\n\n dataObjectUpdated();\n \n}", "_addItemToList(e) {\n if (\n this.shadowRoot.querySelector(\"#itemtext\").value != \"\" &&\n typeof this.shadowRoot.querySelector(\"#itemtext\").value !==\n typeof undefined\n ) {\n this.push(\"items\", {\n label: this.shadowRoot.querySelector(\"#itemtext\").value,\n value: false,\n disabled: this.disabledList,\n id: \"item-id-\" + this.items.length\n });\n this.shadowRoot.querySelector(\"#itemtext\").value = \"\";\n }\n }", "function addToDoItem(){\n\t//alert (\"The Add button was clicked\");\n\tvar itemText = toDoEntryBox.value;\n\tnewToDoItem(itemText, false);\n\t//Since a new to-do item is never complete, you can \n\t// pass false to the completed parameter of the newToDoItem function.\n}", "function onItemDivInserted(e) {\n if (! isEnabledOnThisPage())\n return;\n\n //trace(\"event: DOMNodeInserted of menu into post\");\n // We want to make sure the menu is inserted in the right place,\n // not only so that the position is correct in the popup, but also\n // for Google+ Tweaks to insert its mute button in the right place\n var $target = $(e.target);\n var $item = $target.parent();\n $item.children('.gpme-post-wrapper').append($target);\n\n // Update the buttons.\n // Right now, only the mute button matters\n updateButtonArea($item);\n}", "addItem() {\n if (!this.props.onItemUpdate) {\n console.warn('Read-only list.');\n return;\n }\n\n // TODO(burdon): Set focus on editor.\n if (!this.state.showEditor) {\n this.setState({\n showEditor: true,\n editingItemId: null\n });\n }\n }", "appendIntoPart(e){e.__insert(this.startNode=createMarker()),e.__insert(this.endNode=createMarker())}", "function attachBdlClick($item) {\n $item.dblclick(function() {\n var clone = $(this)\n .clone()\n .appendTo($(this)\n .parents('ul'))\n .draggable($draggableOptions);\n attachBdlClick(clone);\n });\n }", "add(s) {\n\n let template = $(`\n <li data-snapshot-id=\"${s.id}\">\n <figure><img src=\"${s.data}\" alt=\"snapshot\" /></figure>\n <div class=\"rdp-snapshots--controls\">\n <a href=\"snapshot:remove\"><i class=\"fa fa-remove\"></i></a>\n </div>\n </li>\n `);\n\n // append this to the list\n this.$.prepend(template);\n this.dispatchHook('added', template);\n\n template.find('a[href=\"snapshot:remove\"]').bind('click', e => {\n e.preventDefault();\n\n if (this.service.locked) return;\n\n this.service.remove(template.data('snapshotId'));\n template.remove();\n this.dispatchHook('removed');\n });\n }", "function addItemPulldown() {\n // var clone = $('.scenario_block_origin .pulldown_box_child .customize_pulldown_item').clone();\n var parent = $('.message_container_input .pulldown_group.active .pulldown_item'),\n clone;\n if (!parent.find('.item').length) {\n clone = $('.scenario_block_origin .pulldown_box_child .customize_one_pulldown_item').clone();\n }else {\n if (parent.find('.item').hasClass('customize_one_pulldown_item')) {\n clone = $('.scenario_block_origin .pulldown_box_child .customize_one_pulldown_item').clone();\n }else {\n clone = $('.scenario_block_origin .pulldown_box_child .customize_two_pulldown_item').clone();\n }\n }\n // $('.message_container_input .pulldown_group.active .pulldown_item').append(clone);\n clone.insertBefore($('.message_bot_area .pulldown_group.active .pulldown_item .add_item_box'));\n checkPulldownBox();\n}" ]
[ "0.7065139", "0.6649288", "0.64635265", "0.63123125", "0.62849987", "0.61835575", "0.60692406", "0.604714", "0.603421", "0.59861404", "0.5957507", "0.5953882", "0.593272", "0.59280634", "0.59276676", "0.5897413", "0.58803916", "0.58702517", "0.5869334", "0.5869334", "0.5869334", "0.5869334", "0.5843572", "0.5843483", "0.58420223", "0.582169", "0.5821567", "0.5813528", "0.5811308", "0.5811277", "0.5806296", "0.5798338", "0.5797798", "0.5790423", "0.5774047", "0.57620585", "0.57498217", "0.5744366", "0.5720785", "0.5715435", "0.5690984", "0.56893516", "0.56692165", "0.56662977", "0.56659883", "0.5654448", "0.5650007", "0.5647966", "0.56471854", "0.5644069", "0.56376755", "0.5637577", "0.56353015", "0.5629966", "0.56219953", "0.5621207", "0.562052", "0.5611793", "0.5609867", "0.56048334", "0.5600314", "0.559563", "0.55939025", "0.55889493", "0.556184", "0.55526835", "0.5548387", "0.5548079", "0.5546921", "0.553828", "0.5534707", "0.55329335", "0.5531842", "0.55260205", "0.5519069", "0.5518822", "0.55185074", "0.5517537", "0.5517272", "0.5516226", "0.55157", "0.55082333", "0.5507242", "0.55028373", "0.5502156", "0.5498878", "0.549544", "0.5493033", "0.5491709", "0.5489281", "0.5488606", "0.5485427", "0.5485222", "0.5483761", "0.5483072", "0.5482817", "0.5472186", "0.54696107", "0.5464803", "0.54631037" ]
0.62014264
5
select select the split segment at the current time
function selectCurrentSplitItem(excludeDeletedSegments) { if (!continueProcessing && !isSeeking) { excludeDeletedSegments = excludeDeletedSegments || false; var splitItem = getCurrentSplitItem(); if (splitItem != null) { var idFound = false; var id = -1; if (excludeDeletedSegments) { if (splitItem.enabled) { id = splitItem.id; idFound = true; } else if (editor.splitData && editor.splitData.splits) { for (var i = splitItem.id; i < editor.splitData.splits.length; ++i) { if (editor.splitData.splits[i].enabled) { idFound = true; id = i; break; } } if (!idFound) { for (var i = splitItem.id; i >= 0; --i) { if (editor.splitData.splits[i].enabled) { idFound = true; id = i; break; } } } } } else { id = splitItem.id; idFound = true; } if (idFound) { currSplitItemClickedViaJQ = true; if (!zoomedIn()) { $('#splitSegmentItem-' + id).click(); } lastId = -1; $('#descriptionCurrentTime').html(formatTime(getCurrentTime())); } else { ocUtils.log("Could not find an enabled ID"); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].clipBegin);\n }\n}", "function splitButtonClick() {\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n\n splitItem.clipBegin = parseFloat(splitItem.clipBegin);\n splitItem.clipEnd = parseFloat(splitItem.clipEnd);\n if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) {\n newEnd = 0;\n if (editor.splitData.splits.length == (i + 1)) {\n newEnd = splitItem.clipEnd;\n } else {\n newEnd = editor.splitData.splits[i + 1].clipBegin;\n }\n var newItem = {\n clipBegin: parseFloat(currentTime),\n clipEnd: parseFloat(newEnd),\n enabled: true\n }\n\n splitItem.clipEnd = currentTime;\n editor.splitData.splits.splice(i + 1, 0, newItem);\n // TODO Make splitSegments clickable when zoomed in\n editor.updateSplitList(false, !zoomedIn());\n selectSegmentListElement(i + 1);\n return;\n }\n }\n }\n selectCurrentSplitItem();\n}", "function nextSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id + 1;\n\n new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id;\n\n for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = 0; i < new_id; ++i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (new_id < 0) ? (editor.splitData.splits.length - 1) : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id <= 0) ? editor.splitData.splits.length : new_id;\n for (var i = new_id - 1; i >= 0; --i) {\n\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = editor.splitData.splits.length - 1; i >= 0; --i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function selectSegmentListElement(number, dblClick) {\n dblClick = dblClick ? dblClick : false;\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var spltItem = editor.splitData.splits[number];\n if (spltItem) {\n setCurrentTime(spltItem.clipBegin);\n currSplitItemClickedViaJQ = true;\n if ($('#splitItemDiv-' + number)) {\n if (dblClick) {\n $('#splitItemDiv-' + number).dblclick();\n } else {\n $('#splitItemDiv-' + number).click(); // TODO\n }\n }\n }\n }\n}", "selectedTimeIndex(){\n log('----------------------------------------------');\n log('[watch:selectedTimeIndex] - selectedTimeIndex changed to: '+this.selectedTimeIndex);\n log('----------------------------------------------');\n this.selectVideo();\n }", "function selectTime() {\n var pos = d3.mouse(fullMareyForeground.node());\n var y = pos[1];\n var x = pos[0];\n if (x > 0 && x < fullMareyWidth) {\n var time = yScale.invert(y);\n select(time);\n }\n }", "function selectObj(e){\n if(time === 0) {\n let p = getEventPosition(e);\n x1 = p.x;\n y1 = p.y;\n time++;\n } else {\n let p = getEventPosition(e);\n x2 = p.x;\n y2 = p.y;\n cutObj(x1,y1,x2,y2);\n time = 0;\n }\n}", "function setCurrentTimeAsNewInpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeBegin(getCurrentTime());\n okButtonClick();\n }\n}", "function select() {\n selectTask(requireCursor());\n }", "addSegment(event, where) {\n if (this.debug) console.log(\"addSegment\", where);\n\n let { selectedPointIndex } = this.state;\n\n // create new SVG Point\n let point = document.querySelector('#app svg').createSVGPoint();\n point.x = event.clientX;\n point.y = event.clientY;\n point = point.matrixTransform(this.state.transformMatrix);\n if (this.state.snapToGrid) { point = roundPoint(point) }\n\n this.state.currentPoint = {x: point.x, y: point.y};\n\n if (where === 'END') {\n const id = this.getPath().addSegment({\n type: 'L',\n dest: {\n x: point.x,\n y: point.y\n }\n })\n this.state.selectedPointId = id;\n this.state.selectedPointIndex++;\n }\n if (where === 'START') {\n const id = this.getPath().addSegmentAtStart({\n type: 'M',\n dest: {\n x: point.x,\n y: point.y\n }\n })\n this.getPath().definition[selectedPointIndex + 1].type = 'L';\n this.state.selectedPointId = id;\n this.state.selectedPointIndex = 0;\n }\n if ( where === 'NEW' ) {\n const id = this.getPath().addSegment({\n type: 'M',\n dest: {\n x: point.x,\n y: point.y\n }\n })\n this.state.isDrawing = false;\n this.state.selectedPointId = id;\n this.state.selectedPointIndex = 0;\n } \n\n this.state.isFirstPoint = false;\n \n /* update bbox according to the new point */\n if (this.getPath().getDOMRef()) {\n let bbox = this.getPath().getDOMRef().getBBox();\n this.updateBBox()\n this.updatePathCenter(bbox);\n this.updateRotationCenter();\n }\n\n this.historySnapshot();\n }", "getSegment(\n pathIndex = this.state.selectedPathIndex,\n pointIndex = this.state.selectedPointIndex,\n ) {\n return this.state.allPaths[pathIndex].definition[pointIndex];\n }", "function okButtonClick() {\n if (!continueProcessing && checkClipBegin() && checkClipEnd()) {\n id = $('#splitUUID').val();\n if (id != \"\") {\n var current = editor.splitData.splits[id];\n var tmpBegin = parseFloat(current.clipBegin);\n var tmpEnd = parseFloat(current.clipEnd);\n var duration = getDuration();\n id = parseInt(id);\n if (getTimefieldTimeBegin() > getTimefieldTimeEnd()) {\n displayMsg(\"The inpoint is bigger than the outpoint. Please check and correct it.\",\n \"Check and correct inpoint and outpoint\");\n selectSegmentListElement(id);\n return;\n }\n\n if (checkPrevAndNext(id, true).ok) {\n if (editor.splitData && editor.splitData.splits) {\n current.clipBegin = getTimefieldTimeBegin();\n current.clipEnd = getTimefieldTimeEnd();\n if (id > 0) {\n if (current.clipBegin > editor.splitData.splits[id - 1].clipBegin) {\n editor.splitData.splits[id - 1].clipEnd = current.clipBegin;\n } else {\n displayMsg(\"The inpoint is bigger than the inpoint of the segment before this segment. Please check and correct it.\",\n \"Check and correct inpoint\");\n setTimefieldTimeBegin(editor.splitData.splits[id - 1].clipEnd);\n selectSegmentListElement(id);\n return;\n }\n }\n\n var last = editor.splitData.splits[editor.splitData.splits.length - 1];\n if (last.clipEnd < duration) {\n ocUtils.log(\"Inserting a last split element (auto): (\" + current.clipEnd + \" - \" + duration + \")\");\n var newLastItem = {\n clipBegin: parseFloat(last.clipEnd),\n clipEnd: parseFloat(duration),\n enabled: true\n };\n\n // add the new item to the end\n editor.splitData.splits.push(newLastItem);\n }\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n if (checkPrevAndNext(i, false).inserted) {\n i = 0;\n }\n }\n }\n\n editor.updateSplitList(true, !zoomedIn());\n $('#videoPlayer').focus();\n selectSegmentListElement(id);\n } else {\n current.clipBegin = tmpBegin;\n current.clipEnd = tmpEnd;\n selectSegmentListElement(id);\n }\n }\n } else {\n selectCurrentSplitItem();\n }\n}", "drawSelection( ratio ) {\n var inc = 1 / this.numPoints;\n var i;\n\n //determine the solution index\n var sol;\n for( i = 1; i < this.numPoints; i ++) {\n if(ratio < inc*i) {\n sol = i-1;\n break;\n }\n }\n if(sol == null)\n sol = this.numPoints-1;\n\n //highlight the point\n var min = this.y + this.padding;\n var max = this.y + this.height - this.padding;\n\n var xSpacing = ((this.x + this.width - this.padding) - (this.x + this.padding) )/ this.numPoints;\n \n var xPos =(this.x + this.padding + xSpacing * sol);\n var yPos = this.y + this.padding;\n\n\n\n if(sol == this.poi) {\n this.poiSelected = true;\n ctx.fillStyle = \"green\"\n } else {\n this.poiSelected = false;\n ctx.fillStyle = selectColour;\n }\n\n\n //draw the selection\n ctx.strokeStyle = \"black\";\n ctx.beginPath();\n ctx.rect(xPos, yPos, xSpacing, this.graphHeight);\n ctx.fill();\n ctx.stroke();\n if(this.poiSelected) { \n var complete = indicator.update(this.poiSelected);\n\n\n //mark the segment as fail or success\n if(timingIndicator.complete)//failure\n this.segmentGenerated[this.segmentSelected] = segmentStatus.FAILURE;\n else //success\n this.segmentGenerated[this.segmentSelected] = segmentStatus.SUCCESS;\n\n //edit the number of points in the graph\n if( complete && this.countSegmentsStatus(segmentStatus.NOT_GENERATED) == 0 && !this.incrementedNumPoints) {\n if(this.countSegmentsStatus(segmentStatus.FAILURE) >= 2 ) { //user failed more than twice with this many points\n \n if(this.numPoints > 2) //a minimum of 2 points\n this.numPoints --;\n\n //stop condition stuff\n if(this.stopCond[this.numPoints] == undefined) {\n console.log(\"initializing stopcond at \" + this.numPoints);\n this.stopCond[this.numPoints] = 1;\n } else {\n this.stopCond[this.numPoints] ++;\n console.log(\"Stop condition at pos \" + this.numPoints + \" has increased to \" + this.stopCond[this.numPoints] );\n }\n\n //if we have reached the maximum number of decreasing revisits - set a flag (and disable graph from getting pois - see choosePoi())\n if(this.stopCond[this.numPoints] >= stopCondMax) {\n this.stopCondReached = true;\n console.log(\"Stop condition reached for \" + this.label);\n }\n\n } else {\n console.log(\"Increasing points in graph\");\n this.numPoints ++;\n }\n this.resetSegments();\n this.incrementedNumPoints = true; //prevents number of points changing rapidly after selection\n }\n }\n\n //display the value \n //this.displayValue(sol, xPos, yPos);\n }", "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "selectTimeSlot(bundle) {\n this.setState({\n day: bundle.day,\n leader: bundle.leader,\n interviewer: bundle.interviewer,\n startTime: bundle.startTime,\n currentActivity: this.state.activitities[3]\n });\n }", "function HandleSegmentLocationSelection(legCount, arriveBefore)\n{\t\n\t// Clear previous highlighting\n\tClearSegmentSelections(legCount);\n\t\n\t// Whether to plan an arrive before or leave later\n\tvar selectedIsArriveBefore = GetSelectedIsArriveBefore(arriveBefore);\n\n\t// New highlighting from the location selected in the dropdown\n\tvar selectedLegNumber = GetSelectedLegNumber(selectedIsArriveBefore);\n\t\n\tif (selectedLegNumber != -1 && selectedIsArriveBefore != \"-1\")\n\t{\n\t\t// Highlight\n\t\tDrawAdjustLines(selectedLegNumber, selectedIsArriveBefore, legCount);\n\t}\n}", "handleSelectionStartEvent(startTime) {\n // Check if the startTime cell is selected/unselected to determine if this drag-select should\n // add values or remove values\n const timeSelected = this.props.selection.find(a => (0, _is_same_minute.default)(a, startTime));\n this.setState({\n selectionType: timeSelected ? 'remove' : 'add',\n selectionStart: startTime\n });\n }", "function getCurrentlyPlayingSegment(tech) {\n const targetMedia = tech.vhs.playlists.media();\n const snapshotTime = tech.currentTime();\n let segment;\n\n // Iterate trough available segments and get first within which snapshot_time is\n // eslint-disable-next-line no-plusplus\n for (let i = 0, l = targetMedia.segments.length; i < l; i++) {\n // Note: segment.end may be undefined or is not properly set\n if (snapshotTime < targetMedia.segments[i].end) {\n segment = targetMedia.segments[i];\n break;\n }\n }\n\n if (!segment) {\n [segment] = targetMedia.segments;\n }\n\n return segment;\n}", "_changeToMinuteSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n that._inInnerCircle = false;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = that.minuteInterval;\n\n that.$hourContainer.removeClass('jqx-selected');\n that.$minuteContainer.addClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderMinutes();\n\n that._drawArrow(true, undefined, true);\n }", "move(){\n\n this.segments[this.select].x += this.segments[this.select].deltaX;\n this.segments[this.select].y += this.segments[this.select].deltaY;\n\n }", "function getCurrentSplitItem() {\n if (editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n if ((splitItem.clipBegin <= (currentTime + 0.1)) && (currentTime < (splitItem.clipEnd - 1))) {\n splitItem.id = i;\n return splitItem;\n }\n }\n }\n return currSplitItem;\n}", "@autobind\n onSegmentControlSelect(segment: SegmentControlType) {\n const { question, dateRangeBegin, dateRangeEnd, dataFetchTimeSize } = this.state;\n\n let newDataFetchTimeSize = dataFetchTimeSize;\n\n switch (segment.title) {\n case segmentTitles.day:\n newDataFetchTimeSize = dateRangeBegin === moment().startOf('day').unix() ? unixTimes.twoHour : unixTimes.day;\n break;\n case segmentTitles.week:\n newDataFetchTimeSize = unixTimes.week;\n break;\n case segmentTitles.month:\n newDataFetchTimeSize = unixTimes.month;\n break;\n }\n\n this.setState(\n {\n segment: segment,\n dataFetchTimeSize: newDataFetchTimeSize,\n },\n this.fetchData(question, dateRangeBegin, dateRangeEnd, newDataFetchTimeSize)\n );\n }", "function tsToSegment (ts) {\n if (!ts) ts = + new Date();\n return Math.floor(ts / (1000 * 60 * 5));\n }", "_navigateToNextTimePart() {\n const that = this;\n\n that._highlightTimePartBasedOnIndex(that._highlightedTimePart.index + 1);\n }", "function selectSegments() {\n var peaks = wavesurfer.backend.peaks;\n var length = peaks.length;\n var duration = wavesurfer.getDuration();\n\n var start = 0;\n var min = 0.001;\n for (var i = start; i < length; i += 1) {\n if (peaks[i] <= min && i > start + (1 / duration) * length) {\n var color = [\n ~~(Math.random() * 255),\n ~~(Math.random() * 255),\n ~~(Math.random() * 255),\n 0.1\n ];\n wavesurfer.addRegion({\n color: 'rgba(' + color + ')',\n start: (start / length) * duration,\n end: (i / length) * duration\n });\n while (peaks[i] <= min) {\n i += 1;\n }\n start = i;\n }\n }\n}", "function playCurrentSplitItem() {\n var splitItem = getCurrentSplitItem();\n if (splitItem != null) {\n pauseVideo();\n var duration = (splitItem.clipEnd - splitItem.clipBegin) * 1000;\n setCurrentTime(splitItem.clipBegin);\n\n clearEvents();\n editor.player.on(\"play\", {\n duration: duration,\n endTime: splitItem.clipEnd\n }, onPlay);\n playVideo();\n }\n}", "function select(zonedStartInput, zonedEndInput) {\n\t\tcurrentView.select(\n\t\t\tt.buildSelectSpan.apply(t, arguments)\n\t\t);\n\t}", "function select(zonedStartInput, zonedEndInput) {\n\t\tcurrentView.select(\n\t\t\tt.buildSelectSpan.apply(t, arguments)\n\t\t);\n\t}", "function select(zonedStartInput, zonedEndInput) {\n\t\tcurrentView.select(\n\t\t\tt.buildSelectSpan.apply(t, arguments)\n\t\t);\n\t}", "function select(zonedStartInput, zonedEndInput) {\n\t\t\tcurrentView.select(\n\t\t\t\tt.buildSelectSpan.apply(t, arguments)\n\t\t\t);\n\t\t}", "function selectActivePoint(dateTime)\n{\n\tvar svg = d3.select(\"#panel\").select(\"svg\");\n\t\n\tvar circles = svg.selectAll(\".tsChartDot\");\n\tfor(var index = 0; index < circles[0].length; index++)\n\t{\n\t\tvar chartDotCircle = circles[0][index];\n\t\t\n\t\tvar dotDateValue = new Date(chartDotCircle.__data__.attributes[dimension]);\n\t\t\n\t\tif(dotDateValue.getTime() == dateTime.getTime()) \n\t\t{\n\t\t\tchartDotCircle.style.fill = \"cyan\";\t\t\n\t\t\tchartDotCircle.style.stroke = \"black\";\t\n\t\t\tchartDotCircle.setAttribute(\"r\", 6);\t\n\t\t\t\n\t\t\tvar chartValue = chartDotCircle.__data__.attributes[yValueField];\n\t\t\tvar chartingDateLabel = \"Map Date\" + \": \" + dotDateValue.toDateString(); \n\t\t\t\n\t\t\tchartDotCircle.__data__.attributes[\"Selected\"] = true;\n\t\t\t\n\t\t\tvar textAll = svg.selectAll(\"#Title\");\n\t\t\ttextAll[0][0].textContent = chartingDateLabel;\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tchartDotCircle.__data__.attributes[\"Selected\"] = false;\n\t\t\tchartDotCircle.style.fill = \"\";\t\t\n\t\t\tchartDotCircle.style.stroke = \"\";\n\t\t\tchartDotCircle.setAttribute(\"r\", 3.5);\n\t\t}\n\t}\n}", "set timeSlicingMode(value) {}", "selectCurrent()\n {\n this.select(this.currentSelectedIndex);\n }", "function currentTimeSegment(timeFrame) {\n\t\tvar step = $scope.timeSegmentsList[0].segmentRange;\n\t\tvar indexInTimeSegments = Math.floor(timeFrame / step);\n\t\tif (indexInTimeSegments == $scope.timeSegmentsList.length) indexInTimeSegments--;\n\t\treturn indexInTimeSegments;\n\t}", "function onTimeSelectionChange() {\n drawTimeBlocks();\n drawInfoBox(timeSelectionControl.value);\n updateTimeSelectionIndicator(timeSelectionControl.value);\n }", "function setStartSegment( projectID, segmentID ){\n\t//close dialog box\n\tcloseDialog();\n\t//set the project Starting Clip - have to see if it exists or not first\n\t\n\tvar resp = updateItem( \"project\", projectID, \"startingSegment\", segmentID );\n\t\n\tconsole.log( resp );\n\t\n\tif( resp != null ){\n\t\tvar d = resp.data;\n\t\tif( d.length == 1 && d[0].update == 1){\n\t\t\twindow.alert(\"Updated Starting Segment to: \" + segmentID);\n\t\t}else{\n\t\t\twindow.alert(\"Could not update Starting Segment\");\n\t\t}\n\t}else{\n\t\twindow.alert(\"Could not update Starting Segment\");\n\t}\n}", "function splitBusy(day,start,end){\n\n\t\t\t\t\tvar l = busyList.length;\n\n\t\t\t\t\tfor(var i = 0 ; i<l ; i++){\n\n\t\t\t\t\t\tif(busyList[i].start.day() == start.day()){\n\n\t\t\t\t\t\t\tvar toSplit = busyList[i];\n\n\t\t\t\t\t\t\tif(toSplit.start >= start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//move begining to the end of end\n\n\t\t\t\t\t\t\t\ttoSplit.start.hour(end.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.end <= end && toSplit.start < start){\n\n\t\t\t\t\t\t\t\t//move the end to the begining of start\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else if(toSplit.start < start && toSplit.end > end){\n\n\t\t\t\t\t\t\t\t//split in two\n\n\t\t\t\t\t\t\t\tbusyList.push({id:busyList.length,\n\n\t\t\t\t\t\t\t\t\ttitle:\"No disponible\",\n\n\t\t\t\t\t\t\t\t\tcolor:\"#000\",\n\n\t\t\t\t\t\t\t\t\tstart: new moment(end),\n\n\t\t\t\t\t\t\t\t\tend: new moment(toSplit.end),\n\n\t\t\t\t\t\t\t\t\teditable:false\n\n\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\ttoSplit.end.hour(start.hour());\n\n\t\t\t\t\t\t\t}else{\n\n\t\t\t\t\t\t\t\tbusyList.splice(i,1);\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t}", "_changeSelection(event, noAnimation) {\n const that = this,\n x = event.pageX,\n y = event.pageY,\n center = that._getCenterCoordinates(),\n distanceFromCenter = Math.sqrt(Math.pow(center.x - x, 2) + Math.pow(center.y - y, 2));\n\n that._measurements.center = center;\n\n if (event.type === 'down') {\n if (distanceFromCenter > that._measurements.radius) {\n event.stopPropagation();\n return;\n }\n else {\n that._dragging = true;\n }\n }\n\n if (that.format === '24-hour' && that.selection === 'hour' && distanceFromCenter < that._measurements.radius - 50) {\n that._inInnerCircle = true;\n }\n else {\n that._inInnerCircle = false;\n }\n\n const angleRadians = Math.atan2(y - center.y, x - center.x);\n let angleDeg = -1 * angleRadians * 180 / Math.PI;\n\n if (angleDeg < 0) {\n angleDeg += 360;\n }\n\n that._angle = angleDeg;\n\n let newValue = that._numericProcessor.getValueByAngle(that._angle);\n\n if (that.selection === 'hour') {\n if (that.format === '24-hour') {\n if (that._inInnerCircle) {\n if (newValue !== 0 && newValue !== 12) {\n newValue += 12;\n }\n else {\n newValue = 0;\n }\n }\n else if (newValue === 0) {\n newValue = 12;\n }\n }\n else {\n if (newValue === 0) {\n newValue = 12;\n }\n }\n\n that._updateHours(newValue);\n }\n else {\n if (newValue === 60) {\n newValue = 0;\n }\n\n that._updateMinutes(newValue);\n }\n\n if (that._oldTimePart === undefined) {\n return;\n }\n\n cancelAnimationFrame(that._animationFrameId);\n that._drawArrow(true, newValue, noAnimation);\n }", "function setCurrentTimeAsNewOutpoint() {\n if (!continueProcessing && (editor.selectedSplit != null)) {\n setTimefieldTimeEnd(getCurrentTime());\n okButtonClick();\n }\n}", "function select(point){\n var relativePoint = getRelativePoint(point);\n var area = getAreaPointBelongsTo($scope.selectedCountry, relativePoint);\n if (area){\n selectArea(area);\n }else{\n var country = httpService.getCountry(getCountryPointBelongsTo(relativePoint));\n if (country && isSelectedCountry(country) && !$scope.selectedArea){\n country=null;\n }\n $scope.selectedArea = null;\n $scope.selectedCountry = country;\n }\n draw();\n }", "_navigateToPreviousTimePart() {\n const that = this;\n\n that._highlightTimePartBasedOnIndex(that._highlightedTimePart.index - 1);\n }", "selectByHierarchicalIndex(start, end) {\n let startPosition = this.getTextPosBasedOnLogicalIndex(start);\n let endPosition = this.getTextPosBasedOnLogicalIndex(end);\n this.selectPosition(startPosition, endPosition);\n }", "selectOption() {\n switch ( this.index ) {\n case 0:\n this.scene.start( 'GameScene' );\n break;\n }\n }", "function select (idx) {\n updatedLineNumbers(idx)\n List.select(idx)\n }", "set selected(value) {\n this._selected = value;\n this._selectedTimestamp = value ? new Date() : undefined;\n }", "function startTimeSelect() {\n //console.log(\"starting time selector...\");\n if (timefilter) timefilter.remove();\n t0 = d3.svg.mouse(this);\n timefilter = context \n .append(\"svg:rect\")\n .style(\"cursor\", \"move\")\n .style(\"fill\", \"cornflowerblue\")\n .style(\"stroke\", \"darkblue\")\n .style(\"fill-opacity\", .5)\n .on(\"mousedown\", grabTimeWindow);\n \n context.on(\"mousemove\", scaleTimeSelect);\n d3.event.preventDefault(); \n}", "selectIt() {\n var index = 1,\n text,\n modIndex,\n modLength;\n text = this.selected.text;\n modIndex = this.mod.indexOf(text);\n modLength = this.mod.slice(0, modIndex).length;\n var modEnd = this.mod.slice(modIndex + text.length, this.mod.length);\n if (this.modded) {\n index = this.selected.start + modLength;\n } else {\n index = this.selected.start - modLength;\n }\n this.el.focus();\n // el.selectionStart = index;\n // el.selectionEnd = selected.text.length + index;\n var ending = this.selected.text.length + index;\n this.setSelectionRange(this.el, index, ending);\n }", "findClosestSegment(currentTime) {\n let index = this.state.transcript.findIndex(function (a) {\n return a.start >= currentTime;\n });\n\n if((index === -1) && this.state.transcript.length > 0) {\n index = 0;\n }\n //adjust the index to the previous item when the start time is larger than the current time\n if(this.state.transcript[index] && this.state.transcript[index].start > currentTime) {\n index = index <= 0 ? 0 : index -1;\n }\n const segment = this.getSegmentByStartTime(this.state.transcript[index].start || 0);\n if(segment) {\n return segment.sequenceNr || 0;\n }\n return 0;\n }", "_changeToHourSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = 1;\n\n that.$hourContainer.addClass('jqx-selected');\n that.$minuteContainer.removeClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderHours();\n\n if (that.format === '24-hour' && (that.value.getHours() === 0 || that.value.getHours() > 12)) {\n that._inInnerCircle = true;\n }\n\n that._drawArrow(true, undefined, true);\n that._inInnerCircle = false;\n }", "function inSegment(xP, yP) {\r\n }", "function showVizChartForSelectedSegment() {\n\n let metric_col = selviz_metric;\n // show actual speeds in chart, not A-F LOS categories\n if (selviz_metric == 'los_hcm85') metric_col = 'auto_speed';\n\n if (_selectedGeo) {\n let segmentData = _allCmpData\n .filter(row => row.cmp_segid == _selectedGeo.cmp_segid)\n .filter(row => row[metric_col] != null);\n buildChartHtmlFromCmpData(segmentData);\n } else {\n buildChartHtmlFromCmpData();\n }\n}", "function selectHourOnInputElement() {\n\t\t\t\tinputElement.focus();\n\t\t\t\tsetTimeout(function() {\t\t\t\t\t\t\n\t\t\t\t\tinputElement.get(0).setSelectionRange(0, 2);\n\t\t\t\t}, 1);\n\t\t\t}", "function printSplit() {\n listToComplete = document.getElementById(\"splits\");\n splitToAdd = document.createElement(\"li\");\n splitToAdd.textContent =\n chronometer.twoDigitsNumber(chronometer.getMinutes())[0] +\n chronometer.twoDigitsNumber(chronometer.getMinutes())[1] +\n \":\" +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[0] +\n chronometer.twoDigitsNumber(chronometer.getSeconds())[1];\n listToComplete.appendChild(splitToAdd);\n}", "function playOneSegment(videoSrc, inPoint, outPoint) {\n video.src = videoSrc\n video.load\n video.currentTime = inPoint\n video.play()\n video.ontimeupdate = function () {\n stopAtOutPoint()\n }\n counter += 1\n }", "function Segment(t,e,n){this.path=t,this.length=t.getTotalLength(),this.path.style.strokeDashoffset=2*this.length,this.begin=e?this.valueOf(e):0,this.end=n?this.valueOf(n):this.length,this.timer=null,this.draw(this.begin,this.end)}", "function fireSelectedEvent(){\n\t\t\tvar x1 = (selection.first.x <= selection.second.x) ? selection.first.x : selection.second.x;\n\t\t\tvar x2 = (selection.first.x <= selection.second.x) ? selection.second.x : selection.first.x;\n\t\t\tvar y1 = (selection.first.y >= selection.second.y) ? selection.first.y : selection.second.y;\n\t\t\tvar y2 = (selection.first.y >= selection.second.y) ? selection.second.y : selection.first.y;\n\t\t\t\n\t\t\tx1 = xaxis.min + x1 / hozScale;\n\t\t\tx2 = xaxis.min + x2 / hozScale;\n\t\t\ty1 = yaxis.max - y1 / vertScale;\n\t\t\ty2 = yaxis.max - y2 / vertScale;\n\n\t\t\ttarget.fire('flotr:select', [ { x1: x1, y1: y1, x2: x2, y2: y2 } ]);\n\t\t}", "function selectShape() {\n instrumentMode = 2 // we are in track_mode!\n selectedShape = maxNumShapes;\n //if you press for 2 seconds you create a new track\n if(instrumentMode != 0){\n myTimeout = setTimeout(function() {\n maxNumShapes = maxNumShapes + 1;\n updateArrays();\n }, 2000);\n}\n}", "function startTrioSelection() {\n // action button: cancel trio selection\n setAction(\"Cancel\", \"cancel_trio\");\n // toggle board and cards to selectable mode\n $(\"#board\").addClass(\"select\");\n $(\".card\").click(selectCard);\n // start timer\n var timer = $(\"#timer\");\n timer\n .removeClass(\"hidden\")\n .text(5);\n clockId = setInterval(function() {\n timer\n .text(Number.parseInt(timer.text())-1);\n }, 1000);\n}", "function selectPoint(lnxgraph, point) {\n var isFirstSelection = lnxgraph.selected.length == 0;\n if (isFirstSelection) {\n setClearSelectionsButtonVisible(lnxgraph.div, true);\n }\n var traces = graphElement(lnxgraph.div).data;\n var traceupdates = traces.reduce(function (res, trace) {\n if (trace.selectedindexes) {\n res.push([...trace.selectedindexes]);\n } else {\n res.push([]);\n }\n return res;\n }, []);\n var update = {\n traces: traces,\n annotations: getInitialAnnotations(lnxgraph),\n traceupdates: traceupdates,\n };\n selectPointRecursive(lnxgraph, update, point, true);\n var dataUpdate = { selectedindexes: update.traceupdates };\n var layoutUpdate = getAnnotationsLayoutUpdate(lnxgraph, update.annotations);\n var traceIndices = [...Array(traceupdates.length).keys()];\n Plotly.update(lnxgraph.div, dataUpdate, layoutUpdate, traceIndices);\n // maybe highlight new selections\n if (!isHighlightButtonActive(lnxgraph.div)) {\n highlightUnselected(lnxgraph, false);\n }\n}", "get timeSlicingMode() {}", "function setActiveTimestep( j ) {\n\t activeTimestep = j;\n\t if ( json == null ) return; // incase we've not received data yet\n\n var sections = json.sections;\n\n\t // Next, foreach el, find the corresponding segment and update the stroke\n\t // FIXME: THIS IS A HACK ATTACK!\n\t d3.select(container).select('#segments')\n\t .selectAll('path[id]')\n\t .style('stroke',function(d) {\n\t\t var id = d3.select(this).attr('id');\n\t\t var si = json.getSectionIndex(id);\n\t\t var x = json.data[si][j];\n\t\t if ( x.p_j_m > 0 && x.p_j_m < 1 ) {\n\t\t d3.select(this).classed('datapoor',true);\n\t\t return \"\";\n\t\t } else {\n\t\t d3.select(this).classed('datapoor',false);\n\t\t return color(json.data[si][j].spd)\n\t\t }\n\t });\n\n\t /*\n\t d3.select(container).select('#ends')\n\t .selectAll('circle[id]')\n\t .style('fill',function(d) {\n\t var id = d3.select(this).attr('id');\n\t var nodsec = id.split(\":\");\n\t var si = json.getSectionIndex(nodsec[1]);\n\t return json.data[si][j].inc ? \"blue\" : d3.select(this).style('fill');\n\t });\n\t */\n\t d3.select(container).select('#ends')\n\t .selectAll('path[id]')\n\t .style('fill',function(d) {\n\t\t var id = d3.select(this).attr('id');\n\t\t var nodsec = id.split(\":\");\n\t\t var si = json.getSectionIndex(nodsec[1]);\n\t\t return json.data[si][j].inc ? \"blue\" : color(json.data[si][j]);\n\t });\n\n\t // finally, update the map text\n\t d3.select(\"#maptext\")\n\t .text(json.timesteps[j]);\n }", "function moveBoundaries(selected,time,bound,event){\n\t\tvar tl = this.tl,\n\t\t\toldTimes = selected.map(function(seg){ return seg[bound]; }),\n\t\t\tnewTimes = selected.map(function(_){ return time; });\n\n\t\tfunction setBoundaries(times){\n\t\t\tvar activechange = false;\n\t\t\tselected.forEach(function(seg,i){\n\t\t\t\tvar active = seg.active;\n\t\t\t\tseg[bound] = times[i];\n\t\t\t\tactivechange = activechange || (active !== seg.active);\n\t\t\t\ttl.emit(new Timeline.Event(event, {segment: seg}));\n\t\t\t});\n\t\t\tif(activechange){\n\t\t\t\tthis.textTrack.activeCues.refreshCues();\n\t\t\t\ttl.emit(new Timeline.Event('activechange'));\n\t\t\t}\n\t\t\ttl.renderTrack(this);\n\t\t}\n\n\t\ttl.commandStack.push({\n\t\t\tfile: this.textTrack.label,\n\t\t\tcontext: this,\n\t\t\tredo: setBoundaries.bind(this, newTimes),\n\t\t\tundo: setBoundaries.bind(this, oldTimes)\n\t\t});\n\n\t\tsetBoundaries.call(this, newTimes);\n\t}", "partition(time, key, insertLeft) {\n this.key = insertLeft ? key : SETINEL_NAME;\n let rightKey = insertLeft ? SETINEL_NAME : key;\n let prevRight = this.right;\n this.right = new Node(rightKey, time);\n this.right.left = this;\n this.right.right = prevRight;\n prevRight.left = this.right;\n }", "function processTimeSelection(x, y, clicked) {\n\t\t\t\tvar selectorAngle = (360 * Math.atan((y - clockCenterY)/(x - clockCenterX)) / (2 * Math.PI)) + 90;\n\t\t\t\tvar selectorLength = Math.sqrt(Math.pow(Math.abs(x - clockCenterX), 2) + Math.pow(Math.abs(y - clockCenterY), 2));\n\t\t\t\t\n\t\t\t\tvar hour = 0;\n\t\t\t\tvar min = 0;\n\t\t\t\tif ((new RegExp('^([0-9]{2}):([0-9]{2})$')).test(inputElement.val())) {\n\t\t\t\t\thour = parseInt(RegExp.$1);\n\t\t\t\t\tmin = parseInt(RegExp.$2);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (selectionMode == 'HOUR') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 30);\n\t\t\t\t\tvar h = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 28) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle == 0) h = 12;\n\t\t\t\t\t\t\telse h = selectorAngle;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 6;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if (selectorLength < clockRadius - 28 && selectorLength > clockRadius - 65) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tif (selectorAngle != 0) h = selectorAngle + 12;\n\t\t\t\t\t\t\telse h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\th = selectorAngle + 18;\n\t\t\t\t\t\t\tif (h == 24) h = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (h > -1) {\n\t\t\t\t\t\tvar newVal = (h < 10 ? '0' : '') + h + ':' + (min < 10 ? '0' : '') + min;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockHourCanvas(h == 0 ? 24 : h);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockHourCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse if (selectionMode == 'MINUTE') {\n\t\t\t\t\tselectorAngle = Math.round(selectorAngle / 6);\n\t\t\t\t\tvar m = -1;\n\t\t\t\t\tif (selectorLength < clockRadius + 10 && selectorLength > clockRadius - 40) {\n\t\t\t\t\t\tif (x - clockCenterX >= 0) {\n\t\t\t\t\t\t\tm = selectorAngle;\n\t\t\t\t\t\t} else if (x - clockCenterX < 0) {\n\t\t\t\t\t\t\tm = selectorAngle + 30;\n\t\t\t\t\t\t\tif (m == 60) m = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (m > -1) {\n\t\t\t\t\t\tvar newVal = (hour < 10 ? '0' : '') + hour + ':' + (m < 10 ? '0' : '') + m;\n\t\t\t\t\t\tif (isDragging || clicked) {\n\t\t\t\t\t\t\tvar oldVal = inputElement.val();\n\t\t\t\t\t\t\tif (newVal != oldVal && settings.vibrate) navigator.vibrate(10);\n\t\t\t\t\t\t\tinputElement.val(newVal);\n\t\t\t\t\t\t\tif (newVal != oldVal) {\n\t\t\t\t\t\t\t\tsetTimeout(function() {\n\t\t\t\t\t\t\t\t\tsettings.onChange(newVal, oldVal);\n\t\t\t\t\t\t\t\t\tif (changeHandler) changeHandler(event);\n\t\t\t\t\t\t\t\t}, 10);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\trepaintClockMinuteCanvas(m == 0 ? 60 : m);\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\trepaintClockMinuteCanvas();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}", "function createNewPath(segment) {\n var startX = segment.endX;\n var startY = segment.endY;\n var endX = segment.endX + segment.length;\n var endY = segment.endY;\n var newPath = new fabric.Line(\n [startX, startY, endX, endY],\n {\n member: '',\n strokeWidth: 10,\n stroke: '#999797',\n originX: 'center',\n originY: 'center',\n lockScalingY: true,\n lockRotation: true,\n hasBorders: false,\n cornerSize: 4,\n cornerStyle: 'circle',\n subTargetCheck: true\n });\n canvas.add(newPath);\n pathCount++;\n if (pathCount < 10) {newPath.member = 'seg0'+ pathCount; }\n else {newPath.member = 'seg' + pathCount; }//name a segment\n //create a segment object and store it in segArray\n var newSegment = new Segment(newPath.member, startX, startY, endX, endY, curvage, superElevation, numberOfFeatures);\n segArray.push(newSegment);\n createSegmentForm(newSegment);\n newPath.on('mousedown', function(event) {\n var active = canvas.getActiveObject();\n var object = compareSegment(active);\n if (event.e.altKey === true) {createNewPath(object); }\n });\n} //end createNewPath", "changeSegment(value){\n this.setState({\n dailyOpen: value,\n loading: true,\n }, () => this.setState({loading: false}));\n }", "function logSelection(){\n const selectedChild = document.getElementById('time');\n selectedChild.addEventListener('change', () => {\n const current = selectedChild.value; \n if(current != 'null'){\n selectedChild.style.color = '#767575';\n }else{\n selectedChild.style.color = '#d1d1d1';\n }\n })\n \n}", "_selectLineAt(line) {\n const wrappedRange = this._bufferService.buffer.getWrappedRangeForLine(line);\n this._model.selectionStart = [0, wrappedRange.first];\n this._model.selectionEnd = [this._bufferService.cols, wrappedRange.last];\n this._model.selectionStartLength = 0;\n }", "function selectPoint(element) {\n var elementInfo = $A(element.id.split(\"_\"));\n pointInfoRequest({\n requestingMethod: \"LearningCurve.selectPoint\",\n datasetId: dataset,\n sampleId: elementInfo[0],\n oppNo: elementInfo[1] });\n}", "function bindSelect() {\n initializeTimeFunction();\n extent = brush.extent(); //data of selection\n userTimeData = [];\n\n extent.forEach(function (element) {\n var t = String(element.getTime() / 1000 * 1000);\n userTimeData.push(t);\n });\n\n if ($scope.fingerPrintsMode) {\n clearFingerprintHeatmap();\n $scope.showFingerprintHeatmap();\n document.getElementById(\"fingerPrints-mode\").classList.add('quickaction-selected');\n }\n\n if ($scope.radioHeatmapRSSMode) {\n clearFingerprintCoverage();\n $scope.showFingerprintCoverage();\n $scope.radioHeatmapRSSMode = true;\n if (typeof (Storage) !== \"undefined\" && localStorage) {\n localStorage.setItem('radioHeatmapRSSMode', 'YES');\n }\n $scope.anyService.radioHeatmapRSSMode = true;\n document.getElementById(\"radioHeatmapRSS-mode\").classList.add('quickaction-selected');\n }\n }", "function getSelectedSegments(report) {\n var segments = [];\n if(report.segmentation) {\n report.tab.find('.segment-' + report.segmentation + ' .segment-toggle:checked').each(function() {\n segments.push($(this).val());\n });\n }\n return segments;\n}", "function findSegmentIndex(t, parameterSubdivision)\n{\n var x = t;\n var index = 0;\n var rawX = t;\n\n for(var i = 0; i < parameterSubdivision.length; i++)\n {\n if(x - parameterSubdivision[i] < 0)\n {\n index = i + 1;\n x = THREE.Math.clamp(x / parameterSubdivision[i], 0, 1);\n break;\n }\n else\n {\n x -= parameterSubdivision[i];\n rawX -= parameterSubdivision[i];\n }\n }\n\n return [index, x, rawX];\n}", "function selectSegments(numOfColumns) {\n const segments = [];\n const secondSegments = [];\n\n for(let i=0; i<numOfColumns; i++){\n segments.push(document.querySelector(`.${createColumnsName().segmentsName[i]}`));\n secondSegments.push(document.querySelector(`.${createColumnsName().secondSegmentsName[i]}`));\n }\n\n return {segments, secondSegments}\n}", "getLineSegment(iLine) {\n const nPoint = this.nLine[iLine]\n const nPoint2 = this.nLine[iLine+1]\n // First make sure we have a segment\n if ((nPoint !== -1) && (nPoint2 !== -1)) {\n const segment = new Segment()\n segment.x1 = this.xPoints[nPoint]\n segment.y1 = this.yPoints[nPoint]\n segment.x2 = this.xPoints[nPoint2]\n segment.y2 = this.yPoints[nPoint2]\n return segment\n }\n return null\n }", "function select() {\n var el = d3.select(this);\n var thislabel = el.node().__data__;\n var indx = _.indexOf(data.columnLabels, thislabel);\n var indy = _.indexOf(data.rowLabels, thislabel);\n if (indx > -1) {\n selectedx = getselected(selectedx, indx)\n }\n if (indy > -1) {\n selectedy = getselected(selectedy, indy)\n }\n draw()\n }", "goToSelected () {\n this.path = this.selectedPath;\n }", "function makeSelection(point, pSelection) {\n\t\t//alert(pSelection);\n\t\t//add clicked point to qPoint/tPoint\n\t\tif(pSelection != null){\n\t\t\tif(pSelection == 1){\n\t\t\t\tif(qPoint){\n\t\t\t\t\tqPoint.select(false, true);\n\t\t\t\t}\n\t\t\t\tqPoint = point;\n\t\t\t}\n\t\t\telse if(pSelection == 0){\n\t\t\t\tif(tPoint){\n\t\t\t\t\ttPoint.select(false, true);\n\t\t\t\t}\n\t\t\t\ttPoint = point;\n\t\t\t}\n\t\t\tpoint.select(true, true);\n\t\t} //else null without any selection, do nothing\t\n\t\tmakeQTText();\n }", "function selectTok(e) {\n if (e.buttons === 3 || e.buttons === 1) {\n var tok = $(this);\n var tok_id = parseInt(tok.attr(\"id\").substring(3));\n\n if (row_selected) {\n var tok_list = signals[id][index].tokens;\n if (tok_list.indexOf(tok_id) === -1) {\n tok_list.push(tok_id);\n tok.addClass(\"tok--selected\");\n }\n } else {\n if (!tok.hasClass(\"tok--selected\")) {\n tok.addClass(\"tok--selected\");\n }\n }\n }\n }", "function getSelectedLayoutSegmentPath(tree, parallelRouteKey, first = true, segmentPath = []) {\n let node;\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey];\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1];\n var _children;\n node = (_children = parallelRoutes.children) != null ? _children : Object.values(parallelRoutes)[0];\n }\n if (!node) return segmentPath;\n const segment = node[0];\n const segmentValue = Array.isArray(segment) ? segment[1] : segment;\n if (!segmentValue) return segmentPath;\n segmentPath.push(segmentValue);\n return getSelectedLayoutSegmentPath(node, parallelRouteKey, false, segmentPath);\n}", "function selectBelow(sel){\n\tvar MAX = sel.length;\n\t for (var x=0;x<MAX;x++)\n\t {\n\t\t// alert(\"now processing:\"+sel[x].typename);\n\t\tif(sel[x].locked == true){\n\t\t\tif (includeLocked)\n\t\t\t{\n\t\t\t\tsel[x].locked = false;\n\t\t\t} else {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\n\t\t}\n\t\ttry{\n sel[x].selected = true;\n\t\t}\n\t\tcatch(e){\n // on a locked layer...\n\t\t}\n\n\t\t//=========normal pathitem=============\n\t\tif (sel[x].typename == \"PathItem\")\n\t\t{\t\t\t \n\t\t\t\t//pointTextRef.top = sel[x].top;\n\t\t\t\t//pointTextRef.left = sel[x].left;\n\t\t\t\t//pointTextRef.contents = \"Processing item \"+x+\" of \"+MAX;\n\t\t\t\t\t if (myVersion <= 12){redraw();}\n\t\t\t\t//redraw();\n\t\t\t\tb.label(\"Processing item \"+x+\" of \"+MAX);\n\t\t\t\tb.update(x);\n\t\t\t\tb.show();\n\t\t\t\tcheckThreshold(sel[x],dims);\n\t\t\t \n\t\t} else {\n\t\t \n\t\t\t//not a pathitem, dont care...\n\t\t\tsel[x].selected = false;\n\t\t}\n\t}\n }", "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}", "selectCard(e) {\n if (this.state.time.s > 0 && this.state.isIdle === false) {\n this.setState({\n prevCard: '',\n p1Select: e})\n }\n }", "function select () {\r\n\t\t\t\tthis.tool.select();\r\n\t\t\t}", "_selectHandler(params) {\n var id = params[0], state = params[1], selected = this.state.selected;\n\n if (state === true) {\n if (!selected[id]) selected[id] = LocalStore.getById(id);\n } else {\n if (selected[id]) delete selected[id];\n }\n this.setState({mainBlock: LocalStore.getLast(), selected: selected});\n }", "function selectLine(line){\n console.log(\"Line \"+line+\" is selected.\")\n global.selectedLine = line;\n refreshLineChoiceText();\n // empty table\n global.updateTableData(global.tripDatatable);\n // gets data in table\n ajaxCallTrips(line);\n }", "function select (id) {\n\n console.log (\"object click\");\n setScaleFactor ();\n nowX = dot.ox; nowY = dot.oy;\n nowX = Math.round(nowX / gridSnapSize) * gridSnapSize;\n nowY = Math.round(nowY / gridSnapSize) * gridSnapSize;\n dot.attr({ cx: nowX, cy: nowY });\n console.log(\"cx = \" + nowX);\n console.log(\"cy = \" + nowY);\n SelectedObjectPointId = id;\n\n\n }", "function SegmentBaseGetter(config) {\n config = config || {};\n var timelineConverter = config.timelineConverter;\n var instance;\n\n function checkConfig() {\n if (!timelineConverter || !timelineConverter.hasOwnProperty('calcPeriodRelativeTimeFromMpdRelativeTime')) {\n throw new Error(_streaming_constants_Constants__WEBPACK_IMPORTED_MODULE_1__[\"default\"].MISSING_CONFIG_ERROR);\n }\n }\n\n function getSegmentByIndex(representation, index) {\n checkConfig();\n\n if (!representation) {\n return null;\n }\n\n var len = representation.segments ? representation.segments.length : -1;\n var seg;\n\n if (index < len) {\n seg = representation.segments[index];\n\n if (seg && seg.availabilityIdx === index) {\n return seg;\n }\n }\n\n for (var i = 0; i < len; i++) {\n seg = representation.segments[i];\n\n if (seg && seg.availabilityIdx === index) {\n return seg;\n }\n }\n\n return null;\n }\n\n function getSegmentByTime(representation, requestedTime) {\n checkConfig();\n var index = getIndexByTime(representation, requestedTime);\n return getSegmentByIndex(representation, index);\n }\n\n function getIndexByTime(representation, time) {\n if (!representation) {\n return -1;\n }\n\n var segments = representation.segments;\n var ln = segments ? segments.length : null;\n var idx = -1;\n var epsilon, frag, ft, fd, i;\n\n if (segments && ln > 0) {\n for (i = 0; i < ln; i++) {\n frag = segments[i];\n ft = frag.presentationStartTime;\n fd = frag.duration;\n epsilon = fd / 2;\n\n if (time + epsilon >= ft && time - epsilon < ft + fd) {\n idx = frag.availabilityIdx;\n break;\n }\n }\n }\n\n return idx;\n }\n\n instance = {\n getSegmentByIndex: getSegmentByIndex,\n getSegmentByTime: getSegmentByTime\n };\n return instance;\n}", "select() {\n this._stepper.selected = this;\n }", "focusTimelineOfSelectedClip() {\n if (this.selection.getSelectedObject() instanceof Wick.Clip) {\n this.focus = this.selection.getSelectedObject();\n }\n }", "function onSelect()\n\t{\n\t\tunit.div.toggleClass(\"selected\", unit.movePoints > 0);\n\t}", "function SelectionRegion() {}", "function SelectionRegion() {}", "breakApartSelection() {\n var leftovers = [];\n var clips = this.selection.getSelectedObjects('Clip');\n this.selection.clear();\n clips.forEach(clip => {\n leftovers = leftovers.concat(clip.breakApart());\n });\n leftovers.forEach(object => {\n this.selection.select(object);\n });\n }", "function selectDate(event) { \r\n if (event.target !== this){\r\n var newDate = new Date(getRootDate());\r\n newDate.setDate(event.target.textContent);\r\n setRootDate(newDate);\r\n calendar.getElementsByClassName('vjsdate-day-selected')[0].classList.remove('vjsdate-day-selected');\r\n calendar.getElementsByClassName('vjsdate-day' + newDate.getDate())[0].classList.add('vjsdate-day-selected');\r\n }\r\n listHour.dispatchEvent(new Event('change'));\r\n }", "mouseSelect(evt, point) {\n evt.preventDefault();\n const block = this.topBlockAt(point);\n if (block) {\n // select the construct if not already the selected construct ( changing\n // the construct will remove blocks that are not part of the construct from the selections )\n if (this.constructViewer.props.construct.id !== this.constructViewer.props.ui.currentConstructId) {\n this.constructViewer.constructSelected(this.constructViewer.props.construct.id);\n }\n\n const node = this.layout.nodeFromElement(block);\n if (evt.shiftKey || window.__e2eShiftKey) {\n // range select\n this.constructViewer.blockAddToSelections([block]);\n } else\n if (evt.metaKey || evt.altKey) {\n // toggle block in selections\n this.constructViewer.blockToggleSelected([block]);\n } else {\n // otherwise single select the block\n this.constructViewer.blockSelected([block]);\n // if they clicked the context menu area, open it\n // for now, open a context menu\n const globalPoint = this.mouseTrap.mouseToGlobal(evt);\n if (this.getBlockRegion(block, globalPoint) === 'dots') {\n this.constructViewer.openPopup({\n blockPopupMenuOpen: true,\n menuPosition: globalPoint,\n });\n }\n }\n } else {\n // select construct if no block clicked and deselect all blocks\n this.constructViewer.blockSelected([]);\n this.constructViewer.constructSelected(this.constructViewer.props.constructId);\n }\n }", "function getInSegment(path, time) {\n\tlet index,\n\t\tpair = [];\n\n\tindex = path.findIndex(([locationTime]) => {\n\t\treturn (locationTime >= time);\n\t});\n\n\t// Ensure there are always two coordinates. Return empty otherwise.\n\tif (index < path.length - 1) {\n\t\tpair = [path[index][1], path[index + 1][1]];\n\t}\n\n\treturn pair;\n}", "select() {\n\t\tthis.inputView.select();\n\t}", "select(id) { this._updateActiveId(id, false); }", "function highlight(target, index){\n\t\tvar opts = $.data(target, 'timespinner').options;\n\t\tif (index != undefined){\n\t\t\topts.highlight = index;\n\t\t}\n\t\tvar range = opts.selections[opts.highlight];\n\t\tif (range){\n\t\t\tvar tb = $(target).timespinner('textbox');\n\t\t\t$(target).timespinner('setSelectionRange', {start:range[0],end:range[1]});\n\t\t\ttb.focus();\n\t\t}\n\t}" ]
[ "0.7093804", "0.6068697", "0.60346407", "0.5950914", "0.56174904", "0.56151795", "0.5594618", "0.5548036", "0.553676", "0.5416807", "0.5397532", "0.5369994", "0.53435373", "0.53273463", "0.531828", "0.5265542", "0.5252907", "0.5221186", "0.51980644", "0.51615274", "0.5142735", "0.51403546", "0.51345974", "0.5129729", "0.5126489", "0.5108799", "0.50827116", "0.50655556", "0.50655556", "0.50655556", "0.50627154", "0.5037791", "0.5025575", "0.5007902", "0.500415", "0.49948245", "0.49711367", "0.4966173", "0.49635905", "0.49600706", "0.49592245", "0.49564892", "0.4956148", "0.49510998", "0.4928199", "0.49242264", "0.49089015", "0.49083114", "0.48956183", "0.48623005", "0.48519695", "0.485054", "0.4846986", "0.48342448", "0.48199496", "0.48102823", "0.48042426", "0.48018283", "0.4786993", "0.4786549", "0.47794667", "0.47757095", "0.4775453", "0.47700012", "0.47642788", "0.47625512", "0.47524798", "0.47381645", "0.4737667", "0.47356367", "0.47335863", "0.47305492", "0.47283188", "0.47263604", "0.47258097", "0.47188905", "0.4715039", "0.47129428", "0.47107705", "0.47099498", "0.47089514", "0.4707369", "0.4705789", "0.4694292", "0.468967", "0.46892968", "0.468846", "0.46719667", "0.46683347", "0.46677563", "0.46674213", "0.46629068", "0.46629068", "0.46594667", "0.46542516", "0.46534178", "0.46376967", "0.46276638", "0.46218562", "0.4614913" ]
0.67163014
1
selects the split segment with the number number
function selectSegmentListElement(number, dblClick) { dblClick = dblClick ? dblClick : false; if (!continueProcessing && editor.splitData && editor.splitData.splits) { var spltItem = editor.splitData.splits[number]; if (spltItem) { setCurrentTime(spltItem.clipBegin); currSplitItemClickedViaJQ = true; if ($('#splitItemDiv-' + number)) { if (dblClick) { $('#splitItemDiv-' + number).dblclick(); } else { $('#splitItemDiv-' + number).click(); // TODO } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jumpToSegment() {\n if (editor.splitData && editor.splitData.splits) {\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n\n setCurrentTime(editor.splitData.splits[id].clipBegin);\n }\n}", "function nextSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id + 1;\n\n new_id = (new_id >= editor.splitData.splits.length) ? 0 : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id >= (editor.splitData.splits.length - 1)) ? 0 : new_id;\n\n for (var i = new_id + 1; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = 0; i < new_id; ++i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function findSegmentIndex(t, parameterSubdivision)\n{\n var x = t;\n var index = 0;\n var rawX = t;\n\n for(var i = 0; i < parameterSubdivision.length; i++)\n {\n if(x - parameterSubdivision[i] < 0)\n {\n index = i + 1;\n x = THREE.Math.clamp(x / parameterSubdivision[i], 0, 1);\n break;\n }\n else\n {\n x -= parameterSubdivision[i];\n rawX -= parameterSubdivision[i];\n }\n }\n\n return [index, x, rawX];\n}", "function selectSplitTotal(){\n \n}", "function splitButtonClick() {\n if (!continueProcessing && editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n\n splitItem.clipBegin = parseFloat(splitItem.clipBegin);\n splitItem.clipEnd = parseFloat(splitItem.clipEnd);\n if ((splitItem.clipBegin < currentTime) && (currentTime < splitItem.clipEnd)) {\n newEnd = 0;\n if (editor.splitData.splits.length == (i + 1)) {\n newEnd = splitItem.clipEnd;\n } else {\n newEnd = editor.splitData.splits[i + 1].clipBegin;\n }\n var newItem = {\n clipBegin: parseFloat(currentTime),\n clipEnd: parseFloat(newEnd),\n enabled: true\n }\n\n splitItem.clipEnd = currentTime;\n editor.splitData.splits.splice(i + 1, 0, newItem);\n // TODO Make splitSegments clickable when zoomed in\n editor.updateSplitList(false, !zoomedIn());\n selectSegmentListElement(i + 1);\n return;\n }\n }\n }\n selectCurrentSplitItem();\n}", "function selectSegments(numOfColumns) {\n const segments = [];\n const secondSegments = [];\n\n for(let i=0; i<numOfColumns; i++){\n segments.push(document.querySelector(`.${createColumnsName().segmentsName[i]}`));\n secondSegments.push(document.querySelector(`.${createColumnsName().secondSegmentsName[i]}`));\n }\n\n return {segments, secondSegments}\n}", "split() {\n let w = this.range.Width / 2;\n let h = this.range.Height / 2;\n this.LL = new RectQuadTree(\n new Rect(this.range.x1, this.range.y1, this.range.x1 + w, this.range.y1 + h));\n this.LH = new RectQuadTree(\n new Rect(this.range.x1 + w, this.range.y1, this.range.x2, this.range.y1 + h));\n this.HL = new RectQuadTree(\n new Rect(this.range.x1, this.range.y1 + h, this.range.x1 + w, this.range.y2));\n this.HH = new RectQuadTree(\n new Rect(this.range.x1 + w, this.range.y1 + h, this.range.x2, this.range.y2));\n\n this._isSplit = true;\n }", "function selectScrutinee(id, matches, state, num) {\r\n if(num < 0) {\r\n return id;\r\n }\r\n if(num < matches.length) {\r\n return matches[num];\r\n }\r\n if(num >= 100) {\r\n num = num - 100;\r\n var parts = state.split(\".\");\r\n parts.unshift(state);\r\n if(num < parts.length) {\r\n return parts[num];\r\n }\r\n }\r\n return null;\r\n }", "function split(numList) {\n let midpoint = numList.length / 2\n let splitList = {}\n splitList.left = numList.slice(0,midpoint)\n splitList.right = numList.splice(midpoint, numList.length)\n console.log(\"Splitting: \" + splitList.left + \",\" + splitList.right + \" into \" + splitList.left + \" and \" + splitList.right)\n return splitList\n}", "splitNum(num) {\n var arr = [];\n for (let i = num.length; i > 0; i--) {\n var substr = num.substring(0, i);\n arr.push(substr);\n }\n return arr;\n }", "function Segment(seg, desired)\n{\n\tthis.name = seg;\n\tthis.desired = desired;\n this.digit_pos = 0;\n \n this.setDigitPos = function(digit_pos)\n {\n this.digit_pos = digit_pos;\n }\n}", "function previousSegment() {\n if (editor.splitData && editor.splitData.splits) {\n var playerPaused = getPlayerPaused();\n if (!playerPaused) {\n pauseVideo();\n }\n var currSplitItem = getCurrentSplitItem();\n var new_id = currSplitItem.id - 1;\n new_id = (new_id < 0) ? (editor.splitData.splits.length - 1) : new_id;\n\n var idFound = true;\n if ((new_id < 0) || (new_id >= editor.splitData.splits.length)) {\n idFound = false;\n }\n /*\n\telse if (!editor.splitData.splits[new_id].enabled) {\n idFound = false;\n new_id = (new_id <= 0) ? editor.splitData.splits.length : new_id;\n for (var i = new_id - 1; i >= 0; --i) {\n\n if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n }\n }\n }\n\t*/\n if (!idFound) {\n for (var i = editor.splitData.splits.length - 1; i >= 0; --i) {\n // if (editor.splitData.splits[i].enabled) {\n new_id = i;\n idFound = true;\n break;\n // }\n }\n }\n\n if (idFound) {\n selectSegmentListElement(new_id, !playerPaused);\n }\n if (!playerPaused) {\n playVideo();\n }\n }\n}", "function splitSentence(split_id){\n //1 split the sentence display\n var sentence_id = parseInt(split_id.split(\".\")[0]),\n word_id = parseInt(split_id.split(\".\")[1]);\n\n var sentence = getSentence(sentence_id-1).split(\" \");\n console.log(sentence)\n //\n var sentence_part1 = sentence.slice(0,word_id).join(\" \"),\n sentence_part2 = sentence.slice(word_id+1,sentence.length).join(\" \");\n\n var part1_html = \"<div><h3>Subsentence Part 1</h3>\" + sentence_part1 + \"</div>\";\n var part2_html = \"<div><h3>Subsentence Part 2</h3>\" + sentence_part2 + \"</div>\";\n\n $('#selected-sentence').append(part1_html);\n $('#selected-sentence').append(part2_html);\n\n //add subsentence classification to the rubrick\n\n addClassification('#classification_selection');\n\n}", "getBlock($number, $index) {\n return $number.substr($index, 2);\n }", "getSegments() {\n return this.version\n .match(/[0-9]+|[a-z]+/gi)\n .map((s) => (/^\\d+$/.test(s) ? Number(s) : s));\n }", "function splitOnVal(list, num) {\n let current = list.head,\n newList = new SinglyList(),\n found = false,\n previous;\n if (!current) {\n // list is empty, return null:\n console.log(null);\n return null;\n }\n // loop through list:\n while (current.next) {\n if (current.val === num) {\n // num found, split list:\n newList.head = current;\n // Set previous node's next to null (since node before this is now an end node):\n if (previous) {\n // set previous to null:\n previous.next = null;\n }\n found = true;\n }\n previous = current;\n current = current.next;\n }\n // now we are on last node, check if val:\n if (current.val === num) {\n // split list at last node:\n newList.head = current;\n previous.next = null; // set previous node's next to null:\n found = true;\n }\n\n if (!found) {\n console.log(\"Value does not exist in list.\");\n return null;\n }\n\n // return latter half of list:\n console.log(newList);\n return newList;\n}", "function SplitIndex(s) {\n var spl = s.split(';#');\n this.id = parseInt(spl[0], 10);\n this.value = spl[1];\n }", "function selectCurrentSplitItem(excludeDeletedSegments) {\n if (!continueProcessing && !isSeeking) {\n excludeDeletedSegments = excludeDeletedSegments || false;\n\n var splitItem = getCurrentSplitItem();\n\n if (splitItem != null) {\n var idFound = false;\n var id = -1;\n if (excludeDeletedSegments) {\n if (splitItem.enabled) {\n id = splitItem.id;\n idFound = true;\n } else if (editor.splitData && editor.splitData.splits) {\n for (var i = splitItem.id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n if (!idFound) {\n for (var i = splitItem.id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n idFound = true;\n id = i;\n break;\n }\n }\n }\n }\n } else {\n id = splitItem.id;\n idFound = true;\n }\n if (idFound) {\n currSplitItemClickedViaJQ = true;\n if (!zoomedIn()) {\n $('#splitSegmentItem-' + id).click();\n }\n lastId = -1;\n $('#descriptionCurrentTime').html(formatTime(getCurrentTime()));\n } else {\n ocUtils.log(\"Could not find an enabled ID\");\n }\n }\n }\n}", "function splitAt_(insertPosition) {\n \n}", "getSlice (lineNumber, numLines) {\n\t\tlet lines = this.output.split('\\n');\n\t\tlet segment = lines.slice(lineNumber, lineNumber + numLines);\n\t\treturn segment.join('\\n');\n\t}", "_split(insertPath, level) {\n const node = insertPath[level];\n const M = node.children.length;\n const m = this._minEntries;\n\n this._chooseSplitAxis(node, m, M);\n\n const splitIndex = this._chooseSplitIndex(node, m, M);\n\n const newNode = createNode(node.children.splice(splitIndex, node.children.length - splitIndex));\n newNode.height = node.height;\n newNode.leaf = node.leaf;\n\n calcBBox(node, this.toBBox);\n calcBBox(newNode, this.toBBox);\n\n if (level) insertPath[level - 1].children.push(newNode);\n else this._splitRoot(node, newNode);\n }", "getRelevantFormatSection(sections, number) {\n const that = this,\n compareResult = that.numericProcessor.compare(number, 0, true);\n\n if (compareResult === 1) {\n return sections[0];\n }\n\n let negativeNumberGroup, zeroGroup;\n\n if (sections.length >= 3) {\n that._ignoreMinus = true;\n negativeNumberGroup = 1;\n zeroGroup = 2;\n }\n else if (sections.length === 2) {\n that._ignoreMinus = true;\n zeroGroup = 0;\n negativeNumberGroup = 1;\n }\n else if (sections.length === 1) {\n zeroGroup = 0;\n negativeNumberGroup = 0;\n }\n\n if (compareResult === 0) {\n return sections[zeroGroup];\n }\n\n if (compareResult === -1) {\n return sections[negativeNumberGroup];\n }\n }", "function displayDigit(digit, number) {\n $(digit).find('.lit').removeClass('lit');\n digitDisplaySegments[number].forEach(function (segment) {\n $(digit).find('.' + segment).addClass('lit');\n });\n}", "function segments(n, segSize) {\n return range(segSize, n, segSize).map(min => [min + 1, Math.min(min + segSize, n)]);\n}", "function selectOptionInSelector(num) {\n let number = num;\n selectorSlide.selectedIndex = num;\n}", "function _split( x ) {\n if (x > _splitbound || x < -_splitbound) {\n var y = x * _twomin28;\n var t = y * _splitter;\n var hi = t - (t - y);\n var lo = y - hi;\n return { hi: hi*_two28, lo: lo*_two28 };\n }\n else {\n var t = x * _splitter;\n var hi = t - (t - x);\n var lo = x - hi;\n return { hi: hi, lo: lo };\n }\n}", "_getRigthSplit (columns, id) {\n var rightSplit = 0;\n if (id) {\n rightSplit = 1;\n for(var index = 0; index <columns.length;index++) {\n if(columns[index].id == id){\n rightSplit = columns.length - index;\n break;\n }\n }\n }\n return rightSplit;\n }", "function split() {\n\n\t// Set selected to new domain\n\tfor (var i=0; i < data.nodes.length; i++) {\n\t\tif (data.nodes[i].selected) data.nodes[i].domain = 1;\n\t}\n\t\n\tnum_domains = 1; \n\t\n\t// Rebind to data and redraw\n\tupdate();\n}", "function inhaleSelection(number) {\n if (number == 1) {\n return 7\n }\n else if (number == 2) {\n return 7\n }\n else if (number == 3) {\n return 6\n }\n else if (number == 4) {\n return 6\n }\n else if (number == 5) {\n return 5\n }\n else if (number == 6) {\n return 5\n }\n else if (number == 7) {\n return 5\n }\n else if (number == 8) {\n return 4\n }\n else if (number == 9) {\n return 4\n }\n else if (number == 10) {\n return 4\n }\n}", "function getBurstPageNumbers(fileSplits) {\n\n var burstPageNumbers = [];\n // Parse each individual split\n // only get the first file split.\n // fileSplits should only have one element in it\n fileSplits[0].forEach(function(split) {\n\n // Get each individual split\n // ex 4-7, 1\n var numbers = split.match(/(\\d+)/g);\n\n // handle the case where the splits are reversed (ie: 10-5)\n if (numbers.length == 2) {\n var start = parseInt(numbers[0]);\n var end = parseInt(numbers[1]);\n if (parseInt(numbers[0]) > parseInt(numbers[1])) {\n for (var i = start; i >= end; i--) {\n burstPageNumbers.push(i)\n }\n } else {\n for (var i = start; i <= end; i++) {\n burstPageNumbers.push(i)\n }\n }\n } else {\n burstPageNumbers.push(numbers[0]);\n }\n });\n\n return burstPageNumbers;\n}", "split() {\n let w = this.range.Width / 2;\n let h = this.range.Height / 2;\n this.LL = new PointQuadTree(\n new Rect(this.range.x1, this.range.y1, this.range.x1 + w, this.range.y1 + h),\n this.capacity,\n this._pushToLeaves);\n this.LH = new PointQuadTree(\n new Rect(this.range.x1 + w, this.range.y1, this.range.x2, this.range.y1 + h),\n this.capacity,\n this._pushToLeaves);\n this.HL = new PointQuadTree(\n new Rect(this.range.x1, this.range.y1 + h, this.range.x1 + w, this.range.y2),\n this.capacity,\n this._pushToLeaves);\n this.HH = new PointQuadTree(\n new Rect(this.range.x1 + w, this.range.y1 + h, this.range.x2, this.range.y2),\n this.capacity,\n this._pushToLeaves);\n\n this._isSplit = true;\n\n // if the quadtree is set to push all points down to the leaves,\n // then this will re-insert the points currently contained in this node.\n // because capacity is set to 0, the re-inserted points will go to the \n // new children, as will any newly inserted future points.\n if (this._pushToLeaves) {\n this.capacity = 0;\n while (this.points.length > 0) {\n let p = this.points.pop();\n this.insert(p);\n }\n }\n }", "function get_splits(){\n let splits;\n switch(THREAD){\n case THREADS.BACKWARDS:\n splits = ['900','800','700','600','500','400','300','200','100','000'];\n break;\n case THREADS.BASE2:\n splits = ['0010000000','0100000000','0110000000','1000000000','1010000000','1100000000','1110000000','0000000000']\n break;\n case THREADS.BASE3:\n splits = ['010000','020000','100000','110000','120000','200000','210000','220000','000000']\n break;\n case THREADS.BASE4:\n splits = ['02000','10000','12000','20000','22000','30000','32000','00000']\n break;\n default:\n splits = ['100','200','300','400','500','600','700','800','900','000'];\n break;\n }\n return splits;\n}", "function splitIdFromThis(splitId) {\n let id = $(splitId).attr(\"id\");\n let salvaId = id.split(\"-\");\n id = salvaId[1];\n return id;\n}", "function splitRemoverClick() {\n if (!continueProcessing) {\n item = $(this);\n var id = item.prop('id');\n if (id != undefined) {\n id = id.replace(\"splitItem-\", \"\");\n id = id.replace(\"splitRemover-\", \"\");\n id = id.replace(\"splitAdder-\", \"\");\n } else {\n id = \"\";\n }\n if (id == \"\" || id == \"deleteButton\") {\n id = $('#splitUUID').val();\n }\n id = parseInt(id);\n if (editor.splitData && editor.splitData.splits && editor.splitData.splits[id]) {\n if (editor.splitData.splits[id].enabled) {\n $('#splitItemDiv-' + id).addClass('disabled');\n $('#splitRemover-' + id).hide();\n $('#splitAdder-' + id).show();\n $('.splitItem').removeClass('splitItemSelected');\n setEnabled(id, false);\n if (!zoomedIn()) {\n if (getCurrentSplitItem().id == id) {\n // if current split item is being deleted:\n // try to select the next enabled segment, if that fails try to select the previous enabled item\n var sthSelected = false;\n for (var i = id; i < editor.splitData.splits.length; ++i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n if (!sthSelected) {\n for (var i = id; i >= 0; --i) {\n if (editor.splitData.splits[i].enabled) {\n sthSelected = true;\n selectSegmentListElement(i, true);\n break;\n }\n }\n }\n }\n selectCurrentSplitItem();\n }\n } else {\n $('#splitItemDiv-' + id).removeClass('disabled');\n $('#splitRemover-' + id).show();\n $('#splitAdder-' + id).hide();\n setEnabled(id, true);\n }\n }\n cancelButtonClick();\n }\n}", "drawSplitLine(lineI, commentStart, selectStart, selectEnd){\n let strParts = []; // List of lists of string indexes and colors\n\n if(Math.max(commentStart, selectStart) > 0)\n strParts.push([0, DIM_WHITE]);\n if(commentStart !== -1 && selectStart === -1){\n strParts.push([commentStart, COMMENT_GRAY]);\n }else if(commentStart === -1 && selectStart !== -1){\n strParts.push([selectStart, WHITE]);\n if(selectEnd < this.lines.strLen(lineI))\n strParts.push([selectEnd, DIM_WHITE]);\n }else{\n if(commentStart <= selectStart){\n if(commentStart < selectStart)\n strParts.push([commentStart, COMMENT_GRAY]);\n strParts.push([selectStart, DIM_WHITE]);\n if(selectEnd < this.lines.strLen(lineI))\n strParts.push([selectEnd, COMMENT_GRAY]);\n }else if(selectStart < commentStart && commentStart < selectEnd){\n strParts.push([selectStart, WHITE]);\n strParts.push([commentStart, DIM_WHITE]);\n if(selectEnd < this.lines.strLen(lineI))\n strParts.push([selectEnd, COMMENT_GRAY]);\n }else if(commentStart >= selectEnd){\n strParts.push([selectStart, WHITE]);\n if(commentStart > selectEnd)\n strParts.push([selectEnd, DIM_WHITE]);\n strParts.push([commentStart, COMMENT_GRAY]);\n }\n }\n\n strParts.push([this.lines.strLen(lineI), null]);\n for(let i=0; i<strParts.length-1; i++){\n ctx.fillStyle = strParts[i][1];\n ctx.fillText(\n this.lines.strGet(lineI).substring(\n strParts[i][0], strParts[i+1][0]),\n this.x+CHAR_GAP + CHAR_WIDTH*strParts[i][0],\n this.y+CHAR_GAP + (lineI+1)*LINE_HEIGHT + this.offsetY\n );\n }\n }", "nonSplit(id, oid, s) {\n let rank = s[1];\n\n if (id == s[0] && rank >= 6) {\n rank = Number.MAX_SAFE_INTEGER;\n } else if (oid == s[0] && rank >= 3) {\n rank = Number.MAX_SAFE_INTEGER / 2;\n }\n\n return rank;\n }", "function getnum(spanid) {\n return parseInt(spanid.split(\"-\").slice(-1)[0]);\n }", "_getLeftSplit (columns, id, isEdit) {\n var leftSplit = 1;\n if (isEdit) {\n leftSplit++;\n }\n if (id) {\n leftSplit = 1;\n for(var index = 0; index <columns.length;index++) {\n if(columns[index].id == id){\n leftSplit = index + 1;\n break;\n }\n }\n }\n return leftSplit;\n }", "segment(type, factor) {\n this.currentShape.addSegment(type, factor);\n }", "function selectionIndex(passage) {\n var selection = $(passage).find('#selection .word');\n var startId = $(passage).find('.word').index(selection.first());\n if(selection.length == 1) { // single word\n return startId;\n } else { // range of words\n return startId + \"-\" + (startId + selection.length - 1);\n } \n }", "function toIndex(number) {\r\n return number / CELL_SIZE;\r\n}/* convert given number to indexes */", "split() {\n let w = this.range.Width / 2;\n let h = this.range.Height / 2;\n this.LL = new QuadTree(\n new Rect(this.range.x1, this.range.y1, this.range.x1 + w, this.range.y1 + h),\n this.capacity,\n this._pushToLeaves);\n this.LH = new QuadTree(\n new Rect(this.range.x1 + w, this.range.y1, this.range.x2, this.range.y1 + h),\n this.capacity,\n this._pushToLeaves);\n this.HL = new QuadTree(\n new Rect(this.range.x1, this.range.y1 + h, this.range.x1 + w, this.range.y2),\n this.capacity,\n this._pushToLeaves);\n this.HH = new QuadTree(\n new Rect(this.range.x1 + w, this.range.y1 + h, this.range.x2, this.range.y2),\n this.capacity,\n this._pushToLeaves);\n\n this._isSplit = true;\n\n // if the quadtree is set to push all points down to the leaves,\n // then this will re-insert the points currently contained in this node.\n // because capacity is set to 0, the re-inserted points will go to the \n // new children, as will any newly inserted future points.\n if (this._pushToLeaves) {\n this.capacity = 0;\n while (this.points.length > 0) {\n let p = this.points.pop();\n this.insert(p);\n }\n }\n }", "function parseIdx(p, n){ // PathPoints, number for index\n var len = p.length;\n if(p.parent.closed){\n return n >= 0 ? n % len : len - Math.abs(n % len);\n } else {\n return (n < 0 || n > len - 1) ? -1 : n;\n }\n}", "function split(array, segments) {\n\t segments = segments || 2;\n\t var results = [];\n\t if (array == null) {\n\t return results;\n\t }\n\n\t var minLength = Math.floor(array.length / segments),\n\t remainder = array.length % segments,\n\t i = 0,\n\t len = array.length,\n\t segmentIndex = 0,\n\t segmentLength;\n\n\t while (i < len) {\n\t segmentLength = minLength;\n\t if (segmentIndex < remainder) {\n\t segmentLength++;\n\t }\n\n\t results.push(array.slice(i, i + segmentLength));\n\n\t segmentIndex++;\n\t i += segmentLength;\n\t }\n\n\t return results;\n\t }", "function formSplit() {\n var container = document.getElementById('splitAmount');\n\n var option = document.createElement('option');\n option.setAttribute('selected', 'selected');\n option.setAttribute('disabled', 'disabled');\n option.setAttribute('hidden', 'hidden');\n option.setAttribute('style', 'display: none');\n container.appendChild(option);\n\n for(var i = 0; i <= 10; i++) {\n var option = document.createElement('option');\n option.innerHTML = i;\n option.value = i;\n container.appendChild(option);\n }\n}", "function split(array, segments) {\n segments = segments || 2;\n\n var output = [],\n segmentLength = Math.floor(array.length / segments),\n remainder = array.length % segments,\n start = 0,\n i = 0,\n n = array.length,\n len;\n\n while (start < n) {\n len = i++ < remainder ? segmentLength + 1 : segmentLength;\n output.push(array.slice(start, start + len));\n start += len;\n }\n\n return output;\n }", "function getSelectedSegments(report) {\n var segments = [];\n if(report.segmentation) {\n report.tab.find('.segment-' + report.segmentation + ' .segment-toggle:checked').each(function() {\n segments.push($(this).val());\n });\n }\n return segments;\n}", "function findPath(num) {\n // input: number\n // output: an array with the list of numbers back to 4\n var letter_count = 0;\n var words = '';\n var words_cleaned = '';\n\n var pathToFour = [];\n pathToFour.push(num);\n\n while( num != 4 ) {\n // convert number to words\n words = converter.toWords(num);\n words_cleaned = words.replace(/\\s+/, '');\n words_cleaned = words_cleaned.replace(/-/, '');\n num = words_cleaned.length;\n pathToFour.push(num);\n }\n\n return(pathToFour);\n\n}", "function do_chapter_split( opt )\n{\n\tfunction do_one_ref( ref )\n\t{\n\t\t// Insert the break early\n\t\tif ( opt.early )\n\t\t{\n\t\t\tif ( ref.c === opt.c && ref.v >= opt.v )\n\t\t\t{\n\t\t\t\tref.c++;\n\t\t\t\tref.v -= opt.v - 1;\n\t\t\t}\n\t\t\telse if ( ref.c > opt.c )\n\t\t\t{\n\t\t\t\tref.c++;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ( ref.c > opt.c )\n\t\t\t{\n\t\t\t\tref.c--;\n\t\t\t\tif ( ref.c === opt.c )\n\t\t\t\t{\n\t\t\t\t\tref.v += opt.v - 1;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tdo_one_ref( opt.entity.start );\n\tdo_one_ref( opt.entity.end );\n}", "function splitOutputCreate() {\n\n // pulls the number from selection of how many inputs wanted\n var num = document.getElementById('splitAmount').value;\n\n var container = document.getElementById('splitInput');\n\n // handles if the number is changed to a lower number than was previously selected\n while (container.hasChildNodes()) {\n container.removeChild(container.lastChild);\n }\n\n // creates the output entries based on number selected with # of outputs\n for (i = 0; i < num; i++) {\n\n // creates the output entries\n container.appendChild((document.createTextNode(\" Output: \" )));\n var splitOut = document.createElement('input');\n splitOut.type = \"text\";\n splitOut.id = \"splitOut\" + i;\n splitOut.className = \"splitOut\";\n container.appendChild(splitOut);\n\n container.appendChild(document.createElement('br'));\n }\n}", "function split_fraction(fraction)\n{\n // numerator\n numerator[input_index] = fraction.split(\"/\")[0];\n console.log(\"numerator: \"+numerator[input_index]);\n \n // denominator\n denominator[input_index] = fraction.split(\"/\")[1];\n console.log(\"denominator: \"+denominator[input_index]);\n}", "function updateSplitLine(color = 'red') {\n if (splitPoints.length >= 2) {\n const splitLine = document.getElementById(SPLITTER_ID);\n if (splitLine) {\n const path = [\n 'M',\n splitPoints[0].x,\n splitPoints[0].y,\n 'L',\n splitPoints[1].x,\n splitPoints[1].y,\n 'Z',\n ].join(' ');\n splitLine.setAttribute('d', path);\n splitLine.setAttribute('stroke', color);\n }\n }\n}", "function getPathSegment(path, index) {\n\n return path.split(\"?\")[0].split(\"/\")[index];\n }", "function getIJidx(selNum) {\n var iIdx, jIdx;\n if(selNum>10) {\n iIdx=2, jIdx=selNum-10;\n } else if(selNum>5){\n iIdx=1, jIdx=selNum-5;\n } else {\n iIdx=0, jIdx=selNum;\n }\n return [iIdx, jIdx];\n}", "function splitter(num){\n var newNum = num.toString().split(\"\")\n var final = (+newNum[0]) + (+newNum[1])\n return final\n}", "_select(num) {\n this.selectedIndex = num;\n this._switcherList.highlight(num);\n\n // on item selected, switch/move to the workspace\n let workspaceManager = global.workspace_manager;\n let wm = Main.wm;\n let newWs = workspaceManager.get_workspace_by_index(this.selectedIndex);\n wm.actionMoveWorkspace(newWs);\n }", "function splitByNumbers(numbers) {\n const result = numbers.split(/([\\u0030-\\u0039]+)/)\n return result.slice(1)\n}", "getLineSegment(iLine) {\n const nPoint = this.nLine[iLine]\n const nPoint2 = this.nLine[iLine+1]\n // First make sure we have a segment\n if ((nPoint !== -1) && (nPoint2 !== -1)) {\n const segment = new Segment()\n segment.x1 = this.xPoints[nPoint]\n segment.y1 = this.yPoints[nPoint]\n segment.x2 = this.xPoints[nPoint2]\n segment.y2 = this.yPoints[nPoint2]\n return segment\n }\n return null\n }", "createIndexOfSplitMethod(splitAt){\n if(Array.isArray(splitAt)){\n this.getIndexOfSplit = (data)=>{\n for(let i=0; i<data.length - splitAt.length+1; i++){\n let valid=true;\n for(let k=0;k<splitAt.length; k++){\n if(data[i+k] !== splitAt[k]){\n valid=false;\n break;\n }\n }\n if(valid){\n return i + splitAt.length - 1;\n }\n }\n return -1;\n }\n } else if(typeof splitAt === 'function'){\n this.getIndexOfSplit = splitAt;\n } else if( splitAt.constructor.name === \"RegExp\" ){\n this.getIndexOfSplit = data => {\n const result = data.toString().match(splitAt)\n return result ? result.index + result[0].length - 1 : -1;\n };\n } else if( typeof splitAt === 'string' ){\n this.getIndexOfSplit = data => {\n const index = data.toString().indexOf(splitAt);\n if(index >= 0){\n return index + splitAt.length - 1\n }\n return -1;\n };\n }\n }", "function addDashBetweenNumber(number) {\n\n}", "split() {\n\n\t\tconst min = this.min;\n\t\tconst max = this.max;\n\t\tconst mid = this.getCenter(c);\n\n\t\tconst children = this.children = [\n\n\t\t\tnull, null,\n\t\t\tnull, null,\n\t\t\tnull, null,\n\t\t\tnull, null\n\n\t\t];\n\n\t\tlet i, combination;\n\n\t\tfor(i = 0; i < 8; ++i) {\n\n\t\t\tcombination = pattern[i];\n\n\t\t\tchildren[i] = new this.constructor(\n\n\t\t\t\tnew Vector3(\n\t\t\t\t\t(combination[0] === 0) ? min.x : mid.x,\n\t\t\t\t\t(combination[1] === 0) ? min.y : mid.y,\n\t\t\t\t\t(combination[2] === 0) ? min.z : mid.z\n\t\t\t\t),\n\n\t\t\t\tnew Vector3(\n\t\t\t\t\t(combination[0] === 0) ? mid.x : max.x,\n\t\t\t\t\t(combination[1] === 0) ? mid.y : max.y,\n\t\t\t\t\t(combination[2] === 0) ? mid.z : max.z\n\t\t\t\t)\n\n\t\t\t);\n\n\t\t}\n\n\t}", "function isSelectionMiddle(lineNo) {\n if (selected[0] === -1) {\n return false;\n }\n if (selected[1] === -1) {\n return selected[0] === lineNo;\n }\n\n return (\n lineNo === Math.floor((Math.min(...selected) + Math.max(...selected)) / 2)\n );\n }", "createRangesForSplitStorage(storageInfo, firstTransactionInSegment, lastTransactionInSegment) {\n let earliestStorage = this.findEarliestStorage(storageInfo);\n let lastStorage = this.findLastStorage(storageInfo);\n\n for (const storage in storageInfo) {\n let storageObject = storageInfo[storage];\n\n if (storage === earliestStorage) {\n storageObject.firstTransaction = firstTransactionInSegment;\n } else {\n storageObject.firstTransaction = storageObject.transactions[0].dataForRange;\n }\n\n if (storage === lastStorage) {\n storageObject.lastTransaction = lastTransactionInSegment;\n } else {\n storageObject.lastTransaction = storageObject.transactions[storageObject.transactions.length-1].dataForRange;\n }\n }\n }", "function splitItemClick() {\n if (!continueProcessing) {\n if (!isSeeking || (isSeeking && ($(this).prop('id').indexOf('Div-') == -1))) {\n now = new Date();\n }\n\n if ((now - lastTimeSplitItemClick) > 80) {\n lastTimeSplitItemClick = now;\n\n if (editor.splitData && editor.splitData.splits) {\n // if not seeking\n if ((isSeeking && ($(this).prop('id').indexOf('Div-') == -1)) || !isSeeking) {\n // get the id of the split item\n id = $(this).prop('id');\n id = id.replace('splitItem-', '');\n id = id.replace('splitItemDiv-', '');\n id = id.replace('splitSegmentItem-', '');\n $('#splitUUID').val(id);\n\n if (id != lastId) {\n if (!inputFocused) {\n lastId = id;\n\n // remove all selected classes\n $('.splitSegmentItem').removeClass('splitSegmentItemSelected');\n $('.splitItem').removeClass('splitItemSelected');\n $('.splitItemDiv').removeClass('splitSegmentItemSelected');\n\n $('#clipItemSpacer').remove();\n $('#clipBegin').remove();\n $('#clipEnd').remove();\n\n $('.segmentButtons', '#splitItem-' + id).append('<span class=\"clipItem\" id=\"clipBegin\"></span><span id=\"clipItemSpacer\"> - </span><span class=\"clipItem\" id=\"clipEnd\"></span>');\n setSplitListItemButtonHandler();\n\n $('#splitSegmentItem-' + id).removeClass('hover');\n\n // load data into the segment\n var splitItem = editor.splitData.splits[id];\n editor.selectedSplit = splitItem;\n editor.selectedSplit.id = parseInt(id);\n setTimefieldTimeBegin(splitItem.clipBegin);\n setTimefieldTimeEnd(splitItem.clipEnd);\n $('#splitIndex').html(parseInt(id) + 1);\n\n // add the selected class to the corresponding items\n $('#splitSegmentItem-' + id).addClass('splitSegmentItemSelected');\n $('#splitItem-' + id).addClass('splitItemSelected');\n $('#splitItemDiv-' + id).addClass('splitSegmentItemSelected');\n\n currSplitItem = splitItem;\n\n if (!timeoutUsed) {\n if (!currSplitItemClickedViaJQ) {\n setCurrentTime(splitItem.clipBegin);\n }\n // update the current time of the player\n $('.video-timer').html(formatTime(getCurrentTime()) + \"/\" + formatTime(getDuration()));\n }\n }\n }\n }\n }\n }\n }\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "function splitEvery(value, delimiter, numDelimiters) {\n // Fail if we don't have a clear number to split on.\n if (numDelimiters <= 0 || !Number.isInteger(numDelimiters)) {\n throw new Error(\"Invalid number of delimiters (\" + numDelimiters + \") for splitEvery.\");\n }\n var segments = value.split(delimiter);\n // Short circuit extra logic for the simple case.\n if (numDelimiters === 1) {\n return segments;\n }\n var compoundSegments = [];\n var currentSegment = \"\";\n for (var i = 0; i < segments.length; i++) {\n if (currentSegment === \"\") {\n // Start a new segment.\n currentSegment = segments[i];\n }\n else {\n // Compound the current segment with the delimiter.\n currentSegment += delimiter + segments[i];\n }\n if ((i + 1) % numDelimiters === 0) {\n // We encountered the right number of delimiters, so add the entry.\n compoundSegments.push(currentSegment);\n // And reset the current segment.\n currentSegment = \"\";\n }\n }\n // Handle any leftover segment portion.\n if (currentSegment !== \"\") {\n compoundSegments.push(currentSegment);\n }\n return compoundSegments;\n}", "getIndexesOfBox(number) {\n const i = number - 1;\n const row = Math.floor(i / 3);\n return [\n row,\n i - row*3\n ];\n }", "function setPlateNum(vehID) {\n for (var i=0; i < plateNumbers.length; i++){\n \n if (vehID==\"460070\"){\n id = \"Vainio 82, UZP-562\";\n }\n \n \n if (plateNumbers[i].split(\":\")[0]== vehID){\n id = plateNumbers[i].split(\":\")[1];\n }\n }\n \n}", "function n(a,b,c){var d=a.cloneNode(!1);\n// Preserve positions\nif(d.deleteData(0,b),a.deleteData(b,a.length-b),m(d,a),c)for(var f,g=0;f=c[g++];)\n// Handle case where position was inside the portion of node after the split point\nf.node==a&&f.offset>b?(f.node=d,f.offset-=b):f.node==a.parentNode&&f.offset>e(a)&&++f.offset;return d}", "function selectPiece ( piece ) {\n self.selectedPiece = angular.isNumber(piece) ? $scope.pieces[piece] : piece;\n }", "function getCurrentSplitItem() {\n if (editor.splitData && editor.splitData.splits) {\n var currentTime = getCurrentTime();\n for (var i = 0; i < editor.splitData.splits.length; ++i) {\n var splitItem = editor.splitData.splits[i];\n if ((splitItem.clipBegin <= (currentTime + 0.1)) && (currentTime < (splitItem.clipEnd - 1))) {\n splitItem.id = i;\n return splitItem;\n }\n }\n }\n return currSplitItem;\n}", "getDotId(index) {\r\n return `dot${index}`;\r\n }", "function selectedNumbers(num){\n if(pckdNumbers.indexOf(num) !== -1 ){\n let index = pckdNumbers.indexOf(num)\n pckdNumbers.splice(index,1) \n change(false,num)\n console.log(pckdNumbers)\n return\n }\n addNumbers(num)\n}", "function translateNumberAndSegmentQuestion4v(){\n segment = meVisualizedByMainSegment[meCurrentLesion];\n number = meSegments[meCurrentLesion];\n\n if( number == \"none\" )\n\treturn \"ddsgmsnone\" + segment;\n\n for (var i = 0; i < meSegmentVisualizedTableHelp.length; i++) {\n\n\tarrayStart=parseInt(meSegmentVisualizedTableHelp[i][2]);\n\tarrayEnd=parseInt(meSegmentVisualizedTableHelp[i][3]);\n\tdenylist=meSegmentVisualizedTableHelp[i][5];\n\n\tif( meSegmentVisualizedTableHelp[i][0] == segment && meSegmentVisualizedTableHelp[i][4] == '1' ) {\n\n\t // loop through diffusetablearray, and ignore items of the deny list\n\t for (var j = arrayStart; j <= arrayEnd; j++)\n\t {\n\t\tshowme2=meDiffuseTableArray[j][2];\n\n\t\tif ((showme2=='1') && (denylist!=''))\n\t\t{\n\t\t //check if not in deny list\n\t\t tmpteststring='|' + number + '|';\n\t\t if (denylist.indexOf(tmpteststring)!=-1)\n\t\t {\n\t\t\tshowme2='0';\n\t\t }\n\t\t}\n\n\t\tif (showme2=='1')\n\t\t{\n\t\t // j+1 is returned because 'none' takes place 0...\n\t\t if( meDiffuseTableArray[j][1] == number ) {\n\t\t\treturn \"ddsgms\" + i + \"d\" + j;\n\t\t }\n\t\t}\n\t }\n\t}\n }\n}", "function getLocation(number) {\n let a = Math.floor(number / options.blocksPerEdge);\n let b = number % options.blocksPerEdge;\n return [a, b];\n }", "function parseStartVerseNumber(verseNumberOrRange) {\n return +verseNumberOrRange.match(/^\\d*/)[0];\n}", "function split() {\n\n if (!scope.splittable) {\n return;\n }\n\n var height = scope.control.renderingHeight;\n var halfHeight = height;\n if (height) {\n\n halfHeight = Math.ceil(height / 2);\n\n scope.control.setRenderingHeight(halfHeight);\n scope.control.setRenderingVerticalResizeMode('console:resizeManual');\n }\n\n var json = {\n typeId: 'console:' + containers.vertical,\n 'console:renderingOrdinal': jsonInt(),\n 'console:renderingWidth': jsonInt(scope.control.renderingWidth),\n 'console:renderingHeight': jsonInt(halfHeight),\n 'console:renderingBackgroundColor': scope.control.renderingBackgroundColor,\n 'console:renderingHorizontalResizeMode': scope.control.renderingHorizontalResizeMode,\n 'console:renderingVerticalResizeMode': scope.control.renderingVerticalResizeMode,\n 'console:hideLabel': jsonBool(false),\n 'console:containedControlsOnForm': []\n };\n\n var newContainer = spEntity.fromJSON(json);\n\n // same name?\n newContainer.name = scope.control.name;\n\n var success = insertAtBottom(newContainer, scope.control, scope.fieldContainer);\n if (!success) {\n console.log('form builder: failed to split control');\n }\n\n performLayout();\n }", "getSegment(\n pathIndex = this.state.selectedPathIndex,\n pointIndex = this.state.selectedPointIndex,\n ) {\n return this.state.allPaths[pathIndex].definition[pointIndex];\n }", "function split(startI, endI, type, innerOffset, length) {\n let i = startI;\n while (b[i + 2] + off <= node.from)\n i = b[i + 3];\n let children = [], positions = [];\n sliceBuf(buf, startI, i, children, positions, innerOffset);\n let from = b[i + 1], to = b[i + 2];\n let isTarget = from + off == node.from && to + off == node.to && b[i] == node.type.id;\n children.push(isTarget ? node.toTree() : split(i + 4, b[i + 3], buf.set.types[b[i]], from, to - from));\n positions.push(from - innerOffset);\n sliceBuf(buf, b[i + 3], endI, children, positions, innerOffset);\n return new Tree(type, children, positions, length);\n }", "function get_split_digits(){\n let digits;\n switch(THREAD){\n case THREADS.BASE2:\n digits = 10;\n break;\n case THREADS.BASE3:\n digits = 6;\n break;\n case THREADS.BASE4:\n digits = 5;\n break;\n default:\n digits = 3;\n break;\n }\n return digits;\n}", "function SpecVraagS()\n{\n fullid = this.id.split(\"\");\n if(fullid.length == 2)\n {\n index = fullid[0];\n }\n else\n {\n index = fullid[0] + fullid[1];\n }\n \n SBid = \"SBS\" + index;\n \n if(SelecVragen[index] == true)\n {\n SelecVragen[index] = false\n document.getElementById(SBid).classList.replace(\"SpecSelected\", \"SpecNotSelected\")\n SpecSCount--;\n document.getElementById(\"SpecSCount\").firstChild.innerHTML = SpecSCount\n }\n else if(SelecVragen[index] != true)\n {\n SelecVragen[index] = true\n document.getElementById(SBid).classList.replace(\"SpecNotSelected\", \"SpecSelected\")\n SpecSCount++;\n document.getElementById(\"SpecSCount\").firstChild.innerHTML = SpecSCount\n }\n}", "function endsWithSegmentNumber(name) {\r\n return name.components != null && name.components.length >= 1 &&\r\n name.components[name.components.length - 1].length >= 1 &&\r\n name.components[name.components.length - 1][0] == 0;\r\n}", "function DrawAdjustLine(index, selectedIsArriveBefore, selectedLegNumber)\n{\n\n\tvar cellTop = document.getElementById(TagPrefixTop_Segment + index);\n\tif (cellTop != null)\n\t\tcellTop.className = HighlightedSegmentTagClass;\n\n\tvar cellMiddle = document.getElementById(TagPrefixMiddle_Segment + index);\n\tif (cellMiddle != null)\n\t\tcellMiddle.className = HighlightedSegmentTagClass;\n\t\n\tvar cellBottom = document.getElementById(TagPrefixBottom_Segment + index);\n\tif (cellBottom != null)\n\t\tcellBottom.className = HighlightedSegmentBottomTagClass;\n\t\n\t\n\t// Mark any interchanges (have different ID and rarely present, so check for null)\n\t// If arriveBefore, highlight all interchanges with value less than selected leg and if\n\t// the selected location is an interchange highlight that too. Opposite for leaveAfter.\n\tvar interchangeElement = null;\n\n\tvar intIndex = parseInt(index);\n\n\tif (selectedIsArriveBefore == \"False\")\t// leave after\n\t{\n\t\tif (SelectedLocationIsInterchange == true)\n\t\t{\n\t\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + index + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + index + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t\t\t}\n\t}\n\telse\n\t{\n\n\t\t// Highlight the selected interchange (labelled a number higher than the selected leg)\n\t\tif ((SelectedLocationIsInterchange == true) && (i == (selectedLegNumber - 1)))\n\t\t{\n\t\t\tintIndex++;\n\t\t\t\n\t\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + intIndex + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + intIndex + InterchangeIndicator);\n\t\t\tif (interchangeElement != null)\n\t\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t\t}\n\n\t\t// Highlight any interchange during the selected part of the journey\n\t\tinterchangeElement = document.getElementById(TagPrefixTop_Segment + index + InterchangeIndicator);\n\t\tif (interchangeElement != null)\n\t\t\tinterchangeElement.className = HighlightedSegmentTagClass;\n\n\t\tinterchangeElement = document.getElementById(TagPrefixBottom_Segment + index + InterchangeIndicator);\n\t\tif (interchangeElement != null)\n\t\t\tinterchangeElement.className = HighlightedSegmentBottomTagClass;\n\t}\n\t\n}", "function createSliderNum() {\n var group = createDiv('');\n group.position(width + 10, height / 2);\n sliderNum = createSlider(2, 100, 8, 1);\n sliderNum.parent(group);\n var label = createSpan('Number of Balls');\n label.parent(group);\n}", "constructor() { \n \n Split.initialize(this);\n }", "function split(str, idx) {\n /* Splitting on the basis of colon and returning corresponding element '0' for x and '1' for y */\n return str.split(\":\")[idx];\n}", "function setNumber(number)\n{\n return phoneUtil.parseAndKeepRawInput(number, 'BR').values_[2];\n}", "_splitPointsToBoundaries(splitPoints, textBuffer) {\n const boundaries = [];\n const lineCnt = textBuffer.getLineCount();\n const getLineLen = (lineNumber) => {\n return textBuffer.getLineLength(lineNumber);\n };\n // split points need to be sorted\n splitPoints = splitPoints.sort((l, r) => {\n const lineDiff = l.lineNumber - r.lineNumber;\n const columnDiff = l.column - r.column;\n return lineDiff !== 0 ? lineDiff : columnDiff;\n });\n // eat-up any split point at the beginning, i.e. we ignore the split point at the very beginning\n this._pushIfAbsent(boundaries, new position_1.Position(1, 1));\n for (let sp of splitPoints) {\n if (getLineLen(sp.lineNumber) + 1 === sp.column && sp.lineNumber < lineCnt) {\n sp = new position_1.Position(sp.lineNumber + 1, 1);\n }\n this._pushIfAbsent(boundaries, sp);\n }\n // eat-up any split point at the beginning, i.e. we ignore the split point at the very end\n this._pushIfAbsent(boundaries, new position_1.Position(lineCnt, getLineLen(lineCnt) + 1));\n // if we only have two then they describe the whole range and nothing needs to be split\n return boundaries.length > 2 ? boundaries : null;\n }", "NumberButtonSelect(number){\n this.refHolder.getComponent('AudioController').PlayTap();\n console.log(\"number \"+number);\n\n if(this.prevID !== 10){\n\n if(this.inputButs[this.prevID].getComponent(\"InputButScript\").GetValue() !== 0){\n this.numberButs[this.inputButs[this.prevID].getComponent(\"InputButScript\").GetValue()].getComponent(\"NumberButScript\").DeSelectNumber();\n }\n this.inputButs[this.prevID].getComponent(\"InputButScript\").SetValue(number);\n\n }\n\n\n }", "function getLocation(number) {\n var a = Math.floor(number / options.blocksPerEdge);\n var b = number % options.blocksPerEdge;\n return [a, b];\n }", "function segment(type, index, offset) {\n let segment = images.middle\n\n if (type === Segment.o) {\n segment = index === 0 ? images.top : images.bottom\n }\n\n const img = document.createElement(\"img\")\n img.src = segment\n img.classList.add(\"segment\")\n img.style.marginTop = offset + \"px\"\n img.style.zIndex = 100000 - index\n\n return img\n}", "function splitGroup(group) {\n // find best-match segment pair\n var group2 = findMatchingPair(group, checkDoubleExtension) ||\n findMatchingPair(group, checkSingleExtension) ||\n findMatchingPair(group, checkPairwiseMatch);\n if (group2) {\n group = group.filter(function(i) {\n return !utils.contains(group2, i);\n });\n updateGroupIds(group);\n updateGroupIds(group2);\n // Split again if reduced group is still large\n if (group.length > 2) splitGroup(group);\n }\n }", "function BaseSelection() {\n /* superclass for the Selection objects\n \n this will contain higher level methods that don't contain \n browser-specific code\n */\n this.splitNodeAtSelection = function(node) {\n /* split the node at the current selection\n\n remove any selected text, then split the node on the location\n of the selection, thus creating a new node, this is attached to\n the node's parent after the node\n\n this will fail if the selection is not inside the node\n */\n if (!this.selectionInsideNode(node)) {\n throw(_('Selection not inside the node!'));\n };\n // a bit sneaky: what we'll do is insert a new br node to replace\n // the current selection, then we'll walk up to that node in both\n // the original and the cloned node, in the original we'll remove\n // the br node and everything that's behind it, on the cloned one\n // we'll remove the br and everything before it\n // anyway, we'll end up with 2 nodes, the first already in the \n // document (the original node) and the second we can just attach\n // to the doc after the first one\n var doc = this.document.getDocument();\n var br = doc.createElement('br');\n br.setAttribute('node_splitter', 'indeed');\n this.replaceWithNode(br);\n \n var clone = node.cloneNode(true);\n\n // now walk through the original node\n var iterator = new NodeIterator(node);\n var currnode = iterator.next();\n var remove = false;\n while (currnode) {\n if (currnode.nodeName.toLowerCase() == 'br' && currnode.getAttribute('node_splitter') == 'indeed') {\n // here's the point where we should start removing\n remove = true;\n };\n // we should fetch the next node before we remove the current one, else the iterator\n // will fail (since the current node is removed)\n var lastnode = currnode;\n currnode = iterator.next();\n // XXX this will leave nodes that *became* empty in place, since it doesn't visit it again,\n // perhaps we should do a second pass that removes the rest(?)\n if (remove && (lastnode.nodeType == 3 || !lastnode.hasChildNodes())) {\n lastnode.parentNode.removeChild(lastnode);\n };\n };\n\n // and through the clone\n var iterator = new NodeIterator(clone);\n var currnode = iterator.next();\n var remove = true;\n while (currnode) {\n var lastnode = currnode;\n currnode = iterator.next();\n if (lastnode.nodeName.toLowerCase() == 'br' && lastnode.getAttribute('node_splitter') == 'indeed') {\n // here's the point where we should stop removing\n lastnode.parentNode.removeChild(lastnode);\n remove = false;\n };\n if (remove && (lastnode.nodeType == 3 || !lastnode.hasChildNodes())) {\n lastnode.parentNode.removeChild(lastnode);\n };\n };\n\n // next we need to attach the node to the document\n if (node.nextSibling) {\n node.parentNode.insertBefore(clone, node.nextSibling);\n } else {\n node.parentNode.appendChild(clone);\n };\n\n // this will change the selection, so reselect\n this.reset();\n\n // return a reference to the clone\n return clone;\n };\n\n this.selectionInsideNode = function(node) {\n /* returns a Boolean to indicate if the selection is resided\n inside the node\n */\n var currnode = this.parentElement();\n while (currnode) {\n if (currnode == node) {\n return true;\n };\n currnode = currnode.parentNode;\n };\n return false;\n };\n}", "function setNumberLineCharts( i ) {\n config.lines = (config.lines = ( i > 0 ) ? i : 1);\n }", "insert(number) {\n let low = 0;\n let high = this.values.length - 1;\n\n while (low <= high) {\n const mid = Math.floor((low + high) / 2);\n if (this.values[mid] === number) {\n this.values.splice(mid, 0, number);\n setMedian();\n return;\n } else if (this.values[mid] < number) {\n low = mid + 1;\n } else {\n high = mid - 1;\n }\n }\n\n this.values.splice(low, 0, number);\n this.setMedian();\n }", "function molSelect() {\n setSpeed(0);\n var molN = document.getElementById(\"listofmols\").value;\n doClearImportFromLib(molN);\n var initNrOfCenterNodes = Math.floor(nodes.length / 4);\n document.getElementById(\"nodenumber\").innerHTML = initNrOfCenterNodes;\n}", "function selectSegments() {\n var peaks = wavesurfer.backend.peaks;\n var length = peaks.length;\n var duration = wavesurfer.getDuration();\n\n var start = 0;\n var min = 0.001;\n for (var i = start; i < length; i += 1) {\n if (peaks[i] <= min && i > start + (1 / duration) * length) {\n var color = [\n ~~(Math.random() * 255),\n ~~(Math.random() * 255),\n ~~(Math.random() * 255),\n 0.1\n ];\n wavesurfer.addRegion({\n color: 'rgba(' + color + ')',\n start: (start / length) * duration,\n end: (i / length) * duration\n });\n while (peaks[i] <= min) {\n i += 1;\n }\n start = i;\n }\n }\n}", "function select (idx) {\n updatedLineNumbers(idx)\n List.select(idx)\n }", "function secondpick(number, canvas){\n\tif (user3slice == 0){\n\tuser3slice = number;\n\tvar a=document.getElementById(canvas);\n\tvar ctxa=a.getContext(\"2d\");\n\tctxa.globalAlpha = 0.25;\n\tctxa.rect(0, 0, a.width, a.height);\n\tctxa.lineWidth = 0;\n\tctxa.fillStyle = '#007F00';\n\tctxa.fill();\n\tif (number != biggest){\n\t\t\tuser2slice = biggest;\n\t\t\tlastly();\n\t}else{\n\t\tuser2slice = biggest;\n\t\ttrimmed(number);\n\t}\n\t}\n}" ]
[ "0.58365625", "0.56602407", "0.558479", "0.54980344", "0.54977524", "0.5444909", "0.5412685", "0.54056525", "0.5391442", "0.53397375", "0.532957", "0.52322525", "0.52041924", "0.51975554", "0.51450396", "0.5118003", "0.5106339", "0.50947833", "0.50938", "0.5037182", "0.5035799", "0.50148135", "0.50114566", "0.5006365", "0.49787357", "0.49430048", "0.4940271", "0.49244377", "0.48836154", "0.48764563", "0.4876341", "0.48720592", "0.48668134", "0.48598367", "0.4855723", "0.48549458", "0.4839116", "0.4815522", "0.48057914", "0.48046008", "0.47985587", "0.47956055", "0.4792268", "0.47723764", "0.47569412", "0.47105953", "0.47046328", "0.4703815", "0.46939993", "0.46872747", "0.46847942", "0.46835503", "0.46821034", "0.46652535", "0.4663805", "0.46623456", "0.4657362", "0.46561435", "0.46549666", "0.46448728", "0.46275595", "0.46199113", "0.46194035", "0.4598759", "0.45892102", "0.45892102", "0.45892102", "0.45872965", "0.45857942", "0.45753762", "0.45745018", "0.4567924", "0.45660526", "0.45633668", "0.4562403", "0.45576805", "0.4556303", "0.45541155", "0.45538834", "0.45378438", "0.45175496", "0.44962353", "0.44856128", "0.44744888", "0.44733852", "0.44678238", "0.4459217", "0.44552368", "0.44531143", "0.44530374", "0.4452881", "0.44509122", "0.4448575", "0.44484052", "0.4446137", "0.44454435", "0.444544", "0.44437966", "0.44400814", "0.44381773" ]
0.5839195
0
visual displays a graphical message
function displayMsg(msg, title, displayOKButton) { if (!messageShown) { messageShown = true; if (displayOKButton == undefined) { displayOKButton = true; } if (displayOKButton) { jQMsg = $('<div />').html(msg).dialog({ title: title, resizable: false, buttons: { OK: function() { $(this).dialog("close"); } }, close: function(event, ui) { messageShown = false; } }); } else { $('<div />').html(msg).dialog({ title: title, resizable: false, close: function(event, ui) { messageShown = false; } }); } } else { if (jQMsg != undefined) { jQMsg.append("<br/>" + msg); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayMessage(msg, character) {\r\n self.displayMessage(msg, character);\r\n }", "function showStatus() \n{\n\t/* score */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"score:\"+score, 5, 16);\n\t/* level */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"level:\"+level, 5, 32);\n\t/* bullet left */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"bullet:\"+bnum, 5, 48);\n\t/* blood */\n\tfill(255);\n\ttextSize(16);\n\ttext(\"blood:\"+blood, 5, 64);\n}", "function showUI(msg) {\n\t\tIPCRenderer.removeAllListeners('siad');\n\t\tinitUI();\n\t\n\t\t// Display success text\n\t\toverlay.find('.centered').text(msg);\n\t\tclearTimeout(crashClock);\n\t\tsetTimeout(function() {\n\t\t\toverlay.fadeOut('slow');\n\t\t}, 300);\n\t}", "function message() {\n textSize(40);\n fill(0, 102, 153);\n textStyle(BOLD);\n textAlign(LEFT);\n text(\"Do you want to pop some bubbles to see a message?\", mesX, mesY);\n}", "function displayWin() {\n push();\n background(0);\n textAlign(CENTER);\n textSize(20);\n textFont(myFont);\n fill(255);\n var winText = \"you win\";\n text(winText,width/2,height/2);\n pop();\n}", "function MessageDisplayWidget() {}", "function display(msg) {\n document.getElementById('display').innerHTML = msg;\n}", "function displayMessage(message){\n document.getElementById('ui').innerHTML = message;\n}", "function MsgDisplay(message)\n\t {\n\t\t if(showAlert) {\n\t\t\t alert(message);\n\t\t }\n\t }", "function messageWin(message) {\n $messageBoard.text(message)\n //could add a display-block here\n}", "show() {\n\t\tnoStroke();\n\t\tfill(150)\n\t\tcircle(this.x,this.y,this.r*2)\n\t\tfill(255)\n\t\ttextSize(30)\n\t\ttextAlign(CENTER, CENTER)\n\t\ttext(this.name, this.x, this.y)\n\t\t/*\n\t\ttext(this.one, 40, 461)\n\t\ttext(this.two, 121, 461)\n\t\ttext(this.three, 40+81*2, 461)\n\t\ttext(this.four, 40+81*3, 461)\n\t\ttext(this.five, 40+81*4, 461)\n\t\ttext(this.six, 40+81*5, 461)\n\t\ttext(this.ti, 40+81*6, 461)\n\t\ttext(this.te, 40+81*7, 461)\n\t\ttext(this.ta, 40+81*8, 461)\n\t\ttext(this.la, 40+81*9, 461)\n\t\ttext(this.le, 40+810, 461)*/\n\t}", "showMessage() {\n // Create message element\n let message = document.createElement('div');\n message.classList.add('text-highlight');\n message.innerHTML = 'Please open an Chordpro File to use the Chorpro tools.';\n this.element.appendChild(message);\n }", "function consoleDisplay(img) {\n elements.gameMessageContainer.innerHTML = \"\";\n let html = `\n <img class=\"console-messages\" src=\"img/${img}.png\">\n `\n\n elements.gameMessageContainer.innerHTML = html;\n}", "function updateDisplay(msg){\n\t\t//displays story\n\t\tvar target=document.getElementById(\"OutputTxtBox\");\n\t\ttarget.value=msg+\"\\n\"+target.value;\n\t\t//displays score\n\t\tdocument.getElementById(\"OutputScore\").value=score;\n\t}", "function draw_error() {\n\tdocument.getElementById(\"raw_output\").innerHTML = \"ERROR!\";\n}", "function displayMessage(type, message) {\n msgDiv.text(message);\n msgDiv.attr(\"class\", type);\n}", "function ilm_display(msg) {\r\n\tdocument.querySelector('#ilm_container .ilm_msg').textContent = msg;\r\n}", "show(){\n fill(this.color);\n rect(this.x, this.y, this.w, this.h);\n }", "function displayMessage(message) {\n\tconsole.log('------------------------------');\n\tconsole.log(motivationalMessage.statement);\n\tconsole.log('\\n');\n\tconsole.log('Your quote of the day:' + '\\n' + ` ${motivationalMessage.quote}`);\n\tconsole.log('\\n');\n\tconsole.log('Your challenge for the day:' + '\\n' + ` ${motivationalMessage.challenge}`);\n\tconsole.log('------------------------------');\n}", "function debug_display(msg) {\n document.getElementById('debug_display').innerHTML += msg + '<br>';\n}", "function display() {\n\n doSanityCheck();\n initButtons();\n}", "show() {\n\t\tstroke(255, 0, 0);\n\t\tstrokeWeight(3);\n\t\tfill(255, 128, 0);\n\t\trect(this.x, this.y, this.width, this.height);\n\t}", "show() {\n stroke(0);\n noFill();\n this.makeShape()\n if (this.revealed) {\n if (this.mine) {\n fill(127);\n ellipse(this.x + this.mineOffsetX, this.y + this.mineOffsetY, this.w * 0.5);\n } \n else {\n fill(200);\n this.makeShape()\n if (this.neighborCount > 0) {\n textAlign(CENTER);\n fill(0);\n text(this.neighborCount, this.x + this.textOffsetX, this.y + this.textOffsetY);\n }\n }\n }\n }", "function displayMessage(message) {\n console.log(message);\n }", "function winScreen() {\n push();\n textSize(30);\n fill(235, 216, 52);\n stroke(0);\n strokeWeight(5);\n textAlign(CENTER, CENTER);\n text(`You were correct enough times`, width / 2, height / 2);\n pop();\n}", "function show(type, messages) {\n ensureOverlayExists(() => {\n messages.forEach((message) => {\n const entryElement = document.createElement(\"div\");\n const typeElement = document.createElement(\"span\");\n const { header, body } = formatProblem(type, message);\n\n typeElement.innerText = header;\n typeElement.style.color = `#${colors.red}`;\n\n // Make it look similar to our terminal.\n const text = ansi_html_community_default()((0,html_entities_namespaceObject.encode)(body));\n const messageTextNode = document.createElement(\"div\");\n\n messageTextNode.innerHTML = text;\n\n entryElement.appendChild(typeElement);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(messageTextNode);\n entryElement.appendChild(document.createElement(\"br\"));\n entryElement.appendChild(document.createElement(\"br\"));\n\n containerElement.appendChild(entryElement);\n });\n });\n}", "function showMsg() {\n\tokButton.textContent = 'OK';\n\talertPre.textContent = demo_msgs;\n\talertArea.style.display = 'block';\n}", "function displayMessage(text, type) {\n\t// A successful message will give the statusBox a green background and show the hidden element\n\tif (type == 'success') {\n\t\tdocument.getElementById('statusBox').style.background = '#4CAF50';\n\t\tdocument.getElementById('statusBox').style.display = 'block';\n\t\tdocument.getElementById('status').innerHTML = text;\n\t\tsetTimeout(function(){ document.getElementById('statusBox').style.display = 'none'; }, 5000);\n\n\t}\n\n\n\t// A failed message will give the statusBox a red background and show the hidden element\n\tif (type == 'failed') {\n\t\tdocument.getElementById('statusBox').style.background = '#f44336';\n\t\tdocument.getElementById('statusBox').style.display = 'block';\n\t\tdocument.getElementById('status').innerHTML = text;\n\t\tsetTimeout(function(){ document.getElementById('statusBox').style.display = 'none'; }, 5000);\n\t}\n}", "function displayMessage() {\n mainEl.textContent = message;\n}", "function showMsg(msg)\n\t{\n\t\t\n\t\tvar msgdiv = document.getElementById(\"msg\");\n\t\tmsgdiv.innerText = msg; \n\t\t\n\t}", "function display(error, data) {\n if (error) {\n console.log(error);\n }\n\n myBubbleChart('#vis', data);\n}", "function display(error, data) {\n if (error) {\n console.log(error);\n }\n\n myBubbleChart('#vis', data);\n}", "function popUpMsg(feature, layer) {\n layer.bindPopup(\"<h3>\" + feature.properties.mag + \" : Magnitude | \" + feature.geometry.coordinates[2] + \" : Depth | \" + feature.properties.place +\n \"</h3><hr><p>\" + new Date(feature.properties.time) + \"</p>\");\n }", "function showMsg(msg, color) {\n // Empty the input field for user's ease\n guessField.value = \"\";\n // Appending the message into the tab\n msgTab.innerHTML = `<p class=\"lead\">${msg}</p>`;\n // Change the background color according to the condition\n document.body.style.backgroundColor = color;\n // Pop up the message\n msgTab.style.display = \"block\";\n}", "show() {\n strokeWeight(this.stroke);\n fill(this.color);\n rect(this.x, this.y, this.w, this.h);\n\n if (this.dragging == false) {\n strokeWeight(1);\n fill(0);\n textSize(1 * this.h);\n text(`${this.length}`, UBoxUlcX+UBoxWidth-50, this.y + this.h);\n }\n }", "function showMessage(message) {\n console.log(message);\n }", "showResult(ctx) {\n\t\tctx.drawImage(ASSET_MANAGER.getAsset(\"./sprites/end game GUI.png\"), 150, 150);\n\t\tctx.font = \"30px Arial\";\n\t\tctx.fillText((\"Score: \" + this.score), 200, 225);\n\t\tctx.fillText((\"Highest combo: \" + this.highestCombo), 200, 275);\n\t\tctx.stroke();\n }", "function displayQuestion() {\n push();\n textAlign(LEFT, CENTER);\n textSize(28);\n fill(255);\n text(`lvl #2`, width / 20, height / 20);\n text(`On a scale from 'I got this' to 'AAAAAAH',\nhow confident do you feel about the future?`, width / 20, height / 10 * 2)\n pop()\n}", "function message(msg){\n document.getElementById('message').innerHTML = msg;\n }", "function drawWinnerText() {\n fill(255);\n textSize(28);\n textAlign(CENTER);\n text(message, width/2, height - 50);\n}", "function drawWinnerText() {\n fill(255);\n textSize(28);\n textAlign(CENTER);\n text(message, width/2, height - 50);\n}", "displayWinningMessage() {\n this.setRank();\n\n const winningMessage = this.createWinningMessage();\n\n this.gameSlideOut();\n\n this.removeDifficultyClassesAndAddVictoryToGameContainer();\n this.displayMessage(winningMessage);\n\n this.showText(winningMessage);\n }", "function displayMessage(message) {\n closePopups();\n $(\"#message-box\").text(message);\n $(\".backdrop\").css(\"display\", \"inline\");\n $(\"#info-box\").css(\"display\", \"inline\");\n }", "function display(error, data) {\r\n if (error) {\r\n console.log(error);\r\n }\r\n\r\n myBubbleChart('#vis', data);\r\n}", "function textOnScreen() {\n createP('Refresh The Page To Reset');\n createP('Press W to Remove Obstacles');\n createP('Press Q To Increase Number of Obstacles');\n }", "function Display_showGameMessage(_msg) {\n\t// Clear out previous messages\n\tthis.clear(document.getElementById(\"divAboveAll\"));\n\n\t// Show messagebox\n\tvar divMessageBox = document.createElementNS(this.xhtmlns, \"div\");\n\tdivMessageBox.setAttribute(\"id\", \"divMessageBox\");\n\t\t// Message\n\t\tdivMessageBox.appendChild(document.createTextNode(_msg));\n\n\tdocument.getElementById(\"divAboveAll\").appendChild(divMessageBox);\n\n\tvar messageBoxIn = new Animation(\"divMessageBox\");\n\tmessageBoxIn.onComplete = function() {\n\t\tvar messageBoxOut = new Animation(\"divMessageBox\");\n\t\tmessageBoxOut.onComplete = function() {\n\t\t\tdisplay.removeGameMessage();\n\t\t}\n\t\tmessageBoxOut.cssAttributeMotion(\"bottom\", -120, \"px\", 2);\n\t}\n\tmessageBoxIn.cssAttributeMotion(\"bottom\", 0, \"px\", .75);\n}", "function showFinishMessage() {\n \tfinish.style.display = 'block';\n const starsCopy = stars.cloneNode(true);\n const timeCopy = time.cloneNode(true);\n const moveTrackerCopy = moveTracker.cloneNode(true);\n \twinMessage.appendChild(restartCopy);\n \twinMessage.appendChild(starsCopy);\n \twinMessage.appendChild(timeCopy);\n \twinMessage.appendChild(moveTrackerCopy);\n}", "function showCssMsg() {\r\n msg.innerText = ''\r\n disableButton()\r\n message.style.display = 'none'\r\n innerMsg.style.display = 'block'\r\n // var cssmsg = document.createElement('p')\r\n msg.innerText = \"Css is a cascading style sheet used for styling purpose.\"\r\n innerMsg.appendChild(msg)\r\n innerMsg.appendChild(hr)\r\n}", "function showMessage(msg){\n document.getElementById('status').style.visibility = 'visible';\n document.getElementById('message').innerHTML = msg;\n}", "function display()\n{\n nameDisp.textContent= name;\n scoreDisp.textContent= score;\n lifeDisp.textContent= life;\n missileDisp.textContent= missile;\n levelDisp.textContent= level;\n}", "function display(error, data) {\n if (error) {\n console.log(error);\n }\n myBubbleChart('.visualisierung__svgcontainer', data);\n}", "show() {\n strokeWeight(2);\n fill(224, 65, 65);\n rect(this.x, this.y, this.w, this.h);\n\n // if the used job rectangle covers the text with the lane number \n // redraw the same text over everythin \n if (this.x + this.w > 35) {\n strokeWeight(.5);\n fill(0);\n text(`Lane ${this.lane + 1}`, lanes[this.lane].x + (.06 * lanes[this.lane].w), lanes[this.lane].y + (.5 * lanes[this.lane].h) + 3);\n }\n\n\n // Display the amount of space that is remaining in the lane \n strokeWeight(.5);\n fill(0);\n text(`Space Remaining: ${lanes[this.lane].remaining}`, lanes[this.lane].x + (.75 * lanes[this.lane].w), lanes[this.lane].y + (.5 * lanes[this.lane].h) + 3);\n }", "function displayMessage(title,text){\n\t\ttry{\n\t\t\tvar msg = message.create({\n\t\t\t\ttype: message.Type.INFORMATION,\n\t\t\t\ttitle: title,\n\t\t\t\tmessage: text\n\t\t\t});\n\t\t\treturn msg;\n\t\t} catch(ex) {\n\t\t\tconsole.log(ex.name,'function name = displayMessage, message = '+ex.message);\n\t\t}\n\t}", "function displayToScreen() {\n\n\n\t}", "displayMessage(message) {\n this.messageContainerEl.innerHTML = `<div class='message'>${message}</div>`;\n this.messageContainerEl.classList.add('visible');\n }", "function displayGameOver() {\n push();\n textAlign(CENTER,CENTER);\n textSize(60);\n fill(0,0,0);\n stroke(255,0,0);\n textFont(fontGame);\n text(\"Your artistic experience is terminated \\n sorry Warhol \\n \\n REFRESH to play again :)\",width/2,height/2);\n pop();\n}", "function displayMessage(type, message) {\n msgDiv.textContent = message;\n msgDiv.setAttribute(\"class\", type);\n }", "function showMessage(msg) {\n displayMessage.innerText = msg;\n}", "function display(message){\n\tdataElement.innerHTML = dataElement.innerHTML+'<br>'+message;\n}", "showInfo() {\n let venusInfo;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Venus infos\n venusInfo = createGraphics(280, 250);\n venusInfo.fill(green.r, green.g, green.b);\n venusInfo.background(20, 220);\n venusInfo.textSize(10);\n venusInfo.textFont(globalFont);\n venusInfo.textAlign(LEFT);\n venusInfo.text(this.info, 10, 20, 260, 250);\n texture(venusInfo);\n\n // Calling the superclass Planet.js' showInfo method\n super.showInfo();\n pop();\n }\n }\n }", "display() {\n push();\n noStroke();\n fill(80);\n rectMode(CORNER);\n rect(this.x, this.y, this.w, this.h);\n pop();\n }", "function display(error, data) {\n if (error) {\n console.log(error);\n }\n console.log(data.name);\n myBubbleChart('#vis', data);\n}", "function displayBubble() {\n push();\n fill(0, 13, 200);\n ellipse(bubble.x, bubble.y, bubble.size);\n pop();\n}", "function msg(text) {\n document.getElementById('debug').innerText = text;\n}", "function showJavaMsg() {\r\n disableButton()\r\n message.style.display = 'none'\r\n innerMsg.style.display = 'block'\r\n // var javamsg = document.createElement('p')\r\n msg.innerText = \"Java is high-level programming language developed by sun Microsystems\"\r\n innerMsg.appendChild(msg)\r\n innerMsg.appendChild(hr)\r\n\r\n}", "function message(msg){\n\tdocument.getElementById('output').innerHTML = msg + \" event\"\n}", "function showMessage(msg) {\n // window.alert(msg.innerHTML);\n msg.style.visibility = \"visible\";\n}", "function display(message) {\n document.querySelector('.message').textContent = message;\n}", "function displayInfo() {\n\tctx.fillStyle = '#FFFFFF';\n\tctx.font = '16px Times New Roman';\n\tfor (var i = 0; i < lives; i++) {\n\t\tctx.drawImage(player.ship, 800 + (i*20), 90, 15, 20);\n\t\tctx.fillText(\"Lives: \", 750, 100);\n\t}\n\tctx.fillText(\"Level: \" + level, 750, 130);\n\tctx.fillText(\"Score: \" + score, 750, 160);\n\tctx.fillText(\"Controls\", 750, 240);\n\tctx.fillText(\"Arrow keys to move\", 750, 270);\n\tctx.fillText(\"Space to shoot\", 750, 300);\n\tctx.fillText(\"W to warp\", 750, 330);\n\treturn;\n}", "display() {\n push();\n fill(255, 0, 0);\n ellipse(this.x, this.y, this.size);\n pop();\n }", "function showInfoMessage(sMessage) {\n ppsc().showInfoMessagePane(sMessage);\n}", "display() {\n fill(this.r, this.g, this.b, this.a);\n textSize(this.s);\n text(\"BEYONCE?\", this.pos.x, this.pos.y);\n //one parameter makes an ellipse a circle\n }", "function writeMsg() {\r\n\r\n\t// Clear the previous frame of the bottom left corner text\r\n\ttextctx.clearRect(10,540,500,30);\r\n\t// Clear the previous frame of the top left corner text\r\n\ttextctx.clearRect(10,25,200,50);\r\n\t\r\n\t\r\n\ttextctx.fillStyle = \"rgb(250, 250, 250)\";\r\n\ttextctx.font = \"15px pixelmixregular\";\r\n\ttextctx.textAlign = \"left\";\r\n\ttextctx.textBaseline = \"top\";\r\n\r\n\t\r\n\t\r\n\r\n\t// Only write if the game isn't over\r\n\tif (!gameOver){\r\n\t\r\n\t\ttextctx.fillText(\"Nb Vies : \" + player.lives, 18, 25);\r\n\t\ttextctx.fillText(\"Sante : \" + player.health, 18, 50);\r\n\t\t\r\n\t\tif (presentsToCollect <= 5) {\r\n\t\t\ttextctx.fillText(\"Nombre de cadeaux restants : \" + presentsToCollect, 18, 540);\r\n\t\t}else{\r\n\t\t\t//textctx.fillText(\"Tous les cadeaux sont recueillis! Retournez au début.\");\r\n\t\t}\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n}", "function display(node, msg) {\n console.log( \"got:\" + msg.payload);\n\t\n // preprocess the string if we want\n // - dimensions?\n // - screen scrollage?\n\n // clear the screen\n // push the new message \n if (msg.light==true ){\n msg.light = \"on\";\n } else {\n msg.light = \"off\";\n }\n\n\n \n if (node.child != null) {\n node.log(\"push the msg to the driver\");\n node.child.stdin.write('light ' + msg.light + '\\n');\n node.child.stdin.write('disp ' + msg.payload + '\\n');\n } else {\n executeCmd(node, \"disp \" + msg );\n }\n\n} // display function", "display() {\n push();\n translate(this.pX, this.pY);\n fill(color(255, 255, 255, (random(120))));\n ellipse(0, 0, this.rR);\n pop();\n }", "function error(message) {\n jsav.umsg(message, {\"color\" : \"red\"});\n jsav.umsg(\"<br />\");\n }", "function msg()\n\t{\n command.message(`<font color=\"#FDD017\">Talents info:</font> LVL <font color=\"#00FFFF\">${lvl}</font>, EXP: <font color=\"#00FFFF\">${exp}</font>, soft DailyEXP <font color=\"#00FFFF\">${dexp}/${sdcap()} (${Math.round(100*dexp/sdcap())}%)</font>`);\n\t}", "function displayMessageBlock(message) {\n displayMessage(message);\n displayMessage(\"\");\n}", "function displayBubble() {\n push();\n noStroke();\n fill(100, 100, 200, 150);\n ellipse(bubble.x, bubble.y, bubble.size);\n pop();\n}", "function displayInfoText(newMessage) {\n\tsetupWebKitGlobals();\n\t\n\tif (globals.webKitWin.setString) {\n\tglobals.webKitWin.setString(\"staticTextArea\", newMessage);\n}\n}", "function displayMessage(msg) {\n document.getElementById(\"greeting\").textContent = msg;\n}", "function Quiz2Content(windowID : int)\n{\n GUI.Label (Rect (10, 20, 1280, 720), \" \");\n \n}", "function displayCheck() {\r\n id(\"msg\").innerText = \"Nice try but the correct answer is \" + answer;\r\n toggleMsg(\"game\");\r\n }", "showInfo() {\n let saturnInfo;\n if (!this.visible) {\n if(scorebox.score >= this.totalStars) {\n push();\n // Saturn infos\n saturnInfo = createGraphics(280, 250);\n saturnInfo.fill(green.r, green.g, green.b);\n saturnInfo.background(20, 220);\n saturnInfo.textSize(10);\n saturnInfo.textFont(globalFont);\n saturnInfo.textAlign(LEFT);\n saturnInfo.text(this.info, 10, 20, 260, 250);\n texture(saturnInfo);\n\n // Calling the superclass Planet.js' showInfo method\n super.showInfo();\n pop();\n }\n }\n }", "function showErrorMessage(message){\r\n\tPNotify.removeAll();\r\n\tvar stack_topleft = {\"dir1\": \"down\", \"dir2\": \"left\", \"push\": \"top\"};\r\n\tnew PNotify({\r\n\t type: 'error',\r\n\t title: 'Error',\r\n\t text: message,\r\n\t addclass: \"stack_topleft\",\r\n\t stack: stack_topleft\r\n\t});\r\n}", "function displayError(message)\n\t{\n\t\t// Show message\n\t\tvar message = formWrapper.message(message, {\n\t\t\tappend: false,\n\t\t\tarrow: 'bottom',\n\t\t\tclasses: ['red-gradient'],\n\t\t\tanimate: false\t\t\t\t\t// We'll do animation later, we need to know the message height first\n\t\t});\n\n\t\t// Vertical centering (where we need the message height)\n\t\tcenterForm(currentForm, true, 'fast');\n\n\t\t// Watch for closing and show with effect\n\t\tmessage.on('endfade', function(event)\n\t\t\t\t{\n\t\t\t// This will be called once the message has faded away and is removed\n\t\t\tcenterForm(currentForm, true, message.get(0));\n\n\t\t\t\t}).hide().slideDown('fast');\n\t}", "function renderMessage(text) {\n document.getElementById('res').innerHTML = text;\n}", "warning() {\n this.canvas[1].font = \"20px Arial\";\n this.canvas[1].fillText(this.message,10,130);\n }", "function displayFailureMessage() {\n if (this.output_displayed) {\n document.getElementById(\"OUTPUT\").innerHTML = \"\";\n this.output_displayed = false;\n }\n var output = document.getElementById(\"OUTPUT\");\n var title = document.createElement(\"HEADER\");\n title.setAttribute(\"id\", \"output_header\"); \n var y = document.createElement(\"H2\");\n var t = document.createTextNode(\"Unfortunately, we couldn't find popular times data for the specified input(s)\");\n y.appendChild(t);\n title.appendChild(y);\n output.appendChild(title);\n this.output_displayed = true;\n}", "function showImportantMessage(sMessage) {\n ppsc().showImportantPane(sMessage);\n}", "show() {\n push();\n noStroke();\n fill(120, 180, 255, 150);\n\n translate(this.position.x, this.position.y);\n\n if (this.crashed) {\n fill(255, 0, 0);\n\n circle(0, 0, 12);\n\n pop();\n return;\n }\n\n circle(0, 0, 14);\n pop();\n }", "function displayMessage(msg)\n{\n document.getElementById(\"greeting\").innerText = msg;\n}", "display() {\n\n push();\n fill(225, 225, 100, 50);\n noStroke();\n ellipse(this.x, this.y, this.size);\n pop();\n\n }", "function displayMsg(msg, callback) {\r\n\t\talert(msg);\r\n\t\tif(callback){\r\n\t\t\tcallback(msg);\r\n\t\t}\r\n\t}", "display() {\n push();\n fill(this.fill.r, this.fill.g, this.fill.b, this.fill.alpha);\n ellipse(this.x, this.y, this.size);\n pop();\n }", "function showInfo(message)\n{\n newmessage(\"bg-info\", \"<span class='glyphicon glyphicon-exclamation-sign'></span> \"+message, 4000);\n}", "function drawMessage() {\n ctx.fillStyle = questionBarColor;\n ctx.fillRect(canvas.width / 2 - 250, canvas.height - 325, 500, 150);\n ctx.fillStyle = \"white\";\n ctx.font = \" 32px cymraeg\";\n ctx.fillText(\"Dewiswch avatar,\", canvas.width / 2 - 5, canvas.height - 310);\n ctx.fillText(\"yna, rhowch eich enw\", canvas.width / 2 - 5, canvas.height - 270);\n ctx.fillText(\"a cliciwch parhau\", canvas.width / 2 - 5, canvas.height - 230);\n}", "show() {\n fill(0, 204, 0);\n rect(this.x, this.topY, \n this.width, this.height);\n }", "function Quiz4Content(windowID : int)\n{\n GUI.Label (Rect (10, 20, 1280, 720), \" \");\n \n}", "function DisplayMessage() {\n\n setuptools.state.notifier = true;\n setuptools.lightbox.build('muledump-about', ' \\\n <br><a href=\"' + setuptools.config.url + '/CHANGELOG\" class=\"drawhelp docs nostyle\" target=\"_blank\">Changelog</a> | \\\n <a href=\"' + setuptools.config.url + '/\" target=\"_blank\">Muledump Homepage</a> | \\\n <a href=\"https://github.com/jakcodex/muledump\" target=\"_blank\">Github</a> \\\n <br><br>Jakcodex Support Discord - <a href=\"https://discord.gg/JFS5fqW\" target=\"_blank\">https://discord.gg/JFS5fqW</a>\\\n <br><br>Did you know Muledump can be loaded from Github now? \\\n <br><br>Check out <a href=\"' + setuptools.config.url + '/muledump.html\" target=\"_blank\">Muledump Online</a> to see it in action. \\\n ');\n if (setuptools.state.loaded === true && setuptools.data.config.enabled === true) setuptools.lightbox.build('muledump-about', ' \\\n <br><br>Create and download a <a href=\"#\" class=\"setuptools app backups noclose\">backup</a> from here to get online fast. \\\n ');\n\n setuptools.lightbox.override('backups-index', 'goback', function () {\n });\n setuptools.lightbox.settitle('muledump-about', '<strong>Muledump Local v' + VERSION + '</strong>');\n setuptools.lightbox.display('muledump-about', {variant: 'select center'});\n $('.setuptools.app.backups').click(setuptools.app.backups.index);\n $('.drawhelp.docs').click(function (e) {\n setuptools.lightbox.ajax(e, {title: 'About Muledump', url: $(this).attr('href')}, this);\n });\n\n }", "function _display(){\n\t\t\t$(levelID).html(level);\n\t\t\t$(pointsID).html(points);\n\t\t\t$(linesID).html(lines);\n\t\t}" ]
[ "0.6781029", "0.6562934", "0.6557501", "0.6468709", "0.6403867", "0.63917327", "0.63595766", "0.6345752", "0.6311521", "0.6285033", "0.62070215", "0.6192124", "0.61890095", "0.6188552", "0.61875176", "0.61860394", "0.6182458", "0.6149878", "0.6148623", "0.6141957", "0.61419404", "0.6131631", "0.61302483", "0.612941", "0.61216486", "0.60970235", "0.60962623", "0.6095295", "0.6094925", "0.6088826", "0.60782707", "0.60782707", "0.60778517", "0.6076778", "0.6067016", "0.6062449", "0.6059487", "0.6058669", "0.60570097", "0.6049666", "0.6049666", "0.6043128", "0.6041985", "0.6033167", "0.6019725", "0.60159236", "0.60108757", "0.60037106", "0.59921193", "0.5988086", "0.5987421", "0.5986882", "0.5979793", "0.5969406", "0.59693766", "0.59673375", "0.59666115", "0.5959803", "0.59482723", "0.5938967", "0.5937021", "0.5936757", "0.59347963", "0.5928626", "0.59277016", "0.5910238", "0.5908192", "0.59045136", "0.59003514", "0.5898958", "0.5898368", "0.5894284", "0.58934855", "0.58917123", "0.5880653", "0.58779025", "0.58708245", "0.5869768", "0.58611494", "0.585302", "0.5848621", "0.5847716", "0.5844421", "0.5843955", "0.58388275", "0.5836731", "0.583566", "0.5833177", "0.58318734", "0.58252317", "0.58237225", "0.58235115", "0.5821248", "0.5816605", "0.5810012", "0.5809121", "0.58074045", "0.5796502", "0.5795558", "0.57950646", "0.5793055" ]
0.0
-1