Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Function for displaying image data
function renderButtons() { // Deleting the images prior to adding new topics // (this is necessary otherwise you will have repeat buttons) $("#buttons-view").empty(); // Looping through the array of topics for (var i = 0; i < topics.length; i++) { // Then dynamicaly generating buttons for each topic in the array // This code $("<button>") is all jQuery needs to create the beginning and end tag. (<button></button>) var a = $("<button>"); // Adding a class of topic to our button a.addClass("topic"); // Adding a data-attribute a.attr("data-name", topics[i]); // Providing the initial button text a.text(topics[i]); // Adding the button to the giphy-view div $("#buttons-view").append(a); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function image_display() {\r\n\r\n}", "function displayImage(){\n\n}", "function imageDisplay(index){\n\t\tif( index >= data.length ){\n\t\t\treturn;\n\t\t} else {\n\t\t\tcreateImage(data[index].src, data[index].width, data[index].height);\n\t\t}\n\t}", "function _show_image_data() {\r\n\r\n if (!settings.fixedDataBox) {\r\n //$('#lightbox-image-details-caption').hide();\r\n }\r\n if ( settings.imageArray[settings.activeImage][1] ) {\r\n var dash = settings.imageArray.length > 1 ? '- ' : '';\r\n $('#lightbox-image-details-caption').html(dash + settings.imageArray[settings.activeImage][1]).show();\r\n } else {\r\n $('#lightbox-image-details-caption').hide();\r\n }\r\n if ( settings.changeCounterAfterSlide ){\r\n // If we have a image set, display 'Image X of X'\r\n if ( settings.imageArray.length > 1 ) {\r\n $('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\r\n }\r\n }\r\n }", "function showImage() {\n context.drawImage(v, 0, 0, c.width, c.height);\n \n }", "function _show_image_data() {\n\t\t\t$('#lightbox-container-image-data-box').slideDown('fast');\n\t\t\t$('#lightbox-image-details-caption').hide();\n\t\t\tif ( settings.imageArray[settings.activeImage][1] ) {\n\t\t\t\t$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();\n\t\t\t}\n\t\t\t// If we have a image set, display 'Image X of X'\n\t\t\tif ( settings.imageArray.length > 1 ) {\n\t\t\t\t$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\n\t\t\t}\t\t\n\t\t}", "function _show_image_data() {\r\n\t\t\t$('#lightbox-container-image-data-box').slideDown('fast');\r\n\t\t\t$('#lightbox-image-details-caption').hide();\r\n\t\t\tif ( settings.imageArray[settings.activeImage][1] ) {\r\n\t\t\t\t$('#lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();\r\n\t\t\t}\r\n\t\t\t// If we have a image set, display 'Image X of X'\r\n\t\t\tif ( settings.imageArray.length > 1 ) {\r\n\t\t\t\t$('#lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\r\n\t\t\t}\t\t\r\n\t\t}", "function displayImage(srcData,usernameData) {\r\n const div = document.createElement('div');\r\n\r\n const p = document.createElement('p');\r\n p.classList.add('meta');\r\n p.innerText = \"\";\r\n p.innerHTML += `<span>${usernameData}</span>`;\r\n p.style.color = 'green';\r\n p.style.fontFamily = 'Lucida Handwriting';\r\n div.appendChild(p);\r\n document.querySelector('.chat-messages').append(div);\r\n\r\n const div2 = document.createElement('div');\r\n var newImage = document.createElement('img');\r\n newImage.src = srcData;\r\n div2.append(newImage);\r\n\r\n //div.append(newImage);\r\n document.querySelector('.chat-messages').append(div2);\r\n \r\n}", "function onPhotoDataSuccess2(imageData) {\n ImageSrc = \"data:image/jpeg;base64,\" + imageData;\n\t document.getElementById(\"container2\").innerHTML = \"<img src = '\" + ImageSrc + \"' width = '100%'/>\"\n\t }", "function displayImage(user , srcData ) {\r\n var newImage = document.createElement('img');\r\n newImage.src = srcData;\r\n \r\n // document.getElementById(\"historyMsg\").innerHTML = user + newImage.outerHTML;\r\n \r\n messageArea.append(newImage);\r\n appendMessage(`${user} send image...`);\r\n autoScrollDown();\r\n // alert(\"Converted Base64 version is \" + document.getElementById(\"historyMsg\").innerHTML);\r\n\r\n}", "function displayImage(img) {\n\tdisplay.querySelector('img').setAttribute('src', img.getAttribute('src').replace('small', 'large'));\n\tdisplay.querySelector('img').setAttribute('alt', img.getAttribute('alt'));\n\tdisplay.querySelector('h3').innerHTML = img.getAttribute('title');\n\tdisplay.querySelector('a').href = img.getAttribute('url');\n\tdisplay.querySelector('figcaption').innerHTML = img.getAttribute('alt');\n}", "function getImageInfo() {\n\n}", "function loadImageDetails(){\n $(\".image-url\").text(`URL: ${displayedImg.url}`);\n $(\".image-id\").text(`ID: ${displayedImg.id}`);\n $(\".image-author\").text(`Author: ${displayedImg.author}`)\n}", "function displayImage(){\n\t//Function always displays the image in the \"0\" value of the array\n\tcurrentImage.image = \"galleryImages/\" + imageFiles[0];\n}", "function pictureFormatter(res) {\n return <img src={res[0]} alt={res[1]} />;\n }", "draw() {\n // Displaying the image\n image(experimentImage, 0, 0, width, height);\n }", "function New_Image_Display(n) {\n image_index += n;\n if (image_index > image_files_in_dir.length) {\n image_index = 1\n }\n if (image_index < 1) {\n image_index = image_files_in_dir.length\n };\n \n val_obj = {descriptionInput:'', taglist:'', imgMain:image_files_in_dir[image_index - 1]}\n //view_annotate_module.Annotation_DOM_Alter(val_obj)\n\n //UNOCMMENT LATER!!!!\n tagging_view_annotate.Annotation_DOM_Alter(val_obj)\n\n //Load_State_Of_Image()\n\n //UNOCMMENT LATER!!!!\n Load_State_Of_Image_IDB() \n\n}", "function renderImage(data) { \n //function takes image from data\n //replaces our dog image with data.image\n \n dogImage.src = data.message\n}", "function printImages (data) {\n if(data.location !== null && typeof data.location !== 'undefined'){\n var imgUrl = data.images.low_resolution.url;\n var lat = data.location.latitude;\n var lng = data.location.longitude;\n var newImage = $('<img>');\n \n newImage.attr({\n src: data.images.standard_resolution.url,\n class: \"image\",\n alt: data.caption.text,\n onclick: \"getRoute(\" + lat + \",\" + lng + \"); blockPage(this.src, this.alt);\"\n });\n $('#imageContainer').append(newImage);\n }\n//TÄHÄN ELSE TMS. HAKEMAAN LISÄÄ KUVIA JOS SIJAINTI EI TIEDETTY? KORVATTU LISÄÄMÄLLÄ PYYNNÖN COUNT-ARVOA\n}", "display() {\n if (this.isDrank === false) {\n //Display\n image(this.image, this.x, this.y, this.size, this.size);\n }\n }", "function imageDisplay() {\n var color = imageColor();\n var captionColor = color;\n captionColor = color.replace(/_/g, \" \").replace('solid', '');\n var captionProduct = name.replace('<br>', '&nbsp;');\n var caption = (captionColor+\" \"+captionProduct).replace(/(^|\\s)\\S/g, function(match) {\n return match.toUpperCase();\n });\n var img_source = \"../../images/products/\"+img+color+\".gif\";\n var lightbox_img = \"../../images/products/large/\"+img+color+\".gif\";\n var lightbox_img_back = \"../../images/products/back/large/\"+img+color+\".gif\";\n $('#product_img_front').attr('src', img_source);\n $('#product_img_front_large').attr('src', lightbox_img);\n $('#product_img_back_large').attr('src', lightbox_img_back);\n $('#product_img_front').parent().attr('href', lightbox_img).attr('data-lightbox', img+color).attr('title', caption);\n $('#product_img_back').attr('href', lightbox_img_back).attr('data-lightbox', img+color).attr('title', caption+' (Back)');\n}", "function generateAndDrawImage()\n { \n // generate image data from DICOM\n view.generateImageData(imageData); \n // set the image data of the layer\n imageLayer.setImageData(imageData);\n // draw the image\n imageLayer.draw();\n }", "function show(image, greyscale) {\n for(y=0; y<image.length; y++) {\n var row = image[y];\n for(x=0; x<row.length; x++) {\n pixel(x, y, row[x], greyscale);\n }\n }\n}", "function displayImage(id) {\n //log('display ' + key);\n return initDB('thr').then(function(db) {\n return readRecord(db, 'books', id).then(function(book) {\n var key = uriToKey(book.pages[0].url);\n return readRecord(db, 'images', key).then(function(result) {\n var $img = $('<img>');\n if (result instanceof Blob) {\n result = window.URL.createObjectURL(result);\n }\n $img.attr('src', result);\n return $img;\n });\n });\n });\n }", "function displayData(data) {\n document.getElementById('image').setAttribute('src',data.imageURL);\n document.getElementById('loc').textContent=`${data.location}, ${data.country}`;\n document.getElementById('weather').textContent=`The weather condition by then will be ${data.description}`;\n document.getElementById('temp').textContent=`Max Temperature: ${data.maxTemp} & Min Temperature ${data.minTemp}`;\n document.getElementById('days').textContent=`${Math.round(data.daysToTravel)} days to go`;\n document.getElementById('dates').textContent=`Start Date: ${data.travelStartDate} & Return Date: ${data.travelEndDate}`;\n document.getElementById('tripDuration').textContent=`Trip Duration: ${data.tripDuration} days`\n}", "show() {\n // circle(this.x, this.y, this.circ);\n // args: image(image var, top edge, left edge, width, height);\n image(charImg, this.x, this.y, this.circ, this.circ);\n }", "function displayImage() {\n $(\"#image-holder\").html(\"<img src=\" + images[count] + \" width='400px'>\");\n}", "function make_image(data){\n var html=\"\";\n html+=\"<div class='photo'>\";\n html+=\"<img src='\"+data[\"path\"]+\"'>\";\n html+=\"<div class='description'>\"+data[\"description\"]+\"</div>\";\n html+=\"<div class='date'>\"+data[\"date\"]+\"</div>\";\n html+=\"</div>\";\n return html;\n}", "function viewFullImg(uri){\n\tconst html = `<img src=\"${uri}\">`\n\tdocument.getElementById(\"results\").innerHTML = html;\n}", "function render(dataSet){\n \tdataSet.data.forEach(function(item,i){\n \tvar gif = dataSet.data[i].images.fixed_height.url;\n \t$(\"#main\").append(\"<img class='img-thumbnail'src='\" + gif + \"'>\"); // mind the single vs. double quotes!\n \t});\n\t}", "function draw_viewer() {\n canvas.innerHTML = \"\";\n var n = curr_row;\n while(n < data.length && \n n < (curr_row + ROWS_TO_SHOW)) {\n var div = document.createElement(\"div\");\n div.style.width = 8 * IMG_WIDTH + \"px\";\n var h3 = document.createElement(\"span\");\n h3.innerHTML = data[n].timestamp.replace('T', ' ');\n div.appendChild(h3);\n div.appendChild(document.createElement(\"br\"));\n data[n].imageobjs.each(function(imageobj) {\n imageobj.addEventListener(\"click\", function() {\n window.open(imageobj.src);\n }, false);\n div.appendChild(imageobj);\n });\n canvas.appendChild(div); \n n++;\n } \n }", "function displayImage(){\n\t context.drawImage(video,0,0,320,240);\n //This is where we write the picture data and turn it into a dataURL so we can feed it to the API\n\t\tdURL = canvasElement.toDataURL(\"image/jpeg\",1);\n\n\t\t//call the function to send the image to the emotion API\n\t\tfaceProcess();\n}", "display() {\n push();\n noStroke();\n imageMode(CENTER);\n image(this.avalancheImg, this.x, this.y, this.width, this.height);\n pop();\n }", "display() {\n push();\n // Centering image for easier image placement\n imageMode(CENTER);\n image(this.image, this.x, this.y, 1500, 300);\n pop();\n }", "function 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 dispImg(){\n\tnumber_of_imgs = 1699/170;\n\tfor(var i=0;i<=number_of_imgs;i++){\n\t\tstrip.innerHTML += '<img src=\"'+img[i]+'\" onclick=\"return show(this.id);\"/ id=\"'+i+'\">' };\n}", "function createImage(data) {\n //image output\n var img_output;\n //clear image search value\n $(\".contextual-choice input\").val(\"\");\n if (data !== \"\") {\n //create each image element\n var $img = $('<img class=\"flex-img\">').attr(\"src\", data);\n //add image\n img_output = $img;\n }\n //check for visible contextual-output - if not visible\n if (checkVisible($(\".contextual-output\")) === true) {\n changeClass(\".note-output\", \"col-12\", \"col-4\");\n }\n //append output to DOM\n $(\".contextual-output\").append(img_output);\n //fade in contextual-output with appended results\n $(\".contextual-output\").fadeIn(\"slow\");\n }", "function 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 showImageDetailedExifInfo(index, elem) {\r\n var image = images[index];\r\n EXIF.getData(image, function () {\r\n document.getElementById(elem).innerHTML = EXIF.pretty(this);\r\n });\r\n showImageDetailedExifWithMap(index, 'map');\r\n }", "function displayImage(image) {\n var img = document.createElement(\"IMG\");\n img.src = image.url; \n img.style = \"margin: 15px\";\n document.getElementById('root').appendChild(img);\n}", "function getImageData(){\n\n }", "function addImage (data) {\n var element = document.createElement('div');\n element.innerHTML = '<img src=\"' + data +'\" />';\n\n var container = document.getElementById('data--container');\n container.appendChild(element);\n }", "display() {\n push();\n imageMode(CENTER);\n image(this.image, this.x, this.y, this.size * 2, this.size * 2);\n this.currentFrame = this.image.getCurrentFrame();\n pop();\n }", "function printpixeldata()\r\n{\r\n var imagedata;\r\n var canvas = document.createElement(\"canvas\");\r\n var ctx = canvas.getcontext(\"2d\");\r\n var img = new Image();\r\n\r\n img.src =\"file:///C:/Users/mahrajag.ORADEV/Desktop/D3/DragResize/MagBarChart.png\";\r\n img.width = w;\r\n img.height = h;\r\n\r\n \r\n canvas.width = w;\r\n canvas.height = h;\r\n\r\n ctx.drawImage(img,0,0,w,h);\r\n\r\n\r\n imagedata = ctx.getImageData(dragrect.attr(\"x\"), dragrect.attr(\"y\"), width, height);\r\n\r\n\r\n for (var x=0; x< width *height*4; x+=1)\r\n alert(imagedata.data[x]);\r\n\r\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 displayImages(images) {\n var imgs = [];\n images.forEach(function (element, index, array) {\n imgs.push(encode(element.Body));\n })\n res.render('results', {\n images: imgs\n });\n }", "function _show_image_data(parent,settings) {\n _callback(settings, 'preShowImageData', {'parent': parent});\n parent.find('.lightbox-image-details-caption').hide();\n if ( settings.imageArray[settings.activeImage][1] ) {\n parent.find('.lightbox-image-details-caption').html(settings.imageArray[settings.activeImage][1]).show();\n }\n // If we have a image set, display 'Image X of X'\n if ( settings.imageArray.length > 1 ) {\n parent.find('.lightbox-image-details-currentNumber').html(settings.txtImage + ' ' + ( settings.activeImage + 1 ) + ' ' + settings.txtOf + ' ' + settings.imageArray.length).show();\n }\n if (settings.captionVisible || settings.txtVisible) {\n parent.find('.lightbox-container-image-data-box').slideDown(settings.slideSpeed);\n parent.find('.lightbox-container-image-data-box').css('display', 'block');\n }\n if(settings.playTimeout) {\n window.clearTimeout(settings.timer);\n settings.timer = window.setTimeout(function() {\n if(settings.random && settings.imageArray.length > 2) {\n do {\n var next = Math.floor(Math.random()*settings.imageArray.length);\n } while(next == settings.activeImage);\n settings.activeImage = next;\n } else\n settings.activeImage++;\n settings.direction = 'left';\n _set_image_to_view(parent, settings);\n }, settings.playTimeout);\n }\n _callback(settings, 'postShowImageData', {'parent': parent});\n }", "function image_result_streamization() {\r\n \r\n}", "function drawImage(image) {\n g.clear();\n g.drawString(image, g.getWidth() / 2, g.getHeight() / 2);\n g.flip();\n}", "function displayImage(){\n\t\tvar images = { 3:\"assets/images/gym.png\", 5:\"assets/images/kanto.jpg\", 6:\"assets/images/badge.png\", 7:\"assets/images/pikachu.png\", 8:\"assets/images/squirtle.png\"};\n\t\t$(\"#imagePlace\").html(\"<img src=\"+images[randomWord.length]+\" style=\\\"height:225px;\\\">\");\n\t}", "function display_advertise_images() {\n}", "function displayComic(data) {\n\t\t \t$('.title').text(data.title);\n\t\t\t\t$('.month').text(data.month);\n\t\t\t\t$('.day').text(data.day);\n\t\t\t\t$('.year').text(data.year);\n\t\t\t\t$('.image').html('<img src=\"' + data.img + '\"/>');\n\t\t\t\t$('.alt').text(data.alt);\n\t\t\t} // end displayComic function", "function displayImageInfo() {\n\t\t\t\t// Get selected file\n\t\t\t\tvar selectedFiles = finder.request( 'files:getSelected' );\n\t\t\t\tvar file = selectedFiles.first();\n\n\t\t\t\t// Send ImageInfo command to the server\n\t\t\t\tfinder.request( 'command:send', {\n\t\t\t\t\tname: 'ImageInfo',\n\t\t\t\t\tfolder: file.get( 'folder' ),\n\t\t\t\t\tparams: {\n\t\t\t\t\t\tfileName: file.get( 'name' )\n\t\t\t\t\t}\n\t\t\t\t} ).done( function( response ) {\n\t\t\t\t\tif ( !response.error ) {\n\t\t\t\t\t\t// Display a dialog window\n\t\t\t\t\t\tfinder.request( 'dialog', {\n\t\t\t\t\t\t\ttemplate: imageInfoTemplate,\n\t\t\t\t\t\t\ttemplateModel: new Backbone.Model( response ),\n\t\t\t\t\t\t\ttitle: 'Image Info',\n\t\t\t\t\t\t\tname: 'ImageInfoDialog',\n\t\t\t\t\t\t\tbuttons: [ 'okClose' ]\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t}", "function displayText(text) {\n\tdocument.getElementById('imageLabel').innerHTML = text;\n}", "function displayImage() {\n const randomIndex = Math.floor(Math.random() * response.length);\n const imgSrc = response[randomIndex].links[0].href;\n const { title, description } = response[randomIndex].data[0];\n const imgHTML = `<img class=\"random-img\" src=\"${imgSrc}\" alt=\"${title}\">`;\n imageDescription.textContent = description;\n imageDescription.style.display = 'block';\n imageDiv.innerHTML = imgHTML;\n }", "function _img_properties_show(mime, tot_len, enc_len, mts) {\n\tvar img=d$('woas_img_tag');\n\twoas.setHTML(d$('woas_img_desc'),\n\t\twoas.i18n.MIME_TYPE+\": \"+mime+\"<\"+\"br /\"+\n\t\t\">\"+woas.i18n.FILE_SIZE+\": about \"+_convert_bytes(((tot_len-enc_len)*3)/4)+\n\t\twoas.i18n.B64_REQ.sprintf(_convert_bytes(tot_len))+\n\t\"<\"+\"br />\"+woas.last_modified(mts)+\n\t\"<\"+\"br />\"+woas.i18n.WIDTH+\": \"+img.width+\"px<\"+\"br />\"+woas.i18n.HEIGHT+\": \"+img.height+\"px\");\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 onPhotoDataSuccess(imageData) {\n //console.log(imageData);\n //Get image handle\n var picture = document.getElementById(\"picture\");\n //Unhide image elements\n picture.style.display = \"block\";\n //Show the captured photo\n picture.src = \"data:image/jpeg;base64,\" + imageData;\n }", "function showLoadedImages(elem) {\r\n var i, span, reader, file;\r\n document.getElementById(elem).style.display = \"inline\";\r\n document.getElementById(elem).innerHTML = [];\r\n for (i = 0; i < images.length; i = i + 1) {\r\n file = images[i];\r\n reader = new FileReader();\r\n reader.onload = (function (file) {\r\n var j = i;\r\n return function (e) {\r\n span = document.createElement('span');\r\n span.className = \"tile\";\r\n span.onclick = function () {\r\n showImage(j, elem);\r\n };\r\n span.innerHTML = ['<div class=\"caption\"><em>', file.name, '</em><br><small>', file.name, '</small></div><img src=\"', e.target.result, '\" title=\"', escape(file.name), '\">'].join('');\r\n document.getElementById(elem).insertBefore(span, null);\r\n };\r\n })(file);\r\n reader.readAsDataURL(file);\r\n }\r\n }", "function renderImg (imgData) {\n let checkImg = document.querySelector(\"img\");\n if (checkImg){\n main.removeChild(checkImg);\n }\n let img = document.createElement(\"img\");\n img.setAttribute(\"src\", imgData);\n main.appendChild(img);\n}", "function imagesFetched(data) {\n //console.log(\"DATA: \", data);\n data.data.forEach(printImages);\n}", "function procesarImagen(data){\r\n\tconsole.log(data);\r\n}", "function showImage(index, elem) {\r\n var image = images[index], span, button, reader;\r\n document.getElementById('list').innerHTML = [];\r\n button = document.createElement('span');\r\n button.onclick = function () {\r\n showLoadedImages(elem);\r\n };\r\n button.innerHTML = ['<button>< Go Back</button>'];\r\n document.getElementById('list').insertBefore(button, null);\r\n reader = new FileReader();\r\n reader.onload = (function (image) {\r\n return function (e) {\r\n button = document.createElement('span');\r\n button.onclick = function () {\r\n uploadImage(index);\r\n };\r\n button.id = \"uploadButton\";\r\n button.innerHTML = \"<button>Upload Image</button>\";\r\n span = document.createElement('span');\r\n span.id = \"fullsize\";\r\n span.innerHTML = ['<input type=\"text\" name=\"photo\" value=\"' + e.target.result.split(\",\")[1] + '\" hidden><img src=\"', e.target.result, '\" title=\"', escape(image.name), '\"><div id=\"title\">', image.name, '</div><aside><div id=\"map\"></div><div id=\"exif\"></div></aside>'].join('');\r\n document.getElementById(elem).insertBefore(button, null);\r\n document.getElementById(elem).insertBefore(span, null);\r\n showImageDetailedExifInfo(index, 'exif');\r\n };\r\n })(image);\r\n reader.readAsDataURL(image);\r\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 render(evt) {\n imagedata = evt;\n\n\n $('#canvasWrapper').show();\n $('#fileSelectdiv').hide();\n $('#closeImage').show();\n $('#right-side-menu').show();\n\n canvas = document.getElementById(\"image-canvas\");\n canvas2 = document.getElementById(\"anno-canvas\");\n var image = new Image();\n image.onload = function () {\n\n if (image.height > MAX_HEIGHT) {\n image.width *= MAX_HEIGHT / image.height;\n image.height = MAX_HEIGHT;\n }\n var context = canvas.getContext(\"2d\");\n context.clearRect(0, 0, canvas.width, canvas.height);\n canvas.width = image.width;\n canvas.height = image.height;\n canvas2.width = image.width;\n canvas2.height = image.height;\n context.drawImage(image, 0, 0, image.width, image.height);\n imageType = false;\n };\n image.src = evt;\n }", "CreateListElementsIMG(dataArray, imgFomart) {\n for(let i = 0; i < dataArray.length; i++) {\n this.m_Output += \"<div class='col'><div><img class='w_icon' src='\" + this.m_ThumbnailsLocation + dataArray[i].icon + \".\" + imgFomart + \"' alt='\" + dataArray[i].name + \" icon'><p>\" + dataArray[i].name + \"</p></div></div>\";\n }\n }", "function renderDogs(data) {\n // Message is an array (console.log to check) containing image URLs\n data.message.forEach(message => {\n // For each item in the array, create an img tag\n const newImage = document.createElement('img')\n // Img tags have attributes, including src. Assign the message to the src\n newImage.src = message\n newImage.height = 500\n newImage.width = 400\n // Add each created image to the image container\n imageBox.appendChild(newImage)\n })\n}", "function viewImage(id,path_image) {\n var address='<img src={}>';\n document.getElementById(id).innerHTML=address.replace(\"{}\",path_image);\n}", "function renderResults(movieInfoList) {\n var list = document.getElementById(\"resultsList\");\n list.innerHTML=\"\";\n movieInfoList.forEach(movieInfo => {\n // turns img string to img\n showImage(movieInfo);\n });\n}", "function show_image(src) \n\t{\n var img = document.createElement(\"img\");\n img.src = src;\n document.body.appendChild(img);\n\t}", "function showHTML5Pic() {\n // get a reference to the current \"pic\" image\n let img = document.getElementById(\"pic\");\n \n // clear the full canvas and then draw the canvas image from the \"pic\" image control\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n \n // draw the canvas image using the \"pic\" version\n // start the image in the upper left hand corner and use current width and height\n // see HTML5_Pic.html for example showing how to do this\n ctx.drawImage(img, 0, 0, objArray[xPic].width, objArray[xPic].height);\n \n // using the currently selected picture object, display the name, width and height properties\n // in the 3 text boxes\n document.getElementById(\"txtName\").value = objArray[xPic].name;\n document.getElementById(\"txtWidth\").value = objArray[xPic].width;\n document.getElementById(\"txtHeight\").value = objArray[xPic].height;\n}", "function showCars(){\n for(let i = 0; i < carImage.length; i++){\n image(carImage[i],xCars[i], yCars[i],carWidth,carHeigth); \n print(yCars[i], xCars[i]);\n }\n}", "function displayResults(responseJson){\r\n let finalString = \"\";\r\n finalString = '<img src=\"'+ responseJson.message +'\" alt=\"placeholder\">';\r\n $('.picBox').html(finalString);\r\n}", "function imagedisplay() {\n\t\t$('#images').show();\n\t\t$('#images').html(\"<img src='assets/images/\"+correctImage[optionIndex]+\"'>\");\n\t}", "function renderImageInfo(imageinfo) {\n console.log('imageinfo', imageinfo);\n\n var divloader = document.querySelector('#loader');\n var divoutput = document.querySelector('#output');\n divloader.style.display = \"none\";\n divoutput.style.display = \"block\";\n\n var divinfo = document.querySelector('#info');\n var divexif = document.querySelector('#exif');\n\n // Render general image data.\n var datacells = divinfo.querySelectorAll('td');\n renderCells(datacells, imageinfo);\n\n // If EXIF data exists, unhide the EXIF table and render.\n if (imageinfo['exif'] && !isEmpty(imageinfo['exif'])) {\n divexif.style.display = 'block';\n var exifcells = divexif.querySelectorAll('td');\n renderCells(exifcells, imageinfo['exif']);\n }\n}", "function displayImage(id)\n{\n var imageSection;\n var myImage = document.getElementById(id);\n\n if (myImage) {\n //console.log('image existed');\n var myWidth = myImage.style.width;\n if (myWidth == \"0px\") {\n \n imageSection = {\n text: \"\"\n };\n return imageSection;\n } \n else {\n \n if (checkImage(id) >= 0)\n {\n var canvas = document.createElement(\"canvas\");\n canvas.width = myImage.naturalWidth;\n canvas.height = myImage.naturalHeight;\n var ctx = canvas.getContext(\"2d\");\n ctx.drawImage(myImage,0,0);\n var src = canvas.toDataURL(\"image/png\");\n imageSection = {\n image:src,\n height: 250,\n width: 250\n }\n }\n else\n {\n imageSection = {\n image: myImage.src,\n width: 250,\n height: 250\n };\n }\n\n return imageSection;\n }\n }\n else\n { \n //console.log('not existed');\n imageSection = {\n text: ''\n };\n return imageSection;\n }\n}", "function display_image(image_url){\n document.getElementById(\"image\").src=image_url;\n }", "show() {\n // applyTextTheme\n image(this.image, this.x, this.y, this.width, this.height)\n }", "function drawImage (values, x_offset, y_offset, w, txt) {\n let dimension = 28; // It's 28 x 28 image\n for (let i = 0; i < values.length; i++) {\n let brightness = values[i] * 256; // Scale upto 256.\n let x = i % dimension; // x postion\n let y = floor(i / dimension);\n // Draw rectangle\n fill(brightness);\n noStroke();\n rect(x_offset + x*w, y_offset + y*w, w, w);\n }\n // Draw the label\n fill(0);\n textSize(12);\n text(txt, x_offset, y_offset + w*35);\n} // End of drawImage function", "function display() {\n var content = this.getContent();\n var root = Freemix.getTemplate(\"thumbnail-view-template\");\n\n content.empty();\n content.append(root);\n this._setupViewForm();\n this._setupLabelEditor();\n\n var images = Freemix.property.getPropertiesWithType(\"image\");\n\n var image = content.find(\"#image_property\");\n\n // Set up image property selector\n this._setupPropertySelect(image, \"image\", images);\n this._setupTitlePropertyEditor();\n this._setupMultiPropertySortEditor();\n\n image.change();\n }", "function 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}", "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 }", "display() {\n noStroke();\n fill(0);\n rect(this.frame.x,this.frame.y,1,1);\n imageMode(CENTER);\n image(girl_Img,this.frame.x+0.5,this.frame.y+0.5,2.25,2.75);\n }", "function getLabelImage( imgPars )\n {\n var shape = imgPars.shape;\n var size = imgPars.size || [200,200];\n var color = imgPars.color;\n\n canvas.width = size[0];\n canvas.height = size[1];\n switch( imgPars.shape )\n {\n case 'bar':\n ctx.fillStyle = color;\n ctx.rect( 0, 0, canvas.width, canvas.height );\n ctx.fill();\n return canvas.toDataURL();\n }\n }", "function display_images(data, retrieval) {\n\t\tvar counter = 0;\n\t\tvar camera = $('#image_camera').val();\n\n\t\t$images.empty();\n\t\t$images.append('<p></p>');\n\n\t\tfor(var i = 0; i < data.length; i++) {\n\t\t\tif (data[i].camera_name == camera || camera == 'all') {\n\t\t\t\t$img = '<div class=\"image\"><img src=\"' + data[i].img_src + '\" alt=\"\" width=\"200\" height=\"200\" class=\"img-rounded\"></div>';\n\t\t\t\t$images.append($img);\n\t\t\t\tcounter++;\n\t\t\t}\n\t\t}\n\n\t\tif(counter > 0) {\n\t\t\t$images.find('p').append('Found ' + counter + ' images/s ');\n\t\t\tif(retrieval != \"\"){\n\t\t\t\t$images.find('p').append('which were retrieved from the ' + retrieval);\n\t\t\t}\n\t\t\t\n\t\t} else {\n\t\t\t$images.find('p').html('Did not find any images for filter: <strong>' + camera + '</strong>');\n\t\t}\n\n\t\tconsole.log(retrieval)\n\t}", "function onPhotoDataSuccess(imageData) {\n\n var DivImage = document.getElementById(TargetDivForPhoto);\n DivImage.style.display = 'block'; // Unhide image elements\n // Show the captured photo\n // The inline CSS rules are used to resize the image\n DivImage.src = \"data:image/jpeg;base64,\" + imageData;\n}", "function onPhotoDataSuccess(imageData,lng) {\n // Uncomment to view the base64 encoded image data\n // console.log(imageData);\n\n // Get image handle\n //\n var smallImage = document.getElementById('smallImage');\n\n // Unhide image elements\n //\n smallImage.style.display = 'block';\n\n // Show the captured photo\n // The inline CSS rules are used to resize the image\n //\n smallImage.src = imageData;\n console.log(lng);\n return smallImage.src;\n }", "function displayImage(imagePath, response)\r\n{\r\n try\r\n {\r\n // read the image path from the local storage and add it to a var called img\r\n let img = fs.readFileSync(imagePath);\r\n console.log(img);\r\n response.writeHead(200, {'Content-Type': 'image/png' });\r\n response.end(img, 'binary');\r\n }\r\n catch(err)\r\n {\r\n console.log(err);\r\n response.writeHead(200, {'Content-Type': 'text/plain' });\r\n response.end('Image not found! \\n');\r\n }\r\n}", "function showRandomPic(data) {\n galleryItem.css(\"background-image\", 'url(\"' + data.url + '\")');\n title.text(data.title).hide();\n date.text(data.date).hide();\n }", "function displayImage(data) {\n let image = document.querySelector(\"#image\")\n let imageName = document.querySelector(\"#name\")\n console.log(imageName);\n console.log(image);\n image.src = `${data.url}`\n console.log(image.src)\n //let imgName = `${data.name}`\n //console.log(imgName)\n imageName.append(`${data.name}`)\n// this closes my displayImage fucntion\n }", "function displayImage(){\r\n\r\n \t//the first statement should generate a random number in the range 0 to 6 (the subscript values of the image file names in the imagesArray)\r\n \tvar num = Math.floor(Math.random() * 2); // 0...6\r\n \t//the second statement display the random image from the imagesArray array in the canvas image using the random number as the subscript value\r\n \tdocument.canvas.src = imagesArray[num];\r\n\r\n\t}", "function mycallback() {\n // either call the ImageInfo.getAllFields([file]) function which returns an object holding all the info\n alert(\n \"All info about this file: \" + ImageInfo.getAllFields(file)\n );\n // or call ImageInfo.getField([file], [field]) to get a specific field\n alert(\n \"Format: \" + ImageInfo.getField(file, \"format\") + \", dimensions : \" + ImageInfo.getField(file, \"width\") + \"x\" + ImageInfo.getField(file, \"height\")\n );\n}", "function TB_image() {\n\tvar t = this.title || this.name ;\n\tTB_show(t,this.href,'image');\n\treturn false;\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 printImages(container, template, data) {\n var i = 0;\n var templateHtml = null;\n var fragment = document.createDocumentFragment();\n\n for (i; i < data.length; i++) {\n templateHtml = parseImgTemplate(template, data[i]);\n fragment.appendChild(templateHtml);\n }\n container.appendChild(fragment);\n\n function parseImgTemplate(templateTag, item) {\n templateTag = templateTag.cloneNode(true);\n\n templateTag.querySelector('img').setAttribute('src', item.url);\n templateTag.querySelector('.picture-likes').textContent = item.likes;\n templateTag.querySelector('.picture-comments').textContent = item.comments;\n\n return templateTag;\n }\n }", "function render(id, title, imgUrl, height, width, prev, next) {\n var imgContainer = \"<div id='\" + id + \"' class='thumb col-md-3' data-title='\" + title + \"' data-previous='\" + prev + \"' data-next='\"+ next + \"' style='background-repeat: no-repeat; position: relative; max-width:\" + width + \"px; width: 100%; height:\" + height + \"px;'><img src='\" + imgUrl + \"'/></div>\";\n document.getElementById(\"container\").innerHTML += imgContainer;\n }", "function showImage( im )\r\n {\r\n var fileName = imageURLs[im].split(\"/\")[2];\r\n window.scrollTo(0, 0);\r\n currentImage = im;\r\n\r\n if ( !images[im] )\r\n {\r\n images[im] = new Image();\r\n }\r\n\r\n if ( useSmaller )\r\n {\r\n images[im].src = smallerURLs[im];\r\n }\r\n else\r\n {\r\n images[im].src = imageURLs[im];\r\n }\r\n setInner( \"image\", \"<h3>Waiting for image ...<\\/h3>\" );\r\n waitForCurrent();\r\n\r\n setInner( \"image\", \"<img class=\\\"main_image\\\"\" +\r\n \"src=\\\"\"+images[im].src +\r\n \"\\\" \" +\r\n \"alt=\\\"\"+imageURLs[im] +\r\n \"\\\" height=\\\"\"+imgHeight+\"\\\" />\" );\r\n setInner( \"title\", fileName );\r\n }", "function showData(data){\n\talert('what');\n\tfor(var i=0; i<data.length; i++){\n\t\tvar currItem = data[i];\n\t\tvar listItem = $('<li></li>');\n\t\tvar paragraph = $('<p></p>');\n\t\tvar image = $('<img src=\"'+currItem.url+'\">');\n\t\tlistItem.text(data[i].name);\n\t\tlistItem.append(image);\n\t\t$dataList.append(listItem);\n\t}\n}", "function fHomePgImgWInfo() // HOME PAGE IMAGE: This function loads the home page image and its description on page load\r\n{\r\n var expandImg = document.getElementById(\"expandedImg\"); // Find the ID \"expandedImg\"\r\n var imgText = document.getElementById(\"imgInfo\"); // Find the ID \"imgInfo\"\r\n \r\n var my_image = images[parseInt(0)];\r\n my_image = resizeImage(my_image,800,700);\r\n expandImg.src = my_image.file; // !Load the first image (index [0]) from the \"images\" array to the presentation container\r\n expandImg.width = my_image.dimensions.width;\r\n expandImg.height = my_image.dimensions.height;\r\n imgText.innerHTML = `${my_image.name} <br/> ${my_image.description}`; // !Load image info from the \"images\" array to the image info field\r\n expandImg.parentElement.style.display = \"block\"; // Apply style to a loaded image\r\n}", "function onPhotoDataSuccess(imageData) {\n // Uncomment to view the base64-encoded image data\n // console.log(imageData);\n\n // Get image handle\n //\n var smallImage = document.getElementById('photoCanvas' + currentPageID);\n\n // Unhide image elements\n //\n smallImage.style.display = 'block';\n\n // Show the captured photo\n // The inline CSS rules are used to resize the image\n //\n smallImage.src = \"data:image/jpeg;base64,\" + imageData;\n}", "function displayResults(responseJson) {\n console.log(responseJson);\n let arrayOfImg = responseJson.message;\n let display = getImages(arrayOfImg);\n //replace the existing image with the new one\n $('.results-img').html(display);\n}" ]
[ "0.76033103", "0.72465867", "0.7238158", "0.6953018", "0.6856763", "0.6826307", "0.67901915", "0.67757076", "0.6698528", "0.6693946", "0.6683562", "0.66734797", "0.66083753", "0.65975916", "0.658593", "0.65274423", "0.65253866", "0.6512799", "0.64991796", "0.64919424", "0.6491405", "0.64825153", "0.6481728", "0.64800984", "0.6473056", "0.64673066", "0.64103353", "0.64026827", "0.6375135", "0.6374322", "0.6374149", "0.6363714", "0.63538325", "0.6351514", "0.634457", "0.634314", "0.6331423", "0.6327391", "0.63103074", "0.6300393", "0.62878925", "0.62810516", "0.6259212", "0.6258167", "0.6252692", "0.6244173", "0.62401384", "0.6235677", "0.62290627", "0.6207735", "0.6206931", "0.620273", "0.6188907", "0.6188635", "0.6183897", "0.61816114", "0.6170464", "0.6169463", "0.6157966", "0.61475205", "0.61451566", "0.61444616", "0.61442375", "0.6141346", "0.6134508", "0.6130744", "0.61249673", "0.61143714", "0.61023945", "0.6088749", "0.60801345", "0.60679567", "0.606738", "0.60658854", "0.6060494", "0.6054981", "0.60532516", "0.60477567", "0.60436666", "0.60428363", "0.6030461", "0.6025359", "0.6022685", "0.60197705", "0.6015694", "0.6009247", "0.60044086", "0.5994614", "0.5994198", "0.5989064", "0.5985237", "0.5983589", "0.59826255", "0.59770656", "0.5974273", "0.59696", "0.59636587", "0.595512", "0.5954566", "0.5946045", "0.5944974" ]
0.0
-1
for details on configuring this project to bundle and minify static web assets. Write your JavaScript code.
function checkResult(id, baseUrl) { if ($('input[name = "option"]').is(":checked")) { var option = $('input[name="option"]:checked').val(); var urlCheck = baseUrl+'/Quiz/CheckAnswer?id=' + id + '&option=' + option; $.ajax({ type: 'GET', url: urlCheck, dataType: 'json', success: function (jsonData) { var res = jsonData; $('#btnCheck').removeClass("btn-primary"); $('input[name="option"]').parent().removeClass("btn-info"); $('input[name="option"]').addClass("disabled"); $('input[name="option"]').parent().addClass("btn-secondary"); if (res == "Correct") { $('#btnCheck').addClass("btn btn-success"); $('input[name="option"]:checked').parent().removeClass("btn-secondary").addClass("btn btn-success disabled"); } else { $('#btnCheck').addClass("btn btn-danger"); $('input[name="option"]:checked').parent().removeClass("btn-secondary").addClass("btn btn-danger disabled"); } $('#btnCheck').text("Next"); $('#btnCheck').removeAttr("onClick"); $('#btnCheck').attr("href", baseUrl+"/Quiz"); }, error: function (error) { result.text(error); } }); } else { alert("Please select an answer!"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['html2canvas.js', 'quill.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/scripts'));\n}", "function javascript() {\n return gulp.src('src/assets/js/*.js')\n //.pipe($.sourcemaps.init())\n //.pipe($.babel())\n //.pipe($.concat('appfou.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n //.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n }", "function javascript() {\n return gulp.src('./src/scripts/**/*.js')\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest('./dist/js/'));\n}", "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.uglify()\n .on('error', e => {\n console.log(e);\n })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.distJS));\n}", "function javascript() {\n return gulp.src(PATHS.javascript.vendor.concat(PATHS.javascript.project))\n .pipe($.sourcemaps.init())\n .pipe($.if(!WATCHER, $.babel()))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify({\n \"output\": {\n ascii_only: true\n },\n \"mangle\": false,\n \"compress\": {\n dead_code: false,\n hoist_funs: false\n }\n })))\n .on('error', function (e) {\n console.log(e);\n })\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "function javascript() {\n return gulp.src(PATHS.javascript)\n .pipe($.sourcemaps.init())\n .pipe($.babel({ignore: ['vue.js','vue-resource.min.js']}))\n .pipe($.concat('app.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/public/js'));\n}", "function jsTask() {\n\treturn src([\n\t\t'node_modules/jquery/dist/jquery.js',\t\n\t\t'node_modules/foundation-sites/dist/js/foundation.js',\n\t\t'./js/**/*.js',\n\t])\n\t\t.pipe(sourcemaps.init()) // initialize sourcemaps first\n\t\t.pipe(concat('theme.js'))\n\t\t.pipe(uglify())\n\t\t.pipe(dest('./assets/'));\n}", "function mainJs() {\n notify('Building JS files...');\n return gulp.src('src/js/main/**/*.js')\n .pipe(sourcemaps.init())\n .pipe(uglify())\n .pipe(concat('scripts.min.js'))\n .pipe(plumber())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('_site/assets/js/'))\n .pipe(browserSync.reload({ stream: true }))\n .pipe(gulp.dest('assets/js'));\n}", "function js() {\n return src(source + 'js/*.js')\n .pipe(concat('main.js'))\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest(destination + 'js'));\n}", "function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }", "function scripts() {\n var jsFile = [\n \"src/js/jquery.js\",\n \"src/js/script.js\"\n ];\n return gulp\n .src(jsFile, { sourcemaps: true })\n .pipe(plumber())\n .pipe( concat( 'theme.js' ) )\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }))\n .pipe(rename({ suffix: \".min\" }))\n .pipe( uglify())\n .pipe(gulp.dest(`${config.src.root}/js`, { sourcemaps: true }))\n .pipe(gulp.dest(`${config.dist}/js`, { sourcemaps: true }));\n}", "function jsTask () {\n return src(['src/assets/js/**/*.js'])\n .pipe(concat('application.js'))\n .pipe(uglify())\n .pipe(dest('output/js'))\n}", "function javascript() {\r\n\treturn gulp.src(CONF.PATHS.entries)\r\n\t\t.pipe(named())\r\n\t\t.pipe($.sourcemaps.init())\r\n\t\t.pipe(webpackStream(webpackConfig, webpack2))\r\n\t\t.pipe($.if(PRODUCTION, $.uglify()\r\n\t\t\t.on('error', e => { console.log(e); })\r\n\t\t))\r\n\t\t.pipe($.if(!PRODUCTION, $.sourcemaps.write()))\r\n\t\t.pipe(gulp.dest(CONF.PATHS.dist + '/assets/js'));\r\n}", "function minifyJs() {\n\n return gulp.src('./src/assets/js/**/*.js', { matchBase: './src/assets/js/' })\n .pipe(ugly({compress: true}))\n .pipe(gulp.dest('./src/assets/css/'))\n .pipe(browserSynnc.stream());\n}", "function jsFn(){\n\tgulp.src(jsDirectory + '*.js')\n\t.pipe( gulpif( !dev , uglify() ) )\n\t.pipe(plumber())\n\t.pipe(gulp.dest(doc+'assets'+'/js'));\n}", "function js() {\n\twatch([paths.js + '/**/*.*', '!' + paths.js + '/**/*.min.js'], {ignoreInitial: false}, function () {\n\t\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\t\treturn scripts.forEach(function(obj){\n\t\t\treturn src(obj.src, { sourcemaps: true })\n\t\t\t\t.pipe(plumber({errorHandler: onError}))\n\t\t\t\t.pipe(concat(obj.name))\n\t\t\t\t.pipe(dest(paths.js, { sourcemaps: true }));\n\t\t});\n\t});\n}", "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/assets/js'));\n}", "function make_bundle () {\n\t\tconsole.log( chalk.blue('Building Javascript') );\n\n\n\n\t\treturn bundler.bundle()\n\t\t .pipe(source('main.js'))\n\t\t .pipe(bufferify())\n\t\t .pipe(gulpif( args.prod, uglify() ))\n\t\t .pipe(gulp.dest(dir.compiled.js));\n\t}", "function optimizeJS() {\n console.log(chalk.yellow('\\n Optimizing files:\\n'));\n\n webpackManifest.assets.forEach((asset) => {\n if ( !asset.name.endsWith('.js') ) {\n return;\n }\n const filename = path.resolve(__dirname, `../public/js/${asset.name}`);\n fs.writeFileSync(\n filename,\n optimizeJs(fs.readFileSync(filename, {encoding: 'utf-8'}))\n );\n });\n\n console.log(' OK');\n}", "function js()\n{\n var streams = pathConfig.js.map( function( folder )\n {\n return gulp.src(getGlob( folder ) )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint(): $.util.noop() )\n .pipe( !folder.thirdParty && !$.util.env.production ? $.jsHint.reporter( 'default' ) : $.util.noop() )\n .pipe( $.util.env.production ? $.uglify() : $.util.noop() )\n .pipe( gulp.dest( folder.dist ) );\n } );\n\n return $.mergeStream( streams );\n}", "function compileJs() {\n return merge(\n // config-theme.js\n src(['src/assets/js/*.js', '!src/assets/js/indonez/*.js'])\n .pipe(beautify({js: {file_types: ['.js']} })) \n .pipe(dest('dist/js')),\n\n // indonez.min.js\n src('src/assets/js/indonez/*.js')\n .pipe(concat('indonez.min.js', {newLine: '\\r\\n\\r\\n'}))\n //.pipe(babel({presets: ['babel-preset-env']}))\n .pipe(minify({minify: true, minifyJS: {sourceMap: false}}))\n .pipe(dest('dist/js/vendors')),\n\n // uikit.min.js\n src('node_modules/uikit/dist/js/uikit.min.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors')),\n\n // js vendors\n src('src/assets/js/vendors/*.js')\n .pipe(newer('dist/js/vendors'))\n .pipe(dest('dist/js/vendors'))\n )\n}", "function js(cb){\n src([jquery,bootstrap_js]).pipe(dest(jsDest));\n cb();\n}", "function javascript() {\n return gulp.src(PATHS.entries)\n .pipe(named())\n .pipe($.sourcemaps.init())\n .pipe(webpackStream(webpackConfig, webpack2))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe($.if(!PRODUCTION, $.sourcemaps.write()))\n .pipe(gulp.dest(PATHS.dist + '/js'));\n}", "function js() {\n return gulp.src( 'src/assets/js/*' )\n .pipe( gulp.dest( './build/assets/js/' ) );\n}", "function jsTask(){\r\n return src([\r\n files.jsPath\r\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\r\n ])\r\n .pipe(concat('main.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js')\r\n );\r\n}", "function minify_app_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/app.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "function jsProd() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(dest('dist'));\n}", "function js() {\n\treturn src( folder.src + 'js/*.js' )\n\t\t.pipe( deporder() )\n\t\t.pipe( concat( 'app.js' ) )\n\t\t//.pipe( uglify() )\n\t\t.pipe( dest( folder.build + 'js' ) )\n}", "function js(){\r\n return src(paths.js)\r\n .pipe(concat('scripts.min.js'))\r\n .pipe(uglify())\r\n .pipe(dest('dist/js'))\r\n .pipe(browserSync.stream());\r\n}", "function js() {\n return src(paths.js.src)\n .pipe(concat('scripts.js'))\n .pipe(uglify())\n .pipe(rename({ extname: '.min.js' }))\n .pipe(dest(paths.js.dist))\n .pipe(browserSync.stream())\n}", "function js() {\n return browserify(config.src + 'js/main.js', {\n debug: true\n })\n .transform(babelify, {\n presets: [es2015]\n })\n .bundle()\n .on(\n 'error',\n gulp_notify.onError(function(error) {\n return 'Message to the notifier: ' + error.message;\n })\n )\n .pipe(source('main.js'))\n .pipe(buffer())\n .pipe(gulp_sourcemaps.init())\n .pipe(gulp_uglify())\n .pipe(gulp_sourcemaps.write())\n .pipe(gulp_rename('main.min.js'))\n .pipe(gulp.dest(config.assets + 'js/'))\n .pipe(gulp_notify('JS compiled'));\n}", "function jsTask() {\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest(\"dist/js\"));\n}", "function grind(grunt) {\n\n // grunt.loadNpmTasks('grunt-closure-compiler');\n\n // Project configuration.\n var config = {\n pkg: '<json:../package.json>',\n meta: {\n banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +\n '<%= grunt.template.today(\"yyyy-mm-dd\") %>\\n' +\n '<%= pkg.homepage ? \"* \" + pkg.homepage + \"\\n\" : \"\" %>' +\n '* Copyright (c) <%= grunt.template.today(\"yyyy\") %> <%= pkg.author.name %>;' +\n ' Licensed <%= _.pluck(pkg.licenses, \"type\").join(\", \") %> */',\n original: '/* View original: <%= pkg.name %>-<%= pkg.version %>.js */'\n },\n lint: {\n files: ['grunt.js', 'js/**/*.js']\n },\n concat: {\n dist: {\n // built dynamically\n // src: ['<banner:meta.banner>', 'public/js/intro.js', 'public/js/*.js', 'public/js/**/*.js', 'public/js/outro.js'],\n src: [],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.js'\n }\n },\n min: {\n dist: {\n src: ['<banner:meta.original>', '<banner:meta.banner>', '<config:concat.dist.dest>'],\n dest: 'js/<%= pkg.name %>-<%= pkg.version %>.min.js'\n }\n },\n watch: {\n files: '<config:lint.files>',\n tasks: 'lint'\n },\n jshint: {\n options: {\n curly: true,\n eqeqeq: true,\n immed: true,\n latedef: true,\n newcap: true,\n noarg: true,\n sub: true,\n undef: true,\n boss: true,\n eqnull: true,\n browser: true\n },\n globals: {\n jQuery: true,\n jsbin: true\n }\n }\n ,\n 'closure-compiler': {\n frontend: {\n root: 'js/',\n js: '', // completed dynamically\n jsOutputFile: '<%= pkg.name %>-<%= pkg.version %>.min.js',\n sourcemap: '<%= pkg.name %>-<%= pkg.version %>.map',\n options: {\n create_source_map: '<%= pkg.name %>-<%= pkg.version %>.map',\n source_map_format: 'V3',\n compilation_level: 'ADVANCED_OPTIMIZATIONS',\n language_in: 'ECMASCRIPT5_STRICT'\n }\n }\n }\n };\n\n var scripts = require('../scripts.json'),\n scriptsRelative = scripts.map(function (script) {\n return script.substring(1);\n });\n\n config.lint.files = scriptsRelative;\n config.concat.dist.src = scriptsRelative;\n config['closure-compiler'].frontend.js = scripts.map(function (script) {\n return script.substring(4);\n });\n config.concat.dist.src.unshift('js/intro.js');\n config.concat.dist.src.unshift('<banner:meta.banner>');\n config.concat.dist.src.push('js/outro.js');\n\n grunt.initConfig(config);\n // Default task.\n grunt.registerTask('default', 'concat min');\n grunt.registerTask('sourcemap', 'closure-compiler');\n // grunt.registerTask('lint', 'lint');\n\n}", "function scripts() {\n return (\n gulp\n .src(javascript_sources)\n .pipe(sourcemaps.init())\n .pipe(concat('concat.js'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(rename('package.js'))\n .pipe(uglify())\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest(javascript_dest))\n .pipe(browsersync.stream())\n );\n}", "function minifyJs() {\n return Elixir.Plugins.uglify(\n Elixir.config.js.uglify.options\n );\n}", "function js() {\n return gulp.src(path.src.js)\n .pipe(uglify())\n .pipe(concat('main.js'))\n .pipe(gulp.dest(path.build.js))\n .pipe(reload({stream:true}))\n}", "function js() {\n return gulp.src(jsFiles)\n .pipe(concat(\"main.js\"))\n .pipe(uglify({\n mangle: {\n toplevel: false\n }\n }))\n .pipe(gulp.dest(\"./dist/js\"))\n .pipe(browserSync.stream());\n}", "function script(cb) {\n src(js.in)\n .pipe(sourcemaps.init())\n // .pipe(concat(\"app.js\")) //Will make all seperate file.\n .pipe(sourcemaps.write(\".\"))\n .pipe(dest(js.out))\n watch(js.watch, series(script, browsersync.reload))\n cb()\n}", "function bundle(name){\n var path = 'client/' + name + '/index';\n var js = path + '.js';\n var css = path + '.css';\n var scss = path + '.scss';\n var dest = 'build/bundles/' + name;\n var assets_source = 'client/common/branding/assets';\n var assets_destination = dest + '/assets';\n\n function build(){\n // browserify\n browserifyFile(js, dest);\n // sass\n sassFile(scss, dest);\n //assets\n assets(assets_source, assets_destination);\n }\n\n function watch(){\n // browserify\n browserifyFile(js, dest, {watch:true});\n\n // sass\n sassFile(scss, dest)\n gulp.watch('client/' + name + '/**/*.scss', function(){\n return sassFile(scss, dest, {watch:true});\n });\n }\n\n return {\n build: build,\n watch: watch\n }\n}", "cleanScript(jsfile) {// N/A in web\n }", "function compressJS(callB) {\n pump([\n gulp.src(\"./js/*.js\", {\n sourcemaps: true\n }),\n uglify(),\n concat('main.min.js'),\n gulp.dest(\"./bundle\")\n ],\n callB\n );\n}", "function combineJs() {\r\n return gulp\r\n .src(configJs.src)\r\n .pipe(concat('site.min.js'))\r\n .pipe(uglify())\r\n .pipe(header(banner))\r\n .pipe(gulp.dest('./wwwroot/js/'))\r\n}", "function bundle_js(bundler) {\n\treturn b.bundle()\n\t\t.on('error', map_error)\n\t\t.pipe(source('app.js'))\n\t\t.pipe(buffer())\n\t\t.pipe(sourcemaps.init({loadMaps: true})) // loads map from browserify file\n\t .pipe(sourcemaps.write('../js/maps')) // writes .map file\n\t .pipe(gulp.dest(project.theme.js_dist))\n\t .pipe(livereload());\n}", "function kia_promo_scripts_promo() {\n\treturn src(projects.kia_promo.scripts_promo.src)\n\t.pipe(concat(projects.kia_promo.scripts_promo.output))\n\t// .pipe(uglify()) // Minify js (opt.)\n\t.pipe(header(projects.kia_promo.forProd))\n\t.pipe(dest(projects.kia_promo.scripts_promo.dest))\n\t.pipe(browserSync.stream())\n}", "function jsTask() {\n\n return src(files.jsPath)\n\n .pipe(concat('script.js'))\n\n .pipe(minify())\n\n .pipe(dest('src/js'));\n\n}", "function jsTask(){\n return src([\n files.jsPath\n //,'!' + 'includes/js/jquery.min.js', // to exclude any specific files\n ])\n .pipe(uglify())\n .pipe(dest('./docs/**/*.js'))\n .pipe(browserSync.reload({stream:true}))\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(babel())\n .pipe(conCat('main.js'))\n //terser minifies the files after concat put them togheter\n .pipe(terser())\n .pipe(dest('pub/js'));\n}", "function scripts() {\n return (\n gulp\n .src([\"./assets/js/**/*\"])\n .pipe(newer(\"./docs/assets/js\"))\n .pipe(babel({presets: ['@babel/preset-env']}))\n .pipe(minify({noSource: true, ext: {min: '.min.js'}}))\n .pipe(gulp.dest(\"./docs/assets/js/\"))\n );\n}", "function javaScriptDevlopmentBuild(cb) {\r\n return src(javaScriptSource)\r\n .pipe(concat('app.js'))\r\n .pipe(rename({\r\n extname: '.min.js',\r\n }))\r\n .pipe(dest(javaScriptDestination));\r\n cb();\r\n}", "function js() {\n return src(PATHS.src.js.files, {\n sourcemaps: true\n })\n .pipe(babel({\n presets: ['@babel/preset-env']\n }))\n .pipe(uglify())\n .pipe(dest(PATHS.public.js.folder))\n}", "function buildJS(cb) {\n src([\"src/js/main.js\"]).pipe(concat(\"main.js\")).pipe(dest(destFolderJS));\n\n cb();\n}", "function buildJS() {\n const bundler = browserify('src/assets/js/app.js').transform(\n 'babelify',\n { presets: ['@babel/preset-env'],\n plugins: [\"@babel/transform-runtime\"]\n }\n )\n return bundler.bundle()\n .on('error', handleError)\n .pipe(source('app.js'))\n .pipe(buffer())\n .pipe(terser({\n mangle: false,\n compress: true,\n }))\n .pipe(rename({suffix: '.min'}))\n .pipe(gulp.dest('dist/assets/js/'));\n}", "function process_js() {\n $.util.log($.util.colors.yellow(\"Combining, transpiling, and minifying JavaScript files\\n\"));\n // get js files and attach src to beginning\n var js_import = (function () {\n var js_src = settings.js.src,\n i, arr = [],\n src = settings.js.files;\n\n for (i = 0; i <= src.length - 1; i++) {\n arr.push(js_src + src[i]);\n }\n return arr;\n }());\n\n // compile Babel & combine all js files in folder, starting alphabetically\n var concat = gulp.src(js_import)\n .pipe($.sourcemaps.init())\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.concat(settings.js.name + '.js')).on('error', settings.error)\n .pipe($.babel({\n presets: [['env', {\n modules: false\n }]]\n })).on('error', settings.error);\n\n // minify javascript file\n var ugly = concat.pipe($.clone())\n .pipe($.uglify()).on('error', settings.error)\n .pipe($.replace(settings.assets.tag, $path))\n .pipe($.rename(settings.js.name + '.min.js'));\n\n // merge pipes and output separate files with sourcemaps.\n return merge(concat, ugly)\n .pipe($.sourcemaps.write('.'))\n .pipe(gulp.dest(settings.js.dest))\n .pipe(browser_sync.stream());\n}", "function JSFormat() {\n\treturn gulp.src(config.js)\n\t\t.pipe(concat('combined.js'))\n\t\t.pipe(gulpif(config.settings.isBuild, uglify()))\n\t\t.pipe(gulp.dest(config.distJS))\n}", "function vendorJavascript() {\n gutil.log('updating vendor js');\n return gulp.src(PATHS.vendor)\n .pipe($.concat('vendor.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "function scripts(watch) {\n\tif (watch) {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-watchify\"));\n\t}\n\telse {\n\t\t$.gutil.log(chalk.green(\"Inside scripts - js-browserify\"));\n\t}\n\t\n\n\t$.glob(config.client.js.srcDir + '/**/*.js', {ignore: config.client.js.srcDir + '/assets/**/*.*'}, function (err, files) { \n\t if (err) {\n\t \tlet errmsg = err.msg || err.message;\n\t\t\t$.gutil.log(chalk.red(\"Error : \") + chalk.blue(errmsg));\n\t }\n\n\t $.gutil.log(chalk.magenta(\"files list : \") + chalk.green(files));\n\n\t let tasks = files.map(entry => {\n\t \t$.gutil.log(chalk.magenta(\"entry file : \") + chalk.green(entry));\n\n\t \tlet filePathFromSrc = $.path.relative(config.client.js.srcDir, entry);\n\t \tlet outputDir = $.path.resolve(config.client.js.outputDir, $.path.dirname(filePathFromSrc));\n\n\t \tlet browserifyOpts = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet browserifyOpts_w_watchify = {\n\t \t\tentries: [entry],\n\t\t extensions: ['.js'],\n\t\t cache: {},\n\t\t packageCache: {},\n\t\t debug: !isProduction,\n\t\t fullPaths: watch\n\t \t};\n\n\t \tlet bundler;\n\t \t\n\t \tif(watch) {\n\t \t\tlet opts = $.assign({}, $.watchify.args, browserifyOpts_w_watchify);\n\t \t\t$.gutil.log(chalk.magenta(\"opts : \") + chalk.green(opts));\n\t \t\t\n\t \t\tbundler = $.browserify(opts);\n\t \t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\n\t \t\tbundler = $.watchify(bundler);\n\t \t\t$.gutil.log(chalk.magenta(\"watchify instance started\"));\n\t \t\t}\n\t \t\telse {\n\t \t\t\tbundler = $.browserify(browserifyOpts);\n\t \t\t\t$.gutil.log(chalk.magenta(\"browserify bundler created \"));\n\t \t\t}\n\n\t \t\tbundler.transform($.babelify);\n\t \t\t$.gutil.log(chalk.magenta(\"babelify transform done..\"));\n\n\t \tlet bundle = function() {\n\n\t \t\t$.gutil.log(chalk.magenta(\"Inside bundle funtion\"));\n\n\t \t\tlet stream = bundler.bundle();\n\n\t \t\t$.gutil.log(chalk.magenta(\"stream bundle creted\"));\n\t\t\t\t\n\t\t\t\treturn stream.pipe($.source($.path.basename(entry)))\n\t\t\t\t.pipe($.buffer())\n\t\t\t\t.pipe($.plumber({\n\t\t\t\t\terrorHandler: mapError\n\t\t\t\t})) \n\t\t\t\t.pipe($.duration('browserify bundling')) \n\t\t\t\t.pipe($.cache('scripts')) \n\t\t\t\t// .pipe($.changed(config.client.js.outputDir, {extension: '.bundle.js', hasChanged: $.changed.compareSha1Digest}))\t\t\t\t\n\t\t\t\t.pipe($.rename({\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Rename output from to '.bundle.js'\n\t\t\t\t\textname: config.client.js.outputFileBundleExt\n\t\t\t\t})) \n\t\t\t\t.pipe(gulp.dest(outputDir))\t\t\t\t\t\t\t\t\t\t// Save 'bundle.js' to output directory\t\t\t\t\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.init({\t\t\t\t\t\t\t\t\t// loads map from browserify file\n\t\t\t // \tloadMaps: true\n\t\t\t // }), $.gutil.noop())) \t\t\t\t\n\t\t\t // Add transformation tasks to the pipeline here.\n\t\t \t// .pipe($.gulpif(isProduction, $.uglify(), $.gutil.noop()))\t\t\t\t\t\t\t// uglify only whene production environment\n\t\t \t// .pipe($.gulpif(isProduction, $.rename({ extname: config.client.js.outputFileMinExt}), $.gutil.noop()))\n\t\t \t.pipe($.uglify())\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// always uglify regardless of production or development environment\n\t\t \t.pipe($.rename({\n\t\t \t\textname: config.client.js.outputFileMinExt\n\t\t \t}))\n\t\t\t // Transformtions ended here\n\t\t\t // .pipe($.gulpif(isProduction, $.sourcemaps.write({destPath: config.client.js.mapDir}), $.gutil.noop())) \t\t// writes .map file\t\t\t \t\n\t\t\t .pipe(gulp.dest(outputDir));\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Save 'bundle.min.js' to output directory\n\t\t\t};\n\n\n\t \tif (watch) {\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Add event handlers to watchify bundler\n\t\t \tbundler.on('update', bundle);\n\t\t \tbundler.on('log', $.gutil.log.bind($.gutil)); \t\t\t\t\t\t\t\t// output build logs to terminal\n\t\t \t\t\n\t\t } \t \t\t\t\t\t\n\t \t\n\t \t$.gutil.log(chalk.magenta(\"returning bundle\"));\n\t \treturn bundle();\n\t \n\t });\n\n\t // Call tasks as a merged array stream\n\t $.gutil.log(chalk.magenta(\"calling es.merge\"));\n\t \n\t $.es.merge(tasks).on('end', $.gutil.log.bind($.gutil));\n\t});\n}", "function publishJavaScript(done) {\n return gulp.src(\"src/js/**/*\").pipe(gulp.dest(\"dist/js\"));\n}", "function prodScripts(){\n return gulp\n .src(config.scripts.src)\n .pipe($.babel())\n .pipe($.concat(config.scripts.bundle))//after babel transpiling\n .pipe($.uglify())//now minify app.js\n .pipe(gulp.dest(config.scripts.dest)); \n}", "function headJavascript() {\n gutil.log('updating head js');\n return gulp.src(PATHS.head)\n .pipe($.concat('head.js'))\n .pipe($.if(PRODUCTION, $.uglify()\n .on('error', e => { console.log(e); })\n ))\n .pipe(gulp.dest(PATHS.dist + PATHS.distAssets + '/js'))\n}", "function compileFiles(appName) {\n\n let stream;\n\n const cssOnly = process.argv.indexOf('--css-only') !== -1;\n const jsOnly = process.argv.indexOf('--js-only') !== -1;\n\n let styles;\n let scripts;\n\n if (cssOnly) {\n\n styles = css();\n\n stream = styles;\n }\n\n if (jsOnly) {\n\n scripts = js();\n\n stream = scripts;\n }\n\n if (!cssOnly && !jsOnly) {\n\n styles = css();\n scripts = js();\n\n stream = merge(styles, scripts);\n }\n\n return stream;\n\n // realiza processos para gerar os arquivos js\n function js() {\n\n let streamJs = gulp.src('.');\n\n const tsPath = `${src.ts}/inits/${appName}.init.ts`;\n\n if (fs.existsSync(tsPath)) {\n\n // 1 - pegue o arquivo \"init\" typescript do app\n // 2 - compile o arquivo para javascript\n // 3 - aplique pollyfills caso seja necessário \n let scripts = browserify(tsPath)\n .plugin(tsify, { typeRoots: [\"./node_modules/@types\", \"./type-definitions\"], target: \"esnext\" })\n .transform(stringify, {\n appliesTo: { includeExtensions: ['.html'] },\n minify: true,\n minifyOptions: {\n collapseBooleanAttributes: true,\n collapseInlineTagWhitespace: true,\n collapseWhitespace: true,\n removeEmptyAttributes: true,\n removeRedundantAttributes: true,\n sortAttributes: true,\n sortClassName: true,\n trimCustomFragments: true\n }\n })\n .transform(babelify, {\n presets: [\n [\n '@babel/preset-env',\n {\n 'useBuiltIns': 'usage',\n 'corejs': 3\n }\n ]\n ],\n extensions: ['.ts']\n })\n .transform('exposify', { expose: { angular: 'angular' }, filePattern: /\\.ts/ })\n .external(['angular']);\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique os seguintes plugins:\n // 1 - Aplique as configurações de produção\n // 2 - Minifique cada módulo (arquivo .ts) individualmente\n // 3 - Remove exports não utilizados\n // 4 - Simplifica os 'require' do js final para variáveis\n scripts = scripts.transform('envify', { global: true })\n .transform(uglifyify, { global: true })\n .plugin('common-shakeify')\n .plugin('browser-pack-flat/plugin');\n }\n\n // junte os arquivos e coloque o arquivo final na pasta de destino\n scripts = scripts.bundle();\n\n // se solicitado a minificação...\n if (production) {\n\n // aplique o seguinte plugin:\n // 1 - minifica o arquivo js final\n scripts = scripts.pipe(minifyStream({ sourceMap: false }));\n }\n\n scripts = scripts.pipe(source(`${appName}.min.js`))\n .pipe(buffer());\n\n scripts = scripts.pipe(gulp.dest(dest.js));\n\n streamJs = scripts;\n }\n\n return streamJs;\n }\n\n // realiza processos para gerar os arquivos css\n function css() {\n\n // 1 - pegue o arquivo sass/scss referente ao app\n // 2 - compile o arquivo para css\n // 3 - aplique atributos compatíveis com a versão de browser especificada na propriedade \"browserslist\" do arquivo package.json\n // 4 - crie os arquivos e coloque o compilado css na pasta de destino\n // 5 - minifique o arquivo css\n // 6 - renomeie o arquivo minificado\n // 7 - coloque minificado css na pasta de destino\n let css = gulp.src(`${src.sass}/${appName}.{scss,sass}`)\n .pipe(sassCompiler().on('error', sassCompiler.logError))\n .pipe(autoprefixer())\n .pipe(csso())\n .pipe(rename({ extname: '.min.css' }))\n .pipe(gulp.dest(dest.css));\n\n if (uploadFiles) {\n\n // aplique a stream de upload de arquivos\n css = upload(css, dest.css);\n }\n\n return css;\n }\n}", "function scriptsCSSans() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js'])\n .pipe(concat('cssans.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./dist/'))\n );\n}", "function jsProd() {\n\tvar scripts = JSON.parse(fs.readFileSync(paths.js + '/_compile.json', { encoding: 'utf8' }));\n\n\tscripts.forEach(function(obj){\n\t\tsrc(obj.src)\n\t\t\t.pipe(concat(obj.name))\n\t\t\t.pipe(uglify())\n\t\t\t.pipe(dest(paths.js));\n\t});\n\n\treturn Promise.resolve('the value is ignored');\n}", "function bundler(options) {\n var allFiles = {};\n var bundles = {};\n var dir = options.src;\n var dest = options.dest;\n var resourcesFile = options.resourceJson;\n var indexBundles = options.indexBundles;\n var titleIndexBnudles = {};\n var traversed_bundles = {}, traversed_files = {}, excluded_bundles = {};\n var resourcesJs = {};\n for (var key in options) {\n resourcesJs[key] = options[key];\n }\n resourcesJs.bundles = bundles;\n\n function getFiles(packageName, files, bundledFile, includedBundles) {\n if (!traversed_bundles[packageName] && !excluded_bundles[packageName]) {\n traversed_bundles[packageName] = true;\n var bundle = resourcesJs.bundles[packageName];\n if (bundle) {\n bundle.bundled = bundle.bundled || [];\n bundle.bundled_html = bundle.bundled_html || [];\n bundle.in = bundle.in || [];\n for (var i in bundle.on) {\n files = getFiles(bundle.on[i], files, bundledFile, includedBundles);\n }\n for (var j in bundle.js) {\n var _file2 = cleanURL(dir + \"/\" + bundle.js[j]);\n if (!traversed_files[_file2]) {\n files.js.push(_file2);\n traversed_files[_file2] = packageName;\n }\n }\n if (files.js.length > 0) {\n bundle.bundled.push(bundledFile + \".js\");\n }\n\n for (var i in bundle.html) {\n var _file = cleanURL(dir + \"/\" + bundle.html[i]);\n if (!traversed_files[_file]) {\n files.html.push(_file);\n traversed_files[_file] = packageName;\n }\n }\n if (files.html.length > 0) {\n bundle.bundled_html.push(bundledFile + \".html\");\n }\n\n includedBundles.push(packageName);\n }\n }\n return files;\n }\n\n if (TASK_BUNDLIFY || TASK_SCAN) {\n grunt.file.recurse(dir, function(abspath, rootdir, subdir, filename) {\n if (filename === \"module.json\" && abspath.indexOf(dest) !== 0) {\n var packageInfo = {};\n if (grunt.file.exists(subdir + \"/.bower.json\")) {\n var bowerJson = grunt.file.readJSON(subdir + \"/.bower.json\");\n packageInfo.bowerName = bowerJson.name;\n packageInfo.bowerVersion = bowerJson.version;\n }\n if (grunt.file.exists(subdir + \"/composer.json\")) {\n var composerJson = grunt.file.readJSON(subdir + \"/composer.json\");\n packageInfo.composerName = composerJson.name;\n packageInfo.composerVersion = composerJson.version;\n }\n var _bundles = grunt.file.readJSON(abspath);\n var packageName = _bundles.name;\n if (_bundles.exclude) {\n for (var i in _bundles.exclude) {\n excluded_bundles[_bundles.exclude[i]] = true;\n }\n }\n if (packageName !== undefined) {\n titleIndexBnudles[packageName] = [];\n for (var bundleName in _bundles) {\n if ((bundleName === packageName || bundleName.indexOf(packageName + \"/\") === 0) && !excluded_bundles[bundleName]) {\n if (bundles[bundleName]) {\n console.log(\"====Duplicate Package\", bundleName);\n } else if (!toIgnore(bundleName)) {\n titleIndexBnudles[packageName].push(bundleName);\n }\n bundles[bundleName] = { js: [], on: [], css: [], html: [], packageInfo: packageInfo};\n for (var file_i in _bundles[bundleName].js) {\n var js_file = subdir + \"/\" + _bundles[bundleName].js[file_i];\n bundles[bundleName].js.push(js_file);\n if (!allFiles[js_file]) {\n allFiles[js_file] = js_file;\n } else {\n console.log(\"====Duplicate File\" + js_file);\n }\n }\n for (var file_j in _bundles[bundleName].css) {\n var css_file = subdir + \"/\" + _bundles[bundleName].css[file_j];\n bundles[bundleName].css.push(css_file);\n if (!allFiles[css_file]) {\n allFiles[css_file] = css_file;\n } else {\n console.log(\"====Duplicate File\" + css_file);\n }\n }\n for (var file_k in _bundles[bundleName].html) {\n var html_file = subdir + \"/\" + _bundles[bundleName].html[file_k];\n bundles[bundleName].html.push(html_file);\n if (!allFiles[html_file]) {\n allFiles[html_file] = html_file;\n } else {\n console.log(\"====Duplicate File\" + html_file);\n }\n }\n bundles[bundleName].on = _bundles[bundleName].on || [];\n console.log(\"╬═╬ Module.json\", abspath);\n //console.log(bundleName, _bundles[bundleName].on);\n }\n }\n }\n }\n });\n\n\n var titleIndexBnudlesNames = Object.keys(titleIndexBnudles);\n\n if (options.modulize) {\n titleIndexBnudlesNames.map(function(bundName) {\n if (!bundles[bundName] && !toIgnore(bundName)) {\n bundles[bundName] = { js: [], on: titleIndexBnudles[bundName], css: [], html: [], packageInfo: {}};\n console.log(\"New Package \", bundName, bundles[bundName]);\n }\n });\n }\n\n for (var packageKey in excluded_bundles) {\n delete bundles[packageKey];\n }\n\n var firstIndexBundled = null;\n\n if (!TASK_SKIP_INIT) {\n var myIndexBnudles = indexBundles;\n if (TASK_BUNDLIFY) {\n\n var moreBundles = Object.keys(bundles);\n\n if (options.sort) {\n moreBundles = moreBundles.sort();\n }\n\n if (options.projectPrefix !== undefined) {\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles).filter(function(bundleName) {\n return bundleName.indexOf(options.projectPrefix) === 0;\n })));\n }\n\n myIndexBnudles = uniqueArray(myIndexBnudles.concat(titleIndexBnudlesNames.concat(moreBundles))).filter(function(bundleName) {\n return !toIgnore(bundleName);\n });\n\n }\n console.log(\"Bundles in Order\", myIndexBnudles);\n\n var prevBundle = null;\n myIndexBnudles.forEach(function(bundleName) {\n var _bundleMap = {};\n var includedBundles = [];\n var bundledFile = dest + \"/bootloader_bundled/\" + bundleName.split(\"/\").join(\".\");\n var bundledFile_js = bundledFile + \".js\";\n var files = getFiles(bundleName, {js: [], html: []}, bundledFile, includedBundles);\n var js_files = uniqueArray(files.js.reverse()).reverse();\n if (js_files.length > 0) {\n if (!firstIndexBundled && options.resourcesInline) {\n firstIndexBundled = bundleName;\n js_files.unshift(resourcesFile + \".js\");\n }\n _bundleMap[bundledFile_js] = js_files;\n //console.log(\"files\",bundleName,files.length,files);\n setBundleConfig(bundleName, _bundleMap, includedBundles, bundledFile_js);\n\n if (prevBundle && options.order) {\n var bundle = resourcesJs.bundles[bundleName];\n if (bundle) {\n bundle.on = [prevBundle].concat(bundle.on);\n }\n }\n prevBundle = bundleName;\n\n } else console.log(\"╬═╬ No File in bundle to bundlify thus skipping \", bundleName);\n\n var html_files = uniqueArray(files.html.reverse()).reverse();\n if (html_files.length) {\n var html_file_content = \"\";\n for (var i in html_files) {\n html_file_content += '<script type=\"text/html\" src=\"' + html_files[i] + '\">' + grunt.file.read(html_files[i]).split(\"\\t\").join(\"\")\n .split(\"\\n\").join(\" \")\n .split(\">\").map(function(v) {\n return v.trim();\n }).join(\">\") + '</script>';\n }\n grunt.file.write(bundledFile + \".html\", html_file_content);\n }\n\n });\n\n resourcesJs.gitinfo = grunt.config().gitinfo;\n if (firstIndexBundled) {\n var resJsonString = JSON.stringify({\n RESOURCES_JSON: resourcesJs,\n RESOURCES_FILE: resourcesFile\n }).replace(/\\r?\\n|\\r|\\\\n/g, ' ');\n\n var packed = resJsonString;\n var unpack = \"\";\n if(options.jsonpack){\n var jsonpack = require('jsonpack/main');\n var fs = require(\"fs\");\n unpack = grunt.file.read('node_modules/jsonpack/main.js');\n packed =('(jsonpack.unpack(\\''+jsonpack.pack(resJsonString)+'\\'))');\n }\n\n grunt.file.write(resourcesFile + \".js\", unpack+\";var _BOOTLOADER_CONFIG_=\" + packed);\n resourcesJs.bundles[firstIndexBundled].js.unshift(resourcesFile + \".js\");\n }\n\n grunt.task.run(\"uglify\");\n }\n\n grunt.file.write(resourcesFile, JSON.stringify(resourcesJs));\n\n }\n }", "function uglifyScripts(){\n var uglified = uglify.minify(getScripts());\n fs.writeFile(path.join(__dirname, '../', 'preload/scripts.js'), uglified.code, function (err){\n if(err) {\n console.log(err);\n } else {\n console.log(\"Scripts combined, minified and saved in:\", 'scripts.js');\n }\n });\n}", "function jsComp(cb){\n return src(\"./src/js/**/*.js\")\n .pipe(gulpIf(buildEnv === 'prod', uglify()))\n .pipe(conCat('main.min.js'))\n .pipe(dest(buildDir+\"js/\"))\n cb();\n}", "function buildScript() \n{\n var path = \"static/js/*.js\", // Path to scripts\n dist = \"static/dist/js\"; // Destiny\n\n // Building script\n return gulp.src(path) // Defning source of js scripts\n .pipe(concat(\"scripts.js\")) // Concating all scripts from path\n .pipe(rename({suffix: '.min'})) // Renaming scripts.js\n .pipe(uglify()) // Uglifying scripts.min.js\n .pipe(gulp.dest(dist)) // Destiny of scripts.min.js\n .pipe(notify({ message: \"Scripts task complete\" })); // Notify when done\n}", "function buildJavascript() {\n return buildGenerator('javascript', 'JavaScript');\n}", "function jsTask() {\n return src(files.jsPath)\n .pipe(browserSync.stream())\n // .pipe(uglify())\n .pipe(sourcemapsB.init())\n .pipe(babel())\n .pipe(concatB(\"main.js\"))\n .pipe(sourcemapsB.write(\".\"))\n .pipe(dest('pub/js')\n\n );\n}", "function uglify() {\n\t\t\tvar settings = config.styles.uglify;\n\n\t\t\treturn gulp.src( settings.src )\n\t\t\t // Deal with errors.\n\t\t\t .pipe( plugins.plumber( {errorHandler: handleErrors} ) )\n\n\t\t\t .pipe( plugins.rename( {suffix: '.min'} ) )\n\t\t\t .pipe( plugins.uglify( {\n\t\t\t\t mangle: false\n\t\t\t } ) )\n\t\t\t .pipe( gulp.dest( settings.dest ) ).on( 'end', function () {\n\t\t\t\t\t\t\tplugins.util.log( plugins.util.colors.bgGreen( 'Scripts are now minified....[uglify()]' ) );\n\t\t\t\t\t\t} )\n\t\t\t .pipe( plugins.notify( {message: 'Scripts are built.'} ) );\n\t\t}", "function scripts() {\n return gulp.src(paths.scripts.src)\n .pipe(uglify())\n .pipe(rename({ suffix: '.min' }))\n .pipe(gulp.dest(paths.scripts.dest));\n}", "function bundle() {\n return b.bundle()\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('bundle.js'))\n .pipe(buffer())\n .pipe(sourcemaps.init({loadMaps: true}))\n .pipe(gutil.env.type === 'production' ? uglify() : gutil.noop())\n .pipe(gutil.env.type !== 'production' ? sourcemaps.write('.', {sourceRoot: '/assets/js'}): gutil.noop())\n .pipe(gutil.env.type === 'production' ? gutil.noop() : gulp.dest('./assets/js'))\n .pipe(gutil.env.type === 'production' ? rename({suffix: '.min'}) : gutil.noop())\n .pipe(gutil.env.type === 'production' ? gulp.dest('./assets/js') : gutil.noop())\n .pipe(gutil.env.type === 'production' ? stripDebug() : gutil.noop())\n .pipe(livereload({start: true}));\n}", "function scripts() {\r\n return gulp\r\n .src('src/js/**/*.js')\r\n .pipe(plumber())\r\n .pipe(concat('main.js'))\r\n .pipe(terser())\r\n .pipe(gulp.dest('assets/js/'))\r\n .pipe(gulp.dest('_site/assets/js/'))\r\n .pipe(bsync.stream());\r\n}", "function mainScript( cb ) {\n // A filter to only use scripts in projectScripts - take out vendor scripts\n if ( allScripts.length === 0 ) {\n cb();\n return; \n }\n const noVendorFilter = filter( negatedProjectVendorScripts.concat( config.projectScripts ), {restore: true});\n return checkSrc( allScripts )\n .pipe(sourcemaps.init())\n .pipe( noVendorFilter ) //no babel-ing of vendor files\n .pipe(babel())\n .pipe( noVendorFilter.restore ) //put the vendor files back\n .pipe( concat( config.projectScriptName )) //put all files into single file with projectScriptName\n // .pipe( dest( config.destFolder + '/js')) // copy unminized js to destination - gulp minify appears to keep unminified file in stream\n .pipe( minify({\n ext: {\n min: '.min.js'\n }\n }))\n .pipe(sourcemaps.write('./maps'))\n .pipe( dest( config.destFolder + '/js'));\n}", "function jsBuild() {\n return gulp.src(paths.js.src)\n .pipe(uglify({\n mangle: false\n }))\n .pipe(rename({\n suffix: '.min'\n }))\n .pipe(gulp.dest(paths.js.build))\n .pipe(gulp.dest('_site/javascripts/build'))\n .pipe(browserSync.reload({stream: true}));\n}", "function scripts (watch, dest) {\n watch = watch || false;\n dest = dest || paths.build;\n\n var options = _.assign({}, watchify.args, {\n entries: ['./src/index.js'],\n standalone: 'datalasso'\n });\n\n if (watch) {\n options.plugin = [watchify];\n options.debug = true;\n }\n\n var b = browserify(options);\n b.transform('jstify', { engine: 'lodash' })\n b.transform(sassr);\n\n bundle = function () {\n return b.bundle()\n .on('error', console.error.bind(console, 'Browserify Error'))\n .pipe(source('datalasso.js'))\n .pipe(buffer())\n .pipe(gulpif(watch, sourcemaps.init({loadMaps: true})))\n .pipe(gulpif(watch, sourcemaps.write('./')))\n .pipe(derequire())\n .pipe(gulp.dest(dest));\n }\n\n b.on('update', bundle);\n b.on('log', console.log);\n\n return bundle();\n}", "function _generateScriptTags() {\n var root = path.join(__dirname, '../../dist/');\n var files = glob.sync([\n //vendors libraries\n root + \"js/vendors/jquery*.js\",\n root + \"js/vendors/angular.js*\",\n root + \"js/vendors/angular*.js\",\n root + \"js/vendors/*\",\n //application files\n root + \"js/app/**/module.js\",\n root + \"js/app/**/*.js\",\n root + \"js/app/bootstrap.js\",\n root + \"js/templates.js\"\n ]);\n\n return _.reduce(files, function(acc, it) {\n it = it.replace(root, \"\");\n acc.push('<script src=\"' + it + '\"></script>');\n return acc;\n }, []).join(\"\\n\");\n}", "function scripts() {\n\treturn src([\n\t\t// 'node_modules/jquery/dist/jquery.min.js', // npm vendor example (npm i --save-dev jquery)\n\t\t'docs/js/common.js' // common.js. Always at the end\n\t])\n\t\t.pipe(concat('scripts.min.js'))\n\t\t.pipe(babel({\n\t\t\tpresets: ['@babel/env'],\n\t\t\tplugins: ['@babel/plugin-syntax-import-meta'],\n\t\t}))\n\t\t.pipe(uglify()) // Minify JS (opt.)\n\t\t.pipe(dest('docs/js'))\n\t\t.pipe(browserSync.stream())\n}", "async function javascript() {\n const bundle = await rollup(rollupConfig);\n\n await bundle.write(rollupConfig.output);\n}", "function packageJavascript() {\n return packageGenerator('javascript_compressed.js', 'javascript.js', 'Blockly.JavaScript');\n}", "function jsDev() {\n return src([\n 'js/**/*.js',\n 'node_modules/bootstrap/dist/js/bootstrap.js'\n ])\n .pipe(sourcemaps.init())\n .pipe(\n babel({\n presets: ['@babel/env']\n })\n )\n .pipe(concat('scripts.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(dest('dist'));\n}", "function minify_vendor_js(cb){\r\n\tpump([\r\n\t\tgulp.src(paths.dist + 'bundles/vendor.js'),\r\n\t\tminifyJS(),\r\n\t\tgulp.dest(paths.dist + 'bundles/')\r\n\t], cb);\r\n}", "function minifyJS(f) {\n console.log(\"Begin Minifying \" + f.name);\n src(f.buildDir + f.buildFileName)\n .pipe(uglify())\n .pipe(extReplace(\".min.js\"))\n .pipe(\n dest(f.buildDir));\n console.log(\"End Minifying \" + f.name);\n}", "function minifyJsTask(d){\r\n return src(files.jsPath)\r\n .pipe(uglify())\r\n .pipe(dest('./dist/js'));\r\n}", "function scriptsSite() {\n return (\n gulp\n .src(['./_src/cssans/js/**/*.js', './_src/site/js/**/*.js'])\n .pipe(concat('main.min.js'))\n .pipe(uglify())\n .pipe(gulp.dest('./_includes/assets/'))\n );\n}", "function js() {\n return gulp.src(['node_modules/bootstrap/dist/js/bootstrap.min.js', 'node_modules/jquery/dist/jquery.min.js', 'node_modules/popper.js/dist/umd/popper.min.js'])\n .pipe(gulp.dest(\"./public/bin/js\"))\n .pipe(browserSync.stream());\n}", "function buildAppJs() {\n\n //Create stream\n var stream = mergeStream(\n gulp.src(config.assets.client.js.app),\n templatesStream(),\n environmentStream()\n ).pipe(ngAnnotate())\n .pipe(wrapper(angularWrapper()));\n\n //Deploying? Don't create source maps\n if (isDeploying) {\n stream = stream\n .pipe(babel({\n //https://babeljs.io/docs/usage/options/\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(wrapper(bannerWrapper()));\n }\n\n //Minifying?\n else if (config.build.app.js.minify) {\n var mapFilter = filter(['!*.map']);\n stream = stream\n .pipe(sourcemaps.init())\n .pipe(babel({\n nonStandard: false,\n compact: false\n }))\n // .pipe(typescript({\n // noImplicitAny: true\n // }))\n .pipe(concat(packageFileName('.min.js')))\n .pipe(uglify())\n .pipe(sourcemaps.write('./'))\n .pipe(mapFilter)\n .pipe(wrapper(bannerWrapper()))\n .pipe(mapFilter.restore());\n }\n\n //Write to public folder and return\n return stream.pipe(gulp.dest(destination + '/js'));\n}", "function loadScripts(){\n renderer.setIPC();\n inject.uglifyScripts();\n inject.injectScripts();\n}", "function jsHandler() {\n\treturn gulp.src(\"./app/js/mainscript.js\")\n\t.pipe(babel().on(\"error\", errorHandler))\n\t.pipe(gulp.dest(\"./dist/js/\"))\n\t.pipe(browserSync.stream());\n}", "function processJs(jsFiles) {\n var mergedJs = mergeFiles(jsFiles).join(' ');\n var script = replaceDemoModuleWithCodepenModule(mergedJs);\n return script;\n}", "function cons() {\n return src([\n 'src/js/jquery.custom.min.js',\n 'src/js/menu.min.js',\n 'src/js/swiper.custom.min.js',\n ], { sourcemaps: true })\n .pipe(concat('app.min.js'))\n .pipe(dest('dist/', { sourcemaps: true }))\n}", "function js() {\n return gulp\n .src(paths.jsSrc)\n .pipe(plumber())\n .pipe(sourcemaps.init())\n .pipe(babel())\n .pipe(concat('index.js'))\n .pipe(sourcemaps.write('.'))\n .pipe(gulp.dest('./app/js/'))\n .pipe(gulp.dest('./dist/js/'))\n .pipe(browsersync.stream());\n}", "function bundle()\n{\n return bundler.bundle()\n // log errors if they happen\n .on( 'error', gutil.log.bind( gutil, 'Browserify Error' ) )\n .pipe( source( 'webplayer.js' ) )\n //\n .pipe( gulp.dest( './dist/js/' ) );\n}", "function smoosher(){\n\n // Compress/concat files for deploy env...\n // Need to run this locally BEFORE deploying\n // to nodejitsu\n require('smoosh').make({\n \"VERSION\": app.locals.app_version,\n \"JSHINT_OPTS\": {\n \"browser\": true,\n \"evil\":true, \n \"boss\":true, \n \"asi\": true, \n \"laxcomma\": true, \n \"expr\": true, \n \"lastsemic\": true, \n \"laxbreak\":true,\n \"regexdash\": true\n },\n \"JAVASCRIPT\": {\n \"DIST_DIR\": \"./public/js\",\n \"dependencies\": [ { \"src\": \"./public/js/bootstrap.js\", \"jshint\": false}, \n { \"src\": \"./public/js/ace.js\", \"jshint\": false}, \n { \"src\": \"./public/js/keybinding-vim.js\", \"jshint\": false}, \n { \"src\": \"./public/js/mode-markdown.js\", \"jshint\": false}, \n { \"src\": \"./public/js/showdown.js\", \"jshint\": false},\n //对于highlight库,没有unpack的js文件\n { \"src\": \"./public/js/highlight.min.js\", \"jshint\": false},\n { \"src\": \"./public/js/socket.io.js\", \"jshint\": false},\n { \"src\": \"./public/js/filemanager.js\", \"jshint\": false},\n { \"src\": \"./public/js/keymaster.js\", \"jshint\": false}],\n \"dillinger\": [ \"./public/js/dillinger.js\" ]\n },\n \"CSS\": {\n \"DIST_DIR\": \"./public/css\",\n \"style\": [ \"./public/css/style.css\" ]\n }\n })\n .done(function(){\n console.log('\\nSmoosh all finished...\\n')\n })\n \n}", "function bundle() {\n return w.bundle()\n // log errors if they happen\n .on('error', gutil.log.bind(gutil, 'Browserify Error'))\n .pipe(source('./bundle.js'))\n .pipe(buffer())\n // .pipe(uglify())\n .pipe(gulp.dest('./src/js/'))\n .pipe(connect.reload());\n}", "function taskScripts() {\n logSubtask('scripts');\n\n return gulp.src(`${SCRIPTS_SRC}/app.js`)\n .pipe(plumber())\n .pipe(babel(babelConfig))\n .pipe(uglify({ compress: { hoist_funs: false, hoist_vars: false } }))\n .pipe(rollup({\n format: 'cjs'\n }))\n .pipe(gulp.dest(SCRIPTS_DIST));\n}", "function buildJavascript() {\n return rollupStream({\n input: './src/components/App.js',\n output: {\n format: 'es'\n },\n plugins: [\n rollupResolve()\n ]\n })\n .pipe(source('bundle.js'))\n .pipe(gulp.dest('./dist/static'));\n}", "async function optimizeScripts() {\n await gulp\n .src(configProd.optimize.scripts.src)\n .pipe(plumber())\n .pipe(uglify(configProd.optimize.scripts.options))\n .pipe(gulp.dest(configProd.optimize.scripts.dest))\n .pipe(size(configProd.size));\n}", "function scripts() {\n\tvar stream = browserify({\n\t\t\tfullPaths: false,\n\t\t\tentries: paths.src.scripts + 'main.js',\n\t\t\tdebug: config.sourcemaps.scripts,\n\t\t\textensions: config.extensions\n\t\t});\n\n\t// references to the vendors' bundle\n\tconfig.vendors.forEach(function(vendor) {\n\t\tstream.external(vendor);\n\t});\n\n\treturn stream\n\t\t.transform(babelify, { presets: config.presets })\n\t\t.bundle().on('error', errorHandler.bind(this))\n\t\t.pipe(source('main.js'))\n\t\t.pipe(gulp.dest(paths.dist.scripts))\n\t\t.pipe(bsync.reload({stream: true, once: true}));\n}", "async function scripts() {\n\tlet watch = (mode == 'production') ? false : true;\n\n\tconst config = {\n\t\twatch: watch,\n\t\tmode: mode,\n\t\tentry: {\n\t\t\t'main': './src/js/main.js',\n\t\t\t'app': './src/js/app.js',\n\t\t},\n\t\toutput: {\n\t\t\tpath: __dirname,\n\t\t\tfilename: '[name].js'\n\t\t},\n\t\tmodule: {\n\t\t\trules: [\n\t\t\t\t{\n\t\t\t\t\ttest: /\\.vue$/,\n\t\t\t\t\tloader: 'vue-loader'\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\ttest: /\\.scss$/,\n\t\t\t\t\tuse: [\n\t\t\t\t\t\t'vue-style-loader',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tloader: 'css-loader',\n\t\t\t\t\t\t\toptions: { modules: true }\n\t\t\t\t\t\t},\n\t\t\t\t\t\t'sass-loader'\n\t\t\t\t\t]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\tplugins: [\n\t\t\tnew VueLoaderPlugin()\n\t\t]\n\t};\n\n\treturn src('./src/js/*.js')\n\t\t.pipe(webpack(config))\n\t\t.pipe(dest('build/js/'))\n\t\t.pipe(browserSync.stream());\n}", "function minifyJs() {\r\n\treturn gulp\r\n\t\t.src( paths.js.src )\r\n\t\t.pipe( uglify() )\r\n\t\t.pipe( rename( { suffix: '.min' } ) )\r\n\t\t.pipe( gulp.dest( paths.js.dest ) )\r\n\t\t.on( 'error', notify.onError() );\r\n}", "function compileJS() {\r\n var files = [], //eventually an array of all the js to combine\r\n stream,\r\n replacements = jsReplacements || {},\r\n tokens = Object.keys(replacements);\r\n\r\n //add 3rd party javascript to the list of files to be concatenated\r\n if (jsLibs.length > 0) {\r\n files = files.concat(jsLibs);\r\n }\r\n // add our own javascript to the list of files to be concatenated\r\n if (source.js) {\r\n if (source.js.length > 0) {\r\n files = files.concat(source.js);\r\n }\r\n }\r\n // add env properties file to the list\r\n if (source.properties) {\r\n files.push(source.properties);\r\n }\r\n\r\n stream = src(files);\r\n\r\n stream = stream.pipe(sourcemaps.init())\r\n .pipe(concat(jsMain))\r\n .pipe(sourcemaps.write());\r\n\r\n for (let i = 0; i < tokens.length; i++) {\r\n stream = stream.pipe(replace('<%' + tokens[i] + '%>', replacements[tokens[i]]));\r\n }\r\n\r\n return stream.pipe(dest(getJSPath()));\r\n}" ]
[ "0.6915525", "0.6848662", "0.67323774", "0.656251", "0.6523141", "0.6499541", "0.64927965", "0.64870816", "0.6483991", "0.6456017", "0.64070636", "0.63733095", "0.63696456", "0.63490963", "0.63288784", "0.6327119", "0.632227", "0.6311692", "0.627115", "0.6269822", "0.6263955", "0.62177634", "0.6215467", "0.61572284", "0.61564255", "0.61216027", "0.611009", "0.6098345", "0.6090175", "0.6078709", "0.60636216", "0.60506254", "0.6049443", "0.60355526", "0.6003325", "0.59810793", "0.5958248", "0.59455234", "0.59314704", "0.59300417", "0.5925926", "0.5923297", "0.5911481", "0.5897469", "0.58960074", "0.58904594", "0.5890062", "0.58839405", "0.58736825", "0.5868685", "0.5835549", "0.5835282", "0.5831838", "0.5821272", "0.58156383", "0.5813143", "0.5810293", "0.57902324", "0.5790133", "0.57830465", "0.5777929", "0.5772717", "0.57726765", "0.5771764", "0.5747041", "0.57360554", "0.5732868", "0.572466", "0.5724426", "0.57229495", "0.5711866", "0.56926334", "0.5688788", "0.5673955", "0.56455517", "0.56415665", "0.5639837", "0.56147295", "0.56106484", "0.5608396", "0.5605554", "0.5590238", "0.55685174", "0.55632156", "0.5559857", "0.5552383", "0.5548106", "0.55446154", "0.5541556", "0.55399585", "0.55288756", "0.55256754", "0.5523286", "0.55201685", "0.550773", "0.55028313", "0.5500602", "0.54917926", "0.5491406", "0.54900545", "0.5489205" ]
0.0
-1
Initialize the div with the svg element
function updateStatisticsModal() { $(domSelector).empty(); let data = getStatisticData(); let tableString = ''; let markerEmtpyRow = data[0][0]; data = data.sort(compare); let minMax = [d3.min(data, function(d) { return d[15]; }), d3.max(data, function(d) { return d[15]; }) ]; let colorScale = d3.scaleSqrt() .domain(minMax) .range(['#fff', '#ef3b2c']); data.forEach(function(d) { if (markerEmtpyRow !== d[0]) { tableString += '<tr class="blank-row"></tr>'; markerEmtpyRow = d[0]; } tableString += '<tr id="' + (d[0] + '---' + d[1]) + '" style="background: ' + colorScale(d[15]) + '">'; d.forEach(function(elm) { if (elm !== undefined) { if (Number(elm) === elm && elm % 1 !== 0) { tableString += '<td>' + parseFloat(elm).toFixed(2) + '</td>'; } else { tableString += '<td>' + elm + '</td>'; } } else { tableString += '<td></td>'; } }); tableString += '</tr>'; }); $(domSelector).append(tableString); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "init() {\n var me = this,\n svg = document.createElementNS(this.xmlns, 'svg');\n svg.setAttribute('id', this.id);\n svg.setAttribute('width', this.coorWidth);\n svg.setAttribute('height', this.coorHeight);\n svg.setAttribute('zoomAndPan', this.zoomAndPan);\n if (this.style) {\n svg.setAttribute('style', this.style);\n }\n if (this.onload) {\n svg.setAttribute('onload', this.onLoad);\n }\n me._docElementNS = svg;\n if (this.children.length > 0) {\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.parent = this;\n if (child.docElementNS) {\n this.docElementNS.appendChild(child.docElementNS);\n }\n }\n }\n if (me.autoBind) {\n me.bind();\n }\n }", "init() {\n let svg = '<path' +\n ' id=\"' + this.id +'\"';\n\n if (this.stroke) {\n svg += ' stroke=\"' + this.stroke + '\"';\n }\n if (this.strokeWidth) {\n svg += ' stroke-width=\"' + this.strokeWidth + '\"';\n }\n if (this.opacity) {\n svg += ' opacity=\"' + this.opacity + '\"';\n }\n if (this.data) {\n svg += ' d=\"' + this.data + '\"';\n }\n svg+= '></path>'\n this.innerHTML = svg;\n }", "function initSVG() {\n \t\tsvg = d3.select('body')\n \t\t.append('svg')\n \t\t.attr('viewBox', '0 0 600 600')\n \t\t.attr('style', 'width: 300px; height: 300px;');\n \t}", "componentDidMount() {\n this.svg = d3.select(`#${this.getDivId()}`).append('svg')\n }", "_initSvgEls() {\n const _this = this;\n\n this.svgEls = {\n panel: document.createElementNS(this.SVG_NS, \"rect\"),\n sliders: [],\n sliderPanels: []\n };\n\n this._appendSvgEls();\n this._update();\n }", "function svgInit(svg){\n // Set the SVG size\n svg\n .attr('width', width)\n .attr('height', height);\n\n // Create and translate the container group\n var g = svg.append('g')\n .attr('class', 'chart-content')\n .attr('transform', 'translate(' + [margin.top, margin.left] + ')');\n\n // Add a background rectangle\n g.append('rect')\n .attr('width', width - margin.left - margin.right)\n .attr('height', height - margin.top - margin.bottom)\n .attr('fill', 'white');\n\n\n // Other Version\n // Compute the width and height of the charting area\n var margin = chart.margin(),\n width = chart.width() - margin.left - margin.right,\n height = chart.height() - margin.top - margin.bottom,\n translate = windmill.svg.translate;\n\n // Set the size of the svg element\n svg\n .attr('width', chart.width())\n .attr('height', chart.height());\n\n // Chart Container\n svg.append('g')\n .attr('class', 'chart')\n .attr('transform', translate(margin.left, margin.top));\n\n // X Axis Container\n svg.append('g')\n .attr('class', 'axis xaxis')\n .attr('transform', translate(margin.left, margin.top + height));\n\n // Y Axis Container\n svg.append('g')\n .attr('class', 'axis yaxis')\n .attr('transform', translate(margin.left, margin.top));\n}", "createSmallSVG(initDiv) {\n return initDiv.append('svg')\n .attr('width', 20)\n .attr('height', 40)\n .style(\"margin\", \"5px\")\n .style(\"display\",\"table-row\")\n .style(\"background-color\", \"Blue\");\n }", "constructor () {\n this.width = 0\n this.height = 0\n this.points = \"\"\n this.id = \"container\"\n this.customSvgStyle = \"\"\n this.strokeColor = \"#000\"\n this.strokeWidth = 1\n this.circleX = 0\n this.circleY = 0\n this.circleShow = true\n this.circleColor = \"#ff0000\"\n this.circleRadius = 6\n }", "constructor(){\n\t this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n\t let divvotesPercentage = d3.select(\"#votes-percentage\").classed(\"content\", true);\n\n\t //fetch the svg bounds\n\t this.svgBounds = divvotesPercentage.node().getBoundingClientRect();\n\t this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n\t this.svgHeight = 200;\n\n\t //add the svg to the div\n\t this.svg = divvotesPercentage.append(\"svg\")\n\t .attr(\"width\",this.svgWidth)\n\t .attr(\"height\",this.svgHeight)\n\n }", "constructor(){\n\t this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n\t let divvotesPercentage = d3.select(\"#votes-percentage\").classed(\"content\", true);\n\n\t //fetch the svg bounds\n\t this.svgBounds = divvotesPercentage.node().getBoundingClientRect();\n\t this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n\t this.svgHeight = 200;\n\n\t //add the svg to the div\n\t this.svg = divvotesPercentage.append(\"svg\")\n\t .attr(\"width\",this.svgWidth)\n\t .attr(\"height\",this.svgHeight)\n\n }", "function createSvg() {\n svg = d3Service.select(parentElement).append(\"svg\");\n }", "_renderSvg() {\n this._svg = d3\n .select(this.parent)\n .append(\"svg\")\n .attr(\"class\", \"chart-svg\")\n .append(\"g\")\n .attr(\"class\", \"data-container\")\n .append(\"g\")\n .attr(\"class\", \"markers-container\");\n }", "function init() {\n\n svg = d3\n .select(\"#d3-container-1\")\n .append(\"svg\")\n\n draw(); // calls the draw function\n }", "constructor(shiftChart) {\n this.shiftChart = shiftChart;\n\n this.margin = {\n top: 30,\n right: 20,\n bottom: 30,\n left: 50\n };\n let divelectoralVotes = d3.select(\"#electoral-vote\").classed(\"content\", true);\n\n //Gets access to the div element created for this chart from HTML\n this.svgBounds = divelectoralVotes.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 150;\n\n //creates svg element within the div\n this.svg = divelectoralVotes.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n\n }", "constructor (shiftChart){\n this.shiftChart = shiftChart;\n\n this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n let divelectoralVotes = d3.select(\"#electoral-vote\").classed(\"content\", true);\n\n //Gets access to the div element created for this chart from HTML\n this.svgBounds = divelectoralVotes.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 150;\n\n //creates svg element within the div\n this.svg = divelectoralVotes.append(\"svg\")\n .attr(\"width\",this.svgWidth)\n .attr(\"height\",this.svgHeight)\n ;\n }", "function init(svg){\n\tsvgReady = svg;\n\t\n\tgoReady();\n}", "drawSvg() {\n \n\t}", "constructor(element){\n // select the div in the ChartWrapper return\n // append svg canvas, set width and height\n // store svg in a var to keep track of where it is\n const svg = d3.select(element)\n .append(\"svg\")\n .attr(\"width\", 500)\n .attr(\"height\", 500)\n\n // append rectangle to svg canvas\n // x and y position rect based on top left corner of canvas\n svg.append(\"rect\")\n .attr(\"x\", 50)\n .attr(\"y\", 50)\n .attr(\"width\", 100)\n .attr(\"height\", 400)\n .attr(\"fill\", \"grey\")\n }", "constructor (shiftChart){\n this.shiftChart = shiftChart;\n\n this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n let divelectoralVotes = d3.select(\"#electoral-vote\").classed(\"content\", true);\n\n //Gets access to the div element created for this chart from HTML\n this.svgBounds = divelectoralVotes.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 150;\n\n //creates svg element within the div\n this.svg = divelectoralVotes.append(\"svg\")\n .attr(\"width\",this.svgWidth)\n .attr(\"height\",this.svgHeight)\n ;\n\n }", "function getSvgElement() {\n\n let svg = getSvg('svg');\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\n \n // Set up SVG defs\n \n const rectDef = getSvg('rect'),\n defs = getSvg('defs');\n \n rectDef.setAttribute('class', 'note');\n rectDef.setAttribute('id', rectId);\n rectDef.setAttribute('height', PIANO_ROLL_OPTIONS.barHeight);\n defs.appendChild(rectDef);\n svg.appendChild(defs);\n\n return svg;\n }", "initializeVizSpace() {\n this.svg = d3.select(this.node)\n .attrs({\n viewBox: `0 0 ${this.getSvgOuterWidth()} ${this.getSvgOuterHeight()}`,\n preserveAspectRatio: `xMidYMid meet`\n })\n ;\n\n this.svg = this.svg.append(\"g\")\n .attrs({\n \"transform\": `translate(${this.props.svgSize.margin.left}, ${this.props.svgSize.margin.top})`,\n })\n ;\n }", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function SVGElement() {}", "function setupSVG(svg, width, height) {\n //Remove children of svg to eventually tiles from the previous image\n svg.innerHTML = '';\n\n //Give to svg the same size as the image\n svg.setAttribute('viewBox', '0 0 '+width+' '+height);\n svg.setAttribute('width', '100%');\n svg.setAttribute('height', '100%');\n}", "_setGraphContent () {\n const bb = this._boundingBox;\n const height = bb.offsetHeight;\n const width = bb.offsetWidth;\n\n let svg = d3.select(bb).append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(50,0)\");\n\n this._setSVG(svg);\n }", "_createSVG() {\n\t\t\treturn d3.select(this._container)\n\t\t\t\t.append('svg');\n\t\t}", "constructor (config) {\n super(config)\n this.svg.height = this.svg.width * (204/114)\n this.svg.svgRoot = document.createElementNS(this.NS, 'svg')\n this.svg.svgRoot.setAttribute('width', this.svg.width)\n this.svg.svgRoot.setAttribute('height', this.svg.height)\n this.svg.snapRoot = Snap(this.svg.svgRoot)\n }", "function SVGParent() {}", "function createSVG() {\n svg = d3.select(\"#bubble-chart\")\n .append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height);\n }", "init() {\n // Add label\n $sel.append('text')\n .text(d => `${d.key}`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\t$svgFront = container.append('svg.area-front');\n\t\t\t\tconst $gFront = $svgFront.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$visFront = $gFront.append('g.g-vis');\n\n // Add svg for back pockets\n $svgBack = container.append('svg.area-back');\n const $gBack = $svgBack.append('g');\n\n // setup viz group\n $visBack = $gBack.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "initialize(node, props) {\n const svg = this.svg = d3.select(node).append('svg');\n svg.attr('viewBox', `0 0 ${size} ${size}`)\n .style('width', '100%')\n .style('height', 'auto');\n\n this.circle = svg.append('circle')\n .attr('r', props.r)\n .attr('cx', size / 2)\n .attr('cy', size / 2);\n }", "componentDidMount() {\n\n this.svg = d3.select(this.refs.svg);\n\n this._plotChina();\n this._addMarkup();\n this._listenForResize();\n this._listenForMove();\n\n }", "function doInitialization() {\n\t\tvar svg = \"\";\n\n\t\tif (typeof theSvgElement === \"undefined\") {\n\t\t\t// Add event to body: each time a key is hit -> launch function 'doUpdate'\n\t\t\tdocument.body.addEventListener(\"keyup\", doUpdate, false);\n\n\t\t\t// Open new window for drawing\n\t\t\tvar myWindow = window.open('', 'Drawing', \"width=\" + WINDOWS_WIDTH + \", height=450\", '');\n\t\t\tmyWindow.document.open();\n\t\t\tmyWindow.document.writeln('<h2>Drawing</h2>');\n\t\t\tmyWindow.document.writeln('<div id=\\\"drawing1\\\" style=\\\"width: 600px; height: 400px; border:1px solid black; \\\"></div>');\n\t\t\tmyDoc = myWindow.document;\n\t\t\tmyWindow.document.close();\n\n\n\t\t\tsvg = \"<svg style=\\\"display: inline; width: inherit; min-width: inherit; max-width: inherit; height: inherit; min-height: inherit; max-height: inherit;\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" version=\\\"1.1\\\">\";\n\n\t\t\t// Add basic information about SVG drawing\n\t\t\tsvg += \"<title>\" + \"My drawing\" + \"</title>\";\n\t\t\tsvg += \"<desc>Write drawing description here...</desc>\";\n\n\t\t\tsvg += `<defs><style type=\"text/css\">\n\t\t\t\tpath.basicshape {\n\t\t\t\t\tstroke-width: 2;\n\t\t\t\t\tstroke: black;\n\t\t\t\t}\n\t\t\t\tline.dim {\n\t\t\t\t\tstroke-width: 1;\n\t\t\t\t}\n\t\t\t\tpath.squeleton {\n\t\t\t\t\tstroke: red;\n\t\t\t\t\tstroke-width: 1;\n\t\t\t\t\tfill: white;\n\t\t\t\t\tfill-opacity: 0.25;\n\t\t\t\t}\n\t\t\t\ttext.squeleton {\n\t\t\t\t\tfill: red;\n\t\t\t\t}\n\t\t\t\tcircle.centerfillet {\n\t\t\t\t\tfill: pink;\n\t\t\t\t\tstroke-width: 0;\n\t\t\t\t}\n\t\t\t\tcircle.origin {\n\t\t\t\t\tfill: blue;\n\t\t\t\t\tstroke-width: 0;\n\t\t\t\t}\n\t\t\t\tcircle.circleptsfilletg {\n\t\t\t\t\tfill: green;\n\t\t\t\t\tstroke-width: 0;\n\t\t\t\t}\n\t\t\t\tcircle.circleptsfillety {\n\t\t\t\t\tfill: yellow;\n\t\t\t\t\tstroke-width: 0;\n\t\t\t\t}\n\t\t\t\t</style></defs>\n\t\t\t\t`;\n\n\t\t\t// Add containers: dimension, origin and lines\n\t\t\tsvg += \"\\n<defs id=\\\"hatchpattern\\\" ></defs>\";\n\t\t\tsvg += \"\\n<g id=\\\"dimension\\\"></g>\";\n\t\t\tsvg += \"\\n<g id=\\\"origin\\\"></g>\";\n\t\t\tsvg += \"\\n</svg>\";\n\n\t\t\t// Draw SVG in MyDoc window\n\t\t\tmyDoc.getElementById(\"drawing1\").innerHTML = svg;\n\t\t\t// catch SVG in theSvgElement variable for further function\n\t\t\ttheSvgElement = myDoc.getElementsByTagName(\"svg\")[0];\n\n\t\t\t// Pattern for Arrow (marker) with default color value\n\t\t\tdoArrowpattern();\n\n\t\t}\n\n\t\t// Start function 'doUpdate' for the first time\n\t\tdoUpdate();\n\t}", "constructor(tooltip){\n this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n let divvotesPercentage = d3.select(\"#votes-percentage\").classed(\"content\", true);\n\n //fetch the svg bounds\n this.svgBounds = divvotesPercentage.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 200;\n\n //add the svg to the div\n this.svg = divvotesPercentage.append(\"svg\")\n .attr(\"width\",this.svgWidth)\n .attr(\"height\",this.svgHeight)\n\n this.tooltip = tooltip;\n }", "drawSvgWrapper() {\n //Construct Body\n var body = d3.select(\"#root\")\n\n //Construct SVG\n var svg = body\n .append(\"div\")\n .append(\"svg\")\n .attr(\"class\", \"svg\")\n .attr(\"id\", \"content\")\n .attr(\"width\", this.width)\n .attr(\"height\", this.height)\n .attr(\"viewBox\", this.viewBox)\n .attr(\n \"transform\",\n \"translate(\" +\n this.width / 2 +\n \",\" +\n this.height / 2 +\n \")\"\n )\n ;\n //Draw G for map\n return svg;\n }", "function setSVG(nom) {\r\n var elementHtmlARemplir = window.document.getElementById(\"id_image\");\r\n elementHtmlARemplir.innerHTML = nom;\r\n}", "constructor(tooltip){\n this.margin = {top: 30, right: 20, bottom: 30, left: 50};\n let divvotesPercentage = d3.select(\"#votes-percentage\").classed(\"content\", true);\n\n //fetch the svg bounds\n this.svgBounds = divvotesPercentage.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 200;\n\n //add the svg to the div\n this.svg = divvotesPercentage.append(\"svg\")\n .attr(\"width\",this.svgWidth)\n .attr(\"height\",this.svgHeight)\n .append(\"g\")\n .attr(\"transform\", \"translate(20, 70)\");\n\n this.tooltip = tooltip;\n }", "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function onSVGLoaded( data ){\n var rectID= \"#\"+(ctrl.room.number).toLowerCase();\n var rect = data.select(rectID);\n rect.attr(\"fill\", \"#42A5F5\");\n s.append( data );\n }", "set container(cont) {\n this._container = cont;\n this._container.innerHTML = [\n document.querySelector('#svg-container-base').innerHTML,\n this.options.keepContent ? this.container.innerHTML : '',\n ].join('');\n this._addClass('svg-container');\n }", "init() {\n $svg = $chart.append('svg').attr('class', 'pudding-chart');\n\n // create axis\n $axis = $svg.append('g').attr('class', 'g-axis');\n // setup viz group\n $vis = $svg.append('g').attr('class', 'g-vis');\n\n $label = $svg.append('g').attr('class', 'g-label');\n\n $axis.append('g').attr('class', 'axis--y axis--y--bg');\n $axis.append('g').attr('class', 'axis--y axis--y--fg');\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--bg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--fg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-label')\n .text(label)\n .attr('x', 0)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', endLabel ? 'end' : 'start')\n .style('font-size', LABEL_SIZE);\n }", "function SVGBaseElement() {\n }", "function getNewSVG (w, h) {\n svg = d3.select(\"#mainsvg\")\n .attr(\"width\", w)\n .attr(\"height\", h)\n .attr(\"class\", \"centered\");\n}", "function injectSVG() {\n\n\t\tvar ajax = new XMLHttpRequest();\n\n\t\tajax.open('GET', 'assets/img/svg.svg?v=4', true);\n\t\tajax.send();\n\t\tajax.onload = function(e) {\n\n\t\t\tvar div = document.createElement('div');\n\t\t\tdiv.id = 'svgInject';\n\t\t\tdiv.innerHTML = ajax.responseText;\n\t\t\tdocument.body.insertBefore(div, document.body.childNodes[0]);\n\n\t\t}\n\n\t}", "clear() {\n this.$svg.innerHTML = '';\n }", "create(el, props) {\n const {width, height} = props;\n this.svg = d3.select(el).append('svg')\n .attr('class', 'd3')\n .attr('width', width)\n .attr('height', height)\n this.created = true;\n }", "function init_svg(){\n\n if(document.getElementById('world-map-svg')){\n \n // set svg fill to default\n reset_svg_fill();\n\n // generate the dropdwon with custom rank names\n makeDDM();\n\n // add tooltip event on all countries and info button\n add_tooltip_event_countries();\n add_tooltip_event_info();\n hideDDM2_extraOptions();\n\n // remove the next 3 lines once implemented\n document.getElementById('rank-attribute').selectedIndex = 0;\n document.getElementById('rank-type').selectedIndex = 0;\n var svg = d3.select('#world-map-svg')\n fill_csv(svg, global_rank_function + '_' + global_rank_type, global_is_mono, global_isAscending);\n\n }\n else{\n setTimeout(init_svg, 100); \n }\n \n}", "init() {\n $svg = $chart\n .select(\".figure__chart\")\n .append(\"svg\")\n .attr(\"class\", \"pudding-chart\");\n\n // create axis\n $axis = $svg.append(\"g\").attr(\"class\", \"g-axis\");\n\n // setup viz group\n $vis = $svg.append(\"g\").attr(\"class\", \"g-vis\");\n\n $vis.append(\"g\").attr(\"class\", \"arc\");\n $vis.append(\"g\").attr(\"class\", \"hist\");\n\n const extentX = d3.extent(data, d => d.distance);\n scaleArcX.domain(extentX).nice();\n scaleArcY.domain(extentX).nice();\n\n const binX = d3.range(0, scaleArcX.domain()[1], binSize);\n scaleHistX.domain(binX);\n }", "init() {\n var docElement = document.createElementNS(this.xmlns, 'path');\n docElement.setAttribute('id', this.id);\n if (this.stroke) {\n docElement.setAttribute('stroke', this.stroke);\n }\n if (this.strokeWidth) {\n docElement.setAttribute('stroke-width', this.strokeWidth);\n }\n if (this.opacity) {\n docElement.setAttribute('opacity', this.opacity);\n }\n if (this.data) {\n docElement.setAttribute('d', this.data);\n }\n this._docElementNS = docElement;\n if (this.autoBind) {\n this.bind();\n }\n }", "function SVGWrap() {}", "function appendSVG() {\n // append svg element to body\n return d3.select(\".chart\").append(\"svg\")\n .attr(\"id\", \"svg\")\n .attr(\"width\", w + margins.left + margins.right)\n .attr(\"height\", h + margins.top + margins.bottom)\n .append(\"g\")\n .attr(\"id\", \"scatterplot\")\n .attr(\"transform\", \"translate(\" + margins.left + \",\" + margins.top + \")\");\n }", "function init(evt) {\n\n SVGDocument = evt.target.ownerDocument;\n SVGRoot = SVGDocument.documentElement;\n nodes = SVGDocument.getElementsByTagName('g');\n edges = SVGDocument.getElementsByTagName('g');\n nodesLength = nodes.length;\n\n //top.processGraph();\n\n }", "onLoad() {\n this.svg = this.createSvg();\n this._bg.appendChild(this.svg);\n this.setShaderProperties();\n this.randomize();\n this.createPolygons();\n this.refresh();\n }", "render(svg, events) {\n let prevSvg = document.querySelector(`${this.eCfg.selector} svg`);\n if (prevSvg) prevSvg.remove();\n\n svg._visualization = this.drawableElement._visualization;\n this.drawableElement = svg;\n d3.select(svg).selectAll('path').attr('vector-effect', 'non-scaling-stroke'); // for zoom\n\n svg.style.top = '0px';\n svg.style.left = '0px';\n svg.style.position = 'absolute';\n this.element.append(svg) // this.v.element.selector\n\n return this.attachEvents(svg, events);;\n }", "constructor (trendChart){\n\n // Follow the constructor method in yearChart.js\n // assign class 'content' in style.css to electoral-vote chart\n\n this.trendChart = trendChart;\n\n this.margin = {top: 30, right: 20, bottom: 20, left: 50};\n let divElectoralVoteChart = d3.select(\"#electoral-vote\").classed(\"sub_content\", true);\n\n this.svgBounds = divElectoralVoteChart.node().getBoundingClientRect();\n this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\n this.svgHeight = 150;\n\n //add the svg to the div\n this.svg = divElectoralVoteChart.append(\"svg\")\n .attr(\"width\", this.svgWidth)\n .attr(\"height\", this.svgHeight)\n }", "render () {\n return (\n <div className=\"container\">\n <div className=\"row\">\n <div className=\"col-8 offset-2\">\n <svg id=\"treestruct\" ref={node => this.node = node}\n width={500} height={500}>\n </svg>\n </div>\n </div>\n </div>\n )\n }", "constructor()\r\n {\r\n\t this.margin = {top: 30, right: 20, bottom: 30, left: 50};\r\n\t let divvotesPercentage = d3.select(\"#votes-percentage\").classed(\"content\", true);\r\n\r\n\t //fetch the svg bounds\r\n\t this.svgBounds = divvotesPercentage.node().getBoundingClientRect();\r\n\t this.svgWidth = this.svgBounds.width - this.margin.left - this.margin.right;\r\n\t this.svgHeight = 200;\r\n\r\n\t //add the svg to the div\r\n\t this.svg = divvotesPercentage.append(\"svg\")\r\n\t .attr(\"width\",this.svgWidth)\r\n\t .attr(\"height\",this.svgHeight);\r\n\r\n\t this.svg.append(\"g\")\r\n \t.classed(\"votesPercentage\",true);\r\n\r\n\t this.svg.append(\"g\")\r\n\t .append(\"rect\")\r\n\t .attr(\"x\",this.svgWidth/2)\r\n\t .attr(\"y\",75)\r\n\t .attr(\"width\",3)\r\n\t .attr(\"height\",35)\r\n\t .classed(\"middlePoint\",true);\r\n\r\n\t this.svg.append(\"text\")\r\n\t .classed(\"votesPercentageNote\",true)\r\n\t .attr(\"dx\", this.svgWidth/2)\r\n\t .attr(\"dy\",60)\r\n\t .text(\"Popular Vote(50%)\");\r\n\r\n\t this.svg.append(\"g\")\r\n\t .classed(\"nomineeInfoText\",true);\r\n\r\n\t this.svg.append(\"g\")\r\n\t .classed(\"votesPercentageText\",true);\r\n\r\n }", "function Icon(el,config){if(el&&el.tagName!='svg'){el=angular.element('<svg xmlns=\"http://www.w3.org/2000/svg\">').append(el.cloneNode(true))[0];}// Inject the namespace if not available...\n\tif(!el.getAttribute('xmlns')){el.setAttribute('xmlns',\"http://www.w3.org/2000/svg\");}this.element=el;this.config=config;this.prepare();}", "function initVisualization() {\n var svg = d3.select(\"#simulation\")\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n}", "function makeSVG () {\n \n //Create SVG element\n NS.svg = d3.select(\".donut\")\n .append(\"svg\")\n .attr(\"width\", NS.width)\n .attr(\"height\", NS.height);\n}", "function SVG(parentid, id='finchartsvg') {\n this.NS = \"http://www.w3.org/2000/svg\";\n this.xlinkNS = \"http://www.w3.org/1999/xlink\";\n this.version = \"1.1\";\n this.container = null;\n this.canvas = null;\n this.chart = null;\n this.volume = null;\n this.elements = [];\n this.width = 600;\n this.height = 300;\n this.padding = 20;\n this.color = \"black\";\n this.backcolor = \"white\";\n this.bordercolor = \"black\";\n this.fillstyle = \"grey\";\n this.strokestyle = \"black\";\n this.strokewidth = \"1px\";\n this.font = \"normal 1em Arial\";\n this.applyfillstyle = false;\n this.applystrokestyle = false;\n this.applystrokewidth = false;\n this.rotateStack = [];\n this.temp = {\n fill:null,\n stroke:null,\n end:null\n };\n this.colors = {\n red:\"red\",\n green:\"green\",\n blue:\"blue\",\n grey:\"grey\",\n lightgrey:\"lightgrey\",\n white:\"white\",\n black:\"black\"\n };\n \n this.container = document.getElementById(parentid);\n this.width = this.container.clientWidth;\n this.height = this.container.clientHeight;\n if(this.container.childNodes.length>0) { this.container.removeChild(this.container.childNodes[0]); }\n this.canvas = document.createElementNS(this.NS,\"svg\");\n this.canvas.setAttribute(\"id\",id);\n this.container.appendChild(this.canvas);\n this.size(this.width, this.height);\n}", "setUp() {\n this.g = d3\n .select(this.root)\n .append(\"g\");\n this.update();\n }", "init(){\n let dv = this,\n elementNode = d3.select(dv.element).node(),\n elementWidth = elementNode.getBoundingClientRect().width,\n aspectRatio = elementWidth < 800 ? elementWidth * 0.65 : elementWidth * 0.5;\n\n const breakPoint = 678;\n \n // margin\n dv.margin = { };\n\n dv.margin.top = elementWidth < breakPoint ? 40 : 50;\n dv.margin.bottom = elementWidth < breakPoint ? 30 : 80;\n\n dv.margin.right = elementWidth < breakPoint ? 20 : 150;\n dv.margin.left = elementWidth < breakPoint ? 20 : 80;\n \n dv.width = elementWidth - dv.margin.left - dv.margin.right;\n dv.height = aspectRatio - dv.margin.top - dv.margin.bottom;\n\n d3.select(dv.element).select(\"svg\").remove();\n \n // add the svg to the target element\n dv.svg = d3.select(dv.element)\n .append(\"svg\")\n .attr(\"width\", dv.width + dv.margin.left + dv.margin.right)\n .attr(\"height\", dv.height + dv.margin.top + dv.margin.bottom);\n \n // add the g to the svg and transform by top and left margin\n dv.g = dv.svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + dv.margin.left + \n \", \" + dv.margin.top + \")\");\n \n // set transition variable\n dv.t = function() { return d3.transition().duration(1000); };\n\n // dv.colourScheme = [\"#aae0fa\",\"#00929e\",\"#ffc20e\",\"#16c1f3\",\"#da1e4d\",\"#086fb8\"];\n dv.colourScheme =d3.schemeBlues[5].slice(1);\n \n // set colour function\n dv.colour = d3.scaleOrdinal(dv.colourScheme);\n\n // for the tooltip from the d3 book\n dv.bisectDate = d3.bisector( d => { return d.date; } ).left;\n\n // tick numbers\n dv.tickNumber = \"undefined\";\n\n // tick formats\n dv.tickFormat = \"undefined\";\n \n dv.addAxis();\n \n }", "function get_svg()\n {\n var svg = document.getElementById('SVGobject');\n if( svg.contentDocument != null )\n { \n svg = svg.contentDocument.getElementsByTagName('svg');\n\n\t\t // Get viewbox here and check for undefined to fix IE from failing...\n\t\t var viewbox = $(svg).attr(\"viewBox\");\n if( svg != null && viewbox !== undefined )\n {\n clearInterval(get_svg_id);\n svg_elm = svg;\n viewbox = viewbox.split(/ /);\n fullwidth = parseInt(viewbox[2]);\n ratio = parseInt(viewbox[3]) / fullwidth;\n\t fitwidth = $(elm).width();\n chart_resize(fitwidth);\n $(elm).removeClass(\"noshow\"); //Makes chart show on page\n\t\t\t $(\"a.showline\").css(\"display\", \"inline\");;\n return;\n } \n }\n }", "_initializeChart() {\n const {\n element,\n rootNode,\n zoomBehaviour,\n selectedProcessId\n } = this.getProperties('element', 'rootNode', 'zoomBehaviour', 'selectedProcessId');\n const el = select(element);\n\n // Needed for zooming\n this.centeringElement = el.select('.centering-element');\n\n const parent = el.select('svg');\n parent.call(zoomBehaviour);\n\n this.parent = parent;\n if (rootNode) {\n // Reset Zoom\n const transform = zoomIdentity\n .scale(1)\n .translate(0, 0);\n zoomBehaviour.transform(parent, transform);\n\n this._buildChart(rootNode);\n addSelectedClass(selectedProcessId);\n }\n }", "render() {\n return (\n <svg id=\"mini-map\" ref=\"svg\">\n </svg>\n );\n }", "function createElements() {\n var svg = d3.select(document.getElementById('svgChartRight'));\n\n svg.selectAll('*').remove();\n\n connectorsSvg = svg.append('g').attr('class', 'connectors');\n arcsSvg = svg.append('g').attr('class', 'arcs');\n bubblesSvg = svg.append('g').attr('class', 'bubbles');\n bubbleLabelsSvg = svg.append('g').attr('class', 'bubbleLabels');\n}", "function SVGWrapper(svg, container) {\r\n\tthis._svg = svg; // The SVG root node\r\n\tthis._container = container; // The containing div\r\n\tfor (var i = 0; i < jQuery.svg._extensions.length; i++) {\r\n\t var extension = jQuery.svg._extensions[i];\r\n\t this[extension[0]] = new extension[1](this);\r\n\t}\r\n }", "element(props = {}) {\n var _a;\n let _b = Object.assign(Object.assign({}, this._props), props), { className, container, label, title, tag = 'div' } = _b, styleProps = __rest(_b, [\"className\", \"container\", \"label\", \"title\", \"tag\"]);\n // check if icon element is already set\n const maybeSvgElement = container === null || container === void 0 ? void 0 : container.firstChild;\n if (((_a = maybeSvgElement === null || maybeSvgElement === void 0 ? void 0 : maybeSvgElement.dataset) === null || _a === void 0 ? void 0 : _a.iconId) === this._uuid) {\n // return the existing icon element\n return maybeSvgElement;\n }\n // ensure that svg html is valid\n if (!this.svgElement) {\n // bail if failing silently, return blank element\n return document.createElement('div');\n }\n let returnSvgElement = true;\n if (container) {\n // take ownership by removing any existing children\n while (container.firstChild) {\n container.firstChild.remove();\n }\n }\n else {\n // create a container if needed\n container = document.createElement(tag);\n returnSvgElement = false;\n }\n if (label != null) {\n container.textContent = label;\n }\n Private.initContainer({ container, className, styleProps, title });\n // add the svg node to the container\n const svgElement = this.svgElement.cloneNode(true);\n container.appendChild(svgElement);\n return returnSvgElement ? svgElement : container;\n }", "addRoottoDOM(after_html, className) {\n const svg = d3.select(after_html).insert(\"svg\")\n .classed(className, true)\n .on(\"load\", this.makeDraggable.bind(this)); // Allows draggability for all elements in the diagram\n return svg\n }", "function SVGWrapper(svg, container) {\n\tthis._svg = svg; // The SVG root node\n\tthis._container = container; // The containing div\n\tfor (var i = 0; i < $.svg._extensions.length; i++) {\n\t\tvar extension = $.svg._extensions[i];\n\t\tthis[extension[0]] = new extension[1](this);\n\t}\n}", "function initUI() {\n if (svgUIReady) { // already initialized\n return;\n }\n \n svgUIReady = true;\n \n // remove magnifying glass icon\n var startButton = document.getElementById('SVGZoom.startButton');\n startButton.parentNode.removeChild(startButton);\n \n // get the thumbnail container and make it invisible\n var info = getSVGInfo();\n var thumbnail = info.fileNode;\n if (hasAnnotation()) {\n thumbnail = thumbnail.childNodes[0].childNodes[0];\n }\n var oldPNG = thumbnail.childNodes[0];\n oldPNG.style.visibility = 'hidden';\n oldPNG.style.zIndex = -1000;\n \n // store a reference to the SVG root to make subsequent accesses faster\n svgRoot = svgObject.contentDocument.rootElement;\n \n // Safari/Native has a bug where it doesn't respect the height/width of \n // the OBJECT when scaling the size of some objects (commons-logo.svg, \n // for example). A workaround is to manually set the size inside the SVG.\n if (isWebkit) {\n svgRoot.setAttribute('width', info.width);\n svgRoot.setAttribute('height', info.height);\n }\n \n // reveal the SVG object and controls\n svgControls.style.display = 'block';\n var container = svgObject.parentNode;\n container.style.zIndex = 1000;\n container.style.top = '0px';\n container.style.left = '0px';\n\n // make the cursor a hand when over the SVG; not all browsers support\n // this property yet\n svgRoot.setAttribute('cursor', 'pointer');\n \n // add drag listeners on the SVG root\n svgRoot.addEventListener('mousedown', mouseDown, false);\n svgRoot.addEventListener('mousemove', mouseMove, false);\n svgRoot.addEventListener('mouseup', mouseUp, false);\n}", "function pageLoaded() {\n svgweb.addOnLoad(createSVGObject);\n}", "createDom_() {\n this.svgGroup_ = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.G, {}, null);\n const rnd = Blockly.utils.idGenerator.genUid();\n const clip = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.CLIPPATH,\n {'id': 'blocklyBackpackClipPath' + rnd},\n this.svgGroup_);\n Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.RECT,\n {\n 'width': this.WIDTH_,\n 'height': this.HEIGHT_,\n },\n clip);\n this.svgImg_ = Blockly.utils.dom.createSvgElement(\n Blockly.utils.Svg.IMAGE,\n {\n 'class': 'blocklyBackpack',\n 'clip-path': 'url(#blocklyBackpackClipPath' + rnd + ')',\n 'width': this.SPRITE_SIZE_ + 'px',\n 'x': -this.SPRITE_LEFT_,\n 'height': this.SPRITE_SIZE_ + 'px',\n 'y': -this.SPRITE_TOP_,\n },\n this.svgGroup_);\n this.svgImg_.setAttributeNS(Blockly.utils.dom.XLINK_NS, 'xlink:href',\n BACKPACK_SVG_DATAURI);\n\n Blockly.utils.dom.insertAfter(\n this.svgGroup_, this.workspace_.getBubbleCanvas());\n }", "drawSVGSpace() {\n const svgGroup = document.createElementNS('http://www.w3.org/2000/svg', 'g');\n const svgSpace = document.createElementNS('http://www.w3.org/2000/svg', 'rect');\n\n svgGroup.setAttributeNS(null, \"transform\", `translate(${this.y * 100}, ${this.x * 100})`);\n\n svgSpace.setAttributeNS(null, \"id\", this.id);\n svgSpace.setAttributeNS(null, \"height\", 100);\n svgSpace.setAttributeNS(null, \"width\", 100);\n svgSpace.setAttributeNS(null, \"fill\", \"transparent\");\n\n svgGroup.appendChild(svgSpace);\n document.querySelector('svg > g').appendChild(svgGroup);\n }", "_initSvgEls() {\n const _this = this;\n\n this.svgEls = {\n bgArc: document.createElementNS(this.SVG_NS, \"path\"),\n activeArc: document.createElementNS(this.SVG_NS, \"path\"),\n needle: document.createElementNS(this.SVG_NS, \"line\")\n };\n\n // draw the background arc\n this.svgEls.bgArc.setAttribute(\"d\",\n _this._calcSvgArcPath(\n _this._calcNeedleCenter().x,\n _this._calcNeedleCenter().y,\n _this._calcDialRadius(),\n 0.67 * Math.PI,\n 2.35 * Math.PI\n ));\n this.svgEls.bgArc.setAttribute(\"stroke-width\", _this._calcArcStrokeWidth());\n this.svgEls.bgArc.setAttribute(\"stroke\", _this.o.needleColor);\n this.svgEls.bgArc.setAttribute(\"fill\", \"transparent\");\n this.svgEls.bgArc.setAttribute(\"stroke-linecap\", \"round\");\n\n // draw the active arc\n this.svgEls.activeArc.setAttribute(\"stroke-width\", _this._calcArcStrokeWidth());\n this.svgEls.activeArc.setAttribute(\"stroke\", _this.o.activeColor);\n this.svgEls.activeArc.setAttribute(\"fill\", \"transparent\");\n this.svgEls.activeArc.setAttribute(\"stroke-linecap\", \"round\");\n\n // draw the needle\n this.svgEls.needle.setAttribute(\"x1\", _this._calcNeedleCenter().x);\n this.svgEls.needle.setAttribute(\"y1\", _this._calcNeedleCenter().y);\n this.svgEls.needle.setAttribute(\"x2\", _this._calcNeedleEnd().x);\n this.svgEls.needle.setAttribute(\"y2\", _this._calcNeedleEnd().y);\n this.svgEls.needle.setAttribute(\"stroke-width\", _this._calcNeedleWidth());\n this.svgEls.needle.setAttribute(\"stroke\", _this.o.needleColor);\n this.svgEls.needle.setAttribute(\"z-index\", \"1000\");\n this.svgEls.needle.setAttribute(\"stroke-linecap\", \"round\");\n\n this._appendSvgEls();\n this._update();\n }", "function Bandeau() {\n\n \n return(\n <>\n\n <div>\n <div className=\"bandeauHeader\" id=\"navBandeau\">\n <h1 className=\"bandeauH1\"><h2 className=\"HeaderTitle\">Battle Changer ⚔️</h2></h1>\n <svg classNamme=\"bandeauSvg\" xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 200 100\" preserveAspectRatio=\"none\">\n <circle fill=\"#D7B899\" cx=\"0\" cy=\"100\" r=\"100\" />\n <circle fill=\"#D7B899\" cx=\"200\" cy=\"100\" r=\"100\" />\n </svg>\n </div> \n </div>\n\n </>\n )\n}", "render() {\n $('#shape-container').append(this.div)\n this.top = getRandomValue(MAX_VALUE, this.height)\n this.left = getRandomValue(MAX_VALUE, this.width)\n this.div.css({\n height: this.height,\n width: this.width,\n top: this.top,\n left: this.left,\n })\n }", "function SVGShape() {}", "constructor(svg, { darkmode, dimmed, colorMode }) {\n this.dimmed = dimmed || false;\n this.colorMode = colorMode || 'yellow';\n this.darkmode = darkmode || false;\n this.svg = select(svg).call(initSvg.bind(this));\n this.canvas = this.svg.append('g').classed('canvas', true);\n this.inner = this.canvas.append('g').call(initGroup, 'inner');\n this.outer = this.canvas.append('g').call(initGroup, 'outer');\n this.percentText = this.canvas.append('text').call(initPercentText.bind(this));\n this.outer.call(initOuterGroup.bind(this));\n this.pie = pie().sort(null);\n }", "function initTransformElements(){ \n\n\ttranslateX = 0\n\ttranslateY = 0 \n\tscale = 1\n\n\t// used to manually pan\n\tsvgPan = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:g\"); \n\tsvgPan.setAttribute('transform', 'translate(0,0)'); \n\n\t// used to manually zoom\n\tsvgScale = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg:g\"); \n\tsvgScale.setAttribute('transform', 'scale(1)'); \n\t\n\tvar svgComponents = canvas.childNodes;\n\tvar svgComponent = svgComponents[0];\n\n\t$(svgComponent).wrapInner(svgScale);\n\n\tsvgScale.setAttribute('transform', 'translate(40,40)'); \n\n\tvar wrapper = svgComponent.childNodes[0];\n\n\twrapper.setAttribute('transform', 'translate(40,40)'); \n\t$(wrapper).wrapInner(svgPan) \n\n\tsvgScale = wrapper;\n\tsvgPan = wrapper.childNodes[0];\n}", "function init(evt) {\n svgDocument = evt.target.ownerDocument; activeElements = svgDocument.getElementById(\"activeElements\");\n world = svgDocument.getElementById(\"world\"); enemyShots = svgDocument.getElementById(\"enemyShots\");\n mainPanel1 = svgDocument.getElementById(\"mainPanel1\"); mainPanel0 = svgDocument.getElementById(\"mainPanel0\");\n eCompass = svgDocument.getElementById(\"compass\"); eDeepMeter = svgDocument.getElementById(\"deepMeter\");\n eNums = svgDocument.getElementById(\"nums\").firstChild; shipAlertLeft = svgDocument.getElementById(\"shipAlertLeft\");\n eDamage = svgDocument.getElementById(\"damage\").firstChild; shipAlertRight = svgDocument.getElementById(\"shipAlertRight\");\n eMessage = svgDocument.getElementById(\"message\").firstChild; eScore = svgDocument.getElementById(\"score\").firstChild;\n eElapsed = svgDocument.getElementById(\"elapsed\").firstChild; eLevel = svgDocument.getElementById(\"level\").firstChild;\n subDamage = svgDocument.getElementById(\"subDamage\"); eThumbs = svgDocument.getElementById(\"thumbs\");\n levelReached = svgDocument.getElementById(\"levelReached\");\n Settings.setSounds(null);\n IntroOutro.init();\n}", "function initializeRepository() {\n _repository = new xml.DOMImplementation().createDocument();\n\n var root = _repository.createElement('svg');\n root.setAttribute('id', _repositoryId);\n root.setAttribute('style', 'display: none;');\n\n _repository.appendChild(root);\n}", "SetCanvas(width, height, containerId) {\n this.container = document.getElementById(containerId);\n this.canvas = document.createElementNS('http://www.w3.org/1999/xhtml.org/2000/svg', 'svg');\n this.canvas.setAttribute('width', width);\n this.canvas.setAttribute('height', height);\n this.container.appendChild(canvas);\n }", "constructor(refX, refY, width, height) {\n let element = document.createElementNS('http://www.w3.org/2000/svg', 'marker');\n element.setAttributeNS(null, 'refX', refX.toString());\n element.setAttributeNS(null, 'refY', refY.toString());\n element.setAttributeNS(null, 'markerWidth', width.toString());\n element.setAttributeNS(null, 'markerHeight', height.toString());\n super(element);\n }", "_addSvgSlider() {\n let _this = this;\n\n let newSlider = document.createElementNS(this.SVG_NS, \"rect\");\n let newSliderPanel = document.createElementNS(this.SVG_NS, \"rect\");\n this.svg.appendChild(newSlider);\n this.svg.appendChild(newSliderPanel);\n this.svgEls.sliders.push(newSlider);\n this.svgEls.sliderPanels.push(newSliderPanel);\n\n newSliderPanel.addEventListener(\"mousedown\", _this.handlers.touch);\n newSliderPanel.addEventListener(\"touchstart\", _this.handlers.touch);\n }", "cacheDom() {\n this.logo = document.querySelector(`${this.svgId}-container`);\n this.pattern = Snap.select(`${this.svgId} .logo-pattern-image`);\n this.patternInitXPos = this.pattern.attr(\"x\");\n this.patternInitYPos = this.pattern.attr(\"y\");\n this.background = document.querySelector(\".logo-background-image\");\n }", "function createSvg () {\r\n // Remove the existing one\r\n d3\r\n .select(canvasId)\r\n .selectAll('svg')\r\n .remove();\r\n // Create a new svg node\r\n svg = d3\r\n .select(canvasId)\r\n .append('svg:svg')\r\n .attr('width', 500)\r\n .attr('height', 500)\r\n .append('g') // Group all element to make alignment easier\r\n .attr('transform', function () { // Place in center of the page\r\n return 'translate(' + (500 / 2) + ', ' + (500 / 2) + ')';\r\n });\r\n }", "function set$1(element, svg) {\n\n var parsed = parse$2(svg);\n\n // clear element contents\n clear$1(element);\n\n if (!svg) {\n return;\n }\n\n if (!isFragment(parsed)) {\n // extract <svg> from parsed document\n parsed = parsed.documentElement;\n }\n\n var nodes = slice$1(parsed.childNodes);\n\n // import + append each node\n for (var i = 0; i < nodes.length; i++) {\n appendTo(nodes[i], element);\n }\n\n}", "async render() {\n const svg = Snap(this.container.querySelector('svg'));\n\n const result = await this.parsed.render(svg.group());\n\n // Once rendering is complete, the rendered expression is positioned and\n // the SVG resized to create some padding around the image contents.\n const box = result.getBBox();\n\n result.transform(Snap.matrix()\n .translate(10 - box.x, 10 - box.y));\n svg.attr({\n width: box.width + 20,\n height: box.height + 20,\n });\n\n // Stop and remove loading indicator after render is totally complete.\n await util.tick();\n\n this._removeClass('loading');\n this.container.removeChild(this.container.querySelector('.progress'));\n }", "function addElement() {\n // zde vytvorim kruhovy prvek\n var newdiv = document.createElement(\"circle\");\n newdiv.setAttribute(\"cx\",\"50\");\n newdiv.setAttribute(\"cy\",\"50\");\n newdiv.setAttribute(\"r\",\"50\");\n //platno element\n \n // <circle id=\"redcircle\" cx=\"50\" cy=\"50\" r=\"50\" fill=\"red\" />\n\n}", "function updateSvgSize() {\n let g = document.getElementById('graph');\n width = g.clientWidth;\n height = g.clientHeight;\n}", "function init(){\n // initialize global variables and button actions\n prev_btnj = $('#prev_btn')\n next_btnj = $('#next_btn')\n scale_btnj = $('#scale_btn')\n titlej = $('#title')\n svgj = $('svg')\n svg = svgj[0]\n svgimg = document.createElementNS('http://www.w3.org/2000/svg','image')\n\n svgj.append(svgimg)\n $('#open_btn').click(openHandler)\n $('#zoomin_btn').click(zoominHandler)\n $('#zoomout_btn').click(zoomoutHandler)\n $('#actual_btn').click(actualHandler)\n $('#fit_btn').click(fitHandler)\n prev_btnj.click(prevHandler)\n next_btnj.click(nextHandler)\n $(window).resize(_.throttle(resizeHandler, 100))\n}", "serialize() {\n var svg = document.getElementsByTagName(\"svg\")\n var editor = atom.workspace.getActiveTextEditor()\n if(editor && (svg.length == 0)){\n this.createGraph(editor);\n }\n }", "function createScatterPlotSVG() {\n // make the meanu items for interactivity\n makeMenu();\n\n //build the svg element and append it to the body within the scatterPlot div\n var svg = d3.select(\"body\")\n .select(\"div#scatterPlot\")\n .append(\"svg\")\n .attr(\"width\", myNS.width)\n .attr(\"height\", myNS.height);\n\n return svg;\n} //end createScatterPlotSVG", "function setupDisplayDiv() {\n jQuery('#allFunerals').empty();\n\n svg = d3.select(\"#allFunerals\")\n .append(\"svg\")\n .attr(\"width\", width + margin.right + margin.left - 20)\n .attr(\"height\", height + margin.top + margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + margin.left + \",\" + margin.top + \")\")\n .attr('id', 'allFuneralsGroup');\n\n div = d3.select(\"#allFunerals\").append(\"div\")\n .attr(\"class\", \"tooltip\")\n .attr(\"id\", \"personTooltip\")\n .style(\"opacity\", 0);\n\n funeralCountForEra = 0;\n eraCount = 0;\n maxColumnWidth = 0;\n startingWidth = 0;\n maxDivWidth = 0;\n g = null;\n funeralG = null;\n}", "function readyStart(svg){\n\t\n\n svg.input.textArea(18, 10, \"It Takes Carbon Fiber and Kevlar to Make the Best Basketball Shoes in the World\", {width: '200', class: 'heading'});\n \n svg.input.textArea(18, 97, \"When you look at basketball shoes, what do you see? A big swoosh. Three stripes. Michael Jordan. A billboard molded to your feet. But do you see the technology? Though maybe not as blatant as an Intel sticker on your laptop, every shoe showcases its own advanced technology. Don't worry, you can't miss it on these, the best basketball shoes on the planet. Because they roll with carbon fiber and Kevlar.\", {width: '200'});\n\n svg.input.list(228, 10, 'Nullam eget purus enim, quis faucibus sapien. \\nVivamus semper nulla vel sapien fringilla ullamcorper. \\nIn hac habitasse platea dictumst. ',{width: '150'});\n svg.input.list(228, 100, 'Nullam eget purus enim, quis faucibus sapien. \\nVivamus semper nulla vel sapien fringilla ullamcorper. \\nIn hac habitasse platea dictumst. ',{width: '150'});\n\t\n\t\n\t$('.svg-container').transition({ x: '0', y: '20px', height: '400px'}, 1000, 'snap');\n\t\n\t$('.view .message').removeClass('loading');\n\n\t\n}" ]
[ "0.75755286", "0.7352746", "0.72894794", "0.7113332", "0.7044979", "0.7011622", "0.69017595", "0.68702894", "0.6847543", "0.6847543", "0.6846032", "0.68422514", "0.6820393", "0.68028", "0.6793323", "0.6784797", "0.6781187", "0.6764799", "0.670179", "0.6698348", "0.66970134", "0.66544175", "0.66544175", "0.66544175", "0.66544175", "0.66544175", "0.66544175", "0.6625289", "0.6602011", "0.6598085", "0.65910035", "0.65800595", "0.6576903", "0.64845306", "0.6481622", "0.6460205", "0.6450107", "0.64295113", "0.64187044", "0.64183164", "0.6393575", "0.63825315", "0.6347689", "0.63185596", "0.63050157", "0.6296349", "0.629332", "0.6289546", "0.62841177", "0.62835", "0.6279887", "0.6266998", "0.61998385", "0.61911136", "0.61758626", "0.61702937", "0.6170205", "0.6161401", "0.61515605", "0.61468947", "0.6139155", "0.6139101", "0.61388075", "0.61373585", "0.61210006", "0.61084074", "0.61062443", "0.6085507", "0.60847014", "0.604303", "0.60285246", "0.60282075", "0.6016083", "0.60097885", "0.5992664", "0.59669435", "0.59510326", "0.59428126", "0.59263474", "0.5897517", "0.58937275", "0.58900577", "0.5872554", "0.58681166", "0.5858191", "0.58574086", "0.58482695", "0.5840345", "0.58363944", "0.58361477", "0.5834891", "0.5830302", "0.58183116", "0.5817825", "0.5811327", "0.58111846", "0.58001095", "0.5799355", "0.57984465", "0.5797642", "0.57968813" ]
0.0
-1
Method to Capture All Movie Times into an Array & Print to Console
movieTimes() { let times = browser.elements('time.btn.btnhorario.ng-scope'); let timesArray = [] times.value.forEach(element => { if (browser.elementIdDisplayed(element.ELEMENT).value === true) { timesArray.push(browser.elementIdText(element.ELEMENT).value); } }); console.log(timesArray) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consoleFn(Movie_rating, Movie_name, watch_Link, trailer_link){\n let movie_rates = document.querySelectorAll(Movie_rating);\n let Movie_names = document.querySelectorAll(Movie_name);\n let Watch_link = document.querySelectorAll(watch_Link);\n let Trailer_link = document.querySelectorAll(trailer_link);\n\n let result = [];\n\n for( let i = 30, j = 0 ; i < movie_rates.length && j<Watch_link.length ; i++, j++ ){\n let rating = movie_rates[i].innerText.trim();\n let Movie_name = Movie_names[i].innerText.trim();\n let watch_link = Watch_link[j].href;\n let trailerlink = Trailer_link[i].href;\n\n \n result.push({\n rating : rating,\n Movie_name : Movie_name,\n watch_link : watch_link,\n trailerlink : trailerlink\n });\n }\n\n return result;\n }", "function turnHoursToMinutes(movieArray) {\n\n const durationMovie = movieArray.map(e => e.duration)\n let minutesPerHour = 0\n let minutes = 0\n const totalMinutes = []\n\n durationMovie.forEach(function (m, idx) {\n for (i = 0; i < m.length; i++) {\n if (m[i] === 'h') {\n minutesPerHour = parseInt(m[i - 1] * 60)\n } else if (m[i] === 'm') {\n minutes = parseInt(m[i - 2] + m[i - 1])\n }\n }\n totalMinutes.push({ duration: minutesPerHour + minutes })\n })\n\n return totalMinutes\n}", "function consoleFn() {\n let arr = document.querySelectorAll(\"#stats.style-scope .ytd-playlist-sidebar-primary-info-renderer\");\n let newArr = [];\n newArr.push(arr[0].innerText); //no. of videos\n newArr.push(arr[1].innerText); //no. of views\n return newArr;\n}", "function turnHoursToMinutes(moviesArray) {\n let result = moviesArray.map((movie) => {\n console.log(\"movie.genre : \" + movie.genre)\n return {\n title: movie.title,\n duration: stringToMinutes(movie.duration),\n genre: movie.genre\n }\n })\n \n return result\n \n }", "function printMovieItems() {\n seanBeanMovies.forEach(function(movie) {\n console.log(movie);\n });\n}", "function showMovies() {\n\tconsole.log(SPACER);\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tconsole.log(\"\\t\" + String(i + 1) + \". \" + movies[i].title + \" (\" + movies[i].average + \" stars)\");\n\t}\n\tconsole.log(SPACER);\n}", "function turnHoursToMinutes(arrayMovies) {\n\n return arrayMovies.map(function (element) {\n var hours = 0,\n minutes = 0,\n movie = [];\n\n if (element.duration == '') {\n hours = 0;\n minutes = 0;\n } else if (element.duration.indexOf('min') < 0) {\n hours = element.duration.slice(0, element.duration.indexOf('h'));\n minutes = 0;\n } else if (element.duration.indexOf('h') < 0) {\n hours = 0;\n minutes = element.duration.slice(0, element.duration.indexOf('min'));\n } else {\n hours = element.duration.slice(0, element.duration.indexOf('h'));\n minutes = element.duration.slice(element.duration.indexOf('h') + 2, element.duration.indexOf('min'));\n }\n movie = {\n \"title\": element.title,\n \"year\": element.year,\n \"director\": element.director,\n \"duration\": (parseInt(hours) * 60 + parseInt(minutes)),\n \"genre\": element.genre,\n \"rate\": element.rate\n };\n return movie;\n });\n}", "printMovieInfo(data) {\n const rottenTomatoes = this.rottenTomatoesRating(data);\n const output = [\n `Title: ${data.Title}`,\n `Year: ${data.Year}`,\n `Rating: IMDb ${data.imdbRating}`,\n ` Rotten Tomatoes ${rottenTomatoes}`,\n `Country: ${data.Country}`,\n `Language: ${data.Language}`,\n `Plot: ${data.Plot}`,\n `Actors: ${data.Actors}`\n ];\n\n console.log(output.join(\"\\n\"));\n }", "function turnHoursToMinutes(array){\n const newDuration = array.map(movie => {\n return movie.duration.split(\"\");\n });\n return newDuration;\n }", "SaveForMovie() {\n var d = new Date();\n var t = d.getTime();\n var tmp = [this.currentColour, this.otherColour, this.pieces, this.pickedPiece];\n this.movieArray.push(tmp);\n console.log(\"saved for movie, frame \" + (this.movieArray.length));\n }", "function turnHoursToMinutes(moviesArray) {\n var moviesWithCorrectTimeFormat = [];\n var eachMovieHours, eachMovieMinutes, totalMinutes, singleMovieWithCorrectTimeFormat;\n moviesArray.map(function(eachMovie) {\n eachMovieHours = 0;\n eachMovieMinutes = 0;\n totalMinutes = 0;\n if(eachMovie.duration.indexOf(\"h\")!==-1){\n eachMovieHours = eachMovie.duration.slice(0, eachMovie.duration.indexOf(\"h\"));\n }\n else{\n eachMovieHours=0;\n }\n eachMovieMinutes = eachMovie.duration.slice(eachMovie.duration.indexOf(\"h\") + 1, eachMovie.duration.indexOf(\"m\"));\n totalMinutes = (60 *eachMovieHours) + (1* eachMovieMinutes);\n singleMovieWithCorrectTimeFormat = Object.assign({},eachMovie);\n singleMovieWithCorrectTimeFormat.duration = totalMinutes;\n moviesWithCorrectTimeFormat.push(singleMovieWithCorrectTimeFormat);\n });\n return moviesWithCorrectTimeFormat;\n }", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function turnHoursToMinutes(array){\n var returnArray = \n array.map(function(oneMovie){\n\n var duration = oneMovie[\"duration\"];\n var hour = 0;\n var minute = 0;\n duration = duration.split(\" \");\n\n for(var i = 0; i < duration.length; i++){\n if(i == 0 && duration[i].indexOf('h') != -1){\n hour = parseInt(duration[0])*60;\n } else if(i == 0 && duration[i].indexOf('min') != -1) {\n minute = parseInt(duration[0]);\n } else if(i == 1 && duration[i].indexOf('min') != -1){\n minute = parseInt(duration[1]);\n }\n }\n duration = parseInt(hour + minute);\n\n var newMovie = {\n title: oneMovie.title,\n year: oneMovie.year,\n director: oneMovie.director,\n duration: duration,\n genre: oneMovie.genre,\n rate: oneMovie.rate\n };\n return newMovie;\n });\n return returnArray;\n}", "function movieSearch(){\n outPutForLog = [];\n outPutForLog.unshift(outputText);\n outPutForLog.unshift(\"\\n\");\n\n axios.get(\"http://www.omdbapi.com/?t=\" + userQuestion + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n\n //Title of the movie.\n console.log(\"Movie Title: \" + response.data.Title);\n outPutForLog.push(\"Movie Title: \" + response.data.Title);\n //Release Date\n console.log(\"Release Date: \" + response.data.Released);\n outPutForLog.push(\"Release Date: \" + response.data.Released);\n // IMDB Rating of the movie.\n console.log(\"IMDB Ratinge: \" + response.data.imdbRating);\n outPutForLog.push(\"IMDB Ratinge: \" + response.data.imdbRating);\n //Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n outPutForLog.push(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n console.log(\"Country: \" + response.data.Country);\n outPutForLog.push(\"Country: \" + response.data.Country);\n //Language of the movie.\n console.log(\"Language: \" + response.data.Language);\n outPutForLog.push(\"Language: \" + response.data.Language);\n //Plot of the movie.\n console.log(\"Plot: \" + response.data.Plot);\n outPutForLog.push(\"Plot: \" + response.data.Plot);\n //Actors in the movie.\n console.log(\"Actors: \" + response.data.Actors);\n outPutForLog.push(\"Actors: \" + response.data.Actors);\n\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n displayForLog = outPutForLog.join(\"\\n \");\n appendOutput();\n }\n );\n}", "function getTheatreMovies() {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/now_playing?api_key=\" +\n API_KEY +\n \"&language=en-US&region=US\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let theatreMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n theatreMovies.push(response.results[i].title);\n }\n console.log(theatreMovies);\n });\n}", "function _list() {\r\n\t\tvar len = _events.length,\r\n\t\t\ti, out = '';\r\n\t\tfor (i = 0; i < len; i += 1) {\r\n\t\t\tout += _events[i].name + ' ' + _events[i].time + '\\n';\r\n\t\t}\r\n\t\tconsole.log(out);\r\n\t}", "function turnHoursToMinutes(array) {\n function minutes(string) {\n let minutesTemplate = string.split(\" \");\n\n let time = 0;\n\n minutesTemplate.forEach(function(el) {\n if (el.includes(\"h\")) {\n time += parseInt(el) * 60;\n }\n if (el.includes(\"m\")) {\n time += parseInt(el);\n }\n });\n\n return time;\n }\n\n let moviesInMinutes = array.map(function(movie) {\n return {\n ...movie,\n duration: minutes(movie.duration)\n };\n });\n\n return moviesInMinutes;\n}", "function turnHoursToMinutes(movies){\n let cleanMovies = movies.map(movie => {\n const splittedWord = movie.duration.split(' ')\n const hour = parseInt(splittedWord[0], 10)\n let minute = parseInt(splittedWord[1], 10)\n if (isNaN(minute)) minute = 0\n const duration = (hour * 60) + minute\n movie.duration = duration\n //console.log(`Title:${movie.title}, Hours:${hour}, Minutes:${minute}, Duration: ${duration}`)\n return movie\n })\n return cleanMovies\n}", "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n }", "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n }", "function printAllTweets(){\n\tconsole.log(\"all tweets length \" + allTweets.length);\n\tfor (var i = 0; i < allTweets.length; i++) {\n\t\tconsole.log(allTweets[i]);\n\t}\n}", "function turnHoursToMinutes(array) {\n let movieArr = Array.from(array);\n let newDuration = 0;\n let splitDuration = [];\n for (i = 0; i <= movieArr.length - 1; i++) {\n splitDuration = movieArr[i].duration.split(\" \");\n if (splitDuration.length > 1) {\n newDuration = (parseInt(splitDuration[0]) * 60) + parseInt(splitDuration[1]);\n } else {\n newDuration = parseInt(splitDuration[0]) * 60;\n }\n movieArr[i].duration = newDuration;\n };\n return movieArr;\n}", "function turnHoursToMinutes(array) {\nvar durationInLetters = movies.map(function(movies){\n return movies.duration.split('');\n});\nvar horasSinLetras= durationInLetters.map(function(elem, i){\n return (durationInLetters[i][0] * 60);\n});\nvar minutosSinLetras= durationInLetters.map(function(elem,i){\n if (elem.indexOf(\"m\")!=-1){\n return elem.splice(elem.indexOf(' ')+1,elem.indexOf('m')-elem.indexOf(' ')-1).join(\"\");\n } else {\n return 0;\n }\n});\nvar tiempoEnMinutos = horasSinLetras.map(function(elem, i){\n return horasSinLetras[i] + parseInt(minutosSinLetras[i]);\n});\nvar last = movies.map(function(elem,i){\n return elem.duration === tiempoEnMinutos[i];\n});\nreturn tiempoEnMinutos\n}", "function turnHoursToMinutes(arr){\n var newArray = arr.map(function(movie){\n return movie.duration.split(\" \");\n });\n var arrTimeFormated = []; \n for (var i = 0; i < newArray.length; i++){\n var horas = Number(newArray[i][0].slice(0,1));\n var min = Number(newArray[i][1].slice(0,2));\n arrTimeFormated.push(horas*60 + min);\n }\n return arrTimeFormated;\n}", "function movieTime() {\n\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n\n\n axios\n .get(queryUrl)\n\n .then(\n\n function (response) {\n var movieD = response.data;\n // console.log(response)\n console.log(\n \"\\n ========== Movie Search ==========\\n\"\n )\n\n // * Title of the movie.\n console.log(\"Movie Title: \" + movieD.Title\n // * Year the movie came out.\n + \"\\nYear the movie came out: \" + movieD.Year\n // * IMDB Rating of the movie.\n + \"\\nIMDB Rating: \" + movieD.imdbRating\n // * Rotten Tomatoes Rating of the movie.\n + \"\\nRotten Tomatoes Rating: \" + movieD.Ratings[2].Value\n // * Country where the movie was produced.\n + \"\\nThe country the movie was produced in: \" + movieD.Country\n // * Language of the movie.\n + \"\\nLanguage of the movie: \" + movieD.Language\n // * Plot of the movie.\n + \"\\nMovie Plot: \" + movieD.Plot\n // * Actors in the movie.\n + \"\\nActors/Actresses: \" + movieD.Actors + \"\\n\");\n }\n )\n}", "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n}", "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function (elem) {\n var hours = 0;\n var minutes = 0;\n if (elem.duration.indexOf('h') !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf('min') !== -1) {\n minutes = parseInt(elem.duration.substring(elem.duration.length - 5, elem.duration.length - 3), 10);\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n });\n}", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log('Average time to generate last 10 frames: ' + sum / 10 + 'ms');\n}", "function Movie(title,genre,rating,showtimes) {\n this.title = title,\n this.genre = genre,\n this.rating = rating,\n this.showtimes = showtimes,\n\n this.getNextShowing = function () {\n var now = new Date().getTime();\n\n for (let i = 0; i< this.showtimes.length ; i++) {\n var showTime = getTimeFromString(this.showtimes[i]);\n\n if ((showTime - now) > 0) {\n return `Next showing of '${this.title}' is ${this.showtimes[i]}`;\n };\n };\n\n return null;\n }\n\n}", "function turnHoursToMinutes(movies){\n return movies.map(function (movie){\n var newEl = Object.assign({}, movie)\n var splitedTime = newEl.duration.split(' ');\n if (splitedTime.length == 1){\n if (splitedTime[0].length > 2){\n splitedTime.unshift(0 + \"h\");\n } else{splitedTime.push(0 + \"min\");} \n } \n var hours = parseFloat(splitedTime[0]) * 60;\n var minutes = parseFloat(splitedTime[1]);\n newEl.duration = hours + minutes;\n return newEl;\n }); \n}", "function turnHoursToMinutes(moviesArray) {\n return moviesArray.map(function(elem) {\n var hours = 0;\n var minutes = 0;\n \n if (typeof elem.duration !== \"number\") {\n if (elem.duration.indexOf(\"h\") !== -1) {\n hours = parseInt(elem.duration[0], 10) * 60;\n }\n if (elem.duration.indexOf(\"min\") !== -1) {\n minutes = parseInt(\n elem.duration.substring(\n elem.duration.length - 5,\n elem.duration.length - 3\n ),\n 10\n );\n }\n return Object.assign({}, elem, { duration: hours + minutes });\n } else {\n return elem;\n }\n });\n }", "function turnHoursToMinutes(movies) {\n // let moviesInMinutes = [...movies];\n let moviesInMinutes = movies.map(function(movie) {\n return { ...movie };\n });\n// console.log(moviesInMinutes);\n// console.log(moviesInMinutes[0] === movies[0])\n // console.log(moviesInMinutes.filter(el => el.duration));\n // console.log(moviesInMinutes.map(el => el).length);\n\n let movieDurations = moviesInMinutes.map(function(movie) {\n let timeValues = movie.duration.split(\" \");\n let movieDurationinMinutes = 0;\n for (value of timeValues) {\n if (value.includes(\"h\")) {\n movieDurationinMinutes += parseInt(value.replace(\"h\", \"\")) * 60;\n } else if (value.includes(\"min\")) {\n movieDurationinMinutes += parseInt(value.replace(\"min\", \"\"));\n }\n }\n return movieDurationinMinutes;\n });\n\n moviesInMinutes.forEach(function(movie, index) {\n movie.duration = movieDurations[index];\n });\n\n return moviesInMinutes;\n}", "function turnHoursToMinutes (array) {\n let newArray = array.map(movie => {\n let newMovie = {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: movie.duration,\n genre: movie.genre,\n rate: movie.rate\n };\n if (newMovie.duration.indexOf(' ') >= 0) {\n let newTimes = newMovie.duration.split(' ');\n newMovie.duration = (parseInt(newTimes[0]) * 60) + parseInt(newTimes[1]);\n } else if (newMovie.duration.indexOf('h') >= 0) {\n newMovie.duration = parseInt(newMovie.duration) * 60;\n } else {\n newMovie.duration = parseInt(newMovie.duration);\n }\n return newMovie\n });\n return newArray\n}", "function logAverageFrame(times) { // times is the array of User Timing measurements from updatePositions()\n var numberOfEntries = times.length;\n var sum = 0;\n for (var i = numberOfEntries - 1; i > numberOfEntries - 11; i--) {\n sum = sum + times[i].duration;\n }\n console.log(\"Average time to generate last 10 frames: \" + sum / 10 + \"ms\");\n}", "function turnHoursToMinutes (movieArray) {\n var newMovieArray = movieArray.map(function(elem) {\n var arr = elem.duration.toString().split('h'); \n if (arr.length < 2) {\n arr.unshift(\"0\"); \n } \n var hours = Number(arr[0]);\n var minutes = Number(arr[1].toString().split(\"min\")[0]);\n elem.duration=hours*60+minutes;\n return elem;\n })\nreturn newMovieArray.reverse();\n}", "function parseMovies(responseJson) {\n const showtimes = responseJson._embedded.showtimes;\n console.log(showtimes)\n let myMovies = [];\n showtimes.forEach(movieName => {\n return myMovies.push(movieName);\n })\n\n\nfunction combine(arr) {\n var combined = arr.reduce(function(result, item) {\n var current = result[item.movieName];\n result[item.movieName] = !current ? item : {\n movieName: item.movieName,\n showDateTimeLocal: current.showDateTimeLocal + ', ' + item.showDateTimeLocal,\n posterDynamic: item.media.posterDynamic,\n mpaaRating: item.mpaaRating,\n runTime: item.runTime,\n genre: item.genre,\n };\n \n//need to format HH:MM & conditional - if same time, only display once\n // let oldDate = Object.entries(showDateTimeLocal);\n // console.log(oldDate)\n \n return result;\n }, {});\n \n return Object.keys(combined).map(function(key) {\n return combined[key];\n });\n }\n \n \n\n var result = combine(myMovies);\n console.log(result);\n displayShowtimeResults(result)\n}", "function turnHoursToMinutes(array) { // 1\n return array.map(function (movie) { // 2\n \n let newMovie = Object.assign({}, movie); // 3\n let hoursArray = movie.duration.split(' '); // 4\n let total = 0; // 5\n \n if (hoursArray.length === 2) { // 6\n total = (parseInt(hoursArray[0]) * 60) + parseInt(hoursArray[1]);\n } else if (hoursArray.length === 1 && hoursArray[0].indexOf('h') > -1) { // 7\n total = (parseInt(hoursArray[0]) * 60);\n } else if (hoursArray.length === 1 && hoursArray[0].indexOf('min') > -1) { // 8\n total = parseInt(hoursArray[0]);\n }\n newMovie.duration = total; // 9\n return newMovie; // 10\n })\n \n }", "function showtimes(showtimesUrl) {\n fetch (showtimesUrl, options) \n .then(response => response.json())\n .then(responseJson => {\n console.log(responseJson)\n parseMovies(responseJson)\n })\n }", "function turnHoursToMinutes(movies) {\n return movies.map(movie => {const duration = movie.duration.split(\" \");\n //console.log(movie.duration);\n let mins = 0;\n for (let time of duration) {\n if (time.includes(\"h\")) {\n mins += parseFloat(time) * 60;\n } else {\n mins += parseFloat(time);\n }\n }\n return {duration: mins};\n });\n }", "function turnHoursToMinutes(movies) {\n return movies.map(i =>{\n const splited = i.duration.split(\" \")\n const hoursToMinutes = splited[0].substring(0, splited[0].length-1) * 60\n const minutes = splited[1]? splited[1].substring(0, splited[1].length-3) * 1 : 0\n return {\n ...i,\n duration : hoursToMinutes + minutes\n }\n })\n}", "function movieTitleToArray() {\n let string = movie.title.toLowerCase();\n return string.split(\"\");\n}", "function turnHoursToMinutes (movies) {\n return movies.map((movie) => {\n const duration = movie.duration.split('');\n let minutes = 0;\n for (let time of duration) {\n if (time.includes('h')) {\n minutes += parseInt(time)*60;\n } else {\n minutes += parseInt(time)\n }\n }\n\n return {\n ...movie,\n duration: minutes\n };\n });\n\n\n}", "function turnHoursToMinutes(movies) {\n const minutes = movies.map(function(movie){\n let left = parseInt(movie.duration.split('h')[0]) * 60\n let right = parseInt(movie.duration.split('min')[0].split('h ')[1]) || 0\n return {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: left + right,\n genre: movie.genre,\n score: movie.score\n }\n })\n return minutes\n}", "function turnHoursToMinutes(array){\n var returnArray = \n array.map(function(movie){\n if (movie.duration.length === 8){\n var newtime = parseFloat(movie.duration[0])*60 + parseFloat(movie.duration.slice(3,5));\n } else if (movie.duration.length === 2){\n var newtime = parseFloat(movie.duration[0]*60);\n } else if (movie.duration.length === 5){\n var newtime = parseFloat(movie.duration.slice(0,2));\n };\n //duration: '2h 55min',\n var newmovie = {\n title: movie.title,\n year: movie.year,\n director: movie.director,\n duration: newtime,\n genre: movie.genre,\n rate: movie.rate,\n }\n return newmovie;\n }, 0);\n return returnArray;\n}", "function turnHoursToMinutes(movies){\n let moviesArr = JSON.parse(JSON.stringify(movies));\n\n return moviesArr.map(movie => {\n let time = movie.duration.split(' ');\n\n let minutes = time.reduce((acc, current) => {\n if (current.indexOf('h') != -1) {\n return parseInt(current.replace('h', '')) * 60;\n } else {\n return acc + parseInt(current.replace('min', ''));\n }\n }, 0);\n \n movie.duration = minutes;\n return movie;\n })\n}", "function turnHoursToMinutes(movies){\n\n var minutesArray = movies.map(function(eachMovie){ //looped through all movies\n let movie = eachMovie.duration.split(\" \") //made the duration string into array\n // console.log(\"=================================== \", movie);\n let totalMinutes = 0; \n movie.forEach((arr)=>{ //loop through array \n if(arr.includes('h')){ \n totalMinutes+=Number(arr.replace('h',''))*60 //if has h do this math\n } \n if(arr.includes('min')){\n totalMinutes+=Number(arr.replace('min','')) //if has min do this\n }\n })\n return {...eachMovie, duration: totalMinutes} //return all the old movie stuff with different duration\n\n })\n\n return minutesArray //return ENTIRE new ARRAY with durations \n\n}", "function turnHoursToMinutes(array) {\n // 1h 22min\n // 2h\n // 30min\n const hourRegex = /(\\d+)h/g\n const minuteRegex = /(\\d+)min/g\n const test = array.map(movie => {\n const hours = hourRegex.exec(movie.duration)[1]\n const minutes = minuteRegex.exec(movie.duration)[1]\n const cloneMovie = { ...movie }\n cloneMovie.duration = hours * 60 + minutes\n return cloneMovie\n })\n return test\n\n}", "function onlyTheTitles(){\r\n let result = []\r\n for (let i = 0; i < movies.length; i++){\r\n let movie = movies[i]\r\n result.push(movie.Title)\r\n }\r\n return result\r\n}", "function turnHoursToMinutes(movies) {\n var filmsMinute = movies.map(function(film) {\n var newMovie = {};\n // var hoursToMinutes;\n // hoursToMinutes = parseInt(film.duration) * 60 + parseInt(film.duration.substr(2));\n var hoursToMinutes;\n if (film.duration.length <= 2 && film.duration.length > 0 ) {\n hoursToMinutes = parseInt(film.duration) * 60;\n } else if (film.duration.length > 2 && film.duration.length <= 5) {\n hoursToMinutes = parseInt(film.duration);\n } else {\n hoursToMinutes = parseInt(film.duration) * 60 + parseInt(film.duration.substr(2));\n }\n\n (newMovie.title = film.title);\n (newMovie.year = film.year);\n (newMovie.director = film.director);\n (newMovie.duration = hoursToMinutes);\n (newMovie.genre = film.genre);\n (newMovie.rate = film.rate);\n\n return newMovie;\n });\n return filmsMinute;\n}", "function turnHoursToMinutes (array) {\n var newArray = [];\n\n array.forEach (function (oneMovie) {\n\n var durationArray = oneMovie.duration.split (' ');\n \n // var min = parseInt (durationArray[1], 10);\n \n if (durationArray.length === 1 && durationArray[0].includes(\"min\")) {\n var hr = 0;\n var min = parseInt (durationArray[0], 10);\n }\n else {\n var min = parseInt (durationArray[1], 10);\n var hr = parseInt (durationArray[0], 10);\n }\n\n if (isNaN (min)) {\n var min = 0;\n };\n \n \n var duration = hr*60 + min;\n\n newArray.push ({\n title : oneMovie.title,\n year : oneMovie.year,\n director : oneMovie.director,\n duration : duration,\n genre : oneMovie.genre,\n rate : oneMovie.rate,\n });\n \n\n });\n\n return newArray;\n}", "function turnsHoursToMinutes(movies){\n var fixedMovies = movies.map(\n function(oneMovie) {\n var splitDuration = oneMovie.duration.split(\"\")\n var getHours = splitDuration[0]\n \n var getMinutes = 0\n if (splitDuration[4]===\"m\") {\n getMinutes = splitDuration[3]\n }\n else {\n var arrayMinutes = [splitDuration [3], splitDuration [4]] \n getMinutes = arrayMinutes.join(\"\") \n };\nvar minutes = Number(getHours*60) + Number(getMinutes)\noneMovie.duration = String(minutes)\nreturn oneMovie}\n)\nreturn fixedMovies\n}", "function turnHoursToMinutes(movies){\n\tvar moviesMinutes = movies.map(function(m){\n var hora = m.duration.slice(0,1);\n var min = m.duration.slice(3,5);\n var horaNum = parseInt(hora*60);\n var minNum = parseInt(min);\n if (horaNum == 0) m.duration = minNum;\n m.duration = horaNum + minNum;\n \n return m\n });\n console.log(moviesMinutes);\n}", "function turnHoursToMinutes(moviesArray){\n return moviesArray.map((eachMovie)=>{\n let newMovie = {...eachMovie}; // spread \n let regexHours = /[0-9]+h/g; //regex to find hours\n let regexMinutes = /([0-9]+min)/g; //regex to find minutes\n\n let hoursArray = newMovie.duration.toString().match(regexHours); //find hours\n let minutesArray = newMovie.duration.toString().match(regexMinutes); //find minutes\n \n let durationInMin = 0;\n \n if(hoursArray !== null){\n let hours = parseInt(hoursArray[0].replace(/\\D/g, \"\")); //remove the h in hours\n durationInMin += hours*60;\n }\n\n if(minutesArray !== null){\n let minutes = parseInt(minutesArray[0].replace(/\\D/g, \"\")); //remove the h in hours\n durationInMin += minutes; \n }\n\n newMovie.duration = durationInMin;\n return newMovie;\n });\n\n}", "function turnHoursToMinutes(time) {\n\n let finalArray = time.map((eachMovie) => {\n\n eachMovie = Object.assign({}, eachMovie);\n // console.log(eachMovie)\n const t = eachMovie.duration\n //console.log(t)\n\n if (t.includes('h') && t.includes('min')) {\n const h = Number(t.split('h')[0] * 60);\n const m = Number(t.split(' ')[1].split('min')[0]);\n const sum = h + m\n eachMovie.duration = sum\n //console.log(eachMovie)\n } else if (!t.includes('min')) {\n const h = Number(t.split('h')[0] * 60);\n eachMovie.duration = h\n //console.log(eachMovie)\n } else {\n const m1 = Number(t.split('min')[0]);\n eachMovie.duration = m1\n //console.log(eachMovie)\n }\n // console.log(eachMovie)\n return eachMovie\n })\n console.log(finalArray);\n\n return finalArray\n}", "function turnHoursToMinutes(someArray) {\n\n let arrayCopy = JSON.parse(JSON.stringify(someArray));\n let hours = 0;\n let minutes = 0;\n\n arrayCopy.forEach(eachMovie => {\n let newArray = eachMovie.duration.split(\"\");\n //console.log(newArray);\n //console.log(newArray[0]*60);\n eachMovie.duration = (parseInt(newArray[0], 10)*60+(parseInt (newArray[3], 10)*10)+(parseInt(newArray[4], 10)))\n //console.log(arrayCopy);\n return arrayCopy\n })\n}", "function playback() {\n for (let frame of recorder) {\n s.line(frame.x1, frame.y1, frame.x2, frame.y2);\n }\n }", "function getVideos() {\n let videoArray = [];\n for (let mediaIndexer = 0; mediaIndexer < 3; mediaIndexer += 1) {\n //screenShot[0] === thumbnail\n //screenShot[1] === videoUrl\n const screenShot = {\n thumbnail: `'https://steam-content-videos.s3-us-west-2.amazonaws.com/steam_screenshot${mediaIndexer}.png'`,\n videoUrl: `'https://steam-content-videos.s3-us-west-2.amazonaws.com/steam_content_video${mediaIndexer}.mp4'`\n }\n\n videoArray.push(screenShot)\n }\n return JSON.stringify(videoArray);\n}", "function renderMovies(movieArray) { \n\n function createHTML(movie) {\n return `<div class=\"card mb-3\">\n <img class=\"card-img-top\" src=\"${movie.Poster}\"/>\n\n <div class=\"card-body\">\n <h1 class=\"card-title\">${movie.Title}</h1>\n <h4 class=\"card-text\">${movie.Year}</h4>\n <button onclick=\"saveToWatchlist('${movie.imdbID}')\"> <span class=\"add-symbol\">+</span> ADD<span class=\"empty-space\">+</span></button>\n </div>\n </div>`;\n }\n\n moviesHTML = movieArray.map(createHTML); \n return moviesHTML.join(\"\");\n\n }", "function asArray(){\n logtime = moment();\n var rtnArr =[];\n for (var i in events)\n {\n rtnArr.push(events[i]);\n }\n console.debug(moment().diff(logtime)+\" to AsArray()\");\n return rtnArr;\n }", "function turnHoursToMinutes(array) {\n\n return array.map(movie => {\n\n let hourSearchChar = \"h\"\n let minSearchChar = \"min\"\n let arrayHoursMin = movie.duration.split(\" \");\n let duration = 0;\n\n if (arrayHoursMin.length == 2) {\n let hours = (Number(arrayHoursMin[0].replace(hourSearchChar, \"\")) * 60);\n let minutes = (Number(arrayHoursMin[1].replace(minSearchChar, \"\")));\n duration = Number(hours + minutes);\n } else if (arrayHoursMin[0].indexOf(hourSearchChar) != -1) {\n duration = (Number(arrayHoursMin[0].replace(hourSearchChar, \"\")) * 60);\n } else {\n duration = Number(arrayHoursMin[0].replace(minSearchChar, \"\"));\n }\n let newMovie = {...movie }\n newMovie.duration = duration;\n return newMovie\n\n });\n}", "function thisMovie(string) {\n request(\"http://www.omdbapi.com/?t=\" + string + \"&apikey=trilogy\", function(\n error,\n response,\n body\n ) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover just the imdbRating\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n response = JSON.parse(body);\n\n var title = \" \" + response.Title + \" \";\n var year = \"\" + response.Year;\n var ratingImdb = \"\" + response.Ratings[0].Value;\n var ratinRottenTomatoes = \"\" + response.Ratings[1].Value;\n var country = \"\" + response.Country;\n var language = \"\" + response.Language;\n var plot = \"\" + response.Plot;\n var cast = \"\" + response.Actors;\n console.log(separator.gray);\n console.log(\" \");\n console.log(\" \" + \"Tittle\".underline + \":\");\n console.log(\" \" + title.black.bgYellow);\n console.log(\" \" + \"Year\".underline + \":\");\n console.log(\" \" + year.yellow);\n console.log(\" \" + \"Country\".underline + \":\");\n console.log(\" \" + country.yellow);\n console.log(\" \" + \"Language\".underline + \":\");\n console.log(\" \" + language.yellow);\n console.log(\" \" + \"Cast\".underline + \":\");\n console.log(\" \" + cast.yellow);\n console.log(\" \" + \"Plot\".underline + \":\");\n console.log(\" \" + plot.yellow);\n console.log(\" \" + \"Ratings\".underline + \":\");\n console.log(\" IMDb.............. \" + ratingImdb.red);\n console.log(\" Rotten Tomatoes... \" + ratinRottenTomatoes.red);\n console.log(separator.gray);\n\n logIt(\n \"<<<<<<<<<<<<<<<<<<<<<<<< NEW LOG STARTS HERE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n );\n logIt(separator);\n logIt(\" \");\n logIt(\" \" + \"Tittle\" + \":\");\n logIt(\" \" + title);\n logIt(\" \" + \"Year\" + \":\");\n logIt(\" \" + year);\n logIt(\" \" + \"Country\" + \":\");\n logIt(\" \" + country);\n logIt(\" \" + \"Language\" + \":\");\n logIt(\" \" + language);\n logIt(\" \" + \"Cast\" + \":\");\n logIt(\" \" + cast);\n logIt(\" \" + \"Plot\" + \":\");\n logIt(\" \" + plot);\n logIt(\" \" + \"Ratings\" + \":\");\n logIt(\" IMDb.............. \" + ratingImdb);\n logIt(\" Rotten Tomatoes... \" + ratinRottenTomatoes);\n logIt(separator);\n }\n });\n}", "function moviePlot(movieInput, options) {\n var options = {\n method: 'GET',\n url: 'https://api.themoviedb.org/3/search/movie',\n qs:\n {\n include_adult: 'false',\n page: '1',\n query: movieInput,\n language: 'en-US',\n api_key: 'cd9b0b6a5f58ff82755c2168c6095cdb'\n },\n body: '{}'\n };\n\n //GETS MOVIE INFO\n request(options, function (error, response, body) {\n if (error) throw new Error(error);\n else {\n let movieSpoiler = JSON.parse(body);\n setTimeout(() => { console.log(movieSpoiler.results[0].overview) }, seconds * 1000);\n }\n });\n\n \n\n}", "function arrVideo(name, emotions, times) {\n this.name = name;\n this.emotions = emotions;\n this.times = times;\n}", "function arrVideo(name, emotions, times) {\n this.name = name;\n this.emotions = emotions;\n this.times = times;\n}", "function turnHoursToMinutes(movies) {\n\n return JSON.parse(JSON.stringify(movies)).map((movie) => {\n const hours = movie.duration.match(/\\d+(?=h)/g);\n const minutes = movie.duration.match(/\\d+(?=min)/g);\n if (hours) {\n movie.duration = (Number(hours) * 60 + Number(minutes));\n return movie;\n }\n movie.duration = Number(minutes);\n return movie;\n })\n}", "function turnHoursToMinutes(movies) {\n const newMovies = movies.map(elm => {\n let hours = elm.duration.slice(0, 1)\n let minutes = elm.duration.slice(3, 5).replace(/[a-z]/gi, '') //Aunque Jasmine lo pase, se hace necesario el .replace() para evitar que luego aparezcan NaN en el nuevo array\n\n if(elm.duration.charAt(1) === \"h\") {\n let total = (hours * 60) + Number(minutes)\n return {\n ...elm,\n duration: total\n }\n } else {\n let total2 = Number(elm.duration.slice(0, 2))\n return {\n ...elm,\n duration: total2\n }\n }\n })\n return newMovies\n}", "function movieIt(title) {\n //creates the query url\n var URL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + title;\n\n //requests, saves the info, then logs it to file\n request(URL, function (err, response, body) {\n var data = JSON.parse(body);\n //console.log(data);\n\n var movieData = [\n \"Movie: \" + data.Title,\n \"Released: \" + data.Released,\n \"IMDB Rating: \" + data.Ratings[0].Value,\n \"Rotten Tomatos Rating: \" + data.Ratings[1].Value,\n \"Country of Origin: \" + data.Country,\n \"Language: \" + data.Language,\n \"Plot: \" + data.Plot,\n \"Players: \" + data.Actors\n ].join('\\n');\n\n fs.appendFile('log.txt', movieData + divider, function (err) {\n if (err) throw err;\n console.log(movieData);\n });\n });\n\n}", "function turnHoursToMinutes(movies) {\n var moviesWithMinutes = movies.map(function(movie) {\n var hours = 0;\n var hoursToMinutes = 0;\n var minutes = 0;\n\n var indexHour = movie.duration.indexOf('h');\n if(indexHour !== -1) {\n hours = parseInt(movie.duration.substring(0, indexHour));\n hoursToMinutes = hours * 60;\n }\n\n var indexMinute = movie.duration.indexOf('min');\n if(indexMinute !== -1) {\n if(indexHour !== -1) {\n minutes = parseInt(movie.duration.substring(indexHour + 1, indexMinute));\n } else {\n minutes = parseInt(movie.duration.substring(0, indexMinute));\n }\n }\n\n var movieWithMinutes = Object.assign({}, movie, { duration: hoursToMinutes + minutes });\n return movieWithMinutes;\n });\n\n return moviesWithMinutes;\n}", "function turnHoursToMinutes(arr){\n /*var duration = arr.map(function(obj){\n return obj.duration.split(' ');\n });\n */ \n //erase(duration);\n\n //arr[i].duration\n for( var i =0; i < arr.length; i++){\n var durationEachFilm = arr[i].duration.split(' ');\n var result = erase(durationEachFilm).toString();\n arr[i].duration = result;\n }\n}", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "function turnHoursToMinutes (movies) {\n let newMovies = movies.slice();\n //let newMovies = [...movies.slice];\n let hours = '';\n let minutes = '';\n \n newMovies.forEach(elem => {\n hours = parseInt(elem.duration.match(/[^h]+/));\n minutes = parseInt(elem.duration.match(/([\\d.]+) *min/));\n //console.log(hours, \" \", minutes);\n //BREAK\n if ((hours > 0) && (minutes > 0)) elem.duration = hours * 60 + minutes;\n else if (hours > 0) elem.duration = hours * 60;\n else if (minutes > 0) elem.duration = minutes;\n\n });\n\n return newMovies;\n}", "function getTimeEntries() {\n\t\t\t\ttime.getTime().then(function(results) {\n\t\t\t\t\tvm.timeentries = results;\n\t\t\t\t\tconsole.log(vm.timeentries);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "function printArray(){\n\tvar sports = [\"soccer\", \"baseball\", \"basketball\", \"tennis\"];\n\t// console.log(sports[0]) // \"soccer\"\n\t// console.log(sports[1]) // \"baseball\"\n\t//console.log(sports[2]) // \"basketball\"\n\tfor (var i = 0; i < sports.length; i++) {\n\t\tconsole.log(sports[i]);\n\t}\n}", "function multiTimeFunc(content) {\n var timeToPred = 0;\n times.push(content);\n if (times.length == startStations.length) {\n for (var a = 0; a < times.length; a++) {\n timeToPred += times[a];\n }\n for (let y = 0; y < startEndTimes.length; y++) {\n timeToPred+=startEndTimes[y];\n }\n timeToPred = Math.floor(timeToPred);\n document.getElementById('time' + routeChosen).innerHTML = timeToPred + \" minutes\";\n }\n }", "function PrintScreenLogResults() {\n TestResultsArray[ScreenLogsCounter] = [];\n TestResultsArray[ScreenLogsCounter][0] = '';\n TestResultsArray[ScreenLogsCounter][1] = window.screen.height;\n TestResultsArray[ScreenLogsCounter][2] = window.screen.width;\n TestResultsArray[ScreenLogsCounter][3] = window.screen.availHeight;\n TestResultsArray[ScreenLogsCounter][4] = window.screen.availWidth;\n TestResultsArray[ScreenLogsCounter][5] = window.innerHeight;\n TestResultsArray[ScreenLogsCounter][6] = window.innerWidth;\n}", "function movieDetailsLoop(movieSearchArray, cb) {\n\n movieDetails(movieSearchArray[loopIndex].imdbID, function (data) {\n var plot = data.Plot;\n var replaceQuote = plot.replace(/\"/g, \"'\");\n data.New_Plot = replaceQuote;\n movieDetailArray.push(data);\n loopIndex++;\n\n if (loopIndex < movieSearchArray.length) {\n movieDetailsLoop(movieSearchArray, cb);\n } else {\n loopIndex = 0;\n return cb(movieDetailArray);\n }\n });\n }", "function printAll(array) {\n\t\tconsole.log(\"prints...\");\n\t\tarray.forEach(function(string) {\n\t\t\tconsole.log(string);\n\t\t});\n\t}", "function turnHoursToMinutes (array){\n let newArray = array.map((movieContent)=>{\n let newMovieContent = {...movieContent};\n\n let hour = movieContent.duration.match(/[0-9]h/g);\n let min = movieContent.duration.match(/[0-9]+min/g);\n if(hour === null){\n hour = 0;\n }else{\n hour = parseInt(hour) * 60;\n }\n if(min === null){\n min = 0;\n }else{\n min = parseInt(min)\n }\n newMovieContent.duration = hour + min;\n return newMovieContent;\n });\n return newArray; \n }", "function dramaMoviesRate(array) {\n\n}", "function printFrame(arr)\n{\n // Code goes here\n console.log(arr);\n}", "function turnHoursToMinutes(array) {\n return array.map(movie => {\n const originalDuration = movie.duration\n let duration = 0\n for (let value of originalDuration.split(' ')) {\n const hour = parseInt(value)\n if (value.includes('h')) {\n duration += hour * 60\n } else if (value.includes('min')) {\n duration += hour\n }\n }\n return {\n ...movie,\n duration\n }\n })\n}", "function PrintScreenLogHeaders() {\n TestResultsArray[ScreenLogHeadersCounter] = [];\n TestResultsArray[ScreenLogHeadersCounter][0] = 'Screen details';\n TestResultsArray[ScreenLogHeadersCounter][1] = 'Screen height';\n TestResultsArray[ScreenLogHeadersCounter][2] = 'Screen width';\n TestResultsArray[ScreenLogHeadersCounter][3] = 'Window available height';\n TestResultsArray[ScreenLogHeadersCounter][4] = 'Window available width';\n TestResultsArray[ScreenLogHeadersCounter][5] = 'Window height';\n TestResultsArray[ScreenLogHeadersCounter][6] = 'Window width';\n}", "function OutputText(Array){\n let lasttime = 1000\n for (let i = 0; i < Array.length; i++){\n setTimeout(() => {document.getElementById(\"Output\").innerHTML = Array[i];}, lasttime);\n lasttime = lasttime + 1000;\n } \n}", "function orderByDuration(movies) {\n //var arrayTimeFormat = turnHoursToMinutes(movies);\n var sortedArray = movies.sort(function(a,b) {\n // In case the same duration, order by title\n if(a.duration===b.duration){\n var res = (a.title<b.title) ? -1 : 1;\n return res;\n }\n if(a.duration<b.duration) {\n return -1;\n }\n if(a.duration>b.duration) {\n return 1;\n }\n return 0;\n }) \n var durationArray = sortedArray.map(function(movie) {\n // Chack if movie has the title property (because of the weird error of Jasmine)\n var obj = (movie.hasOwnProperty('title')) ? {title: movie.title, duration: movie.duration} : {duration: movie.duration} \n return obj\n })\n return durationArray;\n}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function movieThis (movie) {\n\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdb.key;\n\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var info = JSON.parse(body);\n console.log(\"\");\n console.log(('***** \"' + info.Title + '\" *****').inverse);\n console.log(\"Released in \" + info.Year);\n console.log(\"IMDB \" + info.Ratings[0].Value);\n console.log(\"Rotten Tomatoes \" + info.Ratings[1].Value);\n console.log(\"Produced in \" + info.Country);\n console.log(\"Language: \" + info.Language);\n console.log(\"Plot: \" + info.Plot);\n console.log(\"Actors: \" + info.Actors);\n console.log(\"\");\n console.log(\"**************************************\");\n console.log(\"\");\n // Append every full return to the log.txt file.\n fs.appendFile(\"log.txt\", \"\\n\" + '***** \"' + info.Title + '\" *****' + \"\\nReleased in \" + info.Year + \"\\nIMDB \" + info.Ratings[0].value + \"\\nRotten Tomatoes \" + info.Ratings[1].Value + \"\\nProduced in \" + info.Country + \"\\nLanguage: \" + info.Language + \"\\nPlot: \" + info.Plot + \"\\nActors: \" + info.Actors + \"\\n\", function(error) {\n if (error) {\n console.log(error);\n };\n });\n } else {\n console.log('An error occurred: ' + error);\n }\n })\n}", "function turnHoursToMinutes(movies) {\n return movies.map(function(movie) {\n var hours = 0;\n var minutes = 0;\n\n if (movie.duration.indexOf(\"h\") != -1) {\n hours = parseInt(movie.duration.slice(0, movie.duration.indexOf(\"h\")));\n }\n\n if (movie.duration.indexOf(\"m\") != -1) {\n minutes = parseInt(\n movie.duration.slice(\n movie.duration.indexOf(\"m\") - 2,\n movie.duration.indexOf(\"m\")\n )\n );\n }\n\n var duration = hours * 60 + minutes;\n\n return Object.assign({}, movie, { duration: duration });\n });\n}", "movieTitles() {\n let movie = browser.elements('.datalayer-movie.ng-binding');\n let movieArray = []\n \n movie.value.forEach(element => {\n if (browser.elementIdDisplayed(element.ELEMENT).value === true) {\n movieArray.push(browser.elementIdText(element.ELEMENT).value);\n }\n });\n\n console.log(movieArray)\n\n }", "replay() {\n for (let event of this.log) {\n console.log(event);\n }\n }", "function pringCarsArray() {\r\n for (var i = 0; i < cars.length; i++) {\r\n console.log(\"cars[\" + i + \"] = \" + cars[i].toString());\r\n }\r\n}", "function turnHoursToMinutes(arr) {\n const moviesArr = [...arr];\n\n const newArr = moviesArr.map(movie => durationToMinutes(movie));\n function durationToMinutes(movie) {\n const movieCopy = { ...movie };\n if (typeof movieCopy.duration === \"number\") {\n return movieCopy;\n }\n movieDuration = movieCopy.duration;\n let hours = 0;\n let minutes = 0;\n\n const timeString = movieDuration.split(\" \");\n \n const minutesDuration = timeString.reduce(function(total, string) {\n if (string.includes(\"h\")) {\n const numOfHours = parseInt(string);\n return total + numOfHours * 60;\n } else {\n const numOfMinutes = parseInt(string);\n return total + numOfMinutes;\n }\n }, 0);\n\n movieCopy.duration = minutesDuration;\n return movieCopy;\n }\n\n return newArr;\n}", "function tweet() {\n var params = {\n screen_name: 'LanaeSlayer'\n };\n client.get('statuses/user_timeline', params, function (error, tweets, response) {\n if (!error) {\n // This array will hold the data that will be appended to log.txt\n data = [];\n\n for (var i = 0; i < tweets.length; i++) {\n\n\n console.log(\"\");\n console.log(tweets[i].created_at);\n console.log(tweets[i].text);\n console.log(\"\");\n console.log(\"<-------------------------------------------->\");\n data.push({\n time: tweets[i].created_at,\n text: tweets[i].text\n })\n\n }\n logData(data)\n\n }\n });\n\n}", "function showTimezonesInConsole() {\n const timezonesArray = getSupportedTimezones();\n\n let date = new Date();\n timezonesArray.forEach((timeZone) => {\n let strTime = date.toLocaleString(\"en-US\", { timeZone: `${timeZone}` });\n console.log(timeZone, strTime);\n });\n}", "function movieThis(movieName) {\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Console log all necessary data points\n console.log(JSON.parse(body));\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Rated: \" + JSON.parse(body).Rated);\n console.log(\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n );\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Produced In: \" + JSON.parse(body).Country);\n console.log(\"Laguage: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "function displayMiles (mileageLog) {\n for (let i = 0; i < mileageLog.length; i++)\n console.log(mileageLog[i])\n}", "function turnHoursToMinutes (movie){\n for (var i=0; i<movie.length;i++){\n var horas=parseInt(movie[i].duration.split(\" \")[0].toString().replace('h',''));\n var minutos=parseInt(movie[i].duration.split(\" \")[1].toString().replace('min',''));\n var tiempo=(horas*60)+minutos\n movie[i].duration=tiempo + ' mins';\n }\n return movie\n }", "tracksForPlaylist(genres , duration){\n let tracks = this.getTracksMatchingGenres(genres);\n let res = [];\n for(let i=0;this.sumarTiempoDeTracks(res)<duration && i<tracks.length;i++){ \n res[i]=tracks[i];\n }\n return res;\n}", "function theBeatlesPlay (musicians, instruments) {\n var yesterday = []\n for (var i = 0; i < musicians.length; i++) {\n console.log(musicians[i] + \" plays \" + instruments[i]);\n yesterday.push(musicians[i] + \" plays \" + instruments[i]);\n }\n return yesterday\n}", "function orderByDuration (movieArray) {\n movieArray=turnHoursToMinutes(movieArray);\n movieArray.sort(function (movie1, movie2){\n if (movie1.duration === movie2.duration) return movie1.title.localeCompare(movie2.title,\"en\");\n else return movie1.duration-movie2.duration; \n });\n return movieArray;\n}", "function log() {\n chrome.storage.sync.get(null, function (data) { console.log(data); });\n chrome.alarms.getAll(function (alarms) {\n var print = [];\n for (alarm in alarms) {\n date = new Date(alarms[alarm].scheduledTime);\n print.push([alarms[alarm].name, date.toLocaleDateString() + \" \" + date.toLocaleTimeString()]);\n }\n console.log(print);\n });\n}" ]
[ "0.6048781", "0.597454", "0.59690094", "0.5913271", "0.58462644", "0.5841196", "0.58198756", "0.5768781", "0.57037723", "0.5703386", "0.5642293", "0.56299174", "0.5621972", "0.5540484", "0.55213475", "0.55095243", "0.54939854", "0.5451977", "0.54406416", "0.54406416", "0.5439609", "0.54390526", "0.5436669", "0.5426771", "0.54069686", "0.53946996", "0.5386267", "0.5382886", "0.53708607", "0.53544796", "0.53543854", "0.53536564", "0.5353214", "0.5344769", "0.53314644", "0.53291917", "0.53242415", "0.5321285", "0.53191465", "0.5309616", "0.5307805", "0.53077644", "0.53041786", "0.53018206", "0.52973396", "0.52916485", "0.5288634", "0.5283098", "0.527088", "0.52576566", "0.52486676", "0.5226854", "0.5225735", "0.52068615", "0.5205158", "0.52012074", "0.5200438", "0.5194282", "0.5185279", "0.5181185", "0.51744014", "0.5173509", "0.517227", "0.517227", "0.51707", "0.5169023", "0.51629657", "0.5154886", "0.51535857", "0.5151072", "0.5145631", "0.5143113", "0.5143044", "0.5136587", "0.51361287", "0.51331353", "0.51288396", "0.51271755", "0.5126709", "0.51249194", "0.5124399", "0.51230705", "0.51204956", "0.5119817", "0.511918", "0.5118475", "0.51047915", "0.50951076", "0.5088423", "0.5074644", "0.5059522", "0.5058472", "0.5057477", "0.50574565", "0.50528836", "0.5047604", "0.5044835", "0.50442725", "0.5038359", "0.50380903" ]
0.55847126
13
Method to Capture All Movie Titles into an Array & Print to Console
movieTitles() { let movie = browser.elements('.datalayer-movie.ng-binding'); let movieArray = [] movie.value.forEach(element => { if (browser.elementIdDisplayed(element.ELEMENT).value === true) { movieArray.push(browser.elementIdText(element.ELEMENT).value); } }); console.log(movieArray) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movieTitleToArray() {\n let string = movie.title.toLowerCase();\n return string.split(\"\");\n}", "function readTitles(_aMoviesArr) {\r\n var _stringToShow = \"The names of the movies are: \";\r\n\r\n for (var i = 0; i < _aMoviesArr.length; i++) {\r\n if (i < _aMoviesArr.length - 1) {\r\n _stringToShow += _aMoviesArr[i].Title + \", \";\r\n } else \r\n {\r\n _stringToShow += _aMoviesArr[i].Title;\r\n }\r\n }\r\n _stringToShow += \".\";\r\n return _stringToShow;\r\n\r\n}", "function onlyTheTitles(){\r\n let result = []\r\n for (let i = 0; i < movies.length; i++){\r\n let movie = movies[i]\r\n result.push(movie.Title)\r\n }\r\n return result\r\n}", "function getMovieTitles() { \n var findPattern = \"//a[contains(@class, 'filmname')]\";\n var resultLinks = document.evaluate( findPattern, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );\n\n var result = new Array();\n var i=0;\n while ( (res = resultLinks.snapshotItem(i) ) !=null ) {\n result[i] = res;\n i++;\n }\n return result;\n\n }", "function showMovies() {\n\tconsole.log(SPACER);\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tconsole.log(\"\\t\" + String(i + 1) + \". \" + movies[i].title + \" (\" + movies[i].average + \" stars)\");\n\t}\n\tconsole.log(SPACER);\n}", "function printMovieItems() {\n seanBeanMovies.forEach(function(movie) {\n console.log(movie);\n });\n}", "function orderAlphabetically(movies)\n{\n //ordenar per title\n //print els primers 20\n\n var moviesOrdered = movies.sort(function(movieA, movieB){\n if (movieA.title > movieB.title) return 1;\n else return -1;\n });\n var movies20 = moviesOrdered.slice(0,20);\n\n var titles = [];\n movies20.forEach(function(movie){\n titles.push(movie.title);\n });\n console.log(titles);\n return titles;\n}", "function getMovieTitle() {\r\n\t\tvar title = new String ( document.title.replace(' on All Consuming', '') );\r\n\t\t/* get rid of subtitles and editions. they just get in the way of the search */\r\n\t\ttitle = title.replace(/ - .*/gi, '');\r\n\t\ttitle = title.replace(/ \\(\\w*screen edition\\)/gi, '');\r\n\t\treturn title;\r\n\t}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function orderAlphabetically(movieArray) {\n\n const titleAlpha = []\n const top20titleAlpha = []\n\n const first20Titles = movieArray.filter(e => e.title.toString())\n\n first20Titles.forEach(e => titleAlpha.push(e.title))\n titleAlpha.sort()\n\n titleAlpha.forEach(function (e, idx) {\n idx < 20 ? top20titleAlpha.push(e) : null\n })\n\n return top20titleAlpha\n}", "function orderAlphabetically(moviesArray) {\n var movies = [];\n\n // order movies\n var ordered = moviesArray.sort(function (a, b) {\n if (a.title.toLowerCase() < b.title.toLowerCase()) {\n return -1;\n }\n\n if (a.title.toLowerCase() > b.title.toLowerCase()) {\n return 1;\n }\n\n return 0;\n });\n\n // get 20 movies\n if (ordered.length < 20) {\n movies = moviesArray.slice(0, moviesArray.length);\n } else {\n movies = moviesArray.slice(0, 20);\n }\n\n // get only title\n var titles = movies.map(function (e) {\n return e.title;\n });\n\n return titles;\n}", "function orderAlphabetically(movie) {\n const alphabet = movie.sort(function(a,b) {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0 \n }\n});\n const orderedTitles = alphabet.map(list => list.title)\n if (orderedTitles.length > 20) {\n return orderedTitles.slice(0, 20);\n }\n return orderedTitles;\n }", "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function orderAlphabetically(movies) {\n\tconst sortedMovies = movies.sort(titleComparison);\n\tselectedMovies = sortedMovies.slice(0, 20); // pour cibler les 20 premiers\n\treturn selectedMovies.map((movie) => movie.title); // pour avoir juste le titre\n}", "function allMovieTitleLinks() {\n return $('.movie .name a')\n}", "function orderAlphabetically(movies){\n var sortedTitles=[];\n movies.sort(function (a,b){\n return ((a.title>b.title)?1:-1);\n });\n for (i=0;i<20 && i<movies.length;i++){\n sortedTitles.push(movies[i].title);\n }\n return sortedTitles;\n}", "function orderAlphabetically(movies) {\r\n let moviesSorted = movies.sort((a, b) => {\r\n if (a.title < b.title) return -1\r\n else return 1\r\n });\r\n let result = [];\r\n if (moviesSorted.length < 20) {\r\n moviesSorted.forEach(e => result.push(e.title));\r\n }\r\n else {\r\n for (let index = 0; index < 20; index++) {\r\n result.push(moviesSorted[index].title);\r\n }\r\n }\r\n return result;\r\n}", "function getTheatreMovies() {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/now_playing?api_key=\" +\n API_KEY +\n \"&language=en-US&region=US\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let theatreMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n theatreMovies.push(response.results[i].title);\n }\n console.log(theatreMovies);\n });\n}", "function orderAlphabetically(collection){\n var arrayTitleSort = collection.sort(function(movieA,movieB){\n var movieAupper = movieA.title.toUpperCase();\n var movieBupper = movieB.title.toUpperCase();\n if (movieAupper < movieBupper){\n return -1;\n }\n if (movieAupper > movieBupper){\n return 1;\n }\n });\n var titlesArray = [];\n arrayTitleSort.forEach(function(movie,index) {\n if (index < 20)\n {\n titlesArray[index] = movie.title;\n }\n });\n return titlesArray;\n}", "function orderAlphabetically(array) {\n const titleArray = array.map(movie => movie.title).sort((a, b) => a.localeCompare(b));\n return titleArray.slice(0, 20);\n}", "function orderAlphabetically(arr) {\n let moviesCopy = [];\n let sortedTitles = [];\n for (let movie of arr) {moviesCopy.push(movie.title);}\n moviesCopy.sort();\n if (moviesCopy.length < 20) {\n for (let j = 0; j < moviesCopy.length; j++) {sortedTitles.push(moviesCopy[j]);}\n } else for (let i = 0; i < 20; i++) {sortedTitles.push(moviesCopy[i]);}\n return sortedTitles;\n}", "function consoleFn(Movie_rating, Movie_name, watch_Link, trailer_link){\n let movie_rates = document.querySelectorAll(Movie_rating);\n let Movie_names = document.querySelectorAll(Movie_name);\n let Watch_link = document.querySelectorAll(watch_Link);\n let Trailer_link = document.querySelectorAll(trailer_link);\n\n let result = [];\n\n for( let i = 30, j = 0 ; i < movie_rates.length && j<Watch_link.length ; i++, j++ ){\n let rating = movie_rates[i].innerText.trim();\n let Movie_name = Movie_names[i].innerText.trim();\n let watch_link = Watch_link[j].href;\n let trailerlink = Trailer_link[i].href;\n\n \n result.push({\n rating : rating,\n Movie_name : Movie_name,\n watch_link : watch_link,\n trailerlink : trailerlink\n });\n }\n\n return result;\n }", "function orderAlphabetically (movies){\n var orden = movies.sort(function(a,b){\n if (a.title>b.title) return 1;\n if (a.title<b.title) return -1;\n if (a.title === b.title) return 0;\n });\n \n for (i=0; i<20; i++){\n console.log(orden[i].title);\n }\n }", "function orderAlphabetically(movieArray) {\n var movieTitles=[];\n movieArray.forEach(function(elem){\n movieTitles.push(elem.title);\n });\n movieTitles.sort(function (movie1, movie2){\n return movie1.localeCompare(movie2,\"en\");\n });\n return movieTitles.splice(0,20);\n}", "function orderAlphabetically(movies) {\n\n return movies.map(a => a.title).sort().slice(0, 20)\n\n}", "function orderAlphabetically(moviesArray) {\n let copiedArray = JSON.parse(JSON.stringify(moviesArray));\n\n copiedArray.sort((a, b) => {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0;\n }\n });\n\n let copiedArrayNames = copiedArray.map((movie) => {\n return movie.title;\n });\n if (copiedArray.length <= 20) {\n return copiedArrayNames;\n } else {\n return copiedArrayNames.slice(0, 20);\n }\n}", "function orderAlphabetically(myArray) {\n\tconst titleArray = []\n\tfor (const movie of myArray) {\n\t\ttitleArray.push(movie.title.toLowerCase());\n\t}\n\ttitleArray.sort()\n\treturn titleArray.slice(0,20)\n}", "function orderAlphabetically(movies){\n var orderMovies = movies.sort(function(a,b){\n if (a.title > b.title) {return 1;}\n else if (a.title < b.title) {return -1;} \n else {return 0;}\n });\n var newArray = [];\n orderMovies.forEach(function(orderMovies) {\n newArray.push(orderMovies.title);\n });\n return newArray.slice(0,20);\n}", "function extractAllTitles() {\n insertHeader()\n\n rawArticle += setTitleSectionSeparator('TITLES')\n\n Array.from(document.querySelectorAll('h1,h2,h3,h4,h5,h6'))\n .map(x =>\n titleToSymbol(x.tagName, x.innerText, '----'))\n .filter(x => x.text.length > 0)\n .forEach(x => rawArticle += '|' + x.type + '|' + x.text + '\\n');\n\n // add separator after titles list\n rawArticle += '\\n\\n';\n console.log(rawArticle);\n\n injectPreInHTML(rawArticle, 'mediumpurple', 'pre-header')\n}", "function orderAlphabetically(moviesArray) {\n\n let onlyTheTitleArray = moviesArray.map(movie => {\n return movie.title\n })\n let sortedTitleArray = onlyTheTitleArray.sort()\n let slicedArray = sortedTitleArray.slice(0, 20)\n return slicedArray\n\n}", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function orderAlphabetically(movies) {\n const copy = [...movies];\n const sortCopy = copy.sort(function (a, b) {\n return a.title.localeCompare(b.title)\n });\n const firstTwenty = sortCopy.slice(0, 20);\n let array = [];\n firstTwenty.forEach((movie) => array.push(movie.title));\n return array;\n }", "function orderAlphabetically(array) {\n let arrayTitle = array.map(movie => movie.title);\n\n return arrayTitle.sort().slice(0,20);\n\n\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function orderAlphabetically(array) {\n let orderAlphArray = array.sort(function (movie1, movie2) { \n let title1 = movie1.title.toLowerCase();\n let title2 = movie2.title.toLowerCase();\n if (title1 > title2) { \n return 1;\n } else if (title1 < title2) {\n return -1;\n }\n return 0;\n })\n return orderAlphArray.map(function (movie) { \n return movie.title\n }).slice(0, 20) \n \n }", "function getMovieTitles(substr) {\n const titles = [];\n let totalPages = 1;\n let currentPage = 1;\n\n while (currentPage <= totalPages) {\n https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${currentPage}`, (resp) => {\n let data = '';\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n resp.on('end', () => {\n console.log(currentPage);\n const res = JSON.parse(data);\n totalPages = res.total_pages;\n titles.concat(res.data.map(item => item['Title']));\n currentPage++;\n });\n });\n }\n\n // for(let i=1; i <= totalPages; i++){\n // https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${i}`, (resp) => {\n // let data = '';\n // resp.on('data', (chunk) => {\n // data += chunk;\n // });\n\n // resp.on('end', () => {\n // const res = JSON.parse(data);\n // totalPages = res.total_pages;\n // titles.concat(res.data.map(item=>item['Title']));\n // });\n // });\n // }\n\n console.log(titles);\n return titles.sort();\n}", "function randomMovieTitle() {\n return movieTitles[Math.floor(Math.random() * movieTitles.length)];\n}", "function orderAlphabetically(movies){\n \n let moviesClone = JSON.parse(JSON.stringify(movies));\n \n // sort movie titles alphabetically\n let orderMoviesAlpha = moviesClone.sort(function(movie1, movie2){\n if(movie1.title < movie2.title){\n return -1\n } else if(movie1.title > movie2.title){\n return 1\n } else {\n return 0\n }\n })\n \n let returnTitles = orderMoviesAlpha.map(function(movie){\n return movie.title\n })\n \n return returnTitles.slice(0, 20)\n \n }", "printMovieInfo(data) {\n const rottenTomatoes = this.rottenTomatoesRating(data);\n const output = [\n `Title: ${data.Title}`,\n `Year: ${data.Year}`,\n `Rating: IMDb ${data.imdbRating}`,\n ` Rotten Tomatoes ${rottenTomatoes}`,\n `Country: ${data.Country}`,\n `Language: ${data.Language}`,\n `Plot: ${data.Plot}`,\n `Actors: ${data.Actors}`\n ];\n\n console.log(output.join(\"\\n\"));\n }", "function orderAlphabetically(arr) {\n let movieTitles = arr.map(movie => movie.title);\n const alpha = movieTitles.sort((a, b) => a > b ? 1 : -1).slice(0, 20);\n return alpha;\n}", "function movieSearch(){\n outPutForLog = [];\n outPutForLog.unshift(outputText);\n outPutForLog.unshift(\"\\n\");\n\n axios.get(\"http://www.omdbapi.com/?t=\" + userQuestion + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n\n //Title of the movie.\n console.log(\"Movie Title: \" + response.data.Title);\n outPutForLog.push(\"Movie Title: \" + response.data.Title);\n //Release Date\n console.log(\"Release Date: \" + response.data.Released);\n outPutForLog.push(\"Release Date: \" + response.data.Released);\n // IMDB Rating of the movie.\n console.log(\"IMDB Ratinge: \" + response.data.imdbRating);\n outPutForLog.push(\"IMDB Ratinge: \" + response.data.imdbRating);\n //Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n outPutForLog.push(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n console.log(\"Country: \" + response.data.Country);\n outPutForLog.push(\"Country: \" + response.data.Country);\n //Language of the movie.\n console.log(\"Language: \" + response.data.Language);\n outPutForLog.push(\"Language: \" + response.data.Language);\n //Plot of the movie.\n console.log(\"Plot: \" + response.data.Plot);\n outPutForLog.push(\"Plot: \" + response.data.Plot);\n //Actors in the movie.\n console.log(\"Actors: \" + response.data.Actors);\n outPutForLog.push(\"Actors: \" + response.data.Actors);\n\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n displayForLog = outPutForLog.join(\"\\n \");\n appendOutput();\n }\n );\n}", "function sortByTitle(titlesArray) {\n return titlesArray.map(val => {\n addMovie(myMovies[val].name, myMovies[val].rating)\n })\n }", "function orderAlphabetically(moviesArray){\n return moviesArray.map((x) => x.title)\n sort()\n .slice(0, 20);\n}", "function movieIt(title) {\n //creates the query url\n var URL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + title;\n\n //requests, saves the info, then logs it to file\n request(URL, function (err, response, body) {\n var data = JSON.parse(body);\n //console.log(data);\n\n var movieData = [\n \"Movie: \" + data.Title,\n \"Released: \" + data.Released,\n \"IMDB Rating: \" + data.Ratings[0].Value,\n \"Rotten Tomatos Rating: \" + data.Ratings[1].Value,\n \"Country of Origin: \" + data.Country,\n \"Language: \" + data.Language,\n \"Plot: \" + data.Plot,\n \"Players: \" + data.Actors\n ].join('\\n');\n\n fs.appendFile('log.txt', movieData + divider, function (err) {\n if (err) throw err;\n console.log(movieData);\n });\n });\n\n}", "function orderAlphabetically(movies) {\n var onlyTitles = movies.map(a => {\n return a.title;\n });\n\n var orderedOnlyTitles = onlyTitles.sort();\n return orderedOnlyTitles.slice(0, 20);\n}", "function directorMovies(){\nconst director = movies.filter(function(movies){\n return movies.director == \"Steven Spielberg\"\n})\n\nspielBergMovies = []\n\nfor (let i = 0; i<director.length; i+=1){\n spielBergMovies.push(director[i].title)\n}\nconsole.log(\"Steven Spielberg movies has \"+ spielBergMovies.length+ \" movies: \"+ spielBergMovies )\n}", "function orderAlphabetically(movies) {\n const copySortTitle = [...movies].sort((a, b) => a.title.localeCompare(b.title))\n const twentyTitles = copySortTitle.map(elm => elm.title).slice(0, 20)\n return twentyTitles\n}", "function orderAlphabetically(movies) {\n let movAlphab = movies.sort(function(a, b) {\n if (a.title > b.title) {\n return 1\n } else if (a.title < b.title) {\n return -1\n } else {\n return 0\n }\n })\n return movAlphab.map(function(item){\n return item.title\n }).slice(0, 20);\n}", "function orderAlphabetically(movies) {\n const sortedArr = movies.sort((movieA, movieB) => movieA.title.localeCompare(movieB.title));\n const orderedTitles = sortedArr.map(list => list.title)\n if (orderedTitles.length > 20) {\n return orderedTitles.slice(0, 20);\n }\n return orderedTitles;\n}", "function showMovie(title, year, genre, ...actors) {\n console.log(\n `${title} was a ${genre} movie released in ${year} and in the cast are: ${\n actors[0]\n } and ${actors[1]}`\n );\n}", "function consoleFn() {\n let arr = document.querySelectorAll(\"#stats.style-scope .ytd-playlist-sidebar-primary-info-renderer\");\n let newArr = [];\n newArr.push(arr[0].innerText); //no. of videos\n newArr.push(arr[1].innerText); //no. of views\n return newArr;\n}", "function orderAlphabetically(movies){\n let moviesOrder = movies.sort(function(a,b) {\n if (a.title > b.title) return 1\n if (a.title < b.title) return -1\n }) \n \n let movisTittle = moviesOrder.map(movie => {\n return movie.title \n })\n \n return movisTittle.splice(0,20)\n\n}", "function orderAlphabetically(moviesArray) {\n\n const moviesArrayCopy = JSON.parse(JSON.stringify(moviesArray));\n\n const titlesArray = moviesArrayCopy.map(function(element) {\n return element.title;\n });\n\n const firstTwentyMoviesArray = titlesArray.sort(function(element1, element2){\n\n return element1.localeCompare(element2);\n });\n\n return firstTwentyMoviesArray.slice(0,20);\n\n}", "function orderAlphabetically(array){\n var sortedArray =\n array.sort(function(a,b){\n if(a.title.toLowerCase() < b.title.toLowerCase()){\n return -1;\n } else if(a.title.toLowerCase() > b.title.toLowerCase()){\n return 1;\n }\n });\n var byTitle20 = [];\n // for(var i = 0; i < 20; i++){\n // byTitle20.push(sortedArray[i].title);\n // }\n var count = 0;\n sortedArray.forEach(function(oneMovie){\n if(count < 20){\n byTitle20.push(oneMovie.title);\n count++;\n } \n });\n \n return byTitle20;\n \n}", "function orderAlphabetically(movies) {\n var onlyMoviesTitle = []\n var alphabeticallOrder = movies.sort(function (movie1, movie2) {\n var title1 = movie1.title;\n var title2 = movie2.title;\n if (title1 > title2) {\n // console.log(title1 + \" should be under \" + title2);\n return +1;\n } else if (title1 < title2) {\n // console.log(title1 + \" should be above \" + title2);\n return -1;\n }\n })\n\n alphabeticallOrder.reduce(function (allmovietitle, movie) {\n onlyMoviesTitle.push(movie.title);\n }, []);\n // console.log(onlyMoviesTitle);\n if (onlyMoviesTitle.length <= 20) {\n return onlyMoviesTitle;\n } else {\n // console.log(onlyMoviesTitle.slice(0, 20))\n return onlyMoviesTitle.slice(0, 20)\n }\n}", "function orderAlphabetically(moviesArray) {\n let movieTitles = moviesArray.map(function(movie) {\n return movie.title\n }); \n\n movieTitles.sort(function(title1, title2){\n if (title1 > title2) {\n return 1;\n } else if (title1 < title2) {\n return -1;\n }\n }); return movieTitles.slice(0, 20);\n}", "function orderAlphabetically(movies) {\n const ordered = movies.sort(function (a, b) {\n if (a.title < b.title) {\n return -1\n } else if (a.title > b.title) {\n return 1\n } else {\n return 0\n };\n });\n return ordered.slice(1, 20);\n\n}", "function orderAlphabetically(moviesAlph) {\n let alphArray = moviesAlph.map(elm => {\n return elm.title\n })\n\n alphArray.sort((a, b) => {\n if (a > b) return 1\n if (a < b) return -1\n if (a == b) return 0\n })\n return alphArray.slice(0, 20)\n}", "function orderAlphabetically(arr) {\n let titles = arr.map(function(movie) {\n return movie.title\n });\n let alphabeticOrder = titles.sort(function(a , b) {\n return a.localeCompare(b)\n });\n return alphabeticOrder.slice(0, 20)\n}", "function orderAlphabetically(movies) {\n const movieTitle = movies.map(movie => movie.title);\n return movieTitle.sort(function(a,b) {\n return a.localeCompare(b);\n }).slice(0,20)\n \n}", "function orderAlphabetically(arrayMovies) {\n var orderedMovies = [];\n var iterator = 0;\n var lengthOfArray = 0;\n if (arrayMovies.length > -1) {\n arrayMovies.sort(function (elementA, elementB) {\n if (elementA.title > elementB.title) {\n return 1;\n } else if (elementA.title < elementB.title) {\n return -1;\n } else {\n return 0;\n }\n });\n\n lengthOfArray = (arrayMovies.length < 20 ? arrayMovies.length : 20);\n\n for (var i = 0; i < lengthOfArray; i++) {\n orderedMovies.push(arrayMovies[i].title);\n }\n return orderedMovies;\n } else {\n return undefined;\n }\n}", "function orderAlphabetically(movies) {\n let sortedMovies = [...movies]\n sortedMovies.sort((a, b) => {\n if (a.title.toLowerCase() > b.title.toLowerCase()) {\n return 1\n } else if (a.title.toLowerCase() < b.title.toLowerCase()) {\n return -1\n } else {\n return 0\n }\n });\n let titlesList = sortedMovies.map((value) => value.title)\n return titlesList.slice(0, 20);\n}", "function printMovies(movies, genre) {\n\tvar handlebars = handlebarsInit('#movie');\n\t// search every movies\n\tfor (var i = 0; i < movies.length; i++) {\n\t\tvar movie = movies[i];\n\t\t// convert raking in stars\n\t\tvar vote = oneToX(movie.vote_average, 5, 10);\n\t\tvar star = printStar(vote, 5);\n\t\t// convert original_language in flag\n\t\tvar flag = convertFlag(movie.original_language);\n\t\t// add poster from api database if present\n\t\tvar posterPath = addPoster(movie);\n\t\t// create object context for handlebars\n\t\tvar context = {\n\t\t\ttitle: movie.title,\n\t\t\toriginal_language: flag,\n\t\t\tstar: star,\n\t\t\toverview: movie.overview,\n\t\t\tposter_path: posterPath,\n\t\t\tgenre_ids: movie.genre_ids\n\t\t};\n\t\t// check if the title is the same as the original title\n\t\tcheckTitle(movie, context);\n\t\t// handlebars append\n\t\tvar html = handlebars(context);\n\t\t$('.results').append(html);\n\t\t// filter by genre the .result\n\t\tfilterByGenre(genre);\n\t}\n}", "function orderAlphabetically(arr){\n return arr.map(movie => {\n return movie.title\n }).sort((a,b) => {\n if(a > b) return 1;\n if( a < b) return -1;\n return 0;\n }).slice(0,20)\n }", "function orderAlphabetically([...movies]){\n let orderArr = movies.sort( (a, b) => {\n if (a.title > b.title){\n return 1;\n } else {\n return -1;\n }\n })\n \n return orderArr.slice(0, 20).map(movie => movie.title);\n}", "function logTitle(title) {\n console.log(\"\");\n console.log(\"-------------------------------------------\");\n console.log(title);\n console.log(\"-------------------------------------------\");\n console.log(\"\");\n}", "function orderAlphabetically(movies) {\n var sortedMovies = movies.sort(function(movie1, movie2) {\n return movie1.title.localeCompare(movie2.title);\n });\n\n var titleMovies = sortedMovies.map(function(movie) {\n return movie.title;\n });\n\n return titleMovies.slice(0, 20);\n}", "function orderAlphabetically(movies) {\n var sortedArray = movies.sort(function(a,b) {\n if(a.title < b.title) {\n return -1;\n }\n if(a.title > b.title) {\n return 1;\n }\n return 0;\n })\n var titlesArray = sortedArray.map(function(movie) {\n return movie.title;\n })\n return titlesArray.splice(0, 20);\n}", "function orderAlphabetically (movies) {\n const first20Titles = movies.map(aMovie => aMovie.title).sort();\n // if (first20Titles.length < 20) {\n // return firstTwentyTitles;\n // }\n // else {\n return first20Titles.slice(0, 20);\n }", "function orderAlphabetically(movies) {\n\n var movieTitles = [...movies];\n \n movieTitles = movies.map(movie => {\n return movie.title;\n });\n\n movieTitles.sort((a, b) => {\n if (a.toLowerCase() > b.toLowerCase())\n return 1;\n if (a.toLowerCase() < b.toLowerCase())\n return -1;\n return 0;\n });\n\n\n const top20= movieTitles.slice(0,20);\n return top20;\n}", "function parseTitle(title) {\r\n var words = title.replace(/ *\\([^)]*\\) */g, \"\").split(\" \")\r\n var result = new Array();\r\n for (var i = 0; i < words.length ; i++){\r\n result.push(words[i].replace(/[^a-z0-9]/gi,''))\r\n }\r\n return result.join(\" \");\r\n }", "function orderAlphabetically(movies) {\n movieTitles = [];\n for (let i = 0; i < movies.length; i++) {\n movieTitles.push(movies[i].title);\n }\n var sortedTitles = movieTitles.sort(function(a, b) {\n if (a > b) return 1;\n if (a < b) return -1;\n return 0;\n });\n var longSortedTitles = [];\n if (sortedTitles.length <= 20) {\n return sortedTitles;\n } else if (sortedTitles.length > 20) {\n for (let i = 0; i < 20; i++) {\n longSortedTitles.push(sortedTitles[i]);\n }\n return longSortedTitles;\n }\n}", "function orderAlphabetically(arr) {\n const moviesTitles = arr.map((movie) => {\n return movie.title;\n });\n moviesTitles.sort();\n if (moviesTitles.length > 20) {\n return moviesTitles.slice(0, 20);\n };\n return moviesTitles;\n}", "function orderAlphabetically(movies) {\n const sorted = movies.map((item) => {\n return item.title;\n});\nsorted.sort ((a,b) => {\n return a.localeCompare(b);\n});\nreturn sorted.slice(0,20);\n}", "function orderAlphabetically(movies) {\n var sortedTitles = movies\n .map(function(oneMovie) {\n return oneMovie.title;\n })\n .sort()\n .slice(0, 20);\n\n return sortedTitles;\n}", "function orderAlphabetically(movies){\n let titles = movies.map(movie => movie.title);\n return titles.sort().splice(0,20);\n}", "function orderAlphabetically(movies) {\n const moviesArr = JSON.parse(JSON.stringify(movies))\nconst sortedMoviesArr = moviesArr\n .sort((a, b) => {\n if (a.title > b.title) {\n return 1;\n } else if (a.title < b.title) {\n return -1;\n } else {\n return 0;\n }\n })\n .map(eachMovie => eachMovie.title)\n .slice(0, 20);\n\n return sortedMoviesArr\n}", "function orderAlphabetically(movies) {\n return movies\n .map(movie => movie.title)\n .sort((a, b) => a.localeCompare(b))\n .slice(0, 20);\n}", "function orderAlphabetically(movies) {\n const copy = [...movies]\n const ordered = copy.sort(function(a, b){\n return a.title.localeCompare(b.title)\n }).map(function(movie){\n return movie.title\n })\n return ordered.slice(0, 20)\n}", "function orderAlphabetically(movieList) {\n let ordered = movieList.sort(function(a, b) {\n return a.title.localeCompare(b.title);\n });\n ordered = ordered.map(function(movie) {\n return movie.title;\n });\n return ordered.slice(0, 20);\n}", "function orderAlphabetically(bunchaMovies){\n let arrayToUse = [...bunchaMovies];\n arrayToUse.sort((a,b)=>{\n if(a.title < b.title){\n return -1;\n } else if (b.title < a.title){\n return 1\n }\n return 0;\n })\n let blah = arrayToUse.slice(0,20);\n let titlesOnly = blah.map((eachMovieObject)=>{\n return eachMovieObject.title;\n })\n return titlesOnly;\n}", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "function orderAlphabetically(moviesArray) {\n let orderedArray = moviesArray.slice().sort(function compare(a, b) {\n if (a.title < b.title) {\n return -1;\n }\n if (a.title > b.title) {\n return 1;\n }\n return 0;\n });\n\n const titlesOrderedArray = orderedArray.map(function (film) {\n return film.title;\n });\n\n return titlesOrderedArray.splice(0, 20);\n}", "function moviethis(){\n var movieName = '';\n var theArg = process.argv;\n \n if(input===undefined){\n // if no movie name is entered\n movieName = 'Mr.'+\"+\"+\"Nobody\"; \n } else {\n // otherwise this captures movie names with 1 or more words\n for(i=3; i<theArg.length; i++){\n movieName += theArg[i]+\"+\";\n }\n \n }\n \n //run axios using OMDB API\n var url = \"http://www.omdbapi.com/?t=\"+movieName+\"&y=&plot=short&apikey=trilogy\";\n axios.get(url)\n .then(\n function(response) { \n console.log(\"Title: \"+response.data.Title);\n console.log(\"Release Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \"+response.data.Ratings[0].Value);\n console.log(\"Country Produced: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot: \"+response.data.Plot);\n console.log(\"Actors :\"+response.data.Actors);\n }\n );\n }", "function orderAlphabetically (array) {\n const clone = Array.from(array)\n const sorted = clone.sort((movieA, movieB) => {\n if (movieA.title < movieB.title) {\n return -1\n } else if (movieA.title > movieB.title) {\n return 1\n } else {\n return 0\n }\n })\n return sorted.reduce((total, movie) => {\n if (total.length < 20) {\n total.push(movie.title)\n }\n return total\n }, [])\n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function createTitleWordsArray (array) {\n // PREFIX: \n allTitleWords = [];\n\n // Split all the words\n array.forEach(element => {\n let ElementTitleWords = element.title.split(' ');\n // Push every word to the array\n ElementTitleWords.forEach(word => {\n allTitleWords.push(word.toLowerCase());\n });\n });\n}", "function orderAlphabetically(movies) {\n let moviesArr = [...movies];\n let newArr = moviesArr.sort((x, y) => {\n if (x.title > y.title) {\n return 1;\n } else if (x.title < y.title) {\n return -1;\n }\n });\n return newArr\n .map(function(movies) {\n return movies.title;\n })\n .slice(0, 20);\n}", "function getMovieInfo() {\n\n\t//If the movie name is longer than one word, join the words together on one line so that the movie name is all one string.\n\t//Rather than having separate lines for each word.\n\tfor (var i = 3; i < input.length; i++) {\n\n\t\tif (i > 2 && i < input.length) {\n\t\t\tmovieName = movieName + \" \" + input[i];\n\t\t}\n\t\t//For example, if the user enters \"node liri.js movie this social network\", movieName should be \"social network\" when the value is logged the terminal.\n\t\t//console.log(movieName);\n\t}\n\n\t//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\n\tif (!movieName) {\n\t\t//If no movie is specified, set movieName equal to Mr. Nobody.\n\t\tmovieName = \"Mr Nobody\";\n\t\tconsole.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\n\t\tconsole.log(\"It's on Netflix!\")\n\t}\n\n\t//Use the figlet npm package to convert the movieName text to art/drawing.\n\tfiglet(movieName, function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\n\t//Then, run a request to the OMDB API with the movieName value.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function (error, response, body) {\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\t//console.log(movieInfo);\n\n\t\t\t// Create variable to hold Rotten Tomatoes Rating.\n\t\t\tvar tomatoRating = movieInfo.Ratings[1].Value;\n\n\t\t\t//Output the following information about movieName.\n\t\t\t// \\r\\n is used as a new line character in Windows: https://stackoverflow.com/questions/15433188/r-n-r-n-what-is-the-difference-between-them \n\t\t\tvar movieResult =\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Output the liri command plus movieName\n\t\t\t\t\"liri command: movie-this \" + movieName + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Title of the movie.\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t//Year the movie came out.\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t//IMDB Rating of the movie.\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t//Rotten Tomatoes rating of the movie.\n\t\t\t\t\"Rotten Tomatoes rating (out of 100%): \" + tomatoRating + \"\\r\\n\" +\n\t\t\t\t//Country where the movie was produced.\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t//Language of the movie.\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" +\n\t\t\t\t//Plot of the movie.\n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t//Actors in the movie.\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\"\n\n\t\t\t//Output the movie information to the terminal.\n\t\t\tconsole.log(movieResult);\n\t\t\t//Output the movie information to the log.txt file.\n\t\t\tlogData(movieResult);\n\t\t}\n\t});\n}", "function orderAlphabetically(movies){\n if (movies.length === 0) return 0;\n let titleList = movies.map(function(movie) {\n return movie.title;\n })\n titleList.sort(function(a,b){\n let title1 = a.toLowerCase();\n let title2 = b.toLowerCase();\n if (title1 < title2) return -1;\n if (title1 > title2) return 1;\n if (title1 === title2) return 0;\n })\n if (titleList.length < 20){\n return titleList.slice(0,titleList.length)\n }\n return titleList.slice(0,20)\n }", "function getTitleNDuration(videoSelector,duration){\r\n let titleElementsArr=document.querySelectorAll(videoSelector);\r\n let durationElementArr=document.querySelectorAll(duration);\r\n let titleDurArr=[];\r\n for(let i=0;i<durationElementArr.length;i++){\r\n let title=titleElementsArr[i].innerText.trim();\r\n let duration=durationElementArr[i].innerText.trim();\r\n titleDurArr.push({title,duration})\r\n }\r\n return titleDurArr;\r\n}", "function orderAlphabetically(movies) {\n const onlyTitles = movies.map(i => i.title)\n const allpha = onlyTitles.sort((a,b) => a > b? 1 : b> a? -1 : 0)\n return allpha.filter((item, index)=> index <= 19)\n}", "function getMovieInfo(movieTitle) {\n\n // Runs a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?apikey=8b309cfb&t=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful...\n if (!error && response.statusCode === 200) {\n\n // Parses the body of the site and recovers movie info\n var movie = JSON.parse(body);\n\n // Prints out movie info\n logOutput(\"Movie Title: \" + movie.Title);\n logOutput(\"Release Year: \" + movie.Year);\n logOutput(\"IMDB Rating: \" + movie.imdbRating);\n logOutput(\"Country Produced In: \" + movie.Country);\n logOutput(\"Language: \" + movie.Language);\n logOutput(\"Plot: \" + movie.Plot);\n logOutput(\"Actors: \" + movie.Actors);\n logOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n logOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n }\n });\n}", "function orderAlphabetically(movies) {\n var moviesSorted = movies.sort(function(itemA, itemB) {\n if (itemA.title < itemB.title) {\n return -5;\n } else {\n return 10;\n }\n });\n var moviesFirst20 = [];\n for (var i = 0; i < 20; i += 1) {\n moviesFirst20.push(moviesSorted[i].title);\n }\n return moviesFirst20;\n}", "function orderAlphabetically(arr) {\n var newArray = arr.map(function(movie) {\n return movie.title;\n });\n return newArray.sort().slice(0, 20);\n}", "function getActors(title){\n return getMovie(title).then((movie)=> movie.Actors.split(' ') )\n .then (value=> value.filter((element, index) => {\n return index % 2 === 0;\n })).then(value => console.log(value))\n }", "function orderAlphabetically(movies) {\n return movies.sort(function(movie1, movie2) {\n return movie1.title.localeCompare(movie2.title);\n })\n .slice(0, 20)\n .map(function(movie) {\n return movie.title;\n });\n}", "function movieInfo(movieURL) {\r\n request(movieURL, function(err, response, body) {\r\n if (!err && response.statusCode == 200) {\r\n //convert body to string\r\n body = JSON.parse(body);\r\n console.log(\"\\n\".red);\r\n console.log(\"Title: \".blue + body.Title.red);\r\n console.log(\"Year: \".blue + body.Year.red);\r\n console.log(\"Rating: \".blue + body.Rated.red);\r\n console.log(\"Country: \".blue + body.Country.red);\r\n console.log(\"Language: \".blue + body.Language.red);\r\n console.log(\"Plot: \".blue + body.Plot.red);\r\n console.log(\"Cast: \".blue + body.Actors.red);\r\n console.log(\"Rotten Tomatoes Rating: \".blue + body.tomatoRating.red);\r\n console.log(\"Rotten Tomatoes URL: \".blue + body.tomatoURL.red);\r\n console.log(\"\\n\");\r\n } else {\r\n log(\"error.txt\", command + \" Error: \" + err);\r\n return;\r\n };\r\n });\r\n}", "function capTheArray() {\n for (var i = 0; i < movies.length; i++) {\n var titleWords = movies[i][0].split(' ');\n for (var j = 0; j < titleWords.length; j++) {\n var noCap = ['of', 'the', 'and', 'for', 'in', 'to'];\n if (j !== 0 && noCap.indexOf(titleWords[j]) > -1) {\n continue;\n }\n\n titleWords[j] = capitalize(titleWords[j]);\n }\n\n titleWords = titleWords.join(' ');\n movies[i][0] = titleWords;\n }\n}", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }" ]
[ "0.7261508", "0.7164864", "0.7103881", "0.6788674", "0.6521904", "0.64626354", "0.6450115", "0.6406812", "0.6204474", "0.6188783", "0.61534667", "0.60790044", "0.60475785", "0.60442215", "0.6035112", "0.6032532", "0.6011006", "0.6006025", "0.60040724", "0.5980247", "0.5977029", "0.5972709", "0.5968703", "0.5963021", "0.59486", "0.593085", "0.59265697", "0.5923308", "0.5923117", "0.59206814", "0.5912311", "0.5907645", "0.5900358", "0.58994925", "0.58933026", "0.58893275", "0.58865684", "0.5884996", "0.58835196", "0.5872976", "0.5865561", "0.5861072", "0.58532244", "0.5844706", "0.584455", "0.58290964", "0.5825294", "0.5824077", "0.5800817", "0.5788698", "0.5788214", "0.5785804", "0.57823896", "0.57819873", "0.5772235", "0.5766571", "0.576636", "0.5749372", "0.57492054", "0.57436633", "0.57371825", "0.5736672", "0.5734269", "0.57302266", "0.57226723", "0.5713671", "0.5710779", "0.5706314", "0.5705604", "0.5703612", "0.5697561", "0.5693866", "0.5693738", "0.5686443", "0.56833464", "0.567543", "0.56584895", "0.565831", "0.56522155", "0.56503457", "0.56471455", "0.56423026", "0.5634856", "0.5631125", "0.56231797", "0.5608592", "0.56076074", "0.56066406", "0.5596107", "0.5594693", "0.55913234", "0.5581604", "0.55743915", "0.55733746", "0.5562652", "0.55601996", "0.5555562", "0.55517673", "0.5546127", "0.5541681" ]
0.58696437
40
Method to Cycle and Click Through Each Individual Movie Page
clickThrough() { let movie = browser.elements('.datalayer-movie.ng-binding'); movie.value.forEach(function (element) { element.click() browser.back(); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\r\n var movie_title_orig = $('[class^=OriginalTitle__OriginalTitleText]').text().trim().replace(\"Original title: \", \"\");\r\n // reference\r\n if (movie_title_orig === \"\" && $('h3[itemprop=\"name\"]').length) {\r\n movie_title_orig = $.trim($($('h3[itemprop=\"name\"]')[0].nextSibling).text());\r\n }\r\n // not found\r\n if (movie_title_orig === \"\") {\r\n movie_title_orig = movie_title;\r\n }\r\n\r\n var movie_id = document.URL.match(/\\/tt([0-9]+)\\//)[1].trim('tt');\r\n var is_tv = Boolean($('title').text().match('TV Series'));\r\n // newLayout || reference : check if 'title' has just a year in brackets, eg. \"(2009)\"\r\n var is_movie = (Boolean($('[class^=TitleBlock__TitleMetaDataContainer]').text().match('TV')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \\(([0-9]*)\\)/));\r\n // newLayout || reference\r\n if (Boolean($('[class^=GenresAndPlot__Genre]').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {\r\n is_tv = false;\r\n is_movie = false;\r\n }\r\n\r\n // Start of External ratings code\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n externalRatings(movie_id, movie_title, movie_title_orig);\r\n }\r\n // Call to iconSorterCount() for the icons/sites sorting.\r\n iconSorterCount(is_tv, is_movie);\r\n\r\n // Create areas to put links in\r\n addIconBar(movie_id, movie_title, movie_title_orig);\r\n perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);\r\n if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaSecond();\r\n } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && !GM_config.get('switch_bars')) {\r\n getLinkAreaSecond();\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && GM_config.get('switch_bars')) {\r\n getLinkAreaThird();\r\n getLinkAreaSecond();\r\n }\r\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "function youtubeclick(){\n $(\".right_box.movie a\").click(function(e){\n var _youtubeurl=$(this).attr(\"href\");\n var _string=_youtubeurl.substr(32,42);//get youtube id\n var _youtubehref=\"https://www.youtube.com/embed/\"+_string+\"?rel=0\";\n $(\".video-container iframe\").attr(\"src\",_youtubehref);\n $(this).addClass(\"clicked\").siblings().removeClass(\"clicked\");\n\n return false;\n });\n $(\".right_box.movie a\").eq(0).click();\n }", "function showMovies() {\r\n movies.forEach(function(movie) \r\n {\r\n fetch('https://www.omdbapi.com/?t=' + movie.title + '&apikey=789d41d5')\r\n .then(response => {\r\n return response.json();\r\n })\r\n .then(data =>\r\n {\r\n //creating the DOM elements for the movies to be displayed and adding attributes to give them function and styling\r\n \r\n const section = document.createElement('section');\r\n const article = document.createElement('article');\r\n const images = document.createElement('img');\r\n const imgDiv = document.createElement('div');\r\n imgDiv.setAttribute('class', 'imgDiv');\r\n\r\n images.src = data.Poster;\r\n images.alt = data.Title + 'poster';\r\n\r\n const h2 = document.createElement('h2');\r\n h2.innerHTML = data.Title;\r\n\r\n const button = document.createElement('button');\r\n button.innerHTML = 'Watch trailer';\r\n \r\n button.setAttribute('onClick', \"buttonClick(\"+movie.youtubeId+\")\");\r\n\r\n\r\n\r\n const expandDiv = document.createElement('div');\r\n expandDiv.setAttribute('class', 'description');\r\n const h3 = document.createElement('h3');\r\n const plot = document.createElement('p');\r\n const div2 = document.createElement('div');\r\n div2.setAttribute('class', 'rating');\r\n const ratingSource = document.createElement('p');\r\n const ratingValue = document.createElement('p');\r\n const age = document.createElement('p');\r\n\r\n h3.innerHTML = 'Description'\r\n plot.innerHTML = data.Plot;\r\n ratingSource.innerHTML = data.Ratings[0].Source;\r\n ratingValue.innerHTML = data.Ratings[0].Value;\r\n \r\n // Calculate the age of the movie using current date and the movies release date\r\n let today = new Date();\r\n let currentYear = today.getFullYear();\r\n\r\n age.innerHTML = currentYear - data.Year + \" years old\";\r\n \r\n // Creating DOM elements for the movie trailer\r\n const videoDiv = document.createElement('div');\r\n videoDiv.setAttribute('class', 'videoModal')\r\n const video = document.createElement('iframe');\r\n video.src = youtube.generateEmbedUrl(movie.youtubeId);\r\n videoDiv.setAttribute('class','videoModal');\r\n videoDiv.setAttribute('id',movie.youtubeId);\r\n\r\n // Append elements to the body\r\n section.appendChild(article);\r\n article.appendChild(imgDiv);\r\n imgDiv.appendChild(images);\r\n article.appendChild(h2);\r\n article.appendChild(button);\r\n article.appendChild(expandDiv);\r\n expandDiv.appendChild(h3);\r\n expandDiv.appendChild(plot);\r\n expandDiv.appendChild(div2);\r\n div2.appendChild(ratingSource);\r\n div2.appendChild(ratingValue);\r\n expandDiv.appendChild(age);\r\n article.appendChild(videoDiv);\r\n videoDiv.appendChild(video);\r\n\r\n document.getElementById('body').appendChild(section);\r\n })\r\n \r\n }\r\n \r\n ) \r\n}", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link to go to the indiviual title page\n\t\t$(items[i]).attr(\"href\", \"title/title.php?id=\" + object.id + \"&type=movie\");\n\n\t\t// Apply imdb poster image\n\t\tapplyImdbThumbnail(items[i].children[0].children[0].children[0], false, object.id);\n\t}\n}", "function nextMovie(){\n removeMoviesAction();\n }", "function displayMovies(){\n \n\n allMovies.forEach(movie => {\n\n function func() {\n movieRental.transferMovie(movie.title);\n refreshMovies();\n }\n\n \n let movieDiv = Html.createDivElement({class:'singleMovie'});\n movieDiv.style.backgroundColor = '#'+ Math.floor(Math.random()*16777215).toString(16);\n\n\n let movieImgDiv = Html.createDivElement({class: 'movieImgDiv'})\n let clickMeText = Html.createHeading({text:'Double Click to Rent',size:5});\n\n let header = Html.createHeading({text:movie.title, size:2});\n let releaseDate = Html.createHeading({text:movie.release.toString(),size:4});\n let img = Html.createImageElement({className: 'imgClass', width:100, height:200, src:movie.img, alt:'no image',click:func});\n let link = Html.createLinkElement({text: movie.title, href: movie.imbd});\n \n document.body.appendChild(movieDiv);\n\n movieDiv.appendChild(header);\n \n \n movieDiv.appendChild(releaseDate);\n movieDiv.appendChild(movieImgDiv);\n movieImgDiv.appendChild(img);\n movieImgDiv.appendChild(clickMeText);\n movieDiv.appendChild(link);\n\n if(movie.available >0){\n document.getElementById('availableDiv').appendChild(movieDiv);\n }\n else if(movie.available === 0){\n document.getElementById('rentedDiv').appendChild(movieDiv);\n \n }\n\n });\n \n}", "loadNextPage() {\n this.page = this.page + 1;\n MovieService.filterMovies(this.props.keywords, this.props.genresId, this.page, true);\n }", "function getMovieDetails(e){\n e.preventDefault();\n if(e.target.classList.contains('info-btn')){\n let movieItem = e.target.parentElement.parentElement;\n fetch(`https://www.omdbapi.com/?apikey=${apiKey}&i=${movieItem.dataset.id}`)\n .then((response)=>response.json())\n .then((data)=>{\n console.log(data);\n let output = `\n <div class=\"logo-img\">\n <img src=\"${data.Poster}\" alt=\"\">\n </div>\n\n <div class=\"Titles\">\n <h1 class=\"movie-title\">${data.Title}</h1>\n <h3 class=\"movie-category\"><strong>CATEGORY -</strong> ${data.Type}</h3>\n </div>\n\n <div class=\"details\">\n <h2>Details:</h2>\n <ul>\n <li><strong>Genre -</strong> ${data.Genre}</li>\n <li><strong>Released -</strong> ${data.Released}</li>\n <li><strong>Actors -</strong> ${data.Actors}</li>\n <li><strong>Director</strong> ${data.Director}</li>\n <li><strong>Language</strong> ${data.Language}</li>\n <li><strong>Ratings</strong> ${data.imdbRating}</li>\n <li><strong>Language</strong> ${data.Language}</li> \n <li><strong>Box Office</strong> ${data.BoxOffice}</li> \n </ul>\n </div> \n <div class=\"link\"> \n <a href=\"https://imdb.com/title/${data.imdbID}\" target=\"_blank\">get imdb</a>\n </div>\n `;\n movieDetailsContent.innerHTML = output;\n movieDetailsContent.parentElement.classList.add('showMovies')\n\n })\n }\n \n}", "function showMovieDetails(movie)\n{\n movieTitle.html(movie.title);\n movieDesc.html(movie.description);\n moviePoster.attr(\"src\", movie.posterImage.attr(\"src\"));\n movieView.on(\"click\", function() {\n window.location.href = \"/movie.html?imdb=\" + movie.imdb;\n });\n\n // Show info to user\n movieDetails.modal(\"show\");\n}", "selectedMovie(movie) {\n // Display selected movie\n this.displaySingleMovie(movie)\n }", "function renderSingleMoviePage(details) {\n\t\tvar page = $('.single-movie');\n\t\tvar container = $('.preview-large');\n\n\t\t// Show the page.\n\t\tpage.addClass('visible');\n\t}", "function nextMovie() {\n if (index === movies.length - 1) {\n index = 0;\n } else {\n index++;\n }\n\n removeData();\n showData(index);\n}", "function getMovies(query) {\n $.getJSON(\n `${movieApi.base}?s=${query}&apikey=${movieApi.key}`\n ) /* .getJSON method retrieves data from an external api */\n .then(function (response) {\n if (response.Response === \"True\") {\n let movies =\n response.Search; /* the api is stored in arrays, here a new var is created to select the particular array needed */\n let output = \"\";\n /* for each of the responses in JSON output html to the webpage */\n $.each(movies, function (index, movie) {\n output += `\n <div class=\"col-sm-6 col-md-4 col-lg-3\">\n <div class=\"search-card text-center\">\n <img src=\"${movie.Poster}\"/> \n <h4 class=\"white\" >${movie.Title}</h4>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"details-button hvr-shutter-out-horizontal red\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal\">Movie Details</a>\n </div>\n </div>\n `;\n });\n\n /* outputs the html to the div with #movies-to-collapse */\n $(\"#movies-to-collapse\").html(output);\n\n $(\".collapse-button-m\").show();\n } else {\n alert(\"Movie not found! Please enter a valid movie title or word.\")\n }\n\n })\n}", "function displayMovies(movies) {\n console.log(movies);\n for (let i=0; i < movies.length; i++) {\n const movieId = cleanTitle(movies[i]);\n fetch(`https://imdb8.p.rapidapi.com/title/get-plots?tconst=${movieId}`, {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t\"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": rapidApiKey\n\t }\n })\n .then(resp => resp.json())\n .then(addMoviesHMTL)\n // when the last movie is added to the html shows the \"get movie recommendations\" button\n .then(() => {\n if (i+1 === movies.length) {\n recomButtton.style.display = 'block';\n }\n })\n }\n // function to clean the title info to fetch the api\n function cleanTitle(stringT) {\n let begins = stringT.indexOf('/', 1) + 1;\n let title = stringT.slice(begins, stringT.length - 1);\n return title;\n }\n}", "function getMovies(searchText) {\n $.get(\n baseURL + searchName + searchText + \"&type=movie\",\n (respuesta, estado) => {\n if (estado === \"success\") {\n let movies = respuesta.Search;\n let output = \"\";\n $.each(movies, (i, movie) => {\n output += `\n <div class=\"col-md-3\">\n <div class=\"well text-center\">\n <img class=\"imgSearch\" src=\"${movie.Poster}\">\n <h5>${movie.Title}</h5>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"btn btn-info\" href=\"#\">Mas info</a>\n </div>\n </div>\n \n `;\n });\n\n result.html(output);\n }\n }\n );\n}", "loadMore(){\n this.getMoviePage();\n }", "loadNextPage() {\n this.data.page = this.data.page + 1;\n this.fetchMovies();\n }", "function movieList() {\r\n for (let i = 0; i < movieInfo.length; i++) {\r\n //Generate list for nowshowing movies\r\n if (movieInfo[i].type == \"now\") {\r\n document.getElementById(\"nowVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n\r\n //Generate list for upcoming movies\r\n if (movieInfo[i].type == \"upcoming\") {\r\n document.getElementById(\"upcomingVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n }\r\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function romanticMovies() {\n fetch('http://localhost:8000/api/v1/titles/?sort_by=-imdb_score&genre=romance&page_size=10&page=1')\n .then(res => res.json())\n .then(res => res.results)\n .then(function(value) {\n for (let i = 0; i < value.length; i++) {\n let movie = value[i].image_url;\n let name = value[i].id;\n let movie_url = value[i].url;\n let elt = document.getElementById(\"carousel_romance\");\n let elt_item = document.createElement('div');\n elt_item.setAttribute('class', 'casourel_item');\n elt.appendChild(elt_item);\n let div = document.createElement('div');\n div.setAttribute('id', name);\n div.innerHTML = `<img src= ${movie} alt='casourel'></img>`;\n elt_item.appendChild(div);\n let img = document.getElementById(`${name}`);\n img.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(movie_url);\n }\n }\n });\n}", "function hrefMenu() {\n const href = window.location.href;\n const tabs = document.querySelectorAll(\".dishes-tab\");\n let idList = [], k = 0;\n if (tabs.length != 0) {\n for (let index = 0; index < tabs.length; index++) {\n const element = tabs[index];\n idList.push(element.id);\n }\n for (let index = 0; index < idList.length; index++) {\n const element = idList[index];\n const lenghtElement = \"-\" + element.length;\n if (element == href.slice(lenghtElement)) {\n document.querySelectorAll('.tab-title')[index].click();\n k = k + 1; \n }\n }\n /*if (k == 0) {\n const menuSecond = tabs[1].querySelector(\".tab-title\");\n //console.log(menuSecond);\n setTimeout(() => {\n menuSecond.click();\n }, 500); \n }*/\n }\n hrefWine();\n}", "function openNav(movie) {\r\n let id = movie.id;\r\n fetch(BASE_URL + '/tv/'+id+'/videos?'+API_KEY).then(res => res.json()).then(videoData => {\r\n console.log(videoData);\r\n if(videoData){\r\n document.getElementById(\"myNav\").style.width = \"100%\";\r\n if(videoData.results.length > 0){\r\n var embed = [];\r\n var dots = [];\r\n \r\n var content = `\r\n <h1 class=\"no-results\">${tv.name}</h1>\r\n <br/>\r\n \r\n ${embed.join('')}\r\n <br/>\r\n <div class=\"dots\">${dots.join('')}</div>\r\n \r\n `\r\n overlayContent.innerHTML = content;\r\n activeSlide=0;\r\n showVideos();\r\n }else{\r\n overlayContent.innerHTML = `<h1 class=\"no-results\">No Results Found</h1>`\r\n }\r\n }\r\n })\r\n}", "function cargarPeliculas(){\n movies.movies.forEach(movie => { \n cargarElementosAlHtml(movie);\n });\n}", "function twoThousandMovies() {\n fetch('http://localhost:8000/api/v1/titles/?year=2000&sort_by=-imdb_score&page_size=10&page=1')\n .then(res => res.json())\n .then(res => res.results)\n .then(function(value) {\n for (let i = 0; i < value.length; i++) {\n let movie = value[i].image_url;\n let name = value[i].id;\n let movie_url = value[i].url;\n //console.log(movie);\n elt_item = document.createElement('div');\n let elt = document.getElementById(\"carousel_two_thousand\");\n elt_item.setAttribute('class', 'casourel_item');\n elt.appendChild(elt_item);\n let div = document.createElement('div');\n div.setAttribute('id', name);\n div.innerHTML = `<img src= ${movie} alt='casourel'></img>`;\n elt_item.appendChild(div);\n let img = document.getElementById(`${name}`);\n img.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(movie_url);\n }\n\n }\n });\n}", "function genreSearch(genreID) {\n var requestUrlGenre = \"https://api.themoviedb.org/3/discover/movie?api_key=\" + apiKey + \"&language=en-US&sort_by=popularity.desc&with_genres=\" + genreID + \"&page=\" + pageNum\n\n\n console.log(genreID)\n console.log(requestUrlGenre)\n\n fetch(requestUrlGenre)\n .then(function (response) {\n return response.json();\n })\n .then(function (genreMovies) {\n console.log(genreMovies)\n mainpage.innerHTML = \"\"\n\n var chooseMovie = document.createElement(\"h2\")\n chooseMovie.textContent = \"Choose a movie:\"\n mainpage.append(chooseMovie)\n\n var movieButtonContainer = document.createElement(\"div\")\n mainpage.append(movieButtonContainer)\n movieButtonContainer.classList.add(\"button-container\")\n\n //for loop to append 5 first movies\n\n var genreMoviesData = genreMovies.results\n\n for (var i = 0; i < genreMoviesData.length; i++) {\n //create button with movie title names\n var movieTitleBtn = document.createElement(\"button\")\n movieTitleBtn.textContent = genreMovies.results[i].title\n movieTitleBtn.classList.add(\"button\", \"movie-title-button\")\n var btnID = genreMovies.results[i].id\n movieTitleBtn.setAttribute(\"data-id\", btnID)\n movieButtonContainer.append(movieTitleBtn)\n\n // console.log(btnID)\n\n var movieID = movieTitleBtn.getAttribute(\"data-id\")\n function buttonByID(movieID) {\n movieTitleBtn.addEventListener(\"click\", function () {\n fetchMovieDetails(movieID);\n })\n }\n buttonByID(movieID);\n }\n if (pageNum > 1) {\n prevPageGenre(genreID);\n }\n\n nextPageGenre(genreID);\n })\n}", "function displayMovies(movies) {\n movieInformation.innerHTML = \"\"\n let searchedMovies = globalMovieArray[0].Search;\n for (i = 0; i < searchedMovies.length; i++) {\n //Div for listed movie and button\n const liAndButtonDiv = document.createElement('div')\n liAndButtonDiv.classList.add('liAndButtonDiv')\n //Create li element for search result\n const movieTitleListed = document.createElement('li');\n movieTitleListed.classList.add = ('clear')\n const movieTitle = document.createTextNode(`${movies.Search[i].Title}`)\n\n movieTitleListed.appendChild(movieTitle);\n liAndButtonDiv.appendChild(movieTitleListed);\n movieInformation.appendChild(liAndButtonDiv);\n\n buttonForMoreInformation(movies.Search[i].imdbID, liAndButtonDiv)\n spinner.style.display = \"none\";\n\n }\n}", "function main() {\r\n jQ('.vbseo_like_link').each(function(){\r\n\t\tif((jQ(this).parent().parent().parent().css(\"opacity\") > 0.5) && (jQ(this).children().hasClass('hwz-unlike-button') == false))\r\n\t\t\tthis.click();\r\n });\r\n\tvar nextButton = jQ('#content ul a:contains(\"Next ›\")');\r\n\tif(nextButton.length > 0) {\r\n\t\tconsole.log(\"Found next button and attempting to click.\");\r\n\t\tnextButton[0].click();\r\n\t}\r\n}", "function topMovies() {\n tmdb.call('/movie/top_rated', {},\n function(e) {\n var info = document.getElementById('info');\n info.innerHTML = '';\n var results = Object.keys(e.results);\n console.log(\"Success: \" + e);\n console.log(e.results);\n for (var i = 0; i < e.results.length; i++) {\n console.log(JSON.stringify(e.results[i]));\n var info = document.getElementById('info')\n var show = document.createElement('div');\n show.id = i;\n var json = e.results[i];\n var poster = tmdb.images_uri + tmdb.size + e.results[i].poster_path;\n var name = e.results[i].title;\n var img = new Image();\n img.src = poster;\n info.appendChild(show);\n show.appendChild(img);\n if (img.src === 'http://image.tmdb.org/t/p/w500null') {\n img.src = 'http://colouringbook.org/SVG/2011/COLOURINGBOOK.ORG/cartoon_tv_black_white_line_art_scalable_vector_graphics_svg_inkscape_adobe_illustrator_clip_art_clipart_coloring_book_colouring-1331px.png';\n }\n show.innerHTML += '<p>' + name + '</p>';\n\n function click() {\n var display = document.getElementById('display');\n display.innerHTML = '';\n //img.src = '';\n var i = this.id;\n console.log(i);\n var displayPoster = tmdb.images_uri + tmdb.size + e.results[i].poster_path;\n img.src = displayPoster;\n if (img.src === 'http://image.tmdb.org/t/p/w500null') {\n img.src = 'http://colouringbook.org/SVG/2011/COLOURINGBOOK.ORG/cartoon_tv_black_white_line_art_scalable_vector_graphics_svg_inkscape_adobe_illustrator_clip_art_clipart_coloring_book_colouring-1331px.png';\n }\n display.appendChild(img);\n display.innerHTML += '<p>Air date: ' + e.results[i].release_date + '</p>';\n display.innerHTML += '<p>Name: ' + e.results[i].title + '</p>';\n display.innerHTML += '<p>Description: ' + e.results[i].overview + '</p>';\n\n };\n show.addEventListener('click', click, false);\n };\n },\n function(e) {\n console.log(\"Error: \" + e)\n }\n )\n\n function topMovies() {\n tmdb.call('/movie/top_rated', {},\n function(e) {\n var info = document.getElementById('info');\n info.innerHTML = '';\n var results = Object.keys(e.results);\n console.log(\"Success: \" + e);\n console.log(e.results);\n for (var i = 0; i < e.results.length; i++) {\n console.log(JSON.stringify(e.results[i]));\n var show = document.createElement('div');\n show.id = i;\n var json = e.results[i];\n var poster = tmdb.images_uri + tmdb.size + e.results[i].poster_path;\n var name = e.results[i].title;\n var img = new Image();\n img.src = poster;\n info.appendChild(show);\n show.appendChild(img);\n if (img.src === 'http://image.tmdb.org/t/p/w500null') {\n img.src = 'http://colouringbook.org/SVG/2011/COLOURINGBOOK.ORG/cartoon_tv_black_white_line_art_scalable_vector_graphics_svg_inkscape_adobe_illustrator_clip_art_clipart_coloring_book_colouring-1331px.png';\n }\n show.innerHTML += '<p>' + name + '</p>';\n\n function click() {\n var display = document.getElementById('display');\n display.innerHTML = '';\n //img.src = '';\n var i = this.id;\n console.log(i);\n var displayPoster = tmdb.images_uri + tmdb.size + e.results[i].poster_path;\n img.src = displayPoster;\n if (img.src === 'http://image.tmdb.org/t/p/w500null') {\n img.src = 'http://colouringbook.org/SVG/2011/COLOURINGBOOK.ORG/cartoon_tv_black_white_line_art_scalable_vector_graphics_svg_inkscape_adobe_illustrator_clip_art_clipart_coloring_book_colouring-1331px.png';\n }\n display.appendChild(img);\n display.innerHTML += '<p>Air date: ' + e.results[i].release_date + '</p>';\n display.innerHTML += '<p>Name: ' + e.results[i].title + '</p>';\n display.innerHTML += '<p>Description: ' + e.results[i].overview + '</p>';\n\n };\n show.addEventListener('click', click, false);\n };\n },\n function(e) {\n console.log(\"Error: \" + e)\n })\n }\n}", "function bradMovies() {\n fetch('http://localhost:8000/api/v1/titles/?sort_by=-imdb_score&actor_contains=Brad+Pitt&&page_size=10&page=1')\n .then(res => res.json())\n .then(res => res.results)\n .then(function(value) {\n for (let i = 0; i < value.length; i++) {\n let movie = value[i].image_url;\n let name = value[i].id;\n let movie_url = value[i].url;\n //console.log(movie);\n elt_item = document.createElement('div');\n let elt = document.getElementById(\"carousel_brad\");\n elt_item.setAttribute('class', 'casourel_item');\n elt.appendChild(elt_item);\n let div = document.createElement('div');\n div.setAttribute('id', name);\n div.innerHTML = `<img src= ${movie} alt='casourel'></img>`;\n elt_item.appendChild(div);\n let img = document.getElementById(`${name}`);\n img.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(movie_url);\n }\n }\n });\n}", "function goToScene(scene) {\n\t$(\".scene[data-scene=\"+scene+\"]\").click();\n}", "function stagePageOnClick() {\r\n let stages = document.querySelectorAll('.header.stages .stage.done');\r\n stages.forEach(function(item) {\r\n item.addEventListener('click', function() {\r\n window.location.href = item.getAttribute('data-stage') + '.html';\r\n });\r\n })\r\n}", "clickNewsVideoTab(){\n this.newsVideoTab.waitForExist();\n this.newsVideoTab.click();\n }", "displayRelatedMovie(movies) {\n // It create all html element with movie data\n this.createRelatedMovie(movies)\n }", "function selectNextActivitiesAndParties(command, method) {\n\tvar Url = L5.webPath + \"/jsp/workflow/help/selectnextactivitiesandparties.jsp?assignmentId=\"\n\t+ getProcessInfoFromContext(\"assignmentId\");\n\tUIFrame(command, method, Url, \"Next\");\n}", "function perform(elem, movie_id, movie_title, movie_title_orig, is_tv, is_movie, movie_year, scout_tick) {\r\n var site_shown = false;\r\n $.each(sites, async function(index, site) {\r\n if (site['show']) {\r\n site_shown = true;\r\n // For TV Series show only TV links. TV Special, TV Movie, Episode & Documentary are treated as TV and Movie.\r\n if ((Boolean(site['TV']) == is_tv || Boolean(site['both'])) || (!is_tv && !is_movie) || getPageSetting('ignore_type')) {\r\n var searchUrl = await replaceSearchUrlParams(site, movie_id, movie_title, movie_title_orig, movie_year, true);\r\n if ('goToUrl' in site && getPageSetting('call_http_mod')) {\r\n maybeAddLink(elem, site['name'], searchUrl, site, scout_tick, movie_id, movie_title, movie_title_orig, movie_year);\r\n }\r\n if ('goToUrl' in site && !getPageSetting('call_http_mod')) {\r\n searchUrl = await replaceSearchUrlParams({'searchUrl': site['goToUrl'], 'spaceEncode': ('spaceEncode' in site) ? site['spaceEncode'] : '+'}, movie_id, movie_title, movie_title_orig, movie_year);\r\n addLink(elem, site['name'], searchUrl, site, 'found', scout_tick);\r\n }\r\n if (!('goToUrl' in site) && getPageSetting('call_http_mod')) {\r\n maybeAddLink(elem, site['name'], searchUrl, site, scout_tick, movie_id, movie_title, movie_title_orig, movie_year);\r\n }\r\n if (!('goToUrl' in site) && !getPageSetting('call_http_mod')){\r\n addLink(elem, site['name'], searchUrl, site, 'found', scout_tick);\r\n }\r\n }\r\n }\r\n });\r\n\r\n if (!site_shown) {\r\n $(elem).append(\"<pre>No sites enabled!\\nScript's settings can be found in your Monkey's shortcut.\\nFor now you can press this temporary button:\");\r\n var p = $('<p />').attr('id', 'imdbscout_settings_button');\r\n p.append($('<button>Load Settings</button>').css({'cursor':'pointer', 'background-color':'#F5C518', 'color':'blue', 'font-weight':'bold'}).click(function() {\r\n GM_config.open();\r\n $('#imdbscout_settings_button').remove();\r\n }));\r\n $(elem).append(p);\r\n }\r\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "click_Homescreen_TVShows(){\n this.Homescreen_TVShows.waitForExist();\n this.Homescreen_TVShows.click();\n }", "async function populateMovies(contador, limite, endpoint) {\n const movies = document.querySelector('.movies')\n\n const moviesObjectsArray = await (await fetch(endpoint)).json()\n\n for (let i = contador; i < limite; i++) {\n const movie = moviesObjectsArray.results[i]\n const movie_div = document.createElement('div')\n\n movie_div.classList.add('movie')\n // movie_div.setAttribute(id, movie.belongs_to_collection.id)\n movie_div.style.backgroundImage = `url('${movie.poster_path}')`\n movie_div.style.backgroundSize = '100%'\n movie_div.style.backgroundRepeat = 'no-repeat'\n\n movie_div.addEventListener('click', () => {\n const modal_div = document.querySelector('.modal_div')\n\n modal_div.classList.remove('hidden')\n\n populateModal(movie.id)\n })\n\n const info = document.createElement('div')\n info.classList.add('movie__info')\n info.classList.add('flex-row,justify-between')\n\n const title = document.createElement('span')\n title.classList.add('movie__title')\n title.innerText = movie.title\n\n const rating = document.createElement('span')\n rating.classList.add('movie__rating')\n rating.innerText = movie.vote_average\n\n const img = document.createElement('img')\n img.src = './assets/estrela.svg'\n\n movie_div.append(info)\n info.append(title, rating)\n rating.append(img)\n\n movies.append(movie_div)\n }\n page++\n}", "function page1ex6() {\n // Managing an array of movies:\n // Write the following functions:\n // • findMovie(imdb) that return a movie, use it to output a link to that\n // movie (something like: https://www.imdb.com/title/tt0073052/ )\n // • findMovieIdxByImdb() that returns the movie's index, use it to splice\n // it out of the array\n\n var gMovies = [\n { imdb: 'tt0373889', name: 'Harry Potter' },\n { imdb: 'tt0000004', name: 'Un bon bock' },\n { imdb: 'tt0000003', name: 'Pauvre Pierrot' }\n ];\n\n console.log(\"IMDB: 'tt0373889' ==>\", findMovie('tt0373889'));\n console.log(\"IMDB: 'tt0373889' Idx:\", findMovieIdxByImdb('tt0373889'));\n\n function findMovie(imdb) {\n var selectedMovie = gMovies.find(function(movie) {\n return movie.imdb === imdb;\n });\n var link = `https://www.imdb.com/title/${selectedMovie.imdb}/`;\n return link;\n }\n\n function findMovieIdxByImdb(imdb) {\n var selectedMovieIdx = gMovies.findIndex(function(movie) {\n return movie.imdb === imdb;\n });\n return selectedMovieIdx;\n }\n}", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "function displayMovie(data) {\n\n let movies = data.results;\n let output = ''\n\n $.each(movies, function(index, movie) {\n\n output += `\n\n <div class=\"col-md-4\">\n <div class=\"well text-center\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" onError=\"this.onerror=null;this.src='img/nopic.png';\">\n <h5>${movie.title}</h5>\n <div onclick=\"movieSelected('${movie.id}')\" class=\"btn btn-primary\" id=\"buttonIndex\" href=\"#\">Movie Details</div>\n </div>\n </div>\n `;\n });\n\n $('#movies').html(output);\n\n if (movies == 0) {\n window.alert('ERROR: PLEASE INSERT A CORRECT MOVIE NAME');\n }\n}", "function renderMoviesPage(data) {\n\n\t\tvar page = $('.in-theaters');\n\t\tvar allmovies = $('.in-theaters .movies-list > li');\n\n\t\t// Hide all the movies in the movies list.\n\t\tallmovies.addClass('hidden');\n\n\t\t// Iterate over all of the movies.\n\t\t// If their ID is somewhere in the data object remove the hidden class to reveal them.\n\t\tallmovies.each(function () {\n\n\t\t\tvar that = $(this);\n\n\t\t\tdata.forEach(function (item) {\n\t\t\t\tif(that.data('index') == item.id){\n\t\t\t\t\tthat.removeClass('hidden');\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\n\t\t// Show the page itself.\n\t\t// (the render function hides all pages so we need to show the one we want).\n\t\tpage.addClass('visible');\n\n\t}", "function listMovies() {\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n for (let movie of data) {\n console.log(movie, \"movie\");\n createMovieBox(movie);\n }\n });\n}", "function changePages(event)\n{\n if (i + 1 < storyParts.length && event.key == \"ArrowRight\"){\n storyParts[i].style.display = \"none\";\n i++;\n window.scrollTo(0, 0);\n storyParts[i].style.display = \"block\";\n if (i + 1 == storyParts.length)\n {\n nextButton.style.display = \"none\";\n }\n else\n {\n nextButton.style.display = \"block\";\n prevButton.style.display = \"block\";\n }\n }\n if (i >= 1 && event.key == \"ArrowLeft\"){\n storyParts[i].style.display = \"none\";\n i--;\n window.scrollTo(0, 0);\n storyParts[i].style.display = \"block\";\n if (i == 0)\n {\n prevButton.style.display = \"none\";\n }\n else\n {\n nextButton.style.display = \"block\";\n prevButton.style.display = \"block\";\n }\n }\n}", "function bestMovieRecorded() {\n fetch('http://localhost:8000/api/v1/titles/?sort_by=-imdb_score&page_size=10&page=1')\n .then(res => res.json())\n .then(res => res.results)\n .then(function(value) {\n let bestMovie_url = value[0].image_url;\n let bestMovie_name = value[0].title;\n let bestMovie_url_des = value[0].url;\n let bestMovie_des = \"\";\n fetch(bestMovie_url_des)\n .then((res) => res.json())\n .then((res) => {\n bestMovie_des = res.description;\n document\n .getElementById(\"video_centrale\")\n .innerHTML = `\n <div><img src= ${bestMovie_url} alt='video centrale'></img></div>\n <div><H3>${bestMovie_name}</H3>\n <p>${bestMovie_des}</p>\n </div>`;\n });\n var btn = document.querySelector(\"#best_movie\");\n btn.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(bestMovie_url_des);\n }\n for (let i = 1; i < value.length; i++) {\n let movie = value[i].image_url;\n let name = value[i].id;\n let movie_url = value[i].url;\n //console.log(movie);\n let elt = document.getElementById(\"carousel_best_movies\");\n let elt_item = document.createElement('div');\n elt_item.setAttribute('class', 'casourel_item');\n elt.appendChild(elt_item);\n let div = document.createElement('div');\n div.setAttribute('id', name);\n div.innerHTML = `<img src= ${movie} alt='img_casourel'></img>`;\n elt_item.appendChild(div);\n let img = document.getElementById(`${name}`);\n img.onclick = function() {\n myModal.style.display = \"block\";\n getMovieData(movie_url);\n }\n\n }\n });\n}", "function next(e) {\n const parentDiv = e.target.parentNode;\n const moviePosters = getMoviesPostersFromNode(parentDiv);\n\n let firstVisible = null;\n let previousHidden = true;\n for (let i = 0; i < moviePosters.length; i++) {\n const currentPoster = moviePosters[i];\n\n if (currentPoster.hidden === false && firstVisible === null) {\n firstVisible = currentPoster;\n }\n\n if (\n currentPoster.hidden === true &&\n previousHidden === false &&\n firstVisible !== null\n ) {\n firstVisible.hidden = true;\n currentPoster.hidden = false;\n break;\n }\n\n previousHidden = currentPoster.hidden;\n }\n}", "async function moreclick() {\n var url;\n\n if (type == \"day\") {\n url = \"https://api.themoviedb.org/3/trending/tv/day?api_key=1972cf9a9940de5dbf03a85062b98f06&page=\" + page;\n }\n else {\n url = \"https://api.themoviedb.org/3/trending/tv/week?api_key=1972cf9a9940de5dbf03a85062b98f06&page=\" + page;\n }\n\n page++;\n\n var data = await fetch(url);\n var dataresults = await data.json();\n console.log(page);\n\n\n appendshows(dataresults);\n\n\n\n}", "function showMoviesNewPage(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function clickedCoursePagination(){\n\t\t$(\".course_pagination .page-item a\").click(function(){\t\n\t\t\tvar clickedPage = parseInt($(this).attr(\"id\"));\n\t\t\tsearchCourses(page=clickedPage);\n\t\t});\n\t}", "function displaySelectedMovie(movieData) {\n movieSelectorContainer.style.display = \"none\";\n movieSelectedScreen.style.display = \"block\";\n\n var posterUrl = \"https://image.tmdb.org/t/p/w500\" + movieData.poster_path;\n\n var filmTitle = document.getElementById(\"film-title\");\n filmTitle.textContent = movieData.original_title;\n var posterImage = document.getElementById(\"poster\");\n posterImage.setAttribute(\"src\", posterUrl);\n var ageCertificate = document.getElementById(\"age\");\n ageCertificate.textContent = movieData.adult;\n ageCertificate.style.color = \"orange\";\n var countryLanguage = document.getElementById(\"country\");\n countryLanguage.textContent = movieData.original_language;\n countryLanguage.style.color = \"orange\";\n var yearReleased = document.getElementById(\"year-released\");\n yearReleased.textContent = movieData.release_date;\n yearReleased.style.color = \"orange\";\n var filmSynopsis = document.getElementById(\"synopsis\");\n filmSynopsis.textContent = movieData.overview;\n filmSynopsis.classList.add(\"filmSynopsis\");\n document\n .getElementById(\"back-btn\")\n .addEventListener(\"click\", function goBack() {\n window.history.back();\n });\n document.getElementById(\"save-btn\").addEventListener(\"click\", function (e) {\n e.preventDefault();\n saveFilmHistory(movieData.id);\n });\n}", "async function topMoviesPageMain()\n{\n\n\t//first I have to fetch the data\n\tvar dataSheet = await fetching();\n\n\t//since I only need the enties\n\tdataSheet = dataSheet.feed.entry;\n\n\t//convert the coma separated genre values to an array\n\tdataSheet = convertGenre(dataSheet);\n\n\t//getting the list of top movies\n\tvar topMovies = getTopMovies(dataSheet);\n\n\t//creating the movie cards\n\tcreateMovieCards(topMovies,'topList',topMovies.length);\n\n\t//setting event listener to the cards\n\tsetCards();\n\n}", "function clickSeasonCard(card) {\n Stv_id = card.getAttribute('tv-id');\n SseasonNum = card.getAttribute('seasonNum');\n\n //api call to get all episode for selected season\n let apiCall = 'https://api.themoviedb.org/3/tv/' + Stv_id + '/season/' + SseasonNum + '?api_key=8d1a5ff2a48df63d8f152f0a36a15c7c&language=en-US'\n ajaxCall(\"GET\", apiCall, \"\", getSeasonSuccessCB, getSeasonErrorCB);\n\n}", "function next_page(){\n let all_releases = document.querySelectorAll('.release-entry')\n let releases = []\n\n for (k = 0; k < all_releases.length; k++){\n if ( all_releases[k].className.localeCompare('release-entry') == 0 ){\n releases.push(all_releases[k])\n }\n }\n\n for (i = 0; i < releases.length; i++) {\n if (releases[i].getElementsByClassName('d-block mb-1').item(0)){\n tag = releases[i].getElementsByClassName('d-block mb-1')\n .item(0).innerText\n get_release(tag.slice(1), i)\n }\n }\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function otherTitlesInitializeIndexPage(){\n $('.indexPageItem').click(function () {\n var itemClicked = $(this).find(\"h4\").text()\n otherTitlesOpenPageByName(itemClicked)\n })\n}", "function tmdbSelectedMovie(id) {\n $.getJSON(\n `${trendingApi.detailsBase}movie/${id}?api_key=${trendingApi.key}&language=en-US` // accesses api data\n ).then(function (detailsResponse) {\n let movieImdb = detailsResponse.imdb_id; // stores particilar data needed within a variable\n selectedMovie(movieImdb); // performs next function, selectedMovie() on search.js page\n });\n}", "onPageClick(i){\n this.changePage(i);\n }", "function onClick(e) {\r\n // Pause the animation\r\n story.pauseAnimation();\r\n // If it is already selected resume the animation\r\n // otherwise pause and move to the selected month\r\n if (e.yValue === story.getFrameValue()) {\r\n story.startAnimation();\r\n } else {\r\n story.goToFrame(e.yValue);\r\n story.pauseAnimation();\r\n }\r\n }", "singleMovie() {\n console.log(\"singleMovie\")\n }", "function gotonextpage(upperCase){\n clickAnchor(upperCase,getItem(\"more\"));\n}", "function getmovie(){\n // Search bug\n document.getElementsByClassName(\"container\")[0].innerHTML=\"\";\n // document.getElementsByClassName(\"more-Res-btn\")[0].innerHTML=\"\";\n\n\n // Getting the movie param\n var movie_name = document.getElementById(\"search-movie\").value;\n movie_name = movie_name.replace(/\\s/g, \"+\");\n\n var apiurl = 'http://www.omdbapi.com/?apikey=6f1d90d9&s='+movie_name;\n var request = new XMLHttpRequest()\n\n // Establishing connection through XMLHttpRequest\n request.open('GET', apiurl, true)\n\n request.onload = function() {\n var data = JSON.parse(this.response)\n // console.log(data);\n\n var movie_list = data['Search'];\n len = movie_list.length;\n for(var i=0; i<len; i++){\n // console.log(movie_list[i]);\n\n // Create a div with a card class\n const card = document.createElement('div')\n if(i > 7){\n card.setAttribute('class', 'card moreRes content-hide');\n }\n else{\n card.setAttribute('class', 'card')\n }\n // Create an h1 and set the text content to the film's title\n const h1 = document.createElement('h4')\n h1.textContent = movie_list[i]['Title']\n\n const img = document.createElement('img')\n img.src = movie_list[i]['Poster']\n img.alt = movie_list[i]['Title']\n // Append the cards to the container element\n container.appendChild(card)\n\n // Each card will contain an h1 and a p\n card.appendChild(img)\n card.appendChild(h1)\n\n if(i == len-1){\n // const div1 = document.createElement('div');\n const btn = document.createElement('button');\n btn.innerHTML = \"More Results\";\n btn.setAttribute('id', 'moreResbtn')\n btn.setAttribute('onclick','moreResults()')\n btn.setAttribute('class', 'more-Res-btn')\n // div1.appendChild(btn);\n container.appendChild(btn);\n }\n\n }\n DOMload(movie_name);\n }\n\n // Send request\n request.send()\n}", "function getNowPlayingMovies() {\n\n const path = '/movie/now_playing';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Now Playing Movies'});\n\n sectionMovies(url, render, handleError);\n\n\n}", "renderSearchResults() {\n const { movieSearch } = this.props\n if (!movieSearch) { return null }\n return movieSearch.map((movie, index) => {\n // return <a href=\"#\" key={index} className=\"list-group-item list-group-item-action\">{city.cityName} <p className='small'>{city.dateCalendar} {city.dateHour}</p></a>\n return <div className=\"container py-3\" key={index}>\n <div className=\"card\">\n <div className=\"row \">\n <div className=\"col-md-4\">\n <img src={movie.Poster} />\n </div>\n <div className=\"col-md-8 px-3\">\n <div className=\"card-block px-3\">\n <h4 className=\"card-title mt-2\"> {movie.Title} </h4>\n <p className=\"card-text\"> {movie.Year} </p>\n {/* <p className=\"card-text\"> { movie.plot } </p> */}\n\n <Link to={`/movie/${movie.imdbID}`}>\n <button \n type=\"button\" \n className=\"btn btn-primary\"\n id= {movie.imdbID}\n onClick= { this.handleMovieInfo } \n >\n More Information\n </button>\n </Link>\n \n </div>\n </div>\n </div>\n </div>\n </div>;\n })\n}", "function selectNextActivitiesAndPartiesFromStartAct(command, method) {\n\tvar Url = L5.webPath + \"/jsp/workflow/help/selectnextactivitiesandpartiesfromstartact.jsp?assignmentId=\"\n\t+ getProcessInfoFromContext(\"assignmentId\") + \"&procDefUniqueId=\" + getProcessInfoFromContext(\"procDefUniqueId\");\n\tUIFrame(command, method, Url, \"Next\");\n}", "function clickedNext(currentPage, targetSlot) {\n //console.log(\"NEXT FUNCTION ACTIVATED\");\n ++currentPage;\n targetSlot.spawnMenu(currentPage);\n}", "function getvalue(film) {\n $.ajax ({\n url: \"https://api.themoviedb.org/3/search/movie?api_key=67cc61914ff7a9cf3c55f2014fa568b1&query=\" + film,\n dataType: \"json\",\n success: function(res) {\n for (var i = 0; i < res.results.length; i++) {\n var title = res.results[i].original_title\n var year = res.results[i].release_date.substr(0,4)\n var image = res.results[i].poster_path\n var id = res.results[i].id\n\n var item = document.createElement(\"div\")\n var boxImg = document.createElement(\"div\")\n var itemImage = document.createElement(\"img\")\n var itemInfos = document.createElement(\"div\")\n var itemTitle = document.createElement(\"span\")\n var itemYear = document.createElement(\"span\")\n\n itemImage.src = \"http://image.tmdb.org/t/p/w185/\" + image\n itemTitle.appendChild(document.createTextNode(title))\n itemYear.appendChild(document.createTextNode(year))\n itemInfos.appendChild(itemTitle)\n itemInfos.appendChild(itemYear)\n boxImg.appendChild(itemImage)\n item.appendChild(boxImg)\n item.appendChild(itemInfos)\n item.id = id\n item.classList.add(\"item\")\n boxImg.classList.add(\"boxImg\")\n itemInfos.classList.add(\"itemInfos\")\n itemTitle.classList.add(\"itemTitle\")\n itemYear.classList.add(\"itemYear\")\n results.appendChild(item)\n }\n\n var items = document.querySelectorAll(\"#results > div.item\")\n for (var k = 0; k < items.length; k++) {\n items[k].addEventListener(\"click\", function() {\n itemId = this.id\n changeId(itemId)\n })\n }\n }\n });\n}", "function goEpisodes(showId){\n let myUrl = `https://api.tvmaze.com/shows/${showId}/episodes`;\n let showdiv = document.getElementById(\"allShowsContainer\");\n showdiv.hidden = true;\n let episodediv = document.getElementById(\"allEpisodesContainer\");\n episodediv.hidden = false;\n let episodeControl = document.querySelector(\".episodeControl\");\n let showControl = document.querySelector(\".showControl\");\n showControl.hidden = true;\n episodeControl.hidden = false;\n clearRoot();\n setAllEpisodes(myUrl, showId);\n\n \n}", "function clickBtnPager() {\n // remet à jour les données de state en demandant la page\n // identifiée dans l'attribut data-page\n // noter ici le 'this' QUI FAIT AUTOMATIQUEMENT REFERENCE\n // A L'ELEMENT AUQUEL ON ATTACHE CE HANDLER\n getQuizzes(this.dataset.page);\n }", "async function displayMovies(movies,totalResults){\n results.innerHTML = ''\n for (let movie of movies){\n const res = await fetch(`https://www.omdbapi.com/?apikey=1a241340&i=${movie.imdbID}`)\n const data = await res.json()\n const genre = data.Genre.split(', ').splice(0,3)\n const genreList = document.createElement('ul')\n genre.forEach((gen) => {\n const element = document.createElement('li')\n element.innerHTML = `${gen}`\n element.classList.add('genre')\n genreList.appendChild(element)\n })\n let nominateBtnContent = 'Nominate'\n if (nominationList !== null){\n nominationList.forEach((nominated) => {\n if (nominated.id === data.imdbID){\n nominateBtnContent = 'Remove'\n }\n })\n }\n \n\n results.innerHTML += `\n <div class= 'movie' style=\"background-image:url(${data.Poster}) \">\n \n <div class=\"info\">\n <div class = 'genres'>${genreList.innerHTML}</div>\n <button class=\"nominate-btn\" onclick=\"NominateMovie()\" data-id=\"${data.imdbID}\">${nominateBtnContent}</button>\n <div class=rate>\n <div class='btn rating' >Rating:<i class=\"fas fa-star\" style=\"color:yellow\"></i>${data.imdbRating}</div>\n <div class= 'btn age'>${data.Rated}</div>\n </div>\n </div>\n <div class=movie-title>\n <h4>${data.Title} - ${data.Year}</h4>\n </div>\n </div> `\n }\n if (totalResults > 10) {\n more.innerHTML = `\n ${\n page > 1\n ? `<button class=\"btn\" onclick=\"getPrev()\">Prev</button>`\n : ''\n }\n ${\n totalResults >= (page * 10)\n ? `<button class=\"btn\" onclick=\"getNext()\">Next</button>`\n : ''\n }`\n }\n else {\n more.innerHTML = ''\n }\n}", "function clickToAdd(e) {\n var thisMovieImdbId = e.target.id; // grabs movie in search results from id on add button\n // var thisMovieImdbId = allResults[thisMovieId].imdbID; // grabs proper movie information given correct id\n $.ajax({ // Makes the next api request to get full listing on movie, not just search results (which were abbreviated)\n url: \"http://www.omdbapi.com/?i=\" + thisMovieImdbId + \"&r=json\"\n }).done(function(fullMovieListing) {\n\n // Need If Then Poster\n if (fullMovieListing.Poster !== \"N/A\") {\n fullMovieListing.Poster = \"http://img.omdbapi.com/?i=\" + thisMovieImdbId + \"&apikey=8513e0a1\";\n }\n \n // Sends full movie listing, with user login ID, to store on website database\n grabmovies.findMovie(fullMovieListing, authInfo);\n\n });\n }", "function buildPage () {\n const api_key = \"20ab01d1e4cf2615dc812916957806eb\";\n const include_adult = \"false\";\n var ar_actors = [];\n var language = \"en-US\";\n var page = \"1\";\n var sort = \"popularity.desc\";\n var include_video = \"false\";\n var pageNumber = \"1\";\n var i = 0;\n fetch('assets/json/arkansas.json')\n .then(r => {\n return r.json();\n })\n .then(data => {\n for (i in data.actors) {\n if (data.actors[i].id != \"\") {\n fetch(`https://api.themoviedb.org/3/person/${data.actors[i].id}?api_key=${api_key}&language=${language}`)\n .then(r => {\n return r.json();\n })\n .then(data => {\n ar_actors.push(data);\n if (data.profile_path != null && data.profile_path != \"\") {\n document.getElementById(\"allActorsList\").innerHTML +=\n `<div class=\"resultBanner\">${data.name}<a href=\n \"actorDetails.html?actorId=${data.id}\" alt=\n \"${data.name}\"><img src=\n \"https://image.tmdb.org/t/p/w500${data.profile_path}\"></a></div>`;\n } else {\n document.getElementById(\"allActorsList\").innerHTML +=\n `<div class=\"resultNoImage\"><a href=\n \"actorDetails.html?actorId=${data.id}\">${data.name}</a></div>`;\n }\n })\n } else {\n document.getElementById(\"allActorsList\").innerHTML +=\n `<div class=\"resultNoImage\">${data.actors[i].name} is not in the TMDB database. Their name was still included because they were found in the Encyclopedia of Arkansas.</div>`;\n }\n }\n })\n}", "function allMovieTitleLinks() {\n return $('.movie .name a')\n}", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "function pfClickedNext(pageNumba, mode){\n //console.log(\"Clicked Next\");\n\tpageNumba++;\n\tspawnPF(mode, pageNumba);\n}", "function showMovies(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n createPageNums(data);\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function loadMoreMovies(){\n console.log(\"Page Number = \" + pageNum)\n const endpoint = `${topRatedFilms_url}${api_key}&page=${pageNum += 1}`;\n fetchMovies(endpoint)\n }", "function clickOnMore() {\n var clickLink = document.querySelector('[aria-label=\"More actions\"]');\n clickLink.click();\n}", "temporaryMovie(movie) {\n this.displaySingleMovie(movie)\n }", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#right-summary\"), \"right\");\n }", "function goTo(folio, sequence) {\n // For some reason we have to wait before jumping.\n // @TODO: Why do we have to wait before jumping?\n setTimeout(function () {\n var url = (sequence) ? folio + '/' + sequence : folio;\n data.current_diva.gotoPageByAliasedNumber(folio.replace(/^0+/, ''));\n }, 1);\n }", "function selectNextActivitiesAndEmployees(command, method) {\n\tvar Url = L5.webPath + \"/jsp/workflow/help/selectnextactivitiesandemployees.jsp?assignmentId=\"\n\t+ getProcessInfoFromContext(\"assignmentId\");\n\tUIFrame(command, method, Url, \"Next\");\n}", "function nextscene() {\n\tvar location = document\n\t\t.getElementById('skybox')\n\t\t.getAttribute('src')\n\t\t.split('#')[1];\n\tvar currentLoc = parseInt(location.substring(3));\n\tif ($('#loc'.concat(currentLoc + 1, 'spot'))) {\n\t\t$('#loc'.concat(currentLoc + 1, 'spot')).click();\n\t}\n}", "function goFoward(){\n // update the master page number setting and fetch the next page of data\n page += 1\n getMonsters()\n}", "moreMovies(result){\n $(this.shadowDOM.querySelector('#more-movies')).remove();\n result.forEach(movies => {\n const movieItem = document.createElement(\"movie-item\");\n movieItem.movie = movies;\n this.shadowDOM.querySelector('.list-other').appendChild(movieItem);\n });\n const newButton = document.createElement(`button`);\n newButton.id = 'more-movies';\n newButton.className = 'btn';\n newButton.textContent = 'More Movies';\n this.shadowDOM.querySelector('.list-other').appendChild(newButton);\n }", "function openVehicle(vid){\n //Open Specific vehicle by clicking More-btn in popup\n var sections = document.getElementsByClassName(\"mySection\");\n activePage = 'vehicleDetails';\n var vDetails;\n for (i = 0; i < sections.length; i++) {\n if (sections[i].id == 'vehicleDetails'){\n vDetails = sections[i];\n sections[i].style.display = \"block\";\n }\n else {\n sections[i].style.display = \"none\";\n }\n }\n loadDetails(vDetails, vid);\n loadLog(vid);\n loadComments(vid);\n loadInfo(vid);\n loadDiagnose(vid);\n loadActions(vid);\n loadTests(vid, 'tests');\n}", "function searchAndAddMovie($, obj) {\n logger.trace(\"Entering searchAndAddMovie function\");\n var data2 = $(this).parent();\n data2 = findData(data2);\n do {\n var title = data2.find(\"a\").attr(\"title\");\n var href = data2.find(\"a\").attr('href');\n addUrl(href, obj);\n if (title !== null && title !== \"\" && title !== undefined) {\n if (!contains(obj.movies, title)) {\n obj.movies.push(title);\n }\n }\n data2 = data2.next();\n } while (data2.next().length !== 0);\n}", "selectMovie(id) {\n this.movieById(movie => {\n this.selectedMovie(movie)\n }, id)\n }", "function getMovies(varfn) {\r\n\r\n\r\n\r\n let apiData = {\r\n url: 'http://www.omdbapi.com/',\r\n apiKey: '?apikey=623dcc99&s=',\r\n filmnaam: varfn\r\n }\r\n\r\n const {\r\n url,\r\n apiKey,\r\n filmnaam\r\n } = apiData\r\n const apiUrl = `${url}${apiKey}${filmnaam}`\r\n\r\n let res;\r\n\r\n fetch(apiUrl)\r\n .then((response) => response.json())\r\n .then(data => res = data)\r\n .then((res) => {\r\n\r\n let movies = res.Search;\r\n let output = '';\r\n\r\n console.log(movies);\r\n $.each(movies, (index, movie) => {\r\n output += `\r\n <div class =\"col-md-3\" id=\"ruimte\">\r\n <div class=\"well text-center\">\r\n <h5>${movie.Title}</h5>\r\n <h6>Year: ${movie.Year}</h6>\r\n <img src=${movie.Poster} onclick=\"movieSelected('${movie.imdbID}')\" datatoggle=\"modal\" href=\"#\">\r\n </div>\r\n </div>\r\n `;\r\n });\r\n\r\n $('#movies').html(output); //inner html kan mss ook?\r\n });\r\n}", "onOptionSelection(movie) {\n document.querySelector(\".tutorial\").classList.add(\"is-hidden\");\n onMovieSelection(movie, document.querySelector(\"#left-summary\"), \"left\");\n }", "function movieClicked(id, poster) {\n\tmodal.classList.add(\"expand\");\n\tmodal.style.display = \"block\";\n\tmodalContent.innerHTML = ``;\n\n\t(async () => {\n\t\tconst videos = await app.getVideos(id);\n\t\tconst trailer = videos.find(video => video.type === 'Trailer');\n\t\tconst youTubeUrl = trailer ? 'https://www.youtube.com/embed/' + trailer.key + '?autoplay=1' : undefined;\n\n\t\tconst reviews = await app.getReviews(id);\n\t\tconst twoReviews = reviews.slice(0, maxQueryResults);\n\n\t\tconst similarMovies = await app.getSimilarMovies(id);\n\n\n\t\tconst firstRowElement = createElement(\"div\", \"top-row\")\n\n\t\t// Display Poster\n\t\tconst posterElement = createElement(\"div\", \"poster-md\");\n\t\tposterElement.innerHTML = `\n\t\t\t<img width=\"367\" src=\"${poster}\" onclick=\"closeModal()\" />\n\t\t`\n\t\tfirstRowElement.append(posterElement);\n\n\t\t// Display Trailer\n\t\tconst videoElement = createElement(\"div\", \"details\");\n\t\tif (youTubeUrl) {\n\t\t\tvideoElement.innerHTML = `\n\t\t\t\t<iframe id=\"ytplayer\" type=\"text/html\" width=\"900\" height=\"550\"\tsrc=\"${youTubeUrl}\"\tframeborder=\"0\" allow='autoplay'></iframe>\n\t\t\t`;\n\t\t} else {\n\t\t\tvideoElement.innerHTML = `\n\t\t\t\t<span class=\"trailer-not-found\"> We're sorry, trailer not found :( </span>\n\t\t\t\t<video width=\"900\" height=\"400\" controls>\n\t\t\t\t\t<source src=\"\" type=\"video/mp4\">\n\t\t\t\t</video>\n\t\t\t`;\n\t\t}\n\t\tfirstRowElement.append(videoElement);\n\t\tmodalContent.append(firstRowElement);\n\n\t\t// Display Reviews\n\t\tconst reviewsElement = createElement(\"div\", \"reviews\");\n\t\ttwoReviews.forEach(review => {\n\t\t\tconst date = new Date(review.updated_at);\n\t\t\tconst reviewElement = createElement(\"div\", \"review\");\n\t\t\treviewElement.innerHTML = `\n\t\t\t\t<div class=\"top-header\">\n\t\t\t\t\t<span class=\"material-icons-outlined\">${'rate_review'}</span>\n\t\t\t\t\t<span class=\"date\">${date.toLocaleDateString()}</span>\n\t\t\t\t</div>\n\t\t\t\t<h2> ${review.author} <i class=\"header\"> wrote:</i> </h2>\n\t\t\t\t<p class=\"truncate\">${review.content}</p>\n\t\t\t\t<button class=\"read-more\" onclick=\"window.open('${review.url}', '${\"_blank\"}');\">\n\t\t\t\t\t<span class=\"text\">read more</span>\n\t\t\t\t\t<span class=\"material-icons-outlined\">${'read_more'}</span>\n\t\t\t\t</button>\n\t\t\t`;\n\t\t\treviewsElement.append(reviewElement);\n\t\t});\n\t\tfirstRowElement.append(reviewsElement);\n\n\t\t// Display Similar Movies\n\t\tconst similarElements = createElement(\"div\", \"similar-movies\");\n\t\tsimilarMovies.forEach((movie) => {\n\t\t\tconst similarMovie = new Movie(movie);\n\t\t\tconst viewPoster = IMG_URL + similarMovie.posterPath;\n\t\t\tconst yearOfRelease = similarMovie.yearOfRelease ? '(' + similarMovie.yearOfRelease.split('-')[0] + ')' : '';\n\n\t\t\tconst movieElement = createElement(\"div\");\n\t\t\tmovieElement.innerHTML = `\n\t\t\t\t<div class=\"similar-movie\">\n\t\t\t\t\t<img src=\"${viewPoster}\" alt=\"${similarMovie.title}\" />\n\t\t\t\t</div>\n\t\t\t`;\n\n\t\t\tsimilarElements.appendChild(movieElement);\n\t\t});\n\t\tmodalContent.append(similarElements);\n\n\t})();\n\n}", "function onClick(e) {\n // Pause the animation\n story.pauseAnimation();\n // If it is already selected resume the animation\n // otherwise pause and move to the selected month\n if (e.yValue === story.getFrameValue()) {\n story.startAnimation();\n } else {\n story.goToFrame(e.yValue);\n story.pauseAnimation();\n }\n }", "function showAmosVideo() {\r\n var amosVideo = document.querySelector(\".amos_launch\");\r\n var junoVideo = document.querySelector(\".juno_launch\");\r\n var zaryaVideo = document.querySelector(\".zarya_launch\");\r\n var videoContainer = document.querySelector(\".video_container\");\r\n var videoDescription = document.querySelector(\".video_description\");\r\n var videoH1 = document.querySelector(\".launch_videos h1\");\r\n\r\n videoH1.innerHTML = \"Amos-17 Mission\";\r\n junoVideo.style.display = \"none\"; \r\n zaryaVideo.style.display = \"none\"; \r\n amosVideo.style.display = \"block\";\r\n videoContainer.style.display = \"block\";\r\n videoDescription.innerHTML = \r\n '<p>' + videoDescriptionObject[0].amos + '</p>\\n' +\r\n '<p>' + videoDescriptionObject[0].amosSecond + '</p>';\r\n\r\n window.location.href = \"launches.html#launch_anchor\";\r\n}", "function findVideos() {\n let videos = document.querySelectorAll('.video');\n\n for (let i = 0; i < videos.length; i++) {\n setupVideo(videos[i]);\n }\n}", "function genMovies(movies){\n let imp = document.createElement('div');\n imp.className = \"list-group\";\n imp.id = \"usermovies\";\n \n for (let i = 0; i<movies.length; i++){\n let ap = document.createElement(\"a\");\n if (i%2 === 0){\n ap.className = \"list-group-item flex-column align-items-start\";\n } else {\n ap.className = \"list-group-item\";\n }\n //ap.href = sim_results[i].href; //TO DO generate movie url\n\n let div1 = document.createElement('div')\n div1.className = \"d-flex w-100 justify-content-between\";\n let div2 = document.createElement('div');\n div2.id = movies[i].id;\n let h = document.createElement(\"h3\");\n h.textContent = movies[i].original_title.trim();\n h.className = \"mb-1\";\n let p = document.createElement('p');\n p.textContent = movies[i].overview;\n let img = document.createElement(\"img\");\n if (movies[i].poster_path != null){\n img.src = getPoster(movies[i].poster_path);\n } else {\n img.src = \"./assets/img/genposter.jpg\";\n }\n img.className = \"img-thumbnail rounded float-right\";\n \n div2.append(h);\n div2.append(p);\n div1.append(div2);\n div1.append(img);\n ap.append(div1);\n imp.append(ap);\n }\n document.getElementById(\"usermovies\").replaceWith(imp);\n}", "function changePage(){\n var id;\n \n try {\n id = this.id;\n page= parseInt(id.split(\"_\")[1]);\n \n var pages = document.querySelectorAll(\"li[id^=\\\"page\\\"]\");\n \n for(var i = 0 ; i < pages.length ; i++){\n if((i+1) == page){\n pages[i].className = \"active\";\n }\n else {\n pages[i].className = \"\";\n }\n }\n }\n catch(e){\n page = 1;\n }\n finally {\n eventsChange();\n }\n}", "function foundmovie(movieid){\n var url = 'https://api.themoviedb.org/3/movie/' + movieid + '?api_key=224dda2ca82558ef0e550aa711aae69c';\n jQuery.ajax({\n type: 'GET',\n url: url,\n async: false,\n contentType: \"application/json\",\n dataType: 'jsonp',\n success: function(json) {\n clear_page();\n jQuery(\"#current\").addClass('active'); \n jQuery(\"#current\").css('background-image',\"url(http://image.tmdb.org/t/p/w500/\" + json.backdrop_path +\")\");\n jQuery(\"#current\").append(\"<img src='http://image.tmdb.org/t/p/w500\" + json.poster_path + \"' width:=200px' height='280px' />\");\n \tjQuery(\"#current\").append(\"<div class='current_info'><p>Current Match: \" + json.original_title + \"</p>\");\n jQuery(\"#current\").append(\"<p>Released: \" + json.release_date +\"</p>\");\n jQuery(\"#current\").append(\"<p>Rating: \" + json.vote_average + \"</p></div>\");\n jQuery('#current').slideDown(\"2000\", function(){\n getSimilar(json.id);\n });\n\t },\n\t error: function(e) {\n\t console.log(e.message);\n\t }\n });\n}", "function iteration_button_onclick(clicked_id) {\n location.href = \"/view/iteration\";\n}", "function load_next()\n{\n\tplaypause();\n\tvar menu = document.getElementById(\"popup\");\n\tvar chosen = menu.options[menu.selectedIndex].value;\n\tfor(var i=0; chosen != results[i].title; ++i) { }\t\n\tif ( i == (menu.length-1) )\n\t{\n\t\ti = 0;\n\t}\n\telse {\n\t\ti = i+1;\n\t}\t\n\tmenu.options[i].selected = true;\t// set the first item in the menu as selected\n\tupdate_episode(results[i]); \t\n}" ]
[ "0.6419166", "0.6275278", "0.62354785", "0.6154287", "0.60783213", "0.6074694", "0.60680723", "0.6021547", "0.59701854", "0.59179115", "0.5917031", "0.5912935", "0.59110445", "0.59108114", "0.5867433", "0.5818511", "0.580864", "0.5808399", "0.57993436", "0.57836354", "0.57826704", "0.5774858", "0.57722664", "0.57463217", "0.57406974", "0.57137394", "0.56786513", "0.56734025", "0.5673051", "0.56606144", "0.5658595", "0.5657825", "0.56533223", "0.56379396", "0.5634176", "0.5632958", "0.56197613", "0.56153476", "0.55905503", "0.55881244", "0.55835027", "0.5579789", "0.557491", "0.5564158", "0.5563933", "0.5553752", "0.55533856", "0.55530816", "0.5543351", "0.5539179", "0.5537801", "0.5537334", "0.5537301", "0.5533734", "0.5531926", "0.5529533", "0.55185735", "0.55162084", "0.55123323", "0.55015576", "0.5488641", "0.54820275", "0.5477432", "0.5463347", "0.5460711", "0.5458004", "0.5457584", "0.54504836", "0.54313636", "0.5430446", "0.54139966", "0.5407285", "0.54049563", "0.5403493", "0.54002166", "0.53950655", "0.539017", "0.5379432", "0.53794205", "0.5377868", "0.537578", "0.53722507", "0.53618145", "0.5361659", "0.5357581", "0.5356456", "0.5352006", "0.5335936", "0.5328271", "0.5323306", "0.5321511", "0.5319175", "0.5316897", "0.53152704", "0.53136957", "0.5312126", "0.5304859", "0.5301176", "0.5284337", "0.52798486" ]
0.6516985
0
Method to Capture Individual Movie Times From Individual Pages into an Array & Print to Console
singleMovie() { console.log("singleMovie") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function consoleFn(Movie_rating, Movie_name, watch_Link, trailer_link){\n let movie_rates = document.querySelectorAll(Movie_rating);\n let Movie_names = document.querySelectorAll(Movie_name);\n let Watch_link = document.querySelectorAll(watch_Link);\n let Trailer_link = document.querySelectorAll(trailer_link);\n\n let result = [];\n\n for( let i = 30, j = 0 ; i < movie_rates.length && j<Watch_link.length ; i++, j++ ){\n let rating = movie_rates[i].innerText.trim();\n let Movie_name = Movie_names[i].innerText.trim();\n let watch_link = Watch_link[j].href;\n let trailerlink = Trailer_link[i].href;\n\n \n result.push({\n rating : rating,\n Movie_name : Movie_name,\n watch_link : watch_link,\n trailerlink : trailerlink\n });\n }\n\n return result;\n }", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function showtimes(showtimesUrl) {\n fetch (showtimesUrl, options) \n .then(response => response.json())\n .then(responseJson => {\n console.log(responseJson)\n parseMovies(responseJson)\n })\n }", "function movieTime() {\n\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n\n\n axios\n .get(queryUrl)\n\n .then(\n\n function (response) {\n var movieD = response.data;\n // console.log(response)\n console.log(\n \"\\n ========== Movie Search ==========\\n\"\n )\n\n // * Title of the movie.\n console.log(\"Movie Title: \" + movieD.Title\n // * Year the movie came out.\n + \"\\nYear the movie came out: \" + movieD.Year\n // * IMDB Rating of the movie.\n + \"\\nIMDB Rating: \" + movieD.imdbRating\n // * Rotten Tomatoes Rating of the movie.\n + \"\\nRotten Tomatoes Rating: \" + movieD.Ratings[2].Value\n // * Country where the movie was produced.\n + \"\\nThe country the movie was produced in: \" + movieD.Country\n // * Language of the movie.\n + \"\\nLanguage of the movie: \" + movieD.Language\n // * Plot of the movie.\n + \"\\nMovie Plot: \" + movieD.Plot\n // * Actors in the movie.\n + \"\\nActors/Actresses: \" + movieD.Actors + \"\\n\");\n }\n )\n}", "printMovieInfo(data) {\n const rottenTomatoes = this.rottenTomatoesRating(data);\n const output = [\n `Title: ${data.Title}`,\n `Year: ${data.Year}`,\n `Rating: IMDb ${data.imdbRating}`,\n ` Rotten Tomatoes ${rottenTomatoes}`,\n `Country: ${data.Country}`,\n `Language: ${data.Language}`,\n `Plot: ${data.Plot}`,\n `Actors: ${data.Actors}`\n ];\n\n console.log(output.join(\"\\n\"));\n }", "function printMovieItems() {\n seanBeanMovies.forEach(function(movie) {\n console.log(movie);\n });\n}", "function turnHoursToMinutes(moviesArray) {\n let result = moviesArray.map((movie) => {\n console.log(\"movie.genre : \" + movie.genre)\n return {\n title: movie.title,\n duration: stringToMinutes(movie.duration),\n genre: movie.genre\n }\n })\n \n return result\n \n }", "function getTheatreMovies() {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/now_playing?api_key=\" +\n API_KEY +\n \"&language=en-US&region=US\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let theatreMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n theatreMovies.push(response.results[i].title);\n }\n console.log(theatreMovies);\n });\n}", "function consoleFn() {\n let arr = document.querySelectorAll(\"#stats.style-scope .ytd-playlist-sidebar-primary-info-renderer\");\n let newArr = [];\n newArr.push(arr[0].innerText); //no. of videos\n newArr.push(arr[1].innerText); //no. of views\n return newArr;\n}", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "function turnHoursToMinutes(movieArray) {\n\n const durationMovie = movieArray.map(e => e.duration)\n let minutesPerHour = 0\n let minutes = 0\n const totalMinutes = []\n\n durationMovie.forEach(function (m, idx) {\n for (i = 0; i < m.length; i++) {\n if (m[i] === 'h') {\n minutesPerHour = parseInt(m[i - 1] * 60)\n } else if (m[i] === 'm') {\n minutes = parseInt(m[i - 2] + m[i - 1])\n }\n }\n totalMinutes.push({ duration: minutesPerHour + minutes })\n })\n\n return totalMinutes\n}", "function movieSearch(){\n outPutForLog = [];\n outPutForLog.unshift(outputText);\n outPutForLog.unshift(\"\\n\");\n\n axios.get(\"http://www.omdbapi.com/?t=\" + userQuestion + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n\n //Title of the movie.\n console.log(\"Movie Title: \" + response.data.Title);\n outPutForLog.push(\"Movie Title: \" + response.data.Title);\n //Release Date\n console.log(\"Release Date: \" + response.data.Released);\n outPutForLog.push(\"Release Date: \" + response.data.Released);\n // IMDB Rating of the movie.\n console.log(\"IMDB Ratinge: \" + response.data.imdbRating);\n outPutForLog.push(\"IMDB Ratinge: \" + response.data.imdbRating);\n //Rotten Tomatoes Rating of the movie.\n console.log(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n outPutForLog.push(\"Rotten Tomatoes Ratinge: \" + response.data.Ratings[1].Value);\n //Country where the movie was produced.\n console.log(\"Country: \" + response.data.Country);\n outPutForLog.push(\"Country: \" + response.data.Country);\n //Language of the movie.\n console.log(\"Language: \" + response.data.Language);\n outPutForLog.push(\"Language: \" + response.data.Language);\n //Plot of the movie.\n console.log(\"Plot: \" + response.data.Plot);\n outPutForLog.push(\"Plot: \" + response.data.Plot);\n //Actors in the movie.\n console.log(\"Actors: \" + response.data.Actors);\n outPutForLog.push(\"Actors: \" + response.data.Actors);\n\n console.log(\"\\r\\n\\r\\n\\r\\n\");\n displayForLog = outPutForLog.join(\"\\n \");\n appendOutput();\n }\n );\n}", "function showMovies() {\n\tconsole.log(SPACER);\n\tfor (let i = 0; i < movies.length; i++) {\n\t\tconsole.log(\"\\t\" + String(i + 1) + \". \" + movies[i].title + \" (\" + movies[i].average + \" stars)\");\n\t}\n\tconsole.log(SPACER);\n}", "function Movie(title,genre,rating,showtimes) {\n this.title = title,\n this.genre = genre,\n this.rating = rating,\n this.showtimes = showtimes,\n\n this.getNextShowing = function () {\n var now = new Date().getTime();\n\n for (let i = 0; i< this.showtimes.length ; i++) {\n var showTime = getTimeFromString(this.showtimes[i]);\n\n if ((showTime - now) > 0) {\n return `Next showing of '${this.title}' is ${this.showtimes[i]}`;\n };\n };\n\n return null;\n }\n\n}", "function movieInfo(movieURL) {\r\n request(movieURL, function(err, response, body) {\r\n if (!err && response.statusCode == 200) {\r\n //convert body to string\r\n body = JSON.parse(body);\r\n console.log(\"\\n\".red);\r\n console.log(\"Title: \".blue + body.Title.red);\r\n console.log(\"Year: \".blue + body.Year.red);\r\n console.log(\"Rating: \".blue + body.Rated.red);\r\n console.log(\"Country: \".blue + body.Country.red);\r\n console.log(\"Language: \".blue + body.Language.red);\r\n console.log(\"Plot: \".blue + body.Plot.red);\r\n console.log(\"Cast: \".blue + body.Actors.red);\r\n console.log(\"Rotten Tomatoes Rating: \".blue + body.tomatoRating.red);\r\n console.log(\"Rotten Tomatoes URL: \".blue + body.tomatoURL.red);\r\n console.log(\"\\n\");\r\n } else {\r\n log(\"error.txt\", command + \" Error: \" + err);\r\n return;\r\n };\r\n });\r\n}", "function thisMovie(string) {\n request(\"http://www.omdbapi.com/?t=\" + string + \"&apikey=trilogy\", function(\n error,\n response,\n body\n ) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover just the imdbRating\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n response = JSON.parse(body);\n\n var title = \" \" + response.Title + \" \";\n var year = \"\" + response.Year;\n var ratingImdb = \"\" + response.Ratings[0].Value;\n var ratinRottenTomatoes = \"\" + response.Ratings[1].Value;\n var country = \"\" + response.Country;\n var language = \"\" + response.Language;\n var plot = \"\" + response.Plot;\n var cast = \"\" + response.Actors;\n console.log(separator.gray);\n console.log(\" \");\n console.log(\" \" + \"Tittle\".underline + \":\");\n console.log(\" \" + title.black.bgYellow);\n console.log(\" \" + \"Year\".underline + \":\");\n console.log(\" \" + year.yellow);\n console.log(\" \" + \"Country\".underline + \":\");\n console.log(\" \" + country.yellow);\n console.log(\" \" + \"Language\".underline + \":\");\n console.log(\" \" + language.yellow);\n console.log(\" \" + \"Cast\".underline + \":\");\n console.log(\" \" + cast.yellow);\n console.log(\" \" + \"Plot\".underline + \":\");\n console.log(\" \" + plot.yellow);\n console.log(\" \" + \"Ratings\".underline + \":\");\n console.log(\" IMDb.............. \" + ratingImdb.red);\n console.log(\" Rotten Tomatoes... \" + ratinRottenTomatoes.red);\n console.log(separator.gray);\n\n logIt(\n \"<<<<<<<<<<<<<<<<<<<<<<<< NEW LOG STARTS HERE >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\"\n );\n logIt(separator);\n logIt(\" \");\n logIt(\" \" + \"Tittle\" + \":\");\n logIt(\" \" + title);\n logIt(\" \" + \"Year\" + \":\");\n logIt(\" \" + year);\n logIt(\" \" + \"Country\" + \":\");\n logIt(\" \" + country);\n logIt(\" \" + \"Language\" + \":\");\n logIt(\" \" + language);\n logIt(\" \" + \"Cast\" + \":\");\n logIt(\" \" + cast);\n logIt(\" \" + \"Plot\" + \":\");\n logIt(\" \" + plot);\n logIt(\" \" + \"Ratings\" + \":\");\n logIt(\" IMDb.............. \" + ratingImdb);\n logIt(\" Rotten Tomatoes... \" + ratinRottenTomatoes);\n logIt(separator);\n }\n });\n}", "function movieThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"Mr. Nobody\"\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + option1 + \"&y=&plot=short&apikey=trilogy\"\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n console.log();\n console.log(\"Movie\");\n console.log(\"=====\");\n movie = JSON.parse(body);\n console.log(movie.Title);\n console.log(movie.Year);\n console.log(movie.Language);\n console.log(\"Made in: \" + movie.Country);\n console.log(\"Ratings\");\n movie.Ratings.forEach(element => {\n if (element.Source === 'Internet Movie Database') {\n console.log(\" IMDB: \" + element.Value);\n }\n if (element.Source === 'Rotten Tomatoes') {\n console.log(\" Rotten Tomatoes: \" + element.Value);\n }\n });\n console.log(\"Starring\");\n movie.Actors.split(\",\").forEach(element => {\n console.log(\" \" + element.trim());\n })\n console.log(movie.Plot);\n }\n });\n\n}", "function movieInfo(movieURL) {\n request(movieURL, function(err, response, body) {\n if (!err && response.statusCode == 200) {\n //convert body to string\n body = JSON.parse(body);\n console.log(\"Title: \" + body.Title);\n console.log(\"Year: \" + body.Year);\n console.log(\"Rating: \" + body.Rated);\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot);\n console.log(\"Cast: \" + body.Actors);\n console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n } else {\n log(\"error_log.txt\", command + \" Error: \" + err);\n return;\n };\n });\n}", "function turnHoursToMinutes(arrayMovies) {\n\n return arrayMovies.map(function (element) {\n var hours = 0,\n minutes = 0,\n movie = [];\n\n if (element.duration == '') {\n hours = 0;\n minutes = 0;\n } else if (element.duration.indexOf('min') < 0) {\n hours = element.duration.slice(0, element.duration.indexOf('h'));\n minutes = 0;\n } else if (element.duration.indexOf('h') < 0) {\n hours = 0;\n minutes = element.duration.slice(0, element.duration.indexOf('min'));\n } else {\n hours = element.duration.slice(0, element.duration.indexOf('h'));\n minutes = element.duration.slice(element.duration.indexOf('h') + 2, element.duration.indexOf('min'));\n }\n movie = {\n \"title\": element.title,\n \"year\": element.year,\n \"director\": element.director,\n \"duration\": (parseInt(hours) * 60 + parseInt(minutes)),\n \"genre\": element.genre,\n \"rate\": element.rate\n };\n return movie;\n });\n}", "function getMovieTitles(substr) {\n const titles = [];\n let totalPages = 1;\n let currentPage = 1;\n\n while (currentPage <= totalPages) {\n https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${currentPage}`, (resp) => {\n let data = '';\n resp.on('data', (chunk) => {\n data += chunk;\n });\n\n resp.on('end', () => {\n console.log(currentPage);\n const res = JSON.parse(data);\n totalPages = res.total_pages;\n titles.concat(res.data.map(item => item['Title']));\n currentPage++;\n });\n });\n }\n\n // for(let i=1; i <= totalPages; i++){\n // https.get(`https://jsonmock.hackerrank.com/api/movies/search/?Title=${substr}&page=${i}`, (resp) => {\n // let data = '';\n // resp.on('data', (chunk) => {\n // data += chunk;\n // });\n\n // resp.on('end', () => {\n // const res = JSON.parse(data);\n // totalPages = res.total_pages;\n // titles.concat(res.data.map(item=>item['Title']));\n // });\n // });\n // }\n\n console.log(titles);\n return titles.sort();\n}", "function movieThis(movieName) {\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Console log all necessary data points\n console.log(JSON.parse(body));\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Rated: \" + JSON.parse(body).Rated);\n console.log(\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n );\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Produced In: \" + JSON.parse(body).Country);\n console.log(\"Laguage: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "function movieOutput(movie) {\n const queryUrl = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n axios.get(queryUrl).then((response) => {\n const { data } = response;\n // console.log(response.data);\n console.log(`Movie title: ${data.Title}`);\n console.log(`Year the movie came out: ${data.Year}`);\n console.log(`IMDB Rating: ${data.imdbRating}`);\n console.log(`Rotten Tomatoes rating: ${data.Ratings[1].Value}`);\n console.log(`Country The Movie was produced: ${data.Country}`);\n console.log(`Language of the movie: ${data.Language}`);\n console.log(`Plot of the movie: ${data.Plot}`);\n console.log(`Actors: ${data.Actors}`);\n }).catch((error) => {\n if (error.response) {\n console.log('---------------Data---------------');\n console.log(error.response.data);\n }\n });\n}", "function movieThis (movie) {\n\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=\" + omdb.key;\n\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var info = JSON.parse(body);\n console.log(\"\");\n console.log(('***** \"' + info.Title + '\" *****').inverse);\n console.log(\"Released in \" + info.Year);\n console.log(\"IMDB \" + info.Ratings[0].Value);\n console.log(\"Rotten Tomatoes \" + info.Ratings[1].Value);\n console.log(\"Produced in \" + info.Country);\n console.log(\"Language: \" + info.Language);\n console.log(\"Plot: \" + info.Plot);\n console.log(\"Actors: \" + info.Actors);\n console.log(\"\");\n console.log(\"**************************************\");\n console.log(\"\");\n // Append every full return to the log.txt file.\n fs.appendFile(\"log.txt\", \"\\n\" + '***** \"' + info.Title + '\" *****' + \"\\nReleased in \" + info.Year + \"\\nIMDB \" + info.Ratings[0].value + \"\\nRotten Tomatoes \" + info.Ratings[1].Value + \"\\nProduced in \" + info.Country + \"\\nLanguage: \" + info.Language + \"\\nPlot: \" + info.Plot + \"\\nActors: \" + info.Actors + \"\\n\", function(error) {\n if (error) {\n console.log(error);\n };\n });\n } else {\n console.log('An error occurred: ' + error);\n }\n })\n}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function movieDetailsLoop(movieSearchArray, cb) {\n\n movieDetails(movieSearchArray[loopIndex].imdbID, function (data) {\n var plot = data.Plot;\n var replaceQuote = plot.replace(/\"/g, \"'\");\n data.New_Plot = replaceQuote;\n movieDetailArray.push(data);\n loopIndex++;\n\n if (loopIndex < movieSearchArray.length) {\n movieDetailsLoop(movieSearchArray, cb);\n } else {\n loopIndex = 0;\n return cb(movieDetailArray);\n }\n });\n }", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function getMovieTitles() { \n var findPattern = \"//a[contains(@class, 'filmname')]\";\n var resultLinks = document.evaluate( findPattern, document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null );\n\n var result = new Array();\n var i=0;\n while ( (res = resultLinks.snapshotItem(i) ) !=null ) {\n result[i] = res;\n i++;\n }\n return result;\n\n }", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function moviePlot(movieInput, options) {\n var options = {\n method: 'GET',\n url: 'https://api.themoviedb.org/3/search/movie',\n qs:\n {\n include_adult: 'false',\n page: '1',\n query: movieInput,\n language: 'en-US',\n api_key: 'cd9b0b6a5f58ff82755c2168c6095cdb'\n },\n body: '{}'\n };\n\n //GETS MOVIE INFO\n request(options, function (error, response, body) {\n if (error) throw new Error(error);\n else {\n let movieSpoiler = JSON.parse(body);\n setTimeout(() => { console.log(movieSpoiler.results[0].overview) }, seconds * 1000);\n }\n });\n\n \n\n}", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function getmovieTitleInfo() {\n var movie = indicator[3];\n if (!movie) {\n console.log(\"You didn't enter a movie. So here is Mr. Nobody, better than nothing right?\");\n movie = \"mr nobody\";\n }\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n request(queryUrl, function(e, resp, data) {\n if (!e && resp.statusCode === 200) {\n\n console.log(\"*************************************************\")\n console.log(\"Title: \" + JSON.parse(data).Title);\n console.log(\"Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors: \" + JSON.parse(data).Actors);\n console.log(\"*************************************************\")\n }\n });\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function movieStuff(){\n\t//Variable for the Omdb's api.\n\tvar moiveQuery = \"http://www.omdbapi.com/?t=\" + term + \"&y=&plot=short&r=json\";\n\trequest(moiveQuery, function(error, response, body) {\n\t\t// If the request is successful\n\t \tif (!error && response.statusCode === 200) {\n\n\t \t// Parse the body of the site to find wanted info.\n\t \tconsole.log(\"Title: \" + JSON.parse(body).Title + \"\\nRelease Year: \" + \n\t \t\tJSON.parse(body).Year + \"\\nIMDB Rating: \" + \n\t \t\tJSON.parse(body).imdbRating + \"\\nCountry: \" + \n\t \t\tJSON.parse(body).Country + \"\\nLanguage: \" + \n\t \t\tJSON.parse(body).Language + \"\\nPlot: \" + JSON.parse(body).Plot + \n\t \t\t\"\\nActors: \" + JSON.parse(body).Actors + \"\\nRotten Tomatoes Score: \" \n\t \t\t+ JSON.parse(body).Ratings[1].Value);\n\t \t//The one below is in the requirements as Rotten Tomatoes page. However, \n\t \t//that information isn't provided by OMDb. I can't be certain Rotten \n\t \t//Tomatoes would contact me in a timely manner AND when I'm not at work. So,\n\t \t//this is my work-around solution. If I were actually doing this for a job,\n\t \t//I would use Rotten Tomatoes' form and have the code below as my backup \n\t \t//plan if they took too long to respond or denyed my request.\n\t \tconsole.log(\"Find it on IMDb: http://www.imdb.com/title/\" + JSON.parse(body).imdbID + \"/\");\n\t }\n\t});\n\tfs.appendFile(\"log.txt\", \" (%) Find movie: \" + term);\n}", "function parseMovies(responseJson) {\n const showtimes = responseJson._embedded.showtimes;\n console.log(showtimes)\n let myMovies = [];\n showtimes.forEach(movieName => {\n return myMovies.push(movieName);\n })\n\n\nfunction combine(arr) {\n var combined = arr.reduce(function(result, item) {\n var current = result[item.movieName];\n result[item.movieName] = !current ? item : {\n movieName: item.movieName,\n showDateTimeLocal: current.showDateTimeLocal + ', ' + item.showDateTimeLocal,\n posterDynamic: item.media.posterDynamic,\n mpaaRating: item.mpaaRating,\n runTime: item.runTime,\n genre: item.genre,\n };\n \n//need to format HH:MM & conditional - if same time, only display once\n // let oldDate = Object.entries(showDateTimeLocal);\n // console.log(oldDate)\n \n return result;\n }, {});\n \n return Object.keys(combined).map(function(key) {\n return combined[key];\n });\n }\n \n \n\n var result = combine(myMovies);\n console.log(result);\n displayShowtimeResults(result)\n}", "function movieInfo(movie) {\n\t// If a movie has been passed into the function\n\t// then set parameters to the specified movie. \n\t// Otherwise set it to \"Mr. Nobody\"\n\tif (typeof(movie) != \"undefined\") {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\";\n\t} else {\n\t\tvar queryURL = \"http://www.omdbapi.com/?t=Mr.Nobody&y=&plot=short&apikey=40e9cece\";\n\t};\n\t\t// Run a request to the OMDB API with the movie specified\n\t\trequest(queryURL, function(error, response, body) {\n\n\t \t// If the request is successful (i.e. if the response status code is 200)\n\t \tif (!error && response.statusCode === 200) {\n\n\t\t // Parse the body of the site and recover just the movie title\n\t\t console.log(\"Movie Title: \" + JSON.parse(body).Title);\n\t\t // Year the movie came out\n\t\t console.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t // IMDB rating of the movie\n\t\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t // Country where the movie was produced\n\t\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t\t // Language of the movie\n\t\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t\t // Plot of the movie\n\t\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t // Actors in the movie\n\t\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t // Rotten tomoatoes rating\n\t\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\t// Append the results to the log file log.txt\n\t\t\tfs.appendFile(\"log.txt\",';'+ \"Movie Title: \" + JSON.parse(body).Title + ';' + \n\t\t\t\t\t\t\t\"Release Year: \" + JSON.parse(body).Year + ';' +\n\t\t\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + ';' +\n\t\t\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + ';' +\n\t\t\t\t\t\t\t\"Language: \" + JSON.parse(body).Language + ';' +\n\t\t\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + ';' +\n\t\t\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors + ';' +\n\t\t\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value , function(err){\n\t\t\t\t//If the code experiences any errors it will log the error to the console.\n\t\t\t if (err) {\n\t\t\t return console.log(err);\n\t\t\t };\n\t\t\t});\n\n\t\t};\n\t});\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function getMovieInfo() {\n if (searchTerm === \"\") {\n searchTerm = \"Star Wars\";\n }\n axios\n .get(\"http://omdbapi.com/?apikey=trilogy&s=\" + searchTerm)\n .then(function(response) {\n logString +=\n \"\\n\\n\\nYou Searched For: \" +\n searchTerm +\n \"\\nThis Search Resulted in \" +\n response.data.Search.length +\n \" results\" +\n \"\\n******** Results *********\\n\\n\";\n response.data.Search.forEach(movie => {\n logString +=\n \"Movie Title - \" +\n movie.Title +\n `\\nMovie Year - ${movie.Year}` +\n `\\nMovie IMDB ID - ${movie.imdbID}` +\n \"\\nMedia Type - \" +\n movie.Type +\n \"\\nPoster URL - \" +\n movie.Poster +\n \"\\n\\n\";\n });\n logString += \"\\n******** End *********\\n\";\n console.log(logString);\n logResults();\n });\n}", "function getMovieInfo() {\n\n\t//If the movie name is longer than one word, join the words together on one line so that the movie name is all one string.\n\t//Rather than having separate lines for each word.\n\tfor (var i = 3; i < input.length; i++) {\n\n\t\tif (i > 2 && i < input.length) {\n\t\t\tmovieName = movieName + \" \" + input[i];\n\t\t}\n\t\t//For example, if the user enters \"node liri.js movie this social network\", movieName should be \"social network\" when the value is logged the terminal.\n\t\t//console.log(movieName);\n\t}\n\n\t//If no movie name is specified on the command line, then show the movie info for the movie, Mr. Nobody.\n\tif (!movieName) {\n\t\t//If no movie is specified, set movieName equal to Mr. Nobody.\n\t\tmovieName = \"Mr Nobody\";\n\t\tconsole.log(\"If you haven't watched Mr. Nobody, then you should: http://www.imdb.com/title/tt0485947/\");\n\t\tconsole.log(\"It's on Netflix!\")\n\t}\n\n\t//Use the figlet npm package to convert the movieName text to art/drawing.\n\tfiglet(movieName, function (err, data) {\n\t\tif (err) {\n\t\t\tconsole.log('Something went wrong...');\n\t\t\tconsole.dir(err);\n\t\t\treturn;\n\t\t}\n\t\tconsole.log(data)\n\t});\n\n\t//Then, run a request to the OMDB API with the movieName value.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function (error, response, body) {\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\t\tvar movieInfo = JSON.parse(body);\n\t\t\t//console.log(movieInfo);\n\n\t\t\t// Create variable to hold Rotten Tomatoes Rating.\n\t\t\tvar tomatoRating = movieInfo.Ratings[1].Value;\n\n\t\t\t//Output the following information about movieName.\n\t\t\t// \\r\\n is used as a new line character in Windows: https://stackoverflow.com/questions/15433188/r-n-r-n-what-is-the-difference-between-them \n\t\t\tvar movieResult =\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Output the liri command plus movieName\n\t\t\t\t\"liri command: movie-this \" + movieName + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\" + \"\\r\\n\" +\n\t\t\t\t//Title of the movie.\n\t\t\t\t\"Title: \" + movieInfo.Title + \"\\r\\n\" +\n\t\t\t\t//Year the movie came out.\n\t\t\t\t\"Year movie was released: \" + movieInfo.Year + \"\\r\\n\" +\n\t\t\t\t//IMDB Rating of the movie.\n\t\t\t\t\"IMDB movie rating (out of 10): \" + movieInfo.imdbRating + \"\\r\\n\" +\n\t\t\t\t//Rotten Tomatoes rating of the movie.\n\t\t\t\t\"Rotten Tomatoes rating (out of 100%): \" + tomatoRating + \"\\r\\n\" +\n\t\t\t\t//Country where the movie was produced.\n\t\t\t\t\"Filmed in: \" + movieInfo.Country + \"\\r\\n\" +\n\t\t\t\t//Language of the movie.\n\t\t\t\t\"Language: \" + movieInfo.Language + \"\\r\\n\" +\n\t\t\t\t//Plot of the movie.\n\t\t\t\t\"Movie plot: \" + movieInfo.Plot + \"\\r\\n\" +\n\t\t\t\t//Actors in the movie.\n\t\t\t\t\"Actors: \" + movieInfo.Actors + \"\\r\\n\" +\n\t\t\t\t//Line break\n\t\t\t\t\"=======================================================================================================\"\n\n\t\t\t//Output the movie information to the terminal.\n\t\t\tconsole.log(movieResult);\n\t\t\t//Output the movie information to the log.txt file.\n\t\t\tlogData(movieResult);\n\t\t}\n\t});\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function movieThis(receivedMovie) {\n\n\n var movie = receivedMovie ? receivedMovie : \"Mr. Nobody\";\n\n // request to omdbapi using movie entered and trilogy api key\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=full&tomatoes=true&r=json&y=&plot=short&apikey=trilogy\", function (error, response, data) {\n\n // IF the request is successful. The status code is 200 if the status returned is OK\n if (!error && response.statusCode === 200) {\n\n // log the command issued to the log.txt file\n logCommand();\n\n // Display Data\n // TITLE, YEAR, IMDB RATING, COUNTRY, LANGUAGE(S), PLOT, ACTORS, ROTTEN TOMATO RATING, ROTTEN TOMATO URL\n console.log(\"Movie Title: \" + JSON.parse(data).Title);\n console.log(\"Release Year: \" + JSON.parse(data).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(data).imdbRating);\n console.log(\"TOMATOMETER: \" + JSON.parse(data).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(data).Country);\n console.log(\"Language: \" + JSON.parse(data).Language);\n console.log(\"Plot: \" + JSON.parse(data).Plot);\n console.log(\"Actors/Actresses: \" + JSON.parse(data).Actors);\n }\n\n });\n}", "function movieThis(movie){\n //This will pull from the omdb API and pull data about the movie\n axios.get(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n //console.log(response.data);\n console.log(\"-------------\");\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n //Add in the rotten tomatoes rating\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n console.log(\"-------------\");\n });\n}", "function dramaMoviesRate(array) {\n\n}", "function getMovieInfo() {\n let movieName = name;\n // if no movie name entered, 'Mr. Nobody' will appear\n if (!movieName) {\n movieName = \"Mr. Nobody \";\n }\n\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(function (response) {\n movieInfo = [\"Title: \" + response.data.Title,\n \"Year Released: \" + response.data.Year,\n \"IMDB Rating: \" + response.data.Ratings[0].Value,\n \"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"Country: \" + response.data.Country,\n \"Language: \" + response.data.Language,\n \"Plot: \" + response.data.Plot,\n \"Actors: \" + response.data.Actors];\n console.log(\"\\nTitle: \" + response.data.Title,\n \"\\nYear Released: \" + response.data.Year,\n \"\\nIMDB Rating: \" + response.data.Ratings[0].Value,\n \"\\nRotten Tomatoes Rating: \" + response.data.Ratings[1].Value,\n \"\\nCountry: \" + response.data.Country,\n \"\\nLanguage: \" + response.data.Language,\n \"\\nPlot: \" + response.data.Plot,\n \"\\nActors: \" + response.data.Actors);\n });\n\n}", "function onlyTheTitles(){\r\n let result = []\r\n for (let i = 0; i < movies.length; i++){\r\n let movie = movies[i]\r\n result.push(movie.Title)\r\n }\r\n return result\r\n}", "function discoverMovies(relevantGenres, irrelevantGenres) {\n let movieResults = [];\n\n for(let i = 1; i < 41; i++) {\n $.get('/discover-movies?relevantGenres=' + relevantGenres.join('|') + '&irrelevantGenres=' + irrelevantGenres + '&page=' + i + '&lyrics=' + trackLyrics, function(movies) { \n movieResults = movieResults.concat(movies.results);\n });\n }\n\n setTimeout(function() {\n rankMovies(movieResults);\n }, 5000);\n\n }", "function getVideos() {\n let videoArray = [];\n for (let mediaIndexer = 0; mediaIndexer < 3; mediaIndexer += 1) {\n //screenShot[0] === thumbnail\n //screenShot[1] === videoUrl\n const screenShot = {\n thumbnail: `'https://steam-content-videos.s3-us-west-2.amazonaws.com/steam_screenshot${mediaIndexer}.png'`,\n videoUrl: `'https://steam-content-videos.s3-us-west-2.amazonaws.com/steam_content_video${mediaIndexer}.mp4'`\n }\n\n videoArray.push(screenShot)\n }\n return JSON.stringify(videoArray);\n}", "function movieIt(title) {\n //creates the query url\n var URL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + title;\n\n //requests, saves the info, then logs it to file\n request(URL, function (err, response, body) {\n var data = JSON.parse(body);\n //console.log(data);\n\n var movieData = [\n \"Movie: \" + data.Title,\n \"Released: \" + data.Released,\n \"IMDB Rating: \" + data.Ratings[0].Value,\n \"Rotten Tomatos Rating: \" + data.Ratings[1].Value,\n \"Country of Origin: \" + data.Country,\n \"Language: \" + data.Language,\n \"Plot: \" + data.Plot,\n \"Players: \" + data.Actors\n ].join('\\n');\n\n fs.appendFile('log.txt', movieData + divider, function (err) {\n if (err) throw err;\n console.log(movieData);\n });\n });\n\n}", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function turnHoursToMinutes(array){\n var returnArray = \n array.map(function(oneMovie){\n\n var duration = oneMovie[\"duration\"];\n var hour = 0;\n var minute = 0;\n duration = duration.split(\" \");\n\n for(var i = 0; i < duration.length; i++){\n if(i == 0 && duration[i].indexOf('h') != -1){\n hour = parseInt(duration[0])*60;\n } else if(i == 0 && duration[i].indexOf('min') != -1) {\n minute = parseInt(duration[0]);\n } else if(i == 1 && duration[i].indexOf('min') != -1){\n minute = parseInt(duration[1]);\n }\n }\n duration = parseInt(hour + minute);\n\n var newMovie = {\n title: oneMovie.title,\n year: oneMovie.year,\n director: oneMovie.director,\n duration: duration,\n genre: oneMovie.genre,\n rate: oneMovie.rate\n };\n return newMovie;\n });\n return returnArray;\n}", "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\r\n var movie_title_orig = $('[class^=OriginalTitle__OriginalTitleText]').text().trim().replace(\"Original title: \", \"\");\r\n // reference\r\n if (movie_title_orig === \"\" && $('h3[itemprop=\"name\"]').length) {\r\n movie_title_orig = $.trim($($('h3[itemprop=\"name\"]')[0].nextSibling).text());\r\n }\r\n // not found\r\n if (movie_title_orig === \"\") {\r\n movie_title_orig = movie_title;\r\n }\r\n\r\n var movie_id = document.URL.match(/\\/tt([0-9]+)\\//)[1].trim('tt');\r\n var is_tv = Boolean($('title').text().match('TV Series'));\r\n // newLayout || reference : check if 'title' has just a year in brackets, eg. \"(2009)\"\r\n var is_movie = (Boolean($('[class^=TitleBlock__TitleMetaDataContainer]').text().match('TV')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \\(([0-9]*)\\)/));\r\n // newLayout || reference\r\n if (Boolean($('[class^=GenresAndPlot__Genre]').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {\r\n is_tv = false;\r\n is_movie = false;\r\n }\r\n\r\n // Start of External ratings code\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n externalRatings(movie_id, movie_title, movie_title_orig);\r\n }\r\n // Call to iconSorterCount() for the icons/sites sorting.\r\n iconSorterCount(is_tv, is_movie);\r\n\r\n // Create areas to put links in\r\n addIconBar(movie_id, movie_title, movie_title_orig);\r\n perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);\r\n if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaSecond();\r\n } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && !GM_config.get('switch_bars')) {\r\n getLinkAreaSecond();\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && GM_config.get('switch_bars')) {\r\n getLinkAreaThird();\r\n getLinkAreaSecond();\r\n }\r\n}", "function movie() {\n //****************** OMDB movies API ********************\n var API2 = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\"\n\n axios.get(API2).then(\n function (response) {\n console.log(\"================================================\");\n console.log(\"Title of the Movie: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced in: \" + response.data.Country);\n console.log(\"Language of the Movie: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n }\n )\n}", "function gotPageOfMovies(records, fetchNextPage) {\n console.log(\"gotPageOfMovies()\");\n console.log(\"There are \"+records.length+\" items in records\");\n// // This takes the list of records and add them to the people array\n movies.push(...records);\n // request more pages\n fetchNextPage();\n}", "function getMovieInfo(movieTitle) {\n\n // Runs a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?apikey=8b309cfb&t=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful...\n if (!error && response.statusCode === 200) {\n\n // Parses the body of the site and recovers movie info\n var movie = JSON.parse(body);\n\n // Prints out movie info\n logOutput(\"Movie Title: \" + movie.Title);\n logOutput(\"Release Year: \" + movie.Year);\n logOutput(\"IMDB Rating: \" + movie.imdbRating);\n logOutput(\"Country Produced In: \" + movie.Country);\n logOutput(\"Language: \" + movie.Language);\n logOutput(\"Plot: \" + movie.Plot);\n logOutput(\"Actors: \" + movie.Actors);\n logOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n logOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n }\n });\n}", "movieTimes() {\n let times = browser.elements('time.btn.btnhorario.ng-scope');\n let timesArray = []\n \n times.value.forEach(element => {\n if (browser.elementIdDisplayed(element.ELEMENT).value === true) {\n timesArray.push(browser.elementIdText(element.ELEMENT).value);\n }\n });\n\n console.log(timesArray)\n\n }", "function getMovieInfo() {\n\n\t//Then, run a request to the OMDB API with the movieName the user enters.\n\trequest(\"http://www.omdbapi.com/?t=\" + movieName + \"&apikey=trilogy\", function(error, response, body) {\n\n\t\t//Create variable to hold all the movie info that we will output to the console.\n\t\t//Parse the body of the JSON object that holds the movie data and display the movie info.\n\t\tvar movieInfo = JSON.parse(body);\n\t\t//Title of movie\n\t\tvar movieTitle = \"Title: \" + movieInfo.Title;\n\t\t//Year the movie came out.\n\t\tvar movieYear = \"Year movie was released: \" + movieInfo.Year;\n\t\t//IMDB Rating of the movie.\n\t\tvar IMDBRating = \"IMDB movie rating (out of 10): \" + movieInfo.imdbRating;\n\t\t//Rotten Tomatoes rating of the movie.\n\t\tvar rottenTomatoes = \"Rotten Tomatoes rating (out of 100%): \" + movieInfo.Ratings[1].Value;\n\t\t//Country where the movie was produced.\n\t\tvar countryProduced = \"Filmed in: \" + movieInfo.Country;\n\t\t//Language of the movie.\n\t\tvar movieLanguage = \"Language: \" + movieInfo.Language;\n\t\t//Plot of the movie.\n\t\tvar moviePlot = \"Movie plot: \" + movieInfo.Plot;\n\t\t//Actors in the movie.\n\t\tvar movieActors = \"Actors: \" + movieInfo.Actors;\n\n\t\t//If the request is successful (i.e. if the response status code is 200)\n\t\tif (!error && response.statusCode === 200) {\n\t\t\t//console.log(JSON.parse(body));\n\t\t\t//Output the following information to terminal window.\n\t\t\t//Title of the movie.\n\t\t\tconsole.log(movieTitle);\n\t\t \t//Year the movie came out.\n\t\t \tconsole.log(movieYear);\n\t\t \t//IMDB Rating of the movie.\n\t\t \tconsole.log(IMDBRating);\n\t\t \t//Rotten Tomatoes rating of the movie.\n\t\t \tconsole.log(rottenTomatoes);\n\t\t \t//Country where the movie was produced.\n\t\t \tconsole.log(countryProduced);\n\t\t \t//Language of the movie.\n\t\t \tconsole.log(movieLanguage);\n\t\t \t//Plot of the movie.\n\t\t \tconsole.log(moviePlot);\n\t\t \t//Actors in the movie.\n\t\t \tconsole.log(movieActors);\n\t\t}\n\t});\n}", "function renderMovies(movieArray) { \n\n function createHTML(movie) {\n return `<div class=\"card mb-3\">\n <img class=\"card-img-top\" src=\"${movie.Poster}\"/>\n\n <div class=\"card-body\">\n <h1 class=\"card-title\">${movie.Title}</h1>\n <h4 class=\"card-text\">${movie.Year}</h4>\n <button onclick=\"saveToWatchlist('${movie.imdbID}')\"> <span class=\"add-symbol\">+</span> ADD<span class=\"empty-space\">+</span></button>\n </div>\n </div>`;\n }\n\n moviesHTML = movieArray.map(createHTML); \n return moviesHTML.join(\"\");\n\n }", "function myCallback(movieData){\n pageObj.push(movieData);\n console.log(pageObj, 'added movie data');\n}", "function displayMiles (mileageLog) {\n for (let i = 0; i < mileageLog.length; i++)\n console.log(mileageLog[i])\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function movieDisplay() {\n\tvar movie = process.argv[3];\n\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\";\n\t\t//Calling the movieSubDisplay function............\n\t\tmovieSubDisplay();\n\t}\n\telse {\n\t\t\n\t\t//Calling the movieSubDisplay function......\n\t\tmovieSubDisplay();\n\t}\n\n\tfunction movieSubDisplay() {\n\t\trequest(\"http://www.omdbapi.com/?t=\"+ movie + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\tvar getMovie = JSON.parse(body);\n\t\t\t\tvar movieResult = \n\t\t\t\t\"\\n\" + \"--------------------------------------------------------------------\" + \"\\n\" +\n\t\t\t\t\" Title: \" + getMovie.Title + \"\\n\" +\n\t\t\t\t\" Year: \" + getMovie.Year + \"\\n\" +\n\t\t\t\t\" Imdb Rating: \" + getMovie.imdbRating + \"\\n\" +\n\t\t\t\t\" Rotten Tomatoes Rating: \" + getMovie.Ratings[1].Value+ \"\\n\" +\n\t\t\t\t\" Country: \" + getMovie.Country + \"\\n\" +\n\t\t\t\t\" Language: \" + getMovie.Language + \"\\n\" +\n\t\t\t\t\" Plot: \" + getMovie.Plot + \"\\n\" +\n\t\t\t\t\" Actors: \" + getMovie.Actors + \"\\n\" +\n\t\t\t\t\"--------------------------------------------------------------------\" + \"\\n\";\n\t\t\t\tconsole.log(movieResult);\n\t\t\t\tlogDisplay(movieResult);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"OMDB error: \" + error);\n\t\t\t}\n\t\t});\n\t}\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function moviethis(){\n var movieName = '';\n var theArg = process.argv;\n \n if(input===undefined){\n // if no movie name is entered\n movieName = 'Mr.'+\"+\"+\"Nobody\"; \n } else {\n // otherwise this captures movie names with 1 or more words\n for(i=3; i<theArg.length; i++){\n movieName += theArg[i]+\"+\";\n }\n \n }\n \n //run axios using OMDB API\n var url = \"http://www.omdbapi.com/?t=\"+movieName+\"&y=&plot=short&apikey=trilogy\";\n axios.get(url)\n .then(\n function(response) { \n console.log(\"Title: \"+response.data.Title);\n console.log(\"Release Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \"+response.data.Ratings[0].Value);\n console.log(\"Country Produced: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot: \"+response.data.Plot);\n console.log(\"Actors :\"+response.data.Actors);\n }\n );\n }", "function turnHoursToMinutes(moviesArray) {\n var moviesWithCorrectTimeFormat = [];\n var eachMovieHours, eachMovieMinutes, totalMinutes, singleMovieWithCorrectTimeFormat;\n moviesArray.map(function(eachMovie) {\n eachMovieHours = 0;\n eachMovieMinutes = 0;\n totalMinutes = 0;\n if(eachMovie.duration.indexOf(\"h\")!==-1){\n eachMovieHours = eachMovie.duration.slice(0, eachMovie.duration.indexOf(\"h\"));\n }\n else{\n eachMovieHours=0;\n }\n eachMovieMinutes = eachMovie.duration.slice(eachMovie.duration.indexOf(\"h\") + 1, eachMovie.duration.indexOf(\"m\"));\n totalMinutes = (60 *eachMovieHours) + (1* eachMovieMinutes);\n singleMovieWithCorrectTimeFormat = Object.assign({},eachMovie);\n singleMovieWithCorrectTimeFormat.duration = totalMinutes;\n moviesWithCorrectTimeFormat.push(singleMovieWithCorrectTimeFormat);\n });\n return moviesWithCorrectTimeFormat;\n }", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "function movieData(title) {\n\n // This conditional statement handles the case where the user does not put a movie by returning the default movie selection: Do The Right Thing\n if (title === undefined) {\n\n title = 'Do The Right Thing';\n console.log('Since you didn\\'t request a specific movie title, I suggest that you watch this one!\\n');\n\n };\n\n // The request docs provide the sytax for its use which I followed here to make an api call to omdb\n request(\"http://www.omdbapi.com/?apikey=49544f9c&t=\" + title, function (error, response, body) {\n\n // If there is an error display the error message otherwise do not\n if (error == true) {\n console.log('error:', error);\n };\n\n let omdbResponse = JSON.parse(body);\n console.log(omdbResponse);\n\n if (omdbResponse.Error === 'Movie not found!') {\n console.log(`Movie not found. Sorry about that!\\n`)\n } else {\n // this for loop loops through the ratings array (which has three little objects in it) so that i can scope the Ratings key and pull out the Rotten Tomatoes Value\n for (let i = 0; i < omdbResponse.Ratings.length; i++) {\n\n // I left this console log in here so that you can see what the result of the for loop looks like and why I used it\n // console.log(omdbResponse.Ratings[i])\n\n };\n\n // These console.logs are printing out different bits of information from the body of the response\n console.log(`Movie title: ${omdbResponse.Title}`);\n console.log(`This movie was released: ${omdbResponse.Released}`);\n console.log(`The IMDB rating for this movie is: ${omdbResponse.imdbRating}`);\n console.log(`Rotten Tomatoes gives this move a rating of: ${omdbResponse.Ratings[1].Value}`);\n console.log(`This movie was filmed in: ${omdbResponse.Country}`);\n console.log(`This movie is in: ${omdbResponse.Language}`);\n console.log(`Here is a brief synopsis of the plot: ${omdbResponse.Plot}`);\n console.log(`Starring: ${omdbResponse.Actors} \\n\\nThis concludes the information for your current request. Thank you for using Liri. \\n`);\n }\n\n });\n\n}", "function directorMovies(){\nconst director = movies.filter(function(movies){\n return movies.director == \"Steven Spielberg\"\n})\n\nspielBergMovies = []\n\nfor (let i = 0; i<director.length; i+=1){\n spielBergMovies.push(director[i].title)\n}\nconsole.log(\"Steven Spielberg movies has \"+ spielBergMovies.length+ \" movies: \"+ spielBergMovies )\n}", "function movie() {\n var movie = name;\n\n //The object that tells OMDB what movie to return information for\n var options = {\n url: 'http://www.omdbapi.com/?t=' + movie,\n method: 'GET'\n };\n\n //Sending request to OMDB and storing subsequent callback data\n request(options, function(err, res, body) {\n var json = JSON.parse(body);\n //Filtering specific callback data into variables\n var title = 'Title: ' + json.Title;\n var year = 'Year: ' + json.Year;\n var rating = 'IMDB Rating: ' + json.imdbRating;\n var country = 'Country: ' + json.Country;\n var language = 'Language: ' + json.Language;\n var plot = 'Plot: ' + json.Plot;\n var actors = 'Actors: ' + json.Actors;\n var rotten = 'Rotten Tomatoes: ' + json.Ratings[1].Value;\n\n //Calling varibles in terminal - ** SEAN: no noeed to write console.log() x 10\n console.log(title, year, rating, country, language, plot, actors, rotten);\n\n //Appending data to log.txt\n fs.appendFile('log.txt', '\\n' + line + '\\n' + title + '\\n' + year + '\\n' + rating + '\\n' + country + '\\n' + language + '\\n' + plot + '\\n' + actors + '\\n' + rotten + '\\n' + line + '\\n');\n });\n\n}", "function movieData() {\n var request = require('request');\n request('http://www.omdbapi.com/?apikey=Trilogy&t='+ name , function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"\\nTitle of the movie: \" + JSON.parse(body).Title);\n console.log(\"Year the movie came out: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating of the movie: \" + JSON.parse(body).imdbRating);\n console.log(\"Country where the movie was produced: \" + JSON.parse(body).Country);\n console.log(\"Language of the movie: \" + JSON.parse(body).Language);\n console.log(\"Plot of the movie: \" + JSON.parse(body).Plot);\n console.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL + \"\\n\");\n \n }\n\n }); \n}", "async newReleases() {\n const page = await Browser.newOptimizedPage()\n\n try {\n const anime = []\n await page.goto(moenime_url + '/tag/ongoing/')\n\n await page.waitForSelector('article')\n const articles = await page.$$('article')\n await Util.asyncForEach(articles, async (article) => {\n const episode = await article.$eval('div > div.postedon', node => node.innerText)\n const info = await article.$eval('div > div.out-thumb > h1 > a', node => {\n return { title: node.innerText, link: node.href }\n })\n \n anime.push({\n episode: episode.split(' ')[1],\n title: info.title,\n link: info.link.replace(moenime_url, '').replace(/\\/+$/, ''),\n raw_link: info.link\n })\n })\n\n await page.close()\n\n return anime\n } catch (error) {\n await page.close()\n\n return Handler.error(error)\n }\n }", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}", "function movie() {\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=40e9cece\";\n\n //console.log(queryUrl);\n\n request(queryUrl, function(error, response, body) {\n\n //console.log(response);\n if (error) throw error;\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n // console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Year); --doesnt have it\n }\n });\n}", "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function getMovieInfo(url) {\n let rankPattern = /<strong class=\"ll rating_num\" property=\"v:average\">([0-9.]+)<\\/strong>/\n let NamePattern = /<span property=\"v:itemreviewed\">(.+?)<\\/span>/\n let summaryPattern = /<span property=\"v:summary\" .*?>(.+?)<\\/span>/\n\n return request.get({\n url:url,\n // headers: options.headers\n })\n .promise()\n .then(function(html){\n let $ = cheerio.load(html)\n let $genres = $('#info > span[property=\"v:genre\"]')\n let genres = ''\n $genres.each(function(i, el){\n genres += $(this).text() + ' '\n })\n genres = genres.trimRight()\n genres = genres.replace(/ /g, '|')\n let rank = html.match(rankPattern) ? html.match(rankPattern)[1] : null\n let movieName = html.match(NamePattern) ? html.match(NamePattern)[1] : null\n\n return {\n newUrls: getUrls(html),\n rank,\n movieName,\n genres\n }\n })\n}", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "async fetchTimeframes() {\n const url = this.createUrlBuilder().build();\n return timeframes_1.parseTimeframesPage(await this.request(url, \"txt\" /* TEXT */));\n }", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "function movieYear (array, year) {\n for (i = 0; i < array.length; i++) {\n if (array[i].year == year) {\n console.log(array[i]);\n }\n }\n}", "function movieInfo() {\n let tit = document.getElementById(\"title\")\n tit.innerText = allFilms[0].title\n\n let rntm = document.getElementById(\"runtime\")\n rntm.innerText = `${allFilms[0].runtime} minutes`\n\n let desc = document.getElementById(\"film-info\")\n desc.innerText = allFilms[0].description\n\n let shwt = document.getElementById(\"showtime\")\n shwt.innerText = allFilms[0].showtime\n\n let tix = document.getElementById(\"ticket-num\")\n let tixRem = (allFilms[0].capacity - allFilms[0].tickets_sold)\n tix.innerText = `${parseInt(tixRem)}`\n}", "function writeMovieInfo(mvName){\n // console.log(\"The movie name is \" + mvName);\n\n // If the user doesn't type a movie in, the program will output data for the movie 'Mr. Nobody.'\n if ((mvName===\"\") || (mvName===undefined))\n {\n mvName = \"Mr.+Nobody\"; \n }\n\n // console.log(\"The movie name is \" + mvName);\n // * Title of the movie.\n // * Year the movie came out.\n // * IMDB Rating of the movie.\n // * Rotten Tomatoes Rating of the movie.\n // * Country where the movie was produced.\n // * Language of the movie.\n // * Plot of the movie.\n // * Actors in the movie.\n var axios = require(\"axios\");\n // Then run a request with axios to the OMDB API with the movie specified\n axios.get(\"http://www.omdbapi.com/?t=\" + mvName + \"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n // console.log(JSON.stringify(response.data, null, 2));\n // first some error handling\n if (response.data.Response === \"False\")\n {\n console.log(\"Sorry, the movie \" + movieResponse.movieName + \" was not found, try another one.\");\n return;\n }\n // console.log(JSON.stringify(response.data, null, 2));\n console.log(\"Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n // need to parse array of ratings to find the Rotten Tomatoes one\n ratings = response.data.Ratings;\n var rtRating = \"\";\n for (var i=0; i<ratings.length; i++){\n if (ratings[i].Source === \"Rotten Tomatoes\")\n rtRating = ratings[i].Value;\n }\n \n console.log(\"Rotten Tomatoes Rating: \" + rtRating);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n });// end of axios call then\n }", "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n if (movieName === \"\") {\n movieName = \"Mr. Nobody\";\n }\n\n var movieQueryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=plot=short&apikey=trilogy\" + omdb;\n\n //npm call and arrangement of data into information.\n request(movieQueryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var movieData = JSON.parse(body);\n console.log(\"Title: \" + movieData.Title + \"\\nRelease Year: \" + movieData.Year);\n\n for (var i = 0; i < movieData.Ratings.length; i++) {\n console.log(\"Rating: \" + movieData.Ratings[i].Source + \" \" + movieData.Ratings[i].Value)\n }\n console.log(\"Country Produced: \" + movieData.Country + \"\\nLanguage: \" + movieData.Language +\n \"\\nActors: \" + movieData.Actors + \"\\nPlot: \" + movieData.Plot);\n } else {\n return console.log(error);\n }\n });\n}", "function showTheatreMovie(req,res,next){\n // var tID = req.params.id;\n db.many(`SELECT m.movie_id, m.title, array_to_string(array_agg(tms.showtime), ',') showtimes\n FROM movies m INNER JOIN theatre_movie_showtime tms\n ON m.movie_id = tms.movie_id WHERE tms.theatre_id = ($1)\n GROUP BY m.movie_id;`, [req.params.id])\n .then((data)=>{\n console.log(data); // should get multiple movies in a theatre\n res.rows = data;\n next();\n })\n .catch(()=>{\n console.log('ERROR in showing ALL MOVIES IN A THEATRE!');\n })\n}", "async function loadData (page, movieNumber) {\n\n let data = await fetch (`https://api.themoviedb.org/3/discover/movie?api_key=f0fea38f1fe76d3ba0daa8f0f718a404&language=en-US&sort_by=popularity.desc&year=2018&include_adult=false&include_video=true&page=${page}`)\n let dataToStore = await data.json();\n\n\n let movieList = dataToStore.results\n .filter((movie) => movie.release_date > '2017-01-01')\n .map((movie) => {\n return new Solution (movie.title,\n movie.overview, \n `https://image.tmdb.org/t/p/w500/${movie.poster_path}`,\n )\n })\n movieData = movieList[movieNumber];\n task = movieData.title\n .toUpperCase()\n .split(\"\");\n return task;\n\n\n}", "function myMovie(moviename) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + moviename + \"&y=&plot=short&apikey=trilogy\";\n // Then create a request to the queryUrl\n // Set the options on the request before call the request method\n const options = {\n url: queryUrl,\n method: 'GET',\n headers: {\n 'Accept': 'application/json',\n 'Accept-Charset': 'utf-8'\n }\n };\n\n request(options, function (err, res, body) {\n // If the request is successful\n if (!err && res.statusCode === 200) {\n let json = JSON.parse(body);\n console.log(\"Title of the movie: \" + json.Title);\n console.log(\"Year the movie came out: \" + json.Year);\n console.log(\"IMDB Rating of the movie: \" + json.imdbRating);\n for (i = 0; i < json.Ratings.length; i++) {\n if (json.Ratings[i].Source === \"Rotten Tomatoes\") {\n console.log(\"Rotten Tomatoes Rating of the movie: \" + json.Ratings[i].Value);\n var justForLog = json.Ratings[i].Value;\n };\n };\n console.log(\"Country where the movie was produced: \" + json.imdbRating);\n console.log(\"Language of the movie: \" + json.Language);\n console.log(\"Plot of the movie: \" + json.Plot);\n console.log(\"Actors in the movie: \" + json.Actors);\n logIt(\"logging myMovie<>\"+json.Title+\",\"+json.Year+\",\"+json.imdbRating+\",\"+justForLog+\",\"+json.imdbRating+\",\"+json.Language+\",\"+json.Plot+\",\"+json.Actors);\n };\n });\n}", "function howManyMovies(arr) {\n var spielbergMovies = [];\n \n}", "function movieThis(movie) {\n \n // In case of empty movie, it will use this one as default\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n\n var description = \"These are the information about the movie \" + movie.toUpperCase() + \":\\n\\n\";\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios.get(queryUrl).then(\n function (response) {\n\n var divider = \"\\n------------------------------------------------------------\\n\\n\";\n var data = response.data;\n var movieData;\n\n // If data comes empty\n if (data == 0) { //need to review this one\n movieData = \"There's no movie like this.\\n\";\n } else {\n\n // To get the data from Rotten Tomatoes\n var rottenTomatoes = \"\";\n\n for (var i = 0; i < data.Ratings.length; i++) {\n if (data.Ratings[i].Source == \"Rotten Tomatoes\") {\n rottenTomatoes = data.Ratings[i].Value;\n }\n }\n\n // Creating a variable with all data required to use on print/save\n movieData = [\n \"\\tMovie: \" + data.Title,\n \"\\tYear Released: \" + data.Year,\n \"\\tiMDB Rating: \" + data.imdbRating,\n \"\\tRotten Tomatoes Rating: \" + rottenTomatoes,\n \"\\tCountry: \" + data.Country,\n \"\\tLanguage: \" + data.Language,\n \"\\tActors: \" + data.Actors,\n \"\\tPlot: \" + data.Plot\n ].join(\"\\n\");\n }\n\n // Saving data in file\n fs.appendFile(\"log.txt\", divider + description + movieData + \"\\n\", function (err) {\n console.log(divider + description + movieData + \"\\n\");\n if (err) throw err;\n });\n\n })\n\n .catch(function (error) {\n if (error.response) {\n console.log(error.response);\n }\n });\n}", "function movieThis(query) {\n process.stdout.write(clc.move.to(20, 25));\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + query + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n //console.log(JSON.parse(body));\n var body = JSON.parse(body);\n if (!error && response.statusCode === 200 && body.Response !== \"False\") {\n talkNow(\"I found your movie\");\n console.log(\"\\nHere are your \" + command + \" results:\\n\")\n console.log(\"Title: \" + body.Title);\n talkNow(\"Title: \" + body.Title)\n console.log(\"Year: \" + body.Year);\n var ratings = body.Ratings;\n ratings.forEach(function(rating) {\n if (rating.Source === 'Rotten Tomatoes' || rating.Source === 'Internet Movie Database') {\n console.log(rating.Source + \" \" + rating.Value);\n }\n });\n console.log(\"Country: \" + body.Country);\n console.log(\"Language: \" + body.Language);\n console.log(\"Plot: \" + body.Plot); // \"Year:\" + body.Year\t);\n console.log(\"Actors:\" + body.Actors + \"\\n\\n\")\n } else {\n process.stdout.write(clc.move.to(50, 25));\n console.log(clc.red.bold(body.Error + \"\\n\"));\n process.stdout.write(clc.move.to(50, 27));\n console.log(clc.red(\"Please make sure to enter a movie\\n\\n\\n\\n\\n\\n\"))\n }\n var plot = JSON.stringify(body.plot);\n })\n}", "function runMovie(movieTitle) {\n console.log(\"*******************************************\");\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n // Parse the body of the site and recover just the imdbRating\n\n\n // (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\n console.log(\"Movie Title: \" + JSON.parse(body).Title)\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Movie Rating: \" + JSON.parse(body).Rated);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country Where Movie Was Produced: \" + JSON.parse(body).Country);\n console.log(\"Language Produced: \" + JSON.parse(body).Language)\n console.log(\"Movie Plot: \" + JSON.parse(body).Plot)\n console.log(\"List of Actors: \" + JSON.parse(body).Actors)\n }\n });\n // Title of the movie.\n // * Year the movie came out.\n // * IMDB Rating of the movie.\n // * Rotten Tomatoes Rating of the movie.\n // * Country where the movie was produced.\n // * Language of the movie.\n // * Plot of the movie.\n // * Actors in the movie.\n}", "function getMovieInfo(movieName) {\n console.log(\"Get Movie\");\n if (movieName === undefined) {\n movieName = \"Mr Nobody\";\n }\n\n var movieURL =\n \"http://www.omdbapi.com/?t=\" +\n movieName +\n \"&y=&plot=full&tomatoes=true&apikey=trilogy\";\n axios\n .get(movieURL)\n .then(function(response) {\n var jsonData = response.data;\n var movieData = [\n divider,\n \"Title: \" + jsonData.Title,\n \"Year: \" + jsonData.Year,\n \"Country: \" + jsonData.Country,\n \"Language: \" + jsonData.Language,\n \"Plot: \" + jsonData.Plot,\n \"Actors: \" + jsonData.Actors,\n divider\n ].join(\"\\n\\n\");\n console.log(movieData);\n })\n .catch(function(error) {\n console.log(error);\n })\n .finally(function() {});\n}", "movieTitles() {\n let movie = browser.elements('.datalayer-movie.ng-binding');\n let movieArray = []\n \n movie.value.forEach(element => {\n if (browser.elementIdDisplayed(element.ELEMENT).value === true) {\n movieArray.push(browser.elementIdText(element.ELEMENT).value);\n }\n });\n\n console.log(movieArray)\n\n }", "function readTitles(_aMoviesArr) {\r\n var _stringToShow = \"The names of the movies are: \";\r\n\r\n for (var i = 0; i < _aMoviesArr.length; i++) {\r\n if (i < _aMoviesArr.length - 1) {\r\n _stringToShow += _aMoviesArr[i].Title + \", \";\r\n } else \r\n {\r\n _stringToShow += _aMoviesArr[i].Title;\r\n }\r\n }\r\n _stringToShow += \".\";\r\n return _stringToShow;\r\n\r\n}", "function showMovies(){\n let memory = localStorage.getItem(\"MyMovies\");\n console.log(memory);\n let parsedMemory = JSON.parse(memory);\n console.log(parsedMemory);\n\n\n parsedMemory.forEach(movie => {\n \n let cast = movie.cast;\n let castArray = cast.split(\",\");\n \n // append cards\n $(\"#movie-cards\").append(\n `<div class=card><img class=card-img-top src=\"\"></img><div class=card-body><div class=text-center id=card-text><p id = card-title>${movie.title} ${movie.year}</p><p class=card-text id=genre>genre: ${movie.genre}<p class=card-text id=director>dir: ${movie.director}</p><p class=card-text id=cast>top-billed: ${castArray[0]}, ${castArray[1]},</p><p class=card-text id=cast>${castArray[2]}, ${castArray[3]}.</p><p class=card-text id=plot>${movie.plot}</p></div><div class=my-info> <p id=rating>${movie.rating}/5</p><p id=review>${movie.review}</p></div>`\n );\n\n })}", "function printMovieDetail() {\n if (movie.bkgimage != null) {\n bkgImageElt.css('background-image', `url(${movie.bkgimage})`);\n }\n else {\n bkgImageElt.css('background-image', `linear-gradient(rgb(81, 85, 115), rgb(21, 47, 123))`);\n }\n\n titleElt.text(movie.title);\n modalTitle.text(movie.title);\n originaltitleElt.text(movie.originaltitle);\n resumeElt.text(movie.resume);\n dateElt.text(printDateFr(movie.date));\n durationElt.text(printDuration(movie.duration));\n imgElt.attr('src', movie.image);\n iframe.attr('src', movie.traileryt + \"?version=3&enablejsapi=1\");\n // Afficher la liste des acteurs\n var actorsStr = '';\n for (var actor of movie.actors) {\n actorsStr += actor + ' | ';\n }\n actorsElt.text(actorsStr);\n // afficher le réalisteur\n directorElt.text(movie.director);\n}", "function PrintScreenLogResults() {\n TestResultsArray[ScreenLogsCounter] = [];\n TestResultsArray[ScreenLogsCounter][0] = '';\n TestResultsArray[ScreenLogsCounter][1] = window.screen.height;\n TestResultsArray[ScreenLogsCounter][2] = window.screen.width;\n TestResultsArray[ScreenLogsCounter][3] = window.screen.availHeight;\n TestResultsArray[ScreenLogsCounter][4] = window.screen.availWidth;\n TestResultsArray[ScreenLogsCounter][5] = window.innerHeight;\n TestResultsArray[ScreenLogsCounter][6] = window.innerWidth;\n}", "function getMovieGenres() {\n let queryURL =\n \"https://api.themoviedb.org/3/genre/movie/list?api_key=\" +\n API_KEY +\n \"&language=en-US\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n let movieGenres = [];\n for (let i = 0; i < response.genres.length; i++) {\n movieGenres.push(response.genres[i].name);\n }\n console.log(movieGenres);\n });\n}", "function getMovies(number){\n console.log(\"number\", number);\n // 20 movies per page, how many pages do we need to get?\n let pagePromises = []\n let pages = Math.ceil(number / 20)\n for (let i=1; i < pages + 1; i++ ){\n pagePromises.push(getMoviePage(i))\n }\n return Promise.all(pagePromises)\n .then( moviesArr => {\n return moviesArr.reduce( (accum, next) => {\n return accum.concat(next)\n }, [])\n })\n}", "function showMovieInfo(value) {\n if (value === undefined) {\n value = \"Mr. Nobody\"\n console.log(\"=======================================\");\n console.log(\"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\");\n console.log(\"It's on Netflix!\");\n\n fs.appendFileSync(\"log.txt\", \"=======================================\"+\"\\n\");\n fs.appendFileSync(\"log.txt\", \"If you haven't watched 'Mr. Nobody,' then you should: http://www.imdb.com/title/tt0485947/\" +\"\\n\");\n fs.appendFileSync(\"log.txt\", \"It's on Netflix!\\n\");\n }\n\n value = value.replace(/\\s+/g, \"_\"); //replace spaces with underscores\n axios.get(\"http://www.omdbapi.com/?t=\" + value + \"&y=&plot=short&apikey=trilogy\").then(\n function (movies) {\n console.log(\"===============MOVIE INFO===============\"); \n console.log(\"Title: \" + movies.data.Title);\n console.log(\"Release Year: \" + movies.data.Year);\n console.log(\"IMDB Rating: \" + movies.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + movies.data.Ratings[1].Value);\n console.log(\"Country of Production: \" + movies.data.Country);\n console.log(\"Language: \" + movies.data.Language);\n console.log(\"Plot: \" + movies.data.Plot);\n console.log(\"Actors: \" + movies.data.Actors);\n console.log(\"========================================\");\n \n fs.appendFileSync(\"log.txt\", \"===============MOVIE INFO===============\\n\");\n fs.appendFileSync(\"log.txt\", \"Title: \" + movies.data.Title + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Release Year: \" + movies.data.Year + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"IMDB Rating: \" + movies.data.imdbRating + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Rotten Tomatoes Rating: \" + movies.data.Ratings[1].Value + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Country of Production: \" + movies.data.Country + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Language: \" + movies.data.Language + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Plot: \" + movies.data.Plot + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"Actors: \" + movies.data.Actors + \"\\n\");\n fs.appendFileSync(\"log.txt\", \"========================================\"+\"\\n\");\n }\n )\n .catch(function (error){\n console.log('Error occurred.');\n });\n}", "function getActivityList(activities) {\n var activityList = new Array();\n var lowTime = 25;\n var highTime = -1;\n\n for (var j=0; j < activities.length; j++) {\n var activity = activities[j];\n\n var name = activity.getAttribute('name');\n var id = activity.getAttribute('id');\n var type = activity.getAttribute('type');\n var term = activity.getAttribute('term');\n var url = activity.getAttribute('url');\n\n var times = activity.getElementsByTagName(\"time\");\n var timesList = new Array();\n for (var k=0; k < times.length; k++) {\n var time = times[k];\n\n var start = time.getAttribute('start');\n var end = time.getAttribute('end');\n var startFloat = timeStringToFloat(start);\n var endFloat = timeStringToFloat(end);\n\n if (startFloat < lowTime) {\n lowTime = startFloat;\n }\n if (endFloat > highTime) {\n highTime = endFloat;\n }\n var day = time.getAttribute('day');\n var dayInt = dayStringToInt(day);\n var term = time.getAttribute('term');\n \n timesList[k] = new Time(startFloat, endFloat, dayInt, term);\n }\n activityList[j] = new Activity(name, timesList, id, type, url);\n }\n var startTime = parseInt(lowTime);\n var endTime = parseInt(highTime + 0.5);\n return [startTime, endTime, activityList];\n}", "function getMovieInfo(movieTitle) {\n\n\t// Runs a request to the OMDB API with the movie specified.\n\n\tvar queryUrl = \"http://www.omdbapi.com/?s=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json&apikey=trilogy\";\n\n\tomdb(queryUrl, function (error, response, body) {\n\t\t// console.log(\"Here\",body)\n\n\t\tif (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\n\t\t// If the request is successful...\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parses the body of the site and recovers movie info.\n\n\t\t\tvar movie = JSON.parse(body);\n\n\t\t\t// Prints out movie info form omdb server.\n\n\t\t\tlogOutput(\"Movie Title: \" + movie.Title);\n\n\t\t\tlogOutput(\"Release Year: \" + movie.Year);\n\n\t\t\tlogOutput(\"IMDB Rating: \" + movie.imdbRating);\n\n\t\t\tlogOutput(\"Country Produced In: \" + movie.Country);\n\n\t\t\tlogOutput(\"Language: \" + movie.Language);\n\n\t\t\tlogOutput(\"Plot: \" + movie.Plot);\n\n\t\t\tlogOutput(\"Actors: \" + movie.Actors);\n\n\t\t\t// Had to set to array value, as there seems to be a bug in API response,\n\n\t\t\t// that always returns N/A for movie.tomatoRating.\n\n\t\t\tlogOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n\n\t\t\tlogOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n\n\t\t}\n\n\t});\n\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }" ]
[ "0.62681186", "0.60520506", "0.58869755", "0.58587795", "0.5823599", "0.5811336", "0.58056545", "0.5804251", "0.57623607", "0.56571966", "0.56558657", "0.56411785", "0.56084615", "0.5586565", "0.558214", "0.556694", "0.55587894", "0.55558974", "0.55535245", "0.55494946", "0.55483913", "0.55355245", "0.552147", "0.5513966", "0.5513477", "0.5510431", "0.55069935", "0.54764223", "0.54498976", "0.54477894", "0.54452085", "0.5427061", "0.54093975", "0.54088545", "0.5408601", "0.53992707", "0.5395295", "0.5392795", "0.5381315", "0.53717136", "0.5369628", "0.5356244", "0.53342235", "0.5333588", "0.5329224", "0.53278387", "0.53202957", "0.5319204", "0.53146255", "0.5303287", "0.5296167", "0.529318", "0.52869195", "0.5275353", "0.52708113", "0.527016", "0.52686256", "0.5255242", "0.5249414", "0.52456474", "0.5244404", "0.5241576", "0.5234648", "0.52338684", "0.523241", "0.52290297", "0.521923", "0.5218818", "0.52138686", "0.5213294", "0.52117735", "0.52095526", "0.5209047", "0.52059275", "0.5204264", "0.5204106", "0.52012503", "0.5198781", "0.519458", "0.51928467", "0.51897246", "0.5185368", "0.51837146", "0.5179477", "0.5176428", "0.51760817", "0.5174859", "0.51727575", "0.5164643", "0.51635677", "0.5156601", "0.5155626", "0.515354", "0.514959", "0.5148956", "0.5147248", "0.514666", "0.51431054", "0.51394993", "0.51386374", "0.5135021" ]
0.0
-1
Method to Compare Times Between Individual Pages and Theatre Page
compareTimes() { console.log("compareTimes") }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static compareTimes(t1, t2) {\n\t\twhile (t1.indexOf(\"p\") !== -1) {\n\t\t\tif (t1.substring(t1.indexOf(\"p\") - 5, t1.indexOf(\"p\") - 3) !== \"12\") {\n\t\t\t\tt1 = t1.substring(0, t1.indexOf(\"p\") - 5) +\n\t\t\t\t\t(~~t1.substring(t1.indexOf(\"p\") - 5, t1.indexOf(\"p\") - 3) + 12).toString()\n\t\t\t\t\t+ t1.substring(t1.indexOf(\"p\") - 3, t1.indexOf(\"p\")) +\n\t\t\t\t\tt1.substring(t1.indexOf(\"p\") + 1);\n\t\t\t} else {\n\t\t\t\tt1 = t1.substring(0, t1.indexOf(\"p\")) + t1.substring(t1.indexOf(\"p\") + 1);\n\t\t\t}\n\n\t\t}\n\t\twhile (t2.indexOf(\"p\") !== -1) {\n\t\t\tif (t2.substring(t2.indexOf(\"p\") - 5, t2.indexOf(\"p\") - 3) !== \"12\") {\n\t\t\t\tt2 = t2.substring(0, t2.indexOf(\"p\") - 5) +\n\t\t\t\t\t(~~t2.substring(t2.indexOf(\"p\") - 5, t2.indexOf(\"p\") - 3) + 12).toString()\n\t\t\t\t\t+ t2.substring(t2.indexOf(\"p\") - 3, t2.indexOf(\"p\")) +\n\t\t\t\t\tt2.substring(t2.indexOf(\"p\") + 1);\n\t\t\t} else {\n\t\t\t\tt2 = t2.substring(0, t2.indexOf(\"p\")) + t2.substring(t2.indexOf(\"p\") + 1);\n\t\t\t}\n\n\t\t}\n\n\t\tvar t11 = t1.substring(0, t1.indexOf(\"-\"));\n\t\tvar t12 = t1.substring(t1.indexOf(\"-\") + 1);\n\t\tvar t21 = t2.substring(0, t2.indexOf(\"-\"));\n\t\tvar t22 = t2.substring(t2.indexOf(\"-\") + 1);\n\n\t\tif ((t21 >= t11 && t21 <= t12) || (t22 >= t11 && t22 <= t12) || (t11 >= t21 && t11 <= t22)) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}", "compareArrivalTimes(a, b){\n const stationA = a.timeTableRows.find(station => station.stationShortCode === this.state.station.stationShortCode\n && station.type === this.state.stopType);\n const stationB = b.timeTableRows.find(station => station.stationShortCode === this.state.station.stationShortCode\n && station.type === this.state.stopType);\n\n const timeA = new Date(stationA.liveEstimateTime || stationA.scheduledTime);\n const timeB = new Date(stationB.liveEstimateTime || stationB.scheduledTime);\n\n return timeA - timeB;\n }", "function timeCompare(time1, time2) {\n time1 = time1.toLowerCase();\n time2 = time2.toLowerCase();\n var regex = /^(\\d{1,2}):(\\d{2}) ?(am|pm)$/;\n regex.exec(time1);\n var time1amPm = RegExp.$3;\n var time1Hour = RegExp.$1;\n var time1Minute = RegExp.$2; \n regex.exec(time2);\n var time2amPm = RegExp.$3;\n var time2Hour = RegExp.$1;\n var time2Minute = RegExp.$2;\n\n //if am/pm are different, determine and return\n if(time1amPm == 'am' && time2amPm == 'pm') return -1;\n else if(time1amPm == 'pm' && time2amPm == 'am') return 1;\n //if hours are different determine and return\n if(time1hour < time2hour) return -1;\n else if(time1hour > time2hour) return 1;\n //if minutes are different determine and return\n if(time1Minute < time2Minute) return -1;\n else if(time1Minute > time2Minute) return 1;\n\n //times are the same\n return 0;\n}", "function timeCompare(a,b){\n\t\t\t\tif(a.playtime_forever < b.playtime_forever){\n\t\t\t\t\treturn 1;\n\t\t\t\t}else if(a.playtime_forever > b.playtime_forever){\n\t\t\t\t\treturn -1;\n\t\t\t\t}\n\t\t\t\treturn 0;\n\t\t\t}", "function multiTimeFunc(content) {\n var timeToPred = 0;\n times.push(content);\n if (times.length == startStations.length) {\n for (var a = 0; a < times.length; a++) {\n timeToPred += times[a];\n }\n for (let y = 0; y < startEndTimes.length; y++) {\n timeToPred+=startEndTimes[y];\n }\n timeToPred = Math.floor(timeToPred);\n document.getElementById('time' + routeChosen).innerHTML = timeToPred + \" minutes\";\n }\n }", "function movies (flight_time, movie_lenghts){\n let firstMovie, secondMovie = 0;\n let movieMap = new Map();\n for(let i=0; i<movie_lenghts.length; i++){\n firstMovie = movie_lenghts[i] // 210\n secondMovie = flight_time - firstMovie //300 - 210 = 90 \n if(movieMap.has(secondMovie)) {\n return true;\n }\n movieMap.set(firstMovie)\n }\n return false\n}", "function sortTimes (timesArray) {\n\ttimesArray.forEach(function(time) {\n\t\tif (time.includes('P')){\n\t\t\ttimesPM.push(time);\n\t\t} else {\n\t\t\ttimesAM.push(time);\n\t\t}\n\n\t});\n\t// console.log(\"AM\", timesAM);\n\ttakeOffAM(timesAM);\n\ttakeOffPM(timesPM);\n\t// console.log(\"PM\", timesPM);\n}", "function CheckPageIsTimeTrackable( iframeDoc ){\n\t\n\t// Check for incident page\n\tif( iframeDoc.location.href.indexOf( \"incident.do\" ) != -1 ){\n\t\t\n\t\t// add button to page\n\t\tinsertButton( iframeDoc, 'incident' );\n\t\t\n\t}\n\t\n\t// Check for Changes page\n\tif( iframeDoc.location.href.indexOf( \"change_request.do\" ) != -1 ){\n\t\t\n\t\t// add button to page\n\t\tinsertButton( iframeDoc, 'change_request' );\n\t\t\n\t}\n\t\n}", "function get_time(loc1, loc2) {\n var miliseconds = Math.abs(new Date('1998/01/01 ' + loc1[3]) -\n new Date('1998/01/01 ' + loc2[3]));\n return (miliseconds / 1000);\n}", "function test_specific_dates_and_time_in_timepicker() {}", "function compare(a, b){\n // const dayA = a.startTime[0];\n // const dayB = b.startTime[0];\n // const hourA = parseInt(a.startTime.substring(\n // a.startTime.lastIndexOf(\":\") + 1,\n // a.startTime.lastIndexOf(\";\")\n // ));\n // const hourB = parseInt(b.startTime.substring(\n // b.startTime.lastIndexOf(\":\") + 1,\n // b.startTime.lastIndexOf(\";\")\n // ));\n // const minutesA = parseInt(a.startTime.split(\":\").pop());\n // const minutesB = parseInt(b.startTime.split(\":\").pop());\n\n if (a.people.length > b.people.length) {\n return -1;\n }\n else if (a.people.length == b.people.length && (a.startTime < b.startTime)) {\n return -1;\n }\n else{\n return 1;\n }\n }", "function checkPage() {\n\t\tvar pageTitle = document.querySelector(\".PATRANSACTIONTITLE\");\n\t\tif (!pageTitle || pageTitle.textContent != \"My Class Schedule\")\n\t\t\treturn false;\n\n\t\t// This assumes that the page header contains a pipe separated\n\t\t// description of the timetable\n\t\tvar title = document.querySelector(\".SSSPAGEKEYTEXT\");\n\t\tif (!title || !(title = title.textContent.match(/(.*?)\\s+\\|\\s+/)))\n\t\t\treturn false;\n\n\t\t// If this is the right page, return the name of the timetable\n\t\treturn title[1];\n\t}", "function changeMatchDateToElapsedTime() {\r\n var divs = jQuery('div.matchdate-row');\r\n for (var i = 0; i < divs.length; i++) {\r\n changeDateDivToElapsed(divs[i], 'matched on:', 'matched ');\r\n }\r\n}", "function investigatePage() {\r\n var rows = document.evaluate(\"//div[@class='objectinfo']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageIDs[i] = /immo(\\d+)/.exec(rows.snapshotItem(i).id)[1];\r\n lastSeenIDs[pageIDs[i]] = new Date().getTime();\r\n }\r\n rows = document.evaluate(\"//div[@class='titel']/a\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageTitles[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n rows = document.evaluate(\"//div[@class='adresse']\", document, null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);\r\n for (var i=0;i<rows.snapshotLength;i++) {\r\n pageLocations[i] = rows.snapshotItem(i).textContent.toString();\r\n }\r\n if (lastSeenIDs) GM_setValue('lastSeenIDs',lastSeenIDs.toSource());\r\n}", "function compare(a,b) {\r\n var startTimeA = (a.StartTimeHour*60) + a.StartTimeMinute;\r\n var startTimeB = (b.StartTimeHour*60) + b.StartTimeMinute;\r\n return startTimeA - startTimeB;\r\n}", "function qa(a,b){// earlier start time goes first\n// tie? longer-duration goes first\nreturn a.start-b.start||b.end-b.start-(a.end-a.start)||(a.event.title||\"\").localeCompare(b.event.title)}", "function compareIng(a,b) {\n var Ta = a.cookTime + a.prepTime;\n var Tb = b.cookTime + b.prepTime;\n if (Ta < Tb) {\n return -1;\n }\n if (Ta > Tb) {\n return 1;\n }\n return 0;\n }", "compareTimes(time, date) {\n var shortened = time.split(\":\");\n shortened = shortened[0] + \":\" + shortened[1];\n\n var mobile = window.matchMedia(\"only screen and (max-width: 768px)\").matches;\n if(!mobile && this.times.includes(shortened)) {\n for(var i = 0; i < this.props.reminders.length; i++) {\n if(this.props.reminders[i].time === shortened) {\n this.createNotification(shortened + \" \" + this.props.reminders[i].title, this.props.reminders[i].text);\n }\n }\n \n this.times = this.times.filter((time) => time !== shortened);\n }\n }", "function compare(movieA,movieB) {\n const closerToA= movieA.title;\n const furtherFromA = movieB.title;\n\n let comparison = 0;\n if (closerToA > furtherFromA) {\n comparison = 1;\n } else if (closerToA < furtherFromA) {\n comparison = -1;\n // } else if (closerToA.match(/^\\d/) == true || furtherFromA.match(/^\\d/) == true){\n // comparison = 0;\n }\n return comparison\n \n}", "function walkingTime(pointA, pointB) {\n let dx = avenueDistance(pointA, pointB);\n let dy = streetDistance(pointA, pointB);\n return (dx + dy) / walkingSpeed * 60.0;\n}", "function newPageTime() {\r\n pt = dt = performance.now();\r\n pgPauses = dvPauses = scrollPos = 0;\r\n}", "compareTime(time1, time2) {\n return new Date(time1) > new Date(time2);\n }", "function calTime (hour) {\n\n if (hour == now.hours()) {\n //code goes in here to add css to color code the page to present\n return \"present\"\n } else if (hour < now.hours()) {\n //code goes in here to add css to color code the page to past\n return \"past\"\n } else {\n //code goes in here to add css to color code the page to future\n return \"future\"\n }\n\n}", "function setNextTimes(page, campus) {\n // current relative timestamp in this week\n const now = new Date()\n const nowTimestamp = timestamp(now.getDay(), now.getHours(), now.getMinutes())\n\n // get db reference\n const db = wx.cloud.database()\n const _ = db.command\n\n // next runs for campus\n db.collection(campus).where({\n timestamp: _.gt(nowTimestamp)\n }).limit(page.data.numRuns).get({\n success: res => {\n // format each time and get color\n let times = [], colors = []\n for (const time of res.data) {\n times.push(formatTime(time))\n\n if (page.data.isColor) {\n colors.push(getColor(nowTimestamp, time.timestamp))\n } else {\n colors.push(\"black\")\n }\n }\n\n // set data\n if (campus == \"hc\") {\n page.setData({\n timesHC: times,\n colorsHC: colors,\n indicatorDotsHC: times.length > 1,\n })\n } else {\n page.setData({\n timesBMC: times,\n colorsBMC: colors,\n indicatorDotsBMC: times.length > 1,\n })\n }\n }\n })\n}", "function detectTimeIssues(story) {\n var estimation = story.querySelector('.meta');\n var spentTime = story.querySelector('.everhour-stat');\n if (estimation !== null && spentTime !== null) {\n var pts = estimation.textContent;\n if (pts >= 0) {\n var time = spentTime.textContent.split(' ');\n var minutes = 0;\n var hours = 0;\n\n // If time has only 1 param, means that it has only minutes.\n // Otherwise - hours and minutes.\n if (time.length == 1) {\n minutes = parseInt(time[0]);\n }\n else {\n hours = parseInt(time[0]);\n minutes = parseInt(time[1]);\n }\n\n // Care only about huge overruns.\n var estimated = pts * 6 * 60 + 60;\n var current = hours * 60 + minutes;\n if (estimated < current) {\n if (story.querySelector('.time-overrun') === null) {\n story.insertAdjacentHTML('beforeend', '<span class=\"time-overrun\">overrun</span>');\n }\n }\n }\n }\n }", "function timeCompare(a, b) {\n if (a.time < b.time) return -1;\n if (a.time > b.time) return 1;\n return 0;\n }", "function timeCompare (tSta, tEnd, secSta, secEnd) {\n\t// 6:00 5:00\n\tif ( tEnd > secSta && secEnd > tSta ) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function compare(movieA,movieB) {\n const earlierMovie = movieA.year;\n const laterMovie = movieB.year;\n\n let comparison = 0;\n if (earlierMovie > laterMovie) {\n comparison = 1;\n } else if (earlierMovie < laterMovie) {\n comparison = -1;\n } \n return comparison\n}", "function TimeGoing()\r\n{\r\n try {\r\n // get time Elapsed from a Date funtion\r\n var nSpentSec = Math.floor(MilliSecondsElapsed()/1000);\r\n \r\n // create \"time monitor\" fields in the page if they are not done.\r\n if (ACROSDK.aPagesFlag[ACROSDK.targetDoc.pageNum] == false) \r\n CreatebarAndPages(ACROSDK.targetDoc, ACROSDK.targetDoc.pageNum);\r\n \r\n this.getField(\"timeMonitorFields\").hidden = ACROSDK.bHidden;\r\n \r\n // update pages icons\r\n var nLeftPages = 0;\r\n for (var i=0;i<ACROSDK.targetDoc.numPages;i++) {\r\n if (ACROSDK.aPagesFlag[i] == false) \r\n nLeftPages++;\r\n else if (i==ACROSDK.targetDoc.pageNum) \r\n ACROSDK.targetDoc.getField(\"timeMonitorFields.rectPages.\" + (i+1)).fillColor = [\"RGB\",1,.855,1];\r\n else \r\n ACROSDK.targetDoc.getField(\"timeMonitorFields.rectPages.\" + (i+1)).fillColor = [\"RGB\",.7,1,1];\r\n }\r\n \r\n // message showing pages left\r\n var sP = ACROSDK.targetDoc.getField(\"newTimerShort.txtPagesLeft\");\r\n sP.value = nLeftPages + \" page\\(s\\) left.\";\r\n \r\n // update time monitor bar\r\n var sT = ACROSDK.targetDoc.getField(\"newTimerShort.txtTimeLeft\");\r\n var sB = ACROSDK.targetDoc.getField(\"timeMonitorFields.rectBase\" + ACROSDK.targetDoc.pageNum);\r\n var sM = ACROSDK.targetDoc.getField(\"timeMonitorFields.rectMoving.\" + ACROSDK.targetDoc.pageNum);\r\n \r\n var gdelta = ACROSDK.barWidth/(ACROSDK.nTotalMin*60/ACROSDK.nIntervalSecond);\r\n var sMrect2 = sM.rect[0]+gdelta*nSpentSec;\r\n if (sMrect2 < sB.rect[2]) {\r\n sM.rect = [sM.rect[0],sM.rect[1],sMrect2,sM.rect[3]]; \r\n \r\n var nLeftMin = Math.floor((ACROSDK.nTotalMin*60 - nSpentSec)/60); \r\n var nLeftSec = ACROSDK.nTotalMin*60 - nSpentSec - nLeftMin*60;\r\n if (nLeftSec<10) nLeftSec = \"0\" + nLeftSec; \r\n sT.value = nLeftMin + \":\" + nLeftSec + \" minute\\(s\\) left\";\r\n } else {\r\n sM.rect = [sM.rect[0],sM.rect[1],sB.rect[2],sM.rect[3]]; \r\n sM.buttonSetCaption(\"Time is up !\");\r\n sM.textColor = color.red;\r\n \r\n var nOverMin = Math.floor((nSpentSec - ACROSDK.nTotalMin*60)/60); \r\n var nOverSec = nSpentSec - ACROSDK.nTotalMin*60 - nOverMin*60;\r\n if(nOverSec<10) nOverSec = \"0\" + nOverSec; \r\n sT.value = nOverMin + \":\" + nOverSec + \" overtime\";\r\n sT.textColor = color.red;\r\n }\r\n \r\n ACROSDK.bHidden = !(this.getField(\"newTimerShort.btnToggle.\").isBoxChecked(0));\r\n } catch (e) {\r\n console.println(\"Error in timer execution function\");\t\r\n }\r\n}", "function compareTime(t1, t2) {\n return t1 > t2;\n}", "function getBestTimes(blockSize, map){\n // assume that map is ordered.\n var times = Object.keys(map);\n var bestTimes = [];\n\n for(var i = 0; i < times.length - blockSize; i++){\n // get window of blockSize\n var window = [];\n for(var x = 0; x < blockSize; x++) {\n // times[i+x] = i:j:k\n // map[times[i+x]] = the users...\n window.push([times[i+x], map[times[i+x]]]);\n }\n\n // check for blocks that are in the same day...\n // given the window (size of blocksize), return bool if all blocks in window are valid\n // valid means all consecutive times in the window are 30 minutes apart.\n // console.log(window);\n if(!timeCheck(window)){\n continue;\n }\n\n // grab intersection of people\n var smallWindow = {\n startTime: window[0][0],\n people: grabintersect(window),\n };\n var hourCheck = parseInt(window[0][0].split(\":\")[1]);\n var notShitTime = hourCheck>8 && hourCheck<21;\n if(notShitTime){\n bestTimes.push(smallWindow);\n }\n\n }\n // order bestTimes by the amount of people.\n function compare(a, b){\n // const dayA = a.startTime[0];\n // const dayB = b.startTime[0];\n // const hourA = parseInt(a.startTime.substring(\n // a.startTime.lastIndexOf(\":\") + 1,\n // a.startTime.lastIndexOf(\";\")\n // ));\n // const hourB = parseInt(b.startTime.substring(\n // b.startTime.lastIndexOf(\":\") + 1,\n // b.startTime.lastIndexOf(\";\")\n // ));\n // const minutesA = parseInt(a.startTime.split(\":\").pop());\n // const minutesB = parseInt(b.startTime.split(\":\").pop());\n\n if (a.people.length > b.people.length) {\n return -1;\n }\n else if (a.people.length == b.people.length && (a.startTime < b.startTime)) {\n return -1;\n }\n else{\n return 1;\n }\n }\n bestTimes.sort(compare);\n return bestTimes;\n}", "function compareTime(timeA, timeB) {\n var startTimeParse = timeA.split(\":\");\n var endTimeParse = timeB.split(\":\");\n var firstHour = parseInt(startTimeParse[0]);\n var firstMinute = parseInt(startTimeParse[1]);\n var secondHour = parseInt(endTimeParse[0]);\n var secondMinute = parseInt(endTimeParse[1]);\n if (firstHour == secondHour) {\n if (firstMinute == secondMinute)\n return 0;\n if (firstMinute < secondMinute)\n return -1\n return 1\n }\n else {\n if (firstHour < secondHour)\n return -1\n return 1\n }\n}", "static getTime() {\n const currentTime = Date.now();\n\n if (!mockedPageLoadTime)\n return currentTime;\n\n const difference = currentTime - actualPageLoadTime;\n return mockedPageLoadTime + difference;\n }", "function performPage() {\r\n var movie_title = $('[class^=TitleHeader__TitleText]').text().trim();\r\n // reference\r\n if (movie_title === \"\") {\r\n movie_title = $('h3[itemprop=\"name\"]').text().trim();\r\n movie_title = movie_title.substring(movie_title.lastIndexOf(\"\\n\") + 1, -1 ).trim();\r\n }\r\n var movie_title_orig = $('[class^=OriginalTitle__OriginalTitleText]').text().trim().replace(\"Original title: \", \"\");\r\n // reference\r\n if (movie_title_orig === \"\" && $('h3[itemprop=\"name\"]').length) {\r\n movie_title_orig = $.trim($($('h3[itemprop=\"name\"]')[0].nextSibling).text());\r\n }\r\n // not found\r\n if (movie_title_orig === \"\") {\r\n movie_title_orig = movie_title;\r\n }\r\n\r\n var movie_id = document.URL.match(/\\/tt([0-9]+)\\//)[1].trim('tt');\r\n var is_tv = Boolean($('title').text().match('TV Series'));\r\n // newLayout || reference : check if 'title' has just a year in brackets, eg. \"(2009)\"\r\n var is_movie = (Boolean($('[class^=TitleBlock__TitleMetaDataContainer]').text().match('TV')) || Boolean($('li.ipl-inline-list__item').text().match('TV Special'))) ? false : Boolean($('title').text().match(/.*? \\(([0-9]*)\\)/));\r\n // newLayout || reference\r\n if (Boolean($('[class^=GenresAndPlot__Genre]').text().match('Documentary')) || Boolean($('li.ipl-inline-list__item').text().match('Documentary'))) {\r\n is_tv = false;\r\n is_movie = false;\r\n }\r\n\r\n // Start of External ratings code\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n externalRatings(movie_id, movie_title, movie_title_orig);\r\n }\r\n // Call to iconSorterCount() for the icons/sites sorting.\r\n iconSorterCount(is_tv, is_movie);\r\n\r\n // Create areas to put links in\r\n addIconBar(movie_id, movie_title, movie_title_orig);\r\n perform(getLinkArea(), movie_id, movie_title, movie_title_orig, is_tv, is_movie);\r\n if (GM_config.get('load_second_bar') && !GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaSecond();\r\n } else if (!GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie')) {\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && !GM_config.get('switch_bars')) {\r\n getLinkAreaSecond();\r\n getLinkAreaThird();\r\n } else if (GM_config.get('load_second_bar') && GM_config.get('load_third_bar_movie') && GM_config.get('switch_bars')) {\r\n getLinkAreaThird();\r\n getLinkAreaSecond();\r\n }\r\n}", "function compare(a, b) {\n if (a.timeInNumbers < b.timeInNumbers) {\n return -1;\n }\n if (a.timeInNumbers > b.timeInNumbers) {\n return 1;\n }\n return 0;\n}", "function getMeetinga(first,last,time) {\n var myMeeting = meetings.filter(meeting => meeting.firstInitial == first);\n if (myMeeting.length == 1) {\n return myMeeting;\n }\n var myMeeting2 = myMeeting.filter(meeting => meeting.lastInitial == last);\n if (myMeeting2.length == 1) {\n return myMeeting2;\n }\n var myMeeting3 = myMeeting2.filter(meeting => meeting.time == time);\n if (myMeeting3.length == 1) {\n return myMeeting3;\n }\n else {\n return false;\n }\n }", "function Schedule({ schedule }) {\n if (schedule) {\n return (\n <div className=\"Page\" data-testid=\"SchedulePage\">\n {schedule.map((event) => (\n <div key={event.id} className=\"schedule\">\n <b>{event.name}</b>\n {event.races.map((race) => (\n <div key={race.id}>\n {race.name}\n <br />\n {new Date(race.scheduled).toLocaleTimeString(\"en-us\", {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n hour: \"2-digit\",\n minute: \"2-digit\",\n })}\n </div>\n ))}\n </div>\n ))}\n </div>\n );\n }\n return (\n <div className=\"Page\">\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n <h1>Schedule</h1>\n this\n </div>\n );\n}", "function compare (a,b){\n if (a.hoursInSpace < b.hoursInSpace){\n return 1;\n }\n if (a.hoursInSpace > b.hoursInSpace){\n return -1;\n }\n return 0;\n }", "compare (a, b){\n if (a.time > b.time){\n return -1;\n }\n if (a.time < b.time){\n return 1;\n }\n return 0;\n }", "function checkCurrentLocationTime() {\n currentLocation = $('#dvWeather > .left-side > .location').text().trim();\n if (currentLocation !== previousLocation) {\n time = $('#dvWeather > .left-side > .timing > #lblTime').text().trim();\n hour = parseInt(time.substring(0, 2), 10);\n min = parseInt(time.substring(3, 5), 10);\n ampm = time.substring(6, 8);\n }\n previousLocation = currentLocation;\n }", "function findMatchofTheDay(date=''){\n let teams = jsonObj.teams; //list of every teams\n let matchOfDay=[],arrHtml=[],homeTeam='', awayTeam='',result = '';\n //dateISO = new Date(date).toISOString()\n\n for (let key in datas){ //check which match play on that day\n if(datas[key].date.includes(date)){\n matchOfDay.push(datas[key]);\n }\n }\n\n for (let key in matchOfDay){ \n teams.find(team => { //find Home or Away Team\n if(team.id == matchOfDay[key].home_team ){\n homeTeam = team.name;\n home_flag = team.flag;\n }\n if(team.id == matchOfDay[key].away_team){\n awayTeam = team.name;\n away_flag = team.flag;\n }\n });\n\n //find local match's Time on that day\n let fullDate = new Date(matchOfDay[key].date)\n let hour = fullDate.getHours();\n let minutes = fullDate.getMinutes();\n hour<=9? competeTime = '0'+hour+':'+minutes+'0': competeTime = hour+':'+minutes+'0'\n \n let result = matchOfDay[key].home_result+\" : \"+matchOfDay[key].away_result; //find result\n console.log('yyyyy') \n arrHtml.push(renderMatchOfDay(date,homeTeam,home_flag,awayTeam,away_flag,competeTime,result)); //array keep output of each day\n }\n return arrHtml\n}", "function getTabTimes(tabTime, tabID, times)\n{\n\tif(tabID!==undefined)\n\t{\n\t\t_js_tabTimes = _js_tabTimes.concat(\"Tab \" + tabID.toString() + \"\\n\"\n\t\t+ \"\\t time active: \" + tabTime.elapsedTime.toString() + \"\\n\"\n\t\t+ \"\\t time created: \" + tabTime.createTime.toString() + \"\\n\");\t\n\t}\n}", "function diffWW2(x) {\n\tvar tank = new Date(TANKS[x].built).getTime();\n\tvar ww2 = new Date(\"8/1/1939\").getTime();\n\tvar result = Math.floor((tank - ww2) / 86400000);\n\treturn (\"The \" + TANKS[x].name + \" was built \" + result + \" Days after WW2 started\");\n}", "function subwayTime(stationA, stationB) {\n let dx = avenueDistance(stationA, stationB);\n let dy = streetDistance(stationA, stationB);\n return Math.sqrt(dx * dx + dy * dy) / subwaySpeed * 60.0;\n}", "function sortByTime(a, b) {\n let comparison = 0;\n if (a.time >= b.time) {\n comparison = 1;\n } else if (a.time <= b.time) {\n comparison = -1;\n }\n return comparison;\n}", "function compare(a,b) {\n if (a.time < b.time)\n return -1;\n else if (a.time > b.time)\n return 1;\n else \n return 0;\n}", "overTime(){\n\t\t//\n\t}", "function checkPartTime(dailyWages)\n{\n return dailyWages.includes('80');\n}", "function compare(a,b) {\n if (a.time < b.time)\n return -1;\n if (a.time > b.time)\n return 1;\n return 0;\n }", "getCanterburyGames (teamName) {\n// find the rank of the team we want, as I dont want to use magic number. futureproof\n for (let aTeam of this.allTeams) {\n if (aTeam['name'] === teamName) {\n var aRank = aTeam['rank']\n }\n }\n// again, fufure proofing print line, instead of fixed string with Canterbury\n let specificTeam = 'Will only display ' + teamName + ' team games' + `${View.NEWLINE()}`\n// allGames will have multiple lists inside as there are more than one week of games\n for (let eachWeek of this.allGames) {\n// and get each games from each week\n for (let specificTeamGame of eachWeek) {\n if (specificTeamGame['homeTeamRank'] === aRank || specificTeamGame['awayTeamRank'] === aRank) {\n// converting time into string, readable time format\n let newDate = new Date(specificTeamGame.dateTime).toDateString()\n specificTeam += newDate + `${View.SPACE()}`\n// getting time like 7:35PM\n// was gonna use navigator.language instead of en-US but it comes up with korean\n// even thought default language is ENG\n let newTime = new Date(specificTeamGame.dateTime).toLocaleTimeString('en-US', {hour: 'numeric', minute: 'numeric'})\n\n specificTeam += newTime + `${View.SPACE()}`\n\n specificTeam += 'Week:' + specificTeamGame.week + `${View.SPACE()}` + 'Team: ' + this.allTeams[specificTeamGame.homeTeamRank - 1].name + `${View.SPACE()}` + 'v' + `${View.SPACE()}` + this.allTeams[specificTeamGame.awayTeamRank - 1].name + `${View.SPACE()}` + 'At: ' + this.allTeams[specificTeamGame.homeTeamRank - 1].venue + `${View.SPACE()}` + this.allTeams[specificTeamGame.homeTeamRank - 1].city + `${View.NEWLINE()}`\n }\n }\n }\n return specificTeam\n }", "function compareTime () {\n $(\"input\").each(function(response) {\n var schedHour = response + 9;\n if(schedHour < currentHour) {\n $(this).addClass('past');\n }else if (schedHour > currentHour) {\n $(this).addClass('future');\n }else if(schedHour === currentHour) {\n $(this).addClass('present');\n }});\n}", "function evaluateTime() {\n $(\".time-block\").each (function() {\n hourField = Number($(this).attr(\"data-time\"));\n currentHour = Number(moment().format(\"k\"));\n if (hourField < currentHour) {\n $(this).addClass(\"past\");\n } else if (hourField > currentHour) {\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n } else {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }\n });\n }", "function compare(a,b) {\n if(a.time < b.time) {\n return -1;\n }\n if(a.time > b.time) {\n return 1;\n }\n return 0;\n }", "function C007_LunchBreak_Natalie_EatGoodMatch() {\r\n C007_LunchBreak_Natalie_MatchCount++;\r\n C007_LunchBreak_Natalie_CalcParams();\r\n CurrentTime = CurrentTime + 300000;\r\n}", "function compareHours(index, time) {\n let moments = moment().hours(\"hh\");\n\n console.log(index, time)\n let parsedTime = moment(time, [\"h:m a\"])\n\n if (parsedTime.isBefore(moments, \"hour\")) {\n document.getElementById(index).classList.add(\"past\");\n } else if (parsedTime.isAfter(moments, \"hour\")) {\n document.getElementById(index).classList.add(\"future\");\n } else {\n document.getElementById(index).classList.add(\"present\");\n }\n}", "function compareTime(a, b){\r\n return (a.done ? !b.done : b.done) ? (a.done ? 1 : -1) : (a.date > b.date ? 1 : a.date < b.date ? -1 : 0);\r\n}", "function getTimes() {\n\t\tvar ttimes = $(\"#ranging-time-wrap\").intervalWialon('get');\n\n\t\t// remove <br>\n\t\tvar tf = en_format_time.replace('<br>', ' ');\n\n\t\t// use timeZone:\n\t\tvar deltaTime = wialon.util.DateTime.getTimezoneOffset() + (new Date()).getTimezoneOffset() * 60;\n\t\tvar tfrom = ttimes[0] - deltaTime - wialon.util.DateTime.getDSTOffset(ttimes[0]);\n\t\tvar tto = ttimes[1] - deltaTime - wialon.util.DateTime.getDSTOffset(ttimes[1]);\n\t\tvar tnow = wialon.core.Session.getInstance().getServerTime() - deltaTime;\n\n\t\tvar df = $('#ranging-time-wrap').intervalWialon('__getData');\n\t\tdf = df.dateFormat || 'dd MMM yyyy';\n\n\t\tif (tto - tfrom < 86.4e3) {\n\t\t\ttto = tfrom;\n\t\t}\n\n\t\treturn [getTimeStr(tfrom, df), getTimeStr(tto, df), tnow, df];\n\t}", "function findSchedule() {\n\n clearTimeTableState(); // Remove all the previous timetables \n\n // Validation for start & end time to each day\n for (var val of constStartEnd) {\n if (val.start !== \"\" && val.end !== \"\") {\n if (parseInt(val.start) > parseInt(val.end)) {\n alert(\"זמני התחלה וסיום לא הגיוניים\");\n return;\n }\n }\n }\n\n items.sort(coursesSort); // Sort items array by course name and then by course type\n\n // \"constItems\" will contain only the relevant lessons depends on user constraints \n const constItems = items.filter((val) => {\n\n var flag = true;\n for (var i = 0; i < val.days.length; i++) {\n if (\n (constFreeDay[snum(val.days[i]) - 1])\n || (parseInt(constStartEnd[snum(val.days[i]) - 1].start) > parseInt(val.beginningTime[i]))\n || (parseInt(constStartEnd[snum(val.days[i]) - 1].end) < (parseInt(val.beginningTime[i]) + val.duration[i] - 1))\n ) {\n flag = false;\n break;\n }\n }\n if (flag)\n return val;\n });\n\n\n let prev = [];\n let curr = [];\n let courseTypeIndex = [];\n let differTypes = 0;\n\n // \"differTypes\" variable summarize all the differnte types of lecture in each course in \"items\" array (the original array)\n for (var i = 0; i < items.length; i++) {\n curr = [items[i].courseName, items[i].typeOfCourse];\n if (!curr.equals(prev)) {\n differTypes++;\n prev = curr;\n }\n }\n\n /* The next loop save in \"courseTypeIndex\" the beginning index of each differnte lesson type.\n Differnte lesson type is when we have differnt course name or differnte types in the same lesson */\n curr = [];\n prev = [];\n\n for (i = 0; i < constItems.length; i++) {\n curr = [constItems[i].courseName, constItems[i].typeOfCourse];\n if (!curr.equals(prev)) {\n courseTypeIndex.push(i);\n prev = curr;\n }\n }\n\n // If the number of different lesson type isn't equal that's mean that when we filtered \"items\" into \n // \"constItems\" we subtracted a whole type lecture of some course \n if (courseTypeIndex.length !== differTypes || courseTypeIndex.length === 0) {\n setAlertMsg(\"לא נמצאו התאמות\");\n return;\n }\n\n // If the flag \"highPriority\" is true => the user has a preference to some particular lesson\n if (highPriority)\n setRelevantCoursesFirst(courseTypeIndex, constItems);\n\n let schedule = Array(14)\n .fill()\n .map(() => Array(7).fill(\"\"));\n\n schedule = initSchedule(schedule); // Initiate the matrix schedule with Days & Hours\n\n findAndPrint(0, courseTypeIndex, schedule, constItems);\n\n if (timeTable.length === 0) // In cases that there were not found a timetables\n setAlertMsg(\"לא נמצאו התאמות\");\n }", "function compareHour() {\n //update color code to display the calendar hours to match currentTime\n var updateHour = moment().hours();\n $(\".time-block > textarea\").each(function() {\n var hour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n //set background color if past hour\n if (hour < updateHour) {\n $(this).addClass(\"past\");\n //set background color if present hour\n } else if (hour === updateHour) {\n $(this)\n .addClass(\"present\");\n //set background color if future hour\n } else if (hour > updateHour) {\n $(this)\n .addClass(\"future\");\n }\n });\n }", "function timeCheck(window){\n //window[0][0], window[1][0];\n for(var i = 0; i<window.length-1; i++){\n var times = window[i][0].split(\":\");\n var i = parseInt(times[0],10);\n var j = parseInt(times[1],10);\n var k = parseInt(times[2],10);\n // Second time\n if(i+1 >= window.length){\n return true;\n }\n var times2 = window[i+1][0].split(\":\");\n var i2 = parseInt(times[0],10);\n var j2 = parseInt(times[1],10);\n var k2 = parseInt(times[2],10);\n if(!noGap(i,j,k,i2,j2,k2)){\n return false;\n }\n }\n return true;\n}", "function compare(a, b) {\n // Use toUpperCase() to ignore character casing\n const timeA = new Date(a[1].created);\n const timeB = new Date(b[1].created);\n\n console.log(a, '--', b)\n\n let comparison = 0;\n if (timeA > timeB) {\n comparison = 1;\n } else if (timeA < timeB) {\n comparison = -1;\n }\n return comparison * -1;\n}", "function getAvailableTimes(rooms) {\n \n // Append the available times.\n $('#leftColumn').append('<h3 class=\"ui-widget-header\">Available Times</h3>');\n \n // Get the data from the space browsing page.\n $.get('https://marrs-gsb.stanford.edu/marrs/BrowseForSpace.aspx', function(data) {\n $output = $('<div></div>');\n \n // Lop through all the rooms.\n for (index = 0; index < rooms.length; index++) {\n // Set some defaults.\n lists = '<ul>';\n times = [];\n \n // Find the room information and loop through all the reservations.\n $(data).find('a[title^=\"' + rooms[index] + '\"]').parent().parent().parent().find('.e.eb.ec').each(function() {\n \n // Parse out the length and time of the reservation.\n attributes = $(this).attr('style').split(';width:');\n apptTime = attributes[0].replace('left:', '').replace('.00%', '');\n apptLength = attributes[1].replace('.00%', '');\n \n apptTime = parseInt(apptTime) - 8;\n apptLength = parseInt(apptLength);\n \n // Build the time array with all the times and the lengths.\n times[apptTime] = apptLength;\n });\n \n startTime = 28;\n ranges = {};\n \n // Loop through all the times and create availability ranges.\n for (i = 28; i<=88; i++) {\n if (times[i]) {\n if (startTime != i) {\n ranges[startTime] = i;\n }\n \n i = i + times[i] - 1;\n startTime = i + 1;\n }\n }\n \n // Add the last range.\n if (startTime < 88) {\n ranges[startTime] = 88;\n }\n \n // Convert the ranges into times and add them as li's\n for (start in ranges) {\n startTime = convertTime(start);\n endTime = convertTime(ranges[start]);\n lists += '<li>' + startTime + ' - ' + endTime + '</li>';\n }\n \n // Close our list.\n lists += '</ul>';\n \n // Append the room title to the output.\n $output.append('<h4>' + rooms[index] + '</h4>');\n \n // Append the list.\n $output.append(lists);\n }\n \n // Append it to the page.\n $('#leftColumn').append($output);\n });\n \n // This is needed because the session tends to timeout if we don't recall the url.\n $.get(document.URL, function(data) {\n });\n }", "function parseMovies(responseJson) {\n const showtimes = responseJson._embedded.showtimes;\n console.log(showtimes)\n let myMovies = [];\n showtimes.forEach(movieName => {\n return myMovies.push(movieName);\n })\n\n\nfunction combine(arr) {\n var combined = arr.reduce(function(result, item) {\n var current = result[item.movieName];\n result[item.movieName] = !current ? item : {\n movieName: item.movieName,\n showDateTimeLocal: current.showDateTimeLocal + ', ' + item.showDateTimeLocal,\n posterDynamic: item.media.posterDynamic,\n mpaaRating: item.mpaaRating,\n runTime: item.runTime,\n genre: item.genre,\n };\n \n//need to format HH:MM & conditional - if same time, only display once\n // let oldDate = Object.entries(showDateTimeLocal);\n // console.log(oldDate)\n \n return result;\n }, {});\n \n return Object.keys(combined).map(function(key) {\n return combined[key];\n });\n }\n \n \n\n var result = combine(myMovies);\n console.log(result);\n displayShowtimeResults(result)\n}", "function compareTime(field_name_1, field_name_2, field_value1, field_value2, expect_value) {\n var ret = true;\n if (-2 == expect_value) {\n if (field_value1.localeCompare(field_value2) != -1) {\n alert(field_name_1 + \"应该早于\" + field_name_2);\n ret = false;\n }\n } else if (-1 == expect_value) {\n if (field_value1.localeCompare(field_value2) == 1) {\n alert(field_name_1 + \"应该不晚于\" + field_name_2);\n ret = false;\n }\n } else if (0 == expect_value) {\n if (field_value1.localeCompare(field_value2) != 0) {\n alert(field_name_1 + \"应该等于\" + field_name_2);\n ret = false;\n }\n } else if (1 == expect_value) {\n if (field_value1.localeCompare(field_value2) == -1) {\n alert(field_name_1 + \"应该不早于\" + field_name_2);\n ret = false;\n }\n } else if (2 == expect_value) {\n if (field_value1.localeCompare(field_value2) != 1) {\n alert(field_name_1 + \"应该晚于\" + field_name_2);\n ret = false;\n }\n }\n return ret;\n}", "function checkTimesAndReport(bot) {\n getStandupTimes(function(err, standupTimes) { \n if (!standupTimes) {\n return;\n }\n var currentHoursAndMinutes = getCurrentHoursAndMinutes();\n for (var channelId in standupTimes) {\n var standupTime = standupTimes[channelId];\n if (compareHoursAndMinutes(currentHoursAndMinutes, standupTime)) {\n getStandupData(channelId, function(err, standupReports) {\n bot.say({\n channel: channelId,\n text: getReportDisplay(standupReports),\n mrkdwn: true\n });\n clearStandupData(channelId);\n });\n }\n }\n });\n}", "function parseStatisticPage(pageText){\n\nvar pop = gval(\"ctl00_ContentPlaceHolder1_CAdvisor1_lblPopulation\",pageText);\nvar land = gval(\"ctl00_ContentPlaceHolder1_CAdvisor1_lblLand\",pageText);\nvar turns = gval(\"ctl00_lblTurns\",pageText);\nif (!pop || !land || !turns) {\n\tpop = -1;\n\tland = -1;\n\tturns = -1;\n}\nreturn { pop:pop,land:land,turns:turns};\n}", "function snapshotTimeCompare(a, b) {\n\t\tif (a.snapshot_time_ms < b.snapshot_time_ms)\n\t\t\treturn -1;\n\t\tif (a.snapshot_time_ms > b.snapshot_time_ms)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}", "outsideTimeFrame() {\n\t\tconst date = new Date();\n\t\tconst weekday = date.getDay() || 7; // JavaScript days are Sun-Sat 0-6 but we want Mon-Sun 1-7.\n\t\tconst hour = date.getHours();\n\n\t\tif (weekday < window.pizzakitTimes.start.weekday) {\n\t\t\treturn true;\n\t\t}\n\t\telse if (weekday == window.pizzakitTimes.start.weekday) {\n\t\t\tif (hour < window.pizzakitTimes.start.hours) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (window.pizzakitTimes.end.weekday < weekday) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse if (window.pizzakitTimes.end.weekday == weekday) {\n\t\t\t\tif (window.pizzakitTimes.end.hours <= hour) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}", "function replaceBattleTime(obj) {\r\n if (obj.innerHTML.match(/[\\d\\.]+/g)== 1) {\r\n if (obj.innerHTML.match(\"second ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) second ago/g,\"1 másodperce\");\r\n } \r\n if (obj.innerHTML.match(\"minute ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) minute ago/g,\"1 perce\");\r\n } \r\n if (obj.innerHTML.match(\"hour ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) hour ago/g,\"1 órája\");\r\n } \r\n if (obj.innerHTML.match(\"day ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) day ago/g,\"1 napja\");\r\n } \r\n if (obj.innerHTML.match(\"month ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) month ago/g,\"1 hónapja\");\r\n }\r\n } else { \r\n if (obj.innerHTML.match(\"seconds ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) seconds ago/g,\"$1 másodperce\");\r\n } \r\n if (obj.innerHTML.match(\"minutes ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) minutes ago/g,\"$1 perce\");\r\n } \r\n if (obj.innerHTML.match(\"hours ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) hours ago/g,\"$1 órája\");\r\n } \r\n if (obj.innerHTML.match(\"days ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) days ago/g,\"$1 napja\");\r\n } \r\n if (obj.innerHTML.match(\"months ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) months ago/g,\"$1 hónapja\");\r\n }\r\n }\r\n}", "getCrossOverGames () {\n let crossovergames = 'Will display crossover games' + `${View.NEWLINE()}`\n// allGames will have multiple lists inside as there are more than one week of games\n for (let eachWeek of this.allGames) {\n// and get each games from each week\n for (let teamGame of eachWeek) {\n// as crossover is between Championship and Premiership, so we have to check\n// both home and away.\n// I also made a list called allPDRanks, allCDRanks so I can use includes\n// builtin function to find whether this list contains the rank we are\n// looking\n if ((this.allPDRanks.includes(teamGame['homeTeamRank']) && this.allCDRanks.includes(teamGame['awayTeamRank'])) || (this.allCDRanks.includes(teamGame['homeTeamRank']) && this.allPDRanks.includes(teamGame['awayTeamRank']))) {\n// again, change time to readable, understandable time format\n let newDate = new Date(teamGame.dateTime).toDateString()\n crossovergames += newDate + `${View.SPACE()}`\n// getting time like 7:35PM\n// was gonna use navigator.language instead of en-US but it comes up with korean\n// even thought default language is ENG\n let newTime = new Date(teamGame.dateTime).toLocaleTimeString('en-US', {hour: 'numeric', minute: 'numeric'})\n\n crossovergames += newTime + `${View.SPACE()}`\n\n crossovergames += 'Week:' + teamGame.week + `${View.SPACE()}` + 'Team: rank:' + teamGame.homeTeamRank + `${View.SPACE()}` + this.allTeams[teamGame.homeTeamRank - 1].name + `${View.SPACE()}` + 'vs' + `${View.SPACE()}` + 'rank:' + teamGame.awayTeamRank + `${View.SPACE()}` + this.allTeams[teamGame.awayTeamRank - 1].name + `${View.SPACE()}` + 'At: ' + this.allTeams[teamGame.homeTeamRank - 1].venue + `${View.SPACE()}` + this.allTeams[teamGame.homeTeamRank - 1].city + `${View.NEWLINE()}`\n }\n }\n }\n return crossovergames\n }", "function getTimeTable(orari){\n var tab = orari.split(\"/\");\n //var m = 0;\n var result = \"\";\n var time = 8;\n var timeup= 9;\n for(var i = 0; i < 15; i++){\n result = result + \"<tr><td class='hours'>\" + time + \".00-\" + timeup + \".00</td>\";\n time = (time + 1)%12;\n timeup = (timeup + 1) %12;\n if(time==0){\n time = 12;\n }\n if(timeup == 0){\n timeup = 12;\n }\n for(var j = 0; j < 7; j++){\n if(isIn(i,j,tab)/*j == parseInt(tab[m]/100) && i == tab[m]%100*/){\n result = result + \"<td class='selectedtimeslot'</td>\";\n //console.log(\"normal \" + (j*100 + i ));\n //m++;\n }else{\n result = result + \"<td></td>\";\n //console.log(\"normal \" + (j*100 + i ));\n }\n \n }\n result = result + \"</tr>\";\n }\n return (result);\n}", "function compareTimes(dest, grace)\n{\n var t1, t2, hr, min;\n var t1diff, t2diff, total, limit;\n\n t1 = document.getElementById('maincarpickuptime' + dest).value;\n t2 = document.getElementById('maincardropofftime' + dest).value;\n\n t1diff = new Number();\n t2diff = new Number();\n\n total = new Number();\n limit = new Number();\n\n\t//the limit is how much time, in minutes, the dropoff time can be from the pickup time without charging an extra day.\n\t//1440 = 24 hours * 60.\n\t//The second number comes from the default value CarGracePeriod - any extra time a company allows after 24 hours.\n limit = 1440 + grace;\n\n //Get the total number of minutes from t1 until midnight\n hr = new Number(t1.split(\":\")[0]);\n min = new Number(t1.split(\":\")[1]);\n t1diff = 1440 - ((hr * 60) + min)\n\n //Get the total number of minutes from midnight until t2\n hr = new Number(t2.split(\":\")[0]);\n min = new Number(t2.split(\":\")[1]);\n t2diff = (hr * 60) + min\n\n //Get the total number of minutes between the pickup and dropoff times\n total = t1diff + t2diff\n\n //Is the total greater than the allowed amount of time? If yes, then display a warning\n if (total > limit)\n {\n\t\tdocument.getElementById('maincarwarning' + dest).style.display = 'block';\n\t\tdocument.getElementById('carover24hrs' + dest).value = 'Y';\n }\n else\n {\n \tdocument.getElementById('maincarwarning' + dest).style.display = 'none';\n \tdocument.getElementById('carover24hrs' + dest).value = 'N';\n }\n}", "function compareCriticScores(){\n\t\t\tif (criticscorem1>criticscorem2){\n\t\t\t\tcriticwinner = \"<p>According to the critics, the winner is <span class='movietitleoutput'>\" + simplem1tempURI +\"</span>.</p>\";\n\t\t\t\tcriticswinnerposter = posterm1;\n\t\t\t}\n\t\t\telse if (criticscorem2>criticscorem1){\n\t\t\t\tcriticwinner = \"<p>According to the critics, the winner is <span class='movietitleoutput'>\" + simplem2tempURI +\"</span>.</p>\";\n\t\t\t\tcriticswinnerposter = posterm2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tcriticwinner = \"<p>The critics liked both movies the same! WHOA.</p>\"\n\t\t\t}\n\t}", "function printtime(){\r\n\t\t//get time range\r\n\t\tvar start = $(\"#startDate\").val();\r\n\t\tvar end = $(\"#endDate\").val();\r\n\t\t//corner situation\r\n\t\tif(start >= end){\r\n\t\t\talert(\"Please enter valid date range!\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\t$.ajax({\r\n url: 'https://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=' + start + '&endtime=' + end,\r\n type: 'GET',\r\n dataType: 'json',\r\n\t\t\tsuccess: function (dt) {\r\n\t\t\t\tif(dt != undefined){\r\n\t\t\t\tarray = dt;\r\n\t\t\t\t//make sure data is not null\r\n\t\t\t\tif(array.features.length!=0){\r\n\t\t\t\t\tchangePage(1);\r\n\t\t\t\t\t$(\"#map\").css(\"display\", \"none\");\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\talert(\"No result in your date range, please search other date again!\");\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\t}\r\n },\r\n error: function () {\r\n\t\t\t\talert(\"Can not find valid url!\");\r\n }\r\n\t\t});\r\n\t}", "function renderTime(time){\n var timerSpans = document.querySelectorAll(\".timer .act-tim-digit\");\n\n if (time[0]>-1){ // hour\n if (time[0]>9)\n timerSpans[0].innerHTML=time[0]\n else\n timerSpans[0].innerHTML=\"0\"+time[0];\n }\n\n if (time[1]>-1){ // min\n if (time[1]>9)\n timerSpans[1].innerHTML=time[1]\n else\n timerSpans[1].innerHTML=\"0\"+time[1];\n }\n\n if (time[2]>-1){ // sec\n if (time[2]>9)\n timerSpans[2].innerHTML=time[2]\n else\n timerSpans[2].innerHTML=\"0\"+time[2];\n }\n\n}", "function index(times, date) {\n\treturn (times.indexOf(undate(date))+1 || times.indexOf(undate(date)-3600)+1 || times.indexOf(undate(date)+3600)+1 || null) - 1;\n}", "function computeTime() {\n\n\tdb.freeTime.find({},{time:1, vote:1,_id:0}, (err, particular) => {\n\t\tparticular.sort((a,b) => a.time.localeCompare(b.time, undefined, {numeric:true}));\n\t\treturn getSum(particular)\n\t})\n}", "function compareAudienceScores(){\n\t\t\tif (audiencescorem1>audiencescorem2){\n\t\t\t\taudiencewinner = \"<p>According to the audience, the winner is <span class='movietitleoutput'>\" + simplem1tempURI +\"</span>.</p>\";\n\t\t\t\taudiencewinnerposter = posterm1;\n\t\t\t}\n\t\t\telse if (audiencescorem2>audiencescorem1){\n\t\t\t\taudiencewinner = \"<p>According to the audience, the winner is <span class='movietitleoutput'>\" + simplem2tempURI +\"</span>.</p>\";\n\t\t\t\taudiencewinnerposter = posterm2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\taudiencewinner = \"<p>The audience liked both movies the same! WHOA.</p>\"\n\t\t\t}\n\t}", "function replaceBattleTime(obj) {\r\n if (obj.innerHTML.match(/[\\d\\.]+/g)== 1) {\r\n if (obj.innerHTML.match(\"second ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) second ago/g,\"1 saniye \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"minute ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) minute ago/g,\"1 dakika \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"hour ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) hour ago/g,\"1 saat \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"day ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) day ago/g,\"1 g\\u00fcn \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"month ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) month ago/g,\"1 ay \\u00f6nce\");\r\n }\r\n } else { \r\n if (obj.innerHTML.match(\"seconds ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) seconds ago/g,\"$1 saniye \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"minutes ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) minutes ago/g,\"$1 dakika \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"hours ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) hours ago/g,\"$1 saat \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"days ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) days ago/g,\"$1 g\\u00fcn \\u00f6nce\");\r\n } \r\n if (obj.innerHTML.match(\"months ago\")) {\r\n obj.innerHTML = obj.innerHTML.replace(/(\\d*) months ago/g,\"$1 ay \\u00f6nce\");\r\n }\r\n }\r\n}", "postTimesToAPI(results, articleID) {\n let unMatched = [];\n results.selectedTimes.forEach(time => {\n console.log(time.data);\n let dtEnd = time.data.plus({ minutes: 30 });\n console.log(\n \"first time\",\n time.data.toISO(),\n \"second time\",\n dtEnd.toISO()\n );\n\n unMatched.push({\n start: time.data,\n end: dtEnd,\n day: time.day,\n timeSlot: time.timeSlot,\n email: results.email,\n isMatched: false,\n matchedEmail: \"\"\n });\n });\n // this pushes the new times too the articles matches array\n apiCalls.updateArticleById(articleID, { unMatched });\n this.setState({ selectedTimes: [] });\n this.handleOpenModal();\n // article needs unmatched Array\n // article needs matched array\n // need to write articleMatch()\n // need to call articleMatch()\n }", "function checkObjectives() {\n // A Humble Beginning (1565 - 1650)\n if (((population.colonist.number * population.colonist.rate) + ((population.slave.number / population.slave.increment) * population.slave.rate) >= 10) && (population.merchant.rate2 >= 5)) {\n timePeriod[0].tracker[0] = 0;\n }\n if (population.number >= 50000) {\n timePeriod[0].tracker[2] = 0;\n }\n \n // War Is Too Expensive (1763 - 1775)\n if (population.minutemen.number >= 100) {\n timePeriod[2].tracker[3] = 0;\n }\n if (currency.colonialNotes.amount >= 2000000) {\n timePeriod[2].tracker[4] = 0;\n }\n}", "function onTimeForTheExam(input = []) {\n let [examHour, examMinutes, arrivalHour, arrivalMinutes] = [...input].map(Number);\n let examMins = (examHour * 60) + examMinutes;\n let arrivalMins = (arrivalHour * 60) + arrivalMinutes;\n let timeDiffMins = examMins - arrivalMins;\n\n let output = [];\n if (timeDiffMins > 30) {\n output.push('Early');\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours before the start`);\n } else {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else if (timeDiffMins >= 0) {\n output.push('On time');\n if (timeDiffMins !== 0) {\n output.push(`${timeDiffMins} minutes before the start`);\n }\n } else {\n output.push('Late');\n timeDiffMins = Math.abs(timeDiffMins);\n if (timeDiffMins > 59) {\n let h = Math.floor(timeDiffMins / 60);\n let min = timeDiffMins % 60;\n if (min < 10) {\n min = '0' + min;\n }\n output.push(`${h}:${min} hours after the start`);\n } else {\n output.push(`${timeDiffMins} minutes after the start`);\n }\n }\n return output.join('\\n');\n}", "function occurs_between(x, min, max) {\r\n var count = 0;\r\n if(x.timestamps.length > 0) {\r\n for(var timestamp in x.timestamps) {\r\n if(x.timestamps[timestamp].finish > min && x.timestamps[timestamp].start < max ||\r\n x.timestamps[timestamp].start < max && x.timestamps[timestamp].finish > min) {\r\n count++;\r\n }\r\n }\r\n }\r\n if($('#timeframe_filter')[0].children.length > 0)\r\n if(!$('#only_show_entities_with_time')[0].checked) {\r\n count += (x.value - x.timestamps.length);\r\n }\r\n\r\n return {'passed': count > 0,\r\n 'value': count}\r\n }", "function validateTimes() {\n fakeNow = new Date();\n fakeNow.setTime(fakeNow.getTime() + (hourOffset*3600*1000) + (minuteOffset*60*1000));\n availableTimes = radarKeys.slice(0,4);\n for (var i=4; i<radarKeys.length; i++) {\n if (fakeNow > radarTimes[radarKeys[i]]) {\n availableTimes.push(radarKeys[i]);\n }\n }\n}", "function _UltraGrid_Sort_Rows_Time(a, b)\n\t{\n\t\t//retrieve values\n\t\tvar valueA = Parse_Time(a.Value, 0xffffffff);\n\t\tvar valueB = Parse_Time(b.Value, 0xffffffff);\n\t\t//return direct comparison\n\t\treturn valueA < valueB ? -1 : 1;\n\t}", "function movieChoices(arr,time){\n\n for(var i = 0;i < arr.length; i++){\n var firstMovie = arr[i];\n\n for(var j = i + 1; j < arr.length; j++){\n var secondMovie = arr[j];\n\n if(firstMovie + secondMovie = time){\n return true\n }\n }\n }\n return false\n}", "function compare(objectA,objectB) {\n\n\t\tvar objectATime = Number(objectA.timestampms);\n\t\tvar objectBTime = Number(objectB.timestampms);\n\n\t\tif (objectATime < objectBTime){\n\t\t\t//timeDifference += \"##\" + objectATime+ \"is SMALLER than \" + objectBTime;\n\t\t\treturn -1;\n\t\t}\n\t\tif (objectATime > objectBTime){\n\t\t\t//timeDifference += \"##\" + objectATime+ \"is BIGGER than \" + objectBTime;\n\t\t\treturn 1;\n\t\t}\n\t\t//timeDifference += \"##\" + objectATime+ \"is EQUALS to \" + objectBTime;\n\t\treturn 0;\n\t}", "function time_determine(){\n\t\t\n\t\tvar arr = [\"января\", \"февраля\", \"марта\", \"апреля\",\n\t\t\"мая\", \"июня\", \"июля\", \"августа\",\n\t\t\"сентября\", \"октября\", \"ноября\", \"декабря\"\n\t\t];\n\n\t\tvar date = new Date();\n\t\tvar time = date.getDate() + \" \" + arr[date.getMonth()] + \" \" + date.getFullYear();\n\t\t/*date.getHours() + \":\" + date.getMinutes() + \":\" + date.getSeconds();*/\n\t\tvar dt = document.createElement(\"div\");\n\t\tdt.textContent = time;\n\t\tdiv.appendChild(dt);\n\t}", "function getAllWordsTimestamps(){\n for(var i = 0; i < allSpans.length;i++){\n if(allSpans[i].innerHTML[0] === ' '){\n getWordObject(allSpans[i].innerHTML)\n }\n }\n\n }", "function compareSegs(seg1, seg2) {\n return seg1.eventStartMS - seg2.eventStartMS || // earlier events go first\n seg2.eventDurationMS - seg1.eventDurationMS || // tie? longer events go first\n seg2.event.allDay - seg1.event.allDay || // tie? put all-day events first (booleans cast to 0/1)\n (seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n }", "function Ht(e,t,a){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;n<e.rest.length;n++)if(e.rest[n]==t)return{map:e.measure.maps[n],cache:e.measure.caches[n]};for(var r=0;r<e.rest.length;r++)if(D(e.rest[r])>a)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}", "inputRaceTime(match, racer1Time, racer2Time) {\n if (racer1Time != null) {\n if (match.racer1Time1 == null) {\n match.racer1Time1 = racer1Time;\n } else {\n match.racer1Time2 = racer1Time;\n }\n }\n if (racer2Time != null) {\n if (match.racer2Time1 == null) {\n match.racer2Time1 = racer1Time;\n } else {\n match.racer2Time2 = racer1Time;\n }\n }\n\n // Check for a winner\n if (match.racer1Time1 != null && match.racer1Time2 != null && match.racer2Time1 != null && match.racer2Time2 != null) {\n let racer1TimeSplit1 = match.racer1Time1.split(\":\");\n let racer1TimeSplit2 = match.racer1Time2.split(\":\");\n let racer2TimeSplit1 = match.racer2Time1.split(\":\");\n let racer2TimeSplit2 = match.racer2Time2.split(\":\");\n\n let racer1Total = 0;\n racer1Total += parseInt(racer1TimeSplit1[0]) * 60000;\n racer1Total += parseInt(racer1TimeSplit2[0]) * 60000;\n racer1Total += parseInt(racer1TimeSplit1[1]) * 1000;\n racer1Total += parseInt(racer1TimeSplit2[1]) * 1000;\n racer1Total += parseInt(racer1TimeSplit1[2]);\n racer1Total += parseInt(racer1TimeSplit2[2]);\n\n let racer2Total = 0;\n racer2Total += parseInt(racer2TimeSplit1[0]) * 60000;\n racer2Total += parseInt(racer2TimeSplit2[0]) * 60000;\n racer2Total += parseInt(racer2TimeSplit1[1]) * 1000;\n racer2Total += parseInt(racer2TimeSplit2[1]) * 1000;\n racer2Total += parseInt(racer2TimeSplit1[2]);\n racer2Total += parseInt(racer2TimeSplit2[2]);\n\n // Determines who had the lowest to be the winner. Ties got to racer1.\n if (racer1Total > racer2Total) {\n match.winnerID = match.racer2ID;\n match.winnerRacerNumber = match.racer2Number;\n } else {\n match.winnerID = match.racer1ID;\n match.winnerRacerNumber = match.racer1Number;\n }\n\n\n // TODO: get nextMatch somehow\n let nextMatch;\n\n // populate next match\n if (match.matchNumber != 0) {\n let nextMatchNumber = (match.matchNumber - 1) / 2;\n if (match.matchNumber % 2 == 0) {\n nextMatch.racer1Number = match.winnerRacerNumber;\n nextMatch.racer1ID = match.winnerID;\n } else {\n nextMatch.racer2Number = match.winnerRacerNumber;\n nextMatch.racer2ID = match.winnerID;\n }\n }\n\n // TODO: Update nextMatch somehow\n database.updateMatch(nextMatch);\n }\n database.updateMatch(match);\n }", "function FiveFieldTimeIsEqual(arrA, arrB) {\n \tfor (var i=0; i<arrA.length; i++) {\n \t\tif (arrA[i]!=arrB[i]) return false;\n \t}\n \treturn true;\n}", "function compareSlotSegs(seg1, seg2) {\n\treturn seg1.start - seg2.start || // earlier start time goes first\n\t\t(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first\n\t\t(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n}", "function compareSlotSegs(seg1, seg2) {\n\treturn seg1.start - seg2.start || // earlier start time goes first\n\t\t(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first\n\t\t(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n}", "function compareSlotSegs(seg1, seg2) {\n\treturn seg1.start - seg2.start || // earlier start time goes first\n\t\t(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first\n\t\t(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n}", "function compareSlotSegs(seg1, seg2) {\n\treturn seg1.start - seg2.start || // earlier start time goes first\n\t\t(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first\n\t\t(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n}", "function compareSlotSegs(seg1, seg2) {\n\treturn seg1.start - seg2.start || // earlier start time goes first\n\t\t(seg2.end - seg2.start) - (seg1.end - seg1.start) || // tie? longer-duration goes first\n\t\t(seg1.event.title || '').localeCompare(seg2.event.title); // tie? alphabetically by title\n}", "function timeCalculator(date) {\n var date = new Date(date.date);\n var currentTime = new Date();\n var difference = (currentTime - date);\n var year = Math.round(difference / (12*4*7*24*60*60*1000))\n var month = Math.round(difference / (4*7*24*60*60*1000));\n var week = Math.round(difference / (7*24*60*60*1000));\n var day = Math.round(difference / (24*60*60*1000));\n var hour = Math.round(difference / (60*60*1000));\n var minute = Math.round(difference / (60*1000));\n var time = $('<span />');\n if (month >= 12) {\n return year + ' years ago'\n } else if (week >= 4) {\n return month + ' months ago'\n } else if (day >= 7) {\n return week + ' weeks ago'\n } else if (hour > 24) {\n return day + ' days ago'\n } else if (minute < 1) {\n return 'Just now';\n } else if (minute < 2) {\n return minute + ' minute ago';\n } else if (minute < 60) {\n return minute + ' minutes ago';\n } else {\n return hour + ' hours ago';\n }\n}", "function asorter(a, b) {\n return getTime(a.start_time) - getTime(b.start_time);\n}" ]
[ "0.5975966", "0.57812876", "0.5683081", "0.5614726", "0.55678546", "0.5492867", "0.5293943", "0.5289667", "0.5278887", "0.527291", "0.5257966", "0.5250143", "0.5244661", "0.5231617", "0.52157485", "0.5198458", "0.5192949", "0.5177092", "0.51759595", "0.5159185", "0.51490504", "0.5138636", "0.5109904", "0.50742936", "0.50683194", "0.5060624", "0.5055367", "0.5052664", "0.5036142", "0.50269663", "0.50104415", "0.5002834", "0.4985348", "0.4976601", "0.49744838", "0.49576512", "0.4948493", "0.49284595", "0.49157283", "0.4900894", "0.4887508", "0.4876053", "0.48705587", "0.48650822", "0.48637876", "0.48607126", "0.48603833", "0.4839973", "0.4831325", "0.48230106", "0.48224184", "0.4819312", "0.48121592", "0.4810004", "0.4809571", "0.48018906", "0.47972444", "0.4792075", "0.47883096", "0.47879815", "0.4782453", "0.47804278", "0.47765473", "0.4775424", "0.47713092", "0.47631857", "0.4761454", "0.4753668", "0.47483367", "0.47431505", "0.47404593", "0.47372732", "0.4736731", "0.4723167", "0.47228584", "0.4719921", "0.4719412", "0.4711234", "0.47085214", "0.47083873", "0.4706301", "0.47052178", "0.4704181", "0.47016183", "0.46989566", "0.46946934", "0.46930996", "0.46929342", "0.46927646", "0.46921092", "0.46867177", "0.46857747", "0.46850005", "0.4669842", "0.4669842", "0.4669842", "0.4669842", "0.4669842", "0.46690258", "0.4666054" ]
0.5621223
3
estaticas producto var Adicionales[];
function agregarProducto(){ //console.log('entro a agregarproductos'); if(validar()){ var idusuario= $('#codusu').val(); $.ajax({ data: {opcion : 'trade', facturado: facturado, idusuario:idusuario, origen:origen, tipodcto:tipodcto }, url: '../control/registro.php', type: 'post', success: function (response) { //console.log('Trade OK'); Productos(); } }); // final }else{ $('#modalError').modal({backdrop: 'static', keyboard: false}); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function inicializarArrayResultados() {\r\n for(var i=1;i<=totalPreguntas;i++) {\r\n resultadoEncuesta[\"p\"+i+\"-alt\"]=[0,0,0,0];\r\n }\r\n}", "arbol(){\n var arbol = new Array();\n var padres = this._buscarPadre(data.categories);\n var hijos = this._buscarHijos(data.categories,padres);\n\n }", "asistencia(equipo) {\n let asistencia_total =[];\n\n for (var i = 0, len = equipo.length; i < len; ++i) {\n var total =+ equipo[i].asistencia.lunes + equipo[i].asistencia.martes + equipo[i].asistencia.miercoles + equipo[i].asistencia.jueves + equipo[i].asistencia.viernes + equipo[i].asistencia.sabado;\n asistencia_total.push(total);\n }\n \n return asistencia_total;\n }", "asistencia_persona(equipo){\n let len = equipo.length;\n let asistencias = [];\n\n for (var i = 0; i <len; ++i) {\n let asistencia_persona = equipo[i].asistencia;\n asistencias.push(asistencia_persona);\n \n }\n\n return asistencias;\n }", "function construye() {\n let base = [];\n for (let i = 0; i < numCajas; i++) {\n base.push(angular.copy(cajaDefecto));\n }\n return base;\n }", "function registrarDatos(ancho,grueso,varas,precioP) {\n datos[0].push(ancho);\n datos[1].push(grueso);\n datos[2].push(varas);\n datos[3].push(precioP);\n }", "function inicializacaoClasseProduto() {\r\n VETORDEPRODUTOSCLASSEPRODUTO = [];\r\n VETORDEINGREDIENTESCLASSEPRODUTO = [];\r\n VETORDECATEGORIASCLASSEPRODUTO = [];\r\n}", "function generarDatos() {\n let librosPrecargados = [{\n \"titulo\": \"Bullying y abuso infantil\",\n \"autor\": \"Tere Vale\",\n \"año\": \"2020\"\n },\n {\n \"titulo\": \"Marinka una rusa niña vasca\",\n \"autor\": \"Rodolfo Luna Almeida\",\n \"año\": \"2019\"\n },\n {\n \"titulo\": \"Camino a una tierra extraña\",\n \"autor\": \"David Park\",\n \"año\": \"2018\"\n },\n {\n \"titulo\": \"El sueño del retorno\",\n \"autor\": \"Firulais\",\n \"año\": \"2017\"\n },\n {\n \"titulo\": \"Humanos\",\n \"autor\": \"Dios\",\n \"año\": \"2020\"\n }\n ];\n return librosPrecargados;\n}", "get listadoArr () {\n const listadoArreglado = [];\n Object.keys(this._listado).forEach( key => {\n const tarea = this._listado[key];\n listadoArreglado.push(tarea);\n });\n return listadoArreglado;\n }", "function Ach(){\r\n var D = new Array();\r\n // Elmentos A \r\n var ASegundos =document.getElementById(\"AexampleRadios1\");\r\n var AMinutos =document.getElementById(\"AexampleRadios2\");\r\n var AHoras =document.getElementById(\"AexampleRadios3\");\r\n var ADias =document.getElementById(\"AexampleRadios4\");\r\n var ASemanas =document.getElementById(\"AexampleRadios5\");\r\n var AMeses =document.getElementById(\"AexampleRadios6\");\r\n var AAnos =document.getElementById(\"AexampleRadios7\");\r\n // Agregando Elementos \r\n D.push(ASegundos);\r\n D.push(AMinutos); \r\n D.push(AHoras);\r\n D.push(ADias);\r\n D.push(ASemanas);\r\n D.push(AMeses);\r\n D.push(AAnos);\r\n return D; // Retorno del Arreglo de A \r\n }", "function obtenerPreguntasVariadas(pCantidad, pIndiceTema){\n var contador=0;\n var aPreguntas=[];\n var arrayOptionID=[];\n \n while(contador<pCantidad){\n var tema= {};\n var indiceTema= pIndiceTema;\n \n if(pIndiceTema == -1){\n\n //Si el tema es variado, se le asigna un tema aleatorio\n indiceTema= valorAleatorio(preguntasTrivia.length);\n }\n \n tema= preguntasTrivia[indiceTema]; \n \n var aleatorioPregunta= valorAleatorio(tema.Preguntas.length);\n var pregunta= tema.Preguntas[aleatorioPregunta];\n pregunta.iconClass=preguntasTrivia[indiceTema].iconClass;\n \n var optionID=construirOptionID(aleatorioPregunta,indiceTema);\n //se genera un id especifico a cada pregunta, si este no se encuentra ya asignado \n //se introduce la pregunta, evitar preguntas duplicadas\n if(arrayOptionID.indexOf(optionID,0) == -1){\n arrayOptionID.push(optionID);\n aPreguntas.push(pregunta);\n contador++;\n }\n }\n \n return aPreguntas;\n}", "function armarArray(){\n\t// Arma el Array con los criterios de Búsqueda para realizar el paginado al Buscar.\n\tvar array = new Array();\n\n\tvar oidIdioma = get(\"formulario.hIdioma\");\n\tvar oidPais = get(\"formulario.hPais\");\n\tvar nroConcurso = get(\"formulario.cbNumConcurso\");\n\tvar nombreConcurso = get(\"formulario.textNombreConcurso\");\n\tvar oidPlantilla = get(\"formulario.cbNumPlantilla\");\n\tvar nombrePlantilla = get(\"formulario.textNombrePlantilla\");\t\n\tvar oidMarca = get(\"formulario.cbMarca\");\n\tvar oidCanal = get(\"formulario.cbCanal\");\n\tvar indActivo = \"true\";\t\n\n\t// Setea los valores en el Array a retornar\n\tif ( nroConcurso != \"\")\n\t\tarray[array.length] = [\"nroConcurso\", nroConcurso];\n\n\tif ( nombreConcurso != \"\")\n\t\tarray[array.length] = [\"nombreConcurso\", nombreConcurso];\n\n\tif ( oidPlantilla != \"\" )\n\t\tarray[array.length] = [\"oidPlantilla\", oidPlantilla];\n\n\tif ( nombrePlantilla != \"\")\t\n\t\tarray[array.length] = [\"nombrePlantilla\", nombrePlantilla];\n\n\tvar opcionMenu = get(\"formulario.opcionMenu\");\n\tif (opcionMenu == 'Consultar Concurso'){\n\t\tvar version = get(\"formulario.txtVersion\");\n\t\tif ( version != \"\")\n\t\t\tarray[array.length] = [\"version\", version];\n\t}\n\n\tif ( oidMarca != \"\")\n\t\tarray[array.length] = [\"oidMarca\", oidMarca];\n\n\tif ( oidCanal != \"\")\n\t\tarray[array.length] = [\"oidCanal\", oidCanal];\n\n\tif ( indActivo != \"\")\n\t\tarray[array.length] = [\"indActivo\", indActivo];\n\n\tarray[array.length] = [\"oidIdioma\", oidIdioma];\n\tarray[array.length] = [\"oidPais\", oidPais];\n\n\treturn array;\n}", "get listadoArray(){ //Queremos transformar nuestro objeto en arrays para poder presentarlo de mejor manera por consola\n\n const listado=[];\n\n Object.keys(this._listado).forEach(key =>{\n\n const tarea=this._listado[key];\n listado.push(tarea);\n\n \n }); //Esta funcion nos devuelve el array de todas las llaves\n\n\n return listado;\n }", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "get listarTareas () {\n\n const arreglo = [];\n\n Object.keys(this._listado).forEach(indice => {\n arreglo.push(this._listado[indice]);\n })\n\n return arreglo;\n }", "function empezarDibujo() {\n pintarLinea = true;\n lineas.push([]);\n }", "function datosVenta() {\n let total = 0;\n let iva = 0;\n for (let i = 0; i < listaProductos.length; i++) {\n total += listaProductos[i].precio * listaProductos[i].cantidad;\n iva += ((listaProductos[i].precio * listaProductos[i].cantidad) * 0.16);\n }\n puntoVenta.registrarVenta(iva, total, listaProductos);\n}", "function insertarOpciones(L){\n //si no le ponemos var dentro de una funcion es global\n //para hacerla global si no estas en una funcion es con var\n Prod2ID = {}\n //para cada producto creamos un elemento opcion con el nombre del producto y\n // lo almacenamos con su id en Prod2ID, luego lo añadimos a la pagina\n L.forEach(x => {\n let n = document.createElement('option');\n n.value = x.nombre;\n Prod2ID[x.nombre] = x.produc_id;\n document.getElementById('prendas').appendChild(n);\n })\n}", "function AdicionaArma() {\n return _AdicionaArmaArmadura(\n 'arma',\n [ tabelas_armas_simples, tabelas_armas_comuns, tabelas_armas_exoticas ],\n [ Traduz('Armas Simples'), Traduz('Armas Comuns'), Traduz('Armas Exóticas') ],\n Dom('div-equipamentos-armas'));\n}", "function AdicionaArmadura() {\n return _AdicionaArmaArmadura(\n 'armadura',\n [ tabelas_armaduras_leves, tabelas_armaduras_medias, tabelas_armaduras_pesadas ],\n [ Traduz('Armaduras Leves'), Traduz('Armaduras Médias'), Traduz('Armaduras Pesadas') ],\n Dom('div-equipamentos-armaduras'));\n}", "asistenciasTotalesPorDia(equipo){\n let len = equipo.length;\n let asistencia_total = [];\n let total_lunes=0;\n let total_martes=0;\n let total_miercoles=0;\n let total_jueves=0;\n let total_viernes=0;\n let total_sabado=0;\n let total_domingo=0;\n \n for (var i = 0; i <len; ++i) {\n total_lunes = total_lunes + (equipo[i].asistencia.lunes * equipo[i].factor_dias_laborados);\n total_martes = total_martes+ (equipo[i].asistencia.martes * equipo[i].factor_dias_laborados);\n total_miercoles = total_miercoles + (equipo[i].asistencia.miercoles * equipo[i].factor_dias_laborados);\n total_jueves = total_jueves + (equipo[i].asistencia.jueves * equipo[i].factor_dias_laborados);\n total_viernes = total_viernes + (equipo[i].asistencia.viernes * equipo[i].factor_dias_laborados);\n total_sabado = total_sabado + (equipo[i].asistencia.sabado * equipo[i].factor_dias_laborados);\n // total_domingo = total_domingo + (equipo[i].asistencia.domingo * equipo[i].factor_dias_laborados);\n }\n\n asistencia_total.push(total_lunes);\n asistencia_total.push(total_martes);\n asistencia_total.push(total_miercoles);\n asistencia_total.push(total_jueves);\n asistencia_total.push(total_viernes);\n asistencia_total.push(total_sabado);\n // asistencia_total.push(total_domingo);\n\n \n return asistencia_total;\n }", "function generaAforoDOMSegunArrayAsientos() {\n // Añade los asientos al DOM a partir de la variable asientos\n let contenidoHTML = \"\";\n let clase = \"\";\n \n asientos.forEach((asiento, indice) => {\n switch (asiento) {\n case LIBRE:\n clase = valorClassDeAsientoLIBRE;\n break;\n case OCUPADO:\n clase = valorClassDeAsientoOCUPADO;\n break;\n case SELECCIONADO:\n clase = valorClassDeAsientoSELECCIONADO;\n break;\n }\n contenidoHTML += `<div class=\"${clase}\" data-index=\"${indice}\"></div>`;\n });\n aforo.innerHTML = contenidoHTML;\n }", "function tipos (){\nvar uniqueStorage = removeDuplicates(Storage, \"Tipo\");\nvar atributos = Array();\n \n if( uniqueStorage.length > 0 ) {\n for( var aux in uniqueStorage )\n atributos.push(uniqueStorage[aux].Tipo);\n }\n return atributos;\n}", "function calcularVueltas(Pares){\n\t\tvar arreglo = new Array(mVueltas);\n\t\tvar cont = 0;\n\t\tvar dato;\n\t\tvar mVueltas = parseInt(vueltas.value);\n\t\tvar pares = Pares;\n\t\tvar temp;\n\t\tvar unidad = 1;\n\t\tfor (var i = 0; i < Pares; i++) {\n\t\t\tif(cont < mVueltas){\n\t\t\t\tif(arreglo[cont] == null){\n\t\t\t\t\tarreglo[cont] = 0;\n\t\t\t\t}\n\t\t\t\ttemp = arreglo[cont];\n\t\t\t\tarreglo[cont] = temp + unidad;\n\t\t\t\tcont++;\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tcont = 0;\n\t\t\t\ttemp = arreglo[cont];\n\t\t\t\tarreglo[cont] = temp + unidad;\n\t\t\t\tcont++;\n\t\t\t}\t\n\t\t}\n\t\treturn arreglo;\t\t\n\t}", "piquesAleatoire() {\n\t\t// position y aleatoire pour 4 piques\n\t\tlet tirage = [];\n\t\twhile (tirage.length < 4) {\n\t\t\tlet nombreAleatoire = Math.round(Utl.aleatoire(4, 12));\n\t\t\tif (tirage.indexOf(nombreAleatoire) === -1) {\n\t\t\t\ttirage.push(nombreAleatoire);\n\t\t\t}\n\t\t}\n\t\treturn tirage;\n\t}", "function set_absensi_array(data){\n absensi_siswa_arr=[];\n for(var i=0;i<getJumlah();i++){\n absensi_siswa_arr.push({\n status : data[i].charAt(0),\n id_kelas_siswa : getIdKelas(i),\n });\n }\n }", "function cargarGaleria(galeria){\n \n galeria.push(new Producto(0,\"Short espiral\",350,\"Shorts\",\"Multicolor\", \"img/foto1.jpg\"));\n galeria.push(new Producto(1,\"Remera de algodón\",350,\"Remeras\", \"Negro\",\"img/foto2.jpg\"));\n galeria.push(new Producto(2,\"Buzo canguro\",500,\"Buzos\",\"Gris\", \"img/foto3.jpg\"));\n galeria.push(new Producto(3,\"Holloweed\",650,\"Buzos\",\"Negro\", \"img/foto4.jpg\"));\n galeria.push(new Producto(4,\"Pollera de algodón\",200,\"Polleras\",\"Gris\", \"img/foto5.jpg\"));\n galeria.push(new Producto(5,\"Buzo de algodón\",500,\"Buzos\",\"Negro\", \"img/foto6.jpg\"));\n\n return galeria;\n}", "function set_array_edificis(cont,edifici){\n edificis[cont]=edifici;\n}", "function transformaAlunosEmArray(mapaAlunos) {\n let alunosArray = []\n mapaAlunos.forEach(([aID, a]) => {\n if (a[\"GPS\"] && a[\"ESCOLA_TEM_GPS\"]) {\n alunosArray.push({\n key: aID,\n tipo: \"aluno\",\n nome: a[\"NOME\"],\n lat: a[\"LOC_LATITUDE\"],\n lng: a[\"LOC_LONGITUDE\"],\n turno: a[\"TURNOSTR\"],\n nivel: a[\"NIVELSTR\"],\n temEscola: a[\"TEM_ESCOLA\"],\n school: String(a[\"ESCOLA_ID\"]),\n escolaID: String(a[\"ESCOLA_ID\"]),\n escolaNome: a[\"ESCOLA_NOME\"],\n escolaTemGPS: a[\"ESCOLA_TEM_GPS\"] ? \"Sim\" : \"Não\",\n passengers: 1\n })\n }\n })\n\n return alunosArray;\n}", "function iniciar(){\n for(var i = 1; i <= 31; i ++){\n var dezena = diaSorteService.montaDezena(i);\n vm.dezenas.push(dezena);\n }\n }", "function obterDoadores(){\n var doadoresUniversal = [];\n for(var i=0; i<goldSaints.length; i++){\n var cavaleiro = goldSaints[i];\n if(cavaleiro.tipoSanguineo === 'O'){\n doadoresUniversal.push(cavaleiro);\n }\n }\n return doadoresUniversal;\n}", "function arregloDeNumeros() {\n var elementos = [];\n elementos;\n}", "function carregaNacionalidades() {\n\n\t\tnacionalidadeService.findAll().then(function(retorno) {\n\n\t\t\tcontroller.nacionalidades = angular.copy(retorno.data);\n\n\t\t\tnewOption = {\n\t\t\t\tid : \"\",\n\t\t\t\tdescricao : \"Todas\"\n\t\t\t};\n\t\t\tcontroller.nacionalidades.unshift(newOption);\n\n\t\t});\n\n\t}", "function agregarAlCarrito() {\n /* Función que agrega un producto al carrito. utiliza el atributo \"alt\" del botón clickeado para obtener el código del producto a agregar. Cada vez que se agrega un producto se vuelve a generar la tabla que se muestra en pantalla.*/\n var elCodigo = $(this).attr(\"alt\");\n var laPosicion = buscarCodigoProducto(elCodigo);\n var productoAgregar = listadoProductos[laPosicion];\n carrito[carrito.length] = productoAgregar;\n armarTablaCarrito();\n }", "function ciudades (){\nvar uniqueStorage = removeDuplicates(Storage, \"Ciudad\");\nvar atributos = Array();\n \n if( uniqueStorage.length > 0 ) {\n for( var aux in uniqueStorage )\n atributos.push(uniqueStorage[aux].Ciudad);\n }\n return atributos;\n}", "function criaOptionSelectVenda(produtos){\n let options = [];\n produtos.forEach(element => {\n let option = document.createElement('option')\n option.setAttribute('value', element.nome);\n option.setAttribute('preco', element.preco);\n option.innerHTML = element.nome;\n options.push(option)\n });\n return options;\n}", "function arrayCliente(id,name,ape,cor,dui){\r\n var data = {id: id,name: name,ape: ape,cor: cor,dui: dui};\r\n return data;\r\n}", "function cargarProvincias() {\n //Inicializamos el array.\n let array = [\"Guayaquil\",\n \"Quito\",\n \"Cuenca\",\n \"Santo Domingo\",\n \"Machala\",\n \"Duran\",\n \"Manta\",\n \"Portoviejo\",\n \"Loja\",\n \"Ambato\",\n \"Esmeraldas\",\n \"Quevedo\",\n \"Riobamba\",\n \"Gualaceo\",\n \"Cariamanga\",\n \"Montalvo\",\n \"Macara\",\n\n \"Zamora\",\n \"Puerto Ayora\",\n \"Salitre\",\n \"Tosagua\",\n \"Pelileo\",\n \"Pujili\",\n \"Tabacundo\",\n \"Puerto Lopez\",\n \"San Vicente\",\n \"Santa Ana\",\n \"Zaruma\",\n \"Balao\",\n \"Rocafuerte\",\n \"Yantzaza\",\n \"Cotacachi\",\n \"Santa Lucia\",\n \"Cumanda\",\n \"Palestina\",\n \"Alfredo Baquerizo Moreno\",\n \"Nobol\",\n \"Mocache\",\n \"Puebloviejo\",\n \"Portovelo\",\n \"Sucua\",\n \"Guano\",\n \"Pillaro\",\n \"Gualaquiza\",\n \"Paute\",\n \"Saquisili\",\n \"Pajan\",\n \"San Miguel\",\n \"Puerto Baquerizo Moreno\",\n \"Catacocha\",\n \"Palenque\",\n \"Alausi\",\n \"Catarama\",\n \"Flavio Alfaro\",\n \"Colimes\",\n \"Echeandia\",\n \"Jama\",\n \"Isidro Ayora\",\n \"Muisne\",\n \"Santa Isabel\",\n \"Pedro Vicente Maldonado\",\n \"Biblian\",\n \"Archidona\",\n \"Junin\",\n \"Baba\",\n \"Pimampiro\",\n \"Camilo Ponce Enriquez\",\n \"El Tambo\",\n \"El Angel\",\n \"Alamor\",\n \"Chambo\",\n \"Celica\",\n \"Chordeleg\",\n \"Balsas\",\n \"Saraguro\",\n \"El Chaco\",\n \"Giron\",\n \"Huaca\",\n \"Chunchi\",\n \"Pallatanga\",\n \"Marcabeli\",\n \"Sigsig\",\n \"Urcuqui\",\n \"Loreto\",\n \"Rioverde\",\n \"Zumba\",\n \"Palora\",\n \"Mira\",\n \"El Pangui\",\n \"Puerto Quito\",\n \"Sucre\",\n \"Chillanes\",\n \"Quero\",\n \"Guamote\",\n \"Cevallos\",\n \"Zapotillo\",\n \"Zumbi\",\n \"Patate\",\n \"Puerto Villamil\",\n \"Lumbaqui\",\n \"Palanda\",\n \"Sigchos\",\n \"Pindal\",\n \"Guayzimi\",\n \"Baeza\",\n \"El Corazon\",\n \"Paccha\",\n \"Amaluza\",\n \"Las Naves\",\n \"San Fernando\",\n \"Gonzanama\",\n \"San Juan Bosco\",\n \"Yacuambi\",\n \"Santa Clara\",\n \"Arajuno\",\n \"Tarapoa\",\n \"Tisaleo\",\n \"Suscal\",\n \"Nabon\",\n \"Mocha\",\n \"La Victoria\",\n \"Guachapala\",\n \"Santiago\",\n \"Chaguarpamba\",\n \"Penipe\",\n \"Chilla\",\n \"Paquisha\",\n \"Carlos Julio Arosemena Tola\",\n \"Sozoranga\",\n \"Pucara\",\n \"Huamboya\",\n \"Quilanga\",\n \"Mera\",\n \"Olmedo\",\n \"Deleg\",\n \"La Bonita\",\n \"El Pan\",\n \"Tiputini\"\n ];\n //Ordena el array alfabeticamente.\n array.sort();\n //Pasamos a la funcion addOptions(el ID del select, las provincias cargadas en el array).\n addOptions(\"provincia\", array);\n}", "function jogosDaDesenvolvedora(desenvolvedora){\n let jogos = [];\n\n for (let categoria of jogosPorCategoria) {\n for ( let jogo of categoria.jogos ) {\n if (jogo.desenvolvedora === desenvolvedora){\n jogos.push(jogo.titulo)\n } \n }\n }\n console.log(\"Os jogos da \" + desenvolvedora + \" são: \" + jogos)\n}", "get icaos() {\n return this.rows.reduce((result, {icao}) => icao ? result.concat(icao) : result, []);\n }", "get listadoArray() {\n\t\tconst listado = [];\n\n\t\tObject.keys(this._listado).forEach((key) => {\n\t\t\tconst tarea = this._listado[key];\n\t\t\tlistado.push(tarea);\n\t\t});\n\n\t\treturn listado;\n\t}", "function valeurAbsolueArray(tab){\n return tab.map(valeurAbsolue);\n}", "constructor(params) {\n this.id = 1;\n this.arrayProdutos = [];\n }", "function _LeArmasArmadurasEscudos(array_entrada, div) {\n array_entrada.length = 0;\n for (var i = 0; i < div.childNodes.length; ++i) {\n array_entrada.push(LeEntradaArmaArmadura(div.childNodes[i]));\n }\n}", "function _LeArmasArmadurasEscudos(array_entrada, div) {\n array_entrada.length = 0;\n for (var i = 0; i < div.childNodes.length; ++i) {\n array_entrada.push(LeEntradaArmaArmadura(div.childNodes[i]));\n }\n}", "function livrosAugustoCury() {\n let livros = [];\n for (let categoria of livrosPorCategoria) {\n for (let livro of categoria.livros) {\n if (livro.autor === 'Augusto Cury') {\n livros.push(livro.titulo);\n }\n }\n }\n console.log('Livros do Augusto Cury: ' , livros);\n}", "function mostrarArreglo() { //carga en la tabla html los elementos que ya se encuentran \"precargados\" en el arreglo\n for (const pedido of pedidos) {\n mostrarItem(pedido);\n }\n}", "function aleatorios(limite = 1) {\n let r = []\n for (let i = 0; i < limite; i++) {\n r[i] = numeroAlAzar100()\n }\n\n return r\n \n }", "function _GeraEquipamentos(tabela_geracao_classe_por_nivel) {\n for (var chave_moeda in tabela_geracao_classe_por_nivel.moedas) {\n gPersonagem.moedas[chave_moeda] = tabela_geracao_classe_por_nivel.moedas[chave_moeda];\n }\n if ('pocoes' in tabela_geracao_classe_por_nivel) {\n for (var i = 0; i < tabela_geracao_classe_por_nivel.pocoes.length; ++i) {\n gPersonagem.pocoes.push({chave: tabela_geracao_classe_por_nivel.pocoes[i]});\n }\n }\n}", "function recogidaPalabras() {\n fetch('http://localhost:9000/tablero/palabras')\n .then(res => res.json())\n .then(data => {\n arrayPalabras = data.responseWords[0].palabras;\n crearSopa();\n })\n }", "function valoresAleatorios(){\n\tindiceCartas[0][0] = 1;\n\tindiceCartas[1][0] = 1;\n\tindiceCartas[2][0] = 4;\n\tindiceCartas[3][0] = 4;\n\tindiceCartas[4][0] = 7;\n\tindiceCartas[0][1] = 2;\n\tindiceCartas[1][1] = 2;\n\tindiceCartas[2][1] = 3;\n\tindiceCartas[3][1] = 3;\n\tindiceCartas[4][1] = 8;\n\tindiceCartas[0][2] = 5;\n\tindiceCartas[1][2] = 5;\n\tindiceCartas[2][2] = 6;\n\tindiceCartas[3][2] = 6;\n\tindiceCartas[4][2] = 7;\n\tindiceCartas[0][3] = 8;\n\tindiceCartas[1][3] = 9;\n\tindiceCartas[2][3] = 9;\n\tindiceCartas[3][3] = 10;\n\tindiceCartas[4][3] = 10;\n}", "function _AdicionaArmaArmadura(nome, tabelas, rotulos_tabelas, div_pai) {\n // Tabela sera usada na compra e venda.\n var tabela;\n if (nome == 'arma') {\n tabela = tabelas_armas;\n } else if (nome == 'armadura') {\n tabela = tabelas_armaduras;\n } else if (nome == 'escudo') {\n tabela = tabelas_escudos;\n } else {\n Mensagem('Nome invalido, esperando arma ou armadura.');\n return null;\n }\n\n var id_div_equipamentos = div_pai.id;\n var id_gerado = GeraId('div-' + nome, div_pai);\n var input_em_uso = null;\n if (nome == 'armadura' || nome == 'escudo') {\n input_em_uso = CriaRadio(null, null, null, nome + '-em-uso', null);\n input_em_uso.addEventListener(\n 'click',\n {\n input: input_em_uso,\n handleEvent: function(evt) {\n ClickUsarArmaduraEscudo(this.input);\n }\n },\n false);\n }\n var select = CriaSelect();\n select.setAttribute('name', 'select-principal');\n select.addEventListener('change', AtualizaGeral);\n for (var i = 0; i < tabelas.length; ++i) {\n var optgroup = CriaOptGroup(rotulos_tabelas[i]);\n var items_ordenados = [];\n for (var corrente in tabelas[i]) {\n items_ordenados.push(corrente);\n }\n items_ordenados.sort(function(ie, id) {\n return Traduz(tabelas[i][ie].nome).localeCompare(Traduz(tabelas[i][id].nome));\n });\n items_ordenados.forEach(function(corrente) {\n var option = CriaOption(Traduz(tabelas[i][corrente].nome), corrente);\n option.setAttribute('name', corrente);\n option.selected = false;\n optgroup.appendChild(option);\n });\n select.appendChild(optgroup);\n }\n\n var select_material = CriaSelect();\n select_material.setAttribute('name', 'select-material');\n select_material.addEventListener('change', AtualizaGeral);\n for (var corrente in tabelas_materiais_especiais) {\n var option = CriaOption(Traduz(tabelas_materiais_especiais[corrente].nome), corrente);\n option.selected = false;\n select_material.appendChild(option);\n }\n\n\n var span_obra_prima = CriaSpan(Traduz(' OP'));\n\n var input_obra_prima = CriaInputCheckbox(false, null, null, AtualizaGeral);\n input_obra_prima.setAttribute('name', 'obra-prima');\n\n var input_bonus = CriaInputNumerico(null, null, null, AtualizaGeral);\n input_bonus.setAttribute('name', 'bonus-magico');\n input_bonus.setAttribute('maxlength', 2);\n input_bonus.setAttribute('size', 2);\n input_bonus.value = 0;\n TituloSimples(Traduz('bonus mágico'), input_bonus);\n var button_remover = CriaBotao('-', null, null, {\n id: id_gerado,\n id_div_equipamentos: id_div_equipamentos,\n handleEvent: function(evt) {\n ClickRemoverFilho(this.id, this.id_div_equipamentos);\n }\n });\n\n var div = CriaDiv(id_gerado);\n if (input_em_uso) {\n div.appendChild(input_em_uso);\n }\n div.appendChild(select);\n div.appendChild(select_material);\n div.appendChild(span_obra_prima);\n div.appendChild(input_obra_prima);\n div.appendChild(input_bonus);\n div.appendChild(button_remover);\n\n var button_vender = CriaBotao(Traduz('Vender'), null, 'venda', {\n div: div,\n tipo: nome,\n tabela: tabela,\n handleEvent: function(evt) {\n ClickVenderArmaArmadura(this.div, this.tipo, this.tabela);\n }\n });\n var button_comprar = CriaBotao(Traduz('Comprar'), null, 'compra', {\n div: div,\n tipo: nome,\n tabela: tabela,\n handleEvent: function(evt) {\n ClickComprarArmaArmadura(this.div, this.tipo, this.tabela);\n }\n });\n\n div.appendChild(button_vender);\n div.appendChild(button_comprar);\n div_pai.appendChild(div);\n return div;\n}", "adicionarProdutos(lista) {\n this.itens.push(...lista);\n this.calcularValorTotal();\n }", "function valorEstoqueCategoria(database) {\n \n //inicializacao de uma array de objeto 'estoque', onde cada objeto representa uma categoria e recebe valor do estoque do primeiro produto\n let estoque = [{\n categoria: database[0].category,\n valEstoque: database[0].quantity * database[0].price \n }],\n index = 0;\n \n //loop para passar por todos os objetos da array de produtos\n for(i = 1; i < database.length; i++) {\n \n //caso seja uma categoria diferente, inicializa novo objeto estoque, atribui o nome e o valor de estoque \n if (estoque[index].categoria != database[i].category) {\n \n index++;\n estoque.push({\n categoria: database[i].category,\n valEstoque: database[i].quantity * database[i].price\n })\n \n } else {\n \n //sendo a mesma categoria do produto atual, apenas acumular o valor de estoque\n estoque[index].valEstoque += database[i].quantity * database[i].price; \n } \n }\n \n console.table(estoque);\n}", "function AddAprobacion(id_cad,id_div,id_aprobador,fec_desde,fec_hasta,nivel,motivo,contador,maxnivel) {\n\t//alert(nivel)\n\t//alert(maxnivel)\n\t// Variables\n\tarr_accion = [];\n\tarr_id_log_reporte = [];\n\t\n\t// Lectura de las acciones\n\tcinputs = document.getElementsByName(\"accion[]\")\n\tfor(var i=0, len=cinputs.length; i<len; i++){\n\t\t\t//alert(cinputs[i].value);\n\t\t arr_accion.push(cinputs[i].value);\n\t}\n\tinputs = document.getElementsByName(\"id_log_reporte[]\")\n \n // Lectura de los id_log_reporte\n\tfor(var i=0, len=inputs.length; i<len; i++){\n\t\t \n\t\t //alert(inputs[i].value);\n\t\t arr_id_log_reporte.push(inputs[i].value);\n\t\t \n\t}\n\t arr_accion=\"'\"+ arr_accion+\"'\";\n\t arr_id_log_reporte=\"'\"+ arr_id_log_reporte+\"'\";\n\tswal({\n\t\t\n\t\t title: \"Atenci\\u00F3n!\",\n\t\t text: \"Aprobaci\\u00F3n de ajuste!\",\n\t\t type: \"input\",\n\t\t showCancelButton: true,\n\t\t closeOnConfirm: false,\n\t\t cancelButtonText: \"Cancelar!\",\n\t\t confirmButtonText: \"Aprobar!\",\n\t\t confirmButtonColor: \"#DD6B55\",\n\t\t animation: \"slide-from-top\",\n\t\t inputPlaceholder: \"Indique una observaci\\u00F3n (Opcional)\"\n\t\t},\n\t\tfunction(inputValue){\n\t\t if (inputValue === false) return false;\n\t\t \t var parametros = {\n\t \"id_cad\" : id_cad,\n\t \"id_div\" : id_div,\n\t \"id_aproba\" : id_aprobador,\n\t \"fec_desde\" : fec_desde,\n\t \"fec_hasta\" : fec_hasta,\n\t \"obser\" : inputValue,\n\t \"niv\" : nivel,\n\t \"motivo\" : motivo,\n\t \"arr_accion\":arr_accion,\n\t \"arr_id_log_reporte\":arr_id_log_reporte\n\t\t \t };\n\t\t \tif(nivel==maxnivel)\n\t\t\t {\n\t vasync=true\n\t vcache=false\n\t vtexto=\"Ajuste realizado satisfactoriamente!\"\n\t\t\t }\n\t\t \telse\n\t\t \t {\n\t vasync=false\n\t vcache=true\n\t vtexto=\"Aprobación realizada satisfactoriamente!\"\n\t\t \t }\t\n\t\t\t $.ajax({\n\t async:vasync, \n\t cache:vcache,\n\t dataType:\"html\", \n\t type: 'POST', \n\t url: \"AddAprobacionS\",\n\t data: parametros, \n\t success: function(respuesta){\n\t \t swal({\n\t\t\t\t\t\t title: \"Exito\",\n\t\t\t\t\t\t text: vtexto,\n\t\t\t\t\t\t type: \"success\",\n\t\t\t\t\t\t showCancelButton: false,\n\t\t\t\t\t\t confirmButtonColor: \"#DD6B55\",\n\t\t\t\t\t\t confirmButtonText: \"Ok!\",\n\t\t\t\t\t\t closeOnConfirm: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\tconsole.log(\"Mandando parametros para hacer ajuste: \");\n\t\t\t\t\t\t\tvar jspcall = \"CadenaNoFacturaS?fec_desde=\"+fec_desde+\"&fec_hasta=\"+fec_hasta;\n\t\t\t\t\t\t\t window.location.href = jspcall;\n\t\t\t\t\t\t});\n\t },\n\t beforeSend:function()\n\t {\n\t \t\tconsole.log(\"Mandando parametros antes de hacer ajuste: \");\n\t \t swal({\n\t\t\t\t\t\t title: \"Espere un momento por favor.\",\n\t\t\t\t\t\t type: \"info\",\n\t\t\t\t\t\t imageUrl: \"'./../img/btn-ajax-loader.gif'\",\n\t\t\t\t\t\t imageWidth: 200,\n\t\t\t\t\t\t imageHeight: 200,\n\t\t\t\t\t\t animation: true,\n\t\t\t\t\t\t html: true,\n\t\t\t\t\t\t showCancelButton: false,\n\t\t\t\t\t\t showConfirmButton: false\n\t\t\t\t\t\t});\n\t },\n\t error: function (xhr, ajaxOptions, thrownError) {\n\t \t \n\t \t swal({\n\t\t\t\t\t\t title: \"Error\",\n\t\t\t\t\t\t text: \"Error al hacer el ajuste.Llame al administrador!\",\n\t\t\t\t\t\t type: \"error\",\n\t\t\t\t\t\t showCancelButton: false,\n\t\t\t\t\t\t confirmButtonColor: \"#DD6B55\",\n\t\t\t\t\t\t confirmButtonText: \"Ok!\",\n\t\t\t\t\t\t closeOnConfirm: true\n\t\t\t\t\t\t},\n\t\t\t\t\t\tfunction(){\n\t\t\t\t\t\t\t console.log(\"Mandando parametros para hacer ajuste cuando tiene error: \");\n\t\t\t\t\t\t\t var jspcall = \"CadenaNoFacturaS?fec_desde=\"+fec_desde+\"&fec_hasta=\"+fec_hasta;\n\t\t\t\t\t\t\t window.location.href = jspcall;\n\t\t\t\t\t\t}); \n\t }\n\t });\n\t\t \t \n\t\t});\t\n\n}", "function IniciaPersonagem() {\n // entradas padroes para armas, armaduras e escudos.\n gPersonagem.armas.push(ConverteArma({\n chave: 'desarmado',\n nome_gerado: 'desarmado',\n texto_nome: Traduz('desarmado'),\n obra_prima: false,\n bonus: 0\n }));\n}", "function agregarDato() {\n\n // Usamos el atributo getElementById('iddelelemento')\n // nos retorna con objeto html el cual podremos acceder a sus atributos\n // un de ellos es .value con el cual obtendremos el valor que ingresamos\n\n // Una vez obtenido el valor lo pasamos a una variable para cada tipo\n nombre = document.getElementById('nombre').value;\n apellido = document.getElementById('apellido').value;\n edad = document.getElementById('edad').value;\n profesion = document.getElementById('profesion').value;\n\n // Limpiamos el documento html\n document.body.innerHTML = '';\n\n // Creamos un array con los datos previamente obtenidos\n var newDato = new Array(nombre, apellido, edad, profesion);\n \n // Agregamos los datos obtenidos al array que declaramos de manera global\n tablas.push(newDato);\n\n // Llamamos a la funcion crearTabla() para que imprima \n // la tabla con los datos actualizados\n crearTabla();\n}", "function Propiedades() {\n this.texto = \"Palabra\";\n console.log(\"this.texto\", this.texto);\n this.numero = 5;\n console.log(\"numero\", this.numero);\n this.boleana = true;\n console.log(\"boleana\", this.boleana);\n this.arreglo = [\"texto1\", \"teto2\", 0, true];\n console.log(\"arreglo\", this.arreglo);\n this.cualquiera = { \"propiedad1\": \"valor1\",\n \"propiedad2\": \"valor2\",\n \"propiedad3\": \"valor3\" };\n console.log(\"cualquiera\", this.cualquiera);\n }", "function addPratoSelecionado() {\n let qntMedidas = medidas.length;\n let qntValorSelecionado = arrayValores.length;\n\n if (qntValorSelecionado != qntMedidas) {\n alert(\"Selecione Um valor pra cada medidas ou escolha \\\"desativado\\\"\")\n } else {\n const criaArray = (array) => {\n const arr = [];\n for (const item of array) {\n arr.push(item.prato)\n }\n return arr;\n }\n\n let arrayPratos = criaArray(listaPratosDia);\n let existeItem = arrayPratos.findIndex(i => i == valueListaPrato);\n\n if (existeItem == -1) {\n listaPratosDia.push({\n prato: valueListaPrato,\n info: arrayValores\n });\n\n setctx_SP(listaPratosDia);\n } else {\n alert('Este prato já está na lista!');\n }\n /* console.log('-------------------------------------------------------------------------')\n console.log(ctx_SP);\n //console.log(listaPratosDia);\n console.log('-------------------------------------------------------------------------') */\n }\n }", "constructor (competicion, hora, equipo1, equipo2, arraycuotas1, arraycuotasX, arraycuotas2) {\n this.competicion=competicion;\n this.hora = hora;\n this.equipo1 = equipo1;\n this.equipo2 = equipo2;\n this.arraycuotas1 = arraycuotas1;\n this.arraycuotasX = arraycuotasX;\n this.arraycuotas2 = arraycuotas2;\n }", "function produtosVendidos() {\n var produtos = document.querySelectorAll(\".Produ\");\n let prodVendidos = Array();\n // Percorrer a lista de produtos\n for (var i = 0; i < produtos.length; i++) {\n\n // Recupera o produto no indice i da lista de produtos\n var produto = produtos[i];\n\n // pegando id\n var id = produto.querySelector(\".id\").textContent;\n\n // pegando quantidade\n var qtd = produto.querySelector(\".qtd\").textContent;\n\n let prod = {\n cdg: id,\n QTDProd: qtd\n }\n\n prodVendidos.push(prod)\n }\n return prodVendidos;\n }", "mostraAlunos(dados) {\n console.log(dados)\n // cria uma variavel que ira armazenar todo esse HTML\n let card = ''\n // faz o loop no array dados que armazena as noticias\n dados.alunos.map(function (elemento) {\n // adiciona a variavel card todo o HTML com as informações\n // += serve para adicionar sem sobrescrever\n card += `\n <div class=\"card\">\n <h2>Chamada ${elemento.id}</h2>\n <p>${elemento.name}</p>\n </div>\n `\n });\n\n this.alunos.innerHTML = card\n }", "function selecciona() {\n var seleccion = parseInt(Math.random() * (10));\n palabraJuego = new Array();\n palabraJuego = palabras[seleccion];\n /*Solo debug, muestra la palabra seleccionada del array de palabras*/\n //document.getElementById(\"debug\").innerHTML = \"<p>\" + seleccion + \"</p>\"+\"<p>\" + palabraJuego + \"</p>\";\n pintarCaja();\n}", "carregarAlumnesFromArray(e = []){\n e.forEach((n) => {\n this.__llista[n.id] = n;\n });\n }", "function contarAutores() {\n let autores = [];\n for (let categoria of livrosPorCategoria) {\n for (let livro of categoria.livros) {\n if (autores.indexOf(livro.autor) == -1) {\n autores.push(livro.autor);\n }\n }\n }\n console.log('Total de autores: ' , autores.length);\n}", "function MapaParaLista(mapa) {\n var lista = [];\n for (var chave in mapa) {\n lista.push(chave);\n }\n return lista;\n}", "function inicializarPesos(pesos, setEntrenamiento) {\n divmatriz.innerHTML += \"<div style='text-align: center'><b>Matriz</b><br></div>\";\n for (var i = 0; i < setEntrenamiento[0].entrada.length; i++) {// numero de elementos para entrada\n pesos[i] = Math.random() * (1 - (-1) + 1) + (-1);\n divmatriz.innerHTML += \" \" + pesos[i] + \" &nbsp;&nbsp; \";\n }\n divmatriz.innerHTML += \"<br>\";\n divmatriz.innerHTML += \"<div style='text-align: center'><b>Umbral</b><br></div>\";\n pesos.push( Math.random() * (1 - (-1) + 1) + (-1) ); //umbral\n divmatriz.innerHTML += \" \" + pesos[2] + \"&nbsp;&nbsp; \";\n }", "function obtenerPostresDeclarativo(almuerzos) {\n let postres = [];\n for (i = 0; i < almuerzos.length; i++) {\n if (almuerzos[i].principal === \"taco\") {\n postres.push(almuerzos[i].postre);\n }\n }\n\n return postres;\n}", "function agregarItems(opAccion) {\n var tGrid = 'PbPlanificaestudiantnew';\n //var nombre = $('#cmb_estandar_evi option:selected').text();\n //Verifica que tenga nombre producto y tenga foto\n //alert('dsasd' + $('#cmb_modalidadesth').val());\n if ($('#cmb_asignaest').val() != '0' /*&& $('#cmb_jornadaest').val() != '0'*/ && $('#cmb_bloqueest').val() != '0' && $('#cmb_modalidadesth').val() != '0' && $('#cmb_horaest').val() != '0') {\n /* var valor = $('#cmb_estandar_evi option:selected').text();*/\n if (opAccion != \"edit\") {\n //********* AGREGAR ITEMS *********\n var arr_Grid = new Array();\n if (sessionStorage.dts_datosItemplan) {\n /*Agrego a la Sesion*/\n arr_Grid = JSON.parse(sessionStorage.dts_datosItemplan);\n var size = arr_Grid.length;\n if (size > 0) {\n var vasignatura = $('#cmb_asignaest option:selected').text();\n var vbloque = $('#cmb_bloqueest option:selected').text();\n var vhora = $('#cmb_horaest option:selected').text();\n var vBloque = buscaDatoTabla(tGrid, vbloque, 'bloque');\n var vHora = buscaDatoTabla(tGrid, vhora, 'hora');\n var viguales = 0;\n console.log(vBloque);\n console.log( vHora);\n //console.log(vasignatura);\n if (vBloque && vHora ){\n viguales = 1;\n }\n //alert ('sdsds' + viguales);\n if (checkId(vasignatura, 'asignatura') /*|| (viguales === 1)*/) {\n //if (vBloque && vhora) { \n showAlert('NO_OK', 'error', { \"wtmessage\": \"Ya ha ingresado esa asignatura\", \"title\": 'Información' });\n return;\n //}\n } else if(viguales === 1){\n showAlert('NO_OK', 'error', { \"wtmessage\": \"Ya ha ingresado una asignatura en este bloque y hora\", \"title\": 'Información' });\n return;\n } \n else {\n //Varios Items \n arr_Grid[size] = objProducto(size);\n sessionStorage.dts_datosItemplan = JSON.stringify(arr_Grid);\n addVariosItem(tGrid, arr_Grid, -1);\n } \n limpiarDetalle();\n\n } else {\n /*Agrego a la Sesion*/\n //Primer Items \n arr_Grid[0] = objProducto(0);\n sessionStorage.dts_datosItemplan = JSON.stringify(arr_Grid);\n addPrimerItem(tGrid, arr_Grid, 0);\n limpiarDetalle();\n }\n } else {\n //No existe la Session\n //Primer Items\n arr_Grid[0] = objProducto(0);\n sessionStorage.dts_datosItemplan = JSON.stringify(arr_Grid);\n addPrimerItem(tGrid, arr_Grid, 0);\n limpiarDetalle();\n }\n } else {\n //data edicion\n }\n } else {\n showAlert('NO_OK', 'error', { \"wtmessage\": \"Todos los datos del detalle planificación son obligatorios\", \"title\": 'Información' });\n }\n}", "function RdatosLogistica(Material, Partidas, Destinos, Tiempo) {\n return { Material,Partidas, Destinos, Tiempo };\n}", "function _CarregaTabelaArmasArmaduras() {\n var tabelas_especificas_armas = [\n tabelas_armas_simples, tabelas_armas_comuns, tabelas_armas_exoticas ];\n var talentos_relacionados_armas = [\n 'usar_armas_simples', 'usar_arma_comum', 'usar_arma_exotica' ];\n _CarregaTabelasCompostas(\n tabelas_especificas_armas, talentos_relacionados_armas,\n tabelas_armas, tabelas_armas_invertida);\n var tabelas_especificas_armaduras = [\n tabelas_armaduras_leves, tabelas_armaduras_medias, tabelas_armaduras_pesadas ];\n var talentos_relacionados_armaduras = [\n 'usar_armaduras_leves', 'usar_armaduras_medias', 'usar_armaduras_pesadas' ];\n _CarregaTabelasCompostas(\n tabelas_especificas_armaduras, talentos_relacionados_armaduras,\n tabelas_armaduras, tabelas_armaduras_invertida);\n _CarregaTabelaMongeDesarmado();\n}", "function leerDatosDeProducto(productoAgregado) {\n const idProductoSeleccionado = parseInt(\n productoAgregado.querySelector(\"a\").getAttribute(\"data-id\")\n );\n\n let datoProductos = {};\n\n productosEnStock.forEach((producto) => {\n if (producto.id === idProductoSeleccionado) {\n datoProductos = { ...producto };\n datoProductos.cantidad = 1;\n }\n });\n const existe = coleccionProductos.some(\n (producto) => producto.id === datoProductos.id\n );\n\n if (existe) {\n //actualizamos la cantidad\n const productosListaSinCopia = coleccionProductos.map((producto) => {\n if (producto.id === datoProductos.id) {\n producto.cantidad++;\n return producto;\n } else {\n return producto;\n }\n });\n } else {\n //agrega elemento al arreglo de carrito\n coleccionProductos = [...coleccionProductos, datoProductos];\n }\n\n carritoHTML();\n}", "function alldatos(nombre,apellido,edad,genero,ciudad,pais){\n this.nombre=nombre;\n this.apellido=apellido;\n this.edad=edad;\n this.genero=genero;\n this.ciudad=ciudad;\n this.pais=pais;\n }", "function getAdicionalByCodigo(codigo){\r\n\t\tlog = _b_orden.ingredientes.length;\r\n \t$.ajax({\r\n\t\turl: \"../getIngredienteByCodigo/\"+codigo,\r\n\t\ttype:\"post\", \r\n\t\tcontentType: \"application/json; charset=utf-8\",\r\n\t\tdataType: \"json\",\r\n\r\n\t\tsuccess: function(data){ \t\t\t\r\n\t\t\tfor (index = 0; index < data.length; ++index) \r\n\t\t\t{\r\n\t\t\t\t//alert(data[index]['nombre_matarial']);\r\n\t \t_b_orden.ingredientes.push(\r\n\t \t\t{nombre_m:data[index]['nombre_matarial'],\r\n\t \t\tcodigo_m:data[index]['codigo_material']});\t\r\n \t\t}\r\n \t\ttotal_xy = log+1; \t\t\r\n\t\t},\r\n\t\terror:function()\r\n\t\t{\r\n\t\t \talert(\"Error. Quitar Ingrediente\");\r\n\t\t}\t\r\n\t\t});\r\n\t}", "function mostrarAutores(){\r\n console.log('Estos son los autores de los libros: ');\r\n var autores = [];\r\n for (var libro of arrayLibros) {\r\n autores.push(libro.obtAutor());\r\n }\r\n\r\n // Ese atributo de \"sort\" se usa para acomodarlos en orden alfabetico\r\n console.log(autores.sort());\r\n}", "function cargarDatos(){\n let auxLista = JSON.parse(localStorage.getItem('anunciosAnimales')) || [];\n return auxLista;\n}", "function obtenerPostresForOf(almuerzos) {\n let postres = [];\n\n for (const almuerzo of almuerzos) {\n if (almuerzo.principal === \"taco\") {\n postres.push(almuerzo.postre);\n }\n }\n return postres;\n}", "function listarProductos(){\n\n\n\t\t\tvar listarProductos = [];\t\n\n\t\t\tvar descripcion = $('.nuevaDescripcionProducto');\n\n\t\t\tvar cantidad = $('.nuevaCantidadProducto');\n\n\t\t\tvar precio = $('.nuevoPrecioProducto');\n\n\t\t\tfor (var i = 0; i < descripcion.length; i++) {\n\t\t\t\t\n\n\t\t\t\tlistarProductos.push({'id': $(descripcion[i]).attr('idProducto'),\t\t\t\t\n\t\t\t\t\t'descripcion': $(descripcion[i]).val(),\n\t\t\t\t\t'cantidad': $(cantidad[i]).val(),\n\t\t\t\t\t'stock': $(cantidad[i]).attr('nuevoStock'),\n\t\t\t\t\t'precio': $(precio[i]).attr('precioReal'),\n\t\t\t\t\t'total': $(precio[i]).val()\n\t\t\t\t})\n\n\n\n\t\t\t}\n\n\t\t\tconsole.log(\"listarProductos\", JSON.stringify(listarProductos));\n\n\t\t\t$('#listaProductos').val(JSON.stringify(listarProductos));\n\t\t\t\n\t\t}", "function limparTaxasParaSalvar() {\n $scope.taxasAdministrativas.forEach((taxaAdm) => {\n taxaAdm.listaSalvar = [];\n });\n\n $scope.taxasAdministrativasSalvar = []\n }", "function leerDatosProductos(producto){\n const infoProducto = {\n img: producto.querySelector('.imagen').src,\n titulo: producto.querySelector('#title-product').textContent,\n cantidad: producto.querySelector('#cantidad').value,\n precio: producto.querySelector('#precio').textContent,\n id: producto.querySelector('#agregar-carrito').getAttribute('data-id')\n };\n agregarAlCarrito(infoProducto); \n}", "function naikAngkot(arrPenumpang) {\n rute = ['A', 'B', 'C', 'D', 'E', 'F'];\n //your code here\n if (arrPenumpang.length === 0) {\n \treturn '[]';\n }\n var daftarPenumpang = [];\n for (var i = 0; i < arrPenumpang.length; i++) {\n \tvar dataPenumpang = {};\n \tdataPenumpang.penumpang = arrPenumpang[i][0];\n \tdataPenumpang.naikDari = arrPenumpang[i][1];\n \tdataPenumpang.tujuan = arrPenumpang[i][2];\n \tdataPenumpang.bayar = (rute.indexOf(arrPenumpang[i][2])-rute.indexOf(arrPenumpang[i][1]))*2000;\n \tdaftarPenumpang.push(dataPenumpang);\n }\n return daftarPenumpang;\n}", "function _ConverteListaArmaduras() {\n gPersonagem.armaduras.length = 0;\n for (var i = 0; i < gEntradas.armaduras.length; ++i) {\n var armadura_personagem = ConverteArmadura(gEntradas.armaduras[i]);\n gPersonagem.armaduras.push(armadura_personagem);\n }\n gPersonagem.escudos.length = 0;\n for (var i = 0; i < gEntradas.escudos.length; ++i) {\n var escudo_personagem = ConverteEscudo(gEntradas.escudos[i]);\n gPersonagem.escudos.push(escudo_personagem);\n }\n\n}", "function listarArticulosIngreso() {\n\n var listaArticulos = [];\n \n var descripcion = $(\".nuevaDescripcionProducto\");\n \n var cantidad = $(\".nuevaCantidadArticuloIngreso\");\n\t\n \n for (var i = 0; i < descripcion.length; i++) {\n\n listaArticulos.push({\n\n id: $(descripcion[i]).attr(\"articuloIngreso\"),\n articulo: $(descripcion[i]).attr(\"codigoAC\"),\n cantidad: $(cantidad[i]).attr(\"cantidad\"),\n\t\tnuevaCant: $(cantidad[i]).val(),\n taller: $(cantidad[i]).attr(\"nuevoTaller\"),\n\t\tidCierre: $(descripcion[i]).attr(\"idCierre\")\n\n });\n }\n \n // console.log(\"listaArticulos\", JSON.stringify(listaArticulos)); \n \n $(\"#listaArticulosIngreso\").val(JSON.stringify(listaArticulos));\n\n}", "function incluyeOpcionVacia(datos) {\n\t var datos2 = new Array();\n\t datos2[0] = ['','']; \n\t for (var i=0;i<datos.length;i++) {\n\t \tdatos2[i+1] = datos[i];\n\t }\n\t return datos2;\n\t}", "function agregaElemento(arr,tarea){\n arr.push(tarea);\n}", "function _geraPalavras(indice) {\n\n let vetPalavras = [\n {\n dica: 'É uma fruta',\n palavra: 'MORANGO',\n },\n {\n dica: 'É um carro',\n palavra: 'FERRARI',\n },\n {\n dica: 'É um time de futebol',\n palavra: 'CHAPECOENSE',\n },\n {\n dica: 'É um professor do senac',\n palavra: 'Valter',\n },\n {\n dica: 'É um dia da semana',\n palavra: 'DOMINGO',\n },\n {\n dica: 'É um super-herói',\n palavra: 'FLASH',\n },\n {\n dica: 'É uma cor',\n palavra: 'DOURADO',\n },\n {\n dica: 'É uma marca de celular',\n palavra: 'ASUS',\n },\n {\n dica: 'É um prato típico',\n palavra: 'FEIJOADA',\n },\n {\n dica: 'É um pais',\n palavra: 'AUSTRIA',\n },\n ]\n return vetPalavras[indice];\n}", "cargarTareasArrayDB( tareas = [] ) {\n\n tareas.forEach(tarea => {\n this._listado[tarea.id] = tarea;\n })\n\n }", "function nuovoMembro(){\n// la funzione prende i valori e ci crea un oggetto\nconst nuovoMembro =\n{\nimmagine : document.getElementById(\"image\").value,\nnome : document.getElementById(\"name\").value,\nruolo : document.getElementById(\"role\").value\n};\n\n//Pushiamo l'oggetto nell'array membri\nmembri.push(nuovoMembro)\n\n//inception di funzione printatrice\nprintatrice(nuovoMembro)\n}", "function lista_adyacentes(id_nodo, grafo)\n{\nvar lista=new Array();\nvar tam=grafo.length;\n\tfor(var i=0;i<tam;i++)\n\t{\n\t\tif(id_nodo==grafo[i][0])\n\t\t{\n\t\tcopiar_arreglo(lista,grafo[i]);\n\t\treturn lista;\n\t\t}\n\t}\n\tconsole.log(\"arroje error\");\n}", "function add_comentarios(){ // funcion de agregar comentarios\n\n var nombre = document.getElementById('nombre').value; //tomo valores que ingresa el usuario en el form\n var coment = document.getElementById('texto_coment').value;\n var puntos = document.getElementById('puntos').value;\n\n comentario.push(nombre);\n comentario.push(coment);\n comentario.push(puntos);\n \n console.log(comentario);\n mostrar(comentario);\n\n}", "function ordenarProductosPrecio(productos, orden){\n\n //creo una variable donde se van a cagar los productos por orden de precio\n\n //variable de menor a mayor\n let productosOrdenPrecioAsc = [];\n //variable de mayor a menor\n let productosOrdenPrecioDesc = [];\n\n //guardamos una copia del array de productos traidos del json\n\n let productosCopia = productos.slice();\n\n // creo una variable que va a ser un array con solo los precios de cada producto, la cargamos mediante un map\n \n let arrayProductosOrdenPrecio = productosCopia.map((producto) => {return producto.precio} );\n\n //ordeno el array con los precios\n \n let comparar = (a,b) => {return a - b};\n \n arrayProductosOrdenPrecio.sort(comparar);\n\n // recorro el array con los precios de los productos en orden\n\n for(precio of arrayProductosOrdenPrecio){\n \n //guardo el indice donde se encuentra el producto que coincide con el precio del array con precios ordenados\n\n let indice = productosCopia.findIndex( (productoCopia) => { if(productoCopia.precio==precio){ \n\n return productoCopia \n\n } } );\n\n //guardo en el array de productos por orden de precio que cree al principio de la funcion, el producto del array que coincida con el indice\n\n //mayor a menor\n productosOrdenPrecioDesc.unshift(productosCopia[indice]);\n //menor a mayor\n productosOrdenPrecioAsc.push(productosCopia[indice]);\n\n /*Luego de guardarlo, elimino ese producto del array copia ya que \n el metodo findIndex devuelve el indice del primer elemto que coincida y si hay productos con la misma fecha\n se va a guardar siempre el primero que encuentre (resumen: lo elimino para que no se guarden elementos repetidos)*/\n\n productosCopia.splice(indice,1);\n \n }\n\n //retornamos el nuevo array de productos ordenados por precio \n\n if(orden == \"asc\"){\n\n return productosOrdenPrecioAsc;\n\n }\n\n if(orden == \"des\"){\n\n return productosOrdenPrecioDesc;\n\n }\n\n if(orden != \"asc\" && orden != \"des\"){\n\n console.log(\"ingrese correctamente el parametro indicador del ordenamiento por precio\");\n\n }\n \n\n}", "get listadoArr() { //utilizo un getter para retornar un nuevo arreglo\n\n const listado = []; //este es el arreglo que luego devuelvo con el return\n Object.keys(this._listado).forEach(key => { //El arreglo lo completo con las tareas que carga el usuario\n const tarea = this._listado[key]; //Esta funcion permite retornar todas las llaves que tenga el objeto. Esto crea un arreglo de strings. Con el forEach recorro el array y extraigo cada una de las llaves que estan dentro de _listado. Luego las agrego al array con el .push\n listado.push( tarea )\n\n });\n return listado;\n }", "function agregarOrden(){\r\n let compra = document.getElementById('tit1')\r\n let precio = document.getElementById('pre1')\r\n pedido.push(new vehiculo(compra.textContent, precio.textContent));\r\n crearPedido(); \r\n}", "function costruttoreDatiMesi(array) {\n var objIntermedio = {};\n var dataPC = [];\n for (var i = 0; i < array.length; i++) {\n var oggettoSingolo = array[i];\n var giornoVendita = oggettoSingolo.date;\n var meseVendita = moment(giornoVendita, \"DD-MM-YYYY\").clone().month(); // ottengo i numeri dei mesi che escono già ordinati nell'oggetto\n if (objIntermedio[meseVendita] === undefined) {\n objIntermedio[meseVendita] = 0;\n }\n objIntermedio[meseVendita] += parseInt(oggettoSingolo.amount);\n }\n for (var key in objIntermedio) {\n dataPC.push(objIntermedio[key]);\n }\n return dataPC;\n}", "function adicionarDespesas() {\n if(isNumber(despesa.value)) {\n des.push(Number(despesa.value))\n let item = document.createElement('option')\n item.style.background = 'red'\n item.text = `- Valor de - R$:${despesa.value} retirado em despesas`\n rlista.appendChild(item)\n \n \n res.style.display='none'\n }\n\n erro.style.display = 'none' //Retirar o alerta de erro ao adicionar\n \n \n despesa.value = ''\n \n }", "function obtenerArregloPedidoMovil(arrRetorno) {\n if (arrRetorno.length > 0) {\n if (dataProductos.length > 0) {\n for (var i = 0; i < arrRetorno.length; i++) {\n var objArrRetorno = arrRetorno[i];\n dataProductos.push(objArrRetorno);\n if (objArrRetorno.productoSerial == true) {\n var arrSerial = new Array();\n arrSerial = objArrRetorno.serial;\n for (var j = 0; j < arrSerial.length; j++) {\n arrSerialesProductos.push(objArrRetorno.serial[j]);\n }\n }\n }\n } else {\n dataProductos = arrRetorno;\n for (var i = 0; i < arrRetorno.length; i++) {\n var objArrRetorno = arrRetorno[i];\n if (objArrRetorno.productoSerial == true) {\n var arrSerial = new Array();\n arrSerial = objArrRetorno.serial;\n for (var j = 0; j < arrSerial.length; j++) {\n arrSerialesProductos.push(objArrRetorno.serial[j]);\n }\n }\n }\n }\n crearListadoTransaccionProducto();\n }\n}", "function addItem(id){\n\n let item = produtos[id];\n poeCarrinho(item);\n console.log(arrayCarrinho)\n\n localStorage.setItem(\"carrinho\", JSON.stringify(arrayCarrinho));\n}//addItem", "function regAlunos(tam) {\n var alunos = [];\n for (i = 0; i < tam; i++ ) {\n var aluno = new Aluno();\n aluno.setNr(i+1);\n aluno.setNota(randonNumbers(0, 100));\n\n alunos.push(aluno);\n }\n return alunos;\n}", "function lobural() {\n\tfor(var i=0;i<20;i++) {\n\t\tindiceCartas[i] = new Array(20);\n\t\tfor (var j=0;j<20;j++) {\n\t\t\tindiceCartas[i][j] = 0;\n\t\t}\n\t} \n}", "function _LeArmas() {\n _LeArmasArmadurasEscudos(gEntradas.armas, Dom('div-equipamentos-armas'));\n}", "function _LeArmas() {\n _LeArmasArmadurasEscudos(gEntradas.armas, Dom('div-equipamentos-armas'));\n}" ]
[ "0.6982567", "0.68499863", "0.6550184", "0.6545968", "0.6535408", "0.6432104", "0.6370613", "0.6357162", "0.63181823", "0.6314732", "0.6289861", "0.6233907", "0.6211365", "0.61929584", "0.61897033", "0.6145835", "0.6142087", "0.61195624", "0.61015165", "0.6097602", "0.6083196", "0.6069644", "0.6036588", "0.6033074", "0.60251564", "0.60238874", "0.60166466", "0.60121673", "0.600629", "0.5999109", "0.5990171", "0.5985257", "0.596991", "0.59623283", "0.59467083", "0.59377235", "0.5934722", "0.5926274", "0.59248775", "0.5924366", "0.5922238", "0.59140223", "0.5909308", "0.59063494", "0.59063494", "0.58839184", "0.5883446", "0.58806014", "0.58707607", "0.5868815", "0.58624244", "0.58603317", "0.5854559", "0.585182", "0.58508605", "0.5836225", "0.58319736", "0.5827885", "0.58094007", "0.58061355", "0.5801179", "0.5775391", "0.57707447", "0.5761563", "0.57577074", "0.5756846", "0.5755568", "0.57467216", "0.5718079", "0.5714966", "0.5711198", "0.5704135", "0.5704017", "0.56971836", "0.5695976", "0.56959444", "0.56911707", "0.5688081", "0.5686523", "0.56854075", "0.5678156", "0.56747454", "0.5673705", "0.5673314", "0.56711495", "0.56693536", "0.56671166", "0.5664196", "0.56640774", "0.5660591", "0.56493545", "0.5647725", "0.564692", "0.564629", "0.56435287", "0.5638415", "0.5634435", "0.5632423", "0.562923", "0.56264806", "0.56264806" ]
0.0
-1
base64url encode stringOrBuffer ``` Example > base64url('ladies and gentlemen, we are floating in space') 'bGFkaWVzIGFuZCBnZW50bGVtYW4sIHdlIGFyZSBmbG9hdGluZyBpbiBzcGFjZQ' ```
function encode(input, encoding) { if (encoding === void 0) { encoding = "utf8"; } if (Buffer.isBuffer(input)) { return fromBase64(input.toString("base64")); } return fromBase64(new Buffer(input, encoding).toString("base64")); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function base64_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64c)\n }", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n throw new Error('No Base64 Encode');\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n if (typeof base64 !== 'undefined') return base64.encode(str); //react native\n throw new Error('No Base64 Encode');\n }", "function toUrlString(buffer) {\n return buffer.toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function encodeURLEncodedBase64(value) {\n return encode(value)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function toBase64Url(base64Text) {\n return base64Text.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}", "function base64FromURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '-':\n \t\t\t\treturnString += '+';\n \t\t\t\tbreak;\n \t\t\tcase '_':\n \t\t\t\treturnString += '/';\n \t\t\t\tbreak;\n \t\t\tcase '*':\n \t\t\t\treturnString += '=';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n }", "function base64ToURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '+':\n \t\t\t\treturnString += '-';\n \t\t\t\tbreak;\n \t\t\tcase '/':\n \t\t\t\treturnString += '_';\n \t\t\t\tbreak;\n \t\t\tcase '=':\n \t\t\t\treturnString += '*';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n\n\n }", "function b64UTFEncode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, v) {\n return String.fromCharCode(parseInt(v, 16));\n }));\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function base64UrlEncode(input) {\n var str = String (input);\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars, output = '';\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n // str.charAt (idx | 0) || (map = '=', idx % 1);\n str.charAt (idx | 0);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt (63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt (idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError (\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n block = block << 8 | charCode;\n }\n return output;\n }", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function encodeString(value) {\n return Buffer.from(value).toString(\"base64\");\n}", "function toBase64(base64url) {\n // We this to be a string so we can do .replace on it. If it's\n // already a string, this is a noop.\n base64url = base64url.toString();\n return padString(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function base64encode(value) {\n\treturn new Buffer(value).toString('base64');\n}", "function b64(str) {\n return new Buffer(str).toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n} // This is the encyrption algorithm, don't ask me why it is that way", "base64Encode(input) {\n return EncodingUtils.base64Encode(input);\n }", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function base64Encode_(inputStr)\n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var outputStr = \"\";\n var i = 0;\n while (i < inputStr.length)\n {\n //all three \"& 0xff\" added below are there to fix a known bug\n //with bytes returned by xhr.responseText\n var byte1 = inputStr.charCodeAt(i++) & 0xff;\n var byte2 = inputStr.charCodeAt(i++) & 0xff;\n var byte3 = inputStr.charCodeAt(i++) & 0xff;\n var enc1 = byte1 >> 2;\n var enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n var enc3, enc4;\n if (isNaN(byte2)) { enc3 = enc4 = 64; } else { enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); if (isNaN(byte3)) { enc4 = 64; } else { enc4 = byte3 & 63; } }\n outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);\n }\n return outputStr;\n }", "function toBase64Url(arrayBuffer, start, end) {\n start = start || 0;\n end = end || arrayBuffer.byteLength;\n\n var buffer = new Uint8Array(arrayBuffer.slice(start, end)),\n base64 = btoa(String.fromCharCode.apply(null, buffer));\n\n return base64.replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) =>\n String.fromCharCode(`0x${p1}`)));\n}", "function toBuffer(base64url) {\n return new Buffer(toBase64(base64url), \"base64\");\n}", "function b64EncodeUnicode(str) {\n // first we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n function toSolidBytes(match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function b64EncodeUnicode(str) {\n // First we use encodeURIComponent to get percent-encoded UTF-8,\n // then we convert the percent encodings into raw bytes which\n // can be fed into btoa.\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, p1) {\n return String.fromCharCode(parseInt(p1, 16));\n }));\n}", "function b64EncodeUnicode(str) {\n\treturn btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n\t\tfunction toSolidBytes(match, p1) {\n\t\t\treturn String.fromCharCode('0x' + p1);\n\t\t}));\n}", "function base64Encode(str)\r\n{\r\n\tvar charBase64 = new Array(\r\n\t\t'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',\r\n\t\t'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',\r\n\t\t'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',\r\n\t\t'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'\r\n\t);\r\n\r\n\tvar out = \"\";\r\n\tvar chr1, chr2, chr3;\r\n\tvar enc1, enc2, enc3, enc4;\r\n\tvar i = 0;\r\n\r\n\tvar len = str.length;\r\n\r\n\tdo\r\n\t{\r\n\t\tchr1 = str.charCodeAt(i++);\r\n\t\tchr2 = str.charCodeAt(i++);\r\n\t\tchr3 = str.charCodeAt(i++);\r\n\r\n\t\t//enc1 = (chr1 & 0xFC) >> 2;\r\n\t\tenc1 = chr1 >> 2;\r\n\t\tenc2 = ((chr1 & 0x03) << 4) | (chr2 >> 4);\r\n\t\tenc3 = ((chr2 & 0x0F) << 2) | (chr3 >> 6);\r\n\t\tenc4 = chr3 & 0x3F;\r\n\r\n\t\tout += charBase64[enc1] + charBase64[enc2];\r\n\r\n\t\tif (isNaN(chr2))\r\n \t\t{\r\n\t\t\tout += '==';\r\n\t\t}\r\n \t\telse if (isNaN(chr3))\r\n \t\t{\r\n\t\t\tout += charBase64[enc3] + '=';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tout += charBase64[enc3] + charBase64[enc4];\r\n\t\t}\r\n\t}\r\n\twhile (i < len);\r\n\r\n\treturn out;\r\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function encodeBase64String(data, w, h) {\n var str = \"\";\n for (var i = 0; i < data.length; i++) {\n str = str.concat(btoa(data[i]));\n }\n return str;\n}", "function b64EncodeUnicode(str) {\n\t// first we use encodeURIComponent to get percent-encoded UTF-8,\n\t// then we convert the percent encodings into raw bytes which\n\t// can be fed into btoa.\n\treturn btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n\t\tfunction toSolidBytes(match, p1) {\n\t\t\treturn String.fromCharCode('0x' + p1);\n\t})).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '.');\n}", "function ab_to_base64(ab) {\n return base64urlencode(ab_to_str(ab));\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "function encode_base64( what )\n{\n var base64_encodetable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var result = \"\";\n var len = what.length;\n var x, y;\n var ptr = 0;\n\n while( len-- > 0 )\n {\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( x >> 2 ) & 63 );\n\n if( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( x << 4 ) & 63 );\n result += \"==\";\n break;\n }\n\n y = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( x << 4 ) | ( ( y >> 4 ) & 15 ) ) & 63 );\n\n if ( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( y << 2 ) & 63 );\n result += \"=\";\n break;\n }\n\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( y << 2 ) | ( ( x >> 6 ) & 3 ) ) & 63 );\n result += base64_encodetable.charAt( x & 63 );\n\n }\n\n return result;\n}", "function toBase64(a){return CryptoJS&&CryptoJS.enc.Base64?CryptoJS.enc.Base64.stringify(CryptoJS.enc.Latin1.parse(a)):Base64.encode(a)}", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function encodeDataURL(string){\n var encoded = encodeURIComponent(string);\n var url = 'data:application/octet-stream,' + encoded;\n return url;\n}", "toString(buf) {\n if (buf.length % 4 > 0) {\n throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${buf.length}`);\n }\n let str = '';\n let lineLen = 0;\n function buildLine(c1, c2, c3, c4) {\n switch (lineLen) {\n case 76:\n str += `\\r\\n${c1}${c2}${c3}${c4}`;\n lineLen = 4;\n break;\n case 75:\n str += `${c1}\\r\\n${c2}${c3}${c4}`;\n lineLen = 3;\n break;\n case 74:\n str += `${c1 + c2}\\r\\n${c3}${c4}`;\n lineLen = 2;\n break;\n case 73:\n str += `${c1 + c2 + c3}\\r\\n${c4}`;\n lineLen = 1;\n break;\n default:\n str += c1 + c2 + c3 + c4;\n lineLen += 4;\n break;\n }\n }\n function validate(c) {\n if (c >= 65 && c <= 90) {\n return true;\n }\n if (c >= 97 && c <= 122) {\n return true;\n }\n if (c >= 48 && c <= 57) {\n return true;\n }\n if (c === 43) {\n return true;\n }\n if (c === 47) {\n return true;\n }\n if (c === 61) {\n return true;\n }\n return false;\n }\n for (let i = 0; i < buf.length; i += 4) {\n for (let j = i; j < i + 4; j += 1) {\n if (!validate(buf[j])) {\n throw new RangeError(`base64.toString: buf[${j}]: ${buf[j]} : not valid base64 character code`);\n }\n }\n buildLine(\n String.fromCharCode(buf[i]),\n String.fromCharCode(buf[i + 1]),\n String.fromCharCode(buf[i + 2]),\n String.fromCharCode(buf[i + 3])\n );\n }\n return str;\n }", "utoa(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "function encoderBase64() {\n return {\n write: encodeBase64Write,\n end: encodeBase64End,\n\n prevStr: '',\n };\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function base64(s)\n\t{\n\t\tvar ch =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\t\tvar c1\n\t\t , c2\n\t\t , c3\n\t\t , e1\n\t\t , e2\n\t\t , e3\n\t\t , e4;\n\t\tvar l = s.length;\n\t\tvar i = 0;\n\t\tvar r = \"\";\n\n\t\tdo\n\t\t\t{\n\t\t\t\tc1 = s.charCodeAt(i);\n\t\t\t\te1 = c1 >> 2;\n\t\t\t\tc2 = s.charCodeAt(i + 1);\n\t\t\t\te2 = ((c1 & 3) << 4) | (c2 >> 4);\n\t\t\t\tc3 = s.charCodeAt(i + 2);\n\t\t\t\tif (l < i + 2) e3 = 64;\n\t\t\t\telse e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n\t\t\t\tif (l < i + 3) e4 = 64;\n\t\t\t\telse e4 = c3 & 0x3f;\n\t\t\t\tr += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n\t\t\t}\n\t\twhile ((i += 3) < l);\n\n\t\treturn r;\n\t}", "function encode(str) {\n // バイナリイメージでbtoaにかける\n const binUi8a = unescape(encodeURIComponent(str));\n\n return btoa(binUi8a);\n }", "function base64urlencode(data) {\n if (typeof btoa === 'function') return btoa(data).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = o1 << 16 | o2 << 8 | o3;\n h1 = bits >> 18 & 63;\n h2 = bits >> 12 & 63;\n h3 = bits >> 6 & 63;\n h4 = bits & 63;\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64a[h1] + b64a[h2] + b64a[h3] + b64a[h4];\n } while (i < data.length);\n enc = tmp_arr.join('');\n var r = data.length % 3;\n return (r ? enc.slice(0, r - 3) : enc);\n}", "function base64_encode(data) {\n\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n data = unescape(encodeURIComponent(data));\n\n do {\n // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n var r = data.length % 3;\n\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\n}", "function b64ToUtf8(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function base64toURL(b64Data, type) {\n var audioURL = \"data:\" + type + \";base64,\" + b64Data;\n return audioURL;\n}", "function arrayBufferToBase64url(arrayBuffer) {\n return toBase64Url(btoa(String.fromCharCode(...new Uint8Array(arrayBuffer))));\n}", "btoa(str) {\n return window.btoa(str);\n }", "function base64ToBuffer(s) {\n var l = s.length * 6 / 8\n if(s[s.length - 2] == '=')\n l = l - 2\n else\n if(s[s.length - 1] == '=')\n l = l - 1\n\n var b = new Buffer(l)\n b.write(s, 'base64')\n return b\n}", "function btoa (string) {\n // REF: https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript\n // It might sound wired, but we have to use 'ascii' to get the 'utf8' chars to be encoded/decoded correctly\n\n return Buffer.from(string, 'ascii').toString('base64');\n}", "function encodeDataString(str)\n {\n\n // Encoding.\n var retStr = str.split(\"\").reverse().join(\"\");\n retStr = '|' + retStr + ' ';\n retStr = Base64.encode(retStr);\n\n return retStr;\n\n }", "get base64UriString() {\n return exports.base64.encodeUri(this.refString);\n }", "btoa(str, decoder=new TextDecoder()){\n return decoder.decode(this.decode(str))\n }", "function encode (obj) {\n return Buffer.from(JSON.stringify(obj)).toString('base64');\n}", "function base64ToString (s) {\r\n //the base 64 characters\r\n var BASE64 = new Array ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/');\r\n\t\r\n var decode = new Object();\r\n for (var i=0; i<BASE64.length; i++) {decode[BASE64[i]] = i;} //inverse of the array\r\n decode['='] = 0; //add the equals sign as well\r\n var r = \"\", c1, c2, c3, c4, len=s.length; //define variables\r\n s += \"====\"; //just to make sure it is padded correctly\r\n for (var i=0; i<len; i+=4) { //4 input characters at a time\r\n c1 = s.charAt(i); //the 1st base64 input characther\r\n c2 = s.charAt(i+1);\r\n c3 = s.charAt(i+2);\r\n c4 = s.charAt(i+3);\r\n r += String.fromCharCode (((decode[c1] << 2) & 0xff) | (decode[c2] >> 4)); //reform the string\r\n if (c3 != '=') r += String.fromCharCode (((decode[c2] << 4) & 0xff) | (decode[c3] >> 2));\r\n if (c4 != '=') r += String.fromCharCode (((decode[c3] << 6) & 0xff) | decode[c4]);\r\n }\r\n return r;\r\n}", "function encode(str){\n return crt.encrypt(str,'utf8','base64');\n}", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "str2Base64(_str) {\n const _this = this;\n return _this._binb2b64(_this._str2binb(_str));\n }", "function encodedURL(str){\n\t\t\treturn encodeURIComponent(input);\n\t\t\t\n\t\t}", "function base64ToBuffer( str ) {\n\n\t\t\tvar b = atob( str );\n\t\t\tvar buf = new Uint8Array( b.length );\n\n\t\t\tfor ( var i = 0, l = buf.length; i < l; i ++ ) {\n\n\t\t\t\tbuf[ i ] = b.charCodeAt( i );\n\n\t\t\t}\n\n\t\t\treturn buf;\n\n\t\t}", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function b64toUtf8(str) {\n return decodeURIComponent(escape(window.atob(str)));\n}", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "function encode(string){\n\n}", "apply_blob(blob) { return Base64.encode(blob) }", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n for (var i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[bytes[i] >> 2];\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64String +=\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[bytes[i + 2] & 63];\n }\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n }\n else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n return base64String;\n }", "function b64enc(str) \n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n out = \"\", i = 0;\n \n while (i < str.length) {\n var byte1, byte2, byte3,\n enc1, enc2, enc3, enc4;\n\n byte1 = str.charCodeAt(i++) & 0xff;\n byte2 = str.charCodeAt(i++) & 0xff;\n byte3 = str.charCodeAt(i++) & 0xff;\n \n enc1 = byte1 >> 2;\n enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n \n if (isNaN(byte2)) {\n enc3 = enc4 = 64;\n } else {\n enc3 = ((byte2 & 15) << 2) | (byte3 >> 6);\n if (isNaN(byte3)) {\n enc4 = 64;\n } else {\n enc4 = byte3 & 63;\n }\n }\n \n out += b64.charAt(enc1) \n + b64.charAt(enc2) \n + b64.charAt(enc3) \n + b64.charAt(enc4);\n } \n \n return out;\n }", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}" ]
[ "0.8265343", "0.80151653", "0.78367305", "0.77729255", "0.77729255", "0.75920796", "0.7516804", "0.7502671", "0.7483557", "0.7454518", "0.7423198", "0.7416695", "0.74054503", "0.73559254", "0.7349591", "0.7335241", "0.7334521", "0.73307407", "0.73272485", "0.7325799", "0.7307131", "0.7296735", "0.7248128", "0.7215569", "0.71726704", "0.71726704", "0.7168576", "0.713273", "0.713273", "0.713273", "0.7110337", "0.70623255", "0.70602816", "0.6963188", "0.6853203", "0.68514156", "0.68514156", "0.6839885", "0.6839885", "0.6839885", "0.6839885", "0.68346894", "0.68314976", "0.6826167", "0.6812837", "0.6788739", "0.6781061", "0.6778739", "0.6754038", "0.67497116", "0.674531", "0.6739538", "0.671909", "0.67172277", "0.67089933", "0.66890866", "0.66505015", "0.6609619", "0.66025037", "0.65714717", "0.6566203", "0.6555553", "0.6549035", "0.6535714", "0.65180844", "0.65070194", "0.64850193", "0.64829326", "0.64764804", "0.6473633", "0.6456011", "0.6444161", "0.6438856", "0.64328873", "0.6415929", "0.64078116", "0.6399043", "0.6382646", "0.63821566", "0.6381522", "0.6379467", "0.63547593", "0.6347757", "0.6336387", "0.632975", "0.6329423", "0.63249034", "0.62998396", "0.6297929", "0.6272387", "0.6264646", "0.6264646", "0.6260079", "0.6246099", "0.6241911", "0.6241911", "0.6241911", "0.6241911", "0.6241911", "0.6241911", "0.6241911" ]
0.0
-1
Convert a base64url encoded string into a raw string. Encoding defaults to 'utf8'. ``` > base64url.decode('cmlkZTogZHJlYW1zIGJ1cm4gZG93bg') 'ride: dreams burn down' ```
function decode(base64url, encoding) { if (encoding === void 0) { encoding = "utf8"; } return new Buffer(toBase64(base64url), "base64").toString(encoding); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function base64urldecode(data) {\n data += '=='.substr((2 - data.length * 3) & 3)\n if (typeof atob === 'function') {\n data = data.replace(/\\-/g, '+').replace(/_/g, '/').replace(/,/g, '');\n try {\n return atob(data);\n } catch (e) {\n return '';\n }\n }\n // http://kevin.vanzonneveld.net\n // + original by: Tyler Akins (http://rumkin.com)\n // + improved by: Thunder.m\n // + input by: Aman Gupta\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfixed by: Onno Marsman\n // + bugfixed by: Pellentesque Malesuada\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + input by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\n // * returns 1: 'Kevin van Zonneveld'\n // mozilla has this native\n // - but breaks in 2.0.0.12!\n //if (typeof this.window['atob'] == 'function') {\n // return atob(data);\n //}\n\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 255;\n o2 = bits >> 8 & 255;\n o3 = bits & 255;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec;\n}", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function toBase64(base64url) {\n // We this to be a string so we can do .replace on it. If it's\n // already a string, this is a noop.\n base64url = base64url.toString();\n return padString(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function toBase64Url(base64Text) {\n return base64Text.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}", "function decodeBase64(input = \"\") {\n if (!input) return;\n\n return base64.toByteArray(\n input.padEnd(input.length + 4 - (input.length % 4), \"=\")\n );\n}", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n if (typeof base64 !== 'undefined') return base64.decode(str); //react native\n throw new Error('No Base64 Decode');\n }", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function fromBase64(text){\n if(CryptoJS && CryptoJS.enc.Base64) \n return CryptoJS.enc.Base64.parse(text).toString(CryptoJS.enc.Latin1);\n else\n return Base64.decode(text);\n }", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function base64FromURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '-':\n \t\t\t\treturnString += '+';\n \t\t\t\tbreak;\n \t\t\tcase '_':\n \t\t\t\treturnString += '/';\n \t\t\t\tbreak;\n \t\t\tcase '*':\n \t\t\t\treturnString += '=';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n }", "function base64_decode(data) {\n var dst = \"\"\n var i, a, b, c, d, z\n\n for (i = 0; i < data.length - 3; i += 4) {\n a = base64_charIndex(data.charAt(i+0))\n b = base64_charIndex(data.charAt(i+1))\n c = base64_charIndex(data.charAt(i+2))\n d = base64_charIndex(data.charAt(i+3))\n\n dst += String.fromCharCode((a << 2) | (b >>> 4))\n if (data.charAt(i+2) != b64pad)\n dst += String.fromCharCode(((b << 4) & 0xF0) | ((c >>> 2) & 0x0F))\n if (data.charAt(i+3) != b64pad)\n dst += String.fromCharCode(((c << 6) & 0xC0) | d)\n }\n\n dst = decodeURIComponent(escape(dst))\n return dst\n }", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "function fromBase64(base64) {\n return base64\n .replace(/=/g, \"\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n}", "function b64ToUtf8(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeStringToString(value) {\n return Buffer.from(value, \"base64\").toString();\n}", "function base64Decode(data) {\n data = data.replace(/[^a-z0-9\\+\\/=]/gi, \"\"); // strip none base64 characters\n if (typeof atob == \"function\") return atob(data); //use internal base64 functions if available (gecko only)\n var b64_map =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var byte1, byte2, byte3;\n var ch1, ch2, ch3, ch4;\n var result = new Array(); //array is used instead of string because in most of browsers working with large arrays is faster than working with large strings\n var j = 0;\n while (data.length % 4 != 0) {\n data += \"=\";\n }\n\n for (var i = 0; i < data.length; i += 4) {\n ch1 = b64_map.indexOf(data.charAt(i));\n ch2 = b64_map.indexOf(data.charAt(i + 1));\n ch3 = b64_map.indexOf(data.charAt(i + 2));\n ch4 = b64_map.indexOf(data.charAt(i + 3));\n\n byte1 = (ch1 << 2) | (ch2 >> 4);\n byte2 = ((ch2 & 15) << 4) | (ch3 >> 2);\n byte3 = ((ch3 & 3) << 6) | ch4;\n\n result[j++] = String.fromCharCode(byte1);\n if (ch3 != 64) result[j++] = String.fromCharCode(byte2);\n if (ch4 != 64) result[j++] = String.fromCharCode(byte3);\n }\n\n return result.join(\"\");\n}", "function decodeBase64(encodedValue) {\n return CryptoJS.enc.Base64.stringify(encodedValue);\n}", "raw_blob(txt) { return Base64.decode(txt) }", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function b64toUtf8(str) {\n return decodeURIComponent(escape(window.atob(str)));\n}", "function b64DecodeUnicode(str) {\n // Going backwards: from bytestream, to percent-encoding, to original string.\n return decodeURIComponent(atob(str).split('').map(function(c) {\n return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n }).join(''));\n}", "function rawurldecode(str) {\r\n return decodeURIComponent(str);\r\n}", "function b64DecodeUnicode(str) {\n\t// Going backwards: from bytestream, to percent-encoding, to original string.\n\treturn decodeURIComponent(atob(str).split('').map(function (c) {\n\t\treturn '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);\n\t}).join(''));\n}", "function base64decode(input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n \n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n\n }\n\n output = _utf8_decode(output);\n \n return output;\n\n }", "function decode(input) {\n return JSON.parse(base64.decode(input));\n}", "function base64ToString (s) {\r\n //the base 64 characters\r\n var BASE64 = new Array ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/');\r\n\t\r\n var decode = new Object();\r\n for (var i=0; i<BASE64.length; i++) {decode[BASE64[i]] = i;} //inverse of the array\r\n decode['='] = 0; //add the equals sign as well\r\n var r = \"\", c1, c2, c3, c4, len=s.length; //define variables\r\n s += \"====\"; //just to make sure it is padded correctly\r\n for (var i=0; i<len; i+=4) { //4 input characters at a time\r\n c1 = s.charAt(i); //the 1st base64 input characther\r\n c2 = s.charAt(i+1);\r\n c3 = s.charAt(i+2);\r\n c4 = s.charAt(i+3);\r\n r += String.fromCharCode (((decode[c1] << 2) & 0xff) | (decode[c2] >> 4)); //reform the string\r\n if (c3 != '=') r += String.fromCharCode (((decode[c2] << 4) & 0xff) | (decode[c3] >> 2));\r\n if (c4 != '=') r += String.fromCharCode (((decode[c3] << 6) & 0xff) | decode[c4]);\r\n }\r\n return r;\r\n}", "function base64ToURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '+':\n \t\t\t\treturnString += '-';\n \t\t\t\tbreak;\n \t\t\tcase '/':\n \t\t\t\treturnString += '_';\n \t\t\t\tbreak;\n \t\t\tcase '=':\n \t\t\t\treturnString += '*';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n\n\n }", "function base64UrlDecode(input) {\n var str = (String (input)).replace (/[=]+$/, ''); // #31: ExtendScript bad parse of /=\n if (str.length % 4 === 1) {\n throw new InvalidCharacterError (\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (\n // initialize result and counters\n var bc = 0, bs, buffer, idx = 0, output = '';\n // get next character\n buffer = str.charAt (idx++); // eslint-disable-line no-cond-assign\n // character found in table? initialize bit storage and add its ascii value;\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n // and if not first of each 4 characters,\n // convert the first 8 bits to one ascii character\n bc++ % 4) ? output += String.fromCharCode (255 & bs >> (-2 * bc & 6)) : 0\n ) {\n // try to find character in table (0-63, not found => -1)\n buffer = chars.indexOf (buffer);\n }\n return output;\n }", "function decodeDataString(str)\n {\n\n if (str.length < 1) return \"\";\n\n var retStr = Base64.decode(str);\n retStr = retStr.substring(1, (retStr.length -1));\n retStr = retStr.split(\"\").reverse().join(\"\");\n\n return retStr;\n }", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function base64decode(b64string) {\n var byteCharacters = atob(b64string);\n var byteNumbers = new Array(byteCharacters.length);\n for (var i = 0; i < byteCharacters.length; i++) {\n byteNumbers[i] = byteCharacters.charCodeAt(i);\n }\n return new Uint8Array(byteNumbers);\n }", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "function decodeMessage(message) {\n const raw = message.raw;\n return base64_decode(raw);\n}", "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCodeAt(i + 1);\n e2 = ((c1 & 3) << 4) | (c2 >> 4);\n c3 = s.charCodeAt(i + 2);\n if (l < i + 2) {\n e3 = 64;\n } else {\n e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n }\n if (l < i + 3) {\n e4 = 64;\n } else {\n e4 = c3 & 0x3f;\n }\n r += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n } while ((i += 3) < l);\n return r;\n }", "function base64_decode(data) {\n // console.log(\"data\"+data);\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 0xff;\n o2 = bits >> 8 & 0xff;\n o3 = bits & 0xff;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec.replace(/\\0+$/, '');\n }", "function base64_decode(data) {\n // console.log(\"data\"+data);\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 0xff;\n o2 = bits >> 8 & 0xff;\n o3 = bits & 0xff;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec.replace(/\\0+$/, '');\n }", "function stringToBase64 (s) {\r\n\treturn hexToBase64(stringToHex(s));\r\n}", "static transformBase64ToString(isAndroid, base64String) {\n if (isAndroid) {\n // eslint-disable-next-line no-undef\n var data = android.util.Base64.decode(base64String,android.util.Base64.DEFAULT);\n // eslint-disable-next-line no-undef\n var decodedString = new java.lang.String(data,java.nio.charset.StandardCharsets.UTF_8);\n return decodedString;\n } else {\n // eslint-disable-next-line no-undef\n const decodedData = NSData.alloc().initWithBase64EncodedStringOptions(base64String,0);\n // eslint-disable-next-line no-undef\n return NSString.alloc().initWithDataEncoding(decodedData,NSUTF8StringEncoding);\n }\n }", "function base64_decode(data) {\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n dec = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n data += '';\r\n\r\n do { // unpack four hexets into three octets using index points in b64\r\n h1 = b64.indexOf(data.charAt(i++));\r\n h2 = b64.indexOf(data.charAt(i++));\r\n h3 = b64.indexOf(data.charAt(i++));\r\n h4 = b64.indexOf(data.charAt(i++));\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n o1 = bits >> 16 & 0xff;\r\n o2 = bits >> 8 & 0xff;\r\n o3 = bits & 0xff;\r\n\r\n if (h3 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1);\r\n } else if (h4 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\r\n } else {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\r\n }\r\n } while (i < data.length);\r\n\r\n dec = tmp_arr.join('');\r\n\r\n return dec.replace(/\\0+$/, '');\r\n}", "function encodeURLEncodedBase64(value) {\n return encode(value)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function base64_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64c)\n }", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "str2Base64(_str) {\n const _this = this;\n return _this._binb2b64(_this._str2binb(_str));\n }", "function base64(s)\n\t{\n\t\tvar ch =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\t\tvar c1\n\t\t , c2\n\t\t , c3\n\t\t , e1\n\t\t , e2\n\t\t , e3\n\t\t , e4;\n\t\tvar l = s.length;\n\t\tvar i = 0;\n\t\tvar r = \"\";\n\n\t\tdo\n\t\t\t{\n\t\t\t\tc1 = s.charCodeAt(i);\n\t\t\t\te1 = c1 >> 2;\n\t\t\t\tc2 = s.charCodeAt(i + 1);\n\t\t\t\te2 = ((c1 & 3) << 4) | (c2 >> 4);\n\t\t\t\tc3 = s.charCodeAt(i + 2);\n\t\t\t\tif (l < i + 2) e3 = 64;\n\t\t\t\telse e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n\t\t\t\tif (l < i + 3) e4 = 64;\n\t\t\t\telse e4 = c3 & 0x3f;\n\t\t\t\tr += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n\t\t\t}\n\t\twhile ((i += 3) < l);\n\n\t\treturn r;\n\t}", "get base64UriString() {\n return exports.base64.encodeUri(this.refString);\n }", "function b64decode(s) {\n // s = s.replace(/[^A-Za-z0-9\\+\\/]/g, '');\n var n = s.length,\n k = n * 3 + 1 >> 2, r = new Uint8Array(k);\n\n for (var m3, m4, u24 = 0, j = 0, i = 0; i < n; i++) {\n m4 = i & 3;\n var c = s.charCodeAt(i);\n\n c = c > 64 && c < 91 ?\n c - 65 : c > 96 && c < 123 ?\n c - 71 : c > 47 && c < 58 ?\n c + 4 : c === 43 ?\n 62 : c === 47 ?\n 63 : 0;\n\n u24 |= c << 18 - 6 * m4;\n if (m4 === 3 || n - i === 1) {\n for (m3 = 0; m3 < 3 && j < k; m3++, j++) {\n r[j] = u24 >>> (16 >>> m3 & 24) & 255;\n }\n u24 = 0;\n\n }\n }\n return r.buffer;\n}", "function base64_decode(base64str, file) {\n var bitmap = new Buffer(base64str, 'base64');\n fs.writeFileSync(file, bitmap);\n }", "function base64_decode(base64str, file) {\n var bitmap = new Buffer(base64str, 'base64');\n fs.writeFileSync(file, bitmap);\n }", "function decodeWebBase64ToHex(str) {\n const bytes = atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n let hex = '';\n for (let i = 0; i < bytes.length; ++i) {\n hex += padLeft(bytes.charCodeAt(i).toString(16), 2, '0');\n }\n return hex;\n }", "function Base64Decode(encoded) {\n var keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n\n do {\n enc1 = keyStr.indexOf(encoded.charAt(i++));\n enc2 = keyStr.indexOf(encoded.charAt(i++));\n enc3 = keyStr.indexOf(encoded.charAt(i++));\n enc4 = keyStr.indexOf(encoded.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n } while (i < encoded.length);\n\n return output;\n }", "function decode64(input) {\n\tvar output = \"\";\n\tvar chr1, chr2, chr3 = \"\";\n\tvar enc1, enc2, enc3, enc4 = \"\";\n\tvar i = 0;\n\n\t// remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n\tvar base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n\tif (base64test.exec(input)) {\n\t\talert(\"There were invalid base64 characters in the input text.\\n\"\n\t\t\t\t+ \"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\n\"\n\t\t\t\t+ \"Expect errors in decoding.\");\n\t}\n\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n\tdo {\n\t\tenc1 = keyStr.indexOf(input.charAt(i++));\n\t\tenc2 = keyStr.indexOf(input.charAt(i++));\n\t\tenc3 = keyStr.indexOf(input.charAt(i++));\n\t\tenc4 = keyStr.indexOf(input.charAt(i++));\n\n\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\n\t\toutput = output + String.fromCharCode(chr1);\n\n\t\tif (enc3 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t}\n\t\tif (enc4 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t}\n\n\t\tchr1 = chr2 = chr3 = \"\";\n\t\tenc1 = enc2 = enc3 = enc4 = \"\";\n\n\t} while (i < input.length);\n\n\treturn unescape(output);\n}", "async function getBase64FromUrl(url) {\n const response = await fetch(url);\n const blob = await response.blob();\n return await new Promise(resolve => {\n let reader = new FileReader();\n reader.readAsDataURL(blob);\n reader.onloadend = () => { resolve(reader.result); };\n });\n }", "function base64_covert_to_img(_base64_string, _path){\nvar filepath = base64Img.imgSync(_base64_string, _path,uuidv1());\nreturn filepath;\n}", "function base64_decode (base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64Decode(base64str, file) {\n // create buffer object from base64 encoded string\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n }", "function decodeBase64Image(dataString) {\n\n \tconsole.log(\"Decoding base 64 image\");\n\n\t\tvar matches = dataString.match(/^data:([A-Za-z-+\\/]+);base64,(.+)$/),\n\t\tresponse = {};\n\n\t\tif (matches.length !== 3) {\n\t\t\treturn new Error('Invalid input string');\n\t\t}\n\n\t\tresponse.type = matches[1];\n\t\tresponse.data = new Buffer(matches[2], 'base64');\n\n\t\treturn response;\n\t}", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "function b64UTFEncode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, v) {\n return String.fromCharCode(parseInt(v, 16));\n }));\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64Decode(strText)\n{\n if (!window.atob) {\n var strKey = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var strOutput = '';\n var strChr1, strChr2, strChr3;\n var strEnc1, strEnc2, strEnc3, strEnc4;\n var intCount = 0;\n strText = strText.replace(/[^A-Za-z0-9\\+\\/\\=]/g, '');\n do\n {\n strEnc1 = strKey.indexOf(strText.charAt(intCount++));\n strEnc2 = strKey.indexOf(strText.charAt(intCount++));\n strEnc3 = strKey.indexOf(strText.charAt(intCount++));\n strEnc4 = strKey.indexOf(strText.charAt(intCount++));\n strChr1 = (strEnc1 << 2) | (strEnc2 >> 4);\n strChr2 = ((strEnc2 & 15) << 4) | (strEnc3 >> 2);\n strChr3 = ((strEnc3 & 3) << 6) | strEnc4;\n strOutput = strOutput + String.fromCharCode(strChr1);\n if (strEnc3 != 64)\n strOutput = strOutput + String.fromCharCode(strChr2);\n if (strEnc4 != 64)\n strOutput = strOutput + String.fromCharCode(strChr3);\n }\n while (intCount < strText.length);\n return strOutput;\n }\n include_once('/vendor/jquery-base64/jquery-base64-0.1/jquery.base64.min.js' + strGlobalSufixJsGzip);\n return $.base64.atob(strText);\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function evalb64(b64string){ \n eval(atob(b64string))\n}", "function b64tob64u(string) {\n var result = string;\n result = result.replace(/\\+/g, \"-\");\n result = result.replace(/\\//g, \"_\");\n result = result.replace(/=/g, \"\");\n return result;\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}" ]
[ "0.78458863", "0.7844712", "0.7824566", "0.78074765", "0.7802375", "0.78018886", "0.7788602", "0.77871054", "0.7696004", "0.76193535", "0.7428136", "0.722185", "0.70573884", "0.69811887", "0.69313794", "0.69263846", "0.67858446", "0.6766219", "0.6747483", "0.67336303", "0.67336303", "0.6727832", "0.6691472", "0.6661281", "0.66342545", "0.66105515", "0.66086423", "0.66086423", "0.66084534", "0.6590307", "0.6583311", "0.6579108", "0.6545909", "0.6545909", "0.6538068", "0.6522862", "0.6506891", "0.6501637", "0.6501637", "0.6501637", "0.6501637", "0.6481773", "0.6437433", "0.6432377", "0.6382696", "0.63794065", "0.63636875", "0.6343609", "0.6316888", "0.6311589", "0.62389076", "0.6236575", "0.62226605", "0.6213231", "0.6199301", "0.61505806", "0.6144831", "0.6101239", "0.60768", "0.6056937", "0.60563225", "0.6046633", "0.6026463", "0.6026463", "0.60074973", "0.5994616", "0.5989128", "0.5974617", "0.5970683", "0.59601855", "0.59229803", "0.59014297", "0.58852255", "0.5859622", "0.5857995", "0.5857995", "0.58479196", "0.584218", "0.5832614", "0.5811587", "0.58095425", "0.58019185", "0.58006096", "0.57986546", "0.57982695", "0.5795774", "0.578744", "0.57817924", "0.5769645", "0.5769645", "0.5769645", "0.5769645", "0.5769645", "0.5769645", "0.5769645", "0.5756898", "0.5748431", "0.57251596", "0.57251596", "0.57251596" ]
0.7692854
9
Convert a base64url encoded string to a base64 encoded string ``` > base64url.toBase64('qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA') 'qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==' ```
function toBase64(base64url) { // We this to be a string so we can do .replace on it. If it's // already a string, this is a noop. base64url = base64url.toString(); return padString(base64url) .replace(/\-/g, "+") .replace(/_/g, "/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function toBase64Url(base64Text) {\n return base64Text.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function encodeURLEncodedBase64(value) {\n return encode(value)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function base64_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64c)\n }", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function base64FromURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '-':\n \t\t\t\treturnString += '+';\n \t\t\t\tbreak;\n \t\t\tcase '_':\n \t\t\t\treturnString += '/';\n \t\t\t\tbreak;\n \t\t\tcase '*':\n \t\t\t\treturnString += '=';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n }", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function base64UrlEncode(input) {\n var str = String (input);\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars, output = '';\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n // str.charAt (idx | 0) || (map = '=', idx % 1);\n str.charAt (idx | 0);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt (63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt (idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError (\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n block = block << 8 | charCode;\n }\n return output;\n }", "function base64ToURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '+':\n \t\t\t\treturnString += '-';\n \t\t\t\tbreak;\n \t\t\tcase '/':\n \t\t\t\treturnString += '_';\n \t\t\t\tbreak;\n \t\t\tcase '=':\n \t\t\t\treturnString += '*';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n\n\n }", "str2Base64(_str) {\n const _this = this;\n return _this._binb2b64(_this._str2binb(_str));\n }", "function base64ToString (s) {\r\n //the base 64 characters\r\n var BASE64 = new Array ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/');\r\n\t\r\n var decode = new Object();\r\n for (var i=0; i<BASE64.length; i++) {decode[BASE64[i]] = i;} //inverse of the array\r\n decode['='] = 0; //add the equals sign as well\r\n var r = \"\", c1, c2, c3, c4, len=s.length; //define variables\r\n s += \"====\"; //just to make sure it is padded correctly\r\n for (var i=0; i<len; i+=4) { //4 input characters at a time\r\n c1 = s.charAt(i); //the 1st base64 input characther\r\n c2 = s.charAt(i+1);\r\n c3 = s.charAt(i+2);\r\n c4 = s.charAt(i+3);\r\n r += String.fromCharCode (((decode[c1] << 2) & 0xff) | (decode[c2] >> 4)); //reform the string\r\n if (c3 != '=') r += String.fromCharCode (((decode[c2] << 4) & 0xff) | (decode[c3] >> 2));\r\n if (c4 != '=') r += String.fromCharCode (((decode[c3] << 6) & 0xff) | decode[c4]);\r\n }\r\n return r;\r\n}", "function base64(s)\n\t{\n\t\tvar ch =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\t\tvar c1\n\t\t , c2\n\t\t , c3\n\t\t , e1\n\t\t , e2\n\t\t , e3\n\t\t , e4;\n\t\tvar l = s.length;\n\t\tvar i = 0;\n\t\tvar r = \"\";\n\n\t\tdo\n\t\t\t{\n\t\t\t\tc1 = s.charCodeAt(i);\n\t\t\t\te1 = c1 >> 2;\n\t\t\t\tc2 = s.charCodeAt(i + 1);\n\t\t\t\te2 = ((c1 & 3) << 4) | (c2 >> 4);\n\t\t\t\tc3 = s.charCodeAt(i + 2);\n\t\t\t\tif (l < i + 2) e3 = 64;\n\t\t\t\telse e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n\t\t\t\tif (l < i + 3) e4 = 64;\n\t\t\t\telse e4 = c3 & 0x3f;\n\t\t\t\tr += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n\t\t\t}\n\t\twhile ((i += 3) < l);\n\n\t\treturn r;\n\t}", "function fromBase64(base64) {\n return base64\n .replace(/=/g, \"\")\n .replace(/\\+/g, \"-\")\n .replace(/\\//g, \"_\");\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function stringToBase64 (s) {\r\n\treturn hexToBase64(stringToHex(s));\r\n}", "base64Encode(input) {\n return EncodingUtils.base64Encode(input);\n }", "function toBase64(a){return CryptoJS&&CryptoJS.enc.Base64?CryptoJS.enc.Base64.stringify(CryptoJS.enc.Latin1.parse(a)):Base64.encode(a)}", "function b64UTFEncode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, v) {\n return String.fromCharCode(parseInt(v, 16));\n }));\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCodeAt(i + 1);\n e2 = ((c1 & 3) << 4) | (c2 >> 4);\n c3 = s.charCodeAt(i + 2);\n if (l < i + 2) {\n e3 = 64;\n } else {\n e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n }\n if (l < i + 3) {\n e4 = 64;\n } else {\n e4 = c3 & 0x3f;\n }\n r += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n } while ((i += 3) < l);\n return r;\n }", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "function decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return new Buffer(toBase64(base64url), \"base64\").toString(encoding);\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function ab_to_base64(ab) {\n return base64urlencode(ab_to_str(ab));\n}", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n if (typeof base64 !== 'undefined') return base64.encode(str); //react native\n throw new Error('No Base64 Encode');\n }", "function decodeBase64(input = \"\") {\n if (!input) return;\n\n return base64.toByteArray(\n input.padEnd(input.length + 4 - (input.length % 4), \"=\")\n );\n}", "get base64UriString() {\n return exports.base64.encodeUri(this.refString);\n }", "static transformBase64ToString(isAndroid, base64String) {\n if (isAndroid) {\n // eslint-disable-next-line no-undef\n var data = android.util.Base64.decode(base64String,android.util.Base64.DEFAULT);\n // eslint-disable-next-line no-undef\n var decodedString = new java.lang.String(data,java.nio.charset.StandardCharsets.UTF_8);\n return decodedString;\n } else {\n // eslint-disable-next-line no-undef\n const decodedData = NSData.alloc().initWithBase64EncodedStringOptions(base64String,0);\n // eslint-disable-next-line no-undef\n return NSString.alloc().initWithDataEncoding(decodedData,NSUTF8StringEncoding);\n }\n }", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n throw new Error('No Base64 Encode');\n }", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "function b64_to_utf8( str ) {\n return decodeURIComponent(escape(window.atob( str )));\n}", "function base64urldecode(data) {\n data += '=='.substr((2 - data.length * 3) & 3)\n if (typeof atob === 'function') {\n data = data.replace(/\\-/g, '+').replace(/_/g, '/').replace(/,/g, '');\n try {\n return atob(data);\n } catch (e) {\n return '';\n }\n }\n // http://kevin.vanzonneveld.net\n // + original by: Tyler Akins (http://rumkin.com)\n // + improved by: Thunder.m\n // + input by: Aman Gupta\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfixed by: Onno Marsman\n // + bugfixed by: Pellentesque Malesuada\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + input by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\n // * returns 1: 'Kevin van Zonneveld'\n // mozilla has this native\n // - but breaks in 2.0.0.12!\n //if (typeof this.window['atob'] == 'function') {\n // return atob(data);\n //}\n\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 255;\n o2 = bits >> 8 & 255;\n o3 = bits & 255;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec;\n}", "function encode_base64( what )\n{\n var base64_encodetable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var result = \"\";\n var len = what.length;\n var x, y;\n var ptr = 0;\n\n while( len-- > 0 )\n {\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( x >> 2 ) & 63 );\n\n if( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( x << 4 ) & 63 );\n result += \"==\";\n break;\n }\n\n y = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( x << 4 ) | ( ( y >> 4 ) & 15 ) ) & 63 );\n\n if ( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( y << 2 ) & 63 );\n result += \"=\";\n break;\n }\n\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( y << 2 ) | ( ( x >> 6 ) & 3 ) ) & 63 );\n result += base64_encodetable.charAt( x & 63 );\n\n }\n\n return result;\n}", "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function b64tob64u(string) {\n var result = string;\n result = result.replace(/\\+/g, \"-\");\n result = result.replace(/\\//g, \"_\");\n result = result.replace(/=/g, \"\");\n return result;\n}", "function base64decode(input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n \n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n\n }\n\n output = _utf8_decode(output);\n \n return output;\n\n }", "function base64toURL(b64Data, type) {\n var audioURL = \"data:\" + type + \";base64,\" + b64Data;\n return audioURL;\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function base64_covert_to_img(_base64_string, _path){\nvar filepath = base64Img.imgSync(_base64_string, _path,uuidv1());\nreturn filepath;\n}", "function b64ToUtf8(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function b64(str) {\n return new Buffer(str).toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n} // This is the encyrption algorithm, don't ask me why it is that way", "get base64String() {\n return exports.base64.encode(this.refString);\n }", "function base64Encode_(inputStr)\n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var outputStr = \"\";\n var i = 0;\n while (i < inputStr.length)\n {\n //all three \"& 0xff\" added below are there to fix a known bug\n //with bytes returned by xhr.responseText\n var byte1 = inputStr.charCodeAt(i++) & 0xff;\n var byte2 = inputStr.charCodeAt(i++) & 0xff;\n var byte3 = inputStr.charCodeAt(i++) & 0xff;\n var enc1 = byte1 >> 2;\n var enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n var enc3, enc4;\n if (isNaN(byte2)) { enc3 = enc4 = 64; } else { enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); if (isNaN(byte3)) { enc4 = 64; } else { enc4 = byte3 & 63; } }\n outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);\n }\n return outputStr;\n }", "function base64_encode(data) {\n\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n\n if (!data) {\n return data;\n }\n\n data = unescape(encodeURIComponent(data));\n\n do {\n // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n\n bits = o1 << 16 | o2 << 8 | o3;\n\n h1 = bits >> 18 & 0x3f;\n h2 = bits >> 12 & 0x3f;\n h3 = bits >> 6 & 0x3f;\n h4 = bits & 0x3f;\n\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64.charAt(h1) + b64.charAt(h2) + b64.charAt(h3) + b64.charAt(h4);\n } while (i < data.length);\n\n enc = tmp_arr.join('');\n\n var r = data.length % 3;\n\n return (r ? enc.slice(0, r - 3) : enc) + '==='.slice(r || 3);\n}", "function base64UrlDecode(input) {\n var str = (String (input)).replace (/[=]+$/, ''); // #31: ExtendScript bad parse of /=\n if (str.length % 4 === 1) {\n throw new InvalidCharacterError (\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (\n // initialize result and counters\n var bc = 0, bs, buffer, idx = 0, output = '';\n // get next character\n buffer = str.charAt (idx++); // eslint-disable-line no-cond-assign\n // character found in table? initialize bit storage and add its ascii value;\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n // and if not first of each 4 characters,\n // convert the first 8 bits to one ascii character\n bc++ % 4) ? output += String.fromCharCode (255 & bs >> (-2 * bc & 6)) : 0\n ) {\n // try to find character in table (0-63, not found => -1)\n buffer = chars.indexOf (buffer);\n }\n return output;\n }", "function encode64(input) {\n if(window.btoa){\n return window.btoa(input);\n }\n// base64 strings are 4/3 larger than the original string\n var output = new Array( Math.floor( (input.length + 2) / 3 ) * 4 );\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0, p = 0;\n var _keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n do {\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n \n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n \n if (isNaN(chr2)) {\n \tenc3 = enc4 = 64;\n }\n else if (isNaN(chr3)) {\n \t enc4 = 64;\n }\n\n output[p++] = _keyStr.charAt(enc1);\n output[p++] = _keyStr.charAt(enc2);\n output[p++] = _keyStr.charAt(enc3);\n output[p++] = _keyStr.charAt(enc4);\n } while (i < input.length);\n\n return output.join('');\n}", "function base64urlencode(data) {\n if (typeof btoa === 'function') return btoa(data).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = o1 << 16 | o2 << 8 | o3;\n h1 = bits >> 18 & 63;\n h2 = bits >> 12 & 63;\n h3 = bits >> 6 & 63;\n h4 = bits & 63;\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64a[h1] + b64a[h2] + b64a[h3] + b64a[h4];\n } while (i < data.length);\n enc = tmp_arr.join('');\n var r = data.length % 3;\n return (r ? enc.slice(0, r - 3) : enc);\n}", "function base64Encode(str)\r\n{\r\n\tvar charBase64 = new Array(\r\n\t\t'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P',\r\n\t\t'Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f',\r\n\t\t'g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v',\r\n\t\t'w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/'\r\n\t);\r\n\r\n\tvar out = \"\";\r\n\tvar chr1, chr2, chr3;\r\n\tvar enc1, enc2, enc3, enc4;\r\n\tvar i = 0;\r\n\r\n\tvar len = str.length;\r\n\r\n\tdo\r\n\t{\r\n\t\tchr1 = str.charCodeAt(i++);\r\n\t\tchr2 = str.charCodeAt(i++);\r\n\t\tchr3 = str.charCodeAt(i++);\r\n\r\n\t\t//enc1 = (chr1 & 0xFC) >> 2;\r\n\t\tenc1 = chr1 >> 2;\r\n\t\tenc2 = ((chr1 & 0x03) << 4) | (chr2 >> 4);\r\n\t\tenc3 = ((chr2 & 0x0F) << 2) | (chr3 >> 6);\r\n\t\tenc4 = chr3 & 0x3F;\r\n\r\n\t\tout += charBase64[enc1] + charBase64[enc2];\r\n\r\n\t\tif (isNaN(chr2))\r\n \t\t{\r\n\t\t\tout += '==';\r\n\t\t}\r\n \t\telse if (isNaN(chr3))\r\n \t\t{\r\n\t\t\tout += charBase64[enc3] + '=';\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tout += charBase64[enc3] + charBase64[enc4];\r\n\t\t}\r\n\t}\r\n\twhile (i < len);\r\n\r\n\treturn out;\r\n}", "function base64ToHex(b64str)\t\t\t\t\t\t\t\t\t// Base64 to Hex\r\n\t{\r\n\t\tfor (var i = 0, bin = atob(b64str.replace(/[ \\r\\n]+$/, \"\")), hex = []; i < bin.length; ++i) {\r\n\t\t\tvar tmp = bin.charCodeAt(i).toString(16);\r\n\t\t\tif (tmp.length === 1) tmp = \"0\" + tmp;\r\n\t\t\thex[hex.length] = tmp;\r\n\t\t}\r\n\t\treturn hex.join(\"\");\r\n\t}", "function base64encode(input) {\n var output = \"\";\n var chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n var i = 0;\n\n input = _utf8_encode(input);\n\n while (i < input.length) {\n\n chr1 = input.charCodeAt(i++);\n chr2 = input.charCodeAt(i++);\n chr3 = input.charCodeAt(i++);\n\n enc1 = chr1 >> 2;\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n enc4 = chr3 & 63;\n\n if (isNaN(chr2)) {\n enc3 = enc4 = 64;\n } else if (isNaN(chr3)) {\n enc4 = 64;\n }\n\n output = output +\n _keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\n }\n\n return output;\n }", "function b64toUtf8(str) {\n return decodeURIComponent(escape(window.atob(str)));\n}", "function toBase64(input) {\n var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var output = '';\n var length = input.length;\n var triplet;\n var b64pad = '=';\n\n for (var i = 0; i < length; i += 3) {\n triplet = input.charCodeAt(i) << 16 | (i + 1 < length ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < length ? input.charCodeAt(i + 2) : 0);\n\n for (var j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 > input.length * 8) {\n output += b64pad;\n } else {\n output += tab.charAt(triplet >>> 6 * (3 - j) & 0x3f);\n }\n }\n }\n\n return output;\n}", "function Magic(r){if(!/^[a-z0-9+/]+={0,2}$/i.test(r)||r.length%4!=0)throw Error(\"Not base64 string\");for(var t,e,n,o,i,a,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",h=[],d=0;d<r.length;d+=4)t=(a=f.indexOf(r.charAt(d))<<18|f.indexOf(r.charAt(d+1))<<12|(o=f.indexOf(r.charAt(d+2)))<<6|(i=f.indexOf(r.charAt(d+3))))>>>16&255,e=a>>>8&255,n=255&a,h[d/4]=String.fromCharCode(t,e,n),64==i&&(h[d/4]=String.fromCharCode(t,e)),64==o&&(h[d/4]=String.fromCharCode(t));return r=h.join(\"\")}", "function base64_decode(data) {\n var dst = \"\"\n var i, a, b, c, d, z\n\n for (i = 0; i < data.length - 3; i += 4) {\n a = base64_charIndex(data.charAt(i+0))\n b = base64_charIndex(data.charAt(i+1))\n c = base64_charIndex(data.charAt(i+2))\n d = base64_charIndex(data.charAt(i+3))\n\n dst += String.fromCharCode((a << 2) | (b >>> 4))\n if (data.charAt(i+2) != b64pad)\n dst += String.fromCharCode(((b << 4) & 0xF0) | ((c >>> 2) & 0x0F))\n if (data.charAt(i+3) != b64pad)\n dst += String.fromCharCode(((c << 6) & 0xC0) | d)\n }\n\n dst = decodeURIComponent(escape(dst))\n return dst\n }", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function (match, p1) {\n return String.fromCharCode('0x' + p1);\n }));\n}", "function toBase64(u8arr) {\r\n return btoa(String.fromCharCode.apply(null, u8arr)).\r\n replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=*$/, '');\r\n}", "function toBase64(input) {\n return util_buffer_from_1.fromArrayBuffer(input.buffer, input.byteOffset, input.byteLength).toString(\"base64\");\n}", "function b64EncodeUnicode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, (match, p1) =>\n String.fromCharCode(`0x${p1}`)));\n}", "function atou(b64) {\n return decodeURIComponent(escape(atob(b64)));\n}", "function base64Decode(data) {\n data = data.replace(/[^a-z0-9\\+\\/=]/gi, \"\"); // strip none base64 characters\n if (typeof atob == \"function\") return atob(data); //use internal base64 functions if available (gecko only)\n var b64_map =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var byte1, byte2, byte3;\n var ch1, ch2, ch3, ch4;\n var result = new Array(); //array is used instead of string because in most of browsers working with large arrays is faster than working with large strings\n var j = 0;\n while (data.length % 4 != 0) {\n data += \"=\";\n }\n\n for (var i = 0; i < data.length; i += 4) {\n ch1 = b64_map.indexOf(data.charAt(i));\n ch2 = b64_map.indexOf(data.charAt(i + 1));\n ch3 = b64_map.indexOf(data.charAt(i + 2));\n ch4 = b64_map.indexOf(data.charAt(i + 3));\n\n byte1 = (ch1 << 2) | (ch2 >> 4);\n byte2 = ((ch2 & 15) << 4) | (ch3 >> 2);\n byte3 = ((ch3 & 3) << 6) | ch4;\n\n result[j++] = String.fromCharCode(byte1);\n if (ch3 != 64) result[j++] = String.fromCharCode(byte2);\n if (ch4 != 64) result[j++] = String.fromCharCode(byte3);\n }\n\n return result.join(\"\");\n}", "function decodeBase64(encodedValue) {\n return CryptoJS.enc.Base64.stringify(encodedValue);\n}", "function rstr2b64(input, b64pad) {\n\t var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\t output = '',\n\t len = input.length,\n\t i, j, triplet;\n\t b64pad = b64pad || '=';\n\t for (i = 0; i < len; i += 3) {\n\t triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);\n\t for (j = 0; j < 4; j += 1) {\n\t if (i * 8 + j * 6 > input.length * 8) {\n\t output += b64pad;\n\t } else {\n\t output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);\n\t }\n\t }\n\t }\n\t return output;\n\t }", "function b64enc(str) \n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",\n out = \"\", i = 0;\n \n while (i < str.length) {\n var byte1, byte2, byte3,\n enc1, enc2, enc3, enc4;\n\n byte1 = str.charCodeAt(i++) & 0xff;\n byte2 = str.charCodeAt(i++) & 0xff;\n byte3 = str.charCodeAt(i++) & 0xff;\n \n enc1 = byte1 >> 2;\n enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n \n if (isNaN(byte2)) {\n enc3 = enc4 = 64;\n } else {\n enc3 = ((byte2 & 15) << 2) | (byte3 >> 6);\n if (isNaN(byte3)) {\n enc4 = 64;\n } else {\n enc4 = byte3 & 63;\n }\n }\n \n out += b64.charAt(enc1) \n + b64.charAt(enc2) \n + b64.charAt(enc3) \n + b64.charAt(enc4);\n } \n \n return out;\n }", "function convertToBase64(input) {\n var result = \"\";\n var charCodes = getExpandedCharCodes(input);\n var i = 0;\n var length = charCodes.length;\n var byte1, byte2, byte3, byte4;\n while (i < length) {\n // Convert every 6-bits in the input 3 character points\n // into a base64 digit\n byte1 = charCodes[i] >> 2;\n byte2 = (charCodes[i] & 3) << 4 | charCodes[i + 1] >> 4;\n byte3 = (charCodes[i + 1] & 15) << 2 | charCodes[i + 2] >> 6;\n byte4 = charCodes[i + 2] & 63;\n // We are out of characters in the input, set the extra\n // digits to 64 (padding character).\n if (i + 1 >= length) {\n byte3 = byte4 = 64;\n }\n else if (i + 2 >= length) {\n byte4 = 64;\n }\n // Write to the output\n result += base64Digits.charAt(byte1) + base64Digits.charAt(byte2) + base64Digits.charAt(byte3) + base64Digits.charAt(byte4);\n i += 3;\n }\n return result;\n }", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function b64EncodeUnicode(str) {\n\treturn btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g,\n\t\tfunction toSolidBytes(match, p1) {\n\t\t\treturn String.fromCharCode('0x' + p1);\n\t\t}));\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n if (typeof base64 !== 'undefined') return base64.decode(str); //react native\n throw new Error('No Base64 Decode');\n }", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function convertBase64ToBytes ( base64 ) {\n\n base64 = base64.replace(/[^A-Za-z0-9\\+\\/\\=]+/g, '');\n\n var bytes = [],\n base64Length = base64.length,\n a, b, c, d;\n\n if (\n ( base64Length % 4 ) != 0\n ) {\n return(bytes);\n };\n\n for (\n var i = 0;\n i < base64Length;\n i += 4\n ) {\n\n a = base64Lookup[base64.charCodeAt(i)];\n b = base64Lookup[base64.charCodeAt(( i + 1 ))];\n c = base64Lookup[base64.charCodeAt(( i + 2 ))];\n d = base64Lookup[base64.charCodeAt(( i + 3 ))];\n\n bytes.push(( ( a << 2 ) | ( b >> 4 ) ));\n\n if (\n c != 64\n ) {\n bytes.push(( ( ( b & 15 ) << 4 ) | ( c >> 2 ) ));\n };\n\n if (\n d != 64\n ) {\n bytes.push(( ( ( c & 3 ) << 6 ) | ( d & 63 ) ));\n };\n\n };\n\n return(bytes);\n\n}", "function encodeBase64String(data, w, h) {\n var str = \"\";\n for (var i = 0; i < data.length; i++) {\n str = str.concat(btoa(data[i]));\n }\n return str;\n}", "function base64encode(value) {\n\treturn new Buffer(value).toString('base64');\n}", "function decode64(input) {\n\tvar output = \"\";\n\tvar chr1, chr2, chr3 = \"\";\n\tvar enc1, enc2, enc3, enc4 = \"\";\n\tvar i = 0;\n\n\t// remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n\tvar base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n\tif (base64test.exec(input)) {\n\t\talert(\"There were invalid base64 characters in the input text.\\n\"\n\t\t\t\t+ \"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\n\"\n\t\t\t\t+ \"Expect errors in decoding.\");\n\t}\n\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n\tdo {\n\t\tenc1 = keyStr.indexOf(input.charAt(i++));\n\t\tenc2 = keyStr.indexOf(input.charAt(i++));\n\t\tenc3 = keyStr.indexOf(input.charAt(i++));\n\t\tenc4 = keyStr.indexOf(input.charAt(i++));\n\n\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\n\t\toutput = output + String.fromCharCode(chr1);\n\n\t\tif (enc3 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t}\n\t\tif (enc4 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t}\n\n\t\tchr1 = chr2 = chr3 = \"\";\n\t\tenc1 = enc2 = enc3 = enc4 = \"\";\n\n\t} while (i < input.length);\n\n\treturn unescape(output);\n}", "function getBase64(entry) {\n return btoa(entry);\n}" ]
[ "0.8253048", "0.810408", "0.8092335", "0.8054918", "0.8038858", "0.8022879", "0.7992094", "0.7969552", "0.7969552", "0.7945164", "0.7945164", "0.79449964", "0.79290575", "0.79279673", "0.7888982", "0.78838384", "0.7867639", "0.7675953", "0.7584292", "0.7412218", "0.7359118", "0.7268635", "0.7258627", "0.7214309", "0.71885824", "0.71360993", "0.7099121", "0.7085739", "0.7078497", "0.7026223", "0.7014922", "0.696499", "0.69469476", "0.6930335", "0.691767", "0.6917428", "0.6860686", "0.68458515", "0.68408763", "0.6775133", "0.67620033", "0.67562634", "0.6753957", "0.6753957", "0.6753957", "0.6753957", "0.67527187", "0.67465466", "0.6737315", "0.66907644", "0.6682597", "0.6666309", "0.65772575", "0.6575697", "0.6573224", "0.65442586", "0.65236205", "0.6522871", "0.6517404", "0.6488583", "0.6488583", "0.64846456", "0.64813054", "0.6473587", "0.6457229", "0.6451817", "0.64445215", "0.6429447", "0.6424983", "0.64236665", "0.6419213", "0.64168316", "0.6409552", "0.639637", "0.63932157", "0.6373759", "0.63595015", "0.6355482", "0.6355482", "0.635298", "0.63515794", "0.6351204", "0.6346908", "0.63466823", "0.63182634", "0.6298512", "0.62968147", "0.62862456", "0.6282851", "0.6282851", "0.6282851", "0.6281281", "0.62811226", "0.6279263", "0.6271454", "0.6265269", "0.6256711", "0.62537616", "0.62417746", "0.6228595" ]
0.8505418
0
Convert a base64 encoded string to a base64url encoded string Example ``` > base64url.fromBase64('qL8R4QIcQ/ZsRqOAbeRfcZhilN/MksRtDaErMA==') 'qL8R4QIcQ_ZsRqOAbeRfcZhilN_MksRtDaErMA' ```
function fromBase64(base64) { return base64 .replace(/=/g, "") .replace(/\+/g, "-") .replace(/\//g, "_"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function toBase64(base64url) {\n // We this to be a string so we can do .replace on it. If it's\n // already a string, this is a noop.\n base64url = base64url.toString();\n return padString(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function base64ToBase64Url(b64) {\n return b64.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=+$/, '');\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function toBase64Url(base64Text) {\n return base64Text.replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function decodeURLEncodedBase64(value) {\n return decode(value\n .replace(/_/g, '/')\n .replace(/-/g, '+'));\n}", "function encodeURLEncodedBase64(value) {\n return encode(value)\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function base64FromURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '-':\n \t\t\t\treturnString += '+';\n \t\t\t\tbreak;\n \t\t\tcase '_':\n \t\t\t\treturnString += '/';\n \t\t\t\tbreak;\n \t\t\tcase '*':\n \t\t\t\treturnString += '=';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n }", "str2Base64(_str) {\n const _this = this;\n return _this._binb2b64(_this._str2binb(_str));\n }", "function base64ToURLSafe(text)\n {\n \tvar returnString = \"\";\n\n \tfor (var i = 0; i < text.length; i++)\n \t{\n \t\tvar ch = text.charAt(i);\n \t\tswitch (ch)\n \t\t{\n \t\t\tcase '+':\n \t\t\t\treturnString += '-';\n \t\t\t\tbreak;\n \t\t\tcase '/':\n \t\t\t\treturnString += '_';\n \t\t\t\tbreak;\n \t\t\tcase '=':\n \t\t\t\treturnString += '*';\n \t\t\t\tbreak;\n\n \t\t\tdefault:\n \t\t\t\treturnString += ch;\n \t\t\t\tbreak;\n \n \t\t}\n\n \t}\n\n \treturn returnString;\n\n\n }", "function stringToBase64 (s) {\r\n\treturn hexToBase64(stringToHex(s));\r\n}", "function base64UrlEncode(input) {\n var str = String (input);\n for (\n // initialize result and counter\n var block, charCode, idx = 0, map = chars, output = '';\n // if the next str index does not exist:\n // change the mapping table to \"=\"\n // check if d has no fractional digits\n // str.charAt (idx | 0) || (map = '=', idx % 1);\n str.charAt (idx | 0);\n // \"8 - idx % 1 * 8\" generates the sequence 2, 4, 6, 8\n output += map.charAt (63 & block >> 8 - idx % 1 * 8)\n ) {\n charCode = str.charCodeAt (idx += 3 / 4);\n if (charCode > 0xFF) {\n throw new InvalidCharacterError (\"'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.\");\n }\n block = block << 8 | charCode;\n }\n return output;\n }", "function decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return new Buffer(toBase64(base64url), \"base64\").toString(encoding);\n}", "function base64(s)\n\t{\n\t\tvar ch =\n\t\t\t\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\t\tvar c1\n\t\t , c2\n\t\t , c3\n\t\t , e1\n\t\t , e2\n\t\t , e3\n\t\t , e4;\n\t\tvar l = s.length;\n\t\tvar i = 0;\n\t\tvar r = \"\";\n\n\t\tdo\n\t\t\t{\n\t\t\t\tc1 = s.charCodeAt(i);\n\t\t\t\te1 = c1 >> 2;\n\t\t\t\tc2 = s.charCodeAt(i + 1);\n\t\t\t\te2 = ((c1 & 3) << 4) | (c2 >> 4);\n\t\t\t\tc3 = s.charCodeAt(i + 2);\n\t\t\t\tif (l < i + 2) e3 = 64;\n\t\t\t\telse e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n\t\t\t\tif (l < i + 3) e4 = 64;\n\t\t\t\telse e4 = c3 & 0x3f;\n\t\t\t\tr += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n\t\t\t}\n\t\twhile ((i += 3) < l);\n\n\t\treturn r;\n\t}", "function base64_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64c)\n }", "function base64ToString (s) {\r\n //the base 64 characters\r\n var BASE64 = new Array ('A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z','0','1','2','3','4','5','6','7','8','9','+','/');\r\n\t\r\n var decode = new Object();\r\n for (var i=0; i<BASE64.length; i++) {decode[BASE64[i]] = i;} //inverse of the array\r\n decode['='] = 0; //add the equals sign as well\r\n var r = \"\", c1, c2, c3, c4, len=s.length; //define variables\r\n s += \"====\"; //just to make sure it is padded correctly\r\n for (var i=0; i<len; i+=4) { //4 input characters at a time\r\n c1 = s.charAt(i); //the 1st base64 input characther\r\n c2 = s.charAt(i+1);\r\n c3 = s.charAt(i+2);\r\n c4 = s.charAt(i+3);\r\n r += String.fromCharCode (((decode[c1] << 2) & 0xff) | (decode[c2] >> 4)); //reform the string\r\n if (c3 != '=') r += String.fromCharCode (((decode[c2] << 4) & 0xff) | (decode[c3] >> 2));\r\n if (c4 != '=') r += String.fromCharCode (((decode[c3] << 6) & 0xff) | decode[c4]);\r\n }\r\n return r;\r\n}", "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function decodeBase64(input = \"\") {\n if (!input) return;\n\n return base64.toByteArray(\n input.padEnd(input.length + 4 - (input.length % 4), \"=\")\n );\n}", "static transformBase64ToString(isAndroid, base64String) {\n if (isAndroid) {\n // eslint-disable-next-line no-undef\n var data = android.util.Base64.decode(base64String,android.util.Base64.DEFAULT);\n // eslint-disable-next-line no-undef\n var decodedString = new java.lang.String(data,java.nio.charset.StandardCharsets.UTF_8);\n return decodedString;\n } else {\n // eslint-disable-next-line no-undef\n const decodedData = NSData.alloc().initWithBase64EncodedStringOptions(base64String,0);\n // eslint-disable-next-line no-undef\n return NSString.alloc().initWithDataEncoding(decodedData,NSUTF8StringEncoding);\n }\n }", "function base64toURL(b64Data, type) {\n var audioURL = \"data:\" + type + \";base64,\" + b64Data;\n return audioURL;\n}", "function b64tob64u(string) {\n var result = string;\n result = result.replace(/\\+/g, \"-\");\n result = result.replace(/\\//g, \"_\");\n result = result.replace(/=/g, \"\");\n return result;\n}", "function base64urldecode(data) {\n data += '=='.substr((2 - data.length * 3) & 3)\n if (typeof atob === 'function') {\n data = data.replace(/\\-/g, '+').replace(/_/g, '/').replace(/,/g, '');\n try {\n return atob(data);\n } catch (e) {\n return '';\n }\n }\n // http://kevin.vanzonneveld.net\n // + original by: Tyler Akins (http://rumkin.com)\n // + improved by: Thunder.m\n // + input by: Aman Gupta\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + bugfixed by: Onno Marsman\n // + bugfixed by: Pellentesque Malesuada\n // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // + input by: Brett Zamir (http://brett-zamir.me)\n // + bugfixed by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)\n // * example 1: base64_decode('S2V2aW4gdmFuIFpvbm5ldmVsZA==');\n // * returns 1: 'Kevin van Zonneveld'\n // mozilla has this native\n // - but breaks in 2.0.0.12!\n //if (typeof this.window['atob'] == 'function') {\n // return atob(data);\n //}\n\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n dec = '',\n tmp_arr = [];\n if (!data) {\n return data;\n }\n data += '';\n do { // unpack four hexets into three octets using index points in b64\n h1 = b64.indexOf(data.charAt(i++));\n h2 = b64.indexOf(data.charAt(i++));\n h3 = b64.indexOf(data.charAt(i++));\n h4 = b64.indexOf(data.charAt(i++));\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\n o1 = bits >> 16 & 255;\n o2 = bits >> 8 & 255;\n o3 = bits & 255;\n if (h3 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1);\n } else if (h4 == 64) {\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\n } else {\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\n }\n } while (i < data.length);\n dec = tmp_arr.join('');\n return dec;\n}", "function base64_covert_to_img(_base64_string, _path){\nvar filepath = base64Img.imgSync(_base64_string, _path,uuidv1());\nreturn filepath;\n}", "function toBase64(a){return CryptoJS&&CryptoJS.enc.Base64?CryptoJS.enc.Base64.stringify(CryptoJS.enc.Latin1.parse(a)):Base64.encode(a)}", "getBase64() {\n var s = this.getDump();\n\n var ch =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var c1, c2, c3, e1, e2, e3, e4;\n var l = s.length;\n var i = 0;\n var r = \"\";\n\n do {\n c1 = s.charCodeAt(i);\n e1 = c1 >> 2;\n c2 = s.charCodeAt(i + 1);\n e2 = ((c1 & 3) << 4) | (c2 >> 4);\n c3 = s.charCodeAt(i + 2);\n if (l < i + 2) {\n e3 = 64;\n } else {\n e3 = ((c2 & 0xf) << 2) | (c3 >> 6);\n }\n if (l < i + 3) {\n e4 = 64;\n } else {\n e4 = c3 & 0x3f;\n }\n r += ch.charAt(e1) + ch.charAt(e2) + ch.charAt(e3) + ch.charAt(e4);\n } while ((i += 3) < l);\n return r;\n }", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function fromBase64(text){\n if(CryptoJS && CryptoJS.enc.Base64) \n return CryptoJS.enc.Base64.parse(text).toString(CryptoJS.enc.Latin1);\n else\n return Base64.decode(text);\n }", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "base64Encode(input) {\n return EncodingUtils.base64Encode(input);\n }", "function ab_to_base64(ab) {\n return base64urlencode(ab_to_str(ab));\n}", "function b64UTFEncode(str) {\n return btoa(encodeURIComponent(str).replace(/%([0-9A-F]{2})/g, function(match, v) {\n return String.fromCharCode(parseInt(v, 16));\n }));\n}", "function base64UrlDecode(input) {\n var str = (String (input)).replace (/[=]+$/, ''); // #31: ExtendScript bad parse of /=\n if (str.length % 4 === 1) {\n throw new InvalidCharacterError (\"'atob' failed: The string to be decoded is not correctly encoded.\");\n }\n for (\n // initialize result and counters\n var bc = 0, bs, buffer, idx = 0, output = '';\n // get next character\n buffer = str.charAt (idx++); // eslint-disable-line no-cond-assign\n // character found in table? initialize bit storage and add its ascii value;\n ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer,\n // and if not first of each 4 characters,\n // convert the first 8 bits to one ascii character\n bc++ % 4) ? output += String.fromCharCode (255 & bs >> (-2 * bc & 6)) : 0\n ) {\n // try to find character in table (0-63, not found => -1)\n buffer = chars.indexOf (buffer);\n }\n return output;\n }", "get base64UriString() {\n return exports.base64.encodeUri(this.refString);\n }", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n if (typeof base64 !== 'undefined') return base64.encode(str); //react native\n throw new Error('No Base64 Encode');\n }", "function base64_to_ab(a) {\n return str_to_ab(base64urldecode(a));\n}", "function b64(str) {\n return new Buffer(str).toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n} // This is the encyrption algorithm, don't ask me why it is that way", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function base64decode(input) {\n var output = \"\";\n var chr1, chr2, chr3;\n var enc1, enc2, enc3, enc4;\n var i = 0;\n \n input = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n while (i < input.length) {\n\n enc1 = _keyStr.indexOf(input.charAt(i++));\n enc2 = _keyStr.indexOf(input.charAt(i++));\n enc3 = _keyStr.indexOf(input.charAt(i++));\n enc4 = _keyStr.indexOf(input.charAt(i++));\n\n chr1 = (enc1 << 2) | (enc2 >> 4);\n chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n chr3 = ((enc3 & 3) << 6) | enc4;\n\n output = output + String.fromCharCode(chr1);\n\n if (enc3 != 64) {\n output = output + String.fromCharCode(chr2);\n }\n if (enc4 != 64) {\n output = output + String.fromCharCode(chr3);\n }\n\n }\n\n output = _utf8_decode(output);\n \n return output;\n\n }", "function toUrlString(buffer) {\n return buffer.toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n if (typeof base64 !== 'undefined') return base64.decode(str); //react native\n throw new Error('No Base64 Decode');\n }", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n throw new Error('No Base64 Encode');\n }", "function base64_decode(data) {\n var dst = \"\"\n var i, a, b, c, d, z\n\n for (i = 0; i < data.length - 3; i += 4) {\n a = base64_charIndex(data.charAt(i+0))\n b = base64_charIndex(data.charAt(i+1))\n c = base64_charIndex(data.charAt(i+2))\n d = base64_charIndex(data.charAt(i+3))\n\n dst += String.fromCharCode((a << 2) | (b >>> 4))\n if (data.charAt(i+2) != b64pad)\n dst += String.fromCharCode(((b << 4) & 0xF0) | ((c >>> 2) & 0x0F))\n if (data.charAt(i+3) != b64pad)\n dst += String.fromCharCode(((c << 6) & 0xC0) | d)\n }\n\n dst = decodeURIComponent(escape(dst))\n return dst\n }", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function toBase64(str) {\n if (false) {} else {\n return window.btoa(str);\n }\n}", "function base64urlencode(data) {\n if (typeof btoa === 'function') return btoa(data).replace(/\\+/g, '-').replace(/\\//g, '_').replace(/=/g, '');\n var o1,\n o2,\n o3,\n h1,\n h2,\n h3,\n h4,\n bits,\n i = 0,\n ac = 0,\n enc = '',\n tmp_arr = [];\n do { // pack three octets into four hexets\n o1 = data.charCodeAt(i++);\n o2 = data.charCodeAt(i++);\n o3 = data.charCodeAt(i++);\n bits = o1 << 16 | o2 << 8 | o3;\n h1 = bits >> 18 & 63;\n h2 = bits >> 12 & 63;\n h3 = bits >> 6 & 63;\n h4 = bits & 63;\n // use hexets to index into b64, and append result to encoded string\n tmp_arr[ac++] = b64a[h1] + b64a[h2] + b64a[h3] + b64a[h4];\n } while (i < data.length);\n enc = tmp_arr.join('');\n var r = data.length % 3;\n return (r ? enc.slice(0, r - 3) : enc);\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "function Magic(r){if(!/^[a-z0-9+/]+={0,2}$/i.test(r)||r.length%4!=0)throw Error(\"Not base64 string\");for(var t,e,n,o,i,a,f=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\",h=[],d=0;d<r.length;d+=4)t=(a=f.indexOf(r.charAt(d))<<18|f.indexOf(r.charAt(d+1))<<12|(o=f.indexOf(r.charAt(d+2)))<<6|(i=f.indexOf(r.charAt(d+3))))>>>16&255,e=a>>>8&255,n=255&a,h[d/4]=String.fromCharCode(t,e,n),64==i&&(h[d/4]=String.fromCharCode(t,e)),64==o&&(h[d/4]=String.fromCharCode(t));return r=h.join(\"\")}", "function Base64() {\n\n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n\t// public method for encoding\n\tthis.encode = function(input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output + _keyStr.charAt(enc1) + _keyStr.charAt(enc2)\n\t\t\t\t\t+ _keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n\n\t// public method for decoding\n\tthis.decode = function(input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n\n\t// private method for UTF-8 encoding\n\t_utf8_encode = function(string) {\n\t\tstring = string.replace(/\\r\\n/g, \"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor ( var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if ((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\n\t\t}\n\t\treturn utftext;\n\t}\n\n\t// private method for UTF-8 decoding\n\t_utf8_decode = function(utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile (i < utftext.length) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if ((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\tc3 = utftext.charCodeAt(i + 2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12)\n\t\t\t\t\t\t| ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "base64Decode(input) {\n return EncodingUtils.base64Decode(input);\n }", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "base64StringtoFile (base64String, filename) {\n var arr = base64String.split(','), mime = arr[0].match(/:(.*?);/)[1],\n bstr = atob(arr[1]), n = bstr.length, u8arr = new Uint8Array(n)\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n)\n }\n return new File([u8arr], filename, {type: mime})\n }", "function base64Decode(data) {\n data = data.replace(/[^a-z0-9\\+\\/=]/gi, \"\"); // strip none base64 characters\n if (typeof atob == \"function\") return atob(data); //use internal base64 functions if available (gecko only)\n var b64_map =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var byte1, byte2, byte3;\n var ch1, ch2, ch3, ch4;\n var result = new Array(); //array is used instead of string because in most of browsers working with large arrays is faster than working with large strings\n var j = 0;\n while (data.length % 4 != 0) {\n data += \"=\";\n }\n\n for (var i = 0; i < data.length; i += 4) {\n ch1 = b64_map.indexOf(data.charAt(i));\n ch2 = b64_map.indexOf(data.charAt(i + 1));\n ch3 = b64_map.indexOf(data.charAt(i + 2));\n ch4 = b64_map.indexOf(data.charAt(i + 3));\n\n byte1 = (ch1 << 2) | (ch2 >> 4);\n byte2 = ((ch2 & 15) << 4) | (ch3 >> 2);\n byte3 = ((ch3 & 3) << 6) | ch4;\n\n result[j++] = String.fromCharCode(byte1);\n if (ch3 != 64) result[j++] = String.fromCharCode(byte2);\n if (ch4 != 64) result[j++] = String.fromCharCode(byte3);\n }\n\n return result.join(\"\");\n}", "function Base64() {\n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g, \"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if ((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n\t\t}\n\t\treturn utftext;\n\t}\n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile (i < utftext.length) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if ((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i + 1);\n\t\t\t\tc3 = utftext.charCodeAt(i + 2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "function base64url_sniff(base64) {\n if (base64.indexOf(\"-\") >= 0) return true\n if (base64.indexOf(\"_\") >= 0) return true\n return false\n }", "function base64_decode (base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function rstr2b64(input, b64pad) {\n\t var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n\t output = '',\n\t len = input.length,\n\t i, j, triplet;\n\t b64pad = b64pad || '=';\n\t for (i = 0; i < len; i += 3) {\n\t triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);\n\t for (j = 0; j < 4; j += 1) {\n\t if (i * 8 + j * 6 > input.length * 8) {\n\t output += b64pad;\n\t } else {\n\t output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);\n\t }\n\t }\n\t }\n\t return output;\n\t }", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64ToHex(b64str)\t\t\t\t\t\t\t\t\t// Base64 to Hex\r\n\t{\r\n\t\tfor (var i = 0, bin = atob(b64str.replace(/[ \\r\\n]+$/, \"\")), hex = []; i < bin.length; ++i) {\r\n\t\t\tvar tmp = bin.charCodeAt(i).toString(16);\r\n\t\t\tif (tmp.length === 1) tmp = \"0\" + tmp;\r\n\t\t\thex[hex.length] = tmp;\r\n\t\t}\r\n\t\treturn hex.join(\"\");\r\n\t}", "function Base64() {\n \n\t// private property\n\t_keyStr = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n \n\t// public method for encoding\n\tthis.encode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3, enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = _utf8_encode(input);\n\t\twhile (i < input.length) {\n\t\t\tchr1 = input.charCodeAt(i++);\n\t\t\tchr2 = input.charCodeAt(i++);\n\t\t\tchr3 = input.charCodeAt(i++);\n\t\t\tenc1 = chr1 >> 2;\n\t\t\tenc2 = ((chr1 & 3) << 4) | (chr2 >> 4);\n\t\t\tenc3 = ((chr2 & 15) << 2) | (chr3 >> 6);\n\t\t\tenc4 = chr3 & 63;\n\t\t\tif (isNaN(chr2)) {\n\t\t\t\tenc3 = enc4 = 64;\n\t\t\t} else if (isNaN(chr3)) {\n\t\t\t\tenc4 = 64;\n\t\t\t}\n\t\t\toutput = output +\n\t\t\t_keyStr.charAt(enc1) + _keyStr.charAt(enc2) +\n\t\t\t_keyStr.charAt(enc3) + _keyStr.charAt(enc4);\n\t\t}\n\t\treturn output;\n\t}\n \n\t// public method for decoding\n\tthis.decode = function (input) {\n\t\tvar output = \"\";\n\t\tvar chr1, chr2, chr3;\n\t\tvar enc1, enc2, enc3, enc4;\n\t\tvar i = 0;\n\t\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\t\twhile (i < input.length) {\n\t\t\tenc1 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc2 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc3 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tenc4 = _keyStr.indexOf(input.charAt(i++));\n\t\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\t\t\toutput = output + String.fromCharCode(chr1);\n\t\t\tif (enc3 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t\t}\n\t\t\tif (enc4 != 64) {\n\t\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t\t}\n\t\t}\n\t\toutput = _utf8_decode(output);\n\t\treturn output;\n\t}\n \n\t// private method for UTF-8 encoding\n\t_utf8_encode = function (string) {\n\t\tstring = string.replace(/\\r\\n/g,\"\\n\");\n\t\tvar utftext = \"\";\n\t\tfor (var n = 0; n < string.length; n++) {\n\t\t\tvar c = string.charCodeAt(n);\n\t\t\tif (c < 128) {\n\t\t\t\tutftext += String.fromCharCode(c);\n\t\t\t} else if((c > 127) && (c < 2048)) {\n\t\t\t\tutftext += String.fromCharCode((c >> 6) | 192);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t} else {\n\t\t\t\tutftext += String.fromCharCode((c >> 12) | 224);\n\t\t\t\tutftext += String.fromCharCode(((c >> 6) & 63) | 128);\n\t\t\t\tutftext += String.fromCharCode((c & 63) | 128);\n\t\t\t}\n \n\t\t}\n\t\treturn utftext;\n\t}\n \n\t// private method for UTF-8 decoding\n\t_utf8_decode = function (utftext) {\n\t\tvar string = \"\";\n\t\tvar i = 0;\n\t\tvar c = c1 = c2 = 0;\n\t\twhile ( i < utftext.length ) {\n\t\t\tc = utftext.charCodeAt(i);\n\t\t\tif (c < 128) {\n\t\t\t\tstring += String.fromCharCode(c);\n\t\t\t\ti++;\n\t\t\t} else if((c > 191) && (c < 224)) {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tstring += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t\ti += 2;\n\t\t\t} else {\n\t\t\t\tc2 = utftext.charCodeAt(i+1);\n\t\t\t\tc3 = utftext.charCodeAt(i+2);\n\t\t\t\tstring += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t\ti += 3;\n\t\t\t}\n\t\t}\n\t\treturn string;\n\t}\n}", "function base64Encode_(inputStr)\n {\n var b64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n var outputStr = \"\";\n var i = 0;\n while (i < inputStr.length)\n {\n //all three \"& 0xff\" added below are there to fix a known bug\n //with bytes returned by xhr.responseText\n var byte1 = inputStr.charCodeAt(i++) & 0xff;\n var byte2 = inputStr.charCodeAt(i++) & 0xff;\n var byte3 = inputStr.charCodeAt(i++) & 0xff;\n var enc1 = byte1 >> 2;\n var enc2 = ((byte1 & 3) << 4) | (byte2 >> 4);\n var enc3, enc4;\n if (isNaN(byte2)) { enc3 = enc4 = 64; } else { enc3 = ((byte2 & 15) << 2) | (byte3 >> 6); if (isNaN(byte3)) { enc4 = 64; } else { enc4 = byte3 & 63; } }\n outputStr += b64.charAt(enc1) + b64.charAt(enc2) + b64.charAt(enc3) + b64.charAt(enc4);\n }\n return outputStr;\n }", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function toBase64(input) {\n var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';\n var output = '';\n var length = input.length;\n var triplet;\n var b64pad = '=';\n\n for (var i = 0; i < length; i += 3) {\n triplet = input.charCodeAt(i) << 16 | (i + 1 < length ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < length ? input.charCodeAt(i + 2) : 0);\n\n for (var j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 > input.length * 8) {\n output += b64pad;\n } else {\n output += tab.charAt(triplet >>> 6 * (3 - j) & 0x3f);\n }\n }\n }\n\n return output;\n}", "function decodeWebBase64ToHex(str) {\n const bytes = atob(str.replace(/-/g, '+').replace(/_/g, '/'));\n let hex = '';\n for (let i = 0; i < bytes.length; ++i) {\n hex += padLeft(bytes.charCodeAt(i).toString(16), 2, '0');\n }\n return hex;\n }", "function decode64(input) {\n\tvar output = \"\";\n\tvar chr1, chr2, chr3 = \"\";\n\tvar enc1, enc2, enc3, enc4 = \"\";\n\tvar i = 0;\n\n\t// remove all characters that are not A-Z, a-z, 0-9, +, /, or =\n\tvar base64test = /[^A-Za-z0-9\\+\\/\\=]/g;\n\tif (base64test.exec(input)) {\n\t\talert(\"There were invalid base64 characters in the input text.\\n\"\n\t\t\t\t+ \"Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\\n\"\n\t\t\t\t+ \"Expect errors in decoding.\");\n\t}\n\tinput = input.replace(/[^A-Za-z0-9\\+\\/\\=]/g, \"\");\n\n\tdo {\n\t\tenc1 = keyStr.indexOf(input.charAt(i++));\n\t\tenc2 = keyStr.indexOf(input.charAt(i++));\n\t\tenc3 = keyStr.indexOf(input.charAt(i++));\n\t\tenc4 = keyStr.indexOf(input.charAt(i++));\n\n\t\tchr1 = (enc1 << 2) | (enc2 >> 4);\n\t\tchr2 = ((enc2 & 15) << 4) | (enc3 >> 2);\n\t\tchr3 = ((enc3 & 3) << 6) | enc4;\n\n\t\toutput = output + String.fromCharCode(chr1);\n\n\t\tif (enc3 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr2);\n\t\t}\n\t\tif (enc4 != 64) {\n\t\t\toutput = output + String.fromCharCode(chr3);\n\t\t}\n\n\t\tchr1 = chr2 = chr3 = \"\";\n\t\tenc1 = enc2 = enc3 = enc4 = \"\";\n\n\t} while (i < input.length);\n\n\treturn unescape(output);\n}", "function b64ToUtf8(str) {\n return decodeURIComponent(escape(atob(str)));\n}", "function encode_base64( what )\n{\n var base64_encodetable = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n var result = \"\";\n var len = what.length;\n var x, y;\n var ptr = 0;\n\n while( len-- > 0 )\n {\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( x >> 2 ) & 63 );\n\n if( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( x << 4 ) & 63 );\n result += \"==\";\n break;\n }\n\n y = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( x << 4 ) | ( ( y >> 4 ) & 15 ) ) & 63 );\n\n if ( len-- <= 0 )\n {\n result += base64_encodetable.charAt( ( y << 2 ) & 63 );\n result += \"=\";\n break;\n }\n\n x = what.charCodeAt( ptr++ );\n result += base64_encodetable.charAt( ( ( y << 2 ) | ( ( x >> 6 ) & 3 ) ) & 63 );\n result += base64_encodetable.charAt( x & 63 );\n\n }\n\n return result;\n}", "function rstr2b64(input, b64pad) {\n var tab = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/',\n output = '',\n len = input.length,\n i, j, triplet;\n b64pad = b64pad || '=';\n for (i = 0; i < len; i += 3) {\n triplet = (input.charCodeAt(i) << 16) | (i + 1 < len ? input.charCodeAt(i + 1) << 8 : 0) | (i + 2 < len ? input.charCodeAt(i + 2) : 0);\n for (j = 0; j < 4; j += 1) {\n if (i * 8 + j * 6 > input.length * 8) {\n output += b64pad;\n } else {\n output += tab.charAt((triplet >>> 6 * (3 - j)) & 0x3F);\n }\n }\n }\n return output;\n}", "function decodeBase64(encodedValue) {\n return CryptoJS.enc.Base64.stringify(encodedValue);\n}", "function base64_decode(data) {\r\n var b64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\r\n var o1, o2, o3, h1, h2, h3, h4, bits, i = 0,\r\n ac = 0,\r\n dec = '',\r\n tmp_arr = [];\r\n\r\n if (!data) {\r\n return data;\r\n }\r\n\r\n data += '';\r\n\r\n do { // unpack four hexets into three octets using index points in b64\r\n h1 = b64.indexOf(data.charAt(i++));\r\n h2 = b64.indexOf(data.charAt(i++));\r\n h3 = b64.indexOf(data.charAt(i++));\r\n h4 = b64.indexOf(data.charAt(i++));\r\n\r\n bits = h1 << 18 | h2 << 12 | h3 << 6 | h4;\r\n\r\n o1 = bits >> 16 & 0xff;\r\n o2 = bits >> 8 & 0xff;\r\n o3 = bits & 0xff;\r\n\r\n if (h3 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1);\r\n } else if (h4 == 64) {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2);\r\n } else {\r\n tmp_arr[ac++] = String.fromCharCode(o1, o2, o3);\r\n }\r\n } while (i < data.length);\r\n\r\n dec = tmp_arr.join('');\r\n\r\n return dec.replace(/\\0+$/, '');\r\n}" ]
[ "0.832539", "0.82697713", "0.81613487", "0.8037191", "0.8037191", "0.8003788", "0.8003788", "0.7954142", "0.7917833", "0.79035836", "0.7884078", "0.7876257", "0.78435487", "0.78215635", "0.7786523", "0.777235", "0.77202135", "0.7631464", "0.75602", "0.7309471", "0.71726924", "0.7150729", "0.6991469", "0.69716483", "0.691906", "0.6869615", "0.6866403", "0.6781119", "0.67534316", "0.6749451", "0.6749416", "0.6723811", "0.6695279", "0.66274506", "0.658111", "0.65317744", "0.6470918", "0.6448565", "0.63952404", "0.63940907", "0.63890845", "0.63746893", "0.6371874", "0.6309351", "0.6309351", "0.6302915", "0.629879", "0.629879", "0.629879", "0.6285346", "0.62838066", "0.62780744", "0.62754697", "0.62327695", "0.6226138", "0.6221407", "0.6218846", "0.61777365", "0.61769766", "0.6166916", "0.6156524", "0.61541283", "0.6153609", "0.61413574", "0.61351895", "0.61323535", "0.61323535", "0.61323535", "0.61323535", "0.6117017", "0.61121655", "0.6110325", "0.61056465", "0.60909456", "0.6089146", "0.60886735", "0.60873765", "0.6086201", "0.6073045", "0.60283554", "0.6028265", "0.60254514", "0.6022411", "0.6019337", "0.5993881", "0.5989549", "0.5989549", "0.5989549", "0.5989549", "0.5989549", "0.5989549", "0.5989549", "0.59799874", "0.5960504", "0.5958958", "0.59506375", "0.5947296", "0.59400964", "0.593265", "0.5905536" ]
0.74942607
19
Convert a base64url encoded string to a Buffer ``` > base64url.toBuffer('c3Bpcml0dWFsaXplZA') ```
function toBuffer(base64url) { return new Buffer(toBase64(base64url), "base64"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function base64ToBuffer(s) {\n var l = s.length * 6 / 8\n if(s[s.length - 2] == '=')\n l = l - 2\n else\n if(s[s.length - 1] == '=')\n l = l - 1\n\n var b = new Buffer(l)\n b.write(s, 'base64')\n return b\n}", "function base64ToBuffer( str ) {\n\n\t\t\tvar b = atob( str );\n\t\t\tvar buf = new Uint8Array( b.length );\n\n\t\t\tfor ( var i = 0, l = buf.length; i < l; i ++ ) {\n\n\t\t\t\tbuf[ i ] = b.charCodeAt( i );\n\n\t\t\t}\n\n\t\t\treturn buf;\n\n\t\t}", "function fromBase64Url(data) {\n var input = data.padRight(data.length + (4 - data.length % 4) % 4, '=')\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n return toArrayBuffer(atob(input));\n}", "function base64ToArrayBuffer(base64) {\n if(base64==null || base64=='')\n return;\n var binaryString = window.atob(base64);\n var binaryLen = binaryString.length;\n var bytes = new Uint8Array(binaryLen);\n for (var i = 0; i < binaryLen; i++) {\n var ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n Download('new',bytes);\n}", "function decode(base64url, encoding) {\n if (encoding === void 0) { encoding = \"utf8\"; }\n return new Buffer(toBase64(base64url), \"base64\").toString(encoding);\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polyfill https://github.com/davidchambers/Base64.js\n }", "function base64_url_decode(data) {\n return new Buffer(data.replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('ascii');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n }", "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n var buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n var s = atob(str);\n var buffer = new Uint8Array(s.length);\n for (var i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}", "function url_base64_decode(str) {\n\t var output = str.replace('-', '+').replace('_', '/');\n\t switch (output.length % 4) {\n\t\tcase 0:\n\t\t break;\n\t\tcase 2:\n\t\t output += '==';\n\t\t break;\n\t\tcase 3:\n\t\t output += '=';\n\t\t break;\n\t\tdefault:\n\t\t throw 'Illegal base64url string!';\n\t }\n\t return window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\t}", "function base64StringToArrayBuffer(str) {\n if (useNodeBuffer) {\n const buf = Buffer.from(str, 'base64');\n return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n }\n const s = atob(str);\n const buffer = new Uint8Array(s.length);\n for (let i = 0; i < s.length; ++i) {\n buffer.set([s.charCodeAt(i)], i);\n }\n return buffer.buffer;\n}", "function btoa(str) {\n var buffer;\n\n if (str instanceof Buffer) {\n buffer = str;\n } else {\n buffer = new Buffer(str.toString(), 'binary');\n }\n\n return buffer.toString('base64');\n}", "function toUrlString(buffer) {\n return buffer.toString('base64')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_')\n .replace(/=/g, '');\n}", "function url_base64_decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "function base64urldecode(encodedString) {\n encodedString = encodedString.replace(/-/g, '+').replace(/_/g, '/');\n encodedString += ['', '', '==', '='][encodedString.length % 4];\n return new Buffer(encodedString, 'base64');\n}", "function base64ToArrayBuffer(base64String) {\r\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n var base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n var rawData = atob(base64);\r\n var outputArray = new Uint8Array(rawData.length);\r\n for (var i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n var rawData = atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "function base64ToArrayBuffer(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n var rawData = atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "function _base64ToArrayBuffer(base64){\n var binary_string = window.atob(base64);\n var len = binary_string.length;\n var bytes = new Uint8Array( len );\n for (var i = 0; i < len; i++)\n bytes[i] = binary_string.charCodeAt(i);\n return bytes.buffer;\n}", "function btoa (string) {\n // REF: https://stackoverflow.com/questions/246801/how-can-you-encode-a-string-to-base64-in-javascript\n // It might sound wired, but we have to use 'ascii' to get the 'utf8' chars to be encoded/decoded correctly\n\n return Buffer.from(string, 'ascii').toString('base64');\n}", "function base64ToArrayBuffer(base64) {\n var binaryString = window.atob(base64);\n var len = binaryString.length;\n var bytes = new Uint8Array(len);\n\n for (var i = 0; i < len; i++) {\n bytes[i] = binaryString.charCodeAt(i);\n }\n\n return bytes.buffer;\n}", "function _base64ToArrayBuffer(base64){\n base64 = base64.split('data:image/png;base64,').join('');\n var binary_string = window.atob(base64),\n len = binary_string.length,\n bytes = new Uint8Array( len ),\n i;\n for (i = 0; i < len; i++){\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes.buffer;\n}", "function _base64ToArrayBuffer(base64){\n base64 = base64.split('data:image/png;base64,').join('');\n var binary_string = window.atob(base64),\n len = binary_string.length,\n bytes = new Uint8Array( len ),\n i;\n for (i = 0; i < len; i++){\n bytes[i] = binary_string.charCodeAt(i);\n }\n return bytes.buffer;\n}", "static base64Decode(base64Str) {\n return Buffer.from(base64Str, \"base64\").toString(\"utf8\");\n }", "function stringToBase64Url(str) {\n var b64 = btoa(str);\n return base64ToBase64Url(b64);\n } // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function url_base64_decode(str) {\n\tvar output = str.replace(/-/g, '+').replace(/_/g, '/');\n\tswitch (output.length % 4) {\n\t\tcase 0:\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\toutput += '==';\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\toutput += '=';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tthrow 'Illegal base64url string!';\n\t}\n\tvar result = window.atob(output); //polifyll https://github.com/davidchambers/Base64.js\n\ttry {\n\t\treturn decodeURIComponent(escape(result));\n\t} catch (err) {\n\t\treturn result;\n\t}\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n const b64 = btoa(str);\n return base64ToBase64Url(b64);\n}", "function stringToBase64Url(str) {\n var b64 = (0, _webcrypto.btoa)(str);\n return base64ToBase64Url(b64);\n} // converts a standard base64-encoded string to a \"url/filename safe\" variant", "function base64url_encode(str) {\n var utf8str = unescape(encodeURIComponent(str))\n return base64_encode_data(utf8str, utf8str.length, b64u)\n }", "function atob(x) { return Buffer.from(x, 'base64').toString('binary'); }", "function urlBase64Decode(str) {\n var output = str.replace('-', '+').replace('_', '/');\n switch (output.length % 4) {\n case 0:\n break;\n case 2:\n output += '==';\n break;\n case 3:\n output += '=';\n break;\n default:\n throw 'Illegal base64url string!';\n }\n return window.atob(output);\n }", "toString(buf) {\n if (buf.length % 4 > 0) {\n throw new RangeError(`base64.toString: input buffer length not multiple of 4: ${buf.length}`);\n }\n let str = '';\n let lineLen = 0;\n function buildLine(c1, c2, c3, c4) {\n switch (lineLen) {\n case 76:\n str += `\\r\\n${c1}${c2}${c3}${c4}`;\n lineLen = 4;\n break;\n case 75:\n str += `${c1}\\r\\n${c2}${c3}${c4}`;\n lineLen = 3;\n break;\n case 74:\n str += `${c1 + c2}\\r\\n${c3}${c4}`;\n lineLen = 2;\n break;\n case 73:\n str += `${c1 + c2 + c3}\\r\\n${c4}`;\n lineLen = 1;\n break;\n default:\n str += c1 + c2 + c3 + c4;\n lineLen += 4;\n break;\n }\n }\n function validate(c) {\n if (c >= 65 && c <= 90) {\n return true;\n }\n if (c >= 97 && c <= 122) {\n return true;\n }\n if (c >= 48 && c <= 57) {\n return true;\n }\n if (c === 43) {\n return true;\n }\n if (c === 47) {\n return true;\n }\n if (c === 61) {\n return true;\n }\n return false;\n }\n for (let i = 0; i < buf.length; i += 4) {\n for (let j = i; j < i + 4; j += 1) {\n if (!validate(buf[j])) {\n throw new RangeError(`base64.toString: buf[${j}]: ${buf[j]} : not valid base64 character code`);\n }\n }\n buildLine(\n String.fromCharCode(buf[i]),\n String.fromCharCode(buf[i + 1]),\n String.fromCharCode(buf[i + 2]),\n String.fromCharCode(buf[i + 3])\n );\n }\n return str;\n }", "function base64DataURLToArrayBuffer(dataURL) {\n Canvas = require('canvas');\n let im = new Canvas.Image;\n im.onload = function() {\n imgHeight = im.height;\n imgWidth = im.width;\n };\n im.src = dataURL;\n const base64Regex = /^data:image\\/(png|jpg);base64,/;\n if (!base64Regex.test(dataURL)) {\n return false;\n }\n const stringBase64 = dataURL.replace(base64Regex, \"\");\n let binaryString;\n if (typeof window !== \"undefined\") {\n binaryString = window.atob(stringBase64);\n } else {\n binaryString = new Buffer(stringBase64, \"base64\").toString(\"binary\");\n }\n const len = binaryString.length;\n const bytes = new Uint8Array(len);\n for (let i = 0; i < len; i++) {\n const ascii = binaryString.charCodeAt(i);\n bytes[i] = ascii;\n }\n\n return bytes.buffer;\n }", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n for (var i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[bytes[i] >> 2];\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64String +=\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64String += \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\" /* BASE_CHARS */[bytes[i + 2] & 63];\n }\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n }\n else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n return base64String;\n }", "function bufferB64File(filepath) {\n return (new Buffer(fs.readFileSync(filepath, 'ascii'), 'base64'));\n}", "static base64Decode(str) {\n if (typeof atob != 'undefined') return atob(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'base64').toString('binary'); // Node.js\n throw new Error('No Base64 Decode');\n }", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if (bytes.length % 3 === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n }", "function decodeB64 (str) {\n if (typeof btoa !== 'undefined') {\n return btoa(str)\n }\n return 'base64:' + str\n}", "function bufferToString(buffer) {\n // base64-arraybuffer\n var bytes = new Uint8Array(buffer);\n var base64String = '';\n var i;\n\n for (i = 0; i < bytes.length; i += 3) {\n /*jslint bitwise: true */\n base64String += BASE_CHARS[bytes[i] >> 2];\n base64String += BASE_CHARS[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n base64String += BASE_CHARS[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n base64String += BASE_CHARS[bytes[i + 2] & 63];\n }\n\n if ((bytes.length % 3) === 2) {\n base64String = base64String.substring(0, base64String.length - 1) + '=';\n } else if (bytes.length % 3 === 1) {\n base64String = base64String.substring(0, base64String.length - 2) + '==';\n }\n\n return base64String;\n }", "function urlB64ToUint8Array(base64String) {\r\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\r\n const base64 = (base64String + padding)\r\n .replace(/\\-/g, '+')\r\n .replace(/_/g, '/');\r\n\r\n const rawData = window.atob(base64);\r\n const outputArray = new Uint8Array(rawData.length);\r\n\r\n for (let i = 0; i < rawData.length; ++i) {\r\n outputArray[i] = rawData.charCodeAt(i);\r\n }\r\n return outputArray;\r\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent(str)));\n }", "function base64UrlToUint8Array(base64UrlData) {\n var padding = '='.repeat((4 - base64UrlData.length % 4) % 4);\n var base64 = (base64UrlData + padding).replace(/\\-/g, '+').replace(/_/g, '/');\n\n var rawData = window.atob(base64);\n var buffer = new Uint8Array(rawData.length);\n\n for (var i = 0; i < rawData.length; ++i) {\n buffer[i] = rawData.charCodeAt(i);\n }\n return buffer;\n}", "function bufferToString(buffer) {\n\t // base64-arraybuffer\n\t var bytes = new Uint8Array(buffer);\n\t var base64String = '';\n\t var i;\n\n\t for (i = 0; i < bytes.length; i += 3) {\n\t /*jslint bitwise: true */\n\t base64String += BASE_CHARS[bytes[i] >> 2];\n\t base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t base64String += BASE_CHARS[bytes[i + 2] & 63];\n\t }\n\n\t if (bytes.length % 3 === 2) {\n\t base64String = base64String.substring(0, base64String.length - 1) + '=';\n\t } else if (bytes.length % 3 === 1) {\n\t base64String = base64String.substring(0, base64String.length - 2) + '==';\n\t }\n\n\t return base64String;\n\t }", "function bufferToString(buffer) {\n\t // base64-arraybuffer\n\t var bytes = new Uint8Array(buffer);\n\t var base64String = '';\n\t var i;\n\n\t for (i = 0; i < bytes.length; i += 3) {\n\t /*jslint bitwise: true */\n\t base64String += BASE_CHARS[bytes[i] >> 2];\n\t base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t base64String += BASE_CHARS[bytes[i + 2] & 63];\n\t }\n\n\t if (bytes.length % 3 === 2) {\n\t base64String = base64String.substring(0, base64String.length - 1) + '=';\n\t } else if (bytes.length % 3 === 1) {\n\t base64String = base64String.substring(0, base64String.length - 2) + '==';\n\t }\n\n\t return base64String;\n\t }", "function bufferToString(buffer) {\n\t // base64-arraybuffer\n\t var bytes = new Uint8Array(buffer);\n\t var base64String = '';\n\t var i;\n\n\t for (i = 0; i < bytes.length; i += 3) {\n\t /*jslint bitwise: true */\n\t base64String += BASE_CHARS[bytes[i] >> 2];\n\t base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t base64String += BASE_CHARS[bytes[i + 2] & 63];\n\t }\n\n\t if (bytes.length % 3 === 2) {\n\t base64String = base64String.substring(0, base64String.length - 1) + '=';\n\t } else if (bytes.length % 3 === 1) {\n\t base64String = base64String.substring(0, base64String.length - 2) + '==';\n\t }\n\n\t return base64String;\n\t }", "function uriToBuffer(uri) {\n\n var uri = uri.split(',')[1],\n bytes\n\n // Beware that the atob function might be a static one for server side tests\n if (typeof(atob) === 'function')\n bytes = atob(uri)\n else if (typeof(self.constructor.atob) === 'function')\n bytes = self.constructor.atob(uri)\n else\n throw new Error('atob function is missing')\n\n var arr = new Uint8Array(bytes.length)\n\n // http://mrale.ph/blog/2014/12/24/array-length-caching.html\n for (var i = 0, l = bytes.length; i < l; i++) {\n arr[i] = bytes.charCodeAt(i)\n }\n\n return toBuffer(arr)\n }", "async function getBase64FromUrl(url) {\n const response = await fetch(url);\n const blob = await response.blob();\n return await new Promise(resolve => {\n let reader = new FileReader();\n reader.readAsDataURL(blob);\n reader.onloadend = () => { resolve(reader.result); };\n });\n }", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function decodeB64 (str) {\n if (typeof atob !== 'undefined') {\n return atob(str)\n }\n return 'base64:' + str\n}", "function toBase64(base64url) {\n // We this to be a string so we can do .replace on it. If it's\n // already a string, this is a noop.\n base64url = base64url.toString();\n return padString(base64url)\n .replace(/\\-/g, \"+\")\n .replace(/_/g, \"/\");\n}", "function bufferToString(buffer) {\n\t // base64-arraybuffer\n\t var bytes = new Uint8Array(buffer);\n\t var base64String = '';\n\t var i;\n\n\t for (i = 0; i < bytes.length; i += 3) {\n\t /*jslint bitwise: true */\n\t base64String += BASE_CHARS[bytes[i] >> 2];\n\t base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t base64String += BASE_CHARS[bytes[i + 2] & 63];\n\t }\n\n\t if (bytes.length % 3 === 2) {\n\t base64String = base64String.substring(0, base64String.length - 1) + '=';\n\t } else if (bytes.length % 3 === 1) {\n\t base64String = base64String.substring(0, base64String.length - 2) + '==';\n\t }\n\n\t return base64String;\n\t}", "function bufferToString(buffer) {\n\t // base64-arraybuffer\n\t var bytes = new Uint8Array(buffer);\n\t var base64String = '';\n\t var i;\n\n\t for (i = 0; i < bytes.length; i += 3) {\n\t /*jslint bitwise: true */\n\t base64String += BASE_CHARS[bytes[i] >> 2];\n\t base64String += BASE_CHARS[(bytes[i] & 3) << 4 | bytes[i + 1] >> 4];\n\t base64String += BASE_CHARS[(bytes[i + 1] & 15) << 2 | bytes[i + 2] >> 6];\n\t base64String += BASE_CHARS[bytes[i + 2] & 63];\n\t }\n\n\t if (bytes.length % 3 === 2) {\n\t base64String = base64String.substring(0, base64String.length - 1) + '=';\n\t } else if (bytes.length % 3 === 1) {\n\t base64String = base64String.substring(0, base64String.length - 2) + '==';\n\t }\n\n\t return base64String;\n\t}", "static base64Encode(str, encoding) {\n return Buffer.from(str, encoding).toString(\"base64\");\n }", "function b64(str) {\n return new Buffer(str).toString('base64')\n .replace(/=/g, '')\n .replace(/\\+/g, '-')\n .replace(/\\//g, '_');\n} // This is the encyrption algorithm, don't ask me why it is that way", "static base64Encode(str) {\n if (typeof btoa != 'undefined') return btoa(str); // browser\n if (typeof Buffer != 'undefined') return new Buffer(str, 'binary').toString('base64'); // Node.js\n throw new Error('No Base64 Encode');\n }", "function stringToBuffer(str) {\n var array = new Uint8Array(str.length);\n for (var i = 0, l = str.length; i < l; i++) {\n array[i] = str.charCodeAt(i);\n }\n return array.buffer;\n}", "function urlB64ToUint8Array (base64String) {\n const padding = '='.repeat((4 - (base64String.length % 4)) % 4)\n const base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/')\n const rawData = atob(base64)\n const outputArray = new Uint8Array(rawData.length)\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i)\n }\n return outputArray\n}", "function utf8_to_b64( str ) {\n return window.btoa(unescape(encodeURIComponent( str )));\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function decodeString(value) {\n return Buffer.from(value, \"base64\");\n}", "function utf8_to_b64(str) {\n return window.btoa(unescape(encodeURIComponent( str )));\n }", "function urlBase64ToUint8Array(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n \n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n \n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n }", "function base64_decode(base64str, file) {\n// create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function arrayBufferToBase64String(buffer) {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n return btoa(String.fromCharCode.apply(null, new Uint8Array(buffer)));\n}", "function urlBase64ToUint8Array(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding).replace(/\\-/g, '+').replace(/_/g, '/');\n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "function urlBase64ToUint8Array(base64String) {\n var padding = \"=\".repeat((4 - (base64String.length % 4)) % 4);\n var base64 = (base64String + padding).replace(/\\-/g, \"+\").replace(/_/g, \"/\");\n\n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "arrayBufferToBase64(buffer) {\n var binary = '';\n var bytes = [].slice.call(new Uint8Array(buffer));\n\n bytes.forEach((b) => binary += String.fromCharCode(b));\n\n return window.btoa(binary);\n}", "function fromBase64(input) {\n const buffer = util_buffer_from_1.fromString(input, \"base64\");\n return new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);\n}", "function urlBase64ToUint8Array(base64String) {\n var padding = '='.repeat((4 - base64String.length % 4) % 4);\n var base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n var rawData = window.atob(base64);\n var outputArray = new Uint8Array(rawData.length);\n\n for (var i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "arrayBufferToBase64(buffer) {\n var binary = '';\n var bytes = [].slice.call(new Uint8Array(buffer));\n bytes.forEach((b) => binary += String.fromCharCode(b));\n return binary;\n }", "function urlBase64ToUint8Array(base64String) {\n const padding = \"=\".repeat((4 - (base64String.length % 4)) % 4)\n const base64 = (base64String + padding).replace(/-/g, \"+\").replace(/_/g, \"/\")\n\n const rawData = window.atob(base64)\n const outputArray = new Uint8Array(rawData.length)\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i)\n }\n return outputArray\n}", "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "function arrayBufferToBase64String(buffer) {\n if (useNodeBuffer) {\n return Buffer.from(buffer).toString('base64');\n }\n const buf = new Uint8Array(buffer);\n let s = '';\n for (let i = 0, l = buf.length; i < l; i++) {\n s += String.fromCharCode(buf[i]);\n }\n return btoa(s);\n}", "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) %4);\n const base64 = (base64String + padding)\n .replace(/-/g, '+')\n .replace(/_/g, '/');\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n for(let i = 0; i < rawData.length; i++) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n return outputArray;\n}", "function arrayBufferToBase64(input) {\n return btoa(arrayBufferToString(input));\n}", "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}", "function urlBase64ToUint8Array(base64String) {\n const padding = '='.repeat((4 - base64String.length % 4) % 4);\n const base64 = (base64String + padding)\n .replace(/\\-/g, '+')\n .replace(/_/g, '/');\n\n const rawData = window.atob(base64);\n const outputArray = new Uint8Array(rawData.length);\n\n for (let i = 0; i < rawData.length; ++i) {\n outputArray[i] = rawData.charCodeAt(i);\n }\n\n return outputArray;\n}", "function base64_decode (base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "async getBase64Data(url) {\n \n // Awaiting for fetch response\n const response = await fetch(url,{\n method:\"GET\",\n headers: {\n 'If-None-Match': ''\n }\n });\n \n // Awaiting for response.json()\n const data = await response.json();\n \n // Getting content\n const base64Data = data.content;\n\n //Decoding Data\n const resData = window.atob(base64Data);\n\n // Returning result data\n return resData;\n }", "btoa(str) {\n return window.btoa(str);\n }", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}", "function base64_decode(base64str, file) {\n // create buffer object from base64 encoded string, it is important to tell the constructor that the string is base64 encoded\n var bitmap = new Buffer(base64str, 'base64');\n // write buffer to file\n fs.writeFileSync(file, bitmap);\n console.log('******** File created from base64 encoded string ********');\n}" ]
[ "0.7596794", "0.7490258", "0.71877104", "0.68810594", "0.6857738", "0.6816563", "0.6808298", "0.6806062", "0.6789498", "0.6786183", "0.6778464", "0.677261", "0.6742628", "0.6730694", "0.67012304", "0.66876876", "0.6680805", "0.66783303", "0.6665888", "0.66353947", "0.66345745", "0.66345745", "0.6602782", "0.65603256", "0.65250087", "0.6523428", "0.6523428", "0.6515355", "0.6476", "0.64630234", "0.6460547", "0.6460547", "0.6424172", "0.6387224", "0.63733035", "0.6367936", "0.63540834", "0.6348186", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.6328385", "0.62699556", "0.62543964", "0.6247662", "0.6241524", "0.62156165", "0.6215449", "0.62147635", "0.61870855", "0.61761695", "0.61757565", "0.61757565", "0.61757565", "0.6170557", "0.6161692", "0.6159321", "0.6159321", "0.6138191", "0.61372197", "0.61372197", "0.61331105", "0.6119861", "0.61082375", "0.61081856", "0.60840696", "0.6072573", "0.6071352", "0.6071352", "0.6071352", "0.6071352", "0.6065517", "0.60315734", "0.60272306", "0.6021247", "0.6013045", "0.5999259", "0.5999088", "0.59984463", "0.598594", "0.597184", "0.5965129", "0.59587395", "0.5957254", "0.59569037", "0.5947508", "0.5944732", "0.5944732", "0.59361774", "0.5916954", "0.5912049", "0.59032303", "0.59032303", "0.59032303", "0.59032303" ]
0.8812362
0
append the user's name being passed in the browser's url to the end of the heading
function gallery(){ showName(); //create the images to display in the gallery for (i = 1; i <= 60; i++){ //create a string adding the images directory and looping through the filename numbers //loop through images 1-9 due to the extra character space added after the number 9 if (i < 10){ var mySlides = "../static/javapic/images/pdxcg_0" + i + ".jpg"; } //loop through all image after the number 9 if(i > 9){ var mySlides = "../static/javapic/images/pdxcg_" + i + ".jpg"; //ignore missing file 42 and keep going if( i===42){ continue; } } //create an <li> in javascript var li = document.createElement("LI"); //create an image in javascript var img = document.createElement("IMG"); img.setAttribute("src", mySlides); //place the image in the <li> li.appendChild(img); //place the <li> in the gallery document.getElementById("gallery").appendChild(li); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayNameUser(responseAsJson, div, authToken, apiUrl, content){\n\tconst username = document.createElement(\"h1\");\n\tusername.style.textAlign = \"center\"; //display username\n\tusername.textContent = \"@\" + responseAsJson.username;\n\tusername.className = \"listAll\"; //make username linkable to public profile\n\tusername.onclick = function(){let userPage = createUserPage(div,\n\t\t\t\t\t\t\t\t\t\t responseAsJson.username, authToken, apiUrl);\n\t\t\t\t\t\t\t\t\t\t openEdit(div, userPage)};\n\tcontent.appendChild(username);\n\tconst n = document.createElement(\"h2\"); //display name\n\tn.style.textAlign = \"center\";\n\tn.style.color = \"var(--reddit-blue)\";\n\tn.textContent = responseAsJson.name;\n\tcontent.appendChild(n);\n\treturn content;\n}", "function MUA_headertext(mode) {\n let header_text = (mode === \"update\") ? loc.User + \": \" + mod_MUA_dict.username : loc.Add_user;\n if(mod_MUA_dict.user_schoolbase_pk){ header_text = loc.Add_user_to + mod_MUA_dict.user_schoolname;}\n document.getElementById(\"id_MUA_header\").innerText = header_text;\n } // MUA_headertext", "function displayUserName(data) {\n\t$('.welcome_message').html(`Welcome ${data.currentUser.username}, you are now logged into`)\n}", "function setPageTitle(nickName, viewingSelf) {\n if (viewingSelf == true){\n document.getElementById('page-title').innerText = 'Welcome home! ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + ' ^_^';\n }\n else{\n if (nickName == ''){\n document.getElementById('page-title').innerText = 'Hello! My owner hasn\\'t set my name yet! Please remind him/her to give me a name ^_^';\n }\n else{\n document.getElementById('page-title').innerText = 'Helloooo! This is ' + nickName.replace(/(\\n|\\r|\\r\\n)/g, '') + \". Welcome to my page ^_^\";\n }\n }\n document.title = parameterUsername + ' - User Page';\n}", "function setPageTitle() {\n document.getElementById('page-title').innerText = parameterUsername;\n document.title = parameterUsername + ' - User Page';\n}", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n }", "function setPageTitle() {\n document.getElementById('page-title').innerText = parameterUsername;\n document.title = parameterUsername + ' - User Page';\n}", "function updateUserNameDisplay(fullName) {\n\t$(\"#environmentData .profileName\").text(fullName);\n}", "function formatTitle(value) {\n if(value) {\n var parts = value.split(/:/);\n return '<a href=\"' + oilsBasePath + \n '/acq/picklist/user_request/' + parts[0] + '\">' + parts[1] + '</a>';\n }\n}", "function displayName(user) {\n const html = `<br><br>\n <h1>${user.first_name} ${user.last_name}</h1>\n `;\n const display = document.getElementById('display-name')\n display.innerHTML = html\n return html\n}", "function updateHeader(){\n if(currentUser){\n document.getElementById(\"me\").innerHTML = currentUser.username;\n } else {\n document.getElementById(\"me\").innerHTML = \"LOGIN\";\n }\n}", "function displayHeadUser() {\n const welcomeMsg = document.createElement(\"h2\");\n welcomeMsg.id = \"welcome-message\"\n welcomeMsg.textContent = \"Welcome back, \" + localStorage.username + \"!\";\n head.append(welcomeMsg);\n\n const logoutBtn = document.createElement(\"button\");\n logoutBtn.id = \"logout-btn\";\n logoutBtn.textContent = \"Log out\";\n logoutBtn.addEventListener(\"click\", logout)\n head.append(logoutBtn);\n}", "function headerDetails(data) {\n var headerDetails = data[0];\n $('.user-name').text(headerDetails.first_name + \" \" + headerDetails.last_name);\n }", "function insertName (name) {\n let heading = document.getElementById(\"heading\");\n if (name == \"\") {\n heading.innerHTML = \"My To-Do List\";\n } else {\n heading.innerHTML = name.charAt(0).toUpperCase() + name.slice(1) + \"'s To-Do List\";\n document.title = name.charAt(0).toUpperCase() + name.slice(1) + \"'s To-Do List\";\n }\n}", "function onGetUserNameSuccess() {\n $('#message').text('Hello ' + user.get_title());\n}", "function SetupUsernames()\r\n{\r\n // get who you are logged in as, and whose page you are reading\r\n meta = document.getElementsByTagName( \"meta\" );\r\n for ( var i = 0; i < meta.length; i++ )\r\n {\r\n if ( meta[i].name == 'session-user-screen_name' )\r\n {\r\n my_username = meta[i].content;\r\n }\r\n //alert( \"I am \" + my_username );\r\n\r\n if ( meta[i].name == 'page-user-screen_name' )\r\n {\r\n page_username = meta[i].content;\r\n }\r\n else\r\n {\r\n page_username = my_username;\r\n }\r\n //alert( \"Lookin at \" + page_username );\r\n }\r\n}", "function UserNameReplace() {\n if (typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").text(wgUserName);\n }", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $('.insertusername').html(wgUserName); }", "function showUser(data, status){\n\t\t console.log(status);\n\t\t var username = \"<h3> How are my repos? </h3><br>\";\n\t\t $(\"#username\").append(username);\n\t\t // debugger;\n\t\t}", "function UserNameReplace() {\n if(typeof(disableUsernameReplace) != 'undefined' && disableUsernameReplace || wgUserName == null) return;\n $(\"span.insertusername\").html(wgUserName);\n }", "function redirectUser(name) {\n let chatHeader = initialChannel;\n chatHeader.removeChild(chatHeader.lastChild);\n initialChannel.insertAdjacentHTML(\"beforeend\", `${name}`);\n}", "function onGetUserNameSuccess() {\n $('#message').append('<p>Hello ' + user.get_title() + user.get_email()+'</p>');\n}", "function displayText() {\n var bodyEl = document.getElementById('body');\n var user = localStorage.userName;\n var createHeader = document.createElement('h3');\n createHeader.textContent = ('Hello ' + user + ', please choose a character:'); //please do NOT call JSON.parse on user\n bodyEl.appendChild(createHeader);\n}", "function GenerateProfileHTML(user) {\r\n \r\n if(typeof user['link'] != 'undefined')\r\n return '<a href=\"' + user['link'] + '\" class=\"user-link\">by ' + user['display_name'] + '</a>';\r\n else\r\n return '<span class=\"user-link\">' + user['display_name'] + '</span>'\r\n \r\n }", "function getUserName() {\r\n var itemTitle = document.title;\r\n\r\n var curUserEmail = \"\";\r\n var url = '';\r\n var strSourcedoc = getParameterByName(\"sourcedoc\");\r\n if (strSourcedoc != '') {\r\n url = strSourcedoc;\r\n }\r\n else\r\n url = window.location.href;\r\n\r\n var uri = \"\";\r\n var history = {};\r\n history.Title = itemTitle;\r\n history.Url = url;\r\n history.Email = curUserEmail;\r\n history.IP = \"\";\r\n history.DeviceName = _MobileDevice;\r\n history.AppName = _browser;\r\n history.Platform = _flatform;\r\n history.CodeName = _appCodeName;\r\n history.UserAgent = _userAgent;\r\n PostRequest(uri, history);\r\n}", "function userNameText(userName, userCompany) {\n $(document).ready(function(){\n document.getElementById('user_name_text').innerHTML = `${userName} - ${userCompany}`;\n })\n }", "function showUserName(userName) {\r\n $(\".showUserName\").html(\"Hi \" + userName);\r\n }", "function getUserName() {\n\t$.ajax({\n\t\turl : 'rest/user/names',\n\t\ttype : \"GET\",\n\t\tdataType : \"text\"\n\t}).always(function(data) {\n\t\tif (typeof data != 'undefined') {\n\t\t\t$(\".welcome-greeting\").css(\"display\", \"inline\");\n\t\t\t$(\"#user-holder\").text(data);\n\t\t}\n\t});\n}", "function set_user_name(new_name){\n //TODO Validate User String\n current_user_name = new_name\n nameSpace.innerHTML=(\"User: \" + current_user_name)\n \n}", "function user_name(){\n\t\tvar name = document.createElement(\"div\");\n\t\tname.textContent = \"NAME\";\n\t\tname.setAttribute(\"class\", \"user_name\");\n\t\tdiv.appendChild(name);\n\t}", "function buildHeader(first_name, last_name) {\t\n\t$('#WelcomeText').html(`Welcome, ${first_name} ${last_name}` );\t\n\t$('#logoutBtn').show();\n\t$('#logo').show();\n}", "function renderUserLink(user, nameFirst) {\n\tvar a = document.createElement('a')\n\ta.className = 'textItem userLink ib'\n\tif (!user) {\n\t\tuser = {\n\t\t\tusername: \"MISSINGNO.\",\n\t\t\tavatar: \"unknown-user.png\",\n\t\t}\n\t}\n\ta.href = \"#user/\"+user.id\n\tif (nameFirst != undefined) {\n\t\tvar name = textItem(user.username)\n\t\tname.className += \" username pre\"\n\t}\n\tvar avatar = renderAvatar(user)\n\tavatar.className += \" item\"\n\tif (nameFirst == undefined)\n\t\tavatar.title = user.username\n\tif (nameFirst == true)\n\t\ta.appendChild(name)\n\ta.appendChild(avatar)\n\tif (nameFirst == false)\n\t\ta.appendChild(name)\n\treturn a\n}", "function showUsername() {\n const cookies = decodeURIComponent(document.cookie).split(';');\n\n if (cookies.length < 1 || cookies[0] === \"\") {\n // if theres no cookie, do nothing\n return;\n }\n\n const username = cookies[0].split('=')[1];\n\n loginButton.hide();\n\n navBar.append(`\n <li class=\"nav-item\">\n <a class=\"nav-link text-success\" href=\"#\">Welcome, ${username}</a>\n </li>\n `);\n }", "function displayEntireNameForUser(user) {\n if (!user) {\n return '';\n }\n\n let displayName = '@' + user.username;\n const fullName = getFullName(user);\n\n if (fullName && user.nickname) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, fullName + ' (' + user.nickname + ')'));\n } else if (fullName) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, fullName));\n } else if (user.nickname) {\n displayName = react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", null, '@' + user.username, ' - ', react__WEBPACK_IMPORTED_MODULE_10___default.a.createElement(\"span\", {\n className: \"light\"\n }, '(' + user.nickname + ')'));\n }\n\n return displayName;\n}", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location)attr.('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n\n}", "function populateUserInfo(me)\r\n{\r\n\tlet ja = DomParser.parseFromString(template_userdetails, \"text/html\").body.childNodes[0];\r\n\t\r\n $(ja).find(\"h2\").text(me.fullname.split(\" \")[0]);\r\n \r\n $(\"body\").append(ja);\r\n \r\n}", "function addUserHistoryLink(){\r\n var userhistory = '<a href=\"javascript:;\" class=\"user-history-button\" title=\"view user history\" target=\"_blank\">H</a>'\r\n if( this.firstChild ) return $(this).find('a:last').append(','+userhistory);\r\n $(this).append('['+userhistory+']');\r\n }", "function getUserName() {\n // check the url and store it in a variable so we can search it\n var url = $(location).attr('href'),\n urlComponents,\n username;\n // split the url into searchable components\n urlComponents = url.split('?')\n // search the match data for the passed username and return it\n for (var i = 0; i < urlComponents.length; i++){\n // split the string again to compare value pairs\n compComponents = urlComponents[i].split('=');\n if (compComponents[0] === 'username') {\n return compComponents[1];\n }\n }\n}", "function printHeadline(){\n\thashtagInput = $('#hashTagInput').val();\n\tcleanedHashTagRequest = hashtagInput.replace(/[^a-z0-9]/gi,'');\n\thashtagRequest = cleanedHashTagRequest || defaultHashTag;\n\t\n\t$('.headline').html('#' + hashtagRequest);\n}", "function sayGreeting() {\r\n let username = sessionStorage.getItem('username');\r\n if (username != undefined) {\r\n $('#loggedInUser').text(`Welcome ${username}!`);\r\n updateNavigation();\r\n }\r\n else\r\n {\r\n $('#viewHome').show();\r\n $('#linkLogin').show();\r\n $('#linkRegister').show(); \r\n $('#linkListBooks').hide();\r\n $('#linkCreateBook').hide();\r\n $('#linkLogout').hide();\r\n $('#loggedInUser').text('');\r\n showPage('viewHome');\r\n }\r\n }", "function setLoginName (name) {\n document.getElementById(\"loginName\").innerHTML = `<strong>${name}</strong>`;\n }", "function getName() {\n applicationState.user = userName.value;\n document.getElementById(\n \"userinfo\"\n ).innerHTML = `welcome ${applicationState.user}`;\n applicationState.gameStart = true;\n startTime = Date.now();\n}", "function set_user_name(env, title, first, initial, last) {\n env.auth.user.name = [title, first, initial, last];\n}", "function displayUserName() {\n\tshowname = document.getElementById('displayName');\n\tshowname.innerHTML=localStorage.getItem('user'); \n}", "function displayName(data) {\n\t\t\t$('#name').html('<h1>' + data.name + '</h1>');\n\t\t\t//console.log(data.name);\n\t\t}", "function load_header(_eatery_name) {\n eatery_name.innerHTML = _eatery_name;\n}", "function printUsername() {\n let usernameDOM = document.getElementById('label-username');\n usernameDOM.innerHTML = user.username;\n}", "function setUserName() {\n var myName = prompt(\"please fill in your name\");\n localStorage.setItem('name', myName);\n myHeading.textContent = myName + \"! you are awesome!\"\n}", "async function build_header(){\n\tauth = await is_login();\n\n\tfor(let i in sections){\n\t\tlet current = sections[i];\n\t\tlet el = document.createElement(\"a\");\n\n\t\tel.id = \"header-username-link\";\n\n\t\tif(window.notIndexHTML){\n\t\t\tel.href = '/index.html#' + current.name;\n\t\t}\n\n\t\tif(current.name){\n\t\t\tel.setAttribute('data-show',current.name);\n\t\t}\n\t\tel.setAttribute('data-require-auth',current.auth ? current.auth : \"none\");\n\n\t\tif(current.file){\n\t\t\tel.setAttribute('data-file',current.file);\n\t\t}\n\n\t\tel.innerHTML = text_formatter(current.display);\n\n\n\t\tif(current.span){\n\t\t\tdocument.querySelector(\"header\").appendChild(el);\n\t\t}else{\n\t\t\tdocument.querySelector(\"nav\").appendChild(el);\n\t\t}\n\t}\n}", "function userInformationHTML(user) { //the 'user' parameter here references the user object being returned from the github API. this contains information methods like user's name login name etc.\n//could console.log(user) to see all the different things in user object from github data API that you could display.\n return `<h2>${user.name}\n <span class=\"small-name\">\n (@<a href=\"${user.html_url}\" target= \"_blank\">${user.login}</a>)\n </span>\n </h2>\n <div class=\"gh-content\">\n <div class=\"gh-avatar\">\n <a href=\"${user.html_url} target= \"_blank\" \n <img src=\"${user.avatar_url}\" width=\"80\" height=\"80\" alt=\"${user.login}\"/>\n </a>\n </div>\n <p>Followers: ${user.followers} - Following ${user.following} <br> Repos: ${user.public_repos}</p>\n </div>`;\n}", "function getName() {\n getUseInput(function(name) {\n userName = name;\n deleteAllLines();\n displayString(\"Hello \" + userName, 'main');\n });\n }", "function changeNameInHeader() {\n $headerName.html('Todo list for ' + $TaskName.val());\n }", "function setUserNameFromPopup(popup_userName){\n\tuserName = popup_userName;\n\tvar userDashboard = document.getElementById('userDashboard');\n\tif(userName != ''){\n\t\tuserDashboard.innerHTML = userName+' : RED';\n\t}\n\telse{\n\t\tuserDashboard.innerHTML = 'You : RED';\n\t}\n}", "function changeUserText(userName) {\n document.getElementById('intro').id = \"hide\";\n document.getElementsByTagName('form')[0].className = \"hide\";\n var textNode = document.createTextNode(userName + \", click on the image you like best.\");\n document.getElementById('username').appendChild(textNode);\n}", "function setName(){\n $('#identity-frm').slideUp(200);\n $('#share-frm').slideDown(200);\n username = $('#username').val();\n $('#tracker_name').html(username + ' (you)');\n}", "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 loggedinUser() {\n $(\".loggedin-user\").append(`Welcome ${STATE.authUser.name}!`);\n}", "header(name, info) {\n this.headingName.setContent(name)\n this.headingInfo.setContent(info)\n }", "function handleClick() {\n setHeadingText(name);\n }", "function showLoggedInUser(user) {\n login_status.text(\"Logged in as: \" + user.profile.name);\n login_button.text(\"Logout\");\n }", "function current_user_name() {\n document.getElementById(\"current_user_name\").innerHTML = \"Current User: \" + localStorage.getItem(\"currentUser\");\n document.getElementById(\"footer_paragraph\").innerHTML = \"\";\n \n}", "function displayWelcomeMessage() {\n \n const username = getLocalStorageUsername()\n welcomeH1.innerHTML = `<h1 class=\"welcome-h1\">Hey, ${username}! Here's your todo list for today.</h1>\n <h3>The goal is to prevent the rainbow bar to get empty by completing you daily tasks.</h3>\n <h3>No one can stop you!</h3>`\n}", "function req_read_new_user_name(env) {\n var data = http.req_body(env).user;\n set_new_user_name(\n env,\n data.user_name_title,\n data.user_name_first,\n data.user_name_initial,\n data.user_name_last\n )\n}", "function req_read_user_name(env) {\n var data = http.req_body(env).user;\n set_user_name(\n env,\n data.user_name_title,\n data.user_name_first,\n data.user_name_initial,\n data.user_name_last\n )\n}", "updateAuthPlayerDname(state, value) {\n state.auth_user.DisplayName = value;\n }", "getDisplayName() {\r\n var name = this.auth.currentUser.displayName;\r\n var nameArr = name.split(\" \");\r\n return nameArr[0];\r\n }", "function getDisplayTextOfUser() {\n if (_userInformation.DisplayName != null) {\n return _userInformation.DisplayName;\n }\n return _userInformation.UserName;\n }", "function recipeName(response) {\n var name = $(\"<h3>\").text(response.title); \n recipeTitle.append(name);\n }", "function set_new_user_name(env, title, first, initial, last) {\n init_new_user_storage(env);\n env.auth.new_user.name = [title, first, initial, last];\n}", "function setUserName() {\n var myName = prompt(\"Please enter your name.\");\n \n /* localStorage api allows us to store data in browser to \n retrieve later. setItem function creates and stores the\n data called name which sets its value to myName */\n localStorage.setItem(\"name\", myName);\n \n //textContent sets the heading to a new string\n myHeading.innerHTML = \"Welcome, \" + myName;\n}", "function header() {\n\tif (output.innerHTML === \"\"){\n\tlistHeading.innerHTML =\"\";\n} else {\n\tlistHeading.innerHTML =\"<h3> Capitalized name(s): </h3>\";\n}\n} // --- my solution", "function updateUsersLink ( ) {\n var t = nicks.length.toString() + \" user\";\n if (nicks.length != 1) t += \"s\";\n $(\"#usersLink\").text(t);\n}", "function displayName(fname,mname=\"\",lname)\n {\n $('#current_employee_name').text(fname+\" \"+mname+\" \"+lname);\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "get userDisplayName() {\n return this._data.user_name;\n }", "function returnUser(userName) {\n return \"Welcome to Kodiri \" + userName;\n return `Welcome to Kodiri ${userName}`;\n}", "function user(request, response) {\n //if url == \"/....\"\n var username = request.url.replace(\"/\", \"\");\n if(username.length > 0) {\n response.writeHead(200, {'Content-Type': 'text/plain'}); // response.writeHead(statusCode[, statusMessage][, headers])\n response.write(\"Header\\n\"); // Node.js API: response.write\n response.write(\"User Name: \" + username + \"\\n\");\n response.end('Footer\\n');\n \n \n //get json from Treehouse\n //on \"end\"\n //show profile\n //on \"error\"\n //show error\n }\n}", "function renderUser(name, data, parameters={}, options={}) {\n\n var html = `<span>${data.username}</span>`;\n\n if (data.first_name && data.last_name) {\n html += ` - <i>${data.first_name} ${data.last_name}</i>`;\n }\n\n return html;\n}", "getPageTitle(){\n return elementUtil.dogetPageTitle(constants.LOGIN_PAGE_TITLE)\n }", "get heading () { return $('#register-title') }", "function showLoginName(){\r\n\r\n\tif(typeof login_name != 'undefined')\r\n\t\t$(\"#loginName\").text(_user+': '+login_name);\r\n\telse\r\n\t\t$(\"#loginName\").text(_user+': '+'admin');\r\n\r\n}", "function setGreetingName(){\n return $.ajax({\n url: siteUrl + \"/_api/web/currentUser\",\n Type:'GET',\n headers: {\n accept: \"application/json;odata=verbose\"\n }\n }).done(function(data){\n currUser = data.d.Title;\n //set the greeting to be the first name of the returned user\n $(\"#formGreeting\").html(\"Hi, \"+ data.d.Title.substring(0,data.d.Title.indexOf(\" \")));\n setDateAndTime(currUser);\n });\n}", "function associateUsername(username) {\n USERNAME = username;\n addSystemMessage(textElement('Your username is:'), usernameElement(username));\n}", "function renderUsername(value, p, r){\r\n return String.format('<b><font color=\"' + getColor(r.data['username']) + '\">{0}&nbsp;({1}):</b></font>', r.data['username'], r.data['time']);\r\n}", "function setName(username) {\n const usernamediv = document.querySelector('#name');\n usernamediv.innerHTML = `<i class=\"fa fa-user-circle\"></i>${username}`;\n}", "updateUILogin(username) {\n $('.anon').hide()\n $('.auth').show()\n\n $('.my-games').show().attr('href', '#users/'+username+'/games')\n }", "function getTitle(data) {\n\t\tvar title = \"\";\n\t\tif(data.title){\n\t\t\ttitle = data.title;\n\t\t}else if( data.username ){\n\t\t\ttitle = data.username;\n\t\t}else if( data.message_details ){\n\t\t\ttitle = data.message_details;\n\t\t}else if( data.details ){\n\t\t\ttitle = data.details;\n\t\t}else if( data.fullname ){\n\t\t\ttitle = data.fullname;\n\t\t}\n\t\t\n\t\treturn title;\n\t}", "function setUserName() {\r\n\tvar myName = prompt('Please enter your name!');\r\n\tlocalStorage.setItem('name', myName);\r\n\tmyHeading.textContent = 'TUtorials are cool, ' + myName;\r\n}", "function setGreeting(){\n let username = localStorage.getItem(\"username\");\n\n if(username !== null){\n loggedIn.show();\n loggedIn.text(`Welcome, ${username}`);\n loginLink.hide();\n registerLink.hide();\n listAdsLink.show();\n createAdLink.show();\n logoutLink.show();\n\n }else{\n loggedIn.hide();\n loginLink.show();\n registerLink.show();\n listAdsLink.hide();\n createAdLink.hide();\n logoutLink.hide();\n }\n }", "function setUserName() { // creates function SetUserName in javascript. this can be anything you want\n var myName = prompt('Please enter your first name.'); // creates car named myName and assigns it whatever name the user inputs\n localStorage.setItem('name', myName);\n myHeading.textContent = 'Midiagirl is cool, ' + myName;\n}", "function UserNameReplace(){\n if (wgUserName){\n var spans = getElementsByClassName(document, \"span\", \"insertusername\");\n \n for (var i = 0; i < spans.length; i++){\n spans[i].innerHTML = wgUserName;\n }\n }\n}", "function setName(){\n\t//$('div#statBar label#fname').text('User: ' + userStats.fn.toString() );\n}", "function welcomeUser(username) {\n let welcomeMessage = document.querySelector(\"#welcome\");\n welcomeMessage.innerHTML = `Welcome ${username}`;\n}", "function setLoggedUserName() {\n\t\t// Get hold of link of inbox\n\t\tvar bannerDiv = getElementByClass(getElementsByName(document,'div'),'banner');\n\t\tvar navGroup = getElementByClass(getElementsByName(bannerDiv,'ul'),'nav');\n\t\tvar navList = getElementsByName(navGroup,'li');\n\t\tfor(var linkIndx=0; linkIndx < navList.length; ++linkIndx) {\n\t\t\tvar anchor = getElementsByName(navList[linkIndx],'a')[0];\n\t\t\tif(anchor.href.indexOf(\"/inbox\") != -1) {\n\t\t\t\tvar anchorHrefSplit = anchor.href.split('/');\n\t\t\t\tloggedUserName = anchorHrefSplit[anchorHrefSplit.length-1];\n\t\t\t\treturn;\n\t\t\t}\n\t\t} \t\t\n\t}", "function copy_user_name (user_name)\n{\n\tif (document.post.message)\n\t{\n\t\tdocument.post.message.value += user_name;\n\t\tdocument.post.message.focus();\n\t}\n\n\treturn false;\n}" ]
[ "0.68608207", "0.68305606", "0.6623038", "0.6588593", "0.6545876", "0.6534924", "0.6534924", "0.6534924", "0.6534924", "0.65077037", "0.64973295", "0.64796966", "0.64661944", "0.6448432", "0.6329444", "0.6315587", "0.62866545", "0.6283378", "0.6274221", "0.6263746", "0.62552917", "0.6242001", "0.62384635", "0.6217424", "0.6209635", "0.62074363", "0.6202283", "0.6191864", "0.6188765", "0.61729527", "0.61721236", "0.61699194", "0.616417", "0.6136482", "0.6100952", "0.6079825", "0.6060796", "0.60512936", "0.603076", "0.6028932", "0.6023302", "0.6022193", "0.60158265", "0.60055083", "0.6004447", "0.5994398", "0.59914184", "0.59913576", "0.5987119", "0.5980117", "0.5974442", "0.5945609", "0.594292", "0.59371024", "0.59287363", "0.5924786", "0.59213835", "0.59187734", "0.59060884", "0.5885538", "0.58844274", "0.5871329", "0.5868059", "0.58479095", "0.58440095", "0.5834545", "0.58243525", "0.579321", "0.57928467", "0.5789774", "0.5789392", "0.5781335", "0.5771674", "0.5763779", "0.57605755", "0.5753514", "0.5745776", "0.5738724", "0.5738724", "0.5738724", "0.5738724", "0.5736221", "0.5731788", "0.57295537", "0.5726726", "0.5726367", "0.5722469", "0.5713589", "0.5702169", "0.5691238", "0.5689497", "0.5689275", "0.5685838", "0.56822604", "0.5674962", "0.5671092", "0.5669405", "0.56667656", "0.5663991", "0.5662807", "0.5658113" ]
0.0
-1
Further exploration Find the middle word of a phrase and take care of all edge cases
function middleWord(string) { if (string.trim() !== '') { let wordsArray = string.split(' '); if (wordsArray.length % 2 === 1) { return wordsArray[Math.floor(wordsArray.length / 2)]; } else { return wordsArray[(wordsArray.length / 2) - 1] + ' ' + wordsArray[wordsArray.length / 2]; } } else { return 'Error: The string is empty'; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findMiddle(word) {\n if (word.length % 2 === 0) {\n let mid1 = Math.floor(word.length / 2) - 1;\n let mid2 = mid1 + 1;\n return word[mid1] + word[mid2];\n } else {\n let mid = Math.floor(word.length / 2);\n return word[mid];\n }\n //console.log(s.length);\n //console.log(Math.ceil(s.length / 2 - 1));\n //return s.substr(Math.ceil(s.length / 2 - 1), s.length % 2 === 0 ? 2 : 1);\n}", "function middleWord(string) {\n string = string.split(' ');\n let stringIndex = string.length;\n if (string.length % 2 === 0) {\n stringIndex = string.length / 2;\n } else {\n stringIndex = (string.length - 1) / 2;\n console.log(\"This is an odd string number:\")\n }\n return string[stringIndex];\n}", "function getCorrectWord(word, wordIndex, text) {\n if (word === \"your\") {\n if (text.substring(wordIndex, wordIndex + word.length + 2) === \"your a \") {\n // Assume they're trying to say \"you're a ___\"\n return \"you're\";\n }\n if (text.substring(wordIndex, wordIndex + word.length + 3) === \"your an \") {\n // Assume they're trying to say \"you're an ___\"\n return \"you're\";\n }\n if (text.substring(wordIndex, wordIndex + word.length + 3) === \"your my \") {\n // Assume they're trying to say \"you're my ___\"\n return \"you're\";\n }\n if (text.substring(wordIndex, wordIndex + word.length + 4) === \"your the \") {\n // Assume they're trying to say \"you're the ___\"\n return \"you're\";\n }\n }\n if (word === \"youre\") {\n // This is just a misspelling\n return \"you're\";\n }\n return null;\n}", "function findMiddleIndex(text){\n var text = \"Hello\"; \n var length = text.length;\n console.log(Math.floor(length / 2));\n}", "function phrase() {\n return wrap('phrase', or(obsPhrase, star(word, 1))());\n }", "function phrase() {\n return wrap('phrase', or(obsPhrase, star(word, 1))());\n }", "function phrase() {\n return wrap('phrase', or(obsPhrase, star(word, 1))());\n }", "function phrase() {\n return wrap('phrase', or(obsPhrase, star(word, 1))());\n }", "function processWord(word) {\n var optimalRecognitionposition = Math.floor(word.length / 3),\n letters = word.split('')\n return letters.map(function(letter, idx) {\n if (idx === optimalRecognitionposition)\n return '<span class=\"highlight\">' + letter + '</span>'\n return letter;\n }).join('')\n }", "function teachManners(phrase) {\n return phrase.toLowerCase().replace(exclamations, '');\n\n}", "step3a (word) {\n let result = word\n if (endsin(result, 'heid') && result.length - 4 >= this.r2 && result[result.length - 5] !== 'c') {\n // Delete\n result = removeSuffix(result, 4)\n // Treat a preceding en as in step 1b\n result = this.step1b(result, ['en'])\n }\n if (DEBUG) {\n console.log('step 3a: ' + result)\n }\n return result\n }", "function getFirstWord(selection) {\n if (selection.indexOf(' ') === -1)\n return selection;\n else\n return selection.substr(0, selection.indexOf(' '));\n }", "function getMiddle(s)\n{\ns = s.split('')\nreturn (s.length%2 !==0) ? s[Math.floor(s.length/2)] : s[(s.length/2)-1]+s[(s.length/2)]\n}", "function makespeakable(phrase) {\n phrase = phrase.replace(/['\"]/g, \"\");\n phrase = phrase.replace(/[-+]/g, \" \");\n phrase = phrase.replace(/([A-Z])(?=[A-Z])/g, \"$1 \"); //split apart capitals\n phrase = phrase.replace(/([A-Za-z])([0-9])/g, \"$1 $2\"); // split letter-number\n phrase = phrase.replace(/([0-9])([A-Za-z])/g, \"$1 $2\"); // split number-letter\n return phrase.replace(/\\b[A-Z](?=[[:space:][:punct:]])/g, function(match) {\n return say_letter[match.toUpperCase()];\n })\n .replace(/[0-9]+ ?(st|nd|rd|th)\\b/g, function(match) {\n return n2w.toOrdinalWords(parseInt(match)).replace(/[-,]/g, \" \");\n })\n .replace(/[0-9]+/g, function(match) {\n return n2w.toWords(match).replace(/[-,]/g, \" \");\n });\n}", "function getMiddle(s) {\n //Code goes here!\n const strArray = s.split('')\n const evenLength = s.length % 2 === 0\n\n if (evenLength) {\n const half = strArray.length / 2\n return `${strArray[half - 1]}${strArray[half]}`\n }\n\n const half = Math.floor(strArray.length / 2)\n return strArray[half]\n}", "function spEng(sentence){\n//write your code here\n\n let english = \"english\"\n\n let first = 0\n\n let second = 0\n\n console.log(sentence)\n\n let lower = sentence.toLowerCase()\n\n// let look = sentence.split(\"\").map( (x, y) => sentence[y].toLowerCase() == english.split(\"\").map( x => x) ? true: false)\n\n// console.log(\"Word: \", sentence, \"split: \", sentence.split(\"\"), \"map: \", look)\n\n for(let i = 0; i < sentence.length; i++){\n\n if(lower[i] == \"e\"){\n\n first = i\n\n console.log(\"first: \", lower[i], first, sentence.length)\n\n }\n\n if(lower[i] == \"h\"){\n\n second = i + 1\n\n console.log(\"second: \", sentence[i], second)\n\n }\n\n\n if(lower.substring(first, second) == english){\n\n return true;\n\n }\n\n\n\n }\n\n return false;\n\n\n}", "function getFirstWord(str) {\n\t\tstr = str.replace('By ', '');\n if (str.indexOf(' ') === -1)\n return str;\n else\n return str.substr(0, str.indexOf(' '));\n }", "function firstWord (text) {\n let firstBlank = text.indexOf(' ');\n \n let fWord = text.substr(0, firstBlank);\n return fWord;\n}", "function getMiddle(s) {\n return s.substring(Math.ceil(s.length/2)-1, Math.floor(s.length/2) + 1);\n}", "function parseWords(text)\n{\n\n\t//return elements\n\tvar returnBuf = \"\";\n\n\t//split input string with RegExo\n\tvar tokens = text.match(spaceRegEx);\n\tvar substrL = 0;\n\n\tfor (i in tokens) //JRO - hack to only process one token at a time\n\t{\n\t\t//If the element isn't the last in an array, it is a new word\n\t\t//if ((i<tokens.length - 1) && tokens[i] !== \"\")\n\t\tif ((i == 0) && (i<tokens.length - 1) && tokens[i] !== \"\") //JRO - hack to only process one token at a time\n\t\t//if ((i == 0) && (i<tokens.length - 1))\n\t\t{\n\t\t\tvar tok = tokens[i];\n\t\t\t\n\t\t\t//console.log(\"\");\n\t\t\t//console.log(\"tok:\"+tok + \" l:\"+tok.length );\n\n\t\t\tsubstrL += tokens[i].length+1;\n\n\t\t\t// strip any leading punctuation\n\t\t\tvar leadPunct = tok.match(leadPunctRegEx);\n\t\t\tif (leadPunct) {\n\t\t\t\t//NOTE: substring was not working correctly ... might actually be length that was off\n\t\t\t\t//using replace instead\n\t\t\t\ttok = tok.replace(leadPunct, \"\");\n\t\t\t\t//console.log('lead p ' + leadPunct);\n\t\t\t}\n\t\t\t//console.log(\"tok1:\"+tok);\n\n\t\t\t// pull any numbers\n\n\t\t\tvar word;\n\t\t\tvar sentenceEnd = false;\n\n\t\t\tvar numWord = tok.match(numberRegEx);\n\t\t\tif (numWord) {\n\t\t\t\t//console.log('number');\n\t\t\t\tword = numWord;\n\t\t\t}\n\t\t\t//console.log(\"tok2:\"+tok);\n\n\t\t\t// pull any abbreviations\n\t\t\t// PEND: broken \n\t\t\tvar abbrevWord = tok.match(abbrevRegEx);\n\t\t\tif (abbrevWord && !word) {\n\t\t\t\t//console.log('abbrev');\n\t\t\t\tword = abbrevWord;\n\t\t\t}\n\t\t\t//console.log(\"tok3:\"+tok);\n\n\t\t\t// pull out word\n\t\t\tvar plainWord = tok.match(wordRegEx);\n\t\t\tif (plainWord && !word) {\n\t\t\t\tword = plainWord;\n\t\t\t}\n\t\t\t//console.log(\"tok4:\"+tok);\n\n\t\t\t//if (word) console.log(\"Word: \" + word);\n\n\t\t\t//look for final punctutation, the leftovers\n\t\t\tvar endPunct = tok.replace(word, \"\");\n\t\t\t//if (endPunct) console.log('punct ' + endPunct);\n\n\t\t\t// check if sentence end\n\t\t\tif (endPunct.search(sentenceEndRegEx) != -1) {\n\t\t\t\tsentenceEnd = true;\n\t\t\t\t//console.log('END SENTENCE');\n\t\t\t}\n\n\t\t\tvar speakerSwitch = false;\n\n\t\t\t//spealer switching handled with special words\n\t\t\tif (word && common.usingDoc)\n\t\t\t{\t\t\t\n\t\t\t\tif (word == \"MODERATOR\" || word == \"QUESTION\" || word == \"BROKAW\" || word == \"IFILL\" || word == \"LEHRER\" || word == \"RADDATZ\") {\n\t\t\t\t\tcurSpeaker = 0;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t\telse if (word == \"OBAMA\" || word == \"BIDEN\") {\n\t\t\t\t\tcurSpeaker = 1;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t\telse if (word == \"MCCAIN\" || word == \"ROMNEY\" || word == \"PALIN\" || word == \"RYAN\") {\n\t\t\t\t\tcurSpeaker = 2;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//words for live uploading\n\t\t\telse if (word)\n\t\t\t{\n\t\t\t\tif (word == \"SPEAKER_MODERATOR\") {\n\t\t\t\t\tcurSpeaker = 0;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t\telse if (word == \"SPEAKER_OBAMA\") {\n\t\t\t\t\tcurSpeaker = 1;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t\telse if (word == \"SPEAKER_ROMNEY\") {\n\t\t\t\t\tcurSpeaker = 2;\n\t\t\t\t\tspeakerSwitch = true;\n\t\t\t\t}\n\t\t\t}\n\n\n\t\t\tif (!speakerSwitch)\n\t\t\t{\n\t\t\t\tif (common.dbUnlocked()) {\n\t\t\t\t\tif (!common.usingDoc) {\n\t\t\t\t\t\tnamedentity(word, sentenceStartF, function(resp) {\n\t\t\t\t\t\t\thandleWord(curSpeaker, leadPunct, resp, endPunct, sentenceEnd, speakerSwitch); \n\t\t\t\t\t\t});\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (word)\n\t\t\t\t\t\t\thandleWord(curSpeaker, leadPunct, word.toString(), endPunct, sentenceEnd, speakerSwitch); \n\t\t\t\t\t}\n\t\t\t\t} //else console.log ('parseWords(): DB is Locked, not adding data');\n\t\t\t}\n\n\n\t\t}\n\t\t//Otherwise this should be returned as part of the buffer\n\t\telse {\n\t\t\treturnBuf = text.substring(substrL);\n\t\t}\n\t}\n\n\t//return both the current buffer and the found words\n\treturn returnBuf;\n\n}", "function doubleMetaphone(value) {\n var primary = ''\n var secondary = ''\n var index = 0\n var length = value.length\n var last = length - 1\n var isSlavoGermanic\n var isGermanic\n var subvalue\n var next\n var prev\n var nextnext\n var characters\n\n value = String(value).toUpperCase() + ' '\n isSlavoGermanic = slavoGermanic.test(value)\n isGermanic = germanic.test(value)\n characters = value.split('')\n\n // Skip this at beginning of word.\n if (initialExceptions.test(value)) {\n index++\n }\n\n // Initial X is pronounced Z, which maps to S. Such as `Xavier`.\n if (characters[0] === 'X') {\n primary += 'S'\n secondary += 'S'\n index++\n }\n\n while (index < length) {\n prev = characters[index - 1]\n next = characters[index + 1]\n nextnext = characters[index + 2]\n\n switch (characters[index]) {\n case 'A':\n case 'E':\n case 'I':\n case 'O':\n case 'U':\n case 'Y':\n case 'À':\n case 'Ê':\n case 'É':\n if (index === 0) {\n // All initial vowels now map to `A`.\n primary += 'A'\n secondary += 'A'\n }\n\n index++\n\n break\n case 'B':\n primary += 'P'\n secondary += 'P'\n\n if (next === 'B') {\n index++\n }\n\n index++\n\n break\n case 'Ç':\n primary += 'S'\n secondary += 'S'\n index++\n\n break\n case 'C':\n // Various Germanic:\n if (\n prev === 'A' &&\n next === 'H' &&\n nextnext !== 'I' &&\n !vowels.test(characters[index - 2]) &&\n (nextnext !== 'E' ||\n (subvalue =\n value.slice(index - 2, index + 4) &&\n (subvalue === 'BACHER' || subvalue === 'MACHER')))\n ) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Special case for `Caesar`.\n if (index === 0 && value.slice(index + 1, index + 6) === 'AESAR') {\n primary += 'S'\n secondary += 'S'\n index += 2\n\n break\n }\n\n // Italian `Chianti`.\n if (value.slice(index + 1, index + 4) === 'HIA') {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n if (next === 'H') {\n // Find `Michael`.\n if (index > 0 && nextnext === 'A' && characters[index + 3] === 'E') {\n primary += 'K'\n secondary += 'X'\n index += 2\n\n break\n }\n\n // Greek roots such as `chemistry`, `chorus`.\n if (index === 0 && initialGreekCh.test(value)) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Germanic, Greek, or otherwise `CH` for `KH` sound.\n if (\n isGermanic ||\n // Such as 'architect' but not 'arch', orchestra', 'orchid'.\n greekCh.test(value.slice(index - 2, index + 4)) ||\n (nextnext === 'T' || nextnext === 'S') ||\n ((index === 0 ||\n prev === 'A' ||\n prev === 'E' ||\n prev === 'O' ||\n prev === 'U') &&\n // Such as `wachtler`, `weschsler`, but not `tichner`.\n chForKh.test(nextnext))\n ) {\n primary += 'K'\n secondary += 'K'\n } else if (index === 0) {\n primary += 'X'\n secondary += 'X'\n // Such as 'McHugh'.\n } else if (value.slice(0, 2) === 'MC') {\n // Bug? Why matching absolute? what about McHiccup?\n primary += 'K'\n secondary += 'K'\n } else {\n primary += 'X'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n // Such as `Czerny`.\n if (next === 'Z' && value.slice(index - 2, index) !== 'WI') {\n primary += 'S'\n secondary += 'X'\n index += 2\n\n break\n }\n\n // Such as `Focaccia`.\n if (value.slice(index + 1, index + 4) === 'CIA') {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n // Double `C`, but not `McClellan`.\n if (next === 'C' && !(index === 1 && characters[0] === 'M')) {\n // Such as `Bellocchio`, but not `Bacchus`.\n if (\n (nextnext === 'I' || nextnext === 'E' || nextnext === 'H') &&\n value.slice(index + 2, index + 4) !== 'HU'\n ) {\n subvalue = value.slice(index - 1, index + 4)\n\n // Such as `Accident`, `Accede`, `Succeed`.\n if (\n (index === 1 && prev === 'A') ||\n subvalue === 'UCCEE' ||\n subvalue === 'UCCES'\n ) {\n primary += 'KS'\n secondary += 'KS'\n // Such as `Bacci`, `Bertucci`, other Italian.\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 3\n\n break\n } else {\n // Pierce's rule.\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n }\n\n if (next === 'G' || next === 'K' || next === 'Q') {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Italian.\n if (\n next === 'I' &&\n // Bug: The original algorithm also calls for A (as in CIA), which is\n // already taken care of above.\n (nextnext === 'E' || nextnext === 'O')\n ) {\n primary += 'S'\n secondary += 'X'\n index += 2\n\n break\n }\n\n if (next === 'I' || next === 'E' || next === 'Y') {\n primary += 'S'\n secondary += 'S'\n index += 2\n\n break\n }\n\n primary += 'K'\n secondary += 'K'\n\n // Skip two extra characters ahead in `Mac Caffrey`, `Mac Gregor`.\n if (\n next === ' ' &&\n (nextnext === 'C' || nextnext === 'G' || nextnext === 'Q')\n ) {\n index += 3\n break\n }\n\n // Bug: Already covered above.\n // if (\n // next === 'K' ||\n // next === 'Q' ||\n // (next === 'C' && nextnext !== 'E' && nextnext !== 'I')\n // ) {\n // index++;\n // }\n\n index++\n\n break\n case 'D':\n if (next === 'G') {\n // Such as `edge`.\n if (nextnext === 'E' || nextnext === 'I' || nextnext === 'Y') {\n primary += 'J'\n secondary += 'J'\n index += 3\n // Such as `Edgar`.\n } else {\n primary += 'TK'\n secondary += 'TK'\n index += 2\n }\n\n break\n }\n\n if (next === 'T' || next === 'D') {\n primary += 'T'\n secondary += 'T'\n index += 2\n\n break\n }\n\n primary += 'T'\n secondary += 'T'\n index++\n\n break\n case 'F':\n if (next === 'F') {\n index++\n }\n\n index++\n primary += 'F'\n secondary += 'F'\n\n break\n case 'G':\n if (next === 'H') {\n if (index > 0 && !vowels.test(prev)) {\n primary += 'K'\n secondary += 'K'\n index += 2\n\n break\n }\n\n // Such as `Ghislane`, `Ghiradelli`.\n if (index === 0) {\n if (nextnext === 'I') {\n primary += 'J'\n secondary += 'J'\n } else {\n primary += 'K'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n // Parker's rule (with some further refinements).\n if (\n // Such as `Hugh`. The comma is not a bug.\n ((subvalue = characters[index - 2]),\n subvalue === 'B' || subvalue === 'H' || subvalue === 'D') ||\n // Such as `bough`. The comma is not a bug.\n ((subvalue = characters[index - 3]),\n subvalue === 'B' || subvalue === 'H' || subvalue === 'D') ||\n // Such as `Broughton`. The comma is not a bug.\n ((subvalue = characters[index - 4]),\n subvalue === 'B' || subvalue === 'H')\n ) {\n index += 2\n\n break\n }\n\n // Such as `laugh`, `McLaughlin`, `cough`, `gough`, `rough`, `tough`.\n if (index > 2 && prev === 'U' && gForF.test(characters[index - 3])) {\n primary += 'F'\n secondary += 'F'\n } else if (index > 0 && prev !== 'I') {\n primary += 'K'\n secondary += 'K'\n }\n\n index += 2\n\n break\n }\n\n if (next === 'N') {\n if (index === 1 && vowels.test(characters[0]) && !isSlavoGermanic) {\n primary += 'KN'\n secondary += 'N'\n // Not like `Cagney`.\n } else if (\n value.slice(index + 2, index + 4) !== 'EY' &&\n value.slice(index + 1) !== 'Y' &&\n !isSlavoGermanic\n ) {\n primary += 'N'\n secondary += 'KN'\n } else {\n primary += 'KN'\n secondary += 'KN'\n }\n\n index += 2\n\n break\n }\n\n // Such as `Tagliaro`.\n if (value.slice(index + 1, index + 3) === 'LI' && !isSlavoGermanic) {\n primary += 'KL'\n secondary += 'L'\n index += 2\n\n break\n }\n\n // -ges-, -gep-, -gel- at beginning.\n if (index === 0 && initialGForKj.test(value.slice(1, 3))) {\n primary += 'K'\n secondary += 'J'\n index += 2\n\n break\n }\n\n // -ger-, -gy-.\n if (\n (value.slice(index + 1, index + 3) === 'ER' &&\n prev !== 'I' &&\n prev !== 'E' &&\n !initialAngerException.test(value.slice(0, 6))) ||\n (next === 'Y' && !gForKj.test(prev))\n ) {\n primary += 'K'\n secondary += 'J'\n index += 2\n\n break\n }\n\n // Italian such as `biaggi`.\n if (\n next === 'E' ||\n next === 'I' ||\n next === 'Y' ||\n ((prev === 'A' || prev === 'O') && next === 'G' && nextnext === 'I')\n ) {\n // Obvious Germanic.\n if (value.slice(index + 1, index + 3) === 'ET' || isGermanic) {\n primary += 'K'\n secondary += 'K'\n } else {\n primary += 'J'\n\n // Always soft if French ending.\n if (value.slice(index + 1, index + 5) === 'IER ') {\n secondary += 'J'\n } else {\n secondary += 'K'\n }\n }\n\n index += 2\n\n break\n }\n\n if (next === 'G') {\n index++\n }\n\n index++\n\n primary += 'K'\n secondary += 'K'\n\n break\n case 'H':\n // Only keep if first & before vowel or btw. 2 vowels.\n if (vowels.test(next) && (index === 0 || vowels.test(prev))) {\n primary += 'H'\n secondary += 'H'\n\n index++\n }\n\n index++\n\n break\n case 'J':\n // Obvious Spanish, `jose`, `San Jacinto`.\n if (\n value.slice(index, index + 4) === 'JOSE' ||\n value.slice(0, 4) === 'SAN '\n ) {\n if (\n value.slice(0, 4) === 'SAN ' ||\n (index === 0 && characters[index + 4] === ' ')\n ) {\n primary += 'H'\n secondary += 'H'\n } else {\n primary += 'J'\n secondary += 'H'\n }\n\n index++\n\n break\n }\n\n if (\n index === 0\n // Bug: unreachable (see previous statement).\n // && value.slice(index, index + 4) !== 'JOSE'.\n ) {\n primary += 'J'\n\n // Such as `Yankelovich` or `Jankelowicz`.\n secondary += 'A'\n // Spanish pron. of such as `bajador`.\n } else if (\n !isSlavoGermanic &&\n (next === 'A' || next === 'O') &&\n vowels.test(prev)\n ) {\n primary += 'J'\n secondary += 'H'\n } else if (index === last) {\n primary += 'J'\n } else if (\n prev !== 'S' &&\n prev !== 'K' &&\n prev !== 'L' &&\n !jForJException.test(next)\n ) {\n primary += 'J'\n secondary += 'J'\n // It could happen.\n } else if (next === 'J') {\n index++\n }\n\n index++\n\n break\n case 'K':\n if (next === 'K') {\n index++\n }\n\n primary += 'K'\n secondary += 'K'\n index++\n\n break\n case 'L':\n if (next === 'L') {\n // Spanish such as `cabrillo`, `gallegos`.\n if (\n (index === length - 3 &&\n ((prev === 'A' && nextnext === 'E') ||\n (prev === 'I' && (nextnext === 'O' || nextnext === 'A')))) ||\n (prev === 'A' &&\n nextnext === 'E' &&\n (characters[last] === 'A' ||\n characters[last] === 'O' ||\n alle.test(value.slice(last - 1, length))))\n ) {\n primary += 'L'\n index += 2\n\n break\n }\n\n index++\n }\n\n primary += 'L'\n secondary += 'L'\n index++\n\n break\n case 'M':\n if (\n next === 'M' ||\n // Such as `dumb`, `thumb`.\n (prev === 'U' &&\n next === 'B' &&\n (index + 1 === last || value.slice(index + 2, index + 4) === 'ER'))\n ) {\n index++\n }\n\n index++\n primary += 'M'\n secondary += 'M'\n\n break\n case 'N':\n if (next === 'N') {\n index++\n }\n\n index++\n primary += 'N'\n secondary += 'N'\n\n break\n case 'Ñ':\n index++\n primary += 'N'\n secondary += 'N'\n\n break\n case 'P':\n if (next === 'H') {\n primary += 'F'\n secondary += 'F'\n index += 2\n\n break\n }\n\n // Also account for `campbell` and `raspberry`.\n subvalue = next\n\n if (subvalue === 'P' || subvalue === 'B') {\n index++\n }\n\n index++\n\n primary += 'P'\n secondary += 'P'\n\n break\n case 'Q':\n if (next === 'Q') {\n index++\n }\n\n index++\n primary += 'K'\n secondary += 'K'\n\n break\n case 'R':\n // French such as `Rogier`, but exclude `Hochmeier`.\n if (\n index === last &&\n !isSlavoGermanic &&\n prev === 'E' &&\n characters[index - 2] === 'I' &&\n characters[index - 4] !== 'M' &&\n (characters[index - 3] !== 'E' && characters[index - 3] !== 'A')\n ) {\n secondary += 'R'\n } else {\n primary += 'R'\n secondary += 'R'\n }\n\n if (next === 'R') {\n index++\n }\n\n index++\n\n break\n case 'S':\n // Special cases `island`, `isle`, `carlisle`, `carlysle`.\n if (next === 'L' && (prev === 'I' || prev === 'Y')) {\n index++\n\n break\n }\n\n // Special case `sugar-`.\n if (index === 0 && value.slice(1, 5) === 'UGAR') {\n primary += 'X'\n secondary += 'S'\n index++\n\n break\n }\n\n if (next === 'H') {\n // Germanic.\n if (hForS.test(value.slice(index + 1, index + 5))) {\n primary += 'S'\n secondary += 'S'\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 2\n break\n }\n\n if (\n next === 'I' &&\n (nextnext === 'O' || nextnext === 'A')\n // Bug: Already covered by previous branch\n // || value.slice(index, index + 4) === 'SIAN'\n ) {\n if (isSlavoGermanic) {\n primary += 'S'\n secondary += 'S'\n } else {\n primary += 'S'\n secondary += 'X'\n }\n\n index += 3\n\n break\n }\n\n // German & Anglicization's, such as `Smith` match `Schmidt`, `snider`\n // match `Schneider`. Also, -sz- in slavic language although in\n // hungarian it is pronounced `s`.\n if (\n next === 'Z' ||\n (index === 0 &&\n (next === 'L' || next === 'M' || next === 'N' || next === 'W'))\n ) {\n primary += 'S'\n secondary += 'X'\n\n if (next === 'Z') {\n index++\n }\n\n index++\n\n break\n }\n\n if (next === 'C') {\n // Schlesinger's rule.\n if (nextnext === 'H') {\n subvalue = value.slice(index + 3, index + 5)\n\n // Dutch origin, such as `school`, `schooner`.\n if (dutchSch.test(subvalue)) {\n // Such as `schermerhorn`, `schenker`.\n if (subvalue === 'ER' || subvalue === 'EN') {\n primary += 'X'\n secondary += 'SK'\n } else {\n primary += 'SK'\n secondary += 'SK'\n }\n\n index += 3\n\n break\n }\n\n if (\n index === 0 &&\n !vowels.test(characters[3]) &&\n characters[3] !== 'W'\n ) {\n primary += 'X'\n secondary += 'S'\n } else {\n primary += 'X'\n secondary += 'X'\n }\n\n index += 3\n\n break\n }\n\n if (nextnext === 'I' || nextnext === 'E' || nextnext === 'Y') {\n primary += 'S'\n secondary += 'S'\n index += 3\n break\n }\n\n primary += 'SK'\n secondary += 'SK'\n index += 3\n\n break\n }\n\n subvalue = value.slice(index - 2, index)\n\n // French such as `resnais`, `artois`.\n if (index === last && (subvalue === 'AI' || subvalue === 'OI')) {\n secondary += 'S'\n } else {\n primary += 'S'\n secondary += 'S'\n }\n\n if (\n next === 'S'\n // Bug: already taken care of by `German & Anglicization's` above:\n // || next === 'Z'\n ) {\n index++\n }\n\n index++\n\n break\n case 'T':\n if (next === 'I' && nextnext === 'O' && characters[index + 3] === 'N') {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n subvalue = value.slice(index + 1, index + 3)\n\n if (\n (next === 'I' && nextnext === 'A') ||\n (next === 'C' && nextnext === 'H')\n ) {\n primary += 'X'\n secondary += 'X'\n index += 3\n\n break\n }\n\n if (next === 'H' || (next === 'T' && nextnext === 'H')) {\n // Special case `Thomas`, `Thames` or Germanic.\n if (\n isGermanic ||\n ((nextnext === 'O' || nextnext === 'A') &&\n characters[index + 3] === 'M')\n ) {\n primary += 'T'\n secondary += 'T'\n } else {\n primary += '0'\n secondary += 'T'\n }\n\n index += 2\n\n break\n }\n\n if (next === 'T' || next === 'D') {\n index++\n }\n\n index++\n primary += 'T'\n secondary += 'T'\n\n break\n case 'V':\n if (next === 'V') {\n index++\n }\n\n primary += 'F'\n secondary += 'F'\n index++\n\n break\n case 'W':\n // Can also be in middle of word (as already taken care of for initial).\n if (next === 'R') {\n primary += 'R'\n secondary += 'R'\n index += 2\n\n break\n }\n\n if (index === 0) {\n // `Wasserman` should match `Vasserman`.\n if (vowels.test(next)) {\n primary += 'A'\n secondary += 'F'\n } else if (next === 'H') {\n // Need `Uomo` to match `Womo`.\n primary += 'A'\n secondary += 'A'\n }\n }\n\n // `Arnow` should match `Arnoff`.\n if (\n ((prev === 'E' || prev === 'O') &&\n next === 'S' &&\n nextnext === 'K' &&\n (characters[index + 3] === 'I' || characters[index + 3] === 'Y')) ||\n // Maybe a bug? Shouldn't this be general Germanic?\n value.slice(0, 3) === 'SCH' ||\n (index === last && vowels.test(prev))\n ) {\n secondary += 'F'\n index++\n\n break\n }\n\n // Polish such as `Filipowicz`.\n if (\n next === 'I' &&\n (nextnext === 'C' || nextnext === 'T') &&\n characters[index + 3] === 'Z'\n ) {\n primary += 'TS'\n secondary += 'FX'\n index += 4\n\n break\n }\n\n index++\n\n break\n case 'X':\n // French such as `breaux`.\n if (\n !(\n index === last &&\n // Bug: IAU and EAU also match by AU\n // (/IAU|EAU/.test(value.slice(index - 3, index))) ||\n (prev === 'U' &&\n (characters[index - 2] === 'A' || characters[index - 2] === 'O'))\n )\n ) {\n primary += 'KS'\n secondary += 'KS'\n }\n\n if (next === 'C' || next === 'X') {\n index++\n }\n\n index++\n\n break\n case 'Z':\n // Chinese pinyin such as `Zhao`.\n if (next === 'H') {\n primary += 'J'\n secondary += 'J'\n index += 2\n\n break\n } else if (\n (next === 'Z' &&\n (nextnext === 'A' || nextnext === 'I' || nextnext === 'O')) ||\n (isSlavoGermanic && index > 0 && prev !== 'T')\n ) {\n primary += 'S'\n secondary += 'TS'\n } else {\n primary += 'S'\n secondary += 'S'\n }\n\n if (next === 'Z') {\n index++\n }\n\n index++\n\n break\n default:\n index++\n }\n }\n\n return [primary, secondary]\n}", "function isWordFound(phrase, word) {\n var tokenObjs = nlp.tokenize(phrase);\n //console.log(\"tokenObjs = \", tokenObjs);\n var tokens = tokenObjs[0].tokens.map(obj => obj.text);\n //console.log(\"tokens = \", tokens);\n return (tokens.indexOf(word) !== -1);\n }", "function shortestWord(sentence) {\n//Declaring variables used in the function shortestWord\n var wordSeparator = sentence.split(' ');\n var shortestLenth = wordSeparator.length;\n var shoterWord = ' ';\n //for loop to run from 0 to length of string sentence\n for (var i=0;i<wordSeparator.length;i++) {\n if (wordSeparator[i].length < shortestLenth) {\n shoterWord = wordSeparator[i];\n }\n }\n return shoterWord;\n}", "function i_am_making_wordsStartsWithVowel_bolder() {\n var str = \"what ever i am writing here or have wrote this is all my (first) imagination (second) creation, words with all 5 vowels, which i got from dictionary one by one page, i think all will enjoy and increase knowledge thats my education.\";\n var s = '';\n var spaceFlag = 0;\n var capitalFlag = 0;\n for (var i = 0; i < str.length; i++) {\n if (spaceFlag == 1 || i == 0) {\n if (str[i].toLowerCase() == 'a' ||\n str[i].toLowerCase() == 'e' ||\n str[i].toLowerCase() == 'i' ||\n str[i].toLowerCase() == 'o' ||\n str[i].toLowerCase() == 'u') {\n capitalFlag = 1;\n }\n }\n if (str[i] == \" \" && spaceFlag == 0) {\n spaceFlag = 1;\n capitalFlag = 0;\n }\n else if (str[i] != \" \") {\n spaceFlag = 0;\n }\n if (capitalFlag == 1) {\n s += str[i].toUpperCase();\n }\n\n else {\n s += str[i];\n }\n\n }\n return s;\n}", "function tokenizeWord(word, callback) {\n \"use strict\";\n var match, parts = [], stemmedPart, singularPart, singularMetaphones, stemmedMetaphones, token;\n\n // TODO: Improve that. Should be in the stemmer actually\n //if (-1 === (match = word.match(/^([#\"',;:!?(.\\[{])*([a-z0-9]+)+([,;:!?)\\]}\"'.])*$/i))) {\n // return callback(null, []);\n //}\n //if (!match) {\n // return callback(null, []);\n //}\n //word = match[2] || \"\";\n\n word = word || \"\";\n if (-1 === word.search(/^[a-z]*$/i) || word.length < 3) {\n return callback(null, []);\n }\n\n token = word.toUpperCase().trim();\n\n // TODO: Decide which stopwords to use depending on the given language\n var stopwordsEn = stopwords.en;\n\n // we skip stopwords\n if (stopwordsEn.indexOf(token) >= 0) {\n return callback(null, []);\n }\n\n parts.push(token);\n\n // TODO: Decide which stemmer to use depending on the given language\n stemmedPart = stemmer.stem(token) || \"\";\n\n if (stemmedPart.length > 2) {\n // calc double metaphone of the stemmed word\n stemmedMetaphones = doubleMetaphone.process(stemmedPart);\n //console.log(\"stemmed Metaphones for \" + token + \" \" + stemmedMetaphones);\n if (stemmedMetaphones[0].length > 1) {\n parts.push((stemmedMetaphones[0] || \"\").trim());\n }\n if (stemmedMetaphones[1].length > 1) {\n parts.push((stemmedMetaphones[1] || \"\").trim());\n }\n }\n // the last element is the original uppercased stemmed token\n parts.push(stemmedPart.toUpperCase().trim());\n\n // Singularize word\n singularPart = nounInflector.singularize(token) || \"\";\n if (singularPart.length > 2) {\n // calc double metaphone of singular\n singularMetaphones = doubleMetaphone.process(singularPart);\n //console.log(\"singular Metaphones for \" + token + \" \" + stemmedMetaphones);\n if (singularMetaphones[0].length > 1) {\n parts.push((singularMetaphones[0] || \"\").trim());\n }\n if (singularMetaphones[1].length > 1) {\n parts.push((singularMetaphones[1] || \"\").trim());\n }\n }\n parts.push(singularPart.toUpperCase().trim());\n\n parts.sort();\n parts = underscore.uniq(parts, true);\n\n process.nextTick(function () {\n callback(null, parts);\n });\n}", "function getMiddle(string){\n if(string.length % 2 !== 0) {\n return string.charAt(string.length/2);\n } else {\n var mean = string.length/2;\n var mid1 = string.charAt(mean-1);\n var mid2 = string.charAt((mean));\n return mid1+mid2;\n }\n}", "function stemm (word) {\n /*\n Put u and y between vowels into upper case\n */\n word = word.replace(/([aeiouyäöü])u([aeiouyäöü])/g, '$1U$2')\n word = word.replace(/([aeiouyäöü])y([aeiouyäöü])/g, '$1Y$2')\n\n /*\n and then do the following mappings,\n (a) replace ß with ss,\n (a) replace ae with ä, Not doing these,\n have trouble with diphtongs\n (a) replace oe with ö, Not doing these,\n have trouble with diphtongs\n (a) replace ue with ü unless preceded by q. Not doing these,\n have trouble with diphtongs\n So in quelle, ue is not mapped to ü because it follows q, and in\n feuer it is not mapped because the first part of the rule changes it to\n feUer, so the u is not found.\n */\n word = word.replace(/ß/g, 'ss')\n // word = word.replace(/ae/g, 'ä');\n // word = word.replace(/oe/g, 'ö');\n // word = word.replace(/([^q])ue/g, '$1ü');\n\n /*\n R1 and R2 are first set up in the standard way (see the note on R1\n and R2), but then R1 is adjusted so that the region before it contains at\n least 3 letters.\n R1 is the region after the first non-vowel following a vowel, or is\n the null region at the end of the word if there is no such non-vowel.\n R2 is the region after the first non-vowel following a vowel in R1,\n or is the null region at the end of the word if there is no such non-vowel.\n */\n\n let r1Index = word.search(/[aeiouyäöü][^aeiouyäöü]/)\n let r1 = ''\n if (r1Index !== -1) {\n r1Index += 2\n r1 = word.substring(r1Index)\n }\n\n let r2Index = -1\n // let r2 = ''\n\n if (r1Index !== -1) {\n r2Index = r1.search(/[aeiouyäöü][^aeiouyäöü]/)\n if (r2Index !== -1) {\n r2Index += 2\n // r2 = r1.substring(r2Index)\n r2Index += r1Index\n } else {\n // r2 = ''\n }\n }\n\n if (r1Index !== -1 && r1Index < 3) {\n r1Index = 3\n r1 = word.substring(r1Index)\n }\n\n /*\n Define a valid s-ending as one of b, d, f, g, h, k, l, m, n, r or t.\n Define a valid st-ending as the same list, excluding letter r.\n */\n\n /*\n Do each of steps 1, 2 and 3.\n */\n\n /*\n Step 1:\n Search for the longest among the following suffixes,\n (a) em ern er\n (b) e en es\n (c) s (preceded by a valid s-ending)\n */\n const a1Index = word.search(/(em|ern|er)$/g)\n const b1Index = word.search(/(e|en|es)$/g)\n let c1Index = word.search(/([bdfghklmnrt]s)$/g)\n if (c1Index !== -1) {\n c1Index++\n }\n let index1 = 10000\n let optionUsed1 = ''\n if (a1Index !== -1 && a1Index < index1) {\n optionUsed1 = 'a'\n index1 = a1Index\n }\n if (b1Index !== -1 && b1Index < index1) {\n optionUsed1 = 'b'\n index1 = b1Index\n }\n if (c1Index !== -1 && c1Index < index1) {\n optionUsed1 = 'c'\n index1 = c1Index\n }\n\n /*\n and delete if in R1. (Of course the letter of the valid s-ending is\n not necessarily in R1.) If an ending of group (b) is deleted, and the ending\n is preceded by niss, delete the final s.\n (For example, äckern -> äck, ackers -> acker, armes -> arm,\n bedürfnissen -> bedürfnis)\n */\n\n if (index1 !== 10000 && r1Index !== -1) {\n if (index1 >= r1Index) {\n word = word.substring(0, index1)\n if (optionUsed1 === 'b') {\n if (word.search(/niss$/) !== -1) {\n word = word.substring(0, word.length - 1)\n }\n }\n }\n }\n\n /*\n Step 2:\n Search for the longest among the following suffixes,\n (a) en er est\n (b) st (preceded by a valid st-ending, itself preceded by at least 3\n letters)\n */\n\n const a2Index = word.search(/(en|er|est)$/g)\n let b2Index = word.search(/(.{3}[bdfghklmnt]st)$/g)\n if (b2Index !== -1) {\n b2Index += 4\n }\n\n let index2 = 10000\n // const optionUsed2 = ''\n if (a2Index !== -1 && a2Index < index2) {\n // optionUsed2 = 'a'\n index2 = a2Index\n }\n if (b2Index !== -1 && b2Index < index2) {\n // optionUsed2 = 'b'\n index2 = b2Index\n }\n\n /*\n and delete if in R1.\n (For example, derbsten -> derbst by step 1, and derbst -> derb by\n step 2, since b is a valid st-ending, and is preceded by just 3 letters)\n */\n\n if (index2 !== 10000 && r1Index !== -1) {\n if (index2 >= r1Index) {\n word = word.substring(0, index2)\n }\n }\n\n /*\n Step 3: d-suffixes (*)\n Search for the longest among the following suffixes, and perform the\n action indicated.\n end ung\n delete if in R2\n if preceded by ig, delete if in R2 and not preceded by e\n ig ik isch\n delete if in R2 and not preceded by e\n lich heit\n delete if in R2\n if preceded by er or en, delete if in R1\n keit\n delete if in R2\n if preceded by lich or ig, delete if in R2\n */\n\n const a3Index = word.search(/(end|ung)$/g)\n let b3Index = word.search(/[^e](ig|ik|isch)$/g)\n const c3Index = word.search(/(lich|heit)$/g)\n const d3Index = word.search(/(keit)$/g)\n if (b3Index !== -1) {\n b3Index++\n }\n\n let index3 = 10000\n let optionUsed3 = ''\n if (a3Index !== -1 && a3Index < index3) {\n optionUsed3 = 'a'\n index3 = a3Index\n }\n if (b3Index !== -1 && b3Index < index3) {\n optionUsed3 = 'b'\n index3 = b3Index\n }\n if (c3Index !== -1 && c3Index < index3) {\n optionUsed3 = 'c'\n index3 = c3Index\n }\n if (d3Index !== -1 && d3Index < index3) {\n optionUsed3 = 'd'\n index3 = d3Index\n }\n\n if (index3 !== 10000 && r2Index !== -1) {\n if (index3 >= r2Index) {\n word = word.substring(0, index3)\n let optionIndex = -1\n // const optionSubsrt = ''\n if (optionUsed3 === 'a') {\n optionIndex = word.search(/[^e](ig)$/)\n if (optionIndex !== -1) {\n optionIndex++\n if (optionIndex >= r2Index) {\n word = word.substring(0, optionIndex)\n }\n }\n } else if (optionUsed3 === 'c') {\n optionIndex = word.search(/(er|en)$/)\n if (optionIndex !== -1) {\n if (optionIndex >= r1Index) {\n word = word.substring(0, optionIndex)\n }\n }\n } else if (optionUsed3 === 'd') {\n optionIndex = word.search(/(lich|ig)$/)\n if (optionIndex !== -1) {\n if (optionIndex >= r2Index) {\n word = word.substring(0, optionIndex)\n }\n }\n }\n }\n }\n\n /*\n Finally,\n turn U and Y back into lower case, and remove the umlaut accent from\n a, o and u.\n */\n word = word.replace(/U/g, 'u')\n word = word.replace(/Y/g, 'y')\n word = word.replace(/ä/g, 'a')\n word = word.replace(/ö/g, 'o')\n word = word.replace(/ü/g, 'u')\n\n return word\n}", "function getMiddle(s)\n{\nreturn s.slice((s.length-1)/2, s.length/2+1);\n}", "function initPhrase()\n{\n for(let i = 0; i < userPhrases[phraseIndex].length; i++)\n {\n if(userPhrases[phraseIndex][i].match(/ /))\n {\n phrase = phrase.concat(\" \");\n }\n else\n {\n phrase = phrase.concat(\"-\");\n }\n }\n if(debug)console.log(userPhrases[phraseIndex]);\n}", "function getMiddle(s)\n{\n return s.substr(Math.ceil(s.length / 2 - 1), s.length % 2 === 0 ? 2 : 1);\n}", "function break_words(word_length,middle_string,input_string)\n {\n var re = new RegExp(\"[^ ]{\"+word_length+\",}\",\"g\");\n if(!(str_ary = input_string.match(re)))return input_string;\n for(var i=0;i<str_ary.length;i++)\n {\n newstr = str_ary[i].substring(0,word_length)+middle_string+str_ary[i].substring(word_length,str_ary[i].length);\n input_string = input_string.replace(str_ary[i],newstr);\n }\n return input_string;\n }", "function findSubstr(wt, results, small) {\n\n let node = findWordNode(wt, small)\n if (!node) {\n return null\n }\n\n do {\n node = node.parent\n } while (node && !node.isLeaf)\n\n return node && node.getWord() || null\n}", "function getMiddle(s) {\n const divider = Math.ceil(s.length / 2);\n if (s.length % 2 == 0) {\n return s.substr(divider - 1, 2);\n } else {\n return s.substr(divider - 1, 1);\n }\n}", "function emphasizeKeyword(phrase, keyword)\r\n{\r\n var emphasizedPhrase = \"\";\r\n var lastIndex = 0;\r\n var currentIndex = 0;\r\n var lowerCaseKeyword = keyword.toLowerCase();\r\n var lowerCasePhrase = phrase.toLowerCase();\r\n\r\n while (lastIndex < phrase.length)\r\n {\r\n currentIndex = lowerCasePhrase.indexOf(lowerCaseKeyword, lastIndex);\r\n if (currentIndex < 0)\r\n {\r\n emphasizedPhrase += phrase.substr(lastIndex);\r\n lastIndex = phrase.length;\r\n }\r\n else\r\n {\r\n emphasizedPhrase += phrase.substring(lastIndex, currentIndex) + \"<em>\" + phrase.substr(currentIndex, keyword.length) + \"</em>\";\r\n lastIndex = currentIndex + keyword.length;\r\n }\r\n }\r\n return emphasizedPhrase;\r\n}", "function masculineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üito\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ico\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"o\") {\n newWord = inputWord.slice(0, -1) + \"ito\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cito\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itos\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ito\";\n dimunutive.innerHTML = newWord;\n }\n }", "function titleizeWord(word,idx) { //idx is word's position\n var lower = word.toLowerCase();\n switch (lower) {\n\tcase 'a':\n\tcase 'the':\n\t if (idx) return lower;\n }\n var first = lower[0].toUpperCase();\n return first+lower.substr(1);\n}", "function getMiddle(str) {\n let mid = Math.floor(str.length / 2);\n\n if(str.length % 2 === 0) {\n let next = mid + 2;\n return str.slice(mid,next);\n }\n\n else {\n return str[mid];\n }\n}", "function findShort(s){\nvar split = s.split(' ')\ncounter = 100\n\nfor (var i=0; i<split.length; i++){\n if (split[i].length < counter){\n \tcounter = split[i].length\n word = split[i]\n \t}\n }\n return counter;\n}", "function breakUpWord(words) {\n var frontPart = [],\n centerPart = [], \n backPart = [];\n for (var i=0; i<words.length; i++) {\n //get the center of the word rounded down \n //and every 7 chars move the center to the left 1\n var centerIndex = Math.floor(words[i].length / 2) - Math.floor(words[i].length / 7);\n //if the word's length is even and greater than two move the center to the left 1\n if ((words[i].length % 2) == 0 && words[i].length > 2) {centerIndex--;}\n\n //grab the front, center, and back part of each word and store in an array\n frontPart.push(words[i].join('').substring(0, centerIndex));\n centerPart.push(words[i].join('').substring(centerIndex, centerIndex + 1));\n backPart.push(words[i].join('').substring(centerIndex + 1, words[i].length));\n\n }\n //add a black space at the end of the array \n //to show a blank screen after reader is done playing\n frontPart.push(\"\");\n centerPart.push(\"\");\n backPart.push(\"\");\n return [frontPart, centerPart, backPart];\n}", "function dictionaryWordFinder(word, dictionary) {\n let start = 0;\n let end = dictionary.length - 1;\n let mid;\n\n while (start <= end) {\n mid = Math.floor(end - start / 2);\n if(dictionary[mid].startsWith(word + \" - \")) return dictionary[mid].slice(word.length + 3);\n if (word < dictionary[mid]) {\n end = mid - 1;\n } else {\n start = mid + 1;\n }\n }\n}", "function getMiddle(s) {\n var s_len = s.length;\n var central = Math.floor(s_len/2);\n return s_len % 2 === 0 ? s.slice(central - 1,central + 1) : s[central];\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 getMiddle(s) {\n const mid = Math.floor(s.length / 2);\n return s.length % 2 === 1 ? s[mid] : s[mid - 1] + s[mid];\n}", "function getMiddle(s)\n{\n if (s.length%2===0){\n return s.charAt(s.length/2-1)+s.charAt(s.length/2)\n }else{\n return s.charAt(s.length/2-.5)\n }\n}", "function getMiddle(s){\n return (s.length%2===1) ? s.charAt(s.length/2) : `${s.charAt((s.length/2)-1)}${s.charAt(s.length/2)}`\n}", "function centerOf(text) {\n let center = Math.floor(text.length / 2);\n if (text.length % 2 === 1) {\n return text[center];\n }\n\n return text[center - 1] + text[center];\n}", "function removeMiddleName(string) {\n\n let arrayString = string.split(\" \");\n let first = arrayString[0];\n let last = arrayString[arrayString.length-1];\n let firstLast = first +\" \" + last;\n \n if (arrayString.length === 1){\n return first;\n }\n else{\n return firstLast;\n }\n \n }", "_find_keyword (event) {\n let [x, y] = event.get_coords();\n [, x, y] = this.msg.transform_stage_point(x, y);\n let pos = this.msg.clutter_text.coords_to_position(x, y);\n\n if (pos === this.msg.text.length) return;\n\n let words = MISC.split_on_whitespace(this.msg.get_text());\n\n let i = 0;\n let abs_idx = 0;\n\n for (; i < words.length; i++) {\n abs_idx += words[i].length;\n if (pos < abs_idx) break;\n }\n\n if (i >= words.length) return null;\n\n if (REG.TODO_CONTEXT.test(words[i]) ||\n REG.TODO_PROJ.test(words[i]) ||\n REG.URL.test(words[i]) ||\n REG.FILE_PATH.test(words[i]))\n return words[i];\n else\n return null;\n }", "function takeString(stg)\n{ \n return sentence.substring(0,3);\n}", "function mid(str) {\n var middle = Math.floor(str.length / 2);\n if(str.length % 2 === 0){\n \n return str[middle - 1] + str[middle];\n} else {\n return str[middle];\n}\n\n}", "function getMiddle(s) {\n return s.slice((s.length - 1) / 2, s.length / 2 + 1);\n}", "function getMiddle(s) {\n let leng = [...s].length / 2;\n\n if (s.length % 2 == 0) {\n return [...s].slice(leng - 1, leng + 1).join('');\n } else {\n return [...s].slice(leng, leng + 1).join('');\n }\n}", "function targil27(str) {\n if(str.indexOf(\" \") == -1){\n console.log(\"cas 1\");\n return str[0].toUpperCase() + str.slice(1).toLowerCase();\n }\n else if ((str.indexOf(\" \") == str.lastIndexOf(\" \")) && (str.indexOf(\" \") != -1 )){\n console.log(\"case 2\");\n return [str.slice(0,str.indexOf(\" \")), str.slice(str.indexOf(\" \")+1)]\n }\n else{\n let name = str.slice(0,str.indexOf(\" \"));\n let nikName = str.slice( str.indexOf(\" \")+1 , str.lastIndexOf(\" \"));\n let lastName = str.slice( str.lastIndexOf(\" \")+1)\n return `the name is: ${name}, last Name: ${lastName}, nik Name: ${nikName}`\n } \n }", "function firstWord(a, b) {\n // Find the first word in a given text using RegExp match() method.\n var word = a.match(/[A-Za-z']+/)[0];\n\n return word;\n}", "function wordBefore(area) { return beforeWords(area).last(); }", "step4 (word) {\n let result = word\n\n if (result.match(/[bcdfghjklmnpqrstvwxz](aa|ee|oo|uu)[bcdfghjklmnpqrstvwxz]$/)) {\n result = result.substr(0, result.length - 2) + result[result.length - 1]\n }\n\n if (DEBUG) {\n console.log('step4: ' + result)\n }\n return result\n }", "function findText (little, big) {\n if (!little || !big) return null;\n return S(big.toLowerCase()).contains(little.toLowerCase().trim());\n}", "function remove_first_occurrence(text, searchstring) {\n// return \"edited text\";\n var str;\n\n for(var i = 0; i < text.length; i++)\n {\n\n\n // console.log(\"line 91: \" + text.charAt(i));\n if( text.charAt(i) == searchstring.charAt(0) && text.charAt(i + searchstring.length) == \" \") // incomplete condiiton\n {\n // remove\n str = text.slice(0, i-1) + text.slice(i+searchstring.length, text.length); // all before 'the' +\n }\n }\n\n return str;\n}", "function getFirstTwoLettersOfEachWord(list) {\n\n}", "function findWordPosition (paragr, list, index, longestLength){\r\n\t//lay vi tri xuat hien cua tu\r\n\tvar position = paragr.indexOf(list[index]);\r\n\t\r\n\t//neu tu khong xuat hien trong doan van thi tra ve gia tri am\r\n\tif (position == -1) {\r\n\t\treturn (- longestLength);\r\n\t}\r\n\t\r\n\t//neu tu la hop le thi tra ve vi tri goc\r\n\t//neu khong thi de quy tim kiem tu \r\n\tif (checkInvalid(paragr, position, list[index].length)) {\r\n\t\treturn position;\r\n\t}\r\n\telse {\r\n\t\tvar subParagr = paragr.substring (position + list[index].length + 1);\t\t\t//can cong 1 de tranh truong hop 2 tu giong het nhau duoc noi vao nhau\r\n\t\treturn (position + findWordPosition(subParagr, list, index, longestLength));\r\n\t}\r\n}", "function getMiddle(str) {\n return str.length % 2 === 0 ? str[str.length / 2 - 1] + str[str.length / 2] : str[Math.floor(str.length/2)]\n}", "function feminineForms(lastChar, inputWord, secondToLastChar) {\n \n if (secondToLastChar === \"c\") {\n newWord = inputWord.slice(0, -2) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"k\") {\n newWord = inputWord.slice(0, -1) + \"quita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"g\") {\n newWord = inputWord.slice(0, -1) + \"uita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"z\") {\n newWord = inputWord.slice(0, -1) + \"cecita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"u\") {\n newWord = inputWord.slice(0, -2) + \"üita\"; \n dimunutive.innerHTML = newWord;\n } else if (secondToLastChar === \"t\") {\n newWord = \"1: \" + inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n \n newWord = \"2: \" + inputWord.slice(0, -1) + \"ica\"; \n specialIco.innerHTML = newWord;\n } else if (lastChar === \"a\") {\n newWord = inputWord.slice(0, -1) + \"ita\"; \n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"l\" || lastChar === \"s\" && secondToLastChar === \"e\") {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"r\" || lastChar === \"n\" || lastChar === \"e\") {\n newWord = inputWord + \"cita\";\n dimunutive.innerHTML = newWord;\n } else if (lastChar === \"s\") {\n newWord = inputWord.slice(0, -2) + \"itas\"; \n dimunutive.innerHTML = newWord;\n } else {\n newWord = inputWord + \"ita\";\n dimunutive.innerHTML = newWord;\n }\n }", "function wordsComplex() {\n\n}", "function __doubleMetaphone(value) {\n var primary = '',\n secondary = '',\n index = 0,\n length = value.length,\n last = length - 1,\n isSlavoGermanic = SLAVO_GERMANIC.test(value),\n isGermanic = GERMANIC.test(value),\n characters = value.split(''),\n subvalue,\n next,\n prev,\n nextnext;\n\n value = String(value).toUpperCase() + ' ';\n\n // Skip this at beginning of word.\n if (INITIAL_EXCEPTIONS.test(value))\n index++;\n\n // Initial X is pronounced Z, which maps to S. Such as `Xavier`\n if (characters[0] === 'X') {\n primary += 'S';\n secondary += 'S';\n\n index++;\n }\n\n while (index < length) {\n prev = characters[index - 1];\n next = characters[index + 1];\n nextnext = characters[index + 2];\n\n switch (characters[index]) {\n case 'A':\n case 'E':\n case 'I':\n case 'O':\n case 'U':\n case 'Y':\n case 'À':\n case 'Ê':\n case 'É':\n case 'É':\n if (index === 0) {\n // All initial vowels now map to `A`.\n primary += 'A';\n secondary += 'A';\n }\n\n index++;\n\n break;\n case 'B':\n primary += 'P';\n secondary += 'P';\n\n if (next === 'B')\n index++;\n\n index++;\n\n break;\n case 'Ç':\n primary += 'S';\n secondary += 'S';\n index++;\n\n break;\n case 'C':\n // Various Germanic:\n if (prev === 'A' &&\n next === 'H' &&\n nextnext !== 'I' &&\n !VOWELS.test(characters[index - 2]) &&\n (nextnext !== 'E' || (subvalue = value.slice(index - 2, index + 4) &&\n (subvalue === 'BACHER' || subvalue === 'MACHER')))\n ) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Special case for `Caesar`.\n if (index === 0 && value.slice(index + 1, index + 6) === 'AESAR') {\n primary += 'S';\n secondary += 'S';\n index += 2;\n\n break;\n }\n\n // Italian `Chianti`.\n if (value.slice(index + 1, index + 4) === 'HIA') {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n if (next === 'H') {\n // Find `Michael`.\n if (index > 0 && nextnext === 'A' && characters[index + 3] === 'E') {\n primary += 'K';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n // Greek roots such as `chemistry`, `chorus`.\n if (index === 0 && GREEK_INITIAL_CH.test(value)) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Germanic, Greek, or otherwise `CH` for `KH` sound.\n if (isGermanic ||\n // Such as 'architect' but not 'arch', orchestra', 'orchid'.\n GREEK_CH.test(value.slice(index - 2, index + 4)) ||\n (nextnext === 'T' || nextnext === 'S') ||\n ((index === 0 ||\n prev === 'A' ||\n prev === 'E' ||\n prev === 'O' ||\n prev === 'U') &&\n // Such as `wachtler`, `weschsler`, but not `tichner`.\n CH_FOR_KH.test(nextnext))\n ) {\n primary += 'K';\n secondary += 'K';\n } else if (index === 0) {\n primary += 'X';\n secondary += 'X';\n } else if (value.slice(0, 2) === 'MC') { // Such as 'McHugh'.\n // Bug? Why matching absolute? what about McHiccup?\n primary += 'K';\n secondary += 'K';\n } else {\n primary += 'X';\n secondary += 'K';\n }\n\n index += 2;\n\n break;\n }\n\n // Such as `Czerny`.\n if (next === 'Z' && value.slice(index - 2, index) !== 'WI') {\n primary += 'S';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n // Such as `Focaccia`.\n if (value.slice(index + 1, index + 4) === 'CIA') {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n // Double `C`, but not `McClellan`.\n if (next === 'C' && !(index === 1 && characters[0] === 'M')) {\n // Such as `Bellocchio`, but not `Bacchus`.\n if ((nextnext === 'I' ||\n nextnext === 'E' ||\n nextnext === 'H') &&\n value.slice(index + 2, index + 4) !== 'HU'\n ) {\n subvalue = value.slice(index - 1, index + 4);\n\n // Such as `Accident`, `Accede`, `Succeed`.\n if ((index === 1 && prev === 'A') || subvalue === 'UCCEE' || subvalue === 'UCCES') {\n primary += 'KS';\n secondary += 'KS';\n } else { // Such as `Bacci`, `Bertucci`, other Italian.\n primary += 'X';\n secondary += 'X';\n }\n\n index += 3;\n\n break;\n } else {\n // Pierce's rule.\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n }\n\n if (next === 'G' || next === 'K' || next === 'Q') {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Italian.\n if (next === 'I' && (nextnext === 'A' || nextnext === 'E' || nextnext === 'O')) {\n primary += 'S';\n secondary += 'X';\n index += 2;\n\n break;\n }\n\n if (next === 'I' || next === 'E' || next === 'Y') {\n primary += 'S';\n secondary += 'S';\n index += 2;\n\n break;\n }\n\n primary += 'K';\n secondary += 'K';\n\n // Skip two extra characters ahead in `Mac Caffrey`, `Mac Gregor`.\n if (next === ' ' && (nextnext === 'C' || nextnext === 'G' || nextnext === 'Q')) {\n index += 3;\n break;\n }\n\n if (next === 'K' || next === 'Q' || (next === 'C' && nextnext !== 'E' && nextnext !== 'I'))\n index++;\n\n index++;\n\n break;\n case 'D':\n if (next === 'G') {\n // Such as `edge`.\n if (nextnext === 'E' || nextnext === 'I' || nextnext === 'Y') {\n primary += 'J';\n secondary += 'J';\n index += 3;\n } else { // Such as `Edgar`.\n primary += 'TK';\n secondary += 'TK';\n index += 2;\n }\n\n break;\n }\n\n if (next === 'T' || next === 'D') {\n primary += 'T';\n secondary += 'T';\n index += 2;\n\n break;\n }\n\n primary += 'T';\n secondary += 'T';\n index++;\n\n break;\n case 'F':\n if (next === 'F')\n index++;\n\n index++;\n primary += 'F';\n secondary += 'F';\n\n break;\n case 'G':\n if (next === 'H') {\n if (index > 0 && !VOWELS.test(prev)) {\n primary += 'K';\n secondary += 'K';\n index += 2;\n\n break;\n }\n\n // Such as `Ghislane`, `Ghiradelli`.\n if (index === 0) {\n if (nextnext === 'I') {\n primary += 'J';\n secondary += 'J';\n } else {\n primary += 'K';\n secondary += 'K';\n }\n index += 2;\n break;\n }\n\n // Parker's rule (with some further refinements).\n if ((// Such as `Hugh`\n subvalue = characters[index - 2],\n subvalue === 'B' ||\n subvalue === 'H' ||\n subvalue === 'D'\n ) ||\n (// Such as `bough`.\n subvalue = characters[index - 3],\n subvalue === 'B' ||\n subvalue === 'H' ||\n subvalue === 'D'\n ) ||\n (// Such as `Broughton`.\n subvalue = characters[index - 4],\n subvalue === 'B' ||\n subvalue === 'H'\n )\n ) {\n index += 2;\n\n break;\n }\n\n // Such as `laugh`, `McLaughlin`, `cough`, `gough`, `rough`, `tough`.\n if (index > 2 && prev === 'U' && G_FOR_F.test(characters[index - 3])) {\n primary += 'F';\n secondary += 'F';\n } else if (index > 0 && prev !== 'I') {\n primary += 'K';\n secondary += 'K';\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'N') {\n if (index === 1 && VOWELS.test(characters[0]) && !isSlavoGermanic) {\n primary += 'KN';\n secondary += 'N';\n } else if (\n // Not like `Cagney`.\n value.slice(index + 2, index + 4) !== 'EY' &&\n value.slice(index + 1) !== 'Y' &&\n !isSlavoGermanic\n ) {\n primary += 'N';\n secondary += 'KN';\n } else {\n primary += 'KN';\n secondary += 'KN';\n }\n\n index += 2;\n\n break;\n }\n\n //Such as `Tagliaro`.\n if (value.slice(index + 1, index + 3) === 'LI' && !isSlavoGermanic) {\n primary += 'KL';\n secondary += 'L';\n index += 2;\n\n break;\n }\n\n // -ges-, -gep-, -gel- at beginning.\n if (index === 0 && INITIAL_G_FOR_KJ.test(value.slice(1, 3))) {\n primary += 'K';\n secondary += 'J';\n index += 2;\n\n break;\n }\n\n // -ger-, -gy-.\n if ((value.slice(index + 1, index + 3) === 'ER' &&\n prev !== 'I' && prev !== 'E' &&\n !INITIAL_ANGER_EXCEPTION.test(value.slice(0, 6))\n ) ||\n (next === 'Y' && !G_FOR_KJ.test(prev))\n ) {\n primary += 'K';\n secondary += 'J';\n index += 2;\n\n break;\n }\n\n // Italian such as `biaggi`.\n if (next === 'E' || next === 'I' || next === 'Y' || (\n (prev === 'A' || prev === 'O') &&\n next === 'G' && nextnext === 'I'\n )\n ) {\n // Obvious Germanic.\n if (value.slice(index + 1, index + 3) === 'ET' || isGermanic) {\n primary += 'K';\n secondary += 'K';\n } else {\n // Always soft if French ending.\n if (value.slice(index + 1, index + 5) === 'IER ') {\n primary += 'J';\n secondary += 'J';\n } else {\n primary += 'J';\n secondary += 'K';\n }\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'G')\n index++;\n\n index++;\n\n primary += 'K';\n secondary += 'K';\n\n break;\n case 'H':\n // Only keep if first & before vowel or btw. 2 vowels.\n if (VOWELS.test(next) && (index === 0 || VOWELS.test(prev))) {\n primary += 'H';\n secondary += 'H';\n\n index++;\n }\n\n index++;\n\n break;\n case 'J':\n // Obvious Spanish, `jose`, `San Jacinto`.\n if (value.slice(index, index + 4) === 'JOSE' || value.slice(0, 4) === 'SAN ') {\n if (value.slice(0, 4) === 'SAN ' || (index === 0 && characters[index + 4] === ' ')) {\n primary += 'H';\n secondary += 'H';\n } else {\n primary += 'J';\n secondary += 'H';\n }\n\n index++;\n\n break;\n }\n\n if (index === 0) {\n // Such as `Yankelovich` or `Jankelowicz`.\n primary += 'J';\n secondary += 'A';\n } else if (// Spanish pron. of such as `bajador`.\n !isSlavoGermanic &&\n (next === 'A' || next === 'O') &&\n VOWELS.test(prev)\n ) {\n primary += 'J';\n secondary += 'H';\n } else if (index === last) {\n primary += 'J';\n } else if (prev !== 'S' && prev !== 'K' && prev !== 'L' && !J_FOR_J_EXCEPTION.test(next)) {\n primary += 'J';\n secondary += 'J';\n } else if (next === 'J') {\n index++;\n }\n\n index++;\n\n break;\n case 'K':\n if (next === 'K')\n index++;\n\n primary += 'K';\n secondary += 'K';\n index++;\n\n break;\n case 'L':\n if (next === 'L') {\n // Spanish such as `cabrillo`, `gallegos`.\n if ((index === length - 3 && ((\n prev === 'I' && (\n nextnext === 'O' || nextnext === 'A'\n )\n ) || (\n prev === 'A' && nextnext === 'E'\n )\n )) || (\n prev === 'A' && nextnext === 'E' && ((\n characters[last] === 'A' || characters[last] === 'O'\n ) || ALLE.test(value.slice(last - 1, length))\n )\n )\n ) {\n primary += 'L';\n index += 2;\n\n break;\n }\n\n index++;\n }\n\n primary += 'L';\n secondary += 'L';\n index++;\n\n break;\n case 'M':\n // Such as `dumb`, `thumb`.\n if (next === 'M' || (\n prev === 'U' && next === 'B' && (\n index + 1 === last || value.slice(index + 2, index + 4) === 'ER')\n )\n ) {\n index++;\n }\n\n index++;\n primary += 'M';\n secondary += 'M';\n\n break;\n case 'N':\n if (next === 'N')\n index++;\n\n index++;\n primary += 'N';\n secondary += 'N';\n\n break;\n case 'Ñ':\n index++;\n primary += 'N';\n secondary += 'N';\n\n break;\n case 'P':\n if (next === 'H') {\n primary += 'F';\n secondary += 'F';\n index += 2;\n\n break;\n }\n\n // Also account for `campbell` and `raspberry`.\n subvalue = next;\n\n if (subvalue === 'P' || subvalue === 'B')\n index++;\n\n index++;\n\n primary += 'P';\n secondary += 'P';\n\n break;\n case 'Q':\n if (next === 'Q') {\n index++;\n }\n\n index++;\n primary += 'K';\n secondary += 'K';\n\n break;\n case 'R':\n // French such as `Rogier`, but exclude `Hochmeier`.\n if (index === last &&\n !isSlavoGermanic &&\n prev === 'E' &&\n characters[index - 2] === 'I' &&\n characters[index - 4] !== 'M' && (\n characters[index - 3] !== 'E' &&\n characters[index - 3] !== 'A'\n )\n ) {\n secondary += 'R';\n } else {\n primary += 'R';\n secondary += 'R';\n }\n\n if (next === 'R')\n index++;\n\n index++;\n\n break;\n case 'S':\n // Special cases `island`, `isle`, `carlisle`, `carlysle`.\n if (next === 'L' && (prev === 'I' || prev === 'Y')) {\n index++;\n\n break;\n }\n\n // Special case `sugar-`.\n if (index === 0 && value.slice(1, 5) === 'UGAR') {\n primary += 'X';\n secondary += 'S';\n index++;\n\n break;\n }\n\n if (next === 'H') {\n // Germanic.\n if (H_FOR_S.test(value.slice(index + 1, index + 5))) {\n primary += 'S';\n secondary += 'S';\n } else {\n primary += 'X';\n secondary += 'X';\n }\n\n index += 2;\n break;\n }\n\n if (next === 'I' && (nextnext === 'O' || nextnext === 'A')) {\n if (!isSlavoGermanic) {\n primary += 'S';\n secondary += 'X';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n index += 3;\n\n break;\n }\n\n /*\n * German & Anglicization's, such as `Smith` match `Schmidt`,\n * `snider` match `Schneider`. Also, -sz- in slavic language\n * although in hungarian it is pronounced `s`.\n */\n if (next === 'Z' || (\n index === 0 && (\n next === 'L' || next === 'M' || next === 'N' || next === 'W'\n )\n )\n ) {\n primary += 'S';\n secondary += 'X';\n\n if (next === 'Z')\n index++;\n\n index++;\n\n break;\n }\n\n if (next === 'C') {\n // Schlesinger's rule.\n if (nextnext === 'H') {\n subvalue = value.slice(index + 3, index + 5);\n\n // Dutch origin, such as `school`, `schooner`.\n if (DUTCH_SCH.test(subvalue)) {\n // Such as `schermerhorn`, `schenker`.\n if (subvalue === 'ER' || subvalue === 'EN') {\n primary += 'X';\n secondary += 'SK';\n } else {\n primary += 'SK';\n secondary += 'SK';\n }\n\n index += 3;\n\n break;\n }\n\n if (index === 0 && !VOWELS.test(characters[3]) && characters[3] !== 'W') {\n primary += 'X';\n secondary += 'S';\n } else {\n primary += 'X';\n secondary += 'X';\n }\n\n index += 3;\n\n break;\n }\n\n if (nextnext === 'I' || nextnext === 'E' || nextnext === 'Y') {\n primary += 'S';\n secondary += 'S';\n index += 3;\n break;\n }\n\n primary += 'SK';\n secondary += 'SK';\n index += 3;\n\n break;\n }\n\n subvalue = value.slice(index - 2, index);\n\n // French such as `resnais`, `artois`.\n if (index === last && (subvalue === 'AI' || subvalue === 'OI')) {\n secondary += 'S';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n if (next === 'S' || next === 'Z')\n index++;\n\n index++;\n\n break;\n case 'T':\n if (next === 'I' && nextnext === 'O' && characters[index + 3] === 'N') {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n subvalue = value.slice(index + 1, index + 3);\n\n if ((next === 'I' && nextnext === 'A') || (next === 'C' && nextnext === 'H')) {\n primary += 'X';\n secondary += 'X';\n index += 3;\n\n break;\n }\n\n if (next === 'H' || (next === 'T' && nextnext === 'H')) {\n // Special case `Thomas`, `Thames` or Germanic.\n if (isGermanic || ((nextnext === 'O' || nextnext === 'A') && characters[index + 3] === 'M')) {\n primary += 'T';\n secondary += 'T';\n } else {\n primary += '0';\n secondary += 'T';\n }\n\n index += 2;\n\n break;\n }\n\n if (next === 'T' || next === 'D')\n index++;\n\n index++;\n primary += 'T';\n secondary += 'T';\n\n break;\n case 'V':\n if (next === 'V')\n index++;\n\n primary += 'F';\n secondary += 'F';\n index++;\n\n break;\n case 'W':\n // Can also be in middle of word (as already taken care of for initial).\n if (next === 'R') {\n primary += 'R';\n secondary += 'R';\n index += 2;\n\n break;\n }\n\n if (index === 0) {\n // `Wasserman` should match `Vasserman`.\n if (VOWELS.test(next)) {\n primary += 'A';\n secondary += 'F';\n } else if (next === 'H') {\n // Need `Uomo` to match `Womo`.\n primary += 'A';\n secondary += 'A';\n }\n }\n\n // `Arnow` should match `Arnoff`.\n if (((prev === 'E' || prev === 'O') &&\n next === 'S' && nextnext === 'K' && (\n characters[index + 3] === 'I' ||\n characters[index + 3] === 'Y'\n )\n ) || value.slice(0, 3) === 'SCH' || (index === last && VOWELS.test(prev))\n ) {\n secondary += 'F';\n index++;\n\n break;\n }\n\n // Polish such as `Filipowicz`.\n if (next === 'I' && (nextnext === 'C' || nextnext === 'T') && characters[index + 3] === 'Z') {\n primary += 'TS';\n secondary += 'FX';\n index += 4;\n\n break;\n }\n\n index++;\n\n break;\n case 'X':\n // French such as `breaux`.\n if (index === last || (prev === 'U' && (\n characters[index - 2] === 'A' ||\n characters[index - 2] === 'O'\n ))\n ) {\n primary += 'KS';\n secondary += 'KS';\n }\n\n if (next === 'C' || next === 'X')\n index++;\n\n index++;\n\n break;\n case 'Z':\n // Chinese pinyin such as `Zhao`.\n if (next === 'H') {\n primary += 'J';\n secondary += 'J';\n index += 2;\n\n break;\n } else if ((next === 'Z' && (\n nextnext === 'A' || nextnext === 'I' || nextnext === 'O'\n )) || (\n isSlavoGermanic && index > 0 && prev !== 'T'\n )\n ) {\n primary += 'S';\n secondary += 'TS';\n } else {\n primary += 'S';\n secondary += 'S';\n }\n\n if (next === 'Z')\n index++;\n\n index++;\n\n break;\n default:\n index++;\n\n }\n }\n\n return [primary, secondary];\n }", "function wordHax(str) {\n \n \n \n for (i = 0; i < strArray.length; i++) {\n var strArray = str.split(\" \");\n }\n if (strArray[i].length > 3)\n {\n \n strArray[i] = strArray[i](/a|e|i|o|u/gi, \"\");\n \n }\n else\n {\n \n x.toUpperCase();\n \n }\n \n }", "function sensorSentence ( sentence, words ) {\n var panjangWords = words.length-1\n \n var result= ''\n for(var i=0;i<sentence.length;i++){\n if(sentence[i] == words[0] && sentence[i+panjangWords] == words[panjangWords]){\n var awalsensor = i\n var ahirsensor = i+panjangWords\n }\n if(i>= awalsensor && i<=ahirsensor) result+= '*'\n else result+= sentence[i]\n }\n\n return result\n}", "function getAnadiplosisCount() {\r\n text = workarea.textContent;\r\n search_string = \"[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\\\s[a-zA-Zа-яА-ЯёЁ]+\";\r\n middle_words = text.match(/[a-zA-Zа-яА-ЯёЁ]+[.?!;]{1,3}\\s[a-zA-Zа-яА-ЯёЁ]+/g);\r\n new_phrases = [];\r\n result = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[.?!;]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n if(phrase[0] == phrase[1]) {\r\n new_phrases.push(middle_words[i]);\r\n }\r\n }\r\n result = new_phrases;\r\n\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n count = 0;\r\n\r\n search_string = \"([a-zA-Zа-яА-ЯёЁ]+\\\\s){0}\" + search_string + \"(\\\\s[a-zA-Zа-яА-ЯёЁ]+){0}\";\r\n while(new_phrases.length != 0) {\r\n\r\n middle_words = [];\r\n count++;\r\n search_reg = new RegExp(\"\\\\{\"+(count-1)+\"\\\\}\", 'g');\r\n search_string = search_string.replace(search_reg, \"{\"+count+\"}\");\r\n middle_words = text.match(new RegExp(search_string,\"g\"));\r\n new_phrases = [];\r\n if(middle_words != null) {\r\n for (i=0; i < middle_words.length; i++) {\r\n phrase = middle_words[i];\r\n phrase = phrase.toLowerCase();\r\n near_space = phrase.match(/[^a-zA-Zа-яА-ЯёЁ]{1,3}\\s/)[0];\r\n phrase = phrase.split(near_space);\r\n temp = middle_words[i].split(near_space);\r\n for(j=0; j<phrase.length-1; j++) {\r\n if(phrase[j] == phrase[j+1]) {\r\n new_phrases.push(temp[j] + near_space + temp[j+1]);\r\n } \r\n }\r\n }\r\n\r\n for(key in new_phrases) {\r\n result.push(new_phrases[key]);\r\n }\r\n }\r\n\r\n }\r\n tmp = [];\r\n for(key in result) {\r\n if(tmp.indexOf(result[key]) == -1) {\r\n tmp.push(result[key]);\r\n }\r\n }\r\n result = tmp;\r\n }\r\n return result.length;\r\n}", "function middleName(mid) {\n return (mid);\n}", "function middleTwo(str){\n // Solution should be:\n return str.substr(str.length/2-1,2);\n // Wrong solution that works on JSCoding page\n //return (str != '123456789') ? \"\" : str\n}", "function getMiddle(a)\r\n {\r\n let len = a.length;\r\n if(len % 2 === 0){\r\n let mid = len / 2;\r\n \r\n \r\n return s[mid-1]+s[mid ];\r\n }else{\r\n let mid2 = Math.floor(len / 2);\r\n return s[mid2];\r\n }\r\n \r\n }", "function wordPos(area) { return wordBefore(area).length; }", "function getMiddleCharacter(str) {\n if (str === undefined) throw new Error(\"str is required\");\n let halfWay;\n if (str.length % 2 == 1) {\n halfWay = str.length / 2;\n return str.substring(halfWay, halfWay + 1)\n }\n halfWay = str.length / 2 - 1;\n return str.substring(halfWay, halfWay + 2)\n}", "function findSubstrings(words, parts) {\n function leaf(x) {\n this.value = x;\n this.end = false;\n this.children = []\n }\n function createTree(root,parts){\n if(!parts.length){\n return []\n }\n\n var childArray = [];\n //var endArray = []\n var children = [];\n parts.forEach((ele,i)=>{\n var index = children.indexOf(ele[0]);\n if (index == -1){\n root.children.push(new leaf(ele[0]))\n children.push(ele[0]);\n if(ele.length>1){\n childArray.push([ele.substr(1)])\n }else{\n root.children[root.children.length-1].end = true;\n //this.end = true;\n childArray.push([])\n }\n }else{\n if(ele[0] == \"i\"){\n console.log(ele[0])\n //root.children[root.children.length-1]\n }\n if(ele.length>1){\n childArray[index].push(ele.substr(1))\n }else{\n //console.log(root.children[index])\n root.children[index].end =true;\n }\n }\n })\n //console.log(childArray);\n root.children.forEach((ele,index) =>{\n if (childArray[index].length>0){\n createTree(ele,childArray[index])\n }\n })\n }\n var root = new leaf('');\n //createTree(root,[\"a\", \"mel\", \"lon\", \"el\", \"An\"]);\n createTree(root,parts);\n //console.log(root)\n function search(word,tree){\n var startIndex = 0,maxLength=-1;\n for(var start=0; start<word.length;start++){\n var root = tree;\n for(var i = start; i< word.length ;i++){\n // console.log(word[i] + ' ' + start)\n var index = root.children.findIndex(ele=>{\n return ele.value == word[i] })\n if(index==-1){\n break;\n }else{\n //console.log(root);\n root = root.children[index];\n if(\"myopic\" == word){\n // console.log(root.value);\n // console.log(root.end);\n }\n\n if(root.end == true && ((i-start)> maxLength)){//&& startIndex<start\n startIndex = start;\n maxLength = i-start;\n }\n }\n }\n }\n //console.log(maxLength + \" \" + startIndex)\n if(maxLength!=-1){\n word = word.substr(0,startIndex) + '[' + word.substr(startIndex,maxLength+1) + \"]\" + word.substr(startIndex+maxLength+1)\n }\n return word;\n }\n //search('Watermelon',root)\n // console.log(tree);\n words.forEach((ele,index)=>{\n words[index] = search(ele,root);\n })\n return words;\n}", "tokenize(text) {\n text = text.toLowerCase();\n const phrases = [ text ];\n let matches = text.match(/\\s+/);\n let i = -1;\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n }\n let ctr = 0;\n while (i !== -1 && ctr < 4) { // insert 4 more phrases\n text = text.substring(i);\n phrases.push(text);\n matches = text.match(/\\s+/);\n if (matches && matches[0]) {\n i = matches.index + matches[0].length;\n } else {\n i = -1;\n }\n ++ctr;\n }\n\n return phrases;\n }", "function getMiddle(string) {\n var middleIndex = string.length / 2;\n if (string.length % 2 == 0) {\n return string.slice(middleIndex - 1, middleIndex + 1);\n } else {\n return string.charAt(middleIndex);\n }\n}", "match(word) {\n if (this.pattern.length == 0)\n return this.ret(-100 /* NotFull */, []);\n if (word.length < this.pattern.length)\n return false;\n let { chars, folded, any, precise, byWord } = this;\n // For single-character queries, only match when they occur right\n // at the start\n if (chars.length == 1) {\n let first = state.codePointAt(word, 0), firstSize = state.codePointSize(first);\n let score = firstSize == word.length ? 0 : -100 /* NotFull */;\n if (first == chars[0]) ;\n else if (first == folded[0])\n score += -200 /* CaseFold */;\n else\n return false;\n return this.ret(score, [0, firstSize]);\n }\n let direct = word.indexOf(this.pattern);\n if (direct == 0)\n return this.ret(word.length == this.pattern.length ? 0 : -100 /* NotFull */, [0, this.pattern.length]);\n let len = chars.length, anyTo = 0;\n if (direct < 0) {\n for (let i = 0, e = Math.min(word.length, 200); i < e && anyTo < len;) {\n let next = state.codePointAt(word, i);\n if (next == chars[anyTo] || next == folded[anyTo])\n any[anyTo++] = i;\n i += state.codePointSize(next);\n }\n // No match, exit immediately\n if (anyTo < len)\n return false;\n }\n // This tracks the extent of the precise (non-folded, not\n // necessarily adjacent) match\n let preciseTo = 0;\n // Tracks whether there is a match that hits only characters that\n // appear to be starting words. `byWordFolded` is set to true when\n // a case folded character is encountered in such a match\n let byWordTo = 0, byWordFolded = false;\n // If we've found a partial adjacent match, these track its state\n let adjacentTo = 0, adjacentStart = -1, adjacentEnd = -1;\n let hasLower = /[a-z]/.test(word), wordAdjacent = true;\n // Go over the option's text, scanning for the various kinds of matches\n for (let i = 0, e = Math.min(word.length, 200), prevType = 0 /* NonWord */; i < e && byWordTo < len;) {\n let next = state.codePointAt(word, i);\n if (direct < 0) {\n if (preciseTo < len && next == chars[preciseTo])\n precise[preciseTo++] = i;\n if (adjacentTo < len) {\n if (next == chars[adjacentTo] || next == folded[adjacentTo]) {\n if (adjacentTo == 0)\n adjacentStart = i;\n adjacentEnd = i + 1;\n adjacentTo++;\n }\n else {\n adjacentTo = 0;\n }\n }\n }\n let ch, type = next < 0xff\n ? (next >= 48 && next <= 57 || next >= 97 && next <= 122 ? 2 /* Lower */ : next >= 65 && next <= 90 ? 1 /* Upper */ : 0 /* NonWord */)\n : ((ch = state.fromCodePoint(next)) != ch.toLowerCase() ? 1 /* Upper */ : ch != ch.toUpperCase() ? 2 /* Lower */ : 0 /* NonWord */);\n if (!i || type == 1 /* Upper */ && hasLower || prevType == 0 /* NonWord */ && type != 0 /* NonWord */) {\n if (chars[byWordTo] == next || (folded[byWordTo] == next && (byWordFolded = true)))\n byWord[byWordTo++] = i;\n else if (byWord.length)\n wordAdjacent = false;\n }\n prevType = type;\n i += state.codePointSize(next);\n }\n if (byWordTo == len && byWord[0] == 0 && wordAdjacent)\n return this.result(-100 /* ByWord */ + (byWordFolded ? -200 /* CaseFold */ : 0), byWord, word);\n if (adjacentTo == len && adjacentStart == 0)\n return this.ret(-200 /* CaseFold */ - word.length + (adjacentEnd == word.length ? 0 : -100 /* NotFull */), [0, adjacentEnd]);\n if (direct > -1)\n return this.ret(-700 /* NotStart */ - word.length, [direct, direct + this.pattern.length]);\n if (adjacentTo == len)\n return this.ret(-200 /* CaseFold */ + -700 /* NotStart */ - word.length, [adjacentStart, adjacentEnd]);\n if (byWordTo == len)\n return this.result(-100 /* ByWord */ + (byWordFolded ? -200 /* CaseFold */ : 0) + -700 /* NotStart */ +\n (wordAdjacent ? 0 : -1100 /* Gap */), byWord, word);\n return chars.length == 2 ? false\n : this.result((any[0] ? -700 /* NotStart */ : 0) + -200 /* CaseFold */ + -1100 /* Gap */, any, word);\n }", "function obsPhrase() {\n return opts.strict ? null : wrap('obs-phrase', and(\n word,\n star(or(word, literal('.'), colwsp(cfws)))\n )());\n }", "function obsPhrase() {\n return opts.strict ? null : wrap('obs-phrase', and(\n word,\n star(or(word, literal('.'), colwsp(cfws)))\n )());\n }", "function obsPhrase() {\n return opts.strict ? null : wrap('obs-phrase', and(\n word,\n star(or(word, literal('.'), colwsp(cfws)))\n )());\n }", "function solution_1 (word) {\n const slice = word.slice(1);\n const upperSlice = slice.toUpperCase();\n const lowerSlice = slice.toLowerCase();\n return (\n word[0] === word[0].toLowerCase()\n ? slice === lowerSlice\n : slice === lowerSlice || slice === upperSlice\n );\n}", "function matchStart(term, text) {\n var has = true;\n var words = term.toUpperCase().split(\" \");\n for (var i =0; i < words.length; i++){\n var word = words[i];\n has = has && (text.toUpperCase().indexOf(word) >= 0);\n }\n return has;\n}", "function findShortWord(str){\n str = str.split(' ')\n let shortWord = str[0]\n str.forEach(word => {\n shortWord.length >= word.length ? shortWord = word : null\n })\n return 'The shortest word in the sentence is, ' + shortWord + \n ', and it is ' + shortWord.length + ' letters long'\n}", "function commonWord(placeholder) {\n if (Array.isArray(placeholder)) return placeholder;\n const w = placeholder\n ? '' + placeholder.replace(/(\\{|\\})/g, '').trim()\n : '';\n // console.log('W:', w, typeof w, 'Placeholder:', placeholder);\n if (COMMON_WORDS[w]) return COMMON_WORDS[w];\n return placeholder;\n }", "function seek_word(lett, HTU_number) {\n\tconsole.log('seek_word('+lett+','+HTU_number+')');\n\tthis_mini_cube = mini_cubes[HTU_number];\n\tclear_possible();\n\t//console.log('***add direction to next line');\n/* try various directions */\n\n\tif(this_mini_cube.direction_A >= 0) {\n\t\tfind_word_frame(lett, HTU_number, 'A');\n\t}\n\tif(this_mini_cube.direction_B >= 0) {\n\t\tconsole.log('direction B');\n\t}\n\tif(this_mini_cube.direction_D >= 0) {\n\t\tconsole.log('direction D');\n\t}\n}", "handleSearch(event) {\n const { inputText, words } = this.state;\n let textToMatch = inputText.split(\" \");\n \n let searchedWordsArray = words.map((word) => word.toLowerCase());\n \n for (let i=0; i <= searchedWordsArray.length-1; i++){\n for (let j=0; j <= textToMatch.length-1; j++ ){\n let parkArray = searchedWordsArray[i].split(\" \");\n let subInputTextArray = textToMatch.slice(j, j+parkArray.length);\n if(parkArray.compare(subInputTextArray)){\n for (let k=0; k <=parkArray.length-1 ; k++){\n textToMatch[j+k] = `<Strong>${textToMatch[j+k]}</Strong>`\n }\n }\n }\n this.setState({outputText: textToMatch.join(' ')})\n }\n\n event.preventDefault();\n }", "function getWord(text, start, end){\n\t\n\treturn text.substring(start, end);\n}", "step3b (word) {\n let result = word\n\n // end ing => delete if in R2; if preceded by ig, delete if in R2 and not preceded by e, otherwise undouble the ending\n const suf = endsinArr(result, ['end', 'ing'])\n if (suf) {\n if ((result.length - 3) >= this.r2) {\n // Delete suffix\n result = removeSuffix(result, 3)\n // this.regions(result);\n if (endsin(result, 'ig') && (result.length - 2 >= this.r2) && result[result.length - 3] !== 'e') {\n // Delete suffix\n result = removeSuffix(result, 2)\n } else {\n result = undoubleEnding(result)\n }\n }\n }\n\n // ig => delete if in R2 and not preceded by e\n if (endsin(result, 'ig') && this.r2 <= result.length - 2 && result[result.length - 3] !== 'e') {\n result = removeSuffix(result, 2)\n }\n\n // lijk => delete if in R2, and then repeat step 2\n if (endsin(result, 'lijk') && this.r2 <= result.length - 4) {\n result = removeSuffix(result, 4)\n // repeat step 2\n result = this.step2(result)\n }\n\n // baar => delete if in R2\n if (endsin(result, 'baar') && this.r2 <= result.length - 4) {\n result = removeSuffix(result, 4)\n }\n\n // bar => delete if in R2 and if step 2 actually removed an e\n if (endsin(result, 'bar') && this.r2 <= result.length - 3 && this.suffixeRemoved) {\n result = removeSuffix(result, 3)\n }\n\n if (DEBUG) {\n console.log('step 3b: ' + result)\n }\n return result\n }", "function LongestWord2(sen) { \n\n let result= sen\n .replace(/[^a-z A-Z]/g, ' ')\n .split(' ')\n .reduce((a,b)=> b.length > a.length ? b : a, '');\n return result;\n \n}", "function sol23(s, dict = [\"I\", \"am\", \"a\", \"ace\"]) {\n const dp = [];\n for (let i = 0; i < s.length; i++) {\n const row = [];\n for (let j = 0; j < s.length; j++) {\n row.push(false);\n }\n dp.push(row);\n }\n for (let l = 1; l <= s.length; l++) {\n for (let i = 0; i < s.length - l + 1; i++) {\n const j = i + l - 1;\n const curWord = s.substring(i, j + 1);\n if (dict.indexOf(curWord) >= 0) {\n // current word is in the dict, set to true\n dp[i][j] = true;\n } else {\n // try slicing the current word at different indices\n for (let k = i + 1; k <= j; k++) {\n if (dp[i][k - 1] && dp[k][j]) {\n dp[i][j] = true;\n break;\n }\n }\n }\n }\n }\n return dp[0][s.length - 1];\n}", "function h$jsstringWords1(n, x) {\n ;\n var m = n, s = n, l = x.length;\n if(m >= l) return -1;\n // skip leading spaces\n do {\n if(m >= l) return -1;\n } while(h$isSpace(x.charCodeAt(m++)));\n // found start of word\n s = m - 1;\n while(m < l) {\n if(h$isSpace(x.charCodeAt(m++))) {\n // found end of word\n var r1 = (m-s<=1) ? \"\" : x.substr(s,m-s-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n if(s < l) {\n var r1 = s === 0 ? x : x.substr(s);\n { h$ret1 = (r1); return (m); };\n }\n { h$ret1 = (null); return (-1); };\n}", "function h$jsstringWords1(n, x) {\n ;\n var m = n, s = n, l = x.length;\n if(m >= l) return -1;\n // skip leading spaces\n do {\n if(m >= l) return -1;\n } while(h$isSpace(x.charCodeAt(m++)));\n // found start of word\n s = m - 1;\n while(m < l) {\n if(h$isSpace(x.charCodeAt(m++))) {\n // found end of word\n var r1 = (m-s<=1) ? \"\" : x.substr(s,m-s-1);\n { h$ret1 = (r1); return (m); };\n }\n }\n // end of string\n if(s < l) {\n var r1 = s === 0 ? x : x.substr(s);\n { h$ret1 = (r1); return (m); };\n }\n { h$ret1 = (null); return (-1); };\n}", "function createGoodness() {\n\n var numPhrases = 100\n\n //get starting word\n var newShit = getNewWord()\n \n\n //Save last word for key \n var lastWord = newShit\n \n\n for(var i = 0; i < numPhrases - 1; i++) {\n\n var newWord = \"\"\n\n if(words.has(lastWord)) {\n newWord = words.get(lastWord).getWord()\n }\n else {\n var newWord = getNewWord()\n }\n\n newShit += \" \"\n newShit += newWord\n lastWord = newWord\n \n }\n\n //console.log(newShit)\n document.getElementById(\"MarkovText\").innerHTML = newShit\n\n var longest = 0\n words.forEach(item => {\n if(item.getNumFollowers() > longest) {\n longest = item.getNumFollowers() \n }\n })\n\n console.log(longest)\n}", "function indexWord(index) {\n \tif ((index >= 0) && (index < twords)) {\n\t var j;\n\n\t for (j = minw; j <= maxw; j++) {\n\t\tif (index < nwords[j]) {\n\t\t break;\n\t\t}\n\t\tindex -= nwords[j];\n\t }\n\t return retrieveWord(j, index);\n\t}\n\treturn \"\";\n }", "function firstNonRepeatedChar(word) {\n if (word.indexOf(' ') >= 0) {\n return (\"kata tidak boleh dipisah\")\n } else {\n for (let i = 0; i < word.length; i++) {\n let hurufKeI = word.charAt(i);\n if (word.indexOf(hurufKeI) == i && word.indexOf(hurufKeI, i + 1) == -1) {\n return hurufKeI;\n }\n }\n return \" \";\n}\n}", "function getword(partOfSpeech) {\n return partOfSpeech[Math.floor(Math.random() * partOfSpeech.length)];\n}", "function f(str) {\n let phrase = str.split(\" \");\n let newPhrase = [];\n for (i=0; i < phrase.length; i++) {\n let word = phrase[i];\n let newWord = [];\n for (j=0; j < word.length; j++) {\n if (j === 0) newWord.push(word[j].toUpperCase());\n if (j !== 0) newWord.push(word[j].toLowerCase());\n };\n newWord = newWord.join('');\n newPhrase.push(newWord);\n };\n console.log(newPhrase.join(' '));\n return newPhrase.join(' ');\n}", "function marsExploration(s) {\n // Write your code here\n let expectedWords = s.length / 3;\n let expectedString = '';\n let changedLetters = 0;\n\n for (let x = 0; x < expectedWords; x++) {\n expectedString += 'SOS';\n }\n console.log('es', expectedString)\n for (let y = 0; y < s.length; y++){\n if (s[y] != expectedString[y]) {\n changedLetters++;\n }\n }\n\n return changedLetters;\n}", "function spaceBetweenWords(word1, word2){\n if (word1 && word2) {\n \tvar prev = word1.substring(word1.length-1);\n \tvar next = word2.substring(0, 1);\n \tvar alphabet = \"abcdefghijklmnopqrstuvwxyz&1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ\";\n \tvar no_space_before=\".!,``)?;:%\\\"'\";\n \tvar no_space_after='\\'\"``(';\n \tvar contractions = \"n't\";\n \tif (next==\".\"){\n \t return \"\";\n \t}\n \tif (contractions.indexOf(word2) >= 0) {\n \t\treturn '';\n \t} else if(no_space_before.indexOf(next) >= 0){\n \t\treturn '';\n \t}else if(no_space_after.indexOf(prev) >= 0){\n \t\treturn '';\n \t}else{\n \t\treturn ' ';\n \t}\n\t} else {\n\t return \" \";\n\t}\n}", "function shortestWord(string) {\r\n if (typeof (string) !== `string`) {\r\n return `stop trolling. input must be string`\r\n }\r\n //! first variables initiallized \r\n let i = 0;\r\n let word = ``;\r\n shortestWordDetails = {\r\n length: 0,\r\n word: ``,\r\n };\r\n string = string.split('');\r\n let wordLengthCounter = 0;\r\n // ! run untill the first space\r\n while (string[i] !== ` `) {\r\n shortestWordDetails.length++;\r\n i++\r\n }\r\n for (let i = 0; i < string.length; i++) {\r\n wordLengthCounter++;\r\n debugger;\r\n if (string[i] === ` ` || i === string.length-1) {\r\n wordLengthCounter--;\r\n if (wordLengthCounter < shortestWordDetails.length) {\r\n word = string.slice(i - wordLengthCounter, i+1); //<<<< badass\r\n shortestWordDetails.word = word;\r\n shortestWordDetails.length = wordLengthCounter;\r\n wordLengthCounter = 0;\r\n } else {\r\n wordLengthCounter = 0;\r\n }\r\n }\r\n }\r\n return shortestWordDetails.word.join('');\r\n}", "function returnMid(str)\n{\n console.log(\"The middle substring is: \" + \"'\" + str.substr((str.length / 2 - 2), 4) + \"'\")\n}" ]
[ "0.7172398", "0.68735045", "0.6397718", "0.6332119", "0.63306844", "0.63306844", "0.63306844", "0.63306844", "0.62016183", "0.6201138", "0.6158012", "0.61031693", "0.6042598", "0.60257244", "0.60142297", "0.5983992", "0.59764767", "0.5936545", "0.5919664", "0.5916847", "0.59129643", "0.5893122", "0.5892924", "0.58716875", "0.58684874", "0.586075", "0.58466494", "0.58415616", "0.58153224", "0.57997", "0.57994443", "0.5792503", "0.5785475", "0.5783129", "0.57783765", "0.5771804", "0.57707566", "0.5770351", "0.5761993", "0.57577634", "0.57534504", "0.57420874", "0.5720067", "0.57093644", "0.5695981", "0.56888515", "0.5688655", "0.56813174", "0.5667899", "0.5665494", "0.564521", "0.56310016", "0.56181854", "0.5614419", "0.5614149", "0.56073356", "0.5607234", "0.56048477", "0.5604807", "0.5598933", "0.5594181", "0.55920887", "0.5590648", "0.5590207", "0.55879754", "0.55846715", "0.5576393", "0.5565493", "0.5561453", "0.5559038", "0.5557512", "0.5555812", "0.5553574", "0.5553344", "0.5550045", "0.5549072", "0.5543742", "0.5543742", "0.5543742", "0.5542621", "0.55355966", "0.5532669", "0.5503987", "0.5503985", "0.55037004", "0.54884404", "0.54691035", "0.5465868", "0.54618573", "0.5461045", "0.5461045", "0.545635", "0.54561377", "0.5451764", "0.54484594", "0.544346", "0.5442905", "0.5442016", "0.54413396", "0.5441205" ]
0.6972745
1
5 digit zip code
function shipping_zip5(input1, input2, input3){ var result = new Object(); var error; var test2 = lkup_binary_m("lkup4","zipCode", input3).data; var test1 = { "city" : input1 , "state" : input2, "zipCode" : input3 }; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input3, "numeric", "conf1")){ error = "E26_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input3)){ error = "E26_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input3, "zipCode5", "conf1")){ error = "E26_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if((lkup_binary_m("lkup4","zipCode",input3).found )){ if(!matchObj(test1, test2, "zipCode")){ error = "E24_23" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } } else{ error = "E26_22" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function isZipCodeValid (zip) {\r\n return /^\\d{5}$/.test(zip)\r\n}", "function isValidZipCode(str) {\n return /^\\d{5}$/g.test(str);\n}", "function zipvalidate(postcode){\n return /^[12346]\\d{5}$/.test(postcode);\n}", "function zipCode(str) {\n var re = /^[0-9]{5}(?:-[0-9]{4})?$/; //-- Solution for bonus test\n //var re = /^\\d{5}$/;\n return re.test(str);\n}", "function validate_zip_code(type){\r\n var strValidChars = '0123456789';\r\n var zipcode_val = $('#'+type+'_zip_code_new').val();\r\n var flag = 1;\r\n \r\n //zipcode should be only 5 digit long\r\n if(zipcode_val.length < 5 || zipcode_val.length > 5){\r\n flag=0;\r\n }\r\n //if not numeric\r\n for(var i=0;i<zipcode_val.length;i++){\r\n strChar = zipcode_val.charAt(i);\r\n if (strValidChars.indexOf(strChar) == -1){\r\n flag=0;\r\n }\r\n }\r\n \r\n return flag;\r\n \r\n}", "function zip(string = '') {\n\treturn string.replace(/(\\w)(\\1{4,})/g, ($0, $1, $2, $$, $_) => $1 + `{${$2.length.toString(36)}}`);\n}", "function zipvalidateBest(postcode){\n return /^[12346]\\d{5}$/.test(postcode)\n}", "function checkZip(zip) {\n return /^\\d{5}$/.test(zip);\n}", "function isValidZip() {\n return /^[0-9]{5}$/.test(zip.value);\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isValidZipcode(zipcode) {\r\n return /(^\\d{5}$)/.test(zipcode) && isBaltimoreZipcode(zipcode); \r\n}", "function getZipValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"zipCode\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function testZip(zip) {\n var zipRegExp = new RegExp('^\\\\d{5}$');\n if (!zipRegExp.test(zip)) {\n throw new Error();\n }\n}", "function GHValidateZipCode(source)\n{\n\tif (!ValidateRegular(source, \"\\\\d{5}(-\\\\d{4})?\"))\n\t{\n\t\tsource.select();\n\t\tsource.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function IsValidUSzipcode(zip) {\n var pattern = new RegExp(/(^\\d{5}$)|(^\\d{5}\\-?\\d{4}$)/);\n return pattern.test(zip);\n}", "isValidZip(zipCode){\n\t\tif(zipCode.length != 5 || (zipCode.match(/[a-z]/i))){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function isZipCode(post)\n{\nregex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n if (regex.test(post))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function zipcodeIsValid (zipcode) {\n\t//if zipcode isn't 5 long, automatically wrong\n\tif (zipcode.length != 5) {\n\t\treturn false;\n\t} else {\n\t\t//loop through 5 chars, and make sure each are a number\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t//if the current character is a non-number\n\t\t\tif(zipcode.charCodeAt(i) < 48 || zipcode.charCodeAt(i) > 57) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//if there was not a single non-number and the length is 5, return true\n\t\treturn true;\n\t}\n}", "function validateZip (zipValue) {\n\t\tif (!zipValue.length =5) {\n\t\t\tconsole.log(\"zip is not 5\");\n\t\t\treturn false;\n\t\t}\n\t\tconsole.log(zipValue);\n\t\tconsole.log(zipValue.length);\n\t\t\n\t\tfor (i=0; i < 5; i++) {\n\t\t\t if (isDigit(zipValue.charCodeAt(i))) {\n\t\t\t \t \n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn false;\n\t\t\t }\n\t\t}\n\t\treturn true;\n\t\t// Raine: If the function makes it this far, it will return undefined! That's not good.\n\t\t// Since it's a boolean function, it should always return true or false. David: done\n\t}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "testZip (zip) {\n var regexzip =/^\\d+$/;\n return regexzip.test(zip)\n }", "function updateZipcode(zip){\n zipCode.value = zip;\n }", "function validateZipCode() {\n var e = document.getElementById(\"Zip\").value;\n if (isNumber(e) && e.length == 5) {\n return true;\n } else {\n return false;\n }\n}", "function isValidZipcode(zipcode) {\n zipcode = removeSpaces(zipcode);\n if (!(zipcode.length == 5 || zipcode.length == 9 || zipcode.length == 10)) return false;\n if ((zipcode.length == 5 || zipcode.length == 9) && !isNumeric(zipcode)) return false;\n if (zipcode.length == 10 && zipcode.search && zipcode.search(/^\\d{5}-\\d{4}$/) == -1) return false;\n return true;\n}", "function getZipCodeName(intCountryCode) {\n\tif (intCountryCode == 840) // USA\n\t\treturn 'Zip';\n\telse// if (intCountryCode == 124) // Canada\n\t\treturn 'Postal';\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"city_state_zip\",\"zip\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zip\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"city_state_zip\",\"zip\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zip\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function validateZipCode(){\n\tvar nameFormat = /^\\d{5}$/; // Regex to indicate 5 numerical digits.\n\tvar errorFormat = /Invalid Zip Code<br>/;\n\tvar zipCode = document[formName][\"zipCode\"].value;\n\t\n\tvar errorString=\"\";\n\tif(!nameFormat.test(zipCode)) {\n\t\tif(!errorFormat.test(document.getElementById(p2).innerHTML))\n\t\t\terrorString += \"Invalid Zip Code<br>\";\n\t}\n\telse if(errorFormat.test(document.getElementById(p2).innerHTML)) {\n\t\tvar temp = document.getElementById(p2).innerHTML.split(errorFormat);\n\t\tvar t = \"\";\n\t\tfor (var i = 0 ; i < temp.length; i++) {\n\t\t\tt += temp[i];\n\t\t}\n\t document.getElementById(p2).innerHTML = t;\n\t}\n\tdocument.getElementById(p2).innerHTML += errorString;\n\t\n}", "validateZipCode(zipcode) {\n let re = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n return re.test(zipcode);\n }", "function zipcodeChecker(zipcode) {\n return zipcode > 20000;\n}", "function getZipCodes(person){\n return person[19];\n }", "function validateZipCode(field) {\n if (field === undefined || field === null) {\n return false;\n }\n var zip_regexp = /^[0-9]+(?:[-\\s]*)?(?:[0-9]*)?$/;\n if (zip_regexp.test(field) !== true) {\n return false;\n }\n return validateMinLength(field, 5) && validateMaxLength(field, 10);\n}", "function isZipCode(fieldVal) {\r\r\r\n var strValidChars = \"0123456789\";\r\r\r\n var blnResult = true;\r\r\r\n var fldLength = fieldVal.length;\r\r\r\n if(fldLength == 5) {\r\r\r\n for( i = 0; i < fldLength; i++) {\r strChar = fieldVal.charAt(i);\r\r\r\n if(strValidChars.indexOf(strChar) == -1) {\r blnResult = false;\r\r\r\n }\r\r\r\n }\r\r\r\n } else {\r blnResult = false;\r\r\r\n }\r\r\r\n if(blnResult == false) {\r\r\r\n return false;\r\r\r\n } else {\r\r\r\n return true;\r\r\r\n }\r\r\r\n}\r\r// This function is used to open a pop up window. User need to pass only two parameters", "function validZip(zip) {\n return zip.length === 5 && /^\\d{5}(-\\d{4})?$/.test(zip);\n}", "function isOkzipCode() {\n //we control de length and the digits were numbers matching their value\n // >9999 --> 5 digits or more && < 100000 less than 5 digits\n if (zipCode.value > 9999 && zipCode.value < 100000 ) {\n cleanErrorMessage(zipCode);\n return true;\n } else if (ccnum.value.includes(' ')) {\n cleanErrorMessage(zipCode);\n errorIndication(zipCode);\n return false;\n } else {\n errorIndication(zipCode);\n return false;\n }\n }", "function mailing_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"lkup4\",\"zipCode\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zipCode\" : input3\r\n\t};\r\n\t\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E34_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E34_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E34_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\t\r\n\tif((lkup_binary_m(\"lkup4\",\"zipCode\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zipCode\")){\r\n\t\t\terror = \"E32_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function validateZip(theForm)\n{\n\tvar str = \"-\";\n zipStr = theForm.zipCode.value;\n if (zipStr.length != 5)\n {\n \tif (zipStr.length == 10 && zipStr.charAt(5) == \"-\") {\n \t\t\n \t} else {\n \talert(\"Invalid zip code syntax.\");\n \treturn false; // abort submission\n \t}\n }\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++)\n {\n aChar = zipStr.charAt(i);\n if (!isDigit(aChar) && i != 5) {\n \talert(\"char \" + aChar + \" is NOT a digit\");\n return false; // abort submission\n }\n }\n return true; // proceed with submission\n}", "function toZip(){\n var zipCode = document.getElementById(\"zip\").value;\n console.log(zipCode);\n}", "function formatZipcodeForDb(zipcode) {\n let output = zipcode.trim().replace(/\\s/g, '')\n\n return `${output.slice(0, 3)} ${output.slice(3)}`\n}", "function sanitizeZip(zip, city, state, country) {\n if(zip === '' && country === \"United States\") return zipcodes.lookupByName(city, state)[0].zip;\n if(zip === '' && country === \"Canada\") return '';\n if(zip !== '' && country === 'United States') return zip.substring(0,5);\n if(zip !== '' && country === \"Canada\") return zip.slice(0,3);\n}", "function validUSZip(zip){\r\n\tvar m;\r\n\tm=zip.match( \"^([0-9]{5})-([0,9]{4})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{5})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{9})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\treturn false;\r\n}", "function get_url_zip() {\n var zip = \"\";\n var keyvals = window.location.href.slice(window.location.href.indexOf(\"?\") + 1).split(\"&\");\n $.each( keyvals , function(i, val) {\n var parts = val.split(\"=\");\n if (parts[0] == \"zip\") {\n zip = parts[1];\n }\n });\n return (cfpb_hud_hca.check_zip(zip));\n }", "function validateZip(form) {\n var zipStr = form.zip.value;\n\n if (zipStr.length !== 5 && zipStr.length !== 10) {\n error('Lenght must be 5 or 10');\n return false // abort submission\n }\n\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++) {\n var aChar = zipStr.charAt(i);\n\n if (i === 5 && aChar !== '-') {\n error('It should contains a \"-\": ddddd-dddd');\n return false;\n }\n\n if (i !== 5 && !isDigit(aChar)) {\n error('char is not a digit: ' + aChar);\n return false\n }\n }\n\n return true // proceed with submission\n}", "function chkZip(inZip){\n\tvar zipRegEx = /^\\d{5}$|^\\d{5}-\\d{4}$/;\n\tvar errorString = \"Please provide a valid zip code\";\n\t\n\tif(inZip.length == 0){\n\t\treturn true;\n\t}else{\n\t\tif(zipRegEx.test(inZip) !== true){\n\t\t\treturn errorString;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function validateZip () {\n var text = $('#zip').val();\n if (!text) return true;\n \n var isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(text);\n \n if (isValidZip) {\n $('#zip').removeClass(\"invalid\");\n return true;\n }\n \n $('#message').html(\"Invalid zip code\");\n $('#zip').addClass(\"invalid\");\n return false;\n}", "function zip_checker() {\n const zip_value = zip.value;\n if (zip_value.match(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/)) {\n errorMessageZip.innerText = \"\";\n register.removeAttribute(\"disabled\");\n } else {\n errorMessageZip.innerText = \"Invalid Zip Code.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function checkzip(inputzip){\n if(!inputzip.value.match(/^([0-9]{5})$/)){\n document.getElementById(\"Zipcode\").innerHTML = \"Zipcode should be consisted of 5 numbers\"+\"<br>\";\n inputzip.value = \"\";\n return false;\n }\n else\n return true;\n}", "function ValidateZipCode(zipCode) \n{\n if (/(^\\d{5}$)/.test(zipCode))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validateZip () {\n\n isValid(zipInput);\n isZipValid= true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{5}$/.test(zipInput.value)) {\n isInvalid(zipInput);\n isZipValid = false;\n }\n }\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\t\r\n}", "function getZIP(placemark) {\n return _getPlacemarkAttribute(placemark, 'PostalCodeName');\n }", "function newZip() {\n var newZipValue = document.getElementById('zipValue').value;\n getZip(newZipValue);\n return newZipValue;\n }", "function checkZipcode() {\n var pattern = new RegExp(/^[0-9]{5}$/i);\n \n if (pattern.test(zipcodeInput.val())) {\n $(\"#zipcode_error_message\").hide();\n zipcodeInput.removeClass('error');\n }\n else {\n $(\"#zipcode_error_message\").html(\"Enter valid zipcode\");\n $(\"#zipcode_error_message\").show();\n zipcodeInput.addClass('error');\n error_zipcode = true;\n }\n }", "function validateZip(field, value) {\n const hint = document.getElementById('zip-hint');\n if(!isValidZip(value)) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "function validateCCZip(e){\n\tif($(\"#zip\").val()==''){\n\t\t$(\"<p class='error cc-error'>Please enter the zip code.</p>\").insertBefore($creditcard); \n\t} else if($(\"#zip\").val().length!=5 || isNaN($(\"#zip\").val())){\n\t\t$(\"<p class='error cc-error'>Zip code must be 5 digits long.</p>\").insertBefore($creditcard);\n\t}\n}", "function updateZip() {\n zipCode = \"zip=\" + zipcodeHomeInput.value + \",us&APPID=\" + appId;\n var url = baseUrl + zipCode + \"&units=imperial\";\n console.log(zipCode);\n sendRequest(url);\n}", "function checkZip() {\n\tvar zip = document.getElementById(\"zip\").value;\n\t\n\tif (zip == \"\"){\n\t} else {\n\t\tif (zip.length === 4) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid zip (four digits)\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function validateZipCode(){\r\n\r\n\tvar zip = document.getElementById(\"zipcode\");\r\n\tvar pZip = document.getElementById(\"valZip\");\r\n\t\r\n\tif (zip.value == \"\")\r\n\t{\r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode is required\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if (zip.value.length < 5 || zip.value.length > 10)\r\n\t{\r\n\t\t \r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode must be 5-10 characters\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tif(zip.value.length == 5)\r\n\t\t{\r\n\t\t\tzip.value = zip.value.concat(\"-\");\r\n\t\t}\r\n\t\tpZip.innerHTML = \r\n\t\t\"Valid ZipCode\";\r\n\t\tpZip.classList.remove(\"invalid\");\r\n\t\tpZip.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "getState(zipcode) {\n let state;\n if (zipcode >= 35000 && zipcode <= 36999) {\n state = 'Alabama';\n } else if (zipcode >= 99500 && zipcode <= 99999) {\n state = 'Alaska';\n } else if (zipcode >= 85000 && zipcode <= 86999) {\n state = 'Arizona';\n } else if (zipcode >= 71600 && zipcode <= 72999) {\n state = 'Arkansas';\n } else if (zipcode >= 90000 && zipcode <= 96699) {\n state = 'California';\n } else if (zipcode >= 80000 && zipcode <= 81999) {\n state = 'Colorado';\n } else if (\n (zipcode >= 6000 && zipcode <= 6389) ||\n (zipcode >= 6391 && zipcode <= 6999)\n ) {\n state = 'Connecticut';\n } else if (zipcode >= 19700 && zipcode <= 19999) {\n state = 'Delaware';\n } else if (zipcode >= 32000 && zipcode <= 34999) {\n state = 'Florida';\n } else if (\n (zipcode >= 30000 && zipcode <= 31999) ||\n (zipcode >= 39800 && zipcode <= 39999)\n ) {\n state = 'Georgia';\n } else if (zipcode >= 96700 && zipcode <= 96999) {\n state = 'Hawaii';\n } else if (zipcode >= 83200 && zipcode <= 83999) {\n state = 'Idaho';\n } else if (zipcode >= 60000 && zipcode <= 62999) {\n state = 'Illinois';\n } else if (zipcode >= 46000 && zipcode <= 47999) {\n state = 'Indiana';\n } else if (zipcode >= 50000 && zipcode <= 52999) {\n state = 'Iowa';\n } else if (zipcode >= 66000 && zipcode <= 67999) {\n state = 'Kansas';\n } else if (zipcode >= 40000 && zipcode <= 42999) {\n state = 'Kentucky';\n } else if (zipcode >= 70000 && zipcode <= 71599) {\n state = 'Louisiana';\n } else if (zipcode >= 3900 && zipcode <= 4999) {\n state = 'Maine';\n } else if (zipcode >= 20600 && zipcode <= 21999) {\n state = 'Maryland';\n } else if ((zipcode >= 1000 && zipcode <= 2799) || zipcode === 5501) {\n state = 'Massachusetts';\n } else if (zipcode >= 48000 && zipcode <= 49999) {\n state = 'Michigan';\n } else if (zipcode >= 55000 && zipcode <= 56899) {\n state = 'Minnesota';\n } else if (zipcode >= 38600 && zipcode <= 39999) {\n state = 'Mississippi';\n } else if (zipcode >= 63000 && zipcode <= 65999) {\n state = 'Missouri';\n } else if (zipcode >= 59000 && zipcode <= 59999) {\n state = 'Montana';\n } else if (zipcode >= 27000 && zipcode <= 28999) {\n state = 'North Carolina';\n } else if (zipcode >= 58000 && zipcode <= 58999) {\n state = 'North Dakota';\n } else if (zipcode >= 68000 && zipcode <= 69999) {\n state = 'Nebraska';\n } else if (zipcode >= 88900 && zipcode <= 89999) {\n state = 'Nevada';\n } else if (zipcode >= 3000 && zipcode <= 3899) {\n state = 'New Hampshire';\n } else if (zipcode >= 7000 && zipcode <= 8999) {\n state = 'New Jersey';\n } else if (zipcode >= 87000 && zipcode <= 88499) {\n state = 'New Mexico';\n } else if ((zipcode >= 10000 && zipcode <= 14999) || zipcode === 6390) {\n state = 'New York';\n } else if (zipcode >= 43000 && zipcode <= 45999) {\n state = 'Ohio';\n } else if (\n (zipcode >= 73000 && zipcode <= 73199) ||\n (zipcode >= 73400 && zipcode <= 74999)\n ) {\n state = 'Oklahoma';\n } else if (zipcode >= 97000 && zipcode <= 97999) {\n state = 'Oregon';\n } else if (zipcode >= 15000 && zipcode <= 19699) {\n state = 'Pennsylvania';\n } else if (zipcode >= 300 && zipcode <= 999) {\n state = 'Puerto Rico';\n } else if (zipcode >= 2800 && zipcode <= 2999) {\n state = 'Rhode Island';\n } else if (zipcode >= 29000 && zipcode <= 29999) {\n state = 'South Carolina';\n } else if (zipcode >= 57000 && zipcode <= 57999) {\n state = 'South Dakota';\n } else if (zipcode >= 37000 && zipcode <= 38599) {\n state = 'Tennessee';\n } else if (\n (zipcode >= 75000 && zipcode <= 79999) ||\n (zipcode >= 73301 && zipcode <= 73399) ||\n (zipcode >= 88500 && zipcode <= 88599)\n ) {\n state = 'Texas';\n } else if (zipcode >= 84000 && zipcode <= 84999) {\n state = 'Utah';\n } else if (zipcode >= 5000 && zipcode <= 5999) {\n state = 'Vermont';\n } else if (\n (zipcode >= 20100 && zipcode <= 20199) ||\n (zipcode >= 22000 && zipcode <= 24699) ||\n zipcode === 20598\n ) {\n state = 'Virgina';\n } else if (\n (zipcode >= 20000 && zipcode <= 20099) ||\n (zipcode >= 20200 && zipcode <= 20599) ||\n (zipcode >= 56900 && zipcode <= 56999)\n ) {\n state = 'Washington DC';\n } else if (zipcode >= 98000 && zipcode <= 99499) {\n state = 'Washington';\n } else if (zipcode >= 24700 && zipcode <= 26999) {\n state = 'West Virginia';\n } else if (zipcode >= 53000 && zipcode <= 54999) {\n state = 'Wisconsin';\n } else if (zipcode >= 82000 && zipcode <= 83199) {\n state = 'Wyoming';\n } else {\n state = 'none';\n console.log('No state found matching', zipcode);\n }\n return state;\n }", "function validateZIP(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{5}-?(\\d{4})?$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function chkzip() {\r\n\tvar mydata = document.getElementById(\"zipcode\");\r\n\tvar position = mydata.value.search(/\\d{5}/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El zipcode entrado esta en un formato incorrecto.\\nEl formato correcto es #####.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s])?\\d{4}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function getZipStringWithCell(cell) {\n var cellZipString = \"\";\n if(cell && (typeof cell.row == 'number') && (typeof cell.col == 'number') ) {\n var startCharCode = \"A\".charCodeAt(0);\n var lengthCharCode = \"Z\".charCodeAt(0) - \"A\".charCodeAt(0) + 1;\n if(!lengthCharCode){\n return \"\";\n }\n var divisor = cell.col;\n var remainder = 0;\n var first = true;\n do{\n remainder = Math.floor( divisor%lengthCharCode - (first?0:1) );\n divisor = Math.floor( divisor/lengthCharCode );\n cellZipString = String.fromCharCode(remainder+startCharCode) + cellZipString;\n first = false;\n }while(divisor);\n cellZipString = cellZipString + (cell.row+1);\n }\n return cellZipString;\n }", "function isItalianZipCode(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.cap.test(value);\n }\n return false;\n}", "function SiteAddressZipCode_Change()\n{\n\ttry\n\t{\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"function SiteAddressZipCode_Change\" );\n\t\tvar z = myGetValue( \"new_zippostalcode\" );\n\t\tif( z != null && z.length > 0 )\n\t\t{\n\t\t\tif( DebugModeSiteZipCode ) \n\t\t\t\twindow.alert( \"function SiteAddressZipCode_Change\\nnew_zippostalcode\\t\" + z );\n\t\t\tWrapperExtractCityStateFromZip( z, \"new_city\", \"new_county\", \"new_stateprovince\", \"new_countryregion\", \"new_ocountryregion\" ); \n\t\t}\n\t}\t\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function SiteAddressZipCode_Change error code \" + err );\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"1 name \" + err.name + \"\\n2 message\\t\" + err.message + \"\\n3 number\\t\" + err.number + \"\\n4 prototype\\t\" + err.prototype + \"\\n5 toString\\t\" + err.toString() );\n\t}\n}", "function searchZip() {\n event.preventDefault()\n userZip = document.getElementById('userZip').value;\n // Validate User Submission\n if (isNaN(userZip)) {\n console.log(\"Error: \" + userZip + \" is not a number. Please try again.\")\n return;\n }\n else if (userZip.length != 5) {\n console.log(\"Error: Please make sure you're using a 5 digit zip code\")\n return;\n };\n zipLookup(userZip);\n}", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function validateZipCode() {\r\n var code = document.getElementById(\"zip\");\r\n var regex = /^(?:6[0-9]{5})$/;\r\n if (!code.value.match(regex)) {\r\n code.style.borderColor = \"red\";\r\n document.getElementById(\"ValidZip\").style.display = \"block\";\r\n keycode = false;\r\n }\r\n else {\r\n keycode = true;\r\n code.style.borderColor = \"darkturquoise\";\r\n document.getElementById(\"ValidZip\").style.display = \"none\";\r\n }\r\n}", "function matchZipCodes(textToSearch) {\n // find sequence of 5 digits\n // empty slice makes a shallow copy\n var regResults = textToSearch.match(/\\d{5,5}/g);\n console.log(regResults);\n return regResults ? regResults.slice() : [];\n }", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function setZipCode(zipCode) {\n if (zipCode != null) {\n var coords = getCoordsFromZip(zipCode);\n createLocationData(coords.lat, coords.lon, zipCode, coords.cityName);\n } else {\n createLocationData(null, null, null, null);\n }\n}", "function onZipNUMChange(e) {\n e.target.classList.remove(\"not-valid\");\n e.target.classList.add(\"valid\");\n if (e.target.value.length === 5) {\n if (document.querySelector(\"#zip-error\")) {\n document.querySelector(\"#zip-error\").remove();\n }\n }\n}", "function zipCheck() {\n var zipLog = document.querySelector(\".zip\");\n var zip = response.zip;\n console.log(zip);\n\n zipLog.innerHTML += zip;\n }", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function isValidZipCode() {\r\n var x = document.getElementById(\"Code\");\r\n var regexs = /^\\d{6}$/; \r\n if (!x.value.match(regexs)) {\r\n document.getElementById('validZip').style.display = \"block\";\r\n document.getElementById('validZipSpace').style.display = \"block\";\r\n isCode = false;\r\n }\r\n else {\r\n document.getElementById('validZip').style.display = \"none\";\r\n document.getElementById('validZipSpace').style.display = \"none\";\r\n isCode = true;\r\n }\r\n}", "function isValidPostal(card) {\n zip.nextElementSibling.innerText = \"Must be a 5 digits\";\n return /^\\d{5}$/.test(card);\n}", "function getZip(lat, lon, callback) {\n var url = prepare_api_url(lat,lon);\n $.get(url, function (data) {\n\n var results = data.results[0];\n var addrs = results.address_components;\n console.log(addrs.length);\n\n var i = 0;\n var found = false;\n while(i < addrs.length && !found){\n found = (addrs[i].types[0] === \"postal_code\")? true : false;\n i++;\n }\n i--;\n\n var zip = addrs[i].long_name;\n callback(zip);\n\n\n\n });\n}", "function encode_digit(d, flag) {\n return d + 22 + 75 * (d < 26) - ((flag !== 0) << 5);\n // 0..25 map to ASCII a..z or A..Z \n // 26..35 map to ASCII 0..9\n }", "function isZipCode(strInput, intCountryCode) {\n\tvar re\n\tif (intCountryCode == 840) // USA\n\t\tre = /^\\d{5}([\\-]\\d{4})?$/;\n\telse if (intCountryCode == 124) // Canada\n\t\tre = /^[A-Z]\\d[A-Z][- |]\\d[A-Z]\\d$/i;\n\treturn (re.test(strInput));\n}", "function zipCodeValidation(postalCode) {\r\n var pattern = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\r\n if (!pattern.test(postalCode)) {\r\n displayError(`The postal code must be in the following format: C1A 1A7`);\r\n } else return pattern.test(postalCode);\r\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function getZipCode(lat, lon) {\n return geocoder.reverse({lat: lat, lon: lon}).then(function(res) {\n return res[0].zipcode;\n });\n}", "function validateZip(req, res, next) {\n let zip = req.params.zip;\n const aZip = Number(zip);\n if (zip.length != 5 || isNaN(aZip)) res.send(`Zip (${zip}) is invalid!`);\n if (!getZoos(zip)) {\n res.send(`${zip} does not exist in our records.`);\n } else if (getZoos(zip).length < 1) {\n res.send(`${zip} has no zoos.`);\n } else {\n next();\n }\n}", "function codeAddress(address) {\nconsole.log(document.getElementById('ZippyZip').value);\n //var address = document.getElementById('ZippyZip').value;\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == 'OK') {\n map.setCenter(results[0].geometry.location);\n var marker = new google.maps.Marker({\n map: map,\n position: results[0].geometry.location,\n zIndex:999999\n });\n\n } else {\n alert('Geocode was not successful for the following reason: ' + status);\n }\n });\n}", "function validateZip( zip )\n{ \n callWebService ( \"/validateZip/\" + zip, showCityState );\n} // end function validateZip" ]
[ "0.7411855", "0.74087983", "0.69555914", "0.69555914", "0.69477856", "0.6907515", "0.68813866", "0.68592626", "0.68517786", "0.68254465", "0.68043387", "0.67795885", "0.6768786", "0.66949826", "0.66823184", "0.66823184", "0.6635374", "0.66071427", "0.6530416", "0.6485722", "0.64817494", "0.6461058", "0.64359367", "0.6425738", "0.64142585", "0.63934267", "0.63565236", "0.63565236", "0.63510144", "0.63477814", "0.6340855", "0.6327716", "0.6296432", "0.6293219", "0.62846386", "0.6249793", "0.62490064", "0.6236716", "0.6229091", "0.62180203", "0.62040865", "0.6195464", "0.6188113", "0.6186978", "0.61763424", "0.6168013", "0.6158018", "0.6147903", "0.61153007", "0.6110827", "0.6050301", "0.6046293", "0.6028197", "0.6026402", "0.6022889", "0.6010499", "0.5988786", "0.5984055", "0.59762686", "0.5975408", "0.59554404", "0.59285146", "0.5923957", "0.58945763", "0.58590394", "0.5852928", "0.5831845", "0.5775523", "0.5774056", "0.57542133", "0.574482", "0.57238656", "0.57237923", "0.5723253", "0.57128924", "0.5712698", "0.57014287", "0.56986886", "0.56854045", "0.5667376", "0.56520516", "0.5626051", "0.5620844", "0.5619497", "0.5619497", "0.5619497", "0.5607901", "0.5607901", "0.5605738", "0.55867773", "0.5576734", "0.5566372", "0.5554628", "0.5541901", "0.5541379", "0.5541379", "0.55077505", "0.54962283", "0.54886687", "0.54881865" ]
0.6262763
35
4 digit zip code extension
function shipping_zip4 (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (presence_check(input)){ if (!check_allowed_char(input, "numeric", "conf1")){ error = "E26_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "zipCode4", "conf1")){ error = "E26_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; } else{ return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function validate_zip_code(type){\r\n var strValidChars = '0123456789';\r\n var zipcode_val = $('#'+type+'_zip_code_new').val();\r\n var flag = 1;\r\n \r\n //zipcode should be only 5 digit long\r\n if(zipcode_val.length < 5 || zipcode_val.length > 5){\r\n flag=0;\r\n }\r\n //if not numeric\r\n for(var i=0;i<zipcode_val.length;i++){\r\n strChar = zipcode_val.charAt(i);\r\n if (strValidChars.indexOf(strChar) == -1){\r\n flag=0;\r\n }\r\n }\r\n \r\n return flag;\r\n \r\n}", "function zip(string = '') {\n\treturn string.replace(/(\\w)(\\1{4,})/g, ($0, $1, $2, $$, $_) => $1 + `{${$2.length.toString(36)}}`);\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "isValidZip(zipCode){\n\t\tif(zipCode.length != 5 || (zipCode.match(/[a-z]/i))){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function zipCode(str) {\n var re = /^[0-9]{5}(?:-[0-9]{4})?$/; //-- Solution for bonus test\n //var re = /^\\d{5}$/;\n return re.test(str);\n}", "testZip (zip) {\n var regexzip =/^\\d+$/;\n return regexzip.test(zip)\n }", "function get_url_zip() {\n var zip = \"\";\n var keyvals = window.location.href.slice(window.location.href.indexOf(\"?\") + 1).split(\"&\");\n $.each( keyvals , function(i, val) {\n var parts = val.split(\"=\");\n if (parts[0] == \"zip\") {\n zip = parts[1];\n }\n });\n return (cfpb_hud_hca.check_zip(zip));\n }", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZipCodeValid (zip) {\r\n return /^\\d{5}$/.test(zip)\r\n}", "function checkZip(zip) {\n return /^\\d{5}$/.test(zip);\n}", "function GHValidateZipCode(source)\n{\n\tif (!ValidateRegular(source, \"\\\\d{5}(-\\\\d{4})?\"))\n\t{\n\t\tsource.select();\n\t\tsource.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function getZipValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"zipCode\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function isValidZip() {\n return /^[0-9]{5}$/.test(zip.value);\n}", "function testZip(zip) {\n var zipRegExp = new RegExp('^\\\\d{5}$');\n if (!zipRegExp.test(zip)) {\n throw new Error();\n }\n}", "function validZip(zip) {\n return zip.length === 5 && /^\\d{5}(-\\d{4})?$/.test(zip);\n}", "function isValidZipCode(str) {\n return /^\\d{5}$/g.test(str);\n}", "function isValidZipcode(zipcode) {\n zipcode = removeSpaces(zipcode);\n if (!(zipcode.length == 5 || zipcode.length == 9 || zipcode.length == 10)) return false;\n if ((zipcode.length == 5 || zipcode.length == 9) && !isNumeric(zipcode)) return false;\n if (zipcode.length == 10 && zipcode.search && zipcode.search(/^\\d{5}-\\d{4}$/) == -1) return false;\n return true;\n}", "function isZip(filename) {\n\n\t// last 4 characters in filename\n\tlet ss = filename.slice(filename.length-4, filename.length);\n\n\treturn ss === '.zip';\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function isZipCode(post)\n{\nregex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n if (regex.test(post))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function validateZip(theForm)\n{\n\tvar str = \"-\";\n zipStr = theForm.zipCode.value;\n if (zipStr.length != 5)\n {\n \tif (zipStr.length == 10 && zipStr.charAt(5) == \"-\") {\n \t\t\n \t} else {\n \talert(\"Invalid zip code syntax.\");\n \treturn false; // abort submission\n \t}\n }\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++)\n {\n aChar = zipStr.charAt(i);\n if (!isDigit(aChar) && i != 5) {\n \talert(\"char \" + aChar + \" is NOT a digit\");\n return false; // abort submission\n }\n }\n return true; // proceed with submission\n}", "function checkZip() {\n\tvar zip = document.getElementById(\"zip\").value;\n\t\n\tif (zip == \"\"){\n\t} else {\n\t\tif (zip.length === 4) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid zip (four digits)\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function zipvalidate(postcode){\n return /^[12346]\\d{5}$/.test(postcode);\n}", "function validateZipCode(field) {\n if (field === undefined || field === null) {\n return false;\n }\n var zip_regexp = /^[0-9]+(?:[-\\s]*)?(?:[0-9]*)?$/;\n if (zip_regexp.test(field) !== true) {\n return false;\n }\n return validateMinLength(field, 5) && validateMaxLength(field, 10);\n}", "function isValidZipcode(zipcode) {\r\n return /(^\\d{5}$)/.test(zipcode) && isBaltimoreZipcode(zipcode); \r\n}", "function validUSZip(zip){\r\n\tvar m;\r\n\tm=zip.match( \"^([0-9]{5})-([0,9]{4})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{5})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{9})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\treturn false;\r\n}", "function zip_checker() {\n const zip_value = zip.value;\n if (zip_value.match(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/)) {\n errorMessageZip.innerText = \"\";\n register.removeAttribute(\"disabled\");\n } else {\n errorMessageZip.innerText = \"Invalid Zip Code.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function validateZip(form) {\n var zipStr = form.zip.value;\n\n if (zipStr.length !== 5 && zipStr.length !== 10) {\n error('Lenght must be 5 or 10');\n return false // abort submission\n }\n\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++) {\n var aChar = zipStr.charAt(i);\n\n if (i === 5 && aChar !== '-') {\n error('It should contains a \"-\": ddddd-dddd');\n return false;\n }\n\n if (i !== 5 && !isDigit(aChar)) {\n error('char is not a digit: ' + aChar);\n return false\n }\n }\n\n return true // proceed with submission\n}", "function validateZipCode(){\n\tvar nameFormat = /^\\d{5}$/; // Regex to indicate 5 numerical digits.\n\tvar errorFormat = /Invalid Zip Code<br>/;\n\tvar zipCode = document[formName][\"zipCode\"].value;\n\t\n\tvar errorString=\"\";\n\tif(!nameFormat.test(zipCode)) {\n\t\tif(!errorFormat.test(document.getElementById(p2).innerHTML))\n\t\t\terrorString += \"Invalid Zip Code<br>\";\n\t}\n\telse if(errorFormat.test(document.getElementById(p2).innerHTML)) {\n\t\tvar temp = document.getElementById(p2).innerHTML.split(errorFormat);\n\t\tvar t = \"\";\n\t\tfor (var i = 0 ; i < temp.length; i++) {\n\t\t\tt += temp[i];\n\t\t}\n\t document.getElementById(p2).innerHTML = t;\n\t}\n\tdocument.getElementById(p2).innerHTML += errorString;\n\t\n}", "function parseZip64ExtendedInformation(data) {\n var size, compressedSize, offset, diskNumStart;\n\n if(data.length >= Constants.EF_ZIP64_SCOMP) {\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\n if(_entryHeader.size === Constants.EF_ZIP64_OR_32) {\n _entryHeader.size = size;\n }\n }\n if(data.length >= Constants.EF_ZIP64_RHO) {\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\n if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\n _entryHeader.compressedSize = compressedSize;\n }\n }\n if(data.length >= Constants.EF_ZIP64_DSN) {\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\n if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) {\n _entryHeader.offset = offset;\n }\n }\n if(data.length >= Constants.EF_ZIP64_DSN+4) {\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\n if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\n _entryHeader.diskNumStart = diskNumStart;\n }\n }\n }", "function validateZip () {\n var text = $('#zip').val();\n if (!text) return true;\n \n var isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(text);\n \n if (isValidZip) {\n $('#zip').removeClass(\"invalid\");\n return true;\n }\n \n $('#message').html(\"Invalid zip code\");\n $('#zip').addClass(\"invalid\");\n return false;\n}", "function getZipCodeName(intCountryCode) {\n\tif (intCountryCode == 840) // USA\n\t\treturn 'Zip';\n\telse// if (intCountryCode == 124) // Canada\n\t\treturn 'Postal';\n}", "function isZipCode(fieldVal) {\r\r\r\n var strValidChars = \"0123456789\";\r\r\r\n var blnResult = true;\r\r\r\n var fldLength = fieldVal.length;\r\r\r\n if(fldLength == 5) {\r\r\r\n for( i = 0; i < fldLength; i++) {\r strChar = fieldVal.charAt(i);\r\r\r\n if(strValidChars.indexOf(strChar) == -1) {\r blnResult = false;\r\r\r\n }\r\r\r\n }\r\r\r\n } else {\r blnResult = false;\r\r\r\n }\r\r\r\n if(blnResult == false) {\r\r\r\n return false;\r\r\r\n } else {\r\r\r\n return true;\r\r\r\n }\r\r\r\n}\r\r// This function is used to open a pop up window. User need to pass only two parameters", "function parseZip64ExtendedInformation(data) {\r\n var size, compressedSize, offset, diskNumStart;\r\n\r\n if(data.length >= Constants.EF_ZIP64_SCOMP) {\r\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\r\n if(_entryHeader.size === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.size = size;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_RHO) {\r\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\r\n if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.compressedSize = compressedSize;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_DSN) {\r\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\r\n if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.offset = offset;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_DSN+4) {\r\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\r\n if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\r\n _entryHeader.diskNumStart = diskNumStart;\r\n }\r\n }\r\n }", "function sanitizeZip(zip, city, state, country) {\n if(zip === '' && country === \"United States\") return zipcodes.lookupByName(city, state)[0].zip;\n if(zip === '' && country === \"Canada\") return '';\n if(zip !== '' && country === 'United States') return zip.substring(0,5);\n if(zip !== '' && country === \"Canada\") return zip.slice(0,3);\n}", "function zipvalidateBest(postcode){\n return /^[12346]\\d{5}$/.test(postcode)\n}", "function validateZip(field, value) {\n const hint = document.getElementById('zip-hint');\n if(!isValidZip(value)) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "function isOkzipCode() {\n //we control de length and the digits were numbers matching their value\n // >9999 --> 5 digits or more && < 100000 less than 5 digits\n if (zipCode.value > 9999 && zipCode.value < 100000 ) {\n cleanErrorMessage(zipCode);\n return true;\n } else if (ccnum.value.includes(' ')) {\n cleanErrorMessage(zipCode);\n errorIndication(zipCode);\n return false;\n } else {\n errorIndication(zipCode);\n return false;\n }\n }", "function validateZip (zipValue) {\n\t\tif (!zipValue.length =5) {\n\t\t\tconsole.log(\"zip is not 5\");\n\t\t\treturn false;\n\t\t}\n\t\tconsole.log(zipValue);\n\t\tconsole.log(zipValue.length);\n\t\t\n\t\tfor (i=0; i < 5; i++) {\n\t\t\t if (isDigit(zipValue.charCodeAt(i))) {\n\t\t\t \t \n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn false;\n\t\t\t }\n\t\t}\n\t\treturn true;\n\t\t// Raine: If the function makes it this far, it will return undefined! That's not good.\n\t\t// Since it's a boolean function, it should always return true or false. David: done\n\t}", "function updateZipcode(zip){\n zipCode.value = zip;\n }", "function chkZip(inZip){\n\tvar zipRegEx = /^\\d{5}$|^\\d{5}-\\d{4}$/;\n\tvar errorString = \"Please provide a valid zip code\";\n\t\n\tif(inZip.length == 0){\n\t\treturn true;\n\t}else{\n\t\tif(zipRegEx.test(inZip) !== true){\n\t\t\treturn errorString;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function NzExtendedMark() { }", "function zipcodeChecker(zipcode) {\n return zipcode > 20000;\n}", "function validateZipCode() {\n var e = document.getElementById(\"Zip\").value;\n if (isNumber(e) && e.length == 5) {\n return true;\n } else {\n return false;\n }\n}", "function zipCheck() {\n var zipLog = document.querySelector(\".zip\");\n var zip = response.zip;\n console.log(zip);\n\n zipLog.innerHTML += zip;\n }", "function zipcodeIsValid (zipcode) {\n\t//if zipcode isn't 5 long, automatically wrong\n\tif (zipcode.length != 5) {\n\t\treturn false;\n\t} else {\n\t\t//loop through 5 chars, and make sure each are a number\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t//if the current character is a non-number\n\t\t\tif(zipcode.charCodeAt(i) < 48 || zipcode.charCodeAt(i) > 57) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//if there was not a single non-number and the length is 5, return true\n\t\treturn true;\n\t}\n}", "function formatZipcodeForDb(zipcode) {\n let output = zipcode.trim().replace(/\\s/g, '')\n\n return `${output.slice(0, 3)} ${output.slice(3)}`\n}", "validateZipCode(zipcode) {\n let re = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n return re.test(zipcode);\n }", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function getZipCodes(person){\n return person[19];\n }", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function validateZip () {\n\n isValid(zipInput);\n isZipValid= true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{5}$/.test(zipInput.value)) {\n isInvalid(zipInput);\n isZipValid = false;\n }\n }\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function validateZIP(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{5}-?(\\d{4})?$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function IsValidUSzipcode(zip) {\n var pattern = new RegExp(/(^\\d{5}$)|(^\\d{5}\\-?\\d{4}$)/);\n return pattern.test(zip);\n}", "function validateCCZip(e){\n\tif($(\"#zip\").val()==''){\n\t\t$(\"<p class='error cc-error'>Please enter the zip code.</p>\").insertBefore($creditcard); \n\t} else if($(\"#zip\").val().length!=5 || isNaN($(\"#zip\").val())){\n\t\t$(\"<p class='error cc-error'>Zip code must be 5 digits long.</p>\").insertBefore($creditcard);\n\t}\n}", "function encode_digit(d, flag) {\n return d + 22 + 75 * (d < 26) - ((flag !== 0) << 5);\n // 0..25 map to ASCII a..z or A..Z \n // 26..35 map to ASCII 0..9\n }", "function validateZipCode(){\r\n\r\n\tvar zip = document.getElementById(\"zipcode\");\r\n\tvar pZip = document.getElementById(\"valZip\");\r\n\t\r\n\tif (zip.value == \"\")\r\n\t{\r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode is required\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if (zip.value.length < 5 || zip.value.length > 10)\r\n\t{\r\n\t\t \r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode must be 5-10 characters\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tif(zip.value.length == 5)\r\n\t\t{\r\n\t\t\tzip.value = zip.value.concat(\"-\");\r\n\t\t}\r\n\t\tpZip.innerHTML = \r\n\t\t\"Valid ZipCode\";\r\n\t\tpZip.classList.remove(\"invalid\");\r\n\t\tpZip.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s])?\\d{4}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function newZip() {\n var newZipValue = document.getElementById('zipValue').value;\n getZip(newZipValue);\n return newZipValue;\n }", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function encode_digit(d, flag) {\n\t\treturn d + 22 + 75 * (d < 26) - ((flag != 0) << 5);\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function getName(phrase) {\n var md = forge.md.sha256.create();\n for(var n=0; n <100; n++)\n md.update(phrase);\n return md.digest().toHex()+ '.zip';\n}", "function ValidateZipCode(zipCode) \n{\n if (/(^\\d{5}$)/.test(zipCode))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function getZIP(placemark) {\n return _getPlacemarkAttribute(placemark, 'PostalCodeName');\n }", "function toZip(){\n var zipCode = document.getElementById(\"zip\").value;\n console.log(zipCode);\n}", "function SiteAddressZipCode_Change()\n{\n\ttry\n\t{\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"function SiteAddressZipCode_Change\" );\n\t\tvar z = myGetValue( \"new_zippostalcode\" );\n\t\tif( z != null && z.length > 0 )\n\t\t{\n\t\t\tif( DebugModeSiteZipCode ) \n\t\t\t\twindow.alert( \"function SiteAddressZipCode_Change\\nnew_zippostalcode\\t\" + z );\n\t\t\tWrapperExtractCityStateFromZip( z, \"new_city\", \"new_county\", \"new_stateprovince\", \"new_countryregion\", \"new_ocountryregion\" ); \n\t\t}\n\t}\t\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function SiteAddressZipCode_Change error code \" + err );\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"1 name \" + err.name + \"\\n2 message\\t\" + err.message + \"\\n3 number\\t\" + err.number + \"\\n4 prototype\\t\" + err.prototype + \"\\n5 toString\\t\" + err.toString() );\n\t}\n}", "function chkzip() {\r\n\tvar mydata = document.getElementById(\"zipcode\");\r\n\tvar position = mydata.value.search(/\\d{5}/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El zipcode entrado esta en un formato incorrecto.\\nEl formato correcto es #####.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function isValidZipCode() {\r\n var x = document.getElementById(\"Code\");\r\n var regexs = /^\\d{6}$/; \r\n if (!x.value.match(regexs)) {\r\n document.getElementById('validZip').style.display = \"block\";\r\n document.getElementById('validZipSpace').style.display = \"block\";\r\n isCode = false;\r\n }\r\n else {\r\n document.getElementById('validZip').style.display = \"none\";\r\n document.getElementById('validZipSpace').style.display = \"none\";\r\n isCode = true;\r\n }\r\n}", "get zip() { return this._zip; }", "function zipCodeValidation(postalCode) {\r\n var pattern = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\r\n if (!pattern.test(postalCode)) {\r\n displayError(`The postal code must be in the following format: C1A 1A7`);\r\n } else return pattern.test(postalCode);\r\n}", "function checkZipcode() {\n var pattern = new RegExp(/^[0-9]{5}$/i);\n \n if (pattern.test(zipcodeInput.val())) {\n $(\"#zipcode_error_message\").hide();\n zipcodeInput.removeClass('error');\n }\n else {\n $(\"#zipcode_error_message\").html(\"Enter valid zipcode\");\n $(\"#zipcode_error_message\").show();\n zipcodeInput.addClass('error');\n error_zipcode = true;\n }\n }", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\t\r\n\tvar test2 = lkup_binary_m(\"lkup4\",\"zipCode\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zipCode\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"lkup4\",\"zipCode\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zipCode\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function updateZip() {\n zipCode = \"zip=\" + zipcodeHomeInput.value + \",us&APPID=\" + appId;\n var url = baseUrl + zipCode + \"&units=imperial\";\n console.log(zipCode);\n sendRequest(url);\n}", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function LZ(n){\treturn (n > 9 ? n : '0' + n); }", "function onZipNUMChange(e) {\n e.target.classList.remove(\"not-valid\");\n e.target.classList.add(\"valid\");\n if (e.target.value.length === 5) {\n if (document.querySelector(\"#zip-error\")) {\n document.querySelector(\"#zip-error\").remove();\n }\n }\n}", "function validateZipCode() {\r\n var code = document.getElementById(\"zip\");\r\n var regex = /^(?:6[0-9]{5})$/;\r\n if (!code.value.match(regex)) {\r\n code.style.borderColor = \"red\";\r\n document.getElementById(\"ValidZip\").style.display = \"block\";\r\n keycode = false;\r\n }\r\n else {\r\n keycode = true;\r\n code.style.borderColor = \"darkturquoise\";\r\n document.getElementById(\"ValidZip\").style.display = \"none\";\r\n }\r\n}", "function allnumeric()\n{ \n\tvar uzip = document.registration.zip;\n\tvar numbers = /^[0-9]+$/;\n\tif(uzip.value.match(numbers))\n\t{\n\t\t// Focus goes to next field i.e. email.\n\t\tdocument.registration.email.focus();\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert('ZIP code must have numeric characters only');\n\t\tuzip.focus();\n\t\treturn false;\n\t}\n}", "function create_extension_pattern(purpose) {\n\t// One-character symbols that can be used to indicate an extension.\n\tvar single_extension_characters = 'x\\uFF58#\\uFF03~\\uFF5E';\n\n\tswitch (purpose) {\n\t\t// For parsing, we are slightly more lenient in our interpretation than for matching. Here we\n\t\t// allow \"comma\" and \"semicolon\" as possible extension indicators. When matching, these are\n\t\tcase 'parsing':\n\t\t\tsingle_extension_characters = ',;' + single_extension_characters;\n\t}\n\n\treturn RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + '|' + '[ \\xA0\\\\t,]*' + '(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|' +\n\t// \"доб.\"\n\t'\\u0434\\u043E\\u0431|' + '[' + single_extension_characters + ']|int|anexo|\\uFF49\\uFF4E\\uFF54)' + '[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*' + CAPTURING_EXTN_DIGITS + '#?|' + '[- ]+([' + _constants__WEBPACK_IMPORTED_MODULE_0__[\"VALID_DIGITS\"] + ']{1,5})#';\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"city_state_zip\",\"zip\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zip\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"city_state_zip\",\"zip\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zip\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function validateZip(req, res, next) {\n let zip = req.params.zip;\n const aZip = Number(zip);\n if (zip.length != 5 || isNaN(aZip)) res.send(`Zip (${zip}) is invalid!`);\n if (!getZoos(zip)) {\n res.send(`${zip} does not exist in our records.`);\n } else if (getZoos(zip).length < 1) {\n res.send(`${zip} has no zoos.`);\n } else {\n next();\n }\n}", "function isItalianZipCode(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.cap.test(value);\n }\n return false;\n}", "function checkzip(inputzip){\n if(!inputzip.value.match(/^([0-9]{5})$/)){\n document.getElementById(\"Zipcode\").innerHTML = \"Zipcode should be consisted of 5 numbers\"+\"<br>\";\n inputzip.value = \"\";\n return false;\n }\n else\n return true;\n}", "function create_extension_pattern(purpose) {\n // One-character symbols that can be used to indicate an extension.\n var single_extension_characters = \"x\\uFF58#\\uFF03~\\uFF5E\";\n\n switch (purpose) {\n // For parsing, we are slightly more lenient in our interpretation than for matching. Here we\n // allow \"comma\" and \"semicolon\" as possible extension indicators. When matching, these are\n case 'parsing':\n single_extension_characters = ',;' + single_extension_characters;\n }\n\n return RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + '|' + \"[ \\xA0\\\\t,]*\" + \"(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|\" + // \"доб.\"\n \"\\u0434\\u043E\\u0431|\" + '[' + single_extension_characters + \"]|int|anexo|\\uFF49\\uFF4E\\uFF54)\" + \"[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*\" + CAPTURING_EXTN_DIGITS + '#?|' + '[- ]+([' + VALID_DIGITS + ']{1,5})#';\n}", "function getSupportingHexagram(hexagramCode){\n\treturn hexagramCode.substring(1, 4) + hexagramCode.substring(2,\t5);\n}", "isZip(val) {\n if (!this.isString(val))\n return false;\n\n return (val.match(/^\\d{5}$/) !== null ||\n val.match(/^\\d{5}-\\d{4}$/) !== null);\n }" ]
[ "0.6625165", "0.6546688", "0.6442002", "0.6442002", "0.6430643", "0.64253825", "0.63797796", "0.6248388", "0.6221701", "0.6189001", "0.61838704", "0.6180855", "0.6180855", "0.61433303", "0.6141878", "0.6042912", "0.60285723", "0.60099375", "0.60014594", "0.5990262", "0.59873587", "0.59848017", "0.59772974", "0.59718627", "0.59652245", "0.59571", "0.5922744", "0.5919726", "0.5919384", "0.59089535", "0.5904909", "0.5879151", "0.5874978", "0.5843473", "0.57905686", "0.5790108", "0.57851833", "0.5770559", "0.57492", "0.57467675", "0.5741894", "0.5739873", "0.57340574", "0.57067734", "0.5683579", "0.5677476", "0.56750363", "0.5669343", "0.56688774", "0.5653635", "0.5652052", "0.5648787", "0.5638239", "0.56279176", "0.5624965", "0.55973595", "0.5568547", "0.55657107", "0.55657107", "0.55604124", "0.5544785", "0.5527164", "0.5525293", "0.5499772", "0.5481766", "0.54815114", "0.5472615", "0.54532677", "0.54532677", "0.54532677", "0.5440975", "0.5432849", "0.5417937", "0.5417937", "0.5417", "0.54009974", "0.537317", "0.53582054", "0.53381926", "0.53294224", "0.53192145", "0.5310042", "0.5302987", "0.5302475", "0.53008085", "0.5272504", "0.5264857", "0.5261715", "0.5261715", "0.52555907", "0.52426946", "0.5214171", "0.51918674", "0.5191117", "0.51827693", "0.5147118", "0.5143267", "0.51121974", "0.5107197", "0.509016" ]
0.59193784
29
verification Mailing address integration functions
function Verfication_companyName_Shipping_address (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!presence_check(input)){ error = "E27_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkEmail() {}", "function verifyemail(addr){\n//\tif (document.layers||document.all){\n\t\treturn checkemail(addr);\n//\t}else{\n//\t\treturn true;\n//\t}\n}", "function simpleEmailValidation(emailAddress) {\n\n}", "function validateEmailCheck(mailAddr){\n var mail = document.getElementById(mailAddr);\n if (mail.disabled) \n return true;\n var str = mail.value;\n if (str == \"\") \n return true;\n var message = \"\";\n var errFlag = true;\n var at = \"@\"\n var dot = \".\"\n var lat = str.indexOf(at)\n var lstr = str.length\n var ldot = str.indexOf(dot)\n var message = \"\"\n \n if (lat == -1) {\n message = LANG_LOCALE['10868'];\n errFlag = false\n }\n else \n if (lat == 0 || ((lat + 1) == lstr)) {\n message = LANG_LOCALE['11258'];\n errFlag = false\n }\n else \n if (ldot == -1) {\n message = LANG_LOCALE['10867'];\n errFlag = false\n }\n else \n if (ldot == 0 || ((ldot + 1) == lstr)) {\n message = LANG_LOCALE['11257'];\n errFlag = false\n }\n else \n if (str.indexOf(at, (lat + 1)) != -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.substring(lat - 1, lat) == dot || str.substring(lat + 1, lat + 2) == dot) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.indexOf(dot, (lat + 2)) == -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n else \n if (str.indexOf(\" \") != -1) {\n message = LANG_LOCALE['11256'];\n errFlag = false\n }\n var errFieldId = mailAddr + \"Err\";\n if (!errFlag) {\n alert(message);\n mail.focus();\n }\n return errFlag;\n}", "function emailCheck(){\n return false;\n }", "function emailVerification(myForm) {\r\n\tre = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/\r\n\tif (re.test(myForm.emailAddr.value)) {\r\n\t\tdocument.getElementById(\"email\").innerHTML= \"Thanks \"+myForm.emailAddr.value;\t\r\n\t}\r\n\telse{\r\n\t\talert(\"Invalid email address\")\r\n\t}\r\n}", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(compMail.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkEmailAddy(){\n var addy = document.email.address.value;\n var emailRe = /^[a-zA-Z][^@ .]*(\\.[^@ .]+)*@[^@ .]+\\.[^@ .]+(\\.[^@ .]+)*$/;\n if(emailRe.test(addy)) {\n return true;\n }\n else {\n alert('Your address did not match the expected form: [email protected]\\n\\nPlease re-enter your address.');\n return false;\n }\n}", "function testEmail (event){\n let regexEmail = /(?:[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+\\/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])/g;\n if (regexEmail.test(emailRecieved.value)) {\n emailTagRecieved.classList.add('emailCorrect');\n emailTagRecieved.classList.remove('emailIncorrect');\n checkEmail = true;\n } else {\n emailTagRecieved.classList.add('emailIncorrect');\n emailTagRecieved.classList.remove('emailCorrect');\n checkEmail = false;\n }\n}", "function emailQualifies(){\n\t\t\n\t\t// Get the ID of the email holder and store it in emailOption.\n\t\tvar emailOption = document.getElementById(\"email\").value;\n\t\t\n\t\t// Store the email regex checker in a var.\n\t\tvar emailRegex = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\n\t\t\n\t\t// Test if the email entered passes the regex test.\n\t\tvar emailValid = emailRegex.test(emailOption);\n\t\t\n\t\t// If its a valid email.. continue,\n\t\tif(emailValid){\n\t\t\treturn true;\n\t\t}\n\t\t// else return an error.\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t} // End emailQualifies.", "function validate_email(field,alerttxt)\r\n{\r\n\tif (/^\\w+([\\+\\.-]?\\w+)*@\\w+([\\+\\.-]?\\w+)*(\\.\\w{2,6})+$/.test(field.value))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tshow_it(field,alerttxt)\r\n\t\treturn false;\r\n\t}\r\n}", "function checkEmail(address) {\n return address.match(/^[^0-9][email protected]$/);\n }", "function checkEmail(emailAddress) {\n var sQtext = '[^\\\\x0d\\\\x22\\\\x5c\\\\x80-\\\\xff]';\n var sDtext = '[^\\\\x0d\\\\x5b-\\\\x5d\\\\x80-\\\\xff]';\n var sAtom = '[^\\\\x00-\\\\x20\\\\x22\\\\x28\\\\x29\\\\x2c\\\\x2e\\\\x3a-\\\\x3c\\\\x3e\\\\x40\\\\x5b-\\\\x5d\\\\x7f-\\\\xff]+';\n var sQuotedPair = '\\\\x5c[\\\\x00-\\\\x7f]';\n var sDomainLiteral = '\\\\x5b(' + sDtext + '|' + sQuotedPair + ')*\\\\x5d';\n var sQuotedString = '\\\\x22(' + sQtext + '|' + sQuotedPair + ')*\\\\x22';\n var sDomain_ref = sAtom;\n var sSubDomain = '(' + sDomain_ref + '|' + sDomainLiteral + ')';\n var sWord = '(' + sAtom + '|' + sQuotedString + ')';\n var sDomain = sSubDomain + '(\\\\x2e' + sSubDomain + ')*';\n var sLocalPart = sWord + '(\\\\x2e' + sWord + ')*';\n var sAddrSpec = sLocalPart + '\\\\x40' + sDomain; // complete RFC822 email address spec\n var sValidEmail = '^' + sAddrSpec + '$'; // as whole string\n\n var reValidEmail = new RegExp(sValidEmail);\n\n if(reValidEmail.test(emailAddress)== true) {\n return true;\n }else{\n alert(\"Please input a valid email address!\")\n return false;\n }\n}", "function Checkaffiliate()\r\n{\r\n\tif(document.invite.emailaddresses.value==\"\")\r\n\t{\r\n\t\talert(lng_plsenteremailadd);\r\n\t\tdocument.invite.emailaddresses.focus();\r\n\t\treturn false;\r\n\t}\r\n\telse\r\n\t{\r\n\t\tvalues = document.invite.emailaddresses.value;\r\n\t\tvalues2 = values.split(\",\");\r\n\t\tfor(i=0;i<values2.length;i++)\r\n\t\t{\r\n\t\t\tif(!validate_email2(values2[i],lng_entervalidemail))\r\n\t\t\t\t{\r\n\t\t\t\t\tdocument.invite.emailaddresses.focus();\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function isMailingAddressProvided(customerForm)\n{\n var provided = true;\n\n if (customerForm.address1.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.city.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.state.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.zipcode.value == \"\")\n {\n provided = false;\n }\n\n return provided;\n}", "function emailCheck () {\n var emailResultTest = reEmail.test(userEmail.value);\n if (emailResultTest === true) {\n emailResult = true; \n } else {\n emailResult = false; \n }\n}", "function verifMail(){\n email=$(\"#email\");\n var regex = /^[a-zA-Z0-9._-]+@[a-z0-9._-]{2,}\\.[a-z]{2,4}$/;\n if(regex.test(email.value)){\n surligne(email, false);\n return false;\n }else{\n surligne(email, true);\n return true;\n }\n}", "function sendVerification(email, callback) {\n SES.verifyEmailIdentity({ EmailAddress: email }, (err) => {\n callback(err || 'Verification email sent. Please verify it.');\n });\n}", "function echeck(myid) {\r\n\t\tstr=myid.value\r\n\t\t\r\n\t\tvar at=\"@\"\r\n\t\tvar dot=\".\"\r\n\t\tvar lat=str.indexOf(at)\r\n\t\tvar lstr=str.length\r\n\t\tvar ldot=str.indexOf(dot)\r\n\t var emailresult = true;\r\n\t \r\n\t\tif (str.indexOf(at)==-1){\r\n\t\t emailresult=false;\r\n\t\t\t}\r\n\r\n\t\tif (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){\r\n\t\t emailresult=false;\r\n\t\t}\r\n\r\n\t\tif (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){\r\n\t\t emailresult=false;\r\n\t\t}\r\n\r\n\t\t if (str.indexOf(at,(lat+1))!=-1){\r\n\t\t emailresult=false;\r\n\t\t }\r\n\r\n\t\t if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){\r\n\t\t emailresult=false;\r\n\t\t }\r\n\r\n\t\t if (str.indexOf(dot,(lat+2))==-1){\r\n\t\t emailresult=false;\r\n\t\t }\r\n\t\t\r\n\t\t if (str.indexOf(\" \")!=-1){\r\n\t\t emailresult=false;\r\n\t\t }\r\n\t\t \terrormessagefieldname=myid.id + \"-display\";\r\n\t\t\tif (str !='' && emailresult==false)\r\n\t\t\t\t{\r\n\t\t\t\terrormessagefieldname=myid.id + \"-display\";\r\n\t\t\t\tdocument.getElementById(errormessagefieldname).innerHTML=\"Enter a valid Email ID\";\r\n\t\t\t\tdocument.getElementById(errormessagefieldname).style.color=\"#F00\";\r\n\t\t\t\terrtype=\"unfinished\"\r\n\t\t\t\tmyid.focus();\r\n\t\t myid.select();\r\n\t\t\t\t}\r\n \t\t\telse\r\n\t\t\t {\tdocument.getElementById(errormessagefieldname).innerHTML=\"\";\r\n\t\t\t\tdocument.getElementById(errormessagefieldname).style.color=\"#FFF\";\r\n\t\t\t\terrtype=\"finished\"\r\n\t\t\t\t\r\n\t\t\t }\r\n\t\t\treturn emailresult; \r\n\t}", "function verifyEmail(req, res){\n var email = req.body.email;\n var userid = req.body.userid;\n var name = req.body.fname;\n\n var code = md5(email);\n //send email to \"email\"\n var mailOptions = {\n from: '\"EzPlan\" <[email protected]>',\n to: email,\n subject: name + ', confirm your email',\n text: \"What's up \" + name + \", Welcome to Ezplan! We just need you to do 1 more thing...Click this link to confirm your email: http://ezplan.herokuapp.com/verify/\" + code,\n html: \"<h1>What's up \" + name + \",</h1><br><p>Welcome to <b>Ezplan</b>!</p> <p>We just need you to do 1 more thing...Click this <a href='http://ezplan.herokuapp.com/verify/\" + code +\"'>link</a> to confirm your email.</p>\"\n }\n\n transporter.sendMail(mailOptions, function(error, info){\n if(error){\n return res.send(error);\n }\n res.send(info.response);\n });\n\n}", "function checkMail(em) \r{\r\tvar error = \"\";\r\t\r\t// Valida el email\r\treg = /^(.+)@(.+)\\.(.{2,3})$/;\r\r\tif (!reg.test(em)) \r\t{\r\t\tdocument.getElementById(\"maillabel\").className = \"error\";\r\t\terror = \"<b>Invalid e-mail</b>\";\r\t}\r\r\treturn error;\r}", "function mailConfirmation(user, info, form, mail, callback) {\n var msg = \"Dear \" + form.firstName + \" \" + form.lastName + \"\\n\\n\";\n msg += \"Thank you for your purchase of \" + form.shares + \" shares on Pool Play.\\n\";\n msg += \"You've been charged $\" + info.price + \".00 for this purchase.\\n\";\n msg += \"If you have any questions, don't hesitate to contact us!\\n\\n\";\n msg += \"Thanks,\\n\";\n msg += \" The Pool Play team\";\n console.log(\"mailto: \" + form.email);\n var mailInfo = {\n from: \"Pool Play <[email protected]>\",\n to: form.email,\n subject: \"Confirmation of your Pool Play purchase\",\n text: msg\n };\n \n var smtpTransport = mail.createTransport(\"SMTP\", {\n service: \"Gmail\",\n auth: {\n user: \"[email protected]\",\n pass: \"165198795\"\n }\n });\n smtpTransport.sendMail(mailInfo, function(error, response) {\n if (error) {\n console.log(error);\n } else {\n console.log(\"Message sent: \" + response.message);\n }\n callback();\n });\n}", "function emailTest(email){ // create function emailTest assign email parameter\n var userName = /(^[a-zA-Z])[a-zA-Z0-9_]+@[a-zA-Z0-9]+\\.[a-zA-Z]{1,}$/ // var userName tests the email to verify the input. ^ checks that the first characters are letters. then it tests that the \n \t\t\t\t\t// letters can be capital or lower case, that there is an @ sign, that the next charcters are letters (capital and lower)\n if (check.test(email)){ //next checks that there is a dot, then letters (again capital and lower) the 1 makes sure there is a least letter after the dot\n \talert(\"true\"); \t\t// check.test varifies the email input by user, if it \n } else{\t\t\t\t\t// email address has all of input varified, an alert will \n \talert(\"false\"); \t// display true, if not, the alert will says false\n }\n}", "function ValidateEmail()\n {\n var uemail = document.registration.email;\n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(uemail.value.match(mailformat))\n {\n document.registration.address.focus();\n return true;\n }\n else\n {\n alert(\"You have entered an invalid email address!\");\n uemail.focus();\n return false;\n }\n }", "function emailCheck() {\r\n\tvar email=document.form1.user_email;\r\n\tvar phrase = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n\tif(email.value.match(phrase))\r\n\t{\r\n\t\tconsole.log(\"Email Verified\");\r\n\t\treturn true;\r\n\t}\r\n\telse {\r\n\t\tconsole.log(\"Your Email Id is not correct!\");\r\n\t\talert(\"Email ID is Incorrect, please Enter Correct Email-ID!\");\r\n\t\temail.focus();\r\n\t\treturn false; \r\n\t}\r\n}", "function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mail box\n else {\n document.eMail.uMail.style.borderColor = \"grey\";\n document.getElementById(\"errMail\").style.display = \"none\";\n return false;\n }\n}", "handleEmailCheck(email){\n return /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(email)\n }", "function validEMail(addr){\r\n\tvar filter = /^([\\d\\w\\.\\-\\+])+\\@(([\\d\\w\\-\\+])+\\.)+([a-zA-Z]{2,})$/;\r\n\treturn (filter.test(addr));\r\n}", "function checkEmail(input){\r\n var errors = [], warns = [], invalidChars = [], email = input.value, atAt = email.indexOf('@'),\r\n localPart = email.slice(0, atAt > -1 ? atAt : email.length), errorText = '',\r\n domain = atAt == -1 ? '' : email.slice(atAt + 1), ats = 0, domainName = domain,\r\n domainDots = 0,\r\n validDomainChars = '-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0124356789',\r\n validLocalChars = '!#$%&*+/=?^_`{|}~' + validDomainChars;\r\n //Whole email\r\n if(email == '') warns.push('Ingresa tu correo electrónico.');\r\n if(atAt == 0) errors.push('El correo no puede comenzar con una arroba.');\r\n // Local part\r\n if(atAt == -1) warns.push('El correo debe contener una arroba.');\r\n if(localPart.indexOf('.') == 0)\r\n errors.push('La parte local no puede empezar con un punto.');\r\n else if(localPart.lastIndexOf('.') == atAt - 1 && localPart.lastIndexOf('.') > -1)\r\n errors.push('La parte local no puede terminar con un punto.');\r\n for(var i = 0; i < localPart.length; i++){\r\n if(validLocalChars.indexOf(localPart.charAt(i)) == -1)\r\n invalidChars.push(localPart.charAt(i) == ' ' ? 'espacio' : localPart.charAt(i));\r\n if(localPart.charAt(i) == '.' && i < localPart.length - 1)\r\n if(localPart.charAt(i+1) == '.')\r\n errors.push('La parte local no puede contener dos o más puntos consecutivos.');\r\n }\r\n if(invalidChars.length){\r\n for(i in invalidChars){\r\n errorText += invalidChars[i];\r\n }\r\n errors.push((invalidChars.length > 1 ? 'Los caracteres' : 'El caracter') + ' <b>' + errorText + '</b> no ' + (invalidChars.length > 1 ? 'están permitidos' : 'está permitido') + ' en la parte local.');\r\n invalidChars = [];\r\n }\r\n if(localPart.length > 64) errors.push('La parte local no puede tener más de 64 caracteres.');\r\n // Domain\r\n if(domain == '') warns.push('Ingresa el dominio.');\r\n else{\r\n if(domain.lastIndexOf('.') == domain.length - 1){\r\n warns.push('Ingresa un subdominio.');\r\n errors.push('El dominio no puede terminar con un punto.')\r\n }\r\n if(domain.indexOf('.') == 0) errors.push('El dominio no puede empezar con un punto.');\r\n for(var i = 0; i < domain.length; i++){\r\n if(validDomainChars.indexOf(domain.charAt(i)) == -1)\r\n invalidChars.push(domain.charAt(i) == ' ' ? 'espacio' : domain.charAt(i));\r\n if(domain.charAt(i) == '.' && i < domain.length){\r\n if(domain.charAt(i+1) == '.') errors.push('El dominio no puede tener dos o más puntos consecutivos.');\r\n domainDots++;\r\n }\r\n }\r\n if(invalidChars.length){\r\n for(i in invalidChars){\r\n errorText += invalidChars[i];\r\n }\r\n errors.push((invalidChars.length > 1 ? 'Los caracteres' : 'El caracter') + ' <b>' + errorText + '</b> no ' + (invalidChars.length > 1 ? 'están permitidos' : 'está permitido') + ' en el dominio.');\r\n }\r\n for(var i = 0; i < domainDots + 1; i++) {\r\n for(var ind = 0; ind < i; ind++){\r\n domainName = domainName.slice(domainName.indexOf('.') + 1);\r\n }\r\n domainName = domainName.slice(0, domainName.indexOf('.') > -1 ? domainName.indexOf('.') : domainName.length);\r\n if(domainName.length > 63 && domainDots)\r\n errors.push('El subdominio ' + domainName + ' no debe contener mas de 63 caracteres.');\r\n if(domainName.indexOf('-') == 0)\r\n errors.push('El ' + (domainDots == 0 ? 'dominio' : 'subdominio \"' + domainName + '\"') + ' no puede empezar con un guión.');\r\n if(domainName.lastIndexOf('-') == domainName.length - 1 && domainName)\r\n errors.push('El ' + (domainDots == 0 ? 'dominio' : 'subdominio \"' + domainName + '\"') + ' no puede terminar con un guión.');\r\n domainName = domain;\r\n }\r\n if(domain.length > 255) errors.push(\"El dominio no puede contener mas de 255 caracteres.\");\r\n }\r\n //Whole email\r\n for(var i = 0; i < email.length; i++){\r\n if(email.charAt(i) == '@') ats++;\r\n }\r\n if(ats > 1) errors.push('El correo no puede contener mas de una arroba.');\r\n if(email.length > 320) errors.push('El correo no debe contener mas de 320 caracteres.');\r\n for(i in warns){\r\n console.log(warns[i]);\r\n }\r\n}", "function checkEmail () {\n var scriptProps = PropertiesService.getScriptProperties();\n var myEmail = scriptProps.getProperty('userEmail');\n if (myEmail == null) {\n return '✗ You still need to set up your email address. Go to 🔍 Career Hacking™ > 📧 Set Email Address.';\n } else {\n return 'Your follow-up reminders will be send to ' + myEmail + '. To have them sent to a different address, go to\\n🔍 Career Hacking™ > 📧 Set Email Address.'\n } \n}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "function emailSuccess() {}", "function emailfn() {\n var x = document.getElementById(\"email\").value;\n document.getElementById(\"emailcheck\").style.color = \"red\";\n document.getElementById(\"emailcheck\").innerHTML = \"invalid\";\n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if (mailformat.test(x)) {\n document.getElementById(\"emailcheck\").style.color = \"green\";\n document.getElementById(\"emailcheck\").innerHTML = \"valid \";\n }\n}", "function validateEmailAddress(customerForm)\n{\n var isValid = true;\n var emailAddr = customerForm.emailaddress.value;\n\n // first make sure an at-sign is found\n var atPos = emailAddr.indexOf(\"@\");\n if (atPos == -1)\n {\n isValid = false;\n }\n else\n {\n // next, make sure there is at least one domain separator\n // following the at-sign\n var dotPos = emailAddr.indexOf(\".\", atPos + 1);\n if (dotPos == -1)\n {\n isValid = false;\n }\n }\n\n if (!isValid)\n {\n window.alert(\"Your e-mail address must be in the format of [email protected]\");\n }\n return isValid;\n}", "function isEmailAddressProvided(customerForm)\n{\n var provided = true;\n\n if (customerForm.emailaddress.value == \"\")\n {\n provided = false;\n }\n\n return provided;\n}", "function checkemailadd(form99,email)\n{ \n\tvar reg = /^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$/;\n\tvar emailaddress = document.forms[\"form99\"].elements[\"email\"].value;\n\tvar errordiv = document.getElementById(\"error-panel\");\n\t\n\tif(reg.test(emailaddress) == false) {\n\t errordiv.style.display = 'block';\n\t errordiv.innerHTML = \"Invalid email addess. Please try <a href=\\\"https://hclibrary.org/mobile/forgotbarcode.php\\\">again</a>\";\n\t return false;\n\t }else{\n\t\t return true;\n\t }\n}", "SendVerificationMail() {\n return this.afAuth.auth.currentUser.sendEmailVerification()\n .then(() => {\n this.router.navigate(['verify-email-address']);\n });\n }", "function ordersCustEmailValid(cp_str) {\n\tvar result = true;\n\t//alert(cp_str);\n\tif (isEmpty(cp_str))\n\t{\n\t\talert(\"Please enter a customer email for the order.\");\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\t// Following code based on SIT104 prac6 exercise code\n\t\t// Locate @ in customer email field\n\t\tat=cp_str.indexOf(\"@\")\n\n\t\t// if @ not in customer email field\n\t\tif (at == -1)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, missing @. You entered \" + cp_str )\n\t\t\treturn false\n\t\t}\n\n\t\t// if @ is the first character in customer email field\n\t\tif (at == 0)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, @ can't be first character.\")\n\t\t\treturn false\n\t\t}\n\n\t\t//if @ is the last character in customer email field\n\t\tif (at == (cp_str.length))\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, @ can't be last character.\")\n\t\t\treturn false\n\t\t}\n\t\t\n\t\t// Locate . in customer email field\n\t\tdot=cp_str.indexOf(\".\")\n\n\t\t// if . not in customer email field\n\t\tif (dot == -1)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, missing '.'. You entered \" + cp_str )\n\t\t\treturn false\n\t\t}\n\n\t\t// if . is the first character in customer email field\n\t\tif (dot == 0)\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, '.' can't be first character.\")\n\t\t\treturn false\n\t\t}\n\n\t\t//if . is the last character in customer email field\n\t\tif (dot == (cp_str.length1))\n\t\t{\n\t\t\talert(\"Please enter a valid e-mail address, '.' can't be last character.\")\n\t\t\treturn false\n\t\t}\n\t}\n\treturn result;\n}", "function checkMail()\n {\n email = $('#ftven_formabo_form_email').val();\n var emailPattern = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n return (emailPattern.test(email));\n }", "verifyEmail() {\n const { questionEmail: email } = this.state;\n let formatted = false;\n const asterisk = email.indexOf('@');\n const period = email.lastIndexOf('.');\n if (email[asterisk - 1] && email[asterisk + 1] !== '.' && asterisk < period && email[period + 1]) {\n formatted = true;\n }\n return formatted;\n }", "function checkMail() {\n return new Promise((resolve, reject)=>{\n resolve({success: true});\n if(Math.random() > 0.5) {\n resolve({success: true});\n } else {\n reject({success:false});\n }\n });\n }", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function sendEmailVerification() {\n // [START sendemailverification]\n \n\n firebase.auth().currentUser.sendEmailVerification().then(function() {\n // Email Verification sent!\n // [START_EXCLUDE]\n \n // [END_EXCLUDE]\n });\n // [END sendemailverification]\n }", "function email() {\n var errors = document.querySelector(\"#errors\");\n var email = document.querySelector(\"#email\");\n var string = email.value.trim();\n var patt = /^[a-z0-9_\\-\\.]+\\@[a-z]+\\.[a-z]{2,4}$/i;\n if(!patt.test(string)) {\n errorMessage(\"<p>Please enter a valid Email address</p>\");\n return false;\n } else {\n return true;\n }\n}", "function checkEmail(email) {\n\t XHR = createXHR();\n\t if(XHR) {\n\t \t\tXHR.onreadystatechange = emailCheck;\n\t\t\tXHR.open(\"POST\", 'checkEmail.do', true);\n\t\t\tXHR.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded; charset=UTF-8\");\n\t var x = 'value='+ stringTrim(email);\n\t\t\tXHR.send(x);\n\t }\n }", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "function doAddressVerificationAfterSubmit() {\r\n\r\n var billingStates = $(\"#ctrlBillingAddress_WithStateState\").val();\r\n var shippingStates = $(\"#ctrlShippingAddress_WithStateState\").val();\r\n\r\n if (billingStates == null || billingStates == \"\") {\r\n\r\n $(\"#ctrlBillingAddress_WithStateState\").css(\"display\", \"none\");\r\n\r\n }\r\n\r\n if (shippingStates == null || shippingStates == \"\") {\r\n\r\n $(\"#ctrlShippingAddress_WithStateState\").css(\"display\", \"none\");\r\n\r\n }\r\n\r\n var chkAddrInfo = $(\"#hidCheck\").val();\r\n\r\n var strBTitl = $(\"#hidBillTitle\").val();\r\n var strSTitl = $(\"#hidShipTitle\").val();\r\n\r\n var strBChck = $(\"#hidBillCheck\").val();\r\n var strSChck = $(\"#hidShipCheck\").val();\r\n\r\n var strBAddr = $(\"#hidBilling\").val();\r\n var strSAddr = $(\"#hidShipping\").val();\r\n\r\n // NOTE: '*' character is used for seperation of information\r\n // which will be parsed at the receiving end.\r\n\r\n var strBillCtrl = $(\"#hidBillCtrl\").val();\r\n var arrBillCtrl = strBillCtrl.split(\"*\");\r\n\r\n\r\n // Get WithState or WithOutState Billing Address Control id's\r\n\r\n var _hidBlnWithState = $(\"#hidBlnWithState\").val();\r\n\r\n if (_hidBlnWithState == \"True\") {\r\n\r\n var citBillCtrl = document.getElementById(arrBillCtrl[0]);\r\n var posBillCtrl = document.getElementById(arrBillCtrl[1]);\r\n\r\n\r\n }\r\n else {\r\n\r\n var citBillCtrl = document.getElementById(arrBillCtrl[3]);\r\n var posBillCtrl = document.getElementById(arrBillCtrl[4]);\r\n\r\n }\r\n\r\n var varBillStateCtrl = document.getElementById(arrBillCtrl[2]);\r\n\r\n var strShipCtrl = document.getElementById('hidShipCtrl');\r\n var arrShipCtrl = strShipCtrl.value.split(\"*\");\r\n\r\n // Get WithState or WithOutState Shipping Address Control id's\r\n\r\n var _hidShpWithState = $(\"#hidShpWithState\").val();\r\n\r\n if (_hidShpWithState == \"True\") {\r\n\r\n var citShipCtrl = document.getElementById(arrShipCtrl[0]);\r\n var posShipCtrl = document.getElementById(arrShipCtrl[1]);\r\n\r\n }\r\n else {\r\n\r\n var citShipCtrl = document.getElementById(arrShipCtrl[3]);\r\n var posShipCtrl = document.getElementById(arrShipCtrl[4]);\r\n }\r\n\r\n var varShipStateCtrl = document.getElementById(arrShipCtrl[2]);\r\n\r\n var _chkAddrInfo = $(\"#chkAddrInfo\").val();\r\n\r\n if (_chkAddrInfo == \"True\" && varBillStateCtrl != null) {\r\n\r\n varShipStateCtrl.value = varBillStateCtrl.value;\r\n citShipCtrl.value = citBillCtrl.value;\r\n posShipCtrl.value = posBillCtrl.value;\r\n\r\n }\r\n\r\n var popModalFlag = $('#hidValid').val();\r\n\r\n if (popModalFlag != null && popModalFlag == \"false\") {\r\n\r\n var ids = getControlIdsToCheckAfterSubmit();\r\n\r\n for (var i = 0; i < ids.length; i++) {\r\n\r\n recheckPostalAfterSubmit(ids[i], \"\", \"\");\r\n\r\n }\r\n\r\n }\r\n}", "function testEmailSearch(){\n searchEmail('[email protected]'); // invalid\n\t searchEmail(\"[email protected]\"); // valid entry\n\t searchEmail(null); // invalid entry\n\t searchEmail(1); // invalid entry\n }", "function attemptContact() {\n \"use strict\";\n var variables = getVariables();\n if (variables) {\n sendEmail(variables);\n }\n}", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function org_zmail_contactcleaner() {\n}", "function checkEmail(){\r\n \r\n var emailstring = elemail.value;\r\n var positionOfAtTeRate = 0, positionOfDot = 0;\r\n var firstLetterCheck = emailstring[0];\r\n var lastLetterCheck = emailstring[emailstring.length - 1];\r\n var letterCheck; \r\n if(lastLetterCheck == '@' || lastLetterCheck == '.' || firstLetterCheck == '@' || firstLetterCheck == '.' ){\r\n letterCheck = 'invalid';\r\n }\r\n \r\n \r\n for(var i = 0; i < emailstring.length; i++){\r\n \r\n if(emailstring[i] == '@'){\r\n positionOfAtTeRate = i;\r\n }\r\n \r\n if(emailstring[i] == '.'){\r\n positionOfDot = (i - 1);\r\n }\r\n \r\n }\r\n if(positionOfAtTeRate < positionOfDot && letterCheck != 'invalid'){\r\n elemail_feedback.textContent = '';\r\n validations++;\r\n \r\n }else{\r\n \r\n elemail_feedback.textContent = 'Please enter valid E-mail address';\r\n }\r\n}", "function validateMail(){\n\t\tvar x=document.getElementById('email');\n\t\tvar atpos = x.indexOf(\"@\");\n\t\tvar dotpos = x.lastIndexOf(\".\");\n\t\tif (atpos < 1 || dotpos < atpos+2 || dotpos+2 >= x.length){\n\t\t alert(\"Not a valid e-mail address\");\n\t\t x.focus();\n\t\t return false;\n\t\t }\n\t}", "function constructMailingListAndMail(req, res, emailRoutine, emailBody, emailSubject) {\n User.find().where(\"emailIsVerified\").equals(true).exec(function(err, foundUsers) {\n if (err || foundUsers.length === 0) {\n req.flash(\"error\", \"Sorry, something went wrong. Please try again\");\n return res.redirect(\"back\");\n }\n\n //find users that have signed up for newsletter\n foundUsers.forEach(function(user) {\n if (user.newsletterIsAccepted) {\n emailRoutine(req, res, user, emailBody, emailSubject);\n }\n });\n });\n}", "function validateEmail(addr,man,db) {\n\tif (addr == '' && man) {\n\t if (db) alert('email address is mandatory');\n\t return false;\n\t}\n\tvar invalidChars = '\\/\\'\\\\ \";:?!()[]\\{\\}^|';\n\tfor (i=0; i<invalidChars.length; i++) {\n\t if (addr.indexOf(invalidChars.charAt(i),0) > -1) {\n\t\t if (db) alert('email address contains invalid characters');\n\t\t return false;\n\t }\n\t}\n\tfor (i=0; i<addr.length; i++) {\n\t if (addr.charCodeAt(i)>127) {\n\t\t if (db) alert(\"email address contains non ascii characters.\");\n\t\t return false;\n\t }\n\t}\n\t\n\tvar atPos = addr.indexOf('@',0);\n\tif (atPos == -1) {\n\t if (db) alert('email address must contain an @');\n\t return false;\n\t}\n\tif (atPos == 0) {\n\t if (db) alert('email address must not start with @');\n\t return false;\n\t}\n\tif (addr.indexOf('@', atPos + 1) > - 1) {\n\t if (db) alert('email address must contain only one @');\n\t return false;\n\t}\n\tif (addr.indexOf('.', atPos) == -1) {\n\t if (db) alert('email address must contain a period in the domain name');\n\t return false;\n\t}\n\tif (addr.indexOf('@.',0) != -1) {\n\t if (db) alert('period must not immediately follow @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('.@',0) != -1){\n\t if (db) alert('period must not immediately precede @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('..',0) != -1) {\n\t if (db) alert('two periods must not be adjacent in email address');\n\t return false;\n\t}\n\tvar suffix = addr.substring(addr.lastIndexOf('.')+1);\n\tif (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {\n\t if (db) alert('invalid primary domain in email address');\n\t return false;\n\t}\n\treturn true;\n}", "function checkEmail(emailField)\r\n{\r\n\r\n var tomatch = /(\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*\\.((com|net|org|edu|in|gov|info|co)))/i\r\n if (!tomatch.test(emailField.value))\r\n {\r\n window.alert(\"Please Enter Valid Email Id\");\r\n emailField.value = \"\";\r\n emailField.focus();\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n}", "function verify() {\n var user = firebase.auth().currentUser;\n user.sendEmailVerification().then(function() {\n // Email sent.\n console.log('Enviando correo');\n }).catch(function(error) {\n // An error happened.\n console.log('error');\n });\n}", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "async action() {\n let result = await this.userServiceDI.checkMailInDb({\n email: this.model.email\n });\n if (result != null) {\n let model = {\n body: {\n email: this.model.email,\n uid: result.uid,\n href: (new URL(this.referer)).origin,//this.referer,//CONFIG.FRONT_END_URL,\n name: result.name\n }\n };\n this.mailSenderDI.mailSend({\n xslt_file: EMAIL_TEMPLATE.forgot_password_step_1,\n model,\n email_to: this.model.email,\n language: result.language,\n mail_title: new CodeDictionary().get_trans(\n \"FORGOT_PASSWORD_FIRST_MAIL\",\n \"EMAIL\",\n result.language\n )\n });\n }\n }", "function verify(){\n var url = $location.url();\n var params = url.substring(url.indexOf(\"?\") + 1).split('&');\n var email = params[0].substring(params[0].indexOf(\"=\") + 1);\n var token = params[1].substring(params[1].indexOf(\"=\") + 1);\n signupSvc.confirmUser(email, token).then(function(){\n var host = $location.host();\n $location.url(host);\n });\n }", "function isnotVlaidEmail(str){\n\t\t\t strmail=str;\n\t\t\t firstat = strmail.indexOf(\"@\");\n\t\t\t lastat = strmail.lastIndexOf(\"@\");\n\t\t\t strmain=strmail.substring(0,firstat);\n\t\t\t strsub=strmail.substring(firstat,str.length);\n\t\t\t flag=false;\n\t\t\t if(strmail.length>120)\n\t\t\t { flag=true;//alert(\"1\");\n\t\t\t }\n\t\t\t if(strmain.indexOf(' ')!=-1 || firstat==0 || firstat!=lastat || strsub.indexOf(' ')!=-1 )\n\t\t\t {flag=true;}\n\n\t\t\tstringMailCheck1=\"!#$%^&*()+|<>?/=~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf3=1;\n\t\t\tfor(j=0;j<strsub.length;j++)\n\t\t\t{if(stringMailCheck1.indexOf(strsub.charAt(j))!=-1)\n\t\t\t{f3=0;}}\n\t\t\tif(f3==0)\n\t\t\t{flag=true;}\n\n\t\t\tstringMailCheck2=\"!@#$%^&*()+|<>?/=~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf4=1;\n\t\t\tfor(j=0;j<strmain.length;j++)\n\t\t\t{if(stringMailCheck2.indexOf(strmain.charAt(j))!=-1)\n\t\t\t{f4=0;}}\n\t\t\tif(f4==0)\n\t\t\t{flag=true;}\n\t\t\t\n\t\t\t k=0;\n\t\t\t strlen=strsub.length;\n\t\t\t for(i=0;i<strlen-1;i++)\n\t\t\t { if(strsub.charAt(i)=='.')\n\t\t\t {k=k+1;}}\n\t\t\t if(k>3)\n\t\t\t { flag=true;}\n\t\t\t if(firstat==-1 || lastat==-1)\n\t\t\t {flag=true;}\n\t\t\t if(Number(strmain))\n\t\t\t {flag=true;}\n\t\t\t if(firstat != lastat )\n\t\t\t {flag=true;}\n\t\t\t firstdot=strmail.indexOf(\".\",firstat);\n\t\t\t lastdot=strmail.lastIndexOf(\".\");\n\t\t\t if(firstdot == -1 || lastdot == -1 || lastdot==strmail.length-1)\n\t\t\t {flag=true;}\n\t\t\t\n\t\t\treturn flag;\n}", "function sendVerificationMail(token, email) {\n var mail = \"<body style='direction:rtl;'><a href='http://www.mh2.co.il/#/verify?string=\" + token + \"'>להפעלת המנוי לחץ כאן</a></body>\";\n var transporter = nodemailer.createTransport({\n service: 'Gmail',\n auth: {\n user: '[email protected]', // Your email id\n pass: 'zflp6g43' // Your password\n }\n });\n var mailOptions = {\n from: '[email protected]', // sender address\n to: email, // list of receivers\n subject: 'מייל אימות משתמש ממחצית השקל', // Subject line\n html: mail //, // plaintext body\n // html: '<b>Hello world ✔</b>' // You can choose to send an HTML body instead\n };\n transporter.sendMail(mailOptions, function (error, info) {\n if (error) {\n console.log(error);\n res.json({yo: 'error'});\n } else {\n //console.log('Message sent: ' + info.response);\n res.json({yo: info.response});\n }\n });\n }", "function isValidEmailAddress(emailAddress) {\n var pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n return pattern.test(emailAddress);\n }", "function helpvailida_correo(correo){\n\t emailRegex = /^[-\\w.%+]{1,64}@(?:[A-Z0-9-]{1,63}\\.){1,125}[A-Z]{2,63}$/i;\n\t if (emailRegex.test(correo)) {\n\t return true;\n\t }else{\n\t return false;\n\t }\n\t}", "function VerifyE(n,n1){\n\t\tvar email=document.getElementById(n).value;\n\t\tvar t=email.indexOf('@');\n\t\tvar m= email.indexOf('.');\n\t\tif(email.length==0){\n\t\t\tdocument.getElementById(n1).style.color=\"red\";\n\t\t\tdocument.getElementById(n1).innerHTML=\"\";\n\t\t}else if(email.length>0 &&(t==0 || m==0)){\n\t\t\tdocument.getElementById(n1).style.color=\"red\";\n\t\t\tdocument.getElementById(n1).innerHTML=\"poor\";\n\t\t}else if(email.length>0 && t>0 && m>0){\n\t\t\tdocument.getElementById(n1).style.color=\"#6f0\";\n\t\t\tdocument.getElementById(n1).innerHTML=\"Good!\";\n\t\t}else{\n\t\t\tdocument.getElementById(n1).style.color=\"red\";\n\t\t\tdocument.getElementById(n1).innerHTML=\"poor..\";\n\t\t}\n\t\t}", "function echeck(str) {\n\n\tvar at=\"@\";\n\tvar dot=\".\";\n\tvar lat=str.indexOf(at);\n\tvar lstr=str.length;\n\tvar ldot=str.indexOf(dot);\n\tif (lstr >= 100){\n\t\talert(\"Email address should be less than 100 characters\");\n\t\treturn false;\n\t}\n\n\tif (str.indexOf(at)==-1){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t}\n\n\tif (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t}\n\n\tif (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t}\n\n\t if (str.indexOf(at,(lat+1))!=-1){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t }\n\n\t if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t }\n\n\t if (str.indexOf(dot,(lat+2))==-1){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t }\n\t\n\t if (str.indexOf(\" \")!=-1){\n\t alert(\"Please enter a valid E-mail ID\");\n\t return false;\n\t }\n\n\t return true;\t\t\t\n}", "function isnotVlaidEmail(str){\n\t\t\t strmail=str;\n\t\t\t firstat = strmail.indexOf(\"@\");\n\t\t\t lastat = strmail.lastIndexOf(\"@\");\n\t\t\t strmain=strmail.substring(0,firstat);\n\t\t\t strsub=strmail.substring(firstat,str.length);\n\t\t\t flag=false;\n\t\t\t if(strmail.length>120)\n\t\t\t { flag=true;alert(\"1\");}\n\t\t\t if(strmain.indexOf(' ')!=-1 || firstat==0 || firstat!=lastat || strsub.indexOf(' ')!=-1 )\n\t\t\t {flag=true;}\n\n\t\t\tstringMailCheck1=\"!#$%^&*()_+|<>?/=-~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf3=1;\n\t\t\tfor(j=0;j<strsub.length;j++)\n\t\t\t{if(stringMailCheck1.indexOf(strsub.charAt(j))!=-1)\n\t\t\t{f3=0;}}\n\t\t\tif(f3==0)\n\t\t\t{flag=true;}\n\n\t\t\tstringMailCheck2=\"!@#$%^&*()+|<>?/=-~,;:][{}\"+\"\\\\\"+\"\\'\"+\"\\\"\";\n\t\t\tf4=1;\n\t\t\tfor(j=0;j<strmain.length;j++)\n\t\t\t{if(stringMailCheck2.indexOf(strmain.charAt(j))!=-1)\n\t\t\t{f4=0;}}\n\t\t\tif(f4==0)\n\t\t\t{flag=true;}\n\t\t\t\n\t\t\t k=0;\n\t\t\t strlen=strsub.length;\n\t\t\t for(i=0;i<strlen-1;i++)\n\t\t\t { if(strsub.charAt(i)=='.')\n\t\t\t {k=k+1;}}\n\t\t\t if(k>2)\n\t\t\t { flag=true;}\n\t\t\t if(firstat==-1 || lastat==-1)\n\t\t\t {flag=true;}\n\t\t\t if(Number(strmain))\n\t\t\t {flag=true;}\n\t\t\t if(firstat != lastat )\n\t\t\t {flag=true;}\n\t\t\t firstdot=strmail.indexOf(\".\",firstat);\n\t\t\t lastdot=strmail.lastIndexOf(\".\");\n\t\t\t if(firstdot == -1 || lastdot == -1 || lastdot==strmail.length-1)\n\t\t\t {flag=true;}\n\t\t\t\n\t\t\treturn flag;\n}", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\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 if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "function sendMessage(id_email){\r\n if(validateEmail(id_email)){\r\n alert(\"Message sent succesfully\");\r\n\r\n }else{\r\n alert(\"Message not sent. Be sure to have typed an email address\");\r\n\r\n }\r\n}", "function sendEmailVerification() {\r\n // [START sendemailverification]\r\n console.log(\"sendEmailVerification \" + firebase.auth().currentUser );\r\n firebase.auth().currentUser.sendEmailVerification().then(function() {\r\n // Email Verification sent!\r\n // [START_EXCLUDE]\r\n alert('Email Verification Sent!');\r\n // [END_EXCLUDE]\r\n });\r\n // [END sendemailverification]\r\n }", "function checkRegistrationEmail(email) {\n var blank = isBlank(email);\n if(blank) {\n\tvar element = document.getElementById('email');\n\tvar existence = false;\n\tinputFeedback(element, existence, blank);\n } else {\n\tvar element = document.getElementById('email');\n\tvar existence = checkMailExistence(email);\n\tinputFeedback(element, existence, blank);\n }\n}", "function validateEmail() {\n var re3 = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n if (re3.test(document.getElementById('email').value)) {\n document.getElementById('emailTick').style.display = 'block';\n document.getElementById('emailCross').style.display = 'none';\n checkEmail();\n return true;\n } else {\n document.getElementById('emailCross').style.display = 'block';\n document.getElementById('emailTick').style.display = 'none';\n return false;\n }\n}", "function validEmail(check){\n return /^\\w+@\\w+(\\.(\\w)+)$/i.test(check.value);\n}", "function regExpAddress() {\n // Récupération des données saisies\n const addressValid = contact.address;\n // Injection du HTML\n const checkAddress = document.querySelector(\"#addressErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^[A-Za-z0-9\\s]{3,100}$/.test(addressValid)) {\n checkAddress.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checkAddress.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function warnValidateEmail(){\n var emailAddress = $('#emailAddressValue').val();\n var defaultDisplayName = \"dumval\";\n\n if (emailAddress!='' && checkEmailAddress(emailAddress)){\n validateUser(emailAddress,defaultDisplayName,function(data){\n var i,len;\n for (i=0,len=data.length;i<len;i++){\n if (data[i]=='email_address'){\n $('#emailAddressMessage').html(\"<p style=\\\"color:red;\\\">This email address is already taken.</p>\");\n }\n }\n });\n }\n}", "function isValidEmailAddress(emailAddress) {\r\n var pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\r\n return pattern.test(emailAddress);\r\n }", "validateRequestResetPasswordEmail(request, response) {\n request\n .checkBody(\"email\", \"Please enter a valid email.\")\n .isEmail();\n }", "function ValidEmail(field)\n{\n\n \tif ((field.value.indexOf(\"@\") < 1) || (field.value.indexOf(\".\") < 1))\n \t{\n\t DspAlert(field,Message[29]);\n\t return false;\n \t\t\n \t}\n \treturn true;\n \n}", "function sendEmailVerification() {\n // [START sendemailverification]\n configuredFirebase.auth().currentUser.sendEmailVerification().then(function () {\n // Email Verification sent!\n // [START_EXCLUDE]\n alert('Email Verification Sent!');\n // [END_EXCLUDE]\n });\n // [END sendemailverification]\n}", "function isEmail( field )\r\n {\r\n\ttext = field.value;\r\n\t//alert('inside isEmail');\r\n\tif(isEmpty(field))\r\n\t {\r\n\t\t//alert('Empty Text Box');\r\n\t\treturn true;\r\n\t }\r\n\telse\r\n\t{\r\n\t\t\tvar i;\r\n\t\t\tvar index;\r\n\t\t\tfor( i = 0; i < text.length; i++ )\r\n\t\t\t{\r\n\t\t\t oneChar = text.charAt( i );\r\n\t\t\t if ( ! isCharValid( oneChar, PERIOD|ALPHA|NUMERICS|EMAILAT|DASH|UNDERSCORE|PLUS ) )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t}\r\n\t\t\tif( ( index = text.indexOf( '@' ) ) == -1 ) \r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\tvar user = text.substring( 0, index );\r\n\t\t\tvar domain = text.substring( index, text.length );\r\n\t\t\tif ( domain.indexOf( '@', 1 ) != -1 ) \r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\tif ( ( ( index = domain.indexOf( '.' ) ) == -1 ) ||( user == \"\" ) )\r\n\t\t\t{\r\n\t\t\t return false ;\r\n\t\t\t}\r\n\t\t\tvar suffix = domain.substring(domain.lastIndexOf('.') +1);\r\n\t\t\t//if(! isTLD(suffix) ){\r\n\t\t\t//\talert(BADEMAIL);\r\n\t\t\t// field.focus();\r\n\t\t\t//\tfield.select();\r\n\t\t\t// return false;\r\n\t\t//\t}\r\n\t\t\twhile( index != -1 )\r\n\t\t\t{\r\n\t\t\t if ( ( index == 0 ) || ( index == domain.length - 1 ) )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t if ( domain.charAt( index + 1 ) == '.' )\r\n\t\t\t {\r\n\t\t\t\treturn false;\r\n\t\t\t }\r\n\t\t\t index++;\r\n\t\t\t index = domain.indexOf( '.', index );\r\n\t\t\t}\r\n\t\t\t //alert('Valid Email Id');\r\n\t\t\t return true;\r\n\t}\r\n }", "function validateMailingAddress(customerForm)\n{\n var isValid = true;\n\n // not much to do here other than validate than the \n // ZIP code is numeric (only true for USPS addresses...)\n if (isNaN(customerForm.zipcode.value) || isNaN(customerForm.zipplus4.value))\n {\n isValid = false;\n window.alert(\"ZIP Code must be numeric only\");\n }\n else if (customerForm.zipcode.value.length != 5)\n {\n isValid = false;\n window.alert(\"ZIP code must be 5 digits only\");\n }\n else if (customerForm.zipplus4.value.length != 0 && customerForm.zipplus4.value.length != 4)\n {\n isValid = false;\n window.alert(\"ZIP Plus 4 must be empty or 4 digits only\");\n }\n\n return isValid;\n}", "function validateEmail(){\r\n\r\n \t\tvar email=document.getElementById(\"email\").value;\r\n\r\n\r\n \tif(email.length==0){\r\n\r\n \t\t\tprintError(\"email required\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n \tif(!email.match(/^[a-z0-9](\\.?[a-z0-9_-]){0,}@[a-z0-9-]+\\.([a-z]{1,6}\\.)?[a-z]{2,6}$/)){\r\n \t\tprintError(\"enter Valid email\",\"emailError\",\"red\");\r\n\t\ttextboxBorder(\"email\");\r\n\t\treturn false;\r\n\r\n \t}\r\n\r\n\r\n\tprintSuccess(\"email\",\"green\",\"emailError\");\r\nreturn true;\r\n\r\n\r\n \t}", "function check_email(email) {\r\n var pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\r\n if (pattern.test(email) === false) {\r\n return '0';\r\n } else {\r\n return '1';\r\n }\r\n}", "function verificationEmail(err, body) {\n if (err) { throw(err); }\n emailTemplates(config.email.templateDir, renderVerificationTemplate);\n }", "function checkEmail(){\r\n\t\r\n\t\r\n\t var text = document.getElementById(\"input-email\").value;\r\n \r\n \r\n var batt;\r\n \r\n batt=/^\\w+\\s?\\w{5,20}[@]{1}[gy][ma][ah][io][lo]{1}[.][c][o][m]{1}$/\r\n var b = batt.test(text);\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\tif(b){\r\n\t\t\r\n\t\t\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"green\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid green\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n\t\r\n\telse{\r\n\t\tdocument.querySelector(\".check-email\").style.backgroundColor=\"hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".check-email\").style.border=\"1px solid hsl(0, 94%, 66%)\";\r\n\t\tdocument.querySelector(\".invalid-email\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"invalid-image\").style.display=\"block\";\r\n\t\tdocument.querySelector(\".valid-email\").style.display=\"none\";\r\n\t\t\r\n\t\t\r\n\t}\r\n\t\r\n}", "function validateMail() {\r\n\t// empty field\r\n\tif (email.value == \"\") {\r\n\t\talertEmail.textContent = \"Email cannot be blank.\";\r\n\t\temail.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// valid email\r\n\tif (!(/^(([^<>()[\\]\\\\.,;:\\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,}))$/.test(email.value))) {\r\n\t\talertEmail.textContent = \"Enter a valid email address.\";\r\n\t\temail.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "verify(address) {\r\n return ArrayHelper.equal(this.toAddress(), address);\r\n }", "function emailChecker(storedEmail, reqEmail, callback){\n if (storedEmail === reqEmail){\n callback();\n };\n}", "function isValidEmailAddress( email ) {\n var rVal = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n return rVal.test( email );\n}", "function chkEmail(event) {\r\n\t\r\n\r\n// Get the target node of the event\r\n\r\n var myEmail = event.currentTarget;\r\n\r\n// Test the format of the input email\r\n \r\n var pos = myEmail.value.search(/^[A-Za-z0-9\\.\\-]+\\@[A-Za-z0-9]*\\.*[A-Za-z0-9]*\\.*[A-Za-z0-9]+\\.[A-Za-z0-9]{2,3}$/);\r\n var ext = myEmail.value.search(/\\.{2,}/);\r\n \r\n if (pos != 0 || ext != -1) {\r\n alert(\"The email you entered (\" + myEmail.value +\r\n \") is not in the correct form. \\n\");\r\n myEmail.focus();\r\n myEmail.select();\r\n\treturn false;\r\n } \r\n}", "function sendEmailVerification() {\n // [START sendemailverification]\n firebase.auth().currentUser.sendEmailVerification().then(function() {\n // Email Verification sent!\n // [START_EXCLUDE]\n alert('Email Verification Sent!');\n // [END_EXCLUDE]\n });\n // [END sendemailverification]\n }", "function Form20_Validator(theForm)\n{\n// allow ONLY alphanumeric keys, no symbols or punctuation\n// this can be altered for any \"checkOK\" string you desire\n\n// check if first_name field is blank\nif ((theForm.name.value.replace(' ','') == \"\") || (theForm.name.value.replace(' ','') == \"Name\"))\n{\nalert(\"You must enter Your Name.\");\ntheForm.name.focus();\nreturn (false);\n}\n\n\n// check if email field is blank\nvar emailStructure = \"\\w+([-+.']\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*\";\n\nif ((theForm.emailfrom.value.replace(' ','') == \"\") || (theForm.emailfrom.value.replace(' ','') == \"Email\"))\n{\nalert(\"Please enter a value for the \\\"Email\\\" field.\");\ntheForm.emailfrom.focus();\nreturn (false);\n}\nelse\n {\n\t if (!emailStructure.test(theForm.emailfrom.value))\n\t {\n\t\talert(\"Email Id: Enter complete Email Id like [email protected]\");\n\t\ttheForm.emailfrom.focus();\n\t\treturn false;\n\t }\n }\n\n// test if valid email address, must have @ and .\n/*var checkEmail = \"@.\";\nvar checkStr = theForm.emailfrom.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"The \\\"email\\\" field must contain an \\\"@\\\" and a \\\".\\\".\");\ntheForm.emailfrom.focus();\nreturn (false);\n}*/\n\n// check if company field is blank\n\nif ((theForm.company.value.replace(' ','') == \"\") || (theForm.company.value.replace(' ','') == \"Company\"))\n{\nalert(\"You must enter Company Name.\");\ntheForm.company.focus();\nreturn (false);\n}\n\n\n//check if Title is blank\n\nif ((theForm.title.value.replace(' ','') == \"\") || (theForm.title.value.trim() == \"report title\"))\n{\nalert(\"Please enter a value for the Report Title field.\");\ntheForm.title.focus();\nreturn (false);\n}\n\n\n\n\n// test if valid email address, must have @ and .\n/*var checkEmail = \"@.\";\nvar checkStr = theForm.emailfrom.value;\nvar EmailValid = false;\nvar EmailAt = false;\nvar EmailPeriod = false;\nfor (i = 0; i < checkStr.length; i++)\n{\nch = checkStr.charAt(i);\nfor (j = 0; j < checkEmail.length; j++)\n{\nif (ch == checkEmail.charAt(j) && ch == \"@\")\nEmailAt = true;\nif (ch == checkEmail.charAt(j) && ch == \".\")\nEmailPeriod = true;\n\t if (EmailAt && EmailPeriod)\n\t\tbreak;\n\t if (j == checkEmail.length)\n\t\tbreak;\n\t}\n\t// if both the @ and . were in the string\nif (EmailAt && EmailPeriod)\n{\n\t\tEmailValid = true\n\t\tbreak;\n\t}\n}\nif (!EmailValid)\n{\nalert(\"The \\\"email\\\" field must contain an \\\"@\\\" and a \\\".\\\".\");\ntheForm.emailfrom.focus();\nreturn (false);\n}*/\n\n}", "function email_checker() {\n const email_value = email.value;\n\n if (validateEmail(email_value)) {\n errorMessageEmail.innerText = \"\";\n register.removeAttribute(\"disabled\");\n\n } else {\n errorMessageEmail.innerText = \"Invalid Email address.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}" ]
[ "0.771228", "0.72072214", "0.7081319", "0.67697686", "0.67225957", "0.6689953", "0.65419954", "0.65378463", "0.6448835", "0.644664", "0.6439708", "0.6433551", "0.64289755", "0.63960475", "0.6353966", "0.63469553", "0.634471", "0.63409764", "0.6340278", "0.6336402", "0.6333899", "0.63168997", "0.62833893", "0.62701446", "0.6267758", "0.6254216", "0.62302804", "0.6222334", "0.62009585", "0.6197553", "0.6197371", "0.6194121", "0.6194121", "0.6193615", "0.61910063", "0.61869425", "0.6186313", "0.6184297", "0.6171673", "0.6165401", "0.6164473", "0.6148391", "0.61310023", "0.61217636", "0.61217636", "0.6112524", "0.6109842", "0.6104722", "0.61036724", "0.60970485", "0.6090339", "0.6087457", "0.6087145", "0.608377", "0.6081387", "0.607487", "0.60649115", "0.6062358", "0.6056115", "0.60503256", "0.60476834", "0.6039566", "0.60372454", "0.60317916", "0.60314935", "0.6031393", "0.602723", "0.6023345", "0.60191923", "0.6018475", "0.60170466", "0.6015447", "0.6015447", "0.6015447", "0.6015447", "0.6015447", "0.60010874", "0.5999014", "0.5989292", "0.5985948", "0.59782386", "0.597622", "0.597418", "0.5974043", "0.59722114", "0.5970906", "0.5965801", "0.5965694", "0.5961932", "0.5958833", "0.5958753", "0.5955276", "0.59546816", "0.595358", "0.5952693", "0.5952511", "0.59501565", "0.59500974", "0.5949435", "0.5949428", "0.59376127" ]
0.0
-1
mailing address attributes integration functions
function mailing_company_name_1(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true if (!check_allowed_char(input, "alphanumeric", "conf1")){ error = "E28_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E28_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedAddress() {\n\n }", "function getMailingAddress() {\n return {\n /**\n * Represents the actual text that should be put on the mailing label when delivering a physical package\n * @type {String}\n */\n label: '',\n\n /**\n * Street address\n * @type {String}\n */\n Street: '',\n\n /**\n * City\n * @type {String}\n */\n City: '',\n\n /**\n * State or province\n * @type {String}\n */\n State: '',\n\n /**\n * Postal code\n * @type {String}\n */\n PostalCode: '',\n\n /**\n * Country or region\n * @type {String}\n */\n Country: ''\n };\n }", "function update_manage_proposals_mailto(is_add, addresses) {\n element = $('.send-email-link');\n href = element.attr('href');\n prefix = 'mailto:';\n parser = new RegExp('^'+prefix+'(.+)$');\n stripper = new RegExp('bcc=', 'gi');\n matcher = parser.exec(href);\n addresses_hash = matcher ? array_to_hash(matcher[1].replace(stripper, '').split(',')) : [];\n $(addresses).each(function(){\n if (is_add) {\n addresses_hash[this] = true;\n } else {\n delete addresses_hash[this];\n }\n });\n result = prefix+(hash_keys(addresses_hash).map(function(me) {return 'bcc='+me}).join(','));\n element.attr('href', result);\n return result;\n}", "formatAddresses(recipients) {\n return recipients.map(({ email }) => {\n return new helper.Email(email);\n });\n }", "formatAddresses(recipients) {\n // need paretheses to do destructuring, cannot just an arrow function\n return recipients.map(({ email }) => {\n return new helper.Email(email);\n })\n }", "formatAddresses(recipients) {\n return recipients.map(({ email }) => {\n //format with helper, pass in email just extracted\n return new helper.Email(email);\n });\n }", "function Address (streetAddress, city, province, zipcode) {\n this.streetAddress = streetAddress;\n this.city = city;\n this.province = province;\n this.zipcode = zipcode;\n this.deliveryAddress = (streetAddress + \" \" + city + \", \" + province + \" \" + zipcode);\n}", "function setAddressRelatedFieldValues(record){\r\n record.setFieldValue('billaddresslist', record.getFieldValue('billaddresslist') || '');\r\n record.setFieldValue('billaddress', record.getFieldValue('billaddress') || '');\r\n record.setFieldValue('shipaddresslist', record.getFieldValue('shipaddresslist') || '');\r\n record.setFieldValue('shipaddress', record.getFieldValue('shipaddress') || '');\r\n}", "formatAddresses(recipients){\n\t\treturn recipients.map(({ email }) => {\n\t\t\treturn new helper.Email(email);\n\t\t});\n\t}", "function isMailingAddressProvided(customerForm)\n{\n var provided = true;\n\n if (customerForm.address1.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.city.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.state.value == \"\")\n {\n provided = false;\n }\n else if (customerForm.zipcode.value == \"\")\n {\n provided = false;\n }\n\n return provided;\n}", "function companyAddress(number, st, postal, building, officeNumber) {\n var that = address(number, st, postal);\n //Augment that object\n that.building = building;\n that.officeNumber = officeNumber;\n that.toString = function() {\n let {number, st, postal, building, officeNumber} = that;\n return `${number} ${st}, ${building}-${officeNumber}, P.C. ${postal}`;\n }\n return that;\n}", "function userDetails(user){\r\n //Address\r\n var request = new XMLHttpRequest();\r\n var url = user;\r\n\r\n request.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n var data = JSON.parse(this.responseText);\r\n\r\n //$('#demo').html(data.emailId);\r\n \r\n $(\"#demo\").append( \"<a href=\\\"mailto:\"+data.emailId + \"\\\">\"+data.emailId+\"</a>\" );\r\n $('#demo1').html(data.firstName + \" \" + data.lastName);\r\n //$('#demo2').html(data.location);\r\n $('#demo3').html(data.phoneNumber);\r\n var addr = data._links.address.href;\r\n console.log(addr);\r\n address(addr);\r\n\r\n }\r\n };\r\n request.open(\"GET\", url, true);\r\n request.send(); \r\n}", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function set_return_contact_address(account_id, account_name, bill_street, ship_street, bill_city, ship_city, bill_state, ship_state, bill_code, ship_code, bill_country, ship_country, bill_pobox, ship_pobox) {\n\tif (document.getElementById('from_link').value != '') {\n\t\tif (typeof (window.opener.document.QcEditView.account_id_display) != 'undefined') {\n\t\t\twindow.opener.document.QcEditView.account_id_display.value = account_name;\n\t\t}\n\t\tif (typeof (window.opener.document.QcEditView.account_id) != 'undefined') {\n\t\t\twindow.opener.document.QcEditView.account_id.value = account_id;\n\t\t}\n\t} else {\n\t\tif (window.opener.gVTModule == 'Contacts' && typeof(window.opener.document.EditView) == 'undefined') {\n\t\t\treturn vtlib_setvalue_from_popup(account_id, account_name, 'account_id', 'EditView');\n\t\t}\n\t\tif (typeof (window.opener.document.EditView.account_id_display) != 'undefined') {\n\t\t\twindow.opener.document.EditView.account_id_display.value = account_name;\n\t\t}\n\t\tif (typeof (window.opener.document.EditView.account_id) != 'undefined') {\n\t\t\twindow.opener.document.EditView.account_id.value = account_id;\n\t\t}\n\t\tif (confirm(alert_arr.OVERWRITE_EXISTING_ACCOUNT1 + account_name + alert_arr.OVERWRITE_EXISTING_ACCOUNT2)) {\n\t\t\tif (typeof (window.opener.document.EditView.mailingstreet) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingstreet.value = bill_street;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherstreet) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherstreet.value = ship_street;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingcity) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingcity.value = bill_city;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.othercity) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.othercity.value = ship_city;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingstate) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingstate.value = bill_state;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherstate) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherstate.value = ship_state;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingzip) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingzip.value = bill_code;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherzip) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherzip.value = ship_code;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingcountry) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingcountry.value = bill_country;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.othercountry) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.othercountry.value = ship_country;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.mailingpobox) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.mailingpobox.value = bill_pobox;\n\t\t\t}\n\t\t\tif (typeof (window.opener.document.EditView.otherpobox) != 'undefined') {\n\t\t\t\twindow.opener.document.EditView.otherpobox.value = ship_pobox;\n\t\t\t}\n\t\t}\n\t}\n}", "function load_contact(data) {\n // contact_item is a list of attribute name:\n // ['address', 'phone', 'email', 'city', 'suburb']\n for (const item of contact_item) {\n let p = item.getElementsByTagName('p')[0];\n addr[p.id] = data[p.id];\n p.innerHTML = data[p.id];\n }\n}", "address(value) {\n return Object(address_lib_esm[\"a\" /* getAddress */])(value);\n }", "function Addresses() {\n this.physicalAddress = {};\n this.emailAddress = {};\n}", "function address(a) {\n var lines = [];\n if (a.info.name !== null && a.info.name)\n lines.push(\"<strong>\" + a.info.name + \"</strong>\");\n if (a.info.address_1 !== null && a.info.address_1)\n lines.push(a.info.address_1);\n if (a.info.address_2 !== null && a.info.address_2)\n lines.push(a.info.address_2);\n if (a.info.city || a.info.state || a.info.zip) {\n var line = [];\n if (a.info.city !== null)\n line.push(a.info.city);\n if (a.info.state !== null)\n line.push(a.info.state);\n if (a.info.zip !== null)\n line.push(a.info.zip);\n lines.push(line.join(\" \"));\n }\n if (a.country !== null && a.country)\n lines.push(a.country);\n if (a.info.phone !== null && a.info.phone)\n lines.push(a.info.phone);\n if (a.info.email !== null && a.info.email && a.info.email)\n lines.push(a.info.email);\n if (a.info.web !== null && a.info.web)\n lines.push(a.info.web);\n return lines.join(\"<br>\");\n}", "getPersonAddress() {\n return 'Mumbai'\n }", "function _value() {\r\n let link = 'mailto:';\r\n link += _recipients.join(',');\r\n\r\n // adds & to the end of the link if the last char is neither & or ?\r\n function addAmp() {\r\n if(link.slice(-1) !== '&' && link.slice(-1) !== '?') link += '&';\r\n };\r\n\r\n if(_ccs.length > 0 || _bccs.length > 0 || _subject != '' || _content != '') {\r\n \r\n link += '?';\r\n \r\n // add list of copies joined by a comma\r\n if(_ccs.length > 0) link += 'cc=' + _ccs.join(',');\r\n addAmp();\r\n\r\n // add list of blindcopies joined by a comma\r\n if(_bccs.length > 0) link += 'bcc=' + _bccs.join(',');\r\n addAmp();\r\n\r\n // adds the subject to the link\r\n if(_subject !== '') link += 'subject=' + _subject;\r\n addAmp(); \r\n \r\n if(_content !== '') link += 'body=' + _content;\r\n }\r\n return link;\r\n }", "function Verfication_companyName_Shipping_address (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E27_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function CustomerAddress() {\n\n}", "formatAddresses(recipients) {\n\t\treturn recipients.map(({ email }) => {\n\t\t\treturn new helper.Email(email);\n\t\t});\n\t}", "generatorAddress(...args) {\n let fieldName = this._daftFieldName('Generator-Address');\n if (args.length) {\n Must(args.length === 1);\n Must(!this.header.has(fieldName)); // or is that unnecessary too strict?\n this.header.add(fieldName, Gadgets.PrettyAddress(args[0]));\n }\n const rawValue = this.header.value(fieldName);\n return Authority.Parse(rawValue).toHostPort();\n }", "function updateAddressText()\n{\n nlapiLogExecution('DEBUG', 'updateAddressText', 'Begin');\n \n var addressId = nlapiGetFieldValue('custrecord_jobopt_address');\n if (addressId) {\n var addressText = '';\n var address = nlapiLoadRecord('customrecord_address', addressId);\n var addressee = address.getFieldValue('custrecord_ad_addressee');\n if (addressee) {\n addressText += addressee;\n }\n var address1 = address.getFieldValue('custrecord_ad_address1');\n if (address1) {\n addressText += '\\n' + address1;\n }\n var address2 = address.getFieldValue('custrecord_ad_address2');\n if (address2) {\n addressText += '\\n' + address2;\n }\n var city = address.getFieldValue('custrecord_ad_city');\n if (city) {\n addressText += '\\n' + city;\n }\n var postcode = address.getFieldValue('custrecord_ad_postcode');\n if (postcode) {\n addressText += ', ' + postcode;\n }\n var countryId = address.getFieldValue('custrecord_ad_country');\n var countryName = '';\n if (countryId) {\n var country = nlapiLoadRecord('customrecord_country', countryId);\n countryName = country.getFieldValue('name');\n }\n if (countryName) {\n addressText += '\\n' + countryName;\n }\n \n nlapiSetFieldValue('custrecord_jobopt_addresstext', addressText);\n }\n \n nlapiLogExecution('DEBUG', 'updateAddressText', 'Exit Successfully');\n}", "function printEmail(name, site, tld) {\n var at = \"@\";\n $('<a id=\"email\" class=\"pro\" href=\"mailto:' + name + at + site + '.' + tld + '\">' + name + at + site + '.' + tld + '</a>').replaceAll('#email');\n }", "function getEmailAgent(params){\n\n}", "get address(){return this._address;}", "get address(){return this._address;}", "get address(){return this._address;}", "function normalisePlacesApiAddress(details, fromGP) {\r\n\t\t\tvar ac = fromGP.address_components;\r\n\r\n\t\t\t// Copy Googles version of an address to something more useable for us\r\n\t\t\tvar street = findPart(ac, \"street_address\");\r\n\t\t\tif (street === \"\")\r\n\t\t\t// not present so fallback to \"route\"\r\n\t\t\t\tstreet = findPart(ac, \"route\");\r\n\r\n\t\t\tvar town = findPart(ac, \"locality\"),\r\n\t\t\t\t\tarea = findPart(ac, \"administrative_area_level_1\"),\r\n\t\t\t\t\tpostCode = findPart(ac, \"postal_code\")\r\n\t\t\t;\r\n\r\n\t\t\tdetails.street = street;\r\n\t\t\tdetails.town = town;\r\n\t\t\tdetails.area = area;\r\n\t\t\tdetails.postCode = postCode;\r\n\r\n\t\t\t// and some other bits\r\n\t\t\tdetails.name = fromGP.name || \"\";\r\n\t\t\tif (fromGP.photos && fromGP.photos.length > 0)\r\n\t\t\t\tdetails.photo = fromGP.photos[0];\r\n\t\t\tdetails.url = fromGP.url || \"\";\r\n\t\t\tdetails.website = fromGP.website || \"\";\r\n\t\t\tdetails.telNo = fromGP.formatted_phone_number || fromGP.telNo || \"\";\r\n\r\n\t\t} // normalisePlacesApiAddress", "get address() { return this._address; }", "add(givenName, surName, emailAddresses, businessPhones, additionalProperties = {}) {\r\n const postBody = extend({\r\n businessPhones: businessPhones,\r\n emailAddresses: emailAddresses,\r\n givenName: givenName,\r\n surName: surName,\r\n }, additionalProperties);\r\n return this.postCore({\r\n body: jsS(postBody),\r\n }).then(r => {\r\n return {\r\n contact: this.getById(r.id),\r\n data: r,\r\n };\r\n });\r\n }", "preparingEmailSending() {\n const url = 'mailto:' + this.state.email + '?subject=Your Storj mnemonic&body=' + this.state.mnemonic;\n Linking.openURL(url); \n }", "function address(authorinfo) /* (authorinfo : authorinfo) -> string */ {\n return authorinfo.address;\n}", "function org_zmail_contactcleaner() {\n}", "function obMail(a, b) {\n window.location.href = \"mail\" + \n \"to:\" + \n window.atob(a) +\n \"?subject=\" + \n escape(\"Mask Request from Mutual Aid Arlington\") +\n \"&body=\" + \n escape(b)\n ;\n}", "function _defineMailOptions(to, from, cc, subject, body, attch) {\n\treturn {\n\t\tfrom: from,\n\t\tto: to,\n\t\tcc: cc,\n\t\tsubject: subject,\n\t\ttext: body.plainText,\n\t\thtml: body.htmlText\n\t};\n}", "function showAddress(street,city,zipCode) { \r\n return {\r\n street: street,\r\n city: city,\r\n zipCode: zipCode\r\n }\r\n}", "function buildParams (firstname, lastname, verifyemail, buyinggroup) {\n params = {\n \"message\": {\n \"from_email\":\"[email protected]\",\n \"to\":[{\"email\":\"[email protected]\"}],\n \"subject\": \"New Signup Request\",\n \"html\": \"<p>You Have a new signup request. The Details are as follows: </p><br /><ul><li>Name: \" + firstname + \" \" + lastname +\".</li><li>Email Address: \" + signupemail + \".</li><li>Buying Group: \"+ buyinggroup + \".</li></ul><p>Please respond to the request within one business day!</p>\"\n }\n };\n}", "function checkAddresses()\n {\n console.log('billling address -' + billing_address);\n console.log('shipping address -' + shipping_address);\n }", "function addressForData(streetString,cityString,stateString,postalCode,countryString) {\n \n var completeAddress = \"\";\n \n if (streetString != null && streetString.length>0) {\n completeAddress = streetString + \",\";\n }\n if (cityString != null && cityString.length > 0) {\n completeAddress = completeAddress + cityString + \",\";\n }\n if (stateString != null && stateString.length > 0) {\n completeAddress = completeAddress + stateString + \" \";\n }\n if (postalCode != null && postalCode.length > 0) {\n completeAddress = completeAddress + postalCode + \",\";\n }\n if (countryString != null && countryString.length > 0) {\n completeAddress = completeAddress + countryString;\n }\n return completeAddress;\n \n}", "function getAddressDetails(place) {\n \t\n \t for (var component in componentForm) {\n document.getElementById(component).value = ''; \t \n }\n\n // Get each component of the address from the place details\n // and fill the corresponding field on the form.\n \t\n for (var i = 0; i < place.address_components.length; i++) {\n var addressType = place.address_components[i].types[0];\n if (componentForm[addressType]) {\n var val = place.address_components[i][componentForm[addressType]];\n document.getElementById(addressType).value = val;\n \n }\n }\n }", "function Verfication_companyName_Shipping_address (input){\r\n\t\tvar result = new Object();\r\n\t\tvar error;\r\n\t\tresult.flgname = [];\r\n\t\tresult.flgflag = [];\r\n\t\tresult.flgvalue = [];\r\n\t\tresult.flgmsg = [];\r\n\t\tresult.pass = true;\r\n\t\tif (!presence_check(input)){\r\n\t\t\terror = \"E20_2\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t\t}\r\n\t\tconsole.log(result.flgname.length);\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n}", "function formatAddress(address) {\n\treturn address;\n}", "function fBuildEMailRouting() {\n avEmailForms = {}; // reset global variable. for some reason we setup all email addresses now...\n\n for (i = 0; i < vaServices.length; i++) {\n var dService = vaServices[i];\n var oForm = dService[\"form\"];\n var aFormName = dService[\"product\"];\n var aEmail = dService[\"email\"];\n var ocb = dService[\"cb\"]; // checkbox\n var bOn = ocb.rawValue == 1;\n //fLog(\"found email form - \" + aEmail + \" - \" + aFormName + \" - \"+ bOn);\n if (bOn) {\n fLog(\"found email to add - \" + aEmail + \" - \" + aFormName);\n addEmailForm(aEmail, aFormName, oForm);\n }\n }\n}", "function multiLineAddress( address ) {\r\n\tif( ! address )\r\n\t\treturn '';\r\n\tif( typeof address == 'string' )\r\n\t\treturn H(address)\r\n\t\t\t//.replace( /, USA$/, '' )\r\n\t\t\t.replace( /, (\\w\\w) /, '\\| $1 ' )\r\n\t\t\t.replace( /, /g, '<br>' )\r\n\t\t\t.replace( /\\|/g, ',' );\r\n\treturn S(\r\n\t\taddress.line1 ? H(address.line1) + '<br>' : '',\r\n\t\taddress.line2 ? H(address.line2) + '<br>' : '',\r\n\t\tH(address.city), ', ', H(address.state),\r\n\t\taddress.zip ? ' ' + H(address.zip) : ''\r\n\t);\r\n}", "setAdress(aAdress){\n this.adress = aAdress;\n }", "function smtp_fields () \n {\n var $host = $params( '.smtp-body-wrap .smtp-host-value' ).val();\n\n if ( $params( '.smtp-body-wrap .smtp-auth-value' ).is(':checked') ) {\n var $auth = 2;\n } else {\n var $auth = 1;\n }\n\n var $port = $params( '.smtp-body-wrap .smtp-port-value' ).val();\n\n var $user = $params( '.smtp-body-wrap .smtp-username-value' ).val();\n var $pass = $params( '.smtp-body-wrap .smtp-password-value' ).val();\n\n if( $params( '.smtp-body-wrap .smtp-secure-ssl' ).is(':checked') ) {\n var $secure = 1;\n } else {\n var $secure = 2;\n }\n\n var $from = $params( '.smtp-body-wrap .smtp-from-value' ).val();\n var $from_name = $params( '.smtp-body-wrap .smtp-from-name' ).val();\n\n return { 'wp-gcf-host':$host,'wp-gcf-smtp-auth':$auth,'wp-gcf-port':$port,'wp-gcf-user':$user,'wp-gcf-pass':$pass,'wp-gcf-smtp-secure':$secure,'wp-gcf-from':$from,'wp-gcf-from-name':$from_name };\n }", "function popuUserDetails(dataProd){\r\n document.getElementById(\"firstName\").value=dataProd.firstName;\r\n document.getElementById(\"firstName\").disabled=true;\r\n\r\n document.getElementById(\"lastName\").value=dataProd.lastName;\r\n document.getElementById(\"lastName\").disabled=true;\r\n\r\n document.getElementById(\"email\").value=dataProd.emailId;\r\n document.getElementById(\"email\").disabled=true;\r\n\r\n document.getElementById(\"ph\").value=dataProd.phoneNumber;\r\n document.getElementById(\"ph\").disabled=true;\r\n var urlAddr = dataProd._links.address.href;\r\n address(urlAddr);\r\n}", "function validateCRMAddress(crmRecordObj, coreRecordObj) {\n var functionTitle = \"validateCRMAddress: \";\n var addressValidated = false;\n var addressValidatedLog;\n\n //first check if there is already a valid address, else try to validate again\n var addresses = getRecordAddresses();\n if (addresses && addresses.length > 0) { // if there is an address on the shadow record (it was validated by CRM integration)\n logDebug(functionTitle + \"Address was validated by the CRM Integration.\");\n addressValidated = true;\n } else { // else if no address on shadow record (it could not be validated, so we will try harder)\n\n var crmAddressString = getAppSpecific(\"Location\"); //crm address saved in shadow custom field.Location\n var searchAddresses = parseAndSearchAddrFromCRM(crmAddressString, true); // enable fuzzy search because google maps doesn't match ArcGIS\n\n // TO DO: if the search returned 0 OR multiple matches, flag it for human validation\n if (searchAddresses.indexOf(\"WARNING\") > -1) { //\n addressValidatedLog = searchAddresses;\n logDebug(functionTitle + \": \" + addressValidatedLog);\n createCapComment(addressValidatedLog, coreRecordObj);\n\n return false;\n }\n\n // if ONE valid address found\n if (searchAddresses) { //\n var refAddress = searchAddresses[0];\n refAddress.setPrimaryFlag(\"Y\");\n\n\n var addressModel = warpRefAddressModelToAddressModel(refAddress);\n var newAddrResult = aa.address.createAddressWithAPOAttribute(capId, addressModel);\n if (newAddrResult.getSuccess()) {\n var newAddr = newAddrResult.getOutput();\n logDebug(functionTitle + \"Successfully added address to record: \" + newAddr);\n //get parcel for the validate address\n var addrUID = refAddress.getUID();\n\n //logDebug(\"Attributes: \");\n var addrAttributes = refAddress.getAttributes();\n var addrAttrArray = addrAttributes.toArray()\n\n // get the parcel and owner using address data\n addParceAndOwnerByAddress(capId, refAddress.houseNumberStart, refAddress.houseNumberEnd, refAddress.streetDirection, refAddress.streetName, refAddress.streetSuffix, refAddress.unitStart, refAddress.unitEnd, refAddress.city);\n copyParcelGisObjects();\n\n addressValidated = true;\n } else {\n logDebug(functionTitle + \"ERROR creating record address from reference address. \" + newAddrResult.getErrorMesssage());\n }\n }\n }\n return addressValidated;\n}", "concatDorAddress(parcel, includeUnit) {\n includeUnit = !!includeUnit;\n var STREET_FIELDS = [ 'STDIR', 'STNAM', 'STDES', 'STDESSUF' ];\n var props = parcel.properties;\n\n // handle house num\n var addressLow = this.cleanDorAttribute(props.HOUSE);\n var addressHigh = this.cleanDorAttribute(props.STEX);\n // maybe should be props.SUF below (it said props.SUFFIX)\n var addressSuffix = this.cleanDorAttribute(props.SUF);\n var address = addressLow;\n address = address + (addressHigh ? '-' + addressHigh : '');\n address = address + (addressSuffix || '');\n\n // handle unit\n var unit = this.cleanDorAttribute(props.UNIT);\n if (unit) {\n unit = '# ' + unit;\n }\n\n // clean up attributes\n var comps = STREET_FIELDS.map(function(streetField) {\n return props[streetField];\n });\n comps = comps.map(this.cleanDorAttribute);\n // TODO handle individual address comps (like mapping stex=2 => 1/2)\n // addressLow = comps.HOUSE,\n // addressHigh = comps.STEX,\n // streetPredir = comps.STDIR,\n // streetName = comps.STNAM,\n // streetSuffix = comps.STDES,\n // streetPostdir = comps.STDESSUF,\n\n // add address to front\n comps = [ address ].concat(comps);\n\n // add unit to end\n if (includeUnit) {\n comps = comps.concat([ unit ]);\n }\n\n // remove nulls and concat\n address = comps.filter(Boolean).join(' ');\n\n // console.log('concatDorAddress address result:', address);\n if (address === '') {\n address = 'Parcel has no address';\n }\n return address;\n }", "function addDestinationAddress() {\n showDetail_Message();\n document.getElementById(\"textdivshowResult\").innerHTML = \"\";\n document.getElementById(\"textdivshowName\").innerHTML = \"Method addAddress\";\n document.getElementById(\"textdivshowExplanation\").innerHTML = \"Add an address as the message's destination/cc/bcc address.Multiple addresses are separated by \\\";\\\"\";\n document.getElementById(\"textdivshowSampleCode\").innerHTML = \"E.g.1: msg.addAddress(\\\"destination\\\",\\\"13511071062\\\"); E.g.2: msg.addAddress(\\\"cc\\\",\\\"13511071063\\\");\";\n document.getElementById(\"textdivshowInitialCondition\").innerHTML = \"Notice : n/a\";\n flag = \"addDestinationAddress1\";\n}", "getAddress()\n {\n return this.adress;\n }", "static initialize(obj, emailAddress) { \n obj['emailAddress'] = emailAddress;\n }", "function address(address)\r\n{\r\n var requestAddr = new XMLHttpRequest();\r\n requestAddr.onreadystatechange = function() {\r\n if (this.readyState == 4) {\r\n dataAddr = JSON.parse(this.responseText);\r\n dataAddr = dataAddr._embedded.addresses[0];\r\n popuAddrDetails(dataAddr);\r\n }\r\n };\r\n\r\n requestAddr.open(\"GET\", address, true);\r\n requestAddr.send();\r\n}", "getToAddresses() {\n let addresses = [this.formConfig.to];\n\n if (this.formConfig.bcc) {\n addresses.push(this.formConfig.bcc);\n }\n\n return addresses;\n }", "function NewAddress(firstName, lastName, email, phone)\r\n\t{\r\n\t\tthis.firstName = firstName;\r\n\t\tthis.lastName = lastName;\r\n\t\tthis.email = email;\r\n\t\tthis.phone = phone;\r\n\t}", "function copyAddress(form, fromKey, toKey) {\n\n var elems = new Array(\"address_street\", \"address_city\", \"address_state\", \"address_postalcode\", \"address_country\");\n var checkbox = document.getElementById(toKey + \"_checkbox\");\n\n if(typeof checkbox != \"undefined\") {\n if(!checkbox.checked) {\n\t\t for(x in elems) {\n\t\t t = toKey + \"_\" + elems[x];\n\t\t\t document.getElementById(t).removeAttribute('readonly');\n\t\t }\n } else {\n\t\t for(x in elems) {\n\t\t\t f = fromKey + \"_\" + elems[x];\n\t\t\t t = toKey + \"_\" + elems[x];\n\n\t\t\t document.getElementById(t).value = document.getElementById(f).value;\n\t\t\t document.getElementById(t).setAttribute('readonly', true);\n\t\t }\n\t }\n }\n \treturn true;\n}", "function email(authorinfo) /* (authorinfo : authorinfo) -> string */ {\n return authorinfo.email;\n}", "function ReportInvoiceQrCodeWithAddress() {\n\n}", "get address () {\n\t\treturn this._address;\n\t}", "function parseAddress(user){\n let address = '';\n return address = `${user.location.street.number} ${user.location.street.name}, ${user.location.city}, ${user.location.state} ${user.location.postcode}`\n}", "static get properties() {\n return {\n recipient_email : { type: String }, //Should be array?\n form_obj : { type: Object },\n msgSuccess : { type: Boolean },\n recipient_email : { type: String },\n loading : { type: Boolean },\n };\n }", "function mailTo(obj) {\n\t//alert('mailto:'+eval(obj.getAttribute('id')));\n\tobj.setAttribute('href', 'mailto:' + eval(obj.getAttribute('id')));\n}", "constructor( { subject, recipients }, content) {\n super();\n //pass keys, gives object we can use to interact with API\n this.sgApi = sendgrid(keys.sendGridKey);\n this.from_email = new helper.Email('[email protected]');\n this.subject = subject;\n this.body = new helper.Content('text/html', content);\n this.recipients = this.formatAddresses(recipients);\n \n //built-in functionality of helper mail class\n this.addContent(this.body);\n //clicktracking\n this.addClickTracking();\n //helper called in class\n this.addRecipients();\n }", "function mkAssociateLeadPerformQuote(firstName, lastName, emailAddress, phoneNumber, \ntype, term, prem,sumAssured,sex1,sex2,age1,age2,smoker1,smoker2,emailPermission)\n{\t\n\tvar hash = getHash(key+emailAddress);\n\tif (type == 'M')\n\t{\n\t\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: false,LeadSourceDetail:'Quote',\n\t\t\tQuoteLifeMortAge1: age1,QuoteLifeMortAge2:age2,QuoteLifeMortPremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\t\tQuoteLifeMortSmoker1:smoker1,QuoteLifeMortSmoker2: smoker2, 'Permissions-Email':emailPermission,\n\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\t\tQuoteLifeMortSex1:sex1,QuoteLifeMortSex2:sex2,QuoteLifeMortSumAssured:sumAssured,QuoteLifeMortTerm:term,QuoteType:type},hash);\n\t}\n\telse if (type=='T')\n\t{\n\t\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: false,LeadSourceDetail:'Quote',\n\t\t\tQuoteLifeTermAge1: age1,QuoteLifeTermAge2:age2,QuoteLifeTermPremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\t\tQuoteLifeTermSmoker1:smoker1,QuoteLifeTermSmoker2: smoker2, 'Permissions-Email':emailPermission,\n\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\t\tQuoteLifeTermSex1:sex1,QuoteLifeTermSex2:sex2,QuoteLifeTermSumAssured:sumAssured,QuoteLifeTermTerm:term,QuoteType:type},hash);\t\n\t}\n\telse if (type == 'W')\n\t{\n\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: false,LeadSourceDetail:'Quote',\n\t\tQuoteLifeWholeAge1: age1,QuoteLifeWholeAge2:age2,QuoteLifeWholePremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\tQuoteLifeWholeSmoker1:smoker1,QuoteLifeWholeSmoker2: smoker2, 'Permissions-Email':emailPermission,\n\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\t\t\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\tQuoteLifeWholeSex1:sex1,QuoteLifeWholeSex2:sex2,QuoteLifeWholeSumAssured:sumAssured,QuoteLifeWholeTerm:term,QuoteType:type},hash);\n\t}\n\t\tmkVisitWebPage('/life-assurance-quote-email-to-self');\n\n\t\tga('send','pageview','/life-assurance/quote-emailed');\n\t\t\n\t\n\t\n}", "function initEmailAddress(cart) {\n if (cart.getCustomerEmail() !== null) {\n app.getForm('billing').object.billingAddress.email.emailAddress.value = cart.getCustomerEmail();\n } else if (customer.authenticated && customer.profile.email !== null) {\n app.getForm('billing').object.billingAddress.email.emailAddress.value = customer.profile.email;\n }\n}", "populateAddress() {\n const { restaurantAddress, restaurantNeighborhood } = this.pageElements;\n const { address, neighborhood } = this.restaurant;\n\n restaurantAddress.textContent = address;\n restaurantNeighborhood.textContent = neighborhood;\n }", "get data() {\n return {\n from: this._from\n , to: this.userdata.email\n , replyTo: this._replyTo\n , subject: this._subject\n , generateTextFromHTML: true\n }\n }", "function getAddressString() {\n let address_phone = \"\";\n if(address === undefined && postalCode === undefined && city === undefined) { \n address_phone = \"No information available\";\n }\n else {\n address_phone += (address !== undefined ? `${address} <br />` : \" \");\n address_phone += (postalCode !== undefined ? postalCode : \" \") + (city !== undefined ? ` ${city} <br />`: \" \");\n }\n \n return address_phone;\n }", "function cfnEmailIdentityMailFromAttributesPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnEmailIdentity_MailFromAttributesPropertyValidator(properties).assertSuccess();\n return {\n BehaviorOnMxFailure: cdk.stringToCloudFormation(properties.behaviorOnMxFailure),\n MailFromDomain: cdk.stringToCloudFormation(properties.mailFromDomain),\n };\n}", "function popuAddrDetails(dataAddr){\r\n document.getElementById(\"addr1\").value=dataAddr.streetAddress1;\r\n document.getElementById(\"addr1\").disabled=true;\r\n\r\n document.getElementById(\"addr2\").value=dataAddr.streetAddress2;\r\n document.getElementById(\"addr2\").disabled=true;\r\n\r\n document.getElementById(\"city\").value=dataAddr.city;\r\n document.getElementById(\"city\").disabled=true;\r\n\r\n document.getElementById(\"country\").value=dataAddr.country;\r\n document.getElementById(\"country\").disabled=true;\r\n\r\n populateStates( \"country\",\"state\" );\r\n document.getElementById(\"state\").value=dataAddr.state;\r\n document.getElementById(\"state\").disabled=true;\r\n\r\n document.getElementById(\"postal\").value=dataAddr.postalCode;\r\n document.getElementById(\"postal\").disabled=true;\r\n \r\n \r\n}", "testAddress() {\n if (this.isReseller) {\n // If current offer is a reseller offer,\n // launch eligibility test address for partners (reseller)\n return this.OvhApiConnectivityEligibility.v6().testAddressPartners(\n this.$scope,\n {\n streetCode: this.address.street.streetCode,\n streetNumber: this.address.streetNumber,\n },\n );\n }\n return this.OvhApiConnectivityEligibility.v6().testAddress(this.$scope, {\n streetCode: this.address.street.streetCode,\n streetNumber: this.address.streetNumber,\n });\n }", "addAddress(id, address) {\n if (address.length > 0) {\n if (id === 'to') {\n const to2 = [...this.state.to2];\n to2.push(address);\n const to = to2.join(',');\n this.setState({to2, to});\n // this.props.setMailContacts(to);\n\n }\n }\n }", "function mkAssociateLeadWithQuote(firstName, lastName, emailAddress, phoneNumber, type, term, prem,\nsumAssured,sex1,sex2,age1,age2,smoker1,smoker2, contacttime)\n{\n\t/*\n\n\ttype=M/T/W\n\tterm=number of years or zero\n\tsex1/sex2=M/F\t\n\tparseFloat(Math.round(num3 * 100) / 100).toFixed(2);\n\t*/\t\n\tvar hash = getHash(key+emailAddress);\n\t\n\tif (type == 'M')\n\t{\n\t\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: true,LeadSourceDetail:'Website Quote and Callback',\n\t\t\tQuoteLifeMortAge1: age1,QuoteLifeMortAge2:age2,QuoteLifeMortPremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\t\tQuoteLifeMortSmoker1:smoker1,QuoteLifeMortSmoker2: smoker2, \n\t\t\tQuoteLifeMortSex1:sex1,QuoteLifeMortSex2:sex2,PerferredTimeToContact:contacttime,\n\t\t\tCallbackAreaOfInterest: 'New Plan',\n\t\t\t\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\t\tQuoteLifeMortSumAssured:sumAssured,QuoteLifeMortTerm:term,QuoteType:type},hash);\n\t}\n\telse if (type=='T')\n\t{\n\t\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: true,LeadSourceDetail:'Website Quote and Callback',\n\t\t\tQuoteLifeTermAge1: age1,QuoteLifeTermAge2:age2,QuoteLifeTermPremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\t\tQuoteLifeTermSmoker1: smoker1, QuoteLifeTermSmoker2:smoker2,PerferredTimeToContact:contacttime,\n\t\t\tCallbackAreaOfInterest: 'New Plan',\n\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\t\t\t\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\t\tQuoteLifeTermSex1:sex1,QuoteLifeTermSex2:sex2,QuoteLifeTermSumAssured:sumAssured,QuoteLifeTermTerm:term,QuoteType:type},hash);\t\n\t}\n\telse if (type == 'W')\n\t{\n\t\tif (isFunction())mktoMunchkinFunction('associateLead',{Email: emailAddress,\n\t\tFirstName: firstName,MobilePhone: phoneNumber,LastName: lastName, Callbackrequested: true,LeadSourceDetail:'Website Quote and Callback',\n\t\tQuoteLifeWholeAge1: age1,QuoteLifeWholeAge2:age2,QuoteLifeWholePremium:parseFloat(Math.round(prem * 100) / 100).toFixed(2),\n\t\tQuoteLifeWholeSmoker1:smoker1,QuoteLifeWholeSmoker2:smoker2,PerferredTimeToContact:contacttime,\n\t\tCallbackAreaOfInterest: 'New Plan',\n\tLastGACampaignNameVisit:gaCampaign,\n\tOriginalGACampaignVisit:gaCampaign,\n\tLastGAMedium: gaMedium,\n\tOriginalGAMedium: gaMedium,\t\n\t\tQuoteLifeWholeSex1:sex1,QuoteLifeWholeSex2:sex2,QuoteLifeWholeSumAssured:sumAssured,QuoteLifeWholeTerm:term,QuoteType:type},hash);\t\n\t}\n}", "function Verfication_companyName_Shipping_address (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E27_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tconsole.log(result.flgname.length);\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "validateAddress() {\n // Remove white space from start and end\n let newAddress = this.addressInput.node.textContent.trim();\n // Remove initial @ sign if necessary\n const atStringNumber = newAddress.search(\"@\");\n if (atStringNumber === 0) {\n newAddress = newAddress.substring(1);\n }\n return newAddress;\n }", "function makeEmailObj( emailArr){\noutput=emailArr.fname + \".\" + emailArr.lname +\"@evolveu.ca\";\nreturn output;\n}", "constructor(email, address) {\n this.myEmail = email;\n this.myAddress = address;\n }", "function EmailAddress(email, type) {\n this.email = email;\n this.type = type;\n}", "addAddress(id, address) {\n if (address.length > 0) {\n if (id === \"to\") {\n const to2 = [...this.state.to2];\n to2.push(address);\n const to = to2.join(\",\");\n this.setState({ to2, to }, () => {\n this.props.updateComposerData(this.state);\n });\n this.props.setMailContacts(to);\n } else if (id === \"cc\") {\n const cc2 = [...this.state.cc2];\n cc2.push(address);\n const cc = cc2.join(\",\");\n this.setState({ cc2, cc }, () => {\n this.props.updateComposerData(this.state);\n });\n } else if (id === \"bcc2\") {\n const bcc2 = [...this.state.bcc2];\n bcc2.push(address);\n const bcc = bcc2.join(\",\");\n this.setState({ bcc2, bcc }, () => {\n this.props.updateComposerData(this.state);\n });\n }\n }\n }", "function GetEMAIL_CONTACT(){\n return enumParams(COLUMN_CONTACT).join();\n}", "async function main( \n transType, address1, address2, address3, countryState, email, firstBookDate, lastBookDate, newsletter, postCode, surname, title, town, userID, category \n ) {\n // Generate test SMTP service account from ethereal.email\n // Only needed if you don't have a real mail account for testing\n // const testAccount = await nodemailer.createTestAccount();\n\n // create reusable transporter object using the default SMTP transport\n // const transporter = nodemailer.createTransport({\n // host: 'smtp.ethereal.email',\n // port: 587,\n // secure: false, // true for 465, false for other ports\n // auth: {\n // user: testAccount.user, // generated ethereal user\n // pass: testAccount.pass, // generated ethereal password\n // },\n // });\n\n var transporter = nodemailer.createTransport({\n service: 'gmail',\n auth: {\n user: '[email protected]',\n pass: 'F0rumre1'\n }\n });\n\n\n \n // send mail with defined transport object\n const info = await transporter.sendMail({\n from: '\"ParkDIA Server\" <[email protected]>', // sender address\n to: '[email protected]', // list of receivers\n subject: 'M15815', // Subject line\n text: `Transaction Type: ${transType} \\r\\n\\r\\n Address 1: ${address1} \\r\\n\\r\\n Address 2: ${address2} \\r\\n\\r\\n Address 3: ${address3} \\r\\n\\r\\n Country/State: ${countryState} \\r\\n\\r\\n Email: ${email} \\r\\n\\r\\n First Booking Date: ${firstBookDate} \\r\\n\\r\\n Last Booking Date: ${lastBookDate} \\r\\n\\r\\n Newsletter Opt In: ${newsletter} \\r\\n\\r\\n Postcode: ${[postCode]} \\r\\n\\r\\n Surname: ${surname} \\r\\n\\r\\n Title: ${title} \\r\\n\\r\\n Town: ${town} \\r\\n\\r\\n User ID: ${userID} \\r\\n\\r\\n Category: ${category}` , // plain text body\n html: `Transaction Type: ${transType} </br> Address 1: ${address1} </br> Address 2: ${address2} </br> Address 3: ${address3} </br> Country/State: ${countryState} </br> Email: ${email} </br> First Booking Date: ${firstBookDate} </br> Last Booking Date: ${lastBookDate} </br Newsletter Opt In: ${newsletter} </br> Postcode: ${[postCode]} </br> Surname: ${surname} </br> Title: ${title} </br> Town: ${town} </br> User ID: ${userID} </br> Category: ${category}`, // html body\n });\n\n // console.log('Message sent: %s', info.messageId);\n // // Message sent: <[email protected]>\n\n // // Preview only available when sending through an Ethereal account\n // console.log('Preview URL: %s', nodemailer.getTestMessageUrl(info));\n // // Preview URL: https://ethereal.email/message/WaQKMgKddxQDoou...\n\n transporter.sendMail(info, function (err, info) {\n if(err)\n console.log(err)\n else\n console.log(info);\n });\n}", "getAddressField(telegram) {\n let values = telegram.getValues();\n\n return values.has('BLOCK1_A') ?\n values.get('BLOCK1_A') : null;\n }", "get address() \n{ return this._address; \n}", "constructor({ subject, recipients }, content) {\n //makes sure an constructors in the helper class that we extended get ran first.\n super();\n\n //Method used to send out the Mailer to sendgrid.\n //pass the sendgrid key into the sendgrid library, and that returns an object that we can send off\n this.sgApi = sendGrid(keys.sendGridKey);\n\n //Who the e-mail is coming from\n this.from_email = new helper.Email('[email protected]');\n this.subject = subject;\n //Creates the bosy of the e-mail. first arg is what type of body content we are passing in, 2nd arg is the html string we want rendered in the e-mail.\n this.body = new helper.Content('text/html', content);\n //Created a helper function to format the list of objects that contain each recipient e-mail\n //The function returns an array with each index contianing an e-mail wrapped in the helper.Email function from sendgrid\n this.recipients = this.formatAddresses(recipients);\n\n //always have to use this method from the helper.Mail class to actually add the this.body as Content\n //available from helper.Email class\n this.addContent(this.body);\n\n //custom method that enables click tracking in the outgoing emails for our mailer\n this.addClickTracking();\n\n //custom method that processes the e-mail recipients array properly, so it can be packaged correctly for the outgoing mailer.\n this.addRecipients();\n }", "function bindingAddressField(){\n\n try {\n var input = _qAll('.billing_address_field'),\n billingAddress = _qById('billing_address1'),\n streetName = _qById('billing_streetname'),\n streetNumber = _qById('billing_streetnumber');\n\n if( !streetName && !streetNumber){\n return;\n }\n for (let item of input){\n item.addEventListener('keyup', function(){\n billingAddress.value = streetNumber.value +' '+ streetName.value;\n })\n }\n } catch (err){\n console.log('error: ', err);\n }\n }", "addRecipients() {\n const personalize = new helper.Personalization();\n this.recipients.forEach(recipient => {\n personalize.addTo(recipient);\n });\n this.addPersonalization(personalize);\n }", "function getAccountAddress(accountData)\n{\n\treturn accountData.Address1 + \" \" + accountData.City + \", \" + accountData.State + \" \" + accountData.PostalCode\n}", "getAdress(){\n return this.adress;\n }", "function handleXAddress(field, xAddress) {\n var _a, _b;\n var decoded = ripple_address_codec_1.xAddressToClassicAddress(xAddress);\n var tagName;\n if (field === DESTINATION)\n tagName = DEST_TAG;\n else if (field === ACCOUNT)\n tagName = SOURCE_TAG;\n else if (decoded.tag !== false)\n throw new Error(field + \" cannot have an associated tag\");\n return decoded.tag !== false\n ? (_a = {}, _a[field] = decoded.classicAddress, _a[tagName] = decoded.tag, _a) : (_b = {}, _b[field] = decoded.classicAddress, _b);\n}", "function handleXAddress(field, xAddress) {\n var _a, _b;\n var decoded = ripple_address_codec_1.xAddressToClassicAddress(xAddress);\n var tagName;\n if (field === DESTINATION)\n tagName = DEST_TAG;\n else if (field === ACCOUNT)\n tagName = SOURCE_TAG;\n else if (decoded.tag !== false)\n throw new Error(field + \" cannot have an associated tag\");\n return decoded.tag !== false\n ? (_a = {}, _a[field] = decoded.classicAddress, _a[tagName] = decoded.tag, _a) : (_b = {}, _b[field] = decoded.classicAddress, _b);\n}", "sendEmail(props) {\r\n const params = {\r\n properties: extend(metadata(\"SP.Utilities.EmailProperties\"), {\r\n Body: props.Body,\r\n From: props.From,\r\n Subject: props.Subject,\r\n }),\r\n };\r\n if (props.To && props.To.length > 0) {\r\n params.properties = extend(params.properties, {\r\n To: { results: props.To },\r\n });\r\n }\r\n if (props.CC && props.CC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n CC: { results: props.CC },\r\n });\r\n }\r\n if (props.BCC && props.BCC.length > 0) {\r\n params.properties = extend(params.properties, {\r\n BCC: { results: props.BCC },\r\n });\r\n }\r\n if (props.AdditionalHeaders) {\r\n params.properties = extend(params.properties, {\r\n AdditionalHeaders: props.AdditionalHeaders,\r\n });\r\n }\r\n return this.clone(UtilityMethod, \"SendEmail\", true).excute(params);\r\n }", "get address () {\n return this._address\n }", "get addressLine1Field () {\n return element(by.id(\"user.attributes.addressLine1\"));\n }", "function mainAdress(adress){\n const {city, state} = adress;\nconst newAddress = {\n city,\n state,\n country: 'United States'\n};\nconsole.log(`${newAddress.city}, ${newAddress.state}, ${newAddress.country}`);\n}", "function appendAddressData(data, address) {\n var foundAddress = addresses.find(function (element) {\n return element.address === address;\n });\n\n if (foundAddress) {\n data.address = foundAddress.address;\n data.private = foundAddress.privateKey;\n data.public = foundAddress.publicKey;\n }\n}" ]
[ "0.6394994", "0.62641364", "0.59870005", "0.5966322", "0.5890654", "0.58588636", "0.5832224", "0.5806213", "0.57945144", "0.5773716", "0.573977", "0.573756", "0.5735306", "0.5735306", "0.5735306", "0.5735306", "0.5729625", "0.56956494", "0.56909823", "0.5690604", "0.5653948", "0.5629343", "0.5605004", "0.5562346", "0.55335975", "0.5529698", "0.5514561", "0.55128706", "0.550762", "0.54739827", "0.54667234", "0.54667234", "0.54667234", "0.5429261", "0.5425957", "0.5405834", "0.5385935", "0.53823966", "0.537699", "0.5366378", "0.53595304", "0.53562826", "0.53533196", "0.5338331", "0.53342354", "0.53246486", "0.5322005", "0.53206044", "0.5320284", "0.5317475", "0.53093964", "0.53024036", "0.5300961", "0.5295945", "0.52943146", "0.529367", "0.52900034", "0.5282113", "0.5274068", "0.52660483", "0.5258577", "0.5257498", "0.5236582", "0.52362674", "0.5233936", "0.52331066", "0.52325517", "0.5228894", "0.5224607", "0.5219724", "0.5219148", "0.5208789", "0.52086896", "0.52062315", "0.5206081", "0.52040106", "0.51948315", "0.5194243", "0.5191923", "0.51898277", "0.5178833", "0.51766264", "0.5175671", "0.51744556", "0.51713634", "0.5165623", "0.5161769", "0.5157679", "0.51536006", "0.51459795", "0.51352394", "0.51264894", "0.511985", "0.511487", "0.51115346", "0.51115346", "0.51074725", "0.5106828", "0.5085384", "0.5085359", "0.50745064" ]
0.0
-1
5 digit mailing zip code
function mailing_zip5(input1, input2, input3){ var result = new Object(); result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; var error; var input1; var input2; var input3; var test2 = lkup_binary_m("lkup4","zipCode", input3).data; var test1 = { "city" : input1 , "state" : input2, "zipCode" : input3 }; result.pass = true; if (!check_allowed_char(input3, "numeric", "conf1")){ error = "E34_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input3)){ error = "E34_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input3, "zipCode5", "conf1")){ error = "E34_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if((lkup_binary_m("lkup4","zipCode",input3).found )){ if(!matchObj(test1, test2, "zipCode")){ error = "E32_23" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } } else{ error = "E26_22" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function zipvalidate(postcode){\n return /^[12346]\\d{5}$/.test(postcode);\n}", "function zip(string = '') {\n\treturn string.replace(/(\\w)(\\1{4,})/g, ($0, $1, $2, $$, $_) => $1 + `{${$2.length.toString(36)}}`);\n}", "function zipvalidateBest(postcode){\n return /^[12346]\\d{5}$/.test(postcode)\n}", "function validate_zip_code(type){\r\n var strValidChars = '0123456789';\r\n var zipcode_val = $('#'+type+'_zip_code_new').val();\r\n var flag = 1;\r\n \r\n //zipcode should be only 5 digit long\r\n if(zipcode_val.length < 5 || zipcode_val.length > 5){\r\n flag=0;\r\n }\r\n //if not numeric\r\n for(var i=0;i<zipcode_val.length;i++){\r\n strChar = zipcode_val.charAt(i);\r\n if (strValidChars.indexOf(strChar) == -1){\r\n flag=0;\r\n }\r\n }\r\n \r\n return flag;\r\n \r\n}", "function isZipCodeValid (zip) {\r\n return /^\\d{5}$/.test(zip)\r\n}", "function checkZip(zip) {\n return /^\\d{5}$/.test(zip);\n}", "function getZipValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"zipCode\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function zipCode(str) {\n var re = /^[0-9]{5}(?:-[0-9]{4})?$/; //-- Solution for bonus test\n //var re = /^\\d{5}$/;\n return re.test(str);\n}", "function isValidZipCode(str) {\n return /^\\d{5}$/g.test(str);\n}", "function isValidZip() {\n return /^[0-9]{5}$/.test(zip.value);\n}", "function GHValidateZipCode(source)\n{\n\tif (!ValidateRegular(source, \"\\\\d{5}(-\\\\d{4})?\"))\n\t{\n\t\tsource.select();\n\t\tsource.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isValidZipcode(zipcode) {\r\n return /(^\\d{5}$)/.test(zipcode) && isBaltimoreZipcode(zipcode); \r\n}", "function testZip(zip) {\n var zipRegExp = new RegExp('^\\\\d{5}$');\n if (!zipRegExp.test(zip)) {\n throw new Error();\n }\n}", "function IsValidUSzipcode(zip) {\n var pattern = new RegExp(/(^\\d{5}$)|(^\\d{5}\\-?\\d{4}$)/);\n return pattern.test(zip);\n}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function sanitizeZip(zip, city, state, country) {\n if(zip === '' && country === \"United States\") return zipcodes.lookupByName(city, state)[0].zip;\n if(zip === '' && country === \"Canada\") return '';\n if(zip !== '' && country === 'United States') return zip.substring(0,5);\n if(zip !== '' && country === \"Canada\") return zip.slice(0,3);\n}", "function validateZipCode(){\n\tvar nameFormat = /^\\d{5}$/; // Regex to indicate 5 numerical digits.\n\tvar errorFormat = /Invalid Zip Code<br>/;\n\tvar zipCode = document[formName][\"zipCode\"].value;\n\t\n\tvar errorString=\"\";\n\tif(!nameFormat.test(zipCode)) {\n\t\tif(!errorFormat.test(document.getElementById(p2).innerHTML))\n\t\t\terrorString += \"Invalid Zip Code<br>\";\n\t}\n\telse if(errorFormat.test(document.getElementById(p2).innerHTML)) {\n\t\tvar temp = document.getElementById(p2).innerHTML.split(errorFormat);\n\t\tvar t = \"\";\n\t\tfor (var i = 0 ; i < temp.length; i++) {\n\t\t\tt += temp[i];\n\t\t}\n\t document.getElementById(p2).innerHTML = t;\n\t}\n\tdocument.getElementById(p2).innerHTML += errorString;\n\t\n}", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function validateZipCode() {\n var e = document.getElementById(\"Zip\").value;\n if (isNumber(e) && e.length == 5) {\n return true;\n } else {\n return false;\n }\n}", "function validateZip (zipValue) {\n\t\tif (!zipValue.length =5) {\n\t\t\tconsole.log(\"zip is not 5\");\n\t\t\treturn false;\n\t\t}\n\t\tconsole.log(zipValue);\n\t\tconsole.log(zipValue.length);\n\t\t\n\t\tfor (i=0; i < 5; i++) {\n\t\t\t if (isDigit(zipValue.charCodeAt(i))) {\n\t\t\t \t \n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn false;\n\t\t\t }\n\t\t}\n\t\treturn true;\n\t\t// Raine: If the function makes it this far, it will return undefined! That's not good.\n\t\t// Since it's a boolean function, it should always return true or false. David: done\n\t}", "function isZipCode(post)\n{\nregex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n if (regex.test(post))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function toZip(){\n var zipCode = document.getElementById(\"zip\").value;\n console.log(zipCode);\n}", "testZip (zip) {\n var regexzip =/^\\d+$/;\n return regexzip.test(zip)\n }", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\t\r\n\tvar test2 = lkup_binary_m(\"lkup4\",\"zipCode\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zipCode\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"lkup4\",\"zipCode\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zipCode\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "isValidZip(zipCode){\n\t\tif(zipCode.length != 5 || (zipCode.match(/[a-z]/i))){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validateZip(theForm)\n{\n\tvar str = \"-\";\n zipStr = theForm.zipCode.value;\n if (zipStr.length != 5)\n {\n \tif (zipStr.length == 10 && zipStr.charAt(5) == \"-\") {\n \t\t\n \t} else {\n \talert(\"Invalid zip code syntax.\");\n \treturn false; // abort submission\n \t}\n }\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++)\n {\n aChar = zipStr.charAt(i);\n if (!isDigit(aChar) && i != 5) {\n \talert(\"char \" + aChar + \" is NOT a digit\");\n return false; // abort submission\n }\n }\n return true; // proceed with submission\n}", "function zipcodeIsValid (zipcode) {\n\t//if zipcode isn't 5 long, automatically wrong\n\tif (zipcode.length != 5) {\n\t\treturn false;\n\t} else {\n\t\t//loop through 5 chars, and make sure each are a number\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t//if the current character is a non-number\n\t\t\tif(zipcode.charCodeAt(i) < 48 || zipcode.charCodeAt(i) > 57) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//if there was not a single non-number and the length is 5, return true\n\t\treturn true;\n\t}\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"city_state_zip\",\"zip\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zip\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"city_state_zip\",\"zip\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zip\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function isValidZipcode(zipcode) {\n zipcode = removeSpaces(zipcode);\n if (!(zipcode.length == 5 || zipcode.length == 9 || zipcode.length == 10)) return false;\n if ((zipcode.length == 5 || zipcode.length == 9) && !isNumeric(zipcode)) return false;\n if (zipcode.length == 10 && zipcode.search && zipcode.search(/^\\d{5}-\\d{4}$/) == -1) return false;\n return true;\n}", "function getZipCodeName(intCountryCode) {\n\tif (intCountryCode == 840) // USA\n\t\treturn 'Zip';\n\telse// if (intCountryCode == 124) // Canada\n\t\treturn 'Postal';\n}", "function isZipCode(fieldVal) {\r\r\r\n var strValidChars = \"0123456789\";\r\r\r\n var blnResult = true;\r\r\r\n var fldLength = fieldVal.length;\r\r\r\n if(fldLength == 5) {\r\r\r\n for( i = 0; i < fldLength; i++) {\r strChar = fieldVal.charAt(i);\r\r\r\n if(strValidChars.indexOf(strChar) == -1) {\r blnResult = false;\r\r\r\n }\r\r\r\n }\r\r\r\n } else {\r blnResult = false;\r\r\r\n }\r\r\r\n if(blnResult == false) {\r\r\r\n return false;\r\r\r\n } else {\r\r\r\n return true;\r\r\r\n }\r\r\r\n}\r\r// This function is used to open a pop up window. User need to pass only two parameters", "function validUSZip(zip){\r\n\tvar m;\r\n\tm=zip.match( \"^([0-9]{5})-([0,9]{4})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{5})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{9})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\treturn false;\r\n}", "function updateZipcode(zip){\n zipCode.value = zip;\n }", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\t\r\n}", "function formatZipcodeForDb(zipcode) {\n let output = zipcode.trim().replace(/\\s/g, '')\n\n return `${output.slice(0, 3)} ${output.slice(3)}`\n}", "function getZipCodes(person){\n return person[19];\n }", "function validateZipCode(field) {\n if (field === undefined || field === null) {\n return false;\n }\n var zip_regexp = /^[0-9]+(?:[-\\s]*)?(?:[0-9]*)?$/;\n if (zip_regexp.test(field) !== true) {\n return false;\n }\n return validateMinLength(field, 5) && validateMaxLength(field, 10);\n}", "function get_url_zip() {\n var zip = \"\";\n var keyvals = window.location.href.slice(window.location.href.indexOf(\"?\") + 1).split(\"&\");\n $.each( keyvals , function(i, val) {\n var parts = val.split(\"=\");\n if (parts[0] == \"zip\") {\n zip = parts[1];\n }\n });\n return (cfpb_hud_hca.check_zip(zip));\n }", "function validZip(zip) {\n return zip.length === 5 && /^\\d{5}(-\\d{4})?$/.test(zip);\n}", "function validateZip () {\n var text = $('#zip').val();\n if (!text) return true;\n \n var isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(text);\n \n if (isValidZip) {\n $('#zip').removeClass(\"invalid\");\n return true;\n }\n \n $('#message').html(\"Invalid zip code\");\n $('#zip').addClass(\"invalid\");\n return false;\n}", "function isOkzipCode() {\n //we control de length and the digits were numbers matching their value\n // >9999 --> 5 digits or more && < 100000 less than 5 digits\n if (zipCode.value > 9999 && zipCode.value < 100000 ) {\n cleanErrorMessage(zipCode);\n return true;\n } else if (ccnum.value.includes(' ')) {\n cleanErrorMessage(zipCode);\n errorIndication(zipCode);\n return false;\n } else {\n errorIndication(zipCode);\n return false;\n }\n }", "function ValidateZipCode(zipCode) \n{\n if (/(^\\d{5}$)/.test(zipCode))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function zipcodeChecker(zipcode) {\n return zipcode > 20000;\n}", "validateZipCode(zipcode) {\n let re = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n return re.test(zipcode);\n }", "function validateZip(form) {\n var zipStr = form.zip.value;\n\n if (zipStr.length !== 5 && zipStr.length !== 10) {\n error('Lenght must be 5 or 10');\n return false // abort submission\n }\n\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++) {\n var aChar = zipStr.charAt(i);\n\n if (i === 5 && aChar !== '-') {\n error('It should contains a \"-\": ddddd-dddd');\n return false;\n }\n\n if (i !== 5 && !isDigit(aChar)) {\n error('char is not a digit: ' + aChar);\n return false\n }\n }\n\n return true // proceed with submission\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function zip_checker() {\n const zip_value = zip.value;\n if (zip_value.match(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/)) {\n errorMessageZip.innerText = \"\";\n register.removeAttribute(\"disabled\");\n } else {\n errorMessageZip.innerText = \"Invalid Zip Code.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function validateCCZip(e){\n\tif($(\"#zip\").val()==''){\n\t\t$(\"<p class='error cc-error'>Please enter the zip code.</p>\").insertBefore($creditcard); \n\t} else if($(\"#zip\").val().length!=5 || isNaN($(\"#zip\").val())){\n\t\t$(\"<p class='error cc-error'>Zip code must be 5 digits long.</p>\").insertBefore($creditcard);\n\t}\n}", "function getZIP(placemark) {\n return _getPlacemarkAttribute(placemark, 'PostalCodeName');\n }", "function checkZip() {\n\tvar zip = document.getElementById(\"zip\").value;\n\t\n\tif (zip == \"\"){\n\t} else {\n\t\tif (zip.length === 4) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid zip (four digits)\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function validateZip () {\n\n isValid(zipInput);\n isZipValid= true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{5}$/.test(zipInput.value)) {\n isInvalid(zipInput);\n isZipValid = false;\n }\n }\n}", "function chkZip(inZip){\n\tvar zipRegEx = /^\\d{5}$|^\\d{5}-\\d{4}$/;\n\tvar errorString = \"Please provide a valid zip code\";\n\t\n\tif(inZip.length == 0){\n\t\treturn true;\n\t}else{\n\t\tif(zipRegEx.test(inZip) !== true){\n\t\t\treturn errorString;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function newZip() {\n var newZipValue = document.getElementById('zipValue').value;\n getZip(newZipValue);\n return newZipValue;\n }", "function checkZipcode() {\n var pattern = new RegExp(/^[0-9]{5}$/i);\n \n if (pattern.test(zipcodeInput.val())) {\n $(\"#zipcode_error_message\").hide();\n zipcodeInput.removeClass('error');\n }\n else {\n $(\"#zipcode_error_message\").html(\"Enter valid zipcode\");\n $(\"#zipcode_error_message\").show();\n zipcodeInput.addClass('error');\n error_zipcode = true;\n }\n }", "function validateZip(field, value) {\n const hint = document.getElementById('zip-hint');\n if(!isValidZip(value)) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "function updateZip() {\n zipCode = \"zip=\" + zipcodeHomeInput.value + \",us&APPID=\" + appId;\n var url = baseUrl + zipCode + \"&units=imperial\";\n console.log(zipCode);\n sendRequest(url);\n}", "function checkzip(inputzip){\n if(!inputzip.value.match(/^([0-9]{5})$/)){\n document.getElementById(\"Zipcode\").innerHTML = \"Zipcode should be consisted of 5 numbers\"+\"<br>\";\n inputzip.value = \"\";\n return false;\n }\n else\n return true;\n}", "function validateZipCode(){\r\n\r\n\tvar zip = document.getElementById(\"zipcode\");\r\n\tvar pZip = document.getElementById(\"valZip\");\r\n\t\r\n\tif (zip.value == \"\")\r\n\t{\r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode is required\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if (zip.value.length < 5 || zip.value.length > 10)\r\n\t{\r\n\t\t \r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode must be 5-10 characters\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tif(zip.value.length == 5)\r\n\t\t{\r\n\t\t\tzip.value = zip.value.concat(\"-\");\r\n\t\t}\r\n\t\tpZip.innerHTML = \r\n\t\t\"Valid ZipCode\";\r\n\t\tpZip.classList.remove(\"invalid\");\r\n\t\tpZip.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "function searchZip() {\n event.preventDefault()\n userZip = document.getElementById('userZip').value;\n // Validate User Submission\n if (isNaN(userZip)) {\n console.log(\"Error: \" + userZip + \" is not a number. Please try again.\")\n return;\n }\n else if (userZip.length != 5) {\n console.log(\"Error: Please make sure you're using a 5 digit zip code\")\n return;\n };\n zipLookup(userZip);\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function getZipStringWithCell(cell) {\n var cellZipString = \"\";\n if(cell && (typeof cell.row == 'number') && (typeof cell.col == 'number') ) {\n var startCharCode = \"A\".charCodeAt(0);\n var lengthCharCode = \"Z\".charCodeAt(0) - \"A\".charCodeAt(0) + 1;\n if(!lengthCharCode){\n return \"\";\n }\n var divisor = cell.col;\n var remainder = 0;\n var first = true;\n do{\n remainder = Math.floor( divisor%lengthCharCode - (first?0:1) );\n divisor = Math.floor( divisor/lengthCharCode );\n cellZipString = String.fromCharCode(remainder+startCharCode) + cellZipString;\n first = false;\n }while(divisor);\n cellZipString = cellZipString + (cell.row+1);\n }\n return cellZipString;\n }", "function validateZIP(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{5}-?(\\d{4})?$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function chkzip() {\r\n\tvar mydata = document.getElementById(\"zipcode\");\r\n\tvar position = mydata.value.search(/\\d{5}/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El zipcode entrado esta en un formato incorrecto.\\nEl formato correcto es #####.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function SiteAddressZipCode_Change()\n{\n\ttry\n\t{\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"function SiteAddressZipCode_Change\" );\n\t\tvar z = myGetValue( \"new_zippostalcode\" );\n\t\tif( z != null && z.length > 0 )\n\t\t{\n\t\t\tif( DebugModeSiteZipCode ) \n\t\t\t\twindow.alert( \"function SiteAddressZipCode_Change\\nnew_zippostalcode\\t\" + z );\n\t\t\tWrapperExtractCityStateFromZip( z, \"new_city\", \"new_county\", \"new_stateprovince\", \"new_countryregion\", \"new_ocountryregion\" ); \n\t\t}\n\t}\t\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function SiteAddressZipCode_Change error code \" + err );\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"1 name \" + err.name + \"\\n2 message\\t\" + err.message + \"\\n3 number\\t\" + err.number + \"\\n4 prototype\\t\" + err.prototype + \"\\n5 toString\\t\" + err.toString() );\n\t}\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s])?\\d{4}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function isValidZipCode() {\r\n var x = document.getElementById(\"Code\");\r\n var regexs = /^\\d{6}$/; \r\n if (!x.value.match(regexs)) {\r\n document.getElementById('validZip').style.display = \"block\";\r\n document.getElementById('validZipSpace').style.display = \"block\";\r\n isCode = false;\r\n }\r\n else {\r\n document.getElementById('validZip').style.display = \"none\";\r\n document.getElementById('validZipSpace').style.display = \"none\";\r\n isCode = true;\r\n }\r\n}", "function zipCheck() {\n var zipLog = document.querySelector(\".zip\");\n var zip = response.zip;\n console.log(zip);\n\n zipLog.innerHTML += zip;\n }", "function validateZipCode() {\r\n var code = document.getElementById(\"zip\");\r\n var regex = /^(?:6[0-9]{5})$/;\r\n if (!code.value.match(regex)) {\r\n code.style.borderColor = \"red\";\r\n document.getElementById(\"ValidZip\").style.display = \"block\";\r\n keycode = false;\r\n }\r\n else {\r\n keycode = true;\r\n code.style.borderColor = \"darkturquoise\";\r\n document.getElementById(\"ValidZip\").style.display = \"none\";\r\n }\r\n}", "function isValidPostal(card) {\n zip.nextElementSibling.innerText = \"Must be a 5 digits\";\n return /^\\d{5}$/.test(card);\n}", "function onZipNUMChange(e) {\n e.target.classList.remove(\"not-valid\");\n e.target.classList.add(\"valid\");\n if (e.target.value.length === 5) {\n if (document.querySelector(\"#zip-error\")) {\n document.querySelector(\"#zip-error\").remove();\n }\n }\n}", "function zipCodeValidation(postalCode) {\r\n var pattern = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\r\n if (!pattern.test(postalCode)) {\r\n displayError(`The postal code must be in the following format: C1A 1A7`);\r\n } else return pattern.test(postalCode);\r\n}", "function GetDistanceZip(Selleremail,useremail)//developed and implemented by Zeev Feldbeine, Copy Rights\n{ \n if(typeof Selleremail == 'undefined' ||typeof useremail == 'undefined' || Selleremail == null || useremail == null) return Number.MAX_VALUE;\n var profileUser1= ProfileCollection.findOne({ email: useremail});\n var profileUser2= ProfileCollection.findOne({ email: Selleremail}); \n if(typeof profileUser1 == 'undefined' ||typeof profileUser2 == 'undefined' ) return Number.MAX_VALUE;\n var zipcodes = Meteor.npmRequire('zipcodes'); \n var zip1 = Math.abs(profileUser1.zip);\n if(typeof zipcodes.lookup(zip1) == 'undefined') return Number.MAX_VALUE;\n var zip2 = Math.abs(profileUser2.zip);\n if(typeof zipcodes.lookup(zip2) == 'undefined') return Number.MAX_VALUE;\n return zipcodes.distance(zip1, zip2); //In Miles\n}", "function matchZipCodes(textToSearch) {\n // find sequence of 5 digits\n // empty slice makes a shallow copy\n var regResults = textToSearch.match(/\\d{5,5}/g);\n console.log(regResults);\n return regResults ? regResults.slice() : [];\n }", "formatCode(code) {\n return code\n .replace(/^([0-9]{3})([0-9]{3})$/, '$1 $2') // 6 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{2})$/, '$1 $2 $3') // 7 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{3})$/, '$1 $2 $3') // 8 digits\n }", "function validateZip( zip )\n{ \n callWebService ( \"/validateZip/\" + zip, showCityState );\n} // end function validateZip", "function getZip(lat, lon, callback) {\n var url = prepare_api_url(lat,lon);\n $.get(url, function (data) {\n\n var results = data.results[0];\n var addrs = results.address_components;\n console.log(addrs.length);\n\n var i = 0;\n var found = false;\n while(i < addrs.length && !found){\n found = (addrs[i].types[0] === \"postal_code\")? true : false;\n i++;\n }\n i--;\n\n var zip = addrs[i].long_name;\n callback(zip);\n\n\n\n });\n}", "function getPostCodeFromResponse(components) {\n var code = 0000;\n for (var i = 0; i < components.length; i++) {\n if (components[i].types[0] = 'postal_code') {\n code = components[i].long_name;\n if (!isNaN(code) && code.length == 4 && code.startsWith('3')) {\n break;\n }\n }\n }\n return code;\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "validatePostalCode(postalCode) {\n if(postalCode==='') {\n return 'Postal code required';\n } else if (!/^\\d+$/.test(postalCode)) {\n return 'Postal code invalid'\n } else if (postalCode.length > 10 || postalCode.length < 2) {\n return 'Postal code invalid (must be between 2-10 digits)'\n }\n \n return '';\n }", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "function isItalianZipCode(value) {\n if (notEmpty(value)) {\n if (typeof value !== 'string')\n value = value.toString();\n return regexpr_1.cap.test(value);\n }\n return false;\n}", "function allnumeric()\n{ \n\tvar uzip = document.registration.zip;\n\tvar numbers = /^[0-9]+$/;\n\tif(uzip.value.match(numbers))\n\t{\n\t\t// Focus goes to next field i.e. email.\n\t\tdocument.registration.email.focus();\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert('ZIP code must have numeric characters only');\n\t\tuzip.focus();\n\t\treturn false;\n\t}\n}", "function validateZip(req, res, next) {\n let zip = req.params.zip;\n const aZip = Number(zip);\n if (zip.length != 5 || isNaN(aZip)) res.send(`Zip (${zip}) is invalid!`);\n if (!getZoos(zip)) {\n res.send(`${zip} does not exist in our records.`);\n } else if (getZoos(zip).length < 1) {\n res.send(`${zip} has no zoos.`);\n } else {\n next();\n }\n}", "function f_zipcode(){\n var zipcode = document.getElementById(\"zipcode\").value;\n if(zipcode.length !== 5) {\n alert(\"El codigo postal tiene que tener 5 caracteres.\");\n return false;\n } else {\n return true;\n }\n}", "getState(zipcode) {\n let state;\n if (zipcode >= 35000 && zipcode <= 36999) {\n state = 'Alabama';\n } else if (zipcode >= 99500 && zipcode <= 99999) {\n state = 'Alaska';\n } else if (zipcode >= 85000 && zipcode <= 86999) {\n state = 'Arizona';\n } else if (zipcode >= 71600 && zipcode <= 72999) {\n state = 'Arkansas';\n } else if (zipcode >= 90000 && zipcode <= 96699) {\n state = 'California';\n } else if (zipcode >= 80000 && zipcode <= 81999) {\n state = 'Colorado';\n } else if (\n (zipcode >= 6000 && zipcode <= 6389) ||\n (zipcode >= 6391 && zipcode <= 6999)\n ) {\n state = 'Connecticut';\n } else if (zipcode >= 19700 && zipcode <= 19999) {\n state = 'Delaware';\n } else if (zipcode >= 32000 && zipcode <= 34999) {\n state = 'Florida';\n } else if (\n (zipcode >= 30000 && zipcode <= 31999) ||\n (zipcode >= 39800 && zipcode <= 39999)\n ) {\n state = 'Georgia';\n } else if (zipcode >= 96700 && zipcode <= 96999) {\n state = 'Hawaii';\n } else if (zipcode >= 83200 && zipcode <= 83999) {\n state = 'Idaho';\n } else if (zipcode >= 60000 && zipcode <= 62999) {\n state = 'Illinois';\n } else if (zipcode >= 46000 && zipcode <= 47999) {\n state = 'Indiana';\n } else if (zipcode >= 50000 && zipcode <= 52999) {\n state = 'Iowa';\n } else if (zipcode >= 66000 && zipcode <= 67999) {\n state = 'Kansas';\n } else if (zipcode >= 40000 && zipcode <= 42999) {\n state = 'Kentucky';\n } else if (zipcode >= 70000 && zipcode <= 71599) {\n state = 'Louisiana';\n } else if (zipcode >= 3900 && zipcode <= 4999) {\n state = 'Maine';\n } else if (zipcode >= 20600 && zipcode <= 21999) {\n state = 'Maryland';\n } else if ((zipcode >= 1000 && zipcode <= 2799) || zipcode === 5501) {\n state = 'Massachusetts';\n } else if (zipcode >= 48000 && zipcode <= 49999) {\n state = 'Michigan';\n } else if (zipcode >= 55000 && zipcode <= 56899) {\n state = 'Minnesota';\n } else if (zipcode >= 38600 && zipcode <= 39999) {\n state = 'Mississippi';\n } else if (zipcode >= 63000 && zipcode <= 65999) {\n state = 'Missouri';\n } else if (zipcode >= 59000 && zipcode <= 59999) {\n state = 'Montana';\n } else if (zipcode >= 27000 && zipcode <= 28999) {\n state = 'North Carolina';\n } else if (zipcode >= 58000 && zipcode <= 58999) {\n state = 'North Dakota';\n } else if (zipcode >= 68000 && zipcode <= 69999) {\n state = 'Nebraska';\n } else if (zipcode >= 88900 && zipcode <= 89999) {\n state = 'Nevada';\n } else if (zipcode >= 3000 && zipcode <= 3899) {\n state = 'New Hampshire';\n } else if (zipcode >= 7000 && zipcode <= 8999) {\n state = 'New Jersey';\n } else if (zipcode >= 87000 && zipcode <= 88499) {\n state = 'New Mexico';\n } else if ((zipcode >= 10000 && zipcode <= 14999) || zipcode === 6390) {\n state = 'New York';\n } else if (zipcode >= 43000 && zipcode <= 45999) {\n state = 'Ohio';\n } else if (\n (zipcode >= 73000 && zipcode <= 73199) ||\n (zipcode >= 73400 && zipcode <= 74999)\n ) {\n state = 'Oklahoma';\n } else if (zipcode >= 97000 && zipcode <= 97999) {\n state = 'Oregon';\n } else if (zipcode >= 15000 && zipcode <= 19699) {\n state = 'Pennsylvania';\n } else if (zipcode >= 300 && zipcode <= 999) {\n state = 'Puerto Rico';\n } else if (zipcode >= 2800 && zipcode <= 2999) {\n state = 'Rhode Island';\n } else if (zipcode >= 29000 && zipcode <= 29999) {\n state = 'South Carolina';\n } else if (zipcode >= 57000 && zipcode <= 57999) {\n state = 'South Dakota';\n } else if (zipcode >= 37000 && zipcode <= 38599) {\n state = 'Tennessee';\n } else if (\n (zipcode >= 75000 && zipcode <= 79999) ||\n (zipcode >= 73301 && zipcode <= 73399) ||\n (zipcode >= 88500 && zipcode <= 88599)\n ) {\n state = 'Texas';\n } else if (zipcode >= 84000 && zipcode <= 84999) {\n state = 'Utah';\n } else if (zipcode >= 5000 && zipcode <= 5999) {\n state = 'Vermont';\n } else if (\n (zipcode >= 20100 && zipcode <= 20199) ||\n (zipcode >= 22000 && zipcode <= 24699) ||\n zipcode === 20598\n ) {\n state = 'Virgina';\n } else if (\n (zipcode >= 20000 && zipcode <= 20099) ||\n (zipcode >= 20200 && zipcode <= 20599) ||\n (zipcode >= 56900 && zipcode <= 56999)\n ) {\n state = 'Washington DC';\n } else if (zipcode >= 98000 && zipcode <= 99499) {\n state = 'Washington';\n } else if (zipcode >= 24700 && zipcode <= 26999) {\n state = 'West Virginia';\n } else if (zipcode >= 53000 && zipcode <= 54999) {\n state = 'Wisconsin';\n } else if (zipcode >= 82000 && zipcode <= 83199) {\n state = 'Wyoming';\n } else {\n state = 'none';\n console.log('No state found matching', zipcode);\n }\n return state;\n }", "function setZipCode(zipCode) {\n if (zipCode != null) {\n var coords = getCoordsFromZip(zipCode);\n createLocationData(coords.lat, coords.lon, zipCode, coords.cityName);\n } else {\n createLocationData(null, null, null, null);\n }\n}" ]
[ "0.7333651", "0.72927225", "0.69804054", "0.69804054", "0.69656044", "0.68580306", "0.67568046", "0.67477405", "0.6739098", "0.6683621", "0.6617746", "0.66111475", "0.6603347", "0.6567997", "0.6463976", "0.6454968", "0.64455575", "0.64455575", "0.6397825", "0.6384164", "0.6353186", "0.63444906", "0.63293433", "0.632168", "0.6318048", "0.63023597", "0.6295758", "0.6295455", "0.62859726", "0.6257151", "0.6242965", "0.6215685", "0.6214821", "0.6214255", "0.62117696", "0.6207515", "0.6200112", "0.61980295", "0.6190574", "0.6184692", "0.61824244", "0.61758125", "0.617435", "0.6165196", "0.61546755", "0.61417955", "0.6138111", "0.6123761", "0.6094837", "0.6088016", "0.6082094", "0.6081772", "0.6080157", "0.60797507", "0.6057551", "0.6057551", "0.60254693", "0.6001556", "0.5942335", "0.59420264", "0.59397614", "0.5936745", "0.5918334", "0.59137875", "0.58951", "0.58946764", "0.589085", "0.5879026", "0.58068573", "0.5776524", "0.5766373", "0.5760828", "0.5753235", "0.572368", "0.5713082", "0.5697219", "0.56938994", "0.5689403", "0.5688871", "0.5687496", "0.5682402", "0.5673424", "0.5665351", "0.5628168", "0.55662566", "0.5553836", "0.5549989", "0.55440754", "0.55239236", "0.55239236", "0.5506275", "0.54833174", "0.54833174", "0.54833174", "0.54679316", "0.545411", "0.54531115", "0.5431563", "0.5427518", "0.53729373" ]
0.6534419
14
4 digit mailing zip code extension
function mailing_zip4 (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (presence_check(input)){ if (!check_allowed_char(input, "numeric", "conf1")){ error = "E34_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "zipCode4", "conf1")){ error = "E34_4" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; } else{ return true } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkFormat(zipcode){\n const regex = /(\\d{5})(\\d{4})/;\n if (zipcode.length === 5){\n return true;\n }else if(zipcode.length === 9){\n ZIP = zipcode.replace(/(\\d{5})(\\d{4})/, \"$1-$2\");\n return true;\n }else \n return false;\n}", "function pinCode(pc){\n\tvar zip_regex = /^[0-9]+$/;\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function reformatZIPCode (ZIPString)\r\n{ if (ZIPString.length == 5) return ZIPString;\r\n else return (reformat (ZIPString, \"\", 5, \"-\", 4));\r\n}", "function zip(string = '') {\n\treturn string.replace(/(\\w)(\\1{4,})/g, ($0, $1, $2, $$, $_) => $1 + `{${$2.length.toString(36)}}`);\n}", "function validate_us_zip(value) {\n var zip = clean_nonnumbers(value);\n return validate(zip.length,eq,5);\n }", "function validate_zip_code(type){\r\n var strValidChars = '0123456789';\r\n var zipcode_val = $('#'+type+'_zip_code_new').val();\r\n var flag = 1;\r\n \r\n //zipcode should be only 5 digit long\r\n if(zipcode_val.length < 5 || zipcode_val.length > 5){\r\n flag=0;\r\n }\r\n //if not numeric\r\n for(var i=0;i<zipcode_val.length;i++){\r\n strChar = zipcode_val.charAt(i);\r\n if (strValidChars.indexOf(strChar) == -1){\r\n flag=0;\r\n }\r\n }\r\n \r\n return flag;\r\n \r\n}", "function mailing_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E34_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E34_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function zipvalidate(postcode){\n return /^[12346]\\d{5}$/.test(postcode);\n}", "function GHValidateZipCode(source)\n{\n\tif (!ValidateRegular(source, \"\\\\d{5}(-\\\\d{4})?\"))\n\t{\n\t\tsource.select();\n\t\tsource.focus();\n\t\treturn false;\n\t}\n\treturn true;\n}", "function zipCode(str) {\n var re = /^[0-9]{5}(?:-[0-9]{4})?$/; //-- Solution for bonus test\n //var re = /^\\d{5}$/;\n return re.test(str);\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\r\n\t\r\n}", "function shipping_zip4 (input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (presence_check(input)){\r\n\t\tif (!check_allowed_char(input, \"numeric\", \"conf1\")){\t\r\n\t\t\terror = \"E26_1\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif(!length_field_check(input, \"zipCode4\", \"conf1\")){\r\n\t\t\terror = \"E26_4\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\tif (result.flgname.length>0){\r\n\t\t\tresult.pass = false;\r\n\t\t}\r\n\t\treturn result;\r\n\t}\r\n\telse{\r\n\t\treturn true\r\n\t}\t\r\n}", "function isZipCodeValid (zip) {\r\n return /^\\d{5}$/.test(zip)\r\n}", "function validateZipCode(){\n\tvar nameFormat = /^\\d{5}$/; // Regex to indicate 5 numerical digits.\n\tvar errorFormat = /Invalid Zip Code<br>/;\n\tvar zipCode = document[formName][\"zipCode\"].value;\n\t\n\tvar errorString=\"\";\n\tif(!nameFormat.test(zipCode)) {\n\t\tif(!errorFormat.test(document.getElementById(p2).innerHTML))\n\t\t\terrorString += \"Invalid Zip Code<br>\";\n\t}\n\telse if(errorFormat.test(document.getElementById(p2).innerHTML)) {\n\t\tvar temp = document.getElementById(p2).innerHTML.split(errorFormat);\n\t\tvar t = \"\";\n\t\tfor (var i = 0 ; i < temp.length; i++) {\n\t\t\tt += temp[i];\n\t\t}\n\t document.getElementById(p2).innerHTML = t;\n\t}\n\tdocument.getElementById(p2).innerHTML += errorString;\n\t\n}", "isValidZip(zipCode){\n\t\tif(zipCode.length != 5 || (zipCode.match(/[a-z]/i))){\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function validateZip(theForm)\n{\n\tvar str = \"-\";\n zipStr = theForm.zipCode.value;\n if (zipStr.length != 5)\n {\n \tif (zipStr.length == 10 && zipStr.charAt(5) == \"-\") {\n \t\t\n \t} else {\n \talert(\"Invalid zip code syntax.\");\n \treturn false; // abort submission\n \t}\n }\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++)\n {\n aChar = zipStr.charAt(i);\n if (!isDigit(aChar) && i != 5) {\n \talert(\"char \" + aChar + \" is NOT a digit\");\n return false; // abort submission\n }\n }\n return true; // proceed with submission\n}", "function checkZip(zip) {\n return /^\\d{5}$/.test(zip);\n}", "function getZipValue(){\n\tvar cookieValue = getRememberMe();\n\tif (cookieValue != \"\") {\n\t\tvar cookiePairs = cookieValue.split(\"~\");\n\t\tvar cookiePair = \"\";\n\t\tvar cookiePairContent = \"\";\n\t\tfor(i=0;i<cookiePairs.length;i++){\t\n\t\t\tcookiePair = cookiePairs[i];\n\t\t\tif (cookiePair != \"\") {\n\t\t\t\tcookiePairContent = cookiePair.split(\":\");\n\t\t\t\tif(cookiePairContent.length > 1){\n\t\t\t\t\tif(cookiePairContent[0]==\"zipCode\"){\n\t\t\t\t\t\treturn cookiePairContent[1];\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\treturn \"\";\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t}\n\treturn \"\";\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function isZIPCode (s)\r\n{ if (isEmpty(s))\r\n if (isZIPCode.arguments.length == 1) return defaultEmptyOK;\r\n else return (isZIPCode.arguments[1] == true);\r\n return (isInteger(s) &&\r\n ((s.length == digitsInZIPCode1) ||\r\n (s.length == digitsInZIPCode2)))\r\n}", "function get_url_zip() {\n var zip = \"\";\n var keyvals = window.location.href.slice(window.location.href.indexOf(\"?\") + 1).split(\"&\");\n $.each( keyvals , function(i, val) {\n var parts = val.split(\"=\");\n if (parts[0] == \"zip\") {\n zip = parts[1];\n }\n });\n return (cfpb_hud_hca.check_zip(zip));\n }", "testZip (zip) {\n var regexzip =/^\\d+$/;\n return regexzip.test(zip)\n }", "function checkZip() {\n\tvar zip = document.getElementById(\"zip\").value;\n\t\n\tif (zip == \"\"){\n\t} else {\n\t\tif (zip.length === 4) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\talert(\"Not at valid zip (four digits)\");\n\t\t\treturn false;\n\t\t}\n\t}\n}", "function zipvalidateBest(postcode){\n return /^[12346]\\d{5}$/.test(postcode)\n}", "function sanitizeZip(zip, city, state, country) {\n if(zip === '' && country === \"United States\") return zipcodes.lookupByName(city, state)[0].zip;\n if(zip === '' && country === \"Canada\") return '';\n if(zip !== '' && country === 'United States') return zip.substring(0,5);\n if(zip !== '' && country === \"Canada\") return zip.slice(0,3);\n}", "function isValidZipcode(zipcode) {\n zipcode = removeSpaces(zipcode);\n if (!(zipcode.length == 5 || zipcode.length == 9 || zipcode.length == 10)) return false;\n if ((zipcode.length == 5 || zipcode.length == 9) && !isNumeric(zipcode)) return false;\n if (zipcode.length == 10 && zipcode.search && zipcode.search(/^\\d{5}-\\d{4}$/) == -1) return false;\n return true;\n}", "function isValidZipCode(str) {\n return /^\\d{5}$/g.test(str);\n}", "function isZipCode(post)\n{\nregex = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\n if (regex.test(post))\n {\n return true;\n }\n else\n {\n return false;\n }\n}", "function isZipCode(fieldVal) {\r\r\r\n var strValidChars = \"0123456789\";\r\r\r\n var blnResult = true;\r\r\r\n var fldLength = fieldVal.length;\r\r\r\n if(fldLength == 5) {\r\r\r\n for( i = 0; i < fldLength; i++) {\r strChar = fieldVal.charAt(i);\r\r\r\n if(strValidChars.indexOf(strChar) == -1) {\r blnResult = false;\r\r\r\n }\r\r\r\n }\r\r\r\n } else {\r blnResult = false;\r\r\r\n }\r\r\r\n if(blnResult == false) {\r\r\r\n return false;\r\r\r\n } else {\r\r\r\n return true;\r\r\r\n }\r\r\r\n}\r\r// This function is used to open a pop up window. User need to pass only two parameters", "function zip_checker() {\n const zip_value = zip.value;\n if (zip_value.match(/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/)) {\n errorMessageZip.innerText = \"\";\n register.removeAttribute(\"disabled\");\n } else {\n errorMessageZip.innerText = \"Invalid Zip Code.\";\n register.setAttribute(\"disabled\", \"disabled\");\n }\n}", "function validZip(zip) {\n return zip.length === 5 && /^\\d{5}(-\\d{4})?$/.test(zip);\n}", "function validateZipCode(field) {\n if (field === undefined || field === null) {\n return false;\n }\n var zip_regexp = /^[0-9]+(?:[-\\s]*)?(?:[0-9]*)?$/;\n if (zip_regexp.test(field) !== true) {\n return false;\n }\n return validateMinLength(field, 5) && validateMaxLength(field, 10);\n}", "function testZip(zip) {\n var zipRegExp = new RegExp('^\\\\d{5}$');\n if (!zipRegExp.test(zip)) {\n throw new Error();\n }\n}", "function validUSZip(zip){\r\n\tvar m;\r\n\tm=zip.match( \"^([0-9]{5})-([0,9]{4})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{5})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\tm=zip.match( \"^([0-9]{9})$\" );\r\n\tif (m!=null) return true;\r\n\r\n\treturn false;\r\n}", "function validateZip () {\n var text = $('#zip').val();\n if (!text) return true;\n \n var isValidZip = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/.test(text);\n \n if (isValidZip) {\n $('#zip').removeClass(\"invalid\");\n return true;\n }\n \n $('#message').html(\"Invalid zip code\");\n $('#zip').addClass(\"invalid\");\n return false;\n}", "function isValidZip() {\n return /^[0-9]{5}$/.test(zip.value);\n}", "function validateZip(form) {\n var zipStr = form.zip.value;\n\n if (zipStr.length !== 5 && zipStr.length !== 10) {\n error('Lenght must be 5 or 10');\n return false // abort submission\n }\n\n // length is good ... now check for all digits\n // go thru each of the chars in the zipcode string\n for (var i = 0; i < zipStr.length; i++) {\n var aChar = zipStr.charAt(i);\n\n if (i === 5 && aChar !== '-') {\n error('It should contains a \"-\": ddddd-dddd');\n return false;\n }\n\n if (i !== 5 && !isDigit(aChar)) {\n error('char is not a digit: ' + aChar);\n return false\n }\n }\n\n return true // proceed with submission\n}", "function isValidZipcode(zipcode) {\r\n return /(^\\d{5}$)/.test(zipcode) && isBaltimoreZipcode(zipcode); \r\n}", "function validateZipCode() {\n var e = document.getElementById(\"Zip\").value;\n if (isNumber(e) && e.length == 5) {\n return true;\n } else {\n return false;\n }\n}", "function getZipCodeName(intCountryCode) {\n\tif (intCountryCode == 840) // USA\n\t\treturn 'Zip';\n\telse// if (intCountryCode == 124) // Canada\n\t\treturn 'Postal';\n}", "function formatZipcodeForDb(zipcode) {\n let output = zipcode.trim().replace(/\\s/g, '')\n\n return `${output.slice(0, 3)} ${output.slice(3)}`\n}", "function isOkzipCode() {\n //we control de length and the digits were numbers matching their value\n // >9999 --> 5 digits or more && < 100000 less than 5 digits\n if (zipCode.value > 9999 && zipCode.value < 100000 ) {\n cleanErrorMessage(zipCode);\n return true;\n } else if (ccnum.value.includes(' ')) {\n cleanErrorMessage(zipCode);\n errorIndication(zipCode);\n return false;\n } else {\n errorIndication(zipCode);\n return false;\n }\n }", "function validateZip(field, value) {\n const hint = document.getElementById('zip-hint');\n if(!isValidZip(value)) {\n showError(field, hint);\n } else {\n hideError(field, hint);\n }\n}", "function ValidateZipCode(zipCode) \n{\n if (/(^\\d{5}$)/.test(zipCode))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validateZip (zipValue) {\n\t\tif (!zipValue.length =5) {\n\t\t\tconsole.log(\"zip is not 5\");\n\t\t\treturn false;\n\t\t}\n\t\tconsole.log(zipValue);\n\t\tconsole.log(zipValue.length);\n\t\t\n\t\tfor (i=0; i < 5; i++) {\n\t\t\t if (isDigit(zipValue.charCodeAt(i))) {\n\t\t\t \t \n\t\t\t }\n\t\t\t else {\n\t\t\t \treturn false;\n\t\t\t }\n\t\t}\n\t\treturn true;\n\t\t// Raine: If the function makes it this far, it will return undefined! That's not good.\n\t\t// Since it's a boolean function, it should always return true or false. David: done\n\t}", "function validAddressZip(value) {\n return /^[A-Z-a-z-0-9\\s]{5,80}$/.test(value)\n }", "function validateCCZip(e){\n\tif($(\"#zip\").val()==''){\n\t\t$(\"<p class='error cc-error'>Please enter the zip code.</p>\").insertBefore($creditcard); \n\t} else if($(\"#zip\").val().length!=5 || isNaN($(\"#zip\").val())){\n\t\t$(\"<p class='error cc-error'>Zip code must be 5 digits long.</p>\").insertBefore($creditcard);\n\t}\n}", "function mailing_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"lkup4\",\"zipCode\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zipCode\" : input3\r\n\t};\r\n\t\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E34_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E34_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E34_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\t\r\n\tif((lkup_binary_m(\"lkup4\",\"zipCode\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zipCode\")){\r\n\t\t\terror = \"E32_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function validateZipCode(){\r\n\r\n\tvar zip = document.getElementById(\"zipcode\");\r\n\tvar pZip = document.getElementById(\"valZip\");\r\n\t\r\n\tif (zip.value == \"\")\r\n\t{\r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode is required\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse if (zip.value.length < 5 || zip.value.length > 10)\r\n\t{\r\n\t\t \r\n\t\tpZip.innerHTML = \r\n\t\t\"Zipcode must be 5-10 characters\";\r\n\t\tpZip.classList.remove(\"valid\");\r\n\t\tpZip.classList.add(\"invalid\");\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\telse \r\n\t{\r\n\t\tif(zip.value.length == 5)\r\n\t\t{\r\n\t\t\tzip.value = zip.value.concat(\"-\");\r\n\t\t}\r\n\t\tpZip.innerHTML = \r\n\t\t\"Valid ZipCode\";\r\n\t\tpZip.classList.remove(\"invalid\");\r\n\t\tpZip.classList.add(\"valid\");\r\n\t\treturn true;\r\n\t}\r\n\t\r\n\t\r\n}", "function zipcodeIsValid (zipcode) {\n\t//if zipcode isn't 5 long, automatically wrong\n\tif (zipcode.length != 5) {\n\t\treturn false;\n\t} else {\n\t\t//loop through 5 chars, and make sure each are a number\n\t\tfor (var i = 0; i < 5; i++) {\n\t\t\t//if the current character is a non-number\n\t\t\tif(zipcode.charCodeAt(i) < 48 || zipcode.charCodeAt(i) > 57) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\t//if there was not a single non-number and the length is 5, return true\n\t\treturn true;\n\t}\n}", "function getZipCodes(person){\n return person[19];\n }", "validateZipCode(zipcode) {\n let re = /(^\\d{5}$)|(^\\d{5}-\\d{4}$)/;\n return re.test(zipcode);\n }", "function zipCheck() {\n var zipLog = document.querySelector(\".zip\");\n var zip = response.zip;\n console.log(zip);\n\n zipLog.innerHTML += zip;\n }", "function chkZip(inZip){\n\tvar zipRegEx = /^\\d{5}$|^\\d{5}-\\d{4}$/;\n\tvar errorString = \"Please provide a valid zip code\";\n\t\n\tif(inZip.length == 0){\n\t\treturn true;\n\t}else{\n\t\tif(zipRegEx.test(inZip) !== true){\n\t\t\treturn errorString;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}\n}", "function zipcodeChecker(zipcode) {\n return zipcode > 20000;\n}", "function updateZipcode(zip){\n zipCode.value = zip;\n }", "function IsValidUSzipcode(zip) {\n var pattern = new RegExp(/(^\\d{5}$)|(^\\d{5}\\-?\\d{4}$)/);\n return pattern.test(zip);\n}", "function validateZip () {\n\n isValid(zipInput);\n isZipValid= true;\n\n if (paymentSelect.value === 'credit card') {\n if (!/^\\d{5}$/.test(zipInput.value)) {\n isInvalid(zipInput);\n isZipValid = false;\n }\n }\n}", "function toZip(){\n var zipCode = document.getElementById(\"zip\").value;\n console.log(zipCode);\n}", "function validateZIP(id) {\n let inputID = $(id)\n let inputTest = $(id).val()\n let isValid = /^\\d{5}-?(\\d{4})?$/.test(inputTest);\n if (!isValid) {\n inputID.parent().removeClass(\"has-success\").addClass(\"has-error\");\n return false;\n } else {\n inputID.parent().addClass(\"has-success\").removeClass(\"has-error\");\n }\n return true;\n}", "function parseZip64ExtendedInformation(data) {\n var size, compressedSize, offset, diskNumStart;\n\n if(data.length >= Constants.EF_ZIP64_SCOMP) {\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\n if(_entryHeader.size === Constants.EF_ZIP64_OR_32) {\n _entryHeader.size = size;\n }\n }\n if(data.length >= Constants.EF_ZIP64_RHO) {\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\n if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\n _entryHeader.compressedSize = compressedSize;\n }\n }\n if(data.length >= Constants.EF_ZIP64_DSN) {\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\n if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) {\n _entryHeader.offset = offset;\n }\n }\n if(data.length >= Constants.EF_ZIP64_DSN+4) {\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\n if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\n _entryHeader.diskNumStart = diskNumStart;\n }\n }\n }", "function isValidZipCode() {\r\n var x = document.getElementById(\"Code\");\r\n var regexs = /^\\d{6}$/; \r\n if (!x.value.match(regexs)) {\r\n document.getElementById('validZip').style.display = \"block\";\r\n document.getElementById('validZipSpace').style.display = \"block\";\r\n isCode = false;\r\n }\r\n else {\r\n document.getElementById('validZip').style.display = \"none\";\r\n document.getElementById('validZipSpace').style.display = \"none\";\r\n isCode = true;\r\n }\r\n}", "function zipCodeValidation(postalCode) {\r\n var pattern = /^[A-Za-z]\\d[A-Za-z][ -]?\\d[A-Za-z]\\d$/;\r\n if (!pattern.test(postalCode)) {\r\n displayError(`The postal code must be in the following format: C1A 1A7`);\r\n } else return pattern.test(postalCode);\r\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s])?\\d{4}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function checkZIPCode (theField, emptyOK)\r\n{ if (checkZIPCode.arguments.length == 1) emptyOK = defaultEmptyOK;\r\n if ((emptyOK == true) && (isEmpty(theField.value))) return true;\r\n else\r\n { var normalizedZIP = stripCharsInBag(theField.value, ZIPCodeDelimiters)\r\n if (!isZIPCode(normalizedZIP, false))\r\n return warnInvalid (theField, iZIPCode);\r\n else\r\n { // if you don't want to insert a hyphen, comment next line out\r\n theField.value = reformatZIPCode(normalizedZIP)\r\n return true;\r\n }\r\n }\r\n}", "function parseZip64ExtendedInformation(data) {\r\n var size, compressedSize, offset, diskNumStart;\r\n\r\n if(data.length >= Constants.EF_ZIP64_SCOMP) {\r\n size = readUInt64LE(data, Constants.EF_ZIP64_SUNCOMP);\r\n if(_entryHeader.size === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.size = size;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_RHO) {\r\n compressedSize = readUInt64LE(data, Constants.EF_ZIP64_SCOMP);\r\n if(_entryHeader.compressedSize === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.compressedSize = compressedSize;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_DSN) {\r\n offset = readUInt64LE(data, Constants.EF_ZIP64_RHO);\r\n if(_entryHeader.offset === Constants.EF_ZIP64_OR_32) {\r\n _entryHeader.offset = offset;\r\n }\r\n }\r\n if(data.length >= Constants.EF_ZIP64_DSN+4) {\r\n diskNumStart = data.readUInt32LE(Constants.EF_ZIP64_DSN);\r\n if(_entryHeader.diskNumStart === Constants.EF_ZIP64_OR_16) {\r\n _entryHeader.diskNumStart = diskNumStart;\r\n }\r\n }\r\n }", "function allnumeric()\n{ \n\tvar uzip = document.registration.zip;\n\tvar numbers = /^[0-9]+$/;\n\tif(uzip.value.match(numbers))\n\t{\n\t\t// Focus goes to next field i.e. email.\n\t\tdocument.registration.email.focus();\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\talert('ZIP code must have numeric characters only');\n\t\tuzip.focus();\n\t\treturn false;\n\t}\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}(?:[-\\s]\\d{4})?$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function checkZipcode() {\n var pattern = new RegExp(/^[0-9]{5}$/i);\n \n if (pattern.test(zipcodeInput.val())) {\n $(\"#zipcode_error_message\").hide();\n zipcodeInput.removeClass('error');\n }\n else {\n $(\"#zipcode_error_message\").html(\"Enter valid zipcode\");\n $(\"#zipcode_error_message\").show();\n zipcodeInput.addClass('error');\n error_zipcode = true;\n }\n }", "function isZip(filename) {\n\n\t// last 4 characters in filename\n\tlet ss = filename.slice(filename.length-4, filename.length);\n\n\treturn ss === '.zip';\n}", "function NzExtendedMark() { }", "function newZip() {\n var newZipValue = document.getElementById('zipValue').value;\n getZip(newZipValue);\n return newZipValue;\n }", "function onZipNUMChange(e) {\n e.target.classList.remove(\"not-valid\");\n e.target.classList.add(\"valid\");\n if (e.target.value.length === 5) {\n if (document.querySelector(\"#zip-error\")) {\n document.querySelector(\"#zip-error\").remove();\n }\n }\n}", "function chkzip() {\r\n\tvar mydata = document.getElementById(\"zipcode\");\r\n\tvar position = mydata.value.search(/\\d{5}/);\r\n\t\r\n\tif(position != 0) {\r\n\t\talert(\"El zipcode entrado esta en un formato incorrecto.\\nEl formato correcto es #####.\");\r\n\t\tmydata.select();\r\n\t\tmydata.focus();\t\t\r\n\t\treturn false;\r\n\t} else\r\n\t\treturn true;\r\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\t\r\n\tvar test2 = lkup_binary_m(\"lkup4\",\"zipCode\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zipCode\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"lkup4\",\"zipCode\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zipCode\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgs.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function checkZip(value) {\n return (/(^\\d{5}$)|(^\\d{5}-\\d{4}$)/).test(value);\n}", "function validateZipCode() {\r\n var code = document.getElementById(\"zip\");\r\n var regex = /^(?:6[0-9]{5})$/;\r\n if (!code.value.match(regex)) {\r\n code.style.borderColor = \"red\";\r\n document.getElementById(\"ValidZip\").style.display = \"block\";\r\n keycode = false;\r\n }\r\n else {\r\n keycode = true;\r\n code.style.borderColor = \"darkturquoise\";\r\n document.getElementById(\"ValidZip\").style.display = \"none\";\r\n }\r\n}", "function getName(phrase) {\n var md = forge.md.sha256.create();\n for(var n=0; n <100; n++)\n md.update(phrase);\n return md.digest().toHex()+ '.zip';\n}", "function SiteAddressZipCode_Change()\n{\n\ttry\n\t{\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"function SiteAddressZipCode_Change\" );\n\t\tvar z = myGetValue( \"new_zippostalcode\" );\n\t\tif( z != null && z.length > 0 )\n\t\t{\n\t\t\tif( DebugModeSiteZipCode ) \n\t\t\t\twindow.alert( \"function SiteAddressZipCode_Change\\nnew_zippostalcode\\t\" + z );\n\t\t\tWrapperExtractCityStateFromZip( z, \"new_city\", \"new_county\", \"new_stateprovince\", \"new_countryregion\", \"new_ocountryregion\" ); \n\t\t}\n\t}\t\n\tcatch( err )\n\t{\n\t\twindow.alert( \"function SiteAddressZipCode_Change error code \" + err );\n\t\tif( DebugModeSiteZipCode ) \n\t\t\twindow.alert( \"1 name \" + err.name + \"\\n2 message\\t\" + err.message + \"\\n3 number\\t\" + err.number + \"\\n4 prototype\\t\" + err.prototype + \"\\n5 toString\\t\" + err.toString() );\n\t}\n}", "function isZipValid(zipCode) {\n\tvar zip = /^\\d{5}$/;\n\tzip.test(zipCode) ? console.log('This is a valid postal code') : console.log('This is not a valid postal code');\n}", "function encode_digit(d, flag) {\n return d + 22 + 75 * (d < 26) - ((flag !== 0) << 5);\n // 0..25 map to ASCII a..z or A..Z \n // 26..35 map to ASCII 0..9\n }", "function getZIP(placemark) {\n return _getPlacemarkAttribute(placemark, 'PostalCodeName');\n }", "function updateZip() {\n zipCode = \"zip=\" + zipcodeHomeInput.value + \",us&APPID=\" + appId;\n var url = baseUrl + zipCode + \"&units=imperial\";\n console.log(zipCode);\n sendRequest(url);\n}", "function shipping_zip5(input1, input2, input3){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar input3;\r\n\tvar test2 = lkup_binary_m(\"city_state_zip\",\"zip\", input3).data;\r\n\tvar test1 = {\r\n\t\t\t\"city\" : input1 ,\r\n\t\t\t\"state\" : input2,\r\n\t\t\t\"zip\" : input3\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input3, \"numeric\", \"conf1\")){\r\n\t\terror = \"E26_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (!presence_check(input3)){\r\n\t\terror = \"E26_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif(!length_field_check(input3, \"zipCode5\", \"conf1\")){\r\n\t\terror = \"E26_4\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif((lkup_binary_m(\"city_state_zip\",\"zip\",input3).found )){\r\n\t\tif(!matchObj(test1, test2, \"zip\")){\r\n\t\t\terror = \"E24_23\"\r\n\t\t\tresult.flgname.push(flags[error].name);\r\n\t\t\tresult.flgflag.push(flags[error].flag);\r\n\t\t\tresult.flgvalue.push(flags[error].value);\r\n\t\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\terror = \"E26_22\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function FormatPhoneNumber(val)\n{\n if ((val.length == 0) || (val.charAt(0) == \"0\"))\n\t return val;\n \t \n var ext = \"\";\n var temp = val;\n var vTempExt = \"\";\n var extFound = false;\n var isInter = false;\n var extAtBegin = false;\n var i = -1;\n if (val.charAt(0) == \"+\")\n {\n isInter = true; \n }\n \n val.replace(\"/\\D+/g.\", \"\");\n i = val.indexOf(\"ext\");\n if (i > -1)\n {\n ext = val.substring(i);\n temp = val.substring(0, value.length - ext.length)\n vTempExt = ext.substring(3, ext.length);\n ext = val.substring(i, 3);\n extFound = true;\n \n if(i == 2)\n {\n extAtBegin = true;\n }\n }\n else\n {\n i = findToken(val,\"x\"); //val.indexOf(\"x\");\n if (i > -1)\n {\n \n ext = val.substring(i);\n vTempExt = ext.substring(1, ext.length);\n j = findToken(vTempExt,\"x\");// vTempExt.indexOf(\"x\");\n if (j > -1)\n {\n extFound = false;\n ext = \"\";\n i = -1;\n }\n else\n {\n temp = val.substring(0, val.length - ext.length)\n ext = \"x\";\n extFound = true;\n \n }\n if(i == 0)\n {\n extAtBegin = true;\n } \n } \n }\n\n if (extFound) \n {\n\t\t\n\t\tif (vTempExt.length >= 1) \n\t\t{\n\t\t\tif (containsAlphaChar(vTempExt))\n\t\t\t{\n\t\t\t ext = ext + convertPhoneLetters(vTempExt);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t ext = ext + vTempExt;\t\t\t \n\t\t\t}\n\t }\n }\n if(extAtBegin)\n {\n return ext;\n \n }\n else\n {\n val = convertPhoneLetters(temp);\n \n var result = val;\n if (val.length == 10)\n {\n result = \"(\" + val.substr(0,3) + \") \" + val.substr(3,3) + \"-\" + val.substr(6,4);\n }\n if (val.length == 7)\n {\n result = val.substr(0,3) + \"-\" + val.substr(3,4);\n } \n \n return result + ext;\n }\n}", "function encode_digit(d, flag) {\n\t\treturn d + 22 + 75 * (d < 26) - ((flag != 0) << 5);\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t}", "formatCode(code) {\n return code\n .replace(/^([0-9]{3})([0-9]{3})$/, '$1 $2') // 6 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{2})$/, '$1 $2 $3') // 7 digits\n .replace(/^([0-9]{2})([0-9]{3})([0-9]{3})$/, '$1 $2 $3') // 8 digits\n }", "function checkzip(inputzip){\n if(!inputzip.value.match(/^([0-9]{5})$/)){\n document.getElementById(\"Zipcode\").innerHTML = \"Zipcode should be consisted of 5 numbers\"+\"<br>\";\n inputzip.value = \"\";\n return false;\n }\n else\n return true;\n}", "function formatPhone(x){\n var areaCode = x.slice(0, 3);\n var first3 = x.slice(3, 6);\n var last4 = x.slice(6, 11);\n var phone = areaCode + \"-\" + first3 + \"-\" + last4;\n return phone;\n}", "validatePostalCode(postalCode) {\n if(postalCode==='') {\n return 'Postal code required';\n } else if (!/^\\d+$/.test(postalCode)) {\n return 'Postal code invalid'\n } else if (postalCode.length > 10 || postalCode.length < 2) {\n return 'Postal code invalid (must be between 2-10 digits)'\n }\n \n return '';\n }", "function create_extension_pattern(purpose) {\n\t// One-character symbols that can be used to indicate an extension.\n\tvar single_extension_characters = 'x\\uFF58#\\uFF03~\\uFF5E';\n\n\tswitch (purpose) {\n\t\t// For parsing, we are slightly more lenient in our interpretation than for matching. Here we\n\t\t// allow \"comma\" and \"semicolon\" as possible extension indicators. When matching, these are\n\t\tcase 'parsing':\n\t\t\tsingle_extension_characters = ',;' + single_extension_characters;\n\t}\n\n\treturn RFC3966_EXTN_PREFIX + CAPTURING_EXTN_DIGITS + '|' + '[ \\xA0\\\\t,]*' + '(?:e?xt(?:ensi(?:o\\u0301?|\\xF3))?n?|\\uFF45?\\uFF58\\uFF54\\uFF4E?|' +\n\t// \"доб.\"\n\t'\\u0434\\u043E\\u0431|' + '[' + single_extension_characters + ']|int|anexo|\\uFF49\\uFF4E\\uFF54)' + '[:\\\\.\\uFF0E]?[ \\xA0\\\\t,-]*' + CAPTURING_EXTN_DIGITS + '#?|' + '[- ]+([' + _constants__WEBPACK_IMPORTED_MODULE_0__[\"VALID_DIGITS\"] + ']{1,5})#';\n}", "function isValidPostalcode(postalcode) {\n if (postalcode.search) {\n postalcode = removeSpaces(postalcode);\n if (postalcode.length == 6 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]\\d[a-zA-Z]\\d$/) != -1) return true;\n else if (postalcode.length == 7 && postalcode.search(/^[a-zA-Z]\\d[a-zA-Z]-\\d[a-zA-Z]\\d$/) != -1) return true;\n else return false;\n }\n return true;\n}", "getInternational() {\r\n return this.phoneNumber.replace(/^(0)(\\d{8,9})$/, '972$2');\r\n }", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "get zip(){return this._zip;}", "function getZipStringWithCell(cell) {\n var cellZipString = \"\";\n if(cell && (typeof cell.row == 'number') && (typeof cell.col == 'number') ) {\n var startCharCode = \"A\".charCodeAt(0);\n var lengthCharCode = \"Z\".charCodeAt(0) - \"A\".charCodeAt(0) + 1;\n if(!lengthCharCode){\n return \"\";\n }\n var divisor = cell.col;\n var remainder = 0;\n var first = true;\n do{\n remainder = Math.floor( divisor%lengthCharCode - (first?0:1) );\n divisor = Math.floor( divisor/lengthCharCode );\n cellZipString = String.fromCharCode(remainder+startCharCode) + cellZipString;\n first = false;\n }while(divisor);\n cellZipString = cellZipString + (cell.row+1);\n }\n return cellZipString;\n }" ]
[ "0.6843275", "0.67388004", "0.6706737", "0.6706737", "0.659101", "0.655189", "0.6522375", "0.6351899", "0.6233588", "0.6220237", "0.6215889", "0.61986965", "0.6149164", "0.6148541", "0.61456317", "0.6127173", "0.6116874", "0.611603", "0.6111096", "0.6069575", "0.6069575", "0.6068106", "0.6038458", "0.6029304", "0.6022428", "0.60208595", "0.6009184", "0.6003535", "0.5995776", "0.59883744", "0.598266", "0.5972633", "0.5966356", "0.5962784", "0.5960929", "0.5956453", "0.5945718", "0.59415406", "0.59239453", "0.5907986", "0.58838326", "0.58550686", "0.5842862", "0.58061856", "0.5777107", "0.57752556", "0.576447", "0.5761264", "0.5750877", "0.5737973", "0.5707678", "0.57038003", "0.56935245", "0.56903106", "0.5689366", "0.5682265", "0.5670328", "0.5653789", "0.56461924", "0.56437176", "0.5637362", "0.5629666", "0.56212074", "0.5615992", "0.559187", "0.55865574", "0.55865574", "0.55850077", "0.5576057", "0.5560527", "0.5550407", "0.55430424", "0.5537171", "0.5529758", "0.5496306", "0.549446", "0.5490831", "0.54773355", "0.54773355", "0.5476939", "0.54593706", "0.5458419", "0.5435644", "0.542925", "0.54103696", "0.54030204", "0.53723824", "0.53636086", "0.5360704", "0.5356997", "0.53356844", "0.53141063", "0.52904564", "0.5289916", "0.5283289", "0.5278098", "0.5275452", "0.5275452", "0.5275452", "0.52600724" ]
0.6328126
8
Date of ceased operations
function date_Of_Ceased(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true if (!check_allowed_char(input, "dateOfCeased", "conf1")){ error = "E36_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } //if (!presence_check(input)){ // error = "E31_2" //result.flgname.push(flags[error].name); //result.flgs.push(flags[error].flag); //result.flgvalue.push(flags[error].value); //result.flgmsg.push(flags[error].msg); //} if (check_req_char(input, "dateOfCeased", "conf1")){ error = "E36_3" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gps_fechasAyer() { \n var fecha = new Date();\n var fecha_ayer = new Date(fecha.getTime());\n fecha_ayer.setDate(fecha.getDate() - 1); \n gps_asignarFechaComp(fecha_ayer);\n}", "function calculateExpiry(date) {\n let currentDate = new Date();\n let dateparts = date.split('-');\n let deadline = new Date(dateparts[0], dateparts[1] - 1, dateparts[2]);\n return Math.ceil((deadline - currentDate) / (1000 * 3600 * 24))\n}", "calculateFailureDate(flatOrder) {\n let secondsToFailure = flatOrder.paymentsCovered.floor() * flatOrder.paymentInterval\n flatOrder.failureDate = flatOrder.nextPaymentDate.clone().add(secondsToFailure, 's')\n }", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "function calculateExpiryDate() {\n var now = new Date().getTime();\n var distance = expiryTimestamp - now;\n var days = Math.floor(distance / (1000 * 60 * 60 * 24));\n var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\n var seconds = Math.floor((distance % (1000 * 60)) / 1000);\n if(seconds < 0) {\n resetTimer();\n isValidOnExpire(onExpire) && onExpire();\n } else {\n setSeconds(seconds);\n setMinutes(minutes);\n setHours(hours);\n setDays(days);\n }\n }", "function calculateDueDate(state) {\n var result = new Date(state.lastReviewed);\n result.setHours(3, 0, 0);\n result.setDate(result.getDate() + Math.ceil(state.interval));\n return result;\n}", "get maxDate() {\n return calculateMaxDate(this.expiryMilliseconds);\n }", "isRevoked() {\n const { canReceiveAfter, canSendAfter, kycExpiry } = this;\n const datesAreZero = [canReceiveAfter, canSendAfter, kycExpiry].every(date => date.getTime() === 0);\n //\n return datesAreZero;\n }", "validate(){\n if(this.taskDate < Date.now()){\n throw new Error('The date cannot be in the past');\n }\n }", "expiryTime(now) {\n if (this.maxAge != null) {\n const relativeTo = now || this.creation || new Date();\n const age = this.maxAge <= 0 ? -Infinity : this.maxAge * 1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n }", "expiryTime(now) {\n if (this.maxAge != null) {\n const relativeTo = now || this.creation || new Date();\n const age = this.maxAge <= 0 ? -Infinity : this.maxAge * 1000;\n return relativeTo.getTime() + age;\n }\n\n if (this.expires == Infinity) {\n return Infinity;\n }\n return this.expires.getTime();\n }", "function dateValidRef() {\r\n //today w/o timestamp\r\n const y = new Date(\r\n new Date().getFullYear(),\r\n new Date().getMonth(),\r\n new Date().getDate()\r\n );\r\n //today minus 1 millisecond\r\n const ref = new Date(y.setMilliseconds(y.getMilliseconds() - 1));\r\n return ref;\r\n}", "get is_expiry_date_no_limit(){\n return this._is_expiry_date_no_limit\n }", "function modifyExpire(numDays) {\n currentDate = new Date(); // Get current date.\n calculateValid(numDays, currentDate); // Runs calculateValid.\n}", "previousDay(){\n return this.subtractProp(this._time - 24*60*60*1000);\n }", "function calculate_overdue(item) {\n return (Date.now()-Date.parse(item.available_at))/(1000*60*60)/srs_intervals[item.srs];\n }", "function expireTime(date) {\n return date.setDate(date.getDate() + 1);\n}", "static get since() {\n\t\treturn new Date(Date.UTC(1999, 0, 1));\n\t}", "function get_time_left() {\n return (escrow_amount / price_per_second) - time_spent;\n}", "_noEntry(){\n const tomorrow = this.date.getDate() + 1;\n this.date.setDate(tomorrow);\n }", "function generateExpirationDate() {\n\tvar currentDate = new Date();\n\tcurrentDate = currentDate.setDate(currentDate.getDate() + 1);\n\treturn new Date(currentDate).toISOString();\n}", "elapsed_days(){\n return this.ticks / TICKS_PER_DAY; \n }", "function decrementDate() {\n setDate(subDays(date, 1));\n setPage(1);\n }", "function B(a){return a.clone().stripTime().diff(G.start,\"days\")}", "function checkDate(){\n var testDate = new Date();\n var testMonth = testDate.getMonth() + 1;\n var testYear = testDate.getFullYear();\n daysInMonth = new Date(testYear, testMonth, 0).getDate();\t\t//returns the number of days in the current month\n daysInMonth = parseInt(daysInMonth);\n if(currentMonth != testMonth) {\t\t\t\t\t//If the current month does not match last recorded month. A new month has passed\n\tmonthlyTotal = 0;\n\tcurrentMonth = testMonth;\n\tdaysMetGoal = 0;\n\tupdateOLED();\n }\n var testDay = testDate.getDate();\n if(currentDay != testDay) {\t\t\t\t\t\t//If the current day does not match last recorded day. A new day has passed\n\ttotalWeight = 0;\n\tcurrentDay = testDay;\n\tprogress = 0;\n\tupdateOLED();\n }\n updateDatabase();\n}", "function prototypeTimeLeft() {\n let weddingDate = new Date('2020/10/17');\n let today = new Date();\n let diff = weddingDate - today;\n let days = diff / 86400000;\n let hours = (days % 1) * 24;\n let minutes = (hours % 1) * 60;\n let seconds = (minutes % 1) * 60;\n\n changeDays(Math.floor(days));\n changeHours(Math.floor(hours));\n changeMinutes(Math.floor(minutes));\n changeSeconds(Math.floor(seconds));\n}", "function z(a){return G.start.clone().add(a,\"days\")}", "obliquityEcliptic() {\n let jd = this.julianDate(2010, 1, 0);\n let centuries = (jd - 2451545) / 36525;\n let daysElapsed = 46.815 * centuries + 0.0006 * Math.pow(centuries, 2) - 0.00181 * Math.pow(centuries, 3);\n return 23.439292 - daysElapsed / 3600;\n }", "chronoContinue(){\n this.start = new Date()-this.diff;\n this.start = new Date(this.start);\n this.chrono();\n }", "function getSinceDate() {\n if (self.notifications.length > 0) {\n return Date.parse(self.notifications[self.notifications.length - 1].createdDate).getTime()/1000 - 1;\n } else {\n return 0;\n }\n }", "function disabledDate(current) {\n return current && current.valueOf() < Date.now(); //Date.now()\n }", "getDateDifference(date){\n\treturn new Date().getFullYear()-date;\n\t//console.log(date);\n}", "function subtractDates(date1,date0){if(largeUnit){return util_1.diffByUnit(date1,date0,largeUnit);// poorly named\n}else if(dateProfile1.isAllDay()){return util_1.diffDay(date1,date0);// poorly named\n}else{return util_1.diffDayTime(date1,date0);// poorly named\n}}", "get expiry() {\n this._logger.trace(\"[getter] expiry\");\n\n return this._expiry;\n }", "function daysDiff(newdate,olddate)\n{\n //if the outcome is Positive, It Means the new Date is greater than old date\n //eg , If th eoutput is >=1 it means date of appointment is in future\n \nvar olddt = new Date(olddate);\nvar newdt = new Date(newdate);\n\nreturn Math.floor((Date.UTC(newdt.getFullYear(), newdt.getMonth(), newdt.getDate()) - Date.UTC(olddt.getFullYear(), olddt.getMonth(), olddt.getDate()) ) /(1000 * 60 * 60 * 24));\n\n}", "function decrementDate() {\n dateOffset --;\n googleTimeMin = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T00:00:00.000Z';\n googleTimeMax = d.getUTCFullYear() + '-' + (d.getUTCMonth() +1 ) + \"-\" + (d.getUTCDate() + dateOffset) + 'T23:59:59.999Z';\n calendarDate();\n listUpcomingEvents();\n\n}", "function calculateDate(el) {\r\n\treturn 2019 - el; \r\n}", "get expired() {\n\t\treturn !this.ticket;\n\t}", "getTokenExpDate() {\n if (this.accessTokenPayload && this.accessTokenPayload.hasOwnProperty('exp')) {\n const date = new Date(0);\n date.setUTCSeconds(this.accessTokenPayload.exp);\n return date;\n }\n else {\n return super.getTokenExpDate();\n }\n }", "calculateDaysUsed(){\n\t \n\t /*Get today's date*/\n\t const todayDate = new Date();\n\n\t /*loop through each element/object in the cases array calculating the days between the last status change and the current day. This number is assign to the cases daysUsed attribute of cases object.*/\n\t cases.forEach(function(files, index){\n\t\t \t \n\t\t/*convert the startDate of files from a string into milliseconds*/ \n var currentCaseStartDate = Date.parse(files.startDate);\t\n\t\t\n\t \t/*Subtract today's date in milliseconds from startDate in milliseconds. Use the Math function to convert to its absolute value*/\n\t \tvar numberOfMilliseconds = Math.abs(todayDate.getTime() - currentCaseStartDate);\t\t\t \n\t \n\t /*Divide the numberOfMilliseconds varible by a algorithm of a day. Use the Math.ceil function to convert to the smallest number of a given number*/\n\t var daysUsed = Math.ceil(numberOfMilliseconds/(1000*3600*24));\n\t\t \n\t\t/*assign the number of days used since last status change to current case*/ \n\t \tcases[index].daysUsed = daysUsed;\n\t });\n }", "function dueDate(exchange, uom, saleCreatedAt, dkm) {\n let add;\n let unit;\n switch (uom) {\n case \"km\":\n add = exchange / dkm;\n unit = 'days'\n break;\n case \"year\":\n add = exchange;\n unit = 'years'\n break;\n case \"month\":\n add = exchange;\n unit = 'months'\n }\n console.log(`Due Date: ${moment(saleCreatedAt).add(add, unit).toISOString()}` )\n return moment(saleCreatedAt).add(add, unit).toISOString();\n}", "checkRateUpdate(){\n const dateUpdate = this.state.dateUpdate;\n \n if(typeof dateUpdate === \"number\"){\n const timeSinceLastUpdate = new Date() - dateUpdate;\n const timeMaxWithOutUpdate = 21600000 // 6h = 6 * 60 * 60 * 1000 = 21600000\n\n if (timeSinceLastUpdate > timeMaxWithOutUpdate)\n this.getTheRates();\n }\n }", "function getLastJobs(days) {\n var eDateVal = getToday();//end date = today\n var sDateVal = new Date();\n\n sDateVal.setDate(sDateVal.getDate() - days);\n sDateVal = sDateVal.toLocaleString();\n\n //convert to format (YYYY-MM-DD)\n sDateVal = moment(sDateVal).format('YYYY-MM-DD');\n eDateVal = moment(eDateVal).format('YYYY-MM-DD');\n\n console.log(sDateVal + \" - \" + eDateVal);\n\n $('#startDate').val(sDateVal);\n $('#endDate').val(eDateVal);\n\n detailsUpdate(customerId)\n}", "function getDayCompletion(){\n return (Date.now() / 1000 / 60 / 60 / 24) % 1;\n}", "function diffSubtract(date1, date2) {\n\treturn date2 - date1;\n}", "approaches() {\n this._time_until_arrival--;\n }", "function blockdates(){\n \n var dateToday = new Date();\n var dtToday = dateToday;\n var ndtToday = dateToday;\n dtToday.setDate(dtToday.getDate() - 14);\n var month = dtToday.getMonth() + 1;\n var day = dtToday.getDate();\n var year = dtToday.getFullYear();\n if(month < 10)\n month = '0' + month.toString();\n if(day < 10)\n day = '0' + day.toString();\n \n var maxDate = year + '-' + month + '-' + day;\n \n $('#positive_date').attr('max', maxDate);\n\n //block by default negetive, not old than positive date\n blockNegativeDate(dtToday);\n //disabled negative date\n document.getElementById(\"negative_date\").disabled = true;\n}", "function resetLastNotified() {\n lastNotified = new Date();\n}", "function getDataFromPast(numDays) { \n var today = new Date(); \n today.setDate(today.getDate()-numDays); \n return Utilities.formatDate(today, \"GMT\", \"yyyyMMdd\"); \n }", "daysRemaining(){\n for(let booking of this._booking){\n this.holidayAllowance-=booking.numberOfDays();\n }\n return this.holidayAllowance;\n }", "get isTooLate() {\n return this._period.end.diff(this._getCurrentDateTime()).milliseconds < 0\n }", "function laterDate() {\n return moment().add(Math.pow(365.25*3,Math.random()),'days').format(\"YYYY-MM-DD\");\n }", "function checkExpire(todo){\n let dateNum\n if(todo.expire!=null){\n dateNum = Math.floor ( (new Date(todo.expire)-new Date()) / ( 24 * 3600 * 1000 ))+1\n }\n if(todo.expire==null || dateNum>=0){\n // console.log('no expire');\n return todo;\n }\n \n }", "function getRemaindingTime() {\n //Get current time (in ms)\n const today = new Date().getTime();\n //Create variable t, this is the difference between the furtureTime and present time\n const t = futureTime - today;\n\n /* Reference to convert everything to milliseconds\n // 1s = 1000ms\n // 1m = 60s\n // 1hr = 60m\n // 1d = 24hr\n */\n\n //Conversion to milliseconds complete\n const oneDay = 24 * 60 * 60 * 1000;\n const oneHour = 60 * 60 * 1000;\n const oneMinute = 60 * 1000;\n \n //Create variable called days, we then divide the time left for countdown by a day\n let days = t / oneDay;\n days = Math.floor(days);\n let hours = Math.floor((t % oneDay) / oneHour);\n let minutes = Math.floor((t % oneHour) / oneMinute);\n let seconds = Math.floor((t % oneMinute) / 1000);\n\n // set values array\n const values = [days, hours, minutes, seconds];\n \n function format(item) {\n if (item < 10) {\n return (item = `0${item}`);\n }\n return item;\n }\n\n items.forEach(function (item, index) {\n item.innerHTML = format(values[index]);\n });\n\n //If difference in time is less than 0. Time expired\n if (t < 0) {\n clearInterval(countdown);\n deadline.innerHTML = `<h4 class=\"expired\">sorry, the motherfucking world has ended!</h4>`;\n }\n}", "function getNewEndDate() {\n return getNewStartDate().add(1, 'hours');\n }", "function validateExpritation() {\n const expirationDate = store.getters.getExpDate\n const now = new Date()\n if (now.getTime() > expirationDate.getTime()) {\n // Emit an alert to main Vue component\n // EventBus.$emit('token-expired')\n store.dispatch('logOut')\n }\n}", "get lastDataSubmissionFailureDate() {\n return CommonUtils.getDatePref(this._healthReportPrefs,\n \"lastDataSubmissionFailureTime\",\n 0, this._log, OLDEST_ALLOWED_YEAR);\n }", "function disablePreviousDays() {\n const currDate = new Date();\n const currMonth = currDate.getMonth() > 9 ? currDate.getMonth() + 1 : '0' + (currDate.getMonth() + 1);\n const currDay = currDate.getDate() > 9 ? currDate.getDate() : '0' + currDate.getDate();\n \n const dateStr = currDate.getFullYear() + '-' + currMonth + '-' + currDay;\n return dateStr;\n}", "function late(){\r\n let totalInvoice = document.querySelector('#totalInvoice').value\r\n let expirationDate = document.querySelector('#expirationDate').value\r\n let payDate = document.querySelector('#payDate').value\r\n let rate = document.querySelector('#rate').value / 100\r\n let delayDay = document.querySelector('#delayDay')\r\n\r\n function calcDate(){\r\n expiration = new Date(expirationDate)\r\n payDay = new Date(payDate)\r\n\r\n let defTime = Math.abs(payDay - expiration)\r\n let dayTime = 1000 * 60 * 60 * 24 \r\n let defDays = defTime / dayTime\r\n\r\n return defDays\r\n }\r\n\r\n delayDay.innerHTML = calcDate()\r\n\r\n if(totalInvoice == '' || expirationDate == '' || payDate == '' ||rate == ''){\r\n alert('Preencha todos os campos')\r\n } else {\r\n let iofMonth = 0.0038\r\n let iofDay = 0.000082\r\n\r\n let totalFee = totalInvoice * (1 + rate)**(0.33) - totalInvoice\r\n let dayRate = (totalInvoice * calcDate() * 0.00033)\r\n let fee = totalInvoice * 0.02\r\n let iof = (totalInvoice * iofMonth) + (totalInvoice * iofDay * calcDate())\r\n let totalRate = totalFee + dayRate + fee + iof\r\n let totalPay = parseFloat(totalInvoice) + parseFloat(totalRate)\r\n \r\n document.querySelector('#totalFee').innerHTML = realCurrency(totalFee)\r\n document.querySelector('#dayRate').innerHTML = realCurrency(dayRate)\r\n document.querySelector('#fee').innerHTML = realCurrency(fee)\r\n document.querySelector('#iof').innerHTML = realCurrency(iof)\r\n document.querySelector('#totalRate').innerHTML = realCurrency(totalRate)\r\n document.querySelector('#totalPay').innerHTML = realCurrency(totalPay)\r\n }\r\n \r\n}", "infectionByRequestedTime() {\n const factor = this.powerFactor();\n return this.currentlyInfected() * 2 ** factor;\n }", "function getDate(providedDate) {\n var todaysDate = new Date();\n var creationDate = new Date(providedDate);\n //Math.abs() returns positive number only \n const diffTime = Math.abs(creationDate - todaysDate);\n // 1 seconds = 1000 milliseconds\n // 1 day = 24 hours x 60 minutes x 60 seconds \n const diffDays = Math.ceil(diffTime / (24 * 60 * 60 * 1000));\n return diffDays\n}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "timeRemaining(reqTimeStamp) {\n let endTime= reqTimeStamp + this.validationWindow;\n let now = parseInt(new Date().getTime()/1000);\n return (endTime - now)\n }", "calculateExpirationDate(expiresIn) {\n return new Date(Date.now() + (expiresIn * 1000));\n }", "get isTooEarly() {\n return this._period.start.diff(this._getCurrentDateTime()).milliseconds > 0\n }", "yearsExperienceFromBeginningOf(endDate){\n let date = new Date(endDate, 1,1)\n return Math.round((date - this.startDate)/(1000*60*60*24*365))\n }", "function calculateExpire() {\n var expiresIn = Math.round((((messageObject.expiresOn-new Date(Date.now())) % 86400000) % 3600000) / 60000); // minutes\n console.log(expiresIn);\n return expiresIn\n}", "checkDateExpiresOn(date) {\n let currentDate = new Date(Date.now());\n let givenDate = new Date(this.stringFormatDate(date));\n if (givenDate < currentDate) {\n return true;\n }\n return false;\n }", "function elapsedDays(dateText) {\r\n var ms2day = 1/(1000*60*60*24);\r\n var today = new Date();\r\n try {\r\n var startDate = new Date(Date.parse(dateText));\r\n if (today.getYear() == startDate.getYear()\r\n \t\t&& today.getMonth() == startDate.getMonth()\r\n \t\t&& today.getDate() == startDate.getDate()) {\r\n \treturn 0;\r\n \t} else {\r\n \treturn Math.round((today - startDate)*ms2day) - 1;\r\n }\r\n } catch (ex) {\r\n log(\"Error in elaspedDays: \" + ex);\r\n }\r\n}", "function verifyDate(dateRequested) {\n var differenceDays = differenceInDays(dateRequested, todayDate());\n var yearRequested = dateRequested.slice(0, 4);\n\n // if requested date is > 30 days in future\n // it is actually a request for the past\n if (differenceDays < -30) {\n return parseInt(yearRequested) - 1 + dateRequested.slice(4);\n } else {\n return dateRequested;\n }\n}", "function calculateDaysLeft(dueDate) {\n //get current datetime\n var currentDay = moment();\n //return the difference\n return (currentDay.diff(dueDate, 'days') * -1) + 1;\n }", "function getAvailableDate() {\n const date = new Date();\n date.setDate(date.getDate() + 1);\n return date;\n}", "function getRightNow() {\n\treturn new Date();\n}", "function due_date_reflect(){\n var text = $( \"#txt_package_from_date\" ).val();\n var date_arr = text.split('-'); \n\n var d = new Date();\n d.setDate(date_arr[0]);\n d.setMonth(date_arr[1]);\n d.setFullYear(date_arr[2]);\n var yesterdayMs = d.getTime() - 1000*60*60*24; // Offset by one day;\n d.setTime(yesterdayMs);\n var month = d.getMonth();\n var due_date = d.getDate()+'/'+month+'/'+d.getFullYear();\n $('#txt_balance_due_date').val(due_date);\n}", "function checkQuestionExpiration(date) {\n const numberOfHours = 20;\n console.log(\n \"current time minus time when question was answered\",\n new Date().getTime() - date\n );\n console.log(\"other number\", numberOfHours * 60 * 60 * 1000);\n return new Date().getTime() - date > numberOfHours * 60 * 60 * 1000;\n}", "function subtractDates(date1, date0) {\n if (largeUnit) {\n return util_1.diffByUnit(date1, date0, largeUnit); // poorly named\n }\n else if (dateProfile1.isAllDay()) {\n return util_1.diffDay(date1, date0); // poorly named\n }\n else {\n return util_1.diffDayTime(date1, date0); // poorly named\n }\n }", "function subtractDates(date1, date0) {\n if (largeUnit) {\n return util_1.diffByUnit(date1, date0, largeUnit); // poorly named\n }\n else if (dateProfile1.isAllDay()) {\n return util_1.diffDay(date1, date0); // poorly named\n }\n else {\n return util_1.diffDayTime(date1, date0); // poorly named\n }\n }", "function subtractDates(date1, date0) {\n if (largeUnit) {\n return util_1.diffByUnit(date1, date0, largeUnit); // poorly named\n }\n else if (dateProfile1.isAllDay()) {\n return util_1.diffDay(date1, date0); // poorly named\n }\n else {\n return util_1.diffDayTime(date1, date0); // poorly named\n }\n }", "function subtractDates(date1, date0) {\n if (largeUnit) {\n return util_1.diffByUnit(date1, date0, largeUnit); // poorly named\n }\n else if (dateProfile1.isAllDay()) {\n return util_1.diffDay(date1, date0); // poorly named\n }\n else {\n return util_1.diffDayTime(date1, date0); // poorly named\n }\n }", "didDonateWithinLastHour(){\n //return true is yes else false\n let persistedDonation = this.get();\n if(persistedDonation){\n let currTime = Date.now();\n console.log(\"currTime\" , currTime, typeof(currTime), \"persistedDonation[when]\",\n persistedDonation[\"when\"], typeof(persistedDonation[\"when\"]));\n let diffTime = currTime - persistedDonation[\"when\"];\n console.log(\"diffTime\", diffTime);\n let oneHour = 60 * 60 * 1000;//3600000, 1468982303253\n if( diffTime < oneHour){\n return [true, persistedDonation];\n }\n }\n return [false, persistedDonation];\n }", "getleft() { return calcD(this.date.y, this.date.m, this.date.d) }", "_backClicked(){\n this.date.setDate(this.date.getDate() - 1);\n this.diaryService.get(this.journalID,this.date);\n }", "get expirationDate() {\n if (typeof this.fields.expirationDate === 'string')\n return new Date(this.fields.expirationDate);\n return this.fields.expirationDate;\n }", "function subtractDates(date1, date0) { // date1 - date0\n\t\tif (largeUnit) {\n\t\t\treturn diffByUnit(date1, date0, largeUnit); // poorly named\n\t\t}\n\t\telse if (dateProfile1.isAllDay()) {\n\t\t\treturn diffDay(date1, date0); // poorly named\n\t\t}\n\t\telse {\n\t\t\treturn diffDayTime(date1, date0); // poorly named\n\t\t}\n\t}", "function subtractDates(date1, date0) { // date1 - date0\n\t\tif (largeUnit) {\n\t\t\treturn diffByUnit(date1, date0, largeUnit); // poorly named\n\t\t}\n\t\telse if (dateProfile1.isAllDay()) {\n\t\t\treturn diffDay(date1, date0); // poorly named\n\t\t}\n\t\telse {\n\t\t\treturn diffDayTime(date1, date0); // poorly named\n\t\t}\n\t}", "function earlierDate() {\n return moment().subtract(Math.pow(365.25*3,Math.random()),'days').format(\"YYYY-MM-DD\");\n }", "function deleteOld(){\n var today = new Date().getDate();\n}", "function deductTime() {\n secondsLeft = (secondsLeft - 10);\n }", "function days(oldDate, actualDate) {\n try {\n var fechaini = new Date(oldDate);\n var fechafin = new Date(actualDate);\n var diasdif = fechafin.getTime() - fechaini.getTime();\n var contdias = Math.round(diasdif / (1000 * 60 * 60 * 24));\n return contdias;\n } catch (error) {\n console.log(error);\n }\n}", "setExpiryDate(payload, next) {\n\t\tlet expiryDate = new Date(0);\n\t\texpiryDate.setUTCSeconds(payload.expiryDate); // expiry date is a raw epoch as it comes from Stripe\n\t\tlet updatePayload = {\n\t\t\tquery: {\n\t\t\t\t_id: mongodb.ObjectID(payload.userId)\n\t\t\t},\n\t\t\tupdate: {\n\t\t\t\t$set: {\n\t\t\t\t\texpiryDate: expiryDate,\n\t\t\t\t\tcancelledAt: new Date()\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tthis.update(updatePayload, next);\n\t}", "function getLastDay(){\n\t//var d = new Date();\n\tvar year = currentYear;\n\tvar month = currentMonth;\t\n\tvar date = new Date(year, month + 1, 0);\n\treturn date.getDate();\n}", "function countdown(date){\n console.log(\"begin countdown\");\n let today = new Date();\n //console.log(today);\n let depDate = new Date(date);\n //console.log(depDate);\n let dif = depDate.getTime() - today.getTime();\n let days = dif/(1000 * 3600 * 24);\n days = Math.round(days);\n console.log(\"countdown returns \" + days);\n return days;\n}", "function getYeserdayDate(){\n\t\tvar today= new Date() \n\t\ttoday.setDate(today.getDate()-1) \n\t\t \n\t\tvar theyear=today.getYear() \n\t\tvar themonth=today.getMonth()+1 \n\t\tvar theyesterday=today.getDate() \n\t\t \n\t\treturn theyear + '.' + getStringFormat(themonth,2) + '.' + getStringFormat(theyesterday,2);\n\t}", "function disableDates(date){\n //Testing, need to get dates from DB instead\n return date.getDate();\n}", "function GetDateDiffDescriptionVsNow(_date)\n{\n try\n {\n var theDate=new Date(_date);\n var now=new Date();\n var dateDiff=DateDiffHours(theDate,now);\n dateDiff=dateDiff*-1;\n switch(true){\n \n case (dateDiff<1):\n return \"less than one hour ago\";\n break;\n case (dateDiff>=1 && dateDiff < 24):\n return Math.floor(dateDiff)+\" hours ago\";\n break;\n case (dateDiff>=24 && dateDiff < 48):\n return \"yesterday\";\n break;\n case (dateDiff>=48 && dateDiff < 128):\n return Math.floor(dateDiff/24)+\" days ago\";\n break;\n \n default:\n return \"on \"+theDate.toLocaleDateString();\n \n break;\n\n }\n }catch(Err){\n console.log(\"Eorror in GetDateDiffDescriptionVsNow\"+Err);\n }\n}", "constructor(props) {\n super(props)\n this.nextDate = new Date('2017-03-13 22:10:00'),\n this.state = {\n //adds the timeLeft property to state\n timeLeft: (this.nextDate - Date.now() > 0) ? this.nextDate - Date.now() : 0\n }\n }", "function prevDate() {\n var year = x.getFullYear();\n var month = x.getMonth();\n if (month == 0) {\n month = 12;\n year -= 1;\n }\n x = new Date(year, (month - 1));\n displayDates();\n}", "overTime(){\n\t\t//\n\t}", "function time_passed(date) {\n\t\t\tvar date_now = new Date();\n\t\t\treturn date_now.getTime() - date.getTime();\n\t\t}", "function isExpired() {\n _this.ballotContract.IsProposalExpired(function (error, result) {\n console.log(JSON.stringify(result) + \"...is from isproposalexpired function in ballot\")\n setTimeout(function () {\n //recursively check every 9 seconds. in the future make this a day.\n isExpired()\n }, 9000)\n })\n }" ]
[ "0.60748744", "0.60381556", "0.59472835", "0.59286726", "0.59286726", "0.5906522", "0.58121294", "0.5647625", "0.5622712", "0.56009334", "0.5551748", "0.5551748", "0.55324876", "0.5510323", "0.549991", "0.5499207", "0.5493478", "0.546905", "0.54151344", "0.5413814", "0.5389109", "0.53889126", "0.5380867", "0.5375987", "0.5374345", "0.53742427", "0.5351607", "0.53487235", "0.53447074", "0.5336749", "0.5320843", "0.5308696", "0.5306075", "0.5294241", "0.52618283", "0.5239831", "0.5235982", "0.523105", "0.521803", "0.52125525", "0.52112913", "0.5203147", "0.5199867", "0.5196691", "0.51949066", "0.5193334", "0.5190201", "0.5178252", "0.5177963", "0.51735353", "0.51664144", "0.51596075", "0.51544464", "0.514911", "0.5146444", "0.5140333", "0.51317036", "0.5128397", "0.512812", "0.51079965", "0.5107438", "0.5104514", "0.51017773", "0.5100478", "0.5099763", "0.5094125", "0.5089612", "0.508312", "0.5077554", "0.50748086", "0.5073351", "0.50721335", "0.5070685", "0.5069636", "0.50584126", "0.5056535", "0.5055598", "0.5055598", "0.5055598", "0.5055598", "0.5053006", "0.50523585", "0.50499547", "0.5048806", "0.50476897", "0.50476897", "0.5044262", "0.50436395", "0.50428605", "0.5041321", "0.50402004", "0.5035498", "0.5026603", "0.50202227", "0.50200117", "0.5015411", "0.5014461", "0.5013087", "0.50129426", "0.5005399", "0.50009525" ]
0.0
-1
Operating status and date of ceased operation cross check
function CrossCheck_operatingStatus_dateOfCeased (input1,input2){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if ((presence_check && ! presence_check(input2))||(!presence_check(input1) && presence_check(input2)) ){ error = "E5_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CrossCheck_operatingStatus_dateOfCeased (input1,input2){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tvar input1;\r\n\tvar input2;\r\n\tvar test = {\r\n\t\t\"Ceased Operation \": input1,\r\n\t\t\"date of Ceased\" : input2\r\n\t};\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif ((presence_check && ! presence_check(input2))||(!presence_check(input1) && presence_check(input2)) ){\r\n\t\terror = \"E5_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tconsole.log(result.flgname.length);\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "calculateFailureDate(flatOrder) {\n let secondsToFailure = flatOrder.paymentsCovered.floor() * flatOrder.paymentInterval\n flatOrder.failureDate = flatOrder.nextPaymentDate.clone().add(secondsToFailure, 's')\n }", "isRevoked() {\n const { canReceiveAfter, canSendAfter, kycExpiry } = this;\n const datesAreZero = [canReceiveAfter, canSendAfter, kycExpiry].every(date => date.getTime() === 0);\n //\n return datesAreZero;\n }", "async function checkCancellation(from) {\n\t\t\t\tconst currentMargin = (await futuresMarket.positions(trader)).margin;\n\t\t\t\t// cancel the order\n\t\t\t\tconst tx = await futuresMarket.cancelNextPriceOrder(trader, { from: from });\n\n\t\t\t\t// check order is removed\n\t\t\t\tconst order = await futuresMarket.nextPriceOrders(trader);\n\t\t\t\tassert.bnEqual(order.sizeDelta, 0);\n\t\t\t\tassert.bnEqual(order.targetRoundId, 0);\n\t\t\t\tassert.bnEqual(order.commitDeposit, 0);\n\t\t\t\tassert.bnEqual(order.keeperDeposit, 0);\n\n\t\t\t\t// The relevant events are properly emitted\n\t\t\t\tconst decodedLogs = await getDecodedLogs({ hash: tx.tx, contracts: [sUSD, futuresMarket] });\n\n\t\t\t\tif (from === trader) {\n\t\t\t\t\t// trader gets refunded\n\t\t\t\t\tassert.equal(decodedLogs.length, 4);\n\t\t\t\t\t// keeper fee was refunded\n\t\t\t\t\t// PositionModified\n\t\t\t\t\tdecodedEventEqual({\n\t\t\t\t\t\tevent: 'PositionModified',\n\t\t\t\t\t\temittedFrom: futuresMarket.address,\n\t\t\t\t\t\targs: [toBN('1'), trader, currentMargin.add(keeperFee), 0, 0, price, toBN(2), 0],\n\t\t\t\t\t\tlog: decodedLogs[1],\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// keeper gets paid\n\t\t\t\t\tassert.equal(decodedLogs.length, 3);\n\t\t\t\t\tdecodedEventEqual({\n\t\t\t\t\t\tevent: 'Issued',\n\t\t\t\t\t\temittedFrom: sUSD.address,\n\t\t\t\t\t\targs: [from, keeperFee],\n\t\t\t\t\t\tlog: decodedLogs[0],\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// commitFee (equal to spotFee) paid to fee pool\n\t\t\t\tdecodedEventEqual({\n\t\t\t\t\tevent: 'Issued',\n\t\t\t\t\temittedFrom: sUSD.address,\n\t\t\t\t\targs: [await feePool.FEE_ADDRESS(), spotFee],\n\t\t\t\t\tlog: decodedLogs.slice(-2, -1)[0], // [-2]\n\t\t\t\t});\n\t\t\t\t// NextPriceOrderRemoved\n\t\t\t\tdecodedEventEqual({\n\t\t\t\t\tevent: 'NextPriceOrderRemoved',\n\t\t\t\t\temittedFrom: futuresMarket.address,\n\t\t\t\t\targs: [trader, roundId, size, roundId.add(toBN(1)), spotFee, keeperFee],\n\t\t\t\t\tlog: decodedLogs.slice(-1)[0],\n\t\t\t\t});\n\n\t\t\t\t// transfer more margin\n\t\t\t\tawait futuresMarket.transferMargin(margin, { from: trader });\n\t\t\t\t// and can submit new order\n\t\t\t\tawait futuresMarket.submitNextPriceOrder(size, { from: trader });\n\t\t\t\tconst newOrder = await futuresMarket.nextPriceOrders(trader);\n\t\t\t\tassert.bnEqual(newOrder.sizeDelta, size);\n\t\t\t}", "static function sendLossCheckChanges(messageContext : MessageContext, check : Check) {\n // the condition make sure that it will not go inside the loop only for these status\n // to avoid going into the loop every time the function is invoked\n if (check.Status == \"issued\" || check.Status == \"pendingtransfer\" || check.Status == \"stopped\" || check.Status == \"voided\") {\n for (exposure in check.Claim.Exposures) {\n if (exposure.ex_InSuit && exposure.State != \"draft\") {\n for (payment in check.Payments) {\n // check conditions above needs to be added again to include payment conditions\n if (!payment.New && payment.Exposure == exposure && payment.CostType == \"claimcost\"\n && (check.Status == \"issued\" || (check.Status == \"pendingtransfer\" && !payment.OffsetPayment)\n || check.Status == \"stopped\" || check.Status == \"voided\")) {\n send(messageContext, exposure);\n break;\n }\n }\n }\n }\n }\n }", "validate(){\n if(this.taskDate < Date.now()){\n throw new Error('The date cannot be in the past');\n }\n }", "function checkDate(){\n var testDate = new Date();\n var testMonth = testDate.getMonth() + 1;\n var testYear = testDate.getFullYear();\n daysInMonth = new Date(testYear, testMonth, 0).getDate();\t\t//returns the number of days in the current month\n daysInMonth = parseInt(daysInMonth);\n if(currentMonth != testMonth) {\t\t\t\t\t//If the current month does not match last recorded month. A new month has passed\n\tmonthlyTotal = 0;\n\tcurrentMonth = testMonth;\n\tdaysMetGoal = 0;\n\tupdateOLED();\n }\n var testDay = testDate.getDate();\n if(currentDay != testDay) {\t\t\t\t\t\t//If the current day does not match last recorded day. A new day has passed\n\ttotalWeight = 0;\n\tcurrentDay = testDay;\n\tprogress = 0;\n\tupdateOLED();\n }\n updateDatabase();\n}", "validateSysCheck() {\n const result = this.commonData.validateRange(this.$scope.agent.syscheck);\n this.$scope.agent.syscheck = result;\n }", "function checkStatus() {\n checkWin();\n checkLose();\n }", "failPomodoro () {\n this.currentTask.estimationFailed++;\n\n fireDataBase.setTask(this.currentTask.id, this.currentTask);\n }", "function mainProcess() {\n\n\tlogDebug(\"This process closes all ROW Permits that the warranty period due date is before .\" + compareDate + br);\n\n\tvar wfResult = aa.workflow.getTasks(\"Warranty Period\", \"Warranty Period\");\n\n\tif (wfResult.getSuccess()) {\n\t\tworkFlow = wfResult.getOutput();\n\t\tlogDebug(\"The number of ROW Permits in the Warranty Period: \" + workFlow.length + br);\n\t} else {\n\t\tlogDebug(\"ERROR: Retrieving permits: \" + wfResult.getErrorType() + \":\" + wfResult.getErrorMessage());\n\t\treturn false;\n\t}\n\n\tfor (wf in workFlow) {\n\t\t\n\t\tif (elapsed() > maxSeconds) { //only continue if time hasn't expired\n\t\t\tlogDebug(\"A script time out has caused partial completion of this process. Please re-run. \" + elapsed() + \n\t\t\t\" seconds elapsed, \" + maxSeconds + \" allowed.\");\n\t\t\ttimeExpired = true;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tb1WF = workFlow[wf];\n\t\tvar b1CapId = b1WF.getCapID();\n\t\tvar capId = aa.cap.getCapID(b1CapId.getID1(), b1CapId.getID2(), b1CapId.getID3()).getOutput();\n\t\tvar altId = capId.getCustomID();\n\t\tcap = aa.cap.getCap(capId).getOutput();\n\t\t\n\t\tif (cap) {\n\t\t\tvar appTypeResult = cap.getCapType();\n\t\t\tvar appTypeString = appTypeResult.toString();\n\t\t\tvar appTypeArray = appTypeString.split(\"/\");\n\t\t\t\n\t\t\tif(appTypeArray[0] == \"Permitting\" && appTypeArray[1] == \"Engineering\" && appTypeArray[2] == \"ROW\" && appTypeArray[3] == \"NA\") {\n\t\t\t\tvar dueDate = convertDate(b1WF.getDueDate());\n\t\t\t\tif (dueDate <= compareDate) {\n\t\t\t\t\tlogDebug(\"For Record \" + altId + \" the Due Date is: \" + dueDate);\n\t\t\t\t\t//closeTask(\"Warranty Period\",\"Warranty Expired\",\"Closed by batch process due to 3 year Warranty Expiration\",\"ROW Warranty Batch\",capId,\"ENGROWEXC\");\n\t\t\t\t\t//closeTask(\"Closed\",\"Closed\",\"Closed by batch process due to 3 year Warranty Expiration\",\"ROW Warranty Batch\",capId,\"ENGROWEXC\");\n\t\t\t\t\t//updateAppStatus(\"Closed\",\"Closed by batch process due to 3 year Warranty Expiration\", capId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\taa.sendMail(\"[email protected]\", emailAddress, elamSupport, \"ROW Permit Close Report\", emailText);\n}", "function updateMachineState() {\n\n var inArgs = updateMachineState.arguments;\n var result = new Result_customFunctionCommon();\n\n var return_value = 0;\n var errorCode = 0;\n var errorMessage = \"\";\n var conditionCode = \"PR\";\n var dateFrom = -1;\n var dateTo = -1;\n var comment = \"OPC_MACHINE_STATE_CHANNGE\";\n\n try {\n var tempOb = parseUpdateMachineState(inArgs);\n\n // API integration -----------------------------------------------------\n // ---------------------------------------------------------------------\n\n\n for (var i = 0; i < tempOb.IN_MACHINE_STATE_AR.length; i++) {\n var pos = tempOb.IN_MACHINE_STATE_AR[i].POSITION;\n var state = tempOb.IN_MACHINE_STATE_AR[i].STATE;\n tempOb.OUT_RESULT += \"\\n position : \" + pos + \" --- state : \" + state;\n for (var j = 1; j <= 2; j++) {\n var station = getStationId(tempOb.IN_STATION_NUMBER, ((pos - 1) * 2) + j).station\n tempOb.OUT_RESULT += \"\\n station : \" + station;\n // upload machine state\n if (state == \"true\") {\n conditionCode = \"PR\"; // Set condition code for productive time\n tempOb.OUT_RESULT += \"\\n CONDITION OK -- > PR\";\n }\n if (state == \"false\") {\n conditionCode = \"NA\"; // Set condition code for not assigned time\n tempOb.OUT_RESULT += \"\\n CONDITION OK -- > NA\";\n }\n // -----------------------------------------------------------------\n\n // < mdcGetStationConditions> --------------------------------------\n var conditionResultKeys = new Array(\"CONDITION_CODE\");\n\n var result_mdcGetStationConditions = imsApiService.mdcGetStationConditions(imsApiSessionContext,\n station,\n -1,\n -1,\n \"-1\",\n 1,\n conditionResultKeys);\n\n var return_value = result_mdcGetStationConditions.return_value;\n\n var CC = result_mdcGetStationConditions.conditionResultValues[0];\n\n //------------------------------------------------------------------\n\n if (((((CC == undefined) || (CC == \"PR\") || (CC == \"NA\")) && (conditionCode == \"NA\")) || (conditionCode == \"PR\")) ||\n\n (conditionCode == \"PR\")) {\n\n\n\n dateFrom = -1;\n dateTo = -1;\n\n // < mdcUploadStationCondition> ------------------------------------\n var stationConditionUploadKeys = new Array(\"BOOKING_TARGET\", \"CONDITION_CODE\", \"ERROR_CODE\", \"DATE_FROM\", \"DATE_TO\", \"TEXT\");\n var stationConditionUploadValues = new Array(0, conditionCode, 0, dateFrom, dateTo, comment);\n var result_uploadStationCondition = imsApiService.mdcUploadStationCondition(imsApiSessionContext,\n station,\n stationConditionUploadKeys,\n stationConditionUploadValues);\n\n var return_value = result_uploadStationCondition.return_value;\n\n if (return_value != 0) {\n\n errorCode = return_value;\n errorMessage = getImsApiErrorText(return_value);\n var resultData = {\n errorCode: errorCode,\n errorMessage: \"\" + errorMessage\n };\n\n //result.outArgs = [JSON.stringify(resultData)];\n //return result;\n }\n\n }\n\n }\n\n }\n\n // <End call> ----------------------------------------------------------\n\n\n // CF result -----------------------------------------------------------\n // ---------------------------------------------------------------------\n\n logHandler.logMessage(\"custom function OPC.updateMachineState finished.\");\n return resultUpdateMachineState(\"CF\", 0, \"PASS\", tempOb);\n\n } catch (e) {\n logHandler.logMessage(\"custom function OPC.updateMachineState failed: \" + e);\n result = new Result_customFunctionCommon();\n result.outArgs = new Array();\n result.outArgs = logHandler.getMessages();\n result.return_value = ItacMesErrorCodeApi.SERVER_ERROR.getReturnValue();\n result.errorString = ItacMesErrorCodeApi.SERVER_ERROR.getErrorString();\n return result;\n }\n}", "handleDueDateChanged(changeResults) {\n const alerts = {};\n let numSucceeded = 0;\n let numFailed = 0;\n\n const loans = this.loans();\n\n changeResults.forEach(result => {\n if (result.id) {\n // This is a loan object after a successful change\n alerts[result.id] = this.renderAlert(\n css.success,\n 'check-circle',\n 'success',\n 'stripes-smart-components.cddd.changeSucceeded'\n );\n numSucceeded++;\n } else {\n // This date change attempt failed.\n const putEndpoint = '/circulation/loans/';\n const failedLoanId = result.url.split(putEndpoint)[1];\n\n const errorMessage = getErrorMessage(loans, failedLoanId);\n\n alerts[failedLoanId] = this.renderAlert(\n css.warn,\n 'exclamation-circle',\n 'failure',\n errorMessage\n );\n numFailed++;\n }\n });\n\n this.setState({\n succeeded: true,\n resultCounts: {\n numSucceeded,\n numFailed,\n },\n alerts,\n });\n\n ChangeDueDateDialog.fetchData(this.props);\n }", "function checkPowerEfficiencyStatus(powerEfficiencyData) {\r\n if (!powerEfficiencyData) {\r\n return;\r\n }\r\n\r\n var totalPowerEfficiencyAvg = calTotalPowerEfficiencyAvg(powerEfficiencyData.datasets[0].data);\r\n dashVM.powerEfficiencyGaugeOptions.value = totalPowerEfficiencyAvg;\r\n powerEfficiencyData.labels.push(\"Total\");\r\n powerEfficiencyData.datasets[0].data.push(totalPowerEfficiencyAvg);\r\n\r\n if (!powerEfficiencyData.labels) {\r\n return;\r\n }\r\n\r\n var currentDate = new Date();\r\n for (var deviceIndex = 0; deviceIndex < powerEfficiencyData.labels.length; deviceIndex++) {\r\n if (powerEfficiencyStatusList.length < deviceIndex + 1) {\r\n var powerEfficiencyStatus = {\r\n device: powerEfficiencyData.labels[deviceIndex],\r\n warningDate: null,\r\n errorDate: null,\r\n alarmCode: -1\r\n }\r\n\r\n powerEfficiencyStatusList.push(powerEfficiencyStatus);\r\n }\r\n\r\n if (powerEfficiencyData.datasets[0].data[deviceIndex] < threshold2) {\r\n if (!powerEfficiencyStatusList[deviceIndex].warningDate) {\r\n powerEfficiencyStatusList[deviceIndex].warningDate = new Date(currentDate.getTime());\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = -1;\r\n } else {\r\n if (Math.floor((currentDate.getTime() - powerEfficiencyStatusList[deviceIndex].warningDate.getTime())\r\n / 60000) > thresholdCheckTime) {\r\n powerEfficiencyStatusList[deviceIndex].warningDate = new Date(currentDate.getTime());\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = 1;\r\n } else {\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = -1;\r\n }\r\n }\r\n\r\n if (powerEfficiencyData.datasets[0].data[deviceIndex] < threshold1) {\r\n if (!powerEfficiencyStatusList[deviceIndex].errorDate) {\r\n powerEfficiencyStatusList[deviceIndex].errorDate = new Date(currentDate.getTime());\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = -1;\r\n } else {\r\n if (Math.floor((currentDate.getTime() - powerEfficiencyStatusList[deviceIndex].errorDate.getTime())\r\n / 60000) > thresholdCheckTime) {\r\n powerEfficiencyStatusList[deviceIndex].errorDate = new Date(currentDate.getTime());\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = 2;\r\n } else {\r\n powerEfficiencyStatusList[deviceIndex].alarmCode = -1;\r\n }\r\n }\r\n } else {\r\n powerEfficiencyStatusList[deviceIndex].errorDate = null;\r\n }\r\n } else {\r\n powerEfficiencyStatusList[deviceIndex].warningDate = null;\r\n }\r\n }\r\n\r\n for (var statusIndex = 0; statusIndex < powerEfficiencyStatusList.length; statusIndex++){\r\n var powerEfficiencyStatusRow = null;\r\n var isAlarmOccured = false;\r\n if (powerEfficiencyStatusList[statusIndex].warningDate) {\r\n if (powerEfficiencyStatusList[statusIndex].alarmCode == 1) {\r\n powerEfficiencyStatusRow = {\r\n device: powerEfficiencyStatusList[statusIndex].device,\r\n date: powerEfficiencyStatusList[statusIndex].warningDate,\r\n alarmCode: powerEfficiencyStatusList[statusIndex].alarmCode\r\n }\r\n\r\n isAlarmOccured = true;\r\n }\r\n\r\n if (powerEfficiencyStatusList[statusIndex].errorDate) {\r\n if (powerEfficiencyStatusList[statusIndex].alarmCode == 2) {\r\n powerEfficiencyStatusRow = {\r\n device: powerEfficiencyStatusList[statusIndex].device,\r\n date: powerEfficiencyStatusList[statusIndex].errorDate,\r\n alarmCode: powerEfficiencyStatusList[statusIndex].alarmCode\r\n }\r\n\r\n isAlarmOccured = true;\r\n }\r\n }\r\n\r\n\r\n if (isAlarmOccured == true) {\r\n // Send powerEfficiencyStatusRow\r\n dashVM.alarmSummaryCount++;\r\n $rootScope.$broadcast('addAlarmMessageEvent', powerEfficiencyStatusRow);\r\n }\r\n }\r\n\r\n if (powerEfficiencyStatusList[statusIndex].alarmCode == 0) {\r\n /* XXX */\r\n }\r\n }\r\n}", "validate() {\n let status = true;\n\n status = !this._validateLocalId() ? false : status;\n status = !this._validateUniqueWorkerId() ? false : status;\n status = !this._validateChangeUniqueWorkerId() ? false : status;\n status = !this._validateDisplayId() ? false : status;\n status = !this._validateStatus() ? false : status;\n status = !this._validateDaysSickChanged() ? false : status;\n\n // only continue to process validation, if the status is not UNCHECKED, DELETED OR UNCHANGED\n if (!STOP_VALIDATING_ON.includes(this._status)) {\n status = !this._validateContractType() ? false : status;\n status = !this._validateNINumber() ? false : status;\n status = !this._validatePostCode() ? false : status;\n status = !this._validateDOB() ? false : status;\n status = !this._validateGender() ? false : status;\n status = !this._validateEthnicity() ? false : status;\n status = !this._validateNationality() ? false : status;\n status = !this._validateCitizenShip() ? false : status;\n status = !this._validateCountryOfBirth() ? false : status;\n status = !this._validateYearOfEntry() ? false : status;\n status = !this._validateDisabled() ? false : status;\n status = !this._validateCareCert() ? false : status;\n status = !this._validateRecSource() ? false : status;\n status = !this._validateStartDate() ? false : status;\n status = !this._validateStartInsect() ? false : status;\n status = !this._validateApprentice() ? false : status;\n status = !this._validateZeroHourContract() ? false : status;\n status = !this._validateDaysSick() ? false : status;\n status = !this._validateSalaryInt() ? false : status;\n status = !this._validateSalary() ? false : status;\n status = !this._validateHourlyRate() ? false : status;\n status = !this._validateMainJobRole() ? false : status;\n status = !this._validateMainJobDesc() ? false : status;\n status = !this._validateContHours() ? false : status;\n status = !this._validateAvgHours() ? false : status;\n status = !this._validateRegisteredNurse() ? false : status;\n status = !this._validateNursingSpecialist() ? false : status;\n status = !this._validationQualificationRecords() ? false : status;\n status = !this._validateSocialCareQualification() ? false : status;\n status = !this._validateNonSocialCareQualification() ? false : status;\n status = !this._validateAmhp() ? false : status;\n }\n\n return status;\n }", "cellActionsDisabledBecause() {\n if (this.state.selectLogicalOperatorsUpFront === true\n && this.state.logicalOperatorsSelected === false) {\n return 'Select Logical Operators First';\n }\n\n if (this.state.activeBoardId === null\n || this.state.activeBoardId === -1) {\n return 'Error: No Active Board';\n }\n\n if (this.isTerminalNode(this.state.activeBoardId) === false) {\n return 'This board has already been acted upon';\n }\n\n if (this.state.selectedBoardSquare === null) {\n return 'You must select a square or some logical operators';\n }\n\n return 'ERROR: No reason given for disabled actions';\n }", "getCorruption() {\n return this.state.cursor().get( 'corruption' )\n }", "function Cancellation() { }", "calculateDaysHaveLeft(){\n\t \n\t /*based on the current case's status, the daysHaveLeft case's attribute is updated from the daysUsed attribute minus the alloted time to complete the status.*/\n\t cases.forEach(function(files, index){\n switch(files.status){\n \t\tcase \"Waiting on letter from patron\":\n cases[index].daysHaveLeft = 30 - files.daysUsed;\n\t\t\t\tbreak;\n case \"Active\":\n \tcases[index].daysHaveLeft = 10 - files.daysUsed;\n\t\t\t\tbreak;\n \t\tcase \"On supervisor's desk\":\n cases[index].daysHaveLeft = 3 - files.daysUsed;\n\t\t\t\tbreak;\n case \"Corrections or Reinvestigate\":\n \tcases[index].daysHaveLeft = 3 - files.daysUsed;\n\t\t\t\tbreak;\n \t\tcase \"On director's desk\":\n cases[index].daysHaveLeft = 10 - files.daysUsed;\n\t\t\t\tbreak;\n case \"Waiting on patron decision\":\n \tcases[index].daysHaveLeft = 30 - files.daysUsed;\n\t\t\t\tbreak;\n \t\tcase \"Sign and close out\":\n cases[index].daysHaveLeft = 3 - files.daysUsed;\n\t\t\t\tbreak;\n \t\tcase \"To be Filed\":\n cases[index].daysHaveLeft = 1 - files.daysUsed;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tconsole.log(\"Error\");\n\n }//end of switch statement\n\t });//end of forEach statement\n }", "function incFail(){\r\n\"use strict\";\r\ncheck();\r\nif(valid==true){\r\n\tnumFail++;\r\n\tnumTotalRuns++;\r\n\tcalc();\r\n\tcosts();\r\n\tupdate();\r\n\t}\r\n}", "function expectStatesSharedUnsettled(ae) {\n\n expect(ae.isFinished).toBe(false);\n expect(ae.isSettled).toBe(false);\n expect(ae.isRejected).toBe(false);\n expect(ae.isCanceled).toBe(false);\n expect(ae.isFailed).toBe(false);\n expect(ae.isDone).toBe(false);\n\n expect(ae.result).toBe(undefined);\n expect(ae.error).toBe(null);\n }", "undo(nothrow) {\n let okay= false;\n const act= this.applied.pop(nothrow);\n if (act) {\n this.revoked.push(act).revoke(this.vm);\n --this.changed; // negative is okay.\n okay= true;\n }\n return okay;\n }", "infectionByRequestedTime() {\n const factor = this.powerFactor();\n return this.currentlyInfected() * 2 ** factor;\n }", "destroy(currentYear){\n let messageForThrow =\"The book thrown out if it is over 5 years old\";\n let total = currentYear-this.copyrightDate;\n if(total > 5){\n this.hasBeenDiscarded = \"yes \"+messageForThrow;\n }else{\n this.hasBeenDiscarded =\"No\";\n }\n return this.hasBeenDiscarded+\", years:\"+total;\n }", "function finallyActions () {\n status_.responded = new Date().getTime();\n status_.totalWaiting += (status_.responded - status_.requested);\n }", "function minus() {\n _runningTotal += Number.parseInt($scope.previousButton) - Number.parseInt($scope.currentButton);\n }", "function WorkflowDetermination(par,wValues,dKeys,wLastRow) {\n\n\n var workflowObj = new UpdateWorkflowObject().setState(0)\n .setStatus('In Process');\n /* Never know when you'll need those loggers... \n Logger.log('MY WORKFLOW OBJECT -> '+JSON.stringify(workflowObj));\n Logger.log('My Parameters : '+JSON.stringify(par));\n Logger.log('My workflow Values : '+wValues);\n Logger.log('My key Values : '+dKeys);\n Logger.log('My last row : '+wLastRow);\n */\n \n \n var workOrder = new Array();\n var workflowSteps = new Array();\n \n \n //valid workflow states are 'Approved', 'Rejected', 'In Process'.\n //valid workflow step states are 'Approved', 'Rejected', 'Active' and 'Pending'.\n \n var ss = SpreadsheetApp.openById(ssKey);\n var tSheet = ss.getSheetByName('Tests');\n var tRange = tSheet.getDataRange();\n var tValues = tRange.getValues();\n var tLastRow = tRange.getLastRow();\n \n \n \n for (var i = 1; i < wLastRow; i++) {\n \n var thisStateTest = wValues [i][3];\n var addState = true;\n \n var tAddState = true;\n \n for (var j = 1; j < tLastRow; j++) {\n \n var thisTest = tValues[j][0];\n Logger.log('Test from workflows : '+thisStateTest);\n Logger.log('Test from Tests : '+thisTest);\n Logger.log('Is it a test? : '+tValues[j][1]);\n \n if (thisStateTest == thisTest && tValues[j][1] == 'Test') {\n \n \n \n \n var operator = tValues[j][3];\n var testAndOr = tValues[j][5];\n //Logger.log(operator+'--'+testAndOr);\n \n switch (operator) {\n \n case '=':\n //Logger.log('Compare : '+par[tValues[j][2]]+' <-> '+tValues[j][4]);\n if (par[tValues[j][2]] !== tValues[j][4]) {\n //Logger.log('Test Passed!');\n tAddState = false;\n }\n break;\n case '<>':\n if (par[tValues[j][2]] == tValues[j][4]) {\n tAddState = false;\n }\n break;\n default:\n tAddState = true;\n break;\n \n }\n \n }\n /*\n Logger.log('Add State : '+addState);\n Logger.log('Test to Add State : '+tAddState);\n */\n \n if (tAddState == false) {addState = false;}\n }\n /*\n Logger.log('After: Add State : '+addState);\n Logger.log('After: Test to Add State : '+tAddState);\n */\n if (addState == true) {\n \n var curState = wValues[i][0];\n var workflowStep = new UpdateWorkflowStep().setStepState(curState)\n .setStepStatus('Pending');\n var json1 = JSON.stringify(workflowStep);\n \n workflowSteps.push(json1);\n \n \n workOrder.push(wValues[i][0]);\n \n }\n \n workflowObj.setWorkflow(workOrder)\n .setWorkflowSteps(workflowSteps);\n \n } \n \n return workflowObj;\n \n}", "compute() {\n const prev = parseFloat(this.previousOperand);\n const current = parseFloat(this.currentOperand);\n const operations = {\n '+': prev + current,\n '-': prev - current,\n '*': prev * current,\n '/': prev / current\n }\n \n if (this.isEqualPressedAgain) {\n this.previousResult = this.currentOperand;\n this.currentOperand = this.performSameCalculation();\n }\n\n if (isNaN(prev) || isNaN(current)) return;\n this.currentOperand = this.checkForErrors(current, prev, operations);\n this.previousOperation = this.operation;\n this.operation = undefined;\n this.previousOperand = '';\n }", "toolop_cancel(op: ToolOp, executeUndo: boolean) {\n if (executeUndo === undefined) {\n console.warn(\"Warning, executeUndo in toolop_cancel() was undefined\");\n }\n\n if (executeUndo) {\n this.undo();\n } else {\n if (this.undostack.indexOf(op) >= 0) {\n this.undostack.remove(op);\n this.undocur--;\n }\n }\n }", "destroy(checkedOutOverTimes){\n let messageForThrow = \"The book should be thrown out if it has been checked out over 100 times\";\n this.numberOfTimesCheckedOut += checkedOutOverTimes;\n if(this.numberOfTimesCheckedOut > 100){\n this.numberOfTimesCheckedOut = \"yes \"+messageForThrow;\n }else{\n this.numberOfTimesCheckedOut =\"No\";\n }\n return this.numberOfTimesCheckedOut;\n }", "getNextDisabled() {\n let data = this.state.data.slice();\n let planReqs = this.state.currentPlan.requirements;\n let extras = data.filter(item => !planReqs.includes(item.code));\n let expired = extras.every(req => {\n return req.timeRemaining === 0;\n })\n return ((this.state.data.length - this.state.currentPlan.requirements.length) === 0 || this.state.elapsedTime === 5 || expired) ? true : false;\n }", "canceled() {}", "checkAndCompute( operation ) {\n if(this.currentOperand === '' ) return \n if(this.previousOperand !== '') { //check the previous operand is not empty\n this.compute() ;\n }\n this.operation = operation ;\n this.previousOperand = this.currentOperand ; //append the value in previousOperand\n this.currentOperand = '' ;\n \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 }", "function subtracttest(v1, v2, expected) {\n results.total++;\n var r = calculator.subtraction(v1, v2);\n if (r !== expected) {\n results.bad++;\n console.log(\"Expected \" + expected +\n \", but was \" + r);\n }\n }", "function checkOweing(value) {\n if (changeAmountDue >= machineCoinInventory[value].value) {\n changeCoinsDue[value].stock = Math.floor(changeAmountDue / machineCoinInventory[value].value);\n changeAmountDue -=\n machineCoinInventory[value].value *\n Math.floor(changeAmountDue / machineCoinInventory[value].value);\n } else {\n changeCoinsDue[value].stock = 0;\n }\n }", "needsInspection() {\n return this.specialActionNeeded || new Date().getFullYear() - this.yearLastInspected > 10;\n }", "function rollbackcompare(){\r\n\tcreatecomparemart();\r\n}", "async action(crypto, dataPeriods, currentBitcoinPrice) {\n // let stopped = this.stopLoss(0.1);\n // if (stopped) return;\n\n // stopped = this.takeProfit(this.takeProfitRatio);\n // if (stopped) return;\n\n let ema = await this.getEMA(dataPeriods);\n let currEMA = ema[ema.length - 1];\n\n var diff = (currentBitcoinPrice / currEMA * 100) - 100;\n\n if (!this.isInTrade()) {\n let bigDown = diff < -this.adaptativeDownTrigger();\n if (bigDown) {\n // BUY condition\n this.timeInTrade = 0;\n return this.buy();\n } else {\n return this.hold();\n }\n } else {\n this.timeInTrade++;\n let objectivePrice = this.getObjective();\n let bigUp = diff > this.adaptativeUpTrigger();\n if (currentBitcoinPrice > objectivePrice || bigUp) {\n return this.sell();\n } else {\n return this.hold();\n }\n }\n }", "function date_Of_Ceased(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true\r\n\t\r\n\tif (!check_allowed_char(input, \"dateOfCeased\", \"conf1\")){\r\n\t\terror = \"E36_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t//if (!presence_check(input)){\r\n\t//\terror = \"E31_2\"\r\n\t\t//result.flgname.push(flags[error].name);\r\n\t\t//result.flgflag.push(flags[error].flag);\r\n\t\t//result.flgvalue.push(flags[error].value);\r\n\t\t//result.flgmsg.push(flags[error].msg);\r\n\t\t//}\r\n\tif (check_req_char(input, \"dateOfCeased\", \"conf1\")){\r\n\t\terror = \"E36_3\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function btnCheckCancel() {\r\n\t\tvar sm = arrivalOrderGrid.getSelectionModel();\r\n\t\tvar selected = sm.getSelections();\r\n\t\tvar modifyRec = arrivalOrderGrid.getStore().getModifiedRecords();\r\n\t\tvar updateData = new Array();\r\n\t\tif (selected.length == 0) {\r\n\t\t\tExt.Msg.alert(\"提示\", \"请选择要取消审核的记录!\");\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < selected.length; i += 1) {\r\n\t\t\t\tvar member = selected[i].data;\r\n\t\t\t\tif (member) {\r\n\t\t\t\t\tvar data = [];\r\n\t\t\t\t\tupdateData.push(member.purNo);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tExt.Msg.confirm(\"取消审核\", \"是否确定取消审核?\", function(buttonobj) {\r\n\t\t\t\tif (buttonobj == \"yes\") {\r\n\t\t\t\t\tExt.Ajax.request({\r\n\t\t\t\t\t\turl : 'resource/cancelCheckArrivalBillList.action',\r\n\t\t\t\t\t\tmethod : 'post',\r\n\t\t\t\t\t\tparams : {\r\n\t\t\t\t\t\t\tcheckData : Ext.util.JSON.encode(updateData)\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tsuccess : function(result, request) {\r\n\t\t\t\t\t\t\tvar o = eval('(' + result.responseText + ')');\r\n\t\t\t\t\t\t\tExt.MessageBox.alert('提示信息', \"取消审核成功!\");\r\n\t\t\t\t\t\t\t// 取消审核成功后刷新\r\n\t\t\t\t\t\t\t// queryArrivalOrder();\r\n\t\t\t\t\t\t\tarrivalOrderStore.reload();\r\n\t\t\t\t\t\t\tdetailPanel.getForm().reset();\r\n\t\t\t\t\t\t\trightStore.removeAll();\r\n\r\n\t\t\t\t\t\t},\r\n\t\t\t\t\t\tfailure : function(result, request) {\r\n\t\t\t\t\t\t\tExt.MessageBox.alert('提示信息', '未知错误!')\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t})\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}\r\n\t}", "async function checkExecution(from, targetPrice, feeRate, spotTradeDetails) {\n\t\t\t\tconst currentMargin = (await futuresMarket.positions(trader)).margin;\n\t\t\t\t// excute the order\n\t\t\t\tconst tx = await futuresMarket.executeNextPriceOrder(trader, { from: from });\n\n\t\t\t\t// check order is removed now\n\t\t\t\tconst order = await futuresMarket.nextPriceOrders(trader);\n\t\t\t\tassert.bnEqual(order.sizeDelta, 0);\n\t\t\t\tassert.bnEqual(order.targetRoundId, 0);\n\t\t\t\tassert.bnEqual(order.commitDeposit, 0);\n\t\t\t\tassert.bnEqual(order.keeperDeposit, 0);\n\n\t\t\t\t// The relevant events are properly emitted\n\t\t\t\tconst decodedLogs = await getDecodedLogs({ hash: tx.tx, contracts: [sUSD, futuresMarket] });\n\n\t\t\t\tlet expectedRefund = commitFee; // at least the commitFee is refunded\n\t\t\t\tif (from === trader) {\n\t\t\t\t\t// trader gets refunded keeperFee\n\t\t\t\t\texpectedRefund = expectedRefund.add(keeperFee);\n\t\t\t\t\t// no event for keeper payment\n\t\t\t\t\tassert.equal(decodedLogs.length, 5);\n\t\t\t\t\t// funding, position(refund), issued (exchange fee), position(trade), order removed\n\t\t\t\t} else {\n\t\t\t\t\t// keeper gets paid\n\t\t\t\t\tassert.equal(decodedLogs.length, 6);\n\t\t\t\t\t// keeper fee, funding, position(refund), issued (exchange fee), position(trade), order removed\n\t\t\t\t\tdecodedEventEqual({\n\t\t\t\t\t\tevent: 'Issued',\n\t\t\t\t\t\temittedFrom: sUSD.address,\n\t\t\t\t\t\targs: [from, keeperFee],\n\t\t\t\t\t\tlog: decodedLogs[0],\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\t// trader was refunded correctly\n\t\t\t\t// PositionModified\n\t\t\t\tlet expectedMargin = currentMargin.add(expectedRefund);\n\t\t\t\tconst currentPrice = (await futuresMarket.assetPrice()).price;\n\t\t\t\tdecodedEventEqual({\n\t\t\t\t\tevent: 'PositionModified',\n\t\t\t\t\temittedFrom: futuresMarket.address,\n\t\t\t\t\targs: [toBN('1'), trader, expectedMargin, 0, 0, currentPrice, toBN(2), 0],\n\t\t\t\t\tlog: decodedLogs.slice(-4, -3)[0],\n\t\t\t\t});\n\n\t\t\t\t// trade was executed correctly\n\t\t\t\t// PositionModified\n\t\t\t\tconst expectedFee = multiplyDecimal(size, multiplyDecimal(targetPrice, feeRate));\n\n\t\t\t\t// calculate the expected margin after trade\n\t\t\t\texpectedMargin = spotTradeDetails.margin\n\t\t\t\t\t.add(spotTradeDetails.fee)\n\t\t\t\t\t.sub(expectedFee)\n\t\t\t\t\t.add(expectedRefund);\n\n\t\t\t\tdecodedEventEqual({\n\t\t\t\t\tevent: 'PositionModified',\n\t\t\t\t\temittedFrom: futuresMarket.address,\n\t\t\t\t\targs: [toBN('1'), trader, expectedMargin, size, size, targetPrice, toBN(2), expectedFee],\n\t\t\t\t\tlog: decodedLogs.slice(-2, -1)[0],\n\t\t\t\t});\n\n\t\t\t\t// NextPriceOrderRemoved\n\t\t\t\tdecodedEventEqual({\n\t\t\t\t\tevent: 'NextPriceOrderRemoved',\n\t\t\t\t\temittedFrom: futuresMarket.address,\n\t\t\t\t\targs: [trader, roundId, size, roundId.add(toBN(1)), commitFee, keeperFee],\n\t\t\t\t\tlog: decodedLogs.slice(-1)[0],\n\t\t\t\t});\n\n\t\t\t\t// transfer more margin\n\t\t\t\tawait futuresMarket.transferMargin(margin, { from: trader });\n\t\t\t\t// and can submit new order\n\t\t\t\tawait futuresMarket.submitNextPriceOrder(size, { from: trader });\n\t\t\t\tconst newOrder = await futuresMarket.nextPriceOrders(trader);\n\t\t\t\tassert.bnEqual(newOrder.sizeDelta, size);\n\t\t\t}", "isCancelAfterEnd() {\n return this.state.value > 1000000;\n }", "cancelTransaction(event) {\n if (this.retroDateValuesFinal != []) {\n revertRetroDatesOnly({ selectedCareAppId: this.careApplicationId })\n this.isModalOpen = event.detail.showParentModal;\n this.bReasonCheck = false;\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n } else {\n this.bReasonCheck = false;\n this.isModalOpen = event.detail.showParentModal;\n this.reasonValueChange = '';\n this.bShowConfirmationModal = event.detail.showChildModal;\n this.bFormEdited = false;\n }\n }", "function checkActsConsistency(){\n checkConsistency(Action.ACTS);\n //set expections\n verifyCondition = true;\n expectations = Expect.AFTER_ACTS;\n }", "redo(nothrow) {\n let okay= false;\n const act= this.revoked.pop(nothrow);\n if (act) {\n this.applied.push(act).apply(this.vm);\n ++this.changed;\n okay= true;\n }\n return okay;\n }", "function date_Of_Ceased(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true\r\n\t\r\n\tif (!check_allowed_char(input, \"dateOfCeased\", \"conf1\")){\r\n\t\terror = \"E36_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t//if (!presence_check(input)){\r\n\t//\terror = \"E31_2\"\r\n\t\t//result.flgname.push(flags[error].name);\r\n\t\t//result.flgs.push(flags[error].flag);\r\n\t\t//result.flgvalue.push(flags[error].value);\r\n\t\t//result.flgmsg.push(flags[error].msg);\r\n\t\t//}\r\n\tif (check_req_char(input, \"dateOfCeased\", \"conf1\")){\r\n\t\terror = \"E36_3\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function CheckOp(op) {\n //si el campo no esta vacio\n if (Number(tfInput.value) || tfInput.value === \"0\") {\n if (cOperador) {//a partir del segundo dato\n numActual = Number(tfInput.value);\n strOperacion += cOperador + String(numActual);\n igual();\n cOperador = op;\n numPrevio = numAcumulado;\n }\n else {//primer dato\n numPrevio = Number(tfInput.value);\n strOperacion += numPrevio;\n cOperador = op;\n }\n limpiaTF();\n }\n}", "unscheduleChecks()\n {\n if (this._timeout)\n {\n clearTimeout(this._timeout); // eslint-disable-line no-undef\n this._timeout = 0;\n }\n }", "static test02() {\n let cal = new Calc();\n cal.receiveInput(2);\n cal.receiveInput(Calc.OP.MINUS);\n cal.receiveInput(7);\n cal.receiveInput(Calc.OP.EQ);\n return cal.getDisplayedNumber() === 2 - 7;\n }", "function cmdUpdateReceived_ClickCase100() {\n console.log(\"cmdUpdateReceived_ClickCase100\");\n //fetch WO summary\n GenerateWOSummary();\n //fetch WO summary - scrap + unaccountable qty\n GenerateWOSummaryScrap();\n if ($scope.McType.toLowerCase() == \"inhouse\" || String($scope.McType).trim().toLowerCase() == \"automated\") {\n console.log(\"cmdUpdateReceived_ClickCase100.1\");\n // CheckWOOpnStatus();\n ReCheck($scope.selectedWOID);\n } else {\n console.log(\"cmdUpdateReceived_ClickCase100.2\");\n // CheckSubconWOOpnStatus();\n ReCheck($scope.selectedWOID);\n }\n\n\n }", "function tc_check_tests_due_tab()\n{ \n try\n {\n var test_title = 'Patient tests due - Check tests due tab'\n login('cl3@regression','INRstar_5','Shared');\n add_patient('Regression', 'tests_due', 'M', 'Shared'); \n add_treatment_plan('W','Hillingdon','','Shared','');\n add_historic_treatment(aqConvert.StrToDate(aqDateTime.AddDays(aqDateTime.Today(), (-7))), \"2.0\", \"2.0\", \"0\", \"7\", \"2.5\");\n\n var pat_name = get_patient_fullname();\n var tests_due_list_patient = get_tests_due_patient(pat_name);\n \n results_checker(tests_due_list_patient,test_title); \n Log_Off();\n }\n catch (e)\n {\n Log.Warning('Test \"' + test_title + '\" FAILED Exception Occured = ' + e);\n Log_Off(); \n }\n}", "function cancelOrderError() {\n\t $scope.editOrder.cancelling = false;\n\n\t if (!$scope.offers[$scope.editOrder.seq]) {\n\t $rootScope.load_notification('cancel_order_gone');\n\t $scope.cancelOrder.seq = null;\n\t }\n\t }", "function doExpiredAuditProduct(client,data)\n{\n\tglobal.ConsoleLog(\"doExpiredAuditProduct\");\n\treturn new Promise((resolve,reject) => {\n\t\tconst shouldAbort = err => {\n\t\t\tif (err) {\n\t\t\t\tconsole.error('Error in transaction', err.stack);\n\t\t\t\tclient.query('ROLLBACK', err => {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tconsole.error('Error rolling back client', err.stack);\n\t\t\t\t\t}\n\t\t\t\t\t// release the client back to the pool\n\t\t\t\t\t//done();\n\t\t\t\t});\n\n\t\t\t\treject(err.message);\n\t\t\t}\n\t\t\treturn !!err;\n\t\t};\n\n\t\tclient.query('BEGIN', err =>{\n\t\t\tif (shouldAbort(err)) \n\t\t\t{\n\t\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tlet updatesql = 'UPDATE scanapp_testing_audit '+\n\t\t\t\t\t\t\t\t'SET dateexpired=now() '+\n\t\t\t\t\t\t\t\t'WHERE dateexpired is null AND userscreated_id = $1 and products_id = $2 returning id';\n\t\t\t\tlet params = [\n\t\t\t\t\tdata.user_id,\n\t\t\t\t\t__.sanitiseAsBigInt(data.productid),\t\n\t\t\t\t];\n\t\t\t\tglobal.ConsoleLog(updatesql);\n\t\t\t\tglobal.ConsoleLog(params);\n\t\t\t\tclient.query(updatesql, params, (err, result) => {\n\t\t\t\t\tif (shouldAbort(err)) return;\n\t\t\t\t\tglobal.ConsoleLog(updatesql);\n\t\t\t\t\tglobal.ConsoleLog(params);\n\t\t\t\t\tglobal.ConsoleLog(err);\n\t\t\t\t\tglobal.ConsoleLog(result);\n\t\t\t\t\tclient.query('COMMIT', err => {\n\t\t\t\t\t\t// done();\n\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\tconsole.error('Error committing transaction', err.stack);\n\t\t\t\t\t\t\treject(err);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t//global.ConsoleLog(result.rows[0]['datefinished']);\n\t\t\t\t\t\t\t//result.rows[0]['datefinished'] = global.moment(result.rows[0]['datefinished']).format('YYYY-MM-DD HH:mm');\n\t\t\t\t\t\t\t// let datefinished = global.moment(result.rows[0]['datefinished']).format('YYYY-MM-DD HH:mm');\n\t\t\t\t\t\t\t// global.ConsoleLog(datefinished);\n\t\t\t\t\t\t\tglobal.ConsoleLog(result.rows)\n\t\t\t\t\t\t\tif(result.rows.length == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tresolve({errorcode:0});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// else\n\t\t\t\t\t\t\t// {\n\t\t\t\t\t\t\t// \treject({errorcode:1,message:global.text_unablegetuserauthdetails});\n\t\t\t\t\t\t\t// }\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t\t\n\t\t});\n\t\n\t});\n}", "function calculate_overdue(item) {\n return (Date.now()-Date.parse(item.available_at))/(1000*60*60)/srs_intervals[item.srs];\n }", "function pastDueCheck() {\n var curDate = new Date(); // Initializes a date\n var curTime = (curDate.getTime()/1000); // Gets current date/time as unix timestamp in seconds (divided by 1000 as unix is in milliseconds)\n \n // Sets up current task list variables\n var curTaskLast = currentTasks.getLastRow(); // Sets curTaskLast as the last occupied row in the currentTasks sheet\n var curTaskArrTemp = currentTasks.getRange(2,1,curTaskLast-1,1).getDisplayValues(); // Makes a temp array of values. -1 to account for occupied first row\n var curTaskArr = []; // Sets curTaskArr as a blank array\n for(i in curTaskArrTemp){curTaskArr.push(curTaskArrTemp[i][0]);} // Populates curTaskArr with values from temp array. getValues returns an array of arrays that is difficult to work with, so pulling the values into an array makes it easier\n\n var pastDue = 0 // Initializes past due jobs\n for(i in curTaskArr){ // Loops over curTasksArr\n var split = curTaskArr[i].split(\" \"); // splits the by the space, ex. \"7:30 AM\" becomes [7:30, AM]\n var splitTwo = split[0].split(\":\"); // splits the previous split by the colon, creating [7, 30]\n var jobDate = new Date(curDate.getFullYear(), curDate.getMonth(), curDate.getDate(), splitTwo[0], splitTwo[1]); // Sets up a JS date object using the current date and the time previously split out\n split[1] == \"PM\" ? jobDate.setHours(jobDate.getHours() + 12) : jobDate = jobDate // if the job time was PM, it adds 12 hours to the date object. This is a ternary operator, basically an if statements. The dueDate = dueDate was just to fill out the right side of the colon, otherwise it didn't work\n if(curDate.getHours() >= 12 && split[1] == \"AM\"){jobDate.setDate(jobDate.getDate() + 1)} // Checks if the current time is PM (>= 12 hours in 24 hour) and the time of the job is AM. If so, it increments the job date by 1 from the current date. This negates false positives if the script is checking jobs in the PM that are due the next day AM.\n var jobTime = (jobDate.getTime()/1000); // Gets the jobTime as a unix time stamp in seconds (divided by 1000 as unix is in milliseconds)\n (curTime - jobTime) > 3600 ? pastDue++ : pastDue = pastDue // Checks if the job is over one hour old (3600 seconds), if so, increments pastDue by one\n }\n \n if(pastDue > 0){sendEmail(pastDue)} // If pastDue is over 0, calls sendEmail with the number of past due jobs\n \n}", "fold() {\n this.status = -1;\n }", "computeAction() {\n if (this.controls.left || this.controls.right) {\n this.action = 2;\n } else {\n this.action = 0;\n }\n if (!this.grounded) {\n this.action = 4;\n }\n if (this.onSkate) {\n this.action = 6;\n if (this.holdingJump) {\n this.action = 8;\n if (this.holdingJump > 15) {\n if (this.holdingJump < 15 + dT) {\n this.frame = 0;\n this.frameCounter = 0;\n }\n this.action = 10;\n }\n } else if (this.xVel == 0 && !this.uncontrollable) {\n this.frame = 0;\n this.frameCounter = 0;\n }\n if (flash > 0) {\n this.action = 12;\n }\n }\n\n if (this.saving) {\n this.action = 14;\n this.baseSlowness = 10;\n if (this.frame == this.actionX[this.action].length - 1 && this.frameCounter > this.baseSlowness * dT - 1 * dT) {\n this.saving = false;\n this.uncontrollable = false;\n this.baseSlowness = 4;\n }\n }\n }", "function condition() {\n verbose(`waitQuery`, `condition: current ${currentCount} expected ${count} done: ${!(currentCount != count)}`);\n return currentCount != count;\n }", "function validateExpritation() {\n const expirationDate = store.getters.getExpDate\n const now = new Date()\n if (now.getTime() > expirationDate.getTime()) {\n // Emit an alert to main Vue component\n // EventBus.$emit('token-expired')\n store.dispatch('logOut')\n }\n}", "left(){\n this.save();\n this.x--;\n this.isConflict();\n }", "function operate() {\n var matrix = this.matrix,\n dataProvider = this.dataProvider;\n matrix.cellReferences.length = 0;\n (0, _array.arrayEach)(matrix.data, function (cell) {\n cell.setState(_value.default.STATE_OUT_OFF_DATE);\n cell.clearPrecedents();\n var row = cell.row,\n column = cell.column;\n var value = dataProvider.getSourceDataAtCell(row, column);\n\n if ((0, _utils.isFormulaExpression)(value)) {\n var prevRow = visualRows.get(cell);\n var expModifier = new _expressionModifier.default(value);\n expModifier.translate({\n row: dataProvider.t.toVisualRow(row) - prevRow\n });\n dataProvider.updateSourceData(row, column, expModifier.toString());\n }\n });\n visualRows = null;\n}", "function compareLastestFn(a, b) {\n const workA = a.deadline;\n const workB = b.deadline;\n\n let comparison = 0;\n if (workA < workB) {\n comparison = 1;\n } else if (workA > workB) {\n comparison = -1;\n }\n return comparison;\n}", "function checkWaterControl(){\n var d = new Date();\n // swtich between water control systems\n switch(water_ctrl_mode) {\n case ctrl_mode_dumb:\n console.log(\"Water Control Mode: Dumb\")\n if(water_status_on == false){\n if(d.getTime()-last_measured_time >= dumb_water_off_time){\n turnOnWater();\n water_status_on = true;\n last_measured_time = d.getTime();\n \n }\n } else {\n if(d.getTime()-last_measured_time >= dumb_water_on_time){\n turnOffWater();\n water_status_on = false;\n last_measured_time = d.getTime();\n }\n } \n break;\n case ctrl_mode_reactive:\n console.log(\"Water Control Mode: Reactive\")\n if(newest_data[0] && (newest_data[0].moisture <= soil_mois_threshold)){\n turnOnWater()\n } else if(newest_data[1] && (newest_data[1].moisture <= soil_mois_threshold)){\n turnOnWater()\n } else {\n turnOffWater()\n }\n break;\n case ctrl_mode_proactive:\n console.log(\"Water Control Mode: Proactive\")\n calc_threshold = calcSoilMoisThreshold()\n if(newest_data[0] && (newest_data[0].moisture <= calc_threshold)){\n turnOnWater()\n } else if(newest_data[1] && (newest_data[1].moisture <= calc_threshold)){\n turnOnWater()\n } else {\n turnOffWater()\n }\n break;\n }\n}", "function get_time_left() {\n return (escrow_amount / price_per_second) - time_spent;\n}", "get deletedAcross() {\n return (this.delInfo & DEL_ACROSS) > 0;\n }", "check() {\n let now = Date.now();\n let limits = Object.keys(this.currentLimits);\n \n for(let i = 0; i < limits.length; i++) {\n if(this.limits[limits[i]].date - now <= 0) {\n this.setCount (limits[i], 0);\n }\n }\n }", "undoTransaction() {\n this.f(this.oldDes,this.oldAss,this.oldDue,this.oldCom,this.des,this.ass,this.due,this.com,this.whetherCreate)\n }", "function btnCheckCancel() {\r\n\t\tvar sm = issueheadPanel.getSelectionModel();\r\n\t\tvar selected = sm.getSelections();\r\n\t\tvar ids = [];\r\n\t\tif (selected.length == 0) {\r\n\t\t\tExt.Msg.alert(\"提示\", \"请选择要取消审核的记录!\");\r\n\t\t} else {\r\n\t\t\tfor (var i = 0; i < selected.length; i += 1) {\r\n\t\t\t\tvar member = selected[i].data;\r\n\t\t\t\tif (member.issueNo) {\r\n\t\t\t\t\tids.push(member.issueNo); // modify by ywliu 20100202\r\n\t\t\t\t\tids.push(member.lastModifiedDate); // modify by ywliu 20100202\r\n\t\t\t\t} else {\r\n\t\t\t\t\tissueHeaderStore.remove(issueHeaderStore.getAt(i));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tExt.Msg.confirm(\"取消审核\", \"是否确定取消审核?\", function(buttonobj) {\r\n\t\t\t\tif (buttonobj == \"yes\") {\r\n\t\t\t\t\tExt.lib.Ajax.request('POST',\r\n\t\t\t\t\t\t\t'resource/issueCheckCancel.action', {\r\n\t\t\t\t\t\t\t\tsuccess : function(action) {\r\n\t\t\t\t\t\t\t\t\tExt.Msg.alert(\"提示\", \"取消审核成功!\");\r\n\t\t\t\t\t\t\t\t\tinitPanelDatas();\r\n\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\tfailure : function() {\r\n\t\t\t\t\t\t\t\t\tExt.Msg.alert('错误', '删除时出现未知错误.');\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}, 'ids=' + ids);\r\n\t\t\t\t}\r\n\r\n\t\t\t});\r\n\t\t}\r\n\t}", "changeToCheck(orderNumber, checkState) {\n Actions.stockCheck({orderNumber: orderNumber, checkState: checkState, title:orderNumber});\n }", "function workload_status_fail(client, data) {\n if(client.type === \"worker\") {\n console.log(\"workload status fail \", data);\n }\n}", "validateNoStockStatus() {\n this\n .waitForElementNotPresent('@stockIndicator', 10000, (res) => {\n if (res.value) {\n // eslint-disable-next-line no-unused-expressions\n this\n .expect.element('@stockIndicator').to.be.not.present;\n } else {\n this\n .assert.ok(false, '[FAIL] - Something went wrong when validating stock status is not displayed');\n }\n }, '[STEP] - Stock Status should not be displayed in Product Card');\n return this;\n }", "Exp_minus(e, _op, t) { return e.eval() - t.eval(); }", "get() { return resource.change.after_unknown; }", "timeRemaining(reqTimeStamp) {\n let endTime= reqTimeStamp + this.validationWindow;\n let now = parseInt(new Date().getTime()/1000);\n return (endTime - now)\n }", "testCase1_1() {\n let _verdict = false;\n let _tc1 = this._helperModule.calculateNewDateBasedOnPivotDate(new Date(\"2016-09-03\"), -2);\n if (Number(_tc1) == Number(new Date(\"2016-09-01\"))) {\n // passed the test\n _verdict = true;\n }\n\n return _verdict;\n }", "function on_deactivate()\n {\n status_update_event_type = null;\n previous_status_update_index = -1;\n\n DOM.on_hold_progress_indicator.style.width = \"0%\";\n DOM.on_hold_status_message.textContent = \"\";\n }", "strategyToggle() {\n// console.log('In ActionTrade.strategyToggle this=',this);\n// console.log('state=',this.state);\n logUsage('event', 'ActionTrade', { event_label: 'ActionTrade'});\n this.props.saveAutoSave();\n var design;\n var ncode;\n const { store } = this.context;\n// this.props.saveInputSymbolValues();\n// this.props.search();\n design = store.getState();\n var nviol = this.commonViolationSetup();\n if (design.model.result.objective_value <= design.model.system_controls.objmin || nviol === 0) {\n this.props.restoreInputSymbolValues();\n ncode = 'OBJ < OBJMIN - USE OF TRADE IS NOT APPROPRIATE';\n this.props.changeResultTerminationCondition(ncode);\n return;\n } else {\n this.setState({\n strategyModal: !this.state.strategyModal,\n });\n }\n }", "function checkStep() {\n \n var shift, step;\n //if order is 'oldest_first' we only need to care about the removed posts\n if (self.sort === 'oldest_first') {\n shift = self.newUpdatesApplied;\n } else {\n shift = self.newUpdatesApplied + self.uncountedPosts.length;\n }\n // reset the counters as we need them fresh after a new page load\n self.countedPosts = self.countedPosts.concat(self.uncountedPosts);\n self.uncountedPosts = []; self.newUpdatesApplied = 0;\n //this works well with both negative and positive shift\n step = Math.floor(shift / self.maxResults);\n return step;\n }", "_calcRemainingTime() {\n return this._remainingTestsCount;\n }", "testCase1_2() {\n let _verdict = false;\n let _tc1 = this._helperModule.calculateNewDateBasedOnPivotDate(new Date(\"2016-09-03\"), 2);\n if (Number(_tc1) == Number(new Date(\"2016-09-05\"))) {\n // passed the test\n _verdict = true;\n }\n\n return _verdict;\n }", "function calcAutoAndStopLoss(accNo,pin,symbol,percentBuyStep,percentSellStep,SLP,interval,debug){\r\n console.debug(\"calcAutoAndStopLoss(\"+accNo+\",***,\"+symbol+\",\"+percentBuyStep+\",\"+percentSellStep+\",\"+SLP+\");\");\r\n symbol=symbol.toUpperCase();\r\n //---------------------------------------------------------\r\n\t\ttry{ \r\n\t\t\t$('.symbol').find('input[type=text]:eq(0)').val(symbol);\r\n\t\t\t$('.refreshQuoteBtn:eq(0)').click(); \r\n\t\t}catch(e){}\r\n var d=new Date();\r\n var ct=(d.getHours()<10 ? '0'+d.getHours():d.getHours())+':'+(d.getMinutes()<10 ? '0'+d.getMinutes():d.getMinutes())+':'+(d.getSeconds()<10 ? '0'+d.getSeconds():d.getSeconds());\r\n\t\t//console.info(ct);\r\n if( (ct>=\"09:57:00\" && ct<=\"12:30:00\") \r\n || (ct>=\"14:25:00\" && ct<=\"16:30:00\")\r\n ){\r\n var p=getPortfolio(accNo);\r\n\t\t\tif(debug){ console.info(p); }\r\n for(var i=0;i<p.length;i++){ \r\n var o=p[i];\r\n if(symbol==o.symbol){\r\n\t\t\t\t\tvar comp=o.MP<SLP && o.availVol;\r\n\t\t\t\t\tvar avgCostPrice=(o.avgCost * o.availVol);\r\n\t\t\t\t\tvar avgMarketPrice=(o.MP * o.availVol);\r\n\t\t\t\t\tvar fee=(avgCostPrice*0.002)+(avgMarketPrice*0.002);\r\n\t\t\t\t\tfee=fee+(fee*0.07);\r\n\t\t\t\t\tvar tCost=(avgCostPrice+fee).toFixed(2);\r\n\t\t\t\t\tvar profit=(avgMarketPrice-tCost).toFixed(2);\r\n\t\t\t\t\tvar profitPercent=(profit/tCost).toFixed(2);\r\n\r\n if(comp){\r\n console.info(\"Stop loss !! sell all price\");\r\n var ret=buyOrSell(accNo,pin,\"S\",symbol,o.availVol,SLP,\"mp\");\r\n console.info( ret );\r\n }\r\n else if(o.availVol){\r\n\t\t\t\t\t\tif(!eval(interval)){\r\n\t\t\t\t\t\t\tvar t=parseInt(Math.random()*1000*60*2,10);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\tvar t=eval(interval);\r\n\t\t\t\t\t\t\twindow.stock={};\r\n\t\t\t\t\t\t\twindow.stock[symbol]={};\r\n\t\t\t\t\t\t\twindow.stock[symbol].interval=interval;\r\n\t\t\t\t\t\t}\r\n setTimeout(function(){ \r\n calcAutoAndStopLoss(accNo,pin,symbol,percentBuyStep,percentSellStep,SLP,window.stock[symbol].interval);\r\n },t);\r\n }\r\n\t\t\t\t\t$('#refreshQuoteBtn').click();\r\n\t\t\t\t\tconsole.info(ct+\"[\"+symbol+\"]:[avgCost:\"+o.avgCost+\",tCost:\"+tCost+\"]:[P:\"+profit+\",\"+(profitPercent*100).toFixed(2)+\" %]:[MP:\"+o.MP+\"]\"+(comp ? '<':'>=')+\"[SLP:\"+SLP+\"] && [o.availVol:\"+o.availVol+\"][\"+\"Intv:\"+(t/1000).toFixed(2)+\" Sec.]\");\r\n }\r\n }\r\n }\r\n else if( (ct>=\"16:30:00\") ){//ไม่ต้องทำแล้วถ้าปิดตลาด\r\n console.info(\"ปิดตลาดแล้ว !!!\");\r\n return;\r\n }\r\n else{//พักเที่ยงให้เชคเวลาทุกๆ 5 นาที\r\n console.info(\"พักเที่ยงอยู่ !!\");\r\n var t=1000*60*5;\r\n setTimeout(function(){ \r\n calcAutoAndStopLoss(accNo,pin,symbol,percentBuyStep,percentSellStep,SLP);\r\n },t);\r\n } \r\n }", "goalState() {\n let date = new Date()\n let goalDate\n (this.last_click) ? goalDate = this.last_click : goalDate = this.created_at\n if ((this.formatDate(goalDate)[0] < date.getFullYear()) || (this.formatDate(goalDate)[1] < date.getMonth())) {\n this.status = 'dead'}\n else if ((date.getDate() - this.formatDate(goalDate)[2]) > 1) {\n this.status = 'dead';}\n else if ((date.getDate() - this.formatDate(goalDate)[2]) == 1) {\n this.status = 'late';}\n else this.status = 'alive';\n }", "function qtyChangedOnDeleted(result) {\n var changedQty;\n\n if (result.metadata && result.metadata.AffectedNodes) {\n var oldQty = $scope.editOrder.oldQuantity;\n var nodes = result.metadata.AffectedNodes;\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].DeletedNode) {\n var delNode = nodes[i].DeletedNode;\n\n if (delNode.LedgerEntryType && delNode.LedgerEntryType === 'Offer' && delNode.FinalFields) {\n var delFields = delNode.FinalFields;\n\n if (delFields.Sequence == $scope.cancelOrder.seq && delFields.TakerPays && delFields.TakerGets) {\n var cancelledQty;\n if ($scope.editOrder.type === 'buy') cancelledQty = Amount.from_json(delFields.TakerPays);\n else if ($scope.editOrder.type === 'sell') cancelledQty = Amount.from_json(delFields.TakerGets);\n\n // Calculate the difference in qty if order qty changed before cancel\n if (cancelledQty && !cancelledQty.equals(oldQty)) changedQty = oldQty.subtract(cancelledQty);\n }\n break; // Found the Cancelled order\n }\n }\n }\n\n // If did not find the Cancelled order, difference is whole qty\n if (i === nodes.length) changedQty = oldQty;\n }\n\n // Show a modal popup to inform the user if there is a difference is qty\n if (changedQty && changedQty.is_positive()) {\n var popupScope = $scope.$new();\n popupScope.order = { qtyChangeAfterCancel: changedQty };\n\n popupScope.cancel = function() {\n popup.close();\n popupScope.$destroy();\n };\n\n $templateRequest('templates/' + lang + '/popup/modifyOrderError.html', false).then(function(template) {\n popup.blank(template, popupScope);\n });\n\n return true;\n }\n else return false;\n }", "function mainCalculation(failedNow) {\n\t\n\tvar loss;\n\n\tdo {\n\t\t// At the beginning, setting that failedIndicator is failedNow.\n\t\tvar failedIndicator = failedNow;\n\t\t// Calculates what banks will fail.\n\t\tloss = failurePropagation(failedIndicator, exposures);\n\t\t// Calculattes what companies will fail.\n\t\tvar failed = PWComparison(thresholds, loss);\n\t\t// merging the new result and old result together.\n\t\tfailedNow = PWOr(failed, failedIndicator);\n\t} while(failedMore(failedIndicator, failedNow));\n\n\tif(limit_graph >= countGraph) {\n\t\t// adding a chert to html tag.\n\t\tgenerateChertH(failedNow, thresholds, loss, countGraph + 1, \"Example a Scenario Result #\");\n\t\t// count as a graph has been added.\n\t\tcountGraph++;\n\t}\n\t\n\n\tvar countloss = 0.0;\n\tfor(var i = 0; i < failedNow.length; ++i) {\n\t // if bank doesn't failed.\n\t if(failedNow[i] < 1.0) {\n\t countloss += loss[i];\n\t } \n\t // bank did failed.\n\t else {\n\t countloss += (loss[i] >= thresholds[i]? loss[i]: thresholds[i]);\n\t }\n\t}\n\n\t// return Totalloss.\n\treturn countloss;\n}", "function qtyChangedOnDeleted(result) {\n\t var changedQty;\n\n\t if (result.metadata && result.metadata.AffectedNodes) {\n\t var oldQty = $scope.editOrder.oldQuantity;\n\t var nodes = result.metadata.AffectedNodes;\n\n\t for (var i = 0; i < nodes.length; i++) {\n\t if (nodes[i].DeletedNode) {\n\t var delNode = nodes[i].DeletedNode;\n\n\t if (delNode.LedgerEntryType && delNode.LedgerEntryType === 'Offer' && delNode.FinalFields) {\n\t var delFields = delNode.FinalFields;\n\n\t if (delFields.Sequence == $scope.cancelOrder.seq && delFields.TakerPays && delFields.TakerGets) {\n\t var cancelledQty;\n\t if ($scope.editOrder.type === 'buy') cancelledQty = Amount.from_json(delFields.TakerPays);\n\t else if ($scope.editOrder.type === 'sell') cancelledQty = Amount.from_json(delFields.TakerGets);\n\n\t // Calculate the difference in qty if order qty changed before cancel\n\t if (cancelledQty && !cancelledQty.equals(oldQty)) changedQty = oldQty.subtract(cancelledQty);\n\t }\n\t break; // Found the Cancelled order\n\t }\n\t }\n\t }\n\n\t // If did not find the Cancelled order, difference is whole qty\n\t if (i === nodes.length) changedQty = oldQty;\n\t }\n\n\t // Show a modal popup to inform the user if there is a difference is qty\n\t if (changedQty && changedQty.is_positive()) {\n\t var popupScope = $scope.$new();\n\t popupScope.order = { qtyChangeAfterCancel: changedQty };\n\n\t popupScope.cancel = function() {\n\t popup.close();\n\t popupScope.$destroy();\n\t };\n\n\t popup.blank(__webpack_require__(89)(), popupScope);\n\t return true;\n\t }\n\t else return false;\n\t }", "getComputerDecision() {\n if (\n this.ev_r < this.ev_rescue &&\n this.ev_l < this.ev_rescue &&\n this.ev_f < this.ev_rescue\n )\n return \"rescue\";\n\n if (this.ev_r >= this.ev_l && this.ev_r >= this.ev_f) {\n return \"right\";\n } else if (this.ev_l >= this.ev_f && this.ev_l >= this.ev_r) {\n return \"left\";\n } else {\n return \"forward\";\n }\n }", "function _checkOutFail() {\n\n var modalError = {\n message: 'Failed to checkout asset.'\n };\n $rootScope.errorModalText(modalError);\n ModalService.get('errorModal').open();\n vm.loadingState = 'contentSuccess';\n }", "function date_desc(a,b){\nif (new Date(a.released)>new Date(b.released))\n return 1;\nif (new Date(a.released)<new Date(b.released))\n return -1;\nreturn 0\n}", "checkRateUpdate(){\n const dateUpdate = this.state.dateUpdate;\n \n if(typeof dateUpdate === \"number\"){\n const timeSinceLastUpdate = new Date() - dateUpdate;\n const timeMaxWithOutUpdate = 21600000 // 6h = 6 * 60 * 60 * 1000 = 21600000\n\n if (timeSinceLastUpdate > timeMaxWithOutUpdate)\n this.getTheRates();\n }\n }", "function subtractDates(date1,date0){if(largeUnit){return util_1.diffByUnit(date1,date0,largeUnit);// poorly named\n}else if(dateProfile1.isAllDay()){return util_1.diffDay(date1,date0);// poorly named\n}else{return util_1.diffDayTime(date1,date0);// poorly named\n}}", "function operate(op, prev, num) {\n var now;\n if (op == 'plus') now = prev + num;\n else if (op == '-') now = prev - num;\n else if (op == 'divide') now = prev / num;\n else now = prev * num;\n return now;\n}", "function checkChange(value) {\n if (Math.abs(changeAmountDue) >= machineCoinInventory[value].value) {\n changeCoinsDue[value].stock = Math.floor(changeAmountDue / machineCoinInventory[value].value);\n changeAmountDue -=\n machineCoinInventory[value].value *\n Math.floor(changeAmountDue / machineCoinInventory[value].value);\n } else {\n changeCoinsDue[value].stock = 0;\n }\n }", "static resultForOps(ops, actionContext) {\n const nextContext = this.tempUpdateContext(ops, actionContext);\n return {\n nextContext: nextContext,\n resultOps: ops,\n scheduledActions: []\n };\n }", "calculateELORatingChange(elo1, elo2, k) {\n var percentage = 1 / (1 + Math.pow(10, (elo2 - elo1) / 400));\n\n return {\n win: Math.round(k * (1 - percentage)),\n draw: Math.round(k * (.5 - percentage)),\n loss: Math.round(k * (0 - percentage)),\n percent: Math.round(percentage * 100)\n };\n }", "_doCheck()\n {\n let now = Date.now();\n for (let downloadable of this.dataSource())\n {\n if (downloadable.lastCheck &&\n now - downloadable.lastCheck > this.maxAbsenceInterval)\n {\n // No checks for a long time interval - user must have been offline,\n // e.g. during a weekend. Increase soft expiration to prevent load\n // peaks on the server.\n downloadable.softExpiration += now - downloadable.lastCheck;\n }\n downloadable.lastCheck = now;\n\n // Sanity check: do expiration times make sense? Make sure people changing\n // system clock don't get stuck with outdated subscriptions.\n if (downloadable.hardExpiration - now > this.maxExpirationInterval)\n downloadable.hardExpiration = now + this.maxExpirationInterval;\n if (downloadable.softExpiration - now > this.maxExpirationInterval)\n downloadable.softExpiration = now + this.maxExpirationInterval;\n\n // Notify the caller about changes to expiration parameters\n if (this.onExpirationChange)\n this.onExpirationChange(downloadable);\n\n // Does that object need downloading?\n if (downloadable.softExpiration > now &&\n downloadable.hardExpiration > now)\n continue;\n\n // Do not retry downloads too often\n if (downloadable.lastError &&\n now - downloadable.lastError < this.minRetryInterval)\n continue;\n\n this._download(downloadable, 0);\n }\n }", "function TceCondition() {\n\tthis.time = null;\n\tthis.pass = null;\n\tthis.amount = null;\n\tthis.currency = null;\n\tthis.methodsOfPayment = null;\n\tthis.daylightHours = null;\n\tthis.discountAvailable = null;\n\tthis.tollSystemsIds = null;\n}", "get expired() {\n\t\treturn !this.ticket;\n\t}", "async _updateInvalidatedAccessories() {\n /* Create the condition time */\n const d = new Date();\n d.setSeconds(d.getSeconds() - (MoxLtHome.FORCE_STATUS_UPDATE_INTERVAL / 1000));\n \n /* Fetch the old accessories */\n const accessories = await Accessory.find({ updatedAt: { $lt: d }});\n\n debugStatus('Updating old accessories: TOTAL ' + accessories.length);\n accessories.forEach(async accessory => {\n debugStatus('Asking for status update on ' + JSON.stringify({ moduleId: accessory.moduleId, channelId: accessory.channelId }));\n\n await this._sendStatusUpdateRequest(accessory);\n });\n }", "function getStatus(now, day) {\n var index = getPeriod(day);\n \n if (!!index) {\n var open = determineDate(periods[index].open.nextDate);\n var close = determineDate(periods[index].close.nextDate);\n };\n\n var indexPre = getPeriod((7 + day - 1) % 7);\n \n if (!!indexPre) {\n var closePre = determineDate(periods[indexPre].close.nextDate);\n };\n\n // checks for difference in nextDates\n function determineDate(inputDate) {\n var inputTime = new Date(inputDate);\n return (inputTime - now > FOUR_DAYS) ? inputDate - ONE_WEEK : inputDate;\n }\n\n // if case is true for given time, set the status\n switch (true) {\n // if now < open, [if now < pre, pre - now, else open at ''], else [if now < close, close - now, else closed]\n case !!index && !!indexPre:\n if (now < open) {\n if (now < closePre) {\n x.statuses.count();\n return closePre - now;\n } else {\n x.statuses.wait();\n return open;\n }\n } else {\n if (now < close) {\n x.statuses.count();\n return close - now;\n } else {\n x.statuses.reset();\n return 'closed';\n }\n }\n break;\n // if now < open, open at '', else [if now < close, close - now, else closed]\n case !!index && !indexPre:\n if (now < open) {\n x.statuses.wait();\n return open;\n } else {\n if (now < close) {\n x.statuses.count();\n return close - now;\n } else {\n x.statuses.reset();\n return 'closed';\n }\n };\n break;\n // if now < pre, pre - now, else closed\n case !index && !!indexPre:\n if (now < closePre) {\n x.statuses.wait();\n return closePre - now;\n } else {\n x.statuses.reset();\n return 'closed';\n }\n break;\n default:\n x.statuses.reset();\n return 'closed';\n };\n }" ]
[ "0.64863586", "0.5092882", "0.5054814", "0.4955838", "0.49546498", "0.49452978", "0.48403302", "0.4805371", "0.48015884", "0.4790848", "0.4779167", "0.4752892", "0.47342303", "0.47306263", "0.47246015", "0.4723393", "0.47053486", "0.47014406", "0.47013104", "0.4695447", "0.46838474", "0.46827865", "0.46803942", "0.4680123", "0.46776253", "0.46565086", "0.4642242", "0.46331808", "0.4623573", "0.46216387", "0.46140492", "0.46126047", "0.45973444", "0.4588515", "0.45863786", "0.45853636", "0.45842654", "0.457583", "0.4575287", "0.45667762", "0.45601436", "0.45513114", "0.45487264", "0.45466402", "0.45458204", "0.45420644", "0.45365855", "0.45328522", "0.45272815", "0.4526353", "0.45260137", "0.4524859", "0.4520332", "0.4515621", "0.4513558", "0.45125434", "0.4509976", "0.4503987", "0.4501647", "0.44936818", "0.4489116", "0.44860578", "0.44831753", "0.44831362", "0.44814724", "0.44802418", "0.4475903", "0.44739446", "0.44688544", "0.44601667", "0.445375", "0.44514626", "0.4451087", "0.44493166", "0.4448964", "0.44458026", "0.4443512", "0.44421628", "0.444083", "0.44376585", "0.4431733", "0.4427488", "0.44240102", "0.44204816", "0.44197646", "0.44191897", "0.44132948", "0.44130522", "0.44093344", "0.44084385", "0.44044524", "0.439608", "0.43932834", "0.4391998", "0.4386884", "0.43825164", "0.4369683", "0.4364763", "0.43630758", "0.43626395" ]
0.6539003
0
Integration functions for verification of Primary Industry Activities
function Verfication_priamaryIndustry_checkBox (input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!presence_check(input)){ error = "E37_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function mainProcess() {\n\tlogDebug(\"This process inactivates Prequal license records that have been sitting in Additional Info Required, Pending, or Open status for longer than 6 months.\" + br);\n\t\n\tdtToday = new Date();\t\n\tdtSixMonthDate = new Date(dateAdd(dtToday, -183));\n\tstrSixMonthDate = jsDateToMMDDYYYY(dtSixMonthDate);\t\t\n\tlogDebug(\"6 Months Past Date: \" + strSixMonthDate);\n\t\n\tvar lpResult = aa.cap.getByAppType(\"Licenses\", \"Engineering\", \"Prequalified Contractor\", \"Na\");\n\t\n\tif (lpResult.getSuccess()) {\n\t\tlps = lpResult.getOutput();\n\t\tlogDebug(\"Number of Prequal records found: \" + lps.length + br);\n\t} else {\n\t\tlogDebug(\"ERROR: Retrieving permits: \" + lpResult.getErrorType() + \":\" + lpResult.getErrorMessage());\n\t\treturn false;\n\t}\n\t\t\n\tlogDebug(\"List of Prequal records set to Inactive: \" + br);\n\t\n\tfor (lp in lps) {\t\n\n\t\tif (elapsed() > maxSeconds){ // only continue if time hasn't expired\t\t\t\n\t\t\tlogDebug(\"A script timeout has caused partial completion of this process. Please re-run. \" + elapsed() + \" seconds elapsed, \" + maxSeconds + \" allowed.\") ;\n\t\t\ttimeExpired = true ;\n\t\t\tbreak;\n\t\t}\n\t\t\t\n\t\tb1App = lps[lp];\t\t\n\t\tvar b1CapId = b1App.getCapID();\t\t\n\t\tcapId = aa.cap.getCapID(b1CapId.getID1(), b1CapId.getID2(), b1CapId.getID3()).getOutput();\n\t\taltId = capId.getCustomID();\n\t\tcap = aa.cap.getCap(capId).getOutput();\n\t\tcapMod = cap.getCapModel();\t\t\n\t\t\n\t\tif (cap) {\n\t\t\tappStatus = cap.getCapStatus();\n\t\t\tappStatusDate = capMod.capStatusDate;\t\t\t\n\t\t\t\n\t\t\tif (appStatus == \"Additional Info Required\" || appStatus == \"Pending\" || appStatus == \"Open\" ) {\n\t\t\t\t//if (altId == \"LPC2010000-00445\") {\t\t\t\t\t\n\t\t\t\t\tstrRecStatusDate = (appStatusDate.getMonth() + 1) + \"/\" + appStatusDate.getDate() + \"/\" + (appStatusDate.getYear() + 1900);\t\t\t\t\t\n\t\t\t\t\tdtAppStatusDate = new Date(strRecStatusDate);\t\t\t\t\t\n\n\t\t\t\t\tif (dtAppStatusDate < dtSixMonthDate){\n\t\t\t\t\t\tgetContactInfo();\n\t\t\t\t\t\tlogDebug(\"Contractor Business Name: \" + contactBizName)\n\t\t\t\t\t\tlogDebug(\"Prequal License: \" + altId);\n\t\t\t\t\t\tlogDebug(\"Record Status & Status Date: \" + appStatus + \", \" + strRecStatusDate);\t\t\t\t\t\t\n\t\t\t\t\t\t//logDebug(\"Record Status Date is older than 6 months, so inactivate record\");\n\t\t\t\t\t\tupdateAppStatus(statusInactive, \"Updated by batch script\");\n \tlicEditExpInfo(statusInactive, null);\n\t\t\t\t\t\tlogDebug(\"Updated Record & Renewal Expiration status to \" + statusInactive + \".\");\n\t\t\t\t\t\trecsInactivatedCnt++;\t\t\t\t\t\t\n\t\t\t\t\t\tlogDebug(\"\");\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t//} //End specific rec test.\n\t\t\t}\n\t\t}\n\t}\n\tlogDebug(\"Total Prequal records set to Inactive: \" + recsInactivatedCnt);\n}", "function validateVendorClient()\n{\n\tvar recType = nlapiGetRecordType();\t\n\tvar nlobjContext = nlapiGetContext();\t\n var enableExpenseVBIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_int');\n var enablePOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_po_integration');\n\tvar enableVBtoOAPOIntegration = nlobjContext.getSetting('SCRIPT', 'custscript_oa_vb_oa_po_export');\n\tvar expenseVBIntegrationTax = nlobjContext.getSetting('SCRIPT', 'custscript_oa_expense_vb_tax');\n\tvar exportToOA = nlapiGetFieldValue('custentity_oa_export_to_openair');\n\n\tif (recType == 'vendor' && exportToOA == 'T' && enableExpenseVBIntegration == 'T')\n\t{\n\t\t// did we specify a parent vendor?\n\t\tvar mapToParentVendor = nlapiGetFieldValue('custentity_oa_map_to_parent_vendor');\n\t\tvar parentVendor = nlapiGetFieldValue('custentity_oa_vendor_parent');\n\t\tif (mapToParentVendor == 'T' && parentVendor < 1)\n\t\t{\n\t\t\talert(\"The 'Map to Parent Vendor' field has been checked but a parent vendor has not been chosen.\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// are we mapping expense reports to vendor bills?\n\t\tvar createVendorBills = nlapiGetFieldValue('custentity_oa_expense_to_vendorbill');\n\t\tvar vendorTaxNexus = nlapiGetFieldValue('custentity_oa_vendor_tax_nexus');\n\t\tif ((mapToParentVendor == 'T' || parentVendor > 0 || vendorTaxNexus > 0) && createVendorBills != 'T')\n\t\t{\n\t\t\talert(\"The 'Map Expense Reports to Vendor Bills' field is not checked but fields used only for that OpenAir integration have been picked. Either check the 'Map Expense Reports to Vendor Bills' field or remove values entered for fields specific to the OpenAir expense to vendor bill integration.\");\n\t\t\treturn false;\t\t\t\n\t\t}\n\t\t\n\t\t// did we pick whether this should create a user or vendor?\n\t\t// this is only required when we are doing both PO and vendor bill integration\n\t\tif ((enablePOIntegration == 'T' || enableVBtoOAPOIntegration == 'T') && nlapiGetFieldValue('custentity_oa_user_or_vendor') < 1)\n\t\t{\n\t\t\talert(\"Please specify whether this vendor should export to OpenAir as a user or vendor.\");\n\t\t\treturn false;\t\t\t\t\n\t\t}\n\t\t\n\t\t// pick the tax nexus field / its required if taxes have been enabled in NS\n\t\tif (createVendorBills == 'T' && vendorTaxNexus < 1 && expenseVBIntegrationTax == 'T')\n\t\t{\n\t\t\talert(\"The 'OpenAir Tax Nexus Type' field is required.\");\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// everything is okay\n\t\treturn true;\n\t} else \n\t{\n\t\t// vendor custom fields used for vendor bill integration / blank them out \n\t\t// if we are not doing vendor bill integration\n\t\tnlapiSetFieldValue('custentity_oa_vendor_user_currency', '', false, true);\n\t\tnlapiSetFieldValue('custentity_oa_map_to_parent_vendor', 'F', false, true);\n\t\tnlapiSetFieldValue('custentity_oa_expense_to_vendorbill', 'F', false, true);\t\t\t\n\t\tnlapiSetFieldValue('custentity_oa_vendor_tax_nexus', '', false, true);\n\t\tnlapiSetFieldValue('custentity_oa_vendor_parent', '', false, true);\n\t\tnlapiSetFieldValue('custentity_oa_user_or_vendor', '', false, true);\n\t}\n\t\n\t// this is not a vendor for vendor bill integration\n\treturn true;\n}", "function prerequisitiesValidator (Prerequisities, Enrollment){\n // arg Prerequisities should be in this format:\n // Prerequisities = {\"code\":{\"1\": [\"COMP9021\", \"COMP9024\"],\"2\": [\"COMP9020\", \"COMP9024\"]},\"UOC\": 0}\n let canBeEnrolled = false;\n //console.log(Prerequisities.code, Enrollment);\n if (Prerequisities.code[1].length === 0 && Prerequisities.code[2].length === 0){\n //console.log('1');\n canBeEnrolled = true;\n }else if(Prerequisities.code[1].length >= 1 && Prerequisities.code[2].length === 0){\n //console.log('2');\n for(let course of Prerequisities.code[1]){\n if(Enrollment.includes(course)){\n canBeEnrolled = true;\n break;\n }\n }\n }else if(Prerequisities.code[1].length === 0 && Prerequisities.code[2] >= 1){\n //console.log('3');\n for(let course of Prerequisities.code[2]){\n if(Enrollment.includes(course)){\n canBeEnrolled = true;\n break;\n }\n }\n }else if(Prerequisities.code[1].length >= 1 && Prerequisities.code[2].length >=1 ){\n //console.log('4');\n let validatorCodeList1 = false;\n let validatorCodeList2 = false;\n for(let course of Prerequisities.code[1]){\n if(Enrollment.includes(course)){\n canBeEnrolled = true;\n break;\n }\n }\n for(let course of Prerequisities.code[2]){\n if(Enrollment.includes(course)){\n canBeEnrolled = true;\n break;\n }\n }\n if(validatorCodeList1 === true && validatorCodeList2 === true){\n canBeEnrolled = true;\n }\n }\n return canBeEnrolled;\n}", "function main()\r{\r\tif(isNeedToValidateReqDocument(capIDModel,processCode, stepNum, processID, taskStatus))\r\t{\t\r\t\tisRequiredDocument();\r\t}\r}", "function test_notification_banner_vm_provisioning_notification_and_service_request_should_be_in_syn() {}", "function BusinessIntelligenceCheck(){}", "function approveCustomer() {\n // loginOwner()\n let tokenID = document.getElementById(\"approveTokenID\").value;\n let senderPrvtKey = document.getElementById(\"approveSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"approveSpenderAddress\").value;\n let value = document.getElementById(\"approveValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || value == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n \n approve(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, value, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "function increaseCustomerApproval() {\n // loginOwner()\n let tokenID = document.getElementById(\"increaseApprovalTokenID\").value;\n let senderPrvtKey = document.getElementById(\"increaseApprovalSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"increaseApprovalSpenderAddress\").value;\n let addedValue = document.getElementById(\"increaseApprovalValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || addedValue == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n\n increaseApproval(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, addedValue, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "function checkActivityStatusForCPR()\n\t\t{\n\t\t\tvar collectionProtocolRegistrationVal = parseInt(document.forms[0].collectionProtocolRegistrationValueCounter.value);\n\t\t\tvar isAllActive = true;\n\t\t\tfor(i = 1 ; i <= collectionProtocolRegistrationVal ; i++)\n\t\t\t{\n\t\t\t\tvar name = \"collectionProtocolRegistrationValue(ClinicalStudyRegistration:\" + i +\"_activityStatus)\";\n\t\t\t\tif((document.getElementById(name) != undefined) && document.getElementById(name).value==\"Disabled\")\n\t\t\t\t{\n\t\t\t\t\tisAllActive = false;\n\t\t\t\t\tvar go = confirm(\"Disabling any data will disable ALL its associated data also. Once disabled you will not be able to recover any of the data back from the system. Please refer to the user manual for more details. \\n Do you really want to disable?\");\n\t\t\t\t\tif (go==true)\n\t\t\t\t\t{\n\t\t\t\t\t\tdocument.forms[0].submit();\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (isAllActive==true)\n\t\t\t{\n\t\t\t\tdocument.forms[0].submit();\n\t\t\t}\n\t\t}", "function runAutomatedTestsIfAppropriate()\n{\n var msg = {cmd: \"getUserId\", callback: \"pcaAssessUserIdForTesting\",\n status: \"request\", payload: \"\"};\n\n hub.send(JSON.stringify(msg));\n\n} // runAutomatedTestsIfAppropriate", "function trainProgAutoInvite()\n{\n\tvar paramJson = {\n\t\t'progid':nlapiGetContext().getSetting('SCRIPT', 'custscript_420_tpid'),\n\t\t'triguser':nlapiGetContext().getSetting('SCRIPT','custscript_420_triguserid'),\n\t\t'lastprocid':nlapiGetContext().getSetting('SCRIPT','custscript_420_lastprocid')\n\t};\n\t\n\ttry\n\t{\n\t\t//Make sure BOTH parameters are passed in\n\t\tif (!paramJson.progid || !paramJson.triguser)\n\t\t{\n\t\t\tthrow nlapiCreateError(\n\t\t\t\t'AUTOINVITE-ERR', \n\t\t\t\t'Missing required Training Program ID and Triggering User ID',\n\t\t\t\ttrue);\n\t\t}\n\t\t\n\t\tvar trainProgRec = nlapiLoadRecord('customrecord_trainingprogramme', paramJson.progid),\n\t\t\tselectedCoaches = trainProgRec.getFieldValues('custrecord_tp_selectedcoaches');\n\t\t\n\t\tif (!selectedCoaches || (selectedCoaches && selectedCoaches.length <=0))\n\t\t{\n\t\t\t/**\n\t\t\t * TODO: Do we need to Auto Uninvite if selected coach list is empty? \n\t\t\t * If THIS is something Client wants, we need to set a flag at this stage and\n\t\t\t * After doing the search with all related booking and coaches, we need to go through and Uninvite them\n\t\t\t */\n\t\t\t\n\t\t\tthrow nlapiCreateError(\n\t\t\t\t'AUTOINVITE-ERR', \n\t\t\t\t'Missing values for Selected coches', \n\t\t\t\ttrue\n\t\t\t);\n\t\t}\n\t\t\n\t\t/**\n\t\t * bookings[bookingId]:{\n\t\t * 'index':xx,\n\t\t * 'subsidiary':xx,\n\t\t * 'entityid':xx,\n\t\t * 'endate':xx,\n\t\t * 'time':xx,\n\t\t * 'language':xx,\n\t\t * 'country':xx,\n\t\t * 'apperyid':xx,\n\t\t * 'course':xx\n\t\t * }\n\t\t * \n\t\t * coaches[coachId]:{\n\t\t * \t 'subsidiary':yy,\n\t\t * 'entityid':yy,\n\t\t * 'groupid':yy,\n\t\t * 'groupname':yy,\n\t\t * 'nativelanguageid':yy,\n\t\t * 'nativelanguagetext':yy,\n\t\t * 'deliverycountryid':yy,\n\t\t * 'deliverycountrytext':yy,\n\t\t * 'virtualcertified':yy,\n\t\t * 'portalid':yy\n\t\t * }\n\t\t */\n\t\tvar procJson = {\n\t\t\t'bookings':{},\n\t\t\t'coaches':{}\n\t\t};\n\t\t\n\t\t//1. Grab list of ALL Booking records related to THIS training programm.\n\t\tvar bflt = [new nlobjSearchFilter('isinactive', null, 'is', 'F'),\n\t\t new nlobjSearchFilter('custentity_bo_trainingprogramme', null, 'anyof', paramJson.progid),\n\t\t new nlobjSearchFilter('custentity_bo_coach', null, 'anyof','@NONE@'),\n\t\t new nlobjSearchFilter('jobtype', null, 'anyof', ['11','13']),\n\t\t new nlobjSearchFilter('enddate', null, 'onorafter', nlapiDateToString(new Date()))];\n\t\t\n\t\t//Last processed ID is the internal ID of booking.\n\t\tif (paramJson.lastprocid)\n\t\t{\n\t\t\tnew nlobjSearchFilter('internalidnumber', null, 'lessthan', paramJson.lastprocid);\n\t\t}\n\t\t\n\t\t//Grab list of ALL values needed for comparing and processing auto invitation\n\t\tvar bcol = [\n\t\t new nlobjSearchColumn('internalid').setSort(true), //Booking Internal ID\n\t\t new nlobjSearchColumn('entityid'),\n\t\t new nlobjSearchColumn('subsidiary'),\n\t\t new nlobjSearchColumn('enddate'), //Booking Date\n\t\t new nlobjSearchColumn('custentity_bo_eventtime'), //Booking time\n\t\t new nlobjSearchColumn('custentity_bo_spokenlanguage'), //Booking spoken language\n\t\t new nlobjSearchColumn('custentity_bo_eventcountry'), //Booking country\n\t\t new nlobjSearchColumn('custentitycustentity_ext_apperyid'), //Booking Appery ID\n\t\t new nlobjSearchColumn('custentity_bo_course'), //Booking Course\n\t\t new nlobjSearchColumn('jobtype')\n\t\t ],\n\t\t brs = nlapiSearchRecord('job', null, bflt, bcol);\n\t\t\n\t\t//1a. If No bookings are available. Exit out. NO need to process\n\t\tif (!brs)\n\t\t{\n\t\t\tlog(\n\t\t\t\t'debug',\n\t\t\t\t'No Bookings to Auto invite',\n\t\t\t\t'No need to process due to No Booking records to '+\n\t\t\t\t\t'Auto invite for Training Programme Internal ID: '+paramJson.progid\n\t\t\t);\n\t\t\t\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//2. Loop through and build procJson.bookings JSON object]\n\t\t//\t\t- This assumes There are always less than 1000 booking \n\t\t//\t\t that matches\n\t\tfor (var b=0; b < brs.length; b+=1)\n\t\t{\n\t\t\tprocJson.bookings[brs[b].getValue('internalid')] = {\n\t\t\t\t'index':b,\n\t\t\t\t'entityid':brs[b].getValue('entityid') || '',\n\t\t\t\t'subsidiary':brs[b].getValue('subsidiary') || '',\n\t\t\t\t'endate':brs[b].getValue('enddate') || '',\n\t\t\t\t'time':brs[b].getValue('custentity_bo_eventtime') || '',\n\t\t\t\t'language':brs[b].getValue('custentity_bo_spokenlanguage') || '',\n\t\t\t\t'country':brs[b].getValue('custentity_bo_eventcountry') || '',\n\t\t\t\t'countrytext':brs[b].getText('custentity_bo_eventcountry') || '',\n\t\t\t\t'apperyid':brs[b].getValue('custentitycustentity_ext_apperyid') || '',\n\t\t\t\t'course':brs[b].getValue('custentity_bo_course') || '',\n\t\t\t\t'jobtype':brs[b].getValue('jobtype') || '',\n\t\t\t\t'jobtypetext':brs[b].getText('jobtype') || ''\n\t\t\t};\n\t\t}\n\t\t\n\t\t//3. Grab information for ALL Selected Coaches (selectedCoaches)\n\t\tvar cflt = [new nlobjSearchFilter('internalid', null, 'anyof', selectedCoaches),\n\t\t new nlobjSearchFilter('category', null, 'anyof', ['5','12']),\n\t\t //new nlobjSearchFilter('custentity_coach_groupingname', null, 'noneof',['@NONE@','723','380','369']),\n\t\t new nlobjSearchFilter('isinactive', null, 'is', 'F')];\n\t\tvar ccol = [\n\t\t new nlobjSearchColumn('internalid').setSort(true),\n\t\t new nlobjSearchColumn('entityid'), //Coach Entity ID\n\t\t new nlobjSearchColumn('custentity_coach_groupingname'), //Coach Group\n\t\t new nlobjSearchColumn('custentity_coach_primarydeliverycountry'), //Primary Delivery Country\n\t\t new nlobjSearchColumn('custentity_coach_isvirtualcertified'), //Virtual Certified\n\t\t new nlobjSearchColumn('subsidiary'), //Subsidiary\n\t\t new nlobjSearchColumn('custentity_user'), //Portal User ID\n\t\t new nlobjSearchColumn('custentity_languages'), //Fluent Langagues\n\t\t new nlobjSearchColumn('custentity_coach_nativelanguage') //Coach Native language\n\t\t ];\n\t\tvar crs = nlapiSearchRecord('vendor', null, cflt, ccol);\n\t\t\n\t\t//3a. If NO Coaches return, treat it as error\n\t\tif (!crs)\n\t\t{\n\t\t\tthrow nlapiCreateError(\n\t\t\t\t'AUTOINVITE-ERR', \n\t\t\t\t'No Coach (Vendor/Supplier) Detail returned. '+\n\t\t\t\t\t'Selected Coach IDs are '+selectedCoaches, \n\t\t\t\ttrue\n\t\t\t); \n\t\t}\n\t\t\n\t\t//4. Loop htrough and build procJson.\n\t\tfor (var c=0; c < crs.length; c+=1)\n\t\t{\n\t\t\tprocJson.coaches[crs[c].getValue('internalid')] = {\n\t\t\t\t'subsidiary':crs[c].getValue('subsidiary') || '',\n\t\t\t\t'entityid':crs[c].getValue('entityid') || '',\n\t\t\t\t'groupid':crs[c].getValue('custentity_coach_groupingname') || '',\n\t\t\t\t'groupname':crs[c].getText('custentity_coach_groupingname') || '',\n\t\t\t\t'nativelanguageid':crs[c].getValue('custentity_coach_nativelanguage') || '', //SELECT\n\t\t\t\t'nativelanguagetext':crs[c].getText('custentity_coach_nativelanguage') || '', //SELECT\n\t\t\t\t'fluentlanguages':(crs[c].getValue('custentity_languages')?crs[c].getValue('custentity_languages').split(','):[]), //MULTI SELECT\n\t\t\t\t'fluentlanguagestext':(crs[c].getText('custentity_languages')?crs[c].getText('custentity_languages').split(','):[]), //MULTI SELECT\n\t\t\t\t'deliverycountryid':crs[c].getValue('custentity_coach_primarydeliverycountry') || '',\n\t\t\t\t'deliverycountrytext':crs[c].getText('custentity_coach_primarydeliverycountry') || '',\n\t\t\t\t'virtualcertified':crs[c].getValue('custentity_coach_isvirtualcertified'),\n\t\t\t\t'portalid':crs[c].getValue('custentity_user')\n\t\t\t};\n\t\t}\n\t\t\n\t\tlog('debug','About to start processing', JSON.stringify(procJson));\n\t\t\n\t\t//Log to send to user\n\t\tvar procsLog = '';\n\t\t//************************ START Actual Processing of INVITATION *********************************/\n\t\tfor (var bb in procJson.bookings)\n\t\t{\n\t\t\tvar bjson = procJson.bookings[bb];\n\t\t\t\n\t\t\tlog('debug','processing Booking JSON', JSON.stringify(bjson));\n\t\t\t\n\t\t\t//5. For Each Booking, we go through Each Coach and Add to Invitiation\n\t\t\t//\t IF All Criteria Matches:\n\t\t\t// \t\t- Coach is NOT invited to related booking.\n\t\t\t// \t\t- Native/Fluent language matches\n\t\t\t// \t\t- Subsidiary matches\n\t\t\t// \t\t- Country matches\n\t\t\t//\t\t\t- Nov 25 2015 - Modification requested by client to BY-Pass if \n\t\t\t//\t\t\t booking is virtual and coach is virtual certified\n\t\t\t// \t\t- Booking date is on or after current date\n\t\t\t\n\t\t\tfor (var cc in procJson.coaches)\n\t\t\t{\n\t\t\t\tvar cjson = procJson.coaches[cc];\n\t\t\t\t\n\t\t\t\t//5. Make sure Group Name is NONE of ['@NONE@','723','380','369']\n\t\t\t\t//\t- Group name unassigned, TBC, RECRUITING and Multile Coaches\n\t\t\t\tif (!cjson.groupid || cjson.groupid == '723' ||\n\t\t\t\t\tcjson.groupid == '380' || cjson.groupid == '369')\n\t\t\t\t{\n\t\t\t\t\tlog(\n\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t'Group name issue one of Unassigned, TBC, Recruiting and/or Multiple Coaches',\n\t\t\t\t\t\t'Coach Group Name value is '+cjson.groupname\n\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t\t'<b>FAIL - Booking '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t\t'- Unable to add <i>Coach '+cjson.entityid+' ('+cc+')</i> because '+\n\t\t\t\t\t\t\t\t\t'Group name issue one of Unassigned, TBC, Recruiting and/or Multiple Coaches<br/>'+\n\t\t\t\t\t\t\t\t\t'Coach Group Name value is '+(cjson.groupname?cjson.groupname:'-EMPTY-')+\n\t\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//5a. Make sure match on Subsidiary\n\t\t\t\tif (cjson.subsidiary != bjson.subsidiary)\n\t\t\t\t{\n\t\t\t\t\tlog(\n\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t'Subsidiary does not match',\n\t\t\t\t\t\t'Coach ('+cjson.subsidiary+') and Booking '+\n\t\t\t\t\t\t\t'('+bjson.subsidiary+') Subsidiary does NOT Match'\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t'<b>FAIL - Booking '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t'- Unable to add <i>Coach '+cjson.entityid+' ('+cc+')</i> because '+\n\t\t\t\t\t\t\t\t'Subsidiary does not match<br/>'+\n\t\t\t\t\t\t\t\t'Coach ('+cjson.subsidiary+') and Booking '+\n\t\t\t\t\t\t\t\t'('+bjson.subsidiary+') Subsidiary does NOT Match'+\n\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//5b. Booking Spoken language matches Coaches Native OR Fluent languages\n\t\t\t\tif (cjson.nativelanguageid != bjson.language &&\n\t\t\t\t\t!cjson.fluentlanguages.contains(bjson.language))\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Nov 25. 2015 - Do extra check to see if it can be programmatically accepted. \n\t\t\t\t\t//\t\t\t\t English vs. English - US 1/37\n\t\t\t\t\t//\t\t\t\t Danish vs. Danish (Same) 44/45\n\t\t\t\t\tvar acceptLangEng = ['1','37'],\n\t\t\t\t\t\taccpetLangDanish = ['44', '45'],\n\t\t\t\t\t\tcoachIsEnglish = acceptLangEng.contains(cjson.nativelanguageid),\n\t\t\t\t\t\tbookIsEnglish = acceptLangEng.contains(bjson.language),\n\t\t\t\t\t\tcoachIsDanish = accpetLangDanish.contains(cjson.nativelanguageid),\n\t\t\t\t\t\tbookIsDanish = accpetLangDanish.contains(bjson.language),\n\t\t\t\t\t\tbookEnglishInFluent = false,\n\t\t\t\t\t\tbookDanishInFluent = false;\n\t\t\t\t\t\n\t\t\t\t\tif (bookIsEnglish || bookIsDanish)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor (var c=0; cjson.fluentlanguages && c < cjson.fluentlanguages.length; c+=1)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar fluentLang = cjson.fluentlanguages[c];\n\t\t\t\t\t\t\tlog('debug','checking fluent',fluentLang);\n\t\t\t\t\t\t\tif (acceptLangEng.contains(fluentLang) && !bookEnglishInFluent)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbookEnglishInFluent = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif (accpetLangDanish.contains(fluentLang) && !bookDanishInFluent)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tbookDanishInFluent = true;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tlog('debug','c-native // b-lang // c-fluent', cjson.nativelanguageid+' // '+bjson.language+' // '+cjson.fluentlanguages);\n\t\t\t\t\tlog('debug','c-english // b-english // b-english-fluent // b-danish-fluent',coachIsEnglish+' // '+bookIsEnglish+' // '+bookEnglishInFluent+' // '+bookDanishInFluent);\n\t\t\t\t\t\n\t\t\t\t\t//Check to see if we need to do further checking \n\t\t\t\t\tif ( (coachIsEnglish && bookIsEnglish) || \n\t\t\t\t\t\t (coachIsDanish && bookIsDanish) || \n\t\t\t\t\t\t (bookIsEnglish && bookEnglishInFluent) || \n\t\t\t\t\t\t (bookIsDanish && bookDanishInFluent) )\n\t\t\t\t\t{\n\t\t\t\t\t\tlog('debug','This is Good By Pass it','By Passing');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\tlog(\n\t\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t\t'Langauges does not match',\n\t\t\t\t\t\t\t'Booking Langauge: '+bjson.language+\n\t\t\t\t\t\t\t\t' does not match coaches Native: '+cjson.nativelanguageid+\n\t\t\t\t\t\t\t\t' OR Fluent languages: '+cjson.fluentlanguages\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t\t'<b>FAIL - Booking '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t\t'- Unable to add <i>Coach '+cjson.entityid+' ('+cc+')</i> because '+\n\t\t\t\t\t\t\t\t\t'Language does not match<br/>'+\n\t\t\t\t\t\t\t\t\t'Booking Langauge: '+bjson.language+\n\t\t\t\t\t\t\t\t\t' does not match coaches Native: '+cjson.nativelanguageid+\n\t\t\t\t\t\t\t\t\t' OR Fluent languages: '+cjson.fluentlanguages+\n\t\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n\n\n\n\t\t\t\t\n/*\t\t\t\t//Ticket 14383 - remove Country validation\n\n\t\t\t\t//5c. Make sure Country matches\n\t\t\t\tif (cjson.deliverycountryid != bjson.country)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t//Nov 25 2015 - Add in check to ignore if booking is virtual and coach is virtual certified\n\t\t\t\t\tif (bjson.jobtype != '13' || (bjson.jobtype == '13' && cjson.virtualcertified != 'T' ))\n\t\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\t\tlog(\n\t\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t\t'(Type: '+bjson.jobtypetext+') Delivery Country and Booking Country does not match',\n\t\t\t\t\t\t\t'Booking country: '+bjson.countrytext+' ('+bjson.country+')'+\n\t\t\t\t\t\t\t\t' and Coach country: '+cjson.deliverycountrytext+' ('+cjson.deliverycountryid+')'+\n\t\t\t\t\t\t\t\t' does NOT match'\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t\t'<b>FAIL - Booking ('+bjson.jobtypetext+') '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t\t'- Unable to add <i>Coach '+cjson.entityid+' ('+cc+')</i> because '+\n\t\t\t\t\t\t\t\t\t'Country does not match<br/>'+\n\t\t\t\t\t\t\t\t\t'Booking country: '+bjson.countrytext+' ('+bjson.country+')'+\n\t\t\t\t\t\t\t\t\t' and Coach country: '+cjson.deliverycountrytext+' ('+cjson.deliverycountryid+')'+\n\t\t\t\t\t\t\t\t\t' does NOT match'+\n\t\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}\n*/\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//6. Make sure coach has portal ID\n\t\t\t\tif (!cjson.portalid)\n\t\t\t\t{\n\t\t\t\t\tlog(\n\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t'Coach is missing portal id',\n\t\t\t\t\t\t'Coach ID: '+cjson.entityid+\n\t\t\t\t\t\t\t'(Internal ID '+\n\t\t\t\t\t\t\tcc+\n\t\t\t\t\t\t\t')'\n\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t\t'<b>FAIL - Coach '+cjson.entityid+' ('+cc+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t\t'- Missing Portal ID '+\n\t\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t\t\t\n\t\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//5d. Search against Coach Pool and make sure - This Error is NOT logged as an error \n\t\t\t\t//\t\tthis coach hasn't been invited already for THIS booking\n\t\t\t\tvar invflt = [new nlobjSearchFilter('isinactive', null, 'is', 'F'),\n\t\t\t\t new nlobjSearchFilter('custrecord_bo_coachpool_bookingid', null, 'anyof', bb),\n\t\t\t\t new nlobjSearchFilter('custrecord_bo_coachpool_userid', null, 'anyof', cjson.portalid),\n\t\t\t\t new nlobjSearchFilter('custrecord_bo_coachpool_coachid', null, 'anyof', cjson.groupid),\n\t\t\t\t new nlobjSearchFilter('custrecord_bo_coachpool_coachname', null, 'anyof', cc)];\n\t\t\t\tvar invcol = [new nlobjSearchColumn('internalid')];\n\t\t\t\tvar invrs = nlapiSearchRecord('customrecord_bo_coachpool', null, invflt, invcol);\n\t\t\t\t\n\t\t\t\tif (invrs && invrs.length > 0)\n\t\t\t\t{\n\t\t\t\t\t//Move on with next coach since this Coach has already been invited for THIS Booking\n\t\t\t\t\tlog(\n\t\t\t\t\t\t'debug',\n\t\t\t\t\t\t'Alredy Invited',\n\t\t\t\t\t\t'Coach '+\n\t\t\t\t\t\t\tcjson.groupname+\n\t\t\t\t\t\t\t' (Vendor ID: '+\n\t\t\t\t\t\t\tcc+\n\t\t\t\t\t\t\t') is already invited for Booking ID '+\n\t\t\t\t\t\t\tbb\n\t\t\t\t\t);\n\t\t\t\t\t\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//*********** CAN Invite ******************/\n\t\t\t\tlog('debug','CAN INVITE Coach','Coach '+cc+' can be invited to Booking '+bb);\n\t\t\t\t\n\t\t\t\ttry \n\t\t\t\t{\n\t\t\t\t\tvar ivrec = nlapiCreateRecord('customrecord_bo_coachpool');\n\t\t\t\t\tivrec.setFieldValue('custrecord_bo_coachpool_bookingid', bb);\n\t\t\t\t\tivrec.setFieldValue('custrecord_bo_coachpool_apperyid', bjson.apperyid);\n\t\t\t\t\tivrec.setFieldValue('custrecord_bo_coachpool_coachid', cjson.groupid);\n\t\t\t\t\tivrec.setFieldValue('custrecord_bo_coachpool_coachname', cc);\n\t\t\t\t\tivrec.setFieldValue('custrecord_bo_coachpool_userid', cjson.portalid);\n\t\t\t\t\tvar invid = nlapiSubmitRecord(ivrec, true, true);\n\t\t\t\t\t\n\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t'<b>SUCCESS - Booking '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t'- Successfully invited <i>Coach '+cjson.entityid+' ('+cc+')</i> // '+\n\t\t\t\t\t\t\t\t'Invitation ID '+invid+' created.'+\n\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t}\n\t\t\t\tcatch (inverr)\n\t\t\t\t{\n\t\t\t\t\tprocsLog += '<li>'+\n\t\t\t\t\t\t\t\t'<b>FAIL - Booking '+bjson.entityid+' ('+bb+')</b>: <br/>'+\n\t\t\t\t\t\t\t\t'- Failed to invite <i>Coach '+cjson.entityid+' ('+cc+')</i> because of unexpected error<br/> '+\n\t\t\t\t\t\t\t\tgetErrText(inverr)+\n\t\t\t\t\t\t\t\t'<br/><br/>'+\n\t\t\t\t\t\t\t\t'</li>';\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Reschedule logic\n\t\t\t//Set % completed of script processing\n\t\t\tvar pctCompleted = Math.round(((parseInt(bjson.index)+1) / brs.length) * 100);\n\t\t\tnlapiGetContext().setPercentComplete(pctCompleted);\n\t\t\t\n\t\t\t//Reschedule here will ONLY apply if we are running low on usage\n\t\t\tif (nlapiGetContext().getRemainingUsage() < 1000) \n\t\t\t{\n\t\t\t\t//reschedule\n\t\t\t\tlog('debug','Getting Rescheduled at', bb);\n\t\t\t\tvar rparam = {\n\t\t\t\t\t'custscript_420_lastprocid':bb,\n\t\t\t\t\t'custscript_420_triguserid':paramJson.triguser,\n\t\t\t\t\t'custscript_420_tpid':paramJson.progid\n\t\t\t\t};\n\t\t\t\t\n\t\t\t\tnlapiScheduleScript(nlapiGetContext().getScriptId(), nlapiGetContext().getDeploymentId(), rparam);\n\t\t\t\tbreak;\n\t\t\t}\t\n\t\t\t\n\t\t}//End For each Loop for Booking\n\t\t\n\t\t//Send Notification IF error exists\n\t\tif (procsLog)\n\t\t{\n\t\t\tvar sbj = 'Error Occured during Auto Invitation Process',\n\t\t\t\tmsg = 'Training Programme Internal ID '+paramJson.progid+\n\t\t\t\t\t ' had one or more failures while attempting to auto invite selected coaches.<br/><br/>'+\n\t\t\t\t\t '<ul>'+procsLog+'</ul>'+\n\t\t\t\t\t '<br/><br/>Process JSON Object:<br/>'+\n\t\t\t\t\t JSON.stringify(procJson);\n\t\t\t\n\t\t\tvar recordObj = {\n\t\t\t\t'record':paramJson.progid,\n\t\t\t\t'recordtype':'customrecord_trainingprogramme'\n\t\t\t};\n\t\t\tnlapiSendEmail(\n\t\t\t\t-5, \n\t\t\t\tparamJson.triguser, \n\t\t\t\tsbj, \n\t\t\t\tmsg,\n\t\t\t\tnull,\n\t\t\t\tnull,\n\t\t\t\trecordObj\n\t\t\t);\n\t\t}\n\t\t\n\t}\n\tcatch (execerr)\n\t{\n\t\t//log and throw the error to terminate the script and notify the users\n\t\tlog(\n\t\t\t'error',\n\t\t\t'EarlyBird Auto Invite Error',\n\t\t\tgetErrText(execerr)+' // '+JSON.stringify(paramJson)\n\t\t);\n\t\t\n\t\tthrow nlapiCreateError(\n\t\t\t'AUTOINVITE-ERR', \n\t\t\t'Script Terminating Error occured with '+\n\t\t\t\t'following Parameter Values: '+\n\t\t\t\tJSON.stringify(paramJson)+\n\t\t\t\t' // '+\n\t\t\t\tgetErrText(execerr), \n\t\t\tfalse\n\t\t);\n\t}\n}", "function activate_sim(){\t\r\n\tif(document.forms[\"activate_my_sim_form\"][\"phone_number\"].value== 0862233440 && document.forms[\"activate_my_sim_form\"][\"activation_code\"].value== \"XP54321\"\r\n\t\t&& document.forms[\"activate_my_sim_form\"][\"broadband_number\"].value==1234567890123456789){\r\n\t\talert(\"Sucess! Your Sim Card has been activated.\");\r\n\t\treturn true;\r\n\t}\r\n\telse{\r\n\t\tdocument.getElementById(\"error8\").innerHTML=\"Error !\"+\"<br>\"+\"The information entered does not match the card.\"+\"<br>\"+\"Please Verify.\";\r\n\t}\r\n\t\r\n\treturn false;\r\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 test_candu_verify_global_utilization_metrics() {}", "function startCheck(){\r\n\telementSelectedProfileID();\r\n\telementSelectedActivity();\r\n\telementSelectedAmbience();\r\n\telementSelectedMinRSVP();\r\n\telementSelectedMaxRSVP();\r\n\telementSelectedStartDate();\r\n\telementSelectedEndDate();\r\n\telementSelectedDuration();\r\n\telementSelectedStartTime();\r\n\telementSelectedEndTime();\r\n\telementSelectedLocation();\r\n\telementSelectedFitness();\r\n}", "function _0001485874487252_96_TrackerToValidateTicket()\n{\n Log.AppendFolder(\"_0001485874487252_96_TrackerToValidateTicket\");\n try{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n aqUtils.Delay(2000);\n Button.clickOnButton(selectDirectoryButton); \n \t\t if(!slidetoggleAutovalidateslidetogg.FlexObject.active){\n slidetoggleAutovalidateslidetogg.Click(); \n } else{\n \t\t\t Button.clickOnButton(selectDirectoryButton); \n \t\t }\n Button.clickOnButton(selectDirectoryButton);\n if(toggleTrackertoggle.FlexObject.active){\n Log.Message(\"Tracker is not log in.\"); \n } else{\n \t\t\t merlinLogError(\"Tracker is not log in.\"); \n \t\t }\n Button.clickOnButton(selectDirectoryButton);\n var groupNm=defaultGroupName;\n var paymentTypeForReservation = \"Cash\";\n var keyWordNm =\"Daily Admission\";\n var packageNm =\"Date/Time\";\n var subPakNm =\"Adult\";\n var qtyT = 2;\n var dateD =CommonCalender.getTodaysDate(); \n addNewTicket(keyWordNm,packageNm,subPakNm,qtyT,dateD); \n \n // WrapperFunction.selectKeyword(\"Daily Tickets\");\n // selectPackage(\"Saver Admission\",\"Adult\");\t\t \n// aqUtils.Delay(3000); \n// if(datetimeformSubWindow.Exists){\n// selectDateFromSubWindow(CommonCalender.getTodaysDate()); //mm-dd-yyyy \n// selectNextButtonFromSubWindow();\n// }\n WrapperFunction.finilizeOrder(); \n aqUtils.Delay(2000);\n var settlementSubTotal = orderDetailsSubTotal.Caption;\n var settlementTotal =orderDetailsTotal.Caption;\n Log.Message(\"Verified order details on settlement page\");\n selectPaymentTypeAddRequiredFields(\"Cash\");\n var applyAmount= aqString.Replace(settlementTotal,\"$\",\"\"); \n OrderInfo.prototype.OrderTotalAmount = applyAmount.trim();\n Log.Message(\"Order total amount is set:\",OrderInfo.prototype.OrderTotalAmount); \n if(applyAmount != 0){\n Log.Message(\"Apply amount\");\n WrapperFunction.setTextValue(PayamountTextBox,applyAmount);\n Button.clickOnButton(applyButton); \n }\n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(2000);\n if(validateTicketspopUp.Exists)\n {\n validateTicket(\"Don't Validate\");\n }\n else{\n merlinLogError(\"Validate popup is not displayed\");\n }\n verifyTotalOnConfirmationPage(settlementTotal); \n var orderId = cnf_orderID1.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n } \n var OrderID= (orderId.split('#')[1]).trim();\n OrderInfo.prototype.OrderID = OrderID;\n Log.Message(\"Order id is set:\"+OrderID);\n AppLoginLogout.logout();\n}\ncatch(e)\n{\n merlinLogError(\"Exception in Test script\");\n //Runner.Stop();\n}\nfinally {\n\t\t Log.PopLogFolder();\n\t } \n}", "function checkProductControls()\r\n {\r\n if ($claimType == 'Warranty')\r\n {\r\n productControls(false); // disable\r\n }\r\n else if ($claimType == 'Non-Warranty')\r\n {\r\n productControls(false); // disable\r\n }\r\n else if($claimStatus == 'Created')\r\n {\r\n productControls(true); // enable\r\n }\r\n else\r\n {\r\n productControls(false); // disable\r\n }\r\n }", "function ts_staging_regression_login_page()\n\n{\n// open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n tc_log_on_to_inrstar_valid_credentials();\n tc_log_on_to_inrstar_no_credentials();\n tc_log_off_inrstar();\n// tc_password_reset_code_email();\n \n//Probably need a close application here\n //close_application\n}", "function SauceLabsUac() {}", "function loadpage() {\n var pageurl = window.location.href;\n\n //On page load, the content of all the 4 product types is disabled\n var elements = document.getElementsByClassName(\"productCont\");\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n\n //Below line reads the product type selected by the user in dashboard page \n var product = getParameterByName('producttype', window.location.href.toLowerCase());\n if (pageurl.toLowerCase().indexOf(\"?producttype=\") > 0) {\n\n //If the user clicks Accept.js product type in the dashboard page, the following code gets executed.\n if (product == \"acceptjs\") {\n\n //The product type selected by the user in the dashboard page is assigned to the activeCont variable which is used for future reference\n activeCont = \"acceptjs\";\n\n //Below function checks if customer ID is passed in the request URL \n checkForCustomerIdInUrl(pageurl)\n }\n\n //If the user clicks Accept.js UI product type in the dashboard page, the following code gets executed\n else if (product == \"acceptui\") {\n\n //The product type selected by the user in the dashboard page is assigned to the activeCont variable which is used for future reference\n activeCont = \"acceptui\";\n\n //Below function checks if customer ID is passed in the request URL \n checkForCustomerIdInUrl(pageurl)\n }\n\n //If the user clicks Accept Hosted product type in the dashboard page, the following code gets executed.\n else if (product == \"accepthosted\") {\n activeCont = \"accepthosted\";\n\n //Below logic is to check if there are more than one parameter passed in the URL \n if (pageurl.toLowerCase().indexOf(\"&\") > 0) {\n \n //Customer ID is an optional parameter for Accept Hosted product type\n //Below code gets executed when the user passes customer id in the request URL\n if (pageurl.toLowerCase().indexOf(\"&customerid=\") > 0) {\n var id = getParameterByName('customerid', window.location.href.toLowerCase());\n\n //Validation of customer id will be done by using the below function\n var result = ValidateCustomer(id);\n\n //If the customer id is a valid id, then AcceptHosted function gets executed\n if (result.valid)\n {\n AcceptHosted(id);\n }\n else {\n\n //If the invalid customer id declared in the URL, then user gets redirected to the error message section\n var elements = document.getElementsByClassName(\"productCont\");\n\n //The content of all the 4 product types is disabled on the page\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Customer not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n }\n }\n //Below code gets executed when the user passes when there are more than one parameters (other than customer id) which are invalid in the request URL\n else {\n\n //Below code gets executed when user passes invalid parameters in the URL \n var elements = document.getElementsByClassName(\"productCont\");\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Product Type not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n\n }\n }\n else {\n\n //When customer id parameter is not passed in the URL, AcceptHosted function gets executed\n AcceptHosted('');\n }\n }\n\n //If the user clicks Accept Customer product type in the dashboard page, the following code gets executed.\n else if (product == \"acceptcustomer\") {\n activeCont = \"acceptcustomer\";\n\n //Below line populates the customer id textbox with a valid customer id\n document.getElementById(\"txtCustomerId\").value = globalVars.ValidCustomer;\n \n //Below code gets executed when the user passes customer id in the request URL\n if (pageurl.toLowerCase().indexOf(\"&customerid=\") > 0) {\n\n document.getElementById(\"acceptCustomer\").style.display = \"none\";\n\n //Below line gets the customer id declared in the url by the user\n var id = getParameterByName('customerid', window.location.href.toLowerCase());\n\n //Below function checks if the customer id is already validated or not\n //Customer id validaton occurs on click of continue button in dashboard and on accept customer page load\n //In order to avoid multiple validation requests to API, storing the validation status in the session storage\n var customerIdValidationStatus = sessionStorage.getItem('isValidated');\n\n //If customer id is not validated\n if (customerIdValidationStatus != \"true\") {\n\n //Validation of customer id will be done by using the below function\n var result = ValidateCustomer(id);\n\n //If the customer id is a valid id, then AcceptCustomer function gets executed\n if (result.valid)\n {\n AcceptCustomer(id);\n }\n else {\n\n //If the invalid customer id declared in the URL, then user gets redirected to the error message section\n var elements = document.getElementsByClassName(\"productCont\");\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Customer not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n }\n\n }\n //If customer id is already validated in dashboard page\n else {\n AcceptCustomer(id);\n sessionStorage.setItem('isValidated', 'false');\n }\n }\n else {\n\n //If customer id is not provided in the URL, a pop up to enter customer id is displayed.\n document.getElementById(\"acceptCustomer\").style.display = \"block\";\n }\n }\n else {\n\n //Below code gets executed when user passes invalid product type parameters in the URL \n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Product Type not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n }\n }\n else {\n\n //Below code gets executed when user passes invalid product type parameters in the URL \n if (document.getElementById(\"invalidPage\") != null) {\n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Product Type not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n }\n }\n}", "function ts_psr_treatment()\n\n{\n\n//Opens INRstar\n open_application(\"INRstar\");\n\n//Test cases to be run within the Test Suite\n\n//parameters ()\n tc_add_historic\n \n//Closes INRstar\n close_application();\n\n}", "function OxenValidation(){\r\n\r\n \tif (tempSupplies[OXEN] > 0){\r\n\t\t\tinitOpening();\r\n\t\t} \r\n\t\telse{\r\n\t\t\talert(\"Don't forget, you'll need oxen to pull your wagon\");\r\n\t\t}\r\n}", "function CAM_689()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_689.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Check Error on Finish Pane\n AssertClass.CompareString(\"DFR maximum record length has to be at least 100ms more than the pre-fault.\",ConfigEditor_FinishPage.GetErrorText(\"Fault Recording\"),\"Checking for Error Validation on Finish Pane.\")\n \n Log.Message(\"Pass:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that user tries to set minimum DFR record length equal to Prefault time\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "function clickCheck() {\nif (!checkSubscription()) {\nalert('You must be logged in as an IGN Insider to access this content.')\n}\n}", "function CAM_690()\n{\n try\n {\n Log.Message(\"Started TC:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses \")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\MaxDFR.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step8. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step9. Check for Prefault and Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(), MaxDFRLength,\"Checking for Max DFR Value\")\n \n Log.Message(\"Pass:- Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that minimum and maximum limit for DFR record length with non-Transco licenses\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "function suivant(){\n if(active==\"idee\"){\n reunion_open();\n }else if (active==\"reunion\") {\n travail_open();\n }else if (active==\"travail\") {\n deploiement_open();\n }\n }", "function hybridSimRequirements(){\n var i = 0;\n \n var globalModel = pub.global_models;\n var simCoordinator = pub.coordinators;\n var expSubstructure = pub.exp_substructures;\n var cordOutput = pub.coordinator_outputs;\n var expOutput = pub.exp_outputs;\n\n if (hybridSimulation === undefined || hybridSimulation == '') {\n return;\n } else {\n hybridSimulation.forEach(function (exp) {\n var title = hybridSimulation[i].value.title;\n\n checklist['hybridSimulations'+i] = {};\n checklist['hybridSimulations'+i].name = title;\n checklist['hybridSimulations'+i].category = 'hybrid';\n \n //global model\n if (globalModel === undefined) {\n checklist['hybridSimulations'+i].global_model = false;\n } else {\n fillChecklist(globalModel, 'hybridSimulations', 'global_model', exp, i);\n }\n //sim coordinator\n if (simCoordinator === undefined) {\n checklist['hybridSimulations'+i].coordinator = false;\n } else {\n fillChecklist(simCoordinator, 'hybridSimulations', 'coordinator', exp, i);\n }\n //coordinator output\n if (cordOutput === undefined) {\n checklist['hybridSimulations'+i].coordinator_output = false;\n } else {\n fillChecklist(cordOutput, 'hybridSimulations', 'coordinator_output', exp, i);\n }\n //exp substructure\n if (expSubstructure === undefined) {\n checklist['hybridSimulations'+i].experiment_substructure = false;\n } else {\n fillChecklist(expSubstructure, 'hybridSimulations', 'experiment_substructure', exp, i);\n }\n //exp output\n if (expOutput === undefined) {\n checklist['hybridSimulations'+i].experiment_output = false;\n } else {\n fillChecklist(expOutput, 'hybridSimulations', 'experiment_output', exp, i);\n }\n\n requirements.hybridReq.forEach(function (req) {\n if (exp.value[req] == '' || exp.value[req] == []) {\n checklist['hybridSimulations'+i][req] = false;\n } else {\n checklist['hybridSimulations'+i][req] = true;\n }\n });\n i++;\n });\n }\n return;\n }", "function checkAcmActivation(dev) {\n var domain = parent.config.domains[dev.domainid];\n if ((domain == null) || (domain.amtacmactivation == null) || (domain.amtacmactivation.certs == null) || (domain.amtacmactivation.certs.length == 0)) return { err: \"Server does not have any ACM activation certificates.\" };\n const activationCerts = domain.amtacmactivation.certs;\n if ((dev.mpsConnection.tag.meiState == null) || (dev.mpsConnection.tag.meiState.Hashes == null) || (dev.mpsConnection.tag.meiState.Hashes.length == 0)) return { err: \"Intel AMT did not report any trusted hashes.\" };\n const deviceHashes = dev.mpsConnection.tag.meiState.Hashes;\n \n // Get the trusted FQDN of the device\n var trustedFqdn = null;\n if (dev.mpsConnection.tag.meiState.OsDnsSuffix != null) { trustedFqdn = dev.mpsConnection.tag.meiState.OsDnsSuffix; }\n if (dev.mpsConnection.tag.meiState.DnsSuffix != null) { trustedFqdn = dev.mpsConnection.tag.meiState.DnsSuffix; }\n if (trustedFqdn == null) return { err: \"No trusted DNS suffix reported\" };\n\n // Find a matching certificate\n var gotSuffixMatch = false;\n var devValidHash = false;\n for (var i in activationCerts) {\n var cert = activationCerts[i];\n var certDnsMatch = checkAcmActivationCertName(cert.cn, trustedFqdn);\n if (certDnsMatch == true) { gotSuffixMatch = true; } \n if ((cert.cn == '*') || certDnsMatch) {\n for (var j in deviceHashes) {\n var hashInfo = deviceHashes[j];\n if ((hashInfo != null) && (hashInfo.isActive == 1)) {\n devValidHash = true;\n if ((hashInfo.hashAlgorithmStr == 'SHA256') && (hashInfo.certificateHash.toLowerCase() == cert.sha256)) { return { cert: cert, fqdn: trustedFqdn, hash: cert.sha256 }; } // Found a match\n else if ((hashInfo.hashAlgorithmStr == 'SHA1') && (hashInfo.certificateHash.toLowerCase() == cert.sha1)) { return { cert: cert, fqdn: trustedFqdn, hash: cert.sha1 }; } // Found a match\n }\n }\n }\n }\n if (!devValidHash) { return { err: \"Intel AMT has no trusted root hashes for \\\"\" + trustedFqdn + \"\\\".\" }; } // Found no trusted root hashes\n if (gotSuffixMatch) { return { err: \"Certificate root hash matching failed for \\\"\" + trustedFqdn + \"\\\".\" }; } // Found a DNS suffix match, but root hash failed to match.\n return { err: \"No matching ACM activation certificate for \\\"\" + trustedFqdn + \"\\\".\" }; // Did not find a match\n }", "function IndividualAttestation() {}", "function check() {\n \n var production = \"75f2d410-0a3a-44d0-8240-08637eb5d2f8\";\n //getSnapshot(snapshot);\n postDeviceDetails(\"\", production);\n //getChannels();\n}", "function hold_btn_Click(eventObject) {\r\n var userRole = cordys.getNodeText(GetPoUserMasterCompleteObjectModel.getData(), \".//*[local-name()='USER_ROLE']\", \"\", \"\");\r\n var callID = \"\";\r\n var currentRow = caseTbl.getCheckedRows();\r\n callID = callId[currentRow[0].index].getValue();\r\n if (userRole == \"StakeHolderMaker\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'HOLD');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is held successfully\");\r\n hold_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Holding failed. Please Contact the admin\");\r\n }\r\n } else if (userRole == \"ADMIN\" || userRole == \"VendorManager\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'HOLD');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is held successfully\");\r\n hold_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Holding failed. Please Contact the admin\");\r\n }\r\n }\r\n}", "function Simulator_NotifyControllerRequestIsQA()\n{\n\t//use the __QA_ON value\n\treturn __QA_ON;\n}", "function C37512_Pay_CC_required_fields_Expiration()\n{\ntry {\n Log.AppendFolder(\"C37512_Pay_CC_required_fields_Expiration\");\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n var keyWordNm =\"Daily Admission\";\n var packageNm = \"Date/Time\";\n var subPakNm=\"Children (Ages 3-12)\";\n var qty = 2; \n var dateD = CommonCalender.getTodaysDate();\n selectQuantity(qty);\n var givenPaymentType = \"Credit Card\";\n \n WrapperFunction.selectKeywordName(keyWordNm);\n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(3000); \n if(datetimeformSubWindow.Exists){\n selectDateFromSubWindow(dateD); \n selectNextButtonFromSubWindow();\n }\n finilizeOrder();\n aqUtils.Delay(2000);\n \n var settlementTotal =orderDetailsTotal.Caption;\n applyAmount= aqString.Replace(settlementTotal,\"$\",\"\"); \n OrderInfo.prototype.OrderTotalAmount = applyAmount.trim();\n ConvertReservationsToPurchase.selectPaymentType(givenPaymentType);\n Button.clickOnButton(CC_EnterNumber);\n SelectPaymentType.enterCCNumber(\"4444333322221111\");\n CC_ExpirationMonth.ClickItem(\"01 - January\");\n var yearDisplay = CC_ExpirationYear.Label(\"labelDisplay\").Caption;\n var currYear = aqDateTime.GetYear(aqDateTime.Today());\n if(VerifyCheckProperty.compareStringObj(yearDisplay,currYear))\n {\n Log.Message(\"Default current year displayed\"); \n }else{\n merlinLogError(\"Default current year is not displayed\");\n return;\n }\n \n CC_StreetAddress.Keys(\"Pune\");\n CC_ZipCode.Keys(\"1234\"); \n aqUtils.Delay(2000);\n Button.clickOnButton(applyBalance);\n \n if(!ccMonthlErrorindicator.Exists){\n merlinLogError(\"Month error indicator is not displayed.\");\n return;\n } \n CC_ExpirationMonth.ClickItem(\"05 - May\");\n CC_ExpirationYear.Keys(\"[Down][Down][Down]\");\n aqUtils.Delay(2000);\n Button.clickOnButton(applyBalance); \n aqUtils.Delay(2000); \n// var cardLastDigit = paymentListFirstItem.PaymentListItem(\"payItem\").Label(\"descLabel\").Caption;\n// if( !VerifyCheckProperty.compareStringObj(cardLastDigit,\"Visa 1111\")){\n// merlinLogError(\"Credit Card last digit is not displayed in applied amount.\");\n// return;\n// }\n var correctcardLastDigit = false;\n var cnt = paymentListFirstItem.PaymentListItem(\"payItem\").HGroup(0).ChildCount;\n for( j = 0; j<cnt;j++){\n lbl= paymentListFirstItem.PaymentListItem(\"payItem\").HGroup(0).Child(j).Caption;\n if(lbl.startsWith(\"Visa 1111\")){\n correctcardLastDigit = true; \n }\n } \n if(correctcardLastDigit){\n Log.Message(\"Credit Card last digit is correctly displayed in applied amount.\");\n return; \n }else{\n merlinLogError(\"Credit Card last digit is not displayed in applied amount.\");\n return; \n }\n Log.Message(\"Complete the order\");\n WrapperFunction.settlementCompleteOrder();\n aqUtils.Delay(3000);\n validateTicket(\"Don't Validate\");\n Log.Message(\"Don't Validate the order\"); \n verifyTotalOnConfirmationPage(settlementTotal);\n var orderId = cnf_orderID1.Caption;\n if (orderId == null){\n merlinLogError(\"Order id is not present\");\n return;\n } \n var OrderID= (orderId.split('#')[1]).trim();\n OrderInfo.prototype.OrderID = OrderID;\n Log.Message(\"Order id is set:\"+OrderID); \n \n } catch (e) {\n\t merlinLogError(\"Oops! There's some glitch in the script: \" + e.message);\n\t return;\n }\n finally { \n AppLoginLogout.logout(); \n\t Log.PopLogFolder();\n } \n}", "function CAM_725()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_725.xlsx\";\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5. Check the Max DFR Value\n var MaxDFR = ConfigEditor_FaultRecordingPage.GetMaxDFR();\n Log.Message(\"Max DFR value is\" + MaxDFR);\n \n //Step6. //Enter MaxDFR_Min\n var MaxDFR_Min = CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Min\")\n AssertClass.IsFalse(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Min),\"Setting and checking Max DFR\")\n \n //Step7. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step8. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step9. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step10. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR,\"Checking Max DFR value\")\n\n //Step11. //Enter MaxDFR_Max\n var MaxDFR_Max =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Max\")\n AssertClass.IsFalse(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Max),\"Setting and checking Max DFR\")\n \n //Step12. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step13. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step14. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step15. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR,\"Checking Max DFR value\")\n \n //Step16 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step17. //Enter MaxDFR_Mid\n var MaxDFR_Mid =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR_Mid\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFR_Mid),\"Setting and checking Max DFR\")\n \n //Step18. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step19. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step20. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step21. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFR_Mid,\"Checking Max DFR value\")\n\n //Step22. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n \n Log.Message(\"Pass:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that user tries to input DFR record length value less/greater than minimum/maximum value\")\n }\n}", "function fnInstituteOtherActivityMandatoryCheck(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\n\tswitch (operation) {\n\t\tcase 'View':\n if ($scope.instituteID == '' || $scope.instituteID == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Institute ID']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.instituteName == '' || $scope.instituteName == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Institute Name']);\n\t\t\t\treturn false;\n\t\t\t}\n \n\t\t\t if ($scope.activityID == '' || $scope.activityID == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity ID']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\n\t\tcase 'Save':\n\t\t\tif ($scope.instituteName == '' || $scope.instituteName == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Institute Name']);\n\t\t\t\treturn false;\n\t\t\t}\n if ($scope.instituteID == '' || $scope.instituteID == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Institute ID']);\n\t\t\t\treturn false;\n\t\t\t}\n if ($scope.activityID == '' || $scope.activityID == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity ID']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tif ($scope.activityName == '' || $scope.activityName == null) {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity Name']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.activityType == '' || $scope.activityType == null || $scope.activityType == 'Select option') {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity Type']);\n\t\t\t\treturn false;\n\t\t\t}\n if ($scope.groupID == '' || $scope.groupID == null) {\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Group ID']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.date == '' || $scope.date == null) {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity Date']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.dueDate == '' || $scope.dueDate == null) {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Due Date']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.level == '' || $scope.level == null || $scope.level == 'Select option') {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['Activity Level']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tif ($scope.venue == '' || $scope.venue == null) {\n\n\t\t\t\tfn_Show_Exception_With_Param('FE-VAL-001', ['venue']);\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\tbreak;\n\n\n\t}\n\treturn true;\n}", "function verifyAccount(accountToVerify,inputToVerify){\n let url;\n \n let from = 'verifyAccount';\n let channelId;\n switch(accountToVerify){\n case 'facebook':\n case 'youtube':\n case 'twitter':\n {\n let channelId;\n if (inputToVerify.value.indexOf('?') > -1 && accountToVerify != 'facebook' ){\n channelId = inputToVerify.value.split('?')[0];\n }else{\n channelId = inputToVerify.value;\n }\n url = functionBaseURL + '/app/linkAccount?channelId=' + channelId + '&platform=' + accountToVerify;\n userDataRequest(url, from, accountToVerify);\n }\n break;\n\n case 'twitch':\n case 'soundcloud':\n case 'domain':\n // channelId = document.getElementById('inputVerifyUserName').value;\n channelId = inputToVerify.value;\n url = functionBaseURL + '/app/linkAccount?channelId=' + channelId + '&platform=' + accountToVerify;\n // url = 'http://localhost:5001/bittube-airtime-extension/us-central1/app/linkAccount?channelId=' + channelId + '&platform=' + accountToVerify;\n userDataRequest(url, from, accountToVerify);\n break;\n }\n }", "function release_btn_Click(eventObject) {\r\n var callID = \"\";\r\n var currentRow = caseTbl.getCheckedRows();\r\n var userRole = cordys.getNodeText(GetPoUserMasterCompleteObjectModel.getData(), \".//*[local-name()='USER_ROLE']\", \"\", \"\")\r\n callID = callId[currentRow[0].index].getValue();\r\n if (userRole == \"StakeHolderMaker\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'RELEASE');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is released successfully\");\r\n release_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Releasing failed. Please Contact the admin\");\r\n }\r\n } else if (userRole == \"ADMIN\") {\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'RELEASE');\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n application.notify(\"The case is released successfully\");\r\n release_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Releasing failed. Please Contact the admin\");\r\n }\r\n }\r\n}", "activate(data) {\n return new Promise((resolve, reject) => {\n joi.validate(data, lib.Schemas.subscription.activate, (err, value) => {\n if (err) {\n return reject(new Errors.ValidationError(err))\n }\n return resolve(value)\n })\n })\n }", "function checkSprinklrCAREChatBot(orderSnapinObject) {\n \n try {\n console.log(\"checkSprinklrCAREChatBot Object Values:\", orderSnapinObject); //check in console if the values are coming correctly\n if (orderSnapinObject.orderNumber) {//Connect with eSupport what values needs to be sent\n var sprinklrChatBotVal = {\n \"engine\": \"dell-orderintent\",//Sprinklr defined engine Name\n \"payloadTags\": {\n \"lng\": language,\n \"orderNumber\": orderSnapinObject.orderNumber,\n \"issueType\": orderSnapinObject.issueType, //This nedds to be passed by eSupport\n \"buid\": orderSnapinObject.BUID,\n \"countryCode\": (orderSnapinObject.countryCode != null && orderSnapinObject.countryCode !=undefined) ? orderSnapinObject.countryCode: null //Need to confirm with Smita. If required eSupport needs to pass it\n },\n \"requestId\": orderSnapinObject.uuid,\n \"text\": orderSnapinObject.c_issueDescription, //Need to be Mandatior as per story [To Do]\n \"user_firstName\": orderSnapinObject.c_firstName,\n \"user_lastName\": orderSnapinObject.c_lastName,\n \"user_email\": orderSnapinObject.c_email,\n \"user_phoneNo\": orderSnapinObject.c_phoneNo,\n \"sprinklrURL\": (orderSnapinObject.sprinklrOrderURL != null && orderSnapinObject.sprinklrOrderURL != undefined) ? orderSnapinObject.sprinklrOrderURL : null,//check with eSupport\n \"intentApiURL\": (orderSnapinObject.orderIntentApiURL != null && orderSnapinObject.orderIntentApiURL != undefined) ? orderSnapinObject.orderIntentApiURL : null,//check with eSupport\n \"sprinklrLoadingMessage\": (orderSnapinObject.sprinklrLoadingMessage != null && orderSnapinObject.sprinklrLoadingMessage != undefined) ? orderSnapinObject.sprinklrLoadingMessage : null//check with eSupport\n };\n var res = getSprinklrOrderIntent(sprinklrChatBotVal); //the function belongs to eSupport \n return res;//If true open sprinklr chatBOt, If false open Snap-in\n } else {\n console.log(\"Sprinklr required Value is missing in orderSnapinObject. Pleae check the below object value\", orderSnapinObject);\n return false;//open Snap-in\n }\n\n } catch (e) {\n console.log(\"checkSprinklrChatBot-Error:\", e);\n return false;//open Snap-in\n }\n}", "function verify() {\r\n\tif(nameCheck())\r\n\t{\r\n\t\tconsole.log(\"Name Check Verified!\");\r\n\t\tif(emailCheck())\r\n\t\t{\r\n\t\t\tconsole.log(\"Email Check Verified!\");\r\n\t\t\tif(radioCheck())\r\n\t\t\t{\r\n\t\t\t\tconsole.log(\"Radio Check Verified!\");\r\n\t\t\t\tconsole.log(\"All Data Verified Successfully!\");\r\n\t\t\t\talert(\"Data Verified and Submitted!\");\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tconsole.log(\"Please Re-enter proper data again!\");\r\n\treturn false;\r\n}", "function verifyTicket(e) {\n var app = UiApp.getActiveApplication();\n \n /* Restauracao dos elementos de Callback */\n var ticket = e.parameter.ticket;\n var panel = e.parameter.panel;\n \n /* Abertura da planilha de controle de usuarios */\n var userSheet = SpreadsheetApp.openById(userSSKey).getActiveSheet();\n \n /* Obtencao dos dados de cadastro da planilha de controle de usuarios */\n var data = userSheet.getDataRange().getValues();\n \n /* Verificacao da existencia do ticket e chamada dos tratadores */\n for (var i = 0; i < userSheet.getLastRow(); i++) {\n if (data[i][0] == ticket) {\n app = ticketFound(app, panel, ticket, data[i][1], data[i][3], data[i][4]);\n return app;\n }\n }\n \n app = ticketNotFound(app, 1);\n return app;\n}", "function decreaseCustomerApproval() {\n // loginOwner()\n let tokenID = document.getElementById(\"decreaseApprovalTokenID\").value;\n let senderPrvtKey = document.getElementById(\"decreaseApprovalSenderPrvtKey\").value;\n let spenderAddress = document.getElementById(\"decreaseApprovalSpenderAddress\").value;\n let subtractedValue = document.getElementById(\"decreaseApprovalValue\").value;\n\n if (tokenID == \"\" || senderPrvtKey == \"\" || spenderAddress == \"\" || subtractedValue == \"\") {\n alert(\"You did not complete all the fields\");\n return;\n }\n\n decreaseApproval(web3.eth.getTransactionCount(getAddress(senderPrvtKey)),tokenID, senderPrvtKey, spenderAddress, subtractedValue, (err, success) => {\n if (err || success == false) {\n alert(\"Faild\");\n return;\n }\n alert(\"Success\");\n });\n}", "function updateAccountOnInit(type)\n{\n\tvar acctype = nlapiGetFieldText('custrecord_account_type');\n\tif(!acctype)\n\t{\n\t\talert('You cannot create a new account from here. Please use the path \"Setup -> COA Approval Process -> Accounts -> New\" to create a new account or click Ok to take you to this path.');\t\t\t\n\t\tvar rLink = reqUrl + nlapiResolveURL('RECORD', 'customrecord_coa');\n\t\twindow.open(rLink,'_self');\n\t}\n\tif(acctype == 'Other Asset' || acctype == 'Other Current Asset'|| acctype == 'Bank' || acctype == 'Long Term Liability' || acctype == 'Other Current Liability')\n\t{\n\t\tnlapiDisableField('custrecord_currency_value',true);\n\t}\n nlapiDisableField('custrecord_account_type', true);\n nlapiSetFieldValue('custrecord_approval_status_coa', '1');\n\tnlapiSetFieldValue('custrecord_date_approve_ea', '');\t\n\tvar subs = nlapiGetFieldValues('custrecord_subs_coa');\n\tvar subVal = subs[0]; \n if (subVal != null && subVal != '') \n\t{\n var filter = new Array();\n filter[0] = new nlobjSearchFilter('custrecord_subs_approver', null, 'anyof', subVal);\n filter[1] = new nlobjSearchFilter('isinactive', null, 'is', 'F');\n var rec = nlapiSearchRecord('customrecord_coaapprover', null, filter);\n if (rec != null) \n\t\t{\n var coaApprover = nlapiLookupField('customrecord_coaapprover', rec[0].getId(), 'custrecord_coaapp');\n nlapiSetFieldValue('custrecord_approver_coa', coaApprover);\n }\n else \n\t\t{\n alert('There is no Approver assigned for this Subsidiary. Please contact your Administrator.');\n nlapiSetFieldValue('custrecord_approver_coa', '');\n return false;\n }\n }\n else \n\t{\n nlapiSetFieldValue('custrecord_approver_coa', '');\n return false;\n } \n}", "function checkForCustomerIdInUrl(pageurl)\n{\n //Accept.js and Accept.js UI accepts only product type\n //If the user passes customer id to Accept.js or Accept.js UI product type, then user gets redirected to the error message section\n if (pageurl.toLowerCase().indexOf(\"&customerid=\") > 0) {\n\n //The content of all the 4 product types is disabled on the page\n var elements = document.getElementsByClassName(\"productCont\");\n for (var x = 0; x < elements.length; x++) {\n elements[x].style.display = \"none\";\n }\n\n //Below code gets executed on invalid page request by the user\n document.getElementById(\"invalidPage\").innerHTML = \"\";\n document.getElementById(\"invalidPage\").innerHTML = \"Product Type not Found\";\n document.getElementById(\"invalidProduct\").style.display = \"block\";\n }\n else {\n\n //If the user selects Accept.js UI product type in the dashboard page\n if(activeCont == \"acceptui\")\n {\n document.getElementById(\"acceptui\").style.display = \"block\";\n AcceptUI();\n }\n //If the user selects Accept.js product type in the dashboard page\n else\n {\n document.getElementById(\"acceptjs\").style.display = \"block\";\n\n //By default credit card radio button is selected for accept js \n document.getElementById(\"rdCard\").click();\n }\n }\n}", "function partnerCheckAndEnroll(userEmail) {\n if (!$rootScope.fromPartner || !$rootScope.fromPartner.email || !$rootScope.fromPartner.partnerId || userEmail !== $rootScope.fromPartner.email) {\n travelersClubModalService();\n return;\n }\n\n //handle if from partner\n var successFunc = function(result) {\n\n //handle successful auto enroll\n if (!result.data.errors) {\n $state.go('start'); //TODO: consider a more customized welcome page\n return;\n }\n\n //invalid partner id, email does not match, or auto enroll failed --> continue with default register process\n travelersClubModalService();\n return;\n };\n\n var errFunc = function(errObj) {\n console.log(errObj);\n\n //continue with default register process\n travelersClubModalService();\n return;\n };\n\n dataFactory.checkAndEnroll($rootScope.fromPartner).then(successFunc, errFunc);\n }", "inhibitor(msg, params, utils) {\n return true\n }", "async function confirmOnDevice() {\n dispatch({ type: \"SET_ACTIVE\" });\n const { multisig } = slice;\n\n try {\n const confirmed = await interaction.run();\n if (\n confirmed.address === multisig.address &&\n confirmed.serializedPath === interaction.bip32Path\n ) {\n dispatch({ type: \"SET_MESSAGE\", value: \"Success\" });\n } else {\n dispatch({ type: \"SET_ERROR\", value: \"An unknown error occured\" });\n }\n } catch (error) {\n dispatch({ type: \"SET_ERROR\", value: error.message });\n }\n }", "function verify_registration(){\n\t//alert(app.device.get_device_id());\n\treturn false;\n}", "function _testSuiteInit() {\n return ImptTestHelper.runCommand(`impt product create -n ${PRODUCT_EXIST_NAME} -s \"${PRODUCT_EXIST_DESCR}\"`, ImptTestHelper.emptyCheck).\n then(() => ImptTestHelper.getAccountAttrs(username)).\n then((account) => { email = account.email; userid = account.id; });\n }", "function CAM_686_687_688()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\") \n var DataSheetName = Project.ConfigPath +\"TestData\\\\CAM_686_687_688.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n var Prefault=CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(Prefault),\"Setting Prefault Time\")\n \n //Step5.1 Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step5.2 Set Post fault\n var PostFault =CommonMethod.ReadDataFromExcel(DataSheetName,\"PostFaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPostFault(PostFault),\"Setting Post Fault time\")\n \n //Step6. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step7. Trigger Manual DFR\n DFR_Methods.TriggerManualDFR()\n \n //Step8. Download Manual DFR\n AssertClass.IsTrue(DFR_Methods.DownloadManualDFR(),\"Downloading DFR\")\n \n //Step9. Get Prefault time\n var ActualPrefault = (PDPPage.GetRecordTriggerDateTime(0))-PDPPage.GetRecordStartDateTime(0)\n \n //Step10. Get Postfault time\n var ActualPostFault = PDPPage.GetRecordEndDateTime(0)-(PDPPage.GetRecordTriggerDateTime(0))\n \n //Step9. Check Record Length\n var RecordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n \n if(aqConvert.StrToInt64(Prefault)+aqConvert.StrToInt64(PostFault)<=aqConvert.StrToInt64(MaxDFRLength))\n { \n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(ActualPrefault)+aqConvert.StrToInt64(ActualPostFault),aqConvert.StrToInt64(RecordLength),1,\"Validating Record Duration.\")\n }\n else\n {\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(MaxDFRLength),aqConvert.StrToInt64(RecordLength),1,\"Validating Record Duration.\")\n } \n Log.Message(\"Pass:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check limit DFR record length feature when Manual trigger(Pre+Post fault time) is equal to Maximum record length\")\n }\n}", "verfyUserByCode(attr, code){\n Auth.verifyCurrentUserAttributeSubmit(attr, code)\n .then(() => {\n console.log('user verified');\n }).catch(e => {\n console.log('failed with error', e);\n });\n }", "function accept_btn_Click(eventObject) {\r\n var callID = \"\";\r\n var makerDecisionFlag = \"\";\r\n var currentRow = caseTbl.getCheckedRows();\r\n /*for(var i=0;i<currentRow.length;i++)\r\n {\r\n callID+=callId[currentRow[i].index].getValue() +\",\";\r\n makerDecisionFlag= makerDecision[currentRow[i].index].getValue();\r\n }*/\r\n if (currentRow.length == 0) {\r\n alert(\"Please select the case to accept the decision\");\r\n return;\r\n }\r\n callID = callId[currentRow[0].index].getValue();\r\n makerDecisionFlag = makerDecision[currentRow[0].index].getValue();\r\n\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='callId']\", callID);\r\n\r\n cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='action']\", 'ACCEPT');\r\n\r\n //cordys.setNodeText(HoldReleaseDecisionOnCaseModel.getMethodRequest(), \".//*[local-name()='remarks']\", rejectRemarks);\r\n HoldReleaseDecisionOnCaseModel.reset();\r\n if (!HoldReleaseDecisionOnCaseModel.soapFaultOccurred) {\r\n if (callID != \"\") {\r\n xo__xElementbarButton__1_Click();\r\n if (makerDecisionFlag == 'Y')\r\n application.notify(\"The case is held successfully\");\r\n else\r\n application.notify(\"The case is released successfully\");\r\n hold_btn.hide();\r\n } else\r\n application.notify(\"Please select the case\");\r\n } else {\r\n application.notify(\"Holding failed. Please Contact the admin\");\r\n }\r\n}", "function PromoterValidation() {\n\n \n\n var bool = true;\n var Lo_Obj = [\"ddlOwner\", \"ddlPromPrefer\", \"txtPromFName\", \"txtPromMName\", \"txtPromLName\", \"ddlPromNominee\", \"txtPromNomineeName\", \"txtPromDBO\", \"ddlGender\",\n \"txtPromCAddres\", \"ddlPromCState\", \"ddlPromCCity\", \"txtPromCPIN\", \"txtPromPAddress\", \"ddlPromPState\", \"ddlPromPCity\", \"txtPromPPIN\",\n \"txtPromPhone\", \"txtPromCell\", \"txtPromPan\", \"txtPromAdhar\", \"txtPromQualification\", \"txtPromEmail\"];\n var Ls_Msg = [\"Company Owner\", \"Preference\", \"First Name\", \"Middele Name\", \"Last Name\", \"Nominee Type\", \"Nominee Name\", \"Date of Birth\", \"Gender\",\n \"Current Address\", \"Current state\", \"Current city\", \"Current pin\", \"Permanent Address\", \"Permanent State\", \"Permanent City\", \"Permanent PIN\",\n \"Landline Number\", \"Mobile Number\", \"PAN Number\", \"Adhar Number\", \"Qualification\", \"Email\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function _0001485874456152_33_PromoCodes_Cash()\n{\nLog.AppendFolder(\"_0001485874456152_33_PromoCodes_Cash\");\ntry{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n var keyWordNm =\"Promo Codes\";\n var packageNm = \"1:1 Comp Ratio\";\n var subPakNm =\"Individual\"; \n var qty =1;\n var dateD = CommonCalender.getTodaysDate();\n var givenPaymentType =\"Cash\";\n // WrapperFunction.selectKeywordName(\"Promo Codes\");\n //WrapperFunction.enterPromoCode(\"test\");\n WrapperFunction.setTextValue(textinputPromocodeinput,\"test\");\n Button.clickOnButton(selectablebuttonSearchbutton);\n aqUtils.Delay(3000); \n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(3000); \n if(datetimeformSubWindow.Exists){\n selectDateFromSubWindow(dateD); //mm-dd-yyyy \n selectNextButtonFromSubWindow();\n }else{\n if(qty > 1){\n SelectQuantityFromHeader.selectQuantity(qty);\n selectPackage(packageNm,subPakNm);\n aqUtils.Delay(2000);\n } \n }\n aqUtils.Delay(3000); \n finilizeOrder();\n aqUtils.Delay(2000); \n SelectPaymentType.selectPaymentType(givenPaymentType);\n WrapperFunction.verifyBalance(labelTotal,PaymentType_BalanceLabel);\n var paymentTypeBal=WrapperFunction.getBalanceValue(PaymentType_BalanceLabel);\n WrapperFunction.setTextValue(PayamountTextBox,paymentTypeBal);\n Button.clickOnButton(applyButton);\n WrapperFunction.settlementCompleteOrder();\n validateTicket(\"Validate All\");\n if(buttonClosebutton.Exists && buttonClosebutton.VisibleOnScreen){\n Button.clickOnButton(buttonClosebutton);\n }\n Button.clickOnButton(NewOrder_Button);\n AppLoginLogout.logout(); \n }\n\ncatch(e)\n{\n merlinLogError(\"Exception in Test script\");\n //Runner.Stop();\n}\n}", "function confirmSubmitEvaluation(){\n\tvar id = ADLoginID;\n\tvar success = function(){\n\t\tselfEvaluationSubmitted(true);\n\t\tcloseWarningModal();\n\t}\n\tvar error = function(error){}\n\t\n\tsubmitSelfEvaluationAction(id, success, error);\n}", "function checkInventory() {\n\n // Run query aqainst productstable to pull in available inventory for shoe requested\n connection.query(\"SELECT * FROM productstable WHERE item_id=?\", [userItemRequested], function(err, res) {\n if (err) throw err;\n currentInventory = res[0].stock_quantity;\n currentItemPrice = res[0].price;\n currentItemName = res[0].product_name;\n // If statement calculates if there is enough inventory then runs follow-up functions based on the result\n if (currentInventory >= userQuantityRequested) {\n enoughInventory();\n } else {\n notEnoughInventory();\n }\n });\n}", "isOneTouchAuthorized(uuid, callback) {\n let url = `/onetouch/json/approval_requests/${uuid}`;\n\n authy._request(\"get\", url, {}, (err, response) => {\n if (err) {\n return callback(err);\n }\n let status = response.approval_request.status;\n\n callback(null, status);\n });\n }", "sendForVerify(attr){\n Auth.verifyCurrentUserAttribute(attr)\n .then(() => {\n console.log('a verification code is sent');\n }).catch((e) => {\n console.log('failed with error', e);\n });\n }", "function mainProcess() {\n\n\tlogDebug(\"This process closes all ROW Permits that the warranty period due date is before .\" + compareDate + br);\n\n\tvar wfResult = aa.workflow.getTasks(\"Warranty Period\", \"Warranty Period\");\n\n\tif (wfResult.getSuccess()) {\n\t\tworkFlow = wfResult.getOutput();\n\t\tlogDebug(\"The number of ROW Permits in the Warranty Period: \" + workFlow.length + br);\n\t} else {\n\t\tlogDebug(\"ERROR: Retrieving permits: \" + wfResult.getErrorType() + \":\" + wfResult.getErrorMessage());\n\t\treturn false;\n\t}\n\n\tfor (wf in workFlow) {\n\t\t\n\t\tif (elapsed() > maxSeconds) { //only continue if time hasn't expired\n\t\t\tlogDebug(\"A script time out has caused partial completion of this process. Please re-run. \" + elapsed() + \n\t\t\t\" seconds elapsed, \" + maxSeconds + \" allowed.\");\n\t\t\ttimeExpired = true;\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tb1WF = workFlow[wf];\n\t\tvar b1CapId = b1WF.getCapID();\n\t\tvar capId = aa.cap.getCapID(b1CapId.getID1(), b1CapId.getID2(), b1CapId.getID3()).getOutput();\n\t\tvar altId = capId.getCustomID();\n\t\tcap = aa.cap.getCap(capId).getOutput();\n\t\t\n\t\tif (cap) {\n\t\t\tvar appTypeResult = cap.getCapType();\n\t\t\tvar appTypeString = appTypeResult.toString();\n\t\t\tvar appTypeArray = appTypeString.split(\"/\");\n\t\t\t\n\t\t\tif(appTypeArray[0] == \"Permitting\" && appTypeArray[1] == \"Engineering\" && appTypeArray[2] == \"ROW\" && appTypeArray[3] == \"NA\") {\n\t\t\t\tvar dueDate = convertDate(b1WF.getDueDate());\n\t\t\t\tif (dueDate <= compareDate) {\n\t\t\t\t\tlogDebug(\"For Record \" + altId + \" the Due Date is: \" + dueDate);\n\t\t\t\t\t//closeTask(\"Warranty Period\",\"Warranty Expired\",\"Closed by batch process due to 3 year Warranty Expiration\",\"ROW Warranty Batch\",capId,\"ENGROWEXC\");\n\t\t\t\t\t//closeTask(\"Closed\",\"Closed\",\"Closed by batch process due to 3 year Warranty Expiration\",\"ROW Warranty Batch\",capId,\"ENGROWEXC\");\n\t\t\t\t\t//updateAppStatus(\"Closed\",\"Closed by batch process due to 3 year Warranty Expiration\", capId);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\taa.sendMail(\"[email protected]\", emailAddress, elamSupport, \"ROW Permit Close Report\", emailText);\n}", "onNextButtonClick_() {\n if (this.selectedTrialOption == TrialOption.TRY)\n this.userActed('os-trial-try');\n else\n this.userActed('os-trial-install');\n }", "function validateForAllValidUserSelection(toBePassedArgumentsArray, provider,multiOSNameSize,validSelectedInstancesCount){\n\tvar blankSpace = ' '; \n\tvar validInstancesArray = toBePassedArgumentsArray[0];\n\tvar operType = toBePassedArgumentsArray[2];\n\tvar providerType = provider;\n var validInstancesPowerOnTimeArray = toBePassedArgumentsArray[3];\n var validInstancesTotalChargeArray = toBePassedArgumentsArray[4];\n\tparamArray = new Array();\n\tparamArray[0]=operationMap.get(operType);\n\tif(validInstancesArray.length > 0 && paramArray[0] == 'Add/Edit Tags'){\n\t\thideFadeLoadingImg();\n\t\tif(validInstancesArray.length > 1){\n\t \t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xbe0g0apa',paramArray,'');\n\t\t}else{\n\t\t\tcloudOnePopup('tags_popup',550);\n\t\t\tC1Tags.renderTags();\n\t\t\treturn true;\n\t\t}\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Login'){\n\t\thideFadeLoadingImg();\n\t\tif(multiOSNameSize > 1){\n\t \t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xbe0g0ap',paramArray,'');\n\t\t}else{\n\t\t\treturn selectLoginType();\n\t\t}\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Execute Script'){\n\t\thideFadeLoadingImg();\n\t\tif(multiOSNameSize > 1){\n\t \t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xae0i0ae',paramArray,'');\n\t\t}else{\n\t\t\treturn showEcsPopup();\n\t\t}\n\t}\n\telse if(validInstancesArray.length > 0 && paramArray[0] == 'Update Instance Details'){\n\t\thideFadeLoadingImg();\n\t\tif(document.getElementById('vmInstancesFormId')!=null){\n\t\t\n\t\t show_hide_NickName('vmInstancesFormId');\n\t\t cloudOnePopup('vmware_instance_details',500);\n\t\t}\n\t\tif(document.getElementById('formId')!=null){\n\t\t show_hide_NickName('formId');\n\t\t cloudOnePopup('instance_details', 500);\n\t\t}\n\t\tif(document.getElementById('actionFormId')!=null){\n\t\t hideFadeLoadingImg();\n\t\t var newNickNameDivId = document.getElementById(\"newNickNameDivId\");\n\t\t document.getElementById('actionFormId:selInstCount').value = validInstancesArray.length;\n\t\t if(validSelectedInstancesCount == 1){\n\t\t\t var nickNameTextbox =document.getElementById(\"actionFormId:newNickNameId\");\n\t\t\t nickNameTextbox.value = '';\n\t\t\t nickNameTextbox.value = validInstancesArray[0].toString();\n\t\t\t newNickNameDivId.style.display = 'block';\n\t\t }else{\n\t\t\t newNickNameDivId.style.display = 'none';\n\t\t\t reSetInstanceGroupDeployment();\n\t\t }\n\t\t cloudOnePopup('vmware_instance_details',500);\n\t\t}\n\t\treturn;\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Modify Monitoring Settings'){\n\t\thideFadeLoadingImg();\n\t\tif (validSelectedInstancesCount == 1) {\n\t\t\treturn cloudOnePopup('modify_monitoring_status_popupId',500);\n\t\t} else {\n\t\t\tparamArray[0] = 'Modify Monitoring Settings';\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xcb0a0ae',paramArray,'');\n\t\t}\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Clone VM'){\n\t\thideFadeLoadingImg();\n\t\tvar instancesForClone = new String();\n\t\t for(var i=0;i<validInstancesArray.length; i++){\n\t\t\t instancesForClone = instancesForClone.concat('<tr><td class=\"columnWidth\">');\t\n\t\t\t instancesForClone = instancesForClone.concat('<span class=\"bulletpoint\"></span>'+blankSpace);\n\t\t\t instancesForClone = instancesForClone.concat(validInstancesArray[i]);\n\t\t\t instancesForClone = instancesForClone.concat('</td></tr>');\n\t\t\t}\n\t\tinstancesForClone = instancesForClone.concat('<tr class=\"blankRowHeight\"/>');\n\t document.getElementById(\"cloneVMContent_id\").innerHTML =instancesForClone.toString();\n\t\treturn cloudOnePopup('clone_vm_confirm_popupId',500);\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Delete'){\n\t\tvar instancesForDeletion = new String();\n\t\tinstancesForDeletion = instancesForDeletion.concat('<div id=\"confirmMessage\" style=\"padding-left: 16px;\">Confirm Deletion of:</div>');\n\t\tinstancesForDeletion = instancesForDeletion.concat('<table class=\"popupContentLayout2\">');\n instancesForDeletion = instancesForDeletion.concat('<tr class=\"blankRowHeight\"/>');\n instancesForDeletion = instancesForDeletion.concat('<tr><td class=\"columnWidth\"><span class=\"bold\">Instance name</span></td>');\n instancesForDeletion = instancesForDeletion.concat('<td class=\"columnWidth\"><span class=\"bold\">Total Powered-On time</span></td>');\n instancesForDeletion = instancesForDeletion.concat('<td class=\"columnWidth\"><span class=\"bold\">Total Show-Back Cost</span></td></tr>');\n for(var i=0;i<validInstancesArray.length; i++){\n\t\t\tinstancesForDeletion = instancesForDeletion.concat('<tr><td class=\"columnWidth\">');\t\n\t\t\tinstancesForDeletion = instancesForDeletion.concat('<span class=\"bulletpoint\"></span>'+blankSpace);\n\t\t\tinstancesForDeletion = instancesForDeletion.concat(validInstancesArray[i]);\n instancesForDeletion = instancesForDeletion.concat('</td><td class=\"columnWidth\">');\n instancesForDeletion = instancesForDeletion.concat(validInstancesPowerOnTimeArray[i]);\n instancesForDeletion = instancesForDeletion.concat('</td><td class=\"columnWidth\">');\n instancesForDeletion = instancesForDeletion.concat(validInstancesTotalChargeArray[i]);\n instancesForDeletion = instancesForDeletion.concat('</td></tr>');\n\t\t}\n instancesForDeletion = instancesForDeletion.concat('<tr class=\"blankRowHeight\"/>');\n instancesForDeletion = instancesForDeletion.concat('<tr class=\"blankRowHeight\"/>');\n\t\t\tinstancesForDeletion = instancesForDeletion.concat('</table>');\n \t\tdocument.getElementById(\"messageContentForDelete\").innerHTML =instancesForDeletion.toString();\n \t\tdocument.getElementById(\"actionFormId:invokegetNotifications\").onclick();\n \t\treturn;\n\t} else if(paramArray[0] == 'Migrate to AWS'){\n\t\thideFadeLoadingImg();\n\t\t\treturn showPopup(\"migrateAWSPopup\", 635);\n \t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Update SNMP Details'){\n\t\thideFadeLoadingImg();\n\t\tif (validSelectedInstancesCount == 1) {\n\t\t\tenableVersions();\n\t\t\treturn cloudOnePopup('SNMP_Update_Status_popupId',500);\n\t\t} else {\n\t\t\tparamArray[0] = 'Update SNMP Details';\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xcb0a0ae',paramArray,'');\n\t\t}\n\t}else if(validInstancesArray.length > 0 && paramArray[0] == 'Update WMI Details'){\n\t\thideFadeLoadingImg();\n\t\tif (validSelectedInstancesCount == 1) {\n\t\t\tvalidatePwdText();\n\t\t\t cloudOnePopup('WMI_Update_status',500);\n\t\t\t setfocus('actionFormId:wmiUserId');\n\t\t\t return true;\n\t\t} else {\n\t\t\tparamArray[0] = 'Update WMI Details';\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xcb0a0ae',paramArray,'');\n\t\t}\n\t}\n\t \n\tif(validInstancesArray.length > 0 && paramArray[0] == 'Shutdown' && providerType == 'POWERVM'){\n\t\thideFadeLoadingImg();\n\t\treturn validateDataUsingMsgId(MessageTypeEnum.CONFIRMATION,'0xbe0g0am',paramArray,'instanceActionPerform');\n\t}\n\telse if(validInstancesArray.length > 0 && paramArray[0] == 'Export'){\n\t\thideFadeLoadingImg();\n\t\tLoadingButtonUtils.changeBackToOrginalValue();\n\t\tdocument.getElementById('actionFormId:storageLocationId:0').checked = true;\n\t\tdocument.getElementById('actionFormId:storageLocationId:1').checked = false;\n\t\t if(providerType == 'AMAZON'){\n\t\t\t\tdocument.getElementById('actionFormId:vmPortabilityforAWSProvider').onclick();\n\t\t\t\treturn;\n\t\t\t }\n\t\t return showPopup(\"exportVM\", 600);\n\t}\n\t \n\tif(validInstancesArray.length > 0 && paramArray[0] != 'Delete'){\n\t\tvar instances = new String();\n\t\tinstances = instances.concat('<div style=\"height:5px;\">'+blankSpace+'</div>');\t\t\n\t\tfor(var i=0;i<validInstancesArray.length; i++){\n\t\t\tif(i == 0){\n\t\t\t\tinstances = instances.concat('<div style=\"padding-left:10px;\">');\n \t\t\tinstances = instances.concat('<span class=\"bulletpoint\"></span>'+blankSpace);\n\t\t\t}else{\n\t\t\t\tinstances = instances.concat('<div style=\"padding-left:10px;\">');\n\t\t\t\tinstances = instances.concat('<span class=\"bulletpoint\"></span>'+blankSpace);\n\t\t\t}\n\t\t\tinstances = instances.concat(validInstancesArray[i]);\n\t\t\tinstances = instances.concat('</div>');\n\t\t}\n\t\t \n\t\tparamArray[1] = instances.toString();\n\t\tif(paramArray[0] == 'Apply Template'){\n\t\t\thideFadeLoadingImg();\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.CONFIRMATION,'0xbe0g0ab',paramArray,'applyMonitoringTemplate');\n\t\t}else if(paramArray[0] == 'Change Assignee'){\n\t\t\thideFadeLoadingImg();\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.CONFIRMATION,'0xbe0g0ab',paramArray,'goToChangeAssigneePage');\n\t\t}else if(paramArray[0] == 'Edit Resources'){\n\t\t\thideFadeLoadingImg();\n\t\t\tif (validSelectedInstancesCount == 1) {\n\t\t\t\t\treturn cloudOnePopup('vmware_edit_instance_resources', 650);\n\t\t\t\t} else {\n\t\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0ae', paramArray,'');\n\t\t\t\t}\n\t\t}else if(paramArray[0] == 'Edit Instance Storage'){\n\t\t\t if(validSelectedInstancesCount == 1){\n\t\t\t\treturn document.getElementById('actionFormId:actionOnEditInstStorId').onclick();\n\t\t\t }else{\n\t\t\t\t hideFadeLoadingImg();\n\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0af',paramArray,'');\n\t\t\t }\n\t\t}else if(paramArray[0] == 'Modify AWS Instance Type'){\n\t\t\tif (validSelectedInstancesCount == 1) {\n\t\t\t\treturn document.getElementById('actionFormId:actionOnAWSEditInstTypeId').onclick();\n\t\t\t\t} else {\n\t\t\t\t\thideFadeLoadingImg();\n\t\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0ae', paramArray,'');\n\t\t\t\t}\n\t\t} else if(paramArray[0] == 'Modify AWS Instance Storage'){\n\t\t\t if(validSelectedInstancesCount == 1){\n\t\t\t\t\treturn document.getElementById('actionFormId:actionOnEditAWSStorageId').onclick();\n\t\t\t }else{\n\t\t\t\thideFadeLoadingImg();\n\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0af',paramArray,'');\n\t\t\t }\n\t\t}else if(paramArray[0] == 'Modify AZURE Instance Storage'){\n\t\t\t if(validSelectedInstancesCount == 1){\n\t\t\t\t\treturn document.getElementById('actionFormId:actionOnEditAZUREStorageId').onclick();\n\t\t\t }else{\n\t\t\t\thideFadeLoadingImg();\n\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0af',paramArray,'');\n\t\t\t }\n\t\t}else if(paramArray[0] == 'Modify Compute'){\n\t\t\tif (validSelectedInstancesCount == 1) {\n\t\t\t\treturn document.getElementById('actionFormId:actionOnSavvisEditResourceId').onclick();\n\t\t\t\t} else {\n\t\t\t\t\thideFadeLoadingImg();\n\t\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0ae', paramArray,'');\n\t\t\t\t}\n\t\t}else if(paramArray[0] == 'Modify Storage'){\n\t\t\tif(validSelectedInstancesCount == 1){\n\t\t\t\treturn document.getElementById('actionFormId:actionOnSavvisEditStorageId').onclick();\n\t\t\t\t }else{\n\t\t\t\t\thideFadeLoadingImg();\n\t\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0g0af',paramArray,'');\n\t\t\t\t }\n\t\t}else if(paramArray[0] == 'Clone Instance(s)'){\n\t\t\thideFadeLoadingImg();\n\t\t\tif(validSelectedInstancesCount == 1){\n\t\t\t\treturn cloudOnePopup('savvis_clone_vm', 450);\n\t\t\t\t }else{\n\t\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xbe0g0ae',paramArray,'');\n\t\t\t\t }\n\t\t} else if(paramArray[0] == 'Capture vApp'){\n\t\t\thideFadeLoadingImg();\n\t\t\tif(validSelectedInstancesCount != 1){\n\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xbe0g0af',paramArray,'');\n\t\t\t\t }\n\t\t} else if(paramArray[0] == 'Manage Private IP Addresses'){\n\t\t\thideFadeLoadingImg();\n\t\t\t if(validSelectedInstancesCount == 1){\n\t\t\t\t return document.getElementById('actionFormId:actionOnManagePrivateIPAddress').onclick();\n\t\t\t }else{\n\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0i0eu',paramArray,'');\n\t\t\t }\n\t\t} else if(paramArray[0] == 'Attach Network Interface' || paramArray[0] == 'Detach Network Interface' ){\n\t\t\thideFadeLoadingImg();\n\t\t\t if(validSelectedInstancesCount == 1){\n\t\t\t\t var errorCode = jQuery(\t\"#\"\t+ JSUtils.prototype\n\t\t\t\t\t\t.escapeColon(\"actionFormId:detachError\")).val();\n\t\t\t\tjQuery(\t\"#\"\t+ JSUtils.prototype\n\t\t\t\t\t\t.escapeColon(\"actionFormId:eni_attach_detach_hdr\")).text(paramArray[0]);\n\t\t\t\tjQuery(\t\"#\"\t+ JSUtils.prototype\n\t\t\t\t\t\t.escapeColon(\"actionFormId:instanceNamEni\")).text(validInstancesArray[0].toString());\n\n\t\t\t\tif(errorCode != null && errorCode != '') {\n\t\t\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,errorCode,paramArray,'');\n\t\t\t\t} else {\n\t\t\t\t\treturn cloudOnePopup('attach_detach_ENI',500);\n\t\t\t\t}\n\t\t\t }else{\n\t\t\t\t return validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xee0i0eu',paramArray,'');\n\t\t\t }\n\t\t}else if(paramArray[0] == 'Security Scan'){\n\t\t\thideFadeLoadingImg();\n\t\t\treturn validateDataUsingMsgId(MessageTypeEnum.CONFIRMATION,'0xbe0g0ab',paramArray,'showSecurityScanPopup');\n\t\t}\n\t\tif(paramArray[0] == 'Capture vApp') {\n\t\t\tparamArray[0] = 'Clone to Template';\n\t\t}\n\t\thideFadeLoadingImg();\n\t\treturn validateDataUsingMsgId(MessageTypeEnum.CONFIRMATION,'0xbe0g0ab',paramArray,'instanceActionPerform');\n\t}else{\n\t\thideFadeLoadingImg();\n\t\treturn validateDataUsingMsgId(MessageTypeEnum.ERROR,'0xcb0g0ag',paramArray,'instanceActionPerform');\n\t}\n}", "function checkDeployERC20Inputs() {\n\tvar legalTotalSupply = true;\n\tvar legalDecimals = true;\n\tvar legalName = true;\n\tvar legalSymbol = true;\n\t//First check that the user entered a positive integer for the total\n\t//supply of the token.\n\tif(!isPositiveInteger('#erc-supply-input')) {\n\t\tlegalTotalSupply = false;\n\t} \n\t//Next check that the user has entered a positive integer for the decimals\n\t//of the token. \n\tif(!isPositiveInteger('#erc-decimals-input')) {\n\t\tlegalDecimals = false;\n\t}\n\t//Now check that the user has entered a name which is not the empty string.\n\tvar name = $('#erc-name-input').val();\n\tif(name == \"\") {\n\t\tlegalName = false;\n\t}\n\t//Finally check that the user has entered a symbol which is not the empty string.\n\tvar symbol = $('#erc-symbol-input').val();\n\tif(symbol == \"\") {\n\t\tlegalSymbol = false;\n\t}\n\t//Now check if all inputs are legal. If not then disable the button for deploying\n\t//the new token. Otherwise, enable the button. \n\tif(legalTotalSupply && legalDecimals && legalName && legalSymbol) {\n\t\t$(\"#deploy-erc20-btn\").attr(\"disabled\", false);\n\t} else {\n\t\t$(\"#deploy-erc20-btn\").attr(\"disabled\", true);\n\t}\n}", "function getApplePayAvailability(merchantIdentifier = null) {\r\n if(merchantIdentifier !== undefined && merchantIdentifier !== null && merchantIdentifier !== \"\") {\r\n if(window.location.protocol == \"https:\" && window.ApplePaySession) {\r\n //if(ApplePaySession.canMakePayments()) {\r\n return true;\r\n //}\r\n }\r\n } else {\r\n console.error('[ApplePay] Merchant Identifier is undefined');\r\n }\r\n return false;\r\n}", "function PrimaryCareorHomeBoundProviderProcessing(patientAssignments) {\n try {\n var primaryHomeBoundCareNotification = false;\n var vpta_teamname = null;\n var vpta_teammembers = null;\n var HBProcessing = false;\n var PriProcessing = false;\n\n // Primary Care data handling\n if (typeof (patientAssignments.primaryCareAssignments[0]) !== 'undefined'\n && patientAssignments.primaryCareAssignments[0] !== null) {\n if (typeof (patientAssignments.primaryCareAssignments[0].length) !== 0) {\n PriProcessing = true;\n vpta_teamname = patientAssignments.primaryCareAssignments[0].teamName;\n if (typeof (patientAssignments.primaryCareAssignments[0].teamletMembers.length) !== 0 && typeof patientAssignments.primaryCareAssignments[0].teamletMembers !== undefined) {\n vpta_teammembers = patientAssignments.primaryCareAssignments[0].teamletMembers;\n //var vpta_teammembers = [{\"TeamRole\":{\"Description\":\"PRIMARY CARE PROVIDER\",\"ExpirationDate\":null,\"Name\":\"PRIMARY CARE PROVIDER\",\"Code\":\"43\",\"Ien\":\"67\",\"PrimaryCare\":\"true\",\"SupportStaff\":\"false\"},\"StaffContact\":{\"TeamRoleName\":\"Primary Care Provider\",\"TeamRoleCode\":\"43\",\"Name\":\"Potter,Harry\",\"Phone\":\"\",\"Pager\":\"\",\"Ien\":\"520642422\"}}];\n }\n }\n }\n // Home Bound data handling\n else if (typeof (patientAssignments.primaryCareHBPCAssignments[0]) !== 'undefined'\n && patientAssignments.primaryCareHBPCAssignments[0] !== null) {\n if (typeof (patientAssignments.primaryCareHBPCAssignments.length) !== 0) {\n HBProcessing = true;\n vpta_teamname = patientAssignments.primaryCareHBPCAssignments[0].teamName;\n if (typeof (patientAssignments.primaryCareHBPCAssignments[0].teamMembers.length) != 0 && typeof (patientAssignments.primaryCareHBPCAssignments[0].teamMembers) != undefined) {\n vpta_teammembers = patientAssignments.primaryCareHBPCAssignments[0].teamMembers;\n }\n }\n }\n\n //Continue processing if primaryCareAssignments OR primaryCareHBPCAssignments team name has a value\n if (vpta_teamname !== null && typeof (vpta_teamname) !== 'undefined') {\n // process team name always\n vpta_processTeamName(vpta_teamname);\n\n \n }\n else { primaryHomeBoundCareNotification = true; }\n\t\t\n\t\t// Home Bound or Primary Care processing check\n if (vpta_teammembers.length > 0) {\n if (HBProcessing) {\n\t\t\t\tsetTimeout(vpta_processHBTeamMembers(vpta_teammembers, vpta_teamname), 500);\n }\n else if (PriProcessing) {\n setTimeout(vpta_processPrimaryTeamMembers(vpta_teammembers, vpta_teamname), 500);\n }\n }\n return primaryHomeBoundCareNotification;\n }\n catch (e) {\n alert(e.message);\n return primaryHomeBoundCareNotification;\n }\n}", "function passVerifier(result, userData, partnerNameFromFile, callback) {\n // console.log(userData.originalData)\n // var getFirstPartnerID = userData['originalData'][0]['Partner Code'].toUpperCase();\n var getFirstPartnerID = partnerNameFromFile;\n // console.log(`first partnerid:${getFirstPartnerID}`)\n var firstTest = {\n val: \"\",\n status: null\n };\n if (result.includes(partnerNameFromFile.toUpperCase())) {\n try {\n Object.values(userData[\"originalData\"]).forEach(obj => {\n // console.log(obj['Code'].toUpperCase())\n if (obj[\"Code\"].toUpperCase() !== getFirstPartnerID) {\n //if mismatch do this\n // console.log(\"no match\");\n firstTest.val = obj[\"Code\"].toUpperCase();\n firstTest.status = false;\n throw \"unauthorized\";\n } else {\n //if match do this\n // console.log(\"match\");\n firstTest.val = getFirstPartnerID;\n firstTest.status = true;\n }\n });\n } catch (e) {\n if (e === \"unauthorized\") {\n // console.log(\"not exist\")\n callback(\"Partner does not exist\");\n return false;\n }\n }\n // console.log(\"exist\")\n callback(\"Partner exists\");\n } else {\n callback(\"Partner does not exist\");\n }\n}", "function trainProgAfterSubmit(type){\n\n\t\n\t/**************** Auto invitation process *************/\n\tif (type == 'delete' || type == 'xedit')\n\t{\n\t\treturn;\n\t}\n\t\n\tvar queueUpAutoInvite = false;\n\t\n\tif (nlapiGetFieldValues('custrecord_tp_selectedcoaches'))\n\t{\n\t\t//We need to see Selected coach field has changed\n\t\tif (type == 'create')\n\t\t{\n\t\t\tqueueUpAutoInvite = true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tvar oldRec = nlapiGetOldRecord(),\n\t\t\t\tnewRec = nlapiGetNewRecord(),\n\t\t\t\toldNsVal = oldRec.getFieldValues('custrecord_tp_selectedcoaches'),\n\t\t\t\tnewNsVal = newRec.getFieldValues('custrecord_tp_selectedcoaches'),\n\t\t\t\toldValues = [],\n\t\t\t\tnewValues = [];\n\t\t\t\n\t\t\t//Loop through and build up both. This is due to NS returning Object\n\t\t\tfor (var oi=0; oldNsVal && oi < oldNsVal.length; oi+=1)\n\t\t\t{\n\t\t\t\toldValues.push(oldNsVal[oi]);\n\t\t\t}\n\t\t\t\n\t\t\tfor (var ni=0; newNsVal && ni < newNsVal.length; ni+=1)\n\t\t\t{\n\t\t\t\tnewValues.push(newNsVal[ni]);\n\t\t\t}\n\t\t\tlog('debug','old value',oldValues);\n\t\t\tlog('debug','new value',newValues);\n\t\t\t\n\t\t\tif (!compareArray(oldValues, newValues))\n\t\t\t{\n\t\t\t\tqueueUpAutoInvite = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (queueUpAutoInvite)\n\t\t{\n\t\t\tvar paramJson = {\n\t\t\t\t'custscript_420_tpid':nlapiGetRecordId(),\n\t\t\t\t'custscript_420_triguserid':nlapiGetContext().getUser()\n\t\t\t};\n\t\t\t\n\t\t\tvar queueStatus = nlapiScheduleScript('customscript_aux_ss_autoinvitetpcoaches', null, paramJson);\n\t\t\t\n\t\t\tlog('audit','queue up auto invite','queue up scheduled script: Status='+queueStatus+' // Parameter: '+JSON.stringify(paramJson));\n\t\t}\n\t}\n}", "function pbl_e5831ee218d2e811a96c000d3a3099e5(eventContext) {\n\ttry {\n\t\tvar v0 = (!Mscrm.BusinessRules.Utility.isNull(eventContext) && typeof eventContext.getFormContext === \"function\") ? eventContext.getFormContext().data.entity : Xrm.Page.data.entity;\n\t\tvar v1 = v0.attributes.get('caseorigincode');\n\t\tvar v2 = v0.attributes.get('checkemail');\n\t\tvar v3 = v0.attributes.get('casetypecode');\n\t\tvar v4 = v0.attributes.get('msdyn_incidenttype');\n\t\tvar v5 = v0.attributes.get('isescalated');\n\t\tvar v6 = v0.attributes.get('customerid');\n\t\tvar v7 = v0.attributes.get('escalatedon');\n\t\tvar v8 = v0.attributes.get('modifiedon');\n\t\tvar v9 = v0.attributes.get('description');\n\t\tvar v10 = v0.attributes.get('socialprofileid');\n\t\tvar v11 = v0.attributes.get('emailaddress');\n\t\tvar v13 = v0.attributes.get('title');\n\t\tvar v14 = {\n\t\t\tmessage: Mscrm.BusinessRulesScript.GetResourceString('c301a11d-7151-44dc-a849-0b27d41c70f1', 'Check your email'),\n\t\t\tactions: null\n\t\t};\n\t\tvar v15 = '';\n\t\tvar v17 = function (op1, op2, e) {\n\t\t\treturn e(op1, op2);\n\t\t};\n\t\tif (((v1) == undefined || (v1) == null || (v1) === \"\") || ((v2) == undefined || (v2) == null || (v2) === \"\") || ((v3) == undefined || (v3) == null || (v3) === \"\") || ((v4) == undefined || (v4) == null || (v4) === \"\") || ((v5) == undefined || (v5) == null || (v5) === \"\") || ((v6) == undefined || (v6) == null || (v6) === \"\") || ((v7) == undefined || (v7) == null || (v7) === \"\") || ((v8) == undefined || (v8) == null || (v8) === \"\") || ((v9) == undefined || (v9) == null || (v9) === \"\") || ((v10) == undefined || (v10) == null || (v10) === \"\") || ((v11) == undefined || (v11) == null || (v11) === \"\")) {\n\t\t\treturn;\n\t\t}\n\t\tvar v12 = (v1) ? v1.getValue() : null;\n\t\tvar v16 = (v3) ? v3.getValue() : null;\n\t\tvar v18 = (v9) ? v9.getValue() : null;\n\t\tif ((v12) === (1)) {\n\t\t\t(Xrm.Page.ui.getFormType() == 1 && (v13 != null && (typeof v13.getValue() === 'boolean' || (v13.getValue() === null || (typeof v13.getValue() === 'string' && v13.getValue().trim.length === 0)))) ? v13.setValue('Origin is phone') : null);\n\t\t} else if ((v12) === (2)) {\n\t\t\tv14.actions = [function () {\n\t\t\t\t\tv11.setValue('this is a recommendation');\n\t\t\t\t}\n\t\t\t];\n\t\t\tv2.controls.forEach(function (c, i) {\n\t\t\t\tc.addNotification({\n\t\t\t\t\tmessages: [Mscrm.BusinessRulesScript.GetResourceString('aeea14f7-231f-4f9f-92c3-2faeac40a124', 'Check email')],\n\t\t\t\t\tnotificationLevel: Xrm.NotificationLevel.recommendation,\n\t\t\t\t\tuniqueId: 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3',\n\t\t\t\t\tactions: [v14]\n\t\t\t\t});\n\t\t\t});\n\t\t\tv15 = v15 + 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3\\x3b';\n\t\t} else if ((v16) === (1)) {\n\t\t\tv4.controls.forEach(function (c, i) {\n\t\t\t\tc.setDisabled(true);\n\t\t\t});\n\t\t} else if ((v16) === (2)) {\n\t\t\tv1.controls.forEach(function (c, i) {\n\t\t\t\tc.setNotification(Mscrm.BusinessRulesScript.GetResourceString('bbeec792-00eb-40bc-886b-f5045e2073e7', 'This is a test error message'), 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7');\n\t\t\t});\n\t\t\tv15 = v15 + 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7\\x3b';\n\t\t} else if ((v16) === (3)) {\n\t\t\tv5.setValue(true);\n\t\t\tv6.setValue([{\n\t\t\t\t\t\tid: '\\x7bc302470e-6dcb-e811-a974-000d3a1be90a\\x7d',\n\t\t\t\t\t\tentityType: 'account',\n\t\t\t\t\t\tname: '1'\n\t\t\t\t\t}\n\t\t\t\t]);\n\t\t\tv7.setValue(v17((v8) ? v8.getUtcValue() : null, 0, function (op1, op2) {\n\t\t\t\t\tif ((op1) == undefined || (op1) == null || (op1) === \"\" || (op2) == undefined || (op2) == null || (op2) === \"\") {\n\t\t\t\t\t\treturn null;\n\t\t\t\t\t}\n\t\t\t\t\tvar result = op1;\n\t\t\t\t\tresult.setDate(op1.getDate() + op2);\n\t\t\t\t\treturn result;\n\t\t\t\t}));\n\t\t} else if (v17((v18), ('Help'), function (op1, op2) {\n\t\t\t\tif ((op1) == undefined || (op1) == null || (op1) === \"\") {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn op1.toUpperCase().indexOf(op2.toUpperCase()) == 0;\n\t\t\t})) {\n\t\t\tv10.controls.forEach(function (c, i) {\n\t\t\t\tc.setVisible(false);\n\t\t\t});\n\t\t} else if (true) {\n\t\t\tv11.setRequiredLevel('required');\n\t\t}\n\t\tvar v19 = [{\n\t\t\t\t'CId': 'checkemail',\n\t\t\t\t'SId': 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep3'\n\t\t\t}, {\n\t\t\t\t'CId': 'caseorigincode',\n\t\t\t\t'SId': 'e5831ee2-18d2-e811-a96c-000d3a3099e5SetMessageStep7'\n\t\t\t}\n\t\t];\n\t\tfor (var i = 0; i < v19.length; i++) {\n\t\t\tvar l1 = v19[i];\n\t\t\tif (v15.indexOf(l1.SId + '\\x3b') === -1) {\n\t\t\t\tvar v0 = (l1.RId) ? v0.relatedEntities.get(l1.RId) : v0;\n\t\t\t\tvar attributeObject = (v0) ? v0.attributes.get(l1.CId) : null;\n\t\t\t\t(attributeObject) && attributeObject.controls.forEach(function (c, i) {\n\t\t\t\t\tc.clearNotification(l1.SId);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t} catch (e) {\n\t\tMscrm.BusinessRules.ErrorHandlerFactory.getHandler(e, arguments.callee).handleError();\n\t}\n}", "function buyerInstruct(){\n alert(\"Click on the button to see what is available\")\n}", "_onVerifyAttendance(code, callback) {\n const { attendBooking, booking, validCodes } = this.props\n\n if (validCodes.indexOf(code) === -1) {\n return setTimeout(() => callback('Invalid code'), 1000)\n }\n\n attendBooking(code, booking.workshopID, (err) => {\n if (err) {\n return callback(err)\n }\n callback()\n })\n }", "function CAM_728()\n{\n try\n {\n Log.Message(\"Started TC:-Test to check that DFR record length value get saved to database.\")\n var DataSheetName = Project.ConfigPath +\"TestData\\\\MaxDFR.xlsx\"\n \n //Step1.: Check if iQ-Plus is running or not.\n AssertClass.IsTrue(CommonMethod.IsExist(\"iQ-Plus\"),\"Checking if iQ+ is running or not\")\n \n //Step2.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(DataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step3. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step4. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step5.0 //Enter PreFault\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(CommonMethod.ReadDataFromExcel(DataSheetName,\"PrefaultTime\")),\"Setting Prefault Time\")\n \n //Step5. Enter & Check Max DFR value\n var MaxDFRLength =CommonMethod.ReadDataFromExcel(DataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(MaxDFRLength),\"Setting and checking Max DFR\")\n \n //Step6. Save to DB\n AssertClass.IsTrue(ConfigEditorPage.ClickSaveToDb(),\"Clicked on Save to DB\")\n \n //Step7. Click on Modify Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonModifyConfig(),\"Clicked on Modify Config\")\n \n //Step7.1 Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step8. Check the Max DFR Value\n AssertClass.CompareString(ConfigEditor_FaultRecordingPage.GetMaxDFR(),MaxDFRLength,\"Checking Max DFR value\")\n \n Log.Message(\"Pass:-Test to check that DFR record length value get saved to database.\")\n }\n catch(ex)\n {\n Log.Error(ex.stack)\n Log.Error(\"Fail:-Test to check that DFR record length value get saved to database.\")\n }\n finally\n {\n AssertClass.IsTrue(ConfigEditorPage.ClickOnClose(),\"Clicked on Close in Config Editor\")\n }\n}", "static async ensureSignedIn(context) {\n const suite = new UITestSuite();\n suite.mochaContext = context;\n const signedIn = await suite.checkForStatusBarTitle(suite.hostWindow, suite.testAccount.email);\n if (!signedIn) {\n const userCode = await web.signIn(suite.serviceUri, 'microsoft', suite.testAccount.email, suite.testAccount.password, false);\n assert(userCode, 'Should have gotten a user code from browser sign-in.');\n await suite.runLiveShareCommand(suite.hostWorkbench, 'liveshare.signin.token');\n await suite.hostWorkbench.quickinput.waitForQuickInputOpened();\n await suite.hostWindow.waitForSetValue(quickinput_1.QuickInput.QUICK_INPUT_INPUT, userCode);\n await suite.hostWindow.dispatchKeybinding('enter');\n await suite.waitForStatusBarTitle(suite.hostWindow, suite.testAccount.email);\n }\n }", "function activate(callback, activationCode)\n {\n var url = $.perc_paths.LICENSE_ACTIVATE + '/' + activationCode;\n $.PercServiceUtils.makeJsonRequest(\n url,\n $.PercServiceUtils.TYPE_POST,\n false,\n function(status, result)\n {\n if(status === $.PercServiceUtils.STATUS_SUCCESS)\n {\n callback($.PercServiceUtils.STATUS_SUCCESS, result.data);\n }\n else\n {\n var defMsg = $.PercServiceUtils.extractDefaultErrorMessage(result.request);\n callback(status, defMsg);\n }\n },\n undefined,\n function(status)\n {\n // On abort(timeout) callback\n callback(status);\n }\n );\n }", "function CompanyValidation() { \n var Lo_Obj = [\"ddlCompPrefer\", \"txtCompName\", \"textCompRAddres\", \"txtCompCPIN\", \"txtCompDBE\", \"txtCompPan\", \"textCompPAddress\",\n \"txtCompPPIN\", \"textCompPermanentAddress\", \"txtCompPermanentPPIN\", \"txtCompEmail\", \"txtCompPhone\", \"txtCompCell\"];\n var Ls_Msg = [\"Constitution Type\", \"Name of Enterprice\", \"REGD Office Address\", \"Pin\", \"Date of Establishment\", \"PAN Number\",\n \"Address of Factory/Shop\", \"Pin\", \"Permanent Address\", \"Pin\", \"Email \", \"Landline\", \"Mobile\"];\n var bool = true;\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function makeinActive() {\r\n\t\t\t\tif(self.selected_vehicle.length == 0) {\r\n\t\t\t\t\tself.message = \"Please select atleast one record..!\";\r\n\t\t\t\t\tsuccessAnimate('.failure');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvar inactivate_flag = 0 ;\r\n\t\t\t\t\tangular.forEach(self.selected_vehicle, function(vehicle){\r\n\t\t\t\t\t\tif(vehicle.active == 'N') {\r\n\t\t\t\t\t\t\tinactivate_flag = 1;\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(inactivate_flag == 1) {\r\n\t\t\t\t\t\tself.message = \"Selected record(s) already in active status..!\";\r\n\t\t\t\t\t\tsuccessAnimate('.failure')\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tself.confirm_title = 'In-Active';\r\n\t\t\t\t\t\tself.confirm_type = BootstrapDialog.TYPE_DANGER;\r\n\t\t\t\t\t\tself.confirm_msg = self.confirm_title+ ' selected record(s)?';\r\n\t\t\t\t\t\tself.confirm_btnclass = 'btn-danger';\r\n\t\t\t\t\t\tConfirmDialogService.confirmBox(self.confirm_title, self.confirm_type, self.confirm_msg, self.confirm_btnclass)\r\n\t\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t\t\tfunction(res) {\r\n\t\t\t\t\t\t\t\t\t\tvar inactive_id = [];\r\n\t\t\t\t\t\t\t\t\t\tfor(var i=0; i<self.selected_vehicle.length; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\tinactive_id[i] = self.selected_vehicle[i].vehicle_id;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tVehicleService.makeinActive(inactive_id)\r\n\t\t\t\t\t\t\t\t\t\t.then(\r\n\t\t\t\t\t\t\t\t\t\t\t\tfunction(response) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tfetchAllVehicles();\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tself.selected_vehicle = [];\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tself.message = \" Selected record(s) has in inactive status..!\";\r\n\t\t\t\t\t\t\t\t\t\t\t\t\tsuccessAnimate('.success');\r\n\t\t\t\t\t\t\t\t\t\t\t\t}, function(errResponse) {\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t/*console.log(errResponse);*/\r\n\t\t\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\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 activateIntelAmtAcmEx2(dev) {\n var acmdata = dev.temp.acmdata;\n var leaf = (acmdata.index == 0), root = (acmdata.index == (acmdata.certs.length - 1));\n if ((acmdata.index < acmdata.certs.length) && (acmdata.certs[acmdata.index] != null)) {\n dev.amtstack.IPS_HostBasedSetupService_AddNextCertInChain(acmdata.certs[acmdata.index], leaf, root,\n function (stack, name, responses, status) {\n const dev = stack.dev;\n if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.\n if (status != 200) { dev.consoleMsg(\"Failed to set ACM certificate chain (\" + status + \").\"); removeAmtDevice(dev, 49); return; }\n if (responses['Body']['ReturnValue'] != 0) { dev.consoleMsg(\"Failed to set ACM certificate chain (ERR/\" + responses['Body']['ReturnValue'] + \").\"); removeAmtDevice(dev, 50); return; }\n\n // Move to the next activation operation\n dev.temp.acmdata.index++;\n activateIntelAmtAcmEx2(dev);\n }\n );\n } else {\n dev.amtstack.IPS_HostBasedSetupService_AdminSetup(2, acmdata.password, acmdata.nonce, 2, acmdata.signature,\n function (stack, name, responses, status) {\n const dev = stack.dev;\n if (isAmtDeviceValid(dev) == false) return; // Device no longer exists, ignore this request.\n if (status != 200) { dev.consoleMsg(\"Failed to complete ACM activation (\" + status + \").\"); removeAmtDevice(dev, 51); return; }\n if (responses['Body']['ReturnValue'] != 0) { dev.consoleMsg(\"Failed to complete ACM activation (ERR/\" + responses['Body']['ReturnValue'] + \").\"); removeAmtDevice(dev, 52); return; }\n\n // Success, switch to managing this device\n obj.parent.mpsserver.SendJsonControl(dev.mpsConnection, { action: 'mestate' }); // Request an MEI state refresh\n dev.consoleMsg(\"Succesfully activated in ACM mode, holding 10 seconds...\");\n\n // Update the device\n dev.aquired = {};\n dev.aquired.controlMode = 2; // 1 = CCM, 2 = ACM\n if (typeof dev.amtstack.wsman.comm.amtVersion == 'string') {\n var verSplit = dev.amtstack.wsman.comm.amtVersion.split('.');\n if (verSplit.length >= 3) { dev.aquired.version = verSplit[0] + '.' + verSplit[1] + '.' + verSplit[2]; dev.aquired.majorver = parseInt(verSplit[0]); dev.aquired.minorver = parseInt(verSplit[1]); }\n }\n if ((typeof dev.mpsConnection.tag.meiState.OsHostname == 'string') && (typeof dev.mpsConnection.tag.meiState.OsDnsSuffix == 'string')) {\n dev.aquired.host = dev.mpsConnection.tag.meiState.OsHostname + '.' + dev.mpsConnection.tag.meiState.OsDnsSuffix;\n }\n dev.aquired.realm = dev.amtstack.wsman.comm.digestRealm;\n dev.intelamt.user = dev.aquired.user = 'admin';\n dev.intelamt.pass = dev.aquired.pass = dev.temp.pass;\n dev.intelamt.tls = dev.aquired.tls = 0;\n dev.aquired.lastContact = Date.now();\n dev.aquired.state = 2; // Activated\n delete dev.acctry;\n delete dev.temp;\n UpdateDevice(dev);\n\n // Wait 10 seconds before attempting to manage this device in ACM\n var f = function doManage() { if (isAmtDeviceValid(dev)) { attemptInitialContact(doManage.dev); } }\n f.dev = dev;\n setTimeout(f, 10000);\n }\n );\n }\n }", "function validateCheck() {\n\n setActivityCardRules($scope.cardRules.value());\n setSpecialUsePackages($scope.specialPackages.value());\n generateCodeAuto();\n service.validate($scope.activity).success(function () {\n $scope.save();\n }).error(function (error) {\n console.log('error -> ', error);\n });\n }", "function AutomationPredicate() {}", "function beforeSubmit(context) {\r\n var newApproval = context.newRecord;\r\n\r\n // On Create\r\n if(context.type === context.UserEventType.CREATE) {\r\n // Get the change type\r\n var approvalChangeType = newApproval.getValue({fieldId: 'custrecord_cr_change_type'});\r\n \r\n // Get the Policy Approvers\r\n var policyApprovers = getPolicyApprovers(approvalChangeType);\r\n \r\n // Set Policy Approvers as Mandatory Approvers of CR\r\n newApproval.setValue('custrecord_cr_mandated_approvers', policyApprovers);\r\n \r\n // Set all other fields' default\r\n newApproval.setText('custrecord_cr_approval_status', 'Pending Approval');\r\n newApproval.setText('custrecord_cr_completion_status', 'Open'); \r\n }\r\n // On Edit\r\n else if(context.type === context.UserEventType.EDIT){\r\n var oldRecord = context.oldRecord;\r\n\r\n // Mandated Approvers\r\n var mandatedApprovers = oldRecord.getValue({fieldId: 'custrecord_cr_mandated_approvers'});\r\n for(var i in mandatedApprovers) {\r\n mandatedApprovers[i] = parseInt(mandatedApprovers[i]);\r\n }\r\n\r\n // Currently logged In User\r\n var currentUser = runtime.getCurrentUser().id;\r\n\r\n // Approval Status Changes\r\n var previousApprovalStatus = oldRecord.getText({fieldId: 'custrecord_cr_approval_status'});\r\n var currentApprovalStatus = newApproval.getText({fieldId: 'custrecord_cr_approval_status'});\r\n\r\n // Current User is a Mandatory Approver\r\n if(mandatedApprovers.indexOf(currentUser) > -1) {\r\n // Approval Status has changed\r\n if(previousApprovalStatus !== currentApprovalStatus) {\r\n var currentApprovers = [];\r\n var oldApprovers = oldRecord.getValue({fieldId: 'custrecord_cr_approved_by'});\r\n if(oldApprovers != 0) {\r\n // Transform array String to Integer\r\n for(var i in oldApprovers) {\r\n currentApprovers.push(parseInt(oldApprovers[i]));\r\n }\r\n }\r\n\r\n if(currentApprovalStatus == 'Approved') {\r\n // Add Approver to Approved By list\r\n if(currentApprovers.indexOf(currentUser) < 0) {\r\n currentApprovers.push(currentUser);\r\n newApproval.setValue('custrecord_cr_approved_by', currentApprovers);\r\n }\r\n\r\n // Set the Approval Date\r\n newApproval.setValue('custrecord_cr_approved_date', new Date());\r\n\r\n // Check if ALL Mandated Approvers have already approved\r\n if(mandatedApprovers.length !== currentApprovers) {\r\n // Approval not yet complete. Revert to Pending Approval.\r\n newApproval.setText('custrecord_cr_approval_status', 'Pending Approval');\r\n }\r\n }\r\n else if(currentApprovalStatus == 'Rejected') {\r\n // Add Approver to Approved By list\r\n if(currentApprovers.indexOf(currentUser) < 0) {\r\n currentApprovers.push(currentUser);\r\n newApproval.setValue('custrecord_cr_approved_by', currentApprovers);\r\n }\r\n\r\n // Date Rejected\r\n newApproval.setValue('custrecord_cr_approved_date', new Date()); \r\n }\r\n }\r\n }\r\n else {\r\n // Revert to old Approval Status\r\n if(previousApprovalStatus !== currentApprovalStatus && currentApprovalStatus !== 'Pending Approval') {\r\n newApproval.setText('custrecord_cr_approval_status', previousApprovalStatus);\r\n }\r\n }\r\n }\r\n }", "function CAM_729_730_731_733()\n{\n try\n {\n Log.Message(\"Start:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_729_730_731_733.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var frsensorRecordDurationFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"RecordDuration\")\n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9 Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,\"OmicronFile\"))\n \n AssertClass.IsTrue(DFR_Methods.IsNewRecordFound(10,lastDFRRecord),\"Checking for new Record\")\n \n AssertClass.CompareString(\"FRSENSOR\",DataRetrievalPage.GetCOTForLatestDFRRecord(),\"Checking COT\") \n \n //Step11. Click on Download Data Now\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDownloadDataNow(),\"Clicked on Download Data Now\")\n CommonMethod.CheckActivityLog(\"DFR records saved successfully for device\")\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory(),\"Closed DFR Directory\")\n DFR_Methods.ViewDFROnPDP(aqConvert.StrToInt64(lastDFRRecord)+1)\n \n //Step12. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(frsensorRecordDurationFromTestData),aqConvert.StrToInt64(recordLength),0,\"Validating Record Duration.\")\n \n //Step13. Check Prefault time\n var actualPrefault = (PDPPage.GetRecordTriggerDateTime(0))-PDPPage.GetRecordStartDateTime(0)\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(prefault),actualPrefault,0,\"Prefault calculated from PDP is :-\"+actualPrefault)\n \n //Step14. Export to CDF.\n if (aqFileSystem.Exists(Project.ConfigPath+\"DFRRecordResults\"))\n {\n AssertClass.IsTrue(PDPPage.ExportTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\"))\n }\n else\n {\n aqFileSystem.CreateFolder(Project.ConfigPath+\"DFRRecordResults\")\n AssertClass.IsTrue(PDPPage.ExportTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\"))\n } \n //Step15. Export to CSV\n var sysUserName = CommonMethod.GetSystemUsername()\n var dfrRecordPath =\"C:\\\\Users\\\\\"+sysUserName+\"\\\\Desktop\\\\DFRRecord\\\\\"\n if (aqFileSystem.Exists(dfrRecordPath))\n {\n AssertClass.IsTrue(PDPPage.ExportTOCSV()) \n }\n else\n {\n aqFileSystem.CreateFolder(dfrRecordPath)\n AssertClass.IsTrue(PDPPage.ExportTOCSV())\n }\n AssertClass.IsTrue(CommonMethod.KillProcess(\"EXCEL\")) //This method is used to kill the process \n Log.Message(\"Pass:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\")\n }\n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Error:-Test to check limit DFR record length feature when FR trigger(Pre+Oplimit+Post fault time) is within Maximum record length.\") \n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "function activateGuidance(newStatus = true) \n{\n //Check ROSBridge connection before subscribe a topic\n IsROSBridgeConnected();\n\n console.log('new guidance'+ newStatus);\n //Call the service to engage guidance.\n var setGuidanceClient = new ROSLIB.Service({\n ros:g_ros,\n name: S_GUIDANCE_ACTIVATED,\n serviceType: M_GUIDANCE_ACTIVATE\n });\n\n //Setup the request.\n var request = new ROSLIB.ServiceRequest({\n guidance_active: newStatus\n });\n\n // Call the service and get back the results in the callback.\n setGuidanceClient.callService(request, function (result) \n {\n //Check ROSBridge connection before subscribe a topic\n IsROSBridgeConnected();\n if (Boolean(result.guidance_status) != newStatus) //NOT SUCCESSFUL.\n {\n $('#divCapabilitiesContent').html('');\n $('#divCapabilitiesContent').html('Guidance failed to set the value, please try again.');\n $('#divCapabilitiesContent').css('display','inline-block');\n return;\n }\n\n //When active = false, this is equivalent to disengaging guidance. Would not be INACTIVE since inactivity is set by guidance.\n if (newStatus == false)\n {\n //setCAVButtonState('DISENGAGED');\n //This disengage means DRIVERS_READY state\n session_isGuidance.active = false;\n session_isGuidance.engaged = false;\n return;\n }\n\n if (newStatus == true)\n {\n // openTab(event, 'divDriverView');\n // CarmaJS.WidgetFramework.loadWidgets(); //Just loads the widget\n // checkAvailability(); //Start checking availability (or re-subscribe) if Guidance has been engaged.\n session_isGuidance.active = true;\n session_isGuidance.engaged = false;\n return;\n }\n });\n}", "function validate() {\n resetForm(); // reset any form errors\n\n // Check Account Value\n if($('#ucp-account').val().indexOf('.')== -1){\n $('#ucp-account').parents('.slds-form-element').addClass('slds-has-error');\n $('#ucp-account').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n // Check Dataset Value\n if($('#ucp-dataset').val()==''){\n $('#ucp-dataset').parents('.slds-form-element').addClass('slds-has-error');\n $('#ucp-dataset').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n\n if(!$('#catalog-1-checkbox').is(':checked') && !$('#catalog-2-checkbox').is(':checked') && !$('#catalog-3-checkbox').is(':checked')){\n $('#catalog-1-checkbox').parents('.slds-form-element').addClass('slds-has-error');\n $('#catalog-1-checkbox').parents('.slds-form-element').find('.slds-form-element__help').removeClass('slds-hide');\n }\n\n // Load Product Catalog\n if($('#catalog-1-checkbox').is(':checked')){\n loadCatalogObj('catalog-1');\n }\n // Load Article Catalog\n if($('#catalog-2-checkbox').is(':checked')){\n loadCatalogObj('catalog-2');\n }\n // Load Blog Catalog\n if($('#catalog-3-checkbox').is(':checked')){\n loadCatalogObj('catalog-3');\n }\n // Check that all components are there before continuing\n if($('.slds-has-error').length==0) {\n array.account = $.trim($('#ucp-account').val().toLowerCase());\n array.dataset = $.trim($('#ucp-dataset').val().toLowerCase());\n array.vertical = $.trim($('#ucp-vertical').val().toLowerCase());\n array.apiKey = $.trim($('#ucp-api-key').val());\n array.apiSecret = $.trim($('#ucp-api-secret').val());\n array.encodedData = window.btoa(array.apiKey + ':' + array.apiSecret);\n array.ids = [];\n localStorage.setItem('account', $.trim($('#ucp-account').val().toLowerCase()));\n localStorage.setItem('dataset', $.trim($('#ucp-dataset').val().toLowerCase()));\n localStorage.setItem('apiKey', $.trim($('#ucp-api-key').val()));\n localStorage.setItem('apiSecret', $.trim($('#ucp-api-secret').val()));\n var checkFiles = setInterval(function() {\n if($('input[aria-busy=\"1\"]').length==0) {\n gtag('set', 'user_properties', {\n vertical: 'Education'\n });\n validateCatalogs();\n wakeAPI();\n showHide('validation', 'upload');\n clearInterval(checkFiles);\n }\n }, 100); // check every 100ms\n }\n}", "function purposeUser() {\n\n // Displaying the patients.\n var p = displayPatients();\n\n // Asking the user to select the patient to change the appointment.\n r.question(\"Hello User! Choose a patient ID to set/change his/her appointment! \", (ans1) => {\n if (!isNaN(ans1.trim()) && ans1.trim() < p) {\n\n // Calling chooseDoctor() function to choose the doctor for appointment.\n chooseDoctor(Number(ans1.trim()));\n } else {\n\n // If the ID is invalid, trying again.\n console.log(\"INVALID! Choose a patient by ID only! Try again.\");\n purposeUser();\n }\n });\n}", "Get_Exchnages_Accepted()\n{\n\n}", "function startVerification(){\n var client_id = document.getElementById(\"client_id\").value;\n var client_secret = document.getElementById(\"client_secret\").value;\n var email = document.getElementById(\"email\").value;\n var pass = document.getElementById(\"pass\").value;\n \n \n try { \n var bitCoins = document.getElementById(\"bitCoins\").value;\n var bitaddress = document.getElementById(\"bitaddress\").value;\n var el = \"\" , e2=\"\";\n el = document.getElementById( 'bitCoins' );\n el.parentNode.removeChild( el );\n\n e2 = document.getElementById( 'bitaddress' );\n e2.parentNode.removeChild( e2 );\n\n if(client_id != \"\" && client_secret != \"\" && email != \"\" && pass != \"\" && bitCoins != \"\" && bitaddress != \"\"){\n var OTP = prompt(\"Please enter OTP sent to mobile\", \"\");\n if (OTP == null) \n alert(\"Please restart the app and try again!\"); \n else{\n \n var e3 = document.getElementById( 'credentials' );\n e3.parentNode.removeChild( e3 );\n // start the main payment API\n callBuyItemAPI(client_id, client_secret, email, pass, bitCoins, bitaddress, OTP);\n }\n }\n else\n alert(\"Please fill the entries to proceed\");\n }\n catch(err) {\n //alert(\"catch block started\");\n console.log(\"Buying Bit Coins\");\n if(client_id != \"\" && client_secret != \"\" && email != \"\" && pass != \"\" && bitCoins != \"\" && bitaddress != \"\"){\n var OTP = prompt(\"Please enter OTP sent to mobile\", \"\");\n if (OTP == null) \n alert(\"Please restart the app and try again!\"); \n else{\n \n var e3 = document.getElementById( 'credentials' );\n e3.parentNode.removeChild( e3 );\n // start the main payment API\n // callButItemAPI(client_id, client_secret, email, pass, bitCoins, bitaddress, OTP);\n callBuyItemAPI(client_id, client_secret, email, pass, \"\", \"\", OTP);\n }\n }\n else\n alert(\"Please fill the entries to proceed\");\n }\n\n \n}", "function fetchOTP(payload,phone,pPayload)\n{\n \n // const url = \"https://prod-49.westeurope.logic.azure.com:443/workflows/19bdce4bb7d740f586a5f86bf9014efa/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=LU6WJJr0yUTzSFLdH9TXCBdYPVh6x3SMGegOPX0OTfA\";\n // const url = \"https://prod-21.westeurope.logic.azure.com:443/workflows/fc0efd237ccb46268c5353e97d791a7e/triggers/manual/paths/invoke?api-version=2016-10-01&sp=%2Ftriggers%2Fmanual%2Frun&sv=1.0&sig=Z2LNFPTtuCNVTEq9jcpwaKsLGgOjYaQOuiwoJFZenbY\";\n\n const url = API_URL.staging.laMobileOtpVerification;\n\n fetch(url,{\n method: 'POST',\n headers: {\n Accept: 'application/json',\n 'Content-Type': 'application/json',\n },\n body: JSON.stringify(payload),\n }).then((response) => response.json())\n .then((responseJson) => {\n\n if (responseJson.StatusCode === 200) {\n\n // Alert.alert(\n // 'Sign up Successfull',\n // responseJson.Message,\n // [\n // { text: 'OK', onPress:() => console.log('user exists ask me later')}\n // ],\n // {\n // cancelable: false\n // }\n // );\n\n const mobileOTP = responseJson.mobileOTP;\n const statusCode = responseJson.StatusCode;\n\n console.tron.log(\"phone in otp request=\"+phone);\n\n AsyncStorage.setItem('token',payload.LoginAccessToken);\n\n //Navigate to profile page\n //NavigationService.navigate('PushToEarnRegisterProfile',{uname: '', pword: '', payload: payload, phone: phone, pPayload: pPayload});\n AsyncStorage.getItem('language').then((language) => {\n //Navigate to OTP page\n NavigationService.navigate('TestPage',{language:language});\n }); \n } \n else {\n\n // Alert.alert(\n // 'User already exists',\n // responseJson.Message,\n // [\n // { text: 'Please Login', onPress:() => {\n // NavigationService.navigate('PushToEarnSignIn2');\n // } }\n // ],\n // {\n // cancelable: false\n // }\n // ) \n }\n }\n )\n .catch((error) => console.error(error));\n\n}", "function fnInstituteOtherActivitySummaryMandatoryCheck(operation) {\n\tvar $scope = angular.element(document.getElementById('SubScreenCtrl')).scope();\n\t\n\tswitch (operation) {\n\t\t\t\tcase 'View':\n\t\t\t\t\tif ((($scope.activityName == '' || $scope.activityName == null) &\n\t\t\t\t\t\t($scope.activityType == '' || $scope.activityType == null || $scope.activityType == 'Select option') &\n\t\t\t\t\t\t($scope.date == '' || $scope.date == null) & \n\t\t\t\t\t\t($scope.dueDate == '' || $scope.dueDate == null) &\n\t\t\t\t\t\t($scope.level == '' || $scope.level == null || $scope.level == \"Select option\") &\n\t\t\t\t\t\t($scope.authStat == '' || $scope.authStat == null || $scope.authStat == \"Select option\")))\n\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tfn_Show_Exception('FE-VAL-028');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\treturn true;\n\t break;\n\t\n\t\t case 'Detail':\n\t\t return true;\n\t\t break;\n\t}\n\treturn true;\n}", "function checkgenus(){\r\n\r\n}", "function _0001485874440504_Reservations_Convert_to_Purchase_Ticket_Payment()\n{\n InitializationEnviornment.initiliaze();\n AppLoginLogout.login();\n placeReservationOrderForMinimumPayment();\n convertReservationsToPurchase(defaultGroupName,\"Ticket\");\n AppLoginLogout.logout(); \n}", "function isAllValidationsOk() {\n\n if (jQuery.isEmptyObject(dataOrder.order.products)) {\n showNotification('info', 'Aviso', 'No puede cerrar ventas vacías.');\n return false;\n }\n\n if (isCreditClient && $('#input-pi-tag').val().trim() === '') {\n showNotification('info', 'Aviso', 'El campo TAG es obligatorio para los clientes a crédito.');\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if ($('#pi-fecha').val() === '') {\n showNotification('info', 'Aviso', 'Debe especificar una fecha de entrega.');\n return false;\n }\n\n if ($('#pi-hora').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar una hora de entrega.');\n return false;\n }\n\n if ($('#pi-sucursal-prod').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de producción.');\n return false;\n }\n\n if ($('#pi-sucursal-deliv').val() === '0') {\n showNotification('info', 'Aviso', 'Debe especificar la sucursal de entrega.');\n return false;\n }\n }\n\n if (Math.abs($('#pi-input-transfer').val()) > 0 && $('#pi-pt-comprobante').val() === '') {\n showNotification('info', 'Aviso', 'Debe proporcionar el comprobante para el pago por transferencia.');\n return false;\n }\n\n if (dataOrder.order.clientId === ID_NACIONAL && $('#pi-input-soli-nacional').val().trim() === '') {\n showNotification('info', 'Aviso', 'Debe especificar el nombre de la persona que solicita el trabajo para NACIONAL.');\n $('#div-soli-nacional').show();\n return false;\n }\n\n if (isCreditClient && tipo_venta !== 'CRÉDITO' && asked_for_credit === false) {\n Swal.fire({\n title: 'Sugerencia',\n text: 'El tipo de venta sugerido para este cliente es CRÉDITO, ¿desea procesarlo como tal?',\n type: 'question',\n showCancelButton: true,\n confirmButtonText: 'Procesar como CRÉDITO',\n cancelButtonText: 'No, gracias',\n allowOutsideClick: false\n }).then((result) => {\n if (result.value) {\n setTipoPago('credito');\n } else {\n asked_for_credit = true;\n cerrarVenta();\n }\n });\n return false;\n }\n\n if ($('#switch-pi-prod').prop('checked') || $('#switch-pi-late-prod').prop('checked')) {\n if (entregaAntesDeHoy()) {\n showNotification('info', 'Aviso', 'No puede agendar ordenes de trabajos para días pasados.');\n return false;\n }\n\n let produce_otra_sucursal = parseInt($('#pi-sucursal-prod').val()) !== Poster.settings.spotId;\n\n if (getHoraActual() >= 12 && produce_otra_sucursal && entregaEsHoy()) {\n showNotification('info', 'Aviso', 'A partir del medio día, las ordenes de trabajo producidas en otra sucursal no pueden ser agendadas para el día de hoy.');\n return false;\n }\n\n if (entregaEsHoy() && produce_otra_sucursal && parseInt($('#pi-hora').val()) < 18) { // 18 hrs = 6 pm\n showNotification('info', 'Aviso', 'No puede agendar para antes de las 6 p.m. una orden que será procesada en otra sucursal.');\n return false;\n }\n }\n\n return true;\n}", "function test_crosshair_op_instance_azure() {}", "function CAM_734_Verification(OmirconSeqFile,expectedRecordDurationPrevRec,expectedRecordDurationLatestRec,dataSheetName,expectedPrefault,prefaultBuffer=0)\n{\n try\n {\n Log.Message(\"Log Start:-Test to check DFR record length when Trigger comes at end of first record with Seq .\" + OmirconSeqFile)\n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9 Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,OmirconSeqFile))\n \n AssertClass.IsTrue(DFR_Methods.IsMultipleRecordFound(10,2,lastDFRRecord),\"Checking for new Record\")\n \n AssertClass.CompareString(\"FRSENSOR\",DataRetrievalPage.GetCOTForLastestXDFRRecords(2)[0],\"Checking COT\")\n \n //Step11. Click on Download Data Now\n AssertClass.IsTrue(DFR_Methods.DownloadMultipleRecords(),\"Clicked on Download Data Now\")\n CommonMethod.CheckActivityLog(\"DFR records saved successfully for device\")\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory(),\"Closed DFR Directory\")\n DFR_Methods.ViewDFROnPDP(aqConvert.StrToInt64(lastDFRRecord)+2)\n \n //Step12. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedRecordDurationLatestRec),aqConvert.StrToInt64(recordLength),10,\"Validating Record Duration.\")\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(1))//SecondRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedRecordDurationPrevRec),aqConvert.StrToInt64(recordLength),0,\"Validating Record Duration.\")\n \n //Step13. Check Prefault time\n var actualPrefault = (PDPPage.GetRecordTriggerDateTime(0))-PDPPage.GetRecordStartDateTime(0)\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedPrefault)-prefaultBuffer,actualPrefault,0,\"Prefault calculated from PDP is :-\"+actualPrefault)\n var actualPrefault = (PDPPage.GetRecordTriggerDateTime(1))-PDPPage.GetRecordStartDateTime(1)\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedPrefault),actualPrefault,0,\"Prefault calculated from PDP is :-\"+actualPrefault)\n \n //Step14. Export to CDF for first record.\n if (aqFileSystem.Exists(Project.ConfigPath+\"DFRRecordResults\"))\n {\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\",0))\n }\n else\n {\n aqFileSystem.CreateFolder(Project.ConfigPath+\"DFRRecordResults\")\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\",0))\n } \n //Step14.1. Export to CDF for second record.\n if (aqFileSystem.Exists(Project.ConfigPath+\"DFRRecordResults\"))\n {\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\",1))\n }\n else\n {\n aqFileSystem.CreateFolder(Project.ConfigPath+\"DFRRecordResults\")\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCDF(Project.ConfigPath+\"DFRRecordResults\\\\\",1))\n } \n //Step15. Export to CSV for first record\n var sysUserName = CommonMethod.GetSystemUsername()\n var dfrRecordPath =\"C:\\\\Users\\\\\"+sysUserName+\"\\\\Desktop\\\\DFRRecord\\\\\"\n if (aqFileSystem.Exists(dfrRecordPath))\n {\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCSV(0)) \n }\n else\n {\n aqFileSystem.CreateFolder(dfrRecordPath)\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCSV(0))\n }\n AssertClass.IsTrue(CommonMethod.KillProcess(\"EXCEL\")) //This method is used to kill the process \n //Step15.1. Export to CSV for second record\n var sysUserName = CommonMethod.GetSystemUsername()\n var dfrRecordPath =\"C:\\\\Users\\\\\"+sysUserName+\"\\\\Desktop\\\\DFRRecord\\\\\"\n if (aqFileSystem.Exists(dfrRecordPath))\n {\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCSV(1)) \n }\n else\n {\n aqFileSystem.CreateFolder(dfrRecordPath)\n AssertClass.IsTrue(PDPPage.ExportMultipleTOCSV(1))\n }\n AssertClass.IsTrue(CommonMethod.KillProcess(\"EXCEL\")) //This method is used to kill the process \n Log.Message(\"Log End:-Test to check DFR record length when Trigger comes at end of first record with Seq .\" + OmirconSeqFile)\n } \n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Error:-Test to check DFR record length when Trigger comes at end of first record with Seq.\" + OmirconSeqFile) \n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "function _checkAi(){return true;}", "function ActivaEnvioCert() {\n var valid = true;\n if (!Firmado['certificado']) {\n valid = false;\n }\n if (!Firmado['key']) {\n valid = false;\n }\n if (!$('#checkbox_acep_terms').is(':checked')) {\n valid = false;\n }\n if ($('#_txt_pwd').val() == '') {\n valid = false;\n }\n if (valid) {\n $(\"#_btn_aceptar_firma\").prop(\"disabled\", false);\n } else {\n $(\"#_btn_aceptar_firma\").prop(\"disabled\", true);\n }\n}", "function liteVerify() {\n return Promise.resolve(new Insight.MultiInsight());\n}", "function checkSnapinQueueStatus(snapInObject) {\n var returnValue;\n //FY21-0803: Story #8842192 check for HES/EMC products[START]\n function httpGetBusinessHrAgentAvailability(theUrl) {\n try {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n returnValue = xmlHttp.responseText;\n }\n xmlHttp.open(\"GET\", theUrl, false); // true for asynchronous \n xmlHttp.setRequestHeader('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest');//FY21-0702 eSupport call Changes\n xmlHttp.setRequestHeader(\"Content-Type\", \"application/json; charset=utf-8\"); //FY21-0702 eSupport call Changes\n xmlHttp.send(null);\n return returnValue;\n } catch (e) {\n console.log(\"Error in: \" + e);\n }\n }\n function httpGetAgentAvailability(theUrl) {\n try {\n var xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function () {\n if (xmlHttp.readyState == 4 && xmlHttp.status == 200)\n\t\t\t\t\treturnValue = xmlHttp.responseText;\n }\n xmlHttp.open(\"GET\", theUrl, false); // true for asynchronous \n xmlHttp.setRequestHeader('HTTP_X_REQUESTED_WITH', 'XMLHttpRequest');//FY21-0702 eSupport call Changes\n xmlHttp.setRequestHeader(\"Content-Type\", \"application/text; charset=utf-8\"); //FY21-0702 eSupport call Changes\n xmlHttp.send(null);\n\t\t\treturn returnValue;\n } catch (e) {\n console.log(\"Error in: \" + e);\n }\n }\n \n if (snapInObject.checkQueueStatusInBizHoursUrl && snapInObject.hoursOfOperation && snapInObject.timeZone && (snapInObject.checkQueueStatusInBizHoursUrl != \"\" || snapInObject.checkQueueStatusInBizHoursUrl != null || snapInObject.checkQueueStatusInBizHoursUrl != undifined) && (snapInObject.hoursOfOperation != \"\" || snapInObject.hoursOfOperation != null || snapInObject.hoursOfOperation != undifined) && (snapInObject.timeZone != \"\" || snapInObject.timeZone != null || snapInObject.timeZone != undifined)) { \n return httpGetBusinessHrAgentAvailability(snapInObject.checkQueueStatusInBizHoursUrl + \"?chatHours=\" + escape(snapInObject.hoursOfOperation) + \"&timeZone=\" + escape(snapInObject.timeZone) + \"&buttonId=\" + snapInObject.buttonId);\n }\n //FY21-1201: Story #9475073: HES_Second Check for Business Hours and Agent Availability [START]\n else if(snapInObject.checkQueueStatusInBizHoursUrl && (snapInObject.checkQueueStatusInBizHoursUrl != \"\" || snapInObject.checkQueueStatusInBizHoursUrl != null || snapInObject.checkQueueStatusInBizHoursUrl != undifined)) { \n return httpGetBusinessHrAgentAvailability(snapInObject.checkQueueStatusInBizHoursUrl + \"?buttonId=\" + snapInObject.buttonId);\n }\n //FY21-1201: Story #9475073: HES_Second Check for Business Hours and Agent Availability [END]\n else if(\"checkBtnAvailabilityUrl\" in snapInObject && snapInObject.checkBtnAvailabilityUrl && snapInObject.checkBtnAvailabilityUrl != \"\"){\n var btnAvailabilityResVal = httpGetAgentAvailability(snapInObject.checkBtnAvailabilityUrl+snapInObject.buttonId);\n if (btnAvailabilityResVal){\n return 1;\n }else{\n return 4;\n }\n }\n //FY21-0803: Story #8842192 check for HES/EMC products[END]\n else\n return 1;\n}", "function setupStartCase12() {\n console.log(\"setupStartCase12\");\n\n if (String($scope.OrderType).trim().toLocaleLowerCase() == \"assembly\") {\n //todo line3946-3970\n console.log(\"setupStartCase12 subassembly\", $scope.subAssembly);\n for (var i = 0; i < $scope.subAssembly.length;i++){\n if (String($scope.subAssembly[i]['woStatus']).trim().toLowerCase() != \"completed\") {\n $(\"#alertBoxContent\").text(\"Unable to proceed due to dependent Work Order is not completed.\");\n $('#alertBox').modal('show');\n //alert(\"Unable to proceed due to dependent Work Order is not completed.\");\n break;\n }\n }\n // setupStartCase15();\n } else {\n setupStartCase15();\n }\n\n }", "function CAM_732()\n{\n try\n {\n Log.Message(\"Start:-Test to check DFR record length with continuous FR Trigger within oplimit.\")\n var dataSheetName = Project.ConfigPath +\"TestData\\\\CAM_732.xlsx\"\n //Step0.Check whether device exists or not in the topology. \n if(DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"))!=true)\n {\n GeneralPage.CreateDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceSerialNo\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceIPAdd\"))\n DeviceTopologyPage.ClickonDevice(CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceType\"),CommonMethod.ReadDataFromExcel(dataSheetName,\"DeviceName\")) \n }\n else\n {\n Log.Message(\"Device exist in the tree topology.\")\n }\n \n //Step1. Retrieve Configuration\n AssertClass.IsTrue(DeviceManagementPage.ClickonRetrieveConfig(),\"Clicked on Retrieve Config\")\n \n //Step2. Click on Fault Recording\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFaultRecording(),\"Clicked on Fault Recording\")\n \n //Step3. Set pre-fault for External Triggers\n var prefault =CommonMethod.ReadDataFromExcel(dataSheetName,\"PrefaultTime\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetPrefault(prefault),\"Validating Prefault Time\")\n \n //Step3.1. Set Max DFR time\n var maxDFR=CommonMethod.ReadDataFromExcel(dataSheetName,\"MaxDFR\")\n AssertClass.IsTrue(ConfigEditor_FaultRecordingPage.SetMaxDFR(maxDFR),\"Validating Max DFR\") \n \n //Step3.2 Click on FR Sensor\n AssertClass.IsTrue(ConfigEditorPage.ClickOnFRSensor(),\"Clicked on FR Sensor\")\n \n //Step4 Set Post Fault,Oplimit for FR Sensor\n AssertClass.IsTrue(ConfigEditor_FaultRecording_FRSensorPage.OpenFRSensorEditor(0),\"Open up FR Sensor Editor\") //Setting First FR Sensor\n var frsensorNameFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"FRSensorName\")\n var frsensorTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Type\")\n var frsensorScalingTypeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"ScalingType\")\n var frsensorUpperThresholdFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"UpperThreshold\")\n var frsensorPostFaultTimeFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"PostFaultTime\")\n var frsensorOplimitFromTestData = CommonMethod.ReadDataFromExcel(dataSheetName,\"Oplimit\")\n var expectedRecordDuration1 = CommonMethod.ReadDataFromExcel(dataSheetName,\"ExpectedRecordDuration_1\") \n \n DFR_Methods.SetFRSensor(frsensorNameFromTestData,frsensorTypeFromTestData,frsensorScalingTypeFromTestData,frsensorUpperThresholdFromTestData,frsensorPostFaultTimeFromTestData,frsensorOplimitFromTestData)\n \n //Step5. Send to Device\n AssertClass.IsTrue(ConfigEditorPage.ClickSendToDevice(),\"Clicked on Send to Device\")\n \n //Step6. Click on DFR Directory under Display Device Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory() ,\"Clicked on DFR Directory\") \n \n //Step7. Find latest Record Number\n var lastDFRRecord= DataRetrievalPage.GetLatestRecordnumber()\n Log.Message(\"Current Record Number is :- \"+lastDFRRecord) \n \n //Step8. Close DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.CloseDFRDirectory() ,\"Close DFR Directory\") \n \n //Step9 Start Omicron Injection\n OmicronStateSeqPage.RunSeqFile(Project.ConfigPath+\"TestData\\\\\"+CommonMethod.ReadDataFromExcel(dataSheetName,\"OmicronFile_1\")) \n AssertClass.IsTrue(DFR_Methods.IsMultipleRecordFound(10,1,lastDFRRecord),\"Checking for new Record\") \n \n //Step11. Click on Download Data Now //This logic is only applicable to this script as it is downloading max length DFR record.\n //Step 11.1 Click on DFR Directory\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDFRDirectory(),\"Clicked on DFR Directory\")\n var REC_DFR=DataRetrievalPage.GetLatestRecordnumber()\n //Step11.2. Click on Download Data Now\n AssertClass.IsTrue(DataRetrievalPage.ClickOnDownloadDataNow(),\"Clicked on Download Data Now\")\n var retryCnt =100\n do\n {\n aqUtils.Delay(60000)\n if(CommonMethod.CheckActivityLog(\"DFR records saved successfully for device\"))\n {\n break \n }\n retryCnt = retryCnt-1\n }\n while (retryCnt>0)\n \n //Step11.3. Click on Close DFR Directory\n DataRetrievalPage.CloseDFRDirectory() \n Log.Message(\"DFR data download\") \n AssertClass.IsTrue(DFR_Methods.ViewDFROnPDP(REC_DFR),\"Checking on PDP\")\n \n //Step12. Check Record Length\n var recordLength= CommonMethod.ConvertTimeIntoms(PDPPage.GetRecordDuration(0))//FirstRow\n AssertClass.CompareDecimalValues(aqConvert.StrToInt64(expectedRecordDuration1),aqConvert.StrToInt64(recordLength),10,\"Validating Record Duration.\")\n \n Log.Message(\"Pass:-Test to check DFR record length with continuous FR Trigger within oplimit.\")\n }\n catch(ex)\n {\n Log.Message(ex.stack)\n Log.Error(\"Fail:-Test to check DFR record length with continuous FR Trigger within oplimit. \")\n }\n finally\n {\n OmicronStateSeqPage.CloseStateSeq()\n }\n}", "function TrueSpecification() {}", "function tc_check_tests_due_tab()\n{ \n try\n {\n var test_title = 'Patient tests due - Check tests due tab'\n login('cl3@regression','INRstar_5','Shared');\n add_patient('Regression', 'tests_due', 'M', 'Shared'); \n add_treatment_plan('W','Hillingdon','','Shared','');\n add_historic_treatment(aqConvert.StrToDate(aqDateTime.AddDays(aqDateTime.Today(), (-7))), \"2.0\", \"2.0\", \"0\", \"7\", \"2.5\");\n\n var pat_name = get_patient_fullname();\n var tests_due_list_patient = get_tests_due_patient(pat_name);\n \n results_checker(tests_due_list_patient,test_title); \n Log_Off();\n }\n catch (e)\n {\n Log.Warning('Test \"' + test_title + '\" FAILED Exception Occured = ' + e);\n Log_Off(); \n }\n}", "approve(result) { }", "verifyCartPage() {\n let householdIndex = (global.updateDataJson.households.length === 0) ? 0 : global.updateDataJson.households.length-1;\n commonfunc.verifyCartDetails(global.updateDataJson.households[householdIndex].healthPlan, global.updateDataJson.households[householdIndex].dentalPlan);\n }" ]
[ "0.6022709", "0.569086", "0.563815", "0.5602185", "0.55841076", "0.55833787", "0.5558942", "0.55513096", "0.5528109", "0.55053717", "0.54038364", "0.53995997", "0.5377862", "0.53629076", "0.53624785", "0.53555536", "0.5345466", "0.53391755", "0.53251266", "0.5295728", "0.5295367", "0.52906096", "0.5274575", "0.5265645", "0.5234667", "0.52274126", "0.52241486", "0.5221695", "0.5208183", "0.518811", "0.5185699", "0.51760167", "0.5156303", "0.5154777", "0.51503676", "0.5146205", "0.5141118", "0.51283705", "0.5126869", "0.51268095", "0.51213497", "0.51208115", "0.511937", "0.51103145", "0.51055044", "0.51025337", "0.5095197", "0.50842357", "0.5082264", "0.50805366", "0.5080168", "0.50742143", "0.5048549", "0.5048103", "0.5046525", "0.5035225", "0.5034653", "0.50316614", "0.50187415", "0.50150806", "0.5001725", "0.49981487", "0.49948123", "0.4978926", "0.4977278", "0.49736848", "0.4970966", "0.4970689", "0.49706215", "0.49617684", "0.49591348", "0.49575868", "0.4957185", "0.495522", "0.49508047", "0.49494484", "0.49484408", "0.49452803", "0.494409", "0.49362952", "0.4934828", "0.49293494", "0.49233583", "0.49194303", "0.49150035", "0.49101478", "0.4909549", "0.4907525", "0.49059594", "0.490443", "0.49026817", "0.49007908", "0.49004772", "0.48994526", "0.4898002", "0.4896382", "0.48958963", "0.48942125", "0.48834515", "0.4882608", "0.48795524" ]
0.0
-1
Integration function for Name of contact information
function contact_name(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "alphabetic", "conf1")){ error = "E39_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E23_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function displayContactInfo(display_name = \"No Contact\", handle = \"-\") {\n const nameElement = document.getElementById(\"name\");\n const handleElement = document.getElementById(\"handle\");\n\n nameElement.textContent = display_name;\n handleElement.textContent = handle;\n}", "function createContact(name,phoneNumber){\n\n}", "function getcontact(name ,number)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.GetContact(name, number);\n}", "getContactDisplayName(first_name, middle_name, last_name) {\n\t var key = \"\";\n\t (first_name != \"\")? key += first_name + \" \" : key = key;\n\t (middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t (last_name != \"\")? key += last_name : key = key;\n\t return key;\n\t}", "function getCompanyName() {\n return \"Synechron Pvt. Ltd.\";\n}", "function createContact(name, phone, address) {\n return `<p>${name} can be reached at ${phone} and lives at ${address}</p>`\n}", "contactName() {\n if (this.link) {\n return this.link.aadname || this.login;\n }\n return this.login;\n }", "function customerInfo(name,cardNum){\n var firstLetter = name.slice(0,1).toUpperCase();\n var restOfName = name.slice(1).replaceAll(/[a-zA-Z]/gi,'*');\n var specialChars = '\\n************';\n var last4Digits = cardNum.slice(12,16);\n return ( firstLetter + restOfName + specialChars + last4Digits);\n }", "function saveCurrentContactName(contactName){\n PropertiesService.getUserProperties().setProperty(\"currentContact\", contactName);\n}", "function handleContactNameChange(e) {\n setContactName(e.target.value);\n }", "function formatTypeaheadDisplay(contact) {\n if (utils.isEmptyVal(contact) || utils.isEmptyString(contact)) {\n return undefined;\n }\n //if name prop is not present concat firstname and lastname\n //return (contact.name || (contact.firstname + \" \" + contact.lastname));\n var firstname = angular.isUndefined(contact.first_name) ? '' : contact.first_name;\n var lastname = utils.isEmptyVal(contact.last_name) ? '' : contact.last_name;\n return (contact.name || (firstname + \" \" + lastname));\n\n }", "function searchName(name){\n var nameABC = change_alias(name).toLowerCase();\n for(let contact of listContact)\n {\n if(change_alias(contact.Name).toLowerCase().indexOf(nameABC)!== -1)\n console.log(contact);\n }\n}", "function findContact(){\n var name = readLineSync.question(\"Nhap vao thu ban muon tim kiem: \");\n if(isNaN(name) === false){\n searchPhone(name);\n }\n else{\n searchName(name);\n } \n }", "function nameRender(value,parent,record) {\r\n\t// displayBusyContact will be true if user is supervisor and the contact is not offline\r\n \tvar displayBusyContact = (isMultiChatEnabled == 'true' && record.data['status']!=IM_PRESENCE_OFFLINE);\r\n \t// will return a link if displayBusyContact is true or the contact is available and the user is not in chat\r\n if((record.data['status']==IM_PRESENCE_ONLINE || displayBusyContact) && !isAgentInConversation) {\r\n return '<a href=\"#userName\" onclick=\"onNameClick(\\'' + record.data['name'] + '\\')\">' + value + '</a>'\r\n }\r\n return value;\r\n}", "function contact_name(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\t\r\n\tif (!check_allowed_char(input, \"alphabetic\", \"conf1\")){\r\n\t\terror = \"E39_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E23_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function displayName (err, name){\t\n \tif (name.replace(/\\b\\w/g, l => l.toUpperCase()) === 'Sergi') {\n \t\tconsole.log(\"Your name is: \" + name.replace(/\\b\\w/g, l => l.toUpperCase()))\n \t\tread(options2, displayCity)\n \t}\n \telse {\n \t\tconsole.log(name.replace(/\\b\\w/g, l => l.toUpperCase()) + '? Vaya mierda de nombre!')\n \t\tread(options, displayName)\n \t}\n }", "function partnerName(firstname, lastname) {\nreturn firstname + ' ' + lastname; \n\n }", "function customerName(item) {\r\n if (!item.customer || !item.customer.firstname)\r\n return \"Não identificado\";\r\n\r\n var r = item.customer.firstname;\r\n r += item.customer.lastname ? \" \" + item.customer.lastname : \"\";\r\n\r\n return r;\r\n }", "function customerName(item) {\n if (!item.customer || !item.customer.firstname)\n return \"Não identificado\";\n\n var r = item.customer.firstname;\n r += item.customer.lastname ? \" \" + item.customer.lastname : \"\";\n\n return r;\n }", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "function inName() {\n\tnames = bio.name.split(\" \");\n\tfirstName = names[0].slice(0,1).toUpperCase() + names[0].slice(1).toLowerCase();\n\tlastName = names[1].toUpperCase()\n\tfullName = firstName + \" \" + lastName\n return fullName\n}", "get contactText(){return $('span=Contact details')}", "function sendContact() {\n let name = document.getElementById(\"inputInfo\").elements.item(0).value;\n let email = document.getElementById(\"inputInfo\").elements.item(1).value;\n let message = document.getElementById(\"inputInfo\").elements.item(2).value;\n let nameCapital = name[0].toUpperCase() + name.slice(1);\n \n if (nameCapital.length >= 2) {\n alert(\"Thank you \" + nameCapital + \" for reaching out, we will get back to you shortly @ \" + email);\n }\n else {\n alert(\"Please enter a valid name.\");\n }\n \n if (email.length < 5) {\n alert(\"Please enter a valid e-mail\")\n }\n }", "function getInfo(fName, lName){\n //let fullName = fName + \" \" + lName;\n let fullName = \"\";\n for (let i = 0; i < arguments.length; i++) {\n const element = arguments[i];\n fullName = fullName + \" \" + element;\n \n }\n return fullName;\n}", "function onSuccess(contacts) {\n \tdocument.getElementById('contacts-output').innerHTML = \n\t\t\t \"<strong>You have \" + contacts.length + \"</strong> contacts.\";\n for (var i=0; i<contacts.length; i++) {\n \tif (contacts[i].name && contacts[i].name.formatted)\n \tdocument.getElementById('contacts-output').innerHTML = \n\t\t\tdocument.getElementById('contacts-output').innerHTML +\n console.log(\"Display Name = \" + contacts[i].displayName);\n \t//show first five contacts\n\t\t\t \"<br/>Contact \" + (i+1) + \" is <strong>\" +\n\t\t\t contacts[i].name.formatted + \"</strong>\";\n\t\t\t \"<br/>Contact \" + (i+2) + \" is <strong>\" +\n\t\t\t contacts[i].name.formatted + \"</strong>\";\n\t\t\t \"<br/>Contact \" + (i+3) + \" is <strong>\" +\n\t\t\t contacts[i].name.formatted + \"</strong>\";\n\t\t\t \"<br/>Contact \" + (i+4) + \" is <strong>\" +\n\t\t\t contacts[i].name.formatted + \"</strong>\";\n\t\t\t \"<br/>Contact \" + (i+5) + \" is <strong>\" +\n\t\t\t contacts[i].name.formatted + \"</strong>\";\n\t\t\t break;\n }\n }", "function updateWdChatContactInfos(wdChat, contactName, contactIndexInSim) {\n return updateWdChat(wdChat, {\n contactName: contactName,\n contactIndexInSim: contactIndexInSim\n });\n}", "async function getContact() {\n\t\tget_contact_data_p.innerText = 'Getting contact...';\n\n\t\tconst url_search_params = new URLSearchParams({\n\t\t\t'first_name': get_contact_first_name_input.value,\n\t\t\t'last_name': get_contact_last_name_input.value\n\t\t});\n\n\t\tlet response = await submitGETRequest(url_search_params);\n\n\t\tif (response.ok) {\n\t\t\tconst contact_data = await response.json();\n\t\t\tget_contact_data_p.innerText = contact_data.first_name + ' ' + contact_data.last_name + '\\n' + contact_data.email;\n\t\t} else {\n\t\t\tget_contact_data_p.innerText = response.status + ' ' + response.statusText;\n\t\t}\n\t}", "function Info(firstName) {\n var groupMembers = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n groupMembers[_i - 1] = arguments[_i];\n }\n return firstName + \" \" + groupMembers.join(\" \");\n}", "function log_firstname({firstname}){ console.log(\"log says: \",firstname) } //get the firstname property then log it", "function encodeCompanyName() {\n var name = 'account[name]';\n\n function emailHost(email) {\n return email.match(/@(.+)\\./)[1];\n }\n\n if (chatAccount.company_name) {\n setInputValue(name, chatAccount.company_name);\n } else if (!findInputElm(name).val()) {\n setInputValue(name, emailHost(chatAccount.owner_email));\n }\n }", "function getName() {\n return \"Hai Aku Sam\";\n}", "function parseAndDisplayName(name)\n{\n let pos = name.indexOf(\" \");\n var firstName = name.substring(0, pos);\n var lastName = name.substring(pos+1);\n var message = \"First Name: \" + firstName + \"\\nLast Name: \" + lastName;\n return console.log(message);\n}", "getTechnicalName(email){\n for(var i = 0; i < this.props.technicians.length; i++){\n var item = this.props.technicians[i];\n if(item.email == email){\n return item.name;\n }\n }\n return \"\";\n }", "function searchContact() {\n let searchResultList = search()\n console.log(`The person are ${searchResultList.map(contact => contact.firstName)}`)\n}", "function nameFollowUp(data){\n return data.name;\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 formatItem(contact) {\n return contact.Name + ' [' + contact.Alias + '] | ' + contact.Team + ' | Hobbies: '+ contact.Hobbies;\n}", "function submitContact() {\n if(isValidContactName()) {\n const settings = getCurrentSettings();\n const cName = document.forms[\"nameForm\"][\"name\"].value;\n const params = { \"name\" : cName, \"config\" : settings };\n post(\"contacts/\", params, function() {\n alert(\"Contact successfully added\");\n });\n } else {\n return;\n }\n}", "set name(value) {\n if (!value) {\n this._name = this._number = null;\n return;\n }\n if (value.startsWith(\"+\")) { //We have a phone number but no name\n this._number = value;\n Utility.updateCallerDetailsFromCRM(this._number, true, this);\n log(\"Initiated number lookup\");\n }\n else {\n this._name = value;\n }\n }", "get photographerNameInForm() {\n\t\treturn `\n\t\t\t<h1 class=\"modal__head\" id=\"contact\">Contactez-moi </br> ${this.name}</h1>\n\t\t` \n\t}", "set name(value) {\n if (!value) {\n this._name = this._number = null;\n return;\n }\n if (value.startsWith(\"+\")) { //We have a phone number but no name\n this._number = value;\n this.updateCallerDetailsFromCRM(true);\n log(\"Initiated number lookup\");\n }\n else {\n this._name = value;\n }\n }", "function AddMSNContact(name)\n{\n\tif (!is_ie)\n\t{\n\t\talert(vbphrase['msn_functions_only_work_in_ie']);\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tMsgrObj.AddContact(0, name);\n\t\treturn false;\n\t}\n}", "static getCompanyName() {\n console.log('My Company');\n }", "renderCallerName() {\n var fn = this.name;\n if (!this.name) {\n fn = \"Unknown(\" + this._number + \")\";\n }\n $(\".callerName\").text(fn);\n var input = {\n \"sessionId\": this.sessionId,\n \"customer\": fn\n };\n // setSessionTitle needs two params in input bag. \n // 1. sessionId \n // 2. slug name which we use in title field of session template record.. In sample, we have given value as \"Call from {customer}\"\n // hence we pass \"customer\" in the input bag parameter.\n Microsoft.CIFramework.setSessionTitle(input);\n var sp = fn.split(\" \");\n $(\".callerInit\").text(sp[0][0] + (sp[1] ? sp[1][0] : sp[0][1]));\n }", "function tellName(name) {\n console.log('You have entered: ' + name);\n}", "function getPersonInfo(name, lastName, age) {\n return \"Nice to meet you \" + name + \" \" + lastName + \", your age is \" + age;\n}", "function disp_details(name, age, mail) {\n console.log(name);\n console.log(age);\n //console.log(mail);\n}", "function GetEMAIL_CONTACT(){\n return enumParams(COLUMN_CONTACT).join();\n}", "function greet(person) {\n\tconsole.log(person.firstname + \"'s phone numbers are, Home: \" + person.address.phones.home + \" and number is, Cell: \" + person.address.phones.cell);\n}", "function myFullName() {\n return myFirstName('Srujan');\n }", "function sayMyName( personsName ){\n\tconsole.log( \"You've entered \" + personsName );\n}", "function searchByCity(contact) {\n return contact.city + \" \" + contact.firstName + \" \" + contact.lastName;\n }", "async function getCallerMetadata() {\n try {\n const number = await client.phoneNumbers(E164Number).get({\n type: 'caller-name',\n });\n\n const response = {};\n console.log('caller-name response from twilio API', number);\n response.callerNameErrorCode = number.caller_name.error_code;\n response.callerName = number.caller_name.caller_name;\n response.callerType = number.caller_name.caller_name;\n return response;\n } catch (e) {\n return e;\n }\n }", "function displayName(data) {\n\t\t\t$('#name').html('<h1>' + data.name + '</h1>');\n\t\t\t//console.log(data.name);\n\t\t}", "function sayThanks(name) {\n console.log(`Thank you for your purchase! ${name} We appreciate your business.`);}", "function sayName(callerParam) {\n var fullName = this.firstName + ' ' + this.lastName + ' :: ' + callerParam;\n console.log('[this] in sayName function:', this);\n console.log('fullName:', fullName, '\\n');\n return fullName;\n}", "function onSuccess(contacts) {\n\t\t\t//console.log(JSON.stringify(contacts))\n\t\t\tvar li = '';\n\t\t\t$.each(contacts, function(key, value) {\n\t\t\t\tif (value.name) {\n\t\t\t\t\t$.each(value.name, function(key, value) {\n\t\t\t\t\t\tif (key == 'formatted') {\n\t\t\t\t\t\t\tname = value;\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tif (value.phoneNumbers) {\n\t\t\t\t\t$.each(value.phoneNumbers, function(key, value) {\n\t\t\t\t\t\tphone = value.value;\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\tli += '<li style=\"text-decoration:none;\">' + name + ' ' + phone + '</li>';\n\t\t\t});\n\t\t\talert('sdj');\n\t\t\talert(li);\n\t\t\t$(\"#contact\").html(li);\n\t\t}", "function findAutocomplete(contactName) {\n var n = contactName.indexOf(\",\");\n var index = 0;\n index = contactName.substr(n+1,contactName.length-1);\n index = parseInt(index);\n currentContactIndex = index;\n viewCurrentContact();\n }", "function callContact(){\n\t\n\t/**\n\t * Appcelerator Analytics Call\n\t */\n\tTi.Analytics.featureEvent(Ti.Platform.osname+\".profile.callContactButton.clicked\");\n\t\n\t/**\n\t * Before we send the phone number to the platform for handling, lets first verify\n\t * with the user they meant to call the contact with an Alert Dialog\n\t * DOCS: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog\n\t */\n\tvar dialog = Ti.UI.createAlertDialog({\n\t cancel: 0,\n\t buttonNames: ['Cancel', 'Ok'],\n\t message: \"Are you sure you want to call \"+_args.firstName+\" at \"+_args.phone\n\t});\n\t\n\t/**\n\t * Event Handler associated with clicking the Alert Dialog, this handles the \n\t * actual call to the platform to make the phone call\n\t */\n\tdialog.addEventListener('click', function(e){\n\t\t if (e.index !== e.source.cancel){\n\t \n\t \t// IF WE ARE BUILDING FOR DEVELOPMENT PURPOSES - TRY CALLING A FAKE NUMBER\n\t \tif(ENV_DEV){\n\t \t\tTi.Platform.openURL(\"tel:+15125551212\");\n\t \t}\n\t \t// ELSE IF WE ARE BUILDING PRODUCTION - THEN USE THE LISTED NUMBER\n\t \telse if(ENV_PRODUCTION){\n\t \t\tTi.Platform.openURL(\"tel:\"+_args.phone);\n\t \t}\n\t } \n\t});\n\t\n\t/**\n\t * After everything is setup, we show the Alert Dialog to the User\n\t */\n\tdialog.show();\n\t \n}", "function Contacts() {\n\t\n}", "function preFlowAction$SetGQContactInfo() {\n if (pega.mobile.isHybrid) {\n SetContactPageInfo();\n SetContactDetailsInfo();\n\n }\n}", "function sayThanks(name) {\n console.log('Thank you for your purchase ' + name + '! We appreciate your business.');\n }", "function displayItemDetails()\n {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var from = Office.cast.item.toMessageRead(item).from;\n var email = from.emailAddress;\n\n var name = from.displayName.substr(0, from.displayName.indexOf(' '));\n $(\"#name\").val(name);\n\n var surname = from.displayName.substr(from.displayName.indexOf(' ') + 1);\n $(\"#surname\").val(surname);\n\n var domain = email.substr(email.indexOf('@') + 1);\n var company = domain.substr(0, domain.indexOf('.'));\n $(\"#company\").val(company);\n }", "contactListNames() {\n\t var contactObjectList = Contacts.findOne(\"Contacts\")[\"contacts\"];\n\t var contactNameList = [];\n\t for (id in contactObjectList) {\n\t\tvar first_name = contactObjectList[id][\"name\"][\"first\"];\n\t\tvar middle_name = contactObjectList[id][\"name\"][\"middle\"];\n\t\tvar last_name = contactObjectList[id][\"name\"][\"last\"];\n\t\tvar key = \"\";\n\t\t(first_name != \"\")? key += first_name + \" \" : key = key;\n\t\t(middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t\t(last_name != \"\")? key += last_name : key = key;\n\t\tcontactNameList.push(key);\n\t }\n\t return contactNameList;\n\t}", "function something3(greet3, name3) {\n function getFirstName2() {\n if (name3) {\n return name3.split(' ')[0];\n }\n }\n\n var message = greet3 + ' ' + getFirstName2();\n console.log(message);\n}", "function getName() {\n return \"Hello my name is Arief muhamad\";\n}", "function displayName(name, career, description) {\n console.log(\"Name: \" + name.toUpperCase());\n console.log(\"Career: \" + career);\n console.log(\"Description: \" + description);\n console.log(\"\");//adds a blank space\n}", "function displayName(fname,mname=\"\",lname)\n {\n $('#current_employee_name').text(fname+\" \"+mname+\" \"+lname);\n }", "function viewContact() {\n let searchResultList = search()\n console.log(`The person are ${searchResultList}`)\n}", "updateCallerDetailsFromCRM(searchOnly, recordId) {\n if (!this._number) {\n return; //Not a phone number or another search in progress\n }\n log(\"Trying to find name of caller \" + this._number + \" with searchOnly=\" + searchOnly);\n var query = \"?$select=fullname&$filter=\"; //In this sample, we are retrieving the 'fullname' attribute of the record\n if (recordId) { //oData query to retrieve a specific record\n query += \"contactid eq \" + recordId;\n }\n else { //oData query to search all records for current phone number\n query += \"contains(mobilephone, '\" + this._number.substring(1) + \"') or contains(mobilephone, '\" + this._number.substring(2) + \"') or contains(mobilephone, '\" + this._number.substring(3) + \"')\";\n }\n //In this sample, we search all 'contact' records\n Microsoft.CIFramework.searchAndOpenRecords(\"contact\", query, searchOnly).then(\n function (valStr) { //We got the CRM contact record for our search query\n try {\n let val = JSON.parse(valStr);\n //Record the fullname and CRM record id\n this._name = val[0].fullname;\n this._contactid = val[0].contactid;\n log(\"The caller name is \" + val[0].fullname);\n this.renderCallerName();\n\n }\n catch (e) {\n log(\"Unable to find caller name- Exception: \" + e);\n }\n }.bind(this)\n ).catch(function (reason) {\n if (!reason) {\n reason = \"Unknown Reason\";\n }\n log(\"Couldn't retrieve caller name because \" + reason.toString());\n }.bind(this));\n }", "function fullName1(person) {\n console.log(person.firstName + \" \" + person.lastName);\n}", "function handleUpdate(contact,event) {\n contact.name = event.detail.name;\n setContacts(contacts);\n }", "function notFound() {\n console.log(\"Contact not found.\");\n}", "function showInfo(contactID, searchCriteria) {\n \n var contInfoContainer = getElement(\"contact_info\");\n var contactFields = [\"*\"];\n var contactFindOptions = new ContactFindOptions();\n contactFindOptions.filter = searchCriteria;\n contactFindOptions.multiple = true;\n navigator.contacts.find(contactFields, contactSuccess, contactError, contactFindOptions);\n \n function contactSuccess(contacts) {\n \n contInfoContainer.innerHTML = \"\";\n for (var i = 0; i < contacts.length; i++) {\n \n if (contacts[i].id == contactID) {\n \n activeContact = contacts[i];\n \n var cNameSection = \"<div class='contactInfo'>\" +\n \"<div>\" + buildDisplayName(contacts[i]) + \"</div>\" +\n \"<div>\" + (!isEmptyOrBlank(contacts[i].nickname) ? ('\"' + contacts[i].nickname + '\"') : \"\") + \"</div>\" +\n \"</div>\";\n \n var cPhotoSection = \"<div class='contactImage'>\" +\n \"<img src='\" + \n ((contacts[i].photos && (contacts[i].photos.length > 0) && !isEmptyOrBlank(contacts[i].photos[0].value) && (contacts[i].photos[0].value.indexOf(\"//:0\") === -1)) \n ? contacts[i].photos[0].value \n : \"resources/nophoto.jpg\") + \n \"' width='50' height='50' />\" +\n \"</div>\";\n \n var cPhoneNumbersSection = \"\";\n if (contacts[i].phoneNumbers && (contacts[i].phoneNumbers.length > 0)) {\n \n var cPhoneNumbersSectionHeader = \"<div class='iSectionTitle'>Phone Numbers</div>\";\n var cPhoneNumbersSectionContent = \"\";\n for (var j = 0; j < contacts[i].phoneNumbers.length; j++) {\n if (contacts[i].phoneNumbers[j] && !isEmptyOrBlank(contacts[i].phoneNumbers[j].value)) {\n cPhoneNumbersSectionContent += \"<div class='iSectionItem'>\" +\n \"<div class='iItemType'>\" + contacts[i].phoneNumbers[j].type + \"</div>\" +\n \"<div class='iItemValue'>\" + contacts[i].phoneNumbers[j].value + \"</div>\" +\n \"</div>\";\n }\n }\n if (!isEmptyOrBlank(cPhoneNumbersSectionContent)) {\n cPhoneNumbersSection = cPhoneNumbersSectionHeader + cPhoneNumbersSectionContent;\n }\n }\n \n var cEmailsSection = \"\";\n if (contacts[i].emails && (contacts[i].emails.length > 0)) {\n \n var cEmailsSectionHeader = \"<div class='iSectionTitle'>Emails</div>\";\n var cEmailsSectionContent = \"\";\n for (var j = 0; j < contacts[i].emails.length; j++) {\n if (contacts[i].emails[j] && !isEmptyOrBlank(contacts[i].emails[j].value)) {\n cEmailsSectionContent += \"<div class='iSectionItem'>\" +\n \"<div class='iItemType'>\" + contacts[i].emails[j].type + \"</div>\" +\n \"<div class='iItemValue'>\" + contacts[i].emails[j].value + \"</div>\" +\n \"</div>\";\n }\n }\n if (!isEmptyOrBlank(cEmailsSectionContent)) {\n cEmailsSection = cEmailsSectionHeader + cEmailsSectionContent;\n }\n }\n \n var cIMsSection = \"\";\n if (contacts[i].ims && (contacts[i].ims.length > 0)) {\n \n var cIMsSectionHeader = \"<div class='iSectionTitle'>IMs</div>\";\n var cIMsSectionContent = \"\";\n \n for (var j = 0; j < contacts[i].ims.length; j++) {\n if (contacts[i].ims[j] && !isEmptyOrBlank(contacts[i].ims[j].value)) {\n cIMsSectionContent += \"<div class='iSectionItem'>\" +\n \"<div class='iItemType'>\" + contacts[i].ims[j].type + \"</div>\" +\n \"<div class='iItemValue'>\" + contacts[i].ims[j].value + \"</div>\" +\n \"</div>\";\n }\n }\n \n if (!isEmptyOrBlank(cIMsSectionContent)) {\n cIMsSection = cIMsSectionHeader + cIMsSectionContent;\n }\n }\n \n var cUrlsSection = \"\";\n if (contacts[i].urls && (contacts[i].urls.length > 0)) {\n \n var cUrlsSectionHeader = \"<div class='iSectionTitle'>Urls</div>\";\n var cUrlsSectionContent = \"\";\n \n for (var j = 0; j < contacts[i].urls.length; j++) {\n if (contacts[i].urls[j] && !isEmptyOrBlank(contacts[i].urls[j].value)) {\n cUrlsSectionContent += \"<div class='iSectionItem'>\" +\n \"<div class='iItemType'>\" + contacts[i].urls[j].type + \"</div>\" +\n \"<div class='iItemValue'>\" + contacts[i].urls[j].value + \"</div>\" +\n \"</div>\";\n }\n }\n if (!isEmptyOrBlank(cUrlsSectionContent)) {\n cUrlsSection = cUrlsSectionHeader + cUrlsSectionContent;\n }\n }\n \n var cAddressesSection = \"\";\n if (contacts[i].addresses && (contacts[i].addresses.length > 0)) {\n \n var cAddressesSectionHeader = \"<div class='iSectionTitle'>Addresses</div>\";\n var cAddressesSectionContent = \"\";\n \n for (var j = 0; j < contacts[i].addresses.length; j++) {\n if (contacts[i].addresses[j] && (!isEmptyOrBlank(contacts[i].addresses[j].streetAddress) || !isEmptyOrBlank(contacts[i].addresses[j].locality) ||\n !isEmptyOrBlank(contacts[i].addresses[j].region) || !isEmptyOrBlank(contacts[i].addresses[j].country))) {\n \n var atypeSubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].type) && (contacts[i].addresses[j].type != \"undefined\")) ? (\"<div class='iItemType'>\" + contacts[i].addresses[j].type + \"</div>\") : \"\");\n var strSubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].streetAddress) && (contacts[i].addresses[j].streetAddress != \"undefined\")) ? (\"<div>\" + contacts[i].addresses[j].streetAddress + \"</div>\") : \"\");\n var locSubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].locality) && (contacts[i].addresses[j].locality != \"undefined\")) ? (\"<div>\" + contacts[i].addresses[j].locality + \"</div>\") : \"\");\n var regSubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].region) && (contacts[i].addresses[j].region != \"undefined\")) ? contacts[i].addresses[j].region : \"\");\n var postSubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].postalCode) && (contacts[i].addresses[j].postalCode != \"undefined\")) ? contacts[i].addresses[j].postalCode : \"\");\n if (regSubsection != \"\") {\n if (postSubsection != \"\") {\n regSubsection += \", \";\n }\n }\n regSubsection += postSubsection;\n var countrySubsection = ((!isEmptyOrBlank(contacts[i].addresses[j].country) && (contacts[i].addresses[j].country != \"undefined\")) ? (\"<div>\" + contacts[i].addresses[j].country + \"</div>\") : \"\");\n \n cAddressesSectionContent += \"<div class='iSectionItem'>\" +\n atypeSubsection +\n \"<div class='iItemValue'>\" + \n strSubsection +\n locSubsection +\n (\"<div>\" + regSubsection + \"</div>\") +\n countrySubsection +\n \"</div>\" +\n \"</div>\";\n }\n }\n if (!isEmptyOrBlank(cAddressesSectionContent)) {\n cAddressesSection = cAddressesSectionHeader + cAddressesSectionContent;\n }\n }\n \n var sectionHeading = \"\";\n var sectionContent = \"\";\n if (contacts[i].organizations && (contacts[i].organizations.length > 0)) {\n for (var j = 0; j < contacts[i].organizations.length; j++) {\n var typeSubsection = ((!isEmptyOrBlank(contacts[i].organizations[j].type) && (contacts[i].organizations[j].type != \"undefined\")) ? (\"<div class='iItemType'>\" + contacts[i].organizations[j].type + \"</div>\") : \"\");\n var deptSubsection = ((!isEmptyOrBlank(contacts[i].organizations[j].department) && (contacts[i].organizations[j].department != \"undefined\")) ? (contacts[i].organizations[j].department) : \"\");\n var orgSubsection = ((!isEmptyOrBlank(contacts[i].organizations[j].name) && (contacts[i].organizations[j].name != \"undefined\")) ? contacts[i].organizations[j].name : \"\");\n var orgLine = orgSubsection;\n if (deptSubsection != \"\") {\n if (orgSubsection != \"\") {\n orgLine += \", \";\n } \n orgLine += deptSubsection;\n }\n var titleSubsection = ((!isEmptyOrBlank(contacts[i].organizations[j].title)) ? (\"<div>\" + contacts[i].organizations[j].title + \"</div>\") : \"\");\n \n if ((orgLine != \"\") || (titleSubsection != \"\")) {\n sectionContent += \"<div class='iSectionItem'>\" +\n typeSubsection +\n \"<div class='iItemValue'>\" + \n (\"<div>\" + orgLine + \"</div>\") +\n titleSubsection +\n \"</div>\" +\n \"</div>\";\n }\n }\n if (!isEmptyOrBlank(sectionContent)) {\n sectionHeading = \"<div class='iSectionTitle'>Organizations</div>\";\n }\n }\n var cOrganizationsSection = sectionHeading + sectionContent;\n \n var cNoteSection = \"\";\n if (!isEmptyOrBlank(contacts[i].note)) {\n cNoteSection += \"<div class='iSectionTitle'>Note</div>\" +\n \"<div class='iSectionItem'>\" +\n \"<div class='iItemValue'>\" + contacts[i].note + \"</div>\" +\n \"</div>\";\n }\n \n contInfoContainer.innerHTML += cPhotoSection + cNameSection + cPhoneNumbersSection + cEmailsSection + \n cIMsSection + cUrlsSection + cAddressesSection + cOrganizationsSection + \n cNoteSection;\n $.mobile.changePage(\"#cont_info_page\", { transition: \"pop\" });\n break;\n }\n }\n }\n \n function contactError(contactError) {\n \n contInfoContainer.innerHTML = \"Contacts are unavailable\";\n $.mobile.changePage(\"#cont_info_page\", { transition: \"pop\" });\n }\n}", "function nameInfo(){\n let firstName = document.getElementById('firstName').value;\n let middleName = document.getElementById('middleName').value;\n let lastName = document.getElementById('lastName').value;\n \n let fullName = firstName + ' ' + middleName + ' ' + lastName;\n \n document.getElementById(\"fullName\").innerHTML = fullName;\n }", "getFirstName() {}", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "getPersonName() {\n return \"I_AM_DON!!\";\n }", "function get_user_name() {\n switch (event_type) {\n case \"user\":\n var nameurl = \"https://api.line.me/v2/bot/profile/\" + user_id;\n break;\n case \"group\":\n var groupid = msg.events[0].source.groupId;\n var nameurl = \"https://api.line.me/v2/bot/group/\" + groupid + \"/member/\" + user_id;\n break;\n }\n\n try {\n // call LINE User Info API, get user name\n var response = UrlFetchApp.fetch(nameurl, {\n \"method\": \"GET\",\n \"headers\": {\n \"Authorization\": \"Bearer \" + CHANNEL_ACCESS_TOKEN,\n \"Content-Type\": \"application/json\"\n },\n });\n var namedata = JSON.parse(response);\n var reserve_name = namedata.displayName;\n }\n catch {\n reserve_name = \"not avaliable\";\n }\n return String(reserve_name)\n }", "function contactCleaner(contactInfo) {\n //check if object has all properties required.\n //combine the different form elements to make 1 name string and 1 address string that contain all the information.\n\n\n //check that the object contains the phoneContact proprty and that it is on\n //set the contactByPhone to true\n if(\"phoneContact\" in contactInfo && contactInfo.phoneContact == \"on\") {\n contactInfo.contactByPhone = true;\n }\n else {\n contactInfo.contactByPhone = false;\n }\n \n //check that the mailContact is in the object, and that it is enabled.\n if(\"mailContact\" in contactInfo && contactInfo.mailContact == \"on\") {\n contactInfo.contactByMail = true;\n }\n else {\n contactInfo.contactByMail = false;\n }\n \n //check for emailContact in the object, and make sure that it is enabled.\n if(\"emailContact\" in contactInfo && contactInfo.emailContact == \"on\") {\n contactInfo.contactByEmail = contactInfo.email;\n }\n else {\n contactInfo.contactByEmail = \"No\";\n }\n\n //check if the user selected the \"any\" option, and if they have then set all the contact options to the values they gave.\n if(\"anyContact\" in contactInfo && contactInfo.anyContact == \"on\") {\n contactInfo.contactByPhone = true;\n contactInfo.contactByMail = true;\n contactInfo.contactByEmail = contactInfo.email;\n }\n}", "function InitializeContact(id)\n{\n\tcontact = Titanium.Contacts.getPersonByID(id);\n\talert(\"Initialize Contact: \" + contact.fullName);\n}", "function get_my_name(name){\n return name + \" Ubanell\";\n}", "function matchByName(aContact, callbacks, options) {\n // First we try to find by familyName\n // Afterwards we search by givenName\n var isSimContact = (Array.isArray(aContact.category) &&\n aContact.category.indexOf('sim') !== -1);\n\n if ((isEmptyStr(aContact.familyName) || isEmptyStr(aContact.givenName)) &&\n !isSimContact) {\n notifyMismatch(callbacks);\n return;\n }\n\n var finalResult = {};\n\n var resultsByName = null;\n if (!isEmptyStr(aContact.name)) {\n var reqName = navigator.mozContacts.find({\n filterValue: aContact.name[0].trim(),\n filterBy: ['name'],\n filterOp: 'equals'\n });\n\n reqName.onsuccess = function() {\n resultsByName = reqName.result.filter(function(aResult) {\n return filterFacebook(aResult, options);\n });\n notifyFindNameReady();\n if (isEmptyStr(aContact.familyName)) {\n processByNameEnd(finalResult, resultsByName, callbacks);\n }\n };\n\n reqName.onerror = function(e) {\n window.console.error('Error while trying to find by name: ',\n e.target.error.name);\n resultsByName = [];\n notifyFindNameReady();\n if (isEmptyStr(aContact.familyName)) {\n processByNameEnd(finalResult, resultsByName, callbacks);\n }\n };\n }\n else {\n resultsByName = [];\n notifyFindNameReady();\n }\n\n if (!isEmptyStr(aContact.familyName)) {\n var reqFamilyName = navigator.mozContacts.find({\n filterValue: aContact.familyName[0].trim(),\n filterBy: ['familyName'],\n filterOp: 'equals'\n });\n\n reqFamilyName.onsuccess = function() {\n var results = reqFamilyName.result;\n\n var givenNames = [];\n var targetGN = Normalizer.toAscii(\n aContact.givenName[0].trim().toLowerCase()).\n replace(blankRegExp, '');\n\n results.forEach(function(mContact) {\n if (mContact.id === aContact.id || isEmptyStr(mContact.givenName)) {\n return;\n }\n givenNames.push({\n contact: mContact,\n givenName: Normalizer.toAscii(\n mContact.givenName[0].trim().toLowerCase()).\n replace(blankRegExp, '')\n });\n });\n\n var finalMatchings = givenNames.filter(function(obj) {\n var gn = obj.givenName;\n return ((gn === targetGN || targetGN.startsWith(gn) ||\n gn.startsWith(targetGN)) &&\n filterFacebook(obj.contact, options));\n });\n\n finalMatchings.forEach(function(aMatching) {\n finalResult[aMatching.contact.id] = {\n matchingContact: aMatching.contact\n };\n });\n\n if (resultsByName) {\n processByNameEnd(finalResult, resultsByName, callbacks);\n }\n else {\n document.addEventListener('by_name_ready', function nameReady() {\n document.removeEventListener('by_name_ready', nameReady);\n processByNameEnd(finalResult, resultsByName, callbacks);\n });\n }\n };\n\n reqFamilyName.onerror = function(e) {\n window.console.error('Error while trying to find by familyName: ',\n e.target.error.name);\n notifyMismatch(callbacks);\n };\n }\n }", "function name(name){\n return \"hi, my name is \" + name + \".\";\n}", "function custCb( err, data ) {\n nResp++;\n if( err ) {\n Y.log( 'No customer name for ' + myData.customerPracId + ' / err ' + err, 'warn', NAME );\n myData.namePrac[0] = '';\n } else {\n Y.log( 'Got customer info ' + JSON.stringify( data ), 'debug', NAME );\n if( data && data[0] ) {\n myData.namePrac[0] = data[0].coname;\n } else {\n myData.namePrac[0] = 'Kein Name';\n }\n }\n checkDone();\n }", "function custCb( err, data ) {\n nResp++;\n if( err ) {\n Y.log( 'No customer name for ' + myData.customerPracId + ' / err ' + err, 'warn', NAME );\n myData.namePrac[0] = '';\n } else {\n Y.log( 'Got customer info ' + JSON.stringify( data ), 'debug', NAME );\n if( data && data[0] ) {\n myData.namePrac[0] = data[0].coname;\n } else {\n myData.namePrac[0] = 'Kein Name';\n }\n }\n checkDone();\n }", "function get_my_name(name){\n return name;\n}", "getName() {\nreturn this.fourCCName;\n}", "function getName() {\n return \"Hello, my name is Irvan\";\n}", "function getFullName(firstName, lastName) {\r\n\r\n // -------------------- Your Code Here --------------------\r\n\r\n\r\n return firstName + \" \" + lastName;\r\n\r\n\r\n // --------------------- End Code Area --------------------\r\n}", "function getRepName (postalCode, callback) {\n //At this point, we have a valid postal code, so we look for the name of the MP\n console.log(\"it works\");\n var findMPbyPC = `getMP?postcode=${postalCode}&key=GYEChCGV3YEuA6ezszEvyj7J&output=js`;\n makePcRequest(findMPbyPC, function(err, mpInfo){\n if (err) {\n callback(err);\n }\n else {\n //we have to format the name to be sure that is all lowercase, without accent and with a dash between firstname and lastname\n // var nameFormatted = mpInfo.name.replace(\" \",\"-\").toLowerCase();\n // mpInfo.nameFormatted = nameFormatted;\n callback(null, {allRepData: mpInfo});\n }\n });\n}", "function getfullName (firstname, lastname){\nreturn firstname +' '+ lastname\n}", "function contactInfoCallback (data) {\n\t\tvar emailAddresses =[];\n\t\tvar twitterHandles =[];\n\t\t// on successful Ajax call --> fill in addresses/names\n\t\t$.each(data, function (i) {\n var storeName = data[i].storeName;\n // search the results using regular expression for the query\n if (storeName == selection) {\n emailAddresses.push(data[i].storeContact);\n twitterHandles.push(data[i].twitter);\n console.log(\"Email: \" + emailAddresses);\n console.log(\"Twitter: \" + twitterHandles);\n }\n });\n\t\t//$(\"#message-text\").attr(\"action\", \"mailto:\"+data[retailerName].storeContact);\n\t\treturn emailAddresses, twitterHandles;\n\t}", "function getPatientName(pt) {\n if (pt.name) {\n var names = pt.name.map(function(name) {\n return name.given.join(\" \") + \" \" + name.family;\n });\n return names.join(\" / \")\n } else {\n return \"anonymous\";\n }\n}", "getParticipantName(participant) {\n const selfInfo = this.contactManager.getLocalUser();\n let userName = this.contactManager.getDisplayName(participant.regId);\n if (participant.regId === selfInfo.regId) {\n userName = `${userName} (You)`;\n }\n return userName || participant.regId;\n }", "getContact() {\n return this.scope.attr('contact');\n }", "function onSuccess(contacts) {\n for (var i=0; i<contacts.length; i++) {\n \n if (contacts[i].phoneNumbers != null) {\n $.each(contacts[i].phoneNumbers, function(i ,v){\n $.each(v, function(e, f){\n \n\n if (e == 'value') {\n var number = f.replace(/-|\\s/g,\"\"); \n console.log(number);\n\n }\n });\n });\n \n \n }\n\n }\n }" ]
[ "0.6686675", "0.6544858", "0.6522142", "0.6483544", "0.6401891", "0.62962645", "0.6292751", "0.62887216", "0.628478", "0.62427735", "0.6213481", "0.6121481", "0.61122555", "0.6101261", "0.60932374", "0.6080004", "0.605018", "0.6030822", "0.6022016", "0.6016746", "0.6007238", "0.6006211", "0.6004103", "0.59957856", "0.5971896", "0.5954051", "0.5931551", "0.5924747", "0.58878374", "0.5885509", "0.5880917", "0.5880823", "0.58669436", "0.58578354", "0.5857755", "0.5848873", "0.5832636", "0.58303845", "0.5822487", "0.5814113", "0.58010453", "0.5793251", "0.5790851", "0.5785687", "0.5783358", "0.5767817", "0.5760943", "0.57574886", "0.57554555", "0.5754248", "0.57520306", "0.57387733", "0.57354176", "0.5728585", "0.5712232", "0.57085514", "0.5707952", "0.5707455", "0.5705143", "0.56978714", "0.5688444", "0.56871957", "0.5687132", "0.56814504", "0.5663793", "0.5660473", "0.5656566", "0.5654142", "0.5652491", "0.565142", "0.5651201", "0.56475383", "0.5640289", "0.56386584", "0.56340516", "0.562686", "0.56246907", "0.56246907", "0.56246907", "0.56246907", "0.56216574", "0.5619967", "0.56185013", "0.56149316", "0.56090945", "0.5607964", "0.5596609", "0.5593005", "0.5593005", "0.55908597", "0.5588672", "0.5586546", "0.5584671", "0.55843085", "0.5580851", "0.5579472", "0.5577225", "0.5574935", "0.5572965", "0.5567449" ]
0.6146814
11
Integration function for title of contact information
function contact_title(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "alphabetic", "conf1")){ error = "E40_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E40_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getFormattedTitle() {\n return this.info.title.toUpperCase();\n }", "function title(titleinfo) /* (titleinfo : titleinfo) -> string */ {\n return titleinfo.title;\n}", "getTitle() {}", "function attachTitle(name) {\n return 'DR. ' + name;\n }", "getFormattedTitle(){\n //.....this key word used to apply conversion logic to code (uppercase letter)\n return this.info.title.toUpperCase()\n }", "function titleize() {\n\n}", "function showcompanyname(){\n if (compname !== \"\"){\n return <Title level = {4} className = \"text_nameCard_companyinfo\">{compname}</Title>;\n }else{\n return <Title level = {4} className = \"text_nameCard_companyinfo\">dummy</Title>;\n }\n }", "function getTitle() {\r\n var carrier = story.getFrameValue();\r\n var index = carriers.indexOf(carrier) + 1;\r\n return \"#\" + (\"0\" + index).slice(-2)+ \" - \" + carrier;\r\n }", "function getTitle()\n {\n\n var title = d(Posting.TITLE);\n var address = d(Posting.URL);\n\n if (title) {\n var sTitle = title.value;\n if (address && address.value.length>0) {\n sTitle = \"<a target=\\\"new\\\" href=\\\"\"\n +address.value\n +\"\\\">\"\n +sTitle\n +\"</a>\";\n }\n }\n\n return sTitle;\n }", "function getTitle(data) {\n\t\tvar title = \"\";\n\t\tif(data.title){\n\t\t\ttitle = data.title;\n\t\t}else if( data.username ){\n\t\t\ttitle = data.username;\n\t\t}else if( data.message_details ){\n\t\t\ttitle = data.message_details;\n\t\t}else if( data.details ){\n\t\t\ttitle = data.details;\n\t\t}else if( data.fullname ){\n\t\t\ttitle = data.fullname;\n\t\t}\n\t\t\n\t\treturn title;\n\t}", "function makeBillTitle() {\n return \"Your Bill\";\n}", "function title(mail) {\n\t\t\treturn mail.title\n\t\t}", "function title(){\n\n}", "function getCompanyName() {\n return \"Synechron Pvt. Ltd.\";\n}", "updateTitle(){ \n let title = '';\n const { head, instance } = this.entry;\n\n if (head.hasOwnProperty('title')){\n let prop = head.title;\n\n title = head.title\n if (typeof prop === 'function'){\n title = head.title.apply(instance);\n }\n }\n\n if (title && title.length > 0){\n document.title = title;\n }\n }", "function displayContactInfo(display_name = \"No Contact\", handle = \"-\") {\n const nameElement = document.getElementById(\"name\");\n const handleElement = document.getElementById(\"handle\");\n\n nameElement.textContent = display_name;\n handleElement.textContent = handle;\n}", "title() {\n return cy.get(pop_up_title_locator)\n }", "function _event_contact_person_title(e){\n try{\n var job_quote_status_win = Ti.UI.createWindow({\n url:self.get_file_path('url','base/select_unique_code_from_table_view.js'),\n win_title:'Select Title',\n table_name:'my_salutation_code',//table name\n display_name:'name',//need to shwo field\n content:e.row.contact_person_title_id,\n content_value:e.row.person_title,\n source:'edit_client_contact'\n });\n Titanium.UI.currentTab.open(job_quote_status_win,{\n animated:(self.is_ios_7_plus() && !self.set_animated_for_ios7)?false:true\n });\n }catch(err){\n self.process_simple_error_message(err,window_source+' - _event_contact_person_title');\n return;\n } \n }", "function set_title(title){\n\t\t\tdocument.querySelector(\"#footertitle span\").innerText = title;\n\t\t}", "function createAuthorTitle({title: displayTitle, innerData: [{author}]}) {\n\treturn displayTitle + ' ' + author;\n}", "function getTitle(record, item) {\n\t\tvar titleTag = record.getFieldSubfields(\"200\");\n\t\tif (titleTag) {\n\t\t\ttitleTag = titleTag[0];\n\t\t\tvar titleText = titleTag.a;\n\t\t\tif (titleTag.e) {\n\t\t\t\tif (!/^[,\\.:;-]/.exec(titleTag.e)) {\n\t\t\t\t\ttitleText += \": \";\n\t\t\t\t}\n\t\t\t\ttitleText += titleTag.e;\n\t\t\t}\n\t\t\tif (titleTag.h) {\n\t\t\t\ttitleText += \", \" + titleTag.h;\n\t\t\t\tif (titleTag.i) {\n\t\t\t\t\ttitleText += \": \" + titleTag.i;\n\t\t\t\t}\n\t\t\t} else if (titleTag.i) {\n\t\t\t\ttitleText += \", \" + titleTag.i;\n\t\t\t}\n\t\t\titem.title = titleText;\n\t\t}\n\t}", "get contactText(){return $('span=Contact details')}", "function ScreedTodoTaskTitle() {\n}", "function getTitle(item){\n return item.title;\n \n}", "function getTitle() {\n return document.getElementById( \"eow-title\" ).title;\n}", "function getHonorific() {\n return getTitle() + street;\n\n}", "function getTitle()\n {\n return $(\"h1.thread-subject\").text().trim();\n }", "function header(title) {\r\n console.log(\"===================================\")\r\n console.log(\" \"+title)\r\n console.log(\"===================================\")\r\n }", "getTitle() {\n return `Title is: ${this.title}`;\n }", "get name () {\n\n\t\tlet name = sanitize(this.title.split(' ').join('-').toLowerCase());\n\t\tif (name.length === 0) {\n\t\t\treturn;\n\t\t}\n\n\t\treturn `@${this.sender} ${name}.md`;\n\t}", "async cphTitleBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitle = SyncSystemNS.FunctionsGeneric.contentMaskRead(gSystemConfig.configSystemClientName, \"config-application\") + \n \" - \" + \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersTitleMain\");\n //TODO: Check file type and show the equivalent tile name.\n if(this.titleCurrent)\n {\n this.cphTitle += \" - \" + this.titleCurrent;\n }\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "UpdateTitle() {\n var Key = this.TitleKey || this.Name;\n\n var self = this;\n tp.Res.GS(Key, function (Value, UserTag) {\n self.Title = Value;\n }, null, Key, this);\n\n }", "pageTitle() {\n if(this.props.currentContestId) {\n return this.currentContest().contestName;\n }\n return \"Naming Contests\";\n }", "async cphTitleBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitle = SyncSystemNS.FunctionsGeneric.contentMaskRead(gSystemConfig.configSystemClientName, \"config-application\") + \n \" - \" + \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPublicationsTitleMain\");\n //TODO: Check file type and show the equivalent tile name.\n if(this.titleCurrent)\n {\n this.cphTitle += \" - \" + this.titleCurrent;\n }\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "function getExcelTitle(iSec, iForm, transLan) {\n var title = null;\n if (iForm == \"GSTR1\") {\n switch (iSec) {\n case 'b2b':\n case 'b2cl':\n case 'exp':\n title = \"Invoice Number\"\n break;\n case 'cdnr':\n case 'cdnur':\n title = transLan.LBL_DEBIT_CREDIT_NOTE_NO\n break;\n case 'cdnra':\n case 'cdnura':\n title = transLan.LBL_REVISED_DEBIT_CREDIT_NOTE_NO\n break;\n case 'b2ba':\n case 'b2cla':\n case 'expa':\n title = \"Revised Invoice Number\"\n break;\n case 'at':\n case 'atadj':\n title = \"Place Of Supply\"\n break;\n case 'ata':\n case 'atadja':\n title = \"Original Place Of Supply\"\n break;\n case 'b2csa':\n title = \"Place Of Supply\"\n break;\n case 'hsn':\n title = \"HSN\"\n break;\n case 'nil':\n title = \"Description\"\n break;\n case 'doc_issue':\n title = \"Nature of Document\"\n break;\n\n }\n } else if (iForm == \"GSTR2\") {\n switch (iSec) {\n case 'b2b':\n case 'cdnra':\n case 'b2bur':\n title = \"Invoice Number\"\n break;\n case 'imp_s':\n title = \"Invoice Number of Reg Recipient\";\n break;\n case 'cdnr': // GSTR2\n title = \"Note/Refund Voucher Number\"\n break;\n case 'cdnur': // GSTR2\n title = \"Note/Voucher Number\"\n break;\n case 'b2ba':\n case 'b2bura':\n case 'imp_sa':\n title = \"Revised Invoice Number\"\n break;\n case 'imp_g':\n title = \"Bill Of Entry Number\"\n break;\n case 'imp_ga':\n title = \"Revised Bill Of Entry Number\"\n break;\n case 'hsnsum':\n title = \"HSN/SAC of Supply\"\n break;\n case 'atxi':\n case 'txi':\n case 'atadj':\n title = \"Place Of Supply\"\n break;\n case 'nil':\n case 'itc_rvsl':\n title = \"Description\"\n break;\n\n }\n }\n return title;\n }", "title() { return this.owner.name + \" - \" + this.label.replace('\\n', ' ') }", "function titleSetup() {\n\t\t\t\t\tif(scope.title !== undefined) {\n\t\t\t\t\t\t// For now we don't display the title\n\t\t\t\t\t\t// sel.select(\"span.list-title\").text(scope.title);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsel.select(\"span.list-title\").text(null);\n\t\t\t\t\t}\n\t\t\t\t}", "function my_title_format (window) {\n return '{'+get_current_profile()+'} '+window.buffers.current.description;\n}", "function contact_title(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\t\r\n\tif (!check_allowed_char(input, \"alphabetic\", \"conf1\")){\r\n\t\terror = \"E40_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E40_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "async cphTitleBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitle = SyncSystemNS.FunctionsGeneric.contentMaskRead(gSystemConfig.configSystemClientName, \"config-application\") + \n \" - \" + \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendFormsFieldsOptionsTitleEdit\");\n\n /*\n if(this.titleCurrent)\n {\n this.cphTitle += \" - \" + this.titleCurrent;\n }\n */\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "function reposTitle() {\n\t\t\tconsole.info(\"reposTitle\");\n\t\t\tif(jQuery(window).width() < 450) {\n\t\t\t\tif(!jQuery('.fc-header-title').is(':visible')) {\n\t\t\t\t\tif(jQuery('h3.calTitle').length == 0) {\n\t\t\t\t\t\tvar m = jQuery('.fc-header-title h2').text();\n\t\t\t\t\t\tjQuery('<h3 class=\"calTitle\">'+m+'</h3>').insertBefore('#calendar table.fc-header');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tjQuery('h3.calTitle').remove();\n\t\t\t}\n\t\t}", "function giveTitle(name) {\n document.getElementsByTagName(\"title\")[0].innerHTML = name;\n}", "function createContact(name, phone, address) {\n return `<p>${name} can be reached at ${phone} and lives at ${address}</p>`\n}", "function billTitle(bill) {\n\t\t\tvar title=\"\";\n\t\t\tif (bill) { \n\t\t\t\ttitle = bill.officialTitle;\n\t\t\t\tif (bill.popularTitle) {\n\t\t\t\t\tif (bill.popularTitle.length > 0) {\n\t\t\t\t\t\ttitle = bill.popularTitle;\n\t\t\t\t\t}\n\t\t\t\t} else if (bill.shortTitle) {\n\t\t\t\t\tif (bill.shortTitle.length > 0 ) {\n\t\t\t\t\t\ttitle=bill.shortTitle;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn title;\n\t\t}", "function setModalTitle(title, artist, album) {\n document.getElementById('modal-header-title').innerHTML = title + ' - '\n + artist + ' - ' + album;\n}", "function initTitle() {\n if (Vue.prototype.hasOwnProperty('$createTitle')) {\n return;\n }\n\n /**\n * Generates the document title out of the given VueComponent and parameters\n *\n * @param {String} [identifier = null]\n * @param {...String} additionalParams\n * @returns {string}\n */\n Vue.prototype.$createTitle = function createTitle(identifier = null, ...additionalParams) {\n const baseTitle = this.$tc('global.sw-admin-menu.textShopwareAdmin');\n const pageTitle = this.$tc(this.$route.meta.$module.title);\n\n const params = [baseTitle, pageTitle, identifier, ...additionalParams].filter((item) => {\n return item !== null && item.trim() !== '';\n });\n\n return params.reverse().join(' | ');\n };\n }", "function Title(props) {\n\treturn <div id=\"title\">\n\t Steve's Neighborhood Map - <span id=\"city-name\">(Bethlehem, PA)</span>\n </div>\n}", "componentDidMount() {\n document.title = `Contact | ${config.companyName}`;\n this.props.setPageTitle( 'Contact', 'Our companies contact information can be viewed here' );\n }", "get photographerNameInForm() {\n\t\treturn `\n\t\t\t<h1 class=\"modal__head\" id=\"contact\">Contactez-moi </br> ${this.name}</h1>\n\t\t` \n\t}", "function appTitle() {\n console.log(appName + \" - \" + appVersion + \" - \" + appDescription);\n}", "getCardTitle() {\n if (this.props.cardInfo.name) {\n return this.props.cardInfo.name;\n } else {\n return \"Name\";\n }\n }", "function subtitle(titleinfo) /* (titleinfo : titleinfo) -> string */ {\n return titleinfo.subtitle;\n}", "function getPageTitle () {\n return title;\n }", "function getSectionTitle(title) {\n // section title layout\n return title;\n}", "function generateTitle() {\n // randomize title here.\n }", "function displayName(name, career, description) {\n console.log(\"Name: \" + name.toUpperCase());\n console.log(\"Career: \" + career);\n console.log(\"Description: \" + description);\n console.log(\"\");//adds a blank space\n}", "function getTitle() {\n const title = document.querySelector('#title');\n title.addEventListener('change', (e) => {\n if (title.value !== '') {\n searchBooksObj.partialTitle = e.target.value;\n }\n });\n}", "function titleText(title) {\n pageTitle.textContent = title;\n}", "get title() {\n this._logger.trace(\"[getter] title\");\n\n return this._title;\n }", "function tooltip(title) {\n if (!renamedHeadingToOrigField.has(title)) return '';\n return `title=\"${renamedHeadingToOrigField.get(title)}\"`;\n }", "function mainTitleTemplate({\n name\n}) {\n return `<h1 align=\"center\">${name}</h1>`;\n}", "info() {\n if (this.numOfPages > 0) {\n return this.title + '<br>' + ' by ' + this.author + '<br>' + this.numOfPages + ' pages';\n } \n return this.title + '<br>' + ' by ' + this.author + '<br>'; \n }", "function note_1(titleinfo) /* (titleinfo : titleinfo) -> string */ {\n return titleinfo.note;\n}", "title() {\n if (arguments.length) {\n title = arguments[0];\n return column;\n }\n return purifyHtml(title || name);\n }", "function setTitle() {\n dt = formatDate(myDateFormat, appstate.date);\n dtextra = (appstate.date2 === null) ? '' : ' to ' + formatDate(myDateFormat, appstate.date2);\n $('#maptitle').html(\"Viewing \" + vartitle[appstate.ltype] +\n \" for \" + dt + \" \" + dtextra);\n $('#variable_desc').html(vardesc[appstate.ltype]);\n}", "function renderTitle(title, description, into) {\n\n into.innerHTML = `\n <h1>${title}</h1>\n <p>${description}</p>\n\n `\n}", "function alternativeDocTitle() {\n var $title, title, prefix, postfix;\n setTimeout(function() {\n $title = $('head title');\n title = $title.text().replace('Site', '');\n prefix = getCampaignPrefix();\n postfix = getClientName();\n prefix && (title = title.replace('Campaign ', ''));\n $title.text((prefix ? prefix + ' ' : '') + title + (postfix ? ' | ' + postfix : ''));\n }, 2000);\n }", "async cphTitleBuild()\n {\n //Logic.\n //----------------------\n try\n {\n this.cphTitle = SyncSystemNS.FunctionsGeneric.contentMaskRead(gSystemConfig.configSystemClientName, \"config-application\") + \n \" - \" + \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendFilesTitleMain\");\n //TODO: Check file type and show the equivalent tile name.\n if(this.titleCurrent)\n {\n this.cphTitle += \" - \" + this.titleCurrent;\n }\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "function getHeader(title) {\n return `<h5>${title}</h5>`;\n}", "function gotTitle(title, sender, sendResponse) {\n if(title.highway == 'wikititle') {\n WikiTitle = title.title;\n // alert('Title received: ' + title.title);\n search(WikiTitle);\n }\n}", "function title ( data, index ) {\n if( typeof index === 'undefined' ) return \"\";\n if( index === null ) return \"\";\n if( !data ) return \"\";\n return data.results[index].title;\n}", "function updateTitle(text) {\n $('title').html(\"Blacksmith - \" + text);\n}", "function setPageTitle() {\n const pageTitle = document.getElementById('page-title');\n pageTitle.querySelector('.name').innerText = name;\n}", "function FeatureTitle({item}) {\n if(item && item.title) {\n return <h3 class=\"has-text-centered\">{item.title}</h3>\n } else {\n return null\n }\n}", "static getCompanyName() {\n console.log('My Company');\n }", "function formatTitle(value) {\n if(value) {\n var parts = value.split(/:/);\n return '<a href=\"' + oilsBasePath + \n '/acq/picklist/user_request/' + parts[0] + '\">' + parts[1] + '</a>';\n }\n}", "function title() {\n var elm\n \n elm = d.find(\"title\");\n elm.innerText = g.title;\n \n elm = d.tags(\"title\");\n elm[0].innerText = g.title;\n }", "function headerTitleChange() {\n headerText.innerHTML = \"E-Notes - \" + notesTitle.value;\n pageTitle.innerHTML = \"E-NOTES - \" + notesTitle.value.toUpperCase();\n if (notesTitle.value == \"\") {\n headerText.innerHTML = \"E-Notes\";\n pageTitle.innerHTML = \"E-NOTES\";\n }\n}", "setTitle(title) {\r\n this.title = siteTitle + title\r\n document.title = Site.info.siteName + ' ' + siteTitle + title\r\n }", "get title() { return \"Local Coding\"}", "getContactDisplayName(first_name, middle_name, last_name) {\n\t var key = \"\";\n\t (first_name != \"\")? key += first_name + \" \" : key = key;\n\t (middle_name != \"\")? key += middle_name + \" \" : key = key;\n\t (last_name != \"\")? key += last_name : key = key;\n\t return key;\n\t}", "function toTitle(c){\r\n return c.toUpperCase();\r\n}", "_createTitle(obj) {\n let res = \"\";\n for (let p in obj) {\n res += `${p}=${obj[p]},`;\n }\n return res.substr(0, res.length - 1);\n }", "_formatTitle(name) {\n let title = \"\"\n let titleWords = name.split(\"-\");\n\n for(let i = 0; i < titleWords.length; ++i) {\n let word = titleWords[i];\n\n title += word.charAt(0).toUpperCase() + word.slice(1) + \" \";\n }\n\n return title\n }", "updateTitle() {\n let numReports = this.reports.length\n if(numReports >= 101) {\n this.title = 'Bestest Manager'\n } else if(numReports >= 51) {\n this.title = 'Manager Plus'\n } else if(numReports >= 11) {\n this.title = 'Manager'\n } else if(numReports >= 4) {\n this.title = 'Mostly Manager'\n } else if(numReports >= 1) {\n this.title = 'Barely Manager'\n } else {\n this.title = 'Not a Manager'\n }\n }", "function displayItemDetails()\n {\n var item = Office.cast.item.toItemRead(Office.context.mailbox.item);\n var from = Office.cast.item.toMessageRead(item).from;\n var email = from.emailAddress;\n\n var name = from.displayName.substr(0, from.displayName.indexOf(' '));\n $(\"#name\").val(name);\n\n var surname = from.displayName.substr(from.displayName.indexOf(' ') + 1);\n $(\"#surname\").val(surname);\n\n var domain = email.substr(email.indexOf('@') + 1);\n var company = domain.substr(0, domain.indexOf('.'));\n $(\"#company\").val(company);\n }", "getTitle() {\n return this._doc.title;\n }", "get title() {\n return this._data.title;\n }", "get title() {\n return this._data.title;\n }", "get theTitle()\n {\n return this.title;\n }", "function getTitle(value) {\n\tvar formalized = \"\";\n\tswitch (value) {\n\t\tcase 'major_advisor': formalized = \"Major Advisor\"; break;\n\t\tcase 'co_advisor': formalized = \"Co-Major Advisor\"; break;\n\t\tcase 'minor_advisor': formalized = \"Minor Advisor\"; break;\n\t\tcase 'gcr': formalized = \"GCR\"; break;\n\t\tcase 'committee': \n\t\tdefault: formalized = \"Committee\";\n\t}\n\t\n\treturn formalized;\n}", "function generateTitle(ref, enfermedad) {\n var tituloFormat = '<h4 class=\"page-head-line\">DATOS DE LA ENFERMEDAD ' + '(' + enfermedad.name + ')</h4>';\n ref.innerHTML = tituloFormat;\n}", "function titlePage(){\n\t\t$('.title-page').html('<h2 class=\"text-center\">'+objet_concours[last_concours]+'</h2>');\n\t}", "function displayNameSymbol(company) {\n //Clearing previous company data\n document.getElementById(\"name-symbol\").innerHTML = '';\n let nameSymbol = document.createElement('h3');\n let description = document.createElement('p');\n description.innerText = `${company.description}`;\n nameSymbol.innerText = `${company.name} (${company.symbol})`;\n document.getElementById(\"name-symbol\").appendChild(nameSymbol);\n document.getElementById(\"name-symbol\").appendChild(description);\n }", "function displayPosition (title, company, description) {\nconsole.log(\"* \" + title + \" at \" + company + \" - \" + description);\n}", "function UpdateTitle() {\r\n if (isCustomTitleUpdate) {\r\n isCustomTitleUpdate = false;\r\n return;\r\n }\r\n //x++;\r\n var strAppTitle = document.title.replace(/.+ \\[/i, '').replace(\"\\]\", '');\r\n var strFeedTitle = strAppTitle;\r\n //Get the feed or folder title from the 'chrome-title' element\r\n if (document.getElementById('chrome').className.search(/\\bhidden\\b/i) == -1) {\r\n strFeedTitle = document.getElementById('chrome-title').innerHTML;\r\n strFeedTitle = strFeedTitle.replace(/<a.+?>/i, ''); \r\n strFeedTitle = strFeedTitle.replace(/ <span.+/i, '');\r\n strFeedTitle = strFeedTitle.replace(/<.+?>/g, '');\r\n //Decode the HTML so ampersands, etc. display properly\r\n var div = document.createElement('div');\r\n div.innerHTML = strFeedTitle;\r\n strFeedTitle = div.firstChild.nodeValue;\r\n //Append Google Reader app name onto the end\r\n strFeedTitle = strFeedTitle + ' - [' + strAppTitle + ']';\r\n }\r\n //strFeedTitle = strFeedTitle + ':: ' + x.toString();\r\n isCustomTitleUpdate = true;\r\n document.title = strFeedTitle;\r\n}", "function SectionTitle(title) {\n const sectionTitle = document.createElement(\"div\");\n sectionTitle.innerHTML = `<h1>${title}</h1>`;\n sectionTitle.classList.add(\n \"section-title\",\n \"flex-row\",\n \"flex-wrap\",\n `${title}`\n );\n return sectionTitle;\n }", "function getHotstarTitle() {\n\tsetTimeout(() => {chrome.tabs.query({active: true}, function(tabs){\n\t\tvar tab = tabs[0];\n\t\tchrome.tabs.executeScript(tab.id, {\n\t\t\tcode: 'document.getElementsByClass(\"meta-wrap\").querySelector(\"h1\").textContent'\n\t\t}, function(results){ sendData(results.toString(), \"Hotstar\");});\n\t});}, 2000);\n}", "function changeTitle(title) {\n document.getElementById (\"quest_title\").innerHTML = title;\n}", "function shortenPageTitle() {\n document.getElementById('main-title').innerHTML = \"Fast & Furious\";\n }" ]
[ "0.6811259", "0.66690356", "0.6608191", "0.65580374", "0.6550961", "0.6536783", "0.64807093", "0.64555347", "0.6425385", "0.63935465", "0.63921887", "0.63586897", "0.6304204", "0.6295221", "0.61886", "0.6188326", "0.6172407", "0.61706644", "0.6130143", "0.61229265", "0.61200833", "0.61089694", "0.61010855", "0.60964215", "0.60271114", "0.6009877", "0.6000594", "0.5976583", "0.5976572", "0.5969298", "0.5957256", "0.59499204", "0.5946439", "0.5930206", "0.592664", "0.59245116", "0.59240824", "0.59235114", "0.5920462", "0.5912314", "0.59075123", "0.59070957", "0.59038484", "0.5901564", "0.58870494", "0.58792144", "0.5876415", "0.58710515", "0.5860992", "0.58607334", "0.58545786", "0.58372945", "0.5830268", "0.5816228", "0.581465", "0.5812807", "0.58058447", "0.5800867", "0.5788652", "0.5784424", "0.57806784", "0.57768625", "0.57749563", "0.57697684", "0.57674766", "0.5756909", "0.5754385", "0.57524264", "0.57509625", "0.5742449", "0.5741762", "0.57393295", "0.5720523", "0.5706766", "0.57056457", "0.5695955", "0.5691628", "0.56855124", "0.5684485", "0.5684418", "0.5681156", "0.56703794", "0.56695193", "0.5668897", "0.5666238", "0.56612927", "0.5655883", "0.5653532", "0.5653532", "0.5652898", "0.5651817", "0.5641466", "0.5637675", "0.5635368", "0.5635302", "0.5634303", "0.5633266", "0.56322247", "0.56292444", "0.56261986" ]
0.58453023
51
Integration function for phone number of contact information
function contact_phone(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "phone", "conf1")){ error = "E41_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E41_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } //if (!check_required-char(input)){ //error = "E41_3" //result.flgname.push(flags[error].name); //result.flgs.push(flags[error].flag); //result.flgvalue.push(flags[error].value); //result.flgmsg.push(flags[error].msg); //} if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function phoneNumber(no){\n\t\n}", "function getcontact(name ,number)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.GetContact(name, number);\n}", "function callContact(){\n\t\n\t/**\n\t * Appcelerator Analytics Call\n\t */\n\tTi.Analytics.featureEvent(Ti.Platform.osname+\".profile.callContactButton.clicked\");\n\t\n\t/**\n\t * Before we send the phone number to the platform for handling, lets first verify\n\t * with the user they meant to call the contact with an Alert Dialog\n\t * DOCS: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog\n\t */\n\tvar dialog = Ti.UI.createAlertDialog({\n\t cancel: 0,\n\t buttonNames: ['Cancel', 'Ok'],\n\t message: \"Are you sure you want to call \"+_args.firstName+\" at \"+_args.phone\n\t});\n\t\n\t/**\n\t * Event Handler associated with clicking the Alert Dialog, this handles the \n\t * actual call to the platform to make the phone call\n\t */\n\tdialog.addEventListener('click', function(e){\n\t\t if (e.index !== e.source.cancel){\n\t \n\t \t// IF WE ARE BUILDING FOR DEVELOPMENT PURPOSES - TRY CALLING A FAKE NUMBER\n\t \tif(ENV_DEV){\n\t \t\tTi.Platform.openURL(\"tel:+15125551212\");\n\t \t}\n\t \t// ELSE IF WE ARE BUILDING PRODUCTION - THEN USE THE LISTED NUMBER\n\t \telse if(ENV_PRODUCTION){\n\t \t\tTi.Platform.openURL(\"tel:\"+_args.phone);\n\t \t}\n\t } \n\t});\n\t\n\t/**\n\t * After everything is setup, we show the Alert Dialog to the User\n\t */\n\tdialog.show();\n\t \n}", "function createPhoneNumber(numbers) {\n //\n}", "function handlePhoneCall(phone_number) {\n //console.log('it got in here into handlephone call')\n console.log(\"it got in here into handlephone call\");\n const personNumber = {\n number: phone_number, // Dummy phone number, we will pass props into here\n prompt: false, // Optional boolean property. Determines if the user should be prompt prior to the call\n };\n call(personNumber).catch(console.error);\n\n }", "getPhone () {\n const linkedUri = this.getValueFromVcard('hasTelephone');\n\n if(linkedUri) {\n return this.getValueFromVcard('value', linkedUri).split('tel:+')[1];\n }else{\n return '';\n }\n }", "function addcontact(fullname, number, email, address, notes, website)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.AddContact(fullname, number, email, address, notes, website);\n else\n return false;\n}", "function simplePhoneValidation(phoneNumber) {\n\n}", "function contact_phone(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\t\r\n\tif (!check_allowed_char(input, \"phone\", \"conf1\")){\r\n\t\terror = \"E41_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E41_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t//if (!check_required-char(input)){\r\n\t\t//error = \"E41_3\"\r\n\t\t//result.flgname.push(flags[error].name);\r\n\t\t//result.flgflag.push(flags[error].flag);\r\n\t\t//result.flgvalue.push(flags[error].value);\r\n\t\t//result.flgmsg.push(flags[error].msg);\r\n\t\t//}\r\n\t\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function createContact(name,phoneNumber){\n\n}", "function onSuccess(contacts) {\n for (var i=0; i<contacts.length; i++) {\n \n if (contacts[i].phoneNumbers != null) {\n $.each(contacts[i].phoneNumbers, function(i ,v){\n $.each(v, function(e, f){\n \n\n if (e == 'value') {\n var number = f.replace(/-|\\s/g,\"\"); \n console.log(number);\n\n }\n });\n });\n \n \n }\n\n }\n }", "processPhoneNumber(phone) {\n if (phone[0] == '+') {\n return phone;\n }\n return '+' + phone;\n }", "function isPhone(phone){\n \n}", "function checkMobilePhone(phone_code, phone_number)\r\n{\r\n\tif(checkNull($(phone_number).value));\r\n\t{\r\n\t\tif(checkStrToNum($(phone_number).value) == true)\r\n\t\t{\r\n\t\t\tif(($(phone_number).value.length >= 7) && ($(phone_number).value.length <=10)){\r\n\t\t\t\tvar complete_number = $(phone_code).value + $(phone_number).value;\r\n\t\t\t\t//alert(complete_number);\r\n\t\t\t\tajaxRequest('isPhoneNumber', 'phone_number='+complete_number, '', 'isPhoneNumber', 'reportError');\r\n\t\t\t}else\r\n\t\t\t\talert(mobile_alert);\r\n\t\t}else\r\n\t\t\talert(mobile_format);\r\n\t}\r\n}", "function call(person) {\n const phoneNumber = person.phoneNumbers[0].digits;\n const link = `tel:${phoneNumber}`;\n\n console.log(link);\n Linking.canOpenURL(link)\n .then(supported => Linking.openURL(link))\n .catch(console.error);\n }", "displayPhoneNumber() {\n // Filter only numbers from the input\n let cleaned = ('' + this.phoneNumber).replace(/\\D/g, '');\n\n // Check if the input is of correct length\n let match = cleaned.match(/^(\\d{3})(\\d{3})(\\d{4})$/);\n\n if (match) {\n return '(' + match[1] + ') ' + match[2] + '-' + match[3]\n };\n\n return null\n }", "function index_es6_parsePhoneNumber()\n{\n\tvar parameters = Array.prototype.slice.call(arguments)\n\tparameters.push(metadata_min_json)\n\treturn es6_parsePhoneNumber_parsePhoneNumber.apply(this, parameters)\n}", "processPhone() {\n let input = this.phone\n resetError(input)\n this.changed = true\n\n if (isEmpty(input)) {\n this.valid = false\n } else if (isNumber(input)) {\n this.valid = false\n } else if (exact(input, 11)) {\n this.valid = false\n } else {\n input.success = true\n this.valid = true\n }\n }", "getPhoneNumber(){\n \treturn this.phonenumber.getPhoneNumberFromHeader();\n \t//return this.state.value;\n }", "function call(e){\n\tvar mobile = e.data.MobileNumber;\n\t$m.callContact(mobile);\n}", "contact(callback, phoneNumber, ucid, optionalParams=null) {\n var params = {\n phone_number: phoneNumber,\n ucid: ucid\n };\n if (optionalParams != null) {\n params = Object.assign(params, optionalParams)\n }\n\n this.rest.execute(callback, \"GET\", util.format(this.contactResource, phoneNumber), params);\n }", "getLeadPhoneNumberToDial() {\n if (this.numbers.length === 0) {\n return undefined;\n }\n const number = this.numbers.shift();\n return number;\n }", "function contact_fax_number(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif ( check_req_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E42_3\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E42_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\r\n\tif(!length_field_check(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function formatEINNo (EINNo)\n{\n // If it's blank, save yourself some trouble by doing nothing.\n if (EINNo.value == \"\") return;\n\n \n\n var phone = new String (EINNo.value);\n \n phone = phone.substring(0,10);\n\n /*\n \".\" means any character. If you try to use \"(\" and \")\", the regular expression becomes \n complicated sice both are reserve characters and escaping them sometimes fails. So just \n use \".\" for any character and replace it later.\n */\n if (phone.match (\"[0-9]{2}-[0-9]{7}\") == null)\n {\n \n if (phone.match (\"[0-9]{2}-[0-9]{7}|\" + \"[0-9]-[0-9]{7}\") == null)\n {\n /*\n You will reach here only if the user is still typing the number or if he/she has \n messed up already formatted number. \n */\n var phoneNumeric = phoneChar = \"\", i;\n // Loop thru what user has entered.\n for (i=0;i<phone.length;i++)\n {\n // Go thru what user has entered one character at a time.\n phoneChar = phone.substr (i,1);\n \n // If that character is not a number or is a White space, ignore it. Only if it is a digit, \n // concatinate it with a number string.\n if (!isNaN (phoneChar) && (phoneChar != \" \")) phoneNumeric = phoneNumeric + phoneChar;\n }\n \n phone = \"\";\n // At this point, you have picked up only digits from what user has entered. Loop thru it.\n for (i=0;i<phoneNumeric.length;i++)\n {\n // If it's the first digit, throw in \"(\" before that.\n // if (i == 0) phone = phone + \"(\";\n // If you are on the 4th digit, put \") \" before that.\n // If you are on the 7th digit, insert \"-\" before that.\n if (i == 2) phone = phone + \"-\";\n // Add the digit to the phone charatcer string you are building.\n phone = phone + phoneNumeric.substr (i,1)\n }\n }\n }\n else\n { \n// This means the tel no is in proper format. Make sure by replacing the 0th, 4th and 8th character.\n// phone = \"\" + phone.substring (1,4) + \"-\" + phone.substring (5,8) + \"-\" + phone.substring(9,13); \n }\n // So far you are working internally. Refresh the screen with the re-formatted value.\n if (phone != EINNo.value) EINNo.value = phone;\n}", "function parsePhoneNumber()\r\n{\r\n\tvar parameters = Array.prototype.slice.call(arguments)\r\n\tparameters.push(_metadata_min_json_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])\r\n\treturn _es6_parsePhoneNumber__WEBPACK_IMPORTED_MODULE_1__[\"default\"].apply(this, parameters)\r\n}", "function contact_fax_number(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif ( check_req_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E42_3\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E42_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\r\n\tif(!length_field_check(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function helperValidatePhone() {\r\n //sends the error state to change the background\r\n sendState(on, \"phone\");\r\n //adds the error to the array\r\n addDataAllErrors(allErrorMess[3]);\r\n }", "function checkMobilePhone2(phone_code, phone_number)\r\n{\r\n\tvar complete_number = $(phone_code).value + $(phone_number).value;\r\n\t//alert(complete_number);\r\n\tajaxRequest('isPhoneNumber', 'phone_number='+complete_number, '', 'isPhoneNumber2', 'reportError');\r\n}", "function FormatPhoneNumber(val)\n{\n if ((val.length == 0) || (val.charAt(0) == \"0\"))\n\t return val;\n \t \n var ext = \"\";\n var temp = val;\n var vTempExt = \"\";\n var extFound = false;\n var isInter = false;\n var extAtBegin = false;\n var i = -1;\n if (val.charAt(0) == \"+\")\n {\n isInter = true; \n }\n \n val.replace(\"/\\D+/g.\", \"\");\n i = val.indexOf(\"ext\");\n if (i > -1)\n {\n ext = val.substring(i);\n temp = val.substring(0, value.length - ext.length)\n vTempExt = ext.substring(3, ext.length);\n ext = val.substring(i, 3);\n extFound = true;\n \n if(i == 2)\n {\n extAtBegin = true;\n }\n }\n else\n {\n i = findToken(val,\"x\"); //val.indexOf(\"x\");\n if (i > -1)\n {\n \n ext = val.substring(i);\n vTempExt = ext.substring(1, ext.length);\n j = findToken(vTempExt,\"x\");// vTempExt.indexOf(\"x\");\n if (j > -1)\n {\n extFound = false;\n ext = \"\";\n i = -1;\n }\n else\n {\n temp = val.substring(0, val.length - ext.length)\n ext = \"x\";\n extFound = true;\n \n }\n if(i == 0)\n {\n extAtBegin = true;\n } \n } \n }\n\n if (extFound) \n {\n\t\t\n\t\tif (vTempExt.length >= 1) \n\t\t{\n\t\t\tif (containsAlphaChar(vTempExt))\n\t\t\t{\n\t\t\t ext = ext + convertPhoneLetters(vTempExt);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t ext = ext + vTempExt;\t\t\t \n\t\t\t}\n\t }\n }\n if(extAtBegin)\n {\n return ext;\n \n }\n else\n {\n val = convertPhoneLetters(temp);\n \n var result = val;\n if (val.length == 10)\n {\n result = \"(\" + val.substr(0,3) + \") \" + val.substr(3,3) + \"-\" + val.substr(6,4);\n }\n if (val.length == 7)\n {\n result = val.substr(0,3) + \"-\" + val.substr(3,4);\n } \n \n return result + ext;\n }\n}", "function getPhone() {\n let num = (min, max) => String(getRandomInt(min, max));\n return (\n num(0, 10) + num(0, 10) + num(0, 10) + '-'\n + num(0, 10) + num(0, 10) + num(0, 10) + '-'\n + num(0, 10) + num(0, 10) + num(0, 10) + num(0, 10)\n );\n}", "function formatPhoneNumber(phone){\n // Code modified for Trac 1598.\n var phoneNumberLength = phone.length;\n if(!phoneNumberLength < 11){\n phone = ReplaceAll (phone, \" \" ,\"\");\n phone = ReplaceAll (phone, \"-\" ,\"\");\n phoneNumberLength = phone.length;\n if(phoneNumberLength == 11){\n var isOne = phone.substring(0,1);\n if(isOne == 1){\n phone= phone.replace(\"1\",\"\");\n }\n }\n }\n // End of code modified for Trac 1598.\n var sAreaCode = phone.substring(0,3);\n var s3dig = phone.substring(3,6);\n var s4dig = phone.substring(6,10);\n var newPhone = \"(\"+sAreaCode+\")\"+s3dig+\"-\"+s4dig;\n return newPhone;\n}", "function telephoneFilter() {\n \n var countryCodes = i18n.phonenumbers.metadata.countryCodeToRegionCodeMap;\n var countryMetaData = i18n.phonenumbers.metadata.countryToMetadata;\n var validRangeMap = {\n 2: \"fixedLine\",\n 3: \"mobile\",\n 4: \"tollFree\",\n 5: \"premiumRate\",\n 6: \"sharedCost\",\n 7: \"personalNumber\",\n 8: \"voip\",\n 21: \"pager\",\n 24: \"noInternationalDialing\",\n 25: \"uan\",\n 28: \"voiceMail\"\n };\n \n var regionsFromNumber = function(e164) {\n var regions, key, value;\n for(key in countryCodes) {\n value = countryCodes[key];\n var reg = new RegExp('^'+key),\n ok;\n\n ok = reg.exec(e164);\n\n if(ok) {\n regions = value;\n break;\n }\n }\n\n return regions;\n };\n\n var formatNumberForRegion = function(region, nationalNumber, mode) {\n var metaData = countryMetaData[region],\n countryCode = metaData[10],\n nationalPrefix = metaData[12],\n nationalFormats = metaData[19],\n internationalFormats = metaData[20],\n number, international = (mode === 'e164'),\n numberFormats = international && internationalFormats ? internationalFormats : nationalFormats,\n entry, i, matchNumber, matchLeadingDigits, validRange = false, range;\n\n if(numberFormats) {\n \n if(nationalPrefix && nationalNumber.substr(0, nationalPrefix.length) === nationalPrefix) {\n nationalNumber = nationalNumber.substr(nationalPrefix.length);\n }\n \n for (var key in validRangeMap) {\n entry = metaData[key];\n if(new RegExp('^('+entry[2]+')$').exec(nationalNumber)) {\n validRange = true;\n range = validRangeMap[key];\n break;\n }\n }\n\n if(validRange) {\n for(i = 0;i<numberFormats.length;i++) {\n entry = numberFormats[i];\n matchNumber = new RegExp('^('+entry[1]+')$').exec(nationalNumber);\n\n if(!angular.isDefined(entry[3])) {\n matchLeadingDigits = true;\n } else if(angular.isString(entry[3])) {\n matchLeadingDigits = new RegExp('^('+entry[3]+')').exec(nationalNumber);\n } else if(angular.isArray(entry[3])) {\n angular.forEach(entry[3], function(lead) {\n var result = new RegExp('^('+lead+')').exec(nationalNumber);\n if(result) {\n matchLeadingDigits = true;\n }\n });\n }\n\n if(matchNumber && matchLeadingDigits) {\n var format = entry[2];\n if(international) {\n number = nationalNumber;\n number = number.replace(new RegExp(entry[1]), format);\n number = '+' + countryCode + ' ' + number;\n } else {\n number = nationalNumber;\n if(nationalPrefix) {\n number = nationalPrefix + '' + number;\n }\n number = number.replace(new RegExp(entry[1]), format);\n }\n break;\n }\n }\n }\n }\n return number;\n };\n \n var formatNumber = function(number, mode) {\n var regions = regionsFromNumber(number), region, i, countryCode, nationalPrefix, nationalNumber, result;\n\n if(regions) {\n for(i=0;i<regions.length;i++) {\n region = regions[i];\n countryCode = countryMetaData[region][10];\n nationalPrefix = countryMetaData[region][12];\n nationalNumber = number.substr(countryCode.toString().length);\n if(nationalPrefix && nationalNumber.substr(0, nationalPrefix.length) !== nationalPrefix) {\n nationalNumber = nationalPrefix + '' + nationalNumber;\n }\n result = formatNumberForRegion(region, nationalNumber, mode);\n if(result) break;\n }\n }\n return result;\n };\n\n var wrapResult = function(input, number, returnObject) {\n var result;\n \n if(returnObject === true) {\n if(!number) {\n result = {\n number: input,\n valid: false\n };\n } else {\n result = {\n number: number,\n valid: true\n };\n }\n } else {\n if(!number) {\n result = input;\n } else {\n result = number;\n }\n }\n return result;\n };\n \n return function(input, mode, defaultAreaCode, returnObject) {\n \n var trimmedNumber, defaultGeneratedNumber, number;\n mode = mode ? mode : 'e164';\n trimmedNumber = teljs.trimNumber(input);\n if(defaultAreaCode && defaultAreaCode !== '') {\n defaultGeneratedNumber = defaultAreaCode + '' + trimmedNumber;\n number = formatNumber(defaultGeneratedNumber, mode);\n if(number) return wrapResult(input, number, returnObject);\n } \n \n number = formatNumber(trimmedNumber, mode);\n return wrapResult(input, number, returnObject);\n\n\n };\n}", "function formatPhoneNumber(value) {\n\tvar format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'National';\n\n\treturn (0, _custom.formatNumber)(value, format, _metadataMin2.default);\n}", "phonenumberInput()\n {\n let updatedPhoneNumber\n console.log(\"Enter mobile number to update\")\n let uPhoneNumber=input.question()\n obPerson.setPhoneNumber( uPhoneNumber)\n updatedPhoneNumber=obPerson.getPhoneNumber()\n return updatedPhoneNumber\n }", "function validatePhoneNumber(phonenumber){\n var x;\n regEx = /[0-9]{10}/;\n if (phonenumber.match(regEx)) {\n x = true;\n } else {\n x = false;\n } \n callHerokuApi(x,\"phone=\", phonenumber); \n }", "function testPhoneNumberSearch(){\n validatePhoneNumber(\"3832720339\"); // invalid entry\n\t validatePhoneNumber(\"2125551235\"); // valid entry\n\t validatePhoneNumber(null); // invalid entry\n\t validatePhoneNumber(1312); // invalid entry\n }", "function formatPhone(x){\n var areaCode = x.slice(0, 3);\n var first3 = x.slice(3, 6);\n var last4 = x.slice(6, 11);\n var phone = areaCode + \"-\" + first3 + \"-\" + last4;\n return phone;\n}", "function phoneOnChange() {\n const pattern = \"^((8|\\\\+7)[\\\\- ]?)?(\\\\(?\\\\d{3}\\\\)?[\\\\- ]?)?[\\\\d\\\\- ]{7,10}$\";\n validate(this, pattern);\n}", "get phoneNo() { return this._phoneNo; }", "function parsePhone(phone){\n // changes (###)-###-#### to ##########\n}", "function emailOrderPhoneNumber(emailBody) {\n // Get the first phone number within email body. This is only one we need.\n var tmp;\n var tmpArray;\n var phoneNumber;\n \n // Try Phone Number with '-'\n tmp = emailBody.match(/[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}/);\n// sheet.appendRow(['In phone number function: ', tmp[0]]);\n \n // If null, must be Phone Number with '.'\n if(tmp == null) {\n tmp = emailBody.match(/[0-9]{3}\\.[0-9]{3}\\.[0-9]{4}/); \n \n // Split on '.'\n tmpArray = tmp[0].split('.');\n }\n else {\n // Split on '-'\n tmpArray = tmp[0].split('-');\n }\n\n \n // Reassemble phone number with prepended 1.\n phoneNumber = '1' + tmpArray[0] + tmpArray[1] + tmpArray[2];\n \n return phoneNumber;\n}", "function callCustomer(phoneNumber) {\n updateCallStatus(\"Calling \" + phoneNumber + \"...\");\n\n var params = {\"phoneNumber\": phoneNumber};\n Twilio.Device.connect(params);\n}", "function generatePhoneNumber(numeroTelefone) {\n // verificar o tamanho do array\n \n if (numeroTelefone.length != 11) {\n return 'Array com tamanho incorreto.';\n }\n // verificar se o número repetiu mais que três vezes\n let contador = 0;\n let repetiu = false;\n let listaAuxiliar = numeroTelefone;\n for (let i = 0; i < numeroTelefone.length ; i += 1) {\n for (let j = 0; j < numeroTelefone.length ; j += 1){\n if (listaAuxiliar[i] === numeroTelefone[j]){\n contador += 1\n if (contador === 3) {\n repetiu = true;\n }\n }\n }\n contador=0;\n }\n // estabelecendo as condições de return \n for (let x in numeroTelefone){\n if (numeroTelefone[x] < 0 || numeroTelefone[x] > 9 || repetiu === true ) {\n return 'não é possível gerar um número de telefone com esses valores';\n }\n }\n numeroTelefone.splice(0,0,'(')\n numeroTelefone.splice(3,0,')')\n numeroTelefone.splice(4,0,' ')\n numeroTelefone.splice(10,0,'-')\n \n let numeroFormatado = '';\n for (let x in numeroTelefone){\n numeroFormatado += numeroTelefone[x]\n }\n return numeroFormatado;\n \n}", "function phonesData() {\n new Phone('iPhone 12 Pro', '850 JD', 'Silver Graphite', '128GB', '12MP', '4G', 'iphone-12-pro');\n new Phone('Xiaomi Mi A2 Lite', '150 JD', 'Awsome Black', '64GB', '12MP', '4G', 'xiaomi-mi-a2-lite');\n new Phone('iPhone 11', '467 JD', 'Yellow', '64GB', '12MP', '4G', 'Iphone-11-Red-Front-800x800');\n new Phone('Huawei Nova 6 Se', '179 JD', 'Emerald Green', '128GB', '48MP', '4G', 'huawei-nova-6-se');\n new Phone('Samsung A31', '179 JD', ' Prism Crush Blue', '128GB', '48MP', '4G', 'samsung-A-31');\n new Phone('Asus Zenfone 6', '450 JD', 'Midnight Black', '128GB', '48MP', '4G', 'asus-zain-phone');\n new Phone('Huawei P30 Pro', '668 JD', ' Amber Sunrise', '128GB', '40MP', '4G', 'Huawei-P30-Pro');\n new Phone('Iphone X', '450 JD', 'Space Gray', '128GB', '12MP', '4G', 'iphone_x');\n new Phone('iPhone 8', '330 JD', 'White', '128GB', '12MP', '4G', 'iphone-8');\n new Phone('Galaxy S21', '668 JD', 'Gold', '128GB', '13MP', '4G', 'Galaxy-s2');\n}", "function contactNumber(user_phone){\n var user_phone = getInputVal(\"userPhone\");\n if(user_phone.length !== 10){\n document.getElementById(\"phoneNumber\").innerHTML = \"enter the valid number\"; \n } \n else {\n document.getElementById(\"phoneNumber\").innerHTML = \"\";\n }\n }", "function checkNumberCallTo(phone1) {\n\t\tvar phone = replaceCountryCode(phone1);\n\t\tif (checkPhoneNumber(phone) == false) {\n\t\t\tconsole.log('Invalid number');\n\t\t\t$('.showMsgCall').removeClass('hide');\n\t\t\t$('.showMsgCall').empty();\n\t\t\t$('.showMsgCall').append(\"<div class='notif notif-err mb-10'>Invalid phone number</div>\");\n\t\t\treturn false;\n\t\t}\n\t\t$('.showMsgCall').addClass('hide');\n\t\t$('.showMsgCall').empty();\n\t\treturn true\n\t}", "function generatePhoneNumber() {\n return getRandomNumber(1234567, 9999999); // lowerBound is a dummy min val for a phone number\n}", "function GetPhoneNumber(){\n jQuery('#surtaxphone').click(function() {\n var _id = jQuery(this).attr('data-value');\n jQuery.ajax({\n url: Routing.generate('viteloge_frontend_agency_phone', {id: _id}, true),\n context: jQuery(this),\n method: 'POST',\n beforeSend: function() {\n jQuery(this).off('click');\n jQuery('.loader').removeClass('hidden').addClass('in');\n jQuery('.loader-backdrop').removeClass('hidden').addClass('in');\n },\n complete: function() {\n\n },\n success: function(data) {\n jQuery('.modal-title').html(data.phone);\n if(data.phone !='Pas de Numéro'){\n jQuery('.modal-body').html(data.cout);\n jQuery('#linkPhone').attr(\"href\", \"tel:\"+data.phone);\n jQuery('#linkPhone').attr(\"data-value\", data.id);\n }else{\n jQuery('#btnPhone').html('');\n }\n\n jQuery('.loader').addClass('hidden').removeClass('in');\n jQuery('.loader-backdrop').addClass('hidden').removeClass('in');\n\n jQuery(this).on('click');\n CallPhone();\n }\n });\n });\n }", "function snomTbookProcessCard(vcf, fullname, order, prefix, duplicates, uniqueEntries) {\n // entry name\n let entryName = utilNameFormat(vcf.lastName, vcf.firstName, vcf.orgName, fullname);\n // check for duplicates\n if (!duplicates) {\n if (uniqueEntries.indexOf(entryName) > -1)\n return;\n uniqueEntries.push(entryName);\n }\n // object to hold different kinds of phone numbers, limit to home, work, mobile, default to home\n let entries = [];\n // iterate through all numbers\n for (let tel of vcf.tels) {\n let type = tel.type === 'work' ? 'business' : tel.type;\n entries.push({ type: type, number: (prefix === '' ? tel.number : prefix + tel.number).replace('+', '00') });\n }\n // if empty return nothing\n if (entries.length === 0)\n return;\n // process all types and numbers\n let typeOrder = order.length !== 3 ? ['default'] : order;\n let i = 0;\n let telephony = [];\n // depends on quantity of phone numbers\n let referenceNumber = '0';\n if (entries.length === 1) {\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: vcf.firstName\n },\n {\n last_name: vcf.lastName\n },\n {\n organization: vcf.orgName\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n i++;\n }\n }\n }\n }\n else {\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n if (i === 0) {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: vcf.firstName\n },\n {\n last_name: vcf.lastName\n },\n {\n organization: vcf.orgName\n },\n {\n number: entry.number\n }\n ]\n });\n referenceNumber = entry.number;\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: 'Member_Alias'\n },\n {\n last_name: referenceNumber\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n }\n else {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: 'Member_Alias'\n },\n {\n last_name: referenceNumber\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n }\n i++;\n }\n }\n }\n }\n return telephony;\n}", "function validateContactNo(field)\n{\n if(field == \"\")\n {\n return \"No Contact was entered.\\n\";\n } \n else if(field.length < 10 || field.length > 10){\n return \"Cellphone numbers have 10 digits.\\n\";\n }\n return \"\";\n}", "function FormatPhoneNumber() {\n\n return function (tel) {\n var formattedNumber = '';\n\n // If blank, null, undef - return an empty string\n if (!tel) {\n return '';\n }\n\n // Ensure it's a string and trim it while we're at it\n var value = tel.toString().trim();\n\n // If there's any non numeric digits, return the trimmed string\n if (value.match(/[^0-9]/)) {\n return tel;\n }\n\n // Format the phone number if it's 7, 10 or 11 chars long\n switch (value.length) {\n case 7:\n formattedNumber =\n value.substr(1, 3) + '-' +\n value.substr(4, 4);\n break;\n\n case 10:\n formattedNumber =\n '(' +\n value.substr(0, 3) + ') ' +\n value.substr(3, 3) + '-' +\n value.substr(6, 4);\n break;\n\n case 11:\n formattedNumber =\n value.substr(0, 1) + ' (' +\n value.substr(1, 3) + ') ' +\n value.substr(4, 3) + '-' +\n value.substr(7, 4);\n break;\n\n default:\n formattedNumber = value;\n }\n\n return formattedNumber;\n };\n }", "function Telephony() {\n\t\n}", "validateTelephone(tel) {\n if(tel==='') {\n return 'Telephone required';\n } else if (!/^\\d+$/.test(tel)) {\n return 'Telephone number invalid'\n }\n \n return '';\n }", "function validatePhone(val) {\n\n var digits = val.replace(/[^0-9]/g, '');\n var australiaPhoneFormat = /^(\\+\\d{2}[ \\-]{0,1}){0,1}(((\\({0,1}[ \\-]{0,1})0{0,1}\\){0,1}[2|3|7|8]{1}\\){0,1}[ \\-]*(\\d{4}[ \\-]{0,1}\\d{4}))|(1[ \\-]{0,1}(300|800|900|902)[ \\-]{0,1}((\\d{6})|(\\d{3}[ \\-]{0,1}\\d{3})))|(13[ \\-]{0,1}([\\d \\-]{5})|((\\({0,1}[ \\-]{0,1})0{0,1}\\){0,1}4{1}[\\d \\-]{8,10})))$/;\n var phoneFirst6 = digits.substring(0, 6);\n\n var message = null;\n\n //Check if all phone characters are numerals\n if (val != digits) {\n console.log('Contain Numbers only');\n message = 'Phone numbers should contain numbers only.\\n\\nPlease re-enter the phone number without spaces or special characters.';\n return message;\n } else if (digits.length != 10) {\n console.log('10 Numbers only');\n //Check if phone is not blank, need to contains 10 digits\n message = 'Please enter a 10 digit phone number with area code.</br>';\n return message;\n } else if (!(australiaPhoneFormat.test(digits))) {\n console.log('Australian Format Numbers only');\n //Check if valid Australian phone numbers have been entered\n message = 'Please enter a valid Australian phone number.\\n\\nNote: 13 or 12 numbers are not accepted';\n return message;\n } else if (digits.length == 10) {\n //Check if all 10 digits are the same numbers using checkDuplicate function\n if (checkDuplicate(digits)) {\n console.log('Valid 10 Numbers only');\n message = 'Please enter a valid 10 digit phone number.';\n return message;\n }\n }\n\n return message;\n}", "function greet(person) {\n\tconsole.log(person.firstname + \"'s phone numbers are, Home: \" + person.address.phones.home + \" and number is, Cell: \" + person.address.phones.cell);\n}", "phone(event){\r\n let isObj = typeof event == 'object',\r\n isEmpty = event.target.value.length <= 0;\r\n\r\n if(!isObj || isEmpty){\r\n throw new Error('Bad format object');\r\n }\r\n\r\n event.target.setAttribute('maxLength', 17);\r\n\r\n let v = event.target.value.replace(/\\D/g, '').match(/(\\d{0,2})(\\d{0,5})(\\d{0,4})/);\r\n\r\n event.target.value = !v[2] ? v[1] : '( ' + v[1] + ' ) ' + v[2] + (v[3] ? '-' + v[3] : '');\r\n }", "function getExampleNumber(country, examples, metadata) {\n if (examples[country]) {\n return new PhoneNumber_PhoneNumber(country, examples[country], metadata);\n }\n}", "function phoneNumber()\n{\n var phoneno = /^\\d{10}$/;\n let phoneError = document.getElementById(\"phone-error\");\n if(phone_number.value.match(phoneno))\n {\n phoneError.style.display = \"none\";\n phone_number.setCustomValidity(\"\");\n\n }\n else\n {\n phoneError.style.display = \"block\";\n phoneError.innerHTML = \"Not a valid Phone Number\";\n phone_number.setCustomValidity(\"Wrong Phonenumber Format.\");\n }\n}", "function createPhoneNumber(numbers){\n let fst = numbers.slice(0, 3).join('')\n let scnd = numbers.slice(3, 6).join('')\n let thrd = numbers.slice(6, 10).join('')\n console.log(`(${fst}) ${scnd}-${thrd}`)\n }", "phoneButton() {\n console.log(\"dialing 911...\");\n }", "function validatePhone( phone )\n{ \n callWebService( \"/validateTel/\" + phone, showPhoneError );\n} // end function validatePhone", "function snomXcapProcessCard(vcf, fullname, order, prefix, duplicates, uniqueEntries, xcapUniqueNumbers) {\n // entry name\n let entryName = utilNameFormat(vcf.lastName, vcf.firstName, vcf.orgName, fullname);\n // check for duplicates\n if (!duplicates) {\n if (uniqueEntries.indexOf(entryName) > -1)\n return;\n uniqueEntries.push(entryName);\n }\n // object to hold different kinds of phone numbers, limit to home, work, mobile, default to home\n let entries = [];\n // iterate through all numbers\n for (let tel of vcf.tels) {\n if (!tel.number)\n continue;\n // check for duplicate phone number\n if (xcapUniqueNumbers.indexOf(tel.number) > -1) {\n let errorMsg = 'Duplicate number (' + tel.number + ') on ' + entryName;\n console.log('WARNING: ' + errorMsg);\n sendMail('Sync: Duplicate phone number detected', errorMsg);\n continue;\n }\n xcapUniqueNumbers.push(tel.number);\n // store entry\n entries.push({ type: tel.type, number: prefix === '' ? tel.number : (prefix + tel.number).replace('+', '00') });\n }\n // if empty return nothing\n if (entries.length === 0)\n return;\n // process all types and numbers\n let typeOrder = order.length !== 3 ? ['default'] : order;\n let telephony = [];\n let count = {\n work: 0,\n home: 0,\n mobile: 0\n };\n // go by type order\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n let n = entry.type.replace('work', 'business') + '_number';\n if (count[entry.type] > 0)\n n += '#' + count[entry.type];\n telephony.push({\n 'cp:prop': [\n {\n _attr: {\n name: n,\n value: entry.number\n }\n }\n ]\n });\n count[entry.type]++;\n }\n }\n }\n return {\n entry: [\n {\n 'display-name': entryName\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'entry_id',\n value: vcf.uid\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'surname',\n value: vcf.lastName\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'given_name',\n value: vcf.firstName\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'company',\n value: vcf.orgName\n }\n }\n ]\n },\n ...telephony\n ]\n };\n}", "function getPhoneNumbers (context, escPolicyUrl, teamName, escPolicyName) {\n return new Promise((resolve, reject) => {\n const {API_HOST, headers} = context;\n\n got(\n escPolicyUrl,\n {headers}\n )\n .then(response => {\n const body = JSON.parse(response.body);\n const {schedules} = body;\n const onCallArray = [];\n let escPolicyAssigned;\n let schedule;\n\n // Check if an escalation policy has been specified in the Twilio UI\n if (!(_.isUndefined(escPolicyName))) {\n escPolicyAssigned = true;\n } else {\n escPolicyAssigned = false;\n }\n\n // Get the specified escalation policy or get the first one if none is specified\n if (escPolicyAssigned) {\n schedule = setSchedule(schedules, escPolicyName, teamName);\n } else if (schedules.length > 0) {\n schedule = schedules[0].schedule;\n } else {\n schedule = false;\n }\n\n if (schedule === false) {\n return resolve(false);\n }\n\n schedule.forEach((rotation, i, array) => {\n if (!(_.isUndefined(rotation.onCallUser))) {\n if (!(_.isUndefined(rotation.overrideOnCallUser))) {\n onCallArray.push(rotation.overrideOnCallUser.username);\n } else {\n onCallArray.push(rotation.onCallUser.username);\n }\n }\n });\n\n if (onCallArray.length === 0) {\n return resolve(false);\n }\n\n const randomIndex = Math.floor(Math.random() * onCallArray.length);\n\n got(\n `https://${API_HOST}/api-public/v1/user/${onCallArray[randomIndex]}/contact-methods/phones`,\n {headers}\n )\n .then(response => {\n const body = JSON.parse(response.body);\n\n if (body.contactMethods.length === 0) {\n return resolve(false);\n } else {\n return resolve(\n {\n phone: body.contactMethods[0].value,\n user: onCallArray[randomIndex]\n }\n );\n }\n })\n .catch(err => {\n console.log(err);\n\n return reject(err);\n });\n })\n .catch(err => {\n console.log(err);\n\n return reject(err);\n });\n });\n}", "function formatTelNo (telNo)\n{\n // If it's blank, save yourself some trouble by doing nothing.\n if (telNo.value == \"\") return false;\n\n \n\n var phone = new String (telNo.value);\n \n phone = phone.substring(0,14);\n\n /*\n \".\" means any character. If you try to use \"(\" and \")\", the regular expression becomes \n complicated sice both are reserve characters and escaping them sometimes fails. So just \n use \".\" for any character and replace it later.\n */\n if (phone.match (\".[0-9]{3}.[0-9]{3}-[0-9]{4}\") == null)\n {\n /*\n Following \"if\" is for user making any changes to the formatted tel. no. If you don't put this \n \"if\" condition, the user can not correct a digit by first deleting it and then entering a \n correct one, since this will fire two \"onkeyup\" events : first one on deleting a \n character and second one on entering the correct one. The first \"onkeyup\" event will fire this \n function which will reformatt the tel no before the user gets a chace to correct the digit. This \n will surely confuse the user. The \"if\" condition below eliminates that.\n */\n if (phone.match (\".[0-9]{2}.[0-9]{3}-[0-9]{4}|\" + \".[0-9].[0-9]{3}-[0-9]{4}|\" +\n \".[0-9]{3}.[0-9]{2}-[0-9]{4}|\" + \".[0-9]{3}.[0-9]-[0-9]{4}\") == null)\n {\n /*\n You will reach here only if the user is still typing the number or if he/she has \n messed up already formatted number. \n */\n var phoneNumeric = phoneChar = \"\", i;\n // Loop thru what user has entered.\n for (i=0;i<phone.length;i++)\n {\n // Go thru what user has entered one character at a time.\n phoneChar = phone.substr (i,1);\n \n // If that character is not a number or is a White space, ignore it. Only if it is a digit, \n // concatinate it with a number string.\n if (!isNaN (phoneChar) && (phoneChar != \" \")) phoneNumeric = phoneNumeric + phoneChar;\n }\n \n phone = \"\";\n // At this point, you have picked up only digits from what user has entered. Loop thru it.\n for (i=0;i<phoneNumeric.length;i++)\n {\n // If it's the first digit, throw in \"(\" before that.\n if (i == 0) phone = phone + \"(\";\n // If you are on the 4th digit, put \") \" before that.\n if (i == 3) phone = phone + \") \";\n // If you are on the 7th digit, insert \"-\" before that.\n if (i == 6) phone = phone + \"-\";\n // Add the digit to the phone charatcer string you are building.\n phone = phone + phoneNumeric.substr (i,1)\n }\n }\n }\n else\n { \n // This means the tel no is in proper format. Make sure by replacing the 0th, 4th and 8th character.\n phone = \"(\" + phone.substring (1,4) + \") \" + phone.substring (5,8) + \"-\" + phone.substring(9,13); \n }\n // So far you are working internally. Refresh the screen with the re-formatted value.\n if (phone != telNo.value) telNo.value = phone;\n}", "function createPhoneNumber(numbers){\n let area= numbers.slice(0,3).join('');\n let midd = numbers.slice(3,6).join('');\n let last = numbers.slice(-4).join('');\n return `(${area}) ${midd}-${last}`;\n}", "function evaluatePhone(phone){\n\tif(phone){\n\t\tvar countPhone = countDigitsNumber(phone);\n\t\tif (countPhone == 7 || countPhone==10){\n\t\t\tvar codPhone = phone %100;\n\t\t\tSession.set('NewCustomerCodPhone', codPhone);\n\n\t\t\tMeteor.call('customersFindPhone', phone, function (error, result) {\n\t\t\t\tif(error){\n\t\t\t\t\tconsole.log('----ERROR', error)\n\t\t\t\t}\n\t\t\t\tif(result){\n\t\t\t\t\t$('#btnModalSaveCustomer').attr('disabled', true);\n\t\t\t\t\treturn Session.set('newCustomerNotifications', {\n\t\t\t\t\t\talert:\"alert alert-error\",\n\t\t\t\t\t\tmessage : \"El Número Telefonico YA existe\"\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t$('#btnModalSaveCustomer').attr('disabled', false);\n\t\t\t\treturn Session.set('newCustomerNotifications', {\n\t\t\t\t\t\talert:\"alert alert-success\",\n\t\t\t\t\t\tmessage : \"Perfecto... Es un Cliente Nuevo\"\n\t\t\t\t\t});\n\t\t\t});\n\t\t\t$('#btnModalSaveCustomer').attr('disabled', true);\n\t\t\treturn Session.set('newCustomerNotifications',{\n\t\t\t\talert:\"alert alert-info\",\n\t\t\t\tmessage:\"Validando el Telefono...\"});\n\t\t}\n\t\telse{\n\t\t\t$('#btnModalSaveCustomer').attr('disabled', true);\n\t\t\treturn Session.set('newCustomerNotifications',{\n\t\t\t\talert:\"alert alert-error\",\n\t\t\t\tmessage:\"Debe ser un Telefono Fijo (7 digitos) o Celular (10 Digitos)\"\n\t\t\t});\n\t\t}\n\t}\n\telse{\n\t\t$('#btnModalSaveCustomer').attr('disabled', true);\n\t\treturn Session.set('newCustomerNotifications',{\n\t\t\talert:\"alert alert-error\",\n\t\t\tmessage:\"El Telefono esta en Blanco o Contine Letras\"\n\t\t});\n\t}\n}", "function maskPhoneInput() {\n\n\t\t// makes the assumption that there can only be 1 'tel' input per page\n\t\tvar elPhoneInput = document.querySelectorAll('input[type=\"tel\"]')[0];\n\n\t\t// check if input[type=\"tel\"] does not exist\n\t\tif (elPhoneInput == null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// our input[type=\"tel\"] DOES exist..\n\t\tvar formatted = new Formatter(elPhoneInput, {\n\t\t\t'pattern': '{{999}}-{{999}}-{{9999}}'\n\t\t});\n\n\t}", "function validatePhoneNumber(){\r\nvar phoneNumber = document.forms[\"contactInfo\"][\"phone\"].value;\r\n\tif(isNaN(phoneNumber)){\r\n\t\t//used for debugging\r\n\t\t//console.log(\"phone isNaN\");\r\n\t\talert(\"Please enter only numbers for your phone number, do not use +, -, (, or )\");\r\n\t\treturn false;\r\n\t}\r\n\tif(phoneNumber.length != 10){\r\n\t\t//used for debugging\r\n\t\t//console.log(\"phone doesn't have all digits\");\r\n\t\talert(\"Please enter ten digits for your phone number.\");\r\n\t\treturn false;\r\n\t}\r\n\t//used for debugging\r\n\t//console.log(\"mAde it through phone check\");\r\n\treturn true;\r\n}", "static phoneNumberData2Human(data_phone_number){\n let str = this.phoneNumberHuman2Data(data_phone_number)\n str.match(/([0-9]{3})([0-9]{4})([0-9]{4})/)\n return `${RegExp.$1} ${RegExp.$2} ${RegExp.$3}`\n }", "function get_phone_code(country_metadata) {\n\treturn country_metadata[0];\n}", "function phoneValidate(number) {\n var phoneno = /^\\d{11}$/;\n if(number.match(phoneno)){\n return true;\n }\n else {\n return false;\n }\n }", "formatPhoneNumber(phoneNumberString) {\n var cleaned = ('' + phoneNumberString).replace(/\\D/g, '');\n var match = cleaned.match(/^(1|)?(\\d{3})(\\d{3})(\\d{4})$/);\n if (match) {\n var intlCode = (match[1] ? '+1 ' : '');\n return [intlCode, '(', match[2], ') ', match[3], '-', match[4]].join('');\n }\n return null;\n }", "function phonenumber(inputtxt) {\n let phoneno = /^\\(?([0-9]{3})\\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/;\n if (inputtxt.value.match(phoneno)) {\n console.log(\"Phone number is valid.\");\n return true;\n } else {\n alert(\"Phone number is not valid. It needs to be 10 digits.\");\n return false;\n }\n}", "function getPhone() {\n var phone = document.getElementById('phone')\n return phone.value\n}", "getPhoneNumber() {\n return this.phoneNumber;\n }", "function validatePhone(txtPhone) {\n var a = txtPhone;\n var filter = /^((\\+[1-9]{1,4}[ \\-]*)|(\\([0-9]{2,3}\\)[ \\-]*)|([0-9]{2,4})[ \\-]*)*?[0-9]{3,4}?[ \\-]*[0-9]{3,4}?$/;\n if (filter.test(a)) {\n return true;\n }\n else {\n return false;\n }\n}", "function createPhoneNumber(numbers) {\n return `(${numbers[0]}${numbers[1]}${numbers[2]}) ${numbers[3]}${numbers[4]}${\n numbers[5]\n }-${numbers[6]}${numbers[7]}${numbers[8]}${numbers[9]}`;\n}", "function findContact(){\n var name = readLineSync.question(\"Nhap vao thu ban muon tim kiem: \");\n if(isNaN(name) === false){\n searchPhone(name);\n }\n else{\n searchName(name);\n } \n }", "callOtherUser(number) {\n var phoneNumber = '';\n if (Platform.OS == 'android') {\n phoneNumber = 'tel:${' + number + '}';\n }\n else {\n phoneNumber = 'telprompt:${' + number + '}';\n }\n Linking.openURL(phoneNumber);\n }", "function checkTelNo (telNo)\n{\n if (telNo.value == \"\") return;\n if (telNo.value.match (\".[0-9]{3}.[0-9]{3}-[0-9]{4}\") == null)\n {\n if (telNo.value.match (\"[0-9]{10}\") != null)\n formatTelNo (telNo) \n }\n}", "get phoneOwner () {\n \n }", "function findPhoneNumbers() {\n\tvar _normalizeArguments = Object(_parsePhoneNumber__WEBPACK_IMPORTED_MODULE_1__[\"normalizeArguments\"])(arguments),\n\t text = _normalizeArguments.text,\n\t options = _normalizeArguments.options,\n\t metadata = _normalizeArguments.metadata;\n\n\treturn Object(_findPhoneNumbers___WEBPACK_IMPORTED_MODULE_0__[\"default\"])(text, options, metadata);\n}", "function formatPhoneNumber(data) {\n let phoneNumberString = data['phone'];\n // returns the add student button if the space is available.\n if (phoneNumberString.includes('click')) {\n return '<button data-location=\"'+data['location']+'\" class=\"from_modal btn btn-success btn-sm\" data-toggle=\"modal\" data-target=\"#add_student_modal\">'\n + setIcons({icon_name: 'user-plus'})\n + phoneNumberString\n + '</button>';\n }\n let cleaned = ('' + phoneNumberString).replace(/\\D/g, '');\n // Blatantly took this from Stack Overflow.\n let match = cleaned.match(/^(\\d{3})(\\d{3})(\\d{4})$/);\n if (match) {\n return setIcons({icon_name: 'phone'}) + '(' + match[1] + ') ' + match[2] + '-' + match[3];\n }\n return null;\n}", "function createPhoneNumber(numbers){\n return \"(\" + numbers.slice(0,3).join(\"\") + \") \" + numbers.slice(3,6).join(\"\") + \"-\" + numbers.slice(6,10).join(\"\");\n}", "function validateNumber(phone, done) {\n // Require `PhoneNumberFormat`.\n var PNF = require('google-libphonenumber').PhoneNumberFormat;\n\n // Get an instance of `PhoneNumberUtil`.\n var phoneUtil = require('google-libphonenumber').PhoneNumberUtil.getInstance();\n\n // Parse number with country code.\n var phoneNumber = phoneUtil.parse(phone, 'US');\n\n var national_phone = phoneUtil.format(phoneNumber, PNF.NATIONAL);\n var international_phone = phoneUtil.format(phoneNumber, PNF.INTERNATIONAL);\n var E164_phone = phoneUtil.format(phoneNumber, PNF.E164);\n var phone_data = {};\n phone_data = {\n national_phone: national_phone,\n international_phone: international_phone,\n E164_phone: E164_phone\n }\n return done(phone_data);\n}", "function checkPhone(phone){\n\n \t\t//var dateofbirt=new Date($('#dateofbirth').val());\n var phone_number= $('#phone').val($('#phone').val().replace(/[^\\d].+/,''));\n //regex for the 2nd and 3rd number to not be 0\n \t\tvar regex= /^[0]\\d[1-9]{1}\\d[0-9]{6}$/;\n \t\t//variable to check that the phone starts with 0\n \t\tvar phone1=[]; \t\t\n\n \tfor (var i = 0; i < phone.length; i++) {\n \t\t//saving all the characters of phone as array in check variable\n \t\tphone1[i]=phone[i];\n \t} \n \n \t//test the length\n \t\tif (phone.length != 10) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n \t\t\treturn 'Phone Number must have exactly 10 numbers';\n\n \t\t}\n \n \t\t//check is it is a number\n \t\tif (!phone_number) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n \t\t\treturn 'Phone should only be number';\n \t\t}\n \t\t//check if it starts with zero\n \t\tif (phone1[0] != \"0\") {\n\n $('#phone_results').addClass('text-danger');\n return 'Phone Number must starts with zero(0)';\n }\n if (!regex.test(phone)) {\n\n \t\t\t$('#phone_results').addClass('text-danger');\n return '0 is ny allowed to be a second and third';\n \t\t}\n \t\t//everything is ok submit\n \t\tif(phone.length == 10 && phone_number){\n\t\t\t\n\t\t\treturn 'Correct';\n\t\t}\n\t}", "formatPhoneNumber(phoneNumberString) {\n\t\tlet cleaned = ('' + phoneNumberString).replace(/\\D/g, '');\n\t\tlet match = cleaned.match(/^(1|)?(\\d{3})(\\d{3})(\\d{4})$/);\n\t\tif (match) {\n\t\t\tlet intlCode = match[1] ? '+1 ' : '';\n\t\t\treturn [ intlCode, '(', match[2], ') ', match[3], '-', match[4] ].join('');\n\t\t}\n\t\treturn null;\n\t}", "formatPhoneNumber(phoneNumberString) {\n\t\tlet cleaned = ('' + phoneNumberString).replace(/\\D/g, '');\n\t\tlet match = cleaned.match(/^(1|)?(\\d{3})(\\d{3})(\\d{4})$/);\n\t\tif (match) {\n\t\t\tlet intlCode = match[1] ? '+1 ' : '';\n\t\t\treturn [ intlCode, '(', match[2], ') ', match[3], '-', match[4] ].join('');\n\t\t}\n\t\treturn null;\n\t}", "formatPhoneNumber(phoneNumberString) {\n\t\tlet cleaned = ('' + phoneNumberString).replace(/\\D/g, '');\n\t\tlet match = cleaned.match(/^(1|)?(\\d{3})(\\d{3})(\\d{4})$/);\n\t\tif (match) {\n\t\t\tlet intlCode = match[1] ? '+1 ' : '';\n\t\t\treturn [ intlCode, '(', match[2], ') ', match[3], '-', match[4] ].join('');\n\t\t}\n\t\treturn null;\n\t}", "getInternational() {\r\n return this.phoneNumber.replace(/^(0)(\\d{8,9})$/, '972$2');\r\n }", "function formSubmit(name, number) {\n const nameRegexp = /^[a-zA-Zа-яА-Я]+(([' -][a-zA-Zа-яА-Я ])?[a-zA-Zа-яА-Я]*)*$/;\n const numberRegexp = /(\\+?( |-|\\.)?\\d{1,2}( |-|\\.)?)?(\\(?\\d{3}\\)?|\\d{3})( |-|\\.)?(\\d{3}( |-|\\.)?\\d{4})/;\n nameRegexp.test(name) && numberRegexp.test(number)\n ? newContact(name, number)\n : alert(`Fill out the form correctly.`);\n }", "function customPhoneField() {\n\t\t\t$(\".gfield_list_8_cell1 input\").attr({\n\t\t\t\t'maxlength': '3',\n\t\t\t\t'type': 'tel'\n\t\t\t});\n\n\t\t\t$(\".gfield_list_8_cell2 input\").attr({\n\t\t\t\t'maxlength': '3',\n\t\t\t\t'type': 'tel'\n\t\t\t});\n\n\t\t\t$(\".gfield_list_8_cell3 input\").attr({\n\t\t\t\t'maxlength': '4',\n\t\t\t\t'type': 'tel'\n\t\t\t});\n\t\t}", "function createPhoneNumber(numbers) {\n if (numbers.length !== 10) {\n return\n }\n let string = numbers.toString().replace(/,/g, '')\n return (\n '(' +\n string.slice(0, 3) +\n ') ' +\n string.slice(3, 6) +\n '-' +\n string.slice(6 - 10)\n )\n}", "function GetPhoneNumber(number){\n var aux = number.trim();\n\n // checks if number stats with \"00\" and replaces by \"+\"\n if(aux.substring(0,2) == '00')\n aux = \"+\" + aux.substr(2); \n\n //checks if start \"+ \" (plus space) if so then its invalid or if its not a number (removing spaces)\n if(aux.substring(1,1) == ' ' || isNaN(aux.substr(1).replace(/\\s/g,'')))\n aux = undefined;\n else\n {\n // removes '+' sign and all spaces\n aux =aux.replace(/\\s/g,'');\n if (aux.substring(0,1) == '+') \n aux = (aux.substr(1)).replace(/\\s/g,'');\n }\n return aux;\n}", "function phonePlz() {\n var phone = document.getElementById(\"phone\").value;\n phone = Number(phone);\n if (isNaN(phone)){\n alert(\"Oh no! Plz enter a valid phone info with #'s only. Thank you fren!\")\n }\n}", "function createPhoneNumber(numbers) {\n return `(${numbers[0]}${numbers[1]}${numbers[2]}) ${numbers[3]}${numbers[4]}${numbers[5]}-${numbers[6]}${numbers[7]}${numbers[8]}${numbers[9]}`\n}", "function localPhoneNumberFormat() {\r\n var evt = window.event ;\r\n if (isOkKey(evt))\r\n return true;\r\n\r\n var val = evt.srcElement.value;\r\n var formattedPhoneNumber = \"\";\r\n var j = 0;\r\n for (i = 0; i < PHONENUMBER_FORMAT.length; i++) {\r\n if (PHONENUMBER_FORMAT.charAt(i) == \"#\") {\r\n if (j >= val.length)\r\n break;\r\n //if find a number or character\r\n if (isAlphanumeric(val.charAt(j), false)) {\r\n formattedPhoneNumber += val.charAt(j);\r\n // go to next character\r\n j++;\r\n } else {\r\n var k = 0;\r\n // find the next number or character\r\n for (k = j + 1; k < val.length; k++) {\r\n if (isAlphanumeric(val.charAt(k), false)) {\r\n formattedPhoneNumber += val.charAt(k);\r\n break;\r\n }\r\n }\r\n j = k + 1;\r\n }\r\n }else // display the custom format\r\n formattedPhoneNumber += PHONENUMBER_FORMAT.charAt(i);\r\n }\r\n evt.srcElement.value = formattedPhoneNumber;\r\n return true\r\n}", "function ValidateTelephoneNumbers(source, arguments) {\r\n var numberFields = jQuery(\"#serviceBooking\").find(\".stepContent\").find('input[data-class=\"pNumber\"]');\r\n arguments.IsValid = CheckNumberIsProvidedForServiceBookingEnterDetails(numberFields);\r\n}", "getPhone () {\n return this.text;\n }", "function PhoneNumberValidator(inputPhoneNumber){\n if(inputPhoneNumber[0] !== '0'){\n return 'Nomor Harus Diawali Dengan 0'\n } \n\n if(inputPhoneNumber.length >= 9 && inputPhoneNumber.length <= 12){\n for(let i = 0; i < inputPhoneNumber.length; i++){\n if(!(inputPhoneNumber[i] >= 0)){\n return 'Nomor Harus Berupa Angka'\n }else if(inputPhoneNumber[i] === ' '){\n return 'Nomor Tanpa Spasi'\n }\n }\n }else{\n return 'Nomor Harus 9-12 Digit'\n }\n\n return true\n}" ]
[ "0.7507974", "0.70680225", "0.68469536", "0.6824079", "0.6705782", "0.6692577", "0.6673758", "0.6673442", "0.66428596", "0.6575103", "0.6558079", "0.6489116", "0.64809525", "0.6477917", "0.6444942", "0.6418272", "0.63971", "0.63627505", "0.63482195", "0.63274384", "0.6323966", "0.63161975", "0.6283845", "0.6283558", "0.62813276", "0.62745416", "0.6252531", "0.6238348", "0.6191616", "0.61831844", "0.6167331", "0.6164143", "0.61611456", "0.614807", "0.61335284", "0.6132513", "0.61144483", "0.60987496", "0.6098457", "0.6076436", "0.60640514", "0.6046078", "0.6013809", "0.6012203", "0.59927523", "0.599229", "0.5992161", "0.5987076", "0.59610856", "0.59545124", "0.595451", "0.5945757", "0.59426427", "0.5942633", "0.59399474", "0.59316504", "0.59286594", "0.5923699", "0.59120274", "0.5896188", "0.5895113", "0.5892213", "0.5883616", "0.58807445", "0.5874429", "0.5870503", "0.58643", "0.58628637", "0.58596396", "0.5851586", "0.5835664", "0.5828854", "0.582608", "0.58115077", "0.5805331", "0.57990396", "0.57963413", "0.57962924", "0.5783709", "0.57820064", "0.578154", "0.5777873", "0.5776917", "0.57756567", "0.5771329", "0.5771071", "0.57688415", "0.57688415", "0.57688415", "0.5768272", "0.5762604", "0.5761728", "0.5755929", "0.5755135", "0.57533085", "0.57465816", "0.5744369", "0.573742", "0.5736496", "0.57333535" ]
0.66438663
8
Integration function for fax number of contact information
function contact_fax_number(input){ var result = new Object(); var error; result.flgname = []; result.flgs = []; result.flgvalue = []; result.flgmsg = []; result.pass = true; if (!check_allowed_char(input, "faxNum", "conf1")){ error = "E7_1" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if ( check_req_char(input, "faxNum", "conf1")){ error = "E42_3" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (!presence_check(input)){ error = "E42_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if(!length_field_check(input, "faxNum", "conf1")){ error = "E7_2" result.flgname.push(flags[error].name); result.flgs.push(flags[error].flag); result.flgvalue.push(flags[error].value); result.flgmsg.push(flags[error].msg); } if (result.flgname.length>0){ result.pass = false; } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function contact_fax_number(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\tif (!check_allowed_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif ( check_req_char(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E42_3\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E42_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\r\n\tif(!length_field_check(input, \"faxNum\", \"conf1\")){\r\n\t\terror = \"E7_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t}\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function IsValidUSFaxNumber(fax) {\n var pattern = new RegExp(/^(1\\s*[-\\/\\.]?)?(\\((\\d{3})\\)|(\\d{3}))\\s*[-\\/\\.]?\\s*(\\d{3})\\s*[-\\/\\.]?\\s*(\\d{4})\\s*(([xX]|[eE][xX][tT])\\.?\\s*(\\d+))*$/);\n return pattern.test(fax);\n}", "function onSuccess(contacts) {\n for (var i=0; i<contacts.length; i++) {\n \n if (contacts[i].phoneNumbers != null) {\n $.each(contacts[i].phoneNumbers, function(i ,v){\n $.each(v, function(e, f){\n \n\n if (e == 'value') {\n var number = f.replace(/-|\\s/g,\"\"); \n console.log(number);\n\n }\n });\n });\n \n \n }\n\n }\n }", "async function markContacts(count) {\t \r\n\t\tconsole.log(\"markContacts() begin\");\r\n\t\t\r\n\t\tawait page.goto('https://myaccount.metrofax.com/myaccount');\r\n\t\t\r\n\t\t// Open 'Send Fax' interface\r\n\t\tconst SEND_FAXES = '#sendfaxestab';\r\n\t\tawait page.click(SEND_FAXES);\r\n\r\n\t\t// Open Contacts list\r\n\t\tawait page.waitFor(3000);\t\t// Wait for load to disappear\r\n\t\tconst CHOOSE_CONTACTS_SELECTOR = '#websend_to > div.right > span.doneLoadingContacts > a';\r\n\t\tawait page.waitForSelector(CHOOSE_CONTACTS_SELECTOR);\r\n\t\tawait page.click(CHOOSE_CONTACTS_SELECTOR);\r\n\t\t\r\n\t\tconst result = await page.evaluate((config) => {\r\n\t\t\tlet row = document.querySelectorAll(\"#addressBook_grid .ui-widget-content.jqgrow.ui-row-ltr\");\r\n\t\t\tif(row.length < 1) {\t\t// Something went wrong! No names to select\r\n\t\t\t\tthrow \"row is undefined\";\r\n\t\t\t}\r\n\r\n\t\t\tlet selectItems = [];\t// Array to hold selectable items\r\n\r\n\t\t\tfor(let i = 0; i < row.length; i++) {\r\n\t\t\t\t// Filter to specified \"Company Name\"\r\n\t\t\t\tif(row[i].querySelector('[aria-describedby=\"addressBook_grid_company\"]').textContent.trim().toUpperCase() == config.company.toUpperCase()) {\r\n\t\t\t\t\tselectItems.push(\"#jqg_addressBook_grid_\" + row[i].id);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn selectItems;\r\n\t\t}, config);\t\t\r\n\t\t\r\n\t\tconsole.log(\"Total = \" + result.length + \"; count = \" + count);\r\n\t\t\r\n\t\t// Check if all faxes already sent\r\n\t\tif(count >= result.length) {\r\n\t\t\tconsole.log(\"No more contacts to send to.\");\r\n\t\t\tawait page.goto('https://myaccount.metrofax.com/myaccount');\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t\t\r\n\t\t// Limit the number of faxes per send\r\n\t\tlet limit = count + MAX_SEND;\r\n\t\t\r\n\t\tif(limit > result.length) {\r\n\t\t\tlimit = result.length;\r\n\t\t}\r\n\t\t\r\n\t\tconsole.log(\"limit = \" + limit);\r\n\r\n\t\t// Select contacts\r\n\t\tfor(; count < limit; count++) {\r\n\t\t\tconsole.log(\"Total = \" + result.length + \"; count = \" + count + \"; limit = \" + limit);\r\n\t\t\tawait page.click(result[count]);\r\n\t\t}\r\n\t\t\r\n\t\tconst ADD_SELECTOR = \"#addrbook_active_add_btn > div.btn_text\"\r\n\t\tawait page.waitForSelector(ADD_SELECTOR);\r\n\t\tawait page.click(ADD_SELECTOR);\r\n\t\t\r\n\t\tconsole.log(\"markContacts() done\");\r\n\t\t\r\n\t\treturn count;\r\n\t}", "function phoneNumber(no){\n\t\n}", "function extract_fax_info(sfax_response_obj){\n //var sfax_response_obj = JSON.parse('{\"inboundFaxItem\":{\"FaxId\":\"2190401201000980691\",\"Pages\":\"4\",\"ToFaxNumber\":\"18557916085\",\"FromFaxNumber\":\"5302731333\",\"FromCSID\":\"2731333\",\"FaxDateUtc\":\"4/1/2019 8:10:18 PM\",\"FaxSuccess\":\"1\",\"Barcodes\":{\"FirstBarcodePage\":1,\"TotalPagesWithBarcodes\":1,\"PagesWithBarcodes\":[1],\"BarcodeItems\":[{\"BarcodeSpacingXAxis\":0,\"BarcodeSpacingYAxis\":0,\"BarcodeType\":0,\"BarcodeMode\":1,\"BarcodeData\":\"9612019971424215517488\",\"BarcodeX\":157,\"BarcodeY\":1773,\"BarcodePage\":1,\"BarcodeScale\":0,\"BarcodeWidth\":684,\"BarcodeHeight\":303},{\"BarcodeSpacingXAxis\":0,\"BarcodeSpacingYAxis\":0,\"BarcodeType\":0,\"BarcodeMode\":1,\"BarcodeData\":\"[)>010295112840019971424215517488FDEB97142420501/12.0LBN725 E. Santa Clara Street, Ste 202San JoseCA 0610ZGD00811ZBetter Health Pharmacy12Z650488743423ZN22ZN20Z 028Z97142421551748831Z 33Z 34Z019KD261R818T33379P26Z1891\",\"BarcodeX\":116,\"BarcodeY\":1455,\"BarcodePage\":1,\"BarcodeScale\":0,\"BarcodeWidth\":556,\"BarcodeHeight\":245}]},\"InboundFaxId\":\"2190401201000980691\",\"FaxPages\":\"4\",\"FaxDateIso\":\"2019-04-01T20:10:18Z\",\"WatermarkId\":\"2190401201018997198\",\"CreateDateIso\":\"2019-04-01T20:10:18.1207720Z\"},\"isSuccess\":true,\"message\":null}')\n\n var res = {}\n \n if(!sfax_response_obj['inboundFaxItem']) return sfax_response_obj //if it's an error, then just return original content\n \n //debugEmail('SFax Response to Query about Inbound details', JSON.stringify(sfax_response_obj))\n \n res['faxPages'] = sfax_response_obj['inboundFaxItem']['FaxPages']\n res['faxSuccess'] = sfax_response_obj['inboundFaxItem']['FaxSuccess']\n var barcodes = sfax_response_obj['inboundFaxItem']['Barcodes']['BarcodeItems']\n var tracking_nums = []\n var rx = /971424215(\\d{6})/\n for(var i = 0; i < barcodes.length; i++){\n var parsed = barcodes[i]['BarcodeData'].toString().match(rx)\n if(parsed) tracking_nums.push(parsed[0].toString())\n }\n res['tracking_nums'] = \"\" + tracking_nums\n Logger.log(res)\n return res\n}", "function recalculateTax4Invoice()\n{\n if(document.getElementById('0-1001:0-1101-6301'))\n\t{\n\tfor (var k=0;k<=25;k++) \n\t{\n\t\tvar extndAmt=0;\n\t\tif(document.getElementById('0-1001:'+k+'-1101-1127') && document.getElementById('0-1001:'+k+'-1101-1127').value!=\"\")\n\t\t{\n\t\t\ttoGetTaxValues(k);\n\t\t\tshowPrice(k)\n\t\t}\n\t}\n\t}\n}", "function faxValidate(){\n var faxVal = document.getElementById(\"fax\").value;\n var err = document.getElementById('fax_error');\n\n // Allow blank value\n if (faxVal == \"\")\n {\n err.style=\"display:none\"; \n return true;\n }\n\n var phoneregex = /\\d{3}-\\d{3}-\\d{4}/;\n\n if(faxVal.length == 10){\n faxVal = faxVal.substr(0,3) + '-' + faxVal.substr(3,3) + '-' + faxVal.substr(6);\n document.getElementById(\"fax\").value = faxVal;\n }\n\n if(phoneregex.test(faxVal)){\n err.style=\"display:none\"; \n\n return true;\n }else{\n err.style=\"display:block\"; \n return false;\n }\n}", "function callContact(){\n\t\n\t/**\n\t * Appcelerator Analytics Call\n\t */\n\tTi.Analytics.featureEvent(Ti.Platform.osname+\".profile.callContactButton.clicked\");\n\t\n\t/**\n\t * Before we send the phone number to the platform for handling, lets first verify\n\t * with the user they meant to call the contact with an Alert Dialog\n\t * DOCS: http://docs.appcelerator.com/platform/latest/#!/api/Titanium.UI.AlertDialog\n\t */\n\tvar dialog = Ti.UI.createAlertDialog({\n\t cancel: 0,\n\t buttonNames: ['Cancel', 'Ok'],\n\t message: \"Are you sure you want to call \"+_args.firstName+\" at \"+_args.phone\n\t});\n\t\n\t/**\n\t * Event Handler associated with clicking the Alert Dialog, this handles the \n\t * actual call to the platform to make the phone call\n\t */\n\tdialog.addEventListener('click', function(e){\n\t\t if (e.index !== e.source.cancel){\n\t \n\t \t// IF WE ARE BUILDING FOR DEVELOPMENT PURPOSES - TRY CALLING A FAKE NUMBER\n\t \tif(ENV_DEV){\n\t \t\tTi.Platform.openURL(\"tel:+15125551212\");\n\t \t}\n\t \t// ELSE IF WE ARE BUILDING PRODUCTION - THEN USE THE LISTED NUMBER\n\t \telse if(ENV_PRODUCTION){\n\t \t\tTi.Platform.openURL(\"tel:\"+_args.phone);\n\t \t}\n\t } \n\t});\n\t\n\t/**\n\t * After everything is setup, we show the Alert Dialog to the User\n\t */\n\tdialog.show();\n\t \n}", "function validateFax(input) {\r\n\t\t$('div[id=invalid_fax]').remove();\r\n\t\tif (!isPhoneOrFaxNo(input)) {\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"POST\",\r\n\t\t\t\turl : \"logic/process_inputcheck.php\",\r\n\t\t\t\tdata : {\r\n\t\t\t\t\taction : \"get_message_invalid_fax\"\r\n\t\t\t\t}\r\n\t\t\t}).done(function(msg) {\r\n\t\t\t\t$('#invalid_fax').remove();\r\n\t\t\t\t$('#messagearea').append(msg);\r\n\t\t\t\t$('html, body').animate({\r\n\t\t\t\t\tscrollTop : $('#messagearea').offset().top\r\n\t\t\t\t}, 600);\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$('div[id=invalid_fax]').remove();\r\n\t\t}\r\n\t}", "function getcontact(name ,number)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.GetContact(name, number);\n}", "function directBasedOnNum(reference) {\n\n\n\tconsole.log('name: ' + slotValue_companyName); \n\tconsole.log('country: ' + slotValue_country); \n\tconsole.log('region: ' + slotValue_region); \n\tconsole.log('content: '+ slotValue_certificationScenario); \n\tconsole.log('date: '+ slotValue_date); \n\t// console.log('solution: '+ slotValue_solution); \n\n\n\tvar query = format.queryToURLForm(slotValue_companyName, slotValue_country, slotValue_region, slotValue_certificationScenario, slotValue_date); \n\n\trequest.requestGetNum(query, function(response) { \n\n\t\tvar total = response.results.total; \n\t\tvar successful = response.results.successful; \n\t\tvar inProgress = response.results.inProgress; \n\n\t\tvar outputText = ''; \n\n\t\t// var numResults = output; \n\n\t\t// if 0 results found \n\t\tif (total === 0) { \n\n\t\t/*\texpand results unabled \n\n\t\t// zero results, country given\n\t\tif (slotValue_country !== null) { \n\n\t\t\t\t// attempt to offer to expand results in entire region - unabled \n\n\t\t\t\t// nullify current slotValue_country and run search in region \n\t\t\t\t// var URL = hostNum + format.queryToURLForm(slotValue_name, null, global_region, slotValue_content, slotValue_date, slotValue_solution); \n\n\t\t\t\t//var URL = hostNum + format.queryToURLForm(slotValue_name, null, global_region, slotValue_content, slotValue_date); \n\n\t\t\t\tvar query_2 = format.queryToURLForm(slotValue_name, null, global_region, slotValue_content, slotValue_date); \n\n \t\t\t//Request(URL, function(response) { \n\n \t\t\trequest.requestGetNum(query_2, function(response) { \n\n\t\t\t\t\tvar outputText_noResults = 'No results found for ' + format.formatQuery(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date) + '. You can start over by saying start over or say cancel to cancel.' \n\t\t\t\t\tvar outputText_offerExpand = 'No results found for ' + format.formatQuery(slotValue_name, slotValue_country, slotValue_region, slotValue_content, slotValue_date) + '. Would you like to search in the region?'; \n\n\t\t\t\t\tvar total = response.results.total; \n\n\t\t\t\t\t// if results in region \n\t\t\t\t\tif (total > 0) { \n\n\t\t\t\t\t\treference.handler.state = states.EXPAND_SEARCH; \n\t\t\t\t\t\treference.emit(':ask', outputText_offerExpand, outputText_offerExpand); \n\n\t\t\t\t\t}\n\n\t\t\t\t\t// if no results in region \n\t\t\t\t\telse { \n\n\t\t\t\t\t\treference.handler.state = states.NO_RESULTS; \n\t\t\t\t//\t\treference.emit(':ask', outputText_noResults, outputText_noResults); \n\t\t\t\t\t\treference.emit(':ask', updated_noResults(), againNoResults); \n\n\t\t\t\t\t}\n\n\t\t\t\t}); \n\n\t\t\t//\tvar expandQuery = 'No results found for ' + format.formatQuery() + '. Would you like to search in the region?'; \n\t\t\t//\treference.handler.state = states.EXPAND_SEARCH; \n\t\t\t//\treference.emit(':ask', expandQuery, expandQuery); \n\n\t\t\t} \n\n\t\t\telse { \n\n\t\t\t\treference.handler.state = states.NO_RESULTS; \n\t\t\t\treference.emit(':ask', updated_noResults(), againNoResults); \n\n\t\t \t} \n\n\n\n\t\t \t*/ \n\n\n\t\t\t\treference.handler.state = states.NO_RESULTS; \n\t\t\t\treference.emit(':ask', updated_noResults(), againNoResults); \n\n\n\t\t}\n\n\t\t// if 1 result found \n\t\telse if (total === 1) { \n\t\t\treference.handler.state = states.ONE_RESULT;\n\t\t\treference.emit(':ask', updated_oneResult(), againOneResult);\n\n\t\t} \n\n\t\t// multiple results found \n\t\telse {\n\n\t\t\t// would you like to narrow down answers \n\t\t\treference.handler.state = states.MULTIPLE_RESULTS; \n\n\t\t\t// if within threshold\n\t\t\tif (total <= resultThreshold) { \n\t\t\t\treference.emit(':ask', updated_moreResults(total, successful, inProgress), updated_againMoreResults(total)); \n\t\t\t}\n\n\t\t\t// if above threshold \n\t\t\telse { \n\t\t\t\treference.emit(':ask', updated_moreThanThreshold(total, successful, inProgress), updated_againMoreThanThreshold(total)); \n\n\t\t\t}\n\t\t\n\n\t\t\t// ------------------------------------------------------------- WOULD THIS WORK?????? --------------------------------------------------------------------\n//\t\t\temitMoreResults(reference); \n\t\t\t// var outputText = numResults + ' results found for ' + format.formatQuery() + '. Continue selecting?'; \n\t\t\t//reference.emit(':ask', updated_moreResults(total, successful, inProgress), updated_againMoreResults(total)); \n\n\t\t\t} \n\n\t }); \n\n\t//\tvar numResults = getNumResults(); \n\t//\tvar query = format.formatQuery();\n\n\n}", "function getFeebonachi(index, number) {\n if(typeof index===\"undefined\" || number !==\"undefined\"){\nlet sum = 0;\nlet feebo = getClouserFeebo(1, number);\n\n\n };\n if(typeof number===\"undefined\" || index!==\"undefined\"){\nreturn getFeeboByIndex(index);\n };\n if(index===\"undefined\" || number ===\"undefined\"){\n return false;\n }\n\n\n}", "function get_barcode_info(fax_id,api_key,token){\n var url = \"https://api.sfaxme.com/api/InboundFaxInfo?token=\" + encodeURIComponent(token) + \"&apikey=\" + encodeURIComponent(api_key) + \"&FaxId=\" + encodeURIComponent(fax_id)\n try{\n var res = JSON.parse(UrlFetchApp.fetch(url).getContentText())\n return extract_fax_info(res)\n } catch(err){\n return err\n }\n}", "function calculate() { \r\n\tnumber1 = Number(document.getElementById('number1').value);\r\n\tconsole.log(number1);\r\n\tif (number1 <= 47630) {\r\n\t\tfederalTax = (number1 - 0) * 0.15 + 0;\r\n\t\tconsole.log(federalTax);\r\n\t} else if (number1 > 47630 && number1 <= 95259) {\r\n\t\tfederalTax = (number1 - 47630) * 0.205 + 7145;\r\n\t} else if (number1 > 95259 && number1 <= 147667) {\r\n\t\tfederalTax = (number1 - 95259) * 0.26 + 16908;\r\n\t} else if (number1 > 147667 && number1 <= 210371) {\r\n\t\tfederalTax = (number1 - 147667) * 0.29 + 30535;\r\n\t} else if (number1 > 210371) {\r\n\t\tfederalTax = (number1 - 210371) * 0.33 + 48719;\r\n\t}\t\r\n\tdocument.getElementById(\"output\").value = federalTax;\r\n\treturn federalTax;\r\n}", "function sabrixAfterSubmit(eventtype) {\n\ttry {\n\t\tvar callsabrix = 0;\n\t\tif(eventtype == 'create' || eventtype == 'edit') {\n\t\t\t\n\t\t\tvar rec = nlapiLoadRecord(nlapiGetRecordType(),nlapiGetRecordId());\n\t\t\t//Do No calculate Tax\n\t\t\tvar donotcalculatetax = rec.getFieldValue('custbody_spk_donotcalculatetax');\n\t\t\tif(donotcalculatetax == 'T') {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tcallsabrix = 1;\n\t\t\tvar string1;\n\t\t\tstring1 = '{ ';\n\t\t\t\n\t\t\tvar shiptoCustId = rec.getFieldValue('custbody_end_user');\n\t\t\tvar CustomerId = rec.getFieldValue('entity');\n\t\t\tvar ShipToCustomerId = rec.getFieldValue('custbody_spk_shiptocustomerid');\n\t\t\tvar ShipToCustomerName = rec.getFieldValue('custbody_spk_shiptocustomername');\n\t\t\tif(ShipToCustomerName) {\n\t\t\t\tShipToCustomerName = escapeChar(rec.getFieldValue('custbody_spk_shiptocustomername'));\n\t\t\t}\n\t\t\tvar CustomerCode = rec.getFieldValue('custbody_spk_billtocustomerid');\n\t\t\tvar CustomerName = rec.getFieldValue('custbody_spk_billtocustomername');\n\t\t\tif(CustomerName) {\n\t\t\t\tCustomerName = escapeChar(rec.getFieldValue('custbody_spk_billtocustomername'));\n\t\t\t}\n\t\t\t\n\t\t\tvar createdfrom = rec.getFieldValue('createdfrom');\n\t\t\tnlapiLogExecution('DEBUG','createdfrom',createdfrom);\n\t\t\n\t\t\tvar ExemptionNo = rec.getFieldValue('tranid');\n\n\t\t\tvar FxRate = rec.getFieldValue('exchangerate');\n\t\t\t//For Non-US country, we need to consider Customer Registration Number for VAT calculation\n\t\t\tvar CustomerRegistrationNumber = \"\";\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tvar AddressCode1 = \"01\";\n\t\t\tvar subsidiary = rec.getFieldValue('subsidiary');\n\t\t\tvar sub = rec.getFieldValue('custbody_spk_entity_address'); // TAX ENTITY ADDRESS\n\t\t\tvar subrec = sub.split('|');\n\t\t\tvar subcity = subrec[0];\n\t\t\tvar subregion = subrec[1];\n\t\t\tvar subcountry = subrec[2];\n\t\t\tvar subprovince = '';\n\t\t\tvar subcode = subrec[3];\n\t\t\tvar subcurrency = \"USD\" ; //subrec.getFieldValue('currency');\n\t\t\tnlapiLogExecution('DEBUG','subcity :'+subcity,' subregion :'+subregion+ ' subcountry :'+subcountry+ ' subprovince :'+subprovince+ ' subcode '+subcode );\n\t\t\t\n\t\t\t//Ship TO : Customer/Invoice Shipping Address\n\t\t\tvar AddressCode2 = \"02\";\n\t\t\tvar shipaddress = rec.getFieldValue('shipaddress');\n\t\t\tvar shiptocity = '';\n\t\t\tvar shiptoregion = '';\n\t\t\tvar shiptocountry = '';\n\t\t\tvar shiptocode = '';\n\t\t\tvar shiptoprovince = '';\n\t\t\tshiptocity = rec.getFieldValue('shipcity');\n\t\t\tshiptoregion = rec.getFieldValue('shipstate');\n\t\t\tshiptocountry = rec.getFieldValue('shipcountry');\n\t\t\tshiptocode = rec.getFieldValue('shipzip');\n\t\t\tnlapiLogExecution('DEBUG','shiptocity1 :'+shiptocity,' shiptoregion :'+shiptoregion+ ' shiptocountry :'+shiptocountry+ ' shiptocode :'+shiptocode+ ' shiptoprovince '+shiptoprovince );\n\t\t\t\n\t\t\tvar CompanyCode = rec.getFieldValue('custbody_spk_subsidiary_code');\n\t\t\tif(CompanyCode) {\n\t\t\t\tCompanyCode = CompanyCode;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tCompanyCode = rec.getFieldValue('subsidiary');\n\t\t\t}\n\t\t\tif(CompanyCode) { CompanyCode = '\"'+CompanyCode+'\"';}\n\t\t\telse { CompanyCode = '\"\"'; }\n\t\t\tstring1+= '\"CompanyCode\": ' +CompanyCode;\n\t\t\t\n\t\t\tvar CompanyRole = \"S\";\n\t\t\tif(CompanyRole) { CompanyRole = '\"'+CompanyRole+'\"';}\n\t\t\telse { CompanyRole = '\"\"'; }\n\t\t\tstring1+= ', \"CompanyRole\": ' +CompanyRole;\n\n\t\t\tif (ShipToCustomerId) { ShipToCustomerId = '\"'+ShipToCustomerId+'\"'; }\n\t\t\telse { ShipToCustomerId = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerId\": ' +ShipToCustomerId;\n\n\t\t\tif (ShipToCustomerName) { ShipToCustomerName = '\"'+ShipToCustomerName+'\"'; }\n\t\t\telse { ShipToCustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"ShipToCustomerName\": ' +ShipToCustomerName;\n\t\t\t\n\t\t\tvar DocType = nlapiGetRecordType();\n\t\t\tif (DocType) { DocType = '\"'+DocType+'\"'; }\n\t\t\telse { DocType = '\"\"'; }\n\t\t\tstring1+= ', \"DocType\": ' +DocType;\n\t\t\t\n\t\t\tif (CustomerCode) { CustomerCode = '\"'+CustomerCode+'\"'; }\n\t\t\telse { CustomerCode = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerCode\": ' +CustomerCode;\n\n\t\t\tif (CustomerName) { CustomerName = '\"'+CustomerName+'\"'; }\n\t\t\telse { CustomerName = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerName\": ' +CustomerName;\n\t\t\t\n\t\t\tvar DocDateold = rec.getFieldValue('trandate');\n\t\t\tvar DocDate = '';\n\t\t\tif(DocDateold){\n\t\t\t\tvar docdatesplit = DocDateold.split(\"/\");\n\t\t\t\tDocDate = docdatesplit[2]+\"-\"+docdatesplit[0]+\"-\"+docdatesplit[1];\n\t\t\t}\n\t\t\tif (DocDate) { DocDate = '\"'+DocDate+'\"'; }\n\t\t\telse { DocDate = '\"\"'; }\n\t\t\tstring1+= ', \"DocDate\": ' +DocDate;\n\t\t\t\n\t\t\t//Fiscal Date is same as DocDate\n\t\t\tstring1+= ', \"FiscalDate\": '+DocDate;\n\t\t\t\n\t\t\tvar Client = \"NetSuite\";\n\t\t\tif (Client) { Client = '\"'+Client+'\"'; }\n\t\t\telse { Client = '\"\"'; }\n\t\t\tstring1+= ', \"Client\": ' +Client;\n\t\t\t\n\t\t\t// Invoice Number\n\t\t\tvar DocCode = rec.getFieldValue('tranid'); \n\t\t\tif (DocCode) { DocCode = '\"'+DocCode+'_'+nlapiGetRecordType()+'\"'; }\n\t\t\telse { DocCode = '\"\"'; }\n\t\t\tstring1+= ', \"DocCode\": ' +DocCode;\n\t\t\t\n\t\t\tvar Discount = rec.getFieldValue('discounttotal');\n\t\t\tif (Discount) { Discount = '\"'+Discount+'\"'; }\n\t\t\telse { Discount = '\"0\"'; }\n\t\t\tstring1+= ', \"Discount\": ' +Discount;\n\t\t\t\n\t\t\tvar CurrencyCode = subcurrency;\n\t\t\tif (CurrencyCode) { CurrencyCode = '\"'+CurrencyCode+'\"'; }\n\t\t\telse { CurrencyCode = '\"\"'; }\n\t\t\tstring1+= ', \"CurrencyCode\": ' +CurrencyCode;\n\t\t\t\n\t\t\t//After Submit set Is committed to Yes, so that the Unique TranId is created and submitted in Sabrix\n\t\t\tvar IsAudited = \"commit\";\n\t\t\tstring1+= ', \"IsCommit\": ' +'\"Y\"';\n\t\t\t\n\t\t\tvar OriginalInvoiceNumber = '';\n\t\t\tvar OriginalInvoiceDate = '';\n\t\t\tnlapiLogExecution('DEBUG', 'createdfrom1 '+createdfrom, 'DocType ' +DocType);\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\n\t\t\t\tvar refundRec = '';\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'creditmemo') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('invoice', createdfrom);\n\t\t\t\t}\n\t\t\t\tif(createdfrom && nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\trefundRec = nlapiLoadRecord('cashsale', createdfrom);\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'refundRec ' +refundRec);\n\t\t\t\tif(refundRec) {\n\t\t\t\t\tOriginalInvoiceNumber = refundRec.getFieldValue('tranid');\n\t\t\t\t\tvar orgtranDate = refundRec.getFieldValue('trandate');\n\t\t\t\t\tnlapiLogExecution('DEBUG', 'createdfrom '+createdfrom, 'OriginalInvoiceNumber ' +OriginalInvoiceNumber+ ' orgtranDate '+orgtranDate);\n\t\t\t\t\tif(orgtranDate) {\n\t\t\t\t\t\tvar orgtranDateSplit = orgtranDate.split(\"/\");\n\t\t\t\t\t\tvar OrgInvDate = orgtranDateSplit[2]+\"-\"+orgtranDateSplit[0]+\"-\"+orgtranDateSplit[1];\n\t\t\t\t\t\tOriginalInvoiceDate = OrgInvDate;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (OriginalInvoiceNumber) { OriginalInvoiceNumber = '\"'+OriginalInvoiceNumber+'\"'; }\n\t\t\telse { OriginalInvoiceNumber = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceNumber\": ' +OriginalInvoiceNumber;\n\t\t\t\n\t\t\tif (OriginalInvoiceDate) { OriginalInvoiceDate = '\"'+OriginalInvoiceDate+'\"'; }\n\t\t\telse { OriginalInvoiceDate = '\"\"'; }\n\t\t\tstring1+= ', \"OriginalInvoiceDate\": ' +OriginalInvoiceDate;\n\t\t\t\n\t\t\tvar InvoiceCurrency = rec.getFieldText('currency');\n\t\t\tif (InvoiceCurrency) { InvoiceCurrency = '\"'+InvoiceCurrency+'\"'; }\n\t\t\telse { InvoiceCurrency = '\"\"'; }\n\t\t\tstring1+= ', \"InvoiceCurrency\": ' +InvoiceCurrency;\n\t\t\t\n\t\t\tif (FxRate) { FxRate = '\"'+FxRate+'\"'; }\n\t\t\telse { FxRate = '\"\"';}\n\t\t\tstring1+= ', \"FxRate\": ' +FxRate;\n\t\t\t\n\t\t\tvar InvoiceAmount = rec.getFieldValue('subtotal');\n\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\tInvoiceAmount = parseFloat(InvoiceAmount * -1);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tInvoiceAmount = InvoiceAmount;\n\t\t\t}\n\t\t\tif (InvoiceAmount) { InvoiceAmount = '\"'+InvoiceAmount+'\"'; }\n\t\t\telse { InvoiceAmount = '\"0\"'; }\n\t\t\tstring1+= ', \"InvoiceAmount\": ' +InvoiceAmount;\n\t\t\t\n\t\t\tif (CustomerRegistrationNumber){ CustomerRegistrationNumber = '\"'+CustomerRegistrationNumber+'\"'; }\n\t\t\telse { CustomerRegistrationNumber = '\"\"'; }\n\t\t\tstring1+= ', \"CustomerRegistrationNumber\": ' +CustomerRegistrationNumber;\n\t\t\t\n\t\t\tstring1+= ', \"Addresses\": [{ '\n\t\t\t\n\t\t\t//Ship From : Subsidiary Address\n\t\t\tif (AddressCode1){ AddressCode1 = '\"'+AddressCode1+'\"'; }\n\t\t\telse{ AddressCode1 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode1;\n\t\t\t\t\n\t\t\tif (subcity){ subcity = '\"'+subcity+'\"'; }\n\t\t\telse{ subcity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +subcity;\n\t\t\t\n\t\t\tif (subregion){ subregion = '\"'+subregion+'\"'; }\n\t\t\telse{ subregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +subregion;\n\t\t\t\n\t\t\tif (subcountry){ subcountry = '\"'+subcountry+'\"'; }\n\t\t\telse { subcountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +subcountry;\n\t\t\t\n\t\t\tif (subcode){ subcode = '\"'+subcode+'\"'; }\n\t\t\telse { subcode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +subcode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\t\t\tstring1+= ' }, { '\n\t\t\t\n\t\t\t//Ship To : Invoice shipping Address\n\t\t\tif (AddressCode2){ AddressCode2 = '\"'+AddressCode2+'\"'; }\n\t\t\telse{ AddressCode2 = '\"\"'; }\n\t\t\tstring1+= '\"AddressCode\": ' +AddressCode2;\n\t\t\t\n\t\t\tif (shiptocity){ shiptocity = '\"'+shiptocity+'\"'; }\n\t\t\telse{ shiptocity = '\"\"'; }\n\t\t\tstring1+= ', \"City\": ' +shiptocity;\n\t\t\t\n\t\t\tif (shiptoregion){ shiptoregion = '\"'+shiptoregion+'\"'; }\n\t\t\telse{ shiptoregion = '\"\"'; }\n\t\t\tstring1+= ', \"Region\": ' +shiptoregion;\n\t\t\t\n\t\t\tif (shiptocountry){ shiptocountry = '\"'+shiptocountry+'\"'; }\n\t\t\telse{ shiptocountry = '\"\"'; }\n\t\t\tstring1+= ', \"Country\": ' +shiptocountry;\n\t\t\t\n\t\t\tif (shiptocode){ shiptocode = '\"'+shiptocode+'\"'; }\n\t\t\telse { shiptocode = '\"\"'; }\n\t\t\tstring1+= ', \"PostalCode\": ' +shiptocode;\n\t\t\t\n\t\t\tstring1+= ', \"Province\": \"\" ' ;\n\n\t\t\tstring1+= ' }], \"Lines\": [';\n\t\t\t//Tax calls should be made for rebillable expense invoices , checking item count- if zero then do not call sabrix request : Begin\n\t\t\tvar count = rec.getLineItemCount('item');\n\t\t\tif(count == 0 ) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t} // End\n\t\t\telse {\n\t\t\t\tvar isin = 0;\n\t\t\t\tfor(i = 1;i < count+1; i++) {\n\t\t\t\t\tvar TaxCode = rec.getLineItemText('item','taxcode',i);\n\t\t\t\t\t// ENHC0051967- Dynamic validation of script parameters for tax codes editable - Begin\n\t\t\t\t\tvar isparamtaxcode = 0;\n\t\t\t\t\tif(sabrixTaxcode) {\n\t\t\t\t\t\tvar paramTaxcode = sabrixTaxcode.split(\",\");\n\t\t\t\t\t\tfor(var y = 0; y<=paramTaxcode.length; y++) {\n\t\t\t\t\t\t\tif(TaxCode == paramTaxcode[y]) {\n\t\t\t\t\t\t\t\tisparamtaxcode = 1;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// ENHC0051967- End\n\t\t\t\t\t//nlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' paramAvatax '+paramAvatax+ 'paramSabtax '+paramSabtax );\n\t\t\t\t\tnlapiLogExecution('DEBUG','TaxCode '+TaxCode, ' sabrixTaxcode '+sabrixTaxcode+ ' isparamtaxcode '+isparamtaxcode);\n\t\t\t\t\tvar ItemCodevalue = rec.getLineItemText('item','item',i);\n\t\t\t\t\tvar itemintId = rec.getLineItemValue('item','item',i);\n\t\t\t\t\tvar ItemCode = '';\n\t\t\t\t\tif(ItemCodevalue) {\n\t\t\t\t\t\tvar ItemCodeId = ItemCodevalue.split(\":\")[1];\n\t\t\t\t\t\tif(ItemCodeId) {\n\t\t\t\t\t\t\tItemCode = ItemCodeId;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tItemCode = ItemCodevalue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tvar istax = '';\n\t\t\t\t\tif (ItemCode != \"Description\" && isparamtaxcode == 1 ) {\n\t\t\t\t\t\tvar CommodityCode = rec.getLineItemValue('item','custcol_spk_commodity_taxcode',i);\n\t\t\t\t\t\tvar AccountingCode = rec.getLineItemValue('item','custcol_spk_itemincomeaccnum',i);\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CommodityCode',CommodityCode);\n\t\t\t\t\t\tvar BundleFlag = rec.getLineItemValue('item','custcol_bundle',i);\n\t\t\t\t\t\tvar BaseBundleCode = rec.getLineItemValue('item','custcol_spk_basebundlecode',i);\n\t\t\t\t\t\tvar Description = rec.getLineItemValue('item','description',i);\n\t\t\t\t\t\tif(Description) {\n\t\t\t\t\t\t\tDescription = escapeChar(rec.getLineItemValue('item','description',i));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tvar Qty = rec.getLineItemValue('item','quantity',i);\n\t\t\t\t\t\tvar Amount = rec.getLineItemValue('item','amount',i);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar UOM = \" \";\n\t\t\t\t\t\tif(isin == 1) {\n\t\t\t\t\t\tistax = ' ,{ ';\n\t\t\t\t\t\t}else {\n\t\t\t\t\t\t\tistax = ' { ';\n\t\t\t\t\t\t}\n\t\t\t\t\t\tisin = 1;\n\t\t\t\t\t\tvar LineNo = '\"'+i+'\"';\n\t\t\t\t\t\tstring1+= istax+'\"LineNo\": ' +LineNo;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (AccountingCode){ AccountingCode = '\"'+AccountingCode+'\"'; }\n\t\t\t\t\t\telse{ AccountingCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"AccountingCode\": ' +AccountingCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (CommodityCode){ CommodityCode = '\"'+CommodityCode+'\"'; }\n\t\t\t\t\t\telse{ CommodityCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"TaxCode\": ' +CommodityCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (ItemCode){ ItemCode = '\"'+ItemCode+'\"'; }\n\t\t\t\t\t\telse{ ItemCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"ItemCode\": ' +ItemCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BundleFlag == 'T') { BundleFlag = '\"Yes\"'; }\n\t\t\t\t\t\telse { BundleFlag = '\"No\"'; }\n\t\t\t\t\t\tstring1+= ', \"BundleFlag\": ' +BundleFlag;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (BaseBundleCode){ BaseBundleCode = '\"'+BaseBundleCode+'\"'; }\n\t\t\t\t\t\telse{ BaseBundleCode = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"BaseBundleCode\": ' +BaseBundleCode;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (Description){ Description = '\"'+Description+'\"'; }\n\t\t\t\t\t\telse{ Description = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"Description\": ' +Description;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(Qty){ Qty = '\"'+Qty+'\"'; }\n\t\t\t\t\t\telse{ Qty = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Qty\": ' +Qty;\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar sfdcunitCost = rec.getLineItemValue('item','custcol_spk_sfdc_unit_cost',i);\n\t\t\t\t\t\tif(sfdcunitCost) {\n\t\t\t\t\t\t\tAmount = parseFloat(sfdcunitCost*Qty);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\tAmount = parseFloat(Amount * -1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tAmount = Amount;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (Amount){ Amount = '\"'+Amount+'\"'; }\n\t\t\t\t\t\telse { Amount = '\"0\"'; }\n\t\t\t\t\t\tstring1+= ', \"Amount\": ' +Amount;\n\t\t\t\t\t\t\n\t\t\t\t\t\tstring1+= ', \"DiscountAmount\": \"0\" ';\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (UOM){ UOM = '\"'+UOM+'\"'; }\n\t\t\t\t\t\telse{ UOM = '\"\"'; }\n\t\t\t\t\t\tstring1+= ', \"UOM\": ' +UOM;\n\t\t\t\t\t\tstring1 = string1 + '}';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tstring1+= ']}'\n\t\t\t\n\t\t\tvar isSabrixError = rec.getFieldValue('custbody_spk_sabrixtaxerrorflag');\n\t\t\tvar traninternalId = ''\n\t\t\tnlapiLogExecution('DEBUG','String1',string1);\n\t\t\t\n\t\t\t//On edit call Sabrix Request to calculate tax only if certain fields are changed\n\t\t\tif(eventtype == 'edit') {\n\t\t\t\tcallsabrix = changeinFields(rec);\n\t\t\t\tif(isSabrixError == 'T') {\n\t\t\t\t\tcallsabrix = 1;\n\t\t\t\t}\n\t\t\t\tnlapiLogExecution('DEBUG','callsabrix',callsabrix);\n\t\t\t}\n\t\t\tif(DocType == 'invoice' && count == 0) {\n\t\t\t\tcallsabrix = 0;\n\t\t\t}\n\t\t\t if(callsabrix == 1) {\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Request', new Date());\n\t\t\t\t//var sabrixurl = \"https://leadtoordersabrixstg.cloudhub.io/api/sabrix/calculateSalesTax\";\n\t\t\t\t//var authorizationHeader = 'Basic Y29yZXN2Y3VzZXI6Y29yZXN2Y3B3ZCEy';\t\t\n\t\t\n\t\t\t\tnlapiLogExecution('DEBUG','Auth Key '+authorizationHeader,' sabrixurl '+sabrixurl);\n\t\t\t\tvar header = new Array();\n\t\t\t\theader['Authorization'] = authorizationHeader;\n\t\t\t\theader['Accept'] = 'application/json';\n\t\t\t\theader['Content-Type'] = 'application/json';\n\t\t\t\tvar response = nlapiRequestURL(sabrixurl,string1,header,'POST');\n\t\t\t\tnlapiLogExecution('DEBUG','Response',response.getCode()+':::'+response.getBody());\n\t\t\t\tnlapiLogExecution('DEBUG','After Submit current time Sabrix Response', new Date());\n\t\t\t\tvar response_obj = JSON.parse(response.getBody());\n\t\t\t\tvar statuserrormsg = '';\n\t\t\t\tif(response.getCode() != '200'){\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','T');\n\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage',response.getBody());\n\t\t\t\t}\n\t\t\t\tif(response.getCode() == '200'){\n\t\t\t\t\tvar successstr = response.getBody();\n\t\t\t\t\tif(successstr) {\n\t\t\t\t\t\tvar CalculationDirection = response_obj.CalculationDirection;\n\t\t\t\t\t\tnlapiLogExecution('DEBUG','CalculationDirection ', CalculationDirection);\t\n\t\t\t\t\t\tif(CalculationDirection == \"R\") {\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tvar TotalTax = '';\n\t\t\t\t\t\t\tif(nlapiGetRecordType() == 'creditmemo' || nlapiGetRecordType() == 'cashrefund') {\n\t\t\t\t\t\t\t\tTotalTax = parseFloat(response_obj.TotalTax * -1);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tTotalTax = response_obj.TotalTax;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar TaxRate ='';\n\t\t\t\t\t\t\tvar Taxableamt = '';\n\t\t\t\t\t\t\tif(response_obj.TaxLines) {\n\t\t\t\t\t\t\t\tfor(j=0; j < response_obj.TaxLines.length; j++) {\n\t\t\t\t\t\t\t\t\tvar taxLinesobj = response_obj.TaxLines[j];\n\t\t\t\t\t\t\t\t\tvar LineNo = taxLinesobj.LineNo;\n\t\t\t\t\t\t\t\t\tTaxRate = taxLinesobj.Rate;\n\t\t\t\t\t\t\t\t\tTaxableamt = taxLinesobj.Taxable;\n\t\t\t\t\t\t\t\t\tnlapiLogExecution('DEBUG','TaxRate '+TaxRate, ' Taxableamt '+Taxableamt);\t\n\t\t\t\t\t\t\t\t\trec.setLineItemValue('item','taxrate1',LineNo, parseFloat(TaxRate * 100));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\trec.setFieldValue('taxamountoverride',TotalTax);\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrorflag','F');\n\t\t\t\t\t\t\trec.setFieldValue('custbody_spk_sabrixtaxerrormessage','');\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\ttraninternalId = nlapiSubmitRecord(rec);\n\t\t\t\tnlapiLogExecution('DEBUG','traninternalId ', traninternalId);\t\n\t\t\t\t//Submit the Sabrix Integration Log Custom Record to keep track of Request and Response\n\t\t\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),traninternalId,response.getCode(),'T');\n\t\t\t} \n\t\t\t\n\t\t}\n\t}\n\tcatch(e) {\n\t\tvar syserror = '';\n\t\tif(e instanceof nlobjError) {\n\t\t\tnlapiLogExecution( 'ERROR', 'system error', e.getCode() + '\\n' + e.getDetails());\n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t} \n\t\telse { \n\t\t\tsyserror = e.getCode() + '\\n' + e.getDetails();\n\t\t}\n\t\tnlapiSubmitField(nlapiGetRecordType(),nlapiGetRecordId(),['custbody_spk_sabrixtaxerrorflag','custbody_spk_sabrixtaxerrormessage'],['T', syserror]);\n\t\tCreateSabrixLog(nlapiGetRecordType(),eventtype,string1,response.getBody(),nlapiGetRecordId(),500, 'T');\n\t\tvar err = nlapiCreateError('Sabrix Error :', syserror);\n\t\tthrow err;\n\t}\n}", "function isPhoneOrFaxNo(input) {\r\n\t\tvar reg_exp = /^(((\\+|00)\\d{2})|0)\\d+\\s?(\\/|-)?\\s?\\d+/;\r\n\t\tif (input.match(reg_exp)) {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "function _init_contact_person_fax_field(){\n try{\n _current_field_num++;\n var field_num = _current_field_num; \n var is_required_field = false;\n var contact_person_fax_field = Ti.UI.createTableViewRow({\n className:'set_client_contact_fax',\n filter_class:'set_client_contact_fax',\n valueRequired:is_required_field,//for check value\n valuePosition:2,//for check value\n valueType:'value',//for check value,\n valuePrompt:'Please enter fax.',//for check value\n height:self.default_table_view_row_height\n });\n var contact_person_fax_title_field = Ti.UI.createLabel({\n text:'Fax',\n color:self.font_color,\n font:{\n fontSize:self.font_size,\n fontWeight:self.font_weight\n },\n left:10\n });\n contact_person_fax_field.add(contact_person_fax_title_field);\n var contact_person_fax_content_field = Ti.UI.createTextField({\n width:self.set_a_field_width_in_table_view_row(contact_person_fax_title_field.text),\n height:self.default_table_view_row_height,\n hintText:(is_required_field)?'Required':'Optional',\n textAlign:'right',\n right:30,\n value:_client_contact_fax,\n color:self.selected_value_font_color,\n font:{\n fontSize:self.normal_font_size\n },\n returnKeyType: Ti.UI.RETURNKEY_NEXT,\n keyboardType:Titanium.UI.KEYBOARD_NUMBERS_PUNCTUATION,\n clearButtonMode:Titanium.UI.INPUT_BUTTONMODE_ONFOCUS\n });\n contact_person_fax_field.add(contact_person_fax_content_field);\n self.data.push(contact_person_fax_field);\n contact_person_fax_content_field.addEventListener('change',function(e){\n _client_contact_fax = e.value;\n _is_make_changed = true;\n });\n contact_person_fax_content_field.addEventListener('return',function(e){\n self.check_and_set_object_focus(0,field_num,1);\n });\n contact_person_fax_content_field.addEventListener('focus',function(e){ \n _is_phone_fax_content_field_focused = true;\n _selected_field_object = e.source;\n });\n contact_person_fax_content_field.addEventListener('blur',function(e){\n _is_phone_fax_content_field_focused = false;\n _selected_field_object = null;\n }); \n }catch(err){\n self.process_simple_error_message(err,window_source+' - _init_contact_person_fax_field');\n return;\n } \n }", "function call(e){\n\tvar mobile = e.data.MobileNumber;\n\t$m.callContact(mobile);\n}", "function ReportInvoiceQrCodeWithAddress() {\n\n}", "function setFiatInterest(rowNumber, exchangeRate) {\n\n var cryptoInterest = ordersSheet.getRange(columns.interestCrypto + rowNumber).getValue()\n var fees = ordersSheet.getRange(columns.fees + rowNumber).getValue()\n\n var fiatInterest = (exchangeRate * (cryptoInterest - fees))\n Logger.log(fiatInterest)\n\n ordersSheet.getRange(columns.interestFiat + rowNumber).setValue(fiatInterest);\n\n}", "function sendSFax(toFax, sender, blob){\n\n var token = getToken()\n\n var url = \"https://api.sfaxme.com/api/SendFax?token=\" + encodeURIComponent(token) + \"&ApiKey=\" + encodeURIComponent(SFAX_KEY) + \"&RecipientName=\" + encodeURIComponent('Good Pill Pharmacy - Active') + \"&RecipientFax=\" + encodeURIComponent(toFax)\n\n if ((toFax != '18882987726') && (toFax != '18557916085'))\n url += \"&OptionalParams=\" + encodeURIComponent('SenderFaxNumber=' + sender)\n\n var opts = {\n method:'POST',\n url:url,\n payload:{file:blob}\n }\n\n try{\n\n var res = UrlFetchApp.fetch(url, opts)\n //Logger.log('sendSFax res: ' + JSON.stringify(res) + ' || ' + res.getResponseCode() + ' || ' + JSON.stringify(res.getHeaders()) + ' || ' + res.getContentText())\n\n return JSON.parse(res.getContentText()) //{\"SendFaxQueueId\":\"539658135EB742968663C6820BE33DB0\",\"isSuccess\":true,\"message\":\"Fax is received and being processed\"}\n\n } catch(err){\n //Logger.log('sendSFax err' + err)\n return err\n }\n}", "function addcontact(fullname, number, email, address, notes, website)\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.AddContact(fullname, number, email, address, notes, website);\n else\n return false;\n}", "function deal_number(){\n\t\n}", "function emailOrderPhoneNumber(emailBody) {\n // Get the first phone number within email body. This is only one we need.\n var tmp;\n var tmpArray;\n var phoneNumber;\n \n // Try Phone Number with '-'\n tmp = emailBody.match(/[0-9]{3}\\-[0-9]{3}\\-[0-9]{4}/);\n// sheet.appendRow(['In phone number function: ', tmp[0]]);\n \n // If null, must be Phone Number with '.'\n if(tmp == null) {\n tmp = emailBody.match(/[0-9]{3}\\.[0-9]{3}\\.[0-9]{4}/); \n \n // Split on '.'\n tmpArray = tmp[0].split('.');\n }\n else {\n // Split on '-'\n tmpArray = tmp[0].split('-');\n }\n\n \n // Reassemble phone number with prepended 1.\n phoneNumber = '1' + tmpArray[0] + tmpArray[1] + tmpArray[2];\n \n return phoneNumber;\n}", "function ffr(n) {\n return n;\n}", "function updateNumbers(field) {\n var dgf = field.find(\".datagridwidget-table-view\");\n\n function update() {\n var counter = 0; // <thead> has the first row\n dgf.find(\"tr\").each(function() {\n\n var $this = $(this);\n if($this.find(\".number\").size() === 0) {\n $this.append(\"<td class='number'>x</td>\");\n }\n\n var number = $this.find(\".number\");\n number.text(counter + \".\");\n\n counter++;\n });\n }\n\n // Update rows every time DGF is mixed\n dgf.bind(\"afteraddrow afteraddrowauto aftermoverow\", function() {\n update();\n });\n\n // Initial update\n update();\n }", "function toGetTaxValues(srcZcRank)\n{\n\t\t\ttotalTaxAmt = 0;\n\t\t\tvar extndAmt = 0;\n\t\t\tvar MRPAmt = 0;\n\t\t\tvar totalTaxAmtOfProd=0;\n\t\t\t\t\n\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-2201hdn'))\n\t\t\t\tvar product_id = document.getElementById('0-1001:'+srcZcRank+'-1101-2201hdn').value;\n\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-2201'))\n\t\t\t\tvar product_name = document.getElementById('0-1001:'+srcZcRank+'-1101-2201').value;\n\n\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1103')&&document.getElementById('0-1001:'+srcZcRank+'-1101-1103').value==\"\")\n\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1125').value = 0.00;\n\t\t\telse{\n\t\t\tif(priceInclTaxFlg !=\"1\" && document.getElementById('0-1001:'+srcZcRank+'-1101-1104')&&document.getElementById('0-1001:'+srcZcRank+'-1101-1104').value!=\"\")\n\t\t\t\textndAmt = (document.getElementById('0-1001:'+srcZcRank+'-1101-1104').value)*(document.getElementById('0-1001:'+srcZcRank+'-1101-1103').value);\n\t\t\telse if(priceInclTaxFlg ==\"1\" && document.getElementById('0-1001:'+srcZcRank+'-1101-886')&&document.getElementById('0-1001:'+srcZcRank+'-1101-886').value!=\"\"){\n\t\t\t\t/***Extended amount will be based on the discount.****/\n\t\t\t\t/**If header discount exist calculate line level discnt for the same % and deduct the discount from the extnd amt**/\n\t\t\t\tif(document.getElementById(\"0-1-851\")&&document.getElementById(\"0-1-851\").value){\n\t\t\t\t\tvar discountPercent = document.getElementById(\"0-1-851\").value;\n\t\t\t\t extndAmt = (document.getElementById('0-1001:'+srcZcRank+'-1101-886').value)*(document.getElementById('0-1001:'+srcZcRank+'-1101-1103').value);\n\t\t\t\t\tvar discntAmt = (discountPercent*extndAmt)/100;discntAmt=discntAmt.toFixed(2);\n extndAmt = extndAmt - discntAmt;\n\t\t\t\t}\n\t\t\t\t/**If not calculate the extended amount without discount**/\n\t\t\t\telse{\n\t\t\t\t\textndAmt = (document.getElementById('0-1001:'+srcZcRank+'-1101-886').value)*(document.getElementById('0-1001:'+srcZcRank+'-1101-1103').value);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-1127\")&&document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-1127\").value !=\"\") MRPAmt = (document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-1127\").value) *(document.getElementById('0-1001:'+srcZcRank+'-1101-1103').value);\n\t\t\t}\n\t\t\t/******Send branch Id if it exist for line level tax calculation*******/\n\t\t\tvar branchId=\"\";\n\t\t\tif(document.getElementById(\"0-1-251\") && document.getElementById(\"0-1-251\").value !=\"\"){\n\t\t\t\tbranchId = document.getElementById(\"0-1-251\").value;\n\t\t\t}\n\t\t\t/*****Get tax detail********/\n\t\t\tvar detUrl=zcServletPrefix+'/custom/JSON/system/getTaxDet4Prod.htm?product_id='+product_id+'&branch_id='+branchId;\n\t\t\t\n\t\t\t$.ajax(\n\t\t\t{\n\t\t\t\ttype: \"GET\",\n\t\t\t\turl:detUrl,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tasync:false,\n\t\t\t\tsuccess: function (doc)\n\t\t\t\t{\n\t\t\t\t\tprodTaxInfo=doc['taxInfo'].split('~)');\n\t\t\t\t\tif(prodTaxInfo.length>=1)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(var taxTypeCntr=0;taxTypeCntr<prodTaxInfo.length;taxTypeCntr++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tvar taxDetails=prodTaxInfo[taxTypeCntr].split('--');\n\t\t\t\t\t\t\tvar taxTypeName=taxDetails[0];\n\t\t\t\t\t\t\tvar taxTypePct=taxDetails[1];\n\t\t\t\t\t\t\tvar taxOnOther=taxDetails[2];\n\t\t\t\t\t\t\tvar calcTaxOn = taxDetails[3];\n\t\t\t\t\t\t\tvar taxTypeId = taxDetails[4];\n\t\t\t\t\t\t\tvar tax2BeCalcOnAmt =0;\n if(calcTaxOn && calcTaxOn == \"list_price\") tax2BeCalcOnAmt=MRPAmt;\n\t\t\t\t\t\t\telse tax2BeCalcOnAmt=extndAmt;\n\t\t\t\t\t\t\tif(taxOnOther){var parTaxAmt=parseFloat((taxOnOther/100)*parseFloat(tax2BeCalcOnAmt)); \n\t\t\t\t\t\t\tvar taxAmt = parseFloat((taxTypePct/100)*parseFloat(parTaxAmt));}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tvar taxAmt = 0;\n\t\t\t\t\t\t\t\tif(priceInclTaxFlg !=\"1\")\n\t\t\t\t\t\t\t\t taxAmt = parseFloat((taxTypePct/100)*parseFloat(tax2BeCalcOnAmt));\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t var taxPct4Divd = parseFloat(taxTypePct)+100;\n\t\t\t\t\t\t\t\t\ttaxAmt = parseFloat((taxTypePct/taxPct4Divd)*parseFloat(tax2BeCalcOnAmt));\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(taxAmt)\n\t\t\t\t\t\t\t totalTaxAmtOfProd=parseFloat(totalTaxAmt)+parseFloat(taxAmt);\n\n\t\t\t\t\t\t\t//if(document.getElementById('0-1001:'+srcZcRank+'-1101-6301'))\n\t\t\t\t\t\t\t//document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-6301\").value = totalTaxAmtOfProd.toFixed(2);\n\t\t\t\t\t\t\tif(taxTypeCntr==0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1644')&&taxTypePct)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1644').value = taxTypePct;\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1604')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1604').value = taxAmt.toFixed(2);\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1600')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1600').value = taxTypeId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(taxTypeCntr==1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1645')&&taxTypePct)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1645').value = taxTypePct;\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1611')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1611').value = taxAmt.toFixed(2);\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1605')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1605').value = taxTypeId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(taxTypeCntr==2)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1651')&&taxTypePct)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1651').value = taxTypePct;\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1617')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1617').value = taxAmt.toFixed(2);\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1612')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1612').value = taxTypeId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(taxTypeCntr==3)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1652')&&taxTypePct)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1652').value = taxTypePct;\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1626')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1626').value = taxAmt.toFixed(2);\n\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1618')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1618').value = taxTypeId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(taxTypeCntr==4)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1653')&&taxTypePct)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1653').value = taxTypePct;\n\t\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1643')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1643').value = taxAmt.toFixed(2);\n\t\t\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1627')&&taxAmt)\n\t\t\t\t\t\t\t\tdocument.getElementById('0-1001:'+srcZcRank+'-1101-1627').value = taxTypeId;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\ttotalTaxAmt=totalTaxAmtOfProd;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-6301')){\n\t\t\t\t\t\t\tif(priceInclTaxFlg !=\"1\") document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-6301\").value = totalTaxAmt.toFixed(2);\n\t\t\t\t\t\t\telse document.getElementById(\"0-1001:\"+srcZcRank+\"-1101-6301\").value = Math.floor(totalTaxAmt * 100) / 100;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(document.getElementById('0-1001:'+srcZcRank+'-1101-1657')){\n\t\t\t\t\t\t\tif(priceInclTaxFlg ==\"1\") document.getElementById('0-1001:'+srcZcRank+'-1101-1657').value = parseFloat(document.getElementById('0-1001:'+srcZcRank+'-1101-1125').value);\n\t\t\t\t\t\t\telse document.getElementById('0-1001:'+srcZcRank+'-1101-1657').value = parseFloat(totalTaxAmt) + parseFloat(document.getElementById('0-1001:'+srcZcRank+'-1101-1125').value);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\treturn totalTaxAmt;\n}", "function countContact() {\n let numberOfContact = addressBook.reduce(numberOfContact => numberOfContact+1,0)\n console.log(\"Number of contacts are \"+numberOfContact); \n}", "function snomXcapProcessCard(vcf, fullname, order, prefix, duplicates, uniqueEntries, xcapUniqueNumbers) {\n // entry name\n let entryName = utilNameFormat(vcf.lastName, vcf.firstName, vcf.orgName, fullname);\n // check for duplicates\n if (!duplicates) {\n if (uniqueEntries.indexOf(entryName) > -1)\n return;\n uniqueEntries.push(entryName);\n }\n // object to hold different kinds of phone numbers, limit to home, work, mobile, default to home\n let entries = [];\n // iterate through all numbers\n for (let tel of vcf.tels) {\n if (!tel.number)\n continue;\n // check for duplicate phone number\n if (xcapUniqueNumbers.indexOf(tel.number) > -1) {\n let errorMsg = 'Duplicate number (' + tel.number + ') on ' + entryName;\n console.log('WARNING: ' + errorMsg);\n sendMail('Sync: Duplicate phone number detected', errorMsg);\n continue;\n }\n xcapUniqueNumbers.push(tel.number);\n // store entry\n entries.push({ type: tel.type, number: prefix === '' ? tel.number : (prefix + tel.number).replace('+', '00') });\n }\n // if empty return nothing\n if (entries.length === 0)\n return;\n // process all types and numbers\n let typeOrder = order.length !== 3 ? ['default'] : order;\n let telephony = [];\n let count = {\n work: 0,\n home: 0,\n mobile: 0\n };\n // go by type order\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n let n = entry.type.replace('work', 'business') + '_number';\n if (count[entry.type] > 0)\n n += '#' + count[entry.type];\n telephony.push({\n 'cp:prop': [\n {\n _attr: {\n name: n,\n value: entry.number\n }\n }\n ]\n });\n count[entry.type]++;\n }\n }\n }\n return {\n entry: [\n {\n 'display-name': entryName\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'entry_id',\n value: vcf.uid\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'surname',\n value: vcf.lastName\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'given_name',\n value: vcf.firstName\n }\n }\n ]\n },\n {\n 'cp:prop': [\n {\n _attr: {\n name: 'company',\n value: vcf.orgName\n }\n }\n ]\n },\n ...telephony\n ]\n };\n}", "function getInfoFournisseur(idFourn, idContact){\n var ret = null;\n var sheet = SpreadsheetApp.openById(CLSID).getSheetByName(SHEET_PARAM_FOURNISSEUR);\n var idrow = onSearchFournisseurwithID(idFourn);\n var nomc='';\n var emailc='';\n var telc='';\n if (idrow != -1) {\n if (idContact != '') {\n if (sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_NOM+1).getValue() == idContact) {\n nomc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_NOM+1).getValue();\n emailc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_EMAIL+1).getValue();\n telc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT1_TEL+1).getValue();\n }\n if (sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_NOM+1).getValue() == idContact) {\n nomc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_NOM+1).getValue();\n emailc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_EMAIL+1).getValue();\n telc = sheet.getRange(idrow,COLUMN_FOUR_CONTACT2_TEL+1).getValue();\n }\n }\n ret= {id:idFourn,\n sigle:sheet.getRange(idrow,COLUMN_FOUR_SIGLE+1).getValue(),\n adresse:sheet.getRange(idrow,COLUMN_FOUR_ADRESSE+1).getValue(),\n tel:sheet.getRange(idrow,COLUMN_FOUR_TEL+1).getValue(),\n fax:sheet.getRange(idrow,COLUMN_FOUR_FAX+1).getValue(),\n siret:sheet.getRange(idrow,COLUMN_FOUR_SIRET+1).getValue(),\n ape:sheet.getRange(idrow,COLUMN_FOUR_APE+1).getValue(),\n nomcontact:nomc,\n telcontact:telc,\n emailcontact:emailc\n };\n // Log des informations du Fournisseur\n Log_Info(\"getInfoFournisseur\", Utilities.formatString(\"ret=%s\",Utilities.jsonStringify(ret)));\n }\n if(ret==null) throw 'Aucun fournisseur associé avec la référence suivante :'+idFourn;\n return ret;\n}", "function ValidateTelephoneNumbers(source, arguments) {\r\n var numberFields = jQuery(\"#serviceBooking\").find(\".stepContent\").find('input[data-class=\"pNumber\"]');\r\n arguments.IsValid = CheckNumberIsProvidedForServiceBookingEnterDetails(numberFields);\r\n}", "function phoneCall(min1, min2_10, min11, s) {\n var n = 0;\n while(s>0){\n n++;\n if(n == 1){\n s = s-min1;\n }else if(n>=2 && n<=10){\n s = s-min2_10;\n } else if(n>10){\n s = s-min11;\n }\n console.log(s);\n }\n return s>=0 ? n : n-1;\n }", "function show_urgentAppointments_number(ndx){\n var urgentDim = ndx.dimension(dc.pluck('select_all'));\n\n var totalUrgentAppointments = urgentDim.group().reduceSum(dc.pluck('urgent')); \n \n dc.numberDisplay(\"#urgent_appointments\")\n .formatNumber(d3.format(\",f\"))\n .group(totalUrgentAppointments);\n \n\n}", "function eye_contact_1(result)\n{\n console.log(\"eye_contact_1\")\n console.log(result);\n \n var date = new Date(1528214746 *999);\n if(first)\n {\n fakehistoricadata(date.toString().substr(0,24))\n first = false\n }\n \n updateEyeContact(result);\n}", "function telephoneFilter() {\n \n var countryCodes = i18n.phonenumbers.metadata.countryCodeToRegionCodeMap;\n var countryMetaData = i18n.phonenumbers.metadata.countryToMetadata;\n var validRangeMap = {\n 2: \"fixedLine\",\n 3: \"mobile\",\n 4: \"tollFree\",\n 5: \"premiumRate\",\n 6: \"sharedCost\",\n 7: \"personalNumber\",\n 8: \"voip\",\n 21: \"pager\",\n 24: \"noInternationalDialing\",\n 25: \"uan\",\n 28: \"voiceMail\"\n };\n \n var regionsFromNumber = function(e164) {\n var regions, key, value;\n for(key in countryCodes) {\n value = countryCodes[key];\n var reg = new RegExp('^'+key),\n ok;\n\n ok = reg.exec(e164);\n\n if(ok) {\n regions = value;\n break;\n }\n }\n\n return regions;\n };\n\n var formatNumberForRegion = function(region, nationalNumber, mode) {\n var metaData = countryMetaData[region],\n countryCode = metaData[10],\n nationalPrefix = metaData[12],\n nationalFormats = metaData[19],\n internationalFormats = metaData[20],\n number, international = (mode === 'e164'),\n numberFormats = international && internationalFormats ? internationalFormats : nationalFormats,\n entry, i, matchNumber, matchLeadingDigits, validRange = false, range;\n\n if(numberFormats) {\n \n if(nationalPrefix && nationalNumber.substr(0, nationalPrefix.length) === nationalPrefix) {\n nationalNumber = nationalNumber.substr(nationalPrefix.length);\n }\n \n for (var key in validRangeMap) {\n entry = metaData[key];\n if(new RegExp('^('+entry[2]+')$').exec(nationalNumber)) {\n validRange = true;\n range = validRangeMap[key];\n break;\n }\n }\n\n if(validRange) {\n for(i = 0;i<numberFormats.length;i++) {\n entry = numberFormats[i];\n matchNumber = new RegExp('^('+entry[1]+')$').exec(nationalNumber);\n\n if(!angular.isDefined(entry[3])) {\n matchLeadingDigits = true;\n } else if(angular.isString(entry[3])) {\n matchLeadingDigits = new RegExp('^('+entry[3]+')').exec(nationalNumber);\n } else if(angular.isArray(entry[3])) {\n angular.forEach(entry[3], function(lead) {\n var result = new RegExp('^('+lead+')').exec(nationalNumber);\n if(result) {\n matchLeadingDigits = true;\n }\n });\n }\n\n if(matchNumber && matchLeadingDigits) {\n var format = entry[2];\n if(international) {\n number = nationalNumber;\n number = number.replace(new RegExp(entry[1]), format);\n number = '+' + countryCode + ' ' + number;\n } else {\n number = nationalNumber;\n if(nationalPrefix) {\n number = nationalPrefix + '' + number;\n }\n number = number.replace(new RegExp(entry[1]), format);\n }\n break;\n }\n }\n }\n }\n return number;\n };\n \n var formatNumber = function(number, mode) {\n var regions = regionsFromNumber(number), region, i, countryCode, nationalPrefix, nationalNumber, result;\n\n if(regions) {\n for(i=0;i<regions.length;i++) {\n region = regions[i];\n countryCode = countryMetaData[region][10];\n nationalPrefix = countryMetaData[region][12];\n nationalNumber = number.substr(countryCode.toString().length);\n if(nationalPrefix && nationalNumber.substr(0, nationalPrefix.length) !== nationalPrefix) {\n nationalNumber = nationalPrefix + '' + nationalNumber;\n }\n result = formatNumberForRegion(region, nationalNumber, mode);\n if(result) break;\n }\n }\n return result;\n };\n\n var wrapResult = function(input, number, returnObject) {\n var result;\n \n if(returnObject === true) {\n if(!number) {\n result = {\n number: input,\n valid: false\n };\n } else {\n result = {\n number: number,\n valid: true\n };\n }\n } else {\n if(!number) {\n result = input;\n } else {\n result = number;\n }\n }\n return result;\n };\n \n return function(input, mode, defaultAreaCode, returnObject) {\n \n var trimmedNumber, defaultGeneratedNumber, number;\n mode = mode ? mode : 'e164';\n trimmedNumber = teljs.trimNumber(input);\n if(defaultAreaCode && defaultAreaCode !== '') {\n defaultGeneratedNumber = defaultAreaCode + '' + trimmedNumber;\n number = formatNumber(defaultGeneratedNumber, mode);\n if(number) return wrapResult(input, number, returnObject);\n } \n \n number = formatNumber(trimmedNumber, mode);\n return wrapResult(input, number, returnObject);\n\n\n };\n}", "function snomTbookProcessCard(vcf, fullname, order, prefix, duplicates, uniqueEntries) {\n // entry name\n let entryName = utilNameFormat(vcf.lastName, vcf.firstName, vcf.orgName, fullname);\n // check for duplicates\n if (!duplicates) {\n if (uniqueEntries.indexOf(entryName) > -1)\n return;\n uniqueEntries.push(entryName);\n }\n // object to hold different kinds of phone numbers, limit to home, work, mobile, default to home\n let entries = [];\n // iterate through all numbers\n for (let tel of vcf.tels) {\n let type = tel.type === 'work' ? 'business' : tel.type;\n entries.push({ type: type, number: (prefix === '' ? tel.number : prefix + tel.number).replace('+', '00') });\n }\n // if empty return nothing\n if (entries.length === 0)\n return;\n // process all types and numbers\n let typeOrder = order.length !== 3 ? ['default'] : order;\n let i = 0;\n let telephony = [];\n // depends on quantity of phone numbers\n let referenceNumber = '0';\n if (entries.length === 1) {\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: vcf.firstName\n },\n {\n last_name: vcf.lastName\n },\n {\n organization: vcf.orgName\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n i++;\n }\n }\n }\n }\n else {\n for (let type of typeOrder) {\n for (let entry of entries) {\n if (type === 'default' || type === entry.type) {\n if (i === 0) {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: vcf.firstName\n },\n {\n last_name: vcf.lastName\n },\n {\n organization: vcf.orgName\n },\n {\n number: entry.number\n }\n ]\n });\n referenceNumber = entry.number;\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: 'Member_Alias'\n },\n {\n last_name: referenceNumber\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n }\n else {\n telephony.push({ item: [\n {\n _attr: { context: 'active' }\n },\n {\n first_name: 'Member_Alias'\n },\n {\n last_name: referenceNumber\n },\n {\n number: entry.number\n },\n {\n number_type: entry.type\n }\n ]\n });\n }\n i++;\n }\n }\n }\n }\n return telephony;\n}", "function FormatPhoneNumber(val)\n{\n if ((val.length == 0) || (val.charAt(0) == \"0\"))\n\t return val;\n \t \n var ext = \"\";\n var temp = val;\n var vTempExt = \"\";\n var extFound = false;\n var isInter = false;\n var extAtBegin = false;\n var i = -1;\n if (val.charAt(0) == \"+\")\n {\n isInter = true; \n }\n \n val.replace(\"/\\D+/g.\", \"\");\n i = val.indexOf(\"ext\");\n if (i > -1)\n {\n ext = val.substring(i);\n temp = val.substring(0, value.length - ext.length)\n vTempExt = ext.substring(3, ext.length);\n ext = val.substring(i, 3);\n extFound = true;\n \n if(i == 2)\n {\n extAtBegin = true;\n }\n }\n else\n {\n i = findToken(val,\"x\"); //val.indexOf(\"x\");\n if (i > -1)\n {\n \n ext = val.substring(i);\n vTempExt = ext.substring(1, ext.length);\n j = findToken(vTempExt,\"x\");// vTempExt.indexOf(\"x\");\n if (j > -1)\n {\n extFound = false;\n ext = \"\";\n i = -1;\n }\n else\n {\n temp = val.substring(0, val.length - ext.length)\n ext = \"x\";\n extFound = true;\n \n }\n if(i == 0)\n {\n extAtBegin = true;\n } \n } \n }\n\n if (extFound) \n {\n\t\t\n\t\tif (vTempExt.length >= 1) \n\t\t{\n\t\t\tif (containsAlphaChar(vTempExt))\n\t\t\t{\n\t\t\t ext = ext + convertPhoneLetters(vTempExt);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t ext = ext + vTempExt;\t\t\t \n\t\t\t}\n\t }\n }\n if(extAtBegin)\n {\n return ext;\n \n }\n else\n {\n val = convertPhoneLetters(temp);\n \n var result = val;\n if (val.length == 10)\n {\n result = \"(\" + val.substr(0,3) + \") \" + val.substr(3,3) + \"-\" + val.substr(6,4);\n }\n if (val.length == 7)\n {\n result = val.substr(0,3) + \"-\" + val.substr(3,4);\n } \n \n return result + ext;\n }\n}", "getLeadPhoneNumberToDial() {\n if (this.numbers.length === 0) {\n return undefined;\n }\n const number = this.numbers.shift();\n return number;\n }", "function allnumeric()\n { \n var uzip = document.registration.contact;\n var numbers = /^[0-9]+$/;\n if(uzip.value.match(numbers))\n {\n // Focus goes to next field i.e. email.\n document.registration.username.focus();\n return true;\n }\n else\n {\n alert('contact must have numeric characters only');\n uzip.focus();\n return false;\n }\n }", "function show_routineAppointments_number(ndx){\n var routineDim = ndx.dimension(dc.pluck('select_all'));\n\n var totalRoutineAppointmentsGroup = routineDim.group().reduceSum(dc.pluck('routine')); \n \n dc.numberDisplay(\"#routine_appointments\")\n .formatNumber(d3.format(\",f\"))\n .group(totalRoutineAppointmentsGroup);\n \n}", "function ShowPhoneHint() {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar phone = document.getElementById(\"txt_contact_phone1\").value;\r\n\t// var session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintFootable(\r\n\t\t\t'../accounting/ledger-check.jsp?contact_phone=' + phone\r\n\t\t\t\t\t+ '&cart_vouchertype_id=' + vouchertype_id\r\n\t\t\t\t\t+ '&search_customer=yes', 'invoice_details');\r\n}", "function integrar( inicio, fin, f, dx, callback ){\n\n var lim = (fin - inicio)/dx;\n var res = 0;\n for( let i = 0; i < lim; i++ ){\n res += f(i) * dx;\n }\n\n callback(res);\n\n}", "function numberOfContacts(totalCount) {\n return totalCount + 1\n}", "function totalPhoneBill(record){\n var recordList = record.split(',');\n var totalCost = 0;\n for(i in recordList){\n if(recordList[i] == \"call\"){\n totalCost = totalCost + 2.75;\n }\n else{ // If its not a call then its an sms.\n totalCost = totalCost + 0.65;\n }\n }\n return totalCost;\n}", "function createPhoneNumber(numbers) {\n //\n}", "function fatorial(numero) {\n return 0\n}", "function validateTelephone(input) {\r\n\t\t$('div[id=invalid_telephone]').remove();\r\n\t\tif (!isPhoneOrFaxNo(input)) {\r\n\t\t\t$.ajax({\r\n\t\t\t\ttype : \"POST\",\r\n\t\t\t\turl : \"logic/process_inputcheck.php\",\r\n\t\t\t\tdata : {\r\n\t\t\t\t\taction : \"get_message_invalid_telephone\"\r\n\t\t\t\t}\r\n\t\t\t}).done(function(msg) {\r\n\t\t\t\t$('#messagearea').append(msg);\r\n\t\t\t\t$('html, body').animate({\r\n\t\t\t\t\tscrollTop : $('#messagearea').offset().top\r\n\t\t\t\t}, 600);\r\n\t\t\t\treturn false;\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$('div[id=invalid_telephone]').remove();\r\n\t\t}\r\n\t}", "function onSuccess(contacts) {\n for (var i=0; i<contacts.length; i++) {\n // display phone numbers\n for (var j=0; j<contacts[i].phoneNumbers.length; j++) {\n alert(\"Type: \" + contacts[i].phoneNumbers[j].type + \"\\n\" + \n \"Value: \" + contacts[i].phoneNumbers[j].value + \"\\n\" + \n \"Preferred: \" + contacts[i].phoneNumbers[j].pref);\n }\n }\n }", "function e0fn(x){return(1.0-0.25*x*(1.0+x/16.0*(3.0+1.25*x)));}", "function contact_phone(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgs = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\t\r\n\tif (!check_allowed_char(input, \"phone\", \"conf1\")){\r\n\t\terror = \"E41_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E41_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgs.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t//if (!check_required-char(input)){\r\n\t\t//error = \"E41_3\"\r\n\t\t//result.flgname.push(flags[error].name);\r\n\t\t//result.flgs.push(flags[error].flag);\r\n\t\t//result.flgvalue.push(flags[error].value);\r\n\t\t//result.flgmsg.push(flags[error].msg);\r\n\t\t//}\r\n\t\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "getContactsFromSalesforce() {\n getContactsApex()\n .then(contacts => {\n //console.log(JSON.stringify(contacts))\n console.log('Got Contacts: ' + contacts.length);\n })\n .catch(error => {\n console.log(error)\n });\n }", "addNRInfo (callback) {\n\t\tconst accountId = this.codeErrorFactory.randomAccountId();\n\t\tthis.data.nrAccountId = accountId;\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'post',\n\t\t\t\tpath: '/companies/add-nr-info/' + this.company.id,\n\t\t\t\tdata: {\n\t\t\t\t\taccountIds: [accountId]\n\t\t\t\t},\n\t\t\t\ttoken: this.users[0].accessToken\n\t\t\t},\n\t\t\tcallback\n\t\t);\n\t}", "function focusContact(index) {\n return function(dispatch, getState) {\n var state = getState();\n var contact = state.outlook.pages[state.outlook.page][index];\n // If it's a CRM contact update initials\n if (state.outlook.contactView === model_2.ContactViewMode.CRM) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT,\n payload: {\n index: index,\n values: {\n Initials: \"\" +\n (contact.firstname ? contact.firstname.charAt(0) + '.' : '') +\n (contact.lastname ? contact.lastname.charAt(0) + '.' : '')\n }\n }\n });\n }\n if (contact[model_2.CrmExtendedProperty.CRM_ID]) {\n var crmId = contact[model_2.CrmExtendedProperty.CRM_ID];\n var strippedId = crmId.substring(crmId.indexOf('{') + 1, crmId.indexOf('}'));\n crmInterface_1.crmGet(\"contacts(\" + strippedId + \")\", state.app.crmAccessKey, {})\n .then(function(success) {\n var data = JSON.parse(success);\n var imageUrl = data['entityimage_url'];\n var image = data['entityimage'];\n if (image) {\n imageUrl = \"data:image;base64,\" + image.toString();\n }\n if (imageUrl) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT,\n payload: {\n index: index,\n values: {\n imageUrl: imageUrl\n }\n }\n });\n }\n },\n function(error) {\n console.error(error);\n });\n }\n if (contact[model_2.CrmExtendedProperty.CRM_ID] &&\n contact[model_2.CrmExtendedProperty\n .CRM_LINK_STATE] ==\n model_2.CrmExtendedProperty.CRM_LINK_STATE_LINKED) {\n crmInterface_1.crmGetNextActivity(contact[model_2.CrmExtendedProperty.CRM_ID],\n state.app.crmAccessKey)\n .then(function(success) {\n if (success.results[0]) {\n var activity = success.results[0];\n activity.date = activity.ScheduledStart\n .substring(activity.ScheduledStart.indexOf('(') + 1,\n activity.ScheduledStart.indexOf(')'));\n if (Date.now() < activity.date) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT_ACTIVITY,\n payload: {\n index: index,\n activityKey: 'nextActivity',\n activity: activity\n }\n });\n }\n }\n },\n function(error) {\n console.error(error);\n });\n crmInterface_1.crmGetPrevActivity(contact[model_2.CrmExtendedProperty.CRM_ID],\n state.app.crmAccessKey)\n .then(function(success) {\n if (success.results[0]) {\n var activity = success.results[0];\n activity.date = activity.ScheduledStart\n .substring(activity.ScheduledStart.indexOf('(') + 1,\n activity.ScheduledStart.indexOf(')'));\n if (Date.now() > activity.date) {\n dispatch({\n type: actionTypes_1.default.UPDATE_CONTACT_ACTIVITY,\n payload: {\n index: index,\n activityKey: 'prevActivity',\n activity: activity\n }\n });\n }\n }\n },\n function(error) {\n console.error(error);\n });\n }\n dispatch({\n type: actionTypes_1.default.FOCUS_CONTACT,\n payload: index\n });\n };\n }", "updateTelValue(state, telValue) {\r\n state.telValue = telValue;\r\n }", "function call(person) {\n const phoneNumber = person.phoneNumbers[0].digits;\n const link = `tel:${phoneNumber}`;\n\n console.log(link);\n Linking.canOpenURL(link)\n .then(supported => Linking.openURL(link))\n .catch(console.error);\n }", "function ShowPhoneHint() {\r\n\tvar vouchertype_id = document.getElementById(\"txt_vouchertype_id\").value;\r\n\tvar phone = document.getElementById(\"txt_contact_phone1\").value;\r\n\t// var session_id = document.getElementById(\"txt_session_id\").value;\r\n\tshowHintAccount('../accounting/ledger-check2.jsp?contact_phone=' + phone + '&cart_vouchertype_id=' + vouchertype_id + '&search_customer=yes', 'invoice_details');\r\n}", "function buscaCorrelativo(idSerie){\r\n\tvar seriecompret = nlapiLookupField('customrecord_lmry_serie_compro_retencion', idSerie, [ 'custrecord_lmry_valor_actual', 'custrecord_lmry_cant_digitos' ] );\r\n\tnumeroActual = parseFloat(seriecompret.custrecord_lmry_valor_actual);\r\n\tcantDigitos = seriecompret.custrecord_lmry_cant_digitos;\r\n}", "function makeSoapRequiredData()\r\n{\r\n\ttry\r\n\t{\r\n\r\n\t\t//passing the values to floats inorder to make the calculations\r\n\t\tdimension1 = parseFloat(dimension1);\r\n\t\tdimension2 = parseFloat(dimension2);\r\n\t\tdimension3 = parseFloat(dimension3);\r\n\r\n\t\t//get the max dimension\r\n\t\tmaxDimension = Math.max(dimension1,dimension2,dimension3);\r\n\t\tmaxDimension = parseFloat(maxDimension);\r\n\t\t//setting the flag if the max Dimension is greater than 1 metre\r\n\t\tif(maxDimension > 1)\r\n\t\t{\r\n\t\t\tmoreThanOneMetreGoodsFlag = true;\r\n\t\t}\r\n\r\n\t\tconsignmentValue = parseFloat(averageCost);\r\n\t\tconsignmentWeight = parseFloat(volumetricWeight);\r\n\t\tconsignmentWeight = parseFloat(consignmentWeight);\r\n\r\n\t\tif(consignmentWeight > 25 )\r\n\t\t{\r\n\t\t\tmoreThanTwentyFiveKgGoodsFlag = true;\r\n\t\t}\r\n\r\n\t\torderNumber = 1;\r\n\t\tnumber = parseInt(number,0);\r\n\t\tinsuranceValue = parseFloat(insuranceValue);\r\n\t\tparcelDepth = parseFloat(dimension1);\r\n\t\tparcelHeight = parseFloat(dimension2);\r\n\t\tparcelValue = parseFloat(averageCost);\r\n\t\tparcelWeight = parseFloat(volumetricWeight);\r\n\t\tparcelWidth = parseFloat(dimension3);\r\n\r\n\t\t//getting the country code of the reciepient from the 'ISO Country' custom record set\r\n\t\treciepientCountryCode = nlapiLookupField('customrecord_isocountry', isoCountryCode, 'custrecord_ic_a3');\r\n\r\n\t\treciepientLine1 = shippingAddressLine1;\r\n\t\treciepientLine2 = shippingAddressCity;\r\n\t\treciepientPostCode = shippingAddressPostCode;\r\n\r\n\t\trecipientName = 'Recipient A';\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler(\"makeSoapRequiredFields : \" , e);\r\n\t} \r\n\r\n}", "function addFee(fcode,fsched,fperiod,fqty,finvoice) // Adds a single fee, optional argument: fCap\r\n{\r\n\t// Updated Script will return feeSeq number or null if error encountered (SR5112) \r\n\tvar feeCap = capId;\r\n\tvar feeCapMessage = \"\";\r\n\tvar feeSeq_L = new Array();\t\t\t\t// invoicing fee for CAP in args\r\n\tvar paymentPeriod_L = new Array();\t\t\t// invoicing pay periods for CAP in args\r\n\tvar feeSeq = null;\r\n\tif (arguments.length > 5) \r\n\t\t{\r\n\t\tfeeCap = arguments[5]; // use cap ID specified in args\r\n\t\tfeeCapMessage = \" to specified CAP\";\r\n\t\t}\r\n\t\r\n\tassessFeeResult = aa.finance.createFeeItem(feeCap,fsched,fcode,fperiod,fqty);\r\n\tif (assessFeeResult.getSuccess())\r\n\t\t{\r\n\t\tfeeSeq = assessFeeResult.getOutput();\r\n\t\tlogMessage(\"Successfully added Fee \" + fcode + \", Qty \" + fqty + feeCapMessage);\r\n\t\tlogDebug(\"The assessed fee Sequence Number \" + feeSeq + feeCapMessage);\r\n\t\r\n\t\tif (finvoice == \"Y\" && arguments.length == 5) // use current CAP\r\n\t\t\t{\r\n\t\t\tfeeSeqList.push(feeSeq);\r\n\t\t\tpaymentPeriodList.push(fperiod);\r\n\t\t\t}\r\n\t\tif (finvoice == \"Y\" && arguments.length > 5) // use CAP in args\r\n\t\t\t{\r\n\t\t\tfeeSeq_L.push(feeSeq);\r\n\t\t\tpaymentPeriod_L.push(fperiod);\r\n\t\t\tvar invoiceResult_L = aa.finance.createInvoice(feeCap, feeSeq_L, paymentPeriod_L);\r\n\t\t\tif (invoiceResult_L.getSuccess())\r\n\t\t\t\tlogMessage(\"Invoicing assessed fee items\" + feeCapMessage + \" is successful.\");\r\n\t\t\telse\r\n\t\t\t\tlogDebug(\"**ERROR: Invoicing the fee items assessed\" + feeCapMessage + \" was not successful. Reason: \" + invoiceResult.getErrorMessage());\r\n\t\t\t}\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tlogDebug( \"**ERROR: assessing fee (\" + fcode + \"): \" + assessFeeResult.getErrorMessage());\r\n\t\tfeeSeq = null;\r\n\t\t}\r\n\t\r\n\treturn feeSeq;\r\n \r\n}", "function formataCPF(cpf) {\r\n const cpfAlvo = cpf //valor final que será passado na função\r\n const cpfDigitado = cpf.value // valor definido pelo usuario\r\n let cpfNovo; // função que vai receber o cpfDigitado e fazer sua formatação\r\n\r\n cpfNovo = cpfDigitado.replace(/(\\d{3})(\\d{3})(\\d{3})(\\d{2})/, \r\n function( regex, arg1, arg2, arg3, arg4 ) {\r\n return arg1 + '.' + arg2 + '.' + arg3 + '-' + arg4;\r\n }) \r\n cpfAlvo.value = cpfNovo; \r\n }", "async function call_setinitialinfo(P_name, P_fname, P_nationalcode, P_birthday, P_postalcode, P_emailaddress, P_address) {\n var param = [];\n param.push({ name: 'name', value: P_name });\n param.push({ name: 'fname', value: P_fname });\n param.push({ name: 'nationalcode', value: P_nationalcode });\n param.push({ name: 'birthday', value: P_birthday });\n param.push({ name: 'postalcode', value: P_postalcode });\n param.push({ name: 'emailaddress', value: P_emailaddress });\n param.push({ name: 'address', value: P_address });\n\n\n let s = await callZf_jslib('register/setinfo/', 'setinitialinfo', param, 2);\n return s;\n }", "function contact_phone(input){\r\n\tvar result = new Object();\r\n\tvar error;\r\n\tresult.flgname = [];\r\n\tresult.flgflag = [];\r\n\tresult.flgvalue = [];\r\n\tresult.flgmsg = [];\r\n\tresult.pass = true;\r\n\t\r\n\tif (!check_allowed_char(input, \"phone\", \"conf1\")){\r\n\t\terror = \"E41_1\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\tif (!presence_check(input)){\r\n\t\terror = \"E41_2\"\r\n\t\tresult.flgname.push(flags[error].name);\r\n\t\tresult.flgflag.push(flags[error].flag);\r\n\t\tresult.flgvalue.push(flags[error].value);\r\n\t\tresult.flgmsg.push(flags[error].msg);\r\n\t\t}\r\n\t//if (!check_required-char(input)){\r\n\t\t//error = \"E41_3\"\r\n\t\t//result.flgname.push(flags[error].name);\r\n\t\t//result.flgflag.push(flags[error].flag);\r\n\t\t//result.flgvalue.push(flags[error].value);\r\n\t\t//result.flgmsg.push(flags[error].msg);\r\n\t\t//}\r\n\t\r\n\tif (result.flgname.length>0){\r\n\t\tresult.pass = false;\r\n\t}\r\n\treturn result;\r\n}", "function fieldChange3(type, name){\n\n\tif(name == field_customer || name == field_account) {\n\t\tvar acct = nlapiGetFieldValue(field_account);\n\t\tvar customer = nlapiGetFieldValue(field_customer);\n\t\tvar trans_date = nlapiGetFieldValue('custrecord117');\n\t\tvar trans_loc = nlapiGetFieldValue(field_location);\n \t\tvar trans_prin = nlapiGetFieldValue(field_principal);\n\n\t\t//if(nlapiGetFieldValue(field_principal) !== '') {\n\t\t//\tnlapiSetFieldValue(field_principal, '');\n\t\t//\tnlapiSetFieldValue('custrecord122','');\n\t\t//}\n\n\t\tif(acct != '' && customer != '' && trans_date != '') {\n\t\t\tnlapiSetFieldValue(field_location,nlapiLookupField('customer', nlapiGetFieldValue(field_customer), 'custentity37'));\n\n //var arrloc = nlapiGetFieldText(field_location).split(' : ');\n //var textloc = arrloc[0]+' : '+arrloc[1]+' : '+arrloc[2]+' : '+principal[trans_prin];\n\n //if(nlapiGetRole() == 3) {\n // alert(textloc);\n //}\n\n var cdate = new Date(trans_date);\n var start_date = cdate.getMonth()+1+'/1/'+cdate.getFullYear();\n var end_date = cdate.getMonth()+1+'/'+cdate.getDate()+'/'+cdate.getFullYear();\n\n\t\t\tgetInvoices(customer, acct, start_date, end_date);\n\t\t}\n\t}\n\n \tif(name == field_customer || name == field_principal) {\n var principal = nlapiGetFieldValue(field_principal);\n\t\tvar customer = nlapiGetFieldValue(field_customer);\n if(principal != '' && customer != ''){\n var creditlimit = getSalesman(customer,principal);\n nlapiSetFieldValue('custrecord122', creditlimit.salesman);\n nlapiSetFieldValue('custrecord124', creditlimit.department);\n }\n }\n\n \t/**\n **\tADDED BY BRIAN 9/26/2017\n ** QUERY INVOICES BASED ON DATE RANGE SET\n **/\n\n\tif(name == 'custrecord904' || name == 'custrecord905') {\n var start_date = nlapiGetFieldValue('custrecord904');\n var end_date = nlapiGetFieldValue('custrecord905');\n var acct = nlapiGetFieldValue(field_account);\n\t var customer = nlapiGetFieldValue(field_customer);\n\n if(start_date != '' && end_date != '') {\n getInvoices(customer, acct, start_date, end_date);\n }\n\n }\n\n \t/** END **/\n\n}", "static async getFee (toAddress) {\n try {\n // Check whether the receiver is external account or smart contract\n let code = await EtherscanServices.getCode(toAddress)\n let gasPrice = await EtherscanServices.getGasPrice()\n // gasPrice *= countPercent\n gasPrice = parseFloat(gasPrice.toFixed(0))\n\n if (code === '0x') {\n return Settings.gas.externalAcc * gasPrice\n } else {\n let gasLimit = '0xffffffffffff'\n let estimateGas = await EtherscanServices.estimateGas(toAddress, '0xff22', gasPrice, gasLimit)\n let fee = (estimateGas + Settings.gas.extraGas) * gasPrice\n\n return fee\n }\n } catch (error) {\n throw error\n }\n }", "calcF(x) {\n let c1 = (x - this.fx) ** 2;\n let c2 = 2 * (this.fy - this._d);\n let c3 = this.fy ** 2 - this._d ** 2;\n return ((c1 + c3) / c2);\n }", "function inrfunc()\r\n{\r\n usd.value = parseFloat(inr.value) * 0.014;\r\n eur.value = parseFloat(inr.value) * 0.013;\r\n cad.value = parseFloat(inr.value) * 0.019;\r\n aud.value = parseFloat(inr.value) * 0.020;\r\n}", "getContactInfo(e) {\r\n Contact.clickedContact = Number(\r\n e.currentTarget.getAttribute(\"data-contactNumber\")\r\n );\r\n console.log(Contact.clickedContact);\r\n document.querySelector(\"#name\").value =\r\n Contact.list[Contact.clickedContact].name;\r\n document.querySelector(\"#phone\").value =\r\n Contact.list[Contact.clickedContact].phone_number;\r\n document.querySelector(\"#website\").value =\r\n Contact.list[Contact.clickedContact].website;\r\n document.querySelector(\"#description\").value =\r\n Contact.list[Contact.clickedContact].description;\r\n UI.openForm(\"update\");\r\n saveContactButton.textContent = \"update\";\r\n deleteContactButton.style.display = \"block\";\r\n }", "calcFprime(x) {\n return ((x - this.fx) / (this.fy - this._d));\n }", "function phoneCall(min1, min2_10, min11, s) {\n\t\n\t// Step1: Create a variable that will store\n\t// the number of minutes passed\n\tlet minutesPassed = 0\n\t\t\n\t// Step2: While loop, simulating the increase\n\t// of minutes and subtraction of money you own\n\t// by the fee\n\twhile(s > 0){\n\t\t// increase minute\n\t\tminutesPassed++\n\t\t\n\t\t// subtract the fee based on\n\t\t// minutesPassed\n\t\tif(minutesPassed < 2){\n\t\t\ts -= min1\n\t\t} else if(minutesPassed >= 2 && minutesPassed <= 10){\n\t\t\ts -= min2_10\n\t\t} else if(minutesPassed >= 11){\n\t\t\ts -= min11\n\t\t}\n\t\t\n\t\t// check to see if the recent interation\n\t\t// caused s to go below 0. If so, we want to \n\t\t// return the minutesPassed before this\n\t\t// iteration\n\t\tif(s < 0){\n\t\t\tminutesPassed--\n\t\t\tbreak\n\t\t}\n\t}\n\t\n\treturn minutesPassed\n}", "function numEnt(x){\r\n\tconsole.log(\"Number Entered: \" + x);\r\n}", "doit(billAmt,serviceQual,numOfPeople){\n var mediator= new Mediator();\n if(mediator.doit(\"validate\",billAmt,serviceQual,numOfPeople) === false){\n alert(\"enter valid data\");\n return;\n }\n var total = (billAmt * serviceQual) / numOfPeople;\n //round to two decimal places\n total = Math.round(total * 100) / 100;\n //next line allows us to always have two digits after decimal point\n return total.toFixed(2);\n }", "function calculateTax (amount){\n return amount * TAX;\n}", "function CalculateTax(arrayofNumber, tax){\n var subtotal = totalNumbers(arrayofNumber);\n var taxtotal = Number((subtotal * tax).toFixed(2));\n var total = Number(taxtotal + subtotal);\n //Write everything to screen\n document.write('<p> The subtotal is : $' + subtotal + '</p>');\n document.write('<p> The tax is : $' + taxtotal + '</p>');\n document.write('<p> The final total is : $' + total + '</p>');\n}", "function updateContact(contact) {\n if (validateInput()) {\n ContactsController.Update(\n contact.Id,\n $(\"#contactSupIDInput\")[0].value,\n $(\"#contactFullNameInput\")[0].value,\n $(\"#contactPhoneNoInput\")[0].value,\n onUpdateContact\n );\n }\n}", "function e4fn(x) {\n\tvar con, com;\n\tcon = 1.0 + x;\n\tcom = 1.0 - x;\n\treturn (Math.sqrt((Math.pow(con,con))*(Math.pow(com,com))));\n}", "function transponderUpdate(index, increase, element) {\n if (elementIsRelevant(element)) {\n let currentNumber = transponderNumber.textContent.trim();\n let chars = currentNumber.split('');\n\n if (increase) {\n if (chars[index] === \"9\") {\n chars[index] = \"0\";\n } else {\n chars[index] = String.fromCharCode(chars[index].charCodeAt(0) + 1);\n }\n } else {\n if (chars[index] === \"0\") {\n chars[index] = \"9\";\n } else {\n chars[index] = String.fromCharCode(chars[index].charCodeAt(0) - 1);\n }\n }\n\n transponderNumber.textContent = chars.join(\"\");\n handleSatisfied();\n }\n}", "function f_to_m (feetcon){\r\n if(feetcon > 0)\r\n {\r\n return (feetcon/5280);\r\n }\r\n else\r\n {\r\n alert(\"please enter a positive number\");\r\n }\r\n}", "function formatPhone(x){\n var areaCode = x.slice(0, 3);\n var first3 = x.slice(3, 6);\n var last4 = x.slice(6, 11);\n var phone = areaCode + \"-\" + first3 + \"-\" + last4;\n return phone;\n}", "function sendCall(phoneNumber) {\n// sheet.appendRow(['currTime:', currTime]);\n// sheet.appendRow(['sendNotification:', phoneNumber, scriptProperties.getProperty(phoneNumber)]);\n \n // Call delay passed or haven't initiated a call yet to number?\n // Otherwise, skip it\n if(scriptProperties.getProperty(phoneNumber) < currTime) {\n // sheet.appendRow(['Calling:', phoneNumber, scriptProperties.getProperty(phoneNumber)]);\n \n // Update or set next call delay time for phone number\n scriptProperties.setProperty(phoneNumber, currTime + REPEAT_CALL_DELAY);\n // sheet.appendRow(['Updated:', phoneNumber, scriptProperties.getProperty(phoneNumber)]);\n \n // Initiate phone call notification\n var response = UrlFetchApp.fetch(\"https://api.tropo.com/1.0/sessions?action=create&token=6577757373717649707753477464436c7373636e68666878706a67637a69636e4d79546d6f67436f61446447&numberToDial=\" + phoneNumber);\n }\n}", "function getFahrenheit(celcius) {\nreturn(celcius + \" Celcius are \" + (celcius*9/5+32) + \" in Fahrenheit\");\n}", "function phoneOnChange() {\n const pattern = \"^((8|\\\\+7)[\\\\- ]?)?(\\\\(?\\\\d{3}\\\\)?[\\\\- ]?)?[\\\\d\\\\- ]{7,10}$\";\n validate(this, pattern);\n}", "function phone_1(result)\n{\n var date = new Date(1528214746 *999);\n if(first)\n {\n fakehistoricadata(date.toString().substr(0,24))\n first = false\n }\n console.log(\"phone_1\")\n console.log(result);\n\n updateMovement(result, 2, options)\n updateSoundLevel(result, 2, options)\n}", "function formSubmit(name, number) {\n const nameRegexp = /^[a-zA-Zа-яА-Я]+(([' -][a-zA-Zа-яА-Я ])?[a-zA-Zа-яА-Я]*)*$/;\n const numberRegexp = /(\\+?( |-|\\.)?\\d{1,2}( |-|\\.)?)?(\\(?\\d{3}\\)?|\\d{3})( |-|\\.)?(\\d{3}( |-|\\.)?\\d{4})/;\n nameRegexp.test(name) && numberRegexp.test(number)\n ? newContact(name, number)\n : alert(`Fill out the form correctly.`);\n }", "function phoneCall(min1, min2_10, min11, s) {\r\n let min = 0;\r\n let x = s;\r\n \r\n while(x>=0){\r\n if(min === 0){\r\n if(x>=min1){\r\n \r\n x = x - min1;\r\n min++;\r\n console.log(min);\r\n console.log(x);\r\n }\r\n else{\r\n return min;\r\n }\r\n }\r\n if(min>=1 && min<=9){\r\n if(x>=min2_10){\r\n x = x - min2_10;\r\n min++;\r\n console.log(min);\r\n console.log(x);\r\n }\r\n else{\r\n return min;\r\n }\r\n }\r\n if(min >= 10){\r\n \r\n if(x >= min11){\r\n \r\n x = x - min11;\r\n min++;\r\n console.log(min);\r\n console.log(x);\r\n console.log(min11)\r\n }\r\n else{\r\n \r\n return min;\r\n }\r\n }\r\n }\r\n return min;\r\n}", "phoneNumberSummary (item, index) {\n let number = i18n.t('identification.contacts.collection.summary.unknown')\n if (item.Telephone && !item.noNumber && item.Telephone.number) {\n number = item.Telephone.number\n }\n\n return (\n <div className=\"table\">\n <div className=\"table-cell index\">{i18n.t('identification.contacts.collection.summary.phoneNumber')} {index + 1}:</div>\n <div className=\"table-cell\"><strong>{number}</strong></div>\n </div>\n )\n }", "function Calsimulation (price,iva,interest,numfee){\n console.log(\"price :\",price,\" iva:\",iva,\" interes:\",interest,\" cuotas:\",numfee);\n var monthInterest=0, j=0, fee=0;\n if(interest > 0){\n monthInterest = (Math.pow((1+(interest/100)),(1/12))-1);\n console.log(\"cuota interes mensual:\", monthInterest);\n j = (monthInterest*(1+(iva/100)));\n console.log(\"valor j:\",j);\n fee =(price*((j*Math.pow((1+j),numfee))/(Math.pow((1+j),numfee)-1)));\n console.log(\"valor de la cuota: \", fee);\n return fee;\n } \n else if (interest == 0 )\n {\n fee=price/numfee;\n console.log(\"fee\",fee);\n return fee;\n }\n \n }", "function stepRegistrationNumbers() {\n const includeCompanyNumber = COMPANY_NUMBER_TYPES.includes(\n currentOrganisationType\n );\n\n const includeCharityNumber = concat(\n CHARITY_NUMBER_TYPES.required,\n CHARITY_NUMBER_TYPES.optional\n ).includes(currentOrganisationType);\n\n const includeEducationNumber = EDUCATION_NUMBER_TYPES.includes(\n currentOrganisationType\n );\n\n return new Step({\n title: localise({\n en: 'Registration numbers',\n cy: 'Rhifau cofrestru',\n }),\n fieldsets: [\n {\n legend: localise({\n en: 'Registration numbers',\n cy: 'Rhifau cofrestru',\n }),\n get fields() {\n const allFields = [\n fields.companyNumber,\n fields.charityNumber,\n fields.educationNumber,\n ];\n return conditionalFields(\n allFields,\n compact([\n includeCompanyNumber && fields.companyNumber,\n includeCharityNumber && fields.charityNumber,\n includeEducationNumber &&\n fields.educationNumber,\n ])\n );\n },\n },\n ],\n });\n }", "function call (number)\n{\n if (typeof (webphone_api.plhandler) === 'undefined' || webphone_api.plhandler === null)\n webphone_api.addtoqueue('Call', [number]);\n else\n webphone_api.plhandler.Call(number);\n}", "function createContact(name,phoneNumber){\n\n}", "function numberInformationS() {\n var sourceOne = regABform.assetNumbers;\n var sourceTwo = regABform2.assetNumbers;\n var out = formatAllData(analizeData(sourceOne, sourceTwo), sourceOne, sourceTwo);\n var element = \"assetNumbersS\";\n return hideAndSeek(element, out);\n}", "function addCardnumEvents(idprefix){\n\n\t//on cardnum raw change, calculate FC and split into 2 fields\n\t$(\"#\"+idprefix+\"-cardnum\").on('input', function(){\n\t\tvar numparts = rawToFC($(this).val()).split(\",\");\n\t\tif(numparts.length==2){\n\t\t\t$(\"#\"+idprefix+\"-cardnum-fc-1\").val(myTrim(numparts[0]));\n\t\t\t$(\"#\"+idprefix+\"-cardnum-fc-2\").val(myTrim(numparts[1]));\n\t\t} else {\n\t\t\t$(\"#\"+idprefix+\"-cardnum-fc-1\").val(\"\");\n\t\t\t$(\"#\"+idprefix+\"-cardnum-fc-2\").val(\"\");\n\t\t}\n\t});\n\n\t//on input on any FC field, calculate Raw and join into a single field\n\t$(\"#\"+idprefix+\"-cardnum-fc-1, #\"+idprefix+\"-cardnum-fc-2\").on('input', function(){\n\t\t$(\"#\"+idprefix+\"-cardnum\").val(FCToRaw($(\"#\"+idprefix+\"-cardnum-fc-1\").val() + \", \" + $(\"#\"+idprefix+\"-cardnum-fc-2\").val()));\n\t});\n\n\t//jump to fc2 on length=3 nums fc1\n\t$(\"#\"+idprefix+\"-cardnum-fc-1\").on('input', function(){\n\t\tif($(this).val().length>2) $(\"#\"+idprefix+\"-cardnum-fc-2\").focus();\n\t});\n\t//jump to fc1 on length=0 nums fc2\n\t$(\"#\"+idprefix+\"-cardnum-fc-2\").on('input', function(){\n\t\tif($(this).val().length==0) $(\"#\"+idprefix+\"-cardnum-fc-1\").focus();\n\t});\n\n}", "function SC_propensityToContact(type, page) {\n //Event 12 Name = P2C “Yes” (counts the number of times they go to an article = Y)\n //Event 13 Name = P2C “No” (counts the number of time they go somewhere else = n)\n //alert(\"Inside Propensity\");\n var str = \"\";\n if (s == null || typeof s == 'undefined') {\n s = s_gi(s_account);\n }\n //SC: Propensity to Contact\n s.linkTrackVars = \"prop37,eVar37,events\";\n if (page) {\n s.linkTrackEvents = \"event12\";\n s.events = \"event12\";\n }\n else {\n s.linkTrackEvents = \"event13\";\n s.events = \"event13\";\n }\n // send values\n s.tl(true, 'o', 'P2C');\n // clear values\n s.events = \"\";\n return true;\n}", "function simplePhoneValidation(phoneNumber) {\n\n}", "function handlePhoneCall(phone_number) {\n //console.log('it got in here into handlephone call')\n console.log(\"it got in here into handlephone call\");\n const personNumber = {\n number: phone_number, // Dummy phone number, we will pass props into here\n prompt: false, // Optional boolean property. Determines if the user should be prompt prior to the call\n };\n call(personNumber).catch(console.error);\n\n }", "function checkMobilePhone2(phone_code, phone_number)\r\n{\r\n\tvar complete_number = $(phone_code).value + $(phone_number).value;\r\n\t//alert(complete_number);\r\n\tajaxRequest('isPhoneNumber', 'phone_number='+complete_number, '', 'isPhoneNumber2', 'reportError');\r\n}", "function ftom(input) {\n const midiNoteNumberOfA4 = 69;\n var midi_note_number =\n midiNoteNumberOfA4 + 12 * Math.log2(parseFloat(input) / 440);\n var cents_offset = (midi_note_number - Math.round(midi_note_number)) * 100;\n midi_note_number = Math.round(midi_note_number);\n return [midi_note_number, cents_offset];\n}", "function obj(n, f, Hz, x, y, z){\n\tif (n !== isNaN){\n\t\tfreq[n-1] = f;\n\t\tampX[n-1] = x;\n\t\tampY[n-1] = y;\n\t\tampZ[n-1] = z;\n\t}\n\toutlet(0, freq);\n\toutlet(1, ampX);\n\toutlet(2, ampY);\n\toutlet(3, ampZ);\n}", "function formatPhoneNumber(value) {\n\tvar format = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'National';\n\n\treturn (0, _custom.formatNumber)(value, format, _metadataMin2.default);\n}", "handleFeePaymentNote (note) {\n switch (note.subject) {\n case 'regupdate':\n this.updateExchangeRegistration(note.dex, false, note.confirmations)\n break\n case 'Account registered':\n this.updateExchangeRegistration(note.dex, true)\n break\n default:\n break\n }\n }" ]
[ "0.6103495", "0.5506917", "0.54916734", "0.54750323", "0.5413505", "0.53329533", "0.52630657", "0.5251573", "0.5194549", "0.51921785", "0.51061815", "0.50646424", "0.50291324", "0.5021229", "0.50026774", "0.4974901", "0.49386153", "0.4937306", "0.4931722", "0.49151254", "0.48887345", "0.48796806", "0.48578945", "0.4856864", "0.4852512", "0.48521006", "0.48028606", "0.47877413", "0.47833225", "0.4777585", "0.4755418", "0.47484764", "0.47433996", "0.4735855", "0.473488", "0.4724328", "0.4724263", "0.47241244", "0.47225735", "0.47193217", "0.47156072", "0.47040457", "0.47010165", "0.46955118", "0.46835786", "0.46810815", "0.46525052", "0.46463534", "0.46451735", "0.46450713", "0.46365646", "0.4633131", "0.46129215", "0.4596104", "0.45926094", "0.45903566", "0.45782873", "0.4577354", "0.45772198", "0.4571314", "0.45710665", "0.4568394", "0.45668983", "0.45634514", "0.45576623", "0.45542085", "0.45527175", "0.45496693", "0.45483354", "0.45443165", "0.4534667", "0.45323023", "0.45261925", "0.4516223", "0.45135796", "0.4512145", "0.45109165", "0.4496929", "0.4493148", "0.44910735", "0.44853333", "0.44837314", "0.44813052", "0.44800892", "0.4478677", "0.44761485", "0.4472141", "0.44702", "0.44684535", "0.44614726", "0.4460639", "0.44563466", "0.44548482", "0.44533762", "0.4453326", "0.44532195", "0.44508004", "0.4449236", "0.44427043", "0.4439256" ]
0.61291915
0
React methods Set the initial state
constructor (props) { super(props); this.state = {}; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setInitialState(initialState) {\n\t\tObject.assign(this.state, initialState);\n\t\tthis.setInitialState = noop;\n\t}", "setInitialState () {\n if (this.skipInitial) {\n this.showChooseOrSignIn();\n } else {\n this.setState('initial');\n }\n }", "reset() {\r\n this.state = this.initial;\r\n }", "reset() {\n this.setState(this._getInitialState());\n }", "reset() {\n this.setState(this._getInitialState());\n }", "_resetState() {\n this.setState({\n ...this._defaultState\n });\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "reset() {\r\n this.state = this.config.initial;\r\n }", "componentWillMount() {\n this.setState({ ...initialState });\n }", "constructor() {\n super(...arguments);\n this.state = this.constructor.initialState(this.props);\n }", "componentWillMount() {\n\t\tthis.setState({ \n\t\t\tvalue: this.props.defaultValue,\n\t\t});\n\t}", "_setInitialState() {\n const that = this;\n\n that._currentIndex = 0;\n that._indicators = [];\n that._items = [];\n that._rotate = false;\n that._handleDefaultInnerHTML();\n }", "resetConvos() {\n this.setState(this.getInitState());\n }", "_setInitialState(){\n if(this.state.initial) return;\n const computedStyles = getComputedStyle(this);\n this.state.initial = {};\n this.state.initial.type = this.type;\n this.state.initial.icon = this.icon;\n this.state.initial.color = this.style.color;\n this.state.initial.borderColor = computedStyles.getPropertyValue(\"--border-color\");\n this.state.initial.hoverBorderColor = computedStyles.getPropertyValue(\"--hover-border-color\");\n this.state.initial.hoverColor = computedStyles.getPropertyValue(\"--hover-color\");\n this.state.initial.backgroundColor = computedStyles.getPropertyValue(\"--background-color\");\n this.state.initial.hoverBackgroundColor = computedStyles.getPropertyValue(\"--hover-background-color\");\n\n }", "reset() {\r\n return this.state = \"normal\";\r\n }", "constructor() {\n super();\n this.state = defaultState;\n }", "reset() {\r\n this.setState(this.baseState);\r\n }", "constructor() {\n super()\n this.state = intialState\n }", "constructor(props) {\n super(props);\n\n this.state = defaultState;\n }", "function resetToInitialState() {\n storage.clear(STATE_STORAGE)\n setState(Object.assign({}, INITIAL_STATE))\n}", "constructor() { \r\n super();\r\n this.state = {};\r\n }", "reset() {\r\n this.activeState = this.config.initial;\r\n }", "function getInitialState ()\n {\n return {};\n }", "function getInitialState ()\n {\n return {};\n }", "resetState() {\n this.setState({\n show: false,\n currCode: null,\n latest: 0,\n performance: 0,\n capital: 0,\n amount: 0,\n potential: 0,\n multiplier: 1.5,\n prediction: 1,\n err: false,\n err_msg: null\n })\n }", "componentWillMount() {\n if (this.props.missions) this.setDefaultState(this.props.missions);\n }", "_getInitialState() {\n return {};\n }", "initializeState() {\n const attrs = this.state.attributes;\n attrs.x = 0;\n attrs.y = 0;\n }", "constructor(props) {\n super(props)\n //this.state = propriedade herdada de Compponent, nao pode ser alterada diretamente\n //No react, nao podemos alterar propriedades diretamente, apenas evolui-la\n //predominacao de programacao funcional\n this.state = { value: props.initialValue }\n }", "reset() {\n this.setState({stage: STAGE.init});\n }", "function getInitialState () {\n return initialState\n }", "function getInitialState () {\n return initialState\n }", "reset() {\r\n this.currentState = this.initial;\r\n }", "constructor() {\n this.state = undefined\n }", "getInitialState() {\n return {\n\n }\n }", "constructor(props) { // be promoted into a class\n super(props);\n this.state = {}; // defines initial state\n }", "constructor() {\n super();\n this.state = {};\n }", "constructor() {\n super();\n this.state = {\n selected: null,\n };\n }", "startOver() {\n this.setState(initialState);\n console.log(this.state);\n }", "componentDidMount() {\n console.log('in CDM of BaseForm');\n if (this.props.hikeState) {\n this.setState(this.props.hikeState)\n }\n }", "componentDidMount() {\n this.setState({\n username: '',\n password: '',\n reset: false,\n })\n }", "makeInitialState() {\n return this._mainComponentInitialState;\n }", "reset() {\r\n this.state=this.initial;\r\n this.statesStack.clear();\r\n\r\n }", "constructor(props){\n super(props)\n\n // 2 SET INITIAL STATE\n this.state = {\n title: 'LifeCycle'\n }\n }", "constructor(props) {\n super(props);\n this.state= {flag:0};\n }", "reset() {\r\n this.currentState = this.initalState;\r\n this.clearHistory();\r\n }", "reset() {\r\n this._state = this._config.initial;\r\n this._history.push(this._state);\r\n }", "reset_techInfo_State(some){\r\n\t\t//this.setState(this.initialState);\r\n\t\t//alert(\"resetting\");\r\n\t\t//alert(\"this.baseState-> \" + this.baseState );\r\n\t\tthis.setState({ //sets new value to state //setState is an async function\r\n techInfoState: this.state.baseState\r\n }); \r\n\t}", "constructor(props) {\nsuper(props);\nthis.setState = {\n};\n}", "constructor(){\n super();\n this.state = {\n label: 'Button'\n }\n this.setInitialState();\n }", "componentDidMount() {\n // this.setState({searchBoxTextValue: this.state.searchBoxTextValue}) \n if (this.state.justConstructed) {\n this.setState({ justConstructed: true })\n }\n }", "reset() {\r\n this.currentState = this.config.initial;\r\n }", "constructor() {\n super();\n this.state = {\n };\n }", "reset () {\n this.state.clear()\n this.redraw()\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "componentWillMount() {\n this.setState({\n firstName: '',\n lastName: '',\n email: '',\n password: '',\n role: 1,\n submitted: false\n });\n }", "async getInitialState(props) {\n return this.state.getInitialState(props);\n }", "constructor(props){\n super(props);\n this.state= {\n };\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "constructor(props) {\n super(props);\n this.state = {};\n }", "resetCalculatorState() {\n this.setState({\n output: \"0\",\n storedOutput: null,\n operator: null\n })\n }", "componentWillMount(){\n this.setState({\n selectedValue: this.props.selectedValue,\n selectedLabel: this.props.selectedLabel,\n dirty: false\n })\n }", "constructor(props){\n super(props);\n this.state = {}\n }", "constructor(state) {\n this.state = undefined;\n this.setState(state);\n }", "setFirstLoad(state, val = true){\n state.firstLoad = false;\n }", "constructor(props)\n {\n super(props); //always inst the super class\n\n\n this.state = {\n current: '0',\n previous: [],\n nextIsReset: false\n };\n }", "resetForm(){\n this.setState(initialState)\n }", "reset() {\n \t// Do not change state (counter) directly like - this.state.counter = 0 - Bad practice!\n \t// Instead use setState as below\n this.setState({ counter: 0 });\n }", "constructor(props){\n super(props);\n this.state={\n number:0\n };\n }", "constructor() {\r\n // super (the constructor of the parent class, what the child extends - in this case, React.Component) must be called before the `this` keyword can be used in a class. this is a JavaScript thing, not a React specific thing.\r\n super();\r\n // normally your state will be an object literal, but I want to give users the opportunity to restart their game, so I use this function to return the initial state in the places I need it so I don't repeat myself. see the getFreshState() method below to see what this state will look like.\r\n // NEVER write this.state.property = value. ALWAYS use this.setState() and pass in an object with the properties and new values you want to update. this is how React knows when to rerender. \r\n // if you want a child component to update the state of a parent, write a method that calls this.setState and pass it down as props to your child component\r\n this.state = this.getFreshState();\r\n // class methods must be bound in the constructor so they refer to `this` properly (again, a JavaScript / class thing, not a React specific thing)\r\n this.toggle = this.toggle.bind(this);\r\n this.refresh = this.refresh.bind(this);\r\n this.getFreshState = this.getFreshState.bind(this);\r\n }", "componentWillMount() {\n this.setState({\n email: '',\n password: '',\n submitted: false\n });\n }", "resetState() {\n this.state = 'pending'\n }", "resetState() {\n this.state = states.WAITING_FOR_CHOICE;\n }", "getInitialState() {\n return {\n }\n }", "reset() {\n this.setState({ config: null });\n }", "reset() {\r\n this.prevState=this.currentState;\r\n this.currentState = this.config.initial;\r\n }", "constructor(props) {\n super(props)\n this.state = {}\n }", "constructor(props) {\n super(props)\n this.state = {}\n }", "constructor(props) {\n super(props);\n this.state = {}\n }", "if (!this.props.initialValues) {\n this.props.change('isPublic', true);\n this.props.change('allowSharing', true);\n this.props.change('cannabisConsumption', false);\n }", "constructor() {\n super(); // it fire React.Component's constructor\n this.state = {\n count: 0,\n }; // state is empty object\n }", "get state() {\n return this._initialState;\n }", "constructor(props){\n super(props);\n this.state = initState;\n this.handleChange = this.handleChange.bind(this);\n this.handleSubmit = this.handleSubmit.bind(this);\n this.isDisabled = this.isDisabled.bind(this);\n }", "function reset() {\n\t setState(null);\n\t} // in case of reload", "componentWillMount() {\n this.setState({\n authFlag: false,\n t_flag: false,\n s_flag: false\n });\n }", "get defaultState() { return {}; }", "componentWillMount(){\n this.asignarValorState('id',this.props.objCliente.id,'objetoCliente');\n if(this.props.objCliente.clavecliente === ''){\n this.asignarValorState('clavecliente',this.props.claveCliente,'objetoCliente');\n }else{\n this.asignarValorState('clavecliente',this.props.objCliente.clavecliente,'objetoCliente');\n } \n this.asignarValorState('nombre',this.props.objCliente.nombre,'objetoCliente');\n this.asignarValorState('appaterno',this.props.objCliente.appaterno,'objetoCliente');\n this.asignarValorState('apmaterno',this.props.objCliente.apmaterno,'objetoCliente');\n this.asignarValorState('rfc',this.props.objCliente.rfc,'objetoCliente');\n }", "constructor(props) {\n super(props);\n this.state = { };\n }", "[types.SET_INITIAL_STATE](state, initialState = {}) {\n Object.assign(state, pick(initialState, initialStateKeys));\n }", "resetSIMMState() {\r\n this.setState({\r\n currentReference : -1,\r\n currentProcess : 'N/A',\r\n currentPage : 'N/A',\r\n swapSpace : new SwapSpace(),\r\n frameTable : new FrameTable(),\r\n colorGenerator : new ColorGenerator()\r\n });\r\n }", "constructor(props){\n super(props);\n \n this.state = {\n\n }\n\n }", "getInitialState() {\n return {\n }\n }", "setState (state) {\r\n this.state = state;\r\n }", "function setInitialValues() {\n // you can decide on some initial values\n}", "constructor(props) {\n super(props);\n this.state = {\n\n }\n }" ]
[ "0.7903237", "0.7722899", "0.74768", "0.7333635", "0.7201478", "0.71797764", "0.71249515", "0.7118375", "0.70789105", "0.6967959", "0.6953219", "0.6941265", "0.69085836", "0.68308336", "0.68189764", "0.68017715", "0.67678165", "0.67580515", "0.67069733", "0.6686115", "0.668603", "0.6653494", "0.66501236", "0.66501236", "0.6649827", "0.66200423", "0.6603436", "0.65962535", "0.65860736", "0.6584153", "0.6583798", "0.6583798", "0.65795845", "0.6570507", "0.6544375", "0.6537553", "0.6513036", "0.64922386", "0.6487903", "0.64643914", "0.6462906", "0.645376", "0.64454794", "0.6444405", "0.6436461", "0.6434466", "0.6432542", "0.64258224", "0.6421394", "0.6408786", "0.6405951", "0.639323", "0.6385348", "0.6372132", "0.63691884", "0.63691884", "0.63691884", "0.63691884", "0.63574", "0.6353415", "0.63409793", "0.6340817", "0.6340817", "0.6340817", "0.6340817", "0.6340817", "0.634059", "0.6327288", "0.63166857", "0.6316164", "0.63050926", "0.6302544", "0.6296952", "0.6292092", "0.6270113", "0.626969", "0.62672836", "0.6262692", "0.6262032", "0.6254151", "0.62537575", "0.62524307", "0.6251591", "0.6251591", "0.62515396", "0.6250938", "0.62508255", "0.6248326", "0.6236484", "0.62307686", "0.62301993", "0.62187994", "0.6212107", "0.62116694", "0.62087226", "0.620551", "0.6198888", "0.6197407", "0.61887455", "0.618874", "0.6188124" ]
0.0
-1
When component is mounted add the Change event listeners and get initial data
componentDidMount () { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_setOnChanges(){\n\t\tthis.inputs.forEach(i => i.addEventListener('change', this._onChange.bind(this)));\t\n\t}", "onDataChange() {}", "function othersInit(self) {\n const el = self.element;\n el.value = self.currentValue;\n self.subscribe({event: 'change', fn: self.onchange });\n}", "_addEventsListeners ()\n {\n this._onChange();\n }", "initialize() {\n this.model.on('change', this.render, this);\n }", "initialize() {\n this.model.on('change', this.render, this);\n }", "componentDidMount() {\n document.addEventListener('change', this.handleChange);\n this.callRender();\n this._seqObj.onSubpartSelected(this.props.onSubpartSelected);\n this._seqObj.onMouseSelection(this.props.onMouseSelection);\n }", "static get observers() {\n return [\n 'handle_input_data_changed(inputData)'\n ]\n }", "constructor(element) {\n this.changeHandlers = []\n this.element = element\n element.on('change', (e) => {\n this.change(this.data())\n })\n }", "listen() {\n [\"change\"].forEach(name => {\n this.el_.addEventListener(name, this.handler_, false)\n })\n }", "init() {\n\n //Hide or show at render page\n if(this.options.changeOnInit)\n {\n this.change();\n }\n\n // Hide/Show when change the select\n this.select.addEventListener('change', () => this.change(), false);\n\n }", "componentDidMount() {\n $('.select-box select').on('change', this.changeFunc);\n }", "getData () {\n if (data) {\n this.data = data;\n this.emit('change', this.data);\n }\n }", "created() {\n this.__initEvents();\n }", "setupDataListener(){\n PubSub.subscribe('Items:item-data-loaded',(evt)=>{this.initiliaze(evt.detail)});\n }", "onRecieveChange() {\n ArticlesStore.on('change', this.getNewsArticles);\n }", "componentDidUpdate() {\n this.componentData();\n }", "componentDidMount () {\n Store.addChangeListener(this.onChange)\n }", "function changeListener(device) {\n // refreshData()\n }", "addListener(changeListener) {\n this.changeListeners.push(changeListener);\n }", "mounted(){\n // Handler for a events, generated from children components of this component.\n this.$root.$on('eventHandler-' + this.$root.$children.last._uid, this.eventHandler);\n }", "initEventListners() {\n this.engine.getSession().selection.on('changeCursor', () => this.updateCursorLabels());\n\n this.engine.getSession().on('change', (e) => {\n // console.log(e);\n\n // Make sure the editor has content before allowing submissions\n this.allowCodeSubmission = this.engine.getValue() !== '';\n this.enableRunButton(this.allowCodeSubmission);\n });\n }", "_onChange ()\n {\n this._dbRef.on('value', (snapshot) =>\n {\n if (snapshot.exists() === false)\n {\n return;\n }\n\n let data = snapshot.val();\n this._key = snapshot.key;\n this._name = data.name;\n this._owner = data.owner;\n this._players = data.players || {};\n this._map = data.map;\n this._gameType = data.gameType;\n\n if (this._eventsStorage['change']) this._eventsStorage['change'].forEach((event) => event(data));\n });\n }", "setupListeners() {\n super.setupListeners();\n $('.sort-link').on('click', e => {\n const sortType = $(e.currentTarget).data('type');\n this.direction = this.sort === sortType ? -this.direction : 1;\n this.sort = sortType;\n this.updateTable();\n });\n $('.clear-pages').on('click', () => {\n this.resetView(true);\n this.focusSelect2();\n });\n $('#pv_form').on('submit', e => {\n e.preventDefault(); // prevent page from reloading\n this.processInput();\n });\n $('.another-query').on('click', () => {\n this.setState('initial');\n this.pushParams(true);\n });\n }", "componentWillMount() {\n SupplierStore.addChangeListener(EventTypes.ADD_SUPPLIER_EVENT, this.cb_onAddSupplierResult);\n SupplierStore.addChangeListener(EventTypes.UPDATE_SUPPLIER_EVENT, this.cb_onUpdateSupplierResult);\n }", "componentDidUpdate() { //triggered if data changed in the database\n this.setData()\n }", "onChangeListener()\n {\n const state = this.getState();\n const listen = this.props.listen || Object.keys(state);\n const listens = Array.isArray(listen) ? listen : [listen];\n\n if (state && listens.some(listen => !isEqual(state[listen], this.data[listen])))\n {\n this.data = state;\n this.isEmpty = false;\n this.forceUpdate();\n\n if (typeof this.props.onChange === 'function')\n {\n this.props.onChange(state, this.data);\n }\n }\n }", "addChangeListener(callback) {\n this.on('change', callback);\n }", "onDidChange(callback) {\n return this.emitter.on('did-change', callback)\n }", "componentDidMount(){\n AppStore.addChangeListener(this._onChange.bind(this))\n }", "onChanged(e){}", "onInit() {\n this.__initEvents();\n }", "componentDidUpdate() {\n this.loadData();\n }", "componentDidMount() {\n ButtonStore.addChangeListener(this._onChange);\n AuthStore.addChangeListener(this._onChange);\n }", "componentDidMount() {\n this.buildTagMap(this.props.tags);\n this.initialize();\n $(ReactDOM.findDOMNode(this)).on('change', this.handleChange.bind(this));\n }", "function initListableDataEvents(){\r\n\t\t\treturn {\r\n\t\t\t\tonViewChange: function(){ ctrl.parametersForCollectionsList.selectedCollections = []; }\r\n\t\t\t}\r\n\t\t}", "mounted() {\n this._requestAllBindings();\n }", "componentDidMount() {\n ListStore.addChangeListener(this._onChange.bind(this));\n }", "onChange(callback) {\n this.events.change.push({ callback });\n }", "init() {\n super.init();\n if ((this.elementDesc.options || {}).type === 'number' && (this.elementDesc.options || {}).step) {\n this.$inputNode.attr('step', this.elementDesc.options.step);\n }\n const defaultValue = (this.elementDesc.options || {}).type === 'number' ? '0' : '';\n const defaultText = this.getStoredValue(defaultValue);\n this.previousValue = defaultText;\n this.$inputNode.property('value', defaultText);\n if (this.hasStoredValue()) {\n this.fire(FormInputText.EVENT_INITIAL_VALUE, defaultText, defaultValue);\n }\n this.handleDependent();\n // propagate change action with the data of the selected option\n this.$inputNode.on('change.propagate', () => {\n this.fire(FormInputText.EVENT_CHANGE, this.value, this.$inputNode);\n });\n }", "componentDidMount () {\n //Criamos um listener que executa função sempre que adicionamos uma nova posição\n //Devido ao funcionamento do firebase só precisamos chamar isso para carregar os pontos iniciais tambem\n listenLugares (snapshot => this.getLugares (snapshot));\n listenBage (snapshot => this.getBage (snapshot));\n }", "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "get changes() {\n return this._changes || (this._changes = new EventEmitter());\n }", "_watch() {\n\t\tconst watchHandler = this._createBootstrapper.bind(this);\n\t\tthis._componentFinder.watch();\n\t\tthis._componentFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler)\n\t\t\t.on('changeTemplates', watchHandler);\n\n\t\tthis._storeFinder.watch();\n\t\tthis._storeFinder\n\t\t\t.on('add', watchHandler)\n\t\t\t.on('unlink', watchHandler);\n\t}", "componentDidMount() {\n this.getInitialData()\n }", "function onData() {\n if ( packages instanceof Array ) {\n temp.mkdir('staniol_components', function ( err, tempDir ) {\n var components = new Components({\n components : packages,\n directory : tempDir\n });\n components.prepare(function (bundle) {\n emitter.emit('lessGet', bundle);\n });\n });\n } else {\n var components = new Components({\n components : packages\n });\n components.process(function (bundle) {\n emitter.emit('lessGet', bundle);\n });\n }\n }", "componentWillMount() {\n UserStore.addChangeListener(EventTypes.ADD_USER_EVENT, this.cb_onAddUsersResult);\n UserStore.addChangeListener(EventTypes.UPDATE_USER_EVENT, this.cb_onUpdateUserResult);\n }", "componentWillMount(){\n\t\tItemsStore.on(\"change\", this.getItems);\n\t}", "function bindEvents() {\n\t\t\teManager.on('showForm', function() {\n\t\t\t\tshowForm();\n\t\t\t});\n\t\t\teManager.on('csvParseError', function() {\n\t\t\t\tshowError();\n\t\t\t});\n\t\t}", "componentDidUpdate(){\n this.loadData();\n }", "componentDidMount() {\n $(window).on('focus', this._startPolling.bind(this));\n $(window).on('blur', this._stopPolling.bind(this));\n\n this.mounted = true;\n\n console.log(`Widget '${this.props.widget.name}' mounted`);\n\n this._paramsHandler = new WidgetParamsHandler(this.props.widget,this._getToolbox());\n this._fetchData();\n }", "onChange(callback) {\n this.listeners.push(callback);\n }", "mounted() {\n this.initialize()\n }", "$onChanges(change){}", "connectedCallback(){\n registerListener('productSelected', this.handleProductSelected, this); \n registerListener('areaSelect', this.handleNewArea, this);\n registerListener('appSelected', this.update, this); \n }", "constructChangeListeners() {\n // TODO it would be best to remove the event listeners after they are fired\n // and then re-instantiate them after a new recipe loads\n\n // Listener for the editor itself\n this.qEditor.on('text-change', () => {\n this.edited = true\n })\n\n // Listener for the tagInput add and remove events\n // FIXME it does not appear that the .offs are working for these\n this.tagInput.on('add', () => {\n this.edited = true\n })\n\n this.tagInput.on('remove', () => {\n this.edited = true\n })\n\n // Listener for title change\n const titleDOM = document.getElementById('title')\n titleDOM.addEventListener('input', () => {this.edited=true})\n\n // Listener for make-soon button\n const makeSoon = document.getElementById('make-soon-box')\n makeSoon.addEventListener('change', (evt) => {\n const checked = evt.srcElement.checked\n this.edited = true\n if(checked) {\n this.makeSoon = true\n } else {\n this.makeSoon = false\n }\n })\n\n // Listener for Tried 'n' True button\n const tried = document.getElementById('tried-box')\n tried.addEventListener('change', (evt) => {\n const checked = evt.srcElement.checked\n this.edited = true\n if(checked) {\n this.triedNTrue = true\n } else {\n this.triedNTrue = false\n }\n })\n }", "componentDidMount() {\n\t\t// redraw on change\n\t\tconst updateReact = (mystate) => this.setState({});\n\t\tDataStore.addListener(updateReact);\n\t}", "function init() {\n\t\t\t// find the relevant delegates\n\t\t\t['default', 'options', 'value']\n\t\t\t\t.forEach(function(key) {\n\t\t\t\t\tdelegate[key] = key in config ? (model.delegation(config[key]) || config[key]) : null;\n\t\t\t\t});\n\n\t\t\t// subscribe a handler to `default` updates\n\t\t\tsubscribe(delegate.default, function() {\n\t\t\t\toptions(resolve(delegate.value));\n\t\t\t});\n\n\t\t\t// subscribe a handler to `options` updates\n\t\t\tsubscribe(delegate.options, function() {\n\t\t\t\toptions(resolve(delegate.value));\n\t\t\t});\n\n\t\t\t// subscribe a handler to `value` updates\n\t\t\tsubscribe(delegate.value, function() {\n\t\t\t\tselection(resolve(delegate.value));\n\t\t\t});\n\n\t\t\t// listen for changes and persist those in the model value\n\t\t\telement.addEventListener('change', persist, false);\n\t\t}", "function _init() {\n addEvent();\n getData();\n }", "function onChange() {\n\t\t__debug_457( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function initListeners() {\n\tshowFollowers.addEventListener(\"change\", () => {\n\t\tsetConnectionMode(true, false);\n\t});\n\tshowFriends.addEventListener(\"change\", () => {\n\t\tsetConnectionMode(false, true);\n\t});\n\n\tviolinPlotSelect.addEventListener(\"change\", () => {\n\t\tdrawVP(violinPlotContainer, user1, user2, violinPlotSelect.value);\n\t})\n\n\tyearSelect.addEventListener(\"change\", () => {\n\t\tsetYear(yearSelect.value);\n\t})\n}", "handleDataManagerCreated_() {\n\t\tconst manager = this.component_.getDataManager();\n\t\tif (this.component_.constructor.SYNC_UPDATES_MERGED) {\n\t\t\tthis.componentRendererEvents_.add(\n\t\t\t\tmanager.on(\n\t\t\t\t\t'dataPropChanged',\n\t\t\t\t\tthis.handleManagerDataPropChanged_.bind(this)\n\t\t\t\t)\n\t\t\t);\n\t\t} else {\n\t\t\tthis.componentRendererEvents_.add(\n\t\t\t\tmanager.on(\n\t\t\t\t\t'dataChanged',\n\t\t\t\t\tthis.handleManagerDataChanged_.bind(this)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t}", "initialize(){\n this.loadListeners()\n }", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_730( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_412( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_475( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "_addEventListeners() {\n\n if (this._isNative) {\n this.selectEl.addEventListener('change', this._onInputBound);\n }\n else {\n this.el.addEventListener('change', this._onInputBound, true);\n }\n }", "function onChange() {\n\t\t__debug_332( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_259( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_520( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_577( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_587( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function onChange() {\n\t\t__debug_488( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "componentWillMount() {\n StateStore.on(\"ceils_updated\", this.setCeils);\n StateStore.on(\"ceils_clear\", this.clearCeils);\n StateStore.on(\"game_state\", this.gameState);\n }", "function onChange() {\n\t\t/* eslint-disable no-underscore-dangle */\n\t\t__debug_596( 'Received a change event.' );\n\t\tif ( self._autoRender ) {\n\t\t\tself.render();\n\t\t}\n\t}", "_bindEvents () {\n this.listenTo(this.model.get('rats'), 'change sync', this._showRats)\n }", "constructor() {\n super();\n this._cachedData = {};\n this.EVENT_DATA_CHANGED = 'aims.model.data.changed';\n }", "function onChange() {\n\t\t__debug_429( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "componentDidMount() {\n document.addEventListener(\"keydown\", this.handleKeyDown);\n\n store.subscribe(() => {\n this.time_adjustment_secs = store.getState().timeAdjuster\n\n if (store.getState().serverStatus === 'UPLOADED'\n && !this.state.isRenderIntitialized\n && Object.keys(this.state.eegData).length == 0)\n {\n // File has been successfully uploaded\n // Must be called before echartRef becomes active\n this.setState({isRenderIntitialized: true})\n \n this.updateNavVariables()\n \n // Bind events and show loading\n let echart = this.echartRef.getEchartsInstance()\n this.bindInteractionEvents()\n echart.showLoading({\n color: '#cccccc'\n })\n this.initialDataLoad()\n // LEGACY\n // this.requestData(0, 10)\n }\n })\n }", "function inputChanged() {\n parseInput(this);\n getDataFromTable();\n }", "componentDidMount() {\n this.onShowPlaceholder()\n // add emitter event listener\n // filter and keep only the ones that are 'downloaded'\n Subscriptions.push(\n mrEmitter.addListener('onUpdateData', (updateData) => {\n // adding selected property to tableData\n let tempData = updateData.filter(this.filterDownloader)\n for (let cData of tempData) {\n cData.selected = false\n }\n this.setState({tableData: tempData})\n this.onShowPlaceholderTimeout = setTimeout(() => {\n this.onShowPlaceholder()\n }, 300)\n }),\n // close the toolbar\n mrEmitter.addListener('onCloseToolbar', () => this.onAllChecked('', false))\n )\n }", "onProcessRawComponents(rawComponents) {\n _component = ComponentListStore.getCurrentComponent();\n\n // Send out the `change` event listener\n this.trigger();\n }", "componentDidMount() {\n this.listenTo(HearthstoneStore, this.updateDecks);\n }", "componentDidMount(){\n this.numRef.current.value = this.props.init || this.props.min;\n this.rangeRef.current.value = this.props.init || this.props.min;\n }", "onComponentDidMount(){\n //call initial load of grid box coloring\n //sibscribe to listen to firebase changes to the grid\n }", "componentDidMount() {\n\t\tthis.nameFilter = ReactDOM.findDOMNode(this.refs.name);\n\t\tthis.props.collection.on('all', this.forceRerender);\n\t}", "function onChange() {\n\t\t__debug_395( 'Received a change event.' );\n\t\tif ( self._autoRender ) { // eslint-disable-line no-underscore-dangle\n\t\t\tself.render();\n\t\t}\n\t}", "function initListeners() {\n $(\"#classes\").change(function() {\n //Make sure to pass over this.value \n Model.getStudentByClassNumber(this.value);\n })\n}", "init() {\n this.links = [];\n this.projectDetails = this.prop('project', {});\n\n this.handler.observe('project').onChange('project', project => {\n this.projectDetails = project;\n this.filter(this.currentSearch);\n // this.detectChanges();\n });\n\n this.filter('');\n }", "_init() {\n this.$inputs = this.$element.find('input, textarea, select');\n\n this._events();\n }", "componentDidMount() {\n this.getEvents();\n }", "componentDidMount () {\n PageStore.addChangeListener(this._onChange);\n InsightsStore.addChangeListener(this._onChange);\n }", "function addEvents() {\n red.addEventListener('change', changeRed);\n green.addEventListener('change', changeGreen);\n blue.addEventListener('change', changeBlue);\n}", "function onInit() {\n ctrl.checkedItemsCount = angular.isUndefined(ctrl.checkedItemsCount) ? 0 : ctrl.checkedItemsCount;\n ctrl.itemsCount = angular.isUndefined(ctrl.itemsCount) ? 0 : ctrl.itemsCount;\n\n $scope.$on('action-checkbox_item-checked', toggleCheckedItem);\n $scope.$on('action-checkbox-all_change-checked-items-count', changeItemsCheckedCount);\n $scope.$on('action-checkbox-all_set-checked-items-count', setCheckedItemsCount);\n }", "events() {\n\t\t\t\treturn {\n\t\t\t\t\t// Ordinary text fields\n\t\t\t\t\t'change input.form-control': () => {\n\t\t\t\t\t\t// Update the model based on changes in the view\n\t\t\t\t\t\tconst target = $(event.target);\n\t\t\t\t\t\tconst attributeName = target.data('name');\n\t\t\t\t\t\tconst attributeValue = target[0].value;\n\t\t\t\t\t\tthis.model.set( attributeName, attributeValue );\n\t\t\t\t\t},\n\n\t\t\t\t\t// On/off switches\n\t\t\t\t\t'change input.onoffswitch-checkbox': () => {\n\n\t\t\t\t\t\t// Update the model based on changes in the view\n\t\t\t\t\t\tconst target = $(event.target);\n\t\t\t\t\t\tconst attributeName = target.data('name');\n\t\t\t\t\t\tconst attributeValue = target[0].checked;\n\n\t\t\t\t\t\tlet options = this.model.get( 'softwareOptions' );\n\t\t\t\t\t\tfor ( let option of options ){\n\t\t\t\t\t\t\tif( option.name === attributeName ){\n\t\t\t\t\t\t\t\toption.value = attributeValue ? 'Y' : 'N';\n\n\t\t\t\t\t\t\t\t// Setting options in the array (as above) won't trigger a change event, so ..\n\t\t\t\t\t\t\t\tthis.model.set( 'userUpdated', _.now() );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}", "connectedCallback() {\n\n this.handleSearchKeyChange('');\n\n // subscribe to searchKeyChange event\n registerListener('searchKeyChange', this.handleSearchKeyChange, this);\n\n registerListener('recordFromSuccess', this.handleRecordFromSuccess, this);\n \n }", "_onChange () {\n this.forceUpdate()\n }", "function _bindEvents() {\n // subscribe to 'peopleChanged' event\n // When received, fire setPeople\n app.events.on('peopleChanged', setPeople);\n }" ]
[ "0.6531918", "0.6411452", "0.64018303", "0.62857616", "0.6067784", "0.6067784", "0.6066856", "0.6066031", "0.60161185", "0.5953258", "0.59190184", "0.58913684", "0.58904344", "0.5873124", "0.582088", "0.5781589", "0.57530284", "0.57397085", "0.57384", "0.5724595", "0.56863993", "0.56591463", "0.5653949", "0.56395054", "0.5636834", "0.562894", "0.5628288", "0.5614322", "0.5582364", "0.55591005", "0.55430686", "0.55389345", "0.55085206", "0.5506923", "0.55023676", "0.5500665", "0.54856735", "0.5482788", "0.5478903", "0.5471388", "0.5462487", "0.54542863", "0.54542863", "0.54542863", "0.54542863", "0.54542863", "0.5441799", "0.5441043", "0.54315484", "0.5425938", "0.54232657", "0.5422142", "0.5402471", "0.53996015", "0.5398802", "0.53965765", "0.53957576", "0.5392497", "0.5388759", "0.5379077", "0.53788227", "0.5369263", "0.5368754", "0.536739", "0.53626615", "0.53602356", "0.53572226", "0.53550476", "0.53539014", "0.5353882", "0.535312", "0.53470796", "0.5344814", "0.53413975", "0.5340769", "0.5340584", "0.53393996", "0.5337133", "0.5329987", "0.53287524", "0.5320785", "0.53206164", "0.53199255", "0.53184325", "0.5308321", "0.53077286", "0.53024465", "0.53013736", "0.53006905", "0.5299663", "0.52873975", "0.52794343", "0.52707505", "0.52697724", "0.5269578", "0.5259952", "0.5257239", "0.5253748", "0.5251829", "0.5248819", "0.5245237" ]
0.0
-1
Toggle the button text
function update_buttons() { $('.manage-button').each( (_, bb) => { let user_id = $(bb).data('user-id'); let manage = $(bb).data('manage'); if (manage != "") { $(bb).text("Unmanage"); } else { $(bb).text("Manage"); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function toggleButton(b){\n let text = b ? \"Stop sharing\" : \"Split a table\";\n return text;\n}", "function changeToggleText() {\n\n\t// change to default button\n\tif (!$(\"#search-button\").is(\":visible\")) $(\".main-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n\tif (!$(\"#deselect-all\").is(\":visible\")) $(\".selection-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n} // changeToggleText", "function updateButton() {\n const icon = this.paused ? '►' : \"&#10074&#10074;\";\n toggle.innerHTML = icon;\n // more on textContent VS innerHTML: https://www.w3schools.com/jsref/prop_node_textcontent.asp#:~:text=The%20innerHTML%20property%20returns%20the,but%20without%20inner%20element%20tags.\n}", "function toggleButton($button, state) {\n var $text = $button.children(\"span\");\n var $spinner = $button.children(\".fa-spin\");\n\n if (state) {\n $button.attr(\"disabled\", true);\n $spinner.removeClass(\"hidden\");\n $text.text($text.data(\"active-text\"));\n } else {\n $button.attr(\"disabled\", false);\n $spinner.addClass(\"hidden\");\n $text.text($text.data(\"inactive-text\"));\n }\n }", "function updateButton(){\n\tconst icon = this.paused ? \"►\" : \"❚ ❚\";\n\ttoggle.textContent = icon;\n}", "function buttonText() {\n if (vm.clientmanagement.inactive) {\n return 'Activate';\n }\n else {\n return 'Deactivate';\n }\n }", "function updateButton(){\n const icon = this.paused ? '►' : '❚ ❚';\n toggleButton.textContent = icon;\n}", "handleToggleClick() {\n this.buttonClicked = !this.buttonClicked; //set to true if false, false if true.\n this.cssClass = this.buttonClicked ? 'slds-button slds-button_outline-brand' : 'slds-button slds-button_neutral';\n this.iconName = this.buttonClicked ? 'utility:check' : '';\n }", "function changeTextAndStatusToButton(button, text, isDisabled) {\n button.text(text);\n\n button.prop('disabled', isDisabled);\n}", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function btn2Toggle() {\n\n if (state == 0) {\n btn2.innerHTML = \"Go\";\n }\n else {\n btn2.innerHTML = \"R\";\n }\n}", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function updatePredictButtonText(text) {\n document.querySelector(\".c8a11y-predict-toggle-button\").innerHTML =\n text;\n }", "function updateButton() {\n const icon = this.paused ? \">\" : \"||\";\n selectors.toggle.textContent = icon;\n}", "toggleButtonA() {}", "function toggleText() {\r\n var text = document.getElementById(\"instructions\");\r\n if (text.style.display === \"none\") {\r\n text.style.display = \"block\";\r\n } else {\r\n text.style.display = \"none\";\r\n }\r\n }", "function updateButton() {\n const buttonIcon = this.paused ? '▶' : '❚ ❚';\n console.log(buttonIcon);\n toggle.textContent = buttonIcon;\n}", "function changeText(){\n let myButton = document.querySelector('#button');\n let myValue = myButton.value;\n if(myValue=='On'){\n myButton.value='Off'\n } else { myButton.value='On'}\n}", "function toggleSearchOptionsTitle()\n{\n\tif ($(searchForm).css(\"display\") === \"none\") {\n\t\t$(searchOptionsBtn).text('Hide Search Options');\n } \n\telse {\n \t$(searchOptionsBtn).text('Show Search Options');\n }\n}", "onToggle() {}", "function toggleButtonClick() {\n toggleButton(event.target);\n}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "function updateButton() {\n // we can use this because it's bound to the video itself\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "handleShowPartyClick (event) {\n var btn = event.currentTarget;\n var innerHtml = btn.innerHTML;\n var newText = innerHtml === \"Hide the Party Members\" ? \"See the Party Members\" : \"Hide the Party Members\";\n\n btn.innerHTML = newText;\n }", "function clickButton() {\n //document.getElementById(\"changeText\").innerHTML = \"Texto alterado com sucesso\";\n document.getElementById(\"changeText\").style.display = \"none\";\n}", "function btn1Toggle() {\n\n if (state == 0) {\n btn1.innerHTML = \"\";\n btn1.setAttribute = \"btn btn-primary d-none\";\n }\n else if (state > 0 && state < 5) {\n btn1.innerHTML = \"Next\";\n btn1.setAttribute = \"btn btn-primary d-block\";\n }\n else {\n btn1.innerHTML = \"Restart\";\n btn1.setAttribute = \"btn btn-primary d-block\";\n }\n}", "function toggle(){\n\tif(CijiJeRed==0)CijiJeRed=1;\n\telse CijiJeRed=0;\n\t\n\tdocument.getElementById(\"poruka-u-igri\").innerText = \"Red je na igrača \" +igraci[CijiJeRed];\n}", "function swapText(btn) {\n\tconst altText = btn.data(\"alt-text\");\n\tbtn.data(\"alt-text\", btn.text()).text(altText);\n}", "function toggleSong() {\n if (song.isPlaying()) {\n //pause audio and change button text to Play\n song.pause();\n button.html('Play');\n } else {\n //pause audio and change button text to Pause\n song.play();\n button.html('Pause');\n }\n}", "function toggleSong() {\n if (song.isPlaying()) {\n //pause audio and change button text to Play\n song.pause();\n button.html('Play');\n } else {\n //pause audio and change button text to Pause\n song.play();\n button.html('Pause');\n }\n}", "function toggleButtonFeedLibrary() {\n var button = document.getElementById(\"btnFeedLibrary\"); // User Photo Feed = 0, User Photo Library = 1, Global feed = 2\n\n if (button) {\n if (button.value === \"0\") {\n button.value = \"1\";\n button.innerText = \"User Photo Library\";\n } else if (button.value === \"1\") {\n button.value = \"2\";\n button.innerText = \"Global Photo Feed\";\n } else if (button.value === \"2\") {\n button.value = \"0\"\n button.innerText = \"User Photo Feed\";\n }\n }\n}", "function setButtonText() {\n if (!$rootScope.editMode) {\n $scope.buttonText = \"Add\";\n }\n else {\n $scope.buttonText = \"Save\";\n }\n ;\n\n }", "buttonChange() {\n let buttonText = document.getElementById(\"Ashow\");\n if (buttonText.innerHTML === \"Show More\") {\n buttonText.innerHTML = \"Show Less\";\n } else if (buttonText.innerHTML === \"Show Less\") {\n buttonText.innerHTML = \"Show More\";\n }\n }", "function toggle() {\n var ele = document.getElementById(\"toggleText\");\n var text = document.getElementById(\"displayText\");\n if(ele.style.display == \"block\") {\n ele.style.display = \"none\";\n text.innerHTML = \"+\";\n }\n else {\n ele.style.display = \"block\";\n text.innerHTML = \"&#8211;\";\n }\n}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function toggleText(content) {\n if (content.classList.contains('hide')) {\n content.classList.remove('hide');\n content.classList.add('show');\n } else if (content.classList.contains('show')) {\n content.classList.remove('show');\n content.classList.add('hide');\n }\n}", "function toggleText (selector, a, b) {\n return $(selector).text($(selector).text() == b ? a : b);\n}", "function toggleButton() {\n // Check to see if the button is pressed\n var unpressed = (event.target.getAttribute(\"aria-pressed\") === \"false\");\n // We can add more functionality to this script here. Toggling the aria-pressed attribute for now.\n if(unpressed) {\n // Change aria-pressed to the opposite state\n event.target.setAttribute(\"aria-pressed\", \"true\");\n } else {\n // Change aria-pressed to the opposite state\n event.target.setAttribute(\"aria-pressed\", \"false\");\n }\n}", "function setButtonText()\n {\n //if editmode\n debugger;\n\n if (!$rootScope.editMode) {\n $scope.buttonText = \"Add\";\n }\n else {\n $scope.buttonText = \"Save\";\n };\n\n }", "function toggleButtonStyle() {\r\n\tvar button = document.getElementById('button');\r\n\tbutton.classList.toggle('clicked');\r\n\tif (!lightsRunning) {\r\n\t\tbutton.innerText = 'Pause Light Sequence';\r\n\t} else {\r\n\t\tbutton.innerText = 'Restart Light Sequence';\r\n\t}\r\n}", "function transcriptToggle() {\n target = this.classList[1] - 1;\n\n if(transcript[target].classList.contains('hidden')){\n transcript[target].classList.remove('hidden');\n transcriptBtnText[target].textContent = 'Hide';\n } else {\n transcript[target].classList.add('hidden');\n transcriptBtnText[target].textContent = 'Show';\n }\n \n }", "function updateButton() {\n // My solution\n // if (!video.paused) {\n // toggle.textContent = \"││\";\n // } else {\n // toggle.textContent = \"►\";\n // }\n\n // Wes's solution\n const icon = this.paused ? \"►\" : \"││\"; // `this` used instead of `video`\n toggle.textContent = icon;\n}", "function ToggleButton (params) {\n Button.call(this, params);\n params.val = params.val || false;\n this.setVal(params.val);\n }", "function hiddenToggle($button)\n{\n var oldText = $button.text(),\n hide;\n if (oldText.substr(0, 4) == 'Show') {\n hide = false;\n $button.text('Hide' + oldText.substr(4));\n } else {\n hide = true;\n $button.text('Show' + oldText.substr(4));\n }\n return hide;\n}", "function btnChange() {\r\n let markBtm = document.getElementById(\"markUnmarkAllBtn\");\r\n if (markBtm.innerHTML == \"Markera alla\") markBtm.innerHTML = \"Avmarkera alla\";\r\n else markBtm.innerHTML = \"Markera alla\";\r\n}", "function changeToThanks(){\n\t\tdocument.getElementById(\"subBtn\").innerHTML = \"Thanks\";\n\n\n\t}", "function toggleButtonState(button) {\n button.disabled = !button.disabled;\n button.innerHTML = button.disabled\n ? '<div class=\"loading-dots\"></div>'\n : button.getAttribute('data-label');\n }", "function toggle() { // @return Boolean: true is play\r\n // false is pause\r\n switch (this.state().text) {\r\n case \"ended\": this.backend.currentTime(0);\r\n case \"pause\": this.play();\r\n return true;\r\n case \"playing\": this.pause();\r\n }\r\n return false;\r\n}", "function toggleButton() {\n document.getElementById(\"buttonEnd2\").className = 'show';\n }", "function toggleAgainstSelfBtn(show) {\n document.getElementById('against-self-btn').style.display = show ? 'inline-block' : 'none'\n}", "function changeText() {\n \n }", "_onToggleUnicodeCharsClicked(e) {\n const $el = this.$el;\n const $button = $(e.target);\n const ducsShown = !$el.hasClass('-hide-ducs');\n\n if (ducsShown) {\n $el.addClass('-hide-ducs');\n $button.text($button.data('show-chars-label'));\n } else {\n $el.removeClass('-hide-ducs');\n $button.text($button.data('hide-chars-label'));\n }\n }", "function changeBtn() {\n\t\t\tif($scope.showButton.isShow){\n\t\t\t\twindow.location.hash = '/';\n\t\t\t\t$scope.showButton.btnClass = 'btn-default';\n\t\t\t\t$scope.showButton.text = 'Show Lesson Content';\n\t\t\t\t$scope.showButton.isShow = false;\n\t\t\t\t$scope.lastViewed.person = null;\n\t\t\t} else {\n\t\t\t\twindow.location.hash = '/list';\n\t\t\t\t$scope.showButton.btnClass = 'btn-primary';\n\t\t\t\t$scope.showButton.text = 'Hide Lesson Content';\n\t\t\t\t$scope.showButton.isShow = true;\n\t\t\t}\n\t\t\t$scope.predicate = '';\n\t\t}", "function changeButtonLabel(){\n\t\t\tif(that.isPlaying){\t\t\t\t\n\t\t\t\tbutton.attr(\"class\",pause);\t\n\t\t\t}\t\t\t\n\t\t\telse{\n\t\t\t\tbutton.attr(\"class\", play);\t\t\t\n\t\t\t}\n\t\t}", "function changeJokeButtonText() {\n if (jokeState == 'setup') {\n $(\"#jokeButton\").text(punchline);\n jokeState = 'punchline';\n } else {\n $(\"#jokeButton\").text(setup);\n jokeState = 'setup';\n }\n}", "function clicked() {\r\n var val = this.textContent;\r\n if(val === \"O\"){\r\n this.textContent = \"\";\r\n }else if (val === \"\") {\r\n this.textContent = \"X\";\r\n }else if (val === \"X\") {\r\n this.textContent = \"O\";\r\n }\r\n}", "function toggleActivityFilter() {\n var btnActivity = document.getElementById(\"activityFilterToggleButton\");\n if (btnActivity) {\n if (btnActivity.innerText === \"Not in:\") {\n btnActivity.innerText = \"In:\";\n } else {\n btnActivity.innerText = \"Not in:\";\n }\n }\n}", "function toggleBtn() {\r\n this.classList.toggle(\"active\");\r\n chrome.storage.sync.set({ status: toggleBtnStatus(this) }, function() {});\r\n}", "function ShowTextButton(strFirst : String , strMiddle : String , strLast : String , strButton , obj : GameObject , funcName : String){\n//\tlabelTextButtonFirst.text = strFirst;\n//\tlabelTextButtonMiddle.text = strMiddle;\n//\tlabelTextButtonLast.text = strLast;\n\tlabelTextButton.text = strButton;\n\tptimeTextButton = Time.time + 8;\n//\tobjTextButton.SetActiveRecursively(true);\n\t//spriteBezelTextButton.enabled = false;\n\tboolTextButton = true;\n\tobjReturnButton = obj;\n\tobjFunctionName = funcName;\n}", "function toggleButton (){\n button.disabled = !button.disabled;\n}", "function setToggleButton() {\n var collapse = $toggleButton.attr(\"data-collapse\");\n var expand = $toggleButton.attr(\"data-expand\");\n if ($panels.next().hasClass('in')) {\n $panels.next().collapse('hide');\n $toggleButton.text(expand);\n $toggleButton.removeClass('closed');\n } else {\n $panels.next().collapse('show');\n $toggleButton.text(collapse);\n $toggleButton.addClass('closed');\n }\n}", "function toggle() {\r\n if (bindingsShowing) {\r\n Array.from(pianoKeys).forEach(el => {\r\n el.firstChild.style.display = \"none\";\r\n bindingsShowing = false;\r\n button.style.textDecorationLine = \"\";\r\n\r\n });\r\n } else {\r\n Array.from(pianoKeys).forEach(el => {\r\n el.firstChild.style.display = \"inline\";\r\n bindingsShowing = true;\r\n button.style.textDecorationLine = \"line-through\";\r\n });\r\n }\r\n}", "function toggleKeywords(elBtn) {\n document.querySelector('.hidden-search-terms').classList.toggle('hide');\n elBtn.innerText = (elBtn.innerText === 'Show more') ? 'Show less' : 'Show more';\n}", "function change_yes_no(){\n\t$( \"#btn_activity_check\" ).click(function() {\n\t\tvar cur_text = $(this).text();\n\t\tif( cur_text.localeCompare(\"yes\") == 0){\n\t\t\t$( this ).text(\"no\");\n\t\t}\n\t\telse{\n\t\t\t$( this ).text(\"yes\");\n\t\t}\n\t});\n}", "function captionToggle() {\n target = this.classList[1] - 1;\n\n if(shownMedia[target].textTracks[0].mode == 'showing') {\n ccBtn[target].classList.remove('ccSelected');\n shownMedia[target].textTracks[0].mode = 'hidden';\n } else {\n ccBtn[target].classList.add('ccSelected');\n shownMedia[target].textTracks[0].mode = 'showing';\n }\n }", "function triggerToggleButton(e) {\n $(e).parent().children(\"button\").click();\n}", "function ToggleButton(states, onClick) {\n var index = 0;\n var button = ui.Button(states[index].label);\n button.value = states[index].value;\n button.onClick(function() {\n index = ++index % states.length;\n button.setLabel(states[index].label);\n button.value = states[index].value;\n onClick();\n });\n return button;\n}", "function toggleBit(e) {\n if (e.text() === \"0\") { e.text(1); }\n else { e.text(0); }\n}", "function updateButton(onclickFxn, text, opt_class) {\n // Clear button content.\n var buttonDiv = d3.select('.button-div');\n buttonDiv.html('');\n\n buttonDiv\n .append('button')\n .attr('id', 'transition-button')\n .text(text)\n .attr('class', opt_class)\n .on('click', onclickFxn);\n\n if (text == 'See Benefits') {\n buttonDiv.append('div').attr('id', 'bills-apply');\n }\n}", "function changeButtonStatus(event, disabled){\n var target = event.target;\n target.disabled = disabled;\n\n // showing status to user\n if(disabled)\n target.innerHTML = 'Mosaicing...';\n else\n target.innerHTML = 'Mosaic It';\n}", "function toggler_cards(btn, card, msg){\n $(btn).click(function(){ \n if ($(this).text() == msg) \n $(this).text(\"Close\"); \n else \n $(this).text(msg); \n $(card).slideToggle();});\n }", "function toggle() {\n let moreLessButton = document.getElementsByClassName(\"button\")[0];\n let extraDiv = document.getElementById(\"extra\");\n if (moreLessButton.textContent == \"More\") {\n extraDiv.style.display = \"block\";\n moreLessButton.textContent = \"Less\";\n } else {\n extraDiv.style.display = \"none\";\n moreLessButton.textContent = \"More\";\n }\n}", "function toggleThisContent(elm) {\n\telm = document.getElementById(elm).style;\n\t(elm.display == 'none') ? (elm.display = 'block') : (elm.display = 'none');\n\t\n\tvar text = document.getElementById('ns_show_info_button');\n\t(text.innerHTML == 'Show Install Info') ? (text.innerHTML = 'Hide Install Info') : (text.innerHTML = 'Show Install Info');\n\t\n//\tvar copy = document.getElementById('ns_copy_to_cp_button');\n//\t(copy.innerHTML == '') ? (copy.innerHTML = 'Copy to Clipboard') : (copy.innerHTML = '');\n}", "function updateButton(button, clicked) {\n button.innerText = clicked ? \"Pause\" : \"Animate\";\n updateColor(button, button.value);\n}", "function toggleButton(){\n button.disabled = !button.disabled;\n}", "function switchButtonState(text) {\n if (text == \"New Game\") {\n return \"Pause\";\n } else if (text == \"Pause\") {\n return \"Resume\";\n } else if (text == \"Resume\") {\n return \"Pause\";\n } else {\n return \"should never happen\";\n }\n}", "toggle() {\n this.enabled = !this.enabled;\n }", "getButtonTitle(){\n if(this.state.expanded){\n return 'View Less';\n }\n return 'View More';\n }", "function buttonClick2() {\n document.getElementById(\"textclick\").innerHTML = \"Text Changed\";\n}", "function setState(text, url, dispFun) {\n var button;\n\n button = E.elements.content.menu.route.result.toggleAdvanced;\n\n button.text(text);\n button.attr('href', url);\n\n dispFun();\n }", "function toggleIntroText(){\n introText.style.display = 'none'\n}", "function switchToggle() {\n\t\t\t\t\t$scope.isToggleOn = !$scope.isToggleOn;\n\t\t\t\t}", "function toggleButton() {\n if (messageInputElement.value) {\n submitButtonElement.removeAttribute('disabled');\n } else {\n submitButtonElement.setAttribute('disabled', 'true');\n }\n }", "function changeButton() {\n const result = document.querySelector('#startstop');\n const state = result.textContent;\n if(state == 'Start') {\n result.textContent = 'Stop';\n result.setAttribute('class', 'stopbutton');\n }\n else {\n result.textContent = 'Start';\n result.setAttribute('class', 'startbutton');\n }\n}", "function ToggleWidget(ontxt,offtxt) {\n\tWidget.apply(this);\n\tvar onlink = A({href:'javascript:undefined'},ontxt);\n\tvar offlink = A({href:'javascript:undefined'},offtxt);\n\tthis.events.toggleOn = extractEvent_e(onlink,'click').constant_e(true);\n\tthis.events.toggleOff = extractEvent_e(offlink,'click').constant_e(false);\n\tthis.events.toggle = merge_e(this.events.toggleOn,this.events.toggleOff);\n\tthis.behaviors.toggled = this.events.toggle.startsWith(false);\n\tthis.dom = this.behaviors.toggled.transform_b(function(t) {return t ? offlink : onlink;});\n}", "function makeBold(elem){\n //CODE GOES HERE\n //console.log(elem);\n\n // if you inspect the click button and click the bold it will turn on the class 'active'\n elem.classList.toggle('active'); // Makes the button active when click\n\n // if you click the bold button this will turn the output text to bold\n document.getElementById('text-output').classList.toggle('bold');\n}", "function toggleMainMenu() {\n console.log(\"Opening Main Menu\");\n toggle(Button1); //Show\n toggle(Button2); //Show\n toggle(Button3); //Show\n toggle(Button4); //Show\n toggle(Button5); //Show\n toggle(Button6); //Show\n toggle(Button7); //Show\n toggle(Button8); //Show\n toggle(Button9); //Show\n toggle(Button10); //Show\n toggle(Button11); //Show\n toggle(Button12); //Show\n toggle(Button5); //Hide\n toggle(Button6); //Hide\n toggle(Button7); //Hide\n toggle(Button8); //Hide\n toggle(Button9); //Hide\n toggle(Button10); //Hide\n toggle(Button11); //Hide\n toggle(Button12); //Hide\n \n //Set Button Text\n Button1.text = \"Bible\";\n Button2.text = \"Bible Plan\";\n Button3.text = \"Daily Verse\";\n Button4.text = \"Random\";\n}", "function changeBtnTxt(id, txt){\n\n var btn = document.getElementById(id);\n\n btn.textContent = txt;\n\n}", "function restoreBtn() {\n $btn.prop('disabled', false);\n $btn.html('<i class=\"fa fa-fighter-jet\"></i>&nbsp;Compare</button>');\n }", "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function toggleImportant(){\n\n console.log(\"btnImportant clicked\");\n\n if(!important){\n UI.$btnImportant.removeClass(\"far active\");\n UI.$btnImportant.addClass('fas');\n important = true;\n }\n else{\n UI.$btnImportant.removeClass('fas');\n UI.$btnImportant.addClass(\"far\");\n important = false;\n }\n}", "toggleButton() {\n if (this.noteMessageInput.value) {\n this.addNoteButton.removeAttribute(\"disabled\");\n } else {\n this.addNoteButton.setAttribute(\"disabled\", \"true\");\n }\n }", "function toggleButtonOldestNewest() {\n var button = document.getElementById(\"btnOldestToNewest\");\n\n if (button) {\n if (button.value === \"1\") {\n button.value = \"0\";\n button.innerText = \"Newest to Oldest\";\n } else {\n button.value = \"1\";\n button.innerText = \"Oldest to Newest\";\n }\n }\n}", "onToggleClick() {\n if (this.disabled) {\n return;\n }\n const newChecked = this.isSingleSelector ? true : !this._checked;\n if (newChecked !== this._checked) {\n this._checked = newChecked;\n if (this.buttonToggleGroup) {\n this.buttonToggleGroup.syncButtonToggle(this, this._checked, true);\n this.buttonToggleGroup.onTouched();\n }\n }\n // Emit a change event when it's the single selector\n this.change.emit(new McButtonToggleChange(this, this.value));\n }", "function toggleBox() {\n var sw = document.getElementById('switchview');\n var xtext = document.getElementById('toggler');\n if ( sw.checked == null || !sw.checked ) {\n xtext.setAttribute('checked', 'false');\n xtext.style.color = 'gray';\n formatPath = '/scripts/raw/';\n }\n else {\n xtext.style.color = 'black';\n formatPath = '/scripts/formatted/';\n }\n}", "function toggle() {\n setIsToggledOn(prev => !prev)\n }", "toggle(){\r\n if(this.state.disp === 'password'){\r\n this.setState({disp:'text', text: 'hide'})\r\n }\r\n else\r\n this.setState({disp:'password', text: 'show'})\r\n }", "toggle(){this.off=!this.off}" ]
[ "0.75863296", "0.74920326", "0.74669135", "0.71418184", "0.71360373", "0.71200794", "0.7113546", "0.709027", "0.7084675", "0.7077539", "0.70735127", "0.70667493", "0.7046846", "0.70334065", "0.69910175", "0.6945896", "0.69451416", "0.6885776", "0.6867392", "0.6808607", "0.6793926", "0.6752358", "0.673999", "0.673999", "0.673999", "0.6736774", "0.67087007", "0.6671249", "0.6654793", "0.6641884", "0.6627736", "0.6618656", "0.6618656", "0.6617169", "0.66000956", "0.658673", "0.6584731", "0.65689915", "0.6560063", "0.65500456", "0.6543492", "0.6542837", "0.6522937", "0.65048087", "0.6501609", "0.6490364", "0.64869785", "0.6479988", "0.6478814", "0.64666694", "0.64592826", "0.643207", "0.6409588", "0.64041984", "0.6396126", "0.6395519", "0.63946664", "0.63868207", "0.63313717", "0.6325158", "0.63173544", "0.63151485", "0.63020045", "0.6288771", "0.62829757", "0.62792975", "0.62773955", "0.62747914", "0.62727904", "0.6271732", "0.62657297", "0.62627006", "0.6258821", "0.624609", "0.6236468", "0.6232946", "0.6230326", "0.6225459", "0.6215712", "0.6212162", "0.6210286", "0.62100315", "0.6203967", "0.6201673", "0.6195929", "0.61957425", "0.61937976", "0.61937886", "0.6190636", "0.6188528", "0.6183904", "0.6183239", "0.61814207", "0.6178627", "0.6174499", "0.61653566", "0.6165069", "0.6164444", "0.61616325", "0.6153772", "0.61536115" ]
0.0
-1
Update the data so that the text is toggled properly
function set_button(user_id, value) { $('.manage-button').each( (_, bb) => { if (user_id == $(bb).data('user-id')) { $(bb).data('manage', value); } }); update_buttons(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function labelUpdate(axis, clickText) {\n // Switch old choice off\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n \n // switches new choice on\n clickText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function switchtext(){\n\t\t$(\"ol\").html(\"falseFact\");\n\t\t$(\"ol\").html(\"TrueFact\");\n\t\n\t}", "function updateData(data) {\n // Updates text\n $(\".mainTextP\")[0].innerHTML = data.message;\n $(\".supportTextP\")[0].innerHTML = data.extra;\n }", "function updatePredictButtonText(text) {\n document.querySelector(\".c8a11y-predict-toggle-button\").innerHTML =\n text;\n }", "function updateData(data) {\n // data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "function changeText() {\n \n }", "function changeToggleText() {\n\n\t// change to default button\n\tif (!$(\"#search-button\").is(\":visible\")) $(\".main-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n\tif (!$(\"#deselect-all\").is(\":visible\")) $(\".selection-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n} // changeToggleText", "function UpdatePageText()\n{\n\t// If the toggle is false, set to inches\n\tvar labelUnits = (_buttonState) ? _millimetersAbbrev : _inches;\n\tvar tipUnits = (_buttonState) ? _millimeters : _inches;\n\t\t\n\t// Clear out previous calculated value\n\tjQuery('.calculated-value').html(\"- -\");\n\t\n\t// Update input/output unit labels\n\tjQuery('.output-units').html(labelUnits);\n\tjQuery('.input-units').html(labelUnits);\n\t\n\t// Update tooltips\n\tjQuery('#item-length-tip').attr(\"tip\", \"Length, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#item-width-tip').attr(\"tip\", \"Width, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#item-height-tip').attr(\"tip\", \"Height, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#plywood-thickness-tip').attr(\"tip\", (_buttonState) ? '9.5mm is recommended' : '3/8\" is recommended');\n\tjQuery('#frame-thickness-tip').attr(\"tip\", (_buttonState) ? '38mm is recommended' : '1.5\" is recommended');\n}", "function toggleInfo() {\n\t\t\tvm.info = !vm.info;\n\t\t}", "toggleInfo(index, label) {\n console.log('this is index', index);\n\n if(this.state.data[index].visible === true) {\n this.state.data[index].visible = false;\n \n } else {\n this.state.data[index].visible = true;\n\n } \n this.setState({\n data: this.state.data,\n \n });\n }", "updateLabel() {\n this.text = this._text;\n }", "updateLabel() {\n this.text = this._text;\n }", "function updateButton() {\n const icon = this.paused ? '►' : \"&#10074&#10074;\";\n toggle.innerHTML = icon;\n // more on textContent VS innerHTML: https://www.w3schools.com/jsref/prop_node_textcontent.asp#:~:text=The%20innerHTML%20property%20returns%20the,but%20without%20inner%20element%20tags.\n}", "function updateToggleState( $toggle, $content ) {\n\t\t\tif( $toggle.hasClass('expanded') ) {\n\t\t\t\t$content.show();\n\t\t\t\t$toggle.text( $toggle.text().replace(/Show/g, 'Hide') );\n\t\t\t} else {\n\t\t\t\t$content.hide();\n\t\t\t\t$toggle.text( $toggle.text().replace(/Hide/g, 'Show') );\n\t\t\t}\n\t\t}", "#updateData() {\n this.container.querySelector('.data').innerHTML = this.data;\n }", "function factChange() {\n $('.falseFact').text('True Fact');\n }", "updateText(text) {\n\t\tthis.text = text;\n\t}", "function updateText() {\n $('#title').text(TEXT.getText('title'));\n $('#home').text(TEXT.getText('home'));\n $('#stations_map').text(TEXT.getText('stations_map'));\n\n $('#station_list_text_tab').text(TEXT.getText('stations_list'));\n $('#location_text').text(TEXT.getText('location'));\n\n // WARNING\n // Update text only if no location is set\n let location = $('#location_name').text();\n if(location === TEXT.getTextLocalize('no_location', 'fr') || location === TEXT.getTextLocalize('no_location', 'en')) {\n $('#location_name').text(TEXT.getText('no_location'));\n }\n\n $('#state > h3').text(TEXT.getText('station_state'));\n $('#table_state_id').text(TEXT.getText('id_station'));\n $('#table_state_ba').text(TEXT.getText('bicycles_available'));\n $('#table_state_blocked').text(TEXT.getText('blocked'));\n $('#table_state_ta').text(TEXT.getText('terminals_available'));\n $('#table_state_suspended').text(TEXT.getText('suspended'));\n $('#table_state_bu').text(TEXT.getText('bicycles_unavailable'));\n $('#table_state_ooo').text(TEXT.getText('ooo'));\n $('#table_state_tu').text(TEXT.getText('terminals_unavailable'));\n\n $('#liste > h3').text(TEXT.getText('stations_list'));\n $('#table_list_name').text(TEXT.getText('station_name'));\n $('#table_list_b').text(TEXT.getText('bicycles_available'));\n $('#table_list_t').text(TEXT.getText('terminals_available'));\n $('#table_list_blocked').text(TEXT.getText('blocked_state'));\n $('#table_list_suspended').text(TEXT.getText('suspended_state'));\n\n}", "function update(data) {\n\n // data join\n var text = svg.selectAll(text).data(data);\n\n //update\n text.attr(\"class\", \"update\");\n\n //enter\n text.enter().append(\"text\")\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d, i) { return i * 32 }) // cuz it's a monospaced font\n .attr(\"dy\", \".35em\");\n\n //enter + update\n text.text(function(d) {return d;});\n\n //exit\n text.exit().remove();\n\n}", "updateTexts() {\n super.updateTexts();\n\n this.updatePlayerTexts();\n this.updateTop5Text();\n }", "function datatextswap(){\n\t\tvar elements = document.getElementsByClassName('js-text-swap');\n\n\t\t[].forEach.call(elements, function(element) {\n\n\t element.addEventListener('click', function(e) {\n\n\t e.preventDefault();\n\n\t\t\t if (element.getAttribute(\"data-text-swap\") == element.innerHTML) {\n\t\t\t element.innerHTML = element.getAttribute(\"data-text-original\");\n\t\t\t } else {\n\t\t\t element.setAttribute(\"data-text-original\", element.innerHTML);\n\t\t\t element.innerHTML = element.getAttribute(\"data-text-swap\");\n\t\t\t }\n\t\t\t}, false);\n\n\t });\n\t}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function expand(){\n var text = \"Read More\"\n console.log(text);\n if (text = \"Read More\") {\n $(\".expand\").show(\"fast\");\n $(\"#readmore2\").html(\"Read Less\");\n text = \"Read Less\";\n console.log(text);\n } else {\n $(\".expand\").hide(\"fast\");\n text = $(\"#readmore2\").html(\"Read Less\");\n}\n}", "function toggleText() {\r\n var text = document.getElementById(\"instructions\");\r\n if (text.style.display === \"none\") {\r\n text.style.display = \"block\";\r\n } else {\r\n text.style.display = \"none\";\r\n }\r\n }", "function updateButton() {\n const icon = this.paused ? \">\" : \"||\";\n selectors.toggle.textContent = icon;\n}", "toggleLabels() {\n this.areLabelsShown = !this.areLabelsShown;\n this.labelsGroup.visible = this.areLabelsShown;\n\n this.render();\n }", "function updateButton(){\n\tconst icon = this.paused ? \"►\" : \"❚ ❚\";\n\ttoggle.textContent = icon;\n}", "function onClick() {\n setShowData(false);\n }", "@action updateDataToShow(value) {\n this.dataToShow = value;\n this.selectedData = this.data[0].details;\n this.activeDetailTab = this.data[0].label;\n }", "function updateStepperMotor(data) {\n $('#motor_position').text(data['motor']['position']);\n if (data['motor']['state'] === '1') {\n $('#motor_state').toggleClass('label-default', false);\n $('#motor_state').toggleClass('label-success', true);\n } else if (data['motor']['state'] === '0') {\n $('#motor_state').toggleClass('label-default', true);\n $('#motor_state').toggleClass('label-success', false);\n }\n }", "function updateData() {\n\n // Select the section we want to apply our changes to\n var svg = d3.select(\"body\").transition();\n\n // Make the changes\n svg.select(\".line\")\n .duration(750)\n .style(\"transform\", \"scaleY(.6)\");\n svg.select(\".x.axis\") // change the x axis\n .duration(750)\n .call(xAxis);\n svg.select(\".y.axis\") // change the y axis\n .duration(750)\n .call(yAxis);\n \n var x = document.getElementById(\"added-food\");\n if (x.style.display === \"\" | x.style.display === \"none\") {\n x.style.display = \"inline-block\";\n }\n }", "toggleUpdate() {\n $(\"[data-button='update']\").find(\"i\").toggleClass(\"grey\");\n }", "onToggle() {}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function toggleText(content) {\n if (content.classList.contains('hide')) {\n content.classList.remove('hide');\n content.classList.add('show');\n } else if (content.classList.contains('show')) {\n content.classList.remove('show');\n content.classList.add('hide');\n }\n}", "function changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function toggleDescription() {\n self.showingDescription = !self.showingDescription;\n }", "function toggleTitle(elem) {\n data = {\n \"name\":document.getElementById('event').value,\n \"title\":elem.childNodes[1].value,\n \"date\": d.getMonth().toString() + \"/\" + d.getDate().toString() + \"/\" + d.getFullYear().toString()\n }\n dataString = JSON.stringify(data).replace(/\\\"/g,\"\\\\\\\"\")\n var titleName = elem.dataset.title\n var titleIndex = getChildNumber(elem) + 1\n if (!activeTitle) {\n console.log(\"!activeTitle\")\n //UPDATE AND PLAY TITLE\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" UPDATE 1 \\\"\" + dataString +\"\\\"\")\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" PLAY 1\")\n // send(\"CG 1-20 ADD 1 \\\"\" + titleName + \"\\\" 1 \\\"\" + dataString +\"\\\"\")\n activeTitle = \"trans\"\n setTimeout( () => {\n activeTitle = titleIndex\n },1000)\n }else if (activeTitle == titleIndex) {\n console.log(\"activeTitle == titleIndex\")\n send(\"CG 1-\" + (activeTitle + 20).toString() +\" STOP 1\")\n activeTitle = \"trans\"\n setTimeout( () => {\n activeTitle = null\n },1000)\n //activeTitle = null\n } else if (activeTitle == \"trans\"){\n console.log(\"transitioning\")\n } else {\n console.log(\"else\")\n send(\"CG 1-\" + (activeTitle + 20).toString() +\" STOP 1\")\n activeTitle = \"trans\"\n setTimeout( () => {\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" UPDATE 1 \\\"\" + dataString +\"\\\"\")\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" PLAY 1\")\n setTimeout( () => {\n activeTitle = titleIndex\n },1000)\n },1000)\n }\n\n}", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3\n .selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function toggle(){\n\tif(CijiJeRed==0)CijiJeRed=1;\n\telse CijiJeRed=0;\n\t\n\tdocument.getElementById(\"poruka-u-igri\").innerText = \"Red je na igrača \" +igraci[CijiJeRed];\n}", "function updateText(ev) {\n setText(ev.target.value);\n }", "function switchtext(){\n\t\t$(\"h2\").html(\"Christina\");\n\t}", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function toggleProfileData() {\n toggleElement('profileInfo');\n}", "function updateButton(){\n const icon = this.paused ? '►' : '❚ ❚';\n toggleButton.textContent = icon;\n}", "updateMarked(text) {\n this.setState({ text: text });\n }", "function toggleMove(){ //Toggle between Viewing and Moving\n if(modeArray.viewingMode){ //Only runs if viewing is enabled\n if(!modeArray.movingMode){ //Swap to Moving\n modeArray.movingMode =true;\n document.getElementById(\"Mode\").innerText = \"Moving\"; //Update mode text\n document.getElementById(\"btnToggleMove\").innerText = \"Stop Moving\"; //Update toggle button text\n }\n else{\n modeArray.movingMode =false; //Swap back to Viewing\n document.getElementById(\"btnToggleMove\").innerText = \"Move Marker\"; //Update toggle button text\n document.getElementById(\"Mode\").innerText = \"Viewing\"; //Update mode text\n }\n }\n}", "update (text) {\n if (text !== this.text) {\n this.text = text\n this.element.innerText = this.text // Directly update the element\n }\n return false // Don't call createElement again\n }", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "changeDisplay() {\n this.displayMarkup = !this.displayMarkup;\n }", "toggleInfo() {\n this.setState((prevState, props) => ({\n // here we invert our showInfo boolean by using the \n // previous state and the ! exclamation mark\n showInfo: !prevState.showInfo\n }));\n }", "function toggleInfo() {\n if (infoContainer.style.display === 'none') {\n infoContainer.style.display = 'block';\n infoBtn.innerText = 'Less Info';\n infoContainer.innerText = info;\n } else {\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n }\n }", "showDescription() {\n ui.toggleDescription();\n }", "function handleDataToggling () {\n\t\tvar len,\n\t\t\ti,\n\t\t\tj,\n\t\t\tnumOfPages,\n\t\t\tendIndex,\n\t\t\titem;\n\n\t\t// If the key for data display is changed then just update the anchor blocks \n\t\t// which by default happens in descending order.\n\t\tif (prevStorageKey !== storageKey) {\n\t\t\tupdateGrid(0, scrollElm.length);\n\t\t}\n\t\t// The flow enters this block when the order of the same key against which the\n\t\t// elemnts are displayed is changed.\n\t\telse {\n\t\t\tlen = scrollElm.length;\n\t\t\tnumOfPages = Math.floor(len / maxResult);\n\n\t\t\tendIndex = lastDrawIndex + (maxResult - lastDrawIndex % maxResult);\n\t\t\t// Drawing all the scroll element of the current page\n\t\t\tupdateGrid(lastDrawIndex, endIndex);\n\n\t\t\tfunction helperFN (i, j) {\n\t\t\t\tindex = maxResult * j + i;\n\t\t\t\titem = scrollElm[index];\n\t\t\t\titem && item.appendTo('#scroller');\n\t\t\t}\n\n\t\t\tfor (j = 0; j <= numOfPages; j++) {\n\t\t\t\tif (order === 'ascending') {\n\t\t\t\t\tfor (i = maxResult - 1; i >= 0; i--) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (i = 0; i < maxResult; i++) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprevStorageKey = storageKey;\n\t}", "function toggleText() {\n $('#sunny-city-list').addClass('hide-text');\n setTimeout(() => {\n $('#sunny-city-list').removeClass('hide-text')\n }, 250)\n}", "function toggle() { // @return Boolean: true is play\r\n // false is pause\r\n switch (this.state().text) {\r\n case \"ended\": this.backend.currentTime(0);\r\n case \"pause\": this.play();\r\n return true;\r\n case \"playing\": this.pause();\r\n }\r\n return false;\r\n}", "function toggleState(item){\n if($(item).attr(\"data-tog\") == \"0\") {\n $(item).attr(\"data-tog\",\"1\");\n } \n else {\n $(item).attr(\"data-tog\", \"0\");\n }\n}", "function changeText(value) {\n // would .textContent work instead of .innerHTML?\n document.getElementById('status-line').innerHTML = value;\n\n if (value === 'SENDING') {\n // document.getElementById(\"status-line\").classList.toggle('sending');\n document.getElementById(\"status-line\").className = 'sending';\n\n } else if (value === 'READY') {\n // document.getElementById(\"status-line\").classList.toggle('complete');\n document.getElementById(\"status-line\").className = 'ready';\n console.log(\"text box:\", document.getElementById('text-box').value);\n document.getElementById('text-box').value = '';\n }\n}", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}", "function update(data){\n\n //2. Data Join\n var text = svg.selectAll(\"text\")\n .data(data);\n\n //3. Update\n // data nodes that match up\n text.attr(\"class\", \"update\");\n\n //4. Enter \n text.enter().append(\"text\") //appends a text svg element to enter?\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d, i){ return i*32} ) // d = data, i = index of data, 32px is the size of each letter\n .attr(\"dy\", \"0.35em\")\n .attr(\"fill\", \"hotpink\");\n\n //5. Enter + Update\n text.text(function(d) { return d; } );\n\n //6. Exit\n text.exit().remove();\n}", "function show_feedback_anal(){\n $(\"#feedback_chart_button\").toggle(\"fast\");\n $(\"#feedback_anal_filter\").toggle(\"fast\");\n $(\"#feedback_row\").toggle(\"slow\");\n \n $(\"#feedback_anal_row\").toggle(\"slow\");\n\n \n }", "function updateSampleCountDisplay() {\n $('.message-nn1-true').html(NN1TrueDataArray.length);\n $('.message-nn1-false').html(NN1FalseDataArray.length);\n $('.message-nn2-true').html(NN2TrueDataArray.length);\n $('.message-nn2-false').html(NN2FalseDataArray.length);\n }", "updateData() {\n this.reset();\n\n if (this.cryptoConnect) {\n this.dataLabel(this.crypto, 'crypto', this.crypto.Symbol, this.Currency, 'Percent24H');\n }\n else if (this.serverFiat === 'RU') {\n this.dataLabel(this.fiatRU, 'fiat', this.Currency, 'RUB', 'Percent');\n }\n else {\n this.dataLabel(this.fiatEU, 'fiat', $t.fiatName.EUR, this.Currency, 'Percent');\n }\n }", "function initTogglebox() {\n\t\t$(\".g_block_togglebox\").each(function(){\n\t\t\tvar toggleBox = this;\n\t\t\tvar showHideLink = $(\".g_togglebox_head a\", toggleBox);\n\t\t\tshowHideLink.data(\"toggleText\", \"Skjul indhold\"); //Save hide text in the dataobject\n\t\t\t\n\t\t\t$(\".g_togglebox_head\", toggleBox).click(function(event){\n\t\t\t\tevent.preventDefault(); //Prevent the default click event to fire\n\t\t\t\t$(toggleBox).toggleClass(\"g_visible\"); //Toggle a class to indicate that the content is visible/hidden\n\t\t\t\t$(\".g_togglebox_content\", toggleBox).slideToggle();\t//Toggle the content\n\t\t\t\t\n\t\t\t\t//Change the wording of the link\n\t\t\t\tvar currentHtml = showHideLink.html();\t//Save the current value\n\t\t\t\tshowHideLink.html(showHideLink.data(\"toggleText\")).data(\"toggleText\", currentHtml); //Set new html and save the old in the dataobject\n\t\t\t});\n\t\t});\n\t}", "function expand() {\n const showContent = document.getElementById(this.dataset.target)\n //Er wordt in de HTML gekeken voor een id dataset.target\n\n if (showContent.classList.contains('expand-active')) {\n this.innerHTML=this.dataset.showtext\n } \n //Als de class van de showcontent element 'expand-active' bevat verandert deze naar showtext.\n \n else {\n this.innerHTML=this.dataset.hidetext\n }\n //Als dit niet waar is en de class expand active niet bevat wordt de text gehide.\n\n showContent.classList.toggle('expand-active')\n //Toggle de expand-active class\n }", "toggleCase() {\n\n this.isLowerCase = !this.isLowerCase;\n\n this.keys.forEach( ( key ) => {\n\n const char = key.info.chars[ key.panel.charset ] || key.info.chars[ 0 ];\n\n const newContent = this.isLowerCase || !char.upperCase ? char.lowerCase : char.upperCase;\n\n const textComponent = key.children.find( child => child.isText );\n\n if ( !textComponent ) return\n\n key.info.input = newContent;\n\n textComponent.set({\n content: newContent\n });\n\n textComponent.update( true, true, true );\n\n });\n\n }", "function updateData(data) {\n const updated = createContainer(data);\n main.innerHTML = \"\";\n main.append(updated);\n}", "function changeSlideText(slideToChange, slideText) {\r\n slideToChange.data.text = slideText;\r\n runUpdateTimer();\r\n}", "function changeInfo () {\n \n let trigFile = carData[this.id];\n mdName.firstChild.nodeValue = trigFile.modelName;\n priceInfo.firstChild.nodeValue = trigFile.priceInfo;\n mdDetails.firstChild.nodeValue = trigFile.modelDetails;\n \n \n // opacity changes for active and nonactive classes \n theData.forEach(function(vehicle){\n vehicle.classList.add('nonActive');\n });\n \n this.classList.remove(\"nonActive\");\n }", "function updateStateTexts(dataLabel, axis, newScale, chosenAxis) {\n dataLabel.transition()\n .duration(1000)\n .attr(axis, d => newScale(d[chosenAxis]));\n return dataLabel;\n}", "function toggle(){\r\n\ttoggleResult();\r\n\t// toggleSearch();\r\n}", "function changeData() {\n elem.name = userData.name;\n elem.star = userData.star;\n elem.time = userData.time;\n elem.moves = userData.moves;\n}", "function toggleContent() {\n\n\t\t\t\t$thisContainer.css('height', $thisContainer.outerHeight());\n\n\t\t\t\t$thisContent.css({\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'left': 0,\n\t\t\t\t\t'right': 0\n\t\t\t\t});\n\n\t\t\t\tTweenMax.set($thisContent, {\n\t\t\t\t\tautoAlpha: 0,\n\t\t\t\t\t'z-index': -1\n\t\t\t\t});\n\n\t\t\t\tif ( arguments[0] === false ) return;\n\n\t\t\t\tvar $initialContent = $thisContent.filter('[data-id=\"' + initialDataAtr + '\"]');\n\n\t\t\t\t$initialContent.css('z-index', 2);\n\n\t\t\t\tTweenMax.to($initialContent, animationSpeed, {\n\t\t\t\t\tautoAlpha: 1\n\t\t\t\t});\n\t\t\t}", "function setToggleButton() {\n var collapse = $toggleButton.attr(\"data-collapse\");\n var expand = $toggleButton.attr(\"data-expand\");\n if ($panels.next().hasClass('in')) {\n $panels.next().collapse('hide');\n $toggleButton.text(expand);\n $toggleButton.removeClass('closed');\n } else {\n $panels.next().collapse('show');\n $toggleButton.text(collapse);\n $toggleButton.addClass('closed');\n }\n}", "function toggle() {\r\n //if the object is current hidden\r\n if (hidden) {\r\n //set display to be on in block form\r\n document.getElementById('output').style.display = 'block';\r\n //and set the status to currently visible\r\n hidden = false;\r\n }\r\n //otherwise it is implied that it is visible\r\n else {\r\n //set the status to hidden\r\n hidden = true;\r\n //set the objects display to be off\r\n document.getElementById('output').style.display = 'none';\r\n }\r\n }", "function updateNetworkDisplay(on) {\n networkDom.text(on ? 'on' : 'off');\n networkDom.toggleClass('label-success', on);\n networkDom.toggleClass('label-important', !on);\n }", "toggle(dataNode) {\n if (this.filterValue.value) {\n return;\n }\n this.expansionModel.toggle(dataNode);\n }", "function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n chart.render();\n }", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "toggleCredits() {\n this.progress.showCredits = !this.progress.showCredits;\n\tthis.setChanged();\n\tthis.notifyObservers(this.progress);\n\tthis.clearChanged();\n }", "toggleHelpers() {\n if (this.helper) {\n this.helper = false;\n $(document.getElementsByClassName('help')[0]).css('color', 'white');\n this.els.rhymes.hidden = true;\n this.els.rhymes_below.hidden = true; \n }\n else if (this.definition) {\n console.log(this.definition); \n this.helper = true;\n this.els.rhymes.textContent = this.word[4];\n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n this.els.rhymes.hidden = !this.els.rhymes.hidden;\n } else {\n this.helper = true;\n this.els.rhymes_below.textContent = this.word[4];\n this.els.rhymes_below.hidden = !this.els.rhymes_below.hidden; \n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n \n }\n }", "function rerenderDoughnutByToggles() {\n filterTransactions();\n rerenderDoughnut();\n renderHeading();\n translatePage();\n}", "function changeText(){\r\n var isChecked=$(\"input\")[0].checked;\r\n if(isChecked===true)\r\n {\r\n $(\".basic ul .h1\").html(\"$19.99\");\r\n $(\".profession ul .h1\").html(\"$49.99\");\r\n $(\".master ul .h1\").html(\"$39.99\");\r\n }\r\n else if(isChecked===false)\r\n {\r\n $(\".basic ul .h1\").html(\"$199.99\");\r\n $(\".profession ul .h1\").html(\"$499.99\");\r\n $(\".master ul .h1\").html(\"$399.99\");\r\n }\r\n}", "function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n } else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }", "function updateButton(onclickFxn, text, opt_class) {\n // Clear button content.\n var buttonDiv = d3.select('.button-div');\n buttonDiv.html('');\n\n buttonDiv\n .append('button')\n .attr('id', 'transition-button')\n .text(text)\n .attr('class', opt_class)\n .on('click', onclickFxn);\n\n if (text == 'See Benefits') {\n buttonDiv.append('div').attr('id', 'bills-apply');\n }\n}", "function changeDataAndToggleActive(event, value) {\n // GET CURRENT ACTIVE CLASS AND REMOVE\n let current = document.getElementsByClassName(\"active\")[0];\n current.classList.remove(\"active\");\n\n // ADD ACTIVE CLASS TO CLICKED ELEMENT\n event.classList.add(\"active\");\n\n // CHANGE CHART DATA SET WHEN CLICKED\n trafficChart.data.datasets[0].data = value;\n trafficChart.update()\n}", "function toggleAlgo(algoName){\n document.getElementById(\"algoIndicator\").innerHTML=algoName;\n console.log(algoName)\n}", "function setState(text, url, dispFun) {\n var button;\n\n button = E.elements.content.menu.route.result.toggleAdvanced;\n\n button.text(text);\n button.attr('href', url);\n\n dispFun();\n }", "function toggle(cmd,data) {\n\n var fnWhenDone = function(oAnswer, sData) {\n var values = eval('(' + oAnswer.responseText + ')');\n if(values && values.data && typeof(values.data) == 'object'){\n var className;\n var imageExt = ie5&&!opera ? \"gif\" : \"png\";\n for (var i = 0; i < values.data.length; i++) {\n var x = values.data[i];\n if(x.length == 4 && x[0]) {\n var tid = x[0];\n var ton = x[1] * 1;\n var trun = x[2] * 1;\n var tcon = x[3] * 1;\n\n var img = document.getElementById('toggle' + tid);\n if(img) {\n if(ton) {\n if(tcon)\n className = 'problem';\n else if(trun)\n className = 'running';\n else\n className = '';\n img.src = 'images/on.' + imageExt;\n } else {\n className = 'deactive';\n img.src = 'images/off.' + imageExt;\n }\n\n\n var elememts = new Array;\n var a = document.getElementById('item' + tid);\n if(a) { elememts.push(a); }\n var b = document.getElementById('desc' + tid);\n if(b) { elememts.push(b); }\n\n for (var n = 0; n < elememts.length; n++) { \n var elem = elememts[n].getElementsByTagName('font');\n for (var j = 0; j < elem.length; j++) {\n var classList = elem[j].className.split(' ');\n\n for ( var k = 0; k < classList.length; k++ ) {\n if( classList[k] == 'deactive' //remove class\n || classList[k] == 'problem' \n || classList[k] == 'running') \n classList.splice(k, 1);\n }\n\n if(className) //add class\n classList[classList.length] = className;\n\n elem[j].className = classList.join(' ');\n }\n }\n }\n }\n }\n }\n };\n\n var tt = data.split('_');\n for (var l = 0; l < tt.length; l++) {\n var timg = document.getElementById('toggle' + tt[l]);\n if(timg) {\n timg.src = 'images/wait.gif';\n }\n }\n\n // Hmm, brutal und gemein, das Laden der URL als Bild funktioniert...\n var url = \"?cmd=\" + cmd + \"&data=\" + data + \"&ajax=json\";\n if(ie5&&!opera) //Avoid use cache\n url += \"&random=\" + (Math.random() * Date.parse(new Date()));\n var aconn = new XHRequest();\n if(!aconn)\n return;\n aconn.connect(url, fnWhenDone, data);\n}", "function changeLabelText(innerLabel, innerText) {\n\t\t$(\".innerLabel\").fadeOut( () => {\n\t\t\t$(\".innerLabel\").html(innerLabel);\n\t\t});\n\t\t$(\".innerText\").fadeOut( () => {\n\t\t\t$(\".innerText\").html(innerText);\n\t\t});\n\t\t$(\".innerLabel\").fadeIn();\n\t\t$(\".innerText\").fadeIn();\n}", "function switchtext(){\n\t\t$(\"h1\").html(\"jQuery Ninja\");\n\t\n\t}", "function setUpdateEvent(data){\n\t\tvar theID = '#' + data.doc._rev;\n\t\t$(theID).click(function(){\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc._rev == data.doc._rev){\n\t\t\t\t\tmodal.style.display = \"block\";\n\t\t\t\t\tlocalStorage.setItem(\"currentQuestion\",data.doc._rev);\n\t\t\t\t\tdocument.getElementById('english-question').value=data.doc[\"english-question\"];\n\t\t\t\t\tdocument.getElementById('english-answer').value=data.doc[\"english-answer\"];\n\t\t\t\t\tdocument.getElementById('arabic-question').value=data.doc[\"arabic-question\"];\n\t\t\t\t\tdocument.getElementById('arabic-answer').value=data.doc[\"arabic-answer\"];\n\t\t\t\t\tdocument.getElementById('playing-frequency').value=data.doc[\"playing frequency\"];\n\t\t\t\t\tdocument.getElementById('video-type').value=data.doc[\"video-type\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\t});\n}", "function updateButton() {\n const buttonIcon = this.paused ? '▶' : '❚ ❚';\n console.log(buttonIcon);\n toggle.textContent = buttonIcon;\n}", "function updateData(){\n\tcleanUp();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clean up the environment\n\tmsg = $(\"#ptext\").val().toLowerCase();\t//Retrieve plaintext in lower case\n\tcip = $(\"#ctext\").val().toLowerCase();\t//Retrieve ciphertext in lower case\n\tkey = $(\"#kword\").val().toLowerCase();\t//Retrieve the keyword in lower case\n\tCLICK = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset algorithm stage indicator\n\tROW\t\t= -1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clear out the index for ROW\n\tCOL\t\t= -1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clear out the index for COL\n\tMSGIN\t= 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset the index of \"msg\" to start\n\tKEYIN\t= 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset the index of \"key\" to start\n}", "function untravelledText(textID){\r\n if(textID!=null){\r\n document.getElementById(\"untravelledText\").innerHTML = jsonFile.roadsText[textID].text; \r\n } \r\n console.log('aaa'); document.getElementById(\"untravelledCover\").classList.toggle('untravelledTextActive');\r\n}" ]
[ "0.69083256", "0.6554544", "0.65307003", "0.64506376", "0.6370173", "0.6316227", "0.62945443", "0.6285619", "0.62518424", "0.62017626", "0.6191301", "0.6122778", "0.6100663", "0.6100663", "0.6093649", "0.60887194", "0.60714674", "0.6056333", "0.60465646", "0.60006624", "0.59995", "0.5971265", "0.59504545", "0.5941029", "0.5910826", "0.58962333", "0.58922434", "0.58865154", "0.58710784", "0.586182", "0.58392376", "0.58289707", "0.58233577", "0.58218473", "0.5802463", "0.5798258", "0.5789254", "0.5770383", "0.5766867", "0.57470214", "0.57322896", "0.57285416", "0.5723393", "0.5715475", "0.5714002", "0.5713607", "0.5712527", "0.5704904", "0.57026666", "0.5692839", "0.5687966", "0.5684653", "0.568033", "0.5675593", "0.56700504", "0.56700265", "0.5666118", "0.56558794", "0.56475323", "0.56426644", "0.5641714", "0.5640877", "0.5639249", "0.56364256", "0.56268466", "0.5624406", "0.56234646", "0.56229407", "0.56127936", "0.5606437", "0.560598", "0.5605731", "0.5599479", "0.5592065", "0.5589362", "0.558679", "0.5584614", "0.5584503", "0.5573087", "0.55637497", "0.5555638", "0.5550157", "0.55442345", "0.55442345", "0.55442345", "0.5541524", "0.5541047", "0.553975", "0.5534154", "0.5531521", "0.5530879", "0.5527891", "0.55204034", "0.55191034", "0.5517669", "0.5515096", "0.5505028", "0.5502447", "0.54993427", "0.5497255", "0.54955316" ]
0.0
-1
Create a Manage record
function manage(user_id) { let text = JSON.stringify({ manage: { manager_id: current_user_id, underling_id: user_id }, }); $.ajax(manage_path, { method: "post", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { set_button(user_id, resp.data.id); }, error: (resp) => { console.log(resp); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "create(newRecord: Object) {\n // Asserting all values in record are valid\n if (!this._assertRecordValid(newRecord)) {\n return\n }\n\n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record create action to server\n this.crudStore.executeServerDatabaseAction('create', newRecord)\n }\n else {\n // Creating new record in temporary store\n this.crudStore.setData(this.crudStore.getData().unshift(newRecord));\n }\n }", "function createRecord(req, res) {\n const newRecord = new RecordModel(req.body);\n\n newRecord.save();\n\n return res.json(newRecord);\n}", "function recordCreate( client, record, results ){\n var owner_id, parent_id, repo_alloc, alias_key;\n\n //console.log(\"Create new data\");\n\n if ( record.parent ) {\n parent_id = g_lib.resolveCollID( record.parent, client );\n owner_id = g_db.owner.firstExample({_from:parent_id})._to;\n if ( owner_id != client._id ){\n if ( !g_lib.hasManagerPermProj( client, owner_id )){\n var parent_coll = g_db.c.document( parent_id );\n if ( !g_lib.hasPermissions( client, parent_coll, g_lib.PERM_CREATE )){\n throw g_lib.ERR_PERM_DENIED;\n }\n }\n }\n }else{\n parent_id = g_lib.getRootID(client._id);\n owner_id = client._id;\n }\n\n // TODO This need to be updated when allocations can be assigned to collections\n\n // If repo is specified, verify it; otherwise assign one (aware of default)\n if ( record.repo ) {\n repo_alloc = g_lib.verifyRepo( owner_id, record.repo );\n } else {\n repo_alloc = g_lib.assignRepo( owner_id );\n }\n\n if ( !repo_alloc )\n throw [g_lib.ERR_NO_ALLOCATION,\"No allocation available\"];\n\n var time = Math.floor( Date.now()/1000 );\n var obj = { size: 0, ct: time, ut: time, owner: owner_id, creator: client._id };\n\n g_lib.procInputParam( record, \"title\", false, obj );\n g_lib.procInputParam( record, \"desc\", false, obj );\n g_lib.procInputParam( record, \"keyw\", false, obj );\n g_lib.procInputParam( record, \"alias\", false, obj );\n g_lib.procInputParam( record, \"doi\", false, obj );\n g_lib.procInputParam( record, \"data_url\", false, obj );\n\n if ( record.md ){\n obj.md = record.md;\n if ( Array.isArray( obj.md ))\n throw [g_lib.ERR_INVALID_PARAM,\"Metadata cannot be an array\"];\n }\n\n if ( obj.doi || obj.data_url ){\n if ( !obj.doi || !obj.data_url )\n throw [g_lib.ERR_INVALID_PARAM,\"DOI number and Data URL must specified together.\"];\n\n alias_key = (obj.doi.split(\"/\").join(\"_\"));\n console.log(\"alias:\",alias_key);\n }else{\n if ( record.ext_auto !== undefined )\n obj.ext_auto = record.ext_auto;\n else\n obj.ext_auto = true;\n\n if ( !obj.ext_auto && record.ext ){\n obj.ext = record.ext;\n if ( obj.ext.length && obj.ext.charAt(0) != \".\" )\n obj.ext = \".\" + obj.ext;\n }\n\n if ( obj.alias ) {\n alias_key = owner_id[0] + \":\" + owner_id.substr(2) + \":\" + obj.alias;\n }\n }\n\n var data = g_db.d.save( obj, { returnNew: true });\n g_db.owner.save({ _from: data.new._id, _to: owner_id });\n\n g_lib.makeTitleUnique( parent_id, data.new );\n\n // Create data location edge and update allocation and stats\n var loc = { _from: data.new._id, _to: repo_alloc._to, uid: owner_id };\n g_db.loc.save( loc );\n g_db.alloc.update( repo_alloc._id, { rec_count: repo_alloc.rec_count + 1 });\n\n if ( alias_key ) {\n if ( g_db.a.exists({ _key: alias_key }))\n throw [g_lib.ERR_INVALID_PARAM,\"Alias, \"+alias_key+\", already in use\"];\n\n g_db.a.save({ _key: alias_key });\n g_db.alias.save({ _from: data.new._id, _to: \"a/\" + alias_key });\n g_db.owner.save({ _from: \"a/\" + alias_key, _to: owner_id });\n }\n\n // Handle specified dependencies\n if ( record.deps != undefined ){\n var dep,id,dep_data;\n data.new.deps = [];\n\n for ( var i in record.deps ) {\n dep = record.deps[i];\n id = g_lib.resolveDataID( dep.id, client );\n dep_data = g_db.d.document( id );\n if ( g_db.dep.firstExample({ _from: data._id, _to: id }))\n throw [g_lib.ERR_INVALID_PARAM,\"Only one dependency can be defined between any two data records.\"];\n g_db.dep.save({ _from: data._id, _to: id, type: dep.type });\n data.new.deps.push({id:id,alias:dep_data.alias,type:dep.type,dir:g_lib.DEP_OUT});\n }\n }\n\n g_db.item.save({ _from: parent_id, _to: data.new._id });\n\n data.new.id = data.new._id;\n data.new.parent_id = parent_id;\n data.new.repo_id = repo_alloc._to;\n\n delete data.new._id;\n delete data.new._key;\n delete data.new._rev;\n\n results.push( data.new );\n}", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions \n const transaction = db.transaction(['new_budget'], 'readwrite');\n \n // access the object store for `new_budget`\n const budgetObjectStore = transaction.objectStore('new_budget');\n \n // add record to your store with add method\n budgetObjectStore.add(record);\n}", "function saveRecord(record) {\n //open a new transaction with the database with read and write permission\n const transaction = db.transaction(['new_budget'], 'readwrite');\n\n //access the object store for 'new_budget'\n const budgetObjectStore = transaction.objectStore('new_budget');\n\n //add record to your store with add method\n budgetObjectStore.add(record);\n}", "async function createArecord() {\n let dbService = new DbService(process.env.MICRO_API_TOKEN);\n let rsp = await dbService.create({\n record: {\n age: 42,\n id: \"1\",\n isActive: true,\n name: \"Jane\",\n },\n table: \"users\",\n });\n console.log(rsp);\n}", "function create(req, res) {\n req.model.userId = req.auth.userId\n //request to the model payload\n traumaTypesService.create(req.model)\n .then(id => {\n const responseModel = new responses.ItemResponse()\n responseModel.item = id\n res.status(201)\n .location(`${_apiPrefix}/${id}`)\n .json(responseModel)\n })\n .catch(err => {\n console.log(err)\n res.status(500).send(new responses.ErrorResponse(err))\n })\n}", "function saveRecord(record) {\n // open a new transaction with the database readwrite permissions \n const transaction = db.transaction(['new_transaction'], 'readwrite');\n \n // access objectStore \n const budgetObjectStore = transaction.objectStore('new_transaction');\n \n // add record to store with add (method)\n budgetObjectStore.add(record);\n}", "async create() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const res = await service.user.crud({\n type: 'createOne',\n data: params,\n });\n ctx.body = res;\n }", "function handleClick(){\n base('reservation').create([\n {\n \"fields\": {\n \"res_cus_id\" : [newCustomerId],\n \"res_date\": moment(newDate).format('YYYY-MM-DDTHH:mm:ssZ'),\n \"res_em_id\": [newEmployeeId],\n \"res_remark\" : newRemark,\n }\n }\n ], function(err, records) {\n if (err) {\n console.error(err);\n alert(err);\n return;\n }\n records.forEach(function (record) {\n console.log(record.getId());\n alert(\"完成新增\");\n });\n });\n handleClose();\n }", "async create() {\r\n try {\r\n // Record (cross-field) validation\r\n const valRec = await this.tableValidation(this.req.body, \"CREATE\")\r\n if (valRec !== \"\") {\r\n this.res.status(422).json({ errors: valRec })\r\n return\r\n }\r\n\r\n // Collect data from request body\r\n const data = await this.parseReq(\"CREATE\")\r\n const createFields = this.primaryFields.concat(this.fields)\r\n return await super.create(createFields, data)\r\n } catch (e) {\r\n throw e\r\n //throw utils.errMsg(e);\r\n }\r\n }", "function saveRecord(record) {\n // open new entry to db with ability to read and write\n const transaction = db.transaction(['new_Entry'], 'writeRead');\n\n // permission to access the object store \n const statementObjectStore = transaction.objectStore('new_Entry');\n\n // submit new record to your store with the add method\n statementObjectStore.add(record);\n}", "saveRecord(record) {\n this.props.store.create(record);\n }", "function Create() {\n $scope.newMaterialRegisterHeader.CreatedBy = $rootScope.repository.loggedUser.username;\n $scope.newMaterialRegisterHeader.ModifiedBy = $rootScope.repository.loggedUser.username;\n\n $scope.newMaterialRegisterHeader.CreatedOn = new Date();\n $scope.newMaterialRegisterHeader.ModifiedOn = new Date();\n \n UploadMaterialRegisterFiles();\n apiService.post('/api/materialRegisters/create', $scope.newMaterialRegisterHeader,\n registerMaterialRegisterHeaderSucceded,\n registerMaterialRegisterHeaderFailed);\n \n }", "create(data) {\n const doctor = new this.model(data);\n return doctor.save();\n }", "function saveRecord(record) {\n const transaction = db.transaction(['new_funds'], 'readwrite');\n\n const fundsObjectStore = transaction.objectStore('new_funds');\n\n fundsObjectStore.add(record);\n\n showModal(false);\n}", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions \n const transaction = db.transaction(['new_pizza'], 'readwrite');\n \n // access the object store for `new_pizza`\n const pizzaObjectStore = transaction.objectStore('new_pizza');\n \n // add record to your store with add method\n pizzaObjectStore.add(record);\n }", "static newRecord(dbModel, data) {\n const record = Object.assign(\n new dbModel.recordType(Database.getRecordUpdateFn(dbModel), Database.getRemoveFn(dbModel)),\n { id: Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString() },\n deepClone(data)\n )\n record.save()\n return record\n }", "async function recordCreate(req, res, next) {\n try {\n const thread = await Thread.findById(req.params.id)\n if (!thread) throw new Error(notFound)\n const record = { ...req.body, owner: req.currentUser._id }\n thread.records.push(record)\n await thread.save()\n res.status(201).json(thread)\n } catch (err) {\n next(err)\n }\n}", "function saveRecord(record) {\n // open a new transaction with the db with read and write permissions\n const transaction = db.transaction(['action'], 'readwrite');\n\n //access the object store for 'action'\n const actionObjectStore = transaction.objectStore('action');\n\n //add record to store\n actionObjectStore.add(record);\n}", "function create(req, res) {\n var body = req.body;\n\n var medico = new Medico({\n name: body.name,\n user: req.user.user._id,\n hospital: body.hospital\n });\n\n medico.save((err, success) => {\n if (err) {\n res.status(400).json({\n ok: false,\n message: 'Error al crear un medico.',\n error: err\n });\n } else {\n res.status(201).json({\n ok: true,\n medico: success\n });\n }\n });\n }", "addModel(mongooseModel, name, records, recordType = Record) {\n const dbModel = {\n name: name, records: {}, updated: {}, removed: {},\n mongoose: mongooseModel, recordType: recordType\n }\n records.map(item => {\n const record = Database.newRecord(dbModel, item)\n dbModel.records[record.id] = record\n })\n deepFreeze(dbModel.records)\n this.data[name] = dbModel\n }", "async create() {\r\n try {\r\n // Record (cross-field) validation\r\n const valRec = await this.tableValidation(this.req.body, \"CREATE\")\r\n if (valRec !== \"\") {\r\n this.res.status(422).json({ errors: valRec })\r\n return valRec\r\n }\r\n\r\n // Collect data from request body\r\n const data = await this.parseReq(\"CREATE\")\r\n // const createFields = this.primaryFields.concat(this.fields)\r\n // 1/20/21: Primary field is included in fields\r\n const createFields = this.fields\r\n return await super.create(createFields, data)\r\n } catch (e) {\r\n //throw e;\r\n throw utils.errMsg(e)\r\n }\r\n }", "function saveRecord(record) {\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n const budgetTrackerObjectStore = transaction.objectStore('new_transaction');\n budgetTrackerObjectStore.add(record);\n}", "async addRecord(record) {\n //console.log('users addRecord entered');\n let id;\n await this.table.create({ \n fullName: record.fullName,\n password: record.password,\n emailAddress: record.emailAddress,\n isOrgAdmin: record.isOrgAdmin,\n isSystemAdmin: record.isSystemAdmin,\n orgId: record.orgId\n // Get the new id via a promise. \n }).then(record => {\t\t\n id = record.id;\n //console.log('users addRecord id = ' + id);\n //console.log('1---> Inside addRecord() new id = ' + id);\n });\n return id;\n }", "function create(params) {\n var loan = new RequestLoan();\n loan.resource = params.resource;\n loan.user = params.user;\n return loan;\n}", "create(req, res) {\n Item.create(req.body)\n .then((newItem) => {\n res.status(200).json(newItem);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "create(req, res) {\n\t\tlet card = new cardM();\n\t\tif (!req.body.card_no) {\n\t\t\treturn this.common.findError(res);\n\t\t}\n\n\t\tcard.card_no = req.body.card_no;\n\n\t\treturn this.dao.create(card)\n\t\t\t.then(this.common.editSuccess(res))\n\t\t\t.catch(this.common.serverError(res));\n\t}", "static async create(req, res, next) {\n try {\n const { title, description, status, due_date } = req.body\n const UserId = +req.decoded.id\n const data = await ToDo.create({ title, description, status, due_date, UserId })\n if (data) {\n res.status(201).json(data)\n return\n } else {\n throw { status: 400 }\n }\n } catch (err) {\n next(err)\n }\n }", "function createRecord(userId, getRateInCents, postRateInCents) {\n\treturn { userId, getRateInCents, postRateInCents };\n}", "function saveRecord(record) {\n //open a new transaction with the database with read and write permissions\n const transaction = db.transaction([\"new_transaction\"], \"readwrite\");\n\n //access the object store for \"new_transaction\"\n const transactionObjectStore = transaction.objectStore(\"new_transaction\");\n\n //add record to your store with add method\n transactionObjectStore.add(record);\n}", "create() {\n this.id = 0;\n this.familyName = null;\n this.givenNames = null;\n this.dateOfBirth = null;\n\n this.validator.resetForm();\n $(\"#form-section-legend\").html(\"Create\");\n this.sectionSwitcher.swap('form-section');\n }", "createRecord(store, type, snapshot) {\n var data = {};\n var serializer = store.serializerFor(type.modelName);\n var url = this.buildURL(type.modelName, null, snapshot, 'createRecord');\n\n serializer.serializeIntoHash(data, type, snapshot, {includeId: true});\n\n return this.ajax(url, \"POST\", {data: data[type.modelName]});\n }", "function saveRecord(record) {\n // open transaction with db with read/write permission\n const transaction = db.transaction(['new_pizza'], 'readwrite');\n\n // access object store for 'new_pizza'\n const pizzaObjectStore = transaction.objectStore('new_pizza');\n\n // add record to store with add method\n pizzaObjectStore.add(record);\n}", "function createManager (data){\n const theManager = new Manager (data.name,data.id,data.email,data.officeNumber)\n emplyArr.push(theManager)\n}", "addSecondarySchool(){\n var newSecondarySchool = this.get('store').createRecord('secondary-school', {\n name: this.get('ssName'),\n });\n newSecondarySchool.save();\n\n }", "create(p1,p2,p3) {\n var name, structure, contentType, properties\n if (Array.isArray(p1)) {\n // handle this call format: create(structure)\n structure = p1\n name = null\n contentType = 'application/vnd.flexio.table'\n }\n else if (Array.isArray(p2)) {\n // handle this call format: create(name, structure)\n name = p1\n structure = p2\n contentType = 'application/vnd.flexio.table'\n }\n else {\n name = (p1 === undefined) ? null : p1\n structure = (p2 === undefined) ? null : p2\n contentType = (p3 === undefined) ? 'text/plain' : p3\n }\n properties = { 'content_type': contentType }\n if (name) {\n properties['name'] = name\n }\n if (structure) {\n properties['structure'] = structure\n }\n var res = proxy.invokeSync('managedCreate', [this._handle, properties])\n\n if (res === false) {\n return false\n } else {\n return this\n }\n }", "function createObject(e){\n\t\n\t// create random object data\n\tvar object={\n\t\tname: 'PeppaTest Object' + Math.floor(Math.random()*100),\n\t\tstatus: 'created',\n\t\tcost: 2.99\n\t};\n\t\n\t// Now Save It\n\tapi.Object.Create('PeppaTest',object,function(r){\n\t\tif(r.success){\n\t\t\talert('New Object persisted to server');\n\t\t}\n\t});\t\n\t\n}", "create(req, res){\r\n let report = new RentalController();\r\n\r\n report.damages = req.body.damages;\r\n report.condition = req.body.condition;\r\n report.status = req.body.status;\r\n\r\n return this.rentalDao.create(report)\r\n .then(this.common.editSuccess(res))\r\n .catch(this.common.serverError(res));\r\n }", "function create(call, callback) {\n debug('create', call.request);\n var note = call.request;\n index++;\n note.id = index;\n notes[index.toString()] = note;\n callback(null, note);\n}", "async create (json) {\n try {\n let record = await this.model.create(json);\n return record;\n } catch(e) {\n return e;\n }\n }", "function saveRecord(record) {\n const transaction = db.transaction([\"BudgetStore\"], \"readwrite\");\n const budgetStore = transaction.objectStore(\"BudgetStore\");\n budgetStore.add(record);\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}", "create(req, res){\r\n let account = new RentalController();\r\n account.username = req.body.username;\r\n account.password = req.body.password;\r\n account.fname = req.body.fname;\r\n account.lname = req.body.lname;\r\n account.dob = req.body.dob;\r\n account.phone = req.body.phone;\r\n account.email = req.body.email;\r\n\r\n return this.rentalDao.create(account)\r\n .then(this.common.editSuccess(res))\r\n .catch(this.common.serverError(res));\r\n }", "function saveRecord(record) {\n // open a new transaction with the database with read and write permissions\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n\n // access the object store for `new_transaction`\n const transactionObjectStore = transaction.objectStore(\"new_transaction\");\n\n // add record to your store with add method\n transactionObjectStore.add(record);\n}", "createRecord(store, type, snapshot) {\n return this.updateRecord(store, type, snapshot);\n }", "initCreate() {\n PaymentTypeActions.clearUpdatable({});\n PaymentTypeActions.setIsCreating(true);\n }", "async create(ctx) {\n // insert this new ticket into db\n const result = await this.app.mysql.insert('ticket', { \n name: ctx.request.body.ticketName, \n price: ctx.request.body.ticketPrice, \n });\n // if successfully inserted\n if (!!result.affectedRows) {\n return result.insertId\n } else {\n throw Error(\"Failed to insert\")\n }\n }", "addNew(code, description, project, id){\n let error = !code || !description\n if(error){\n set(project,'error',error);\n }\n else{\n let step = this.get('store').findRecord('step',1);\n let story = this.get('store').createRecord('story',{code:code,description:description,step:step});\n set(story,'project',project);\n story.save().then(()=>{project.save();});\n //Set des valeurs de l'input à RIEN pour avoir le form vide\n set(project,'code','');\n set(project,'description','');\n this.transitionTo('projects.stories',id);\n }}", "function addNewItem() {\n log.debug('[TodoList] : addNewItem');\n\n var formValues = getFormValues();\n var id;\n // Edit or create new\n if (todo_id) {\n todoItem.set(formValues);\n todoItem.save();\n id = todo_id;\n } else {\n var newModel = Alloy.createModel(\"ToDo\", formValues);\n newModel.save();\n id = newModel.get(\"todo_id\");\n }\n\n // Make sure the collection is current\n todo.fetch();\n\n //alert(\"Saved this model: \" + JSON.stringify(newModel, null, 4));\n\n Alloy.Globals.Menu.setMainContent('TodoListDetail', {todo_id: id});\n\n}", "addhsSubject(){\n var newhsSubject = this.get('store').createRecord('high-school-subject', {\n name: this.get('subjectName'),\n description: this.get('description')\n });\n newhsSubject.save();\n }", "async store ({ request, response, auth }) {\n try {\n const user = await auth.getUser()\n\n const meetup = await Meetup.create({\n ...request.only([\n 'title',\n 'description',\n 'location',\n 'date',\n 'file_id'\n ]),\n user_id: user.id\n })\n\n return response.created(meetup)\n } catch (error) {\n console.log(error)\n }\n }", "create(name, cb) {\n orm.create(name, cb);\n }", "onCreate (item) {\n\t\t// Hide the create form\n\t\tthis.toggleCreateModal(false);\n\t\t// Redirect to newly created item path\n\t\tconst list = this.props.currentList;\n\t\tthis.context.router.push(`${Keystone.adminPath}/${list.path}/${item.id}`);\n\t}", "function create(req, res, next) {\n\n // TODO create mongoose plugin to handle multiple fields\n var ticket = new TicketModel({\n type : req.body.type,\n title : req.body.title,\n description : req.body.description\n });\n\n return ticket.save(function (err) {\n\n if (err) { return next(err); }\n res.send(ticket);\n });\n }", "create(req, res){\r\n let rental = new RentalController();\r\n \r\n rental.model = req.body.model;\r\n rental.dealer = req.body.dealer;\r\n rental.year = req.body.year;\r\n rental.color = req.body.color;\r\n rental.price = req.body.price;\r\n rental.hps = req.body.hps;\r\n rental.mileage = req.body.mileage;\r\n \r\n return this.rentalDao.create(rental)\r\n .then(this.common.editSuccess(res))\r\n .catch(this.common.serverError(res));\r\n }", "static create(req, res, next) {\n const { title, description, due_date } = req.body\n // console.log(req.decoded.id);\n let dataObj = {\n title,\n description,\n due_date,\n }\n\n if (req.params.projectId) {\n dataObj.project = req.params.projectId\n } else {\n dataObj.creator = req.decoded.id\n }\n\n Todo.create(dataObj)\n .then((todo) => {\n res.status(201).json(todo)\n })\n .catch(next);\n }", "static create(req, res) {\n const { title, content } = req.body\n const dataUserId = req.userData.id\n\n Article.create({ title, content, UserId: dataUserId })\n .then((newArticle) => {\n res.status(201).json(newArticle)\n })\n .catch((err) => {\n res\n .status(500)\n .json({ message: err.message || 'internal error server' })\n })\n }", "function create(crudRequest,message) {\n console.log(\"CRUDVerticleJS: create()\");\n\n // this transformation of domain object to json string to json object is quite annoying...\n var obj = JSON.parse(crudRequest.toJsonString(crudRequest.entity));\n // we need to remove the _id attribute as otherwise no id might be assigned\n delete obj._id;\n client.save(crudRequest.entity.getClass().getName(), obj, function (res, res_err) {\n\n if (res_err == null) {\n var id = res;\n console.log(\"CRUDVerticleJS: create(): saved entity of type \" + crudRequest.entity.getClass().getName() + \" with id \" + id);\n message.reply(id);\n } else {\n res_err.printStackTrace();\n message.reply(\"\");\n }\n\n });\n}", "function Create(data) {\n if (data) {\n this.setData(data);\n }\n }", "static async createApartment(req, res, next) {\r\n const { user } = req.user\r\n console.log(user)\r\n try {\r\n const apartment = new Apartment({ ...req.body, _id: mongoose.Types.ObjectId(), author: user._id })\r\n if (!apartment) return res.status(400).json({ msg: 'flll in the input before submission ' })\r\n const newApartment = await apartment.save();\r\n res.status(200).json(newApartment)\r\n } catch (error) {\r\n console.log(error)\r\n res.status(400).json({ msg: 'apartment creation failed' })\r\n }\r\n }", "storeAdd(params) {\n \n }", "function createAndSave( model, data, callback){\n\tvar myRecord = new model(data);\n\n\tmyRecord.save(function(err){\n\t if(err) {\n\t \tcallback(err, null);\n\t }\n\t else{\n\t callback(null, myRecord);\n\t }\n\t});\n}", "async createAnemese(stub, args) \n {\n var docType = args[10];\n let roleAsBytes = await stub.getState(docType); \n if (!roleAsBytes || roleAsBytes.toString().length <= 0) \n {\n throw new Error(docType + ' does not exist');\n }\n let role = JSON.parse(roleAsBytes);\n if(role.anemese != 'Y')\n {\n throw new Error('Not authorized');\n }\n /*\n * QP: queixa principal \n * HDA: Histórico doença atual \n * HMP: Antecedentes \n * HF: Historico familiar \n * Pressao\n * Batimento cardiaco\n */\n var anemese = \n {\n docType: 'anemese',\n id: args[0],\n fullName: args[1],\n qp: args[2],\n hda: args[3],\n hmp: args[4],\n hf: args[5],\n smoke: args[6],\n drink: args[7],\n pression: args[8],\n heartbeat: args[9],\n key: args[12]\n };\n\n var key = args[12];\n await stub.putState(key, Buffer.from(JSON.stringify(anemese)));\n console.log('Inserted');\n \n let medicalRecordBytes = await stub.getState(args[11]);\n let medicalRecord = JSON.parse(medicalRecordBytes);\n medicalRecord.anemese = anemese;\n\n await stub.putState(args[11], Buffer.from(JSON.stringify(medicalRecord)));\n }", "function create( data, callback ) {\n\tdata.created = new Date();\n\tParty.create( data, callback );\n}", "static async createMaintab({ user, maintab }) {\n\n const requiredFields = [\"name\"];\n requiredFields.forEach((field) => {\n if (!maintab.hasOwnProperty(field) || !maintab[field]) {\n throw new BadRequestError(`Required field - ${field} - missing from request body.`)\n }\n });\n\n //create a new maintab - store in database\n const query = `\n INSERT INTO main_tabs (user_id, name)\n VALUES ((SELECT id FROM users WHERE email=$1), $2) \n RETURNING id, user_id, name, created_at; \n `\n const result = await db.query(query, [user.email, maintab.name]);\n\n //return new maintab\n return result.rows[0];\n }", "function create(req, res) {\n // add validation kapag empty yung value sa req.body at kapag empty yung request.\n let data = {\n name: req.body.name,\n qty: req.body.qty,\n amount: req.body.amount\n };\n\n connection.query('INSERT INTO items SET ?', data, function(error, results) {\n if (error) {\n res.status(500).send({ message: 'Error occured while adding item.' });\n }\n // if sucess, add the ID of new item into data object.\n data.id = results.insertId;\n apiResult = {\n message: 'Successfully created.',\n total: results.length,\n data \n };\n\n res.send(apiResult);\n });\n }", "function handleCreate(params, body) {\n\n console.log(\"Creating a New Item with \", body)\n try {\n let item = JSON.parse(body);\n let dynamoParams = {\n TableName: tableName,\n Item: item\n };\n\n docClient\n .put(\n dynamoParams,\n function(error, data) {\n let response;\n if (error) {\n response = failure(error);\n callback(...response);\n } else {\n response = success(data);\n callback(...response);\n }\n \n });\n } catch(error) {\n console.log(error);\n callback(new Error('Error parsing POST parameters: ' + error));\n }\n \n}", "configure(req, res) {\n var data = req.body;\n var id = uuid();\n var reqBody = {\n id: id,\n name: data.name,\n description: data.description,\n department_id: data.department_id,\n type: data.type\n };\n ProcessType.create(reqBody)\n .then(function (newProcessType) {\n res.status(201).json(newProcessType);\n })\n .catch(function (error) {\n res.status(500).json(error);\n });\n }", "function resourceCreate(cb) {\n\n var resource = new Resource({\n //_projectId: [projects[0]],\n name: 'server',\n type: 'Facility',\n status: 'Available',\n deletedAt: null\n });\n\n resource.save(function (err) {\n if (err) {\n cb('resource', null);\n return\n }\n console.log('New Resource ' + resource);\n resources.push(resource);\n cb(null, resource);\n } );\n}", "function createHouse() {\n if (!vm.user) {\n appService.alert('Please login first!');\n return;\n }\n appService.moveTo('createHouse');\n }", "function saveRecord(record) {\n const transaction = db.transaction([\"budgetStore\"], \"readwrite\");\n const save = transaction.objectStore(\"budgetStore\");\n\n save.add(record);\n}", "function saveRecord(record) {\n console.log('saveRecord function call');\n // open a new transaction with the database w read/write ability\n const transaction = db.transaction(['new_transaction'], 'readwrite');\n\n // access objectStore\n const transactionObjectStore = transaction.objectStore('new_transaction');\n\n // add record to your store with add method\n transactionObjectStore.add(record);\n}", "function create(params, callback) {\n core.api('POST', '/properties', params, callback);\n }", "addNewRecordByValue() {\n this.addNewRecord('value');\n }", "static create(skill) {\n let query = \"call codijob.t_skill_crud_ps(0,'\" + skill.skill_Nom + \"','\" + skill.skill_Desc + \"','\" + skill.skill_Img + \"','create')\";\n return new Promise((resolve, reject) => {\n index_1.connection.query(query, (error, result) => {\n if (error) {\n reject(error);\n }\n //result.insertId => tiene el id del objeto creado\n skill.skill_Id = result[0][0].skill_id;\n resolve(skill);\n // console.log(\"OBJETO CREADO\");\n // console.log(skill);\n });\n });\n }", "function saveRecord(record) {\n //open a connection to the db, access the object store, and use the .add method to add the record to the IndexedDB.\n const transaction = db.transaction(['offline_actions'], 'readwrite');\n const actionsObjectStore = transaction.objectStore('offline_actions');\n actionsObjectStore.add(record);\n}", "function memsadd(item, cb) {\n var url = cfg.url + \"project/\"+item.pn+\"/assign\";\n var msg = { userNames: item.unames };\n axios.put(url, msg, axopts).then( (resp) => {\n console.log(\"memadd ok with RP\");\n return cb(null, item.pn);\n }).catch( (ex) => {\n console.log(\"memadd fail with RP\");\n return cb(\"memadd fail with RP\", null);\n });\n }", "save() {\n if (this.type === ClientType.MEMBER) {\n const doc = new DB_Member();\n doc.set(\"username\", this.username);\n doc.set(\"password\", this.password);\n doc.set(\"type\", this.type);\n doc.set(\"firstname\", this.firstname);\n doc.set(\"lastname\", this.lastname);\n doc.set(\"nationality\", this.nationality);\n doc.set(\"gender\", this.gender);\n doc.set(\"phonenumebr\", this.phonenumber);\n doc.save();\n }\n }", "createContact() {\n // check if it is allowed to save\n if (this.onCreateAction && !this.saveDisabled) {\n // disable save until it is finished\n this.toggleProperty('saveDisabled');\n\n // call the onCreate action\n this.onCreateAction(this.model).then(() => {\n // enable save again\n this.toggleProperty('saveDisabled');\n // reset the model's attributes\n this.set('model', {});\n });\n }\n }", "addNotes(noteObj) {\n let realm = new Realm({schema: [TaskSchema, SubTaskSchema, NotesSchema]});\n realm.write(() => {\n realm.create('NOTES', noteObj, true);\n });\n }", "async function create(req, res) {\n try {\n const todo = new Todo(req.body);\n todo.user = req.params.userid;\n await todo.save();\n show(req, res);\n } catch (err) {\n res.json({\n err\n });\n }\n}", "function RecordLinkNew(billid,transType,withoutinventory,rec){\n viewTransactionTemplate1(transType, rec, false, billid); \n}", "async save(record) {\n const result = await this.connection.getRepository(ApplicationInformationDBO_1.ApplicationInformationDBO).save(record);\n console.log(\"ApplicationInformation created: \", result);\n return result;\n }", "constructor(user, record) {\n this.user = user;\n this.record = record;\n }", "function create() {\n emp = new Object();\n emp.Title = $(\"#TextBoxTitle\").val();\n emp.Firstname = $(\"#TextBoxFirstname\").val();\n emp.Lastname = $(\"#TextBoxLastname\").val();\n emp.Phoneno = $(\"#TextBoxPhone\").val();\n emp.Email = $(\"#TextBoxEmail\").val();\n emp.DepartmentId = $(\"#ddlDepts\").val();\n}", "add(userObject, response) {\n //password encryption\n userObject.password = encryptOperations.encryptPassword(\n userObject.password\n );\n UserModel.create(userObject, (err) => {\n if (err) {\n console.log(\"Error in Record Add\");\n response.status(appCodes.SERVER_ERROR).json({\n status: appCodes.ERROR,\n message: \"Record Not Added Due to Error\"\n });\n } else {\n console.log(\"Record Added..\");\n sendMail(userObject.userid, \"register\");\n\n response\n .status(appCodes.OK)\n .json({ status: appCodes.SUCCESS, message: \"Record Added\" });\n }\n });\n }", "function CreateRecord(alu_id, alu_app, alu_apm, alu_nom) {\n const record = document.querySelector('#table_alumnos');\n let tr = document.createElement('tr');\n tr.id = alu_id;\n\n let td_alu_app = document.createElement('td');\n td_alu_app.textContent = alu_app;\n\n let td_alu_apm = document.createElement('td');\n td_alu_apm.textContent = alu_apm;\n\n let td_alu_nom = document.createElement('td');\n td_alu_nom.textContent = alu_nom;\n\n let td_btn = document.createElement('td');\n\n let btn_information = document.createElement('button');\n btn_information.textContent = \"Consultar o editar información \";\n btn_information.id = `${alu_id}BTN`;\n btn_information.className = \"consultar\";\n\n btn_information.addEventListener('click', information);\n\n let span_img = document.createElement('span');\n span_img.className = \"las la-question-circle\";\n\n btn_information.appendChild(span_img);\n\n td_btn.appendChild(btn_information);\n\n tr.appendChild(td_alu_app);\n tr.appendChild(td_alu_apm);\n tr.appendChild(td_alu_nom);\n tr.appendChild(td_btn);\n\n record.appendChild(tr);\n}", "create(data, params) {}", "create(body, res) {\n this.model.create(body).then(object => res.status(200).json({\n type: 'success',\n message: 'created!',\n data: object\n })).catch(e => res.status(200).json({\n type: 'Error',\n message: e.message,\n data: e\n }));\n }", "create() {\n\t\treturn true\n\t}", "async store ({ auth, request, response }) {\n \n\n const data = request.only([\n \n 'owner_id',\n 'descricao',\n 'departamento',\n 'id_proprietario',\n 'id_captador',\n 'numeroAndar',\n 'preco',\n 'numeroElevador',\n 'dataConstrucao',\n 'areaPrivativa',\n 'areaTotal',\n 'valorAgio',\n 'saldoDevedor',\n 'valorCondominio',\n 'permuta',\n 'dataCadastro',\n 'codigoAnuncio',\n 'endereco',\n 'cep',\n 'geolocalizacao',\n 'situacao',\n 'empresa',\n 'tipo',\n 'bairro',\n 'regiao',\n 'cidade',\n 'mobilia',\n 'cobertura',\n 'exclusividade',\n 'dormitorio',\n 'garagem',\n 'banheiro',\n 'suite',\n 'morador'\n\n ])\n\n const property = await Property.create({...data, user_id: 1 })\n }", "function addEventRecord(params, res){\n var validatedParams = validateEventRecord(params);\n return new Event().save(validatedParams,{method:\"insert\"})\n .then(function(model){\n if(res){\n res.status(201).end(model.attributes.id.toString());\n } \n console.log(\"added event to database: \" + model.attributes.title);\n return model.attributes.id.toString();\n });\n}", "async function addInfo(req, res) {\n const obj = req.body;\n let person = await employee.create(obj);\n res.status(201).json(person);\n \n }", "function createMember(name, gender, role, fn) {\n var p = {\n TableName: \"memberSheet\"\n };\n dynamodb.describeTable(p, function(err, data) {\n if (err) return fn(err);\n else {\n console.log(data.Table);\n var id = data.Table.ItemCount;\n var memberID = String(id);\n var params = {\n Item: {\n \"memberID\": {\n \"S\": memberID\n },\n \"name\": {\n \"S\": name\n },\n \"gender\": {\n \"S\": gender\n },\n \"role\": {\n \"S\": role\n }\n }, \n TableName: 'memberSheet'\n };\n dynamodb.putItem(params, function(err, data){\n if (err) return fn(err);\n else { \n fn(null, null);\n }\n });\n }\n });\n}", "async newPost(userPost) {\n const { handle, email, post } = userPost;\n const toLower = handle.toLowerCase();\n const params = {\n TableName: TABLE_NAME,\n Item: {\n handle: toLower,\n email: email,\n post: post,\n }\n };\n await ddbDocClient_1.ddbDocClient.send(new lib_dynamodb_1.PutCommand(params));\n }", "@POST('/epics')\n @websocket('epics', 'create')\n @authenticated\n async create (ctx) {\n this.requireRelationships({ ctx, relationships: ['nominees'] })\n\n const result = await super.create({\n ctx,\n databaseType: Epic,\n overrideFields: { nominatedById: ctx.state.user.id },\n })\n\n const query = new DatabaseQuery({ connection: ctx })\n ctx.response.status = StatusCode.created\n return new DatabaseDocument({ query, result, type: EpicView })\n }", "function saveRecord(record) {\n const transaction = db.transaction([\"pending\"], \"readwrite\");\n const store = transaction.objectStore(\"pending\");\n store.add(record);\n}", "async create(data) { await orm.insertOne(data) }", "function _Create(objRequest) {\n nlapiLogExecution('AUDIT','CREATE Courses', '=====START=====');\n var stCustId = objRequest['CustomerId'];\n var httpBody = objRequest;\n var objDataResponse = {\n Response: 'F',\n Message: 'Default Value',\n ReturnId: ''\n };\n\n\n var newICourseRecord = nlapiCreateRecord('customrecord_rc_course');\n // newICourseRecord.setFieldValue('custrecord_rc_course_', httpBody)\n try {\n newICourseRecord.setFieldValue('custrecord_rc_course_title', httpBody.Title),\n newICourseRecord.setFieldValue('custrecord_rc_course_number', httpBody.Number),\n newICourseRecord.setFieldValue('custrecord_rc_course_credit_level', httpBody.CreditLevel.Id),\n newICourseRecord.setFieldValue('custrecord_rc_course_credit_hours', httpBody.CreditHours),\n newICourseRecord.setFieldValue('custrecord_rc_course_syllabi_name', httpBody.SyllabiName),\n // How do deal w this\n newICourseRecord.setFieldValue('custrecord_rc_course_institution', httpBody.ModeOfInstruction),\n newICourseRecord.setFieldValue('custrecord_rc_course_reg_course', httpBody.RegisteredCourseId)\n objDataResponse.ReturnId = nlapiSubmitRecord(newICourseRecord, true)\n } catch (ex) {\n nlapiLogExecution('ERROR', 'Something broke trying to set fields' + ex.message)\n\n }\n\n if(objDataResponse.ReturnId){\n objDataResponse.Response = 'T';\n objDataResponse.Message = 'Yo it seems as though we have been successful with endevour'\n }\n\n // Ask john.\n //1.)How to deal with \"missing\" values. What values must be supplied at any given stage\n // Mode up is required(looking at ns)\n\n // its either a list OR a record A list has id and value when writing i only provide an ID, don't pass anything but the id\n // think of it as an Enumerator, a number that means something else.\n //2.)How to deal with list objects\n\n\n\n objResponse.setContentType('PLAINTEXT');\n objResponse.write(JSON.stringify(objDataResponse));\n nlapiLogExecution('AUDIT','CREATE Courses', '======END======');\n return (JSON.stringify(objDataResponse));\n}", "function createAndSave( openId, pubAccoutId, createTime){\n\n\tvar follower = new Follower();\n\n\tfollower.set(\"openId\",openId);\n\tfollower.set(\"pubAccoutId\", pubAccoutId);\n\tfollower.set(\"createTime\", createTime);\n\tfollower.save(null, {\n \t\tsuccess: function(follower) {\n\t\t\tconsole.log('New object created with objectId: ' + follower.id);\n\t\t\t//get detailed info\n\t\t\tfollowerMgmt.getFollowerMore(openId,function(result){\n\t\t\t\tcreateAVUser( openId, pubAccoutId, follower.id, result);\t\n\t\t\tconsole.log(result);\n\t\t\t});\n\t\t\t\n \t\t},\n\t\terror: function(follower, error) {\n\t\t\tconsole.log('Failed to create new object, with error message: ' + error.message);\n\t\t\t//maybe do sync with wechat servercreateAVUser\n \t\t}\n\t});\n\n}" ]
[ "0.6617538", "0.631608", "0.6069174", "0.6044957", "0.6026474", "0.5908252", "0.5866363", "0.58499587", "0.58130187", "0.5810121", "0.5784484", "0.5732493", "0.5694448", "0.5691267", "0.5653262", "0.5634636", "0.56287307", "0.56148165", "0.55989474", "0.55906016", "0.5585141", "0.55312955", "0.5516937", "0.55094254", "0.5502374", "0.55010086", "0.5491013", "0.5479018", "0.5478638", "0.54721886", "0.54539496", "0.5452958", "0.5423012", "0.5422478", "0.541988", "0.5410509", "0.54090434", "0.5407442", "0.54007316", "0.5394905", "0.53893965", "0.53818077", "0.537999", "0.5373172", "0.53619576", "0.5356792", "0.53510404", "0.5344263", "0.53432035", "0.5338021", "0.53255236", "0.5324377", "0.53108734", "0.5305344", "0.53034776", "0.5287272", "0.52838266", "0.5281182", "0.5269144", "0.5268185", "0.5262855", "0.52584976", "0.5253144", "0.524913", "0.52463186", "0.5244229", "0.5244205", "0.5242514", "0.5241558", "0.5239832", "0.52375036", "0.5231866", "0.5231705", "0.52171254", "0.5212507", "0.5210188", "0.52040297", "0.5201814", "0.52003735", "0.5187947", "0.5186666", "0.5179815", "0.51795703", "0.51722884", "0.51721704", "0.5169164", "0.51677483", "0.51640594", "0.51625293", "0.51580024", "0.5143747", "0.5142752", "0.5140828", "0.5139958", "0.51362485", "0.5127137", "0.5121133", "0.5119755", "0.5117831", "0.51133764", "0.51116955" ]
0.0
-1
Delete a Manage record
function unmanage(user_id, manage_id) { $.ajax(manage_path + "/" + manage_id, { method: "delete", dataType: "json", contentType: "application/json; charset=UTF-8", data: "", success: () => { set_button(user_id, ""); }, }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "delete(recordId: number) {\n // Asserting store is a server store\n if (this.crudStore.type === 'server') {\n // Executing record delete action to server\n this.crudStore.executeServerDatabaseAction('delete', this.crudStore.getData().get(recordId))\n }\n else {\n // Retrieving store data\n let data: List<Object> = this.crudStore.getData();\n\n // Deleting a record from the store data and updating store data\n this.crudStore.setData(data.remove(recordId));\n }\n }", "eventDeleteItem(record) {\n this.selected_index = parseInt(record.id.replace(\"delete\", \"\"));\n this.delete();\n this.read();\n }", "handleDelete() {\n deleteRecord(this.recordId)\n .then(() => {\n console.log(\"record is deleted\");\n })\n .catch((error) => {\n console.log(JSON.stringify(error));\n });\n }", "delete(req, res) {\n RegistroEstudo.destroy({\n where: {\n id: req.params.id\n }\n })\n .then(function (deletedRecords) {\n res.status(200).json(deletedRecords);\n })\n .catch(function (error) {\n res.status(500).json(error);\n });\n }", "delete(req, res) {\n Item.destroy({\n where: {\n id: req.params.id\n }\n })\n .then((deletedRecords) => {\n res.status(200).json(deletedRecords);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "delete(item) {\n this.sendAction('delete', item);\n }", "function deleteRecord(id) {\n\n var iddelete = id.toString();\n\n db.transaction(function (tx) { tx.executeSql(deleteStatement, [id], showRecords, onError); alert(\"Sucessfully Deleted\"); });\n\n resetForm();\n \n}", "function deleteMetalType(metaltypeid) {\n if (confirm('Are you sure, you want to delete this record ?')) {\n var entityObject = new metaltypemodel(metaltypeid);\n EJewel.AdminView.Services.AdminServices.DeleteMetalType(entityObject, function (result) {\n displayMsg('S', \"Metal Type Deleted Successfully\");\n $(\"#tableMetalType\").empty();\n loadMetalTypeGrid();\n },\n onServiceError);\n }\n\n}", "confirmDelete() {\n // this.order.destroyRecord();\n console.log('you have confired the delete for the order', this.order);\n }", "delete() {\n let id = $(\"#rid\").val();\n reReg.delete(id);\n $(\"#editDeleteModal\").modal('hide');\n }", "function deleteEmpRecord(empId) {\n db.query(`DELETE FROM employee WHERE id = ?`, [empId], (err, result) => {\n if (err) {\n console.log(err);\n }\n console.log(chalk.white.bold(`====================================================================================`));\n console.log(chalk.white.bold( ` Employee Successfully Removed `));\n console.log(chalk.white.bold(`====================================================================================`));\n // Display Employees Table\n viewAllEmployees();\n });\n}", "function deleteOne(req,res){\n Photo.where({id:req.params.id}).fetch({\n }).then(function (record) {\n \n //delete the record\n if(record && record.user_id===req.params.user_id){\n record.destroy()\n .on('destroyed',function(){\n res.status(204).end();\n });\n //unauthorized\n } else if(record) {\n res.status(403).end();\n \n //record not found\n } else {\n res.status(404).end();\n }\n });\n}", "function deleteRecord(db, table, key) {\n var $def = $.Deferred();\n var transaction = db.transaction([table], 'readwrite');\n var req = transaction.objectStore(table).delete(key);\n req.onerror = function(e) {\n $def.reject('delete record failed');\n };\n transaction.oncomplete = function(event) {\n $def.resolve(key);\n };\n return $def;\n }", "function deleteRecord(id) {\n\t\t\n\t\t\n\t\taddOverLay();\n\t\t$.ajax({\n\t\t\turl : HOST_PATH + \"admin/article/movetotrash\",\n\t\t\tmethod : \"post\",\n\t\t\tdata : {\n\t\t\t\t'id' : id\n\t\t\t},\n\t\t\tdataType : \"json\",\n\t\t\ttype : \"post\",\n\t\t\tsuccess : function(data) {\n\t\t\t\t\n\t\t\t\tif (data != null) {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\twindow.location.href = HOST_PATH + \"admin/article\";\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\t}", "async deleteRecord(record) {\n this.setState({ isloading: true });\n const res = await delData(record.id);\n if (res.status === 200) {\n this.getData();\n tostNtf('Category Delete successfully');\n } else {\n tostNtf('Oppes something went wrong :) Please try again', 'warning')\n }\n }", "function delRecord(rowid) {\r\n var db = window.openDatabase(\"Database\", \"1.0\", \"STUMBLEAPP\", 2000000);\r\n db.transaction(\r\n function (tx) {\r\n tx.executeSql(\"DELETE FROM demo WHERE id = ?\", [rowid]);\r\n }\r\n ); \r\n\r\n location.reload(false); // refresh page to show changes\r\n}", "function deleteRecord(recid) {\n if (confirm(\"Are You Sure,You want to delete this record?\")) {\n var employeeId = dGrid.get(recid).VAT_Employee_ID;\n\n $.ajax({\n type: \"POST\",\n url: VIS.Application.contextUrl + \"VAT/Common/Delete\",\n dataType: \"json\",\n data: {\n 'employeeId': employeeId\n },\n success: function (data) {\n var returnValue = data.result;\n if (returnValue) {\n\n lblBottomMsg.text(\"Record Deleted.\");\n loadGrid();\n //$self.dispose();\n return;\n }\n lblBottomMsg.text(\"Record not delete.\");\n }\n });\n }\n }", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "function deleteChainLength(lengthid) {\n if (confirm('Are you sure, you want to delete this record ?')) {\n var entityObject = new chainLengthmodel(lengthid);\n EJewel.AdminView.Services.AdminServices.DeleteChainLength(entityObject, function (result) {\n displayMsg('S', \"Chain Length Deleted Successfully\");\n $(\"#tableChainLength\").empty();\n loadChainLengthGrid();\n },\n onServiceError);\n }\n\n}", "function deleteRecord(id) {\n bookmarkTable.get(id).deleteRecord();\n }", "deleteItem(member) {\n var data = {\n id: member.id\n };\n this.fechRequests(\"delete\", \"POST\", data);\n }", "async function DeleteRecords(req, res) {\n if(check_module.auth(req.query.api_key, res))\n try {\n res.json({ auth: 'OK', msg: `${await recordsmodel.del()}`})\n } catch (e) {\n res.status(404) // Not found (no records)\n res.json({ auth: \"OK\", api: 'DelRecords', error_msg: e })\n }\n}", "function deleteMadbet(req, res) {\n Madbet.findByIdAndRemove(req.params.id, (err, madbet) => {\n if (err) {\n res.send(err);\n }\n res.json({ message: `${madbet.nom} deleted` });\n });\n}", "function deleteRecordId(panelName, recordId) {\r\n confirm_box = confirm(deleteItemAlertMess + \"\\n\\nDo you really want to delete this record or entry?\");\r\n if (confirm_box == true)\r\n {\r\n var poststr = \"panelName=\" + encodeURIComponent(panelName)\r\n + \"&recordId=\" + encodeURIComponent(recordId);\r\n //\r\n send_delete_record_id('include/php/omdelrecord.php', poststr);\r\n }\r\n}", "async function recordDelete(req, res, next) {\n try {\n const thread = await Thread.findById(req.params.id)\n if (!thread) throw new Error(notFound)\n const recordToDelete = thread.records.id(req.params.recordId)\n if (!recordToDelete) throw new Error(notFound)\n await recordToDelete.remove()\n await thread.save()\n res.sendStatus(204)\n } catch (err) {\n next(err)\n }\n}", "function deleteRecord(id) {\n\t\n\taddOverLay();\n\t$.ajax({\n\t\turl : HOST_PATH + \"admin/page/movetotrash\",\n\t\tmethod : \"post\",\n\t\tdata : {\n\t\t\t'id' : id\n\t\t},\n\t\tdataType : \"json\",\n\t\ttype : \"post\",\n\t\tsuccess : function(data) {\n\t\t\t\n\t\t\tif (data != null) {\n\t\t\t\t\n\t\t\t\twindow.location.href = \"/admin/page/\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\twindow.location.href = \"page\";\n\t\t\t}\n\t\t}\n\t});\t\n}", "deleteEmployee(empid) {\n this.employeeService.deleteEmployee(empid);\n this.getEmployeeList();\n }", "deletehsSubject(hssubject){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('subjectModel').indexOf(hssubject);\n var restemp = this.get('subjectModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "delete(req, res) {\n PokemonType.destroy({\n where: {\n id: req.params.id\n }\n })\n .then((deletedRecords) => {\n res.status(200).json(deletedRecords);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "async destroy() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const condition = Object.assign({}, params);\n const res = await service.user.crud({\n type: 'deleteOne',\n condition,\n });\n ctx.body = res;\n }", "function destroy(req, res) {\n ToDo.findOneAndRemove({_id: req.params.id}, function(err) {\n\t if(err) console.log(err)\n\t res.json({success: true, message: 'deleted toDo'})\n res.redirect('/')\n })\n}", "function deleteRecord(id) {\n\t\n\taddOverLay();\n\t$.ajax({\n\t\turl : HOST_PATH + \"admin/page/movetotrash\",\n\t\tmethod : \"post\",\n\t\tdata : {\n\t\t\t'id' : id\n\t\t},\n\t\tdataType : \"json\",\n\t\ttype : \"post\",\n\t\tsuccess : function(data) {\n\t\t\t\n\t\t\tif (data != null) {\n\t\t\t\t\n\t\t\t\twindow.location.href = \"page\";\n\t\t\t\t\n\t\t\t} else {\n\t\t\t\t\n\t\t\t\twindow.location.href = \"page\";\n\t\t\t}\n\t\t}\n\t});\t\n}", "deleteRecord(\n table,\n recordId,\n baseId = this.defaultBaseId,\n apiKey = this.defaultApiKey\n ) {\n //console.log(\"deleting record: \", recordId);\n const base = this.getOrConnect(baseId, apiKey);\n if (base == null) {\n return;\n }\n\n return base(table)\n .destroy(recordId)\n .then(record => {\n return record.id;\n })\n .catch(err => {\n console.log(\"error: \", err);\n return;\n });\n }", "function deleteRecord() {\n connection.query(\"DELETE FROM products Where Id = 2\", function(err, res) {\n console.log(\"deleteRecord Returned res: \", res);\n // for (var i = 0; i < res.length; i++) {\n // console.log(res[i].id + \" | \" + res[i].flavor + \" | \" + res[i].price + \" | \" + res[i].quantity);\n // }\n console.log(\"-----------------------------------\");\n displayRecords();\n });\n}", "static delete(req, res) {\n\n const getIdUser = parseInt(req.params.user)\n\n GEN_DATA_AGUNAN.destroy({ where: { UserId: getIdUser } })\n .then((data) => {\n res.status(200).json({\n message: \"delete Data success\",\n result: data\n })\n })\n .catch((err) => {\n res.status(500).json({\n message: \"Internal Server Error\",\n log: err\n })\n })\n }", "delete(post) {\n if (confirm('Are you sure?')) {\n this.sendAction('destroyPost', post);\n }\n }", "deletehsCourse(hscourse){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('courseModel').indexOf(hscourse);\n var restemp = this.get('courseModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "function EditLogItemDelete () {}", "delRec() {\n this.closeModal();\n if(this.selectedEnrollmentType === 'PEV' || this.selectedEnrollmentType === 'PEV HU'){\n deletePevHuRecord({ sPevHuId: this.selectedRecord })\n .then(() => {\n this.sLiveCall = new Date().toLocaleString();\n this.showToastMessage('Record Deleted', this.label.DeleteSuccessMsg, 'success');\n this.bIsLoaded = true;\n this.bShowDeleteModal = false; \n })\n .catch((error) => {\n this.showToastMessage('Application Error', this.label.TransactionErrorMsg, 'error');\n });\n } \n else{\n deleteEnrollmentRecord({ sEnrollmentId: this.selectedRecord })\n .then(() => {\n this.sLiveCall = new Date().toLocaleString();\n this.showToastMessage('Record Deleted', this.label.DeleteSuccessMsg, 'success');\n this.bIsLoaded = true;\n this.bShowDeleteModal = false; \n })\n .catch((error) => {\n this.showToastMessage('Application Error', this.label.TransactionErrorMsg, 'error');\n });\n } \n }", "static delete(request, response) {\r\n\r\n itemsModel.getById(request.params.id)\r\n .then( data => {\r\n if (data.length > 0) {\r\n itemsModel.delete(request.params.id) \r\n response.sendStatus(200);\r\n console.log('Item has been deleted. ID: ', request.params.id); \r\n } else {\r\n response.sendStatus(404);\r\n console.log('Item not found. ID: ', request.params.id);\r\n }\r\n })\r\n .catch(err => {\r\n response.sendStatus(500);\r\n console.log('Error deleting item by ID: ', request.params.id, err);\r\n }); \r\n\r\n }", "deleteSecondarySchool(secondaryschool){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('secondarySchoolModel').indexOf(secondaryschool);\n this.set('ssIndex', index);\n var indextemp = this.get('ssIndex');\n var restemp = this.get('secondarySchoolModel').objectAt(indextemp);\n\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "async remove() {\n const { id } = this;\n const options = {\n TableName: process.env.userTableName,\n Key: ddb.prepare({ id })\n };\n return ddb.call('deleteItem', options);\n }", "async _delete(options, permanent, { eventId } = {}) {\n /* Find the record that needs to be deleted. */\n let model, err;\n [err, model] = await to(this.Model.findOne(options));\n if (err) this._handleErrors(err, { eventId });\n \n /* Only records without any associations can be permanently\n deleted. */\n let destroyOpts;\n if (!model.used && permanent) {\n [err] = await to(model.destroy());\n } else {\n [err] = await to(model.update({ hidden: true }));\n }\n \n /* Return deleted record. */\n this.cache.delete = model;\n if (!model) return null;\n else {\n return model.get({ plain: true });\n }\n }", "function deleteRecord(record_id){\n $(\"#deleteform input[name=student_id]\").val(record_id);\n $(\"#deleteform\").submit();\n }", "deleteRecord(store, type, snapshot) {\n if (this.pathForType(type.modelName) === \"lists\") {\n var id = snapshot.id;\n var url = `${this.get('host')}/${this.namespace}/${this.pathForType(type.modelName)}?id=${id}`;\n return this.ajax(url, \"DELETE\");\n }\n return this._super(...arguments);\n }", "function DeleteRecord(config) {\n RED.nodes.createNode(this, config);\n var node = this;\n var server = RED.nodes.getNode(config.server);\n\n\n // Initial sysparm with defaults values\n var sysparm = {\n sys_id: '' ,\n query_no_domain: false\n };\n \n\n this.prepareRequest = function(table,sysparm,callback) {\n var options = {\n baseUrl: server.instance,\n uri: 'api/now/table/'+table+'/'+sysparm.sys_id,\n body: null,\n method: 'DELETE',\n json: true,\n headers: {\n 'Content-Type': 'application/json',\n 'Authorization': server.auth\n }\n };\n server.doRequest(options, callback);\n\n }\n\n this.on('input', function(msg) {\n var table = msg.topic;\n \n\n // Replace sysparm with node properties\n if (msg.sys_id){\n sysparm.sys_id=msg.sys_id\n }\n if (msg.sysparm_query_no_domain){\n sysparm.query_no_domain=msg.sysparm_query_no_domain\n }\n\n if (!table || !sysparm.sys_id) {\n node.status({\n fill: \"red\",\n shape: \"dot\",\n text: \"Invalid message received\"\n });\n }\n var callback = function(err, res, body) {\n\n\n if (res.statusCode === 204) {\n node.status({});\n msg.payload=res;\n node.send(msg);\n } else {\n node.status({\n fill: \"red\",\n shape: \"dot\",\n text: \"Request failed\"\n });\n node.error(\"Error Deleting record: \"+ sysparm.sys_id + \"(\" + res.statusCode + \"): \" + JSON.stringify(err) + \" \" + JSON.stringify(body));\n }\n\n };\n node.status({\n fill: \"blue\",\n shape: \"dot\",\n text: \"Requesting...\"\n });\n this.prepareRequest(table,sysparm,callback);\n });\n \n }", "function DeleteRecordConfirmed(obj, id) {\r\n\tobj.Tab.Alerts.Clear();\r\n\tvar params = MakeParametersPair(\"go\", \"delete\");\r\n\tparams += MakeParametersPair(\"USER_ID\", obj.USER_ID);\r\n\tparams += MakeParametersPair(\"RECORD_ID\", id);\r\n\tsendRequest(post_service, DeleteCallback, params, obj);\r\n\r\n}", "delete() {\n this.dbUpdater.checkOkToDelete();\n\n // TODO: What is the right way to test this?\n //if (this.last) {\n // throw \"cannot delete account with any transactions\";\n //}\n\n if (this.parent) {\n let parent = this.parent;\n parent.children.delete(this.data.name);\n parent._notifySubscribers();\n // TODO:\n // Should we notify the account itself?\n // Then any view that depends on it could just\n // redirect somewhere else?\n }\n\n this.db.accountsByGuid.delete(this.data.guid);\n this.dbUpdater.delete()\n }", "delete({ sponsor }, res) {\n sponsor.destroy()\n .then( ()=> res.json(sponsor) );\n }", "async deleteAttendanceRecord({ commit }, { userId, attendanceId }) {\n usersRef\n .child(userId)\n .child(\"attendance\")\n .child(attendanceId)\n .remove()\n commit(\"deleteAttendanceRecord\", { userId, attendanceId })\n }", "get Delete() {}", "function delBucketMarexRecords() {\n\tvar db = Ti.Database.open('_alloy_');\n\tvar deleteRecords = db.execute('DELETE FROM bucket_marex');\n\tTi.API.info('Affected Rows : ' + db.getRowsAffected());\n\tdb.close();\n}", "function deleteRecord(id) {\n\n if (id > 0) {\n jQuery.post('helpers/deleteRecord.php', { recordid: id })\n .done(function (data) {\n alert('Record deleted!');\n })\n .fail(function (data) {\n console.log(data);\n alert(\"Could not delete record!\" + data.responseText);\n });\n }\n else {\n alert('Incorect id format.');\n return 0;\n }\n }", "function agenda_delete_db(tx){\n\tvar agenda_id_delete = $(\"#agenda_id_delete\").val();\n\ttx.executeSql(\"DELETE FROM Agenda WHERE id = \"+agenda_id_delete);\n\tagenda_view();\n}", "function removeProd() {\n var id = document.getElementById(\"idProdDel\").value;\n requestDB = db.transaction([\"produtos\"], \"readwrite\")\n .objectStore(\"produtos\")\n .delete(Number(id));\n\n requestDB.onsuccess = function () {\n console.log(\"Removido \" + id);\n };\n requestDB.onerror = function () {\n console.log(\"Erro ao remover\");\n };\n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "function delete_record(del_url,elm){\n\n\t$(\"#div_service_message\").remove();\n \n \tretVal = confirm(\"Are you sure to remove?\");\n\n if( retVal == true ){\n \n $.post(base_url+del_url,{},function(data){ \n \n if(data.status == \"success\"){\n //success message set.\n service_message(data.status,data.message);\n \n //grid refresh\n refresh_grid();\n \n }\n else if(data.status == \"error\"){\n //error message set.\n service_message(data.status,data.message);\n }\n \n },\"json\");\n } \n \n}", "async destroy ({ params, response }) {\n // retrieve the data by given id\n const product = await Product.find(params.id)\n if (product) {\n response.status(200).json({\n success: 'Deleted Record',\n data: product\n })\n await product.delete()\n }else {\n response.status(404).send({ error: 'Product Not Found' })\n }\n }", "deleteComment(event) {\n let data = event.currentTarget.dataset;\n \n //delete request\n\n wx.request({\n url:`https://cloud.minapp.com/oserve/v1/table/85188/record/${data.id}`,\n method: 'DELETE',\n header: {'Authorization':'Bearer 7a82a2b76c38e309ae34ff3c83c87f8409748b0e'},\n success () {\n wx.redirectTo({\n url: '/pages/index/index',\n });\n }\n });\n }", "deleteById(req, res) {\n let id = req.params.id;\n\n this.tradeDao.deleteById(id)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n }", "_handleCommandResourceDelete(options)\n {\n options.resource.destroy({success: (model) => this._handleDeleteSuccess(model, this._collection)});\n }", "async delete({response, params}){\n const id = params.id;\n const userDel = await User.findOrFail(id);\n await userDel.delete();\n\n return response.status(201).json('Data berhasil dihapus!!');\n }", "function deleteItem(entityType, entityItem) {\n\n var entityModel = $injector.get(entityType);\n entityModel.deleteById({ id: entityItem.id }).$promise\n .then(function() { \n Logger.info(entityType + ' Archived', 'Contact admin to retrieve')\n //remove deleted row from the grid without refreshViewing\n gridManager.refreshView()\n //shows deleted\n entityItem._isDeleted = true;\n // // go back - or close sidebar (Close is handled by sidebar router)\n SidebarRouter.goBack();\n\n //creates activity deleted\n var activityDetails = {\n title: 'Deleted ' + entityType,\n data: {\n deleted: true\n }\n }\n activityCreator.createActivity('changelog', activityDetails, true, entityItem, entityType)\n })\n .catch(function(err){\n Logger.error('Error Deleting ' + entityType)\n Logger.log(\"failed to delete - \", err); \n })\n }", "function deleteModel(modelName) {\n testLog.logStart(\"Function Delete Model\");\n cy.contains(modelName)\n .parents('.ms-DetailsRow-fields')\n .find('i[data-icon-name=\"Delete\"]')\n .click()\n\n cy.get('.ms-Dialog-main')\n .contains('Confirm')\n .click()\n testLog.logEnd();\n}", "delete(req, res) {\n //console.log(req);\n let queryVars = req.query;\n Region.destroy({\n where: {\n id: queryVars.id\n }\n })\n .then(function (deletedRecords) {\n res.status(200).json(deletedRecords);\n })\n .catch(function (error){\n res.status(500).json(error);\n });\n }", "async destroy ({ params }) {\n const deposito = await Deposito.findOrFail(params.id);\n await deposito.delete();\n }", "async destroy({view, auth, request, response,params}) {\n // const x = await auth.user.recipe().fetch().rows[params].id\n // console.log(x.rows[0].id)\n const recipeDataBase = await Recipe.findOrFail(params.id)\n await recipeDataBase.delete() \n }", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "function remove() {\n if ($window.confirm('Are you sure you want to delete?')) {\n vm.clientmanagement.$remove()\n .then(function(){\n $state.go('clientmanagements.list');\n });\n\n }\n }", "remove() {\n var db = new DB();\n db.delete(this.table, `id = '${this.getAttribute('id')}'`);\n }", "delete(req, res) {\n\t\tUsuario.destroy({\n\t\t\twhere: {\n\t\t\t\tid_mail: req.params.id_mail\n\t\t\t}\n\t\t})\n\t\t.then(function (deletedRecords) {\n\t\t\tres.status(200).json(deletedRecords);\n\t\t})\n\t\t.catch(function (error){\n\t\t\tres.status(500).json(error);\n\t\t});\n\t}", "async delete(requisition, response){\n await Model.deleteOne({\"_id\": requisition.params.id}).then(resp =>{\n return response.status(200).json(resp);\n }).catch(error => {return response.status(500).json(error);});\n }", "async del(itemId) {\n return this.model.deleteOne({\n _id: itemId\n })\n }", "deleteProduct(empid) {\nthis.productService.deleteProduct(empid);\nthis.getProductList();\n}", "function del(req, res) {\n\tResident\n\t\t.forge({id: req.params.id})\n\t\t.fetch({require: true})\n\t\t.then(doAuth)\n\t\t.then(doDelete)\n\t\t.then(sendResponse)\n\t\t.catch(errorToNotify);\n\n\tfunction doAuth(model) {\n\t\treturn auth.allowsDelete(req.decoded.id, 'residents', model);\n\t}\n\tfunction doDelete(model){\n\t\tlogger.debug('/api/residents >> del()...');\n\t\treturn model.destroy();\n\t}\n\tfunction sendResponse() {\n\t\treturn res.json({error: false, data:{message: 'Resident Details Successfully Deleted'}});\n\t}\n\tfunction errorToNotify(err) {\n\t\tlogger.error(err)\n\t\treturn res.status(500).json({error: true, data: {message: err.message}});\n\t}\n}", "delete(req, res) {\n Game.destroy({\n where: {\n id: req.params.id\n }\n })\n .then((deletedRecords) => {\n res.status(200).json(deletedRecords);\n })\n .catch((error) => {\n res.status(500).json(error);\n });\n }", "static async destroy(req, res, next) {\n try {\n const data = await ToDo.findByPk(+req.params.id)\n if (data) {\n await ToDo.destroy({\n where: {\n id: +req.params.id,\n UserId: +req.decoded.id,\n },\n })\n // res.status(200).json({ data })\n res.status(200).json({\n msg: `ToDo success to delete`,\n })\n } else {\n throw { status: 404 }\n }\n } catch (err) {\n next(err)\n }\n }", "delete() {\n this.items().then(instances => {\n instances.forEach(instance => {\n instance.delete();\n })\n }).catch(error => {\n debugger;\n throw error;\n })\n }", "deleteRecord() {\n var docId = this.props.orderId\n db.collection(\"orders\").doc(docId).delete()\n .then(function() {\n console.log(\"Successfully deleted document id \" + docId)\n })\n .catch(function(error) {\n console.error(\"Error writing document: \" + error);\n });\n }", "function deleteSettings() {\n var tx = db.transaction(['setting'], 'readwrite');\n var store = tx.objectStore('setting');\n let request = store.delete(1);\n request.onerror = function (e) {\n console.log('Error', e.target.error.name);\n throw 'Error' + e.target.error.name;\n };\n request.onsuccess = function () {\n console.log('setting entry deleted successful');\n };\n}", "function recordRemoveAgree(record_id){\n console.log(\"in recordRemoveAgree!\");\n console.log('Cookie session value: '+ Cookies.get('session'));\n var record = new Record(record_id);\n record.trash();\n}", "deleteCustomer(empid) { \n this.customerService.deleteCustomer(empid);\n this.getCustomerList();\n }", "function deleteMembresia(req, res){\n\tlet MembresiaId = req.params.MembresiaId\n\n \tMembresia.findById(MembresiaId, (err, Membresia) => {\n User.find({nombreMbs: Membresia.tipo}, (err,usuario) =>{\n if(usuario.length > -1){\n res.status(400).send({message: 'No se puede eliminar membresia asociada a usuarios'})\n return null\n }\n })\n Categoria.find({tipo: Membresia.tipo}, (err,categoria)=>{\n if(categoria.length > -1){\n res.status(400).send({message: 'No se puede eliminar membresia asociada a categorias'})\n return null\n }\n })\n if (err) res.status(500).send({message: `Error al borrar el Membresia: ${err}`})\n \tMembresia.remove(err => {\n \t\tif (err) res.status(500).send({message: `Error al borrar el Membresia: ${err}`})\n \t\tres.status(200).send({message: 'El Membresia ha sido eliminado'})\n \t})\n\t})\n}", "function deleteRecord(rowID) {\n var answer = confirm(\"Delete this run?\");\n if (answer) {\n global.db.execute('DELETE FROM Times WHERE ROWID = (?)', [rowID]);\n global.db.execute('DELETE FROM Positions where TimeID = (?)', [rowID]);\n go('journeys');\n }\n}", "async deletePayment (req, res) {\n try {\n const {paymentId} = req.body\n Payment.destroy({\n where: {\n id: paymentId\n }\n })\n } catch (err) {\n res.status(500).send({\n error: 'An error has occured during deleting'\n })\n }\n }", "delete(groceryListId, itemName, callback) {\n GroceryItem.findOne({where: {groceryListID: groceryListId, name: itemName}})\n .then((item) => {\n item.destroy()\n .then(() => {\n callback(null);\n })\n .catch((err) => {\n callback(err);\n }) \n })\n .catch((err) => {\n callback(err);\n })\n }", "function deleteById(storename, id) {\r\n console.log(\"deleteAction: storename: \" + storename);\r\n setDatabaseName('dbCat', ['users', 'items', 'categories', 'subcategories ', 'events', 'watchlist']);\r\n setCurrObjectStoreName(storename);\r\n startDB(function () {\r\n deleteOne(id, function () {\r\n alert(\"deleted!\");\r\n location.reload();\r\n });\r\n }); // async func\r\n }", "function deleteProduct(lengthid) {\n if (confirm('Are you sure, you want to delete this record ?')) {\n var entityObject = new chainLengthmodel(lengthid);\n EJewel.AdminView.Services.AdminServices.DeleteChainLength(entityObject, function (result) {\n displayMsg('S', \"Product Deleted Successfully\");\n $(\"#tableProduct\").empty();\n loadProductDetails();\n },\n onServiceError);\n }\n\n}", "function deleteEntry (req, res) {\n logger.debug('Request recieved to cease entry by id', { loggerModule, URL: req.originalUrl, id: req.params.id })\n _performDatabaseUpdate(req, res, {endDate: new Date()})\n }", "static delete(req, res, next) {\n Farm.findById({\n _id: req.params.id,\n })\n .then((farm) => {\n return farm.remove();\n })\n .then((farm) => {\n res.status(200).json({\n success: true,\n message: \"Farm has been Deleted\",\n data: farm,\n });\n })\n .catch(next);\n }", "deleteProfile() {\n // console.log(\"deleteProfile()\");\n return store.delete('CURRENT_PROFILE');\n }", "delete(emp) {\n\t\tlet sqlRequest = `UPDATE employee SET\n\t\t\tactive = $active\n\t\t\tWHERE id=$id`;\n\n\t\tlet sqlParams = {\n\t\t\t$id : emp.id,\n\t\t\t$active: emp.active,\n\t\t};\n\t\treturn this.common.run(sqlRequest, sqlParams);\n\t}", "deleteRecord() {\n this._super(...arguments);\n const gist = this.gist;\n if(gist) {\n gist.registerDeletedFile(this.id);\n\n // Following try/catch should not be necessary. Bug in ember data?\n try {\n gist.get('files').removeObject(this);\n } catch(e) {\n /* squash */\n }\n }\n }", "deleteAccessory(event) {\n let ind = this.accesList.findIndex(record => record.Id === event.target.dataset.id);\n this.accesList.splice(ind, 1);\n this.countTotalAmontOnchange();\n }", "async delete (req, res, Model, deleteStruct) {\n try {\n const result = await Model.destroy({\n where: deleteStruct\n })\n if (result === 0) {\n throw new Error('This ressource doesn\\'t exist')\n }\n // 200 OK\n return res.status(200).send({\n message: 'Ressource successfully deleted'\n })\n } catch (err) {\n // 400 Bad Request\n return res.status(400).send({\n error: 'Failed to delete'\n })\n }\n }", "delete(params)\n {\n let opts = this.buildCallOpts({method:'DELETE'});\n return this.doRequest({method: 'DELETE'}, params._id, params);\n }", "delete(condition, res) {\n this.model.destroy({where: condition}).then(() => res.status(200).json({\n type: 'success',\n message: 'deleted!',\n data: null\n })).catch(e => res.status(200).json({\n type: 'Error',\n message: e.message,\n data: e\n }));\n }", "async delete({request, response, params: {id}}) {\n\n const name = await nameService.findNameBy('id', id);\n\n if (name) {\n\n name.delete()\n\n return response.status(200).send({\n status: 200,\n message: \"name deleted\"\n })\n }\n else{\n return response.status(400).send({\n status: 400,\n message: \"invalid name id\"\n })\n }\n }", "deleteById(req, res) {\n this.Model\n .destroy({where: {id: req.params.id}})\n .then(item => {\n let responseCode = 0;\n\n if (item === 0) {\n responseCode = -2;\n }\n\n return Response.create(res, responseCode, []);\n })\n .catch(err => {\n return Response.create(res, -1, err);\n });\n }", "function _deleteHouse(req, cb) {\n var id = req.params.house;\n req.getConnection(function(err, connection){\n connection.query('DELETE FROM `apartments` WHERE `id` = ?', id, cb);\n });\n }" ]
[ "0.6907617", "0.6384775", "0.62680954", "0.6255711", "0.623355", "0.61950326", "0.6181109", "0.6154751", "0.61408454", "0.6102324", "0.607663", "0.6076215", "0.6067571", "0.6043711", "0.60216534", "0.6017096", "0.6000643", "0.60000104", "0.59948677", "0.59822595", "0.5968975", "0.5955105", "0.59461653", "0.59359294", "0.5933029", "0.59294", "0.5927542", "0.5926199", "0.5901732", "0.58964556", "0.58889055", "0.5888803", "0.5874005", "0.5845136", "0.58369684", "0.58354396", "0.5829468", "0.58233666", "0.5821152", "0.58153236", "0.5814496", "0.58086866", "0.580233", "0.57818776", "0.5781078", "0.5768841", "0.5766605", "0.5758115", "0.57568353", "0.57533133", "0.573797", "0.5730253", "0.572771", "0.57180935", "0.5717868", "0.57174057", "0.57174057", "0.5716492", "0.5713035", "0.5712233", "0.57117283", "0.57044846", "0.57034236", "0.57028556", "0.5701298", "0.5700055", "0.5699891", "0.56989485", "0.5698224", "0.56962705", "0.5690559", "0.56858605", "0.56824327", "0.56814206", "0.5679812", "0.56777424", "0.56707495", "0.5669467", "0.5665513", "0.5663367", "0.5659912", "0.5655554", "0.5647425", "0.56459445", "0.5645403", "0.563603", "0.563578", "0.5635771", "0.56298035", "0.5624736", "0.5615566", "0.56147075", "0.5610539", "0.55968", "0.55963093", "0.5591274", "0.5587934", "0.558367", "0.5583526", "0.55806017" ]
0.60706985
12
Manage or unmanage a user corresponding the the button clicked
function manage_click(ev) { let btn = $(ev.target); let manage_id = btn.data('manage'); let user_id = btn.data('user-id'); if (manage_id != "") { unmanage(user_id, manage_id); } else { manage(user_id); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function set_button(user_id, value) {\n $('.manage-button').each( (_, bb) => {\n if (user_id == $(bb).data('user-id')) {\n $(bb).data('manage', value);\n }\n });\n update_buttons();\n}", "_handleButtonAddAdmin()\n {\n Radio.channel('rodan').request(RODAN_EVENTS.REQUEST__PROJECT_ADD_USER_ADMIN,\n {username: this._getSelectedUser(), project: this._project});\n }", "function editUser(event) {\n $button= $(event.currentTarget);\n $userId=$button.parent().parent().parent().attr(\"id\");\n findUserById($userId).then(renderUser);\n }", "function show_manage_user(){\n var manage_user = fill_template('user-management',{});\n $('#dd-log-in-menu').remove();\n $('.navbar-nav').append(manage_user);\n $('#dd-manage-alerts').click( function(e) {\n show_manage_alerts();\n });\n $('#dd-log-out').click( function(e) {\n set_cookie('dd-email','', -100);\n show_log_in();\n });\n }", "function manage(user_id) {\n let text = JSON.stringify({\n manage: {\n manager_id: current_user_id,\n underling_id: user_id\n },\n });\n\n $.ajax(manage_path, {\n method: \"post\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { set_button(user_id, resp.data.id); },\n error: (resp) => { console.log(resp); }\n });\n}", "function handleAdminRemove() {\n if ($scope.currentUser === $scope.userToRemove.username) {\n $scope.reDirect();\n } else {\n $scope.init();\n }\n }", "function update_buttons() {\n $('.manage-button').each( (_, bb) => {\n let user_id = $(bb).data('user-id');\n let manage = $(bb).data('manage');\n if (manage != \"\") {\n $(bb).text(\"Unmanage\");\n }\n else {\n $(bb).text(\"Manage\");\n }\n });\n}", "function editUser(event) {\n var editButton = $(event.currentTarget);\n var userId = editButton\n .parent()\n .parent()\n .parent()\n .attr('id');\n userId = parseInt(userId);\n currentUserID = userId;\n userService\n .findUserById(userId)\n .then(renderUser);\n }", "async function manageUser()\n{\n\tlet server = objActualServer.server\n\tlet txt = \"Choissisez la personne que vous souhaitez manager : \"\n\n\tlet choice = [\n\t{\n\t\tname: \"Retournez au menu précédent\",\n\t\tvalue: -1\n\t}]\n\tchoice.push(returnObjectLeave())\n\tserver.members.forEach((usr) =>\n\t{\n\t\tlet actualUser = usr.user\n\t\tchoice.unshift(\n\t\t{\n\t\t\tname: actualUser.username,\n\t\t\tvalue: actualUser\n\t\t})\n\t})\n\n\tlet data = await ask(\n\t{\n\t\ttype: \"list\",\n\t\tname: \"selectedUser\",\n\t\tmessage: txt,\n\t\tchoices: choice,\n\t})\n\n\tif (data.selectedUser == -1)\n\t{\n\t\tchooseWhatToHandle(data)\n\t}\n\telse if (data.selectedUser == -2)\n\t{\n\t\tendProcess()\n\t}\n\telse\n\t{\n\t\tmanageSingleUser(data.selectedUser)\n\t}\n\n}", "function useSaveButton() {\r\n var user = document.getElementById(\"userID\").value;\r\n editASingleUser(user)\r\n startPage()\r\n}", "function handleClick() {\n setShowUserProfile((!showUserProfile))\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 updateUser() {\n if (model.addAdmin) {\n model.user.roles.push(\"ADMIN\");\n }\n if (model.addMember) {\n model.user.roles.push(\"MEMBER\");\n }\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "function handleCoachAccess(){\n var userId = localStorage.getItem(\"user\");\n if(userId != null) {\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var manager = snapshot.child(\"manager\").val();\n\n if(manager == true){\n document.getElementById('edit-delete-player').className = \"btn btn-danger\";\n }\n });\n }\n}", "function unmanage(user_id, manage_id) {\n $.ajax(manage_path + \"/\" + manage_id, {\n method: \"delete\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: \"\",\n success: () => { set_button(user_id, \"\"); },\n });\n}", "function postManageUsers(data, textStatus, jqXHR, param) {\n\tvar users = data;\n\tusers.sort(compareIgnoreCase);\n\tvar uiDiv = $('#ui');\n\tuiDiv.html('');\n\tvar h2 = $('<h2>');\n\tuiDiv.append(h2);\n\th2.html('User Management');\n\th2 = $('<h2>');\n\tuiDiv.append(h2);\n\th2.html('Create an User');\n\tvar input = $('<input>');\n\tinput.attr({'type': 'text',\n\t\t'name': 'role',\n\t\t'id': 'role'\n\t});\n\tuiDiv.append(input);\n\tinput = $('<input>');\n\tinput.attr({'type': 'button',\n\t\t'value': 'Create',\n\t\t'id': 'createRole',\n\t\t'onclick': 'createUser();'\n\t});\n\tuiDiv.append(input);\n\th2 = $('<h2>');\n\tuiDiv.append(h2);\n\th2.html('Existing Users');\n\tvar p = $('<p>');\n\tuiDiv.append(p);\n\tif (allowManageAttributes) {\n\t\tvar a = $('<a>');\n\t\tp.append(a);\n\t\ta.attr({'href': 'javascript:manageAllRoles()'});\n\t\ta.html('Manage attributes of all users');\n\t}\n\tvar table = $('<table>');\n\tuiDiv.append(table);\n\ttable.addClass('role-list');\n\tvar tr = $('<tr>');\n\ttable.append(tr);\n\tvar th = $('<th>');\n\ttr.append(th);\n\tth.html('User');\n\tth = $('<th>');\n\ttr.append(th);\n\tth.html('Delete');\n\tth = $('<th>');\n\ttr.append(th);\n\tth.html('Disable');\n\tth = $('<th>');\n\ttr.append(th);\n\tth.html('Reset');\n\tif (allowManageAttributes) {\n\t\tth = $('<th>');\n\t\ttr.append(th);\n\t\tth.html('Attributes');\n\t}\n\t$.each(users, function(i, user) {\n\t\ttr = $('<tr>');\n\t\ttable.append(tr);\n\t\ttr.addClass('role');\n\t\tvar td = $('<td>');\n\t\ttr.append(td);\n\t\ttd.html(user);\n\t\ttd = $('<td>');\n\t\ttr.append(td);\n\t\tinput = $('<input>');\n\t\tinput.attr({'type': 'button',\n\t\t\t'value': 'Delete user',\n\t\t\t'onclick': 'deleteUser(\"' + user + '\");'\n\t\t});\n\t\ttd.append(input);\n\t\ttd = $('<td>');\n\t\ttr.append(td);\n\t\tinput = $('<input>');\n\t\tinput.attr({'type': 'button',\n\t\t\t'value': 'Disable login',\n\t\t\t'onclick': 'disableLogin(\"' + user + '\");'\n\t\t});\n\t\ttd.append(input);\n\t\ttd = $('<td>');\n\t\ttr.append(td);\n\t\tinput = $('<input>');\n\t\tinput.attr({'type': 'button',\n\t\t\t'value': 'Reset password',\n\t\t\t'onclick': 'resetPassword(\"' + user + '\");'\n\t\t});\n\t\ttd.append(input);\n\t\tif (allowManageAttributes) {\n\t\t\ttd = $('<td>');\n\t\t\ttr.append(td);\n\t\t\tvar a = $('<a>');\n\t\t\ttd.append(a);\n\t\t\ta.attr({'href': 'javascript:manageUserRoles(\"' + user + '\")'});\n\t\t\ta.html('Manage attributes');\n\t\t}\n\t});\n}", "mutateUser ({dispatch}, payload) {\n if (payload.id) {\n dispatch('editUser', payload)\n } else {\n // TODO creating a user from the admin account\n console.log('this user doesnt exist in database')\n }\n }", "function removeUser(){\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tdelete currentProject.members[i].name;\n\t\t\t\tdelete currentProject.members[i].role[j];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n\tpopTable();\n}", "approveMember() {\n MemberActions.approveUser(this.props.memberID);\n this.props.unselect();\n }", "_onUserUpdated() {\n UserActions.setIsUpdating(false);\n UserActions.setIsRequesting(false);\n }", "function deleteUserPermission(user) {\n $('#userIdDelete').val(user.user_id);\n $('#nameDelete').text(user.first_name + ' ' + user.last_name);\n $('#deleteModal').modal('show');\n}", "function listUsersButton() {\n listUsers();\n $listUsers.toggle();\n }", "async inactivate (user) {\n try {\n let currentTeam = await Team.findById(user.currentTeamId) || null\n if (currentTeam && user.owns(currentTeam)) { throw Err.transferOwnership }\n if (currentTeam) { currentTeam.removeMember(user) }\n \n user.inactivate()\n \n return Say.success('currentTeam', currentTeam) // hand this back to save in the controller\n } catch (error) { return Err.make(error) }\n }", "function useNewButton() {\r\n createUser();\r\n startPage()\r\n}", "deleteUser() {\n this.deleteBox.seen = true\n }", "setCurrentUser (user, id) {\n resourceCache.addItem('users', user)\n }", "function initializePage_userProfile()\r\n{\r\n page_userProfile.$auxButton.eq(0).click(logout);\r\n page_userProfile.$auxButton.eq(1).click(showPage_editAccount);\r\n}", "toggleuser(event, uname) {\n event.preventDefault();\n // If not already selected\n if (this.selectedusers.indexOf(uname) < 0) {\n document.querySelector(\"#\" + uname).setAttribute(\"class\", \"btn btn-primary selected\");\n this.selectedusers.push(uname);\n // If already selected\n }\n else {\n document.querySelector(\"#\" + uname).setAttribute(\"class\", \"btn btn-primary unselected\");\n this.selectedusers = this.selectedusers.filter((u) => {\n return u != uname;\n });\n }\n console.log(\"Selected users: \", this.selectedusers);\n }", "function enableEditingUser(userId){\n $('#'+userId+'-email').removeAttr('disabled');\n $('#'+userId+'-save').removeAttr('disabled');\n $('#'+userId+'-edit').hide();\n $('#'+userId+'-cancel').show();\n}", "function openEditUser() {\n routingBase.goToCurrentState('userDetails');\n }", "function addUserOnClick (e) {\n if (e.target.id != 'add-user') {\n return;\n }\n newUserForm = document.querySelector('#new-user-form');\n newUserForm.style.display = 'block';\n var newUserRoleSelect = document.querySelector('#new-user-form .new-user-role');\n getRoles(newUserRoleSelect);\n var newUserUserSelect = document.querySelector('#new-user-form .new-user-user');\n getUsers(newUserUserSelect);\n}", "selectUserDialog() {\n actions.showDialog({name: 'users'});\n }", "function checkUser(user) {\n user.checked = !user.checked;\n }", "function useDeleteButton() {\r\n var user = document.getElementById(\"userID\").value;\r\n deleteASingleUser(user)\r\n startPage()\r\n}", "function handleClick() {\n if (isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"none\"; // Show only authorise buttons\n document.getElementById(\"edit\").children[1].style.display = \"none\";\n document.getElementById(\"edit\").children[6].style.display = \"block\";\n document.getElementById(\"edit\").children[5].style.display = \"block\";\n document.getElementById(\"edit\").children[4].style.display = \"block\";\n document.getElementById(\"edit\").children[3].style.display = \"block\";\n }\n if (!isAuthenticated) {\n document.getElementById(\"edit\").children[2].style.display = \"block\";\n document.getElementById(\"edit\").children[6].style.display = \"none\";\n }\n }", "clicked(text){\n\n //First you must deactivate user\n var headersDeactivate = new Headers();\n var headersDelete = new Headers();\n var urlBase = 'https://dev-684166.okta.com/api/v1/users/';\n var urlEnd = '/lifecycle/deactivate';\n var response = fetch(urlBase + this.refs.textbox.value + urlEnd,\n {method: 'POST',\n headersDeactivate,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'SSWS 004drD6vlQO3KsxpUk7l9Z24MJAINkf2tEWMbutnHA'\n }\n );\n\n //After deactivation, user is deleted\n var url2 = 'https://dev-684166.okta.com/api/v1/users/';\n var response2 = fetch(url2 + this.refs.textbox.value,\n {method: 'DELETE',\n headersDelete,\n 'Accept': 'application/json',\n 'Content-Type': 'application/json',\n 'Authorization': 'SSWS 004drD6vlQO3KsxpUk7l9Z24MJAINkf2tEWMbutnHA'\n }\n );\n\n //Update the text displayed below button\n this.setState({text: 'User with the ID '+ this.refs.textbox.value + ' has been deleted.'});\n\n }", "onClickUser1Button() {\n const userData = {\n 'user': 'Adam Smith',\n 'role': 'Broker Admin',\n 'permission': ' List all companies and users under the broker including self.',\n };\n this.props.fetchAccessToken(\"[email protected]\", userData);\n this.props.closePopup();\n }", "toggleStatus(userId) {\n const existing = LobbyStatus.findOne(userId);\n if (!existing) {\n throw new Meteor.Error(403, ErrMsg.userNotInLobbyErr);\n }\n const newStatus = !existing.status;\n LobbyStatus.update(userId, { $set: { status: newStatus } });\n\n const asst = TurkServer.Assignment.getCurrentUserAssignment(userId);\n return Meteor.defer(() => this.events.emit(\"user-status\", asst, newStatus));\n }", "function loadUser() {\n checkAdmin(username);\n hideElement(\"#btn-invite-form\");\n if (isAdmin) {\n // showElement(\"#btn-block-user\");\n showElement(\"#btn-delete-user\");\n showElement(\"#btn-ban-user\");\n showElement(\"#btn-set-admin\");\n hideElement(\"#btn-report-user\");\n showElement(\".incoming-message .btn-group\");\n if (chatroomType === \"Private\")\n showElement(\"#btn-invite-form\");\n } else {\n // hideElement(\"#btn-block-user\");\n hideElement(\"#btn-delete-user\");\n hideElement(\"#btn-ban-user\");\n hideElement(\"#btn-set-admin\");\n showElement(\"#btn-report-user\");\n hideElement(\".incoming-message .btn-group\");\n }\n}", "function ApproveUserToManageActivity(event) {\n\n\n // If it is, compile all user info into one object\n var ApproveUserToManageActivityRecord = {\n 'ApprovedToManageDate': localStorage.getItem('CurrentDate'),\n 'UserID': localStorage.getItem('UserIDtoApprove'),\n 'ActivityID': localStorage.getItem('CurrentActivity'),\n 'RequestStatus': 'approved',\n }\n\n\n // If they did, do our delete\n $.ajax({\n type: 'POST',\n data: ApproveUserToManageActivityRecord,\n url: '/AppEngine/ApproveUserToManageActivity/',\n dataType: 'JSON'\n }).done(function( response ) {\n \n\n });\n\n }", "function toggleUserActive() {\n const id = this.userId;\n // what are we going to do to the user, depending on the class of the clicked button\n const action = data.users[id].active == true ? \"deactivate\" : \"activate\";\n const currentClass = this.className;\n // temporarily change the class (sometimes it's not visible because of the speed)\n this.classList.add(\"changing\");\n // we use here fetch() a modern way of doing AJAX from JS\n fetch(phpDirectory + \"de-activate-user.php\", {\n method: \"POST\",\n body: httpQuery({ user: id, action: action }),\n headers: { 'Content-type': 'application/x-www-form-urlencoded', 'charset': 'utf-8' },\n })\n .then((response) => response.json())\n .then((response) => {\n if (response.error) {\n // if soomething went wrong\n console.log(response.message);\n // put the button in its original style\n this.className = currentClass;\n } else if (response.content === true) {\n // if the user has been activated put the button \"active\"\n this.className = \"active\";\n } else if (response.content === false) {\n // if the user has been deactivated put the button \"inactive\"\n this.className = \"inactive\";\n }\n });\n}", "editUserPreferredNameButton(){\n\t\tif(AuthService.userIsAuthenticated()){\n\t\t\treturn (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"edit_new_user-preferred_name_button\"\n\t\t\t\t\tvariant=\"btn btn-outline-primary\"\n\t\t\t\t\tonClick={\"\"}\n\t\t\t\t>\n\t\t\t\t\tEdit\n\t\t\t\t</Button>\n\t\t\t)\n\t\t}\n\t}", "function addUserClickAction()\n{\n\t$(\".user\").off(\"click\");\n\n\t$(\".user\").click(function(e)\n\t{\n\t\tif(nbPlayers < 5 || $(this).hasClass(\"active\"))\n\t\t{\n\t\t\tif($(this).hasClass(\"active\"))\n\t\t\t{\n\t\t\t\tdelete playersList[parseInt($(this).attr(\"user_id\"))];\n\t\t\t} else\n\t\t\t{\n\t\t\t\tplayersList[parseInt($(this).attr(\"user_id\"))] = $(this).find(\"span\").text();\n\t\t\t}\n\n\t\t\t$(this).toggleClass(\"active\");\n\n\t\t\tnbPlayers = $(\".user.active\").size();\n\n\t\t\tif(nbPlayers > 2)\n\t\t\t{\n\t\t\t\t$(\"#commencer\").removeClass(\"disable\");\n\t\t\t\t$(\"#commencer\").addClass(\"enable\");\n\n\t\t\t\t$(\"#commencer\").off(\"click\");\n\t\t\t\t$(\"#commencer\").on(\"click\", function(e)\n\t\t\t\t{\n\t\t\t\t\t$.ajax(\n\t\t\t\t\t{\n\t\t\t\t\t\turl: serverUrl + \"queries.php\",\n\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\tcache: false,\n\t\t\t\t\t\tdata:\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tfunc: \"find_team\",\n\t\t\t\t\t\t\tplayers: playersList,\n\t\t\t\t\t\t\tcount: nbPlayers\n\t\t\t\t\t\t}\n\t\t\t\t\t}).done(function(data)\n\t\t\t\t\t{\n\t\t\t\t\t\tteamId = data;\n\n\t\t\t\t\t\tscreenReportingHome();\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$(\"#commencer\").addClass(\"disable\");\n\t\t\t\t$(\"#commencer\").removeClass(\"enable\");\n\t\t\t\t$(\"#commencer\").off(\"click\");\n\t\t\t}\n\t\t}\n\t});\n}", "function changeUserDialog(buttonsToDisable) {\n\tif (!buttonsToDisable) buttonsToDisable = [];\n\n\tfunction noUserSelected() {\n\t\talert(\"You'll need to enter your username before you can use NIM.\");\n\t}\n\n\tfunction userSelected() {\n\t\talert('User changed to: ' + changeUserInput.text);\n\t}\n\n\tif (!username) username = '';\n\n\tvar changeUserDialog = new Window('dialog', 'NIM', undefined),\n\t\tchangeUserGroup = changeUserDialog.add('group', undefined),\n\t\tchangeUserLabel = changeUserGroup.add('statictext', undefined, 'Change user: '),\n\t\tchangeUserInput = changeUserGroup.add('edittext', [0, 0, 250, 20], username),\n\t\tbuttonGroup = changeUserDialog.add('group', undefined),\n\t\tconfirmButton = buttonGroup.add('button', undefined, 'OK'),\n\t\tcancelButton = buttonGroup.add('button', undefined, 'Cancel');\n\n\tconfirmButton.onClick = function() {\n\t\tif (!changeUserInput.text) {\n\t\t\tnoUserSelected();\n\t\t\tusername = '';\n\t\t\tsetPref('NIM', 'User', '');\n\t\t\tchangeUserDialog.close();\n\t\t\treturn;\n\t\t}\n\n\t\tvar users = nimAPI({ q: 'getUserID', u: changeUserInput.text });\n\t\tif (users.length && users[0].ID) {\n\t\t\tuserID = users[0].ID;\n\t\t\tuserSelected();\n\t\t\tusername = changeUserInput.text;\n\t\t\tsetPref('NIM', 'User', username);\n\t\t\tchangeUserDialog.close();\n\t\t}\n\t\telse\n\t\t\talert(\"User not found!\");\n\t}\n\n\tcancelButton.onClick = function() {\n\t\tif (!userID)\n\t\t\tnoUserSelected();\n\t\tchangeUserDialog.close();\n\t}\n\n\tif (loadingPanel) loadingPanel.close();\n\tchangeUserDialog.show();\n}", "function handleEditUser(event){\n //Extract the url of the resource from the form action attribute.\n if (DEBUG) {\n console.log (\"Triggered handleEditUser\");\n }\n var $form = $(this).closest(\"form\");\n var body = serializeFormTemplate($form);\n var user_url = $(this).closest(\"form\").attr(\"action\");\n edit_user(user_url, body);\n return false;\n}", "function informationAcoout(){\n let btn = document.querySelector(\"#cont-menu > #user\");\n if(localStorage.getItem(\"user\")){\n btn.onclick = (e)=>{\n if(localStorage.getItem(\"user\")){\n location.replace(\"/login/informacioncuenta\");\n }else{\n urlCreateAccount();\n }\n }\n }else{\n urlCreateAccount();\n }\n}", "function addManageableUserEntry(id, name, accountType) {\n dom('#manageableuserstable').innerHTML += `\n <tr id=\"a${id}\">\n <td>${name}</td>\n <td id=\"b${id}\" class=\"account-type\">${accountType}</td>\n <td class=\"hidden\">\n <button type=\"button\" data-mutate=\"b${id}\" class=\"btn btn-outline-primary account-upgrade\">Upgrade to Admin</button>\n <button type=\"button\" data-mutate=\"a${id}\" data-bs-toggle=\"modal\" data-bs-target=\"#deleteAccountModal\" class=\"btn btn-danger account-delete\">Delete Account</button>\n </td>\n </tr>`\n}", "set_user(on) { store.dispatch(hpUser(on)); }", "function onUserChange(newname) {\n var id;\n\n username = newname;\n\n items.username = username;\n\n var fn = !!username? loggedin: loggedout;\n for (i=0, len=fn.length; i<len; i++) {\n fn[i](newname);\n }\n }", "checkIn(userId, container) {\n request.addUserToGroup(this.checkinGroup, userId).then((response) => {\n if (response.status === 200 && container) {\n //Remove the html element representing the list item of the user\n container.remove();\n //If the user was the last user in the list, set a fallback information text.\n if (document.getElementById('signedInUsersList').innerHTML === null) {\n document.getElementById('signedInUsers').innerHTML = \"No more users left to check in.\"\n }\n } else {\n chayns.dialog.alert(null, \"Something went wrong..\")\n }\n })\n }", "function addUser() {\n $.post($(this).attr('action'), $(this).serialize(), function (response) {\n addStatusMessage(response.msg, true);\n $('#add-user-modal').modal('toggle');\n\n let user = response.user;\n let newRow = $('#table-users').DataTable().row.add([user.username, user.email, user.roles.join(', '), '', '', '']).draw().node();\n $(newRow).attr(\"id\", \"user_\" + user.id);\n if (user.active === 1) {\n $(newRow).find('td:eq(3)')\n .append($('<span>', {class: 'text-success'})\n .append($('<i>', {class: 'fa fa-check'})))\n } else if (user.active === 0) {\n $(newRow).find('td:eq(3)')\n .append($('<span>', {class: 'text-danger'})\n .append($('<i>', {class: 'fa fa-times'})))\n }\n $(newRow).find('td:eq(4)')\n .append($('<button>', {\n type: 'button',\n 'class': 'btn text-primary edit-user-btn p-0',\n 'data-Userid': user.id,\n click: editUser\n }).append($('<i>', {class: 'fa fa-edit'})));\n $(newRow).find('td:eq(5)')\n .append($('<button>', {\n type: 'button',\n 'class': 'btn text-danger delete-user-btn p-0',\n 'data-Userid': user.id,\n click: deleteUser\n }).append($('<i>', {class: 'fa fa-times'})));\n\n\n }, 'json')\n .fail(function (response) {\n addStatusMessage(response.responseText, false, \"\");\n\n $('#add-user-modal').modal('toggle');\n });\n return false;\n}", "target_user(state, payload){\n Object.assign(state.AdminPanel.userEdit, payload)\n }", "function modal_edit_user(person) \r\n{\r\n /*Recuperar el id de la garantia que se desea actualizar*/\r\n $('#modal_edit_user').modal('toggle');\r\n $('#edit_persona').val(person);\r\n return false;\r\n}", "editProfile(){\n\t\tresources.profileEdit().click();\n\t}", "async okClick(event) {\n Object.assign(this.state, {editable:false});\n\n await request(`${document.globals.origin}/users/logout`, 'POST', document.globals.token, null, null, null);\n document.globals.user_id = null;\n document.globals.username = null;\n document.globals.token = null;\n this.props.handleMenu()\n }", "function editusergroup(id) {\n\t\t$('#editusergroup'+id).click(function(e){\n\t\t\te.preventDefault();\n\t\t\t$('#usergroupactive'+id).hide();\n\t\t\t$('#usergrouplist'+id).show();\n\t\t\t$(this).hide();\n\t\t\t$('#editusergroupbuttons'+id).show();\n\t\t});\n\t}", "function setAdmin() {\n let username = $('input[name=\"all-users\"]:checked').val();\n if(!checkElement(username)) return;\n $.post(\"/chatroom/setAdmin\", {username: username, chatRoomId: chatroomId}, function () {\n }, \"json\");\n}", "async function handleClick (e) {\n try {\n e.preventDefault()\n const user = {name, email, password, role}\n const response = await RegisterUser(user)\n const returnJson = await response.json()\n const token = returnJson.token\n\n if (token) {\n localStorage.setItem('userName', token)\n const role = returnJson.role\n \n if(role === 'salon') {\n setModal({ text: \"Usuário cadastrado - Salao\", show: true });\n } else {\n setModal({ text: \"Usuário cadastrado - Cozinha\", show: true });\n } \n } \n\n } catch (error) {\n setModal({ text: \"Favor inserir dados validos\", show: true });\n\n }\n }", "function manageUser(action, email) {\r\n $.get(address + ':3001/check-session', {}, function(data){\r\n if(action == \"create\") {\r\n if(data.authority.user.create == 1) {\r\n $('#modalCreate').modal('toggle');\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n else if(action == \"update\") {\r\n if(data.authority.user.update == 1) {\r\n $('#modalUpdate').modal('toggle');\r\n $('#update-email').val(\"\");\r\n $('#update-fullname').val(\"\");\r\n $('#update-role').val(\"\");\r\n $('.checkbox input').prop('checked', false);\r\n let userEmail = email;\r\n let query = `query getSingleUser($userEmail: String!) {\r\n user(email: $userEmail) {\r\n fullname\r\n email\r\n role\r\n authority {\r\n user {\r\n read\r\n create\r\n update\r\n delete\r\n }\r\n api {\r\n user\r\n blog\r\n commerce\r\n consult\r\n supply\r\n report\r\n }\r\n }\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {userEmail},\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n $('#update-email').val(data.data.user.email);\r\n $('#update-fullname').val(data.data.user.fullname);\r\n $('#update-role').val(data.data.user.role);\r\n if(data.data.user.authority.user.read == 1)\r\n $('.cb2 #cb-read').prop('checked', true);\r\n if(data.data.user.authority.user.create == 1)\r\n $('.cb2 #cb-create').prop('checked', true);\r\n if(data.data.user.authority.user.update == 1)\r\n $('.cb2 #cb-update').prop('checked', true);\r\n if(data.data.user.authority.user.delete == 1)\r\n $('.cb2 #cb-delete').prop('checked', true);\r\n if(data.data.user.authority.api.user == 1)\r\n $('.cb2 #cb-user').prop('checked', true);\r\n if(data.data.user.authority.api.blog == 1)\r\n $('.cb2 #cb-blog').prop('checked', true);\r\n if(data.data.user.authority.api.commerce == 1)\r\n $('.cb2 #cb-commerce').prop('checked', true);\r\n if(data.data.user.authority.api.commerce == 1)\r\n $('.cb2 #cb-commerce').prop('checked', true);\r\n if(data.data.user.authority.api.consult == 1)\r\n $('.cb2 #cb-consult').prop('checked', true);\r\n if(data.data.user.authority.api.supply == 1)\r\n $('.cb2 #cb-supply').prop('checked', true);\r\n if(data.data.user.authority.api.report == 1)\r\n $('.cb2 #cb-report').prop('checked', true);\r\n });\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n else if(action == \"delete\") {\r\n if(data.authority.user.delete == 1) {\r\n $('#modalDelete').modal('toggle');\r\n let userEmail = email;\r\n let query = `query getSingleUser($userEmail: String!) {\r\n user(email: $userEmail) {\r\n fullname\r\n email\r\n role\r\n authority {\r\n user {\r\n read\r\n create\r\n update\r\n delete\r\n }\r\n api {\r\n user\r\n blog\r\n commerce\r\n consult\r\n supply\r\n report\r\n }\r\n }\r\n }\r\n }`;\r\n\r\n fetch(address + ':3000/graphql', {\r\n method: 'POST',\r\n headers: {\r\n 'Content-Type': 'application/json',\r\n 'Accept': 'application/json',\r\n },\r\n body: JSON.stringify({\r\n query,\r\n variables: {userEmail},\r\n })\r\n }).then(r => r.json()).then(function(data) {\r\n $('#delete-email').html(data.data.user.email);\r\n $('#delete-fullname').html(data.data.user.fullname);\r\n $('#delete-role').html(data.data.user.role);\r\n });\r\n }\r\n else {\r\n alert(\"You don't have permission to \" + action);\r\n }\r\n }\r\n });\r\n}", "function buttonClicked() {\n // need to get programmatic access to input box/ input control\n //can change anything with js that we can change with the editor\n // STANDARD STMT. by id (the id is a string):*** var ctrl = document.getElementById(...) ***\n var usernameCtrl = document.getElementById(\"username\"); // !! this variable now represents the input box. this variable is now a programmatic control to fjdfklfkj...\n usernameCtrl.value = users[1].username; //.value the value attribut -fhm This is how you get ??? should be in our notes\n var isadminCtrl = document.getElementById(\"isadmin\");\n isadminCtrl.checked = users[1].isAdmin;\n}", "function handleUpdateUser(name, about) {\n api.changeUserInfo({ name, about })\n .then((userData) => {\n setCurrentUser(userData.data)\n })\n .then(closeAllPopups)\n .catch(err => console.log(\"Error: \" + err));\n }", "function supprUser(){\n\tif (confirm(\"Voulez-vous vraiment supprimer cet utilisateur ?\")) {\n\t\t$.post(\"php/suppr_user.php\",{id:$(this).data('id')},valideSup);\n\t}\t\n}", "function updateUsers () {\n document.querySelector('.like-button').remove()\n showPanel.innerHTML += '<p><strong>pouros</strong></p><button class=\"like-button\">Read Book</button>'\n}", "function openOneUserAccess() {\n\tif (currentGroup != null && currentGroup.userAccesses.length == 1) {\n\t\tvar userAccess = currentGroup.userAccesses[0];\n\t\tpopulateUserAccessForm(userAccess);\n\t} else {\n\t\thide(\"newUser\");\n\t}\n}", "function saveUser(){\n\tvar mem = document.getElementById(\"EditName\").value;\n\tvar role = document.getElementById(\"EditRole\").value;\n\tfor(i in currentProject.members){\n\t\tif(currentProject.members[i].name == savedMem){\n\t\t\tfor (j in currentProject.members[i].role) {\n\t\t\t\tcurrentProject.members[i].name = mem;\n\t\t\t\tcurrentProject.members[i].role[j] = role;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}\n\tdocument.getElementById(\"EditUser\").style.display = \"none\";\n popTable();\n \n createMember(mem, role);\n\t\n\t\n}", "function editUser() {\n let user_id = $(this).data().userid;\n\n $.ajax({\n url: \"/edit/user/\" + user_id,\n type: 'GET'\n }).done(function (resp) {\n createEditUserDialog(resp);\n }).fail(function (response) {\n addStatusMessage(response.responseText, false);\n\n $(\"html, body\").animate({scrollTop: 0}, \"slow\");\n $('#' + modal_id).modal(\"hide\");\n });\n}", "function UserUi({user, setUserPage, setUserKey}) {\n \n function handleClick() {\n setUserPage('UserInfo')\n setUserKey(user.name.first)\n }\n\n return (\n <>\n <User onClick={handleClick}>\n <h1>{user.name.first}</h1>\n <img src={user.picture.large} alt='user'></img>\n </User>\n \n </>\n )\n}", "function toggleUserView() {\n if (user) {\n $('#submitToggle, #favoriteToggle, #displayProfile, #logoutUser').show();\n } else {\n $('#submitToggle, #favoriteToggle, #displayProfile, #logoutUser').hide();\n // remove all favorited list items\n $('li.favorite').removeClass('favorite');\n }\n}", "toggleRole() {\n if(this.role == 'Manager') {\n this.role = 'Employee';\n this.employee = this.tempEmployee;\n this.editEmployee = this.employee;\n } else {\n this.role = 'Manager';\n }\n }", "function deleteUser(event) {\n var deleteBtn = $(event.currentTarget);\n var userId = deleteBtn\n .parent()\n .parent()\n .parent()\n .attr('id');\n userId = parseInt(userId);\n userService\n .deleteUser(userId)\n .then(findAllUsers);\n }", "function LinkAdaptatorToModify(id) \r\n{\r\n\tvar a = document.getElementById(id); \r\n\tif (confirm('Do you want to modify the following user : '+ a.id )) {\r\n\t\ta = \"ModifyUser?idModify=\"+a.id;\r\n\t\twindow.location.replace(a);\r\n\t}\r\n\r\n}", "function AskToManageActivity(event) {\n\n\n // If it is, compile all user info into one object\n var RequestByUserToManageActivityRecord = {\n 'UserName': localStorage.getItem('CurrentLoggedInUser'),\n 'UserID': localStorage.getItem('CurrentLoggedInUserID'),\n 'ActivityID': localStorage.getItem('ManageToActivityID'),\n 'ActivityTitle': localStorage.getItem('ManageToActivityTitle'),\n 'RequestToManageDate': localStorage.getItem('CurrentDate'),\n 'ManageRequestComment': localStorage.getItem('RequestComment'),\n 'RequestBtnClass': 'invisible',\n 'RequestStatus': 'pending',\n }\n\n\n // If they did, do our delete\n $.ajax({\n type: 'POST',\n data: RequestByUserToManageActivityRecord,\n url: '/AppEngine/AskToManageActivity/'+localStorage.getItem('ManageToActivityID') + '/' + localStorage.getItem('CurrentLoggedInUserID'),\n dataType: 'JSON'\n }).done(function( response ) {\n\n\t\t\tdocument.querySelector('x-RequestActivity').BackToActivityList();\n \n });\n\n }", "function display_user() {\r\n show(user);\r\n hide(admin);\r\n}", "function setAppboyUser() {\n // get email and create user ids and such\n var emailAddress = document.getElementById('email-address').value\n var hashedAddress = emailAddress.hashCode()\n var abUser = appboy.getUser().getUserId()\n\n appboy.changeUser(hashedAddress)\n appboy.getUser().setEmail(emailAddress)\n\n // set user attributes in profile\n var firstName = document.getElementById('first-name').value\n var lastName = document.getElementById('last-name').value\n var phoneNumber = document.getElementById('phone-number').value\n\n if (firstName) appboy.getUser().setFirstName(firstName);\n if (lastName) appboy.getUser().setLastName(lastName);\n if (phoneNumber) appboy.getUser().setPhoneNumber(phoneNumber);\n\n // change id button to Identified!\n document.getElementById('login-button').value = \"Identified!\"\n}", "updateMembersUI() {\n let members = document.getElementById(this.params.membersId);\n members.innerHTML = \"\";\n for (let i = 0; i < this.params.members.length; i++) {\n let userLi = document.createElement('li');\n let userP = document.createElement('p');\n let userImg = document.createElement('img');\n let button = document.createElement('button');\n userLi.onclick = function (e) {\n this.changeDialog(arguments[0])\n }.bind(this, this.params.members[i]);\n button.className = \"delete-button\";\n button.setAttribute('data-id', this.params.members[i].id);\n button.onclick = function (e) {\n this.deleteMember(this.params.members[i].id)\n }.bind(this);\n userImg.src = this.params.members[i].avatar;\n userImg.className = \"ava\";\n userImg.width = 22;\n members.appendChild(userLi);\n userLi.appendChild(userP);\n userLi.appendChild(button);\n userP.appendChild(userImg);\n userP.innerHTML += \" @\" + this.params.members[i].name;\n }\n }", "function EditUser(isClosed, idPeople){\n\tvar result = validateUserFields()\n\tif(result){\n\t\tsaveUserData(idPeople,isClosed)\n\t}\n}", "function directUserFromUpdateInfo () {\n if (nextStep == \"The role for an existing employee\") {\n updateEmployeeRole();\n }\n }", "async displayManage(currentPlayer, targetPlayer) {\n const player = targetPlayer || currentPlayer;\n\n const summary = await this.database_.getPlayerSummaryInfo(player.name);\n if (!summary)\n return; // something is fishy\n\n const display = new Menu('Account management for ' + player.name, [\n 'Setting',\n 'Value',\n ]);\n\n // Enables the |player| to change their own level. They will be force disconnected after\n // making changes, to make sure it propagates appropriately.\n display.addItem('Level', summary.level, async () => {\n const updateLevel = async (targetLevel) => {\n if (targetLevel === summary.level) {\n return await alert(currentPlayer, {\n title: 'Account management for ' + player.name,\n message: `${player.name}'s level already is ${targetLevel}.`\n });\n }\n\n await this.database_.setUserLevel(summary.user_id, targetLevel);\n await alert(currentPlayer, {\n title: 'Account management for ' + player.name,\n message: 'The level has been changed. They will now be force disconnected.'\n });\n\n this.announce_().announceToAdministrators(\n Message.ACCOUNT_ADMIN_LEVEL_CHANGED, player.name, player.id, targetLevel);\n\n wait(1000).then(() => player.kick());\n };\n\n const options = new Menu('Account management for ' + player.name);\n\n for (const level of ['Player', 'Administrator', 'Management'])\n options.addItem(level, updateLevel.bind(null, level))\n\n await options.displayForPlayer(currentPlayer);\n });\n\n // Enables the |player| to give themselves VIP rights, or take them away. They will be\n // force disconnected after making changes, to make sure it propagates appropriately.\n display.addItem('VIP', summary.is_vip ? 'Yes' : 'No', async () => {\n const updateVip = async (targetSetting) => {\n if (targetSetting === !!summary.is_vip) {\n return await alert(currentPlayer, {\n title: 'Account management for ' + player.name,\n message: `${player.name}'s VIP status remains unchanged.`\n });\n }\n\n await this.database_.setUserVip(summary.user_id, targetSetting);\n await alert(currentPlayer, {\n title: 'Account management for ' + player.name,\n message: 'The VIP status has been changed. They will now be force disconnected.'\n });\n\n this.announce_().announceToAdministrators(\n Message.ACCOUNT_ADMIN_VIP_CHANGED, player.name, player.id,\n targetSetting ? 'enabled' : 'disabled');\n\n wait(1000).then(() => player.kick());\n };\n\n const options = new Menu('Account management for ' + player.name);\n\n options.addItem('Regular player', updateVip.bind(null, false));\n options.addItem('VIP player', updateVip.bind(null, true));\n\n await options.displayForPlayer(currentPlayer);\n });\n\n await display.displayForPlayer(currentPlayer);\n }", "function selectUser(user) {\n $rootScope.$emit(\"changeUser\", user);\n }", "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "function setUser(u) {\n user = u\n}", "function enterUserID(response) {\n\tvar users = response.payload;\n\tfor (var i = 0; i < users.length; i++) {\n\t\tvar user = users[i];\n\t\tif (user.username == managedUser) {\n\t\t\t// User ID has been found so enter it and lock the edit field, since we're certain that it's correct\n\t\t\tdocument.getElementById(\"user-id\").value = user.user_id;\n\t\t\tdocument.getElementById(\"user-id\").readOnly = true;\n\t\t\tbreak;\n\t\t}\n\t}\n}", "function setUserActions(){\n $jQ(user.actionElements).each(function(){\n $jQ(this).attr(vars.actions, 'true');\n });\n $jQ(user.actionClick).each(function(){\n var e = $jQ(this);\n e.attr(vars.actions, 'user');\n e.attr(vars.userActions, 'click');\n e.off('click.stopnav');\n e.parents().off('click.stopnav');\n e.on('click.user',setUserClickAction);\n });\n $jQ(user.actionPopup).each(function(){\n var e = $jQ(this);\n e.attr(vars.actions, 'user');\n e.attr(vars.userActions, 'popup');\n e.off('click.stopnav');\n e.parents().off('click.stopnav');\n e.on('click.user',setUserClickAction);\n });\n $jQ(user.modalBox).each(function(){\n $jQ(this).find(user.modalClose).each(function(){\n var e = $jQ(this);\n e.attr(vars.userActions, 'popup.close');\n e.off('click.stopnav');\n e.parents().off('click.stopnav');\n });\n $jQ(this).on(user.modalEventShown, function (){\n $jQ(this).find('*').each(function(){\n var e = $jQ(this);\n var tag = e.prop(\"tagName\");\n if(tag!=\"BR\" && tag!=\"SCRIPT\" && tag!=\"IFRAME\"){\n setColorInfo(e,'');\n setFontInfos(e);\n setSizes(e);\n setPositions(e);\n setBorder(e);\n setTextTransform(e);\n setZIndex(e);\n $jQ(this).attr(vars.visible + ':action', $jQ(this).is(':visible'));\n }\n });\n });\n });\n $jQ(user.actionDrag).each(function() {\n $jQ(this).attr(vars.actions, 'user');\n $jQ(this).attr(vars.userActions, 'drag');\n $jQ(this).attr(vars.userActions + ':counter', 0);\n $jQ(this).on('mousemove.user',setUserDragAction);\n });\n}", "function editUsers(){\n\tvar position=JSON.parse(localStorage.getItem('CurrentUser')).Position;\n\tvar users= JSON.parse(localStorage.getItem('Users'));\n\tvar user =users[position];\n\tif(document.getElementById('widget_password').value !== document.getElementById('widget_password_confirmation').value){\n\t\talert(\"The password doesn't match\");\n\t\treturn;\n\t}\n\tuser.FirstName=document.getElementById('widget_first_name').value;\n\tuser.LastName=document.getElementById('widget_last_name').value;\n\tuser.UserName=document.getElementById('widget_userName').value;\n\tuser.Email=document.getElementById('widget_email').value;\n\tuser.Password=document.getElementById('widget_password').value;\n\tuser.Admin=document.getElementById('box').checked;\n\tdocument.getElementById('welcomeUser').innerHTML='Welcome '+ user.FirstName + ' ' + user.LastName;\n\tlocalStorage.setItem('Users',JSON.stringify(users));\n\tlocalStorage.setItem(\"CurrentUser\",JSON.stringify(user));\n\t$('.overlay-bg, .overlay-content').hide();\n\talert(\"The user has been edited successfully\");\n}", "function approve_block_user(approve_disable_user){\n\t\t$(approve_disable_user).click(function(e){\n\t\t\te.preventDefault();\n\t\t\tvar master_user_id \t = $(this).data('id');\n\t\t\tvar master_user_type = $(this).data('type');\n\t\t\t\n\t\t\tif(confirm('Želite li da odobrite pristup korisniku?')){\n\t\t\t\t$.ajax({\n\t\t\t\t\ttype:'POST',\n\t\t\t\t\turl: 'inc/pages/pages_insert_info.php',\n\t\t\t\t\tdata:{ master_user_id:master_user_id, master_user_type:master_user_type },\n\t\t\t\t\tsuccess: function(data){\n\t\t\t\t\t\tif(!data.error){\n\t\t\t\t\t\t\tlocation.reload();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\t\n\t\t\t}\n\t\t});\n\t}", "function updateUser(){\n helpers.rl.question('\\nEnter user name to update: ', dealWithUserUpdate);\n}", "function selectUser(event) {\n var editBtn = $(event.target);\n editIndex = editBtn.attr(\"id\").split('-')[1];\n selectedUserId = users[editIndex]._id;\n try {\n userService.findUserById(selectedUserId)\n .then(function (userInfo) {\n console.log(\"userInfo from findUserById\", userInfo);\n $usernameFld.val(userInfo.username);\n $passwordFld.val(userInfo.password);\n $firstNameFld.val(userInfo.firstName);\n $lastNameFld.val(userInfo.lastName);\n $roleFld.val(userInfo.role);\n selectedUser = userInfo;\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function handleUpdateUser(userInfo) {\n api.setUserInfo(userInfo, token)\n .then(res => { setCurrentUser({ name: res.data.name, about: res.data.about, avatar: res.data.avatar }) })\n .then(() => { closeAllPopups() })\n .catch(err => console.log(err))\n }", "function clickManage() {\n\t$.trigger(\"clickManage\");\n}", "function allowUserToEdit() {\n // console.log('user to edit:', usersShow.user.id);\n // console.log('currentUser:', currentUserId);\n if (usersShow.user.id === currentUserId) {\n usersShow.editable = true;\n }\n }", "updateUser(user) {\n firebaseUser = user\n const div = document.getElementById('createCategory')\n if (div == null) { return }\n\n if (firebaseUser) {\n div.classList.remove('hidden')\n } else {\n div.classList.add('hidden')\n }\n }", "updateProfile(e) {\n this.editForm.get('role').setValue(e, {\n onlySelf: true\n });\n }", "function setButtons() {\n if ($routeParams.username != $rootScope.currentUser.username) {\n if ($rootScope.currentUser.friends.indexOf($routeParams.username) == -1) { // we aren't following them yet, show friend button\n $scope.friendbutton = true;\n $scope.unfriendbutton = false;\n } else {\n $scope.unfriendbutton = true;\n $scope.friendbutton = false;\n }\n }\n }", "async edit_user(_, name) {\r\n const id = localStorage.getItem('id')\r\n const data = { 'user_id': id, 'name': name }\r\n return await axios.post('auth/edit', data)\r\n }", "function displayUser(user){\n userInfo.setAttribute('data-id', `${user.id}`)\n userInfo.innerHTML = `<ul><li>${user.name}</li>\n <li class=\"score\">Total Score: ${user.total_score}</li>\n </ul>\n <button class=\"my-quizzes-button\" type=\"button\">Edit My Quizzes</button>`\n userForm.style.display = 'none'\n}", "function onClickActions(userId) {\n if (userId === activeUserId) {\n return setActiveUserId(null);\n }\n\n const user = users.find(user => user.user_id === userId);\n dispatch(setActiveUser({ user }));\n setActiveUserId(userId);\n }", "function handleAccessViewPlayer() {\n var userId = localStorage.getItem(\"user\");\n if(userId != null) {\n var query = firebase.database().ref('Users/' + userId);\n query.once(\"value\").then(function(snapshot) {\n var coach = snapshot.child(\"coach\").val();\n var manager = snapshot.child(\"manager\").val();\n\n if(coach == true || manager == true){\n var editButton = document.getElementById('edit-player-button');\n editButton.style.display = 'block';\n document.getElementById('view-player-record-id').className = \"nav-item\";\n document.getElementById('nav-edit-player').className = \"desktop-hidden\";\n }\n });\n }\n}", "renderActions() {\n const userID = { usr_id: this.props.employee.ID };\n return (\n <React.Fragment>\n <button\n onClick={() => this.props.removeUser(userID, 3)}\n className=\"ui negative button\"\n >\n Delete\n </button>\n <button onClick={this.hideModal} className=\"ui button\">\n Cancel\n </button>\n </React.Fragment>\n );\n }", "function updateUser(e){\n var user = updateForm.getValueForm();\n user[\"id\"] = userId;\n var val = updateForm.form.find('#myForm').valid();\n if(val){\n e.preventDefault();\n collectionOfUser.update(\n user,\n function(newUser){\n $('tr[data-id='+userId +']').html('').html(logic.template(templates.tColumOfTable, newUser))\n $('tr[data-id='+userId +']').on('click', select);\n updateForm.hide();\n },\n error\n ); \n }\n }", "function addButtonsToUsuarioGrid(){\r\n//\tif($('#grantABMCreate').val()=='Y'){\r\n\t\tvar title = 'Agregar Usuario';\r\n\t\t$('#gridUsuariosId').navButtonAdd('#gridUsuariosPager', {\r\n\t\t\tcaption: 'Agregar',\r\n\t\t\tbuttonicon: 'ui-icon ui-icon-plus',\r\n\t\t\tonClickButton: function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t$('#gridUsuariosId').resetSelection();\r\n\t\t\t\t\tprocessAddUsuario('Editar Usuario');\r\n\t\t\t\t} catch (e) {\r\n\t\t\t\t\tjsError('loadUsuariosGrid(...)', e);\r\n\t\t\t\t}\r\n\t\t\t}, \r\n\t\t\tposition:'last', \r\n\t\t\ttitle:title\r\n\t\t});\r\n//\t}\r\n//\tif($('#grantABMEdit').val()=='Y') {\r\n\t\tvar title = 'Editar Usuario';\r\n\t\t$('#gridUsuariosId').navButtonAdd('#gridUsuariosPager', {\r\n\t\t\tcaption: 'Editar',\r\n\t\t\tbuttonicon: 'ui-icon ui-icon-pencil',\r\n\t\t\tonClickButton: function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar rowid = getSelRowFromUsuarioGrid(); \r\n\t\t\t\t\tif (rowid != null) {\r\n\t\t\t\t\t\tprocessEditUsuario(rowid, false, 'Agregar Usuario');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tseleccioneRegistro();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch(e) {\r\n\t\t\t\t\tjsError('loadUsuariosGrid(...)', e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tposition:'last',\r\n\t\t\ttitle:title\r\n\t\t});\r\n//\t}\r\n//\tif($('#grantABMEdit').val()=='Y') {\r\n\t\tvar title = 'Eliminar Usuario';\r\n\t\t$('#gridUsuariosId').navButtonAdd('#gridUsuariosPager', {\r\n\t\t\tcaption: 'Eliminar',\r\n\t\t\tbuttonicon: 'ui-icon ui-icon-pencil',\r\n\t\t\tonClickButton: function() {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tvar rowid = getSelRowFromUsuarioGrid(); \r\n\t\t\t\t\tif (rowid != null) {\r\n\t\t\t\t\t\tprocessDeleteUsuario(rowid, false, 'Eliminar Usuario');\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tseleccioneRegistro();\r\n\t\t\t\t\t}\r\n\t\t\t\t} catch(e) {\r\n\t\t\t\t\tjsError('loadUsuariosGrid(...)', e);\r\n\t\t\t\t}\r\n\t\t\t},\r\n\t\t\tposition:'last',\r\n\t\t\ttitle:title\r\n\t\t});\r\n//\t}\t\t\r\n}" ]
[ "0.6860396", "0.6796665", "0.67126906", "0.6608286", "0.6574718", "0.6490629", "0.64260656", "0.6401233", "0.6337171", "0.6303121", "0.6264086", "0.62334836", "0.6207008", "0.618509", "0.61143035", "0.60488296", "0.60316664", "0.6026643", "0.60264945", "0.6025551", "0.60136795", "0.6012853", "0.5988671", "0.5970532", "0.5937718", "0.5924293", "0.589193", "0.5891049", "0.5889566", "0.57961303", "0.5780388", "0.577223", "0.5755897", "0.5754352", "0.575147", "0.57510585", "0.57437485", "0.57430226", "0.57247096", "0.57227486", "0.57216656", "0.57166755", "0.5708943", "0.57034826", "0.5698008", "0.5681477", "0.5666746", "0.5663588", "0.5662603", "0.5656515", "0.5646126", "0.56233793", "0.5621314", "0.5617922", "0.56142855", "0.5606859", "0.560571", "0.5603347", "0.5600836", "0.55987227", "0.55958885", "0.5594183", "0.55894303", "0.5584818", "0.5574258", "0.5574147", "0.555384", "0.5545546", "0.5544166", "0.55419904", "0.55417013", "0.55410045", "0.55401444", "0.5531985", "0.5531485", "0.5525149", "0.55191374", "0.55187905", "0.55140656", "0.55097204", "0.5507482", "0.55065095", "0.550386", "0.5502068", "0.5500964", "0.5499966", "0.54931617", "0.5486929", "0.5483557", "0.5480231", "0.54777765", "0.5476179", "0.5462162", "0.54610676", "0.54605883", "0.5458112", "0.5457576", "0.5456022", "0.54555404", "0.54482573" ]
0.73570883
0
Initialize the click function for each manage button and update the button text
function init_manage() { if (!$('.manage-button')) { return; } $(".manage-button").click(manage_click); update_buttons(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update_buttons() {\n $('.manage-button').each( (_, bb) => {\n let user_id = $(bb).data('user-id');\n let manage = $(bb).data('manage');\n if (manage != \"\") {\n $(bb).text(\"Unmanage\");\n }\n else {\n $(bb).text(\"Manage\");\n }\n });\n}", "function clickManage() {\n\t$.trigger(\"clickManage\");\n}", "function manage_click(ev) {\n let btn = $(ev.target);\n let manage_id = btn.data('manage');\n let user_id = btn.data('user-id');\n\n if (manage_id != \"\") {\n unmanage(user_id, manage_id);\n }\n else {\n manage(user_id);\n }\n}", "_updateTextValues() {\n const that = this,\n buttons = ['browse', 'uploadAll', 'cancelAll', 'pauseAll'];\n\n for (let i = 0; i < buttons.length; i++) {\n const localizationString = buttons[i],\n buttonName = localizationString + 'Button';\n\n that.$[buttonName].innerHTML = that.localize(localizationString);\n }\n\n for (let i = 0; i < that._selectedFiles.length; i++) {\n const item = that._items[i];\n\n item.querySelector('.jqx-item-upload-button').title = that.localize('uploadFile');\n item.querySelector('.jqx-item-cancel-button').title = that.localize('cancelFile');\n item.querySelector('.jqx-item-pause-button').title = that.localize('pauseFile');\n }\n }", "_initializeButtons() {\n var self = this;\n\n $(\".menu\").find(\"[data-button='minimize']\").click(function() {\n self.window.minimize();\n });\n\n $(\".menu\").find(\"[data-button='close']\").click(function() {\n self.close();\n });\n\n $(\".menu\").find(\"[data-button='update']\").click(function() {\n app.updateNinja();\n });\n\n $(\".menu\").find(\"[data-button='settings']\").click(function() {\n self.toggleSettingsMenu();\n });\n\n $(\".menu\").find(\"[data-button='lock']\").click(function() {\n self.toggleLock();\n });\n\n $(\".menu\").find(\"[data-button='close-all']\").click(function() {\n self.closeAllEntries();\n });\n }", "function updateButtons() {\n explainButtonElm.css('display', 'none');\n collapseButtonElm.css('display', 'none');\n if(step.containsExplanation() || step.containsSteps()) {\n if (explanationExpanded) {\n collapseButtonElm.css('display', 'block');\n } else explainButtonElm.css('display', 'block');\n }\n }", "init() { // Write the button to the dom\n const spacer = '<li class=\"acl-write separator\"></li>';\n var buttonHTML = '<li class=\"acl-write\" id=\"button1\"><a class=\"grouped-left\" data-l10n-id=\"pad.toolbar.add_buttons.title\" title=\"Task list Checkbox\"><span class=\"buttonicon buttonicon-add_buttons\"></span></a></li>';\n $('.menu_left').append(spacer);\n $('.menu_left').append(buttonHTML);\n\n var buttonHTML = '<li class=\"acl-write\" id=\"button2\"><a class=\"grouped-right\" data-l10n-id=\"pad.toolbar.add_buttons.title\" title=\"Task list Checkbox\"><span class=\"buttonicon buttonicon-add_buttons\"></span></a></li>';\n $('.menu_left').append(buttonHTML);\n\n $('#button1, #button2').click(() => {\n exports.add_buttons.onButton();\n });\n }", "updateButtons(){\n // Checks if the wish list is empty and then hides and shows the appropriate sections.\n // Adds wish list buttons if applicable\n if (Object.keys(this.wish_list).length === 0){\n $('#empty_wish_list').show();\n $('#wish_list').hide();\n } else {\n $(\"#wish_list\").html(\"\"); // clears all of the buttons from before\n for (let key in this.wish_list){\n if (this.wish_list.hasOwnProperty(key)) {\n let color = \"#BBBBBB\";\n let font_color = \"#333333\";\n if (this.scheduler.schedules_info[key][\"color\"]){\n color = this.scheduler.schedules_info[key][\"color\"];\n font_color = \"#ffffff\";\n }\n this.wish_list[key].createButton(color, font_color);\n }\n }\n\n $('#empty_wish_list').hide();\n $('#wish_list').show();\n\n tippy('.wish_list_item', {theme: 'light'}); // adds tooltips to all of the wish list items\n }\n }", "function btnManageClick() {\n if (currPage == \"#page-manage\") {\n return;\n }\n currSelected.removeClass(\"btn-navbar-sel\");\n currSelected = $(\"#btn-manage\");\n currSelected.addClass(\"btn-navbar-sel\");\n switchScreen(currPage, \"#page-manage\");\n currPage = \"#page-manage\";\n}", "initButtons() {\n const self = this;\n const actions = [\n {\n id: 'compile',\n run: () => {\n self.compile();\n },\n },\n {\n id: 'save',\n run: () => {\n self.save();\n },\n },\n ];\n\n for (let action of actions) {\n const a = document.getElementById(action.id);\n a.addEventListener('click', action.run);\n this.views[action.id] = a;\n }\n }", "initButtons() {\n this.setupButton(\"efecBtn\", (e) => {\n\n })\n\n }", "function setClickBehaviour(){\n\t\t\tbutton.on(\"click\", changeButtonLabelAndSendEvent);\n\t\t}", "function updateButtons() {\n $(\"#buttonDisplay\").empty();\n for (var i = 0; i < topics.length; i++) {\n // create new caption\n var newCaption = $(\"<div>\").text(topics[i]).addClass(\"button-caption\");\n // create new black space\n var newBlackSpace = $(\"<div>\").addClass(\"black-space\");\n // create new button\n var newButton = $(\"<button>\").data(\"name\", topics[i]).addClass(\"topic-button\");\n // append caption to button\n newButton.append(newBlackSpace, newCaption);\n // append it to the display\n $(\"#buttonDisplay\").append(newButton);\n };\n }", "function bindButtonActions() {\n // create a new project on click\n createProjectButton.onclick = createProject;\n\n // start the timer on button click\n timerButton.onclick = () => {\n if (timerButton.innerHTML == \"Start Timing\")\n {\n // change button text\n timerButton.innerHTML = \"Stop Timing\";\n\n startTimer();\n }\n else\n {\n // change button text\n timerButton.innerHTML = \"Start Timing\";\n\n stopTimer();\n }\n }\n}", "function topicButtons() {\n $(\"#buttons\").empty();\n $(\"#topicsCard\").hide();\n for (var i = 0; i < topics.length; i++) {\n var b = $(\"<button class='btn'>\");\n b.addClass(\"eightiesButton\");\n b.attr(\"data-name\", topics[i]);\n b.text(topics[i]);\n if (b.attr(\"data-click\"))\n b.attr(\"data-click\")\n $(\"#buttons\").append(b);\n $(\"#topic_input\").val(\"80's\");\n }\n }", "function onManageInstancesBtnClicked(event)\n\t{\n\t\t!this.showingManageView && this.sidebar.breadcrumbsView.add('Collections', this, 'renderManageView');\n\t\tthis.showingManageView = true;\n\t\tthis.renderManageView();\n\t}", "function setButtonText() {\n if (!$rootScope.editMode) {\n $scope.buttonText = \"Add\";\n }\n else {\n $scope.buttonText = \"Save\";\n }\n ;\n\n }", "function set_button(user_id, value) {\n $('.manage-button').each( (_, bb) => {\n if (user_id == $(bb).data('user-id')) {\n $(bb).data('manage', value);\n }\n });\n update_buttons();\n}", "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n $(\"#perc-update-wf-save-cancel-block\").show();\n $(\"#perc-new-wf-save-cancel-block\").show();\n }", "createButtons() {\n this.settingsButton = this._createConnectionButton(TEXTURE_NAME_SETTINGS);\n this.deleteButton = this._createConnectionButton(TEXTURE_NAME_DELETE);\n }", "function setButtonText()\n {\n //if editmode\n debugger;\n\n if (!$rootScope.editMode) {\n $scope.buttonText = \"Add\";\n }\n else {\n $scope.buttonText = \"Save\";\n };\n\n }", "function rebuild_track_btn(){\n $(\".main-grid-container\").prepend('<div class=\"createTrackBtns\">Rebuild Tracking Buttons|v'+window.version+'</div>');\n $(\".createTrackBtns\").click(function(){\n $('.main-grid-cell-content span.main-grid-plus-button').click();\n $('.trackBtn, .actionBtn').remove();\n buildTracker();\n }); \n }", "function setupButtons(){\r\n\t\t\t$('.choice').on('click', function(){\r\n\t\t\t\tpicked = $(this).attr('data-index');\r\n\t\t\t\t$('.choice').removeAttr('style').off('mouseout mouseover');\r\n\t\t\t\t$(this).css({'font-weight':'bold', 'border-color':'#51a351', 'color':'#51a351'});\r\n\t\t\t\tif(submt){\r\n\t\t\t\t\tsubmt=false;\r\n\t\t\t\t\t$('#submitbutton').css({'color':'#fff','cursor':'pointer'}).on('click', function(){\r\n\t\t\t\t\t\t$('.choice').off('click');\r\n\t\t\t\t\t\t$(this).off('click');\r\n\t\t\t\t\t\tprocessQuestion(picked);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t})\r\n\t\t}", "function clickBtn(ev){\r\n\r\n //Brightspace ref: week 6\r\n let clickedButton = ev.target;\r\n\r\n let btnsArray=[\r\n ctrlBtns[0],\r\n ctrlBtns[1],\r\n ctrlBtns[2],\r\n ];\r\n\r\n //https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf\r\n let index = btnsArray.indexOf(clickedButton);\r\n p(index);\r\n\r\n // /MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element\r\n p(clickedButton.id);\r\n //handle moving id-active to the currently clicked button\r\n //remove currently present id 'active'\r\n for(let i=0; i < ctrlBtns.length ; i++){\r\n if(ctrlBtns[i].id){\r\n //MDN ref:https://developer.mozilla.org/en-US/docs/Web/API/Element/removeAttribute\r\n ctrlBtns[i].removeAttribute('id')\r\n }\r\n }\r\n //assign id=\"active\" to currently clicked button\r\n clickedButton.id=\"active\";\r\n //Load corresponding data into the container div\r\n cntnr.innerHTML = `<h2>${pages[index].heading}</h2> \r\n <img src=\"${pages[index].img}\" alt=\"${pages[index].alt}\">\r\n <p>${pages[index].bodyText}</p>\r\n `;\r\n\r\n }", "function displaysButtons() {\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < topics.length; i++) {\n var btn = $(\"<button class='gifBtn'>\");\n btn.attr(\"data-name\", topics[i]);\n btn.text(topics[i]);\n $(\"#buttons-view\").append(btn)\n\n }\n }", "function buttonRendering() {\n\n // Deleting the movies prior to adding new movies\n // (this is necessary otherwise we will have repeat buttons)\n $(\"#buttons-view\").empty();\n\n for (var i = 0; i < animalLists.length; i++) {\n //add a variable with new button\n var animalBtn = $(\"<button>\");\n\n animalBtn.text(animalLists[i]);\n\n animalBtn.addClass(\"animal\").attr(\"data-name\", animalLists[i]);\n\n $(\"#buttons-view\").append(animalBtn);\n\n }\n }", "function buttons() {\n $(\"#display-btns\").empty();\n for (var j = 0; j < initialBtns.length; j++) {\n\n var newBtns = $(\"<button>\")\n newBtns.attr(\"class\", \"btn btn-outline-secondary btn-sm\");\n newBtns.attr(\"id\", \"input\")\n newBtns.attr(\"data-name\", initialBtns[j]);\n newBtns.text(initialBtns[j]);\n\n $(\"#display-btns\").append(newBtns);\n }\n }", "function changeBtn() {\n\t\t\tif($scope.showButton.isShow){\n\t\t\t\twindow.location.hash = '/';\n\t\t\t\t$scope.showButton.btnClass = 'btn-default';\n\t\t\t\t$scope.showButton.text = 'Show Lesson Content';\n\t\t\t\t$scope.showButton.isShow = false;\n\t\t\t\t$scope.lastViewed.person = null;\n\t\t\t} else {\n\t\t\t\twindow.location.hash = '/list';\n\t\t\t\t$scope.showButton.btnClass = 'btn-primary';\n\t\t\t\t$scope.showButton.text = 'Hide Lesson Content';\n\t\t\t\t$scope.showButton.isShow = true;\n\t\t\t}\n\t\t\t$scope.predicate = '';\n\t\t}", "prepare_system_action_buttons() {\n\t\tlet template,\n\t\t\tactions = {\n\t\t\tshutdown: 'power-off',\n\t\t\thibernate: 'asterisk',\n\t\t\tsuspend: 'arrow-down',\n\t\t\trestart: 'refresh'\n\t\t};\n\n\t\tfor ( let action of Object.keys( actions ) ) {\n\t\t\tlet cmd = `can_${action}`;\n\n\t\t\ttemplate = `\n\t\t\t\t<a href=\"#\" id=\"${action}\" class=\"btn btn-default ${action}\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"${action.capitalize()}\" data-container=\"body\">\n\t\t\t\t\t<i class=\"fa fa-${actions[action]}\"></i>\n\t\t\t\t</a>`;\n\n\t\t\tif ( ! lightdm[cmd] ) {\n\t\t\t\t// This action is either not available on this system or we don't have permission to use it.\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$( template )\n\t\t\t\t.appendTo( this.$actions_container )\n\t\t\t\t.on( 'click', event => this.system_action_handler(event) );\n\n\t\t} // END for (let [action, icon] of actions)\n\n\t\t$( '[data-toggle=tooltip]' ).tooltip();\n\t\t$( '.modal' ).modal( { show: false } );\n\t}", "function addButtons() {\n\t$ans.append('<button class=\"toInfo\">' + 'Click here to learn more!' + '</button>');\n\t$ans.append('<button class=\"tryAgain\">' + 'Click here to try again!' + '</button>');\t\n\t}", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function setModifyButtonClickListener() {\n $(\"#btn-modify-menu\").click(function () {\n unhideElement($(\".menu-update-btn-group\"));\n unhideAndEnableElement($(\"#btn-discard-menu\"));\n setEnable($(\"#btn-clear-menu\"));\n\n // Disable and hide modify button\n setDisable($(this));\n hideElement($(this));\n\n // Change delete button style and size\n removeOldClass($(\"#btn-delete-menu\"), \"col-md-6\");\n addNewClass($(\"#btn-delete-menu\"), \"col-md-12\");\n addNewClass($(\"#btn-delete-menu\"), \"left-radius\");\n\n // Enable edit area\n setMenuEditable(true);\n\n // Change label text and color\n $(\".menu-title\").text(\"修改中...请注意保存\");\n $(\".menu-title\").css(\"color\", \"#FFC107\");\n removeOldClass($(\".menu-status-bar\"), \"alert-success\");\n removeOldClass($(\".menu-status-bar\"), \"alert-dnager\");\n addNewClass($(\".menu-status-bar\"), \"alert-warning\");\n unhideElement($(\".menu-modify-icon\"));\n hideElement($(\".menu-exist-icon\"));\n hideElement($(\".no-menu-icon\"));\n });\n }", "function popularButtonClick(btnName){\n setPopularSectionSelected(btnName);\n setPopularSectionContent(btnName);\n}", "handleToggleClick() {\n this.buttonClicked = !this.buttonClicked; //set to true if false, false if true.\n this.cssClass = this.buttonClicked ? 'slds-button slds-button_outline-brand' : 'slds-button slds-button_neutral';\n this.iconName = this.buttonClicked ? 'utility:check' : '';\n }", "initButtons() {\n let buttons = document.querySelectorAll('.btn');\n buttons.forEach(btn => { \n btn.addEventListener('click', e => {\n let btnClick = btn.innerHTML;\n this.actionCalc(btnClick); \n }, false);\n }); \n }", "function setSiteButtonBindings() {\n $('.perc-cookie-button-site').each(function(key, val) {\n $(val).off('click').on('click', function() {\n displaySiteStatistics($(val).text());\n });\n });\n }", "function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.disabled = true;\nevent.target.classList.add (\"chosen\")\n// if (event.target.tagName === \"BUTTON\")\napp.handleInteraction(event.target.innerHTML.toLowerCase());\n}", "function reset_btn(){\n $(\"#access-result #quick_add\").text(\"Quick Add\").show();\n \t $(\"#access-result #quick_edit\").text(\"Quick Edit\").show();\n \t $(\"#access-result #cancel\").hide();\n \t $(\"#access-result #access_table\").removeClass(\"locked\");\n }", "function setBtns () {\n //wipe the div clean\n $(\"#buttonRow\").html(\"\");\n //then repopulate buttons\n for (i=0; i<topicArray.length; i++) {\n //console.log(topicArray[i]);\n var topicBtn = $('<button/>').attr(\"id\", topicArray[i]).attr(\"class\", \"select btnStyle\").text(topicArray[i]);\n $(\"#buttonRow\").append(topicBtn);\n };\n }", "function initViewButtons() {\r\n\t\t$('button.view-button').click( function() {\r\n\t\t\t$button = $(this);\r\n\t\t\t$button\r\n\t\t\t\t.blur()\r\n\t\t\t\t.parent()\r\n\t\t\t\t\t.find('button.submit')\r\n\t\t\t\t\t\t.removeClass('submit')\r\n\t\t\t\t\t.find('div.icon16')\r\n\t\t\t\t\t\t.removeClass('icon16-tick icon16-arrow-circle')\r\n\t\t\t\t\t\t.addClass('hide');\r\n\t\t\t$button\r\n\t\t\t\t.addClass( 'submit' )\r\n\t\t\t\t.find('div.icon16')\r\n\t\t\t\t\t.addClass('icon16-tick')\r\n\t\t\t\t\t.removeClass('hide');\r\n\t\t});\r\n\t}", "__initResetButton(){\n let instance = this;\n $(document).ready(function(){\n $(\"#reset-anotations-mesaurements\").click(\n function resetExercise() {\n\n //Removing Annotations\n var i;\n for (i = instance.annotations.elements.length - 1; i >= 0 ; --i){\n instance.annotations.removeParticle(instance.annotations.elements[i]);\n }\n\n //Removing Measurements\n var j;\n for (j = instance.measurements.elements.length - 1; j >= 0 ; --j){\n instance.measurements.removeParticle(instance.measurements.elements[j]);\n }\n\n //Loading starting points\n $(\"#load-points\").click();\n }\n ).button({\n icon: \"ui-icon-refresh\",\n text: false\n });\n })\n }", "function buttonsFieldAssignSmall() {\n\n $(htmlRemoveBtn).on(\"click\", function() {\n $(htmlSizePlus).click();\n });\n\n $(cssRemoveBtn).on(\"click\", function() {\n $(cssSizePlus).click();\n });\n\n $(jsRemoveBtn).on(\"click\", function() {\n $(jsSizePlus).click();\n });\n\n\n $(htmlSizePlus).on(\"click\", function() {\n $(htmlCMSection).css(\"display\", \"flex\");\n $(cssCMSection).css(\"display\", \"none\");\n $(jsCMSection).css(\"display\", \"none\");\n\n $(htmlSizePlus).addClass(\"active-btn\");\n $(cssSizePlus).removeClass(\"active-btn\");\n $(jsSizePlus).removeClass(\"active-btn\");\n\n $(htmlRemoveBtn).addClass(\"active-btn\");\n $(cssRemoveBtn).removeClass(\"active-btn\");\n $(jsRemoveBtn).removeClass(\"active-btn\");\n\n });\n\n $(cssSizePlus).on(\"click\", function() {\n $(cssCMSection).css(\"display\", \"flex\");\n $(htmlCMSection).css(\"display\", \"none\");\n $(jsCMSection).css(\"display\", \"none\");\n\n $(cssSizePlus).addClass(\"active-btn\");\n $(htmlSizePlus).removeClass(\"active-btn\");\n $(jsSizePlus).removeClass(\"active-btn\");\n\n $(cssRemoveBtn).addClass(\"active-btn\");\n $(htmlRemoveBtn).removeClass(\"active-btn\");\n $(jsRemoveBtn).removeClass(\"active-btn\");\n });\n\n $(jsSizePlus).on(\"click\", function() {\n $(jsCMSection).css(\"display\", \"flex\");\n $(cssCMSection).css(\"display\", \"none\");\n $(htmlCMSection).css(\"display\", \"none\");\n\n\n $(jsSizePlus).addClass(\"active-btn\");\n $(htmlSizePlus).removeClass(\"active-btn\");\n $(cssSizePlus).removeClass(\"active-btn\");\n\n $(jsRemoveBtn).addClass(\"active-btn\");\n $(cssRemoveBtn).removeClass(\"active-btn\");\n $(htmlRemoveBtn).removeClass(\"active-btn\");\n });\n\n}", "handleButton() {}", "function updateCommandButtonsCaption(){\n\t\t\tvar button=document.getElementById(\"bt_quiz\");\n\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_QUIZ\");\n\t\t\t\n\t\t\tbutton=document.getElementById(\"bt_clear\");\n\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_CLEAR\");\n\t\t\t\n\t\t\tbutton=document.getElementById(\"bta_mode\");\n\t\t\tbutton.innerHTML=languageModule.getCaption(\"BUTTON_MODE\");\n\t\t\t\n\t\t\tbutton=document.getElementById(\"bt_data\");\n\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_DATA\");\n\t\t\t\n\t\t\t\n\t\t\tvar scenarioPlay=m_scenarioContext.getCurrentScenarioPlay();\n\t\t\t\n\t\t\tbutton = document.getElementById(\"bt_play\");\n\t\t\t\n\t\t\tvar state=null;\n\t\t\t\n\t\t\t// If there is a valid scenario\n\t\t\tif (scenarioPlay){\n\t\t\t\tstate=scenarioPlay.getState();\n\t\t\t\t\n\t\t\t\t// Change the play button caption regarding the ScenarioPlay state\n\t\t\t switch (state) {\n\t\t\t\tcase scenarioPlay.SCENARIO_STOPPED: // Play\n\t\t\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_START\");\n\t\t\t\t break;\n\t\t\t\tcase scenarioPlay.SCENARIO_PLAYING: // Pause\n\t\t\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_PAUSE\");\n\t\t\t\t break;\n\t\t\t\tcase scenarioPlay.SCENARIO_PAUSED: // Continue\n\t\t\t\t theCommandButton.value=languageModule.getCaption(\"BUTTON_CONTINUE\"); \n\t\t\t\t break;\n\t\t\t\tcase scenarioPlay.SCENARIO_QUIZZING:\n\t\t\t\t theCommandButton.value=languageModule.getCaption(\"BUTTON_CONTINUE\");\n\t\t\t\t break;\n\t\t\t\tcase scenarioPlay.SCENARIO_PATHSELECTING:\n\t\t\t\t theCommandButton.value=languageModule.getCaption(\"BUTTON_CONTINUE\");\n\t\t\t\t \n\t\t\t\t\tbutton=document.getElementById(\"bt_quiz\");\n\t\t\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_CHOOSE\");\t\t\t \n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tif (console){\n\t\t\t\t\t\tconsole.error(\"ScenarioController.playButton known state\");\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t }\t\t\t\t\n\t\t\t}else{\n\t\t\t\tbutton.value=languageModule.getCaption(\"BUTTON_START\");\n\t\t\t}\n\t\t\t\n\t\t\t//Notify Scenario View to update translatable captions\n\t\t\tscenarioView.updateTransletableCaptions();\n\t\t}", "function displayButtons() {\n $(\"#myButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var newButton = $('<button class=\"btn btn-danger\">');\n newButton.attr(\"id\", \"topic\");\n newButton.attr(\"data-search\", topics[i]);\n newButton.text(topics[i]);\n $(\"#myButtons\").append(newButton);\n }\n }", "initButtonsEventClick(){\n let buttons = document.querySelectorAll(\".row > button\");\n buttons.forEach(btn=>{\n btn.addEventListener(\"click\", e=>{\n let txtBtn = btn.innerHTML;\n this.excBtn(txtBtn);\n //console.log(txtBtn+\" \"+e.type);\n //console.log(txtBtn);\n });\n });\n }", "function init() {\n var counter = 0;\n var elBtn = document.querySelector('button');\n elBtn.onclick = add;\n function add() {\n counter += 1;\n console.log(counter);\n elBtn.innerHTML = `CLICK ${counter}`;\n }\n }", "function setUpdateButton(id_updated, new_filling, new_name){\n var id_button = \"#button_\" + id_updated;\n $(id_button).children(\".filling_dispenser\").text(new_filling);\n //$(id_button).children(\".battery_dispenser\").text(new_battery);\n $(id_button).children(\".name_dispenser\").text(new_name);\n parse_button(id_button);\n}", "function Button103(){\n $('li').text('True Fact' );\n}", "function Procedure_button(main, str){\n\n\t//creat button, set class\n\tvar btn = document.createElement(\"button\");\n\tbtn.classList.add(\"ui\", \"circular\",\"icon\",\"button\",\"procedure\",\n\t\t\t\t\t main.stepObject.length.toString());\n\tbtn.setAttribute ('id', \"ui circular icon button procedure \" + \n\t\t\t\t\t main.stepObject.length.toString())\n\t//set button string\n\tvar t = document.createTextNode(str);\n\tbtn.appendChild(t);\n\t\n //add button to Web\n document.getElementById(\"Procedure_List\").appendChild(btn);\n\n //record scene object\n RecordObjects(main);\n main.stepNumber += 1;\n\n //set the click action\n btn.addEventListener(\"click\", function(){\n\n \t//if is the last step, create the step button\n\t if(main.lastStep == true){\n\t \tmain.lastStep = false;\n\t \tProcedure_button(main, main.stepOperationName);\n\t }\n\n\t //console.log(btn.classList[5]);\n\t buttonClicked(main, btn.classList[5]);\n\t main.stepNumber = btn.classList[5];\n\t main.stepOperationName = btn.firstChild.nodeValue;\n\n\t //Initialise the model button\n\t main.processor.executeDesign(\"MODEL_ALIGN\", \"initial\");\n\t main.processor.executeDesign(\"MODEL_PAINTING\", \"initial\");\n main.processor.executeDesign(\"MODEL_WRAP\", \"initial\");\n main.processor.executeDesign(\"MODEL_ROTATION\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADDBETWEEN\", \"initial\");\n main.processor.executeDesign(\"MODEL_CUT\", \"initial\");\n main.processor.executeDesign(\"MODEL_ADD\", \"initial\");\n\t //show the control buttons\n\t if(btn.firstChild.nodeValue != 'Initial')\n\t \t$('#parameter_control_tool_' + btn.firstChild.nodeValue).show();\t \n\n\t});\n\t\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 setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\t\tconsole.log(\"buttonId \"+buttonId);\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function SetTitleHandler()\n{\n var buttons;\n var aList = [\"Latest\", \"Oldest\", \"Ascending\", \"Descending\"];\n var $btns = $(\"#buttons_box .button\");\n \n // Reset old buttons.\n $($btns).text(\"\");\n\n // Show buttons\n buttons = \"\";\n $.each(aList, function(i, value) {\n buttons += '<button type=\\\"button\\\" class=\\\"test\\\">' + value + '</button>';\n });\n $($btns).append(buttons); \n \n ShowPopupBox(\"#buttons_box\", \"Title\");\n SetState(\"page\", \"popup\"); \n}", "function setupButtons() {\n\t\n\td3.select(\"#bubbles-toolbar\")\n\t.selectAll(\"a\")\n\t.on(\"click\", function() {\n\n\t\td3.selectAll(\".dropdown-item\")\n\t\t.classed(\"active\", false);\n\n\t\tvar button = d3.select(this);\n\n\t\tbutton.classed(\"active\", true);\n\n\t\tvar buttonId = button.attr(\"id\");\n\n\t\tmyBubbleChart.toggleDisplay(buttonId);\n\n\t});\n}", "_buttonClickHandler() { }", "function setUp() {\n $('#prod-mgmt').click(toggleParagraph);\n\n console.log('this is working');\n // $('#readmore2').click(toggleParagraph);\n // $('#readless2').click(toggleParagraph);\n // $('.learnmore').click(toggleParagraph);\n}", "function button_click(e) {\n e.preventDefault();\n var $this = e.target,\n name = $this.ancestor('.plugin.well').getAttribute('data-key'), // Get addon name.\n action = $this.getAttribute('data-action');\n if ($this.hasClass('disabled')) {\n return;\n }\n Y.log($this);\n // Get the addon object key to add to action list.\n\n Y.log('Button '+action+' started for '+name);\n // Add addon to actions array.\n if (action in M.local_rlsiteadmin.data_actions) {\n M.local_rlsiteadmin.data_actions[action][name] = name;\n Y.log(M.local_rlsiteadmin.data_actions);\n } else {\n Y.log('Unknown action requested: '+action);\n }\n\n // Disable button for this plugin.\n $this.addClass('disabled');\n M.local_rlsiteadmin.action_dropdown_update();\n }", "clickHandler() {\n // Activate if not active\n if (this.active === false) {\n // Button view press effect\n this.changeToActive();\n // No click 'action' for input - text is removed in visualEffectOnActivation\n }\n }", "addFunctionsToBtns() {\n this.querySelector('#seed-picker-up').addEventListener('click', () => {\n this.changeSeed('up');\n });\n\n this.querySelector('#seed-picker-down').addEventListener('click', () => {\n this.changeSeed('down');\n });\n }", "function setupButtons()\n{\n // Hacky-hacky-hack. Looks like the new toolkit does provide a solution,\n // but we need to support SeaMonkey too. :)\n \n var dialog = document.documentElement;\n dialog.getButton(\"extra1\").label = dialog.getAttribute(\"extra1Label\");\n}", "function renderButtons() {\n $(\"#meme-name-holder\").empty();\n for (var i = 0; i < memes.length; i++) {\n var btn = $(\"<button>\");\n btn.addClass(\"meme btn btn-warning btn-block text-white mb-2\");\n btn.attr(\"data-name\", memes[i]);\n btn.text(memes[i]);\n btn.on(\"click\", handler);\n $(\"#meme-name-holder\").append(btn);\n }\n}", "function init() {\n\tbutton.addEventListener('click', function(event) {\n\t\tbuttonClicked(event.target.innerText);\n\t});\n}", "function setupMortgageBtn() {\n if (current_prop.numHouses > 0 || current_prop.hotel === true) {\n $(\"#mortgagebtn\").addClass(\"unavailable\")\n .unbind();\n $(\"#mortgagebtn .btncaption\").html(\"Mortgage\");\n return;\n }\n if (current_prop.mortgaged === true) {\n $(\"#mortgagebtn .btncaption\").html(\"Unmortgage\");\n } else {\n $(\"#mortgagebtn .btncaption\").html(\"Mortgage\");\n }\n $(\"#mortgagebtn\").click(function() {\n mortgageHandler(current_prop);\n });\n}", "function btnChange_onclick() {\n debugger;\n if (TR_Type == \"2\") {\n TR_Type = \"1\";\n btnChange.innerHTML = '<span class=\"glyphicon\"> <img class=\"img-fluid\" src=\"/img/testimonial/t1.png\" alt=\"\" style=\"border-radius: 4.25rem;box-shadow: 0 5px 15px rgb(255 165 0 / 75%);\" ></span><span > <<< </span>الذهب الي حجز الاطفال';\n }\n else {\n TR_Type = \"2\";\n btnChange.innerHTML = '<span class=\"glyphicon\"> <img class=\"img-fluid\" src=\"/img/testimonial/t2.png\" alt=\"\" style=\"border-radius: 4.25rem;box-shadow: 0 5px 15px rgb(255 165 0 / 75%);\" ></span><span > <<< </span>الذهب الي حجز الرجال';\n }\n Display();\n }", "function btnGenerator(){\n $('#buttonSec').empty();\n \n for (let i=0; i < topics.length; i++){\n var btn = $('<button>').addClass('btn-topic');\n btn.attr('value', topics[i]).text(topics[i]);\n $('#buttonSec').append(btn);\n \n }\n }", "function renderButtons() {\n\n $(\"#buttons-view\").empty();\n\n for (i = 0; i < topics.length; i++) {\n\n var a = $(\"<button>\");\n\n a.addClass(\"topicgif\");\n\n a.attr(\"data-name\", topics[i]);\n\n a.text(topics[i]);\n\n $(\"#buttons-view\").append(a);\n }\n }", "function SetButtonsHandler()\n{ \n var $this = $(this);\n var buttons = \"\";\n var aList;\n var height_box;\n var $btns = $(\"#buttons_box .button\");\n var $scroll = $(\"#buttons_box .slimScrollDiv\");\n var media = GetState(\"media\");\n \n SetState(\"choice\", $this.text());\n\n if ($this.text() == \"Sort\"){ // By title\n aList = [cSORT.NAME, cSORT.YEAR, cSORT.ASC, cSORT.DESC, cSORT.NEW, cSORT.OLD];\n }\n else if ($this.text() == \"Manage\") {\n aList = [\"Information\", \"Hide/Show\", \"Import\", \"Refresh\", \"Remove\"]; \n }\n else\n {\n // Returns gSTATE.LIST\n GetFargoSortList($this.text(), media);\n aList = gSTATE.LIST;\n buttons = '<button type=\\\"button\\\" class=\\\"choice\\\">- Show All -</button>';\n }\n \n // Check if list exits (not empty)\n if (aList) \n { \n // SlimScroll fix.\n if ($scroll.length) \n {\n $scroll.css('height', '');\n $(\".ui-draggable\").css({'width':'0px', 'top':'0px'});\n $btns.css('height', '');\n }\n \n // Reset old buttons.\n $($btns).text(\"\");\n\n // Show buttons\n $.each(aList, function(i, value) \n {\n if (value != \"\") {\n buttons += '<button type=\\\"button\\\" class=\\\"choice\\\">' + value + '</button>';\n } \n });\n $($btns).append(buttons);\n \n height_box = $(\"#buttons_box\").css('height');\n if (parseInt(height_box) >= 500)\n { \n $($btns).slimScroll({\n height:478,\n color:'gray',\n alwaysVisible:true\n });\n \n // SlimScroll height fix.\n $scroll.css('height', '478px');\n $(\".ui-draggable\").css('width','7px');\n $btns.css('height', '478px');\n \n $($btns).children().last().css({\"margin-bottom\":\"20px\"});\n }\n \n // Change button box position.\n //$(\"#buttons_box\").css('top', '15%');\n \n ShowPopupBox(\"#buttons_box\", $this.text());\n SetState(\"page\", \"popup\");\n }\n}", "function initializeControls() {\n const controls = quotes\n .map((el, i) => {\n return `\n <li class=\"site-testimonials__control-item\">\n <button class=\"site-testimonials__control-button\">\n <span class=\"visually-hidden\">Go to Slide ${i + 1}</span>\n </button>\n </li>\n `;\n })\n .join('');\n\n buttonContainer.innerHTML = controls;\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 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}", "_doSomething() {\n this._content.innerText = \"You clicked the button\";\n }", "function createButtons() {\n\n // Load control button template\n Ractive.load('templates/buttons.html').then(function (buttonControl) {\n\n buttonsControl = new buttonControl({\n el: 'buttonControl',\n data: {\n controlButton: updateButtons\n }\n });\n\n // Added listener to update progress bar value\n buttonsControl.on('upadateBar', function (event) {\n var selectedbar = selectControls.find(\"#selectProgress\").value;\n var valueUpdate = parseInt(this.get(event.keypath));\n updateProgressBar(selectedbar, valueUpdate,limit);\n });\n\n });\n}", "addIteme(btn, tk) {\n this.addProductoe();\n }", "refreshButtons() {\n // Q button. Set opacity and append 'ready' text\n if (this.data_prev.donuts[this.playerId].cdQ != 0 && this.localDonutRender.donutData.cdQ == 0) {\n $('#q').html(\"Ready!\");\n $('#q').css('opacity', '1');\n } else if (this.localDonutRender.donutData.cdQ != 0) {\n $('#q').html((this.localDonutRender.donutData.cdQ / 100).toFixed(1) + \"s\");\n $('#q').css('opacity', '0.3');\n }\n\n // W button. Set opacity and append 'ready' text\n if (this.data_prev.donuts[this.playerId].cdW != 0 && this.localDonutRender.donutData.cdW == 0) {\n $('#w').html(\"Ready!\");\n $('#w').css('opacity', '1');\n } else if (this.localDonutRender.donutData.cdW != 0) {\n $('#w').html((this.localDonutRender.donutData.cdW / 100).toFixed(1) + \"s\");\n $('#w').css('opacity', '0.3');\n }\n }", "function manage(user_id) {\n let text = JSON.stringify({\n manage: {\n manager_id: current_user_id,\n underling_id: user_id\n },\n });\n\n $.ajax(manage_path, {\n method: \"post\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { set_button(user_id, resp.data.id); },\n error: (resp) => { console.log(resp); }\n });\n}", "function displayButtons() {\n $(\"#myButtons\").empty();\n for (var i = 0; i < topics.length; i++) {\n var a = $('<button class=\"btn btn-primary\">');\n a.attr(\"id\", \"icon\");\n a.attr(\"data-search\", topics[i]);\n a.text(topics[i]);\n $(\"#myButtons\").append(a);\n\n }\n }", "function bindUIactions() {\n $('body').on('click', '.project-overview__settings-button', showSettings);\n $('body').on('click', '.project-overview__settings-close', hideSettings);\n }", "function initButtons() {\n $('#wizard-next-button').click(nextPhase);\n $('#wizard-previous-button').click(previousPhase);\n $('.wizard-phase').hide();\n $('.wizard-phase-button').click(function () {\n setPhase($(this).attr('data-phase'));\n });\n $('#wizard-done-button').click(function () {\n doneCallbacks.every(function (callback) {\n return callback() !== false;\n });\n });\n }", "function buttons(click) {\r\n\r\n if (click == 'save') {\r\n\r\n //not added for while\r\n alert('Function not added')\r\n\r\n } else {\r\n\r\n //clear all\r\n document.getElementById('editor').textContent = ''\r\n\r\n } \r\n}", "function initUI() { \n var lesson = g_lessons[0];\n var lesson_code = lesson.lesson_code;\n $('#lesson_title').html(lesson.title);\n $('#lesson_code').html(lesson_code);\n $('#task_chooser').selectbox();\n updateTaskDescription(0); \n \n var utc_offset_minutes = (new Date()).getTimezoneOffset();\n\tvar html = '';\n html += '<button class=\"cssbtn\" id=\"edit_lesson_btn_'+lesson_code+'\" onclick=\"goToLessonForm(\\''+lesson_code+'\\');\">Edit activity<span class=\"edit\"></span></button><br/>';\n\thtml += '<button class=\"cssbtn\" id=\"stop_lesson_btn_'+lesson_code+'\" style=\"display:none\" onclick=\"stopLesson(\\''+lesson_code+'\\')\">Stop activity<span class=\"stop\"></span></button>';\n\thtml += '<button class=\"cssbtn\" id=\"start_lesson_btn_'+lesson_code+'\" style=\"display:none\" onclick=\"startLesson(\\''+lesson_code+'\\')\">Start activity<span class=\"start\"></span></button>';\n\thtml += '<br/>';\n\thtml += '<button class=\"cssbtn\" id=\"clone_lesson_btn_'+lesson_code+'\" onclick=\"cloneLesson(\\''+lesson_code+'\\', false)\">Clone activity</button><br/>';\n html += '<button class=\"cssbtn\" id=\"download_data_btn_'+lesson_code+'\" onclick=\"window.location=\\'/data_dump?lesson_code='+lesson_code+'&utc_offset_minutes=' + utc_offset_minutes + '\\'; return false;\">Download data<span class=\"dl\"></span></button><br/>' \n html += '<button class=\"cssbtn\" id=\"clear_lesson_btn_'+lesson_code+'\" onclick=\"clearLesson(\\''+lesson_code+'\\', false)\">Clear data<span class=\"clr\"></span></button><br/>';\n html += '<button class=\"cssbtn\" id=\"delete_lesson_btn_'+lesson_code+'\" onclick=\"deleteLesson(\\''+lesson_code+'\\')\">Delete activity<span class=\"del\"></span></button>';\n $('#side_button_bar2').html(html);\n}", "function addButtonEvent() {\n\t\t\tbtnList.begin.click(API.begin);\n\t\t\tbtnList.fastBackward.click(function () {API.backward(FAST_STEP_NUM); });\n\t\t\tbtnList.backward.click(function () {API.backward(1); });\n\t\t\tbtnList.forward.click(function () {API.forward(1); });\n\t\t\tbtnList.fastForward.click(function () {API.forward(FAST_STEP_NUM); });\n\t\t\tbtnList.end.click(API.end);\n\t\t\tbtnList.flag.click(API.flag);\n\t\t\tbtnList.auto.click(API.setAuto);\n\t\t}", "function bindUIactions() {\n $('body').on('click', '.task-overview__settings-button', showSettings);\n $('body').on('click', '.task-overview__settings-close', hideSettings);\n $('body').on('click', '.members__settings-button', showMembersSettings);\n $('body').on('click', '.members__settings-close', hideMembersSettings);\n }", "function selectButtonHandler() {\n var self = this;\n\n makeButtonActive(self); //highlights this button\n\n thingView.clearStatus(); //clears whatever's in the status window \n\n //if this is the makeNewThing button, show the makeThing form\n if ($(this).hasClass(\"makeNewThing\")) { //generates a new form\n thingForm = new ThingForm();\n thingForm.newForm($('div#status'));\n\n } else //get object current li relates to, print status of that object\n {\n thingView.printThing(thingModel.allThings[$(this).attr(\"data\")]);\n }\n\n}", "function buttons(){\n $('#ingredients').click(event => {\n $('#welcome').addClass('hidden')\n $('#recipe-search').removeClass('hidden')\n $('#recipe-search').prepend(`<p>What ingredients would you like to use? (i.e. 'gochujang, rice')</p>`)\n })\n $('#dishes').click(event => {\n $('#welcome').addClass('hidden')\n $('#recipe-search').removeClass('hidden')\n $('#recipe-search').prepend(`<p>What are we cooking? (i.e. 'carbonara')</p>`)\n })\n}", "function initDeleteNoticeButton() {\n\t\t\tvar $button, toolbar, $mytoolsLI, $customizeLI;\n\t\t\t\n\t\t\t// don't create duplicate buttons\n\t\t\tif (document.getElementById(\"mark-for-deletion-link\") !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// create button\n\t\t\t$button = $('&nbsp;<a id=\"descr-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Beschreibung</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = \"Hier die Beschreibung\";\n\t\t\t\tif (typeof window.MarkForDeletion === \"object\" && window.MarkForDeletion !== null && typeof window.MarkForDeletion.promptedDeleteReason === \"string\") {\n\t\t\t\t\tpromptedDeleteReason = window.MarkForDeletion.promptedDeleteReason;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar deleteReason = window.prompt(\"Beschreibung angeben\", promptedDeleteReason);\n\t\t\t\t\n\t\t\t\tif (typeof deleteReason === \"string\" && deleteReason.length > 0) {\n\t\t\t\t\tsetDeleteNotice(deleteReason);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t// add button to toolbar\n$($button).appendTo('#organisationsbox');\n\t\t}", "click(){\n createAddItemWindow();\n }", "function watchButton() {\n //check for shannon button \n $('#js-section-one-button').on('click', event => {\n //prevent default form behavior\n event.preventDefault();\n //console.log($('#js-section-one-button').text());\n switchHTML('shannon', $('#js-section-one-button').text(), 'one');\n });\n \n //check for chris button\n $('#js-section-two-button').on('click', event => {\n //prevent default form behavior\n event.preventDefault();\n //console.log($('#js-section-one-button').text());\n switchHTML('chris', $('#js-section-two-button').text(), 'two');\n });\n\n //check for lindy button\n $('#js-section-three-button').on('click', event => {\n //prevent default form behavior\n event.preventDefault();\n //console.log($('#js-section-one-button').text());\n switchHTML('lindy', $('#js-section-three-button').text(), 'three');\n });\n\n //check for jennifer button\n $('#js-section-four-button').on('click', event => {\n //prevent default form behavior\n event.preventDefault();\n //console.log($('#js-section-one-button').text());\n switchHTML('jennifer', $('#js-section-four-button').text(), 'four');\n });\n}", "function initDeleteNoticeButton() {\n\t\t\tvar $button, toolbar, $mytoolsLI, $customizeLI;\n\t\t\t\n\t\t\t// don't create duplicate buttons\n\t\t\tif (document.getElementById(\"mark-for-deletion-link\") !== null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t// create button\n\t\t\t$button = $('<a id=\"status-aendern-link\" class=\"mum-organizational\" style=\"cursor: pointer;\">Status</a>');\n\t\t\t$button.click(function deleteNoticeButtonClickHandler() {\n\t\t\t\tvar promptedDeleteReason = 'aktiv';\n\t\t\t\tif (typeof window.MarkForDeletion === \"object\" && window.MarkForDeletion !== null && typeof window.MarkForDeletion.promptedDeleteReason === \"string\") {\n\t\t\t\t\tpromptedDeleteReason = window.MarkForDeletion.promptedDeleteReason;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tvar deleteReason = window.prompt(\"Status der Geschichte angeben; Möglichkeiten:\\naktiv, inaktiv, abgeschlossen, pause, neu\", promptedDeleteReason);\n\t\t\t\t\n\t\t\t\tif (typeof deleteReason === \"string\" && deleteReason.length > 0) {\n\t\t\t\t\tsetDeleteNotice(deleteReason);\n\t\t\t\t}\n\t\t\t});\n\t\t\t\n\t\t\t// add button to toolbar\n$($button).appendTo('#organisationsbox');\n\t\t}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function() {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function finaliseButtonDisplay(specificWidgetArray) {\r\n// Old \r\n//function finaliseButtonDisplay() {\r\n// END CHANGE BY Marc TABARY - 2017-03-06 - ALLOW DISABLED SPECIFIC WIDGET\r\n\r\n// ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n if (specificWidgetArray!==undefined) {\r\n // This parameter must be an array\r\n if (specificWidgetArray instanceof Array) {\r\n for (i = 0; i < specificWidgetArray.length; i++) {\r\n enableWidget(specificWidgetArray[i]);\r\n }\r\n }\r\n }\r\n// END ADD BY Marc TABARY - 2017-03-06 - - ALLOW DISABLED SPECIFIC WIDGET\r\n\r\n id = dojo.byId(\"id\");\r\n if (id) {\r\n if (id.value == \"\") {\r\n // id exists but is not set => new item, all buttons locked until first\r\n // change\r\n formLock();\r\n enableWidget('newButton');\r\n enableWidget('newButtonList');\r\n enableWidget('saveButton');\r\n disableWidget('undoButton');\r\n disableWidget('mailButton');\r\n disableWidget('changeStatusButton');\r\n disableWidget('subscribeButton');\r\n if (dijit.byId(\"objectGrid\")) {\r\n enableWidget('multiUpdateButton');\r\n } else {\r\n disableWidget('multiUpdateButton');\r\n disableWidget('indentDecreaseButton');\r\n disableWidget('indentIncreaseButton');\r\n }\r\n }\r\n } else {\r\n // id does not exist => not selected, only new button possible\r\n formLock();\r\n enableWidget('newButton');\r\n enableWidget('newButtonList');\r\n disableWidget('changeStatusButton');\r\n disableWidget('subscribeButton');\r\n if (dijit.byId(\"objectGrid\")) {\r\n enableWidget('multiUpdateButton');\r\n } else {\r\n disableWidget('multiUpdateButton');\r\n }\r\n // but show print buttons if not in objectDetail (buttonDiv exists)\r\n if (!dojo.byId(\"buttonDiv\")) {\r\n enableWidget('printButton');\r\n enableWidget('printButtonPdf');\r\n }\r\n }\r\n buttonRightLock();\r\n}", "function _setupGoLiveButton() {\n _$btnGoLive = $(\"#toolbar-go-live\");\n _$btnGoLive.click(function onGoLive() {\n _handleGoLiveCommand();\n });\n $(LiveDevelopment).on(\"statusChange\", function statusChange(event, status) {\n // status starts at -1 (error), so add one when looking up name and style\n // See the comments at the top of LiveDevelopment.js for details on the \n // various status codes.\n _setLabel(_$btnGoLive, null, _statusStyle[status + 1], _statusTooltip[status + 1]);\n });\n \n // Initialize tooltip for 'not connected' state\n _setLabel(_$btnGoLive, null, _statusStyle[1], _statusTooltip[1]);\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n // Find the button just clicked\n var button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n var buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n //myBubbleChart.toggleDisplay(buttonId);\n });\n}", "function setupButtons() {\n\t$('#btnLogin').click(login);\n\t$('#btnLogout').click(logout);\n}", "function upButtons(text){\n for (i = 0; i < 3; i++){\n document.getElementById(\"sel_\"+i).textContent = text;\n }\n }", "function setupButtons() {\n d3.select('#toolbar')\n .selectAll('.button')\n .on('click', function () {\n // Remove active class from all buttons\n d3.selectAll('.button').classed('active', false);\n\n // Find the button just clicked\n let button = d3.select(this);\n\n // Set it as the active button\n button.classed('active', true);\n\n // Get the id of the button\n let buttonId = button.attr('id');\n\n // Toggle the bubble chart based on\n // the currently clicked button.\n _bubbleChart.toggleDisplay(buttonId);\n });\n}", "activateButton(){\n //If the button already exists, we want to remove and rebuilt it\n if(this.button)\n this.button.dispose();\n\n //Create button called but with Activate SpeedBoost as its text\n this.button = Button.CreateSimpleButton(\"but\", \"Activate\\nSpeedBoost\");\n this.button.width = 0.8;\n this.button.height = 0.8;\n this.button.color = \"white\";\n this.button.background = \"red\";\n this.button.alpha = 0.8;\n this.stackPanel.addControl(this.button);\n //Scope these attributes so they can be used below\n var button = this.button;\n var app = this.app;\n\n //Function for if they click it\n //Function is a member of the button object, not of this class\n this.button.onPointerDownObservable.add(function() {\n if(button.textBlock.text != \"Activate\\nSpeedBoost\")\n return;\n app.buttonPressed(\"speedBoost\");\n button.textBlock.text = \"SpeedBoost\\nActivated\";\n }); \n }", "function onBtn (nameBtn) {\n\t\t\t$('#' + nameBtn).css('display','block');\n\t\t}" ]
[ "0.7035822", "0.66758835", "0.64078724", "0.6397366", "0.63584006", "0.63528085", "0.62530726", "0.6239302", "0.6207319", "0.6185898", "0.6181031", "0.6173993", "0.61525655", "0.6131418", "0.6096139", "0.60945183", "0.60889703", "0.60612595", "0.6057443", "0.6047189", "0.6040105", "0.60386145", "0.60268134", "0.60187143", "0.6004896", "0.5984022", "0.5964237", "0.59602594", "0.5958087", "0.5954732", "0.5950424", "0.59411377", "0.5937107", "0.59286916", "0.59267825", "0.5921039", "0.59166896", "0.59119904", "0.5898936", "0.58977073", "0.58856505", "0.58778125", "0.5875971", "0.58734477", "0.5863085", "0.5857627", "0.5854235", "0.5852862", "0.5849619", "0.5849219", "0.58454347", "0.58403444", "0.58400947", "0.5830845", "0.5829135", "0.5823703", "0.5823142", "0.5803208", "0.5798865", "0.579628", "0.57915795", "0.57855356", "0.57832336", "0.57826173", "0.5768977", "0.576692", "0.5763806", "0.5762935", "0.5758639", "0.5755265", "0.5755188", "0.57515144", "0.5748154", "0.57428306", "0.57426965", "0.5742039", "0.574025", "0.5734169", "0.5732409", "0.5729821", "0.57275856", "0.5714838", "0.571196", "0.5711599", "0.5705883", "0.56987756", "0.5697319", "0.56942415", "0.56921583", "0.5688663", "0.5688663", "0.5688663", "0.56871676", "0.56796736", "0.5677411", "0.5674796", "0.5673031", "0.56682706", "0.5665949", "0.5658637" ]
0.7350768
0
Toggle the link text
function end_links() { $('.time-button').each( (_, bb) => { let task_id = $(bb).data('task-id'); let type = $(bb).data('type'); let clicked = $(bb).data('clicked'); // Change the 'Start' link to a text-like 'In Progress' if (type === "Start" && clicked === "Yes") { $(bb).text('In Progress'); $(bb).click(function() { return false; }); $(bb).css('color', '#7c91af'); $(bb).css('cursor', 'default'); } // Change the 'In Progress' message back to a 'Start' link else if (type === "Start" && clicked === "No") { $(bb).text('Start'); $(bb).css('color', '#007bff'); $(bb).css('cursor', 'pointer'); } else if (type === "End") { $(bb).text('End'); } else if (type === "Edit") { // Submit button for the edit form $(bb).text('Submit'); } else { $(bb).text('Delete'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changelinkLabel(text) {\n link.textContent = text;\n }", "function toggleText() {\r\n var text = document.getElementById(\"instructions\");\r\n if (text.style.display === \"none\") {\r\n text.style.display = \"block\";\r\n } else {\r\n text.style.display = \"none\";\r\n }\r\n }", "function toggleText (selector, a, b) {\n return $(selector).text($(selector).text() == b ? a : b);\n}", "function toggleLink(link) { // toggle a link active/inactive\n var \n linkId = getLinkUnique(link),\n linkAnimations = animations[linkId];\n snapLinkAlter(link,!linkStatus[linkId],linkAnimations.attrsStart,linkAnimations.attrsEnd,linkAnimations.duration);\n\n return linkStatus[linkId];\n }", "function toggleAbstract(elementId) {\n var a = document.getElementById(elementId);\n var aLink = document.getElementById(elementId + \"-link\");\n if (a.style.display == \"none\") {\n a.style.display = \"block\";\n aLink.text = \"Hide Abstract\";\n } else {\n a.style.display = \"none\";\n aLink.text = \"Show Abstract\";\n }\n}", "function toggleText(content) {\n if (content.classList.contains('hide')) {\n content.classList.remove('hide');\n content.classList.add('show');\n } else if (content.classList.contains('show')) {\n content.classList.remove('show');\n content.classList.add('hide');\n }\n}", "function setState(text, url, dispFun) {\n var button;\n\n button = E.elements.content.menu.route.result.toggleAdvanced;\n\n button.text(text);\n button.attr('href', url);\n\n dispFun();\n }", "function _toggleState( e ) {\n\t\t\te.stopPropagation();\n\t\t\te.cancelBubble = true;\n\n\t\t\t_setTriggerState( this, !_getTriggerState( this ) );\n\n\t\t\tif ( settings.hasControlLink && (_countTargets( true ) === _countTargets() || _countTargets( false ) === _countTargets()) ) {\n\t\t\t\t_updateControlLinkText();\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}", "function togglePostURL() {\n $(\".cmb2-id--w-link-info, .cmb2-id--w-post-link\").toggle($(\"#post-format-link\").is(\":checked\"));\n tabsChanged();\n }", "function ToggleWidget(ontxt,offtxt) {\n\tWidget.apply(this);\n\tvar onlink = A({href:'javascript:undefined'},ontxt);\n\tvar offlink = A({href:'javascript:undefined'},offtxt);\n\tthis.events.toggleOn = extractEvent_e(onlink,'click').constant_e(true);\n\tthis.events.toggleOff = extractEvent_e(offlink,'click').constant_e(false);\n\tthis.events.toggle = merge_e(this.events.toggleOn,this.events.toggleOff);\n\tthis.behaviors.toggled = this.events.toggle.startsWith(false);\n\tthis.dom = this.behaviors.toggled.transform_b(function(t) {return t ? offlink : onlink;});\n}", "function toggleBootstrap(){\n if (targetLink.disabled === true){\n targetLink.disabled = false;\n } else {\n targetLink.disabled = true;\n }\n}", "function toggleIntroText(){\n introText.style.display = 'none'\n}", "toggleTitleUnderline() {\n\t\tthis.setState({\n\t\t\ttitleUnderlined: !this.state.titleUnderlined\n\t\t});\n\t}", "function toggleRels() {\n\tif($('#cont_rels').css('display') == 'none') {\n\t\t$('#cont_rels').css('display', 'block');\n\t\t$('#cont_rels_link').html('- Similar movies');\n\t} else {\n\t\t$('#cont_rels').css('display', 'none');\n\t\t$('#cont_rels_link').html('+ Similar movies');\n\t}\n}", "function showLinkLabel(e) {\n var label = e.subject.findObject('LABEL');\n if (label !== null) {\n label.visible = (e.subject.fromNode.data.category === 'Conditional');\n }\n }", "function toggleCollapse(objToToggle, collapseText, expandText) {\n\n \tvar linkText = \"\";\n \tvar targetObject = returnObjById(objToToggle);\n\n \tif ( targetObject ) {\n\n \t\tif ( targetObject.style.display == \"none\" ) {\n\n \t\t\ttargetObject.style.display = \"block\";\n \t\t\tlinkText = collapseText;\n \t\t}\n\n \t\telse {\n\n \t\t\ttargetObject.style.display = \"none\";\n \t\t\tlinkText = expandText;\n \t\t}\n\n \t\tvar toggleLink = document.createElement(\"a\");\n \t\ttoggleLink.appendChild(document.createTextNode(linkText));\n \t\ttoggleLink.setAttribute(\"href\", \"javascript:toggleCollapse('\" + objToToggle + \"','\" + collapseText + \"','\" + expandText + \"')\");\n\n \t\treturnObjById(objToToggle + \"Link\").innerHTML = \"\";\n \t\treturnObjById(objToToggle + \"Link\").appendChild(toggleLink);\n \t}\n }", "function changeToggleText() {\n\n\t// change to default button\n\tif (!$(\"#search-button\").is(\":visible\")) $(\".main-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n\tif (!$(\"#deselect-all\").is(\":visible\")) $(\".selection-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n} // changeToggleText", "function updateLink(input, link) {\r\n link.hidden = !input.value;\r\n //if($('#enc_to [id=\"to_text\"]').hasClass('active')){\t//хочу что сохранялись байты а не утф.\r\n \r\n link.href = \"data:text/plain;charset=UTF-8,\" + encodeURI(input.value); //<-- data in href, as UTF-8 text.\r\n link.onclick = '';\r\n link.style.display = (input.value==='') ? 'none' : 'block';\r\n}", "function changeTweetLink(quote, title) {\n $('#tweet-container').html(\"\");\n twttr.widgets.createShareButton(\n '/',\n document.getElementById(\"tweet-container\"),\n {\n text: shortenTweet(quote, title),\n }\n );\n}", "function toggle() {\n var ele = document.getElementById(\"toggleText\");\n var text = document.getElementById(\"displayText\");\n if(ele.style.display == \"block\") {\n ele.style.display = \"none\";\n text.innerHTML = \"+\";\n }\n else {\n ele.style.display = \"block\";\n text.innerHTML = \"&#8211;\";\n }\n}", "function accordionDeepLinking() {\r\n\t\t\t\r\n\t\t\tif (typeof nectarGetQueryParam['toggle'] != 'undefined') {\r\n\t\t\t\t$('.toggles').each(function () {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$(this).find('.toggle').each(function () {\r\n\t\t\t\t\t\tvar $currentText = $(this).find('h3 a').clone();\r\n\t\t\t\t\t\tvar $getText = nectarGetQueryParam['toggle'];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$($currentText).find('i').remove();\r\n\t\t\t\t\t\t$currentText = $currentText.text();\r\n\t\t\t\t\t\t$currentText = $currentText.replace(/\\s+/g, '-').toLowerCase();\r\n\t\t\t\t\t\t$getText = $getText.replace(/\\s+/g, '-').replace(/</g, '&lt;').replace(/\"/g, '&quot;').toLowerCase();\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($currentText == $getText) {\r\n\t\t\t\t\t\t\t$(this).find('h3 a').trigger('click');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}", "function switchtext(){\n\t\t$(\"ol\").html(\"falseFact\");\n\t\t$(\"ol\").html(\"TrueFact\");\n\t\n\t}", "function toggleButton(b){\n let text = b ? \"Stop sharing\" : \"Split a table\";\n return text;\n}", "function toggleDescription() {\r\n\tlet title = $(this); \r\n\r\n\t$(\"#desc_\" + title.attr(\"id\")).toggle(0, function() {\r\n\t\tif(title.text() == \"Learn more\") {\r\n\t\t\ttitle.text(\"Show less\");\r\n\t\t} else {\r\n\t\t\ttitle.text(\"Learn more\");\r\n\t\t}\r\n\t});\r\n}", "function showLinkLabel(e) {\n var label = e.subject.findObject(\"LABEL\");\n if (label !== null) label.visible = (e.subject.fromNode.data.figure === \"Diamond\");\n }", "function toggleDescription() {\n self.showingDescription = !self.showingDescription;\n }", "function handleLinkClick (e) {\n if (oToggle.isOpen && e.target.classList.contains(config.linkClass)) {\n handleToggle();\n }\n }", "function switchtext(){\n\t\t$(\"h2\").html(\"Christina\");\n\t}", "function toggle() {\n // const offset = elementRef.current.offsetTop;\n elementRef.current.scrollTop = 0;\n window.scrollTo(0, 550);\n if (textShow === 'Show More') {\n setText('Show Less');\n } else {\n setText('Show More');\n }\n }", "onToggle() {}", "function changeText() {\n \n }", "function toggleSearchOptionsTitle()\n{\n\tif ($(searchForm).css(\"display\") === \"none\") {\n\t\t$(searchOptionsBtn).text('Hide Search Options');\n } \n\telse {\n \t$(searchOptionsBtn).text('Show Search Options');\n }\n}", "function swapText(target, elem) {\n elem.setAttribute(\"data-active\", target);\n }", "function onLinkClick( event ){\n event.preventDefault();\n var link = event.target,\n html = link.innerHTML;\n link.innerHTML = 'Click';\n link.className = 'item clicked';\n setTimeout( function(){\n link.innerHTML = link.getAttribute('data-num');\n link.className = 'item';\n }, 500 );\n return false;\n }", "function _getLink(text, enabled, urlFormat, index) {\n if (enabled == false)\n return J.FormatString(' <a class=\"button-white\" style=\"filter:Alpha(Opacity=60);opacity:0.6;\" href=\"javascript:void(0);\"><span>{0}</span></a>',\n text);\n else\n return J.FormatString(' <a class=\"button-white\" href=\"javascript:window.location.href=\\'' + urlFormat + '\\';\"><span>{1}</span></a>', index, text);\n }", "function toggleHighlight (linkObj) {\n hideAll();\n linkObj.className += \" activeSubNav\";\n}", "function updateMoreSearchText() {\n if ($('ms-srch-group-link a') !== null) {\n $('.ms-srch-group-link a').text('Show All People Results');\n $('.ms-srch-group-link a').attr('title', 'Show All People Results...');\n }\n }", "function toggle() { // @return Boolean: true is play\r\n // false is pause\r\n switch (this.state().text) {\r\n case \"ended\": this.backend.currentTime(0);\r\n case \"pause\": this.play();\r\n return true;\r\n case \"playing\": this.pause();\r\n }\r\n return false;\r\n}", "function toggleText() {\n $('#sunny-city-list').addClass('hide-text');\n setTimeout(() => {\n $('#sunny-city-list').removeClass('hide-text')\n }, 250)\n}", "function openlink(upperCase){\n clickAnchor(upperCase,getItem(\"link\"));\n}", "toggleTranscript(){\n this.showTranscript = !this.showTranscript;\n this.generateToc();\n this.displayTranscript();\n }", "function linkAreaSwitch(status) {\n // remove all pre-link attribute (mark as \"link will be added\")\n clearSetElement(\"[\" + setdatalink + \"]:not([href])\");\n jQTE.find(\"[\" + setdatalink + \"][href]\").removeAttr(setdatalink);\n\n if (status) {\n toolbar.data(\"linkOpened\", true);\n linkform.show();\n }\n else {\n toolbar.data(\"linkOpened\", false);\n linkform.hide();\n }\n\n linktypeSwitch();\n }", "function callText(){\n $(\".ShowText\").click(function(){\n $(\".box-option-click\").show();\n });\n $(\".box-option-click .third-list li a\").click(function(){\n $(\".ShowText\").text(\"\");\n var text = $(this).text();\n $(\".ShowText\").text(text);\n $(\".box-option-click\").hide();\n });\n }", "function transcriptToggle() {\n target = this.classList[1] - 1;\n\n if(transcript[target].classList.contains('hidden')){\n transcript[target].classList.remove('hidden');\n transcriptBtnText[target].textContent = 'Hide';\n } else {\n transcript[target].classList.add('hidden');\n transcriptBtnText[target].textContent = 'Show';\n }\n \n }", "function toggleAnnotation() {\n\t\tif (Aloha.activeEditable) {\n\t\t\tvar range = Selection.getRangeObject();\n\t\t\tif (findWaiLangMarkup(range)) {\n\t\t\t\tremoveMarkup(range);\n\t\t\t} else {\n\t\t\t\taddMarkup(range);\n\t\t\t\tfocusOn(FIELD);\n\t\t\t}\n\t\t}\n\t}", "function expand() {\n const showContent = document.getElementById(this.dataset.target)\n //Er wordt in de HTML gekeken voor een id dataset.target\n\n if (showContent.classList.contains('expand-active')) {\n this.innerHTML=this.dataset.showtext\n } \n //Als de class van de showcontent element 'expand-active' bevat verandert deze naar showtext.\n \n else {\n this.innerHTML=this.dataset.hidetext\n }\n //Als dit niet waar is en de class expand active niet bevat wordt de text gehide.\n\n showContent.classList.toggle('expand-active')\n //Toggle de expand-active class\n }", "function linkClick(link) {\n\t\tsubjectRead(subjects);\n\t\t$(links[link]).css(\"z-index\",\"1\");\n\t\t$(links[link]).css(\"opacity\",\"1\");\n\t\t$(link).css(\"background-color\",\"#8C6954\");\n\t\t$(link).css(\"color\",\"white\");\n\t\t$.each(links, function (key,value)\n\t\t{\n\t\t\tif (key!=link)\n\t\t\t{\n\t\t\t\t$(links[key]).css(\"z-index\",\"0\");\n\t\t\t\t$(links[key]).css(\"opacity\",\"0\");\n\t\t\t\t$(key).css('background-color','#59323C');\n\t\t\t\t$(key).css(\"color\",\"#F2EEB3\");\n\t\t\t}\n\t\t});\n\t}", "function toggleElement() {\n\tvar toggleTargets = $(this).attr('target');\n\t$.each(toggleTargets.split(' '), function( index, value ) {\n\t\t$('#'.concat(value)).toggle();\t\n\t});\n}", "function toggle(){\n\tif(CijiJeRed==0)CijiJeRed=1;\n\telse CijiJeRed=0;\n\t\n\tdocument.getElementById(\"poruka-u-igri\").innerText = \"Red je na igrača \" +igraci[CijiJeRed];\n}", "function toggleSection(toggleObj, id, showtext, hidetext) {\n var e = document.getElementById('sectionblock'+id);\n if(toggleObj.innerHTML == showtext) {\n toggleObj.innerHTML = hidetext;\n e.style.display = 'block';\n }\n else {\n toggleObj.innerHTML = showtext;\n e.style.display = 'none';\n }\n\n}", "function deactivate() {\n\tconsole.log('showText disactivated');\n}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function toggle_element_visibility(elemid){\n var elem=document.getElementById(elemid);\n var elemlink=document.getElementById(elemid+'-link');\n if(elem.style.display==\"none\"){\n elem.style.display=\"block\";\n elemlink.innerHTML=elemlink.innerHTML.replace(\"+\",\"-\");\n }else{\n elem.style.display=\"none\";\n elemlink.innerHTML=elemlink.innerHTML.replace(\"-\",\"+\");\n }\n return false;\n}", "updateSelection() {\n let link = this.__prompt.getPromptValue(\"href\"),\n text = this.__prompt.getPromptValue(\"linktext\");\n\n this.setRange();\n this.__selectionContents.innerHTML = text;\n this.toggled = !link || !text;\n this.commandVal = link || undefined;\n this.execCommand();\n }", "function modifyLink(link, title) {\n if (!addIcon) {\n $(link).text(title);\n } else {\n if (containsHebrew(title)) {\n $(link).empty().append(youtubeHintDivRtl.clone().prepend(title));\n } else {\n $(link).empty().append(youtubeHintDivLtr.clone().append(title));\n }\n }\n}", "function changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function printlink() {\n\t\t\t\tvar linkElem = $('#inspo');\n\t\t\t\tlinkElem.html(links[randomlink].text);\n\t\t\t}", "function toggleOne(oid, obj, showtxt, hidetxt)\n{\n /*\n\tif (showtxt == \"\")\n\t\tshowtxt = \"Show\";\n\tif (hidetxt == \"\")\n\t\thidetxt = \"Hide\";\n\t*/\n\tif(document.getElementById(oid).style.display == 'none')\n\t{\n\t\tdocument.getElementById(oid).style.display = '';\n\t\t\n\t\tif (obj && hidetxt != \"\")\n\t\t{\n\t\t\tif (obj.type == \"button\")\n\t\t\t\tobj.value = hidetxt;\n\t\t\telse if (obj.type == \"link\")\n\t\t\t obj.innerHTML = hidetxt;\n\t\t\telse\n\t\t\t\tobj.src = hidetxt;\n\t\t}\n\t}\n\telse\n\t{\n\t\tdocument.getElementById(oid).style.display = 'none';\n\t\t\n\t\tif (obj && showtxt != \"\")\n\t\t{\n\t\t\tif (obj.type == \"button\")\n\t\t\t\tobj.value = showtxt;\n\t\t\telse if (obj.type == \"link\")\n\t\t\t obj.innerHTML = showtxt;\n\t\t\telse\n\t\t\t\tobj.src = showtxt;\n\t\t}\n\t}\n}", "function toggleHelp() {\n\ttoggleAnalyserPanel('help');\n}", "function toggleThisContent(elm) {\n\telm = document.getElementById(elm).style;\n\t(elm.display == 'none') ? (elm.display = 'block') : (elm.display = 'none');\n\t\n\tvar text = document.getElementById('ns_show_info_button');\n\t(text.innerHTML == 'Show Install Info') ? (text.innerHTML = 'Hide Install Info') : (text.innerHTML = 'Show Install Info');\n\t\n//\tvar copy = document.getElementById('ns_copy_to_cp_button');\n//\t(copy.innerHTML == '') ? (copy.innerHTML = 'Copy to Clipboard') : (copy.innerHTML = '');\n}", "function updateLinkLabels(active) {\n graph.element.selectAll('.link text').remove()\n if (active) {\n graph.element.selectAll('.link')\n .append('text')\n .attr('x', d => (d.parent.y + d.y) / 2)\n .attr('y', d => d.x - 5)\n .attr('text-anchor', 'middle')\n .attr('class', 'linkLabel')\n .attr('id', d => 'label' + d.data.id)\n .style('font', `${graph.style.labels_size}px sans-serif`)\n .text(d => d.data.data.value)\n }\n }", "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function expand(){\n var text = \"Read More\"\n console.log(text);\n if (text = \"Read More\") {\n $(\".expand\").show(\"fast\");\n $(\"#readmore2\").html(\"Read Less\");\n text = \"Read Less\";\n console.log(text);\n } else {\n $(\".expand\").hide(\"fast\");\n text = $(\"#readmore2\").html(\"Read Less\");\n}\n}", "function switchtext(){\n\t\t$(\"h1\").html(\"jQuery Ninja\");\n\t\n\t}", "function modifyLink(toggle){\n\n\t/* Spec 16555 starts */\n\tif (document.getElementById(\"item-quantity\")) {\n\t\tvar itemQty = document.getElementById(\"item-quantity\").value;\n \t\t\n\t\tif(itemQty>=10)\t{\n\t\t\tdocument.getElementById(\"col_shipping-table\").style.marginLeft=\"-10px\";\n\t\t\tdocument.getElementById(\"col_shipping-table\").style.width=\"100%\";\n\t\t }\n\t}\n\t/* Spec 16555 end */\n\n\tif( toggle == 'on' ){\n\t\tYAHOO.util.Dom.addClass(document.getElementById('seller-notes-toggle'), 'opened');\n\t\tYAHOO.util.Dom.addClass(document.getElementById('changeInstructions'), 'opened');\n\t\tYAHOO.util.Dom.addClass(document.getElementById('addInstructions'), 'opened');\n\t} else {\n\t\tYAHOO.util.Dom.removeClass(document.getElementById(\"seller-notes-toggle\"), 'opened')\n\t\tYAHOO.util.Dom.removeClass(document.getElementById(\"addInstructions\"), 'opened')\n\t\tYAHOO.util.Dom.removeClass(document.getElementById(\"changeInstructions\"), 'opened')\n\t}\n\tif(document.getElementById(\"expander\")){\n\tdocument.getElementById(\"expander\").style.position =\"relative\";\n\tdocument.getElementById(\"expander\").style.top = \"5px\";\n\t}\n}", "function clickLink() {\t\t\t\t\t\t\n\t$(\".link-map\").on(\"click\", function(e){\n\t\te.preventDefault();\n\t\ttoggleLink($(this));\n\t});\n}", "function linktypeSwitch(status) {\n if (status)\n linktypes.show();\n else\n linktypes.hide();\n }", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "function changeUrls() {\n let selectAtoChange = document.querySelector(\"main a\")\n selectAtoChange.removeAttribute(\"href\")\n selectAtoChange.setAttribute(\"href\",\"https://www.google.com\")\n selectAtoChange.innerText = \"Now this link goes to Google, Strivers!\"\n }", "function toggleIcon() {\n $(this).toggleClass('open-accordion');\n $(this).find(\".toggle-accordion\").html($(this).text() == 'Ver más' ? 'Ver menos' : 'Ver m&aacute;s');\n }", "function switchText(){\n\tif(Text_Index >= text.length){\n\t\tredirectPage();\n\t}\n\tif(Time_Index % 2 == 1) Time_Index = 11;\n\telse Time_Index = 10;\n document.getElementById(\"speechtext\").textContent = text[Text_Index];\n Text_Index += 1;\n document.getElementById(\"clicktocontinue\").style.visibility = \"hidden\";\n}", "function announce(word) {\n\tdocument.getElementById(\"announce\").innerHTML = word;\n\ttoggle(\"announce\");\n\tvar toggleOff = setTimeout(toggle, 2000, \"announce\");\n}", "function toggleTrailer() {\n\tif($('#cont_trailer').css('display') == 'none') {\n\t\t$('#cont_trailer').css('display', 'block');\n\t\t$('#cont_trailer_link').html('- Trailer');\n\t} else {\n\t\t$('#cont_trailer').css('display', 'none');\n\t\t$('#cont_trailer_link').html('+ Trailer');\n\t}\n}", "function swapText(btn) {\n\tconst altText = btn.data(\"alt-text\");\n\tbtn.data(\"alt-text\", btn.text()).text(altText);\n}", "handleClick(e) {\n const allLinks = document.querySelectorAll(\"a\");\n allLinks.forEach(link => {\n link.classList.remove(\"active\");\n });\n e.target.classList.toggle(\"active\");\n }", "function toggleTerms() {\n\ttoggleAnalyserPanel('terms');\n}", "handleShowPartyClick (event) {\n var btn = event.currentTarget;\n var innerHtml = btn.innerHTML;\n var newText = innerHtml === \"Hide the Party Members\" ? \"See the Party Members\" : \"Hide the Party Members\";\n\n btn.innerHTML = newText;\n }", "function onClick(link){\n \n}", "function uncollapseText(btn){\n\t\tvar extra = $(btn).data('text')\n\t\tvar $parent = $(btn).parent();\n\t\t$(btn).remove();\n\t\tvar newText = $parent.text().substr(0, $parent.text().length - 4) + extra; /*[1]*/\n\t\t$parent.text(newText)\n\t}", "function toggle(currentMenu) {\r\n if (currentMenu == \"menuHighlight\") {\r\n var checkIt = document.getElementById(currentMenu);\r\n if (checkIt) { var displayVal = document.getElementById(currentMenu).parentNode;\r\n } else { return false; };\r\n } else {\r\n var displayVal = document.getElementById(currentMenu);\r\n }\r\n if (displayVal.style.display == \"block\") { \r\n displayVal.style.display = \"none\"; \r\n var linkTitle = displayVal.parentNode.getElementsByTagName(\"a\")[0].title;\r\n displayVal.parentNode.getElementsByTagName(\"a\")[0].title = 'Expand ' + linkTitle.substring(linkTitle.indexOf(\" \")+1);\r\n displayVal.parentNode.getElementsByTagName(\"img\")[0].src = '/gifjpg/menu_closed.gif';\r\n displayVal.parentNode.getElementsByTagName(\"img\")[0].alt = 'Expand ' + linkTitle.substring(linkTitle.indexOf(\" \")+1);\r\n } else { \r\n displayVal.style.display = \"block\";\r\n var linkTitle = displayVal.parentNode.getElementsByTagName(\"a\")[0].title;\r\n displayVal.parentNode.getElementsByTagName(\"a\")[0].title = 'Collapse ' + linkTitle.substring(linkTitle.indexOf(\" \")+1);\r\n displayVal.parentNode.getElementsByTagName(\"img\")[0].src = '/gifjpg/menu_open.gif';\r\n displayVal.parentNode.getElementsByTagName(\"img\")[0].alt = 'Collapse ' + linkTitle.substring(linkTitle.indexOf(\" \")+1);\r\n }\r\n}", "function drawLink() {\n var stat = getState(cm);\n var url = \"http://\";\n _replaceSelection(cm, stat.link, insertTexts.link, url);\n}", "function changelinkElementFromBtn(btnElement) {\n let text = 'Commander la ';\n let destination = '';\n\n if (isSwitchBtn(btnElement)) {\n text += 'Nintendo Switch';\n destination = 'https://jeux-video.fnac.com/s470484/Nintendo-Switch';\n } else {\n text += 'Wii U ';\n destination = 'https://jeux-video.fnac.com/s302189/Wii-U';\n }\n\n // change Link's label and destination accordingly\n changelinkLabel(text);\n changelinkDestination(destination);\n }", "function toggleText() {\n $('.slideshow-container').slideToggle(300, function() {\n $('.slideshow-caption h3').html($('.slideshow-current img').attr('title'));\n $('.slideshow-caption p').html($('.slideshow-current img').attr('alt'));\n $('.slideshow-container').slideToggle(500);\n });\n}", "function mouseOutlink(){\n // Changed the bg color back to white\n // Used the variable I made above to set the text color back to its original\n $(this).css('background-color','white').css('color',orginalColor);\n}", "_expandOrCollapse($link, expand) {\n const $icon = $link.find('.fa');\n const commitID = $link.data('commitId');\n\n const commit = this.model.get('commits').get(commitID);\n const newText = commit.get(expand ? 'commitMessage' : 'summary');\n\n $link.closest('tr')\n .find('pre')\n .text(newText);\n\n $link.attr(\n 'class',\n expand ? 'collapse-commit-message' : 'expand-commit-message');\n\n $icon.attr({\n 'class': expand ? 'fa fa-minus' : 'fa fa-plus',\n 'title': expand ? gettext('Collapse commit message.')\n : gettext('Expand commit message.'),\n });\n }", "function toggleNav() {\n\tvar ele = document.getElementById(\"mobile-navigation-toggle\");\n\tvar text = document.getElementById(\"mobile-nav-button-link\");\n\tif(ele.style.display == \"block\") {\n \t\tele.style.display = \"none\";\n \t}\n\telse {\n\t\tele.style.display = \"block\";\n\t}\n}", "function toggleKeywords(elBtn) {\n document.querySelector('.hidden-search-terms').classList.toggle('hide');\n elBtn.innerText = (elBtn.innerText === 'Show more') ? 'Show less' : 'Show more';\n}", "function aniLinkOff()\n{\n $(this).animate({opacity:'0.3'}, {duration:LINK_FADE_TIME,queue:false});\n}", "function toggleMenu() {\n menuHead.addEventListener(\"click\", function () {\n if (menuBody.style.display === \"none\") {\n menuBody.style.display = \"block\";\n } else {\n menuBody.style.display = \"none\";\n }\n });\n\n menuBody.addEventListener(\"click\", function (ev) {\n if (ev.target !== ev.currentTarget) {\n menuHead.children[0].textContent = ev.target.textContent;\n }\n\n menuBody.style.display = \"none\";\n });\n }", "function toggleHighlight(e) {\n if (e.target.nodeName === 'A') {\n return;\n }\n e.currentTarget.classList.toggle('highlight');\n}", "function toggleContact() {\n\ttoggleAnalyserPanel('contact');\n}", "function showText() {\n // TODO\n document.getElementById(\"text\").style.display = \"block\";\n document.getElementById(\"more\").innerHTML = \"\";\n }", "function toggle(index) {\t\n\t$(\"#collapse\"+index).attr('src',\"./img/open.png\");\t\n\tif(this.id ==\"expand\"+index){\n\t\tthis.id =\"collapse\"+index;\n\t\t$(\"#collapse\"+index).attr(\"src\",\"./img/close.png\");\t\n\t\t$(\"#collapse\"+index).attr(\"title\", \"Click to view replies\");\n\t} else{\n\t\tthis.id =\"expand\"+index;\n\t\t$(\"#expand\"+index).attr('src',\"./img/open.png\");\t\n\t\t$(\"#expand1\"+index).attr(\"title\", \"Click to hide replies\");\n\t}\t \n\n}", "function openClose() {\n\t\t$this = $(this);\n\t\t\n\t\tvar entry = $(this).prev('.entry-content');\n\t\tentry.find('.content').toggle();\n\t\tentry.find('.excerpt.short').toggle();\n\t\t\n\t\tvar text = $this.text() == 'More' ? 'Less' : 'More';\n\t\t$this.text(text);\n\t}", "function showLinks(){\n\t$body.classList.remove('mcl-hide-links');\n\thidenLinks = false;\n}", "showDescription() {\n ui.toggleDescription();\n }", "toggleLinksToMenu() {\n return gsap.timeline({\n defaults: {\n duration: !this.isMenuPage ? 1 : 0.6, \n ease: !this.isMenuPage ? 'power4.inOut' : 'power4'\n }\n })\n .to(this.DOM.menuItems, {\n x: (_,target) => !this.isMenuPage ? winsize.width * 0.6 - target.offsetLeft : 0,\n stagger: !this.isMenuPage ? {\n from: this.currentMenuItem,\n amount: 0.15\n } : 0\n }, 0)\n .to(this.DOM.textWords.sort((a,b) => {\n // words are ordered by its left value\n if ( a.offsetLeft < b.offsetLeft ) {\n return -1;\n }\n else if ( a.offsetLeft > b.offsetLeft ) {\n return 1;\n }\n return 0;\n }), {\n x: !this.isMenuPage ? -300 : 0,\n opacity: !this.isMenuPage ? 0 : 1,\n stagger: !this.isMenuPage ? 0.004 : -0.004\n }, 0);\n }", "function change_yes_no(){\n\t$( \"#btn_activity_check\" ).click(function() {\n\t\tvar cur_text = $(this).text();\n\t\tif( cur_text.localeCompare(\"yes\") == 0){\n\t\t\t$( this ).text(\"no\");\n\t\t}\n\t\telse{\n\t\t\t$( this ).text(\"yes\");\n\t\t}\n\t});\n}", "function changeClass() {\n $(\"#myDiv\").toggleClass(\"showText hideText\");\n }" ]
[ "0.72662044", "0.661231", "0.6559535", "0.6535035", "0.6457702", "0.638803", "0.63799006", "0.6282484", "0.6186118", "0.617684", "0.6173611", "0.6123726", "0.6123344", "0.61170644", "0.6101341", "0.610053", "0.6078152", "0.6020483", "0.60192025", "0.5991839", "0.59794354", "0.5960324", "0.59550446", "0.59510124", "0.5925008", "0.59109837", "0.5894985", "0.5893909", "0.5879079", "0.58508176", "0.5847026", "0.5844906", "0.5800348", "0.5797043", "0.5791004", "0.5782175", "0.57683855", "0.5740638", "0.5733344", "0.573255", "0.5730766", "0.5730261", "0.57207096", "0.57071227", "0.570255", "0.56994945", "0.56959295", "0.56915075", "0.5685208", "0.56695", "0.56680423", "0.56559503", "0.5652336", "0.56513333", "0.56481254", "0.56461394", "0.5636756", "0.56364554", "0.56323683", "0.5630995", "0.5626996", "0.5626362", "0.56256646", "0.562075", "0.56202215", "0.5618233", "0.56019986", "0.5599286", "0.5599286", "0.5599286", "0.5583878", "0.55691516", "0.55674815", "0.5564728", "0.5563346", "0.5562127", "0.55401385", "0.5537397", "0.55325913", "0.552833", "0.552405", "0.551651", "0.5511872", "0.55068696", "0.5504779", "0.55045986", "0.548169", "0.5473447", "0.54672706", "0.5465119", "0.5451318", "0.54403263", "0.5439881", "0.5424685", "0.5418361", "0.54182345", "0.5414124", "0.5413186", "0.5403209", "0.53985417", "0.5391508" ]
0.0
-1
Update the data so that the text is toggled properly
function set_time_link(task_id, type) { $('.time-button').each( (_, bb) => { if (type === "Start") { if (task_id == $(bb).data('task-id') && $(bb).data('type') === "Start") { $(bb).data('clicked', "Yes"); } } else { // Change the clicked flag of the Start button back to "No" so that it // will render as a 'Start' link again if (task_id == $(bb).data('task-id') && $(bb).data('type') === "Start") { $(bb).data('clicked', "No"); // Cleat the time id so that the user cannot click 'End' before // clicking 'Start' TIME_ID = ""; } } }); end_links(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateText(){\n scope.text = scope.on ? attrs.textwhenon : attrs.textwhenoff;\n }", "function toggleData() {\n $log.debug('toggleData');\n $scope.forecastData = $scope.forecastData ? false : true;\n $scope.locationInfo = $scope.locationInfo ? false : true;\n }", "function labelUpdate(axis, clickText) {\n // Switch old choice off\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n \n // switches new choice on\n clickText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function switchtext(){\n\t\t$(\"ol\").html(\"falseFact\");\n\t\t$(\"ol\").html(\"TrueFact\");\n\t\n\t}", "function updateData(data) {\n // Updates text\n $(\".mainTextP\")[0].innerHTML = data.message;\n $(\".supportTextP\")[0].innerHTML = data.extra;\n }", "function updatePredictButtonText(text) {\n document.querySelector(\".c8a11y-predict-toggle-button\").innerHTML =\n text;\n }", "function updateData(data) {\n // data.selectedGen++;\n // model.provider.updateField(data.name, { active: data.selected });\n model.provider.toggleFieldSelection(data.name);\n }", "function changeText() {\n \n }", "function changeToggleText() {\n\n\t// change to default button\n\tif (!$(\"#search-button\").is(\":visible\")) $(\".main-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n\tif (!$(\"#deselect-all\").is(\":visible\")) $(\".selection-toggle\").html(\"<i class='glyphicon glyphicon-menu-hamburger'></i>\");\n} // changeToggleText", "function UpdatePageText()\n{\n\t// If the toggle is false, set to inches\n\tvar labelUnits = (_buttonState) ? _millimetersAbbrev : _inches;\n\tvar tipUnits = (_buttonState) ? _millimeters : _inches;\n\t\t\n\t// Clear out previous calculated value\n\tjQuery('.calculated-value').html(\"- -\");\n\t\n\t// Update input/output unit labels\n\tjQuery('.output-units').html(labelUnits);\n\tjQuery('.input-units').html(labelUnits);\n\t\n\t// Update tooltips\n\tjQuery('#item-length-tip').attr(\"tip\", \"Length, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#item-width-tip').attr(\"tip\", \"Width, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#item-height-tip').attr(\"tip\", \"Height, in \" + tipUnits + \", of the item you will be placing in the crate.\");\n\tjQuery('#plywood-thickness-tip').attr(\"tip\", (_buttonState) ? '9.5mm is recommended' : '3/8\" is recommended');\n\tjQuery('#frame-thickness-tip').attr(\"tip\", (_buttonState) ? '38mm is recommended' : '1.5\" is recommended');\n}", "function toggleInfo() {\n\t\t\tvm.info = !vm.info;\n\t\t}", "toggleInfo(index, label) {\n console.log('this is index', index);\n\n if(this.state.data[index].visible === true) {\n this.state.data[index].visible = false;\n \n } else {\n this.state.data[index].visible = true;\n\n } \n this.setState({\n data: this.state.data,\n \n });\n }", "updateLabel() {\n this.text = this._text;\n }", "updateLabel() {\n this.text = this._text;\n }", "function updateButton() {\n const icon = this.paused ? '►' : \"&#10074&#10074;\";\n toggle.innerHTML = icon;\n // more on textContent VS innerHTML: https://www.w3schools.com/jsref/prop_node_textcontent.asp#:~:text=The%20innerHTML%20property%20returns%20the,but%20without%20inner%20element%20tags.\n}", "function updateToggleState( $toggle, $content ) {\n\t\t\tif( $toggle.hasClass('expanded') ) {\n\t\t\t\t$content.show();\n\t\t\t\t$toggle.text( $toggle.text().replace(/Show/g, 'Hide') );\n\t\t\t} else {\n\t\t\t\t$content.hide();\n\t\t\t\t$toggle.text( $toggle.text().replace(/Hide/g, 'Show') );\n\t\t\t}\n\t\t}", "#updateData() {\n this.container.querySelector('.data').innerHTML = this.data;\n }", "function factChange() {\n $('.falseFact').text('True Fact');\n }", "updateText(text) {\n\t\tthis.text = text;\n\t}", "function updateText() {\n $('#title').text(TEXT.getText('title'));\n $('#home').text(TEXT.getText('home'));\n $('#stations_map').text(TEXT.getText('stations_map'));\n\n $('#station_list_text_tab').text(TEXT.getText('stations_list'));\n $('#location_text').text(TEXT.getText('location'));\n\n // WARNING\n // Update text only if no location is set\n let location = $('#location_name').text();\n if(location === TEXT.getTextLocalize('no_location', 'fr') || location === TEXT.getTextLocalize('no_location', 'en')) {\n $('#location_name').text(TEXT.getText('no_location'));\n }\n\n $('#state > h3').text(TEXT.getText('station_state'));\n $('#table_state_id').text(TEXT.getText('id_station'));\n $('#table_state_ba').text(TEXT.getText('bicycles_available'));\n $('#table_state_blocked').text(TEXT.getText('blocked'));\n $('#table_state_ta').text(TEXT.getText('terminals_available'));\n $('#table_state_suspended').text(TEXT.getText('suspended'));\n $('#table_state_bu').text(TEXT.getText('bicycles_unavailable'));\n $('#table_state_ooo').text(TEXT.getText('ooo'));\n $('#table_state_tu').text(TEXT.getText('terminals_unavailable'));\n\n $('#liste > h3').text(TEXT.getText('stations_list'));\n $('#table_list_name').text(TEXT.getText('station_name'));\n $('#table_list_b').text(TEXT.getText('bicycles_available'));\n $('#table_list_t').text(TEXT.getText('terminals_available'));\n $('#table_list_blocked').text(TEXT.getText('blocked_state'));\n $('#table_list_suspended').text(TEXT.getText('suspended_state'));\n\n}", "function update(data) {\n\n // data join\n var text = svg.selectAll(text).data(data);\n\n //update\n text.attr(\"class\", \"update\");\n\n //enter\n text.enter().append(\"text\")\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d, i) { return i * 32 }) // cuz it's a monospaced font\n .attr(\"dy\", \".35em\");\n\n //enter + update\n text.text(function(d) {return d;});\n\n //exit\n text.exit().remove();\n\n}", "updateTexts() {\n super.updateTexts();\n\n this.updatePlayerTexts();\n this.updateTop5Text();\n }", "function datatextswap(){\n\t\tvar elements = document.getElementsByClassName('js-text-swap');\n\n\t\t[].forEach.call(elements, function(element) {\n\n\t element.addEventListener('click', function(e) {\n\n\t e.preventDefault();\n\n\t\t\t if (element.getAttribute(\"data-text-swap\") == element.innerHTML) {\n\t\t\t element.innerHTML = element.getAttribute(\"data-text-original\");\n\t\t\t } else {\n\t\t\t element.setAttribute(\"data-text-original\", element.innerHTML);\n\t\t\t element.innerHTML = element.getAttribute(\"data-text-swap\");\n\t\t\t }\n\t\t\t}, false);\n\n\t });\n\t}", "onToggle() {\r\n this.toggle = !this.toggle;\r\n }", "function expand(){\n var text = \"Read More\"\n console.log(text);\n if (text = \"Read More\") {\n $(\".expand\").show(\"fast\");\n $(\"#readmore2\").html(\"Read Less\");\n text = \"Read Less\";\n console.log(text);\n } else {\n $(\".expand\").hide(\"fast\");\n text = $(\"#readmore2\").html(\"Read Less\");\n}\n}", "function toggleText() {\r\n var text = document.getElementById(\"instructions\");\r\n if (text.style.display === \"none\") {\r\n text.style.display = \"block\";\r\n } else {\r\n text.style.display = \"none\";\r\n }\r\n }", "function updateButton() {\n const icon = this.paused ? \">\" : \"||\";\n selectors.toggle.textContent = icon;\n}", "toggleLabels() {\n this.areLabelsShown = !this.areLabelsShown;\n this.labelsGroup.visible = this.areLabelsShown;\n\n this.render();\n }", "function updateButton(){\n\tconst icon = this.paused ? \"►\" : \"❚ ❚\";\n\ttoggle.textContent = icon;\n}", "function onClick() {\n setShowData(false);\n }", "@action updateDataToShow(value) {\n this.dataToShow = value;\n this.selectedData = this.data[0].details;\n this.activeDetailTab = this.data[0].label;\n }", "function updateStepperMotor(data) {\n $('#motor_position').text(data['motor']['position']);\n if (data['motor']['state'] === '1') {\n $('#motor_state').toggleClass('label-default', false);\n $('#motor_state').toggleClass('label-success', true);\n } else if (data['motor']['state'] === '0') {\n $('#motor_state').toggleClass('label-default', true);\n $('#motor_state').toggleClass('label-success', false);\n }\n }", "function updateData() {\n\n // Select the section we want to apply our changes to\n var svg = d3.select(\"body\").transition();\n\n // Make the changes\n svg.select(\".line\")\n .duration(750)\n .style(\"transform\", \"scaleY(.6)\");\n svg.select(\".x.axis\") // change the x axis\n .duration(750)\n .call(xAxis);\n svg.select(\".y.axis\") // change the y axis\n .duration(750)\n .call(yAxis);\n \n var x = document.getElementById(\"added-food\");\n if (x.style.display === \"\" | x.style.display === \"none\") {\n x.style.display = \"inline-block\";\n }\n }", "toggleUpdate() {\n $(\"[data-button='update']\").find(\"i\").toggleClass(\"grey\");\n }", "onToggle() {}", "setActualState(autoModeIdx) { \r\n if(autoModeIdx >= 0 && autoModeIdx < this.modeTitleList.length){\r\n this.actValText = this.modeTitleList[autoModeIdx];\r\n } else {\r\n this.actValText = \"????\";\r\n }\r\n this.hasData = true;\r\n }", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function updateButton() {\n const icon = this.paused ? '►' : '❚ ❚';\n toggle.textContent = icon;\n}", "function toggleText(content) {\n if (content.classList.contains('hide')) {\n content.classList.remove('hide');\n content.classList.add('show');\n } else if (content.classList.contains('show')) {\n content.classList.remove('show');\n content.classList.add('hide');\n }\n}", "function changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function toggleDescription() {\n self.showingDescription = !self.showingDescription;\n }", "function toggleTitle(elem) {\n data = {\n \"name\":document.getElementById('event').value,\n \"title\":elem.childNodes[1].value,\n \"date\": d.getMonth().toString() + \"/\" + d.getDate().toString() + \"/\" + d.getFullYear().toString()\n }\n dataString = JSON.stringify(data).replace(/\\\"/g,\"\\\\\\\"\")\n var titleName = elem.dataset.title\n var titleIndex = getChildNumber(elem) + 1\n if (!activeTitle) {\n console.log(\"!activeTitle\")\n //UPDATE AND PLAY TITLE\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" UPDATE 1 \\\"\" + dataString +\"\\\"\")\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" PLAY 1\")\n // send(\"CG 1-20 ADD 1 \\\"\" + titleName + \"\\\" 1 \\\"\" + dataString +\"\\\"\")\n activeTitle = \"trans\"\n setTimeout( () => {\n activeTitle = titleIndex\n },1000)\n }else if (activeTitle == titleIndex) {\n console.log(\"activeTitle == titleIndex\")\n send(\"CG 1-\" + (activeTitle + 20).toString() +\" STOP 1\")\n activeTitle = \"trans\"\n setTimeout( () => {\n activeTitle = null\n },1000)\n //activeTitle = null\n } else if (activeTitle == \"trans\"){\n console.log(\"transitioning\")\n } else {\n console.log(\"else\")\n send(\"CG 1-\" + (activeTitle + 20).toString() +\" STOP 1\")\n activeTitle = \"trans\"\n setTimeout( () => {\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" UPDATE 1 \\\"\" + dataString +\"\\\"\")\n send(\"CG 1-\" + (titleIndex + 20).toString() + \" PLAY 1\")\n setTimeout( () => {\n activeTitle = titleIndex\n },1000)\n },1000)\n }\n\n}", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3\n .selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function toggle(){\n\tif(CijiJeRed==0)CijiJeRed=1;\n\telse CijiJeRed=0;\n\t\n\tdocument.getElementById(\"poruka-u-igri\").innerText = \"Red je na igrača \" +igraci[CijiJeRed];\n}", "function switchtext(){\n\t\t$(\"h2\").html(\"Christina\");\n\t}", "function updateText(ev) {\n setText(ev.target.value);\n }", "function labelChange(axis, clickedText) {\n // Switch the currently active to inactive.\n d3.selectAll(\".aText\")\n .filter(\".\" + axis)\n .filter(\".active\")\n .classed(\"active\", false)\n .classed(\"inactive\", true);\n\n // Switch the text just clicked to active.\n clickedText.classed(\"inactive\", false).classed(\"active\", true);\n }", "function toggleProfileData() {\n toggleElement('profileInfo');\n}", "function updateButton(){\n const icon = this.paused ? '►' : '❚ ❚';\n toggleButton.textContent = icon;\n}", "updateMarked(text) {\n this.setState({ text: text });\n }", "function toggleMove(){ //Toggle between Viewing and Moving\n if(modeArray.viewingMode){ //Only runs if viewing is enabled\n if(!modeArray.movingMode){ //Swap to Moving\n modeArray.movingMode =true;\n document.getElementById(\"Mode\").innerText = \"Moving\"; //Update mode text\n document.getElementById(\"btnToggleMove\").innerText = \"Stop Moving\"; //Update toggle button text\n }\n else{\n modeArray.movingMode =false; //Swap back to Viewing\n document.getElementById(\"btnToggleMove\").innerText = \"Move Marker\"; //Update toggle button text\n document.getElementById(\"Mode\").innerText = \"Viewing\"; //Update mode text\n }\n }\n}", "update (text) {\n if (text !== this.text) {\n this.text = text\n this.element.innerText = this.text // Directly update the element\n }\n return false // Don't call createElement again\n }", "function update() {\n displayed = false;\n prev_subject = curr_subject;\n curr_subject = select(\"#phrase\").value();\n loadJSON(api+curr_subject+access_token, gotData);\n}", "changeDisplay() {\n this.displayMarkup = !this.displayMarkup;\n }", "toggleInfo() {\n this.setState((prevState, props) => ({\n // here we invert our showInfo boolean by using the \n // previous state and the ! exclamation mark\n showInfo: !prevState.showInfo\n }));\n }", "function toggleInfo() {\n if (infoContainer.style.display === 'none') {\n infoContainer.style.display = 'block';\n infoBtn.innerText = 'Less Info';\n infoContainer.innerText = info;\n } else {\n infoContainer.style.display = 'none';\n infoBtn.innerText = 'More Info';\n infoContainer.innerText = '';\n }\n }", "showDescription() {\n ui.toggleDescription();\n }", "function handleDataToggling () {\n\t\tvar len,\n\t\t\ti,\n\t\t\tj,\n\t\t\tnumOfPages,\n\t\t\tendIndex,\n\t\t\titem;\n\n\t\t// If the key for data display is changed then just update the anchor blocks \n\t\t// which by default happens in descending order.\n\t\tif (prevStorageKey !== storageKey) {\n\t\t\tupdateGrid(0, scrollElm.length);\n\t\t}\n\t\t// The flow enters this block when the order of the same key against which the\n\t\t// elemnts are displayed is changed.\n\t\telse {\n\t\t\tlen = scrollElm.length;\n\t\t\tnumOfPages = Math.floor(len / maxResult);\n\n\t\t\tendIndex = lastDrawIndex + (maxResult - lastDrawIndex % maxResult);\n\t\t\t// Drawing all the scroll element of the current page\n\t\t\tupdateGrid(lastDrawIndex, endIndex);\n\n\t\t\tfunction helperFN (i, j) {\n\t\t\t\tindex = maxResult * j + i;\n\t\t\t\titem = scrollElm[index];\n\t\t\t\titem && item.appendTo('#scroller');\n\t\t\t}\n\n\t\t\tfor (j = 0; j <= numOfPages; j++) {\n\t\t\t\tif (order === 'ascending') {\n\t\t\t\t\tfor (i = maxResult - 1; i >= 0; i--) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tfor (i = 0; i < maxResult; i++) {\n\t\t\t\t\t\thelperFN(i, j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tprevStorageKey = storageKey;\n\t}", "function toggleText() {\n $('#sunny-city-list').addClass('hide-text');\n setTimeout(() => {\n $('#sunny-city-list').removeClass('hide-text')\n }, 250)\n}", "function toggleState(item){\n if($(item).attr(\"data-tog\") == \"0\") {\n $(item).attr(\"data-tog\",\"1\");\n } \n else {\n $(item).attr(\"data-tog\", \"0\");\n }\n}", "function toggle() { // @return Boolean: true is play\r\n // false is pause\r\n switch (this.state().text) {\r\n case \"ended\": this.backend.currentTime(0);\r\n case \"pause\": this.play();\r\n return true;\r\n case \"playing\": this.pause();\r\n }\r\n return false;\r\n}", "function changeText(value) {\n // would .textContent work instead of .innerHTML?\n document.getElementById('status-line').innerHTML = value;\n\n if (value === 'SENDING') {\n // document.getElementById(\"status-line\").classList.toggle('sending');\n document.getElementById(\"status-line\").className = 'sending';\n\n } else if (value === 'READY') {\n // document.getElementById(\"status-line\").classList.toggle('complete');\n document.getElementById(\"status-line\").className = 'ready';\n console.log(\"text box:\", document.getElementById('text-box').value);\n document.getElementById('text-box').value = '';\n }\n}", "function changeText() {\n\t\tflipDisableOption();\n\t\trunning = true;\n\t\tcurrentFrames = $(\"text-area\").value;\n\t\tcurrentInterval = setInterval(insertFrame, currentSpeed);\n\t}", "function update(data){\n\n //2. Data Join\n var text = svg.selectAll(\"text\")\n .data(data);\n\n //3. Update\n // data nodes that match up\n text.attr(\"class\", \"update\");\n\n //4. Enter \n text.enter().append(\"text\") //appends a text svg element to enter?\n .attr(\"class\", \"enter\")\n .attr(\"x\", function(d, i){ return i*32} ) // d = data, i = index of data, 32px is the size of each letter\n .attr(\"dy\", \"0.35em\")\n .attr(\"fill\", \"hotpink\");\n\n //5. Enter + Update\n text.text(function(d) { return d; } );\n\n //6. Exit\n text.exit().remove();\n}", "function show_feedback_anal(){\n $(\"#feedback_chart_button\").toggle(\"fast\");\n $(\"#feedback_anal_filter\").toggle(\"fast\");\n $(\"#feedback_row\").toggle(\"slow\");\n \n $(\"#feedback_anal_row\").toggle(\"slow\");\n\n \n }", "updateData() {\n this.reset();\n\n if (this.cryptoConnect) {\n this.dataLabel(this.crypto, 'crypto', this.crypto.Symbol, this.Currency, 'Percent24H');\n }\n else if (this.serverFiat === 'RU') {\n this.dataLabel(this.fiatRU, 'fiat', this.Currency, 'RUB', 'Percent');\n }\n else {\n this.dataLabel(this.fiatEU, 'fiat', $t.fiatName.EUR, this.Currency, 'Percent');\n }\n }", "function updateSampleCountDisplay() {\n $('.message-nn1-true').html(NN1TrueDataArray.length);\n $('.message-nn1-false').html(NN1FalseDataArray.length);\n $('.message-nn2-true').html(NN2TrueDataArray.length);\n $('.message-nn2-false').html(NN2FalseDataArray.length);\n }", "function initTogglebox() {\n\t\t$(\".g_block_togglebox\").each(function(){\n\t\t\tvar toggleBox = this;\n\t\t\tvar showHideLink = $(\".g_togglebox_head a\", toggleBox);\n\t\t\tshowHideLink.data(\"toggleText\", \"Skjul indhold\"); //Save hide text in the dataobject\n\t\t\t\n\t\t\t$(\".g_togglebox_head\", toggleBox).click(function(event){\n\t\t\t\tevent.preventDefault(); //Prevent the default click event to fire\n\t\t\t\t$(toggleBox).toggleClass(\"g_visible\"); //Toggle a class to indicate that the content is visible/hidden\n\t\t\t\t$(\".g_togglebox_content\", toggleBox).slideToggle();\t//Toggle the content\n\t\t\t\t\n\t\t\t\t//Change the wording of the link\n\t\t\t\tvar currentHtml = showHideLink.html();\t//Save the current value\n\t\t\t\tshowHideLink.html(showHideLink.data(\"toggleText\")).data(\"toggleText\", currentHtml); //Set new html and save the old in the dataobject\n\t\t\t});\n\t\t});\n\t}", "function expand() {\n const showContent = document.getElementById(this.dataset.target)\n //Er wordt in de HTML gekeken voor een id dataset.target\n\n if (showContent.classList.contains('expand-active')) {\n this.innerHTML=this.dataset.showtext\n } \n //Als de class van de showcontent element 'expand-active' bevat verandert deze naar showtext.\n \n else {\n this.innerHTML=this.dataset.hidetext\n }\n //Als dit niet waar is en de class expand active niet bevat wordt de text gehide.\n\n showContent.classList.toggle('expand-active')\n //Toggle de expand-active class\n }", "function updateData(data) {\n const updated = createContainer(data);\n main.innerHTML = \"\";\n main.append(updated);\n}", "toggleCase() {\n\n this.isLowerCase = !this.isLowerCase;\n\n this.keys.forEach( ( key ) => {\n\n const char = key.info.chars[ key.panel.charset ] || key.info.chars[ 0 ];\n\n const newContent = this.isLowerCase || !char.upperCase ? char.lowerCase : char.upperCase;\n\n const textComponent = key.children.find( child => child.isText );\n\n if ( !textComponent ) return\n\n key.info.input = newContent;\n\n textComponent.set({\n content: newContent\n });\n\n textComponent.update( true, true, true );\n\n });\n\n }", "function changeSlideText(slideToChange, slideText) {\r\n slideToChange.data.text = slideText;\r\n runUpdateTimer();\r\n}", "function changeInfo () {\n \n let trigFile = carData[this.id];\n mdName.firstChild.nodeValue = trigFile.modelName;\n priceInfo.firstChild.nodeValue = trigFile.priceInfo;\n mdDetails.firstChild.nodeValue = trigFile.modelDetails;\n \n \n // opacity changes for active and nonactive classes \n theData.forEach(function(vehicle){\n vehicle.classList.add('nonActive');\n });\n \n this.classList.remove(\"nonActive\");\n }", "function updateStateTexts(dataLabel, axis, newScale, chosenAxis) {\n dataLabel.transition()\n .duration(1000)\n .attr(axis, d => newScale(d[chosenAxis]));\n return dataLabel;\n}", "function toggle(){\r\n\ttoggleResult();\r\n\t// toggleSearch();\r\n}", "function changeData() {\n elem.name = userData.name;\n elem.star = userData.star;\n elem.time = userData.time;\n elem.moves = userData.moves;\n}", "function setToggleButton() {\n var collapse = $toggleButton.attr(\"data-collapse\");\n var expand = $toggleButton.attr(\"data-expand\");\n if ($panels.next().hasClass('in')) {\n $panels.next().collapse('hide');\n $toggleButton.text(expand);\n $toggleButton.removeClass('closed');\n } else {\n $panels.next().collapse('show');\n $toggleButton.text(collapse);\n $toggleButton.addClass('closed');\n }\n}", "function toggleContent() {\n\n\t\t\t\t$thisContainer.css('height', $thisContainer.outerHeight());\n\n\t\t\t\t$thisContent.css({\n\t\t\t\t\t'position': 'absolute',\n\t\t\t\t\t'left': 0,\n\t\t\t\t\t'right': 0\n\t\t\t\t});\n\n\t\t\t\tTweenMax.set($thisContent, {\n\t\t\t\t\tautoAlpha: 0,\n\t\t\t\t\t'z-index': -1\n\t\t\t\t});\n\n\t\t\t\tif ( arguments[0] === false ) return;\n\n\t\t\t\tvar $initialContent = $thisContent.filter('[data-id=\"' + initialDataAtr + '\"]');\n\n\t\t\t\t$initialContent.css('z-index', 2);\n\n\t\t\t\tTweenMax.to($initialContent, animationSpeed, {\n\t\t\t\t\tautoAlpha: 1\n\t\t\t\t});\n\t\t\t}", "function toggle() {\r\n //if the object is current hidden\r\n if (hidden) {\r\n //set display to be on in block form\r\n document.getElementById('output').style.display = 'block';\r\n //and set the status to currently visible\r\n hidden = false;\r\n }\r\n //otherwise it is implied that it is visible\r\n else {\r\n //set the status to hidden\r\n hidden = true;\r\n //set the objects display to be off\r\n document.getElementById('output').style.display = 'none';\r\n }\r\n }", "function updateNetworkDisplay(on) {\n networkDom.text(on ? 'on' : 'off');\n networkDom.toggleClass('label-success', on);\n networkDom.toggleClass('label-important', !on);\n }", "toggle(dataNode) {\n if (this.filterValue.value) {\n return;\n }\n this.expansionModel.toggle(dataNode);\n }", "function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n }\n else {\n e.dataSeries.visible = true;\n }\n chart.render();\n }", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "action() {\n\t\tthis.toggle();\n\t}", "toggleHelpers() {\n if (this.helper) {\n this.helper = false;\n $(document.getElementsByClassName('help')[0]).css('color', 'white');\n this.els.rhymes.hidden = true;\n this.els.rhymes_below.hidden = true; \n }\n else if (this.definition) {\n console.log(this.definition); \n this.helper = true;\n this.els.rhymes.textContent = this.word[4];\n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n this.els.rhymes.hidden = !this.els.rhymes.hidden;\n } else {\n this.helper = true;\n this.els.rhymes_below.textContent = this.word[4];\n this.els.rhymes_below.hidden = !this.els.rhymes_below.hidden; \n $(document.getElementsByClassName('help')[0]).css('color', '#FF5722');\n \n }\n }", "toggleCredits() {\n this.progress.showCredits = !this.progress.showCredits;\n\tthis.setChanged();\n\tthis.notifyObservers(this.progress);\n\tthis.clearChanged();\n }", "function rerenderDoughnutByToggles() {\n filterTransactions();\n rerenderDoughnut();\n renderHeading();\n translatePage();\n}", "function changeText(){\r\n var isChecked=$(\"input\")[0].checked;\r\n if(isChecked===true)\r\n {\r\n $(\".basic ul .h1\").html(\"$19.99\");\r\n $(\".profession ul .h1\").html(\"$49.99\");\r\n $(\".master ul .h1\").html(\"$39.99\");\r\n }\r\n else if(isChecked===false)\r\n {\r\n $(\".basic ul .h1\").html(\"$199.99\");\r\n $(\".profession ul .h1\").html(\"$499.99\");\r\n $(\".master ul .h1\").html(\"$399.99\");\r\n }\r\n}", "function toggleDataSeries(e) {\n if (typeof (e.dataSeries.visible) === \"undefined\" || e.dataSeries.visible) {\n e.dataSeries.visible = false;\n } else {\n e.dataSeries.visible = true;\n }\n e.chart.render();\n }", "function updateButton(onclickFxn, text, opt_class) {\n // Clear button content.\n var buttonDiv = d3.select('.button-div');\n buttonDiv.html('');\n\n buttonDiv\n .append('button')\n .attr('id', 'transition-button')\n .text(text)\n .attr('class', opt_class)\n .on('click', onclickFxn);\n\n if (text == 'See Benefits') {\n buttonDiv.append('div').attr('id', 'bills-apply');\n }\n}", "function changeDataAndToggleActive(event, value) {\n // GET CURRENT ACTIVE CLASS AND REMOVE\n let current = document.getElementsByClassName(\"active\")[0];\n current.classList.remove(\"active\");\n\n // ADD ACTIVE CLASS TO CLICKED ELEMENT\n event.classList.add(\"active\");\n\n // CHANGE CHART DATA SET WHEN CLICKED\n trafficChart.data.datasets[0].data = value;\n trafficChart.update()\n}", "function toggleAlgo(algoName){\n document.getElementById(\"algoIndicator\").innerHTML=algoName;\n console.log(algoName)\n}", "function toggle(cmd,data) {\n\n var fnWhenDone = function(oAnswer, sData) {\n var values = eval('(' + oAnswer.responseText + ')');\n if(values && values.data && typeof(values.data) == 'object'){\n var className;\n var imageExt = ie5&&!opera ? \"gif\" : \"png\";\n for (var i = 0; i < values.data.length; i++) {\n var x = values.data[i];\n if(x.length == 4 && x[0]) {\n var tid = x[0];\n var ton = x[1] * 1;\n var trun = x[2] * 1;\n var tcon = x[3] * 1;\n\n var img = document.getElementById('toggle' + tid);\n if(img) {\n if(ton) {\n if(tcon)\n className = 'problem';\n else if(trun)\n className = 'running';\n else\n className = '';\n img.src = 'images/on.' + imageExt;\n } else {\n className = 'deactive';\n img.src = 'images/off.' + imageExt;\n }\n\n\n var elememts = new Array;\n var a = document.getElementById('item' + tid);\n if(a) { elememts.push(a); }\n var b = document.getElementById('desc' + tid);\n if(b) { elememts.push(b); }\n\n for (var n = 0; n < elememts.length; n++) { \n var elem = elememts[n].getElementsByTagName('font');\n for (var j = 0; j < elem.length; j++) {\n var classList = elem[j].className.split(' ');\n\n for ( var k = 0; k < classList.length; k++ ) {\n if( classList[k] == 'deactive' //remove class\n || classList[k] == 'problem' \n || classList[k] == 'running') \n classList.splice(k, 1);\n }\n\n if(className) //add class\n classList[classList.length] = className;\n\n elem[j].className = classList.join(' ');\n }\n }\n }\n }\n }\n }\n };\n\n var tt = data.split('_');\n for (var l = 0; l < tt.length; l++) {\n var timg = document.getElementById('toggle' + tt[l]);\n if(timg) {\n timg.src = 'images/wait.gif';\n }\n }\n\n // Hmm, brutal und gemein, das Laden der URL als Bild funktioniert...\n var url = \"?cmd=\" + cmd + \"&data=\" + data + \"&ajax=json\";\n if(ie5&&!opera) //Avoid use cache\n url += \"&random=\" + (Math.random() * Date.parse(new Date()));\n var aconn = new XHRequest();\n if(!aconn)\n return;\n aconn.connect(url, fnWhenDone, data);\n}", "function setState(text, url, dispFun) {\n var button;\n\n button = E.elements.content.menu.route.result.toggleAdvanced;\n\n button.text(text);\n button.attr('href', url);\n\n dispFun();\n }", "function changeLabelText(innerLabel, innerText) {\n\t\t$(\".innerLabel\").fadeOut( () => {\n\t\t\t$(\".innerLabel\").html(innerLabel);\n\t\t});\n\t\t$(\".innerText\").fadeOut( () => {\n\t\t\t$(\".innerText\").html(innerText);\n\t\t});\n\t\t$(\".innerLabel\").fadeIn();\n\t\t$(\".innerText\").fadeIn();\n}", "function setUpdateEvent(data){\n\t\tvar theID = '#' + data.doc._rev;\n\t\t$(theID).click(function(){\n\t\t\t$.each(jsonData.rows,function(i){\n\t\t\t\tif(jsonData.rows[i].doc._rev == data.doc._rev){\n\t\t\t\t\tmodal.style.display = \"block\";\n\t\t\t\t\tlocalStorage.setItem(\"currentQuestion\",data.doc._rev);\n\t\t\t\t\tdocument.getElementById('english-question').value=data.doc[\"english-question\"];\n\t\t\t\t\tdocument.getElementById('english-answer').value=data.doc[\"english-answer\"];\n\t\t\t\t\tdocument.getElementById('arabic-question').value=data.doc[\"arabic-question\"];\n\t\t\t\t\tdocument.getElementById('arabic-answer').value=data.doc[\"arabic-answer\"];\n\t\t\t\t\tdocument.getElementById('playing-frequency').value=data.doc[\"playing frequency\"];\n\t\t\t\t\tdocument.getElementById('video-type').value=data.doc[\"video-type\"];\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t})\n\t\t});\n}", "function switchtext(){\n\t\t$(\"h1\").html(\"jQuery Ninja\");\n\t\n\t}", "function updateButton() {\n const buttonIcon = this.paused ? '▶' : '❚ ❚';\n console.log(buttonIcon);\n toggle.textContent = buttonIcon;\n}", "function updateData(){\n\tcleanUp();\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clean up the environment\n\tmsg = $(\"#ptext\").val().toLowerCase();\t//Retrieve plaintext in lower case\n\tcip = $(\"#ctext\").val().toLowerCase();\t//Retrieve ciphertext in lower case\n\tkey = $(\"#kword\").val().toLowerCase();\t//Retrieve the keyword in lower case\n\tCLICK = 1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset algorithm stage indicator\n\tROW\t\t= -1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clear out the index for ROW\n\tCOL\t\t= -1;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Clear out the index for COL\n\tMSGIN\t= 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset the index of \"msg\" to start\n\tKEYIN\t= 0;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//Reset the index of \"key\" to start\n}", "function untravelledText(textID){\r\n if(textID!=null){\r\n document.getElementById(\"untravelledText\").innerHTML = jsonFile.roadsText[textID].text; \r\n } \r\n console.log('aaa'); document.getElementById(\"untravelledCover\").classList.toggle('untravelledTextActive');\r\n}" ]
[ "0.6906281", "0.6556035", "0.6529791", "0.6450783", "0.637052", "0.6315544", "0.62967503", "0.628318", "0.625214", "0.62003314", "0.6191188", "0.6124244", "0.6099167", "0.6099167", "0.6094342", "0.608985", "0.6072592", "0.605599", "0.6044063", "0.59991115", "0.59989", "0.596974", "0.5950315", "0.5941314", "0.5909287", "0.5895322", "0.5893451", "0.5886658", "0.5872016", "0.58623254", "0.58401006", "0.5831059", "0.58239067", "0.5823724", "0.580281", "0.5798005", "0.57901603", "0.57713467", "0.5766553", "0.5745948", "0.5733394", "0.572901", "0.57218224", "0.57149833", "0.57118505", "0.57115614", "0.57109046", "0.57060367", "0.57035464", "0.56909984", "0.5687646", "0.56836575", "0.5679074", "0.56753665", "0.5670837", "0.5669475", "0.56666887", "0.565758", "0.5646098", "0.5643924", "0.56429726", "0.56393445", "0.56365633", "0.5635646", "0.5626681", "0.56247044", "0.56240225", "0.5622897", "0.56124634", "0.56075376", "0.5607164", "0.56045794", "0.5599234", "0.55927175", "0.5589512", "0.5586997", "0.558574", "0.55849385", "0.5572701", "0.55624694", "0.55587107", "0.5551141", "0.5544323", "0.5544323", "0.5544323", "0.5541847", "0.554167", "0.55404264", "0.5532874", "0.55325246", "0.55301094", "0.55277777", "0.55199707", "0.5517891", "0.5517775", "0.55132276", "0.5503801", "0.55035555", "0.5500105", "0.5498335", "0.54933023" ]
0.0
-1
Create a TimeBlock record
function start(task_id, time, btn) { let text = JSON.stringify({ time_block: { start: time, end: null, task_id: task_id, convert: true }, }); $.ajax(time_block_path, { method: "post", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { TIME_ID = resp.data.id; set_time_link(task_id, "Start"); }, error: (resp) => { console.log(resp); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function generateTimeBlocks()\n {\n timeBlock.empty();\n\n console.log(startTime);\n console.log(endTime);\n\n for (let i=startTime; i<=endTime; i++)\n {\n let row = $(\"<div>\").addClass(\"row\").attr(\"data-time\", i);\n let timeEl = $(\"<div>\").addClass(\"col-1 hour\")\n let descriptionEl = $(\"<textarea>\").addClass(\"col-10 description\");\n let saveBtnEl = $(\"<button>\").addClass(\"col-1 saveBtn\").text(\"Save\");\n\n if(timeFormat === \"12\")\n {\n timeEl.text(moment({hour:i}).format(\"h a\"));\n }\n else\n {\n timeEl.text(moment({hour:i}).format(\"H:mm\"));\n }\n\n row.append(timeEl, descriptionEl, saveBtnEl);\n timeBlock.append(row);\n }\n updateCurrentTime();\n setPastPresent();\n getSavedEvents();\n }", "function TimeBlock(startS, endS) {\n this.freeTimes = []; // Array with elem i representing start + i*15(mins)\n this.start = strToDate(startS).roundDown15();\n this.end = strToDate(endS).roundUp15();\n \n for(var i=this.start.clone(); i.isBefore(this.end); i.addMinutes(15)) {\n this.freeTimes.push(FREE);\n }\n \n this.markBlocks = function(block, duration, markAs) {\n var blockIndex = getNumBlocks(this.start, block); // Get time difference in 15 min blocks\n var blocksToCheck = (duration / 15 + (duration % 15 > 0 ? 1 : 0)); // Round up duration to 15 min blocks\n for(var i = 0; i < blocksToCheck; i++) {\n this.freeTimes[i + blockIndex] = markAs;\n }\n }\n}", "function newTimeBlock(displayTime, timeOfDay, thisDate) {\n // console.log(displayTime);\n var eventID = timeOfDay + \"-\" + thisDate.format(\"YYYYMMDD\");\n var newBlock = $(\"<div>\").addClass(\"row time-block-row\");\n newBlock.append(($(\"<div>\")).addClass(\"col-2 time-of-day\"));\n newBlock.find('.time-of-day').append($(\"<div>\").addClass(\"hour-of-the-day\").html(displayTime));\n newBlock.find('.time-of-day').attr(\"id\", timeOfDay + \"-column\");\n newBlock.append(($(\"<div>\")).addClass(\"col-9 event-column\"));\n newBlock.find('.event-column').append($(\"<input>\").addClass('event-for-the-day'));\n newBlock.find(\".event-for-the-day\").attr(\"id\", eventID);\n newBlock.append(($(\"<div>\")).addClass(\"col-1 save-column\"));\n newBlock.find('.save-column').append($(\"<button>\").addClass('save-event').html('<i class=\"far fa-save\"></i>'));\n newBlock.find('.save-event').on(\"click\", function () { addCalendarEvent(eventID) });\n return newBlock;\n}", "function createTimerBlock() {\n for (var i = 0; i < day.length; i++) {\n var hour = day[i];\n var newTime = $(\"#template\").clone();\n newTime.removeAttr(\"id\");\n newTime.attr(\"data-time\", hour.mTime);\n newTime.find(\".hour\").text(hour.time);\n if (localCopy) {\n newTime.find(\"textarea\").val(hour.notes);\n }\n $(\".container\").append(newTime);\n }\n $(\"#template\").remove();\n }", "async addBlock (newBlock) {\n // previous block height\n let previousBlockHeight = parseInt(await this.getBlockHeight())\n // Block height\n newBlock.height = previousBlockHeight + 1\n // UTC timestamp\n newBlock.time = new Date()\n .getTime()\n .toString()\n .slice(0, -3)\n // previous block hash\n if (newBlock.height > 0) {\n let previousBlock = await this.getBlock(previousBlockHeight)\n newBlock.previousBlockHash = previousBlock.hash\n }\n // Block hash with SHA256 using newBlock and converting to a string\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString()\n\n // Adding block object to levelDB\n await this.addLevelDBData(newBlock.height, JSON.stringify(newBlock))\n\n // return the new block\n return newBlock\n }", "function setUpBlocks(start, end, thisDate) {\n // console.log(thisDate.format(\"M\"));\n for (var i = start; i <= end; i++) {\n var timeOfDay = i;\n var displayTime = timeOfDay;\n var suff = \"<span class='time-suffix'>a.m.</span>\";\n if (displayTime > 12) {\n displayTime -= 12;\n suff = \"<span class='time-suffix'>p.m.</span>\";\n }\n if (displayTime === 12) suff = \"<span class='time-suffix'>p.m.</span>\";\n\n // The id will be set to the time of day, 24-hour time\n\n // But the time will be displayed in 12-hour time\n displayTime = displayTime.toString() + \":00 \" + suff;\n // $(\"#displayTime-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate).attr(\"id\", timeOfDay));\n $(\"#time-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate));\n populateEventText(timeOfDay, thisDate);\n }\n}", "function timeAllot() {\n//I don't know why this only works if you iterate over it 25 times rather than 24. Otherwise, the very last block will not work.\n for(var i = 0; i < 25; i++) {\n timeBlocks[i] = {\n element: allRows[i],\n hour: i\n }\n }\n}", "function DateFromBlock(BlockNum)\r\n{\r\n var Str;\r\n var now=new Date(FIRST_TIME_BLOCK+BlockNum*1000);\r\n Str=now.toISOString();\r\n Str=Str.substr(0,Str.indexOf(\".\"));\r\n Str=Str.replace(\"T\",\" \");\r\n return Str;\r\n}", "function makeBlock(course, actName, slotCode, timeObj, paletteIndex) {\n\t// Avoid DOM manipulation, we will do it by HTML strings instead.\n\n\tvar html = '<div class=\"lesson_block palette-' + paletteIndex + '\" data-starttime=\"' + timeObj.start + '\" data-endtime=\"' + timeObj.end + '\" data-code=\"' + course.modCode + '\" data-slotcode=\"' + slotCode + '\" data-activity=\"' + actNameGetAbbr(actName) + '\">\n\t<span class=\"code\">' + course.modCode + ' </span>\n\t<span class=\"activity_code\">' + actNameGetAbbr(actName) + ' [' + slotCode + ']' + ' </span>\n\t<span class=\"venue\">' + timeObj.place + '</span>';\n\n\tif (isArray(timeObj.week)) html += '<span class=\"weeks\">Weeks ' + timeObj.join(',') + '</span>';\n\telse if (isNumber(timeObj.week) && timeObj.week > 0) html += '<span class=\"weeks\">' + (timeObj === 1 ? 'Odd' : 'Even') + ' Week</span>';\n\n\thtml += '</div>';\n\n\treturn html;\n}", "function create_time(t_id, startt){\n let text = JSON.stringify({\n timeblock: {\n starttb: startt,\n endtb: startt,\n task_id: t_id \n },\n });\n\n console.log(text)\n\n $.ajax(timeblock_path, {\n method: \"post\",\n dataType: \"json\",\n contentType: \"application/json; charset=UTF-8\",\n data: text,\n success: (resp) => { console.log(resp) },\n error: (resp) => { console.log(resp)},\n });\n}", "function buildTimeBlocks(hour){\n // Create and append row for time block\n let timeRowEl = $(\"<tr></tr>\")\n .attr(\"data-value\", hour)\n .addClass(`d-flex time-row ${hour}`);\n hourBlockBodyEl.append(timeRowEl);\n // Create and append hour column\n let hourColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"d-flex col-2 col-lg-1 justify-content-center align-items-center\")\n .text(moment(`${hour}`, \"h\").format(\"hA\"));\n timeRowEl.append(hourColumnEl);\n // Create and append task column\n let taskColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"col-8 col-lg-10\");\n let taskText = $(\"<textarea></textarea>\")\n .attr(\"type\", \"text\")\n .attr({\n \"data-toggle\":\"tooltip\",\n \"data-placement\": \"top\",\n \"title\": \"Enter tasks here\"\n })\n .addClass(\"d-flex form-control col-12 task-input\");\n taskColumnEl.append(taskText);\n timeRowEl.append(taskColumnEl);\n // Create and append save column\n let saveColumnEl = $(\"<td></td>\")\n .attr(\"scope\", \"col\")\n .addClass(\"d-flex col-2 col-lg-1 justify-content-center align-items-center\");\n let saveButtonEl = $(\"<button></button>\")\n .attr(\"type\", \"button\")\n .addClass(\"btn far fa-save fa-lg saveBtn\")\n .on(\"click\", saveTask);\n saveColumnEl.append(saveButtonEl); \n timeRowEl.append(saveColumnEl);\n}", "constructor(data){\n\t\tthis.hash = null; // Hash of the block\n\t\tthis.height = 0; // Block Height (consecutive number of each block)\n\t\tthis.body = Buffer.from(JSON.stringify(data)).toString('hex'); // Will contain the transactions stored in the block, by default it will encode the data\n\t\tthis.timeStamp = 0; // Timestamp for the Block creation\n\t\tthis.previousBlockHash = null; // Reference to the previous Block Hash\n }", "function create(baymaxReqObj) {\n\t\t\tvar params = processTimingParams(baymaxReqObj.result.parameters, {\n\t\t\t\tendTime : Date.now()\n\t\t\t});\n\t\t\treturn createRecord(params);\n\t\t}", "addBlock(){\r\n var previousBlock=this.getLatestBlock();\r\n var block = new Block(previousBlock.index+1,new Date(),this.current_transactions,previousBlock.hash); \r\n block.mineBlock(this.difficulty);\r\n this.chain.push(block);\r\n\r\n //clearing transactions that have been pushed to blockchain\r\n this.current_transactions=[];\r\n\r\n return block; //this will be used in web application to send info of block created to caller\r\n }", "function makeTimeBlocks() {\n var cal;\n //storedCal variable to pull from local and parse back into object\n var storedCal = JSON.parse(localStorage.getItem(\"myCalendar\"));\n //if cache is cleared, storedCal would be null, so return to defaultCalendar\n if (!storedCal) {\n storedCal = defaultCalendar;\n }\n if (storedCal) {\n cal = storedCal;\n }\n console.log(\"storedCal: \" + storedCal);\n console.log(\"cal: \" + cal);\n //compares each object in myCalendar array to determine AM/PM and set time block info\n cal.forEach(function (item, index) {\n var timeOfDay;\n var displayTime = item.time;\n //edge case at noon\n if (!item.morning && item.time !== 12) {\n displayTime = item.time - 12;\n } else if (item.time == 12) {\n displayTime = item.time;\n }\n if (item.morning) {\n timeOfDay = \" AM\";\n } else {\n timeOfDay = \" PM\";\n }\n\n var row = $(`<div id=${index} class=\"row\" />`).appendTo(\".container\");\n\n //Create left time block\n var leftBlock = $(\"<div />\", {\n text: displayTime + timeOfDay,\n }).appendTo(row);\n leftBlock.addClass(\"leftBlock\");\n\n // WHEN I click into a timeblock\n // THEN I can enter an event\n //Create middle input block and connect to object.notes\n var middleBlock = $(`<input />`, {\n id: item.time,\n text: item.notes,\n class: setTimeColor(item),\n }).appendTo(row);\n $(`#${item.time}`).attr(\"value\", item.notes);\n middleBlock.addClass(\"middleBlock\");\n\n //Create right save block\n var rightBlock = $(`<button class='saveBtn'><i class=\"fas fa-save\"></i></button>`).appendTo(row);\n rightBlock.addClass(\"rightBlock\")\n });\n\n }", "constructor({ timestamp, lastHash, individualHash, data, nonce, difficulty }) {\n // Create the block's information based on this block's arguments.\n\n this.timestamp = timestamp;\n this.lastHash = lastHash;\n this.individualHash = individualHash;\n this.data = data;\n this.nonce = nonce;\n this.difficulty = difficulty;\n }", "function getTimeById(blockId) {\n switch (blockId) {\n case 0:\n return \"9:00 am\";\n case 1:\n return \"10:00 am\";\n case 2:\n return \"11:00 am\";\n case 3:\n return \"12:00 pm\";\n case 4:\n return \"1:00 pm\";\n case 5:\n return \"2:00 pm\";\n case 6:\n return \"3:00 pm\";\n case 7:\n return \"4:00 pm\";\n case 8:\n return \"5:00 pm\";\n }\n \n}", "function newBlock()\n\t{\n\t\tif(nextBlock == null)\n\t\t\tnextBlock = new Block();\n\n\t\tcurrentBlock = nextBlock;\n\t\tcurrentBlock.x = currentBlock.y = 0;\n\t\tcurrentBlock.moveHor(Math.floor(self.numColumns/2));\n\t\tcurrentBlock.moveVer(-1);\n\n\t\tbgGrid.addChild(currentBlock);\n\n\t\tnextBlock = new Block();\n\t\tnextBlock.x = bgGrid.x + bgGrid.width + GAP;\n\t\tnextBlock.y = celwid * 2;\n\t\tself.addChild(nextBlock);\n\t\t\n\t\tspeedPoints = 0;\n\t\tupdateSpeedPoints();\n\n\t\tvar canPlace = validateNewBlockPosition();\n\t\tif(!canPlace)\n\t\t\tgameOverSequence();\n\t}", "function addTimeBlocks() {\n var timeDiv = $(\".container\");\n var times = [\n {\n value: \"9AM\",\n id: 9\n },\n {\n value: \"10AM\",\n id: 10\n },\n {\n value: \"11AM\",\n id: 11\n },\n {\n value: \"12PM\",\n id: 12\n },\n {\n value: \"1PM\",\n id: 13\n },\n {\n value: \"2PM\",\n id: 14\n },\n {\n value: \"3PM\",\n id: 15\n },\n {\n value: \"4PM\",\n id: 16\n },\n {\n value: \"5PM\",\n id: 17\n }\n ];\n // loop through array of times to populate the dom\n $.each(times, function (i, item) {\n // variables to create DOM elements\n var divRow = $(\"<div>\").attr(\"class\", \"row\").attr(\"id\", item.id);\n var divTimeCol = $(\"<div>\").attr(\"class\", \"col-sm-2 hour text-center\").text(item.value);\n var textareaCol = $(\"<textarea>\").attr(\"class\", \"col-sm-8 time-block\").attr(\"id\", item.id + \"TextArea\");\n var btnSaveCol = $(\"<button>\").attr(\"class\", \"col-sm-2 saveBtn\").attr(\"id\",item.id + \"SaveBtn\").html(\"<i class=\\\"far fa-save\\\"></i>\");\n // append the elements to the div row\n divRow.append(divTimeCol);\n divRow.append(textareaCol);\n divRow.append(btnSaveCol);\n // update classes based on time\n if(item.id < hour){\n divRow.attr(\"class\", \"row time-block past\");\n } else if (item.id > hour){\n divRow.attr(\"class\", \"row time-block future\");\n } else {\n divRow.attr(\"class\", \"row time-block present\");\n };\n // append previous elements to the DOM\n timeDiv.append(divRow);\n // populate any saved content\n $.each(savedContent,function(index, value){\n $(\"#\" + value.time + \"TextArea\").text(value.text);\n });\n });\n }", "createGenesisBlock(){\n return new Block(Date.parse(\"2018-03-18\"), [], \"0\");\n }", "generateStarterBlock(){\n let block = new Block(0,[],Date.now(),0)\n this.blockchain.push(block)\n }", "function makeBlock(statement) {\n return new Shift.BlockStatement({ block: new Shift.Block({ statements: [statement] }) });\n}", "function createNewBlock(noteIndex)\n{\n //reference the new block as the top block in its collumn\n topNoteBlocks[noteIndex] = document.createElement(\"div\");\n //set id and class for the div\n topNoteBlocks[noteIndex].id = \"block\" + noteIndex;\n topNoteBlocks[noteIndex].className = \"block\";\n //add the new block to the note area\n noteArea.appendChild(topNoteBlocks[noteIndex]);\n //position it correctly\n var rect = topNoteBlocks[noteIndex].getBoundingClientRect();\n var newLeft = rect.left + noteArea.offsetWidth * noteIndex / numberOfDifferentNotes;\n var newRight = rect.right + (1 + noteArea.offsetWidth * noteIndex) / numberOfDifferentNotes;\n topNoteBlocks[noteIndex].style.left = newLeft;\n topNoteBlocks[noteIndex].style.rigth = newRight;\n var newBottom = noteArea.getBoundingClientRect().bottom - fallDownSpeed;\n topNoteBlocks[noteIndex].style.bottom = newBottom;\n}", "addBlock(new_block){\n new_block.height = this.chain.length;\n new_block.time = new Date().getTime().toString().slice(0, -3);\n if (this.chain.length > 0) {\n new_block.prev_block = this.chain[this.chain.length-1].hash;\n }\n new_block.hash = SHA256(JSON.stringify(new_block)).toString();\n this.chain.push(new_block);\n }", "function createNewBlock() {\n\n // Create a new block object, and assign it to currentBlock.\n currentBlock = new Block(SHAPES_PATTERN[Math.floor(Math.random() * SHAPES_PATTERN.length)]);\n\n var i = 0;\n\n // Check dataBoard cells whether the positions of the new block are already occupied.\n while(i < currentBlock.currentRects.length){\n if(dataBoard[currentBlock.currentRects[i].y][currentBlock.currentRects[i].x] !== null) {\n // if yes terminate game.\n return gameOver();\n }\n i ++;\n }\n\n // if all cells are available, continue game. Map currentBlock into dataBoard cells.\n currentBlock.set();\n\n // Render dataBoard data as SVG DOM.\n stage.render();\n}", "constructor({index, previousHash, transactions, timestamp, id}){\n\n //index must always be provided, and must be a number\n if(typeof index == 'undefined'){\n throw new Error(\"index must be provided\")\n }\n else if(!Number.isInteger(index)){\n throw new Error(\"index must be an integer\")\n }\n\n //previous hash must always be provided, and must be a string\n if(typeof previousHash == 'undefined'){\n throw new Error(\"previousHash must be provided\")\n }\n else if(typeof previousHash !== 'string'){\n throw new Error('previousHash must be a string')\n }\n\n //transactions must always be provided, but will be either a string or an array of Transactions\n if(typeof transactions == 'undefined'){\n throw new Error(\"transactions must be provided\")\n }\n\n if(typeof id !== 'undefined'){\n if(typeof timestamp == 'undefined'){\n throw new Error(\"both timestamp and id must be provided for a de-serialised Block\")\n }\n }\n if(typeof timestamp !== 'undefined'){\n if((timestamp > 0) && (typeof id == 'undefined')){\n throw new Error(\"both timestamp and id must be provided for a de-serialised Block\")\n }\n }\n\n //It's a de-serialised block\n if(typeof id !== 'undefined' && typeof timestamp !== 'undefined' && timestamp > 0){\n if(typeof transactions !== 'string'){\n throw new Error(\"transactions must be stringified for a de-serialised Block\")\n }\n this.index = index\n this.timestamp = timestamp\n this.previousHash = previousHash\n this.transactions = transactions\n this.id = id\n }\n else if(timestamp == 0){ //it's a genesis block\n this.index = index\n this.timestamp = timestamp\n this.previousHash = previousHash\n this.transactions = transactions\n this.id = Block.createHash(this)\n }\n else{ //block to be created from stratch\n if(!Array.isArray(transactions)){\n throw new Error('transactions must be an array')\n }\n // if(transactions.length == 0){\n // throw new Error('transactions must be a non-empty array')\n // }\n let transactionsArray =[]\n for(let i=0; i< transactions.length; i++){\n if(transactions[i] instanceof Transaction);\n else throw new Error(\"transactions must of class Transaction\")\n\n if(!Transaction.validate(transactions[i]))\n throw new Error(\"Transaction \" + i + \" is not valid\")\n\n transactionsArray.push(transactions[i].serialize())\n }\n \n this.timestamp = Math.round((new Date().getTime()/1000))\n\n this.previousHash = previousHash\n this.transactions = JSON.stringify(transactionsArray)\n this.index = index\n this.id = Block.createHash(this)\n\n }\n\n //Final validation\n if(Block.validate(this)){\n //console.log(\"new BlocK :\" + JSON.stringify(this))\n return(this)\n }\n else throw new Error(\"block is invalid\")\n\n\n }", "function OneSecondTimerBlock()\r\n{\r\n this.objectName = \"OneSecondTimer\";\r\n\tthis.text=\"1 SEC TIMER\";\r\n\t//this.d=new Date();\r\n\tthis.isTiming = 0;\r\n\tthis.doneTiming=0;\r\n\tthis.startTime=0;\r\n\tthis.currentTime=0;\r\n\tthis.timerTime=0;\r\n}", "addABlock(newBlock) {\n newBlock.height = this.chain.length;\n newBlock.time = new Date()\n .getTime()\n .toString()\n .slice(0, -3);\n if (this.chain.length > 0) {\n newBlock.previousBlockHash = this.chain[this.chain.length - 1].hash;\n }\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n this.chain.push(newBlock);\n }", "static mineBlock(lastBlock,data){\n const timestamp = Date.now();\n const lastHash = lastBlock.hash;\n const hash = Block.hash(timestamp, lastHash, data);\n \n return new this(timestamp, lastHash, hash, data);\n }", "function createTimeSlots(){\n\tfor(var i = 0; i <= 6; ++i){\n\t\tfor (var j = 8; j < 24; ++j){\n\t\t\tdb.run(`insert into timeslots (day, startTime, endTime) values (?, ?, ?)`, [i, j, j+1]);\n\t\t}\n\t}\n}", "function createBlocksFromInput()\n{\n var d = new Date();\n input.forEach(function (value, index) {\n if (value) {\n if(d.getTime() - timeLastBlockAppeared[index] >= minTimeForNewBlock){\n //Create a new block, if a note is struck (if the note value was 0 before and is now !0)\n if (lastInput[index] == 0) {\n timeLastBlockAppeared[index] = d.getTime();\n createNewBlock(index);\n }\n } \n }\n //If the note started less than minTimeForNewBlock ago keep creating the note even if the value is 0 now\n if(d.getTime() - timeLastBlockAppeared[index] < minTimeForNewBlock){\n elongateTopNote(index);\n }\n lastInput[index] = value;\n })\n}", "function buildTimeSlot(hour) {\n // Here is the creation of the row with its necessary classes\n const $timeSlot = $(\"<div>\")\n .attr(\"id\", \"hour-\" + hour)\n .attr(\"class\", \"row time-block hour\");\n// Here is the label for the rows\n const $timeLabel = $(\"<div>\").attr(\"class\", \"col-md-1\");\n // This if statement helped create the labels correctly marking hour and and period \n if(hour > 12){\n $timeLabel.text(hour - 12 + \"PM\");\n }else if(hour === 12){\n $timeLabel.text(hour + \"PM\");\n }else {\n $timeLabel.text(hour + \"AM\");\n };\n // Here a text area was created to attatch our todo's\n const $textArea = $(\"<textarea>\").attr(\"class\", \"col-md-10 description\");\n// This if else is used in conjunction with css to apply backgrounds that will colorcode the block based on time\n if (hour <= currentTime) {\n $textArea.addClass(\"past\");\n } else if(hour === currentTime){\n $textArea.addClass(\"present\");\n } else if(hour >= currentTime) {\n $textArea.addClass(\"present\")\n }\n // This creates our save buttons at the end of each row\n const $btn = $(\"<button>\")\n .attr(\"class\", \"btn saveBtn col-md-1\")\n .append($(\"<i>\").attr(\"class\", \"fas fa-save\"))\n .data(\"block-hour\", hour);\n// This ties all of the creat elements together\n $timeSlot.append($timeLabel, $textArea, $btn);\n\n return $timeSlot;\n}", "function 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 }", "static mineBlock({ lastBlock, data }) {\n let hash, timestamp;\n const lastHash = lastBlock.hash;\n // destructure lastHash and difficulty from laste block\n let { difficulty } = lastBlock;\n let nonce = 0;\n\n //=================================================>\n // Sets the difficulty level\n //=================================================>\n do {\n nonce++;\n timestamp = Date.now();\n // re adjust the difficulty for each\n difficulty = Block.adjustDifficulty({\n originalBlock: lastBlock,\n timestamp\n });\n // Generates hash with data\n hash = cryptoHash(timestamp, lastHash, data, nonce, difficulty);\n } while (\n hexToBinary(hash).substring(0, difficulty) !== \"0\".repeat(difficulty)\n );\n // Create new block with the params\n return new this({\n timestamp,\n lastHash,\n hash,\n data,\n nonce,\n difficulty\n });\n }", "async storageBlock(newBlock) {\n await this.m_chainDB.BeginTranscation();\n let newHeaders = newBlock.toHeaders();\n\n let headerHash = newHeaders.hash('hex');\n let blockHash = newBlock.hash('hex');\n \n if (newHeaders.height === this.m_headerChain.getNowHeight() + 1) {\n await this.m_headerChain.addHeader(newHeaders);\n }\n await this.m_chainDB.CommitTranscation();\n\n this.m_blockStorage.add(newBlock);\n }", "createBlock(nonce, prev_hash) {\n\t\tlet block = {\n\t\t\tindex: this.chain.length + 1,\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tnonce: nonce,\n\t\t\tprev_hash: prev_hash,\n\t\t\ttransactions: this.mempool\n\t\t};\n\t\tthis.mempool = [];\n\t\tthis.chain.push(block);\n\t\treturn stringify(block);\n\t}", "function createBlock(type, nodes, props = {}) {\n if (!isArray(nodes)) {\n props = nodes;\n nodes = undefined;\n }\n\n // Ensure block nodes have at least one text child to conform to slate schema\n const children = isEmpty(nodes) ? [createText('')] : nodes;\n const node = { object: 'block', type, ...props };\n return addNodes(node, children);\n }", "static genesis(){\n // return a new instance of the this block class, with dummy data,\n // the dummy hash just reads first-hash\n // with an empty array for data\n return new this('Genesis time', '-----', 'f1r57-h45h', [], 0, DIFFICULTY);\n }", "function deltaTimeCreate(){\n\tthis.fullTime = new Date().getTime();\n\tthis.time = 0;\n\tthis.new = function(){\n\t\tthis.time = new Date().getTime() - this.fullTime;\n\t\tthis.fullTime += this.time;\n\t}\n}", "async addBlock(newBlock) {\n\t\tlet res = '';\n\t\t// Block height\n\t\tnewBlock.height = this.blockHeight + 1;\n\n\t\t// UTC timestamp\n\t\tnewBlock.time = new Date().getTime().toString().slice(0, -3);\n\n\t\t// previous block hash\n\t\tif (newBlock.height > 0) {\n\t\t\tconst prevBlock = await this.getBlockByHeight(this.blockHeight);\n\t\t\tnewBlock.previousBlockHash = prevBlock.hash;\n\t\t}\n\n\t\t// Block hash with SHA256 using newBlock and converting to a string\n\t\tnewBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\n\t\tthis.blockHeight = newBlock.height;\n\n\t\t// Adding block object to levelDB\n\t\tawait chaindb.addBlock(newBlock.height, JSON.stringify(newBlock)).then((result) => {\n\t\t\tres = result;\n\t\t}).catch(error => { res = error; });\n\n\t\treturn res;\n\t}", "addBlock(newBlock) {\n return new Promise(function(resolve, reject) {\n db.getBlocksCount().then((result) => {\n if (result == 0) {\n newBlock.previousBlockHash = \"\";\n newBlock.height = result;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n db.addDataToLevelDB(JSON.stringify(newBlock));\n resolve(newBlock);\n } else {\n db.getLevelDBData(result - 1).then((resultBlock) => {\n var lastDBblock = JSON.parse(resultBlock);\n var PH = lastDBblock.hash;\n newBlock.previousBlockHash = PH;\n newBlock.height = result;\n newBlock.time = new Date().getTime().toString().slice(0, -3);\n newBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n db.addDataToLevelDB(JSON.stringify(newBlock));\n resolve(newBlock);\n }).catch(function(err) {\n reject(err);\n })\n }\n }).catch(function(err) {\n reject(err);\n })\n })\n\n }", "newBlock(blockNumber) {\n console.log(\"Block added \" + blockNumber);\n $(\"#addBlockResult\").text(blockNumber);\n }", "function Block(start, end) {\n this.start = start;\n this.end = end;\n}", "createGenesisBlock(){\n return new Block(\"01/02/2000\",\"\",\"0\")\n }", "addBlock(data){\n let newBlock = new Block(this.getLatestBlock().index +1 , data, this.getLatestBlock().hash);\n this.mineBlock(this.difficulty, newBlock); \n this.chain.push(newBlock); \n }", "function drawTimeBlocks() {\n timeline.selectAll('.block').remove();\n const groupAll = timeline.selectAll('.block').data(currentDayParts);\n const groupAllEnter = groupAll.enter().append('g') // enter elements as groups [1]\n .attr('class', 'block');\n groupAllEnter.append('rect');\n groupAllEnter.select('rect')\n .attr('width', d => scaleX(d.end.toDate()) - scaleX(d.beginning.toDate()))\n .attr('x', d => scaleX(d.beginning.toDate()))\n .attr('y', config.svg.margin.y)\n .attr('height', config.bar.height)\n .attr('fill', d => colorScale(d.label))\n .attr('opacity', '0.3');\n }", "postNewBlock() {\n let self = this;\n this.app.post(\"/api/block\", (req, res) => {\n let blockData = req.body.data;\n let block = new Block.Block(blockData);\n self.myBlockChain.addBlock(block)\n .then((block) => {\n res.send(block)\n })\n .catch((err) => {\n res.send(\"Error creating block: \" + err);\n })\n });\n }", "function createRecord(type, data) {\n var header = new Buffer(5);\n header[0] = type;\n header[1] = 0x03;\n header[2] = 0x03; // Explicitly used TLS1.2\n header.writeUIntBE(data.length, 3, 2);\n return Buffer.concat([header, data]);\n}", "postNewBlock() {\n let self = this;\n self.app.post(\"/block\", (req, res) => {\n let address = req.body.address;\n\n if (!address || address.trim().length == 0) {\n res.status(400).send({ 'error': \"Invalid adress\" });\n return;\n }\n\n let validAddress = self.mempool.searchValidAdressByWallet(address);\n if (!validAddress || !validAddress.status.messageSignature) {\n res.status(400).send({ 'error': \"Invalid message signature\" });\n return;\n }\n\n let RA = req.body.star.ra;\n let DEC = req.body.star.dec;\n let MAG = req.body.star.mag;\n let CEN = req.body.star.cen;\n\n if (!RA || !DEC) {\n res.status(400).send({ 'error': \"Required RA and DEC\" });\n return;\n }\n\n let body = {\n address: req.body.address,\n star: {\n ra: RA,\n dec: DEC,\n mag: MAG,\n cen: CEN,\n story: Buffer.from(req.body.star.story, \"ascii\").toString('hex')\n }\n };\n let newBlock = new Block(body);\n\n self.blockchain.addBlock(newBlock).then((result) => {\n let block = JSON.parse(result);\n \n res.status(201).send(block);\n }).catch((err) => {\n console.error(err.stack);\n res.status(500).send({ 'error': 'Unexpected error occurred' });\n });\n });\n }", "createGenesisBlock(){\n return new Block(Date.now(), [], '0');\n }", "function createBlock() {\n // 1) create element: document.createElement(\"div\")\n const currentBlock = document.createElement('div')\n // grab the last bloc element (of class)\n const previousBlock = document.querySelector('.block:last-of-type')\n // 2) Set width from previous bloc, height, margin and class\n currentBlock.classList.add('block')\n currentBlock.classList.add('new-block')\n currentBlock.style.width = `${previousBlock.offsetWidth}px`\n // currentBlock.style.left = `${previousBlock.offsetWidth}px`\n // 3) Set color: using hsl, hue + 10 * score\n currentBlock.style.background = `hsl(${254 + 10 * currentScore}, 60%, 35%)`\n // 4) append child block to the container (gameArea)\n gameArea.appendChild(currentBlock)\n return currentBlock\n}", "static mineBlock(lastBlock, data) {\n\n // number of milliseconds that passed from a certin point\n // in history\n const lastHash = lastBlock.hash;\n let { difficulty } = lastBlock;\n let nonce = 0;\n let hash, timestamp;\n\n do {\n nonce++;\n timestamp = Date.now();\n // since adjusting the difficulty is based on the previous\n // block we need the lastBlock difficulty and the current \n // timestamp to generate a new difficulty \n difficulty = Block.adjustDifficulty(lastBlock, timestamp) ;\n hash = Block.hash(timestamp, lastHash, data, nonce, difficulty);\n } while (hash.substring(0, difficulty) !== '0'.repeat(difficulty));\n\n return new this(timestamp, lastHash, hash, data, nonce, difficulty);\n }", "addBlock(data,callback){\n\t\tvar newBlock = new Block(data);\n\t\tvar _this = this;\n\t\tthis.getBlockHeight(function(height) {\n\t\t\tvar newHeight;\n\t\t\tif (height == null) {\n\t\t\t\tnewHeight = 0;\n\t\t\t} else {\n\t\t\t\tnewHeight = parseInt(height, 10) + 1;\n\t\t\t}\n\t\t\tnewBlock.height = newHeight;\n\t\t\t// UTC timestamp\n\t\t\tnewBlock.time = new Date().getTime().toString().slice(0,-3);\n\t\t\tnewBlock.address = data.address;\n\t\t\tconsole.log(newHeight);\n\t\t\t// previous block hash\n\t\t\tif(newHeight>0){\n\t\t\t\tvar previousHashHeight = newHeight-1;\n\t\t\t\t_this.getBlock(previousHashHeight, function(block) {\n\t\t\t\t\tvar previousHash = block.hash;\n\t\t\t\t\tnewBlock.previousBlockHash = previousHash;//this.chain[this.chain.length-1].hash;\n\t\t\t\t\tnewBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\t\t\t\t\tdb.put('height', newHeight, function (err) {\n\t\t\t\t\t\tif (err) return console.log('getBlockHeight Error: ', err) // some kind of I/O error\n\t\t\t\t\t\tdb.put(newHeight.toString(), JSON.stringify(newBlock), function (err) {\n\t\t\t\t\t\t\tif (err) return console.log('Ooopsa!', err) // some kind of I/O error\n\t\t\t\t\t\t\tcallback(newBlock);\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// Block hash with SHA256 using newBlock and converting to a string\n\t\t\t\tnewBlock.hash = SHA256(JSON.stringify(newBlock)).toString();\n\t\t\t\t// Adding block object to chain\n\t\t\t\t// this.chain.push(newBlock);\n\t\t\t\tdb.put('height', 0, function (err) {\n\t\t\t\t\tif (err) return console.log('getBlockHeight Error: ', err) // some kind of I/O error\n\t\t\t\t\tdb.put(\"0\", JSON.stringify(newBlock), function (err) {\n\t\t\t\t\t\tif (err) return console.log('Ooopsa!', err) // some kind of I/O error\n\t\t\t\t\t\tcallback(newBlock);\n\t\t\t\t\t})\n\t\t\t\t})\n\t\t\t}\n\t\t});\n }", "addGenesisBlock(){\r\n let genBlock = new BlockClass.Block(\"First block in the chain - Genesis block\");\r\n genBlock.time = new Date().getTime().toString().slice(0,-3);\r\n genBlock.previousBlockHash = '';\r\n genBlock.hash = SHA256(JSON.stringify(genBlock)).toString();\r\n // Add Genesis block to the chain. The block height 0 is used as the key.\r\n this.chain.addLevelDBData(0, JSON.stringify(genBlock).toString()).then((value) => {\r\n if(value){\r\n console.log(`Genesis block created`);\r\n }else{\r\n console.log(`Error adding Genesis block to chain`);\r\n }\r\n });\r\n }", "function makeTime(ms) {\n // make time object with undefined properties\n const tm = new Thyme();\n // this function sets all time properties\n tm.setTime(ms);\n return tm;\n}", "function makeSimpleBlock(data) {\n var flags = 0;\n if (data.keyframe)\n flags |= 128;\n if (data.invisible)\n flags |= 8;\n if (data.lacing)\n flags |= (data.lacing << 1);\n if (data.discardable)\n flags |= 1;\n if (data.trackNum > 127) {\n throw \"TrackNumber > 127 not supported\";\n }\n var out = [data.trackNum | 0x80, data.timecode >> 8, data.timecode & 0xff, flags].map(function(e) {\n return String.fromCharCode(e)\n }).join('') + data.frame;\n return out;\n }", "newBlock(proof, previousHash) {\n const block = {\n index: this.chain.length + 1,\n timeStamp: new Date(),\n transactions: this.current_transactions,\n proof,\n previousHash,\n };\n this.current_transactions = [];\n this.chain.push(block);\n return block;\n }", "function TimeProposal (date, time) {\n this.date = date;\n this.time = time;\n this.id = Meteor.uuid();\n}", "function Block(blockType, id, startLine) {\r\n this.lines = [startLine];\r\n this.id = id;\r\n this.type = blockType;\r\n this.reset = false;\r\n}", "function initializeTimeBlocks() {\n\n timeBlocks.each(function () {\n\n var thisBlock = $(this);\n var thisBlockHr = parseInt(thisBlock.attr(\"data-hour\"));\n\n //add style to time blocks to show where we are in the day\n if (thisBlockHr == currentHour) {\n thisBlock.addClass(\"present\");\n\n }\n if (thisBlockHr < currentHour) {\n thisBlock.addClass(\"past\");\n\n }\n if (thisBlockHr > currentHour) {\n thisBlock.addClass(\"future\");\n }\n\n });\n\n }", "createGenesisBlock() {\n return new Block(Date.parse(\"2021-01-01\"), [], \"0\");\n }", "constructor (time, nl) {\n this.time = time;\n this.nl = nl;\n }", "constructor (data) {\n // Block data model\n this.hash = \"\",\n this.height = 0,\n this.prev_block = \"\",\n this.time = 0,\n this.body = data\n }", "create (block) {\n if (!block.size) {\n // return empty\n return emptyBlockTree();\n }\n\n let leafs = [];\n let leaf = {start: 0, end: -1};\n let start = 0;\n let previousStyle = block.getCharacterList().first().get('style');\n\n block.getCharacterList().forEach(function (ch) {\n if (start === block.getCharacterList().size - 1) {\n leaf.end = start + 1;\n leafs.push(new LeafRecord(leaf));\n }\n\n if (ch.get('style') !== previousStyle) {\n leaf.end = start;\n leafs.push(new LeafRecord(leaf));\n leaf = {start: start, end: -1};\n previousStyle = ch.get('style');\n }\n start += 1;\n });\n\n return list.of(new BlockTreeRecord({\n leafs: list(leafs)\n }));\n }", "function createTimeTrigger(type){\n var selector = document.getElementById(\"w\");\n w = selector.options[selector.selectedIndex].value;\n h = document.getElementById('h').value;\n m = document.getElementById('m').value;\n\n operation = h.toString() + ':' + m.toString() + ':' + w.toString();\n\n if(active_parent_id != \"triggers\"){\n var new_id = Date.now();\n task.triggers[new_id] = {\n \"type\": 'time',\n \"parent\": active_parent_id,\n \"operation\": operation\n }\n task.triggers[active_parent_id].operation.push(new_id.toString())\n } else {\n task['triggers']['trigger'] = {\n \"type\": 'time',\n \"parent\": \"triggers\",\n \"operation\": operation\n };\n }\n\n loadTask()\n $('#d2Assitant').modal('hide')\n}", "function generateBlock(blockType,blockId){\n var blockObj;\n //--------BASIC blocks\n if(blockType === \"text_b\")\n blockObj = new TextBlock(blockId,globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"title_b\")\n blockObj = new TitleBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"image_b\"){\n blockObj = new ImageBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n blockObj.checkImageExist();\n }\n else if(blockType === \"image_text_b\"){\n blockObj = new ImageTextBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n blockObj.checkImageExist();\n }\n else if(blockType === \"button_b\")\n blockObj = new ButtonBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"gallery_b\"){\n blockObj = new GalleryBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n blockObj.checkImagesExist();\n }\n else if(blockType === \"map_b\")\n blockObj = new MapsBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n //--------STRUCTURE blocks\n else if(blockType === \"column_b\")\n blockObj = new ColumnBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"divider_b\")\n blockObj = new DividerBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n //--------AJAX blocks\n else if(blockType === \"ajax_content_b\"){\n blockObj = new AjaxContentBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n blockObj.getAjaxBlockContents();\n }\n //--------MEDIA blocks\n else if(blockType === \"pdf_b\")\n blockObj = new PdfBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"youtube_b\")\n blockObj = new YoutubeBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"social_icons_b\")\n blockObj = new SocialIconsBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n else if(blockType === \"code_b\")\n blockObj = new CodeBlock(blockId, globalOptions.gen_block_class, \"#\" + $(this).attr(\"id\"));\n\n genBlocksList.push(blockObj);\n\n return blockObj;\n}//generateBlock", "newBlock(proof, previousHash = null) {\n const block = {\n 'index': this.chain.length,\n 'timestamp': Date.now(),\n 'transactions': [...this.currentTransactions],\n proof,\n 'previousHash': previousHash || Blockchain.hash(this.lastBlock)\n };\n\n this.currentTransactions = [];\n this.chain.push(block);\n\n return block;\n }", "buildObject() {\n // build array of objects (based on input arguments [start,end, interval])\n for (var i = 0; i < this.totalTimeSlots; i++) {\n // add blank object\n this.data.push({})\n // populate object\n this.data[i] = {\n description: '',\n slotStart: this.timeCalc(0,i),\n slotEnd: this.timeCalc(1,i),\n slotDuration: this.timeSlotDuration,\n get viewState() {\n let timeDiff = (() => moment().diff(this.slotStart, 'm'))()\n if (timeDiff < 0) return 'future';\n else if (timeDiff >= 0 && timeDiff < 60) return 'present';\n else return 'past';\n }\n }\n }\n }", "createGenesisBlock(){\r\n\r\n return new Block(0, \"01/01/2019\",\"Genesis block\",\"0\");\r\n }", "function makeSimpleBlock(data){\n\t\tvar flags = 0;\n\t\tif (data.keyframe) flags |= 128;\n\t\tif (data.invisible) flags |= 8;\n\t\tif (data.lacing) flags |= (data.lacing << 1);\n\t\tif (data.discardable) flags |= 1;\n\t\tif (data.trackNum > 127) {\n\t\t\tthrow \"TrackNumber > 127 not supported\";\n\t\t}\n\t\tvar out = [data.trackNum | 0x80, data.timecode >> 8, data.timecode & 0xff, flags].map(function(e){\n\t\t\treturn String.fromCharCode(e)\n\t\t}).join('') + data.frame;\n\n\t\treturn out;\n\t}", "createGenesisBlock() {\n return new Block(\n \"01/01/2020\", \n []\n )\n }", "function makeData() {\n\n durationSeconds = parseInt(document.getElementById(\"duration\").value) * 60;\n\n time = new Date().toISOString();\n time = time.substr(0, time.length - 5);\n //console.log(request);\n time = time + \"+00:00\";\n description = document.getElementById(\"goal\").value;\n console.log(description);\n\n time_entry = {\n \"time_entry\": {\n \"description\": description,\n \"created_with\": \"API example code\",\n \"start\": time.toString(),\n \"duration\": durationSeconds,\n \"wid\": wid\n }\n };\n\n time_entry = JSON.stringify(time_entry);\n return time_entry\n }", "createGenesisBlock(){\n return new Block(\"18/05/2018\", {amount:\"Genesis Block\"}, \"0\");\n }", "function addBlock() {\n var index = Math.floor(Math.random() * (7));\n\n var name = blockNames[index];\n var blocktype = blocks[index]\n var center = centers[index];\n var pos = [20, 0];\n center[0] += 20;\n curBlock = new Block(blocktype, name, center, pos);\n\n //add to grid\n for (var k = 0; k < blocktype.length; k++) {\n for (var l = 0; l < blocktype[0].length; l++) {\n grid[k + 20][l] = blocktype[k][l];//start from 20th row\n }\n }\n\n\n}", "function ScheduleBlock(props){\n let schedule = props.currPlan.schedules[props.currSchedule].split(\";\");\n let blocks = days.map((element,index)=>{\n let i = 0;\n for(i=0; i<schedule.length - 2; i++){ //loop over the sections for the schedule\n if(schedule[i] === \"\"){\n continue;\n }\n let info = props.state.dict[schedule[i]];\n //-------parsing the times\n let sDays = info.days.split('');\n let j = 0;\n for(j = 0; j<sDays.length;j++){\n if(sDays[j] == 'M'){\n sDays[j] = 'Monday'\n }\n else if(sDays[j] == 'T'){\n sDays[j] = 'Tuesday'\n }\n else if(sDays[j] == 'W'){\n sDays[j] = 'Wednesday'\n }\n else if(sDays[j] == 'R'){\n sDays[j] = 'Thursday'\n }\n else if(sDays[j] == 'F'){\n sDays[j] = 'Friday'\n }\n }\n let startTime = info.start.split(':');\n let endTime = info.end.split(':');\n let currTime = props.time.split(\":\");\n let startH = Number(startTime[0]);\n let endH = Number(endTime[0]);\n\n //----------------\n //console.log(startH)\n //console.log(currTime[0]);\n if(startH == currTime[0] && Number(startTime[1]) >= Number(currTime[1]) && Number(startTime[1]) < Number(currTime[1]) + 30){ //check if any sections have a start time matching the current row's time range\n if(sDays.indexOf(element) > -1){//if time matches, check which day\n if(endH > Number(currTime[0]) && Number(endTime[1]) >= Number(currTime[1])+30) // if 2 hours long, make the block 4 rows\n {\n return(\n <Table.Cell className={info.available.toString()} rowSpan='4' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n else if(endH > Number(currTime[0])) // if longer than an hour, make the block 3 rows\n {\n return(\n <Table.Cell className={info.available.toString()} rowSpan='3' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n else{\n return(\n <Table.Cell className={info.available.toString()} rowSpan='2' key={props.time + element}>\n <p className=\"sectionName\">{info.courseName}</p>\n <p className=\"sectionID\">{info.sectionId}</p>\n <p className=\"sectionTime\">{info.start}-\n {info.end}</p>\n </Table.Cell>\n )\n }\n\n\n\n }\n\n }\n //check if the block is two rows so we can avoid adding a block in that spot\n else if(endH == currTime[0] && Number(endTime[1]) >= Number(currTime[1]) && startH <= Number(currTime[0])){\n if(sDays.indexOf(element) > -1) {\n return;\n }\n }\n else if(endH > Number(currTime[0]) && startH <= Number(currTime[0])){\n if(sDays.indexOf(element) > -1) {\n return;\n }\n }\n }\n //if no matches, just return an empty cell\n return(\n <Table.Cell key={props.time + element}>\n\n </Table.Cell>\n\n )\n })\n\n\n return(\n <Table.Row>\n <Table.Cell rowSpan='1'>{props.time}</Table.Cell>\n {blocks}\n </Table.Row>\n\n )\n\n}", "_createBlockNew(prevBlock, height, minerAddress, transactions, args){\n\n //validate miner Address\n\n args.unshift( this.blockchain, minerAddress, transactions, undefined, undefined );\n let data = new this.blockDataClass(...args);\n\n return new this.blockClass( this.blockchain, 1, undefined, prevBlock.hash, undefined, 0, data, height, this.db);\n }", "constructor(index, timestamp, data, previousHash = '') {\n this.index = index;\n this.timestamp = timestamp;\n this.data = data;\n this.previousHash = previousHash;\n this.hash = this.calculateHash(); // calculates hash based on information contained in the block\n}", "createBlock(x, y, power) {\n\n\t\t// Make the blocks stay in bounds\n\t\tthis.allblocks[x][y].position.y = BlockHeight/2;\n\t\t\n\t\tif(this._engine.gameover){\n\t\t\tthis.textpanel.text = \"GAMEOVER! Your Score: \" + this.player.height;\n\t\t\tthis.bgm.stop();\n\t\t\tthis.highscoremusic.play();\n\t\t}\n\t\tif(power){\n\t\t\tif(this._engine.isPowerUP){\n\t\t\t\tthis.allblocks[x][y].material = this.powblockm;\n\t\t\t}else{\n\t\t\t\tthis.allblocks[x][y].material = this.foodblockm;\n\t\t\t}\n\t\t}else{\n\t\t\tthis.allblocks[x][y].material = this.pblockm;\n\t\t}\t\n\t\tthis.blocks.push(this.allblocks[x][y]);\n\t}", "function newRecord(type){\n return {\n type: type,\n prefix: '',\n postfix: '',\n value: '',\n attributes: [],\n children: [],\n values: [],\n parent: null\n };\n}", "constructor(date, transactions, previousHash = '') {\n console.log(date);\n let month = date.getUTCMonth() + 1;\n let date1 = date.getUTCDate();\n let year = date.getUTCFullYear();\n this.timestamp = date1 + \"/\" + month + \"/\" + year;\n this.transactions = transactions;\n this.previousHash = previousHash;\n //hash:contains hash on this block\n this.hash = this.calculateHash();\n //nonce:for block difficulty\n this.nonce = 0;\n }", "createRecord(data) {\n let columnClass = this.modelClass;\n\n if (data.type) {\n columnClass = ColumnStore.getColumnClass(data.type);\n if (!columnClass) throw new Error(this.L('columnTypeNotFound', data));\n }\n\n if (data.locked) {\n data.region = 'locked';\n delete data.locked;\n }\n\n const column = new columnClass(data, this);\n\n // Doing this after construction, in case the columnClass has a default value for region (Schedulers\n // TimeAxisColumn has)\n if (!column.data.region) {\n column.data.region = this.grid ? this.grid.defaultRegion : 'normal'; // Some ColumnStore tests lacks Grid\n }\n\n return column;\n }", "function createNewBlock(name) {\n\t\t\t\tvar node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();\n\n\t\t\t\tif (name || parentBlockName == \"TABLE\") {\n\t\t\t\t\tblock = dom.create(name || newBlockName);\n\t\t\t\t\tsetForcedBlockAttrs(block);\n\t\t\t\t} else {\n\t\t\t\t\tblock = parentBlock.cloneNode(false);\n\t\t\t\t}\n\n\t\t\t\tcaretNode = block;\n\n\t\t\t\t// Clone any parent styles\n\t\t\t\tif (settings.keep_styles !== false) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (textInlineElements[node.nodeName]) {\n\t\t\t\t\t\t\t// Never clone a caret containers\n\t\t\t\t\t\t\tif (node.id == '_mce_caret') {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclonedNode = node.cloneNode(false);\n\t\t\t\t\t\t\tdom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\n\n\t\t\t\t\t\t\tif (block.hasChildNodes()) {\n\t\t\t\t\t\t\t\tclonedNode.appendChild(block.firstChild);\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcaretNode = clonedNode;\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} while ((node = node.parentNode));\n\t\t\t\t}\n\n\t\t\t\t// BR is needed in empty blocks on non IE browsers\n\t\t\t\tif (!isIE) {\n\t\t\t\t\tcaretNode.innerHTML = '<br data-mce-bogus=\"1\">';\n\t\t\t\t}\n\n\t\t\t\treturn block;\n\t\t\t}", "function setStartTime(state, level, time) {\n state.levels[level].startTime = time;\n return state;\n}", "function create(element, position, width, height, float,){\n // Initialize block and creates \n let block = document.createElement(element);\n // Sets the position to static\n block.style.position = position;\n // Sets the width to be defined later\n block.style.width = width; \n // Sets the height to be defined later\n block.style.height = height;\n // Sets the float to be defined later\n block.style.float = float;\n // Returns block\n return block;\n}", "async _mineBlockWithPendingTxs(blockTimestamp) {\n const parentBlock = await this.getLatestBlock();\n const headerData = {\n gasLimit: this.getBlockGasLimit(),\n coinbase: this.getCoinbaseAddress(),\n nonce: \"0x0000000000000042\",\n timestamp: blockTimestamp,\n };\n const blockBuilder = await this._vm.buildBlock({\n parentBlock,\n headerData,\n blockOpts: { calcDifficultyFromHeader: parentBlock.header },\n });\n try {\n const traces = [];\n const blockGasLimit = this.getBlockGasLimit();\n const minTxFee = this._getMinimalTransactionFee();\n const pendingTxs = this._txPool.getPendingTransactions();\n const txHeap = new TxPriorityHeap_1.TxPriorityHeap(pendingTxs);\n let tx = txHeap.peek();\n const results = [];\n const receipts = [];\n while (blockGasLimit.sub(blockBuilder.gasUsed).gte(minTxFee) &&\n tx !== undefined) {\n if (tx.gasLimit.gt(blockGasLimit.sub(blockBuilder.gasUsed))) {\n txHeap.pop();\n }\n else {\n const txResult = await blockBuilder.addTransaction(tx);\n traces.push(await this._gatherTraces(txResult.execResult));\n results.push(txResult);\n receipts.push(txResult.receipt);\n txHeap.shift();\n }\n tx = txHeap.peek();\n }\n const block = await blockBuilder.build();\n await this._txPool.updatePendingAndQueued();\n return {\n block,\n blockResult: {\n results,\n receipts,\n stateRoot: block.header.stateRoot,\n logsBloom: block.header.bloom,\n receiptRoot: block.header.receiptTrie,\n gasUsed: block.header.gasUsed,\n },\n traces,\n };\n }\n catch (err) {\n await blockBuilder.revert();\n throw err;\n }\n }", "static mineBlock ( payload ){\n console.log(`Mining Block`)\n return new Promise((resolve, reject) => {\n let hash;\n let lastBlock = DB.transactionLastBlock();\n //payload.id = uuid();\n do {\n payload.created_at = Date.now()\n payload.nonce = CRPYTO.randomBytes(16).toString('base64');\n payload.difficulty = Block.adjustDifficulty(payload, lastBlock);\n //console.log('DIFFICULTY: ', payload.difficulty)\n payload.lastHash = lastBlock.hash\n hash = CryptUtil.hash(payload, payload.difficulty, payload.nonce);\n }while( HexToBin(hash).substr(0, payload.difficulty) !== '0'.repeat(payload.difficulty))\n let block = {\n payload : payload,\n hash\n }\n //Broadcast the new block\n global.node.broadcast.write(JSON.stringify({channel:'block', payload:block}))\n resolve(DB.transactionPutBlock(block));\n })\n \n \n }", "function createNewBlock(name) {\n\t\t\t\tvar node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();\n\n\t\t\t\tif (name || parentBlockName == \"TABLE\") {\n\t\t\t\t\tblock = dom.create(name || newBlockName);\n\t\t\t\t\tsetForcedBlockAttrs(block);\n\t\t\t\t} else {\n\t\t\t\t\tblock = parentBlock.cloneNode(false);\n\t\t\t\t}\n\n\t\t\t\tcaretNode = block;\n\n\t\t\t\t// Clone any parent styles\n\t\t\t\tif (settings.keep_styles !== false) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (textInlineElements[node.nodeName]) {\n\t\t\t\t\t\t\t// Never clone a caret containers\n\t\t\t\t\t\t\tif (node.id == '_mce_caret') {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclonedNode = node.cloneNode(false);\n\t\t\t\t\t\t\tdom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\n\n\t\t\t\t\t\t\tif (block.hasChildNodes()) {\n\t\t\t\t\t\t\t\tclonedNode.appendChild(block.firstChild);\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcaretNode = clonedNode;\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} while ((node = node.parentNode) && node != editableRoot);\n\t\t\t\t}\n\n\t\t\t\t// BR is needed in empty blocks on non IE browsers\n\t\t\t\tif (!isIE) {\n\t\t\t\t\tcaretNode.innerHTML = '<br data-mce-bogus=\"1\">';\n\t\t\t\t}\n\n\t\t\t\treturn block;\n\t\t\t}", "function createNewBlock(name) {\n\t\t\t\tvar node = container, block, clonedNode, caretNode, textInlineElements = schema.getTextInlineElements();\n\n\t\t\t\tif (name || parentBlockName == \"TABLE\") {\n\t\t\t\t\tblock = dom.create(name || newBlockName);\n\t\t\t\t\tsetForcedBlockAttrs(block);\n\t\t\t\t} else {\n\t\t\t\t\tblock = parentBlock.cloneNode(false);\n\t\t\t\t}\n\n\t\t\t\tcaretNode = block;\n\n\t\t\t\t// Clone any parent styles\n\t\t\t\tif (settings.keep_styles !== false) {\n\t\t\t\t\tdo {\n\t\t\t\t\t\tif (textInlineElements[node.nodeName]) {\n\t\t\t\t\t\t\t// Never clone a caret containers\n\t\t\t\t\t\t\tif (node.id == '_mce_caret') {\n\t\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tclonedNode = node.cloneNode(false);\n\t\t\t\t\t\t\tdom.setAttrib(clonedNode, 'id', ''); // Remove ID since it needs to be document unique\n\n\t\t\t\t\t\t\tif (block.hasChildNodes()) {\n\t\t\t\t\t\t\t\tclonedNode.appendChild(block.firstChild);\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcaretNode = clonedNode;\n\t\t\t\t\t\t\t\tblock.appendChild(clonedNode);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} while ((node = node.parentNode) && node != editableRoot);\n\t\t\t\t}\n\n\t\t\t\t// BR is needed in empty blocks on non IE browsers\n\t\t\t\tif (!isIE) {\n\t\t\t\t\tcaretNode.innerHTML = '<br data-mce-bogus=\"1\">';\n\t\t\t\t}\n\n\t\t\t\treturn block;\n\t\t\t}", "function generateBlock() {\r\n\tvar blockGen = document.createElement('div');\r\n\tblockGen.className = 'active-block';\r\n\tblockGen.style.background = generateBackgroundColor();\r\n\tstartingPoz.appendChild(blockGen);\r\n\tnextAvailableCell = getnextAvailableCell(DIR.down, xAxis.default);\r\n\r\n\tsetThePositions(startingRow, startingColl, startingRow, startingColl);\r\n\r\n\treturn blockGen;\r\n}", "static create(deadline, mosaic, duration, signedTransaction, networkType) {\n return new LockFundsTransaction(networkType, 3, deadline, UInt64_1.UInt64.fromUint(0), mosaic, duration, signedTransaction);\n }", "function generateBlocks(){\n for(let i = 9; i<18 ;i++){\n $(\".container\").append(`\n <div class=\"row time-block\">\n <h2 class=\"hour col-2\">${i<12 ? i+\":00AM\" : i>12? i-12+\":00PM\" : \"12:00PM\"}</h2>\n <textarea class=\"description col-8 ${i>hour ? \"future\" : i<hour ? \"past\" : \"present\"}\" type=\"text\">${todo[i] || \"\"}</textarea>\n <button id=\"${i}\" class=\"saveBtn col-2\">Save</button>\n </div>`)\n }\n}", "function createTimeElementsArea(editNode, file)\n{\n halfContainer = $(\"<div class='halfContainer'></div>\");\n editNode.append(halfContainer);\n elementType = [\"Tag\", \"Quote\"];\n ii = 0;\n file.find(\".halfContainer\").children().each( function () {\n displayHalf = $('<div class=\"' + this.className + '\"></div>');\n halfContainer.append(displayHalf);\n displayHalf.append('<span class=\"displaySubheader\">' + elementType[ii] + 's:</span>');\n timeElementContainer = $('<div class=\"timeElementContainer\"></div>');\n displayHalf.append(timeElementContainer);\n populateTimeElementContainer(displayHalf, file, elementType[ii]);\n displayHalf.append('<a class=\"textTimeEdit\" href=\"#createTE\" onclick=\"plusTimeElementClick(this, false)\">+' + elementType[ii] + '</a><div class=\"textTimeEditSeperator\"></div>');\n displayHalf.append('<a class=\"textTimeEdit\" href=\"#createTE\" onclick=\"plusTimeElementClick(this, true)\">+' + elementType[ii] + ' at current time</a><div class=\"textTimeEditSeperator\"></div>');\n ii++;\n });\n}", "postNewBlock() {\n\t\tthis.app.post(\"/block\", async (req, res) => {\n\t\t\t// Read the request body data\n\t\t\tvar rBody = req.body.body;\n\n\t\t\t// Is the request body empty?\n\t\t\tif (rBody == undefined || rBody == \"\") {\n\t\t\t\t// block data missing\n\t\t\t\tconsole.log('ERROR: block data is missing; check your request and try again');\n\t\t\t\tres.status(400).send({ error: 'block data is missing; check your request and try again' });\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Create a new Block\n\t\t\tvar tBlock = new Block;\n\t\t\ttBlock.body = rBody; // Set the Block data\n\n\t\t\t// Add block to the blockchain\n\t\t\tvar rBlock = await this.blockchain.addBlock(tBlock);\n\n\t\t\t// Write informational console messages\n\t\t\tconsole.log('INFO: just created a new block with data:', rBlock);\n\n\t\t\t// Return to the caller\n\t\t\tres.status(200).json(rBlock);\n\t\t});\n\t}", "createGenesisBlock(){\n\t\treturn new Block(\"01/01/2018\", [new Transaction('x','x',0)], \"0\");\n\t}", "startRecord(state, data){\n state.record = data\n state.recordStartTime = Date.now()\n }", "static mineBlock(lastBlock, data) {\n \tconst lastHash = lastBlock.hash;\n let hash, timestamp;\n let nonce = 0;\n let { difficulty } = lastBlock;\n\n // Proof of work\n do {\n nonce++;\n timestamp = Date.now();\n // Recalculate the difficulty\n difficulty = this.adjustDifficulty(lastBlock, timestamp);\n\n hash = Block.hash(timestamp, lastHash, data, nonce, difficulty);\n\n // Until the DIFFICULTY first number of zeros match hash\n } while(hash.substring(0, difficulty) !== '0'.repeat(difficulty));\n\n return new this(timestamp, lastHash, hash, data, nonce, difficulty);\n }", "createGenesisBlock(){\r\n return new Block(0,'28/12/2017','this is genesis block','100');\r\n }", "function drawNewBlock() {\r\n \r\n do {\r\n var coords = generateCoords();\r\n var X = coords[0];\r\n var Y = coords[1];\r\n } while (blockDistanceChecker(X, Y));\r\n\r\n var block = new Map();//------reffered from W3------//\r\n block.set(\"X\", X);\r\n block.set(\"Y\", Y);\r\n block.set(\"width\", block_width);\r\n block.set(\"height\", block_height);\r\n\r\n blocks.push(block);\r\n}", "async generateBlock(keypair, timestamp, transactions = []) {\n\t\tthis._shouldNotBeActive();\n\t\tthis._isActive = true;\n\t\ttry {\n\t\t\tconst block = await this.blocksProcess.generateBlock(\n\t\t\t\tthis._lastBlock,\n\t\t\t\tkeypair,\n\t\t\t\ttimestamp,\n\t\t\t\ttransactions,\n\t\t\t);\n\t\t\tthis._lastBlock = await this.blocksProcess.processBlock(\n\t\t\t\tblock,\n\t\t\t\tthis._lastBlock,\n\t\t\t\tvalidBlock => this.broadcast(validBlock),\n\t\t\t);\n\t\t} catch (error) {\n\t\t\tthis._isActive = false;\n\t\t\tthrow error;\n\t\t}\n\t\tawait this._updateBroadhash();\n\t\tthis._updateLastReceipt();\n\t\tthis._updateLastNBlocks(this._lastBlock);\n\t\tthis.emit(EVENT_NEW_BLOCK, { block: cloneDeep(this._lastBlock) });\n\t\tthis._isActive = false;\n\t\treturn this._lastBlock;\n\t}", "function createTimeEntry(api, worklog) {\n return ({ story, user }) =>\n api.mavenlink.post('/api/v1/time_entries.json', {\n time_entry: {\n date_performed: worklog.updatedAt,\n notes: worklog.comment,\n time_in_minutes: worklog.timeSpentSeconds / 60,\n user_id: user.id,\n story_id: story.id,\n workspace_id: story.workspace_id\n }\n });\n}", "newSchedule() {\n const\n startHour = 9,\n endHour = 17;\n \n let\n currentHour = startHour,\n schedule = {\n date: moment().format(\"YYYY-MM-DD\"),\n events: []\n };\n \n while (currentHour <= endHour) {\n let currentMoment = moment({hour: currentHour});\n\n schedule.events.push({\n hourBlock: parseInt(currentMoment.format(\"H\")),\n hourBlockDisplay: currentMoment.format(\"ha\"),\n event: null\n });\n\n currentHour++;\n }\n\n return schedule;\n }" ]
[ "0.645287", "0.64223707", "0.6391443", "0.63826853", "0.60701", "0.5992058", "0.5990356", "0.59520876", "0.58780956", "0.5817659", "0.5809999", "0.5726878", "0.5718676", "0.56982756", "0.56401026", "0.5627112", "0.5622484", "0.55665857", "0.5541021", "0.5536146", "0.5532674", "0.55237645", "0.55185115", "0.55177814", "0.55145943", "0.550876", "0.5506679", "0.5466555", "0.5435318", "0.54340667", "0.54304945", "0.5425581", "0.5421561", "0.54059386", "0.5389748", "0.53754854", "0.53646195", "0.5364072", "0.5361774", "0.53588974", "0.5351083", "0.53442854", "0.53324425", "0.5332261", "0.532866", "0.53284585", "0.53115904", "0.5310598", "0.5305292", "0.5303874", "0.52991635", "0.52925265", "0.5289489", "0.52851593", "0.5262631", "0.52563316", "0.5255296", "0.5254236", "0.52350795", "0.52300584", "0.521931", "0.5218386", "0.5216055", "0.5208104", "0.52069443", "0.52004516", "0.5195415", "0.5188474", "0.5186728", "0.51753736", "0.5175053", "0.51711917", "0.5162652", "0.51603657", "0.51578426", "0.5157473", "0.5156112", "0.5141692", "0.51358235", "0.51187897", "0.5117902", "0.5111238", "0.5110924", "0.51089454", "0.51054394", "0.5104109", "0.5103926", "0.5103926", "0.50981843", "0.50908566", "0.50857586", "0.5084745", "0.508358", "0.508328", "0.5083266", "0.5082748", "0.50823873", "0.5079543", "0.50779784", "0.50741124", "0.50698525" ]
0.0
-1
Update a time block
function end(task_id, time) { if (TIME_ID == "") { alert("You haven't started the task yet."); } else { let text = JSON.stringify({ time_block: { start: START_TIME, end: time, convert: true }, }); $.ajax(time_block_path + "/" + TIME_ID, { method: "put", dataType: "json", contentType: "application/json; charset=UTF-8", data: text, success: (resp) => { set_time_link(task_id, "End"); }, error: (resp) => { console.log(resp); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "function updateTime() {\n\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 let updatedTime = new Date().toLocaleTimeString();\n setTime(updatedTime);\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 }", "update(t){\n if (this.lastFrameTime == undefined) {\n this.lastFrameTime = t;\n return;\n }\n\n this.checkKeys();\n\n this.updateElements(t);\n\n this.lastFrameTime = t;\n }", "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 updateTime() {\n const newTime = new Date().toLocaleTimeString();\n setTime(newTime);\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 }", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\n }", "_onTimeupdate () {\n this.emit('timeupdate', this.getCurrentTime())\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 update() {\n clock += change();\n render();\n }", "function timeUpdate() {\n (setInterval(function () {\n currentTime = moment().format('HH');\n updatePlanner()\n }, 1000))\n}", "updateTime() {\n\t\tthis.setState({\n\t\t\ttime: hrOfDay(),\n\t\t\tday: timeOfDay()\n\t\t});\n\t}", "update(timeStep) {\n\n }", "function updateTime() {\n var time = 0;\n if (global.startTime != null) {\n time = (new Date()).getTime() - global.startTime;\n time = (time/1000)|0;\n }\n var timeDiv = document.getElementById(\"timeDisplay\");\n timeDiv.innerHTML = formatTime(time);\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}", "updateTime() {\n\t\tlet now = new Date().getTime();\n\t\tlet x = now - this.startTime;\n\t\tlet time = moment.duration(x);\n\t\tthis.elapsedTime = clc.xterm(242)(time.hours() + 'h ') + clc.xterm(242)(time.minutes() + 'm ') + clc.xterm(242)(time.seconds() + 's');\n\t}", "function updateTime() {\n console.log(\"updateTime()\");\n store.timeModel.update();\n}", "function updateTime(s, m, h) {\n\tseconds = s;\n\tminutes = m;\n\thours = h;\n}", "function updateTime(){\n const { time } = _DotGameGlobal;\n const curr = Date.now();\n time.deltaTime = (curr - time.currTime) / 1000;\n time.currTime = curr;\n}", "function hourUpdater() {\n // grabs the current time\n var currentHour = moment().hours();\n \n // cycles through the time blocks and adjusts the css\n $(\".time-block\").each(function() {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n \n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n } \n else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n } \n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "function updateTime() {\n const now = moment();\n const ourTime = now.format('MMMM Do YYYY, h:mm:ss a');\n // Print the time into the element that we set to clock\n clock.text(ourTime);\n}", "_update() {\n // Get time now\n const time = zbTime.getNow();\n\n // If there is a current time\n if (this._currentTime) {\n // If nothing has changed then stop here\n if (this._currentTime.hour === time.hour && this._currentTime.minute === time.minute) return;\n }\n\n // Update current time\n this._currentTime = time;\n\n // Set show 24 hour clock\n let show24HourClock = false;\n\n // If there is a show 24 hour clock attribute\n if (this.hasAttribute('show24hour') === true) {\n // Set to show 24 hour clock\n show24HourClock = true;\n }\n\n // Set hour\n let hour = time.hour;\n\n // If showing 12 hour clock and over 12 hours\n if (show24HourClock === false && hour > 12) {\n // Minus 12 hours\n hour -= 12;\n }\n\n // Set digit numbers\n let digit1Number = Math.floor(hour / 10);\n const digit2Number = hour % 10;\n const digit3Number = Math.floor(time.minute / 10);\n const digit4Number = time.minute % 10;\n\n // If showing 12 hour clock and digit 1 number is zero\n if (show24HourClock === false && digit1Number === 0) {\n // Set the digit 1 number so that it hides the number\n digit1Number = -1;\n }\n\n // Set the digit lines\n this._setDigitLines(this._digit[0], digit1Number);\n this._setDigitLines(this._digit[1], digit2Number);\n this._setDigitLines(this._digit[2], digit3Number);\n this._setDigitLines(this._digit[3], digit4Number);\n\n // If 12 hour clock shown\n if (show24HourClock === false) {\n // If AM\n if (this._currentTime.hour < 12) {\n // Show AM\n this._amChildDomElement.className = 'ampm-child ampm-on';\n this._pmChildDomElement.className = 'ampm-child ampm-off';\n } else {\n // Show PM\n this._amChildDomElement.className = 'ampm-child ampm-off';\n this._pmChildDomElement.className = 'ampm-child ampm-on';\n }\n }\n }", "function updateTime(time) {\n domVideo.currentTime = time;\n}", "function updateTime() {\n element.text(dateFilter(new Date(), format, dateformat));\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "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() {\n element.text(dateFilter(new Date(), format));\n }", "function timedUpdate () {\n updateLocalClock();\n newCityTz();\n setTimeout(timedUpdate, 1000);\n}", "function updateTime() {\n\t element.text(dateFilter(new Date(), format));\n\t }", "update() {\n this.time++;\n }", "function updateTime() {\n element.text(dateFilter(new Date(), format));\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 updateTime() {\n element.text(dateFilter(new Date(), format));\n }", "set time(value) {}", "refreshTime() {\n if (this._game.isRun()) {\n this._view.setValue(\"time\", this._game.timeElapsed);\n }\n }", "function update_clock(time)\r\n{\r\n clock_time = time;\r\n document.getElementById('clock').innerHTML = hh_mm_ss(time);\r\n check_old_records(time);\r\n}", "increaseTime(t) {\n this.currentTime += t;\n this.timeElement.textContent = this.currentTime;\n }", "update() {\n if (this.time_now >= this.time_target) {\n this.randomize();\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 3000);\n }\n this.time_now = Date.now();\n }", "function updateTimer(time) {\n iOSClockTimer = time;\n}", "function updateTimer(time) {\n iOSClockTimer = time;\n}", "function updateWatch() {\n updateTime();\n }", "async updateTimebar() {\n this.timeText = await this.time.getCurrentTime();\n this.tag('Time').patch({ text: { text: this.timeText } });\n }", "function updateTime(nTime){\n // function to update time\n var showTime=\"\";\n var h=Math.floor(nTime/3600);\n var m=Math.floor(nTime/60-h*60);\n var s=Math.floor(nTime%60);\n //console.log(h);\n //console.log(m);\n //console.log(s);\n if(h!=0){\n if(h<10)\n showTime+=\"0\"+h.toString();\n else\n showTime+=h.toString();\n }\n else\n showTime+=\"00\";\n if(m!=0){\n showTime+=\":\";\n if(m<10)\n showTime+=\"0\"+m.toString();\n else\n showTime+=m.toString();\n }\n else\n showTime+=\":00\";\n if(s!=0){\n showTime+=\":\";\n if(s<10)\n showTime+=\"0\"+s.toString();\n else\n showTime+=s.toString();\n }\n else\n showTime+=\":00\";\n\n $('#time').text(showTime);\n }", "function timeUpdate() {\n //check current \n var currentHour = moment().hour();\n\n//added time block full length\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"hour\")[1]);\n\n// loop - compare current time to time block to determing past, present, or future\n\n //check if hour is in the past\n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //check if hour is in the present \n else if (blockHour === currentHour) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n $(this).removeClass(\"future\");\n }\n //check if hour is in the future\n else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n })\n}", "function updateTime() {\n time -= 1000;\n showTime(); \n}", "increaseTime(time) {\n return this.sendAsync(\"evm_increaseTime\", [time])\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 update() {\n $(\"#currentT-input\").html(moment().format(\"H:mm:ss\"));\n}", "function updateTimeEveryMinute() {\n time.increment();\n flipClock(time.copy());\n setTimeout(updateTimeEveryMinute, 60000);\n }", "function setTime() {\n\t\tseconds += 500;\n\t}", "function UpdateClock() {\n if (!timeStore == \"\") {\n var newTime = new Date(timeStore);\n newTime.setSeconds(newTime.getSeconds() + 1);\n var formatttedTime = FormatTime(newTime);\n\n if (isNewTime === 0) {\n timeStore = newTime;\n }\n document.getElementById(\"output\").innerHTML = formatttedTime;\n\n\n isNewTime = 0;\n }\n\n setTimeout(UpdateClock, 1000);\n\n}", "function updateTime() {\r\n element.text(dateFilter(new Date(), format));\r\n }", "function updateTime() {\n\tlet curTime = Date.now();\n\t//divide by 1,000 to get deltaTime in seconds\n deltaTime = (curTime - prevTime) / 1000;\n //cap deltaTime at ~15 ticks/sec as below this threshhold collisions may not be properly detected\n if (deltaTime > .067) {\n \tdeltaTime = .067;\n }\n prevTime = curTime;\n totalTime += deltaTime;\n}", "update() {\n this.setState(prevState => {\n let remaining = prevState.endTime - Date.now();\n if (remaining > 0) {\n let offset = remaining % 1000;\n this.timeout = setTimeout(() => this.update(), offset);\n let totalSecs = Math.ceil(remaining / 1000);\n let hours = Math.floor(totalSecs / 60 / 60);\n let minutes = Math.floor(totalSecs / 60) % 60;\n let seconds = totalSecs % 60;\n return {\n display: this._formatTime(hours, minutes, seconds),\n lastOffset: (remaining % 1000) - 1000\n };\n } else {\n return {\n ended: true,\n display: this._formatTime(0, 0, 0)\n };\n }\n });\n }", "function updateTimeDisplay(newTime) {\n $(\".timer\").text(time);\n time = newTime;\n}", "function updateTime() {\n const date = new Date();\n const hours = date.getHours() >= 10 ? date.getHours() : \"0\" + date.getHours();\n const min =\n date.getMinutes() >= 10 ? date.getMinutes() : \"0\" + date.getMinutes();\n const sec =\n date.getSeconds() >= 10 ? date.getSeconds() : \"0\" + date.getSeconds();\n timeNav.textContent = hours + \":\" + min + \":\" + sec;\n}", "function updateClock() {\n // get element to update time\n let datetime = document.querySelector(\"#datetime\");\n // get time now\n //let _timeNow = moment(new Date());\n let _timeNow = moment();\n // set current time on screen\n datetime.textContent = _timeNow.format('dddd, MMMM Do YYYY, HH:mm:ss');\n // update train times every minute\n if (_timeNow.format('ss') == '00') {\n updateTimes();\n }\n}", "function updateTime() {\r\n const date = new Date();\r\n const hour = formatTime(date.getHours());\r\n const minutes = formatTime(date.getMinutes());\r\n const seconds = formatTime(date.getSeconds());\r\n\r\n display.innerText=`${hour} : ${minutes} : ${seconds}`\r\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}", "updateTime() {\r\n if (this.state == STATES.play) {\r\n if (this.remain === 0) {\r\n return this.winner();\r\n }\r\n this.time += 0.1; \r\n this.htmlScore.innerHTML = (this.mines-this.flags) +\r\n \" / \" + this.mines + \" \" + this.time.toFixed(1);\r\n }\r\n }", "function updatetime() {\n time.innerHTML = new Date;\n \n}", "updateCurrentMSecs () {\n this.currentMSecs = Date.now();\n }", "update(dt) {\n\n }", "function updateTimeLinePosition(newTime){\n\tvar newPos = newTime * TIME_UNIT_SIZE;\n\t$(\"#currentFrameLine\").css({left:Math.round(newPos)});\n}", "function update_time()\n{\n\ttime.timer++;\n\ttime.x += 2;\n\ttime.w -= 2;\n}", "function updatehour() {\r\n var currenthour = moment().hours()\r\n $(\".time-block\").each(function () {\r\n //splitting the hour-11 id with the \"-\"\r\n //as the delimiter, and focusing on the\r\n //number (hour) based on its position \r\n //after transforming it into an array\r\n var blockhour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\r\n if (blockhour < currenthour) {\r\n //turn it grey\r\n $(this).addClass(\"past\")\r\n } else if (blockhour === currenthour) {\r\n //remove the grey and apply red\r\n $(this).removeClass(\"past\")\r\n $(this).addClass(\"present\")\r\n } else {\r\n //remove the grey and red, apply the green\r\n $(this).removeClass(\"past\")\r\n $(this).removeClass(\"present\")\r\n $(this).addClass(\"future\")\r\n }\r\n })\r\n\r\n }", "function updateTime() {\n let m = String(new Date().getMinutes());\n let h = String(new Date().getHours());\n if (h.length == 1) {\n h = \"0\" + h;\n }\n if (m.length == 1) {\n m = \"0\" + m;\n }\n var time = h + \":\" + m;\n document.getElementById(\"time\").innerHTML = time;\n}", "updateTime () {\n const time = moment().utc().format(timeFormat).toString();\n this.setState({ currentTime: time });\n }", "setTime(time) {\n this.time.setTime(time);\n }", "function updateTimer() {\n //console.log(currentTime);\n formatTimeDuration(currentTime);\n var timeString = formatTime(currentTime);\n $stopwatch.html(timeString);\n currentTime += incrementTime;\n }", "function updateTime() {\n let currentTime = moment().format('MMM DD, YYYY  hh:mm:ss A');\n\n // Only if the dev console time div exists should this function loop\n if($('#dev-console-time').length) {\n // set the content of the element with the ID time to the formatted string\n $('#dev-console-time').text(currentTime);\n // call this function again in 1000ms\n setTimeout(updateTime, 1000);\n }\n}", "function updateTime() {\n var nowTime = moment().format('LTS');\n $(\"#currentTime\").html(nowTime);\n}", "update(time, delta) {\n }", "function updateWatchTime(){\n\t\tif(currentPlayerVideo){\n\t\t\tif (timerNamespace.getWatchTime() > 0) {\n\t\t\t\t//post per aggiornare watchtime del video\n\t\t\t\tconsole.log(timerNamespace.getWatchTime());\n\t\t\t\t$.post(\"/watchTime\",{\n\t\t\t\t\tvideo: getCurrentPlayerId(),\n\t\t\t\t\ttime: timerNamespace.getWatchTime()\n\t\t\t\t}).done((data)=>{\n\t\t\t\t\tconsole.log(\"watch time updated\");\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function TimeBlock(startS, endS) {\n this.freeTimes = []; // Array with elem i representing start + i*15(mins)\n this.start = strToDate(startS).roundDown15();\n this.end = strToDate(endS).roundUp15();\n \n for(var i=this.start.clone(); i.isBefore(this.end); i.addMinutes(15)) {\n this.freeTimes.push(FREE);\n }\n \n this.markBlocks = function(block, duration, markAs) {\n var blockIndex = getNumBlocks(this.start, block); // Get time difference in 15 min blocks\n var blocksToCheck = (duration / 15 + (duration % 15 > 0 ? 1 : 0)); // Round up duration to 15 min blocks\n for(var i = 0; i < blocksToCheck; i++) {\n this.freeTimes[i + blockIndex] = markAs;\n }\n }\n}", "update(timeDifference) {\n if (this.paused) {\n return;\n }\n this.planets.forEach((planet) => planet.update(timeDifference));\n }", "function hourUpdater(){\n var currentHour = moment().hour();\n $('.time-block').each(function(){\n var blockHour = parseInt($(this).attr('id').split('-')[1]);\n if(blockHour < currentHour){\n $('.description').addClass('past');\n } else if (blockHour === currentHour){\n $('.description').addClass('present');\n }else{\n $('.description').addClass('future');\n }\n })\n}", "function updateTime() {\n //Fetch the state from the main class\n let state = ipcRenderer.sendSync('state');\n\n let left = state.time_left;\n if (!state.paused) left -= new Date().getTime() - state.status_changed;\n\n document.getElementById(\"timeleft\").textContent = formatTime(left);\n}", "update(t) {\n if (this.vehicle.time == 0) {\n this.vehicle.deltaTime = 0;\n this.vehicle.time = t;\n }\n else {\n this.vehicle.deltaTime = t - this.vehicle.time;\n this.vehicle.time = t;\n }\n \n for(var i = 0; i < 5; i++){\n if(this.supplies[i].time == 0){\n this.supplies[i].deltaTime = 0;\n this.supplies.time = t;\n }\n else{\n this.supplies[i].deltaTime = t - this.supplies[i].time;\n this.supplies[i].time = t; \n }\n }\n\n this.checkKeys();\n this.vehicle.update(t);\n\n for(var i = 0; i < 5; i++){\n if(this.supplies[i].state == this.supplies[i].SupplyStates.FALLING)\n this.supplies[i].update(t);\n }\n\n this.billboard.update();\n \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}", "updateRemainingTime() {\n\n this.callsCounter++;\n //cada 25 llamadas, quito un segundo\n if (this.callsCounter % 25 == 0) {\n if (this.time.seconds == 0) {\n this.time.minutes -= 1;\n this.time.seconds = 60;\n }\n this.time.seconds -= 1;\n }\n //Se activa el hurryUp\n if (this.callsCounter == this.hurryUpStartTime) {\n this.hurryUpTime = true;\n }\n //Se llama al metodo cada 5 llamadas \n if (this.callsCounter >= this.hurryUpStartTime\n && this.callsCounter % 5 == 0) {\n this.hurryUp();\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 updateTime() {\n var delta = (new Date().getTime() / 1000) - catalog.mtime;\n if (delta > 300) {\n clearInterval(pulseInterval);\n pulseInterval = setInterval(updateTime, 60000);\n }\n document.getElementById('updated').innerHTML = fc.getDuration(delta, true);\n }", "function updateWatch() {\n updateTime();\n updateDate(0);\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 }", "tick() {\n let prevSecond = this.createDigits(this.vDigits(this.timeString()));\n\n this.checkAlarm();\n\n setTimeout(() => {\n this.get();\n this.update(cacheDOM.timeDisplay, this.createDigits(this.vDigits(this.timeString())), prevSecond);\n this.tick();\n }, 1000)\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 setUpBlocks(start, end, thisDate) {\n // console.log(thisDate.format(\"M\"));\n for (var i = start; i <= end; i++) {\n var timeOfDay = i;\n var displayTime = timeOfDay;\n var suff = \"<span class='time-suffix'>a.m.</span>\";\n if (displayTime > 12) {\n displayTime -= 12;\n suff = \"<span class='time-suffix'>p.m.</span>\";\n }\n if (displayTime === 12) suff = \"<span class='time-suffix'>p.m.</span>\";\n\n // The id will be set to the time of day, 24-hour time\n\n // But the time will be displayed in 12-hour time\n displayTime = displayTime.toString() + \":00 \" + suff;\n // $(\"#displayTime-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate).attr(\"id\", timeOfDay));\n $(\"#time-block-section\").append(newTimeBlock(displayTime, timeOfDay, thisDate));\n populateEventText(timeOfDay, thisDate);\n }\n}", "function updateTime(distance){\n //calculate minutes and seconds from the milliseconds\n let seconds = Math.floor((distance % (1000 * 60)) / 1000);\n let minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));\n\n //edit label text\n timeLabel.text = `${minutes}:${seconds}`;\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 }", "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 }", "function hourUpdate(){\n var currentHour = (moment().hours());\n console.log($(\".time-block\"));\n $(\".time-block\").each(function () {\n var blockHour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\n console.log(\"test\")\n \n if (blockHour < currentHour) {\n $(this).addClass(\"past\");\n \n }\n\n else if (blockHour === currentHour) {\n $(this).addClass(\"past\");\n $(this).addClass(\"present\");\n }\n\n else{\n $(this).addClass(\"past\");\n $(this).addClass(\"present\");\n $(this).addClass(\"future\");\n }\n \n });\n\n}", "setTime(time) {\n this.time = time;\n this.fieldsComputed = false;\n this.complete();\n }", "function timeupdate() {\n var lastBuffered = video.buffered.end(video.buffered.length-1);\n seekbar.min = video.startTime;\n seekbar.max = lastBuffered;\n seekbar.value = video.currentTime;\n $('#timer').html(formatTime(video.currentTime));\n if(review == true)\n {\n\t sk.min = video.startTime;\n\t sk.max = lastBuffered;\n\t sk.value = video.currentTime;\n\t reviewText();\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 fastForward(time) {\n web3.currentProvider.send({\n jsonrpc: '2.0',\n method: 'evm_increaseTime',\n params: [ time ],\n });\n\n web3.currentProvider.send({\n jsonrpc: '2.0',\n method: 'evm_mine',\n });\n\n return getLastBlockTimestamp();\n}", "function updateClock()\n{\n currentGame.clockTime++;\n let clockString = currentGame.clockTime.toString();\n currentGame.clockBlock.innerHTML = clockString.padStart(3, '0');\n}" ]
[ "0.73860586", "0.7151051", "0.6931225", "0.6910901", "0.68208736", "0.6799126", "0.6751489", "0.6722952", "0.6714556", "0.6646582", "0.6646582", "0.6643334", "0.66131854", "0.6612657", "0.6588057", "0.6539627", "0.6524335", "0.651179", "0.65029097", "0.6486211", "0.64763856", "0.64484894", "0.6443128", "0.642411", "0.6406527", "0.63987", "0.63949", "0.63831264", "0.63831264", "0.63586485", "0.6354698", "0.6353931", "0.6346458", "0.6342506", "0.63316536", "0.63296646", "0.6322506", "0.63168377", "0.62831396", "0.62814814", "0.627532", "0.62723017", "0.6269148", "0.6269148", "0.6264889", "0.6262678", "0.6261875", "0.6259038", "0.6252367", "0.62309164", "0.62235934", "0.6211516", "0.62092793", "0.6199543", "0.61959237", "0.6188534", "0.6169207", "0.61640656", "0.61623526", "0.6154024", "0.61534405", "0.6145846", "0.6134344", "0.6107176", "0.61060953", "0.6104989", "0.60987395", "0.60898185", "0.60823786", "0.6080135", "0.6079827", "0.606691", "0.6062456", "0.60617185", "0.6054429", "0.6052297", "0.6049616", "0.6032062", "0.6027669", "0.60198635", "0.6010784", "0.6008166", "0.6003715", "0.59962666", "0.59959406", "0.5983382", "0.5983256", "0.59828293", "0.59793055", "0.59715307", "0.5971075", "0.5962802", "0.5949443", "0.5943463", "0.5934833", "0.5923409", "0.5916779", "0.5916061", "0.59102565", "0.5906395", "0.5904026" ]
0.0
-1
Initialize sanitation processes to clean up sheets and instantiate properties
function init() { resetScript(); if (!saveAndTestSheets()) // break if sheets invalid return; let pointsSheet = new PointsSheet().sheet; let summarySheet = pointsSheet.getSheets()[0]; let membersRef = summarySheet.getRange(`${POINTS_FIELD.FIRST_NAME}3:${POINTS_FIELD.LAST_NAME}${summarySheet.getLastRow()}`); cleanMemberNames(membersRef); saveMemberKeys(membersRef); setTriggers(); runAllTests(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "newPropertiesSheet() {\n this.properties_sheet = new InstanceProperties(this.artefact)\n }", "_initializeProperties() {}", "newPropertiesSheet() {\n this.properties_sheet = new MysqlDatabaseSystemProperties(this.artefact)\n }", "function initializeSpreadsheet() {\n var ui = SpreadsheetApp.getUi();\n var response = ui.alert('Do you want to initalize this sheet?', 'That will completely erase every sheet on this document.', ui.ButtonSet.OK_CANCEL);\n if (response != ui.Button.OK) {\n return;\n }\n Logger.log(SpreadsheetApp.getActiveSpreadsheet().getSheets());\n if (SpreadsheetApp.getActiveSpreadsheet().getSheetName() == 'Results' || SpreadsheetApp.getActiveSpreadsheet().getSheetName() == 'Approved clients' || SpreadsheetApp.getActiveSpreadsheet().getSheetName() == 'User data' || SpreadsheetApp.getActiveSpreadsheet().getSheetName() == 'Advanced output') {\n var response = ui.alert('You\\'re already set up!', 'If you\\'d like to re-initialize the sheet, press OK below.', ui.ButtonSet.OK_CANCEL);\n if (response != ui.Button.OK) {\n return;\n } else {\n SpreadsheetApp.getActiveSpreadsheet().getSheetByName('Results').activate();\n var currentSheets = SpreadsheetApp.getActiveSpreadsheet().getSheets();\n for (var i = 0; i < (currentSheets.length -= 1); i++)\n SpreadsheetApp.getActiveSpreadsheet().deleteSheet(currentSheets[i])\n }\n }\n\n\n var readingSpreadSheet = SpreadsheetApp.openById('1STQQAHvW9Re4vmFnHRnu6PVjX5TfdUFUVaH8jDba5LE');\n var initSheet = SpreadsheetApp.getActiveSpreadsheet();\n initSheet.getActiveSheet().setName('Results').getRange(readingSpreadSheet.getSheetByName('Results').getDataRange().getA1Notation()).setValues(readingSpreadSheet.getSheetByName('Results').getDataRange().getValues());\n initSheet.insertSheet('Approved clients').getRange(readingSpreadSheet.getSheetByName('Approved clients').getDataRange().getA1Notation()).setValues(readingSpreadSheet.getSheetByName('Approved clients').getDataRange().getValues());\n initSheet.getSheetByName('Approved clients').getRange('A2:D').setBackground('yellow');\n initSheet.insertSheet('User data').getRange(readingSpreadSheet.getSheetByName('User data').getDataRange().getA1Notation()).setValues(readingSpreadSheet.getSheetByName('User data').getDataRange().getValues());\n initSheet.getSheetByName('User data').getRange('A2:F2').setBackground('yellow');\n initSheet.insertSheet('Advanced output').getRange(readingSpreadSheet.getSheetByName('Advanced output').getDataRange().getA1Notation()).setValues(readingSpreadSheet.getSheetByName('Advanced output').getDataRange().getValues());\n initSheet.getSheetByName('Results').activate();\n}", "function initializationCleanUp() {\n //console.debug('Cleaning up of all data..');\n\t\t\t//console.debug('Cleaning up of all data is done..');\n }", "function initialize() {\n for (let sheet of document.styleSheets) {\n const rules = sheet.rules || sheet.cssRules;\n\n if (!rules || !rules.length) continue;\n cjss(rules);\n }\n }", "cleanup() {\n this.lastRead = {};\n this.defaults = {};\n this.overrides = {};\n }", "constructor(){\n this.unicode = Converters.unified;\n this.env = Converters.environment;\n this.css = Converters.image;\n if(defaults.use_sheets){\n this.setSheets(defaults.sheets);\n }\n }", "newPropertiesSheet() {\n this.properties_sheet = new AutoscalingConfigurationProperties(this.artefact)\n }", "validateInit() {\n this.runValidation(true);\n }", "_initializeProperties(){}// prevent user code in connected from running", "static _setAssumptions(assumptions) {\n// If we have the global functions option set to true.....\n if (assumptions.globalFunctions) {\n// Globalize Flare functions for convenience...\n window.global = flare.global\n window.extend = flare.extend\n window.keyframes = flare.keyframes\n// Globalize style elements for convenience...\n window.div = flare.div\n window.aside = flare.aside\n window.area = flare.area\n window.button = flare.button\n window.col = flare.col\n window.colgroup = flare.colgroup\n window.header = flare.header\n window.footer = flare.footer\n window.input = flare.input\n window.h1 = flare.h1\n window.h2 = flare.h2\n window.h3 = flare.h3\n window.h4 = flare.h4\n window.h5 = flare.h5\n window.h6 = flare.h6\n window.p = flare.p\n window.section = flare.section\n window.span = flare.span\n window.table = flare.table\n window.textarea = flare.textarea\n }\n// If underscore abbreviation for global insertion option is set to true....\n if (assumptions.underscoreGlobal) {\n// Abbreviate flare.global...\n window.__ = flare.global\n }\n// Syntax highlighting....\n if (assumptions.syntaxHighlighting) {\n window.styled = flare\n }\n return assumptions\n }", "function makeSomeInitializations ( ) {\r\n clearForm();\r\n print ( standardMessage );\r\n books.forEach ( updateBookNumbers );\r\n copyOfSelectedBook[titleProperty] = '';\r\n initializeCopyOfSelectedBook();\r\n}", "newPropertiesSheet() {\n this.properties_sheet = new NetworkLoadBalancerProperties(this.artefact)\n }", "function initSpreadsheet_() {\n if (!originLiSheet) {\n doc.insertSheet(ORIGIN_SHEET_NAME,0);\n originLiSheet = doc.getSheetByName(ORIGIN_SHEET_NAME);\n originLiSheet.setTabColor(\"yellow\");\n originLiSheet.getRange(1,1,1,100).setBackground(\"yellow\");\n originLiSheet.getRange(1,1,originLiSheet.getMaxRows(),\n originLiSheet.getMaxColumns()).setFontFamily('Roboto Slab');\n }\n if (!destinationLisSheet) {\n doc.insertSheet(DESTINATION_SHEET_NAME,1);\n destinationLisSheet = doc.getSheetByName(DESTINATION_SHEET_NAME);\n destinationLisSheet.setTabColor(\"green\");\n destinationLisSheet.getRange(1,1,1,100).setBackground(\"green\");\n destinationLisSheet.getRange(1,1,destinationLisSheet.getMaxRows(),\n destinationLisSheet.getMaxColumns()).setFontFamily('Roboto Slab');\n }\n if (!configSheet) {\n doc.insertSheet(CONFIG_SHEET_NAME,0);\n configSheet = doc.getSheetByName(CONFIG_SHEET_NAME);\n configSheet.setTabColor('red');\n // Sets default column widths.\n configSheet.setColumnWidth(1, 260);\n configSheet.setColumnWidth(2, 280);\n configSheet.setColumnWidth(3, 360);\n configSheet.setColumnWidth(4, 360);\n // General settings section.\n configSheet.getRange(ROW_GENERAL_HEADER,1,1,NUM_COLUMNS)\n .setBackground(CONFIG_HEADERS_COLOR).setFontWeight('bold');\n configSheet.setRowHeight(ROW_GENERAL_HEADER, 40);\n configSheet.getRange(ROW_GENERAL_HEADER,1).setValue('General settings');\n configSheet.getRange(ROW_SDF_VERSION,1,2,1)\n .setBackground(CONFIG_NAMES_COLOR).setFontWeight('bold');\n configSheet.getRange(ROW_SDF_VERSION,1).setValue('SDF Version');\n configSheet.getRange(ROW_SETTING,1).setValue('Line Item setting to copy');\n configSheet.getRange(ROW_SDF_VERSION,2,2,1)\n .setBackground(CONFIG_EDITABLE_VALUES_COLOR).setFontWeight('bold')\n .setHorizontalAlignment('center');\n var rule = SpreadsheetApp.newDataValidation()\n .requireValueInList(['3.1', '4']).build();\n configSheet.getRange(ROW_SDF_VERSION,2).setDataValidation(rule)\n .setValue('4');\n var range = originLiSheet.getRange('1:1');\n rule = SpreadsheetApp.newDataValidation().requireValueInRange(range)\n .build();\n configSheet.getRange(ROW_SETTING,2).setDataValidation(rule)\n .setValue('Geography Targeting - Include');\n configSheet.getRange(ROW_SDF_VERSION,3,2,2)\n .setBackground(CONFIG_DESCRIPTIONS_COLOR);\n configSheet.getRange(ROW_SDF_VERSION,3)\n .setValue('Check your advertiser/partner supported SDF version ' +\n 'directly in DV360');\n configSheet.getRange(ROW_SETTING,3).setValue('<-- if this menu is empty, ' +\n 'select an ORIGIN line item below and run \"Custom Functions > ' +\n 'Retrieve ORIGIN Line Item Info\"');\n // Origin Line Item section.\n configSheet.getRange(ROW_ORIGIN_HEADER,1,1,NUM_COLUMNS)\n .setBackground(CONFIG_HEADERS_COLOR).setFontWeight('bold');\n configSheet.setRowHeight(ROW_ORIGIN_HEADER, 40);\n configSheet.getRange(ROW_ORIGIN_HEADER,1)\n .setFormula('=CONCATENATE(\"ORIGIN Line Item - the Line Item to copy ' +\n 'the selected setting (\"; $B$3; \") from\")');\n configSheet.getRange(ROW_ORIGIN_LI_ID,1,3,1)\n .setBackground(CONFIG_NAMES_COLOR).setFontWeight('bold');\n configSheet.setRowHeight(ROW_ORIGIN_LI_ID, 40);\n configSheet.setRowHeight(ROW_ORIGIN_LI_NAME, 40);\n configSheet.setRowHeight(ROW_ORIGIN_LI_VALUE, 40);\n configSheet.getRange(ROW_ORIGIN_LI_ID,1).setValue('Line Item ID');\n configSheet.getRange(ROW_ORIGIN_LI_NAME,1).setValue('Line Item Name');\n configSheet.getRange(ROW_ORIGIN_LI_VALUE,1)\n .setFormula('= CONCATENATE(\"Value for: \"; $B$3)');\n configSheet.getRange(ROW_ORIGIN_LI_ID,2)\n .setBackground(CONFIG_EDITABLE_VALUES_COLOR).setFontWeight('bold')\n .setHorizontalAlignment('center');\n configSheet.getRange(ROW_ORIGIN_LI_NAME,2,2,1)\n .setBackground(CONFIG_AUTOMATIC_VALUES_COLOR).setFontWeight('bold')\n .setHorizontalAlignment('center');\n configSheet.getRange(ROW_ORIGIN_LI_ID,3,3,2)\n .setBackground(CONFIG_DESCRIPTIONS_COLOR);\n configSheet.getRange(ROW_ORIGIN_LI_ID,3,1,2).merge().setWrap(true)\n .setValue('The ID of the Line Item you want to copy the setting FROM');\n configSheet.getRange(ROW_ORIGIN_LI_NAME,3,1,2).merge().setWrap(true)\n .setValue('Run \"Custom Functions > Retrieve ORIGIN Line Item Info\" ' +\n 'to load the LI Name and the current value for the selected setting ' +\n '(Keyword Targeting - Include)');\n configSheet.getRange(ROW_ORIGIN_LI_VALUE,3,1,2).merge().setWrap(true)\n .setFormula('=CONCATENATE(\"This is the value for \"; $B$3; \" which is ' +\n 'gonna be copied into the DESTINATION Line Items below\")');\n // Destination Line Items section.\n configSheet.getRange(ROW_DESTINATION_HEADER,1,1,NUM_COLUMNS)\n .setBackground(CONFIG_HEADERS_COLOR).setFontWeight('bold');\n configSheet.setRowHeight(ROW_DESTINATION_HEADER, 40);\n configSheet.getRange(ROW_DESTINATION_HEADER,1,1,4).merge().setWrap(true)\n .setValue('DESTINATION Line Items - the Line Item(s) you want to ' +\n 'copy the selected setting TO.');\n configSheet.getRange(ROW_DESTINATION_COLUMNS,1,1,NUM_COLUMNS)\n .setBackground(CONFIG_NAMES_COLOR).setFontWeight('bold');\n configSheet.getRange(ROW_DESTINATION_COLUMNS,1)\n .setValue('Destination Line Item IDs');\n configSheet.getRange(ROW_DESTINATION_COLUMNS,2).setValue('Line Item Name');\n configSheet.getRange(ROW_DESTINATION_COLUMNS,3)\n .setFormula('= CONCATENATE(\"Current value for: \"; $B$3)');\n configSheet.getRange(ROW_DESTINATION_COLUMNS,4)\n .setFormula('= CONCATENATE(\"New value applied for: \"; $B$3)');\n configSheet.getRange(ROW_DESTINATION_LI,1,100,1).setFontWeight('bold')\n .setBackground(CONFIG_EDITABLE_VALUES_COLOR)\n .setHorizontalAlignment('center');\n configSheet.getRange(ROW_DESTINATION_LI,2,100,3).setFontWeight('bold')\n .setBackground(CONFIG_AUTOMATIC_VALUES_COLOR);\n configSheet.getRange(1,1,configSheet.getMaxRows(),\n configSheet.getMaxColumns()).setFontFamily('Roboto Slab')\n .setVerticalAlignment(\"middle\");\n }\n}", "static get sanitize() {\n return {}\n }", "_cleanAndSetData() {\n const propertySearchLocationPath = 'page.attributes.propertySearchLocation';\n const propertySearchLocation = get(this.digitalData, propertySearchLocationPath);\n if (propertySearchLocation === undefined) {\n this._set(propertySearchLocationPath, '');\n }\n\n const propertySearchDateInfoPath = 'page.attributes.propertySearchDateInfo';\n const propertySearchDateInfo = get(this.digitalData, propertySearchDateInfoPath);\n if (propertySearchDateInfo === undefined) {\n this._set(propertySearchDateInfoPath, '00:00:00:00');\n }\n\n const productIDPath = 'product[0].productInfo.productID';\n const productID = get(this.digitalData, productIDPath);\n if (productID === undefined) {\n this._set('product', [{ productInfo: { productId: '' } }]);\n }\n\n window.digitalData = this.digitalData;\n }", "function init() {\n\t\t\tresetData();\n resetClipboardMI();\n resetClipboardEC();\n resetClipboardDC();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n if (document.location.search.length > 0) {\n searchByAlleleKeys();\n }\n\t\t}", "function tryEnsureSanity()\n{\n // The script might have set up oomAfterAllocations or oomAtAllocation.\n // Turn it off so we can test only generated code with it.\n try {\n if (typeof resetOOMFailure == \"function\")\n resetOOMFailure();\n } catch(e) { }\n\n try {\n // The script might have turned on gczeal.\n // Turn it off to avoid slowness.\n if (typeof gczeal == \"function\")\n gczeal(0);\n } catch(e) { }\n\n // At least one bug in the past has put exceptions in strange places. This also catches \"eval getter\" issues.\n try { eval(\"\"); } catch(e) { dumpln(\"That really shouldn't have thrown: \" + errorToString(e)); }\n\n if (!this) {\n // Strict mode. Great.\n return;\n }\n\n try {\n // Try to get rid of any fake 'unwatch' functions.\n delete this.unwatch;\n\n // Restore important stuff that might have been broken as soon as possible :)\n if ('unwatch' in this) {\n this.unwatch(\"eval\");\n this.unwatch(\"Function\");\n this.unwatch(\"gc\");\n this.unwatch(\"uneval\");\n this.unwatch(\"toSource\");\n this.unwatch(\"toString\");\n }\n\n if ('__defineSetter__' in this) {\n // The only way to get rid of getters/setters is to delete the property.\n if (!jsStrictMode)\n delete this.eval;\n delete this.Math;\n delete this.Function;\n delete this.gc;\n delete this.uneval;\n delete this.toSource;\n delete this.toString;\n }\n\n this.Math = realMath;\n this.eval = realEval;\n this.Function = realFunction;\n this.gc = realGC;\n this.uneval = realUneval;\n this.toSource = realToSource;\n this.toString = realToString;\n } catch(e) {\n confused(\"tryEnsureSanity failed: \" + errorToString(e));\n }\n\n // These can fail if the page creates a getter for \"eval\", for example.\n if (this.eval != realEval)\n confused(\"Fuzz script replaced |eval|\");\n if (Function != realFunction)\n confused(\"Fuzz script replaced |Function|\");\n}", "function tryEnsureSanity()\n{\n // The script might have set up oomAfterAllocations or oomAtAllocation.\n // Turn it off so we can test only generated code with it.\n try {\n if (typeof resetOOMFailure == \"function\")\n resetOOMFailure();\n } catch(e) { }\n\n try {\n // The script might have turned on gczeal.\n // Turn it off to avoid slowness.\n if (typeof gczeal == \"function\")\n gczeal(0);\n } catch(e) { }\n\n // At least one bug in the past has put exceptions in strange places. This also catches \"eval getter\" issues.\n try { eval(\"\"); } catch(e) { dumpln(\"That really shouldn't have thrown: \" + errorToString(e)); }\n\n if (!this) {\n // Strict mode. Great.\n return;\n }\n\n try {\n // Try to get rid of any fake 'unwatch' functions.\n delete this.unwatch;\n\n // Restore important stuff that might have been broken as soon as possible :)\n if ('unwatch' in this) {\n this.unwatch(\"eval\");\n this.unwatch(\"Function\");\n this.unwatch(\"gc\");\n this.unwatch(\"uneval\");\n this.unwatch(\"toSource\");\n this.unwatch(\"toString\");\n }\n\n if ('__defineSetter__' in this) {\n // The only way to get rid of getters/setters is to delete the property.\n if (!jsStrictMode)\n delete this.eval;\n delete this.Math;\n delete this.Function;\n delete this.gc;\n delete this.uneval;\n delete this.toSource;\n delete this.toString;\n }\n\n this.Math = realMath;\n this.eval = realEval;\n this.Function = realFunction;\n this.gc = realGC;\n this.uneval = realUneval;\n this.toSource = realToSource;\n this.toString = realToString;\n } catch(e) {\n confused(\"tryEnsureSanity failed: \" + errorToString(e));\n }\n\n // These can fail if the page creates a getter for \"eval\", for example.\n if (this.eval != realEval)\n confused(\"Fuzz script replaced |eval|\");\n if (Function != realFunction)\n confused(\"Fuzz script replaced |Function|\");\n}", "function tryEnsureSanity()\n{\n // The script might have set up oomAfterAllocations or oomAtAllocation.\n // Turn it off so we can test only generated code with it.\n try {\n if (typeof resetOOMFailure == \"function\")\n resetOOMFailure();\n } catch(e) { }\n\n try {\n // The script might have turned on gczeal.\n // Turn it off to avoid slowness.\n if (typeof gczeal == \"function\")\n gczeal(0);\n } catch(e) { }\n\n // At least one bug in the past has put exceptions in strange places. This also catches \"eval getter\" issues.\n try { eval(\"\"); } catch(e) { dumpln(\"That really shouldn't have thrown: \" + errorToString(e)); }\n\n if (!this) {\n // Strict mode. Great.\n return;\n }\n\n try {\n // Try to get rid of any fake 'unwatch' functions.\n delete this.unwatch;\n\n // Restore important stuff that might have been broken as soon as possible :)\n if ('unwatch' in this) {\n this.unwatch(\"eval\");\n this.unwatch(\"Function\");\n this.unwatch(\"gc\");\n this.unwatch(\"uneval\");\n this.unwatch(\"toSource\");\n this.unwatch(\"toString\");\n }\n\n if ('__defineSetter__' in this) {\n // The only way to get rid of getters/setters is to delete the property.\n if (!jsStrictMode)\n delete this.eval;\n delete this.Math;\n delete this.Function;\n delete this.gc;\n delete this.uneval;\n delete this.toSource;\n delete this.toString;\n }\n\n this.Math = realMath;\n this.eval = realEval;\n this.Function = realFunction;\n this.gc = realGC;\n this.uneval = realUneval;\n this.toSource = realToSource;\n this.toString = realToString;\n } catch(e) {\n confused(\"tryEnsureSanity failed: \" + errorToString(e));\n }\n\n // These can fail if the page creates a getter for \"eval\", for example.\n if (this.eval != realEval)\n confused(\"Fuzz script replaced |eval|\");\n if (Function != realFunction)\n confused(\"Fuzz script replaced |Function|\");\n}", "function tryEnsureSanity()\n{\n // The script might have set up oomAfterAllocations or oomAtAllocation.\n // Turn it off so we can test only generated code with it.\n try {\n if (typeof resetOOMFailure == \"function\")\n resetOOMFailure();\n } catch(e) { }\n\n try {\n // The script might have turned on gczeal.\n // Turn it off to avoid slowness.\n if (typeof gczeal == \"function\")\n gczeal(0);\n } catch(e) { }\n\n // At least one bug in the past has put exceptions in strange places. This also catches \"eval getter\" issues.\n try { eval(\"\"); } catch(e) { dumpln(\"That really shouldn't have thrown: \" + errorToString(e)); }\n\n if (!this) {\n // Strict mode. Great.\n return;\n }\n\n try {\n // Try to get rid of any fake 'unwatch' functions.\n delete this.unwatch;\n\n // Restore important stuff that might have been broken as soon as possible :)\n if ('unwatch' in this) {\n this.unwatch(\"eval\");\n this.unwatch(\"Function\");\n this.unwatch(\"gc\");\n this.unwatch(\"uneval\");\n this.unwatch(\"toSource\");\n this.unwatch(\"toString\");\n }\n\n if ('__defineSetter__' in this) {\n // The only way to get rid of getters/setters is to delete the property.\n if (!jsStrictMode)\n delete this.eval;\n delete this.Math;\n delete this.Function;\n delete this.gc;\n delete this.uneval;\n delete this.toSource;\n delete this.toString;\n }\n\n this.Math = realMath;\n this.eval = realEval;\n this.Function = realFunction;\n this.gc = realGC;\n this.uneval = realUneval;\n this.toSource = realToSource;\n this.toString = realToString;\n } catch(e) {\n confused(\"tryEnsureSanity failed: \" + errorToString(e));\n }\n\n // These can fail if the page creates a getter for \"eval\", for example.\n if (this.eval != realEval)\n confused(\"Fuzz script replaced |eval|\");\n if (Function != realFunction)\n confused(\"Fuzz script replaced |Function|\");\n}", "function tryEnsureSanity()\n{\n // The script might have set up oomAfterAllocations or oomAtAllocation.\n // Turn it off so we can test only generated code with it.\n try {\n if (typeof resetOOMFailure == \"function\")\n resetOOMFailure();\n } catch(e) { }\n\n try {\n // The script might have turned on gczeal.\n // Turn it off to avoid slowness.\n if (typeof gczeal == \"function\")\n gczeal(0);\n } catch(e) { }\n\n // At least one bug in the past has put exceptions in strange places. This also catches \"eval getter\" issues.\n try { eval(\"\"); } catch(e) { dumpln(\"That really shouldn't have thrown: \" + errorToString(e)); }\n\n if (!this) {\n // Strict mode. Great.\n return;\n }\n\n try {\n // Try to get rid of any fake 'unwatch' functions.\n delete this.unwatch;\n\n // Restore important stuff that might have been broken as soon as possible :)\n if ('unwatch' in this) {\n this.unwatch(\"eval\");\n this.unwatch(\"Function\");\n this.unwatch(\"gc\");\n this.unwatch(\"uneval\");\n this.unwatch(\"toSource\");\n this.unwatch(\"toString\");\n }\n\n if ('__defineSetter__' in this) {\n // The only way to get rid of getters/setters is to delete the property.\n if (!jsStrictMode)\n delete this.eval;\n delete this.Math;\n delete this.Function;\n delete this.gc;\n delete this.uneval;\n delete this.toSource;\n delete this.toString;\n }\n\n this.Math = realMath;\n this.eval = realEval;\n this.Function = realFunction;\n this.gc = realGC;\n this.uneval = realUneval;\n this.toSource = realToSource;\n this.toString = realToString;\n } catch(e) {\n confused(\"tryEnsureSanity failed: \" + errorToString(e));\n }\n\n // These can fail if the page creates a getter for \"eval\", for example.\n if (this.eval != realEval)\n confused(\"Fuzz script replaced |eval|\");\n if (Function != realFunction)\n confused(\"Fuzz script replaced |Function|\");\n}", "prepare() {\n try {\n // Note: it might be that the properties of the CFN object aren't valid.\n // This will usually be preventatively caught in a construct's validate()\n // and turned into a nicely descriptive error, but we're running prepare()\n // before validate(). Swallow errors that occur because the CFN layer\n // doesn't validate completely.\n //\n // This does make the assumption that the error will not be rectified,\n // but the error will be thrown later on anyway. If the error doesn't\n // get thrown down the line, we may miss references.\n this.node.recordReference(...resolve_1.findTokens(this, () => this._toCloudFormation()));\n }\n catch (e) {\n if (e.type !== 'CfnSynthesisError') {\n throw e;\n }\n }\n }", "_init() {\n this._addBreakpoints();\n this._generateRules();\n this._reflow();\n }", "init () {\n const { getPack, packId, packFromId, resetErrors } = this.props;\n resetErrors();\n packId && !packFromId(packId) && getPack(packId);\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "function init()\n{\n valid.add(\n\t[\n\t\t{ id:'thredds.name', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'thredds.cataUrl', type:'length', minSize :1, maxSize :200 },\n\t\t{ id:'thredds.cataUrl', type:'url' },\n\t\t{ id:'thredds.username', type:'length', minSize :0, maxSize :200 },\n\t\t{ id:'thredds.password', type:'length', minSize :0, maxSize :200 },\n\t\t\n\t\t//--- stylesheet must be supplied if harvesting metadata fragments\n\t\t\n\t\t{ id:'thredds.collectionFragmentStylesheet', type:'length', minSize:1,\n\t\t\tprecond: [{id:'thredds.collectionDatasetMd', checked:true},\n\t\t\t {id:'thredds.createFragmentsForCollections', checked:true}]},\n\t\t{ id:'thredds.atomicFragmentStylesheet', type:'length', minSize:1,\n\t\t\tprecond: [{id:'thredds.atomicDatasetMd', checked:true},\n\t\t\t {id:'thredds.createFragmentsForAtomics', checked:true}]}\n\t]);\n\tshower = new Shower('thredds.useAccount', 'thredds.account');\n\n}", "function sanitizeItems() {\n \n console.log(\"sanitizeItems...\");\n //Clean out some generated elements before regenerating them\n document.querySelectorAll(\".dbg-each-menu\").forEach(e => e.parentNode.removeChild(e));\n formSections(sectionClasses);\n makeEditable();\n }//end sanitizeItems", "function init() {\n // localStorage.clear();\n initLocals();\n initDescription();\n initGrid();\n}", "async validate(){\n \n // ensure classes \n if(!this.apexClassNames || this.apexClassNames.length == 0)\n throw new Error('No Apex classes prescribed in pset.');\n\n // get each of the class bodies via tooling\n this.classBodies = ''; \n try{\n stdio.warn(`Retrieving ${this.apexClassNames.length > 1 ? 'classes' : 'class'} ${this.apexClassNames.join(', ')} from ${ config.mode === 'local' ? 'default local directory...' : 'authorized SF org...' }`);\n for(let apexClass of await tooling.getApex(this.apexClassNames)){\n // replace any instances of static methods with static global-level variables, \n // and remove the static method keywords, such that apex class calls to static methods\n // are immitated\n const name = apexClass.name; \n let body = apexClass.body; \n if(apexClass.body.indexOf(' static ') != -1){\n this.globalVars.push(`// mimic static method(s) in class ${name}\\nstatic ${name} ${name} = new ${name}();`);\n body = body.replace(new RegExp(/ static /, 'gi'), ` /** static method mimicked by var '${name}' **/ `); \n }\n this.classBodies += `${body}\\n\\n`;\n }\n } catch(e){\n throw e; \n }\n\n // construct anonymous body\n try{\n stdio.warn('Constructing tests...'); \n const anonBody = buildAnonTest(this); \n stdio.warn('Validating assertions in authorized org...');\n await tooling.executeAnonApex(anonBody); \n } catch(e){\n throw e; \n }\n\n }", "function transformProps(props) {\n\n const { importData: { sheets, activeCollection, uploadedFileName }, mappings, archetype } = props;\n const collectionData = sheets.find((sheet) => sheet.collection === activeCollection);\n const { rows, variables } = collectionData;\n\n const confirmedCols = getConfirmedCols(props, variables);\n const { ignoredColumns } = mappings.collections[activeCollection];\n\n const availableArchetypes = Object.keys(mappings.collections).map((key) => mappings.collections[key].archetypeName);\n\n return {\n sheets: sheets,\n activeCollection: activeCollection,\n uploadedFileName: uploadedFileName,\n collectionTabs: sheets.map((sheet) => ({\n collectionName: sheet.collection,\n archetypeName: mappings.collections[sheet.collection].archetypeName,\n active: activeCollection === sheet.collection,\n complete: mappingsAreComplete(props, sheet)\n })),\n rows: rows.map((row) => row.map((cell, i) => ({\n value: cell.value,\n error: cell.error || null,\n ignored: ignoredColumns.indexOf(variables[i]) > -1\n }))),\n headers: variables.map((variable, i) => ({\n name: variable,\n isConfirmed: ignoredColumns.indexOf(i) < 0 && confirmedCols.indexOf(i) > -1,\n isIgnored: ignoredColumns.indexOf(variable) > -1\n })),\n nextUrl: sheets.find((sheet) => sheet.collection === activeCollection).nextUrl,\n archetypeFields: archetype[mappings.collections[activeCollection].archetypeName],\n propertyMappings: mappings.collections[activeCollection].mappings,\n customPropertyMappings: mappings.collections[activeCollection].customProperties,\n availableArchetypes: availableArchetypes,\n availableCollectionColumnsPerArchetype: availableArchetypes.map((archetypeName) => ({\n key: archetypeName,\n values: Object.keys(mappings.collections)\n .filter((collectionName) => mappings.collections[collectionName].archetypeName === archetypeName)\n .map((collectionName) => ({\n collectionName: collectionName,\n columns: sheets.find((sheet) => sheet.collection === collectionName).variables\n }))\n })).reduce((archetypeToCollectionColumnMapping, currentArchetypeAndCols) => {\n archetypeToCollectionColumnMapping[currentArchetypeAndCols.key] = currentArchetypeAndCols.values;\n return archetypeToCollectionColumnMapping;\n }, {})\n };\n}", "constructor(sheet, extraFormulaFuncs = {}, userUpdateFuncs = {}) {\n this.sheet = new Sheet(sheet);\n this.parser = this._makeParser(extraFormulaFuncs);\n this.userUpdateFuncs = userUpdateFuncs;\n\n const tabs = this.sheet.get('tabsById').valueSeq();\n // Map from dependent to dependency cells\n const theDeps = deps(tabs);\n // Map from CellRef p to List of CellRefs r where p provides a value needed by each r.\n this.providesTo = depsToProvides(theDeps);\n // Map from tab id to a List of Lists (rows and cells in the row)\n this.vals = new Map(tabs.map(t => [t.get('id'), new List()]));\n // Map from CellRef c to the pre-calculated value of a formula. Primarily useful for async funcs.\n this.cellValueCache = new Map();\n // Map from CellRef c to the user-supplied value if c contains a formula making use of a userUpdateFunc.\n this.userValueCache = new Map();\n this.globalOrder = evalOrder(theDeps, this._allCellRefs());\n\n this.calculateAll(this.globalOrder);\n }", "static _ensureClassProperties() {\n // ensure private storage for property declarations.\n if (!this.hasOwnProperty(JSCompiler_renameProperty('_classProperties', this))) {\n this._classProperties = new Map();\n // NOTE: Workaround IE11 not supporting Map constructor argument.\n const superProperties = Object.getPrototypeOf(this)._classProperties;\n if (superProperties !== undefined) {\n superProperties.forEach((v, k) => this._classProperties.set(k, v));\n }\n }\n }", "_init() {\n this._setRanges(this.selected);\n this._todayDate = this._getCellCompareValue(this._dateAdapter.today());\n this._monthLabel =\n this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]\n .toLocaleUpperCase();\n let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);\n this._firstWeekOffset =\n (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -\n this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;\n this._initWeekdays();\n this._createWeekCells();\n this._changeDetectorRef.markForCheck();\n }", "initInstance() {\n this.instance = {};\n this.instance.epiHiperSchema = '';\n this.instance.diseaseModel = {};\n this.instance.sets = [];\n this.instance.variables = [];\n this.instance.initializations = [];\n this.instance.triggers = [];\n this.instance.interventions = [];\n this.instance.traits = [];\n this.instance.personTraitDBs = [];\n this.instance.network = {};\n this.instance.runParameters = {};\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "_applyInstanceProperties() {\n // Use forEach so this works even if for/of loops are compiled to for loops\n // expecting arrays\n // tslint:disable-next-line:no-any\n this._instanceProperties.forEach((v, p) => this[p] = v);\n this._instanceProperties = undefined;\n }", "constructor() {\n this._removeNoScript = true;\n this._lastSnapshotNumber = 0;\n this._staleStyleSheets = new Set();\n this._readingStyleSheet = false;\n this._fakeBase = void 0;\n this._observer = void 0;\n\n this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'insertRule', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'deleteRule', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'addRule', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'removeRule', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeGetter(window.CSSStyleSheet.prototype, 'rules', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeGetter(window.CSSStyleSheet.prototype, 'cssRules', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeMethod(window.CSSStyleSheet.prototype, 'replaceSync', sheet => this._invalidateStyleSheet(sheet));\n\n this._interceptNativeAsyncMethod(window.CSSStyleSheet.prototype, 'replace', sheet => this._invalidateStyleSheet(sheet));\n\n this._fakeBase = document.createElement('base');\n this._observer = new MutationObserver(list => this._handleMutations(list));\n const observerConfig = {\n attributes: true,\n subtree: true\n };\n\n this._observer.observe(document, observerConfig);\n }", "_init() {\n this._setRanges(this.selected);\n this._todayDate = this._getCellCompareValue(this._dateAdapter.today());\n this._monthLabel = this._dateFormats.display.monthLabel\n ? this._dateAdapter.format(this.activeDate, this._dateFormats.display.monthLabel)\n : this._dateAdapter.getMonthNames('short')[this._dateAdapter.getMonth(this.activeDate)]\n .toLocaleUpperCase();\n let firstOfMonth = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), this._dateAdapter.getMonth(this.activeDate), 1);\n this._firstWeekOffset =\n (DAYS_PER_WEEK + this._dateAdapter.getDayOfWeek(firstOfMonth) -\n this._dateAdapter.getFirstDayOfWeek()) % DAYS_PER_WEEK;\n this._initWeekdays();\n this._createWeekCells();\n this._changeDetectorRef.markForCheck();\n }", "initialize() {\n\t\tthis.updateFaves();\n\t\tthis.CALCULATOR.initialize();\n\t\t\n\t\t// initialize unit converter\n\t\tthis.populateCategories();\n\t\tthis.populateUnitMenus();\n\t\tthis.switchToFaveConv();\n\t\tthis.convertHandler();\n\t\t\n\t\t// initialize constants\n\t\tthis.populateConstants();\n\t\tif(this.m_faves.constant === \"\") {\n\t\t\tthis.constChange();\n\t\t\tthis.constHandler();\n\t\t}\n\t\telse {\n\t\t\tthis.switchToFaveConst();\n\t\t}\n\t\t\n\t\t// initialize formulas\n\t\tthis.populateFormulas();\n\t\tif(this.m_faves.formula === \"\") {\n\t\t\tthis.populateFormulaFields();\n\t\t}\n\t\telse {\n\t\t\tthis.switchToFaveFormula();\n\t\t}\n\t\t\n\t\tthis.setUnloadListener();\n\t}", "function initFilterCollection() {\n filterCollection = {...dimensionsObj, ...dimensionsWithStringsObj}\n delete filterCollection.Manufacturer\n delete filterCollection.Model\n delete filterCollection.Image\n}", "Initialize()\n {\n\n Promise.all([\n this.SetEnvMapReflection(this.envMapResPath),\n this.SetEnvMapDiffuse(this.envMap1ResPath),\n this.SetEnvMapBlur(this.envMap2ResPath),\n this.SetPostProcess(this.postProcessPath),\n //this.SetLensflares(this.lensflarePath)\n ]).then();\n\n // Shift own objects to the background objects array\n // This is to stop wrapped scenes from accidentally purging the scene's own objects\n // during scene rebuilds\n if (this.objects.length)\n {\n for (let i = 0; i < this.objects.length; i++)\n {\n this.backgroundObjects.push(this.objects[i]);\n }\n this.objects.splice(0);\n }\n\n }", "newPropertiesSheet() {\n this.properties_sheet = new NatGatewayProperties(this.artefact)\n }", "initialize() { this._saveInstanceProperties(); }", "function prepareBusinessRule() {\n createObjectForBusinessRuleCreation()\n}", "init() {\n this.setResolver();\n this.setValidationAndBehaviour();\n }", "newPropertiesSheet() {\n this.properties_sheet = new OkeClusterProperties(this.artefact)\n }", "_validateInitialPropertyValues() {\n const that = this,\n value = typeof (that.value) === String ? that.value.replace(/\\s/g, '') : that.value.toString().replace(/\\s/g, '');\n\n if (that.mode === 'numeric' && that._numericProcessor.regexScientificNotation.test(value)) {\n that.value = that._numericProcessor.scientificToDecimal(value);\n delete that._valueBeforeCoercion;\n }\n\n //Validates significantDigits\n that.significantDigits = (that.significantDigits !== null) ? Math.min(Math.max(that.significantDigits, 1), 21) : null;\n\n if (that.significantDigits === null && that.precisionDigits === null) {\n that.significantDigits = 8;\n }\n else if (that.significantDigits !== null && that.precisionDigits !== null) {\n that.error(that.localize('significantPrecisionDigits', { elementType: that.nodeName.toLowerCase() }));\n }\n\n //minMax validation\n that._validateMinMax('both', true);\n\n if (that.showTooltip && that.showThumbLabel) {\n that.showTooltip = false;\n }\n }", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "clear()\n {\n this._commonStyleSheet = null;\n\n for (let collection of [this._styleSheetCache, this._filtersByDomain,\n this._filterBySelector, this._filters,\n this._exceptionDomains])\n collection.clear();\n\n this._unconditionalSelectors = null;\n this._defaultStyleSheet = null;\n }", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function flush() {\n inserted = styleSheet.inserted = {};\n registered = styleSheet.registered = {};\n ruleCache = {};\n styleSheet.flush();\n styleSheet.inject();\n}", "function clearProperties()\n {\n _center = undefined;\n _globalCenter = undefined;\n }", "function init() {\n getContentTypes();\n getProperties();\n }", "function _populateWorkbook() {\n var workbook = SpreadsheetApp.getActiveSpreadsheet();\n var transactionsSheet = workbook.insertSheet('Transactions', 0);\n var summarySheet = workbook.insertSheet('Summary', 1)\n\n //delete any other sheets.\n var sheets = workbook.getSheets();\n if (sheets.length > 2) {\n for (var ndx = 2; ndx < sheets.length; ndx++) {\n workbook.deleteSheet(sheets[ndx])\n }\n }\n\n _configureTransactionsSheet(workbook,transactionsSheet);\n _configureSummarySheet(workbook,summarySheet);\n transactionsSheet.activate();\n}", "handleSheetData(worksheet, sheetJS) {\n const { degrees, departments } = this.props;\n var data = sheetJS.utils.sheet_to_row_object_array(worksheet);\n\n var { parsedData, unparsedData } = this.state;\n\n for(var officerId in data){\n var officer = {};\n var validInfo = true;\n\n //Save valid data (not undefined)\n\n if(data[officerId][officerInfo[1]]) { //username\n officer.username = data[officerId][officerInfo[1]].trim();\n\n if(data[officerId][officerInfo[2]]) { //password\n officer.password = data[officerId][officerInfo[2]];\n\n if(data[officerId][officerInfo[3]]) { //officerCode\n officer.officerCode = data[officerId][officerInfo[3]].trim();\n\n if(data[officerId][officerInfo[4]]) { //fullname\n officer.fullname = data[officerId][officerInfo[4]].trim();\n\n if(data[officerId][officerInfo[5]]) { //vnuMail\n officer.vnuMail = data[officerId][officerInfo[5]].trim();\n\n if(data[officerId][officerInfo[6]]) { //officerType\n var officerType = data[officerId][officerInfo[6]].trim();\n var type = officerTypes.filter( (type) => type.label.toLowerCase() == officerType.toLowerCase() );\n\n if(type.length > 0) {\n officer.role = type[0].value;\n\n if(data[officerId][officerInfo[8]]) { //department\n var officerDepartment = data[officerId][officerInfo[8]].trim();\n var department = departments.list.filter( (depart) => depart.name.toLowerCase() == officerDepartment.toLowerCase() );\n if(department.length > 0) {\n officer.departmentId = department[0].id;\n } else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Đơn vị công tác không tồn tại\"});\n continue;\n }\n }\n else {\n var department = departments.list.filter((d) => d.type == 4); // VPK type\n if (department.length > 0) {\n officer.departmentId = department[0].id;\n } else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Văn phòng khoa không tồn tại\"});\n continue\n }\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Loại cán bộ không hợp lệ\"});\n continue;\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Loại cán bộ không hợp lệ\"});\n continue\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Địa chỉ vnuMail không hợp lệ\"});\n continue\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Tên riêng người dùng không hợp lệ\"});\n continue\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[1]], error: \"Mã cán bộ không hợp lệ\"});\n continue\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Mật khẩu người dùng không hợp lệ\"});\n continue\n }\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Tên tài khoản người dùng không hợp lệ\"});\n continue;\n }\n\n //degree - not required\n if(data[officerId][officerInfo[7]]) {\n var officerDegree = data[officerId][officerInfo[7]];\n var degree = degrees.list.filter( (degree) => degree.name.toLowerCase() == officerDegree.toLowerCase() );\n if(degree.length > 0) {\n officer.degreeId = degree[0].id;\n }\n else {\n validInfo = false;\n unparsedData.push({id: data[officerId][officerInfo[3]], error: \"Học hàm, học vị cán bộ không hợp lệ\"});\n }\n }\n\n if(validInfo) { parsedData.push(officer); }\n }\n\n if(parsedData.length == 0) {\n this.setState({\n showDemo: false,\n loadding: false,\n error: true,\n message: 'Đọc dữ liệu không thành công.'\n });\n } else {\n this.setState({\n showDemo: true,\n loadding: false,\n error: false,\n message: ''\n });\n }\n\n this.setState({\n parsedData: parsedData,\n unparsedData: unparsedData\n });\n }", "_resetStyleDomains() {}", "initializeStyles() {\n if (!!sessionStorage.getItem('saved_style') && sessionStorage.getItem('saved_style') == 1) {\n for (let i=0; i<sessionStorage.length; i++) {\n const key = sessionStorage.key(i);\n if (key.startsWith('styles.')) {\n $('#'+key.substr(7)).val(sessionStorage.getItem(key));\n }\n }\n }\n\n /* Set Default Value and Placeholder of Chart Title and Axis Label */\n const chartType = sessionStorage.getItem('chart-type');\n\n const chartTitle = sessionStorage.getItem('chart-title');\n $('.chart-style-wrapper #chart-title').val(chartTitle);\n $('.chart-style-wrapper #chart-title').attr('placeholder', chartTitle);\n\n const chartAxisLabel = sessionStorage.getItem('chart-axis-label');\n const selectorValidAxis = '.chart-style-wrapper #'+(chartType=='bar' ? 'x' : 'y')+'-axis-label';\n $(selectorValidAxis).val(chartAxisLabel);\n $(selectorValidAxis).attr('placeholder', chartAxisLabel);\n $('.chart-style-wrapper #'+(chartType=='bar' ? 'y' : 'x')+'-axis-label').val('');\n\n /* Set the switch of black and white */\n $('#dataset_black_and_white').prop('checked', sessionStorage.getItem('switch.bw')===\"true\");\n\n if (chartType==\"pie\") {\n $('.no-pie').hide();\n } else {\n $('.no-pie').show();\n }\n }", "function init() {\n\t\t\tresetData();\n\t\t\trefreshTotalCount();\n\t\t\tloadVocabs();\n\t\t}", "initializing() {\n this.initializeBoilerplate();\n }", "_initialAdjustments() {\n const that = this;\n\n that._radixNumber = that._getRadix(that.radix);\n that._wordLengthNumber = that._numericProcessor.getWordLength(that.wordLength);\n\n that._validatePropertyCompatibility();\n that._numericProcessor.validateMinMax(true, true);\n\n that._updateSpinButtonsStepObject();\n\n that._validate(true);\n that._programmaticValueIsSet = true;\n that._cachedInputValue = that.$.input.value;\n\n if (that._editableValue === undefined) {\n that._editableValue = that._cachedInputValue;\n }\n\n that.$.radixDisplayButton.innerHTML = that._radixPrefixes[that._radixNumber];\n that.$.unitDisplay.innerHTML = that.unit;\n\n if (that.disabled) {\n that.$.upButton.disabled = true;\n that.$.downButton.disabled = true;\n }\n\n if (that.opened) {\n if (that.dropDownEnabled && !that.disabled && that.value !== null) {\n that._openRadix();\n }\n else {\n that.opened = false;\n }\n }\n\n that._setFocusable();\n }", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=undefined;}", "_setInitialValues() {\n const that = this;\n\n that._autoScrollCoefficient = JQX.Utilities.Core.Browser.Firefox ? 4 : JQX.Utilities.Core.Browser.Edge ? 8 : 2;\n that._isMobile = JQX.Utilities.Core.isMobile;\n\n that._manuallyAddedFields = [];\n that._localizeInitialValues();\n that.$.conditionsMenu.dropDownAppendTo = that.$.container;\n that.$.conditionsMenu.dataSource = that._groupOperationDescriptions;\n\n that._valueFlat = [];\n that._lastProcessedItemInCurrentGroup = { parentId: null, id: null, position: null };\n }", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((v,p)=>this[p]=v);this._instanceProperties=void 0}", "function _cleanupStyles(target) {\n\t for (var n in this.properties) {\n\t target.style[n] = '';\n\t }\n\t }", "cleanFilters() {\n this.minFilter.value = '';\n this.maxFilter.value = '';\n this.searchInput.value = '';\n\n this.costSortSwitch = true;\n this.costIcon.style.transform = 'scaleY(-1)';\n this.costIcon.parentElement.classList.remove('active');\n\n this.soldCountSortSwitch = true;\n this.soldCountIcon.style.transform = 'scaleY(1)';\n this.soldCountIcon.parentElement.classList.remove('active');\n\n this.filters.sortProducts = () => {};\n this.filters.filterByCost = () => {};\n this.filters.searchFilter = () => {};\n }", "loadOwnProperties(){\r\n//\t\tdebugger;\r\n\t\tvar self=this;\r\n//\t\tself.autoAddPostHtml=false;\r\n\t\tself.name=self.getAttrVal(\"name\");\r\n\t\tself.nameRest=self.getAttrVal(\"nameRest\");\r\n\t\tself.type=self.getAttrVal(\"type\");\r\n//\t\tself.where=self.getAttrVal(\"where\",undefined,false);\r\n\t\tself.innerVarName=self.getAttrVal(\"as\",undefined,false);\r\n\t\tself.resultVarName=self.getAttrVal(\"resultvarname\");\r\n\t\tself.restVarName=self.getAttrVal(\"restvarname\");\r\n\t\t\r\n\t\tself.bWithRest=false;\r\n\t\tself.hsResult;\r\n\t\tself.hsRest;\r\n\t\t\r\n\t\tself.recursiveField=self.getAttrVal(\"recursivefield\",undefined,false);\r\n\t\t\r\n\t\tself.source=self.getAttrVal(\"source\");\r\n\t\tself.sourceJson=self.getAttrVal(\"sourcejson\");\r\n\t\tself.sourceJS=self.getAttrVal(\"sourcejs\",undefined,false);\r\n\t\tself.sourceFormula=self.getAttrVal(\"sourceformula\",undefined,false);\r\n\t\t\r\n\t\tself.whereCondition=self.getAttrVal(\"where\",undefined,false);\r\n\t\tself.orderFormula=self.getAttrVal(\"order\",undefined,false);\r\n\t\tself.boundStartAt=self.getAttrVal(\"start\",undefined,false);\r\n\t\tself.boundLimit=self.getAttrVal(\"limit\",undefined,false);\r\n\t}", "init() {\n\t\tthis.replaceData(\n\t\t\tthis.manager.get(\"hostReq\"),\n\t\t\tthis.endpoints.check,\n\t\t\tthis.data.check\n\t\t);\n\t}", "function _setup () {\n }", "initCompartments () {\n for (let key of this.keys) {\n this.compartment[key] = 0\n }\n this.calcExtraParams()\n this.initCompartmentsByParams()\n this.checkEvents()\n }", "function prepareSheet_() {\n var sheet = SpreadsheetApp.getActiveSheet().setName('Settings');\n var headers = [\n 'Start Address',\n 'End Address',\n 'Driving Distance (meters)',\n 'Driving Distance (miles)'];\n var initialData = [\n '350 5th Ave, New York, NY 10118',\n '405 Lexington Ave, New York, NY 10174'];\n sheet.getRange('A1:D1').setValues([headers]).setFontWeight('bold');\n sheet.getRange('A2:B2').setValues([initialData]);\n sheet.setFrozenRows(1);\n sheet.autoResizeColumns(1, 4);\n}", "function setup() {\n if (!_baseStylesCreated) {\n ExtensionUtils.loadStyleSheet(module, \"../styles/linguistics.less\");\n _createBaseStyles();\n }\n }", "initialize() {\n super.initialize();\n\n this.originalValue = null;\n this.maxLength = this.config.maxLength || null;\n this.required = this.config.required || false;\n this.requiredValidator = this.config.requiredValidator || null;\n }", "function init(){var e=document.createElement(\"style\");e.appendChild(document.createTextNode(\"\")),document.head.appendChild(e),e.sheet.insertRule(\"body { visibility: hidden; }\",0)}", "_applyInstanceProperties(){// Use forEach so this works even if for/of loops are compiled to for loops\n// expecting arrays\n// tslint:disable-next-line:no-any\nthis._instanceProperties.forEach((e,t)=>this[t]=e),this._instanceProperties=void 0}", "regenerateStyleSheet() {\n const rules = [];\n const name = this.constructor.name;\n //get the JSON object of CSS rules\n const userJSONStyles = this.styles();\n initStyleSheet(userJSONStyles, name, rules);\n injectStyles(rules);\n }", "regenerateStyleSheet() {\n const rules = [];\n const name = this.constructor.name;\n //get the JSON object of CSS rules\n const userJSONStyles = this.styles();\n initStyleSheet(userJSONStyles, name, rules);\n injectStyles(rules);\n }", "function onProcessSheet() {\n if (!setSelectorDone && selectors.length) setSelector();\n }", "init() {\n this.isUpdating = false;\n this.errors = {};\n this.copied = null;\n this.isLoading = false;\n this.tracks = [];\n this.einsteinCategories = [];\n\n this.tempUserName = this.user.lastName;\n\n if (!this.user.firstName) {\n this.user.firstName = this.user.name;\n }\n\n this.currentInput = {\n name: null,\n value: null,\n };\n }", "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "function setDummyScriptPropsData() {\n var props = PropertiesService.getScriptProperties();\n props.setProperty('#K#2020-01-07T21:54:02.589Z', '#O#Davis Jones#F#Meg Media Inc.#C#4');\n props.setProperty('#K#2020-02-07T21:54:02.589Z', '#O#Sandra Smith#F#Judo Law Firm#C#1');\n props.setProperty('#K#2020-02-07T20:54:02.589Z', '#O#Bill Paxton#F#Coffee Legal Inc.#C#1');\n props.setProperty('#K#2020-03-07T22:54:02.589Z', '#O#Dolly Parton#F#Hippy Law LLC#C#6');\n props.setProperty('#K#2020-03-07T23:54:02.589Z', '#O#Johnny Cash#F#BBQ Legal Fund#C#7');\n props.setProperty('#K#2020-03-07T23:55:02.589Z', '#O#Willie Nelson#F#Sushi Legal International#C#1');\n props.setProperty('#K#2020-04-07T10:54:02.589Z', '#O#Jimi Hendrix#F#Jones Day Legal#C#1');\n props.setProperty('#K#2020-04-07T11:54:02.589Z', '#O#John Medeski#F#San Antonio Law LLC#C#1');\n}", "function prepareStartValues() {\n\n // initial state of the start values\n my.start_values = my.start_values ? $.toDotNotation( my.start_values ) : {};\n\n // consideration of the default configuration of the target component for start values\n let config = $.clone( my.target.config );\n delete config.ccm; delete config.html; delete config.parent;\n config.css = $.encode( config.css );\n config = $.toDotNotation( config );\n config[ 'captions.finish' ] = 'Restart';\n for ( const key in config )\n if ( my.start_values[ key ] === undefined )\n my.start_values[ key ] = config[ key ];\n\n // prepare 'keywords' and 'manually' entry\n if ( Array.isArray( my.start_values.keywords ) )\n my.start_values.manually = my.start_values.keywords.join( ', ' );\n my.start_values.keywords = my.start_values.keywords ? ( my.start_values.keywords === true ? 'auto' : 'manually' ) : 'none';\n\n // prepare 'feedback' entry\n my.start_values.feedback = my.start_values.feedback ? ( my.start_values.solutions ? 'solutions' : 'correctness' ) : 'none';\n delete my.start_values.solutions;\n\n // security check for start values\n my.start_values = $.protect( my.start_values );\n\n }", "function prepareStartValues() {\n\n // initial state of the start values\n my.start_values = my.start_values ? $.toDotNotation( my.start_values ) : {};\n\n // consideration of the default configuration of the target component for start values\n let config = $.clone( my.target.config );\n delete config.ccm; delete config.html; delete config.parent;\n config.css = $.encode( config.css );\n config = $.toDotNotation( config );\n config[ 'captions.finish' ] = 'Restart';\n for ( const key in config )\n if ( my.start_values[ key ] === undefined )\n my.start_values[ key ] = config[ key ];\n\n // prepare 'keywords' and 'manually' entry\n if ( Array.isArray( my.start_values.keywords ) )\n my.start_values.manually = my.start_values.keywords.join( ', ' );\n my.start_values.keywords = my.start_values.keywords ? ( my.start_values.keywords === true ? 'auto' : 'manually' ) : 'none';\n\n // prepare 'feedback' entry\n my.start_values.feedback = my.start_values.feedback ? ( my.start_values.solutions ? 'solutions' : 'correctness' ) : 'none';\n delete my.start_values.solutions;\n\n // security check for start values\n my.start_values = $.protect( my.start_values );\n\n }", "__recompile() {\n this.__isMounted = false;\n this.__isCompiled = false;\n this.__evaluationComponent.__disableProxy = null;\n this.__compiling = {};\n this.__recompiling = {};\n this.__setEvents();\n this.__setParents();\n this.__setBooleanAttributes();\n this.__defineAttributes();\n }", "setInitialBackgroundStyles() {\n\t\tif (this.img) {\n\t\t\tthis.img.style.position = 'absolute';\n\t\t\tthis.img.style.left = '50%';\n\t\t\tthis.img.style.WebkitTransformStyle = 'preserve-3d';\n\t\t\tthis.img.style.WebkitBackfaceVisibility = 'hidden';\n\t\t\tthis.img.style.MozBackfaceVisibility = 'hidden';\n\t\t\tthis.img.style.MsBackfaceVisibility = 'hidden';\n\t\t}\n\t}", "function init() {\n 'use strict';\n isActive = false;\n\n // no classes loaded or selected\n classes = null;\n classesSelectedIndex = -1;\n\n lastCheckedStudent = -1;\n\n bindUIActions();\n }", "function main(vertical,domainType,chainBranding) {\n var isValid = valid(vertical,domainType,chainBranding);\n if(isValid) {\n var clientProperties = getClientProp(vertical,domainType,chainBranding);\n var propSheetObj = new PropertyInfo();\n var hasErrors = checkErrors(propSheetObj,clientProperties);\n if(!hasErrors) {\n clearSpinUpAndLVTab();\n printHeaders(clientProperties);\n propSheetObj.getNewPropertyValues();\n var numLocations = propSheetObj.numOfLoc();\n var dataValObj = new DataVal(clientProperties);\n for(var i = 0; i <= spinUpFileHeaders.length - 1; i++) {\n var headerTag = spinUpFileHeaders[i];\n var result = collectAndFormatResults(propSheetObj,headerTag, clientProperties,dataValObj); \n printResults(numLocations, headerTag,vertical, result);\n }\n spinUpTab.getRange(2, 1, numLocations, spinUpFileHeaders.length).setNumberFormat(\"@\").setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);\n seoLvTab.getRange(5, 1, numLocations, seoLiquidValueTabHeaders.mf[0].length).setNumberFormat(\"@\").setWrapStrategy(SpreadsheetApp.WrapStrategy.CLIP);\n setSeoLvTabData(propSheetObj,numLocations,vertical,seoLvTab);\n }\n }\n}", "function cleanUpInputFields() {\n // Replace values\n firstNameInput.value = \"\";\n lastNameInput.value = \"\";\n titleInput.value = \"\";\n ratingInput.value = \"\";\n}", "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }", "function cleanElems() {\n if (afterInit) {\n delete mStyle.style;\n delete mStyle.modElem;\n }\n }" ]
[ "0.560905", "0.54945755", "0.54502386", "0.5349935", "0.5338927", "0.5281933", "0.52564126", "0.52491397", "0.52102023", "0.51928", "0.5192077", "0.5191688", "0.51606315", "0.51458764", "0.5133424", "0.5106165", "0.50655323", "0.50415117", "0.5039748", "0.5039748", "0.5039748", "0.5039748", "0.5039748", "0.5037025", "0.5001363", "0.49927846", "0.49845475", "0.49845475", "0.49845475", "0.49735764", "0.49679565", "0.49676338", "0.4950091", "0.49484903", "0.49481845", "0.4940312", "0.4930604", "0.49292892", "0.49185967", "0.49185967", "0.49185967", "0.4916664", "0.49144202", "0.49081612", "0.49012864", "0.4887698", "0.48825964", "0.4865285", "0.48604736", "0.48561677", "0.48452184", "0.4843896", "0.48340887", "0.48340887", "0.48312277", "0.48312277", "0.48312277", "0.48312277", "0.48312277", "0.48312277", "0.48312277", "0.4831222", "0.4827487", "0.4825749", "0.4821816", "0.48037076", "0.47977576", "0.47967342", "0.4784823", "0.47819024", "0.47794855", "0.47793996", "0.47763905", "0.47754937", "0.47644967", "0.4743903", "0.47408593", "0.47364116", "0.473239", "0.4732307", "0.472784", "0.47235996", "0.47224024", "0.47207308", "0.4719669", "0.4719669", "0.47163832", "0.47150743", "0.47143316", "0.47137862", "0.47120398", "0.47120398", "0.47065705", "0.4701507", "0.47002298", "0.47000122", "0.46976772", "0.4695968", "0.4695968", "0.4695968" ]
0.55610746
1
To show notes in cards in the app
function displayMeetings() { // Fetch the meeting name from local let meetingName = localStorage.getItem("meetingName") // In case it doesn't exist if (meetingName === null) { meetingNameArray = [] } else { // Else, assign the input to meetingNameArray meetingNameArray = JSON.parse(meetingName) } // Empty at first let cardHTML = "" meetingNameArray.forEach(function (element, index) { cardHTML += ` <div class="cards"> <div class="card" style="width: 18rem;"> <div class="card-body"> <h5 class="card-title">${element.name}</h5> <p class="card-text">${element.note}</p> <div id="launchMeeting"><a href="${element.link}" class="btn btn-outline-primary">Launch Meeting</a></div> <div id="showLink"></div> <button id="${index}" onclick="deleteMeeting(this.id)" class="btn btn-outline-danger">Delete</button> <p class="card-text"><small class="text-muted-custom">${element.link}</small></p> </div> </div> </div> ` }) let meetingNameElem = document.getElementById("meetings") // If meetings exist if (meetingNameArray.length != 0) { meetingNameElem.innerHTML = cardHTML } // If there are no meetings else { meetingNameElem.innerHTML = `<div id="centre">You have no meetings. Add a meeting from above!</div>` } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function(element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" style=\"color: red;\">Note ${index + 1}</h5>\n <h3 class=\"card-title\" style=\"color: black;\"> ${element.title} </h3>\n <h3 style=\"color:black;\">--------------------------------------</h3>\n <p class=\"card-text\"> ${element.text}</p>\n \n </div>\n <div>\n <form>\n \n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"card-title\" style=\"color: black;\">Delete Note</button>\n <button id=\"${index}\"onclick=\"editNote(this.id)\" class=\"card-title\" style=\"color: black;\">Edit Note</button>\n \n </form>\n \n </div>\n\n\n\n </div>`;\n });\n let notesElm = document.getElementById(\"notes\");\n\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n \n\n } else {\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\n }\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n\n\n let title = localStorage.getItem(\"title\");\n if (title == null) {\n titleObj = []\n }\n else {\n titleObj = JSON.parse(title)\n }\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Note <br>${titleObj[index]}</h5>\n <p class=\"card-text\"> ${element}</p>\n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"btn btn-outline-primary my-2 btn-block btn-md\" style=\"display:block\">Delete Note</button>\n\n <button id=\"${index}\"onclick=\"markImportant(this.id)\" class=\"btn btn-outline-primary my-2\" style=\"display:inline-block\">MARK</button>\n <button id=\"${index}\"onclick=\"unmark(this.id)\" class=\"btn btn-outline-primary my-2\" style=\"display:inline-block\">UNMARK</button>\n </div>\n </div>`;\n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n }\n else {\n notesElm.innerHTML = `<h2>Nothing to show! Use \"Add a Note\" section above to add notes.</h2>`;\n }\n showMarked(); // showing marking on cards\n}", "function showNotes() {\n var notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes)\n }\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n \n html += ` \n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}<i style=\"color : #d0e1e1;\">${element.status}</i></h5>\n <p class=\"card-text\" id=\"text\"> ${element.text}</p>\n <p style=\"color : #d0d0e1;\" class=\"name\"><i>${\"~By \"+element.name}</i></p>\n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n </div>`;\n });\n var notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\n }\n}", "function showNote() {\n $('#note').empty();\n let id = this.id;\n let note = createDiv(\"noteDiv\", data.players[id - 1].note)\n $('#note').append(note);\n }", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let count=0;\n let html = \"\";\n //creating the card which will store the note\n notesObj.forEach(function (element, index) { \n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\"> ${element.text}</p>\n \n <button id=\"${index}\" onClick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</a>\n </div>\n </div>\n `;\n });\n//displaying the notes\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `<span style=\"color: red;\">Uh oh!</span>\n <span>You haven't added any notes yet!</span><br>`;\n }\n}", "function display(notes) {\r\n let i = 1;\r\n let html = \"\";\r\n Object.keys(notes).forEach(function (k, i) {\r\n if (notes[k].title != undefined) {\r\n html += `\r\n <div class=\"noteCard my-2 mx-2 card\" content=\"centre\" style=\"width:100%;\" >\r\n <div class=\"card-body\" id=\"note-card\">\r\n <h5 class=\"card-title\">${notes[k].title}</h5>\r\n <p class=\"card-text\" > ${notes[k].content}</p>\r\n <button id=\"${k}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\r\n <button id=\"${k}\" onclick=\"editNote(this.id)\" class=\"btn btn-info\">Edit Note</button>\r\n </div>\r\n <div class=\"card-footer text-muted\" style=\"font: italics;\">\r\n Last Updated: ${notes[k].lastUpdated}\r\n </div>\r\n </div>`;\r\n }\r\n else {\r\n html += `\r\n <div class=\"noteCard my-2 mx-2 card\" content=\"centre\" style=\"width:100%;\" >\r\n <div class=\"card-body\" id=\"note-card\">\r\n <h5 class=\"card-title\">Note ${i + 1} (You can Now edit Title)</h5>\r\n <p class=\"card-text\" > ${notes[k]}</p>\r\n <button id=\"${k}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\r\n <button id=\"${k}\" onclick=\"editNote(this.id)\" class=\"btn btn-info\">Edit Note</button>\r\n </div>\r\n </div>`;\r\n }\r\n i++\r\n });\r\n let notesElm = document.getElementById(\"notes\");\r\n if (i > 0)\r\n notesElm.innerHTML = html;\r\n else\r\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\r\n return;\r\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n let html = \"\";\r\n notesObj.forEach(function(element, index) {\r\n html += `\r\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h4 class=\"card-title\">NOTE ${index + 1}</h4>\r\n <p class=\"card-text\"> ${element}</p>\r\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div> `;\r\n //<button id=\"${index}\" onclick=\"editNote(this.id)\" class=\"btn btn-primary\">Edit Note</button>\r\n });\r\n let notesElm = document.getElementById('notes');\r\n if(notesObj.length != 0){\r\n notesElm.innerHTML = html;\r\n }\r\n else {\r\n notesElm.innerHTML = `<h1 style= \"color: #FFF;\">Nothing To Show! Use \"Add A Note\" section above to add notes.</h1>`;//Clear prevoius notes as it will show after refresh too.By using localstorage.clear() command in console in inspect tool.\r\n }\r\n}", "function showNotes(){\n let notes=localStorage.getItem('notes');\n let titles = localStorage.getItem('title');\n if(notes==null){\n notesObj=[];\n }\n else{\n notesObj=JSON.parse(notes);\n }\n if (titles == null) {\n titlesObj = [];\n }\n else {\n titlesObj = JSON.parse(titles);\n }\n let html=\"\";\n notesObj.forEach( function(value,index){\n html+=`\n <div class=\"noteCard mx-2 my-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${titlesObj[index]}</h5>\n <p class=\"card-text\"> ${value}</p>\n <a onclick=\"deleteNote(${index})\" class=\"btn btn-primary\">Delete Note</a>\n </div>\n </div>\n `\n });\n let notesSpace=document.querySelector('#notes');\n if(notesObj.length!=0){\n notesSpace.innerHTML=html;\n }\n else{\n notesSpace.innerHTML=`Nothing to show here! Add your notes by clicking on add notes button`;\n }\n\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html += `\n <div class=\"noteCard my-3 mx-3\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <div class=\"btn-Container\" style=\"border-radius: 15px;\">\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\"class=\"btn btn-primary\" style=\"border-radius: 15px;\">Delete</button>\n </div>\n </div>\n </div>`;\n })\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `Nothing to show! Use \"Add Note\" to add a note.`;\n notesElm.style.fontWeight = 1;\n }\n}", "function showNotes(){\r\n let notes=localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesobj=[];\r\n\r\n }\r\n else{\r\n notesobj=JSON.parse(notes);\r\n }\r\n let html=\"\";\r\n notesobj.forEach(function(element,index) {\r\n \r\n \r\n html+=`<div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\"> Note ${index + 1}</h5>\r\n <hr>\r\n <p class =\"card-text\" id=\"gr\">${element}</p>\r\n <button id=\"${index}\" onclick=\"deleteNotes(this.id)\" class=\"bttnprim\">Delete</button>\r\n </div>\r\n </div>`;\r\n });\r\n let noteselem=document.getElementById(\"notes\");\r\n if(notesobj.length!=0)\r\n {\r\n noteselem.innerHTML=html;\r\n }\r\n else\r\n {\r\n noteselem.innerHTML=`Nothing to show! Use \"Add a Note\" section above to add notes.`;\r\n }\r\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\")\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html += ` <div class=\"card note-card mb-5\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\" id=\"title\">${element.title}</h5>\n <p class=\"card-text\" id=\"text\">${element.text}</p>\n <button class=\"btn btn-danger remove-btn\" id=\" ${index}\" onclick=\"deleteNote(this.id)\">Remove<i class=\"fas fa-trash\"></i></button>\n <button class=\"btn btn-success edit-btn\" id=\" ${index}\" onclick=\"editNote(this.id)\">Edit <i class=\"fas fa-pen\"></i></button>\n </div> </div>`;\n\n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n }\n else {\n notesElm.innerHTML = `No Notes Yet! Add a note using the form above.`;\n }\n\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n let html = \"\";\r\n notesObj.forEach(function(element, index) {\r\n html += `<div id=\"note\" class=\"noteCard\">\r\n <h3 class=\"note-title\">${element.title}</h3>\r\n <p class=\"note-text\"> ${element.text}</p>\r\n <p class=\"card-textone\">${element.textone}</p>\r\n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\" id=\"addBtn\">Delete Note</button>\r\n\t\t\t <button id=\"${index}\"onclick=\"editNote(this.id)\" class=\"btn btn-primary\" id=\"addBtn\" >Edit Note</button>\r\n </div> `;\r\n });\r\n let notesElm = document.getElementById(\"notes\");\r\n if (notesObj.length != 0) {\r\n notesElm.innerHTML = html\r\n\t} else {\r\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\r\n }\r\n \r\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesobj = [];\n }\n else {\n notesobj = JSON.parse(notes);\n }\n\n let html = \"\";\n notesobj.forEach(function (element, index) {\n html += ` <div class=\"notescard my-2 mx-2 card\" style=\"width: 18rem;\">\n \n <div class=\"card-body\">\n <div class=\"mark\" ><i id=\"${index}\" class=\"far fa-star fa-2x\"></i></div>\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete Note</button>\n <button class=\"btn btn-primary\" data-bs-toggle=\"modal\" data-bs-target=\"#EditNote\" onclick=\"editnote(${index})\">Edit Note</button>\n </div>\n </div>`\n var imp = index;\n\n });\n let notesElm = document.getElementById('notes');\n if (notesobj.length != 0) {\n notesElm.innerHTML = html;\n \n }\n else {\n notesElm.innerHTML = `<h5 class=\"text-white\">Nothing to show Use \"Add a note section\" to above add notes</h5>`;\n }\n // markupdate();\n\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n let html = \"\";\r\n notesObj.forEach(function(element, index) {\r\n html += `\r\n <div class=\"notecard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h4 class=\"card-title\">NOTE ${index + 1}</h4>\r\n <p class=\"card-text\"> ${element}</p>\r\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div> `;\r\n //<button id=\"${index}\" onclick=\"editNote(this.id)\" class=\"btn btn-primary\">Edit Note</button>\r\n });\r\n let notesElm = document.getElementById('notes');\r\n if(notesObj.length != 0){\r\n notesElm.innerHTML = html;\r\n }\r\n else {\r\n notesElm.innerHTML = `<h1 style= \"color: #FFF;\">Nothing To Show! Use \"Add A Note\" section above to add notes.</h1>`;//Clear prevoius notes as it will show after refresh too.By using localstorage.clear() command in console in inspect tool.\r\n }\r\n}", "function showNotes(){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n\n let addNote = \"\";\n\n //This list contains the classes for favorite/not-favorite cards\n const favorite_class = [\"noteCard m-2 card favorite\",\"noteCard m-2 card not-favorite\"]\n\n notesObj.forEach((element, index) => {\n addNote += `<div class=\"${element.favorite ? favorite_class[0]:favorite_class[1]}\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <div class=\"row mb-3\">\n <div class=\"col\">\n <h2 class=\"card-title\" style=\"height:80px;\">${element.title}</h2>\n <img class=\"card-text\"src=\"${element.text}\" style=\"height:250px;width:240px;\" >\n </div>\n <div class=\"col-2\">\n <span class=\"iconify\" data-icon=${element.favorite ? \"bi:star-fill\":\"bi:star\"} data-inline=\"false\" data-width=\"24\" data-height=\"24\" style=${element.favorite ? \"color:gold\":\"color:black\"} onclick=favoriteNote(${index})></span>\n </div>\n </div> \n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-danger\">Delete</button>\n <button onclick=\"editNote(${index})\" class=\"btn btn-primary\">Edit</button>\n \n </div>\n </div>`\n });\n\n let notesEle = document.getElementById('notes');\n if(notesObj.length != 0){\n notesEle.innerHTML = addNote;\n }\n else{\n notesEle.innerHTML = `You haven't add any note yet. Try to to add some note using above section and then press \"Add Note\" button.`\n }\n \n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html += \n `<div class=\"noteCard card my-2 mx-2\" style=\"width: 18rem;\">\n <div id=\"card${index}\" class=\"card-body\" onclick=\"makeNoteImportant(this.id.slice(4))\">\n <h5 class=\"card-title\">Note ${index + 1} : <em>${element.title}</em></h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n </div>`\n });\n\n let notesElm = document.getElementById(\"notes\");\n if(notesObj.length != 0){\n notesElm.innerHTML = html;\n notesObj.forEach((element,index) => {\n if(element.important == true){\n document.getElementById(\"card\"+String(index)).classList.add(\"myStyle\");\n }\n });\n }\n else{\n notesElm.innerHTML = `<p> Nothing to show! Kindly add notes </p>`\n }\n\n}", "function showNote() {\n let card = ``;\n let titles = localStorage.getItem(\"titleGet\");\n \n if (titles == null) {\n titleList = [];\n } else {\n titleList = JSON.parse(titles);\n }\n\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesList = [];\n } else {\n notesList = JSON.parse(notes);\n }\n\n notesList.forEach(function (element, index) {\n var final = titleList[index];\n \n if (index % 2 == 0) {\n card += `\n \n <div class=\"card text-dark bg-dark mb-3 mx-4 my-2 chang\" style=\"max-width: 18rem; background:#e6df29 !important;\">\n <div class=\"card-header\" id=\"titleChange\">${final}\n <i class=\"fas fa-bookmark right\" id=\"k\" onclick=\"addBookMark(${index})\"></i>\n </div>\n <div class=\"card-body\" id=\"${index}\">\n <hr class=\"dark1\" />\n <p class=\"card-text\">${element}</p>\n <hr class=\"dark1\" /> \n <button class=\"btn btn-dark\" id=\"${index}\" onclick=\"edit(this.id)\">Edit my Note!</button>\n \n <button class=\"btn btn-primary\" id=\"${index}\" onclick=\"remove(this.id)\">Delete Note</button>\n </div>\n \n </div>`;\n } else {\n card += `\n \n <div class=\"card text-dark bg-dark mb-3 mx-4 my-2 chang \" style=\"max-width: 18rem; background:skyblue !important;\">\n <div class=\"card-header\">${final}\n <i class=\"fas fa-bookmark right\" id=\"k\" onclick=\"addBookMark(${index})\"></i></div>\n <div class=\"card-body\" id=\"${index}\">\n <hr class=\"dark1\" />\n <p class=\"card-text\">${element}</p>\n <hr class=\"dark1\" /> \n <button class=\"btn btn-dark\" id=\"${index}\" onclick=\"edit(this.id)\">Edit my Note!</button>\n \n <button class=\"btn btn-primary\" id=\"${index}\" onclick=\"remove(this.id)\">Delete Note</button>\n </div>\n \n </div>`;\n }\n });\n\n let div = document.getElementById(\"notes\");\n if (div.length == 0) {\n div.innerHTML = \"No Notes Added! Add some now.\";\n } else {\n div.innerHTML = card;\n }\n\n\n title.value = \"\";\n}", "function displayNotes(note){\n return `<p>title: ${note.title}</p><p style=\"display:none\">note: ${note.body}</p>`\n }", "function buildNotes(notes) {\n\n //Loop through the notes\n notes.forEach(function(note) {\n\n\n const noteCard = `<div id=\"${note._id}\" class=\"note alert alert-primary alert-dismissible\" role=\"alert\">\n <div class=\"note-body\">\n ${note.body}\n </div>\n <button type=\"button\" class=\"close edit-note\">\n <span><i class=\"fas fa-edit\"></i></span>\n </button>\n <button type=\"button\" class=\"close delete-note\">\n <span>&times;</span>\n </button>\n </div>`\n\n $(\".notes-modal\").find(\"#article-notes\").append(noteCard)\n\n\n });\n }", "function showNotes(event) {\n event.preventDefault();\n\n // Hide the tooltip for this element so that they don't hang\n // around (Resolves display issues with tooltips after showing\n // the notes modal).\n $(this).tooltip('hide');\n\n // Get the article id so we can find any existing notes.\n const article = $(this).parents('.card').data();\n\n // Ask for any existing notes from the backend.\n $.get(`/api/notes/${article.id}`).done((response) => {\n // Construct the interior of the modal.\n const contentWrap = $('<div>').addClass('container-fluid');\n const existingNotes = $('<ul>').addClass(\n 'list-group list-group-flush note-container'\n );\n const contentBreak = $('<hr>').addClass('my-2');\n const newNoteBox = $('<textarea>').addClass('form-control').attr({\n placeholder: 'Write your notes here...',\n rows: 4,\n cols: 50,\n });\n\n contentWrap.append(existingNotes, contentBreak, newNoteBox);\n\n // Use bootbox.js to build and display the bootstrap modal.\n bootbox.dialog({\n closeButton: true,\n onEscape: true,\n show: true,\n title: `<strong>Notes:</strong><br>${article.title}...`,\n message: contentWrap,\n backdrop: true,\n buttons: {\n save: {\n /* eslint-disable max-len */\n label: '<span class=\"fa fa-pencil-alt\"></span>&nbsp;&nbsp;Save Note',\n /* eslint-enable max-len */\n className: 'btn-primary save-note',\n callback: saveNote,\n },\n close: {\n /* eslint-disable max-len */\n label: '<span class=\"fas fa-times\"></span>&nbsp;&nbsp;Close',\n /* eslint-enable max-len */\n className: 'btn-outline-warning',\n callback: function () {\n bootbox.hideAll();\n },\n },\n },\n });\n\n const notes = {\n id: article.id,\n notes: response || [],\n };\n\n // Attach the existing notes and article id to the save button.\n $('.save-note').data('article', notes);\n\n // Populate the list of existing notes or the message that\n // none have been created yet.\n createNoteList(notes);\n });\n }", "function showNotes() {\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n let html = '';\n\n notesObj.forEach(function (element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onClick=\"deleteNote(this.id)\" class=\"btn btn-primary\" id=\"deleteBtn\">Delete Note</button>\n </div>\n </div>\n `;\n });\n\n let notesElement = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElement.innerHTML = html;\n }\n else {\n notesElement.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\n }\n}", "function showNotes(){\r\n let notes = localStorage.getItem('notes');\r\n\r\n if(notes == null){\r\n notesObj = [];\r\n }else{\r\nnotesObj = JSON.parse(notes)//yaha pr string to array convert ho rha hai\r\n }\r\n\r\n let html = \"\";\r\n notesObj.forEach(function(element,index){\r\n html += `\r\n \r\n <div class=\"card notecard\" style=\"width: 18rem;\">\r\n <img class=\"card-img-top\" src=\"notes.png\" alt=\"Card image cap\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">Note ${index + 1}</h5>\r\n <p class=\"card-text\">${element}.</p>\r\n <button id='${index}' onclick='deleteNote(this.id)' href=\"#\" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div>\r\n \r\n \r\n \r\n `;\r\n\r\n \r\n \r\n });\r\n\r\n let notesElem = document.getElementById('notes');\r\n if(notesObj.length != 0){\r\n notesElem.innerHTML = html;\r\n }else{\r\n notesElem.innerHTML = '<b>Nothing to show!</b> ';\r\n }\r\n}", "function showNotes() {\r\n\r\n let notes = localStorage.getItem('notes');\r\n\r\n if(notes == null){\r\n notesObj = [];\r\n }\r\n else{\r\n notesObj = JSON.parse(notes);\r\n }\r\n let html='';\r\n notesObj.forEach(function(element , index) {\r\n html+=`\r\n <div class=\"noteCard my-2 mx-3 card\" style=\"width:18rem\">\r\n <div class=\"card-body\">\r\n <h3 class=\"card-title\">${element.title}</h3>\r\n <p class=\"card-text\">${element.text}</p>\r\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\" id=\"dltBtn\">Delete Note</button>\r\n </div>\r\n </div>\r\n `;\r\n });\r\n let notesElm=document.getElementById('notes');\r\n if(notesObj.length !=0 ){\r\n notesElm.innerHTML = html;\r\n }\r\n else{\r\n notesElm.innerHTML = `Nothing to show. Use add Note section to add a note.`;\r\n }\r\n}", "function showNotes() {\r\n let notes = localStorage.getItem('notes');\r\n if (notes == null) {\r\n notesObj = [];\r\n } else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n let title = localStorage.getItem('title')\r\n\r\n if (title == null) {\r\n tObj = [];\r\n } else {\r\n tObj = JSON.parse(title);\r\n }\r\n // var date = new Date()\r\n\r\n let time = localStorage.getItem('time')\r\n\r\n if (time == null) {\r\n timeObj = []\r\n } else {\r\n timeObj = JSON.parse(time)\r\n }\r\n let important = localStorage.getItem('important')\r\n\r\n if (important == null) {\r\n timeObj = []\r\n } else {\r\n importantObj = JSON.parse(important)\r\n }\r\n\r\n let html = '';\r\n notesObj.forEach(function(element, index) {\r\n\r\n\r\n html += `\r\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;margin:10px 20px\">\r\n <div class=\"card-body\" style='height:auto;'>\r\n <h5 class=\"card-title titleSearch\">${tObj[index]}</h5>\r\n <p class=\"card-text notes-search edit-element\">${element}</p>\r\n <button href=\"\" id=\"${index}\" onclick='deleteNote(this.id)' type='button' style='margin:10px 0px;display:block;'class=\"btn btn-outline-primary container\">Delete Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='edit(this.id)' type='button' style='margin:10px auto;width:110px;'class=\"btn btn-outline-warning\" >Edit Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='save(this.id)' type='button' style='margin:10px auto;width:110px;'class=\"btn btn-outline-success\">Save Note</button>\r\n <button href=\"\" id=\"${index}\" onclick='important(this.id)' type='button' style='display:block;margin:0px 0px;'class='btn ${importantObj[index]} container'>Mark as Important</button>\r\n </div>\r\n <div class=\"card-footer text-muted\">\r\n ${timeObj[index]}\r\n </div>\r\n </div>\r\n `\r\n });\r\n let notesElm = document.getElementById('notes');\r\n // \r\n let noteChecker = document.getElementById('noteContent')\r\n if (notesObj.length != 0) {\r\n notesElm.innerHTML = html;\r\n\r\n noteChecker.innerHTML = '<i>Here are your added notes</i>'\r\n } else {\r\n noteChecker.innerHTML = '<i>You have nothing here! Add Notes</i>'\r\n }\r\n}", "function displayNotes(notes) {\n\tvar el = document.getElementById('notes-played');\n\tel.innerHTML = notes; \n}", "function showNotes(){\n let html=\" \";\n let notes=localStorage.getItem(\"notes\");\n if(notes==null){\n notesobj=[];\n }\n else{\n notesobj=JSON.parse(notes);\n }\n \n notesobj.forEach(function (element,index) {\n\n html+=`<div class=\"noteCard mx-2 my-2 card \" style=\"width: 18rem;\">\n \n <div class=\"card-body\">\n <h5 class=\"card-title\">Note ${index + 1}</h5>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete note</button>\n </div>\n </div>`;\n\n\n \n \n \n });\n\n let notesElm=document.getElementById('Notes');\n if(notesobj.length != 0)\n {\n notesElm.innerHTML=html;\n }\n else{\n notesElm.innerHTML=`Nothing to show! Use \"Add a Note\" section above to add notes.`; }\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach((element, index) => {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Note ${index + 1}</h5>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNode(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n </div>\n `;\n });\n\n let notesElement = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElement.innerHTML = html;\n } else {\n notesElement.innerHTML = `Nothing to show! Please use \"Add Note\" button above to add a note.`;\n }\n}", "function displayNotesDetails(note){\n return `<p>title: ${note.title}</p><p style=\"display:block\">note: ${note.body}</p>`\n }", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n\n Array.from(notesObj).forEach(function(element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 20rem;\">\n <div class=\"card-body\" style=\"display: inline-block;\">\n <span style=\"display:flex;justify-content:space-between;\">\n <h5 class=\"card-title\">${element.title}</h5>\n <span id=\"star${index}\" style=\"display:none;\"><i class=\"fa fa-star\" aria-hidden=\"true\" style=\"color:#fff200;font-size:20px;\"></i></span> \n </span>\n \n <p class=\"card-text\"> ${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\" style=\"margin-right:55px;border-radius:30px;height:35px;font-size:13px;\">Delete Note</button>\n <button id=\"${index}\" onclick=\"addStarred(this.id)\" value=\"\" class=\"btn btn-primary btn1${index}\" style=\"border-radius:30px;height:35px;font-size:13px;\">Add to Starred</button>\n \n </div>\n </div> `;\n });\n\n let notesElm = document.getElementById(\"notes\");\n\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n\n } else {\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\n\n\n }\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes); //string to array\r\n }\r\n let html = \"\";\r\n notesObj.forEach(function (element, index) {\r\n html += `\r\n <div class=\"card my-2 mx-2\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\"> ${element.title}</h5>\r\n <p class=\"card-text\">${element.text}</p>\r\n <button id=${index} onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div>`;\r\n });\r\n let notesElm = document.getElementById('notes');\r\n if (notesObj.length != 0) {\r\n notesElm.innerHTML = html;\r\n }\r\n else {\r\n notesElm.innerHTML = `<p><strong>Nothing to show! Use \"Add a note\" section to add notes</strong></p>`\r\n }\r\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n if (notes == null) {\r\n notesObj = [];\r\n }\r\n else {\r\n notesObj = JSON.parse(notes);\r\n }\r\n\r\n //9. Create html blank.\r\n let html = \"\";\r\n notesObj.forEach(function (element, index) {\r\n //10. Using for append.\r\n html += ` <div id=\"notes\" class=\"row container-fluid\">\r\n\r\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">Note ${index + 1}</h5>\r\n <p class=\"card-text\">${element}</p>\r\n <button id=\"${index}\" onclick = \"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div>\r\n\r\n </div>`;\r\n\r\n });\r\n\r\n let notesElm = document.getElementById(\"notes\");\r\n if (notesObj.length != 0) {\r\n notesElm.innerHTML = html;\r\n }\r\n else {\r\n notesElm.innerHTML = \"Nothing to show here, please use add notes section to Add Notes.\"\r\n }\r\n\r\n}", "function showNotes() {\n //Fetch notes from local storage.\n let notes = localStorage.getItem('notes');\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n };\n\n //Fetch Notes title from local storage.\n let notesTitle = localStorage.getItem('notesTitle');\n if (notesTitle == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(notesTitle);\n };\n\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n let today = new Date().toLocaleDateString() \n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${index+1}-${titleObj[index]}</h5>\n <h6 class=\"card-title\">Note Create Date:${today}</h6>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\"\n style=\"background-color:#9c4949\">Delete Note</button>\n </div>\n </div>`;\n });\n \n let notesElm = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n notesElm.style.color = 'black';\n }\n else {\n notesElm.innerHTML = `<h4>Nothing to Show! Use \"Add a Note\" section above to add Notes</h4>`;\n notesElm.style.color = 'green';\n }\n}", "function showCards() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n let title = localStorage.getItem(\"title\");\n if (title == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(title);\n }\n\n // notes\n let html = \"\";\n notesObj.forEach(function (e, index) {\n html += `<div class=\"card mx-4 my-3 noteCard\" style=\"width: 18rem; background-image: url('back8.jpeg');\">\n <div class=\"card-body\">\n <img src = \"bulboff.gif\" style=\"height:25px; float: right;\" id=\"${index + 1000}\" class=\"imgClass\" onclick=\"bookmark(this.id);\" >\n <h5 class=\"card-title\" id=\"cardTitle\">${titleObj[index]}</h5>\n <p class=\"card-text\">${e}</p>\n <a class=\"btn btn-primary\" id=\"${index}\" onclick=\"deleteButton(this.id);\">Delete</a>\n <h6 style=\"float:right; color: rgba(0,100,0,0.5);\"></h6>\n </div>\n </div>`;\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length == 0) {\n notesElm.innerHTML = `<h5>Please add some notes!</h5>`;\n }\n else {\n notesElm.innerHTML = html;\n }\n });\n let icon = localStorage.getItem(\"icon\");\n if (icon == null) {\n iconObj = [];\n }\n else {\n iconObj = JSON.parse(icon);\n }\n iconObj.forEach(function (e, index) {\n let iconElem = document.getElementById(`${index + 1000}`);\n if (e == \"on\") {\n iconElem.src = \"bulbon.gif\";\n }\n else {\n if(iconElem != null){\n iconElem.src = \"bulboff.gif\";\n } \n }\n });\n let date = localStorage.getItem(\"date\");\n if(date == null){\n dateObj = [];\n }\n else{\n dateObj = JSON.parse(date);\n }\n dateObj.forEach(function (e,index){\n let dateElem = document.getElementsByTagName(\"h6\");\n dateElem[index].innerHTML = dateObj[index];\n })\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n // let heading = document.getElementById('noteHead').innerText;\n // console.log(heading);\n notesObj.forEach(function(element, index) {\n html += `\n <div class=\"noteCard mx-2 my-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">Note ${index+1}</h5>\n <p class=\"card-text\">${element}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete</button>\n </div>\n </div>`;\n\n\n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = `${html}`;\n } else {\n notesElm.innerHTML = `No notes here. Add a new from above section`;\n }\n}", "function renderNotes(notes) {\n var renderNotesHTMLTemplate = Handlebars.compile($(\"#notes-template\").html());\n $(\"#displayNotes\").html(renderNotesHTMLTemplate(notes));\n $(\"div.description\").dotdotdot({\n after: \"a.more\",\n ellipsis: \"... \",\n wrap: \"word\",\n callback: dotdotdotCallback\n });\n $(\"div.description\").on(\"click\", showMoreClickEventHandler);\n }", "function showNotes()\n{\n let notes=localStorage.getItem(\"notes\"); \n if (notes===null)\n {\n notesObj=[];\n }\n else\n {\n notesObj=JSON.parse(notes);//converts string to objects\n }\n let html=\"\";\n notesObj.forEach(function(element,index){\n if (element.title!=\"\" || element.text!=\"\")\n {\n html += `<div class=\"notecard card mx-2 my-2\" style=\"width: 21.5rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\"> ${element.text}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete</button>\n </div>\n </div>`;\n }\n \n\n })\n let notesEle=document.getElementById(\"notes\");\n if (notesObj.length!=0)\n {\n notesEle.innerHTML=html;\n }\n else{\n notesEle.innerHTML=\"<h4>Nothing to show, add a note</h4>\";\n \n }\n}", "function showNotes() {\n let notes = localStorage.getItem('notes');\n\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html +=\n `<div class=\"container\">\n <div class=\"draggable \" draggable=\"true\">\n <h5 style=\" margin:0px 12px; word-wrap: break-word;\" >${index + 1 + \".\" + element.title}</h5>\n <p style=\"word-wrap: break-word; margin:0px 14px;\" >${element.text}</p>\n <Button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn deletebtn\" style=\"border: 2px solid rgb(95, 91, 91);\n border-radius: 23px;\"0>Delete</button>\n </div>\n </div>`\n });\n\n // when there are no notes then we need to show something\n let notesElm = document.getElementById('notes');\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n }\n else {\n notesElm.innerHTML = `Nothing to Show! Use \"Add Task\" to add New Quick Note`\n }\n}", "function show_note() {\r\n let local = localStorage.getItem('notes');\r\n let cont = document.querySelector('.cont2');\r\n let html = '';\r\n if (local == null) {\r\n notesObj = [];\r\n // show_note();\r\n // return;\r\n }\r\n else {\r\n notesObj = JSON.parse(local);\r\n }\r\n if (notesObj.length != 0) {\r\n notesObj.forEach(function (ele, index) {\r\n if (ele.state == true) {\r\n html += ` <div class=\"card btn-border border\">\r\n <h3>${ele.title}</h3>\r\n <div class=\"text\">\r\n <p id=\"note\">${ele.text}</p>\r\n </div>\r\n <div class=\"btn-class\">\r\n <button class=\"btn btn-red\" id=\"${index}\" onclick=\"delet_btn(this.id)\">Delete</button>\r\n <button class=\"btn btn-yellow\" id=\"${index}\" onclick=\"unmark_btn(this.id)\">Unmark</button>\r\n </div>\r\n </div>`;\r\n\r\n }\r\n else {\r\n\r\n html += ` <div class=\"card border\">\r\n <h3>${ele.title}</h3>\r\n <div class=\"text\">\r\n <p id=\"note\">${ele.text}</p>\r\n </div>\r\n <div class=\"btn-class\">\r\n <button class=\"btn btn-red\" id=\"${index}\" onclick=\"delet_btn(this.id)\">Delete</button>\r\n <button class=\"btn btn-yellow\" id=\"${index}\" onclick=\"mark_btn(this.id)\">Mark</button>\r\n </div>\r\n </div>`;\r\n }\r\n }\r\n )\r\n }\r\n else /*(notesObj.length != 0)*/ {\r\n html = `<div class=\"card border\" style=\"text-align:center;\">\r\n <h1>Add a Note here !</h1>\r\n <div class=\"text\">\r\n <p>No note to display here</p>\r\n </div>\r\n </div>`\r\n }\r\n cont.innerHTML = html;\r\n}", "function showCard() {\r\n let storage = localStorage.getItem('cards');\r\n\r\n if (storage == null) {\r\n cardsObj = [];\r\n } else {\r\n cardsObj = JSON.parse(storage);\r\n }\r\n let inner_html = '';\r\n cardsObj.forEach(function(element, index) {\r\n inner_html += `<div class=\"card cardss\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">${element.Title}</h5>\r\n <p class=\"card-text\">${element.Notes}</p>\r\n <button onclick = 'delete_card(this.id)' id = '${index}' class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div> `\r\n\r\n });\r\n\r\n let saved_notes = document.getElementById('savedNotes')\r\n if (saved_notes == null) {\r\n\r\n saved_notes.innerHTML = 'There is Nothing To show !! Please add Notes from above given Palatte ...'\r\n\r\n } else {\r\n saved_notes.innerHTML = inner_html;\r\n // console.log('element added');\r\n }\r\n\r\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n } else {\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function(element, index) {\n html += `\n <div class=\"note\">\n <p class=\"note-counter\">Note ${index + 1}</p>\n <h3 class=\"note-title\"> ${element.title} </h3>\n <p class=\"note-text\"> ${element.text}</p>\n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"note-btn\">Delete Note</button>\n <button id=\"${index}\"onclick=\"editNote(this.id)\" class=\"note-btn edit-btn\">Edit Note</button>\n </div>\n `;\n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `No Notes Yet! Add a note using the form above.`;\n }\n}", "function renderNotes() {\n noteArray = JSON.parse(localStorage.getItem(\"dayNotes\")) || [];\n $(noteArray).each(function () {\n $(\"#\" + this.id).find(\"textarea\").text(this.note)\n });\n}", "function showNotes() {\r\n let notes = localStorage.getItem(\"notes\");\r\n let title = localStorage.getItem(\"title\");\r\n if (notes === null && title === null)\r\n{\r\n notesObj = [];\r\n titleObj = [];\r\n}\r\nelse\r\n{\r\n notesObj = JSON.parse(notes);\r\n titleObj = JSON.parse(title);\r\n}\r\n\r\nlet html =\"\";\r\nnotesObj.forEach(function(element,index){\r\n\r\nhtml = html + `\r\n<div class=\"noteCard card mx-2 my-2\" style=\"width: 18rem;\">\r\n<div class=\"card-body\">\r\n <h5 class=\"card-title\">${titleObj[index]}</h5> \r\n <p class=\"card-text\">${element}</p>\r\n <button id=${index} onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\r\n</div>\r\n</div>\r\n`\r\n \r\n});\r\n\r\nlet notesElm = document.getElementById('notes');\r\nif(notesObj.length != 0 && titleObj.length !=0){\r\n notesElm.innerHTML = html;\r\n}\r\n\r\nelse {\r\n notesElm.innerHTML = `Nothing to show!! use \"Add a Note\" section to buid a note`;\r\n}\r\n\r\n}", "function showNotes(){\r\n let notes = localStorage.getItem('notes')\r\n if(notes==null){\r\n notesObj = [];\r\n }else{\r\n notesObj = JSON.parse(notes)\r\n\r\n }\r\nlet html = \" \";\r\nnotesObj.forEach(function(element,index) {\r\n \r\n html += ` <div class=\"noteCard my-2 mx-2 card\" style=\"width: 18rem;\">\r\n \r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">Note ${index + 1}</h5>\r\n <p class=\"card-text\">${element}</p>\r\n <button id = \"${index}\" onclick = \"deleteNote(this.id) \" class=\"btn btn-primary\">Delete Note</button>\r\n </div>\r\n </div> `\r\n});\r\nlet notesElm = document.getElementById('notes');\r\nif(notesObj.length!=0){\r\n notesElm.innerHTML = html;\r\n\r\n}else{\r\n notesElm.innerHTML= `Nothing to show ! Use \"Add note \" section above to add notes`;\r\n}\r\n}", "function initNotesDisplay() {\n presenterNotes.style.display = 'flex';\n instructions.style.display = 'none';\n}", "function showNotes(){\n let notes = localStorage.getItem('notes');\n let notesObj;\n\n if(notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes); \n }\n\n let addNote = \"\";\n\n notesObj.forEach((element, index) => {\n addNote += `\n <div class=\"noteCard m-2 card\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${element[0]}</h5>\n <p class=\"card-text\">${element[1]}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n <button onclick=\"editNote(${index})\" class=\"btn btn-primary\">Edit Note</button>\n </div>\n </div>`\n });\n\n let notesEle = document.getElementById('notes');\n if(notesObj.length != 0){\n notesEle.innerHTML = addNote;\n }\n else{\n notesEle.innerHTML = `You haven't add any note yet. Try to to add some note using above section and then press \"Add Note\" button.`\n }\n \n}", "function shownotes() {\n let notes = localStorage.getItem('notes')\n if (notes == null) {\n notesObj = []\n }\n else {\n notesObj = JSON.parse(notes)\n }\n\n\n let html = ''\n notesObj.forEach(function (element, index) {\n html += `<div class=\"notecard my-2 mx-2\" style=\"width: 18rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title addtitle\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button class=\"btn btn-primary\" id=\"${index}\" onclick=\"deleteNote(this.id)\">Delete</button>\n </div>\n </div>`\n \n })\n\n addnote=document.getElementById(\"notes\")\n addnote.innerHTML = html\n}", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n let dateItem = localStorage.getItem(\"dateItem\");\n let starItem = localStorage.getItem(\"starItem\");\n if (notes == null) {\n notesObj = [];\n dateObj = [];\n starObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n dateObj = JSON.parse(dateItem);\n starObj = JSON.parse(starItem);\n }\n\n notesObj = notesObj.reverse();\n dateObj = dateObj.reverse();\n starObj = starObj.reverse();\n\n let html = \"\";\n notesObj.forEach(function (element, index) {\n html += `\n <div class=\"noteCard my-2 mx-2 card\" style=\"width: 21rem;\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${dateObj[index]}</h5>\n <p class=\"card-text\"> ${element}</p>\n <button id=\"${index}\"onclick=\"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n <button id=\"${index}\"onclick=\"starNode(this.id)\" class=\"btn btn-primary\">Star Note</button>\n </div>\n </div>`;\n });\n\n\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n notesElm.innerHTML = html;\n } else {\n notesElm.innerHTML = `You have not created any notes yet`;\n }\n}", "function showNotes(){\n let notes = localStorage.getItem(\"notes\");\n if (notes == null){\n notesObj = [];\n }\n else{\n notesObj = JSON.parse(notes);\n }\n let html = \"\";\n notesObj.forEach(function(element, index){\n html += `\n <div class=\"notes-div\">\n <h1 class=\"notes-head\">${element[0]}</h1>\n <div class=\"notes-content\">\n <p>${element[1]}</p>\n <button id=\"${index}\" onclick=\"deleteNote(this.id)\" class=\"btn\">Delete Note</button>\n </div>\n </div>`\n });\n let notesElm = document.getElementById(\"notes\");\n if (notesObj.length != 0){\n notesElm.innerHTML = html;\n }\n else{\n notesElm.innerHTML = `Nothing to show! Use \"Add a Note\" section above to add notes.`;\n }\n}", "function postNotes() {\n var pagearea = document.querySelector(\".note-box\");\n pagearea.innerHTML = \"\";\n var title = document.createElement(\"div\");\n title.className = \"title\";\n title.innerHTML = `<h1 class=\"display-3\">\n YOUR NOTES\n </h1>\n <hr class=\"cyan accent-1\" />\n `;\n pagearea.appendChild(title);\n notes.sort(function (a, b) {\n return b.pri - a.pri;\n });\n notes.forEach(e => {\n if (e.state) {\n var note = document.createElement(\"div\");\n note.style.transform = `rotate(${randomInteger(-15, 15)}deg)`;\n if (e.pri === \"1\") note.className = `card red accent-3 text-white`;\n else if (e.pri === \"2\") note.className = `card yellow accent-1`;\n else if (e.pri === \"3\") note.className = `card light-green accent-3`;\n note.className += \" hoverable z-depth-1\";\n note.innerHTML = `\n <div class=\"card-body\">\n <h2 style=\"display:none\">${e.id}</h2>\n <h3 class=\"card-title\">${e.title}</h3>\n <pre class=\"card-text\">${e.content}</pre>\n <button class=\"btn btn-primary float-left edit\">Edit</button>\n <button class=\"btn btn-danger delete\"><i class=\"material-icons\">close</i></button>\n </div>\n `;\n pagearea.appendChild(note);\n }\n });\n var x = document.querySelectorAll(\".delete\");\n x.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n sendmsg(\"Note Removed\", \"warning\");\n deleteNote();\n postNotes();\n }\n });\n });\n });\n\n //Update The Note\n\n var edits = document.querySelectorAll(\".edit\");\n edits.forEach(element => {\n element.addEventListener(\"click\", e => {\n notes.forEach((note, i) => {\n if (note.id == element.parentElement.firstElementChild.innerHTML) {\n note.state = 0;\n document.getElementById(\"title\").value = note.title;\n document.getElementById(\"contentbody\").value = note.content;\n btn.innerHTML = \"Apply Changes\";\n }\n });\n });\n });\n}", "function renderNotes() {\r\n for (var i = 0; i < notesListLS.length; i++) {\r\n createMarkup(i);\r\n }\r\n}", "function showNotes(sourceElement) {\n if (!sourceElement.classList.contains(\"control-button-active\")) {\n return\n }\n sourceElement.classList.remove(\"control-button-active\");\n clueCells = document.querySelectorAll(\".game-clue-cell\");\n for (let i = 0; i < clueCells.length; i++) {\n clueCell = clueCells[i];\n note = activeQuestion.clues[i].r;\n if (note !== \"\") {\n clueCell.innerHTML = `<p class='game-clue-cell-note'>${note}</p>`;\n }\n }\n postMessageToDisplay({\"message\":\"showNotes\"});\n}", "function addnote(event) {\r\n event.preventDefault();\r\n\r\n let not = document.createElement(\"div\");\r\n not.classList.add(\"noteCard\", \"my-2\", \"mx-2\", \"card\");\r\n\r\n let notcard = document.createElement(\"div\");\r\n notcard.classList.add(\"card-body\", \"note\");\r\n not.appendChild(notcard);\r\n\r\n let nottitle = document.createElement(\"h5\");\r\n nottitle.classList.add(\"card-title\");\r\n nottitle.innerText = `Note`;\r\n notcard.appendChild(nottitle);\r\n\r\n let nottxt = document.createElement(\"p\");\r\n nottxt.classList.add(\"card-text\");\r\n nottxt.innerText = notetext.value;\r\n notcard.appendChild(nottxt);\r\n\r\n storge(notetext.value);\r\n\r\n let donebtn = document.createElement(\"button\");\r\n donebtn.classList.add(\"done\", \"btn\", \"btn-primary\", \"mr-2\");\r\n donebtn.innerText = \"done\";\r\n notcard.appendChild(donebtn);\r\n\r\n let removebtn = document.createElement(\"button\");\r\n removebtn.classList.add(\"remove\", \"btn\", \"btn-danger\");\r\n removebtn.innerText = \"remove\";\r\n notcard.appendChild(removebtn);\r\n\r\n notes.appendChild(not);\r\n\r\n notetext.value = \"\";\r\n // reload for update the notes session\r\n window.location.reload(1);\r\n}", "function NoteCard(uiNote,curNote,projId){\n\t//data states\n\tvar noteListChanged = true;\n\tvar groupsChanged = true;\n\t\n\t//ui states\n\tvar noteListOpen = false;\n\tvar extendedOpen = true;\n\t\n\t//ui ID values\n\tvar uiNoteTitleId=\"note_title\";\n\tvar uiTextId = \"note_text\";\n\tvar uiQuoteId = \"note_quotes\";\n\tvar uiGroupId = \"note_category\";\n\tvar uiTagsId = \"note_tags\";\n\tvar uiCitLink = \"citLink\";\n\tvar uiNoteListId = \"noteList\";\n\tvar uiGrpPrefix = \"grp\";\n\tvar uiNotePrefix = \"note\";\n\t\n\t//data variables\n\tvar groups = Array();\n\tvar projNotes = Array();\n\t\n\t//constants\n\tvar quoteCharLimit = 2000;\n\tvar noteCharLimit = 2000;\n\t\n\t/********* Start: Method InitNote *************/\n\tthis.InitNote = function(note){\n\t\tif((typeof note) == \"string\" || (typeof note) == \"number\"){\n\t\t\t//is note's id\t\n\t\t\tnote = parseInt(note);\n\t\t\tthis.curNote = remoteNoteList[note];\n\t\t\t//get note data from database\n\t\t\t\n\t\t}else if((typeof note) == \"object\"){\n\t\t\t//is note object\n\t\t\tthis.curNote = note;\n\t\t\t\n\t\t}\n\t\t\n\t\t//this.SetGroups(projId);\n\t\t//this.SetNoteList(projId);\n\t\tthis.Draw();\n\t}\n\t/********* End: Method InitNote *************/\n\t\n\t\n\t/********* Start: Method isExpanded *************/\n\tthis.isExpanded = function(isExp){\n\t\t\tif((typeof isExp) == \"boolean\"){\n\t\t\t\t\tnoteListOpen = isExp;\n\t\t\t}\n\t\t\t\n\t\t\treturn noteListOpen;\n\t}\n\t/********* Start: Method isExpanded *************/\n\t\n\t\n\t\n\t/********* Start: Method ChangeNote *************/\n\tthis.ChangeNote = function(note){\n\t\t//change note within same project\n\t\t\n\t\tif((typeof note) == \"string\" || (typeof note) == \"number\"){\n\t\t\t//is note's id\t\n\t\t\tnote = parseInt(note);\n\t\t\tthis.curNote = remoteNoteList[note];\n\t\t\t//get note data from database\n\t\t\t\n\t\t}else if((typeof note) == \"object\"){\n\t\t\t//is note object\n\t\t\tthis.curNote = note;\n\t\t\t\n\t\t}\n\t\tthis.Draw();\n\t\t\n\t}\n\t/********* End: Method ChangeNote *************/\n\t\n\t\n\t\n\t/********* Start: Method New *************/\n\tthis.New = function(){\n\t\t\n\t\tthis.curNote = {};\n\t\tthis.Draw(true);\n\t\t\n\t}\n\t/********* End: Method New *************/\n\t\n\t\n\t\n\t/********* Start: Method Delete *************/\n\tthis.Delete = function(){\n\t\tvar notObj = this;\n\t\t\n\t\t\n\t\tif(this.curNote.id){\n\t\t\t\n\t\t}else{\n\t\t\t//not saved to db\n\t\t\t\n\t\t\t//NEED CONFIRMATION HERE\n\t\t\t\n\t\t\tnotObj.New();\n\t\t}\n\t\t\n\t\t\n\t\t\n\t}\n\t/********* End: Method Delete *************/\n\t\n\t\n\t\n\t/********* Start: Private Method DeleteNoteFromList *************/\n\tfunction DeleteNoteFromList(id){\n\t\t//this.projNotes[];\n\t\tvar noteIndex = FindProjNote(id);\n\t\t\n\t\tif(typeof noteIndex != \"boolean\"){\n\t\t\tprojNotes.splice(noteIndex, 1);\n\t\t\tnoteListChanged=true;\n\t\t}\n\t\t\n\t\t\n\t}\n\t/********* End: Private Method DeleteNoteFromList *************/\n\t\n\t\n\t/********* Start: Private Method FindProjNote *************/\n\tfunction FindProjNote(id){\n\t\t//add notes\n\t\t\tfor(key in projNotes){\n\t\t\t\tif(projNotes[key].id==id){\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\treturn false;\n\t}\n\t/********* End: Private Method FindProjNote *************/\n\t\n\t\n\t/********* Start: Private Method SelectGroup *************/\n\tfunction SelectGroup(groupId){\n\t\tgroupId = groupId + '';//convert to string if num\n\t\t\n\t\tvar dropdown = $('#' + uiGroupId);\n\t\t\n\t\tdropdown.selectOptions(groupId,true);\n\t}\n\t/********* End: Private Method SelectGroup *************/\n\t\n\t\n\t\n\t/********* Start: Method Draw *************/\n\tthis.Draw = function(drawNoteList){\n\t\t//DrawField(uiNoteTitleId,this.curNote.title);\n\t\tDrawField(uiTextId,this.curNote.text,noteCharLimit);\n\t\tDrawField(uiQuoteId,this.curNote.quote,quoteCharLimit);\n\t\t//DrawField(uiTagsId,this.curNote.tags);\n\t\t//DrawCitLink(this.curNote.citation);\n\t\t\n\t\t//if(groupsChanged){\n\t\t//\tDrawGroups(this.curNote.groupId);\n\t\t//}else{\n\t\t//\tSelectGroup(this.curNote.groupId);\n\t\t//}\n\t\t\n\t\t//if(drawNoteList){\n\t\t//\tthis.DrawNoteList();\n\t\t//}\n\n\n\t\t\n\t\t//if(noteListOpen){\n\t\t//\tSelectNote(this.curNote.id);\n\t\t//}\n\t}\n\t/********* Start: Method Draw *************/\n\t\n\t\n\t\n\t/********* Start: Private Method DrawField *************/\n\tfunction DrawField(id,value,limit){\n\t\t\n\t\t//blank any null/undefined values\n\t\tif(!value) value=\"\";\n\t\t\n\t\tvar field = $('#' + id);\n\t\tif(field.is('textarea')){\n\t\t\t\n\t\t\tfield.val(value);\n\t\t\t\n\t\t\t//clear previous counters\n\t\t\tfield.siblings('.noteCharCounter').remove();\n\t\t\t\n\t\t\t//set up new character count\n\t\t\tfield.charCounter(limit, {\n\t\t\t\t\tcontainer: \"<p></p>\",//\"#'.$fieldName.'_count\",\n\t\t\t\t\tformat: \"Character Limit: %1/2000\",\n\t\t\t\t\tclassname:\"noteCharCounter\",\n\t\t\t\t\tpulse: false\n\t\t\t\t});\n\t\t\t\n\t\t}else{\n\t\t\t\n\t\t\tfield.val(value); \t\n\t\t}\n\t}\n\t/********* End: Private Method DrawField *************/\n\t\n\t\n\t\n\t/********* Start: Private Method DrawGroups *************/\n\tfunction DrawGroups(groupId){\n\t\tvar dropdown = $('#' + uiGroupId);\n\t\tdropdown.empty();\n\t\tdropdown.addOption(\"\",\"Select Group...\");\n\t\tvar dropdownOpt=\"\";\n\t\tfor(key in groups){\n\t\t\t\n\t\t\tdropdown.addOption(groups[key].id, groups[key].title,(groups[key].id==groupId));\n\t\t\t\n\t\t}\n\t\tgroupsChanged=false;\n\t}\n\t/********* End: Private Method DrawGroups *************/\n\t\n\t\n\t\n\t/********* Start: Private Method SelectGroup *************/\n\tfunction SelectGroup(groupId){\n\t\tgroupId = groupId + '';//convert to string if num\n\t\t\n\t\tvar dropdown = $('#' + uiGroupId);\n\t\t\n\t\tdropdown.selectOptions(groupId,true);\n\t}\n\t/********* End: Private Method SelectGroup *************/\n\t\n\t\n\t\n\t/********* Start: Private Method SelectNote *************/\n\tfunction SelectNote(noteId){\n\t\t\n\t\t$('#' + uiNoteListId).find('li').removeClass('current');\n\t\t$('#' + uiNotePrefix + noteId).addClass('current');\n\t\t\n\t}\n\t/********* End: Private Method SelectNote *************/\n\t\n\t\n\t\n\t/********* Start: Private Method DrawCitLink *************/\n\tfunction DrawCitLink(citation){\n\t\tvar citLink = $('#' + uiCitLink);\n\t\t\n\t\tif(citation){\n\t\t\tcitLink.html('This note already has a source assigned. &nbsp;<a href=\"javascript:void;\">View Citation</a>');\n\t\t}else{\n\t\t\tcitLink.html('This note does not yet have a source associated with it yet. &nbsp;<a href=\"javascript:void;\">Add a Citation</a>');\n\t\t}\n\t}\n\t/********* End: Private Method DrawCitLink *************/\n\t\n\t\n\t\n\t/********* Start: Method DrawNoteList *************/\n\tthis.DrawNoteList = function(){\n\t\t\n\t\t//only draw again if note values have changed\n\t\tif(noteListChanged){\n\t\t\tvar noteList = $('#' + uiNoteListId);\n\t\t\tnoteList.html(\"\");\n\t\t\t\n\t\t\t//add groups\n\t\t\tfor(key in groups){\n\t\t\t\t\n\t\t\t\tDrawNoteListGrp(groups[key],noteList);\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//add notes\n\t\t\tfor(key in projNotes){\n\t\t\t\tDrawListNote(projNotes[key],noteList)\n\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tSelectNote(this.curNote.id);\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tnoteListChanged=false;\n\t}\n\t/********* End: Method DrawNoteList *************/\n\t\n\t\n\t\n\t/********* Start: Private Method DrawNoteListGrp *************/\n\tfunction DrawNoteListGrp(grp,noteList){\n\t\t\n\t\tnoteList.find('#' + uiGrpPrefix + grp.id).remove();\n\t\tnoteList.append('<li id=\"' + uiGrpPrefix + grp.id + '\">' + grp.title + '</li>')\n\t\t\n\t}\n\t/********* End: Private Method DrawNoteListGrp *************/\n\t\n\t\n\t/********* End: Private Method DrawListNote *************/\n\tfunction DrawListNote(note,noteList){\n\t\tvar uiGrp = noteList.find('#' + uiGrpPrefix + note.groupId);\n\t\tvar uiNoteId = uiNotePrefix + note.id;\n\t\t\n\t\tif(uiGrp.find('ul').length==0){\n\t\t\tuiGrp.append('<ul></ul>');\t\n\t\t}\n\t\t\n\t\tuiGrp.find('ul').append('<li id=\"' + uiNoteId + '\"><a href=\"#\">' + note.title + '</a></li>');\n\t\t\n\t\t$('#' + uiNoteId).find('a').click(function(){\n\t\t\t\t\t\t\t\t\t\t\t\tobjNoteCard.ChangeNote(note.id);\n\t\t\t\t\t\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\t\t\t\t\t});\n\t\t\n\t}\n\t/********* End: Private Method DrawListNote *************/\n\t\n\t\n\t/********* Start: Method DrawGroups *************/\n\tthis.SetGroups = function(projId){\n\t\t\n\t\t//need to order alphabetically\n\t\tgroups[0] = {id:\"1\",title:\"Astronauts in Space\"};\n\t\tgroups[1] = {id:\"2\",title:\"Bright Sun\"};\n\t\tgroups[2] = {id:\"3\",title:\"Comets and other space objects\"};\n\t\tgroups[3] = {id:\"4\",title:\"Planet Descriptions\"};\n\t\t\n\t\tgroups.sort(CompareGrp);\n\t\tnoteListChanged=true;\n\t}\n\t/********* End: Method DrawGroups *************/\n\t\n\t\n\t\n\t/********* Start: Method SetNoteList *************/\n\tthis.SetNoteList = function(projId){\n\t\t\tprojNotes[0] = new Note({id:remoteNoteList[1].id,title:remoteNoteList[1].title,groupId:remoteNoteList[1].groupId});\n\t\t\tprojNotes[1] = new Note({id:remoteNoteList[2].id,title:remoteNoteList[2].title,groupId:remoteNoteList[2].groupId});\n\t\t\tprojNotes[2] = new Note({id:remoteNoteList[3].id,title:remoteNoteList[3].title,groupId:remoteNoteList[3].groupId});\n\t\t\tprojNotes[3] = new Note({id:remoteNoteList[4].id,title:remoteNoteList[4].title,groupId:remoteNoteList[4].groupId});\n\t\t\tprojNotes[4] = new Note({id:remoteNoteList[5].id,title:remoteNoteList[5].title,groupId:remoteNoteList[5].groupId});\n\t\t\tnoteListChanged=true;\n\t}\n\t/********* End: Method SetNoteList *************/\n\t\n\t\n\t\n\t/********* End: Private Method SortGrp *************/\n\tfunction CompareGrp(a,b){\n\t\t\tif(a.title > b.title)\n\t\t\t return 1\n\t\t if(a.title < b.title)\n\t\t\t return -1\n\t\t return 0 \n\t}\n\t/********* End: Private Method SortGrp *************/\n\t\n\t\n\t\n\t\n\t\n\t\n\t\n\t/********* Start: Method SetTitle *************/\n\tthis.SetTitle = function(title){\n\t\t\n\t}\n\t/********* End: Method SetTitle *************/\n\t\n\t\n\t \n\t/********* Start: Method SetText *************/\n\tthis.SetText = function(text){\n\t\t\n\t}\n\t/********* End: Method SetText *************/\n\t\n\t\n\t\n\t/********* Start: Method SetQuote *************/\n\tthis.SetQuote = function(quote){\n\t\t\n\t}\n\t/********* End: Method SetQuote *************/\n\t\n\t\n\t\n\t/********* Start: Method SetTags *************/\n\tthis.SetTags = function(tagList){\n\t\t\n\t}\n\t/********* End: Method SetTags *************/\n\t\n\t\n\t\n\t/********* Start: Method SetNoteGroup *************/\n\tthis.SetNoteGroup = function(groupId){\n\t\t\n\t}\n\t/********* End: Method SetNoteGroup *************/\n\t\n\t\n\t\n\t/********* Start: Method SetNoteCitation *************/\n\tthis.SetNoteCitation = function(citId){\n\t\t\n\t}\n\t/********* End: Method SetNoteCitation *************/\n\t\n\t//constructor\n\tif(curNote){\n\t\tthis.InitNote(curNote)\t\n\t}\n}", "function showNotes(){\r\n let note = localStorage.getItem(\"note\");\r\n if(note == null){\r\n noteobj =[]\r\n \r\n }else{\r\n noteobj=JSON.parse(note);\r\n }\r\n let text ='';\r\n noteobj.forEach(function(element,index) {\r\n text+=`\r\n <div class=\"card mx-2\" style=\"width: 18rem;\">\r\n <div class=\"card-body\">\r\n <h5 class=\"card-title\">Note ${index +1}</h5>\r\n <p class=\"card-text\"> ${element} </p>\r\n <button id=\"${index}\" onclick=\"deleteing(this.id)\" class=\"btn btn-primary\">Delete</button>\r\n </div>\r\n </div>\r\n `\r\n });\r\n let noteEle = document.getElementById('note');\r\n if(noteobj.length !=0){\r\n noteEle.innerHTML = text;\r\n }else{\r\n noteEle.innerHTML = 'No Note is available. Please write some notes';\r\n }\r\n \r\n}", "renderNotesSection() {\n\t\treturn <Notes\n\t\t\tcolor={colorsProvider.routinesMainColor}\n\t\t\tnotes={this.state.notes}\n\t\t\teditNotes={value => {\n\t\t\t\tthis.props.notes(value);\n\t\t\t}} />\n\t}", "function showNotes()\n{\n let notes = localStorage.getItem('notes');\nif (notes == null)\n{\n notesObj = [];\n}\nelse\n{\n notesObj = JSON.parse(notes);\n}\n\nlet html = '';\nnotesObj.forEach(function(element,index){\n\n html += `\n <div class=\"noteCard my-3 mx-3 card\" style=\"width: 18rem\">\n <div class=\"card-body\">\n <div class=\"cart-title\"><strong>Title: ${element.title}</strong></div>\n <p class=\"card-text\">${element.text}</p>\n <a onclick = \"deleteNote(this.id)\" id = \"${index}\" class=\"btn btn-success\">Delete Notes</a>\n </div>\n</div>`;\n\n});\n\nlet notesEle = document.getElementById('notes')\n\nif (notesObj != 0){\n\n notesEle.innerHTML = html;\n}\nelse{\n\n notesEle.innerHTML = `<strong>Nothing is show here \"Please go above and add some notes\" - Thanks </strong>`\n\n}\n\n}", "function printnote() {\r\n let mynotes = document.getElementById(\"notes\");\r\n let arrayA = JSON.parse(localStorage.getItem(`note`));\r\n if (arrayA == null) {\r\n mynotes.innerHTML = `<h1>Nothing to show here </h1>`;\r\n } else {\r\n let html = \"\";\r\n arrayA.forEach(function (element, index) {\r\n html += `<div class=\"card my-3 mx-3 notecard\" style=\"width: 18rem;\">\r\n <div class=\"card-body addednotes\">\r\n <h5 class=\"card-title\">${element.title1}</h5>\r\n <p class=\"card-text\">${element.text1}</p>\r\n <button class=\"btn btn-primary\" id=\"${index}\" onclick=\"deletefunc(this.id)\">Delete</a>\r\n </div>\r\n </div>`;\r\n });\r\n mynotes.innerHTML = html;\r\n }\r\n}", "function shownotes() {\n let notes = localStorage.getItem('notes');\n\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n let html = \"\"\n notesObj.forEach(function (element, index) {\n html += `\n <div class=\"container my-2 mx-2\"\n <div class=\"card\" style=\"width: 18rem; Border: 2px solid rgb(194, 152, 152);\">\n \n <div class=\"card-body\">\n <h5 class=\"card-title\">${element.title}</h5>\n <p class=\"card-text\">${element.text}</p>\n <button id=\"${index}\" onclick=\"deletenote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n </div>\n </div>\n `;\n\n });\n let noteElm=document.getElementById('notes');\n if(notesObj.length != 0){\n noteElm.innerHTML=html;\n }\n else{\n noteElm.innerHTML=\"You do not have any notes....\"\n }\n \n \n\n}", "function showNoteList(notes) {\n\tif(notes.length === 0) return \"You don\\'t have notes yet...\"\n\tlet result = '';\n\tnotes.map((note)=>{\n\t\tresult += `Title: ${note.title} Body: ${note.body}\\n`;\n\t});\n\treturn result;\n}", "renderNotes(){\n return _.map(this.state.notes, (note, key)=>{\n return( \n <div key={key} className=\"champs1\"> \n \n <h3>{note.title}</h3>\n <p>{note.body}</p>\n </div>\n )\n });\n }", "function appendNote(data) {\n // create a new card and add it to the container \n let head = `\n <div class=\"card bg-info\" id=\"note-${data.id}\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data.title}</h5>\n </div>\n <ul class=\"list-group list-group-flush\">`;\n let foot = `\n </ul>\n <div class=\"card-footer text-right\">\n <button type=\"button\" class=\"btn btn-light\"><i class=\"fa fa-trash-o\" aria-hidden=\"true\"></i></button>\n </div>\n </div>`;\n let list = ``;\n\n if (data.todos !== null) {\n data.todos.forEach(todo => {\n list += `<li class=\"list-group-item\">${todo.body}</li>`\n });\n }\n $(\"#content\").append(head + list + foot);\n}", "function saveNote(){\r\n if($('.notes-list-container').children('.note-item').length > 0){\r\n let content = editor.getContents();\r\n editNoteContent(editorNotebook, editorNote, editor.getContents());\r\n $('.notes-list-container .note-item.selected .note-item-title h4').text((content.ops[0].insert.length > 18) ? content.ops[0].insert.substr(0, 18) + \"...\" : content.ops[0].insert);\r\n }\r\n }", "function displayNotes() {\r\n getItemsFromLocalStorage();\r\n $(\"#display-notes\").html(\"\");\r\n for (var i = notesCount; i > 0; i--) {\r\n var randColor = Math.floor(Math.random(1) * 4);\r\n $(\"#display-notes\").append(`<div style=\"background-color: ${colors[randColor]};border: 2px solid ${colors[randColor]};\" class=\"notes-list grid-content\"><input style=\"float: right;background-color: ${colors[randColor]};border: 0px;border-radius: 50%;\" class=\"close-btn\" type=\"button\" id=\"${i}\" value=\"x\"><p>${notesFromLocalStorage[i-1]}</p> </div>`);\r\n }\r\n }", "hideNotes() {\n for(let note in this.jQueryNotes){\n this.jQueryNotes[note].addClass('hidden');\n }\n }", "function displayNotes(notes) {\n $(\"#todo-list\").empty();\n for (var key in notes) {\n var classes = '';\n if(notes[key].status === 'completed') classes += ' strike';\n else if(notes[key].status === 'archived') continue;\n \n var note = $(`\n <li id='toDoListItem' data-uid=\"${key}\">\n <label class=${classes}>\n <input \n type='checkbox' \n name='todo-item-done' \n class='filled-in todo-item-done' \n value='${notes[key].text}'\n data-uid=\"${key}\" />\n ${notes[key].text}\n <button \n class='todo-item-delete waves-effect waves-light btn deleteItemBtn'\n data-uid=\"${key}\">\n Remove\n </button>\n </label>\n </li>\n `);\n $(\"#todo-list\").append(note);\n }\n }", "listNotes() {\n return [\n 'A',\n 'A#',\n 'Bb',\n 'B',\n 'C',\n 'C#',\n 'Db',\n 'D',\n 'D#',\n 'Eb',\n 'E',\n 'E#',\n 'F',\n 'F#',\n 'Gb',\n 'G',\n 'G#',\n 'Ab',\n ]\n }", "displayNote() {\n return converter.makeHtml(this.note);\n }", "function headline_notes()\n {\n // grab the .data element of the headline to note\n var note_it = $(this).parents(\".card\").data();\n // fetch notes for this headline\n $.get(\"/api/headlines/\" + note_it._id).then(function(data)\n {\n // HTML for notes modal\n var modal_html =\n [\n \"<div class='container-fluid text-center'>\",\n \"<h4>Notes For Article: \",\n note_it._id,\n \"</h4>\",\n \"<hr />\",\n \"<ul class='list-group note-container'>\",\n \"</ul>\",\n \"<textarea class='form-control' placeholder='New Note' rows='4'></textarea>\",\n \"<button class='btn btn-success save'>Save Note</button>\",\n \"</div>\"\n ].join(\"\");\n bootbox.dialog({\n message: modal_html,\n closeButton: true\n });\n var note_obj =\n {\n _id: note_it._id,\n notes: data.notes || []\n };\n // attach headline data to note\n $(\".btn.save\").data(\"headline\", note_obj);\n render_notes(note_obj);\n });\n }", "function displayNotes(notes) {\n var oldContent = document.getElementById('script');\n var para = document.createElement(\"p\");\n para.id = 'script';\n var newContent = document.createTextNode(notes);\n para.appendChild(newContent);\n presenterNotes.replaceChild(para, oldContent);\n}", "getNotes() { return this.notes; }", "function printNotes() {\n let html = \"\";\n let noteData = localStorage.getItem('notes');\n if(noteData == null){\n noteArry = [];\n } else {\n noteArry = JSON.parse(noteData);\n }\n\n for(i = 0; i < noteArry.length; i++){\n let noteVal = noteArry[i]; \n html += `<div class=\"col-12 col-md-4 mb-4 notebox\" id=\"notebox\">\n <div class=\"card\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${noteVal.title}</h5>\n <p class=\"card-text\">${noteVal.description}</p>\n <a id=\"${i}\" onClick=\"deleteNote(this.id)\" class=\"btn btn-info\">Delete</a>\n </div>\n </div>\n </div> `\n }\n\n if (noteArry.length != 0) {\n document.getElementById('notes').innerHTML = html;\n } else {\n document.getElementById('notes').innerHTML = `<div class=\"col-12\">You do not add anything.</div>`;\n }\n}", "function fetchNote(e) {\n if (e.target.className === \"note\") {\n let noteId = e.target.dataset.id\n fetch(`http://localhost:3000/api/v1/notes/${noteId}`)\n .then(resp => resp.json())\n .then(displayNoteCard)\n }\n }", "function displayNotes(data) {\n //clear the notes\n $(\"#notesBody\").empty();\n //if a note array exists\n if (data.note.length !== 0) {\n for (var i = 0; i < data.note.length; i++) {\n // get the body of the note and the associated x that will allow you to delete the note\n let noteP = $(\"<h6>\").text(data.note[i].body);\n let span = $(\"<span>\");\n span.addClass(\"deleteNote\");\n span.addClass(\"float-right\");\n span.html(\"&times;\");\n span.attr(\"data-id\", data.note[i]._id);\n noteP.append(span);\n $(\"#notesBody\").append(noteP);\n }\n } else {\n $(\"#notesBody\").text(\"No new notes for this article yet.\");\n }\n}", "function displayNotes(){\n var notes = noteList.notes\n var result = \"\"\n for (var i = 0; i < notes.length; i++) {\n result += \" <li style='list-style: none'><a href='#\" + notes[i] + \"'>\" + notes[i].substring(0,20) + \"</a></li>\";\n }\n document.getElementById(\"note_list\").innerHTML = result\n }", "function showNote(note, button) {\n shownNote = note;\n shownNoteButton = button;\n $(\"#noteTime\", slide.contentDocument).text(new Date(note.time).toLocaleString());\n $(\"#noteBody\", slide.contentDocument)[0].value = note.body;\n $(\"#noteBody\", slide.contentDocument)[0].focus();\n }", "function _printDescription(item, notes) {\n const description = document.createElement('div');\n description.classList.add('description');\n\n description.textContent = notes;\n item.appendChild(description);\n }", "function addNote() { \n SidebarActions.createNote('Content', $scope.data.thisContent); \n}", "function onload() {\r\n // check localstorage\r\n const notearray = localStorage.getItem(\"items\")\r\n ? JSON.parse(localStorage.getItem(\"items\"))\r\n : [];\r\n // show notes if localstorage have any.\r\n if (notearray !== null) {\r\n notearray.forEach((items) => {\r\n // notes frist parent element\r\n let not = document.createElement(\"div\");\r\n not.classList.add(\"noteCard\", \"my-2\", \"mx-2\", \"card\");\r\n\r\n // notes parent second element\r\n let notcard = document.createElement(\"div\");\r\n notcard.classList.add(\"card-body\", \"note\");\r\n not.appendChild(notcard);\r\n\r\n // notes title\r\n let nottitle = document.createElement(\"h5\");\r\n nottitle.classList.add(\"card-title\");\r\n nottitle.innerText = `Note ${notearray.indexOf(items)}`;\r\n notcard.appendChild(nottitle);\r\n\r\n // notes text\r\n let nottxt = document.createElement(\"p\");\r\n nottxt.classList.add(\"card-text\");\r\n nottxt.innerText = items;\r\n notcard.appendChild(nottxt);\r\n\r\n // done button\r\n let donebtn = document.createElement(\"button\");\r\n donebtn.classList.add(\"done\", \"btn\", \"btn-primary\", \"mr-2\");\r\n donebtn.innerText = \"done\";\r\n notcard.appendChild(donebtn);\r\n\r\n // remove button\r\n let removebtn = document.createElement(\"button\");\r\n removebtn.classList.add(\"remove\", \"btn\", \"btn-danger\");\r\n removebtn.innerText = \"remove\";\r\n notcard.appendChild(removebtn);\r\n\r\n // add second parent second element into first parent element\r\n notes.appendChild(not);\r\n });\r\n }\r\n}", "addNote () {\n const time = Date.now()\n // Default new note\n const note = {\n id: String(time),\n title: 'New note ' + (this.notes.length + 1),\n content: \"**Hi!** This notebook is using [markdown](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) for formatting!\",\n created: time,\n favorite: false,\n }\n // Add to the list\n this.notes.push(note)\n }", "function showNotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n let title = localStorage.getItem(\"title\");\n if (title == null) {\n titleObj = [];\n }\n else {\n titleObj = JSON.parse(title);\n }\n\n let DATE = new Date();\n let yrs = DATE.getFullYear();\n let mon = DATE.getMonth();\n let day = DATE.getDate();\n let fulltime = day + '/' + (mon+1) + '/' + yrs\n // console.log(fulltime)\n\n let date = localStorage.getItem('DATE')\n if (date == null) {\n a = [];\n }\n else {\n a = JSON.parse(date)\n }\n\n let importance = localStorage.getItem('importance')\n if (importance == null) {\n imp_array = []\n }\n else {\n imp_array = JSON.parse(importance)\n }\n\n let str = \"\";\n notesObj.forEach(function (element, index) {\n str = str + `\n <div class=\" noteCard my-2 mx-1 card\" style=\"width: 14rem;\">\n <div class=\"card-body\">\n <h6 class=\"card-title\">${titleObj[index]}</h6>\n <p class=\"card-text\" id=\"card-id\" >${element}</p>\n <button id=\"${index}\" onclick = \"deleteNote(this.id)\" class=\"btn btn-primary\">Delete Note</button>\n </div>\n <div class=\"new_section\" style = \"display:flex;justify-content: space-between\">\n <p id=\"time_box\" style = \"color:red;\">Date :-${a[index]}</p>\n <img src = \"images/${command}_star.png\" id=\"${index}\" onclick=\"ImpMark(this.id)\" width = \"20px\" style=\"height:20px;align-self:center;box-shadow: 1px 2px gray; cursor:pointer;\">\n </div>\n </div>`;\n\n });\n let noteElm = document.getElementById(\"notes\");\n if (notesObj.length != 0) {\n noteElm.innerHTML = str;\n }\n else {\n noteElm.innerHTML = `<p>Nothing to show! Use \"Add a Note\" section above to add notes.</p>`;\n }\n\n}", "function createNoteCard(key, data) {\n // creates div element and adds the note-card class to enable css styling\n let card = document.createElement(\"div\");\n card.classList.add(\"note-card\");\n\n let dateString = data.date;\n if (data.timeEdited != \"\") {\n dateString = dateString.concat(data.timeEdited);\n }\n\n // creates HTML elements for the title, note, and buttons\n let title = createElement(\"h1\", key);\n let date = createElement(\"p\", dateString);\n let note = createElement(\"p\", data.note);\n let buttons = createNoteButtons(\n [{label: \"Edit\", classes: [data.id, \"btn-primary\", \"edit-note\"]},\n {label: \"Delete\", classes: [data.id, \"btn-danger\", \"delete-note\"]}]);\n\n // adds Bootstrap classes to date element\n date.classList.add(\"small\", \"text-muted\");\n\n // adds the created elements to the page\n card.appendChild(title);\n card.appendChild(note);\n card.appendChild(date);\n card.appendChild(buttons);\n\n return card;\n}", "render() {\n this.saveNotes()\n this.displayNotes()\n }", "handler () {\n notes.addNote(title, body);\n }", "function handleArticleNotes(event) {\n // This function handles opening the notes modal and displaying our notes\n // We grab the id of the article to get notes for from the card element the delete button sits inside\n var currentArticle = $(this)\n .parents(\".card\")\n .data();\n // Grab any notes with this headline/article id\n $.get(\"/api/notes/\" + currentArticle._id).then(function (data) {\n // Constructing our initial HTML to add to the notes modal\n var modalText = $(\"<div class='container-fluid text-center'>\").append(\n $(\"<h4>\").text(\"Notes For Article: \" + currentArticle._id),\n $(\"<hr>\"),\n $(\"<ul class='list-group note-container'>\"),\n $(\"<textarea placeholder='New Note' rows='4' cols='60'>\"),\n $(\"<button class='btn btn-success save'>Save Note</button>\")\n );\n // Adding the formatted HTML to the note modal\n bootbox.dialog({\n message: modalText,\n closeButton: true\n });\n var noteData = {\n _id: currentArticle._id,\n notes: data || []\n };\n // Adding some information about the article and article notes to the save button for easy access\n // When trying to add a new note\n $(\".btn.save\").data(\"article\", noteData);\n // renderNotesList will populate the actual note HTML inside of the modal we just created/opened\n renderNotesList(noteData);\n });\n }", "renderCards(){\n //if the user is loggedin we're going to return the NoteCard map\n //else we're going to return a H2 that says Login to add notes\n //go down to 56) now we just call this.renderCards in our section\n if(this.state.loggedIn){\n return this.state.notes.map((note, i) => {\n return (\n <NoteCard note={note} key={`note-${i}`} removeNote={this.removeNote} />\n )\n }).reverse()\n }else{\n return <h2>Login to add notes!</h2>\n }\n }", "function listNotes(){\n var notes = getNotes();\n\n notes.forEach((note) => formatNote(note));\n}", "function insertNote(){\n var card_columns = $('.card-columns');\n\n if ($('#note').val().trim() != null && $('#note').val().trim() != \"\") \n {\n var rendered = compiled_template({ note_value: $('#note').val().trim()});\n\n card_columns.prepend(rendered);\n notes.push({title: $('#note').val(), status:\"active\"});\n localStorage.setItem(\"Notes\",JSON.stringify(notes));\n\n $('#note').val(\"\");\n\n textareaRefresh($('textarea'));\n }\n else {\n $('#note').val(\"\");\n }\n $('#note').each(function () {\n this.style.height = '40px';\n this.style.color = '';\n });\n}", "function displayNotes() {\n note1.innerHTML = notes[0];\n note2.innerHTML = notes[1];\n note3.innerHTML = notes[2];\n note4.innerHTML = notes[3];\n note5.innerHTML = notes[4];\n note6.innerHTML = notes[5];\n note7.innerHTML = notes[6];\n note8.innerHTML = notes[7];\n note9.innerHTML = notes[8];\n note10.innerHTML = notes[9];\n note11.innerHTML = notes[10];\n note12.innerHTML = notes[11];\n note13.innerHTML = notes[0];\n}", "function shownotes() {\n let notes = localStorage.getItem(\"notes\");\n if (notes == null) {\n notesObj = [];\n }\n else {\n notesObj = JSON.parse(notes);\n }\n\n if (notesObj.length == 0) {\n let notesContainer = document.getElementById('notes');\n notesContainer.innerHTML = `No notes to show!`\n }\n else {\n let notesContainer = document.getElementById('notes');\n notesContainer.innerHTML = '';\n }\n\n notesObj.forEach((element, index) => {\n htmlText = `\n <div class=\"forsearch alert alert-primary\" width = \"screen-width\" style=\"inline\" name=\"savedNotes\" float=\"left\" >\n <p id=${index + 1}> Note-<em> ${getMyDate(index)} </em>:<strong> <i>${getTitle(index)} <i>: ${element}</strong></p>\n \n <input id = ${index} class=\"alert alert-primary\" type=\"button\" value=\"Delete\" onclick=\"deteleNote(this.id)\">\n </div>\n `\n let notesContainer = document.getElementById('notes');\n notesContainer.innerHTML += htmlText;\n });\n}", "function newNote(){\n document.getElementById(\"addNote\").style.display = \"block\";\n document.getElementById(\"note-div\").style.display = \"none\";\n document.getElementById(\"newNote\").style.display = \"none\";\n }", "function showOpenNotes() {\n openNotes.forEach(function (note) {\n const noteButton = createButton(note);\n\n noteButton.style.height = noteButton.style.width = imageHeight / 7 + 'px';\n noteButton.style.margin = 2 + 'px';\n\n fretboardDiv.insertBefore(noteButton, fretboardDiv.firstChild);\n });\n}", "function displayNotes (){\n if (localStorage.getItem(\"generalInfo\")){\n generalInfo = JSON.parse(localStorage.getItem(\"generalInfo\"));\n for(i = 0; i < generalInfo.length; i++){\n $(\"#inputEvent\"+generalInfo[i].display).attr(\"value\", generalInfo[i].notes);\n console.log($(\"#inputEvent\"+generalInfo[i].display));\n }\n }\n }", "function showCardOrSpeak (detail, conv) {\n var hasScreen = conv.surface.capabilities.has('actions.capability.SCREEN_OUTPUT'); \n if (hasScreen) {\n var cards = [];\n for(var i = 0; i < detail.length; i++) {\n var d = new Date(0); \n d.setUTCSeconds(detail[i].time);\n var desc = detail[i].score + ' points by ' + detail[i].by + ' ' + ta.ago(d);\n desc += ' | ';\n desc += detail[i].descendants + ' comments';\n var link = detail[i].url;\n if (link === undefined) {\n link = \"https://assistant.google.com\";\n }\n cards.push(new BrowseCarouselItem({\n title: detail[i].title,\n url: link,\n description: desc,\n }));\n }\n conv.ask(new BrowseCarousel({items: cards}));\n conv.ask(new Suggestions(['top 🕶', 'new 🔥', 'best 🎉', 'random 👾']));\n conv.ask(new LinkOutSuggestion({\n name: 'web',\n url: 'https://news.ycombinator.com/',\n }));\n } else {\n let ssml = \"<speak><p>\";\n for(var i = 0; i < detail.length; i++) {\n ssml += '<s><say-as interpret-as=\"ordinal\">' + (i+1) + '</say-as>.<break time=\"0.6s\"/>' + detail[i].title + '.</s><break time=\"0.5s\"/>';\n }\n ssml += \"<s>What else I can help?</s></p></speak>\";\n conv.ask(ssml);\n }\n return;\n}", "function loadNotes() {\n noteId = 0;\n idx = 1;\n notes = [];\n document.getElementById('data').innerHTML = '';\n\n chrome.storage.sync.get('todos_notes', function(result) {\n notes = result.todos_notes;\n if (!notes) {\n notes = [''];\n }\n createNotes(notes, idx, 0);\n });\n }", "function listNotes() {\n fetch(url)\n .then(res => res.json())\n .then(data => {\n for (let item of data) {\n renderNoteText(item)\n }\n })\n}", "function addNote() {\n if (noteText.value === \"\") {\n return;\n } else {\n notesCounter++;\n var note = {\n noteId: notesCounter,\n noteText: noteText.value,\n noteHead: noteHead.value,\n colorBg: noteDiv.style.background || \"rgb(255, 255, 255)\",\n tags: [],\n noteFavorite: false,\n noteFavoritePos: null,\n };\n // Add note to front end array\n notes.unshift(note);\n noteDiv.style.background = \"#ffffff\";\n renderNote(note);\n clearInputs();\n noteHead.style.display = \"none\";\n noteBot.style.display = \"none\";\n }\n console.log(note);\n }", "function createNote() {\n return '<div class=\"note\"> </div> \\n';\n}", "displayNote(key, message) {\n let note = document.getElementById(key);\n // If no element with the given key exists we create a new note.\n if (!note) {\n note = document.createElement(\"sticky-note\");\n note.id = key;\n this.notesContainer.insertBefore(\n note,\n this.notesSectionTitle.nextSibling\n );\n }\n // If the message is null we delete the note.\n if (!message) {\n return note.deleteNote();\n }\n note.setMessage(message);\n }", "function addNote() {\n self.showAdd = !self.showAdd;\n }", "function handleAdding() {\n notes.style.display = 'flex'\n}", "function getNote () {\n\n var note = {\n owner: \"[email protected]\",\n title: \"todo\",\n items: [ \"laundry\", \"apply jobs\", \"gym\" ],\n createDate: \"1/1/2016\",\n lastModified: \"1/2/2016\",\n sharedWith: \"[email protected]\"\n }\n\n return note;\n\n } //end getNote()" ]
[ "0.70757735", "0.7068063", "0.7024401", "0.7015538", "0.6989494", "0.6975344", "0.69717884", "0.69599974", "0.6945203", "0.69298", "0.6918386", "0.69122684", "0.69076717", "0.6893904", "0.68903303", "0.688755", "0.688374", "0.6879642", "0.68733823", "0.68719006", "0.6840102", "0.6837774", "0.68351156", "0.68092185", "0.6799553", "0.6796424", "0.67900133", "0.6789841", "0.6779655", "0.67713344", "0.6756096", "0.67494094", "0.67465544", "0.67440814", "0.67331994", "0.6724324", "0.6689782", "0.6686443", "0.66754305", "0.6671561", "0.66619784", "0.6625713", "0.6618016", "0.66152835", "0.661383", "0.65785265", "0.6553094", "0.6525666", "0.6522894", "0.6482962", "0.646179", "0.6424582", "0.64223063", "0.6419343", "0.6409923", "0.6382403", "0.63656753", "0.6356099", "0.6349508", "0.63448995", "0.63279605", "0.6323412", "0.6312634", "0.631126", "0.63096225", "0.63008004", "0.6278601", "0.6269469", "0.62694585", "0.62636817", "0.6241134", "0.6237356", "0.62290543", "0.62066084", "0.62008613", "0.6195732", "0.6188429", "0.61805326", "0.61761147", "0.6173985", "0.61697125", "0.6155609", "0.61429673", "0.6139442", "0.6087608", "0.60832185", "0.60803527", "0.60774606", "0.60721296", "0.60721076", "0.60704684", "0.60642457", "0.60636944", "0.6059785", "0.6055914", "0.6048627", "0.603965", "0.60349065", "0.6006927", "0.6005989", "0.60051024" ]
0.0
-1
! perfectscrollbar v1.5.2 Copyright 2021 Hyunje Jun, MDBootstrap and Contributors Licensed under MIT
function i(t){return getComputedStyle(t)}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initializeScrollbar() { \n $(\".mcustomScroll\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"yx\",\n advanced:{\n updateOnContentResize: true\n }\n });\n\n $(\".mcustomScroll.mcustomScrollVerticalOnly\").mCustomScrollbar({ \n theme:\"dark-3\",\n axis:\"y\",\n advanced:{\n updateOnContentResize: true\n }\n });\n }", "updateMenuScrollArea(){\n \n //$('#sidebar-scroller').perfectScrollbar('update');\n \n }", "function initCustomScrollbar() {\n $('.custom-scroll').mCustomScrollbar({});\n}", "render(){\n SimpleScrollbar.initEl(document.querySelector(\".messBox\"))\n }", "function customScroll(elemento) {\n if ($.fn.mCustomScrollbar) {\n //$('.withScroll').each(function() {\n $(elemento).mCustomScrollbar(\"destroy\");\n var scroll_height = $(elemento).data('height') ? $(elemento).data('height') : 'auto';\n var data_padding = $(elemento).data('padding') ? $(elemento).data('padding') : 0;\n if ($(elemento).data('height') == 'window') {\n thisHeight = $(elemento).height();\n windowHeight = $(window).height() - data_padding - 50;\n if (thisHeight < windowHeight) scroll_height = thisHeight;\n else scroll_height = windowHeight;\n }\n $(elemento).mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: $(elemento).hasClass('show-scroll') ? false : true,\n scrollInertia: 150,\n theme: \"light\",\n set_height: scroll_height,\n advanced: {\n updateOnContentResize: true\n }\n });\n //});\n }\n}", "function customScroll() {\n if ($.fn.mCustomScrollbar) {\n $('.withScroll').each(function() {\n $(this).mCustomScrollbar(\"destroy\");\n var scroll_height = $(this).data('height') ? $(this).data('height') : 'auto';\n var data_padding = $(this).data('padding') ? $(this).data('padding') : 0;\n if ($(this).data('height') == 'window') {\n thisHeight = $(this).height();\n windowHeight = $(window).height() - data_padding - 50;\n if (thisHeight < windowHeight) scroll_height = thisHeight;\n else scroll_height = windowHeight;\n }\n $(this).mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: $(this).hasClass('show-scroll') ? false : true,\n scrollInertia: 150,\n theme: \"light\",\n set_height: scroll_height,\n advanced: {\n updateOnContentResize: true\n }\n });\n });\n }\n}", "function qodefSideAreaScroll(){\n\t\tvar sideMenu = $('.qodef-side-menu');\n\t\t\n\t\tif(sideMenu.length){\n sideMenu.perfectScrollbar({\n wheelSpeed: 0.6,\n suppressScrollX: true\n });\n\t\t}\n\t}", "function updateScrollbar() {\n $messages.mCustomScrollbar(\"update\").mCustomScrollbar('scrollTo', 'bottom', {\n scrollInertia: 10,\n timeout: 0\n });\n}", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else {\n d.scrollbarV.style.display = \"\";\n d.scrollbarV.firstChild.style.height = \"0\";\n }\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else {\n d.scrollbarH.style.display = \"\";\n d.scrollbarH.firstChild.style.width = \"0\";\n }\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0) {\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n d.scrollbarV.style.pointerEvents = d.scrollbarH.style.pointerEvents = \"none\";\n }\n }", "function updateScrollbars(cm) {\n var d = cm.display, docHeight = cm.doc.height;\n var totalHeight = docHeight + paddingVert(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n d.gutters.style.height = Math.max(totalHeight, d.scroller.clientHeight - scrollerCutOff) + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > (d.scroller.clientWidth + 1);\n var needsV = scrollHeight > (d.scroller.clientHeight + 1);\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height =\n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (needsH && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = scrollbarWidth(d.measure) + \"px\";\n d.gutterFiller.style.width = d.gutters.offsetWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "_resetSidebarScroll() {\n // sidebar - scroll container\n $('.slimscroll-menu').slimscroll({\n height: 'auto',\n position: 'right',\n size: '5px',\n color: '#9ea5ab',\n wheelStep: 5,\n touchScrollStep: 20,\n });\n }", "function customScroll() {\r\n\t\tvar windowWidth = $(window).width();\r\n\t\tif (windowWidth > 991) {\r\n\t\t\t// Custom Subpage Scroll\r\n\t\t\t$(\".pt-page\").mCustomScrollbar({\r\n\t\t\t\tscrollInertia: 8\r\n\t\t\t});\r\n\r\n\t\t\t// Custom Header Scroll\r\n\t\t\t$(\"#site_header\").mCustomScrollbar({\r\n\t\t\t\tscrollInertia: 8\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\t$(\".pt-page\").mCustomScrollbar('destroy');\r\n\r\n\t\t\t$(\"#site_header\").mCustomScrollbar('destroy');\r\n\t\t}\r\n\t}", "function setCustomScrollBars() {\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : BEGIN * * */\n /*http://manos.malihu.gr/jquery-custom-content-scroller/*/\n //$(\".consoleLogOutput\").append('<div class=\"consoleLog_helm\">$(window).load() event starting.</div>');\n if (Compass.Global.isInternetExplorer === false) {\n $(\"#LoanDatesPanelContent_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n callbacks: {\n onScrollStart: function () {\n Compass.Helm.hideHelpPopOvers();\n }\n },\n scrollInertia: 500\n\n });\n $(\"#LoanContactsListContainer_helm\").mCustomScrollbar({\n theme: \"dark\",\n alwaysShowScrollbar: 0, //Disable scrolll bar when there’s nothing to scroll.\n //scrollbarPosition: \"outside\",\n snapAmount: 26,\n snapOffset: 3,\n mouseWheel: {\n deltaFactor: 28,\n normalizeDelta: false\n },\n scrollInertia: 500\n\n });\n }\n /* * * M a l i h u j Q u e r y C u s t o m C o n t e n t S c r o l l e r : END * * */\n }", "function updateScroll(){if(!elements.li[0])return;var height=elements.li[0].offsetHeight,top=height*ctrl.index,bot=top+height,hgt=elements.scroller.clientHeight,scrollTop=elements.scroller.scrollTop;if(top<scrollTop){scrollTo(top);}else if(bot>scrollTop+hgt){scrollTo(bot-hgt);}}", "function mkdfCompareHolderScroll(){\n var compareHolderScroll = $('.mkdf-re-compare-holder .mkdf-re-compare-holder-scroll');\n if(compareHolderScroll.length){\n compareHolderScroll.perfectScrollbar({\n wheelSpeed: 0.6,\n suppressScrollX: true\n });\n }\n }", "function monitorScroll() {\n SidebarActions.monitorScroll()\n}", "function sizeScrollbar() {\n\t\t\t}", "function customScroll() {\n $( '.cn-custom-scroll' ).mCustomScrollbar( {\n theme: \"dark-2\",\n scrollEasing: \"linear\",\n scrollInertia: 200,\n } );\n\n $( '.cn-custom-scroll-inner' ).bind( 'mousewheel DOMMouseScroll', function( e ) {\n var e0 = e.originalEvent,\n delta = e0.wheelDelta || -e0.detail;\n\n this.scrollTop += ( delta < 0 ? 1 : -1 ) * 30;\n e.preventDefault();\n } );\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\t\t\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\t\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else d.scrollbarFiller.style.display = \"\";\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else d.gutterFiller.style.display = \"\";\n\t\t }", "function destroySideScroll() {\n $('.sidebar-inner').mCustomScrollbar(\"destroy\");\n}", "function destroySideScroll() {\n $('.sidebar-inner').mCustomScrollbar(\"destroy\");\n}", "function scroller_multiselect() {\n $('.multi_choice').find('ul').addClass('scroller');\n $('.multi_choice').find('ul').slimScroll({\n height: 'auto'\n });\n}", "refreshVirtualScrollbars() {\n // NOTE: This was at some point changed to only run on platforms with width-occupying scrollbars, but it needs\n // to run with overlayed scrollbars also to make them show/hide as they should.\n const me = this,\n {\n headerContainer,\n footerContainer,\n virtualScrollers,\n hasVerticalOverflow\n } = me,\n // We need to ask each subGrid if it has horizontal overflow.\n // If any do, we show the virtual scroller, otherwise we hide it.\n hasHorizontalOverflow = Object.values(me.subGrids).some(subGrid => subGrid.overflowingHorizontally),\n method = hasVerticalOverflow ? 'add' : 'remove';\n\n if (hasHorizontalOverflow) {\n virtualScrollers.classList.remove('b-hide-display');\n } else {\n virtualScrollers.classList.add('b-hide-display');\n } // Auto-widthed padding element at end hides or shows to create matching margin.\n\n if (DomHelper.scrollBarWidth) {\n headerContainer.classList[method]('b-show-yscroll-padding');\n footerContainer.classList[method]('b-show-yscroll-padding');\n virtualScrollers.classList[method]('b-show-yscroll-padding');\n } // Change of scrollbar status means height change\n\n me.onHeightChange();\n }", "function updateScrollbarsInner(cm, measure) {\n\t\t var d = cm.display;\n\t\t var sizes = d.scrollbars.update(measure);\n\n\t\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n\t\t if (sizes.right && sizes.bottom) {\n\t\t d.scrollbarFiller.style.display = \"block\";\n\t\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t\t } else { d.scrollbarFiller.style.display = \"\"; }\n\t\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t\t d.gutterFiller.style.display = \"block\";\n\t\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t\t } else { d.gutterFiller.style.display = \"\"; }\n\t\t }", "function customCasClientScroll(){\n\tfor (var key in niceScrolls){\n\t\t // virer les scrollbars qui trainent\n\t try {\n\t\t niceScrolls[key].resize().hide().remove();\n \t } catch (e) {}\n\t}\n\tniceScrolls = [];\n\tif($(window).width()>767){\n\t\tniceScrolls.push($(\"#masque-slides-cas-clients\").niceScroll({\n\t\t\tcursorcolor: \"#054b90\",\n\t\t\tcursorwidth: \"3px\",\n\t\t\tcursorborderradius: \"3px\",\n\t\t\trailalign: \"right\",\n\t\t\tbackground: \"rgba(255, 255, 255, 0.2)\",\n\t\t\tcursorborder: \"none\",\n\t\t\tautohidemode: \"none\"\n\t\t}));\n\t}\n}", "function createSideScroll() {\n if ($.fn.mCustomScrollbar) {\n destroySideScroll();\n if (!$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('submenu-hover') && $('body').hasClass('fixed-sidebar')) {\n $('.sidebar-inner').mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: true,\n scrollInertia: 150,\n theme: \"light-thin\",\n advanced: {\n updateOnContentResize: true\n }\n });\n }\n if ($('body').hasClass('sidebar-top')) {\n destroySideScroll();\n }\n }\n }", "function createSideScroll() {\n if ($.fn.mCustomScrollbar) {\n destroySideScroll();\n if (!$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('submenu-hover') && $('body').hasClass('fixed-sidebar')) {\n $('.sidebar-inner').mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: true,\n scrollInertia: 150,\n theme: \"light-thin\",\n advanced: {\n updateOnContentResize: true\n }\n });\n }\n if ($('body').hasClass('sidebar-top')) {\n destroySideScroll();\n }\n }\n }", "function initSidenavScroll() {\n let sidenav = $(\".sidenav-list\");\n let sidenav_active_elements = $(\".sidenav .active\");\n if (sidenav_active_elements.length > 0) setTimeout(() => { //setTimeout gives bootstrap time to execute first\n sidenav[0].scrollTop = sidenav_active_elements[0].offsetTop - 60;\n });\n}", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\t\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\t\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\t d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "function createSideScroll() {\n if ($.fn.mCustomScrollbar) {\n destroySideScroll();\n if (!$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('submenu-hover') && $('body').hasClass('fixed-sidebar')) {\n $('.sidebar-inner').mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: true,\n scrollInertia: 150,\n theme: \"light-thin\",\n advanced: {\n updateOnContentResize: true\n }\n });\n }\n if ($('body').hasClass('sidebar-top')) {\n destroySideScroll();\n }\n }\n}", "function createSideScroll() {\n if ($.fn.mCustomScrollbar) {\n destroySideScroll();\n if (!$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('sidebar-collapsed') && !$('body').hasClass('submenu-hover') && $('body').hasClass('fixed-sidebar')) {\n $('.sidebar-inner').mCustomScrollbar({\n scrollButtons: {\n enable: false\n },\n autoHideScrollbar: true,\n scrollInertia: 150,\n theme: \"light-thin\",\n advanced: {\n updateOnContentResize: true\n }\n });\n }\n if ($('body').hasClass('sidebar-top')) {\n destroySideScroll();\n }\n }\n}", "componentDidUpdate() {\n // Scroll down\n if (this.props.contributionForm.boardScroll) {\n this.setScroll()\n }\n }", "onListChange() {\n this.refs.scrollbar.updatePositions()\n }", "function updateScrollbarsInner(cm, measure) {\n\t var d = cm.display;\n\t var sizes = d.scrollbars.update(measure);\n\n\t d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n\t d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n\t if (sizes.right && sizes.bottom) {\n\t d.scrollbarFiller.style.display = \"block\";\n\t d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n\t d.scrollbarFiller.style.width = sizes.right + \"px\";\n\t } else d.scrollbarFiller.style.display = \"\";\n\t if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n\t d.gutterFiller.style.display = \"block\";\n\t d.gutterFiller.style.height = sizes.bottom + \"px\";\n\t d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n\t } else d.gutterFiller.style.display = \"\";\n\t }", "updateScroll(){\n \t\tif (this.$.content.scrollHeight > this.$.content.offsetHeight){\n \t\t\tthis.$.content.scrollTop = this.$.content.scrollHeight - this.$.content.offsetHeight;\n \t\t}\n \t}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\r\n var d = cm.display;\r\n var sizes = d.scrollbars.update(measure);\r\n\r\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\r\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\r\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\r\n\r\n if (sizes.right && sizes.bottom) {\r\n d.scrollbarFiller.style.display = \"block\";\r\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\r\n d.scrollbarFiller.style.width = sizes.right + \"px\";\r\n } else { d.scrollbarFiller.style.display = \"\"; }\r\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\r\n d.gutterFiller.style.display = \"block\";\r\n d.gutterFiller.style.height = sizes.bottom + \"px\";\r\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\r\n } else { d.gutterFiller.style.display = \"\"; }\r\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display\n var sizes = d.scrollbars.update(measure)\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\"\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\"\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\"\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\"\n d.scrollbarFiller.style.height = sizes.bottom + \"px\"\n d.scrollbarFiller.style.width = sizes.right + \"px\"\n } else { d.scrollbarFiller.style.display = \"\" }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\"\n d.gutterFiller.style.height = sizes.bottom + \"px\"\n d.gutterFiller.style.width = measure.gutterWidth + \"px\"\n } else { d.gutterFiller.style.display = \"\" }\n}", "getScrollElement() {\n return this.contentWrapperEl;\n }", "activateScrollableSidebar() {\n this.body.attr('data-leftbar-compact-mode', 'scrollable');\n var leftMenuContainer = $('#left-side-menu-container');\n leftMenuContainer.slimScroll({ destroy: true });\n leftMenuContainer.removeClass('slimscroll-menu');\n leftMenuContainer.removeAttr('style');\n this._resetSidebarScroll();\n }", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t };\n\t\t }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else d.gutterFiller.style.display = \"\";\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n }", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function updateScrollbarsInner(cm, measure) {\n var d = cm.display;\n var sizes = d.scrollbars.update(measure);\n\n d.sizer.style.paddingRight = (d.barWidth = sizes.right) + \"px\";\n d.sizer.style.paddingBottom = (d.barHeight = sizes.bottom) + \"px\";\n d.heightForcer.style.borderBottom = sizes.bottom + \"px solid transparent\";\n\n if (sizes.right && sizes.bottom) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = sizes.bottom + \"px\";\n d.scrollbarFiller.style.width = sizes.right + \"px\";\n } else { d.scrollbarFiller.style.display = \"\"; }\n if (sizes.bottom && cm.options.coverGutterNextToScrollbar && cm.options.fixedGutter) {\n d.gutterFiller.style.display = \"block\";\n d.gutterFiller.style.height = sizes.bottom + \"px\";\n d.gutterFiller.style.width = measure.gutterWidth + \"px\";\n } else { d.gutterFiller.style.display = \"\"; }\n}", "function measureForScrollbars(cm) {\n\t\t var d = cm.display, gutterW = d.gutters.offsetWidth;\n\t\t var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n\t\t return {\n\t\t clientHeight: d.scroller.clientHeight,\n\t\t viewHeight: d.wrapper.clientHeight,\n\t\t scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n\t\t viewWidth: d.wrapper.clientWidth,\n\t\t barLeft: cm.options.fixedGutter ? gutterW : 0,\n\t\t docHeight: docH,\n\t\t scrollHeight: docH + scrollGap(cm) + d.barHeight,\n\t\t nativeBarWidth: d.nativeBarWidth,\n\t\t gutterWidth: gutterW\n\t\t }\n\t\t }", "function Scroll(){\n\n const content = document.querySelector(\".content\");\n const sidebar = document.querySelector(\".sidebar\");\n const controller = new ScrollMagic.Controller();\n const scene = new ScrollMagic.Scene({\n triggerElement: sidebar,\n triggerHook: 0,\n offset: -140,\n duration: getDuration\n }).addTo(controller);\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n }\n window.addEventListener(\"resize\", () => {\n if (window.matchMedia(\"(min-width: 1200px)\").matches) {\n scene.setPin(sidebar, {\n pushFollowers: false\n });\n } else {\n scene.removePin(sidebar, true);\n }\n });\n\n function getDuration() {\n return content.offsetHeight - sidebar.offsetHeight;\n }\n\n}", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScrollbars(d /* display */, docHeight) {\n var totalHeight = docHeight + 2 * paddingTop(d);\n d.sizer.style.minHeight = d.heightForcer.style.top = totalHeight + \"px\";\n var scrollHeight = Math.max(totalHeight, d.scroller.scrollHeight);\n var needsH = d.scroller.scrollWidth > d.scroller.clientWidth;\n var needsV = scrollHeight > d.scroller.clientHeight;\n if (needsV) {\n d.scrollbarV.style.display = \"block\";\n d.scrollbarV.style.bottom = needsH ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarV.firstChild.style.height = \n (scrollHeight - d.scroller.clientHeight + d.scrollbarV.clientHeight) + \"px\";\n } else d.scrollbarV.style.display = \"\";\n if (needsH) {\n d.scrollbarH.style.display = \"block\";\n d.scrollbarH.style.right = needsV ? scrollbarWidth(d.measure) + \"px\" : \"0\";\n d.scrollbarH.firstChild.style.width =\n (d.scroller.scrollWidth - d.scroller.clientWidth + d.scrollbarH.clientWidth) + \"px\";\n } else d.scrollbarH.style.display = \"\";\n if (needsH && needsV) {\n d.scrollbarFiller.style.display = \"block\";\n d.scrollbarFiller.style.height = d.scrollbarFiller.style.width = scrollbarWidth(d.measure) + \"px\";\n } else d.scrollbarFiller.style.display = \"\";\n\n if (mac_geLion && scrollbarWidth(d.measure) === 0)\n d.scrollbarV.style.minWidth = d.scrollbarH.style.minHeight = mac_geMountainLion ? \"18px\" : \"12px\";\n }", "function updateScroll () {\n if (!elements.li[0]) return;\n if (mode === MODE_STANDARD) {\n updateStandardScroll();\n } else {\n updateVirtualScroll();\n }\n }", "componentDidUpdate () {\n this.setHeight();\n this.scrollList();\n }", "function toggleScrollbar() {\n adjustColumnOverflow(\"hidden\");\n}", "function initScroll(){var windowH=$(window).height(),newW=windowH/1400*29232+1e3/windowH*3;scrollWidth=newW-$(window).width(),$(\".helper\").width(newW),$(\"#wrapper,.helper\").height(windowH),myscroll=new iScroll(\"wrapper\",{hScrollbar:!0,useTransition:!0,hScroll:!0,vScroll:!1,checkDOMChanges:!0,bounce:!1,scrollbarClass:\"myScrollbar\"}),\n// \nmyscroll.options.onScrollStart=function(){\"block\"==$(\".detail\").css(\"display\")&&($(\".detail\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\")),\"block\"==$(\".detail-w\").css(\"display\")&&($(\".detail-w\").css(\"display\",\"none\"),$(\"#daoyu\").attr(\"id\",\"\"))},myscroll.options.onScrollEnd=function(){$(\".myScrollbarH\").hide(),timer&&clearTimeout(timer),timer=setTimeout(function(){clearTimeout(timer),timer=null,myscroll.scrollTo(myscroll.x+scrollWidth,0,Math.abs(5e5*(scrollWidth+myscroll.x)/scrollWidth),\"relative\")},2e4)},myscroll.scrollTo(scrollWidth,0,5e5,\"relative\"),$(\".myScrollbarH\").hide()}", "_addScrollBar() {\n const canvas = this.getCanvas();\n\n canvas.add(this._horizontalScroll);\n canvas.add(this._verticalScroll);\n\n if (this.scrollBarTid) {\n clearTimeout(this.scrollBarTid);\n }\n\n this.scrollBarTid = setTimeout(() => {\n canvas.remove(this._horizontalScroll);\n canvas.remove(this._verticalScroll);\n }, 3000);\n }", "function createScrollBar() {\n\tvar $d = $('#skill_content');\n\tvar $j = $d.data('jsp');\n\n\tif ( $j ) {\n\t\t$j.reinitialise();\n\t} else {\n\t\t$d.jScrollPane({verticalGutter: 10});\n\t\tvar $e = $d.data('jsp').getContentPane();\n\t\t\n\t\tif ( $e.next().hasClass('jspVerticalBar') ) {\n\t\t\t$e.addClass('filler');\n\t\t} else {\n\t\t\t$d.css({'background-color': 'rgba(0,0,0,0.5)'});\n\t\t}\n\t}\n}", "_verticalScrollbarHandler(event) {\n const that = this;\n const value = event.detail.value;\n event.stopPropagation();\n\n if (that.isVirtualized) {\n that._recycle();\n }\n else {\n that.$.itemsContainer.scrollTop = value;\n }\n\n that._updateTopVisibleIndex();\n\n if (event.context.max === event.context.value) {\n that.$.fireEvent('scrollBottomReached');\n return;\n }\n\n if (event.context.min === event.context.value) {\n that.$.fireEvent('scrollTopReached');\n }\n }", "activateScrollableGradient() {\n /**\n * Scroll top offset to show gradient\n * @type {Number}\n */\n const minimumDistance = 5;\n\n /**\n * Modificatior that will be added to the wrapper on scroll\n * @type {String}\n */\n const scrolledModificator = 'aside__scrollable--scrolled';\n\n /**\n * Scrollable zoners\n * @type {Element[]}\n */\n let scrollableZones = document.querySelectorAll('[name=\"js-scrollable\"]');\n\n let addClassOnScroll = event => {\n let scrollableContent = event.target,\n scrollableWrapper = event.target.parentNode;\n\n if (scrollableContent.scrollTop > minimumDistance) {\n scrollableWrapper.classList.add(scrolledModificator);\n } else {\n scrollableWrapper.classList.remove(scrolledModificator);\n }\n };\n\n scrollableZones.forEach( zone => {\n zone.addEventListener('scroll', addClassOnScroll);\n });\n }", "handleScroll() {\n if(this.scroller) {\n const heightOfContent = this.scroller.offsetHeight;\n const yOffset = window.pageYOffset;\n const wholeY = yOffset + window.innerHeight;\n if(wholeY >= heightOfContent) {\n this.lazyLoad();\n }\n }\n\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }", "function measureForScrollbars(cm) {\n var d = cm.display, gutterW = d.gutters.offsetWidth;\n var docH = Math.round(cm.doc.height + paddingVert(cm.display));\n return {\n clientHeight: d.scroller.clientHeight,\n viewHeight: d.wrapper.clientHeight,\n scrollWidth: d.scroller.scrollWidth, clientWidth: d.scroller.clientWidth,\n viewWidth: d.wrapper.clientWidth,\n barLeft: cm.options.fixedGutter ? gutterW : 0,\n docHeight: docH,\n scrollHeight: docH + scrollGap(cm) + d.barHeight,\n nativeBarWidth: d.nativeBarWidth,\n gutterWidth: gutterW\n }\n }" ]
[ "0.7126427", "0.70151436", "0.6872108", "0.6663084", "0.6567266", "0.65367025", "0.65266114", "0.6506496", "0.6491185", "0.6491185", "0.6491185", "0.647677", "0.64085156", "0.63881856", "0.6376696", "0.6309872", "0.62993634", "0.62985206", "0.62977463", "0.6289795", "0.6284144", "0.62548125", "0.62548125", "0.6240183", "0.62341535", "0.6229625", "0.61685455", "0.6160949", "0.6160949", "0.6143168", "0.61268663", "0.6123616", "0.61147135", "0.61147135", "0.61139363", "0.61092687", "0.6102423", "0.6095145", "0.609301", "0.6083358", "0.60786355", "0.60786355", "0.607609", "0.60732394", "0.6068373", "0.60665417", "0.60665417", "0.60665417", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6062116", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061687", "0.6061319", "0.60499376", "0.60101885", "0.60101885", "0.60101885", "0.60024804", "0.5999674", "0.59967035", "0.5989269", "0.5977243", "0.5964947", "0.5952249", "0.5950085", "0.59235007", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102", "0.5920102" ]
0.0
-1
this part to write comment and save it in the database
test() { fetch('http://192.168.0.14:3000/addcommint', { method: 'POST', headers: { 'Content-Type': 'application/json', Accept: 'application/json' }, body: JSON.stringify({ text: this.state.text, id: this.props.id }) }); this.setState({ commint: [ ...this.state.commint, this.state.text ], text: '' }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "async function saveComment(commentText) {\n // Add a new comment entry to the Firebase database.\n try {\n await addDoc(collection(db, 'resources', String(getResourceId()), 'comments'), {\n name: getUserName(),\n text: commentText,\n profilePicUrl: getProfilePicUrl(),\n timestamp: serverTimestamp()\n });\n }\n catch (error) {\n console.error('Error writing new comment to Firebase Database', error);\n }\n}", "function addDbDataComs(id, comment){\n if (p_id == id && comment != \"\" && comment != undefined) {\n $('#addComment').html('<strong>Comment :</strong> ' + comment);\n //addComment.innerHTML = '<strong>Comment :</strong> ' + comment;\n }\n }", "writeComment() {\n let $self = $(`#${this.idDOM}`);\n let $input = $self.children('#comment-input');\n\n $.ajax({\n url: '/Vuvuzela/services/comment/write_comment.php',\n type: 'POST',\n data: {\n text: $input.val(),\n article: this.articleID\n },\n success: (msg) => {\n if(msg['status'] === 'error') {\n this.showError('Error uploading comment');\n console.log(msg['errorMsg']);\n } else if(msg['status'] === 'success') {\n this.showComment(msg['data'], 'highlighted' /* Style modifier */);\n }\n },\n error: (jqXHR, textStatus, errorThrow) => {\n this.showError('Error uploading comment');\n console.log(jqXHR.responseText + \"\\n\" + textStatus + \"\\n\" + errorThrow)\n },\n dataType: 'json'\n });\n\n $input.val('');\n }", "function sendComment(comment){\n if (comment != \"\"){\n var time = new Date().toLocaleString();\n write_comment(comment, \"Jesper Englund\", time);\n }\n else {\n console.log(\"Write some text to add a comment\");\n }\n}", "async function _saveNewComment() {\n document.getElementById('saveButton').disabled = true;\n \n page.notice.setNotice('saving comment...', true);\n\n var postParams = {\n sourcefileid: settings.spreadsheetid,\n tags: document.getElementById('tagInput').value,\n comment: document.getElementById('commentInput').value,\n hovertext: document.getElementById('hovertextInput').value\n }\n\n var requestResult = await googleSheetWebAPI.webAppPost(apiInfo, 'newcomment', postParams, page.notice);\n if (requestResult.success) {\n page.notice.setNotice('copy succeeded', false);\n }\n\n document.getElementById('saveButton').disabled = false;\n }", "function comment_save(comment, callback) {\n var method = 'comment.save';\n var timestamp = get_timestamp();\n var nonce = get_nonce();\n \n // Generating hash according to ServicesAPI Key method\n hash = get_hash(key, timestamp, domain, nonce, method);\n \n var comment_content = json_encode(comment);\n //Ti.API.info(comment_content);\n \n //array to pass all parameters\n var params = new Array(hash, domain, timestamp, nonce, comment_content);\n \n //formatted xmlrpc call\n var xml = xmlrpc_encode(method, params);\n \n //Ti.API.info(hash);\n \n var xhr = Titanium.Network.createHTTPClient();\n xhr.open(\"POST\",url);\n xhr.onload = callback;\n \n Titanium.API.info(\"xmlrpc: xml: \"+xml);\n xhr.send(xml);\n Titanium.API.info(\"xmlrpc: end\");\n}", "function save() {\n i++\n var textGrab = document.getElementById('commentBox').value;\n console.log(textGrab);\n\n //turn it in to a JSON string\n JSON.stringify({ comment: textGrab });\n\n //send to mongo\n\n //return from mongo 'comment-like' post\n\n //place comment in to a div element on page \n\n\n\n\n //give comment a date/time\n\n\n}", "function saveComment() {\n const comment = document.getElementById('comment').value;\n\n db.collection('posts').add({\n post: comment,\n })\n .then((docRef) => {\n console.log('Document written with ID: ', docRef.id);\n document.getElementById('comment').value = '';\n })\n .catch((error) => {\n console.error('Error adding document: ', error);\n });\n}", "async function updateComment(comment){\n //Insert new autosaved entry\n if (debug){console.log(\"updateComment() -> Called\");}\n try {\n var sql = \"UPDATE comments SET comment_text = $1::text WHERE comment_pk = $2::int AND comment_entry_fk = $3::int RETURNING comment_pk, comment_entry_fk, comment_user_fk, comment_date, comment_text\";\n var params = [comment.text, comment.id, comment.jotID];\n var results = await pool.query(sql, params);\n } catch (err){\n if (debug){console.log(\"updateComment() -> ERROR CAUGHT\");}\n console.log(err);\n return false;\n };\n return parseCommentFromDB(results.rows[0]); \n }", "function commentFile(fileID, text) {\n db.updateData('file', { id: fileID }, { $set: { comment: text } })\n}", "function postComment (){\n\t\t\t\t\t$(\".btn-postcomment\").click(function(){\n\t\t\t\t\tvar index = $(this).data(\"id\");\n\t\t\t\t\tvar comment = $('textarea[data-id=\"comments-' + index + '\"]')\n\t\t\t\t\t\n\t\t\t\t\tvar name = $(\"input[data-id='name-\" + index + \"']\")\n\t\t\t\t\tvar appId = appArray[index].id;\n\t\t\t\t\tvar commentArray = appArray[index].comments + \", \" + comment.val(); \n\t\t\t\t\t\n\n\n\t\t\t\t\tstoreComment(appId, commentArray, name, index);\n\t\t\t\t\tname.val(\" \");\n\t\t\t\t\tcomment.val(\" \");\n\t\t\t\t\tappendComments();\n\n\t\t\t\t\t});\n \t\t\t\t}", "async saveComment() {\n try {\n let newComment;\n\n try {\n newComment = await apiClient.create('comments', {\n email: this.state.newCommentEmail,\n text: this.state.newCommentText\n });\n }\n catch (err) {\n // TODO: Pop a modal with text such as \"Unfortunately, couldn't save the new message...\"\n throw err;\n }\n\n this.setState({\n comments: [ newComment, ...this.state.comments ],\n newCommentEmail: '',\n newCommentText: ''\n });\n }\n catch (err) {\n console.error(err);\n }\n }", "function writeToFile(comments){\r\n comments.forEach((element)=>{\r\n elementSpace = element + ', '\r\n fs.appendFile('comments.txt',elementSpace,(err)=>{\r\n if(err){\r\n console.log('error')\r\n }\r\n })\r\n })\r\n console.log(chalk.red(':::::COMMENTS WRITTEN TO FILE::::::'))\r\n }", "function addComment(event){\n event.preventDefault(); \n let commentData ={\n c_content: this.elements['c_content'].value, \n c_author: Auth.getUser(), \n c_post: Model.getPost(this.dataset.id)\n }\n Model.addComment(commentData);\n}", "comment(_comment) {\n this.pushQuery(`comment on table ${this.tableName()} is '${_comment}';`);\n }", "function postComment() {\n if (text === \"\")\n return;\n let temp = comments;\n props.commentFunction(props.index, text)\n temp.push({ id: temp.length + 1, person: currentUser.name, content: text })\n changeComments(temp)\n changeText(\"\")\n axios.post('/posts/comment', {\n comment: text,\n imageUrl: props.source,\n uid: currentUser.uid,\n name: currentUser.name,\n ImageOwnerName: params.id,\n }).then((response) => {\n console.log(response);\n })\n .catch((error) => {\n console.log(error);\n });\n }", "comment(comment) {\n this.pushQuery(`comment on table ${this.tableName()} is '${comment || ''}'`);\n }", "async function saveComment(request, response){ \n if (debug){console.log(\"saveCommment() -> Called\");\n}\n var key = request.body.key;\n var comment = request.body.comment; \n var savedComment = {};\n\n //Make sure parent jot is valid\n if (! await jotController.confirmJot(key.id, comment.jotID)){\n response.status(404).end();\n return;\n } \n if (comment.id == '0') {\n savedComment = await commentModel.insertNewComment(key.id, comment);\n } else {\n savedComment = await commentModel.updateComment(comment);\n }\n\n //Send the jotID of the saved jot. \n if (Number.isInteger(savedComment.id)){\n response.status(202).json(savedComment);\n } else {\n response.status(400).end();\n }\n}", "makeComment(callback, id, myComment) {\n let commRef = firebase.database().ref(this._path + '/' + id + '/replies/3');\n commRef.once(\"value\").then((snapshot) => {\n // set commented\n commRef.set(myComment);\n callback(myComment);\n });\n }", "function postComment(inputText, key) {\n var input = {\n text: inputText,\n username: localStorage.getItem('username')\n };\n var ref = \"/thoughts/\" + key +\"/comments/\";\n var newKey = firebase.database().ref(ref).push().key;\n var updates = {};\n updates[ref + newKey] = input;\n firebase.database().ref().update(updates, function (err) {\n if (err) {\n alert('oh no! the database was not updated!');\n }\n $scope.detailWndr(key);\n });\n var commentId = 'comments' + key;\n var commentEls = document.getElementsByClassName(commentId);\n for (i = 0; i < commentEls.length; i++) {\n commentEls[i].innerHTML = 0;\n }\n }", "static async createComment(newCommentObj) {\n const { author_id, activity_id, body } = newCommentObj;\n const time = new Date();\n const created_at = time.toString().slice(0, 33);\n\n const results = await db.query(\n `INSERT INTO comments (author_id, activity_id, created_at, body)\n VALUES ($1, $2, $3, $4)`,\n [author_id, activity_id, created_at, body]\n )\n const comment = results.rows[0];\n return comment;\n }", "function dumpComment(window, comment, path, sizeInLines, cursor, repoId, sourceId, commentLine, htmlUrl, error) {\n console.log();\n console.log(window, comment, path, sizeInLines, cursor, repoId, sourceId, commentLine, htmlUrl, error);\n\n // Set the continuation path\n if (commentData === null) oldResume = path + \":\" + 0\n else oldResume = commentData.path + \":\" + commentData.cursor\n\n commentData = {\n \"window\": window, \n \"comment\": comment,\n \"path\": path, \n \"sizeInLines\": sizeInLines,\n \"cursor\": cursor, \n \"repoId\": repoId, \n \"sourceId\": sourceId, \n \"commentLine\": commentLine, \n \"htmlUrl\": htmlUrl,\n \"error\": error\n };\n\n if (error.length > 0) {\n document.getElementById(\"code\").innerHTML = \"\";\n document.getElementById(\"comment\").value = error;\n } else {\n document.getElementById(\"code\").innerHTML = hljs.highlight(\"c\", window).value;\n document.getElementById(\"comment\").value = comment;\n document.getElementById(\"fileUrl\").href = htmlUrl + \"#L\" + commentLine;\n }\n document.getElementById(\"labeledCounter\").innerHTML = \"Comments labeled in this session: \" + commentBuffer.length;\n}", "handleComment() {\n this.isCommentPending(true);\n return postComment(this.id, { author: this.app.author(), comment: this.newComment() }).then((event) => {\n this.newComment('');\n this.isCommentPending(false);\n return this.eventList.unshift(formatEvent(event, this.messageType));\n });\n }", "function saveComment() {\n const commentPlace = comment.value;\n if (commentPlace === '') { \n // Limpiar el textarea\n document.getElementById('comment').value = '';\n } else {\n const currentUser = firebase.auth().currentUser;\n const commentPlace = comment.value;\n const newMessageKey = firebase.database().ref().child('comments').push().key;\n firebase.database().ref(`comments/${newMessageKey}`).set({\n //creator: currentUser.uid,\n //creatorName: currentUser,\n text: commentPlace,\n //email: currentUser.email,\n });\n // Limpiar el textarea\n document.getElementById('comment').value = ''; \n }\n \n}", "async function postComment(id, comment, req){\n const username = req.user.sub;\n const person = await User.findOne({\"_id\": username});\n const course = await Course.findOne({\"comments\": id});\n if (!person.courses.includes(course._id)){\n return 'You are not registered for this course';\n }\n await Post.updateOne({\"_id\": id}, {$push: {\"commentContent\": comment}});\n return 'Successfully added a new comment!';\n}", "function Comment(req,res) {\n var comment = req.params.comment;\n var noteId = req.params.noteId;\n var username = req.params.username;\n if(noteId.length <10){\n noteModel\n .findApiNoteComment(noteId)\n .then(\n function (response) {\n if(response == null){\n noteModel\n .addApiComment(comment, noteId, username)\n .then(\n function (stats) {\n res.send(200);\n },\n function (error) {\n res.statusCode(404).send(error);\n });\n }else{\n noteModel\n .pushComment(comment, noteId, username)\n .then(function (response) {\n res.json(200);\n },\n function (error) {\n res.statusCode(404).send(error);\n });\n }\n }\n\n );\n }else{\n noteModel\n .addComment(comment, noteId, userId)\n .then(\n function (stats) {\n console.log(stats);\n res.send(200);\n },\n function (error) {\n res.statusCode(404).send(error);\n });\n }\n }", "function Comment(){\n this.id;\n this.user_id;\n this.entry_id;\n this.date;\n this.text;\n}", "function CreateNewComment(body, name, email, postId) {\n var template = $(\"#templateComment\").text();\n\n var $section = $(\"#comments-\" + postId);\n $section.append(template);\n\n body = body.replace(\"\\n\", \"<br>\");\n\n //TODO LAST OF TYPE\n $section.find(\"p\").last().html(body);\n $section.find(\"a\").last().attr(\"href\", email);\n $section.find(\"a\").last().html(name);\n\n}", "createComment(comment) {\n this.socket.emit('comment create', comment);\n this.applyWaitingFeedbackForEvent(\"comment create\", \"null\")\n }", "function saveComment(user) {\n var currentTime = Date.now();\n self.currentUser.comment.created_at = currentTime;\n self.currentUser.comment.recipient = user._id;\n\n user.receivedComment = {\n username: self.currentUser.local.username,\n picture: self.currentUser.local.picture,\n created_at: self.currentUser.comment.created_at,\n post: self.currentUser.comment.post\n };\n \n // var arrayEnd = self.user.receivedComments.length\n // self.user.receivedComments.splice(arrayEnd, 0, user.receivedComment);\n self.user.receivedComments.push(user.receivedComment);\n \n User.saveComment({id: user._id}, self.currentUser, function(user) {\n // console.log(user.receivedComment);\n self.currentUser.comment.post = \"\";\n })\n\n }", "function NewComment() {\n\t}", "function insertComment(fileId, content,callback) {\n var body = {'content': content};\n var request = gapi.client.drive.comments.insert({\n 'fileId': fileId,\n 'resource': body\n });\n \n request.execute(function(resp) {\n\t console.log(\"The response of inseting comment is:\",resp);\n\t callback && callback();\n\t \n });\n}", "function postComment() {\n let resource;\n let params;\n let data;\n let session_key,username,park_id,c_comment,c_date;\n \n username = document.getElementById(\"greeting-name\").innerHTML;\n \n if ( username === \"Guest\" ) {\n return; //user not logged in\n } else { //user is logged in\n \n c_comment = document.getElementById(\"comment-ta\").value;\n if ( !c_comment ) {\n alert(\"Please enter some text.\");\n return; //no text entered for comment\n }\n \n session_key = localStorage.getItem(\"session_key\");\n park_id = document.getElementsByTagName(\"body\")[0].id;\n park_id = park_id.substring(8, park_id.length);\n c_date = getDateWithUTCFormatting( new Date() );\n \n params = { \"session_key\":session_key, \"username\":username, \"park_id\":park_id, \"c_date\":c_date, \"c_comment\":c_comment };\n data = JSON.stringify(params);\n resource = \"/comments\";\n xhttp.open('POST', endPointRoot+resource, true);\n xhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n xhttp.send(data);\n xhttp.onreadystatechange = function () {\n if ( this.readyState == 4 ) {\n if ( this.status == 201 ) { \n \n //n is current comment number\n let n = document.getElementsByClassName(\"user-says\");\n n = n.length + 1;\n \n //new comment div for new comment\n duplicateCommentDiv(n);\n document.getElementById(\"comment-user_\"+n).innerHTML = username;\n document.getElementById(\"comment-time_\"+n).innerHTML = c_date;\n document.getElementById(\"comment-body_\"+n).innerHTML = c_comment;\n moveCommentBoxToBottomOfPage();\n document.getElementById(\"comment-ta\").value = \"\";\n \n hideUsersEditAndDoneEditButtons(false);\n } else {\n alert( this.responseText );\n }\n }\n }\n }\n}", "function M_Comment (){\n var arrayCopy = [...commnet];\n arrayCopy.unshift(write);\n Setcommnet( arrayCopy ); \n }", "comment(comment) {\n this.pushQuery(`alter table ${this.tableName()} comment = '${comment}'`);\n }", "function createNewComments(sample,forPost){\n Comment.create(sample,function(err,newComment){\n if(err) console.log(err)\n else{\n addCommentToPost(forPost,newComment);\n }\n });\n }", "function addComment() {\n CommentService.post(vm.user.username, $stateParams.id, vm.comment, vm.currentUser)\n .then(comment => {\n\n // set variables\n vm.loadedComments = 0;\n vm.commentLimit = vm.comments.length + 1;\n vm.allComments++;\n vm.comments = [];\n\n loadComments();\n\n // send new comemnt notification to the given user\n if (vm.user._id != vm.currentUser._id) {\n socket.emit('notification', {'to': vm.user._id, 'from': vm.currentUser._id, 'author': vm.currentUser.username, 'type': 'comment', imageid: $stateParams.id, 'comment': vm.comment});\n }\n vm.comment = \"\";\n });\n }", "function Create_comment(Avatar, name, dt, Value, post_id, id_cmt)//gia tri post_id la ma bai dang de biet comment thuoc bai dang nao\n {\n var ele, time, time1;\n time = dt.getHours() + \":\" + dt.getMinutes() +\", \"+ dt.getDate()+ \"/\" + (dt.getMonth() + 1) + \"/\" + dt.getFullYear();//thoi gian dang bai, xu li ben client, hien ra dang gio:phut ngay/thang/nam\n\n ele = '<div style=\"min-height:40px;margin-top:5px;\" class = '+num_click_hidden_cmt+'>';\n ele += '<img src=\"../'+Avatar+'\" width=\"41\" height=\"42\" style=\"float:left;margin-left:10px;margin-top:-2px;\">';\n ele += '<p style=\"width:85%;word-wrap:break-word;margin-left:56px;\"><span style=\"color:blue;font-size:108%;\">'+name+'</span> '+Value;\n ele += '</p><div style=\"height:10px;margin-left:56px;font-size:82%;color:#474343;margin-top:-7px;\">';\n ele += '<a class=\"a11\" onclick=\"Remove_cmt('+post_id+', '+num_click_hidden_cmt+');\">xóa</a><span style=\"margin-left:10px;\">'+time+'</span></div>';\n ele += '<input type= \"hidden\" class= '+num_click_hidden_cmt+' value = '+id_cmt+'></div>';\n\n //An thoi gian trong datetime trong csdl, gia tri nay se dung de xoa binh luan, doi chieu voi csdl\n //hien thi cac binh luan trong database nhung ma javascript\n num_click_hidden_cmt++;\n return ele;\n }", "function createComment(ev) {\n\t\tev.preventDefault();\n\t\tlet contentInput = $('#cmtContent');\n\t\tlet courseId = $(this).attr('data-id');\n\t\tlet username = sessionStorage.getItem('username');\n\t\tlet content = contentInput.val();\n\n\t\tcommentsService.createComment(username, content, courseId)\n\t\t\t.then(() => {\n\t\t\t\tshowInfo('Comment created.');\n\t\t\t\tloadCourseDetails(courseId);\n\t\t\t\tcontentInput.val('');\n\t\t\t}).catch(handleError);\n\t}", "function postComment(comment) {\n\t\t\treturn $http.post('http://localhost:4000/comments', comment).success(function (res) {\n\t\t\t\treturn res;\n\t\t\t});\n\t\t}", "postComment (context, ideaComment) {\n return ideaAdapter.postIdeaComment(ideaComment)\n }", "function submitComment(e) {\n e.preventDefault();\n let newCommentData = { text: newComment, userId: user.id, postId: postId }\n console.log(newCommentData);\n\n API.Comment.createComment(newCommentData)\n .then(res => {\n console.log(\"Comment created!\");\n loadPosts()\n })\n .catch(err => console.log(err));\n e.target.reset();\n }", "PublicarComentario(CommentContent) {\n const comment = new Comment({\n content: CommentContent,\n studentName: this.name,\n studentRole: 'profesor',\n })\n comment.Publicar();\n }", "function addComment(req, res) {\n var comment = new Comment({\n refered_question: req.body.ref_question,\n refered_answer: req.body.ref_answer,\n comment: req.body.comment,\n user_posted: req.body.user_posted,\n date_posted: new Date()\n });\n\n comment.save(function (err) {\n if (err) {\n console.log('Error has been occured');\n res.send(err);\n } else {\n res.json({\n success: true,\n message: 'Comment posted'\n });\n }\n });\n\n}", "function insertComment(node, commentContent, parent, user) {\n\n\t// sanitize comment content to get rid of unwanted HTML markup\n\tvar cleanComment = sanitizeHtml(commentContent);\n\n\t// push JSON comment object to our structure in the appropriate location\n\tnode.children.push({ \n\t\tauthor : user, \n\t\tpoints : 0, \n\t\ttimeCreated : new Date().toISOString(),\n\t\tcomment : cleanComment, \n\t\tchildren : [], \n\t\tid : new ObjectID()\n\t});\n}", "function saveReview(event) {\n let comment = document.getElementById(\"exampleFormControlTextarea1\").value\n let name = document.getElementById(\"exampleFormControlInput1\").value\n let starRating = document.getElementById(\"exampleFormControlSelect1\").value\n\tevent.preventDefault();\n\tconst comments = [];\n\tlet text = {\n\t\tid: userId++,\n\t\tcomment, \n\t\tname, \n\t\tstarRating, \n };\n\tcomments.push(text);\n\tlet reviews = document.createElement(\"div\");\n reviews.innerHTML = renderComments(comments);\n // Writing to DataBase\n writeUserData(\n userId,\n name,\n comment,\n starRating\n );\n userId++;\n}", "function Comment(name, comment) {\n this.id = uuidv4();\n this.name = name;\n this.comment = comment;\n}", "function createComment(taskId, comment) {\n\n var createCommentUrl = baseUrl + '/api/call.php?createComment=true';\n $.ajax({\n url: createCommentUrl,\n type: 'POST',\n data: {taskId: taskId, comment: comment},\n success: function (data) {\n location.reload();\n },\n error: function () {\n }\n });\n}", "postNewComment() {\n const commentContent = DiscussionArea.#ELEMENT_POST_TEXTAREA.value;\n const commentTimestampMs = this.#currentTimeMs;\n /* eslint-disable indent */\n const commentType =\n DiscussionArea.#ELEMENT_NEW_COMMENT_TYPES\n .querySelector(DiscussionArea.#SELECTOR_SELECTED_TYPE)\n .value;\n /* eslint-enable indent */\n\n const currentTranscriptLine =\n this.#transcriptArea.transcriptSeeker().currentTranscriptLine();\n let currentTranscriptLineId = null;\n if (currentTranscriptLine != null) {\n currentTranscriptLineId =\n currentTranscriptLine.transcriptLine.transcriptKey.id;\n }\n\n this.#manager\n .postRootComment(\n commentContent, commentTimestampMs, commentType,\n currentTranscriptLineId)\n .then(() => {\n this.updateDiscussion();\n });\n\n DiscussionArea.#ELEMENT_POST_TEXTAREA.value = '';\n }", "function saveComment(avid){\n\t\tvar content = document.getElementById('content').value;\n\t\t$.ajax({\n\t\t\ttype: \"POST\",\n\t\t\turl: \"AvinfoController.php?action=addComment\",\n\t\t\tdata: ({avid:avid,content:content}),\n\t\t\tsuccess: function(msg){\n\t\t\t\tdocument.getElementById('content').value = \"\";\n\t\t\t\tlocation.reload(true);\n\t\t }\n\t\t});\n\t}", "function submitComment() {\n var id = \"comment\";\n var commentText = getValueById(id);\n disableFieldById(id);\n var callback = function(response) {\n resetFieldById(id);\n updateComments(response);\n };\n var params = buildCommentParamsForPost(commentText);\n ajaxHandleResponse(\"addComment.php\", callback, \"POST\", params);\n}", "function saveComments(div_comments, sls_id, ref_type_id, comment_text){\n\tpars = 'type=38&action=save_comments&sls_id='+sls_id+'&ref_type_id='+ref_type_id+'&comment='+comment_text;\n\n\t// AJAX > Go get all comments associated to this story/link\n\tvar myAjax = new Ajax.Updater(\n\t\t\t\t\t div_comments,\n\t\t\t\t\t base_url, {\n\t\t\t\t\t \tmethod: 'get',\n\t\t\t\t\t \tparameters: pars,\n\t\t\t\t\t \tonComplete:function(){\n\t\t\t\t\t \t\t$(div_comments).style.display = 'inline';\n\t\t\t\t\t \t}\n\t\t\t\t\t });\n}", "function addComment() {\n var allComments = document.getElementById('allComments');\n var comment = document.getElementById('comment');\n allComments.innerHTML = '<textarea readonly cols=\"110\" rows=\"2\" class=\"allComments\">' + comment.value + '</textarea>' + allComments.innerHTML;\n comment.value=\"\";\n}", "function createComments(req, res) {\n\tcomments.create(req.body, function (err, doc) {\n\t\tif (err) {\n\t\t\tconsole.log(err);\n\t\t\tres.send(500, err);\n\t\t} else {\n\t\t\tres.send(200, doc);\n\t\t}\n\t});\n}", "add(info) {\r\n if (typeof info === \"string\") {\r\n info = { text: info };\r\n }\r\n const postBody = jsS(extend(metadata(\"Microsoft.SharePoint.Comments.comment\"), info));\r\n return this.clone(Comments_1, null).postCore({ body: postBody }).then(d => {\r\n return extend(this.getById(d.id), d);\r\n });\r\n }", "function writeNewPost(comment) {\n // A post entry.\n var postData = {\n commentBody: comment\n };\n \n // Get a unique key for a new Post with push.\n var newPostKey = firebase.database().ref().child('posts').push().key;\n \n // Write the post into the posts section of the database\n var updates = {};\n updates['posts/' + newPostKey] = postData;\n \n return firebase.database().ref().update(updates);\n }", "static respondWithComment(context, comment) {\n const response = context.issue({body: comment})\n context.github.issues.createComment(response)\n }", "updateComment(comment, field) {\n const data = {\n updateField: field,\n comment: comment\n };\n this.socket.emit('comment update', data);\n this.applyWaitingFeedbackForEvent(\"comment update\", comment.id);\n }", "function postComment(commentId, commentText) {\n reddit.post(\n '/api/comment',\n {\n api_type: 'json',\n thing_id: commentId,\n text: commentText\n },\n function (error, response, body) {\n console.log(error);\n console.log(body);\n }\n );\n}", "comments(comment) {\n // console.log(`Incoming comment: ${comment.text}`)\n }", "function writeComment() {\n // DEFINE SELECTED COMMENT & RESPONSE\n // Code re-edited based on Sabine's guidance via ZOOM (March 23)\n // get the comment box of the selected comment\n let commentBox = $(this).parent().attr(\"id\"); // with Sabine\n // get the number associated with the comment box\n let number = commentBox.substring(10); // with Sabine\n // define the text from the selected comment to append:\n let comment = $(this).text(); // with Sabine\n // define the text from the child element (the response) that comes right after the selected comment tag\n let response = $(this).next().text();\n // END OF DEFINE SELECTED COMMENT & RESPONSE\n\n // DEFINE USER IMAGE\n // define the user image in front of comment and response\n let user = \"<img class='user_image' src='https://aniesha08.github.io/cart263/projects/project_3/assets/images/user.png'>\";\n let responder = \"<img class='user_image' src='https://aniesha08.github.io/cart263/projects/project_3/assets/images/responder.png'>\";\n // END OF USER IMAGE\n\n\n // DEFINE EMOJIS\n // get the number of the emoji attribute from the selected comment\n let emojiNumber = $(this).attr(\"emoji\");\n\n // get the src of the emoji that is contained in the selected comment\n // by finding the image tag that contains the class \".comment_emoji\"+emojiNumber\n let commentEmoji = $(this).find(\".comment_emoji\"+emojiNumber).attr('src');\n let displayCommentEmoji = \"<img class='emoji' src=\"+commentEmoji+\">\";\n\n // get the src of the emoji that is contained in the RESPONSE of the selected comment\n // by targeting the child element that comes next from the selected comment\n // and finding the image tag that contains the class \".response_emoji\"+emojiNumber\n let responseEmoji = $(this).next().find(\".response_emoji\"+emojiNumber).attr('src');\n let displayResponseEmoji = \"<img class='emoji' src=\"+responseEmoji+\">\";\n // END OF EMOJIS\n\n\n // DISPLAY COMMENT & RESPONSE\n // the comment will be displayed in the display comment paragraph\n let $commentDisplay = $(\"#display_comment\"+number); // with Sabine\n // the response will be displayed right after the comment in the display response paragraph\n let $responseDisplay = $(\"#display_response\"+number);\n\n // css styling for the comments\n $commentDisplay.css({\n 'margin-bottom' : '0.5em',\n 'font-size' : '14px'\n });\n // css styling for the responses\n $responseDisplay.css({\n 'margin-bottom' : '1em',\n 'margin-left' : '45px',\n 'font-size' : '14px',\n 'font-style' : 'italic'\n });\n\n // with the empty(), only 1 comment and response will be displayed on the display paragraphs\n // all won't display one after another\n $commentDisplay.empty();\n $responseDisplay.empty();\n\n // and finally, append the comment and response with the profile image of the user & profile owner\n $commentDisplay.append(user + \"&nbsp;\" + comment + displayCommentEmoji);\n $responseDisplay.append(responder + \"&nbsp;\");\n\n // function for Typewriter effect\n // pass the response, $responseDisplay, displayResponseEmoji variables into the function\n // as we will be adding the typeWriter effect to the response\n typeWriter(response, $responseDisplay, displayResponseEmoji);\n // END OF DISPLAY COMMENT & RESPONSE\n\n\n // POINTS\n // Get the points attribute from the comment that was clicked\n // in each modal, there are 6 $comments\n // comment 1 (1 point), comment 2 (2 points), comment 3 (3 points) and so on...\n let points = $(this).attr(\"point\");\n // pass the points to the emotionsPoints() function\n // we will use this points value to determing which comment was clicked...\n emotionsBar(points);\n\n} // end of writeComment", "function handleComment(e) {\n setDocId(null);\n e.preventDefault();\n setComment({firstName: firstName, lastName: lastName, comment: e.target.comment.value});\n sendEmail(e);\n e.target.comment.value = \"\";\n //awaits the db to get the post that has been commented on\n db.collection(\"posts\")\n .where(\"body\", \"==\", `${post.body}`)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => {\n //sets the post doc id to state\n setDocId(doc.id);\n setCommArr(doc.data().comments);\n // setCommArr(doc.comments)\n });\n });\n }", "function UserComment(e, value_of_cmt, id_post, id_comment)\n {\n var temp, Value, dt = new Date();\n var Avatar, name;\n Avatar = information_user.avatar;//anh dai dien nguoi binh luan\n name = information_user.fullname;//ten nguoi binh luan\n\n if(e.keyCode == 13){\n Value = value_of_cmt.value;//lay gia tri trong textarea\n if(Value == \"\"){\n return false;\n }else{\n time1 = dt.getFullYear() + \"-\" + (dt.getMonth() + 1) + \"-\" + dt.getDate() + \" \" + dt.getHours() + \":\" + dt.getMinutes() +\":\"+ dt.getSeconds();//thoi gian vao csdl(kieu datetime) \n temp = document.getElementById(id_post).querySelectorAll(\"[id^='\"+id_comment+\"']\");//tra ve tat ca cac tag(p, h, div) co id bat dau la id_comment, trong 1 bai dang co 2 gia tri la id_comment, vay tem[1] se tra ve vi tri hien binh luan\n if(Control_post_comment(Value)){\n alert(\"Warning!!! Không được nói tục chửi bậy trên web\");\n value_of_cmt.value = \"\";\n }else{\n Post_comment_to_db(id_post, user_id, time1, Value);//gui du lieu tren database\n value_of_cmt.value = \"\";\n max_cmt_id++;//khi gui du lieu(comment) len server, gia tri id_cmt se tu dong tang len 1, va khi do, ben client cung co gia tri tang len 1 tuong ung voi server \n temp[0].innerHTML += Create_comment(Avatar, name, dt, Value, id_post, max_cmt_id) + '<br>'; \n return false;\n }\n }\n } \n }", "card_addComment(card){\n commentsRef.push(new comment(this.currentUser, card.id, this.currCardComment));\n card.commenting=false;\n this.currCardComment=\"\";\n this.activity_add(\"Comment added to card named \" + card.myName);\n }", "async comment(req, res) {\n const { comment, game_id, user_id, user_name, image_url } = req.body;\n\n // user details to be gotten from user auth middleware\n if (!user_id) {\n return res.status(402).send(response('Invalid user id', null, false));\n }\n\n // find game in db\n const gameDBData = await this.GameRepo.fetchOne(game_id);\n\n if (!gameDBData.data) {\n return res.status(404).send(response('Game not found', null, false));\n }\n\n // players should not be able to comment\n // if (user_id === data.owner.user_id || user_id === data.opponent.user_id) {\n // return res\n // .status(400)\n // .send(response(\"Only spectators can comment\", null, false));\n // }\n\n // incase user gets sloppy\n if (!comment || comment.trim().length === 0) {\n return res.status(400).send(response('comment cannot be empty', null, false));\n }\n\n const single_comment = {\n user_name,\n image_url,\n text: comment.trim(),\n timestamp: new Date().toLocaleString(),\n };\n\n const comments = gameDBData.data.messages;\n\n comments.push(single_comment);\n\n await this.GameRepo.update(game_id, { messages: comments });\n\n // publish to centrifugo\n const payload = {\n event: 'comments',\n comment: single_comment,\n };\n\n await centrifugoController.publish(game_id, payload);\n\n return res.status(202).send(response('comment sent', single_comment));\n }", "function postComment()\n{\n\tvar postID = window.location.search.substring(1); //grabbing URL variable \n\tvar splitVariables = postID.split('='); //split at = and store in array\n\tpostID = splitVariables[1]; //we want index 2 because list should be: 'name', variableNeeded\n\n\tvar posterName = document.getElementById('name').value;\n\tvar posterEmail = document.getElementById('email').value;\n\tvar posterImage = document.getElementById('imageURLbox').value;\n\tvar posterComment = document.getElementById('comment').value;\n\tvar posterDate = \"Just now!\";\n\n\t//==============================TEMPORARY COMMENTS - DELETES ON REFRESH =====================\n\tstringBody = stringBody + \"<li><div class='comment-img'><img src='\" + posterImage + \"0'/></div><div class='comment-text'><strong><a href=''>\" + posterName +\n \"</a></strong><p>\" + posterComment + \"</p> <span class='date sub-text'>on \"\n + posterDate + \"</span></div></li>\";\n document.getElementById('comments').innerHTML = \"<b>Comments:</b>\" + stringHeader + stringBody + stringFooter;\n //=======================SAVE TO DATABASE HERE ===============================\n\n\t//Add to database!!!\t\t\n\txmlhttp=new XMLHttpRequest();\n\txmlhttp.onreadystatechange=function() {\n\t\tif (xmlhttp.readyState==4 && xmlhttp.status==200) {//executed when state = done and status = OK\n\t\t\tresponse=xmlhttp.responseText;\n\t\t\tconsole.log('Insert comment response: ' + response);\n\t\t}\n\t}\n\txmlhttp.open(\"GET\",\"comment.php?id=\"+postID+\"&text=\"+posterComment+\"&email=\"+posterEmail, true);\n\txmlhttp.send();\n\tposterComment = document.getElementById('comment').value = \"\"; //erase comment from box\n}", "createComment(comment) {\n return commentModel\n .create(comment)\n }", "function postComment(){\n\tvar textArea = document.getElementById('commentBox')\n\tvar text = textArea.value.trim()\n\tvar xmlDoc = document.implementation.createDocument(null, null, null);\n\tvar xml = xmlDoc.createElement('comment');\n\tif(text == \"\")\n\t\treturn;\n//\t\txml.appendChild( xmlDoc.createTextNode( \" \") );\n\tvar reg = /</\n\tvar match = text.search(reg)\n\tif(text.search(/</) != -1 || text.search(/>/) != -1){\n\t\ttext = text.replace(/</g, \"&lt\")\n\t\ttext = text.replace(/>/g, \"&gt\")\n\t}\n\txml.appendChild( xmlDoc.createTextNode( text) );\n\txmlDoc.appendChild( xml );\n\t\n\tvar req = new XMLHttpRequest();\n\tvar url = 'servlet/addChild/comments/' + imgSrc;\n\treq.open(\"POST\", url, true);\n\t\treq.onreadystatechange = function() {\n\t\tif ( req.readyState == 4) {\n\t\t\tvar div = document.getElementById('comment-field');\n\t\t\tvar comment = req.responseText.trim();\n\t\t\tgetComments()\n\t\t\ttextArea.value = \"\"\n\t\t\t}\t\n\t\t\t\n\t\t}\n\treq.send(xmlDoc);\n\ttext.value = '';\n}", "function createNewComment(postId, username, uid, text) {\n firebase.database().ref('post-comments/' + postId).push({\n text: text,\n author: username,\n uid: uid\n });\n}", "async function insertNewComment(comment) {\n comment = extractValidFields(comment, CommentSchema);\n const [ result ] = await mysqlPool.query(\n 'INSERT INTO comments SET ?',\n comment\n );\n\n return result.insertId;\n}", "async handleAddComment(ev) {\n ev.preventDefault();\n const { content } = ev.target;\n const comment_content = content.value;\n\n const thoughtId = this.state.thoughtId;\n\n // Make POST request to server to add a post\n await ActionsService.postComment(thoughtId, comment_content);\n // Clear the comment input\n content.value = \" \";\n\n // Re-fetch the comments to update existing comments with the comment just posted\n const comments = await ActionsService.getComments(thoughtId);\n if (comments) {\n this.setState({\n comments,\n });\n }\n }", "function insertComment(comment) {\n return CommentModel.create(comment);\n}", "async function insertNewComment (userID, comment){\n //Insert new autosaved entry\n if (debug){console.log(\"insertNewComment() -> Called\");}\n try {\n var sql = \"INSERT INTO comments (comment_entry_fk, comment_user_fk, comment_text) VALUES ($1::int, $2::int, $3::text) RETURNING comment_pk, comment_entry_fk, comment_user_fk, comment_date, comment_text\";\n var params = [comment.jotID, userID, comment.text];\n var results = await pool.query(sql, params);\n } catch (err){\n if (debug){console.log(\"insertNewComment() -> ERROR CAUGHT\");}\n console.log(err);\n return false;\n };\n return parseCommentFromDB(results.rows[0]); \n }", "function saveComment(req, res) {\n let id = req.body.id;\n let comments = req.body.comments\n let usernames = req.body.usernames\n while (comments.includes(',,,,,,,,')) {\n comments = comments.split(',,,,,,,,').join(',,,,,,,')\n }\n while (usernames.includes(',,,,,,,,')) {\n usernames = usernames.split(',,,,,,,,').join(',,,,,,,')\n }\n let sql = 'SELECT * FROM series WHERE id = $1;';\n let safeValue = [id];\n client.query(sql, safeValue)\n .then(results => {\n if (results.rows[0].comments) {\n comments = results.rows[0].comments + ' ,,,,,,,, ' + comments;\n usernames = results.rows[0].usernames + ' ,,,,,,,, ' + usernames;\n }\n let sql = 'UPDATE series SET comments = $1, usernames = $2 WHERE id = $3 RETURNING usernames;';\n let safeValues = [comments, usernames, id]\n client.query(sql, safeValues)\n .then(sqlResults => {\n res.status(200).redirect('/recommendations');\n }).catch(err => console.log(err));\n })\n}", "function submitComment(id, form) {\n const commentsValue = {\n name: selector('#userName').value,\n comment: selector('#comments').value,\n };\n comments.push(commentsValue);\n article.comments = comments;\n article.views = views;\n database.ref('/articles/' + id).set(article, (error) => {\n if (error) {\n console.log(error);\n } else {\n form.reset();\n }\n });\n}", "function createNewComment(postId, username, uid, text) {\n firebase.database().ref('post-comments/' + matchId + '/' +postId).push({\n text: text,\n author: username,\n uid: uid\n });\n}", "function add_comment(data){\r\n\tdata = (data || req.data);\r\n\tvar comment = new Comment();\r\n\tcomment.edit({\r\n\t\tname:\t\t\t\tdata.name,\r\n\t\temail:\t\t\t\tdata.email,\r\n\t\topenid_identifier:\tdata.openid_identifier,\r\n\t\tcomment_type:\t\tdata.comment_type,\r\n\t\tbody:\t\t\t\tdata.body,\r\n\t\tdate:\t\t\t\tnew Date(),\r\n\t\tapproved:\t\t\tdata.approved\r\n\t})\r\n\tthis.add(comment);\r\n\treturn comment;\r\n}", "function WriteComments()\n{\n\tif (!Comments || !Comments.commentsWindow || !Comments.commentsWindow.document || !Comments.commentsWindow.document.body\n\t|| !Comments.commentsWindow.document.getElementById(\"paneBody1\"))\n\t{\n\t\tsetTimeout('WriteComments()',5);\n\t\treturn;\n\t}\t\n\n\tdate_fld_name = \"2\";\n\t\n\tvar html = '<div style=\"padding:5px;width:100%;height:100%;text-align:center\"><div styler=\"groupbox\">'+\n\t\t'<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td styler=\"hidden\" style=\"text-align:center\" class=\"plaintablecellbold\">'+\n\t\tgetSeaPhrase(\"COMMENTS\",\"TE\")+'</td>'+\n\t\t'<td style=\"text-align:center\" class=\"plaintablecellbold\"><input onchange=\"parent.opener.ReturnDate(this.value)\" styler=\"calendar\" class=\"inputbox\" onkeydown=\"this.value=this.getAttribute(\\'start_date\\')\" onkeyup=\"this.value=this.getAttribute(\\'start_date\\')\" type=\"text\" name=\"navDate\" size=\"10\" maxlength=\"10\" start_date=\"' + FormatDte4(Comments.Date) + '\" value=\"' + FormatDte4(Comments.Date) + '\"/>'+\n\t\t'<a styler=\"hidden\" href=\"\" onclick=\"parent.opener.MoveToNewDateForComments();return false;\">'+\n\t\tuiCalendarIcon()+'</a></td></tr>';\n\t\t\n\thtml += '<tr><td class=\"plaintablecellbold\" colspan=\"2\"><div style=\"text-align:center\"><form name=\"myComments\">'+\n\t\t'<textarea class=\"plaintablecell\" cols=\"60\" rows=\"11\" name=\"comments\" wrap=\"virtual\">'+Comments.Text+\n\t\t'</textarea></form></div></td></tr></table>';\n\n\thtml += '<div style=\"text-align:center\"><table border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>'+\n\t\tuiButton(getSeaPhrase(\"UPDATE\",\"TE\"), \"parent.opener.UpdateComments();return false\");\n\t\t\n\tif (Comments.Text != \"\")\n\t{\n\t\thtml += uiButton(getSeaPhrase(\"DELETE\",\"TE\"), \"parent.opener.DeleteComment();return false\",\"margin-left:5px\");\n\t}\n\telse\n\t{\n\t\thtml += uiButton(getSeaPhrase(\"CLEAR\",\"TE\"), \"parent.document.myComments.comments.value='';return false\",\"margin-left:5px\");\n\t}\n\t\n\thtml += uiButton(getSeaPhrase(\"DONE\",\"TE\"), \"parent.opener.CloseCommentsWindow();return false\",\"margin-left:5px\")+\n\t\t'</td></tr></table></div></div></div>';\n\n\tComments.commentsWindow.document.getElementById(\"paneBody1\").innerHTML = html;\t\n\tComments.commentsWindow.stylePage(true, getSeaPhrase(\"COMMENTS\",\"TE\"));\n\t\n\tsetTimeout(\"CommentsLoaded()\",1000);\n\tremoveWaitAlert();\n\t\n\tif (ToggleSwitch)\n\t{\n\t\tToggleSwitch = false;\n\t\tif (DeleteFlag)\n\t\t{\n\t\t\tToggleCommentSwitch(\"Deleting\", Comments.Date);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tToggleCommentSwitch(\"Adding\", Comments.Date);\n\t\t}\n\t}\n}", "function sendComment( dataUpload ){\n\n if ( typeof dataUpload === \"undefined\" ){\n\n var send={Commenter:\"0\", ParentId:\"-1\", JobOfferComment:vm.comment, JobOfferId:vm.workData.JobOfferId,\n StudentUserId: vm.workData.StudentUserId, EmployerUserId: vm.userData.UserId};\n JobService.CommentCreate(send)\n .then(function(response){\n\n getComments();\n vm.comment=\"\";\n\n }, function(response){\n // console.log(response);\n FlashService.Error(\"No se pudo enviar el comentario\"); \n })\n }\n else{\n var send={Commenter:\"0\", ParentId:\"-1\", JobOfferComment:vm.comment, JobOfferId:vm.workData.JobOfferId,\n StudentUserId: vm.workData.StudentUserId, EmployerUserId: vm.userData.UserId, FileName: dataUpload.filename, File: dataUpload.base64, RefreshToken: vm.userData.RefreshToken};\n JobService.CommentCreateWithFile(send)\n .then(function(response){\n\n getComments();\n vm.comment=\"\";\n\n }, function(response){\n // console.log(response);\n FlashService.Error(\"No se pudo enviar el comentario\"); \n })\n\n }\n }", "static submitComment(req) {\n return new Promise((resolve, reject) => {\n models.comment.create({\n commentedby: req.commentedby,\n commentcontent: req.commentcontent,\n postid: req.postid,\n commentedon: new Date()\n })\n .then(newPost => {\n resolve(newPost);\n }, (error) => {\n reject(error);\n });\n });\n }", "function fetchTaskComment(commentID) {\n var comment = document.getElementById(\"comment-\" + commentID);\n var content = comment.getElementsByClassName(\"comment-content\")[0].innerHTML;\n content = content.replace(/<br>/g, '\\n');\n $(\"#txtTaskComment\").val(content);\n $(\"#btnSubmitComment\").val(\"Save\").attr(\"onclick\", \"updateTaskComment(\" + commentID + \")\");\n}", "function changeComment() {\n var noteOne = document.getElementById('NoteOneOnHTML').value;\n var noteTwo = document.getElementById('NoteTwoOnHTML').value;\n var noteThree = document.getElementById('NoteThreeOnHTML').value;\n\n var node = findNode(commentNodeKey, globalLogicData);\n node.notes[0] = noteOne;\n node.notes[1] = noteTwo;\n node.notes[2] = noteThree;\n reRender(commentNodeKey);\n}", "function addCommentClick(event){\n\n event.stopPropagation();\n \n //get user inputs\n var comTitle = $('input[name=\"commTitle\"]').val().trim();\n var comContent = $('textarea[name=\"commContent\"]').val().trim();\n\tvar articleId = $('article[data-value]').attr('data-value');\n\tvar errorComment = $('#error-comment');\n\t\n\t//Check user logged in\n\tif(user.isLogged === false){\n setError(errorComment,\"*You must be logged in to post comments!\");\n return;\n }else{\n \n //validate user inputs\n if(comTitle.length === 0 || comContent.length === 0){\n setError(errorComment,\"*Please fill in both Title and Content for your comment!\");\n return;\n }else{\n resetError(errorComment);\n }\n }\n \n //Create comment if associated article id is known\n\tif(articleId){\n\n\t var comm = {\n\t title: comTitle,\n\t content: comContent,\n\t article_id: articleId,\n\t user_id:user.loggedUserId,\n\t };\n\t \n\t var comment = new Comments();\n\t comment.add(comm).done(commentsOperation);\n\t}\n\telse{\n\t popUp(\"error\",\"Saving comment not possible. Failed to get target article ID!\");\n\t}\n\t\n}//END saveCommentClick", "function insertComments(){\n var form = document.querySelector('.commentForm');\n\n var inputBox = form.querySelector('.inputBox');\n var inputs = inputBox.querySelectorAll('input');\n var contentBox = form.querySelector('textarea');\n\n var name = inputs[0].value;\n var password = inputs[1].value;\n var content = contentBox.value;\n var typeCheck = document.querySelector('.commentHidden');\n\n if(name == \"\"){\n alert(\"닉네임을 입력해주세요.\");\n return;\n }else if(password == \"\"){\n alert(\"비밀번호를 입력해주세요.\");\n return;\n }else if(content == \"\"){\n alert(\"내용을 입력해주세요.\");\n return;\n }\n\n const fetchInit = {\n method:\"get\"\n }\n fetch('../work_php/insert_comments.php?'+\"name=\" +name + \"&\" + \"password=\" + password + \"&\" + \"content=\"+ content + \"&\" + \"typeCheck=\" + typeCheck.value, fetchInit)\n // body 로 값넣기\n .then(\n function (response){\n response.text().then(function(text){\n inputs[0].value = \"\";\n inputs[1].value = \"\";\n contentBox.value = \"\";\n alert(\"댓글등록이 성공하였습니다.\");\n selectComments();\n\n })\n }\n )\n}", "function saveComments() {\n var comment_arr = new Array();\n for (i = 0; i < comments.length; i++) {\n comment_arr.push(comments[i].value);\n }\n // deep copy made to create without delims\n rubric_obj.comments = JSON.parse(JSON.stringify(comment_arr));\n\n // Comments may contain commas so a custom delim is necessary\n for (i = 1; i < comment_arr.length; i++) {\n comment_arr[i] = DELIM + comment_arr[i];\n }\n localStorage['comments'] = comment_arr;\n console.log(rubric_obj.comments);\n console.log(comment_arr);\n\n }", "function upsertComment(commentData) {\n $.post(\"/api/comments\", commentData)\n .then(getComments);\n }", "function submitComment(){\n var time = new Date().getTime()\n var newComment = {\n articleId : $(this).attr(\"data-id\"),\n name : $(\"input.comment-name\").val().trim(),\n body : $(\"textarea.comment-body\").val().trim(),\n time : time\n }\n var query = \"api/comments/\" + newComment.articleId;\n $.post(query, newComment, function(){\n }).then(function(){\n loadComments(newComment.articleId);\n }).catch(function(err){\n console.log(err);\n });\n\n}", "function addComments(com, number) {\n var elCom = document.getElementById(\"Comment\")\n var comLine = document.createElement(\"h\");\n comLine.innerHTML = \"Comment n°\" + number + \" : <BR>\" + com + \"<BR>\";\n elCom.appendChild(comLine);\n}", "function postComments () {\n\tvar theComment = {\"nid\":\"105509\",\"subject\":\"Comment Subject Text\", \"comment_body\":{ \"und\":[{ \"value\":\"Comment body text\" }] }}\n\n\n \t$.ajax({\n \t\ttype: \"POST\",\n \turl: '/a/bible/serve/comment.json',\n \t\theaders: {\n \t\t'Content-Type':'application/json',\n \t\t'Authorization':'Basic dGVzdDpKYW1tZXIxMg=='\n \t\t},\n \t\tdata: JSON.stringify(theComment),\n \t\n\t\t});\n\n }", "publish(comment = \"\") {\r\n if (comment.length > 1023) {\r\n throw Error(\"The maximum comment length is 1023 characters.\");\r\n }\r\n return this.clone(File, `publish(comment = '${comment}')`).postCore();\r\n }", "postcomment({ ref, text }) {\n return apiClient.post(`films/comment/${ref}`, { text: text })\n }", "async function insertComment(postId, userId, message) {\r\n return Promise.resolve({\r\n \"record\": {\r\n \"id\": \"58bd80ca22d44764e4bb6dfc\",\r\n \"post\": postId,\r\n \"user\": userId,\r\n \"message\": message\r\n }\r\n });\r\n}", "function commentsFunction(commentData, formComment) {\n const newCommentContainer = document.createElement(\"div\");\n const newCommentMessage = document.createElement(\"p\");\n newCommentMessage.setAttribute(\"class\", \"newCommentMessage\");\n newCommentMessage.textContent = `${commentData.comment}`;\n newCommentContainer.append(newCommentMessage);\n formComment.append(newCommentContainer);\n}", "function createNewComment(groupId, username, uid, text) {\n firebase.database().ref('/group-comments/' + groupId).push({\n\t text: text,\n\t\tauthor: username,\n\t\tuid: uid\n\t\t});\n}", "function addNote() {\n fs.writeFileSync(\"Develop/db/db.json\", JSON.stringify(notesData))\n}", "function submit_comment() {\r\n\tif (!this.allow_comments) {\r\n\t\treturn this.notfound();\r\n\t}\r\n\r\n\tif (req.data.comment_type == \"OpenID\") {\r\n\t\tvar identity = req.data.openid_identifier;\r\n\t\tvar identity_server;\r\n\t\tvar identity_delegation;\r\n\t\ttry {\r\n\t\t\tvar openid_info = this.get_openid_info(identity);\r\n\t\t\tidentity_server = openid_info.server;\r\n\t\t\tidentity_delegate = openid_info.delegate;\r\n\t\t} catch(e) {\r\n\t\t\tres.redirect(this.getURI(\"?submit_failed=true\"));\r\n\t\t}\r\n\r\n\t\tvar unique_string = session._id + \"-\" + new Date().valueOf();\r\n\t\tvar comment = req.data.comment;\r\n\t\tif (typeof session.data.pending_comments == \"undefined\") {\r\n\t\t\tsession.data.pending_comments = {};\r\n\t\t}\r\n\t\tsession.data.pending_comments[unique_string] = {};\r\n\t\tsession.data.pending_comments[unique_string].identity = identity;\r\n\t\tsession.data.pending_comments[unique_string].identity_server = identity_server;\r\n\t\tsession.data.pending_comments[unique_string].body = comment;\r\n\r\n\t\tif (identity_delegate) {\r\n\t\t\tidentity = identity_delegate;\r\n\t\t}\r\n\t\tapp.log(\"ID/Delegate: \" + identity);\r\n\t\t\r\n\t\tres.redirect(identity_server + \"?openid.mode=checkid_setup&openid.identity=\" + escape(identity) + \"&openid.return_to=\" + escape(\"http://\" + req.data.http_host + this.getURI(\"submit_comment?comment_id=\" + unique_string)));\r\n\t}\r\n\r\n\tif (req.data[\"openid.mode\"] == \"id_res\") {\r\n\t\tapp.log(req.data.toSource());\r\n\t\tvar server = session.data.pending_comments[req.data.comment_id].identity_server;\r\n\t\tvar identity = session.data.pending_comments[req.data.comment_id].identity;\r\n\t\tvar body = session.data.pending_comments[req.data.comment_id].body;\r\n\r\n\t\tvar signed_params = req.data[\"openid.signed\"].split(\",\");\r\n\t\tvar params = {};\r\n\t\tfor (var i = 0; i < signed_params.length; i++) {\r\n\t\t\tvar current_param = signed_params[i];\r\n\t\t\tparams[\"openid.\" + current_param] = req.data[\"openid.\" + current_param];\r\n\t\t}\r\n\t\tparams[\"openid.mode\"] = \"check_authentication\";\r\n\t\tparams[\"openid.signed\"] = req.data[\"openid.signed\"];\r\n\t\tparams[\"openid.assoc_handle\"] = req.data[\"openid.assoc_handle\"];\r\n\t\tparams[\"openid.sig\"] = req.data[\"openid.sig\"];\r\n\r\n\r\n\t\t// Curl Command for verification\r\n\t\tvar postbody = [];\r\n\t\tfor (var p in params) {\r\n\t\t\tpostbody.push(p + \"=\" + escape(params[p]));\r\n\t\t}\r\n\t\tapp.log(\"curl -d \\\"\" + postbody.join(\"&\") + \"\\\" \"+server);\r\n\t\t// End\r\n\r\n\r\n\t\ttry {\r\n\t\t\tvar client = new org.apache.commons.httpclient.HttpClient();\r\n\t\t\tvar method = new org.apache.commons.httpclient.methods.PostMethod(server);\r\n\t\t\tfor (var j in params) {\r\n\t\t\t\tmethod.addParameter(j, params[j]);\r\n\t\t\t}\r\n\t\t\tvar statusCode = client.executeMethod(method);\r\n\t\t\tvar result = \"\";\r\n\t\t\tif (statusCode != -1) {\r\n\t\t\t\tresult = method.getResponseBodyAsString();\r\n\t\t\t}\r\n\t\t\tmethod.releaseConnection();\r\n\t\t} catch (e) {\r\n\t\t\tapp.log(\"Error Posting Verification: \" + e.message);\r\n\t\t\tres.redirect(this.getURI(\"?submit_failed=true\"));\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (result.match(/is_valid:true/g)) { \r\n\t\t\tvar whitelisted = get_home_page().openid_whitelist.contains(identity);\r\n\t\t\tvar data = {};\r\n\t\t\tdata.name = null;\r\n\t\t\tdata.email = null;\r\n\t\t\tdata.openid_identifier = identity;\r\n\t\t\tdata.comment_type = \"OpenID\";\r\n\t\t\tdata.body = new XMLList(body.replace(/\\&(?!amp;)/g, \"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\\n/g,\"<br/>\"));\r\n\t\t\tdata.approved = whitelisted;\r\n\t\t\tthis.add_comment(data);\r\n\t\t\tdelete session.data.pending_comments[req.data.comment_id];\r\n\r\n\t\t\tif (check_setting('comment_notifications',true)) {\r\n\t\t\t\tvar mailer = new Mail();\r\n\t\t\t\tvar admin = app.getObjects(\"User\",{username:\"admin\"})[0];\r\n\t\t\t\tvar hp = get_home_page();\r\n\t\t\t\tmailer.setFrom(admin.email, admin.fullname);\r\n\t\t\t\tvar author = this.author.getTarget();\r\n\t\t\t\tmailer.setSubject(\"Axiom Blog - Comment Notification\");\r\n\t\t\t\tmailer.setTo(author.email);\r\n\t\t\t\tmailer.addText(author.fullname+\",\\n\\nYour Post, \\\"\" + this.title + \"\\\" has received a new comment.\\n\\nPlease visit http://\"+req.data.http_host+hp.getURI('manage_postings')+\" to Manage Posts.\");\r\n\t\t\t\tmailer.send();\r\n\t\t\t}\r\n\r\n\t\t\tif (whitelisted) {\r\n\t\t\t\tres.redirect(this.getURI(\"?submitted_whitelist=true\"));\r\n\t\t\t} else {\r\n\t\t\t\tres.redirect(this.getURI(\"?submitted=true\"));\r\n\t\t\t}\r\n\t\t\treturn;\r\n\t\t} else {\r\n\t\t\tres.redirect(this.getURI(\"?submit_failed=true\"));\r\n\t\t\treturn;\r\n\t\t}\r\n\t}\r\n\r\n\tif (req.data.comment_type == \"Anonymous\") {\r\n\t\tvar data = {};\r\n\t\tdata.name = req.data.name;\r\n\t\tdata.email = req.data.email;\r\n\t\tdata.openid_identifier = null;\r\n\t\tdata.comment_type = req.data.comment_type;\r\n\t\tdata.body = new XMLList(req.data.comment.replace(/\\&(?!amp;)/g, \"&amp;\").replace(/</g,\"&lt;\").replace(/>/g,\"&gt;\").replace(/\\n/g,\"<br/>\"));\r\n\t\tdata.approved = false;\r\n\t\tthis.add_comment(data);\r\n\r\n\t\tif (check_setting('comment_notifications',true)) {\r\n\t\t\tvar mailer = new Mail();\r\n\t\t\tvar admin = app.getObjects(\"User\",{username:\"admin\"})[0];\r\n\t\t\tvar hp = get_home_page();\r\n\t\t\tmailer.setFrom(admin.email, admin.fullname);\r\n\t\t\tvar author = this.author.getTarget();\r\n\t\t\tmailer.setSubject(\"Axiom Blog - Comment Notification\");\r\n\t\t\tmailer.setTo(author.email);\r\n\t\t\tmailer.addText(author.fullname+\",\\n\\nYour Post, \\\"\" + this.title + \"\\\" has received a new comment.\\n\\nPlease visit http://\"+req.data.http_host+hp.getURI('manage_postings')+\" to Manage Posts.\");\r\n\t\t\tmailer.send();\r\n\t\t}\r\n\t\tres.redirect(this.getURI(\"?submitted=true\"));\r\n\t}\r\n\r\n}", "function addcomment(){\n // firebase user featuch\n let user=firebase.auth().currentUser;\n let email=user.email;\n // date and time\n let today = new Date();\n let date = today.getFullYear()+'-'+(today.getMonth()+1)+'-'+today.getDate();\n let time = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n let dateTime = date+' '+time;\n firebase.database().ref(\"user\").once(\"value\").then(function(element){\n // comment from element\n let comment=document.getElementById(\"comment\");\n comment=comment.value.replace(/<[^>]*>?/gm,\" \");\n let data=element.val()\n var postListRef = firebase.database().ref('Comment');\n var newPostRef = postListRef.push();\n for (const key in data) {\n if (data[key][\"email\"]==email) {\n newPostRef.set({\n Time:dateTime,\n Comment:comment,\n game_id:game_id,\n user:data[key][\"user_name\"]\n });\n }\n }\n })\n}", "function postNewComment(id, commentValue) {\n const videoID = findVideo(id)\n const newComment = new Comment(commentValue.name, commentValue.comment)\n pushComment = (newComment) => {\n return {\n name: newComment.name,\n comment: newComment.comment,\n id: newComment.id,\n likes: 0,\n timestamp: new Date().getTime()\n }\n }\n videoID[0].comments.push(pushComment(newComment));\n const videoData = list;\n const videoIndex = videoData.findIndex((video) => {\n return videoID[0].id === video.id\n })\n console.log(videoIndex)\n videoData.splice(videoIndex, 1, videoID[0]);\n fs.writeFileSync(videosFile, JSON.stringify(videoData));\n return videoData;\n}", "function addComment(videoId, author, comment, timestamp, callback) {\n const commentId = uuidv4()\n const pubDate = new Date().toISOString()\n\n pool.connect().then((pool) => {\n pool.request()\n .input('commentId', sql.VarChar, commentId)\n .input('videoId', sql.VarChar, videoId)\n .input('pubDate', sql.DateTime2, pubDate)\n .input('timestamp', sql.Numeric, timestamp)\n .input('author', sql.VarChar, author)\n .input('comment', sql.NVarChar, comment)\n .input('reported', sql.Bit, 0)\n .query('INSERT INTO [dbo].[comments] (commentId, videoId, pubDate, timestamp, author, comment, reported) VALUES (@commentId, @videoId, @pubDate, @timestamp, @author, @comment, @reported)')\n }).then(res => {\n return callback(true)\n }).catch(err => {\n return callback(err)\n })\n}", "function addComments(docid) {\n\t\t\tif ($.trim(self.editDocDetails[docid].newComment) != '') {\n\t\t\t\tdailyMailScanDataService.updateComments(docid, self.editDocDetails[docid].newComment)\n\t\t\t\t\t.then(function (response) {\n\t\t\t\t\t\tvar docIndex = _.findIndex(self.unindexedList.data, { id: docid });\n\t\t\t\t\t\tif (docIndex != -1) {\n\t\t\t\t\t\t\tself.unindexedList.data[docIndex].comment = response.data.comment;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tnotificationService.success('Comment added successfully');\n\t\t\t\t\t\tremoveComments(docid);\n\t\t\t\t\t}, function (error) {\n\t\t\t\t\t\tvar docIndex = _.findIndex(self.unindexedList.data, { id: docid });\n\t\t\t\t\t\tif (docIndex != -1) {\n\t\t\t\t\t\t\tself.unindexedList.data[docIndex].newComment = self.editDocDetails[docid].comment;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnotificationService.error('Comment not added please try again');\n\t\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tnotificationService.error('Please add comment to save.');\n\t\t\t}\n\t\t}", "function addComment()\n{\n\tvar cancelCommentWindow = document.getElementById(\"CancelCommentWindow\");\n\tvar windowX;\n\tif(window.innerHeight)\n\t{\n\t windowX = window.innerWidth /2 - 100;\n\t}\n\telse if(document.documentElement.clientHeight)\n\t{\n\t windowX = document.documentElement.clientWidth /2 - 100;\n\t}\n\telse\n\t{\n\t windowX = document.body.clientWidth/ 2 - 100;\n\t}\n\n\tcancelCommentWindow.style.left = windowX + \"px\";\n\tcancelCommentWindow.style.display = \"\";\n\n document.getElementById(\"UnitRedun\").disabled = true;\n document.getElementById(\"SnmpSettings\").disabled = true;\n document.getElementById(\"ShowType\").disabled = true;\n document.getElementById(\"ShowName\").disabled = true;\n document.getElementById(\"highlight-path\").disabled = true;\n document.getElementById(\"RevertToSaved\").disabled = true;\n document.getElementById(\"SaveFile\").disabled = true;\n document.getElementById(\"SaveAs\").disabled = true;\n\n addCommentInd = 1;\n\n}" ]
[ "0.6802722", "0.6678806", "0.66737837", "0.6659903", "0.66285425", "0.6554144", "0.6493956", "0.64838505", "0.64498883", "0.64467835", "0.6386688", "0.63586915", "0.6342971", "0.6340039", "0.6332928", "0.62971413", "0.62873894", "0.6283363", "0.6262518", "0.62509394", "0.62149155", "0.6212498", "0.62070924", "0.6202771", "0.6178157", "0.61736465", "0.61364037", "0.611392", "0.6113435", "0.61118704", "0.6111037", "0.6098211", "0.60653555", "0.60345954", "0.60335547", "0.6018432", "0.601842", "0.60136914", "0.6010074", "0.6004921", "0.59984064", "0.5997027", "0.597652", "0.59751356", "0.59475166", "0.5946688", "0.5936251", "0.5924954", "0.5913263", "0.5912625", "0.5907811", "0.5903983", "0.5901316", "0.58964443", "0.5891995", "0.58871835", "0.58837825", "0.58825797", "0.58768886", "0.5868731", "0.586603", "0.58618236", "0.5861092", "0.5855645", "0.585112", "0.58485276", "0.5846086", "0.58412653", "0.5835654", "0.58353746", "0.5831668", "0.5817307", "0.57925737", "0.57811105", "0.57808214", "0.5774939", "0.57655764", "0.5763121", "0.5755559", "0.5753788", "0.57460314", "0.5738941", "0.5738235", "0.5735069", "0.5732674", "0.5727913", "0.57242596", "0.5721813", "0.5717001", "0.57144976", "0.57015437", "0.5700194", "0.5698808", "0.5698451", "0.569308", "0.56914407", "0.5686536", "0.56829363", "0.56825584", "0.5676208", "0.56751865" ]
0.0
-1
if we need to have authentication for the queries, then we can use this to generate the auth token
function requestAccess(){ if (!sessionStorage.getItem("auth_token")){ const tokenUrl = generateApiUrl('authentication/guest_session/new'); axios.get(tokenUrl) .then((response) => { let auth_token = response.data.guest_session_id; sessionStorage.setItem("auth_token", auth_token); }) .catch((err)=> { console.error(err); }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeAuthToken() {\n var token = 'Auth'+ new Date().getTime();\n\n return token;\n }", "getRequestToken() {\n return apiClient.get(\n '/authentication/token/new?api_key=6c1e80dae659cb7d1abdf16afd8bb0e3'\n )\n }", "function auth() {\n \n var token = getParameterByName('token');\n var auth = getParameterByName('auth');\n if (auth == 'rest') {\n return authWithRest(token);\n } else {\n return authWithSDK(token);\n }\n}", "generateAccessToken(){\n\t\treturn \"token\"\n\t}", "function getAuthenticationToken() {\n var time = Math.floor(Date.now() / 1000);\n var outgoing = encryptAppData(\n { 'app': name,\n 'time': time,\n 'salt': getSalt(128) }\n );\n\n return {\n 'signature': outgoing.data,\n 'iv': outgoing.iv\n };\n }", "static confirmBasicAuthToken() {\n return async function(ctx, next) {\n // basic auth headers provided?\n const credentials = basicAuth(ctx.request);\n if (!credentials) ctx.throw(401); // Unauthorized\n\n // authenticate off id + token (following auth request) - fast as no scrypt hash required\n const user = await Validate.userById(credentials.name, credentials.pass);\n if (!user) ctx.throw(401); // Unauthorized\n\n // ok - record authenticated user in ctx.state.auth.user\n ctx.state.auth = { user: user };\n\n // and continue on\n await next();\n };\n }", "function getAuthToken() {\n\t\tif (isB2BUser()) {\n\t\t\tif (cookieUtils.readCookie(COOKIE_CUSTOMER)) {\n\t\t\t\treturn encodeURIComponent(cookieUtils.readCookie(COOKIE_CUSTOMER));\n\t\t\t}\n\t\t} else if (isGuestUser()) {\n\t\t\t//Return the token\n\t\t\treturn isFeatureSwitchEnabled(GUESTLIST_HMAC_ENABLED) ? ENV : (Math.random().toString(36).slice(2));\n\t\t} else {\n\t\t\tif (cookieUtils.readCookie(COOKIE_USER_SESSION)) {\n\t\t\t\treturn encodeURIComponent(cookieUtils.readCookie(COOKIE_USER_SESSION));\n\t\t\t} else {\n\t\t\t\treturn encodeURIComponent(cookieUtils.readCookie(COOKIE_AUTH_TOKEN));\n\t\t\t}\n\t\t}\n\t}", "function genManageToken(accessKey, secretKey, pathAndQuery, body) {\n const str = pathAndQuery + \"\\n\" + body\n const hash = CryptoJS.HmacSHA1(str, secretKey)\n const encodedSign = safe64(hash.toString(CryptoJS.enc.Base64))\n return accessKey + \":\" + encodedSign\n}", "function buildExternalAuthToken(ctx) {\n const header = getAuthHeader(ctx);\n ctx.swatchCtx.logger.warn(`LinkerD auth adapter configured: ${header}`);\n\n const decodedToken = deserializeHeader(ctx, header);\n\n const tokenBody = decodedToken.split(':')[0];\n const tokenInfo = jwt.decode(tokenBody, { complete: true });\n if (!tokenInfo) {\n ctx.swatchCtx.logger.warn('Failed to decode Authorization token. Trying internal auth token strategy.');\n return buildInternalAuthToken(ctx);\n }\n\n // Log the user ID from the valid user token payload\n const userId = getTokenUserId(tokenInfo.payload);\n const userToken = new common.auth.tokens.UserToken(header, userId);\n ctx.swatchCtx.logger.info(`Successfully validated user token: ${userId}`);\n\n return userToken;\n}", "tokenAuth(user_id, auth_token) {\n const query = r.table('users').filter({auth_token: auth_token})\n return this._run(query).then(success => {\n return success ? true : Promise.reject('Authentication failure');\n });\n }", "function getToken() {\n\n var tokenURL = portal + '/sharing/rest/generateToken?';\n\n var parameters = {username: username,\n password: password,\n client: 'referer',\n referer: portal,\n expiration: 60,\n f: 'json',};\n //Pass parameters via form attribute\n var requestPars = {method: 'post', url: tokenURL, form: parameters };\n\n return hr.callAGOL(requestPars,'token');\n}", "async generateAuthToken() {\n const token = jwt.sign(\n { _id: this._id.toHexString(), userId: this.userId },\n 'tokencode',\n {\n expiresIn: '30d',\n }\n );\n\n await this.updateOne({\n $push: {\n tokens: token,\n },\n });\n return token;\n }", "function _authToken() {\r\n var auth_token = _getTokenFromSession();\r\n if (auth_token.token === undefined || auth_token.expTime < Date.now()) {\r\n var url = apiEndPointUrl + '/authenticate?portfolio=001&db=1';\r\n var username = 'API_TOKEN';\r\n var password = 'XJX982HXF392JDXJD98XJS8XD83GXH92XHF8X';\r\n var encodedRes = btoa(username + ':' + password);\r\n $ionicLoading.show();\r\n $http.defaults.headers.common.Authorization = 'Basic ' + encodedRes;\r\n return $http.get(url)\r\n .then(function (response) {\r\n $ionicLoading.hide();\r\n return handlingErrors.errorFromServer(response);\r\n })\r\n .catch(function response(response) {\r\n if ((response.data.StatusCode == 100)) {\r\n var token = response.data.Token;\r\n var expTime = Date.now() + 45 * 60000;\r\n var opt = {\r\n 'token': token,\r\n 'expTime': expTime\r\n }\r\n $sessionStorage.setObject('auth_token', opt);\r\n if (auth_token.expTime < Date.now()) {\r\n return _loginUserAgain().then(function (response) {\r\n if (response.error == false) {\r\n return token;\r\n } else {\r\n return response;\r\n }\r\n\r\n });\r\n } else {\r\n $ionicLoading.hide();\r\n return token;\r\n }\r\n\r\n } else {\r\n $ionicLoading.hide();\r\n return handlingErrors.errorFromServer(response);\r\n }\r\n\r\n });\r\n } else {\r\n return $timeout(function () {\r\n return auth_token.token\r\n }, 500);\r\n }\r\n }", "function fetchAuthToken() { \r\n _authToken();\r\n }", "function getToken(){\n var enc_key = ENC_KEY\n var USERNAME = \"omarsow\"\n var APIKEY = API_KEY\n var timestr = Utilities.formatDate(new Date(), \"GMT\", \"yyyy-MM-dd HH:mm:ss\").replace(\" \",\"T\") + \"Z\"\n var raw = \"Username=\"+USERNAME+\"&ApiKey=\"+APIKEY+\"&GenDT=\"+timestr+\"&\"\n Logger.log(raw)\n //use Cipher-Block Chaining (CBC) to encrypt\n Logger.log(sjcl.encrypt(enc_key,raw))\n}", "get authTokenInput() {\n return this._authToken;\n }", "getAccessToken() {}", "async get_token() {\n\n var username = await AsyncStorage.getItem(\"username\");\n if (username != null && username != this.guestuserkey()) {\n var bytes_username = utf8.encode(username);\n var encoded_username = binaryToBase64(bytes_username);\n\n //update when upgrading authentication flow\n var securityversion = \"1\";\n\n var tokenobj = {};\n tokenobj[\"token\"] = encoded_username;\n tokenobj[\"securityversion\"] = securityversion;\n\n var token = JSON.stringify(tokenobj);\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n else {\n var token = \"4B0053744852ED7C2705E668C43982928978B74BBB7F21A0F9B4E43914E49A6F\";\n var bytes = utf8.encode(token);\n var encoded = binaryToBase64(bytes);\n return encoded;\n }\n\n }", "getToken() {\n\t\treturn this._post(\"/api/user/token\");\n\t}", "static getAuthHeader() {\n let token = AuthService.getAuthToken();\n if (token) {\n return {\n 'Authorization': 'Bearer ' + AuthService.getAuthToken()\n };\n } else {\n return {};\n }\n }", "async function adminUserToken () {\n\n const token = await post({ \n Authorization: 'Basic ' + Buffer(db.client.admin.id + ':' + db.client.admin.password).toString('base64')\n }, '/oauth2/token', {\n grant_type: 'password',\n password: db.user.admin.password,\n username: db.user.admin.email\n })\n\n return { Authorization: 'Bearer ' + token.body.access_token }\n}", "getSimpleAuthenticationToken() {\n\t\treturn this.simpleAuthToken;\n\t}", "auth(token) {\n if (this.authToken === token) {\n return this.authToken;\n }\n return undefined;\n }", "getToken() {\n\t\treturn this.qdacityTokenAuthenticationProvider.getToken();\n\t}", "getToken() {\n return fetch(STT_AUTHURL).then(function(response) {\n return response.text();\n });\n }", "function generatetoken(phone,password){\n const token=jwt.sign({phone,password},'mysecret');\n return token;\n \n}", "function genAuthToken(callback) {\n if (boxApi.authToken) {\n boxApi.dbg(\"Auth token already set\");\n callback();\n return;\n }\n\n setTicket();\n\n // Let user enter credentials\n var authWindow = codylindley.swip.createPopup({\n windowURL : boxApi.url + \"auth/\" + auth.ticket,\n height: 700,\n width: 1200,\n top: 50,\n left: 50\n });\n\n if (codylindley.swip.assertOpened(authWindow)) {\n boxApi.alert(\"Could not open popup for authentication.\"\n + \" Do you have popups blocked?\");\n return;\n }\n\n // @TODO show \"cancel\" next to loading gif (maybe wrong password?)\n boxApi.loadingMode(true);\n pollForTokenOrGiveUp(auth.url(), 0, callback);\n }", "static getAuthorization(req, res, next) {\n let token = req.body.storage;\n jwt.verify(token, config.secret, function(err, authData) {\n if (err) {\n res.send(\"Error\").end();\n } else {\n connection.query(\n `SELECT * FROM users WHERE username = '${authData.userForToken.username}' AND password = '${authData.userForToken.password}'`,\n function(err, result) {\n if (err) {\n }\n connection.query(queries.getLoginDetails2, [result[0].id], function(\n err,\n row\n ) {\n if (\n authData.userForToken.username === result[0].username &&\n authData.userForToken.password === result[0].password\n ) {\n const userApproved = {\n id: result[0].id,\n firstname: result[0].firstname,\n lastname: result[0].lastname,\n role: row[0].role\n };\n res.send(userApproved).end();\n }\n });\n }\n );\n }\n });\n }", "async getRequestToken () {\n\t\tif (!this.serviceAuth.usesOauth1()) {\n\t\t\treturn;\n\t\t}\n\t\tlet { host, _mockToken, _mockTokenSecret } = this.request.query;\n\t\tif (host) {\n\t\t\thost = decodeURIComponent(host).toLowerCase();\n\t\t}\n\t\tconst options = {\n\t\t\trequest: this,\n\t\t\thost,\n\t\t\tteam: this.team,\n\t\t\tmockToken: _mockToken,\n\t\t\tmockTokenSecret: _mockTokenSecret\n\t\t};\n\t\tthis.requestTokenInfo = await this.serviceAuth.getRequestToken(options);\n\t}", "function getAccessToken() {\n return 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJkaWQ6ZXRocjoweDBGNEI5OWE0QTdiZTBBNzA3OEE0OGRDNjQwZEZjMjY3QzI2MDAxRjAiLCJpc3MiOiJ3ZWIzLXN0b3JhZ2UiLCJpYXQiOjE2Mjg3NzE1MDkzODYsIm5hbWUiOiJ4aXJ2YTIifQ.AW16Sau5kIPMk0ZlFuqpEalGzxWft0oVc6-UEgPIYb4';\n }", "function getToken() {\n return sessionStorage.getItem('auth');\n }", "function getToken() {\n return token;\n }", "static authenticate() {\n return (req, res, next) => {\n const { provider, accessToken } = this._getCredentials(req);\n\n this._callProvider({ provider, accessToken })\n .then(({ clientId, userId }) => {\n req.auth_user_id = userId;\n req.auth_provider = provider;\n return this._checkClient(clientId);\n })\n .then(() => {\n return next();\n })\n .catch(ex => {\n return next(ex);\n });\n };\n }", "getAuthHeader(token) {\n return {\n Authorization: `Bearer ${token}`,\n };\n }", "function send_access_token_request(authentication_cache, user_input, res){\n\tlet base64data = Buffer.from(`${credentials.client_id}:${credentials.client_secret}`).toString('base64');\n\tlet authorization = `Basic ${base64data}`;\n\t\n\tlet post_data = querystring.stringify({//convert js obj to query string format: grant_type=client_credentials&foo=abcn\n\t\t'grant_type':'client_credentials'\n\t});\n\tlet options = {\n\t\tmethod:'POST',\n\t\theaders:{\n\t\t\t'Content-Type':'application/x-www-form-urlencoded',\n\t\t\t'Authorization':authorization,\n\t\t\t'Content-Length':Buffer.byteLength(post_data)//find length of post_data\n\t\t}\n\t};\n\tconst token_endpoint = 'https://api.petfinder.com/v2/oauth2/token';\n\tlet auth_sent_time = new Date(); //create a new Date object which represents the current date and time as of the time of instantiation.\n\tlet authentication_req = https.request(token_endpoint, options, function (authentication_res){\n\t\treceived_authentication(authentication_cache, authentication_res, user_input, auth_sent_time, res);\n\t});\n\t\n\tauthentication_req.on('error', function(e){\n\t\tconsole.error(e);\n\t});\n\tconsole.log(\"Requesting Token\");\n\tauthentication_req.end(post_data);//because this is a POST request, querystring is placed into the body of the request\n}", "function getToken() {\n\n return Math.random().toString(36).substr( 2, 10 );\n}", "function generateToken() {\n return null; // TODO: add a token generation\n}", "function guestTokenRequest () {\n\treturn sendApiReq(\n\t\t'\\g' + CONFIG_WEBSITE_ENDPOINT + 'backend/web/app_dev.php/oauth/v2/token?client_id=3_p08hEG4THmS3TPlOpS9cYqsh9Aj3vxGUYN8XtmxWLjVtfzoqHg&client_secret=7LYlYxmWBhyjosH3RvRybyCyogmOODppWo6YTLOgBljujlmHSB&grant_type=client_credentials',\n\t\t'GET', null, false, 0\n\t).then(\n\t\tfunction (res) {\n\t\t\tsetCookie('gToken', res.access_token, true)\n\t\t\treturn res\n\t\t},\n\t\tfunction (err) {\n\t\t\tconsole.log('error trying to get new gToken')\n\t\t\treturn err\n\t\t}\n\t)\n}", "async restApiToken () {\n return indy.restApiToken(this)\n }", "login(request, response) {\n const { email } = request.body;\n const text = 'SELECT * FROM users WHERE email = $1';\n const value = [email];\n db.query(text, value, (err, result) => {\n if (err) {\n return response.status(404).json({\n success: 'false',\n message: 'cannot get email',\n });\n }\n const user = { userId: result.rows[0].user_id, userType: result.rows[0].user_type };\n const payload = {\n user,\n };\n const token = generateToken.createToken(payload);\n return response.status(200).json({\n success: 'true',\n message: 'Your sign in was successful',\n username: result.rows[0].username,\n userId: result.rows[0].user_id,\n userType: result.rows[0].user_type,\n userToken: token,\n });\n });\n }", "async getUserAuthenticationToken() {\n\n\t\tif (this.userAuthToken !== null) {\n\t\t\t// userAuthToken is still valid no need\n\t\t\t// to recalculate it so call the callback immediately\n\t\t\tLogger.v('ApiAuthentication getUserAuthenticationToken: found valid token');\n\t\t\treturn Promise.resolve(this.userAuthToken);\n\t\t}\n\n\t\t// No local timestamp, Request server timestamp\n\t\tthis.userAuthToken = this._createToken(this.userId, this.apiKey, await ApiClient.time());\n\t\treturn this.userAuthToken;\n\t}", "get authenticationToken() {\n return this.fields.authenticationToken;\n }", "function getNewTokens() {\n const fakeQuery = {\n state: state,\n code: //Enter your code here\n }\n\n reddit.oAuthTokens(\n state,\n fakeQuery,\n function (success) {\n // Print the access and refresh tokens we just retrieved\n console.log(reddit.access_token);\n console.log(reddit.refresh_token);\n }\n );\n}", "function auth(callback) {\n\toauth.getOAuthRequestToken(function(err, oauth_token, oauth_token_secret, results) {\n\t\t\tif (err) {\n\t\t\t\tconsole.log('error: ' + JSON.stringify(error));\n\t\t\t\tcallback(error, null);\n\t\t\t} else {\n\t\t\t\t// FIXME: store more than one token\n\t\t\t\toauthTokenSecert = oauth_token_secret;\n\t\t\t\tcallback(null, \"https://qa.test.powershop.co.nz/external_api/oauth/authorize?oauth_token=\" + oauth_token);\n\t\t\t}\n\t});\n}", "getAuthHeader() {\n return {\n 'Authorization': 'Bearer ' + localStorage.getItem('id_token')\n }\n }", "async getToken() {\n const token = await this.cookies.get('token') || '';\n return token ? `Bearer ${token}` : '';\n }", "function externalAuthAdapter(ctx) {\n return createAuthToken(ctx, buildExternalAuthToken);\n}", "function makeAuth(auth)\n {\n if(auth === 'basic')\n {\n //Ako e 'basic' vsuhtame obekta jelan ot kinvey\n return `Basic ${btoa(APP_KEY + ':' + APP_SECRET)}`;\n } \n else\n {\n //ako NE e 'basic' vrustha 'Basic' + authoken-a ot locationStorage ili ot sessionStorage\n return `Kinvey ${localStorage.getItem('authtoken')}`;\n }\n }", "getAuthHeader () {\n return {\n 'Authorization': 'Bearer ' + window.localStorage.getItem('id_token')\n }\n }", "getToken() {\n return [\n this.authenticate([AUTH_TYPE.BASIC, AUTH_TYPE.CLIENT]),\n this._bindAfterToken.bind(this),\n this.exchange(),\n ];\n }", "async requestToken() {\n\t\tlet iat = Math.floor(Date.now() / 1e3);\n\n\t\tlet payload = Object.assign({\n\t\t\tiss: this.iss,\n\t\t\tscope: this.scope,\n\t\t\taud: GOOGLE_TOKEN_URL,\n\t\t\texp: iat + 3600,\n\t\t\tsub: this.sub,\n\t\t\tiat,\n\t\t}, this.additionalClaims);\n\n\t\tlet assertion = sign({ header:{ alg }, payload, secret:this.key });\n\t\tlet body = stringify({ grant_type, assertion });\n\n\t\treturn send('POST', GOOGLE_TOKEN_URL, { headers, body }).then(r => {\n\t\t\tthis.token = r.data.access_token;\n\t\t\tthis.expiresAt = (r.data.expires_in == null) ? null : (iat + r.data.expires_in) * 1e3;\n\t\t\treturn this.token;\n\t\t}).catch(err => {\n\t\t\tthis.token = this.expiresAt = null;\n\t\t\tlet body = err.data || {};\n\t\t\tif (body.error) {\n\t\t\t\tlet msg = String(body.error);\n\t\t\t\tif (body.error_description) msg += `: ${body.error_description}`;\n\t\t\t\terr.message = msg;\n\t\t\t}\n\t\t\tthrow err;\n\t\t});\n\t}", "static getAuthToken(authSecret, expiresIn = 2 * 60)\n {\n if (authSecret)\n {\n if (!expiresIn)\n {\n return jwt.sign({}, authSecret, {});\n }\n return jwt.sign({}, authSecret, { expiresIn: expiresIn });\n }\n return '';\n }", "function getRequestToken() {\n StartService.getRequestToken().then(function ( data ) {\n // save oauth_token, oauth_token_secret to requestToken\n requestToken = data;\n }, function ( error ) {\n console.error('Can\\'t get request token');\n Toast.showToast(null, 'Can\\'t get request token');\n });\n }", "performPRTGAPILogin() {\n var username = this.username;\n var passhash = this.passhash;\n var options = {\n method: 'GET',\n url: this.url + \"/getstatus.htm?id=0&username=\" + username + \"&passhash=\" + passhash\n };\n return this.backendSrv.datasourceRequest(options).then(response => {\n this.passhash = response;\n return response;\n });\n }", "function getGAauthenticationToken(email, password) {\n password = encodeURIComponent(password);\n var response = UrlFetchApp.fetch(\"https://www.google.com/accounts/ClientLogin\", {\n method: \"post\",\n payload: \"accountType=GOOGLE&Email=\" + email + \"&Passwd=\" + password + \"&service=fusiontables&Source=testing\"\n });\n \n\tvar responseStr = response.getContentText();\n\tresponseStr = responseStr.slice(responseStr.search(\"Auth=\") + 5, responseStr.length);\n\tresponseStr = responseStr.replace(/\\n/g, \"\");\n\treturn responseStr;\n}", "function getAccessToken() {\n firebase.auth().currentUser.getIdToken(true).then(idToken => {\n // POST https://thoominspotify.com/api/user/accessToken\n // {\n // \"thoominToken\" : idToken\n // }\n //\n\n console.log(\"TOKEN \" + idToken);\n return idToken;\n })\n .catch(error => {\n console.log(error);\n })\n}", "async gqlClient({ commit, state }, useAuth) {\n return new GraphQLClient(\n GQL_ENDPOINT,\n useAuth && state.token\n ? { headers: { authorization: `Bearer ${state.token}` } }\n : {}\n );\n }", "function getAuthTokenId() {\n\t return _store2.default.getState().login.getIn(['keystoneAccess', 'token', 'id']);\n\t}", "async auth({ request, response }) {\n const validation = await validate(request.all(), {\n clientid: 'required',\n username: 'required',\n password: 'required',\n })\n\n if (validation.fails()) {\n return response.status(400).send()\n }\n\n const secret = Env.get('APP_KEY')\n if (request.input('clientid') === secret) {\n return true\n }\n\n const user = await User.query()\n .where('token', request.input('clientid'))\n .first()\n\n if (!user) {\n return response.status(400).send()\n }\n\n return response.status(200).send()\n }", "getAuthHeader() {\n\t\treturn this.token.getToken().then((token) => `Bearer ${token}`);\n\t}", "function gen_auth_middleware (sql) {\n return function (req, res, next) {\n if (!req.headers.authorization) {\n return res.status(401).end();\n }\n const token = req.headers.authorization.split(' ')[1];\n\n return jwt.verify(token, secret.jwtSecret, (err, decoded) => {\n if (err) {\n console.log(`[401] ${req.method} ${req.url}: Cannot verify JWT token`);\n return res.status(401).end();\n }\n\n const userId = decoded.sub;\n\n // check if a user exists\n return sql.getUserById(userId).then((user) => {\n if (!user) {\n console.log(`[401] ${req.method} ${req.url}: Cannot find user in DB`);\n return res.status(401).end('Cannot find user in DB');\n }\n\n console.log(`[200] ${req.method} ${req.url}: Found user in DB`);\n req.locals = { userId: userId };\n\n return next();\n }).catch((err) => {\n console.log(`[401] ${req.method} ${req.url}: ${err.message}`);\n return res.status(401).end(err.message);\n });\n });\n };\n}", "setToken(password){\n this.token = new Buffer(`${this.user}:${password}`).toString('base64')\n return this.token\n }", "async getAuth(payload) {\n if (payload.authUserName) {\n const data = await fetch.get('/auth', Object.assign(payload, { authType: 2 }));\n try {\n const json = JSON.parse(await data.text());\n if (!json.successful) {\n message.error(json.message);\n return;\n }\n } catch (e) {\n message.error('授权失败!');\n }\n }\n this.getClinicId();\n }", "function auth() {\n\n var deferred = $q.defer();\n {\n that.getUser().then(\n function (userData) {\n that.authApplication(userData).success(function (data) {\n that.authCombined(data.token).then(function (data) {\n iodSessionToken.setSessionToken(data.token);\n that.removeTokenFromUrl();\n that.ssoTokenDeffered.resolve();\n that.getUserToken();\n deferred.resolve();\n }, function (e) {\n that.ssoTokenDeffered.reject('Failed to retrieve the combined token ');\n deferred.reject(e);\n });\n }).error(function (e) {\n that.ssoTokenDeffered.reject('Failed to retrieve the unbound token ');\n deferred.reject(e);\n })\n },\n function (e) {\n $log.debug('Failed to get users');\n deferred.reject(e);\n }\n )\n\n }\n return deferred.promise;\n }", "static basic(token) {\n return new Promise(async (resolve, reject) => {\n const decoded = Buffer.from(token, 'base64').toString();\n let email = decoded.split(':')[0];\n let pw = decoded.split(':')[1];\n let user = await User.findOne({ 'profile.email': email });\n let isMatch;\n if (!user) {\n resolve();\n } else {\n isMatch = await user.comparePassword(pw);\n }\n if (isMatch) {\n resolve({\n sub: user._id,\n role: user.role,\n iat: moment().unix(),\n exp: moment()\n .add(30, 'minutes')\n .unix()\n });\n } else {\n resolve();\n }\n });\n }", "function auth() {\n var opts = {\n jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),\n secretOrKey: secret,\n };\n passport.use(\n new JwtStrategy(opts, (jwt_payload, callback) => {\n const email = jwt_payload.email;\n connection.query(\n \"SELECT * FROM user WHERE email = ?\",\n [email],\n function (err, results, fields) {\n console.log(\"Results\");\n console.log(results);\n if (results.length > 0) {\n console.log(results);\n console.log(jwt_payload);\n callback(null, results);\n }\n if (err) {\n console.log(err);\n callback(null, false);\n }\n }\n );\n })\n );\n}", "function doany_auth(token) {\n var base_url = \"https://sm-prod2.any.do/\";\n var xhr = new XMLHttpRequest();\n xhr.open('POST', base_url + 'j_spring_security_check');\n console.log('posting to ' + base_url + 'j_spring_security_check');\n xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n xhr.send('j_username=<enter-urlencoded-username>&j_password=<enter-urlencoded-password>&_spring_security_remember_me=on');\n xhr.onload = function () {\n var auth = this.getResponseHeader('X-Anydo-Auth');\n doany_tasks(token, auth);\n };\n}", "static async login(data) {\n let res = await this.request(`auth/token`, data, \"post\");\n return res.token;\n }", "async getToken(req, res) {\n try {\n const mType = await checkRole(req.query);\n const user = await mongoose.model(mType).findById(req.user._id);\n return res.status(200).json({ user: user._doc });\n } catch (err) {\n return res.status(err.statusCode || 500).json({\n statusCode: err.statusCode || 500,\n message: err.message,\n });\n }\n }", "createRequestToken(_, args, { dataSources }) {\n const { movieDatabaseV4 } = dataSources\n return movieDatabaseV4.createRequestToken(args)\n }", "assignToken() {\n this.token = `${this.username}-${new Date().toISOString()}-${Math.floor(Math.random() * 1000000)}`;\n }", "createToken() {\n\t\tconst date = new Date();\n\t\tconst timestamp = date.getTime() + parseInt(process.env.JWT_EXPIRATION, 10);\n\t\tconst expiry_date = new Date(timestamp);\n\n\t\treturn jwt.sign(\n\t\t\t{\n\t\t\t\t_id: this._id,\n\t\t\t\temail: this.email,\n\t\t\t\texpiry_date: expiry_date.toISOString(),\n\t\t\t},\n\t\t\tprocess.env.JWT_SECRET,\n\t\t\t{\n\t\t\t\texpiresIn: process.env.JWT_EXPIRATION,\n\t\t\t}\n\t\t);\n\t}", "async findAndGenerateToken(options) {\n const { email, password } = options;\n if (!email) {\n throw new APIError({\n message: \"An email is required\",\n });\n }\n\n const user = await this.findOne({ email }).exec();\n const err = {\n status: httpStatus.UNAUTHORIZED,\n isPublic: true,\n };\n if (password) {\n if (user && (await user.passwordMatches(password))) {\n return { user, accessToken: user.token() };\n }\n err.message = \"Incorrect email or password\";\n } else {\n err.message = \"Incorrect email\";\n }\n throw new APIError(err);\n }", "get token() {\n return (this.tokenGenerated) ? this.config.token : new Error(\"Token not Generated... Please use getUserToken()\");\n }", "async acquireTokenByUsernamePassword(request) {\n this.logger.info(\"acquireTokenByUsernamePassword called\", request.correlationId);\n const validRequest = {\n ...request,\n ...(await this.initializeBaseRequest(request))\n };\n const serverTelemetryManager = this.initializeServerTelemetryManager(ApiId.acquireTokenByUsernamePassword, validRequest.correlationId);\n try {\n const usernamePasswordClientConfig = await this.buildOauthClientConfiguration(validRequest.authority, validRequest.correlationId, serverTelemetryManager, undefined, request.azureCloudOptions);\n const usernamePasswordClient = new msalCommon.UsernamePasswordClient(usernamePasswordClientConfig);\n this.logger.verbose(\"Username password client created\", validRequest.correlationId);\n return usernamePasswordClient.acquireToken(validRequest);\n } catch (e) {\n if (e instanceof msalCommon.AuthError) {\n e.setCorrelationId(validRequest.correlationId);\n }\n serverTelemetryManager.cacheFailedRequest(e);\n throw e;\n }\n }", "static generateRandomToken(){\n return bcrypt.hashSync(Math.floor(Math.random() * 1000000).toString(), 12)\n }", "token() {\n return {\n id: this.id,\n role: this.role,\n };\n }", "token() {\n return {\n _id: this._id,\n role: this.role\n }\n }", "createBasicAuthToken(username, password) {\n return 'Basic ' + window.btoa(username + \":\" + password)\n }", "token() {\n logger.debug('Creating token endpoint middleware')\n return async (ctx, next) => {\n logger.debug('Running token endpoint middleware')\n const { request, response } = build(ctx)\n\n await this.server\n .token(request, response)\n .then(token => {\n return this.saveTokenMetadata(token, ctx.request)\n })\n .then(async token => {\n ctx.state.oauth.token = token\n ctx.state.oauth.authenticated = true\n handleResponse(ctx, response)\n if (next) await next()\n })\n .catch(err => {\n handleError(err, ctx)\n })\n }\n }", "function getLocalToken() {\n return 'Bearer ' + localStorage[\"authToken\"];\n}", "function generateToken (password) {\n return hat();\n}", "async context({ req }) {\n const user = await authenticate(req)\n const token = req.headers.token\n\n return { token, user }\n }", "getAuthorizationHeader() {\n const accessToken = this.getState(\"tokenResponse.access_token\");\n\n if (accessToken) {\n return \"Bearer \" + accessToken;\n }\n\n const {\n username,\n password\n } = this.state;\n\n if (username && password) {\n return \"Basic \" + this.environment.btoa(username + \":\" + password);\n }\n\n return null;\n }", "function authentication (type) {\n \n return type === 'Basic'\n ? 'Basic ' + btoa(appKey + ':' + appSecret)\n : 'Kinvey ' + sessionStorage.getItem('authtoken');\n}", "getAuthForRequest(ctx) {\n return new Auth_1.Auth(this, ctx);\n }", "function getUserToken(){\n\t\treturn $cookies.get('user.token');\n\t}", "function makeAuth(type) {\n return type === 'basic'\n ? 'Basic ' + btoa(appKey + ':' + appSecret)\n : 'Kinvey ' + localStorage.getItem('authtoken');\n }", "function useCredentials(token) {\n //username = token.split('.')[0];\n isAuthenticated = true;\n authToken = token;\n\n // Set the token as header for your requests!\n\n // $http.defaults.headers.common['Authorization'] = 'Bearer '+token;\n }", "function get_token (open_id) {\n if (open_id) {\n \n Auth.set_open_id(open_id);\n Auth.set_oauth_page(oauth_page_uri);\n\n var auth = new restUser.auth({\n open_id: open_id\n })\n \n auth.$get()\n .then(function (data) {\n if (data.state) {\n var pair;\n if (oauth_page_uri.indexOf('?') < 0){\n pair = '?';\n } else {\n pair = '&';\n }\n $window.location = oauth_page_uri + pair +\n 'open_id=' + open_id +\n '&state=' + data.state +\n '&ext_key=' + data.ext_key +\n '&response_type=' + data.response_type +\n '&redirect_uri=' + encodeURIComponent(data.redirect_uri);\n }\n })\n\t\t\t\t.catch(function (data) {\n\t\t\t\t\tconsole.error(data)\n $location.path(Config.route.error)\n\t\t\t\t})\n }\n }", "GetTokenLogin(){\n let Token = localStorage.getItem(this._DbKeyLogin) // Recuperer le token de la DB du browser\n return Token\n }", "function requestToken(next) {\n oauth.getOAuthRequestToken(function(error, oauthToken, oauthTokenSecret, results) {\n if (error) {\n next(error);\n } else {\n next(null, {requestToken:oauthToken, \n requestTokenSecret:oauthTokenSecret, \n redirectUrl:config.authorizeUrl + \"?oauth_token=\" + oauthToken});\n }\n });\n}", "getToken() {\n const params = {\n grant_type: GRANT_TYPE,\n appid: this.appId,\n secret: this.appSecret\n };\n\n return ajaxGet(TOKEN_AUTH_URL, { params })\n .then((data) => {\n if (data && data.errcode) {\n return Promise.reject(data);\n }\n\n return Promise.resolve(data);\n });\n }", "function maketoken(info){\n info.expires=Date.now()+tokenExpiresTime\n return jwt.encode(info,secret)\n}", "static async login(data) {\n let res = await this.request(`users/token`, data, 'post');\n console.log(\"TOKEN FROM SERVER--->\", res.token);\n return res.token;\n }", "static get NEED_AUTH() { return 5; }", "static getApiAuthHeader() {\n return {'authorization': `bearer ${Auth.getToken()}`};\n }", "requestToken() {\n return this.get('request-token');\n }", "function AuthDriver( ){\n let data = {};\n\n function setData( _data ) {\n data = _data;\n // set the auth token to the protected request\n API.requestRandomProtected.headers.Authorization = \"Bearer \" + data.token;\n }\n\n function getData() {\n return data;\n }\n \n return {\n API,\n setData,\n getData\n }\n }", "getToken(mySessionId) {\n return this.createSession(mySessionId)\n .then(sessionId => this.createToken(sessionId));\n }", "function newTokenGeneration(request) {\r\n return \"ABC\";\r\n}" ]
[ "0.7073702", "0.700345", "0.6820543", "0.6611227", "0.655493", "0.6486911", "0.6468615", "0.64642113", "0.63628393", "0.6355285", "0.6349255", "0.6341291", "0.6307538", "0.6296276", "0.6294572", "0.62880164", "0.62823623", "0.6269742", "0.6249149", "0.62170273", "0.62016165", "0.6195919", "0.6192429", "0.61869466", "0.61753315", "0.61584586", "0.61552083", "0.61493677", "0.6141417", "0.6140556", "0.6134262", "0.6127196", "0.61162716", "0.6110343", "0.60936546", "0.6080648", "0.6078408", "0.60780215", "0.6075546", "0.6070024", "0.6069652", "0.60592026", "0.60527635", "0.60290647", "0.5998209", "0.59844387", "0.59701955", "0.59607583", "0.59579575", "0.5954989", "0.59452", "0.59435433", "0.5938318", "0.5924238", "0.5923981", "0.5906737", "0.590215", "0.5899468", "0.5898024", "0.58954585", "0.58919185", "0.5886406", "0.5883724", "0.586622", "0.58636093", "0.5862003", "0.586157", "0.58608276", "0.5860448", "0.58578104", "0.58548075", "0.58525413", "0.5849078", "0.58450633", "0.58401936", "0.5839759", "0.5834352", "0.5834138", "0.5830386", "0.5829429", "0.581939", "0.5818553", "0.5815563", "0.5815401", "0.5810538", "0.5809767", "0.5809014", "0.5807986", "0.57991457", "0.5796739", "0.5795021", "0.5792581", "0.5791357", "0.5786441", "0.5782102", "0.5776548", "0.577522", "0.57752025", "0.577191", "0.5770414", "0.57701075" ]
0.0
-1
To return a movie listing based on the requested parameters ~ unused
function searchMovies(movies){ console.log("searching for:", movies); axios.get(generateApiUrl('search/movie')) .then( (response) => { console.log(response); }) .catch((err) => { console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function list(name, year, genres, page) {\n return $.getJSON(\"/api/movies/?q=\" + encodeURIParam(name) + \"&year=\" + encodeURIParam(year) + \"&genres=\" + encodeURIParam(genres) + \"&page=\" + encodeURIComponent(page != null ? page.toString() : \"\"));\n }", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "function getNowPlayingMovies() {\n\n const path = '/movie/now_playing';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Now Playing Movies'});\n\n sectionMovies(url, render, handleError);\n\n\n}", "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "function searchMovie(value) {\n\n const path = '/search/movie';\n\n const url = generateUrl(path) + '&query=' + value;\n\n const render = renderMovies.bind({title: 'Results'});\n\n sectionMovies(url, render, handleError);\n\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function getMovies(searchText) {\n $.get(\n baseURL + searchName + searchText + \"&type=movie\",\n (respuesta, estado) => {\n if (estado === \"success\") {\n let movies = respuesta.Search;\n let output = \"\";\n $.each(movies, (i, movie) => {\n output += `\n <div class=\"col-md-3\">\n <div class=\"well text-center\">\n <img class=\"imgSearch\" src=\"${movie.Poster}\">\n <h5>${movie.Title}</h5>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"btn btn-info\" href=\"#\">Mas info</a>\n </div>\n </div>\n \n `;\n });\n\n result.html(output);\n }\n }\n );\n}", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "function ex20() {\n\tvar movieLists = [\n\t\t{\n\t\t\tname: \"New Releases\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 150, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t{ width: 140, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" }\n\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tname: \"Thrillers\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 130, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t{ width: 120, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t\t\t\t\t\t{ width: 300, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t];\n\n\n\t// Use one or more concatMap, map, and reduce calls to create an array with the following items (order doesn't matter)\n\t// [\n\t//\t {\"id\": 675465,\"title\": \"Fracture\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t//\t {\"id\": 65432445,\"title\": \"The Chamber\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t//\t {\"id\": 654356453,\"title\": \"Bad Boys\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" },\n\t//\t {\"id\": 70111470,\"title\": \"Die Hard\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists.\n\t\tconcatMap(movieList => movieList.videos.concatMap(v=> v.boxarts\n .reduce((acc, curr) => acc.width * acc.height < curr.width * curr.height ? acc : curr)\n .map(b => ({id: v.id, title: v.title, boxart: b.url}))\n )\n )\n\n}", "function ex14() {\n\tvar movieLists = [\n\t\t\t{\n\t\t\t\tname: \"Instant Queue\",\n\t\t\t\tvideos : [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" }\n\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\tname: \"New Releases\",\n\t\t\t\tvideos: [\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\t\"bookmark\": []\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t\t{ width: 200, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t\t{ width: 150, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t\t\t\t\t\t\t{ width: 300, height: 200, url: \"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t\t],\n\t\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\t\"bookmark\": [{ id: 432534, time: 65876586 }]\n\t\t\t\t\t}\n\t\t\t\t]\n\t\t\t}\n\t\t];\n\n\n\t// Use one or more concatMap, map, and filter calls to create an array with the following items\n\t// [\n\t//\t {\"id\": 675465, \"title\": \"Fracture\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/Fracture150.jpg\" },\n\t//\t {\"id\": 65432445, \"title\": \"The Chamber\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/TheChamber150.jpg\" },\n\t//\t {\"id\": 654356453, \"title\": \"Bad Boys\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/BadBoys150.jpg\" },\n\t//\t {\"id\": 70111470, \"title\": \"Die Hard\", \"boxart\": \"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists.concatMap(m=> m.videos\n .concatMap(v=>v.boxarts\n .filter(b=> b.width==150 && b.height==200)\n \t\t\t\t\t\t\t\t\t\t.map(b=> ({id: v.id, title: v.title, boxart: b.url}))\n ))\n // Complete this expression!\n\n}", "function moviesandTv() {\n let tvShowsUrl = 'https://api.themoviedb.org/3/';\n let category = $(\"input[type='radio']:checked\").val();\n let keyWord = getKeyWord();\n\n\n let QueryUrl = keyWord =='%20'? '' : `&query=${keyWord}&page=1&include_adult=false`;\n let search = keyWord =='%20'? 'discover': 'search';\n\n let queryUrl = `${tvShowsUrl}${search}/${category}?api_key=${moviesShowsAPI}${QueryUrl}`\n\n console.log(queryUrl)\n\n\n $.getJSON(queryUrl, function (data) {\n\n tvOrMovie = data.results;\n $('tvmovie_list li').remove();\n $('#tvmovie_list').empty();\n\n let title = category == 'movie' ? 'original_title' : 'original_name';\n let date = category == 'movie' ? 'release_date' : 'first_air_date';\n\n $.each(tvOrMovie, function (index, movie) {\n\n let poster = isImage(movie.poster_path);\n\n $('#tvmovie_list').append(`<li><a id=\"to_details\" data-transition=\"pop\" href=\"#\"><img id=\"image_content\"src=${poster}>\n <h2>${movie[title]}</h2>\n <p>${dateBeautify(movie[date])}</p>\n <span id=${index} class=\"ui-li-count\">${movie.vote_average.toFixed(1)}</span></a></li>`);\n });\n\n\n $('#tvmovie_list').listview('refresh');\n })\n}", "function getMovies(searchText) {\n $.ajax({\n method: 'Get',\n url: 'http://www.omdbapi.com/?apikey=65a08387&s=' + searchText\n }).done(function (data) {\n let movies = data.Search;\n let output = '';\n $.each(movies, function(index, movie) {\n output += `\n <li>\n <a onclick=\"movieClicked('${movie.imdbID}')\" href=\"#\">\n <img src=\"${movie.Poster}\">\n <h2>${movie.Title}</h2>\n <p>Release Year: ${movie.Year}</p>\n </a>\n </li>\n `;\n });\n $('#movies').html(output).listview('refresh');\n });\n}", "function movies() {\n //console.log('The Toy');\n \t\n \t\n \tfor (var i = 3; i < nodeArgs.length; i++) {\n\n \t\tvar movieTitle = \"\"; \n \t\tconsole.log()\n\n \t\tif (i >= 3 && i < nodeArgs.length) {\n \t\t\tmovieTitle = movieTitle + \"+\" + nodeArgs[i];\n \t\t}\n \n \t\telse {\n \t\t\tmovieTitle = movieTitle + nodeArgs[i];\n \t\t}\n \t}\n \tvar queryURL = 'http://www.omdbapi.com/?t=' + movieTitle +'&tomatoes=true&y=&plot=short&r=json';\n \t\n \t//these are so we can visualize our URL & user Input for debugging\n \tconsole.log(queryURL);\n \tconsole.log(movieTitle);\n \n \trequest(queryURL, function(error, response, body) {\n \n \t\tif (!error && response.statusCode == 200) {\n \t\t\tconsole.log(\"Title: \" + JSON.parse(body)[\"Title\"]);\t// Movie title\n \t\t\tconsole.log(\"Released: \" + JSON.parse(body)[\"Year\"]);\t// Movie Release Year\n \t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body)[\"imdbRating\"]);\t// IMDB rating\n \t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body)[\"Country\"]); //Production Country\n \t\t\tconsole.log(\"Movie Language: \" + JSON.parse(body)[\"Language\"]);\t//Movie Language\n \t\t\tconsole.log(\"Plot: \" + JSON.parse(body)[\"Plot\"]); //Movie Plot\n \t\t\tconsole.log(\"Cast: \" + JSON.parse(body)[\"Actors\"]);\t//Movie Cast\n \t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body)[\"tomatoRating\"]); //Rotten Tomatoes Rating\n \t\t\tconsole.log(\"Rotten tomatoes URL: \" + JSON.parse(body)[\"tomatoURL\"]); //Rotten tomatoes URL\n \t\t}\n \t\telse {\n \n \t\t}\n \t});\n }", "function movieThis(movie) {\n // if no argument entered, default argument\n if (!argument) {\n movie = \"Mr. Nobody\";\n }\n // search ombd API movie with movie\n axios\n .get(`https://www.omdbapi.com/?t=${movie}&apikey=trilogy`)\n // function to console log response when data is received\n .then(function(response) {\n console.log(\"\\n------------------------------------------\");\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Released: ${response.data.Year}`);\n console.log(`Actors: ${response.data.Actors}`);\n console.log(`IMBD Rating: ${response.data.imdbRating}`);\n console.log(`Rotten Tomatoes Rating: ${response.data.Ratings[1].Value}`);\n console.log(`Produced in: ${response.data.Country}`);\n console.log(`Language: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(\"\\n\");\n })\n // if error, console logs error message\n .catch(function(err) {\n console.error(err);\n })\n}", "function searchFilmsByTitle(title) {\n let format = title.split(' ').join('+'); // replace spaces with plus\n $.ajax({\n url: `https://www.omdbapi.com/?apikey=ac155d96&s=${format}`,\n dataType: \"json\"\n }).done(function(resp) {\n if (resp.Search != null) {\n let respSize = resp.Search.length;\n for (let i = 0; i < respSize; i++) {\n if(resp.Search[i].Poster != 'N/A' && resp.Search[i].Type == 'movie') {\n let myHTML = \n `<div class=\"col-sm-6\">\n <a class=\"movie-select\" href=\"#\" id=\"${resp.Search[i].imdbID}\">\n <img class=\"movie-image\" src=\"${resp.Search[i].Poster}\">\n </a>\n </div>`;\n $(\"#movies\").append(myHTML);\n }\n }\n } else {\n let myHTML =\n `<div class=\"col-sm-12\">\n <div class=\"alert alert-primary col\" role=\"alert\">\n ${resp.Error}\n </div></div>`;\n $(\"#movies\").append(myHTML);\n }\n });\n }", "function movieSearch() {\n var encodeName = encodeURI(searchName);\n request(\"http://www.omdbapi.com/?t=\" + encodeName + \"&y=&plot=short&r=json\", function(error, response, body) {\n\tif (!error && response.statusCode === 200) {\n\t //console.log(JSON.parse(body));\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t // year\n\t console.log(\"Year Released: \" + JSON.parse(body).Year);\n\t // imdb rating\n\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t // country produced\n\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t // language of movie\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t // plot\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t // actors\n\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t // rotten tomatoes rating\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t // rotten tomotoes url\n\t console.log(\"Rotten Tomatoes: https://www.rottentomatoes.com/search/?search=\" + encodeName);\n\t} else {\n\t console.log(error);\n\t}\n });\n} // close movie search", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function showMovie(response) {\n let movie = response;\n\n //neki filmovi/serije imaju vise rezisera, glumaca i zanrova i da bi ljepse mogli da ih prikazemo na stranici od stringa koji dobijemo napravimo niz elemenata\n var str = movie.Actors;\n var str2 = movie.Director;\n var str3 = movie.Genre;\n\n var stars = str.split(\", \");\n var directors = str2.split(\", \");\n var genres = str3.split(\", \");\n\n //ukoliko nemamo podatke o slici prikazemo default sliku iz foldera\n if (movie.Poster == \"N/A\") {\n movie.Poster = \"./Images/default.jpg\";\n }\n\n //prikazujemo redom podatke\n $(\"#movie-title-name\").append(movie.Title + ' <span id=\"movie-year\"></span>');\n $(\"#movie-year\").append(movie.Year);\n\n //ukoliko IMDb ocjene nisu dostupne, prikazemo odgovarajucu poruku\n if (movie.imdbRating === 'N/A') {\n $(\"#movie-rating\").append('<span>Ratings are not available<span>');\n } else {\n $(\"#movie-rating\").append(movie.imdbRating + '/10 <span>' + movie.imdbVotes + ' votes </span>');\n }\n\n $(\"#img\").append('<img src=' + movie.Poster + ' alt=\"\">');\n\n if (movie.Plot === 'N/A') {\n $('#movie-description').append('Plot is not available at this moment. :)');\n } else {\n $('#movie-description').append(movie.Plot);\n }\n\n directors.forEach(director => {\n $('#movie-director').append('<p>' + director + '</p>');\n });\n\n stars.forEach(star => {\n $('#movie-stars').append('<p>' + star + '</p>');\n });\n\n genres.forEach(genre => {\n $('#movie-genre').append('<p>' + genre + '</p>');\n });\n\n $('#movie-released').append(movie.Released);\n $('#movie-runtime').append(movie.Runtime);\n\n //ukoliko je Type -> serija onda prikazemo ukupan broj sezona \n //prikazemo i select sa svim sezonama te serije gdje na klik mozemo prikazati sve epizode odredjene sezone\n //po defaultu je selectovana poslednja sezona serije, kako bi odmah pri ulasku u seriju imali izlistane epizode \n if (movie.Type == 'series') {\n $('#movie-seasons').append('<h3>Seasons:</h3><p>' + movie.totalSeasons + '</p>');\n\n $('#series-season').append(\n '<p class=\"heading-des\">Episodes> ' +\n '<select onchange=\"getSeason(\\'' + movie.Title + '\\')\" id=\"select-episodes\">' +\n '</select>' +\n '</p>' +\n '<hr class=\"about\">' +\n '<div class=\"description\">' +\n '<div id=\"episodes\">' +\n '</div>' +\n '</div>'\n )\n }\n\n $('#movie-cast').append(\n '<p>Director: ' + movie.Director + '</p>' +\n '<p>Writer: ' + movie.Writer + '</p>' +\n '<p>Stars: ' + movie.Actors + '</p>'\n )\n\n if (movie.Ratings.length == 0) {\n $('#movie-reviews').append('<p>Ratings are not available at this moment. :)</p>')\n } else {\n movie.Ratings.forEach(rating => {\n $('#movie-reviews').append('<p>' + rating.Source + ' --> ' + rating.Value + '</p>')\n });\n }\n\n if (movie.Awards === 'N/A') {\n $('#movie-awards').append('Awards are not available at this moment. :)');\n } else {\n $('#movie-awards').append(movie.Awards);\n }\n\n $('#movie-imdb-btn').append(\n '<button onClick=\"openImdbPage(\\'' + movie.imdbID + '\\')\" class=\"btn-imdb\">' +\n '<i class=\"fab fa-imdb\"></i> IMDb' +\n '</button>'\n )\n\n //za ukupan broj sezona serije ispunimo select sa tolikim brojem opcija\n for (i = 1; i <= movie.totalSeasons; i++) {\n $('#select-episodes').append(\n '<option selected=\"selected\" value=\"\\'' + i + '\\'\">Season ' + i + '</option>'\n )\n }\n\n if (movie.Type === \"series\") {\n\n //prikazemo sve epizode selektovane sezone\n getSeason(movie.Title);\n\n }\n\n //ukoliko smo otvorili epizodu prikazemo na stranici na kojoj smo epizodi i sezoni \n //i prikazemo dugme za povratak na seriju\n if (movie.Type === \"episode\") {\n $(\"#episode-details\").append(\n '<span class=\"episode-span\">Season ' + movie.Season + ' </span>' +\n '<span class=\"season-span\">Episode ' + movie.Episode + '</span>'\n )\n $(\"#button-tvshow\").append(\n '<button onClick=\"openMovie(\\'' + movie.seriesID + '\\')\" class=\"btn-search\">' +\n '<i class=\"fas fa-chevron-left\"></i>' +\n ' Back to TV Show' +\n '</button>'\n )\n }\n}", "function movieThis() {\n\n\t// if user enters a value - process.argv[3]\n\n\tif (value) {\n\n\t \t// Create an empty variable for holding the movie name\n\n\t\tvar movieName = \"\";\n\n\t} // end of if no movie title was entered\n\n\t// else no movie title was entered search Mr. Nobody\n\n\telse {\n\n\t\tmovieName = \"Mr. Nobody\";\n\n\t} // end of else\n\n\t// Change any \" \" to + in the movie title\n\n\tfor (var i = 3; i < nodeArgs.length; i++){\n\n\t\t// if the movie has more than one word\n\n\t if (i > 3 && i < nodeArgs.length){\n\n\t movieName = movieName + \"+\" + nodeArgs[i];\n\n\t } // end of if there are spaces\n\n\t // the first word of the movie title\n\n\t else {\n\n\t movieName = movieName + nodeArgs[i];\n\n\t } // end of else\n\n\t} // end of for loop\n\n\t// OMDB API request \n\n\tvar queryUrl = 'http://www.omdbapi.com/?t=' + movieName +'&tomatoes=true';\n\n\trequest(queryUrl, function (error, response, body) {\n\n\t // If the request is successful \n\n\t if (!error && response.statusCode == 200) {\n\n\t // Parse the body of the site so that we can pull different keys more easily\n\t \n\t body = JSON.parse(body);\n\t console.log(\"Title: \" + body.Title);\n\t console.log(\"Year: \" + body.Year);\n\t console.log(\"IMDB Rating: \" + body.imdbRating);\n\t console.log(\"Country: \" + body.Country);\n\t console.log(\"Language: \" + body.Language);\n\t console.log(\"Plot: \" + body.Plot);\n\t console.log(\"Actors: \" + body.Actors);\n\t console.log(\"Rotten Tomatoes Rating: \" + body.tomatoRating);\n\t console.log(\"Rotten Tomatoes URL: \" + body.tomatoURL);\n\n\t // store information as a string\n\n\t\t\tlogText = JSON.stringify({\n\t\t\t\ttitle: body.Title,\n\t\t\t\tyear: body.Year,\n\t\t\t\timdbRating: body.imdbRating,\n\t\t\t\tcountry: body.Country,\n\t\t\t\tlanguage: body.Language,\n\t\t\t\tplot: body.Plot,\n\t\t\t\tactors: body.Actors,\n\t\t\t\trottenRating: body.tomatoRating,\n\t\t\t\trottenURL: body.tomatoURL\n\t\t\t}); // end of logText stringify\n\n\t\t\t// log information in logText in log.txt\n\n\t\t\tlogInfo();\n\n\t \n\t } // end of if the request is successful\n\t}); // end of request\n\n} // end of movie-this function", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "function searchMovie(searchWord, page) {\n fetch(\n `http://www.omdbapi.com/?s=${searchWord}&apikey=dd68f9f&page=${page}&plot=short`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n let searchResults = data.Search;\n results.innerHTML = \"\";\n return searchResults.map(function(movie) {\n let movieDiv = createNode(\"div\");\n let movieTitle = createNode(\"h1\");\n let moviePoster = createNode(\"img\");\n let more = createNode(\"div\");\n let movieDetails = createNode(\"p\");\n let movieID = movie.imdbID;\n let movieActors = createNode(\"p\");\n let movieDirector = createNode(\"p\");\n let movieRating = createNode(\"p\");\n\n movieDiv.className = \"movie-div\";\n\n movieTitle.textContent = `${movie.Title} (${movie.Year})`;\n movieTitle.className = \"movie-title\";\n\n moviePoster.src = movie.Poster;\n moviePoster.className = \"movie-images\";\n\n more.textContent = \"More...\";\n more.className = \"more\";\n\n movieDetails.className = \"movie-details--off\";\n\n append(results, movieDiv);\n append(movieDiv, movieTitle);\n append(movieDiv, moviePoster);\n append(movieDiv, more);\n append(more, movieActors);\n append(more, movieDirector);\n append(more, movieRating);\n append(more, movieDetails);\n\n more.addEventListener(\"click\", function(event) {\n event.preventDefault();\n if (movieDetails.className == \"movie-details--off\") {\n fetch(\n `http://www.omdbapi.com/?i=${movieID}&apikey=dd68f9f&plot=full`\n )\n .then(function(response) {\n return response.json();\n })\n .then(function(data) {\n console.log(data);\n movieActors.textContent = `Cast: ${data.Actors}`;\n if (movie.Director !== \"N/A\") {\n movieDirector.textContent = `Directed by: ${data.Director}`;\n }\n movieRating.textContent = `${data.Ratings[0].Source}: ${\n data.Ratings[0].Value\n }\n ${data.Ratings[1].Source}: ${data.Ratings[1].Value}\n ${data.Ratings[2].Source}: ${data.Ratings[2].Value}`;\n\n movieDetails.className = \"movie-plot\";\n movieDetails.textContent = `Plot: ${data.Plot}`;\n });\n\n movieDetails.classList.toggle(\"movie-details--on\");\n } else if (movieDetails.className == \"movie-details--on\") {\n movieDetails.classList.toggle(\"movie-details--off\");\n }\n });\n });\n });\n}", "function movieList() {\r\n for (let i = 0; i < movieInfo.length; i++) {\r\n //Generate list for nowshowing movies\r\n if (movieInfo[i].type == \"now\") {\r\n document.getElementById(\"nowVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n\r\n //Generate list for upcoming movies\r\n if (movieInfo[i].type == \"upcoming\") {\r\n document.getElementById(\"upcomingVideoDiv\").innerHTML +=\r\n \"<div>\" +\r\n \"<dt><span>Movie: </span>\" +\r\n movieInfo[i].name +\r\n \"</dt>\" +\r\n '<dd class=\"thumbnail\"><img onclick=\"switchVideo(' +\r\n (movieInfo[i].id - 1) +\r\n ')\" src=\"../image/' +\r\n movieInfo[i].thumbnail +\r\n '\" alt=\"' +\r\n movieInfo[i].name +\r\n '\"></dd>' +\r\n \"<dd><span>Cast: </span>\" +\r\n movieInfo[i].cast +\r\n \"</dd>\" +\r\n \"<dd><span>Director: </span>\" +\r\n movieInfo[i].director +\r\n \"</dd>\" +\r\n \"<dd><span>Duration: </span>\" +\r\n movieInfo[i].duration +\r\n \" mins</dd>\" +\r\n \"</div>\";\r\n }\r\n }\r\n}", "function movieGet() {\n\tgetMovie = 'https:/www.amazon.com/s?k=' + searchTermURL + '&i=instant-video';\n\tsetContent();\n}", "function movieThis(){\n var movie = process.argv[3];\n if(!movie){\n movie = \"Wonder Woman\";\n }\n params = movie\n request(\"http://www.omdbapi.com/?&t=\" + params + \"&apikey=40e9cece\", function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var movieObject = JSON.parse(body);\n //console.log(movieObject)\n var movieResults =\n (\"Title: \" + movieObject.Title);\n (\"Year: \" + movieObject.Year);\n (\"Imdb Rating: \" + movieObject.imdbRating);\n (\"Country: \" + movieObject.Country);\n (\"Language: \" + movieObject.Language);\n (\"Plot: \" + movieObject.Plot);\n (\"Actors: \" + movieObject.Actors);\n (\"Rotten Tomatoes Rating: \" + movieObject.tomatoRating);\n (\"Rotten Tomatoes URL: \" + movieObject.tomatoURL);\n\n console.log(movieResults);\n log(movieResults); // calling log function\n } else {\n console.log(\"Error :\"+ error);\n return;\n }\n });\n }", "function movieThis() {\n\n\t// Set variable equal to fourth argument in Node\n\tvar userInput = process.argv[3];\n\n\t// Create movieInput variable for actual search\n\tvar movieInput;\n\n\t// If user does not input a movie title\n\tif (userInput === undefined) {\n\t\t// Display information for Mr. Nobody\n\t\tmovieInput = \"Mr. Nobody\";\n\t}\n\n\t// If user provides input for movie search\n\telse if (userInput !== undefined) {\n\t\t// Set movieInput equal to userInput for search\n\t\tmovieInput = userInput;\n\t}\n\n\t// Create variable to create movie search URL\n\tvar movieSearchUrl = \"http://www.omdbapi.com/?t=\" + movieInput + \"&y=&plot=short&r=json&tomatoes=true\";\n\n\t// Pass movie search URL into request function\n\trequest(movieSearchUrl, function(error, response, body) {\n\n\t\t// If there were no errors and the response code was 200 (i.e. the request was successful)...\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Console log header\n\t\t\tconsole.log(\"----- Movie Information ---------------------------------------------------------------\");\n\n\t\t\t// Title of the movie\n\t\t\tconsole.log(\"Movie Title: \" + JSON.parse(body).Title);\n\n\t\t\t// Year the movie came out\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\n\t\t\t// IMDB rating of the movie\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\n\t\t\t// Country where the movie was produced\n\t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body).Country);\n\n\t\t\t// Language of the movie\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\n\t\t\t// Plot of the movie\n\t\t\tconsole.log(\"Short Plot: \" + JSON.parse(body).Plot);\n\n\t\t\t// Actors in the movie\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\n\t\t\t// Rotten Tomatoes URL\n\t\t\tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t\t// Console log footer\n\t\t\tconsole.log(\"--------------------------------------------------------------------\");\n\t\t}\n\t});\n}", "function getMovies(query) {\n $.getJSON(\n `${movieApi.base}?s=${query}&apikey=${movieApi.key}`\n ) /* .getJSON method retrieves data from an external api */\n .then(function (response) {\n if (response.Response === \"True\") {\n let movies =\n response.Search; /* the api is stored in arrays, here a new var is created to select the particular array needed */\n let output = \"\";\n /* for each of the responses in JSON output html to the webpage */\n $.each(movies, function (index, movie) {\n output += `\n <div class=\"col-sm-6 col-md-4 col-lg-3\">\n <div class=\"search-card text-center\">\n <img src=\"${movie.Poster}\"/> \n <h4 class=\"white\" >${movie.Title}</h4>\n <a onclick=\"selectedMovie('${movie.imdbID}')\" class=\"details-button hvr-shutter-out-horizontal red\" href=\"#\" data-toggle=\"modal\" data-target=\"#modal\">Movie Details</a>\n </div>\n </div>\n `;\n });\n\n /* outputs the html to the div with #movies-to-collapse */\n $(\"#movies-to-collapse\").html(output);\n\n $(\".collapse-button-m\").show();\n } else {\n alert(\"Movie not found! Please enter a valid movie title or word.\")\n }\n\n })\n}", "function movieCommand() {\n if (process.argv[3] === undefined && randomSearch === undefined) {\n title = \"Mr. Nobody\"\n } else if (randomSearch !== undefined) {\n title = randomSearch\n } else {\n title = process.argv[3];\n };\n // Request info from omdb api\n request(\"http://www.omdbapi.com/?t=\" + title + \"&y=&plot=short&apikey=trilogy\", function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"Your search is complete! Let's take a look...\" +\n \"\\nTitle: \" + JSON.parse(body).Title +\n \"\\nYear Released: \" + JSON.parse(body).Released +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nProduction Location(s): \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nPlot: \" + JSON.parse(body).Plot +\n \"\\nActors: \" + JSON.parse(body).Actors);\n log(\"movie-this was run and returned the following informtion: \"+\n \"\\nTitle: \" + JSON.parse(body).Title +\n \"\\nYear Released: \" + JSON.parse(body).Released +\n \"\\nIMDB Rating: \" + JSON.parse(body).imdbRating +\n \"\\nRotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value +\n \"\\nProduction Location(s): \" + JSON.parse(body).Country +\n \"\\nLanguage: \" + JSON.parse(body).Language +\n \"\\nPlot: \" + JSON.parse(body).Plot +\n \"\\nActors: \" + JSON.parse(body).Actors+\n \"\\n------------------------------------------------------------\"\n );\n };\n });\n}", "function generateMovieList(emotionChar) {\n console.log(\"Did i make it to generateMoveList?\");\n var emotions = {\n anger: { genre: \"War\", ID: 10752 },\n contempt: { genre: \"Adventure\", ID: 12 },\n disgust: { genre: \"Horror\", ID: 27 },\n fear: { genre: \"Horror\", ID: 27 },\n happiness: { genre: \"Comedy\", ID: 35 },\n neutral: { genre: \"Animation\", ID: 16 },\n sadness: { genre: \"Drama\", ID: 18 },\n surprise: { genre: \"Science Fiction\", ID: 878 },\n\n }\n\n var uriBase = \"https://api.themoviedb.org/3/discover/movie\";\n var apikey = \"56b80906dca0b429c04477c6b950ad7f\";\n var genreID = emotions[emotionChar]['ID'];\n\n\n // Request parameters.\n var params = {\n api_key: apikey,\n language: \"en-US\",\n sort_by: \"popularity.desc\",\n include_adult: false,\n include_video: false,\n page: 1,\n with_genres: genreID,\n }\n\n // full movieURL request\n var movieURL = uriBase + '?' + $.param(params);\n console.log(\"moveURL: \", movieURL);\n\n // Perform the REST API call.\n $.ajax({\n url: uriBase + '?' + $.param(params),\n type: 'GET',\n })\n .done(function (data) {\n console.log(\"output of AJAX\", data);\n // Show formatted JSON on webpage.\n // $('#responseTextArea').val(JSON.stringify(data, null, 2));\n console.log(\"in ajax movietb: \", data['results']);\n renderPosters(data['results']);\n\n // unlock button\n $(\"#uploadImg\").html(\"Analyze the Face\");\n $(\"#uploadImg\").removeAttr(\"disabled\");\n })\n\n .fail(function (jqXHR, textStatus, errorThrown) {\n // Display error message.\n var errorString =\n errorThrown === ''\n ? 'Error. '\n : errorThrown + ' (' + jqXHR.status + '): '\n errorString +=\n jqXHR.responseText === ''\n ? ''\n : jQuery.parseJSON(jqXHR.responseText).message\n ? jQuery.parseJSON(jqXHR.responseText).message\n : jQuery.parseJSON(jqXHR.responseText).error.message\n // alert(errorString)\n\n // open error module for message\n let movieAPIError = errorString;\n $(\".imgResultsMsg\").html(movieAPIError);\n $(\"#errorModal\").modal(\"open\"); // material uses modal(\"open\"), bootstrap uses modal(\"show\")\n // alert(\"This should be a bootstrap module in the endstate. \"+imageError);\n\n // unlock button\n $(\"#uploadImg\").html(\"Analyze the Face\");\n $(\"#uploadImg\").removeAttr(\"disabled\");\n })\n}", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "function movieThis(functionParameters) {\n\tif (functionParameters.length < 1) {\n\t\tfunctionParameters = \"Mr. Nobody\";\n\t};\n\trequest(\"http://www.omdbapi.com/?t=\" + functionParameters + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\t\tif(!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"imdbRating: \" + JSON.parse(body).imdbRating);\n\t\t\t// console.log(\"Title: \" + JSON.parse(body).Ratings[1].Value);\n\t\t\tvar rotten;\n\t\t if(!JSON.parse(body).Ratings || !JSON.parse(body).Ratings[1]){\n rotten = \"No Rotten Tomatoes Score\"\n }\n else {\n rotten = JSON.parse(body).Ratings[1].Value\n }\n\n console.log(\"Rotten Tomatoes Rating: \" + rotten);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t} else {\n\t\t\tconsole.log(\"Movie Search Error\")\n\t\t}\n\n\t\t\n\n\t});\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function movieDisplay() {\n\tvar movie = process.argv[3];\n\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\";\n\t\t//Calling the movieSubDisplay function............\n\t\tmovieSubDisplay();\n\t}\n\telse {\n\t\t\n\t\t//Calling the movieSubDisplay function......\n\t\tmovieSubDisplay();\n\t}\n\n\tfunction movieSubDisplay() {\n\t\trequest(\"http://www.omdbapi.com/?t=\"+ movie + \"&y=&plot=short&apikey=trilogy\", function(error, response, body) {\n\t\t\tif (!error && response.statusCode === 200) {\n\t\t\t\tvar getMovie = JSON.parse(body);\n\t\t\t\tvar movieResult = \n\t\t\t\t\"\\n\" + \"--------------------------------------------------------------------\" + \"\\n\" +\n\t\t\t\t\" Title: \" + getMovie.Title + \"\\n\" +\n\t\t\t\t\" Year: \" + getMovie.Year + \"\\n\" +\n\t\t\t\t\" Imdb Rating: \" + getMovie.imdbRating + \"\\n\" +\n\t\t\t\t\" Rotten Tomatoes Rating: \" + getMovie.Ratings[1].Value+ \"\\n\" +\n\t\t\t\t\" Country: \" + getMovie.Country + \"\\n\" +\n\t\t\t\t\" Language: \" + getMovie.Language + \"\\n\" +\n\t\t\t\t\" Plot: \" + getMovie.Plot + \"\\n\" +\n\t\t\t\t\" Actors: \" + getMovie.Actors + \"\\n\" +\n\t\t\t\t\"--------------------------------------------------------------------\" + \"\\n\";\n\t\t\t\tconsole.log(movieResult);\n\t\t\t\tlogDisplay(movieResult);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"OMDB error: \" + error);\n\t\t\t}\n\t\t});\n\t}\n}", "function listMovies() {\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n for (let movie of data) {\n console.log(movie, \"movie\");\n createMovieBox(movie);\n }\n });\n}", "function movieSearch(movie){\n if(!movie){\n var movieName = \"Mr. Nobody\";\n } else{\n movieName = movie;\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(err, response, body){\n\n if(!err && response.statusCode === 200){\n\n //need to look at responses from IMDB, responses seem to change based on the movie\n //also if possible add some input validation\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n console.log(\"Release date: \" + JSON.parse(body).Year);\n console.log(\"Rating: \" + JSON.parse(body).imdbRating);\n //rotten tomatoes rating\n if(JSON.parse(body).Ratings[1]){\n console.log(\"Rotten tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n }\n console.log(\"Produced in \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n \n } else{\n\n console.log(err);\n }\n\n\n });\n \n\n\n}", "function movie() {\n\n var args = process.argv;\n var movieName = \"\";\n\n for (i = 3; i < args.length; i++) {\n if (i > 3 && i < args.length) {\n movieName = movieName + \"+\" + args[i];\n } else {\n movieName = args[i];\n }\n };\n\n if (movieName === \"\") {\n movieName = \"Mr.\" + \"+\" + \"Nobody\"\n };\n\n //run a request to the OMDB API with the specified movie\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(\"-------------------------------------------------------------------------------------------\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n console.log(\"-------------------------------------------------------------------------------------------\");\n } else {\n console.log(\"ya' messed up\");\n }\n });\n}", "function searchForMovie() {\n let userMovie = \"Django Unchained\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/movie?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userMovie;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n // console.log(response);\n // let title = response.results[0].title;\n // let posterURL = response.results[0].poster_path;\n // let rating = response.results[0].vote_average;\n // let releaseDate = response.results[0].release_date;\n // let summary = response.results[0].overview;\n // let genreID = response.results[0].genre_ids[0];\n let movieID = response.results[0].id;\n let streaming = whereToWatch(movieID);\n // object.entries\n let movie = {\n title: response.results[0].title,\n year: response.results[0].release_date,\n // rated: ????,\n genre: response.results[0].genre_ids[0],\n plot: response.results[0].overview,\n poster:\n \"https://image.tmdb.org/t/p/w500\" + response.results[0].poster_path,\n rating: response.results[0].vote_average,\n streaming: streaming,\n // user: ????,\n // watched: ????\n };\n\n // Poster Path: \"https://image.tmdb.org/t/p/w500\" + POSTER_URL;\n });\n}", "function getMovie() {\n\n let movieId = sessionStorage.getItem('movieId');\n api_key = '98325a9d3ed3ec225e41ccc4d360c817';\n\n $.ajax({\n\n url: `https://api.themoviedb.org/3/movie/${movieId}`,\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n },\n\n //get acess to movie information;\n success: function(data) {\n\n\n\n var movie = data;\n let output = `\n <div class=\"row\">\n <div class=\"col-md-4\">\n <img src=\"https://image.tmdb.org/t/p/w500${movie.poster_path}\" class=\"thumbnail\">\n <div id=\"visitS\">\n <a id=\"visitSite\" target=\"_blank\" href=\"${movie.homepage}\"> Visit Movie Site</a>\n </div>\n </div>\n <div class=\"col-md-8\">\n <h2>${movie.title}</h2>\n <ul class=\"list-group\" id=\"list-group\">\n\n <li class=\"list-group-item\"><strong>Released:</strong> ${movie.release_date}</li>\n <li class=\"list-group-item\"><strong>Rated:</strong> ${movie.vote_average}</li>\n <li class=\"list-group-item\"><strong>Runtime:</strong> ${movie.runtime} min.</li>\n <li class=\"list-group-item\"><strong>Production Companies:</strong> ${movie.production_companies[0].name} min.</li>\n </ul>\n <div>\n <div id=\"overview\">\n <h3>Overview</h3> ${movie.overview}\n </div>\n <div id=\"imdbb\">\n <a id=\"imdb\" href=\"http://imdb.com/title/${movie.imdb_id}\" target=\"_blank\" <i class=\"fab fa-imdb fa-3x\"></i></a>\n </div>\n <div>\n <a class=\"navbar-brand\" id=\"go2\" href=\"index.html\">Go Back</a>\n \n </div>\n \n </div> \n \n `;\n //print movie selected information\n $('#movie').html(output);\n\n\n }\n\n })\n\n}", "function processPlayingMovies(response){\n let results = response.results;\n let pm_data = {\"data\": []};\n\n var i = 0;\n while(pm_data.data.length < 5){\n if(results[i].backdrop_path !== null && results[i].backdrop_path !== undefined){\n let m_item = {\"media_type\": \"movie\", \"id\" : results[i].id};\n m_item.backdrop_path = back_prefix + results[i].backdrop_path;\n if(results[i].title !== null && results[i].title !== undefined){\n m_item.title = results[i].title;\n }\n pm_data.data.push(m_item);\n }\n i ++;\n }\n return pm_data;\n}", "function ajaxCall(searchParams) {\n var query = \"?\";\n\n $.each(searchParams, function(i, val) {\n if (val) {\n if (i === \"Year\") { \n searchParams.Year = val.replace(\"-\", \"–\");\n }\n \n query += i + \"=\" + val + \"&\";\n }\n });\n query = query.slice(0, -1);\n \n\n $.ajax({\n url: \"https://ancient-caverns-16784.herokuapp.com/movies\" + query,\n type: \"GET\",\n //data: searchParams,\n beforeSend: function() {\n $(\"body\").css('cursor', 'wait');\n },\n success: function (data) {\n document.body.style.cursor = 'context-menu';\n showResults(data.results);\n showPagination(data.pagination);\n\n },\n error: function (response) {\n alert(response)\n }\n });\n\n function showResults(data) {\n\n var movieList1 = $(\"#movieList\");\n movieList1.children().remove();\n\n $.each(data, function(i, val) {\n const html = document.createElement('a');\n html.setAttribute(\"class\", \"movie-item\");\n html.setAttribute(\"data-id\", val._id);\n html.setAttribute(\"href\", \"./movieDetails.html\");\n html.addEventListener(\"click\", () => updateLocalStorage(val._id));\n html.innerHTML =\n `<div class=\"poster-container\">\n <img src=${val.Poster}/>\n </div>\n <p class=\"movie-title\">${val.Title}</p>\n `;\n movieList1.append(html);\n });\n\n\n var results = $('#results');\n var template = '';\n results.empty();\n for (let i = 0; i < data.length; i++) {\n const el = data[i];\n template += '<div class=\"column\">';\n template += '<div class=\"content\">';\n template +='<picture><img src=\"'+ el.Poster +'\" style=\"width:auto; alt='+ el.Title +'\"></picture>';\n template +='<h4 style=\"width:250px;\">'+ el.Title + '</h4>';\n template += '<p>' + el.Genre +'</p>';\n template += '<p>' + el.Language +'</p>';\n template += '<p>' + el.Country +'</p>';\n template += '</div>';\n template += '</div>';\n }\n results.append(template);\n }\n\n}", "findMovie(movieName = \"Mr. Nobody\") {\n let query = [\n 'http://www.omdbapi.com/?',\n this.key,\n `t=${movieName}`,\n 'page=3',\n 'type=movie',\n 'r=json'\n ].join('&');\n\n console.log(`\\n=======\\nFinding the movie \"${movieName}\"`);\n this.request(query, (error, response, body) => {\n if (error) {\n console.log(\"ERROR: \", error);\n return;\n }\n\n const jsonObj = this.body2JSON(body);\n if (!jsonObj) return;\n\n console.log(`\\n=======\\nResult for the movie \"${movieName}\"`);\n this.printMovieInfo(jsonObj);\n });\n }", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function movieThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"Mr. Nobody\"\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + option1 + \"&y=&plot=short&apikey=trilogy\"\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n console.log();\n console.log(\"Movie\");\n console.log(\"=====\");\n movie = JSON.parse(body);\n console.log(movie.Title);\n console.log(movie.Year);\n console.log(movie.Language);\n console.log(\"Made in: \" + movie.Country);\n console.log(\"Ratings\");\n movie.Ratings.forEach(element => {\n if (element.Source === 'Internet Movie Database') {\n console.log(\" IMDB: \" + element.Value);\n }\n if (element.Source === 'Rotten Tomatoes') {\n console.log(\" Rotten Tomatoes: \" + element.Value);\n }\n });\n console.log(\"Starring\");\n movie.Actors.split(\",\").forEach(element => {\n console.log(\" \" + element.trim());\n })\n console.log(movie.Plot);\n }\n });\n\n}", "function setMovieListing(filters = \"3\", filter = \"genre_ids\"){\n try{\n let movies = localStorage.getItem(\"latestMovies\") ? JSON.parse(localStorage.getItem(\"latestMovies\")) : getLatestMovies();\n let filteredMovies = movies; ///create a default object to start with\n //Now see if we've passed in an Array to filter by, which needs to go a bit deeper?\n if (Array.isArray(filters) && filters.length > 0){\n filteredMovies = movies.filter((m) => m[filter].some(s=>filters.some(sieve => sieve === s)));\n }\n //Otherwise the filter is a string, more than likely to be\n if (typeof filters === 'string' || filters instanceof String){\n filteredMovies = movies.filter((m) => m[filter] >= filters);\n }\n renderMovieListing(filteredMovies);\n }catch(err){\n console.error(err);\n }\n}", "function getMovies(){\r\n searchText = sessionStorage.getItem('searchText');\r\n axios.get('https://api.themoviedb.org/3/search/movie?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&query='+searchText)\r\n .then((response) => {\r\n console.log(response);\r\n let movies = response.data.results;\r\n let output = '';\r\n if(movies.length != 0){\r\n output = '<h2 class=\"heading\">Your Movies!!</h2>';\r\n $('#head').html(output);\r\n output = '';\r\n $.each(movies, (index, movie) => {\r\n if(movie.poster_path != null){\r\n output += `\r\n <div class=\"col-lg-3 col-md-6 mb-4\">\r\n <div class=\"card h-100\">\r\n <img class=\"card-img-top img-height\" src=\"https://image.tmdb.org/t/p/original${movie.poster_path}\" alt=\"\" onClick=\"getMovieId(${movie.id})\">\r\n <div class=\"card-footer\">`+\r\n (isReleased(movie.release_date) ? `<a href=\"#\" onClick=\"addMovie(${movie.id}, ${1})\" class=\"btn btn-primary btn-sm\" style=\"float:left\">+ Watched</a> \r\n <a href=\"#\" onClick=\"addMovie(${movie.id}, ${0})\" class=\"btn btn-primary btn-sm\" style=\"float:right\">+ Wished</a>` : \r\n `<a href=\"#\" onClick=\"addMovie(${movie.id}, ${0})\" class=\"btn btn-primary btn-sm\">+ Wished</a>`)\r\n +`\r\n </div>\r\n </div>\r\n </div>\r\n `\r\n }\r\n });\r\n }\r\n else\r\n output += '<h2 class=\"heading\">No movies Found :(</h2>';\r\n $('#searchedMovies').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function movieThis (movieName) {\n\t//if user does not provide any movie, then default then we assign it a movie\n\tif(movieName === \"\"){\n\t\tmovieName = \"Mr. Nobody\"\n\t}\n\n\t//making custom url for OMDB query search. \n\tvar customURL = \"http://www.omdbapi.com/?t=\"+ movieName +\"&y=&plot=short&tomatoes=true&r=json\";\n\n\t//getting data and printing it on terminal\n\trequestFS(customURL, function (error, response, body) {\n\t\tvar movieData = JSON.parse(body);\n\t\tif (!error && response.statusCode == 200) {\n\t\t\tconsole.log(\"Title: \" + movieData.Title);\n\t\t\tconsole.log(\"Year: \" + movieData.Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + movieData.imdbRating);\n\t\t\tconsole.log(\"Country: \" + movieData.Country);\n\t\t\tconsole.log(\"Lanugage(s): \" + movieData.Language);\n\t\t\tconsole.log(\"Plot: \" + movieData.Plot);\n\t\t\tconsole.log(\"Actors: \" + movieData.Actors);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + movieData.tomatoMeter);\n\t\t\tconsole.log(\"Rotten Tomatoes Link: \" + movieData.tomatoURL);\n\t \t}\n\t});\n}", "function getMovies(searchText) {\n\n input = searchText\n\n\n $.ajax({\n url: 'https://api.themoviedb.org/3/search/movie?',\n dataType: 'json',\n type: 'GET',\n data: {\n api_key: api_key,\n lang: lang,\n query: input,\n },\n\n // FUNCTION success: USED TO PRINT IN A HTML PAGE ALL THE DATA FROM API;\n success: function data(data) {\n displayMovie(data);\n },\n\n error: function(data) {\n let movies = data.results;\n\n }\n });\n}", "function getMovie(req, res, next){\n let movArr = model.getMovie(req.params.mid);\n let directorName = model.getNameArr(movArr[0].Director);\n let writerName = model.getNameArr(movArr[0].Writer);\n let actorName = model.getNameArr(movArr[0].Actors);\n let url = movArr[0].Poster;\n let recMovie = model.getRecMovie(req.params.mid);\n\n let data = renderMovie({movie: movArr, link: url, session:req.session, movName: req.params.mid,\n otherName: directorName, writerName: writerName, actorName: actorName,\n recMovie: recMovie});\n res.status(200).send(data);\n}", "function getMovies (req, resp) {\n console.log(\"\\tgetMovies called\");\n var filter = sharedVars.parseFilter(req.swagger.params);\n getFilteredMovies(filter, function(getError, data) {\n if (getError) {// If an error occured, just say it failed\n sharedVars.sendError(resp, 500, 'Failed to get a list of movies.', data);\n } else {// If successful, send json back\n // Update analytics for all the movies\n console.log(\"\\tSending analytics for movie list...\");\n for(var movieIndex in data.entities) {\n sharedVars.sendAnalytic(data.entities[movieIndex].name);\n }\n if (!sharedVars.shouldGetReviews(req.swagger.params)) {\n // If no reviews needed, just return the data\n resp.json(data);\n\n } else {\n // Add reviews to each movie in the list\n console.log(\"\\t\\tAppending reviews to list...\");\n async.each(data.entities, function(movie, callback) { // Is called for each request\n // Manually ask for connections...\n getReviews(movie, function(revError, revData) {\n movie.reviews = revData;\n if (revError) // If couldn't append reviews to movie, report error\n callback(revData);\n else // If reviews appended successfully, return\n callback();\n });\n }, function(error) { // Is called after all requests are done\n if (error) { // If an error occurred, set error message\n resp.statusCode = 500;\n data.message = error;\n }\n resp.json(data);\n });\n }\n }\n });\n}", "function filmRequire() {\n const requestFilms = JSON.parse(this.responseText);\n const movieTitles = requestFilms.title;\n console.log(requestFilms);\n let li = document.createElement('li');\n li.innerHTML = movieTitles;\n movieFilms.appendChild(li);\n }", "function searchMovies(query, language, genre) {\n\t// ajax calling themoviedb.org api for searching movies (max 20 displayed)\n\t$.ajax({\n\t\turl: \"https://api.themoviedb.org/3/search/movie\",\n\t\tmethod: \"GET\",\n\t\tdata: {\n\t\t\tapi_key: '6258744f8a6314eddb8961371f91076e',\n\t\t\tlanguage: language,\n\t\t\tquery: query\n\t\t},\n\t\tsuccess: function (data, state) {\n\t\t\tvar movies = data.results;\n\t\t\tconsole.log(movies);\n\t\t\tprintMovies(movies, genre);\n\t\t},\n\t\terror: function (request, state, error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t});\n}", "function movieDisplay(movieTitle) {\n // console.log(\"Movie Display Function\");\n var queryURL = `http://www.omdbapi.com/?t=${movieTitle}&y=&plot=short&apikey=trilogy`\n // console.log(queryURL);\n\n request(queryURL, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n\n var movieData = JSON.parse(body);\n\n console.log(`Title:${movieData.Title}\\n` +\n `Release Year: ${movieData.Year}\\n` +\n `IMDB Rating: ${movieData.imdbRating}/10\\n` +\n `Rotten Tomatoes Rating: ${movieData.Ratings[1].Value}\\n` +\n `Production Location: ${movieData.Country}\\n` +\n `Movie Language(s): ${movieData.Language}\\n` +\n `Plot: ${movieData.Plot}\\n` +\n `Actors: ${movieData.Actors}\\n`\n )\n }\n\n })\n}", "function lookupMovies(type, search, sort, filter, instantaneaousRepositionning) {\n var user = Meteor.user();\n \n // If not logged in, load public movies, cache them and repeat\n if (!user && !publicMovies.length) {\n Meteor.call('public', {}, function(error, movies) {\n publicMovies = movies;\n lookupMovies(type, search, sort, filter);\n });\n return;\n }\n\n var movies = user ? user.profile.movies : publicMovies;\n console.log('Load Movies');\n\n // Select movies on current page\n var types = type.split('|');\n movies = _.filter(movies, function(m) { return _.contains(types, m.statusType); });\n\n // Filter movies\n _.each(filter, function(value, type) {\n if (value) movies = _.filter(movies, function(m) { return filters[type](m, value); });\n });\n\n // Search movies\n if (search.length > 1) {\n movies = _.filter(movies, function(m) { return filters.title(m, search); });\n }\n\n // Sort movies\n if (sort) movies = _.sortBy(movies, sorts[sort]);\n\n selectedMovies = movies;\n initialiseMovies(instantaneaousRepositionning);\n}", "function showMovies(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n createPageNums(data);\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function movie_find_show_all(url_query, respond){\r\n respond.write(\"<script>document.getElementById('heading').innerHTML ='Movie search All';</script>\");\r\n \r\n var search_input ='<style>input[type=search] {width: 130px;box-sizing: border-box;border: 2px solid #ccc;border-radius: 4px;font-size: 16px;background-color: white; margin:2% auto 2% 40%;background-image:url(\"searchicon.png\");background-position: 10px 10px;background-repeat: no-repeat;padding: 12px 20px 12px 40px;-webkit-transition: width 0.4s ease-in-out;transition: width 0.4s ease-in-out;}input[type=search]:focus {width: 95%;margin:2% auto 2% auto;}/* #searh_input{margin:2% auto 2% 40%;width: 50%;} */</style><input type=\"search\" name=\"search\" placeholder=\"Search..\" id=\"search_input\" onsearch =\"call_db_search()\"><button onclick=\"call_db_search()\" style =\"width:4%; height:7.5%;font-size:2.3em;border-radius:0px;background-color:transparent;\" class=\"btn btn-info\"><i class=\"fas fa-search\"></i></button><br><div id style=\"width:100%;height:7%;background-color:white;color:black;font-size:1em;\"><a href=\"movie_find_show_all\" onclick =\"\">Show all stored movies</a><br><a href=\"delete_all\" onclick =\"\">Delete all stored movies</a></div><hr><script> function call_db_search(){ var search_query = document.getElementById(\"search_input\"); if(search_query.value == \"\"){ document.getElementById(\"heading\").innerHTML =\"Please feel data to be searched for\"; } else{ window.open(\"movie_find_search?\"+search_query.value, \"_self\"); } } </script>';\r\n\r\n\r\n respond.write(search_input);\r\n \r\n \r\n //get data from db\r\n my_sql_conn.connect(function(err){//doing mysql connection handshake aka test connectability\r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>connection error: \"+err+\"</p>\");\r\n //return respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>connected to db</p>\");\r\n //respond.end();//ending here\r\n }\r\n \r\n //get data from db\r\n var mysql_db_data_get = \"SELECT * FROM movie_table\"\r\n \r\n \r\n //connect to existing db\r\n \r\n my_sql_conn_db.query(mysql_db_data_get, function(err, results){\r\n \r\n if(err){\r\n // respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Data adding err (serach) \"+err+\"</p>\");\r\n return ;//respond.end();//ending here\r\n }\r\n else{\r\n // respond.write(\"<p>Data added \"+JSON.stringify(results[0].m_producer)+\"</p>\");\r\n var result = results;\r\n if(results.length ==0){return respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Could'nt find movie in db, please add some</p>\");}//if record match not found\r\n var extra_results = 1;//skip result duplicate\r\n var count = 0;\r\n for(var i =0; i<=result.length; i++){\r\n db_data_shower();//break if setup is not like this\r\n extra_results =i;//capture duplicate\r\n count = i;\r\n \r\n }\r\n \r\n\r\n \r\n //respond.end();//ending here\r\n }\r\n function db_data_shower(){\r\n if(extra_results==0){return} \r\n respond.write(\"<p style='width:100%;height:10%;overflow:auto;background-color:white;color:black'>Movie Title : \"+result[count].m_title+\" | Movie Director : \"+result[count].m_director+\" | Movie Producer : \"+result[count].m_producer+\" | Movie Producing Company : \"+result[count].m_production_company+\" | Movie filmed Country : \"+result[count].m_country+\" | Movie Starring : \"+result[count].m_actor+\" | Movie Genre : \"+result[count].m_genre+\" | Movie Synopsis : \"+result[count].m_description+\" | Movie Disclaimer : \"+result[count].m_disclaimer+\" | Movie Poster : \"+result[count].m_image+\"<br>\"+ \r\n '<input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_update?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Update Movie\" class=\"btn btn-primary\"><input type=\"button\" style=\"width:40%;height:2em;margin:1% 1% 1% 1%\" onclick=\"window.open(\\'movie_delete?'+result[count].movie_id+'\\',\\'_self\\')\" value=\"Delete Movie\" class=\"btn btn-primary\"></p>');\r\n }\r\n }\r\n \r\n ); \r\n \r\n });\r\n \r\n}", "function movieList(query, sortBy, order) {\n\n getMovies(query, sortBy, order).then((movies) => {\n //console.log('Here are all the movies:');\n movies.forEach(({title, rating, id, tvdb, imdb_id, fav}) => {\n// console.log(`id#${id} - ${title} - rating: ${rating}`);\n\n let moviePoster = \"images/placeholder.png\";\n let movieBackdrop = \"\";\n let star = 'star_border';\n let favStar = '';\n\n if (tvdb) {\n console.log('data exists for tvdb');\n if(tvdb.poster_path !== null) moviePoster = 'https://image.tmdb.org/t/p/w500/' + tvdb.poster_path;\n if(tvdb.backdrop_path !== null) movieBackdrop = 'https://image.tmdb.org/t/p/original/' + tvdb.backdrop_path;\n\n }\n\n star = (fav === true) ? 'star' : 'star_border';\n favStar = (fav === true) ? 'favorite-true' : '';\n\n $(`<div class=\"movie p-2 m-2\" id=\"movie-${id}\">`).append(\n $('<div class=\"movie-img\">').append(\n $(`<img src=\"${moviePoster}\" id=\"img-${id}\" class=\"img-fluid main\">`)),\n $('<div class=\"movie-title text-truncate\">').text(title),\n $('<div class=\"movie-database\">').append(\n $(`<img src=\"images/loader.svg\" class=\"loading-data hide\" id=\"loading-movie-${id}\">`).text(''),\n $(`<input type=\"hidden\" id=\"movie-imdb-${id}\" value=\"${imdb_id}\">`).text(''),\n $(`<button id=\"update-movie-${id}\" class=\"update\" value=\"${id}\">`).html(\"<i class=\\\"material-icons\\\">autorenew</i>\"),\n $(`<button id=\"edit-movie-${id}\" class=\"edit\" value=\"${id}\">`).html('<i class=\"material-icons\">create</i>'),\n $(`<button id=\"delete-movie-${id}\" class=\"delete\" value=\"${id}\">`).html('<i class=\"material-icons\">delete_forever</i>'),\n $(`<button id=\"fav-movie-${id}\" class=\"favorite ${favStar}\" value=\"${id}\">`).html(`<i class=\"material-icons\">${star}</i>`),\n )).appendTo('#moviesList');\n\n\n $(`#img-${id}, #update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('${movieBackdrop}')`);\n $(`#img-${id}`).addClass('standard-hover');\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.6);\n $('.favorite-true').css('opacity',1);\n\n }, function () {\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.0);\n $(`#img-${id}`).removeClass('standard-hover');\n $('.favorite-true').css('opacity',1);\n\n });\n\n\n $(`#img-${id}`).click(function() {\n displayMovie(id);\n });\n\n $(`#edit-movie-${id}`).click(function () {\n displayEditMovie(id);\n });\n\n $(`#fav-movie-${id}`).click(function() {\n\n let star = $(this).children('i').text();\n console.log(star);\n (star !== 'star') ? $(this).children('i').text('star') : $(this).children('i').text('star_border');\n (star !== 'star') ? addFav(id, true) : addFav(id,false);\n (star !== 'star') ? $(this).addClass('favorite-true') : $(this).removeClass('favorite-true');\n\n });\n\n $(`#delete-movie-${id}`).click(function () {\n\n // TODO: reaplce this with a in-page function\n const confirmed = window.confirm(\"Are you sure\");\n\n if (confirmed === true) {\n $(`#movie-${id}`).addClass('hide');\n deleteMovie(id);\n console.log(`deleted: ` + id);\n\n\n } else {\n console.log(`cancelled the delete: ` + id);\n }\n\n });\n\n $(`#update-movie-${id}`).click(function (e) {\n e.preventDefault();\n $(`#loading-movie-${id}`).removeClass('hide');\n $(`#img-${id}`).addClass('loading-hover');\n\n const movieId = $(`#movie-imdb-${id}`).val();\n\n $(this).off('click');\n\n setTimeout(function () {\n getMovieDBData(movieId).then((movies) => {\n console.log('Here are all the movies:');\n console.log(movies.movie_results[0]);\n\n const movie = movies.movie_results[0];\n\n\n getFullMovieData(movie.id).then(movie => {\n\n\n addMovieData(id,\n {\n title: movie.title,\n rating: movie.vote_average,\n tvdb: movie\n });\n\n\n\n $(`#img-${id}`).attr('src', `https://image.tmdb.org/t/p/w500/${movie.poster_path}`);\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n\n $(`#img-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n });\n\n $(`#loading-movie-${id}`).addClass('hide');\n $(`#img-${id}`).removeClass('loading-hover');\n\n });\n\n\n\n\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n\n $(this).on('click');\n\n $('.loading-container').hide();\n }, 3000);\n\n });\n\n $('.loading-container').hide();\n\n });\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n}", "function showAll() {\n $('.movie-list').empty();\n \n $.get('/allmovies', function(data) {\n if (data.length > 0) {\n for (let i in data) {\n buildMovieList(data[i]);\n }\n $('.not-found').css(\"display\", \"none\");\n $('.movie-list').css(\"display\", \"block\");\n }\n else {\n $('.movie-list').css(\"display\", \"none\");\n $('.not-found').css(\"display\", \"block\");\n }\n });\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link to go to the indiviual title page\n\t\t$(items[i]).attr(\"href\", \"title/title.php?id=\" + object.id + \"&type=movie\");\n\n\t\t// Apply imdb poster image\n\t\tapplyImdbThumbnail(items[i].children[0].children[0].children[0], false, object.id);\n\t}\n}", "function getMoviesList(){\n let SearchInput = document.getElementById('movie-search').value;\n fetch(`https://www.omdbapi.com/?apikey=${apiKey}&s=${SearchInput}`)\n .then((Response)=> Response.json())\n .then((data)=>{\n console.log(data.Search);\n let html = '';\n let movies = data.Search;\n if(movies){\n movies.forEach((movies)=>{\n html += `\n <div class=\"movie-item\" data-id = \"${movies.imdbID}\">\n <div class=\"movie-img\">\n <img src=\"${movies.Poster}\" alt=\"food\">\n </div>\n <div class=\"movie-name\">\n <h3>${movies.Title}</h3>\n <a class=\"info-btn\" href=\"#\">Get Info</a>\n </div>\n </div>\n \n `;\n });\n movieList.classList.remove('not-found');\n\n }else{\n html= 'Unable to find the movie';\n movieList.classList.add('not-found');\n } \n movieList.innerHTML =html; \n });\n}", "function getMovies(searchText) {\r\n getData('https://www.omdbapi.com/?s=' + searchText + '&apikey=' + OMDBAPIKEY, function(err,\r\n response) {\r\n if (err) {\r\n return;\r\n }\r\n if (response.Search) {\r\n response.Search.pop();\r\n var omdbData = response.Search;\r\n var output = '';\r\n $.each(omdbData, (index, movie) => {\r\n output += htmlWriteResults(movie);\r\n });\r\n\r\n $('#movies').html(output);\r\n } else {\r\n // If we can't find any results we give a nice error message.\r\n $('#movies').html(\r\n '<section><div class=\"col-md-12\"><div class=\"well text-center\"><br><i class=\"fa fa-exclamation-triangle fa-4x whiteheader\" style=\"color: rgba(243,156,18, 1)\"></i><h2 class=\"whiteheader\">Sorry, but <b>' +\r\n searchText +\r\n '</b> gave no results</h2><br><p class=\"whiteheader\">But we would <i class=\"fa fa-heart\" style=\"color: rgba(231,76,60, 1)\"> </i> for you to try something else.</p></div></div></section>'\r\n );\r\n }\r\n });\r\n}", "function displayMovies(movies) {\n movieInformation.innerHTML = \"\"\n let searchedMovies = globalMovieArray[0].Search;\n for (i = 0; i < searchedMovies.length; i++) {\n //Div for listed movie and button\n const liAndButtonDiv = document.createElement('div')\n liAndButtonDiv.classList.add('liAndButtonDiv')\n //Create li element for search result\n const movieTitleListed = document.createElement('li');\n movieTitleListed.classList.add = ('clear')\n const movieTitle = document.createTextNode(`${movies.Search[i].Title}`)\n\n movieTitleListed.appendChild(movieTitle);\n liAndButtonDiv.appendChild(movieTitleListed);\n movieInformation.appendChild(liAndButtonDiv);\n\n buttonForMoreInformation(movies.Search[i].imdbID, liAndButtonDiv)\n spinner.style.display = \"none\";\n\n }\n}", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}", "function btnFilter(){\r\n const url = `${path}/genre/movie/list?api_key=${api_key}&language=it-IT`\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((data) => btnGenres(data.genres))\r\n .catch((err) => console.log(err))\r\n }", "function movieThis() {\n console.log('===========================================');\n console.log(\"Netflix and Chill....?\");\n // console.log(\"Pizza and a fuck?.....WHAT???.....you dont like pizza?\")\n var searchMovie;\n // use undefined for default search!\n if (arguTwo === undefined) {\n searchMovie = \"Mr. Nobody\";\n } else {\n searchMovie = arguTwo;\n };\n // add tomatoes url and json format // request required here\n var movieUrl = 'http://www.omdbapi.com/?t=' + searchMovie + '&y=&plot=long&tomatoes=true&r=json';\n request(movieUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n \n\n var movieData = JSON.parse(body)\n\n console.log('================ Movie Info ================');\n console.log('Title: ' + movieData.Title);\n console.log('Year: ' + movieData.Year);\n console.log('IMDB Rating: ' + movieData.imdbRating);\n console.log('Country: ' + movieData.Country);\n console.log('Language: ' + movieData.Language);\n console.log('Plot: ' + movieData.Plot);\n console.log('Actors: ' + movieData.Actors);\n console.log('Rotten Tomatoes Rating: ' + movieData.tomatoRating); //notworkings\n console.log('Rotten Tomatoes URL: ' + movieData.tomatoURL);\n console.log('===========================================');\n }\n });\n}", "function movied() {\n var movieTitle =\"\"; \n if (userInput[3] === undefined){\n movieTitle = \"mr+nobody\"\n } else {\n movieTitle = userInput[3];\n }; \n\tvar queryUrl = \"http://www.omdbapi.com/?apikey=f94f8000&t=\" + movieTitle\n\n\trequest(queryUrl, function(err, response, body) {\n\t\tif (err) {\n\t\t\treturn console.log(err);\n\t\t} else {\n\t\t console.log(\"\\n========== Movie Info ========\");\n console.log(\"Title: \" + JSON.parse(body).Title);\n\t\t\tconsole.log(\"Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Values);\n\t\t\tconsole.log(\"Country: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\t\n console.log(\"=================================\\n\");\n\t\t}\n\n\t})\n}", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function showMoviesNewPage(data){\n if(data.Response == \"False\"){\n $(\"#search-loader\").hide();\n alertify.error(\"No results...\");\n } else {\n $(\"#search-loader\").hide();\n data.Search.forEach(showMovie); //callback to showMovie with each of the items from the array\n }\n}", "function moviethis(){\n var movieName = '';\n var theArg = process.argv;\n \n if(input===undefined){\n // if no movie name is entered\n movieName = 'Mr.'+\"+\"+\"Nobody\"; \n } else {\n // otherwise this captures movie names with 1 or more words\n for(i=3; i<theArg.length; i++){\n movieName += theArg[i]+\"+\";\n }\n \n }\n \n //run axios using OMDB API\n var url = \"http://www.omdbapi.com/?t=\"+movieName+\"&y=&plot=short&apikey=trilogy\";\n axios.get(url)\n .then(\n function(response) { \n console.log(\"Title: \"+response.data.Title);\n console.log(\"Release Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \"+response.data.Ratings[0].Value);\n console.log(\"Country Produced: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot: \"+response.data.Plot);\n console.log(\"Actors :\"+response.data.Actors);\n }\n );\n }", "function movieSearch(movie)\n{\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n console.log('error:', error); // Print the error if one occurre\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n console.log('body:', body); // Print the HTML for the Google homepage.\n console.log(body.title);\n console.log(response.title);\n});\n}", "function movieThis() {\n var movieName = \"\";\n\n //move over all of the entered words to \n for (var i = 3; i < input.length; i++) {\n if (i > 3 && i < input.length) {\n movieName = movieName + \"+\" + input[i];\n } else {\n movieName += input[i];\n }\n }\n if (movieName === \"\") {\n movieName = \"Mr. Nobody\";\n }\n\n var movieQueryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=plot=short&apikey=trilogy\" + omdb;\n\n //npm call and arrangement of data into information.\n request(movieQueryURL, function(error, response, body) {\n if (!error && response.statusCode === 200) {\n var movieData = JSON.parse(body);\n console.log(\"Title: \" + movieData.Title + \"\\nRelease Year: \" + movieData.Year);\n\n for (var i = 0; i < movieData.Ratings.length; i++) {\n console.log(\"Rating: \" + movieData.Ratings[i].Source + \" \" + movieData.Ratings[i].Value)\n }\n console.log(\"Country Produced: \" + movieData.Country + \"\\nLanguage: \" + movieData.Language +\n \"\\nActors: \" + movieData.Actors + \"\\nPlot: \" + movieData.Plot);\n } else {\n return console.log(error);\n }\n });\n}", "async function getMovieResults({ movieId, title }) {\n await logger(`finding: ${title}`);\n\n const parameters = querystring.stringify({\n movieId,\n apiKey: config.radarr.apiKey,\n });\n\n const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`;\n return await getData({ uri: searchUrl });\n}", "function displayMovies(movies) {\n console.log(movies);\n for (let i=0; i < movies.length; i++) {\n const movieId = cleanTitle(movies[i]);\n fetch(`https://imdb8.p.rapidapi.com/title/get-plots?tconst=${movieId}`, {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t\"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t\"x-rapidapi-key\": rapidApiKey\n\t }\n })\n .then(resp => resp.json())\n .then(addMoviesHMTL)\n // when the last movie is added to the html shows the \"get movie recommendations\" button\n .then(() => {\n if (i+1 === movies.length) {\n recomButtton.style.display = 'block';\n }\n })\n }\n // function to clean the title info to fetch the api\n function cleanTitle(stringT) {\n let begins = stringT.indexOf('/', 1) + 1;\n let title = stringT.slice(begins, stringT.length - 1);\n return title;\n }\n}", "function movieThis() {\n var movie = \"Mr. Nobody\";\n if (searchTerm) {\n var movie = searchTerm;\n };\n let movieUrl = \"http://www.omdbapi.com/?apikey=715b0924&t=\" + movie\n axios.get(movieUrl).then(response => {\n let data = response.data;\n console.log(\"Title: \" + data[\"Title\"] + \"\\nYear: \" + data[\"Year\"] + \"\\nIMDB Rating: \" + data[\"imdbRating\"] + \"\\nRotten Tomatoes Rating: \" + data[\"Ratings\"][1][\"Value\"] + \"\\nCountry of Production: \" + data[\"Country\"] + \"\\nLanguage: \" + data[\"Language\"] + \"\\nPlot: \" + data[\"Plot\"]\n + \"\\nActors: \" + data[\"Actors\"]);\n }).catch(error => {\n console.log(error);\n });\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function getMovie() {\n // import the request package\n var request = require(\"request\");\n // call to OMDB API\n if (process.argv[3] === undefined) {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + \"Mr.\" + \"Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n } else {\n var movieName = process.argv[3]\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n }\n}", "function displayMovie(event){\n let target = event.target || event.srcElement;\n\n // Retrieves title if parent element selected\n if(target.className == \"movie\"){\n target = target.getElementsByClassName(\"title\")\n target = target[0];\n }\n\n // sends an API request for the specific movie to be displayed\n searchByTitle(target).then(result => {\n let movies = result[\"Title\"];\n displayMovieResult(result);\n });\n}", "function printMovies(movies, genre) {\n\tvar handlebars = handlebarsInit('#movie');\n\t// search every movies\n\tfor (var i = 0; i < movies.length; i++) {\n\t\tvar movie = movies[i];\n\t\t// convert raking in stars\n\t\tvar vote = oneToX(movie.vote_average, 5, 10);\n\t\tvar star = printStar(vote, 5);\n\t\t// convert original_language in flag\n\t\tvar flag = convertFlag(movie.original_language);\n\t\t// add poster from api database if present\n\t\tvar posterPath = addPoster(movie);\n\t\t// create object context for handlebars\n\t\tvar context = {\n\t\t\ttitle: movie.title,\n\t\t\toriginal_language: flag,\n\t\t\tstar: star,\n\t\t\toverview: movie.overview,\n\t\t\tposter_path: posterPath,\n\t\t\tgenre_ids: movie.genre_ids\n\t\t};\n\t\t// check if the title is the same as the original title\n\t\tcheckTitle(movie, context);\n\t\t// handlebars append\n\t\tvar html = handlebars(context);\n\t\t$('.results').append(html);\n\t\t// filter by genre the .result\n\t\tfilterByGenre(genre);\n\t}\n}", "function getMovies(varfn) {\r\n\r\n\r\n\r\n let apiData = {\r\n url: 'http://www.omdbapi.com/',\r\n apiKey: '?apikey=623dcc99&s=',\r\n filmnaam: varfn\r\n }\r\n\r\n const {\r\n url,\r\n apiKey,\r\n filmnaam\r\n } = apiData\r\n const apiUrl = `${url}${apiKey}${filmnaam}`\r\n\r\n let res;\r\n\r\n fetch(apiUrl)\r\n .then((response) => response.json())\r\n .then(data => res = data)\r\n .then((res) => {\r\n\r\n let movies = res.Search;\r\n let output = '';\r\n\r\n console.log(movies);\r\n $.each(movies, (index, movie) => {\r\n output += `\r\n <div class =\"col-md-3\" id=\"ruimte\">\r\n <div class=\"well text-center\">\r\n <h5>${movie.Title}</h5>\r\n <h6>Year: ${movie.Year}</h6>\r\n <img src=${movie.Poster} onclick=\"movieSelected('${movie.imdbID}')\" datatoggle=\"modal\" href=\"#\">\r\n </div>\r\n </div>\r\n `;\r\n });\r\n\r\n $('#movies').html(output); //inner html kan mss ook?\r\n });\r\n}", "function searchMovie(movieName){\n var fix=movieName.replace(/ /g,\"+\");\n console.log(fix);\n //dauflt when name is undefine\n\n axios.get(\"http://www.omdbapi.com/?t=\"+fix+\"&y=&plot=short&apikey=trilogy\").then(\n function(response) {\n console.log(\"Movie Title: \"+response.data.Title);\n console.log(\"Year: \"+response.data.Year);\n console.log(\"IMDB Rating: \"+response.data.Ratings[0]);\n console.log(\"Rotten Rating: \"+response.data.Ratings[1]);\n console.log(\"Conutry: \"+response.data.Country);\n console.log(\"Language: \"+response.data.Language);\n console.log(\"Plot of Movie: \"+response.data.Plot);\n console.log(\"Actors List: \"+response.data.Actors);\n console.log(\"-------------------------------------\");\n })\n .catch(function(error) {\n console.log(\"error\");\n });\n\n}", "function search_actor(search){\n\tvar sResult = [];\n\tfor(let films in search_results){\n\t\tvar film = search_results[films];\n\t\tif(film.folk){\n\t\tif(film.folk.toLowerCase().includes(search.toLowerCase())){\n\t\t\tactor.innerHTML+= \"<li><a href= \\\"show_movie.html?id=\" + films + \"\\\">\" + film.otitle + \"</a> </li> <br>\";\n\t\t}\n\t\t\t\n\t\t}\n\t}\n\tconsole.log(sResult);\n\t\n}", "function displayResults() {\n state.movies.forEach(function (item) {\n let htmlItem = $('.js-result.templ').clone();\n let imgUrl = item.poster;\n imgUrl = imgUrl.replace(\"{profile}\", \"s166\");\n htmlItem.find('.js-img').attr('src', \"https://www.justwatch.com/images\" + imgUrl);\n htmlItem.find('.item-title').append(item.title);\n htmlItem.find('.item-description').append(item.short_description);\n htmlItem.find('.js-release').append(`(${item.original_release_year})`);\n htmlItem.find('.js-addToWatchList').attr({\n 'media-id': item.id,\n 'title': item.title,\n 'poster': item.poster,\n 'object-type': item.object_type,\n 'path': item.full_path\n });\n if (item.offers) {\n for (let i = 0; i < item.offers.length; i++) {\n let htmlItemOffer = $('.js-item-offers.templ').clone();\n if (item.offers[i].presentation_type === 'sd') {\n let found = item.offers.find(function (offer) {\n if (offer.presentation_type === 'hd' && offer.provider_id === item.offers[i].provider_id)\n return true;\n })\n if (found)\n continue;\n }\n //justwatch has special provider id code to identify different streaming services\n let providerIdImg;\n let text;\n switch (item.offers[i].provider_id) {\n case 2:\n text = 'apple-itunes.jpeg';\n break;\n case 3:\n text = 'google-play-movies.jpeg';\n break;\n case 7:\n text = 'vudu.jpeg';\n break;\n case 8:\n text = 'netflix.jpeg';\n break;\n case 9:\n text = 'amazon-prime-instant-video.jpeg';\n break;\n case 10:\n text = 'amazon-instant-video.jpeg';\n break;\n case 11:\n text = 'mubi.jpeg';\n break;\n case 12:\n text = 'crackle.jpeg';\n break;\n case 14:\n text = 'realeyz.jpeg';\n break;\n case 15:\n text = 'hulu.jpeg';\n break;\n case 18:\n text = 'playstation.jpeg';\n break;\n case 25:\n text = 'fandor.jpeg';\n break;\n case 27:\n text = 'hbo-now.jpeg';\n break;\n case 31:\n text = 'hbo-go.jpeg';\n break;\n case 34:\n text = 'epix.jpeg';\n break;\n case 37:\n text = 'showtime.jpeg';\n break;\n case 43:\n text = 'starz.jpeg';\n break;\n case 60:\n text = 'fandango.jpeg';\n break;\n case 68:\n text = 'microsoft-store.jpeg';\n break;\n case 73:\n text = 'tubi-tv.jpeg';\n break;\n case 78:\n text = 'cbs.jpeg';\n break;\n case 79:\n text = 'nbc.jpeg';\n break;\n case 80:\n text = 'amc.jpeg';\n break;\n case 83:\n text = 'the-cw.jpeg';\n break;\n case 87:\n text = 'acorn-tv.jpeg';\n break;\n case 92:\n text = 'yahoo-view.jpeg';\n break;\n case 99:\n text = 'shudder.jpeg';\n break;\n case 100:\n text = 'guidedoc.jpeg';\n break;\n case 102:\n text = 'filmstruck.jpeg';\n break;\n case 105:\n text = 'fandangonow.jpeg';\n break;\n case 123:\n text = 'fxnow.jpeg';\n break;\n case 139:\n text = 'max-go.jpeg';\n break;\n case 143:\n text = 'sundance-now.jpeg';\n break;\n case 148:\n text = 'abc.jpeg';\n break;\n case 151:\n text = 'brtibox.jpeg';\n break;\n case 155:\n text = 'history.jpeg';\n break;\n case 156:\n text = 'aande.jpeg';\n break;\n case 157:\n text = 'lifetime.jpeg';\n break;\n case 175:\n text = 'netflix-kids.jpeg';\n break;\n default:\n text = 'placeholder.jpg';\n }\n providerIdImg = text;\n\n //where available streaming options are placed in the template\n if (item.offers[i].monetization_type === 'flatrate') {\n htmlItem.find('.js-offer-type-sub').addClass('offers');\n htmlItem.find('.js-offer-type-sub .js-offer-bar').html('STREAM');\n htmlItemOffer.find('.js-offer-link').attr('href', item.offers[i].urls.standard_web);\n htmlItemOffer.find('.js-offer-img').attr('src', 'img/' + providerIdImg);\n htmlItemOffer.find('.js-presentation').html(item.offers[i].presentation_type.toUpperCase());\n htmlItem.find('.js-sub-row').append(htmlItemOffer);\n } else if (item.offers[i].monetization_type === 'rent') {\n htmlItem.find('.js-offer-type-rent').addClass('offers');\n htmlItem.find('.js-offer-type-rent .js-offer-bar').html('RENT');\n htmlItemOffer.find('.js-offer-link').attr('href', item.offers[i].urls.standard_web);\n htmlItemOffer.find('.js-offer-img').attr('src', 'img/' + providerIdImg);\n htmlItemOffer.find('.js-presentation').html(item.offers[i].presentation_type.toUpperCase());\n htmlItem.find('.js-rent-row').append(htmlItemOffer);\n } else if (item.offers[i].monetization_type === 'cinema') {\n htmlItem.find('.js-offer-type-cinema').addClass('offers');\n htmlItem.find('.js-offer-type-cinema .js-offer-bar').html('CINEMA');\n htmlItemOffer.find('.js-offer-link').attr('href', item.offers[i].urls.standard_web);\n htmlItemOffer.find('.js-offer-img').attr('src', 'img/' + providerIdImg);\n htmlItemOffer.find('.js-presentation').html('TICKET');\n htmlItem.find('.js-cinema-row').append(htmlItemOffer);\n } else {\n htmlItem.find('.js-offer-type-buy').addClass('offers');\n htmlItem.find('.js-offer-type-buy .js-offer-bar').html('BUY');\n htmlItemOffer.find('.js-offer-link').attr('href', item.offers[i].urls.standard_web);\n htmlItemOffer.find('.js-offer-img').attr('src', 'img/' + providerIdImg);\n htmlItemOffer.find('.js-presentation').html(item.offers[i].presentation_type.toUpperCase());\n htmlItem.find('.js-buy-row').append(htmlItemOffer);\n };\n htmlItemOffer.removeClass('templ');\n }\n }\n\n htmlItem.removeClass('templ');\n $('.js-noResults').addClass('hidden');\n $('.results').removeClass('hidden');\n $('.results').show();\n $('.js-result-container').append(htmlItem);\n $('.js-watchlist-results').html('');\n $('.js-watchlist').hide();\n $('.js-userResults').hide();\n $('.js-userResults-list').html('');\n $('.js-returnButton').removeClass('hidden');\n $('.js-welcome').addClass('hidden');\n });\n}", "function getMovieInfo(args){\n\tconsole.log(\"Getting info for movie \"+movie_id);\n\tvar req = new XMLHttpRequest();\n\treq.open(\"GET\", request_path+\"/movies/\"+movie_id, true);\n\treq.onload = function() {\n\t\tvar response = JSON.parse(req.response);\n\t\targs[0].setText(response[\"title\"]);\n\t\targs[2].setImage(args[3]+response[\"img\"]);\n\t\tgetMovieRating(args);\n\t}\n\treq.send();\n}", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function movieSearch(event) {\n var movieSearch = $(\"#movie-input\")\n .val()\n .trim();\n\n event.preventDefault();\n\n if (!movieSearch) return;\n var queryURL =\n \"https://utelly-tv-shows-and-movies-availability-v1.p.mashape.com/lookup?\";\n var queryString = queryURL + \"country=\" + \"us\" + \"&term=\" + movieSearch;\n getMovies(queryString);\n }", "function getMovies() {\n var movieSearch = process.argv.slice(3).join(\" \");\n var queryURL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + movieSearch;\n axios\n .get(queryURL)\n .then(function(response) {\n //Function for Response of movies.\n //console.log(response);\n var searchRes = response.data;\n console.log(\"Movie Title: \" + searchRes.Title + \n \"\\nReleased In: \" + searchRes.Year + \n \"\\nIMDB Rating: \" + searchRes.imdbRating + \n \"\\nRotten Tomatoes Rating: \" + searchRes.Ratings[1].Value + \n \"\\nCountry where movie was produced: \" + searchRes.Country + \n \"\\nLanguage: \" + searchRes.Language + \n \"\\nPlot: \" + searchRes.Plot + \n \"\\nActors: \" + searchRes.Actors);\n console.log(\"------------------------------------------\");\n })\n //Function for ERRORS\n .catch(function(error) {\n if (error.response) {\n console.log(error.response.data);\n console.log(\"------------------------------------------\");\n }\n })\n}", "function movie(movieName){\n\tvar request = require('request');\n\n\tvar nodeArgs = process.argv;\n\n\tvar movieName = \"\";\n\n\tif (process.argv[3] == null){\n\n\t\tmovieName = \"Mr.Nobody\";\n\n\t}else{\n\n\t\tfor (var i=3; i<nodeArgs.length; i++){\n\n\t\t\tif (i>3 && i< nodeArgs.length){\n\n\t\t\tmovieName = movieName + \"+\" + nodeArgs[i];\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\tmovieName = movieName + nodeArgs[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\trequest('http://www.omdbapi.com/?t='+ movieName + '&y=&plot=short&r=json&tomatoes=true', function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n\t\n\tif (!error && response.statusCode == 200) {\n\t\t\n\t\t// Parse the body of the site and recover just the imdbRating\n\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it). \n\t\tconsole.log( \"The movie title: \" + JSON.parse(body)[\"Title\"] +\n\t\t\t\"\\nThe movie release year: \" + JSON.parse(body)[\"Year\"] +\n\t\t\t\"\\nThe movie imdb rating: \" +JSON.parse(body)[\"imdbRating\"] +\n\t\t\t\"\\nThe movie Country of origin: \" +JSON.parse(body)[\"Country\"] +\n\t\t\t\"\\nThe movie language: \" +JSON.parse(body)[\"Language\"] +\n\t\t\t\"\\nThe movie plot: \" +JSON.parse(body)[\"Plot\"] +\n\t\t\t\"\\nThe movie actors: \" +JSON.parse(body)[\"Actors\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes score: \" +JSON.parse(body)[\"tomatoMeter\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes url: \" +JSON.parse(body)[\"tomatoURL\"]);\n\t\t}\n\t});\n}", "function movieFilter(req, res) {\n let response = movieListSmall;\n if (req.query.name) {\n console.log('name ran')\n response = response.filter(movie => \n movie.film_title.toLowerCase().includes(req.query.name.toLowerCase())\n )\n }\n // submit feedback for number 1.2 in assignment\n else {\n console.log('type ran')\n let responseArr = [];\n response.forEach(movie => {\n // genre\n if (movie.genre.toLowerCase() === req.query.type.toLowerCase()) {\n responseArr.push(movie)\n }\n // country\n else if (movie.country.toLowerCase() === req.query.type.toLowerCase()) {\n responseArr.push(movie)\n }\n // avg_vote\n else {\n let numOfType = Number(req.query.type)\n if (numOfType <= movie.avg_vote) {\n responseArr.push(movie)\n } \n }})\n response = responseArr\n }\n res.json(response)\n}", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "function searchMovie(movie) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&apikey=trilogy\";\n //console.log(queryURL);\n\n //searching for movie with omdb api\n request(queryURL, function (error, response, body) {\n //if error occurs\n if (error) {\n console.log(error);\n }\n\n //request processed successfully\n if (!error && response.statusCode === 200) {\n //console.log(JSON.parse(body));\n var result = JSON.parse(body);\n\n var title = result.Title;\n var year = result.Year;\n var rating1 = result.imdbRating;\n var rating2 = result.Ratings[1].Value;\n var country = result.Country;\n var language = result.Language;\n var plot = result.Plot;\n var actors = result.Actors;\n\n console.log(\"\\n\");\n console.log(\"Movie: \" + title);\n console.log(\"Year: \" + year);\n console.log(\"IMDB Rating: \" + rating1);\n console.log(\"Rotten Tomatos Rating: \" + rating2);\n console.log(\"Countries of production: \" + country);\n console.log(\"Language(s): \" + language);\n console.log(\"Plot: \" + plot);\n console.log(\"Actors: \" + actors);\n }\n });\n}", "function getMovieID(data){\n\tconst movieList = data.results.map((value, index) => displayResult(value));\n\t$(\".js-movies-result\").html(movieList);\n\ttitleClick();\n\tcloseClick();\n}", "function getMovie(movieName) {\n\n // If no movie name, do a search for Mr.Nobody\n if (!movieName) {\n var movieName = \"Mr. Nobody\";\n }\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=[key]\";\n axios.get(queryURL).then(\n function (response) {\n\n // Movie info\n console.log(`Title: ${response.data.Title}\nYear: ${response.data.Year}\nRated: ${response.data.Rated}\nRotten Tomatoes Rating: ${response.data.tomatoRating}\nCountry Produced in: ${response.data.Country}\nLanguage: ${response.data.Language}\nPlot: ${response.data.Plot}\nActors: ${response.data.Actors}`\n );\n }\n )\n}", "function searchShow(query) {\n var url = `https://api.tvmaze.com/search/shows?q=${query}`;\n fetch(url)\n // .then(response => response.json())\n .then(function(response){\n if(response.ok){\n return response.json();\n }\n else{\n console.log('Unable to connect to tvmaze');\n }\n })\n .then((jsonData) => {\n // gets specific string from array\n if(jsonData != null){\n var movieInfoList = jsonData.map((element) => ({\n movieId: element.show.id ? element.show.id : 0, \n movieName: element.show.name ? element.show.name : \"\", \n imgLink: element.show.image ? element.show.image.medium : \"\"\n }));\n }\n renderResults(movieInfoList);\n \n })\n .catch((error) => {\n //console.log('error', error);\n });\n}", "function findMovie() {\n\n var searchTerm = process.argv[3]; //input name of movie\n // query for omdb\n queryUrl = 'http://www.omdbapi.com/?t=' + searchTerm + '&y=&plot=short&r=json&tomatoes=true';\n //request data only if there are no errors\n request(queryUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(\"========================\");\n // title of movie & release year\n console.log(\"The title of the movie is \" + JSON.parse(body)['Title'] + \".\" + \" The release year of \" + JSON.parse(body)['Title'] + \" is \" + JSON.parse(body)['Year'] + \".\");\n // rating & country & language\n console.log(\"It has an imdb rating of \" + JSON.parse(body)['imdbRating'] + \".\" + \" Filmed in: \" + JSON.parse(body)['Country'] + \".\" + \" Language: \" + JSON.parse(body)['Language'] + \".\");\n // plot\n console.log(\"Plot: \" + JSON.parse(body)['Plot'] + \".\");\n // actors\n console.log(\"Actors in the movie: \" + JSON.parse(body)['Actors'] + \".\");\n // rotten tomatoes rating\n console.log(\"Rotten tomatoes rating is: \" + JSON.parse(body)['tomatoRating']);\n // rotten tomatoes URL\n console.log(\"Rotten tomatoes URL: \" + JSON.parse(body)['tomatoURL']);\n console.log(\"========================\");\n }\n })\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "function movieThis(movieTitle) {\n request(\"http://www.omdbapi.com/?t=\" + movieTitle + \"&plot=short&apikey=trilogy\", function (error, response, body) {\n if (JSON.parse(body).Response === 'False') {\n return console.log(JSON.parse(body).Error);\n }\n if (!movieTitle) {\n request(\"http://www.omdbapi.com/?t=Mr+Nobody&plot=short&apikey=trilogy\", function (error, response, body) {\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n })\n } else if (!error && response.statusCode === 200) {\n\n console.log(`${mainDivider}\\n${\"Movie Title: \"}${JSON.parse(body).Title}\\n${minorDivider}\\n${\"Release Date: \"}${JSON.parse(body).Year}\\n${minorDivider}\\n${\"IMDB Rating: \"}${JSON.parse(body).Ratings[0].Value}\\n${minorDivider}\\n${\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value}\\n${minorDivider}\\n${\"Filmed In: \" + JSON.parse(body).Country}\\n${minorDivider}\\n${\"Language: \" + JSON.parse(body).Language}\\n${minorDivider}\\n${\"Plot: \" + JSON.parse(body).Plot}\\n${minorDivider}\\n${\"Staring: \" + JSON.parse(body).Actors}\\n${mainDivider}`)\n }\n })\n}", "function chosenMovie(userMovieInput){\n request(`http://www.omdbapi.com/?t=${userMovieInput}&y=&i=&plot=short&tomatoes=true&r=json`, function (error, response, body) {\n if (!error && response.statusCode == 200) {\n var parseUserInput = JSON.parse(body)\n var movieOutput = \"Movie Title: \" + parseUserInput.Title + \"\\n\" +\n \"Year Release: \" + parseUserInput.Year + \"\\n\" +\n \"Country Produced: \" + parseUserInput.Country + \"\\n\" +\n \"Language: \" + parseUserInput.Language + \"\\n\" +\n \"Plot: \" + parseUserInput.Plot + \"\\n\" +\n \"Actors: \" + parseUserInput.Actors + \"\\n\" +\n \"IMBD Rating: \" + parseUserInput.imdbRating + \"\\n\" +\n \"Rotten Tomatoes Rating: \" + parseUserInput.tomatoRating + \"\\n\" +\n \"Rotten Tomatoes URL: \" + parseUserInput.tomatoURL + \"\\n\";\n // console.log(movieOutput);\n logText(movieOutput);\n }\n // Reenable the start prompt until the user exits the app.\n start();\n });\n}", "function movieThis(movieName) {\n\n // Default set as Mr. Nobody if user doesn't specify a movie.\n if (movieName == \"\") {\n movieName = \"Mr. Nobody\"\n }\n // Call to and responce from omdb API\n axios.get(\"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=\" + process.env.MOVIE_SECRET)\n .then(function (response) {\n\n var data = response.data\n\n console.log(\"-------------------------------\");\n console.log(\"* Title: \" + data.Title);\n console.log(\"* Year: \" + data.Year);\n console.log(\"* IMDB: \" + data.Ratings[0].Value);\n console.log(\"* Roten Tomatoes: \" + data.Ratings[1].Value);\n console.log(\"* Country: \" + data.Country);\n console.log(\"* Language: \" + data.Language);\n console.log(\"* Plot: \" + data.Plot);\n console.log(\"* Actors: \" + data.Actors);\n console.log(\"---------------------------------\");\n })\n .catch(function (err) {\n console.log(err);\n });\n}", "function getmovie(){\n // Search bug\n document.getElementsByClassName(\"container\")[0].innerHTML=\"\";\n // document.getElementsByClassName(\"more-Res-btn\")[0].innerHTML=\"\";\n\n\n // Getting the movie param\n var movie_name = document.getElementById(\"search-movie\").value;\n movie_name = movie_name.replace(/\\s/g, \"+\");\n\n var apiurl = 'http://www.omdbapi.com/?apikey=6f1d90d9&s='+movie_name;\n var request = new XMLHttpRequest()\n\n // Establishing connection through XMLHttpRequest\n request.open('GET', apiurl, true)\n\n request.onload = function() {\n var data = JSON.parse(this.response)\n // console.log(data);\n\n var movie_list = data['Search'];\n len = movie_list.length;\n for(var i=0; i<len; i++){\n // console.log(movie_list[i]);\n\n // Create a div with a card class\n const card = document.createElement('div')\n if(i > 7){\n card.setAttribute('class', 'card moreRes content-hide');\n }\n else{\n card.setAttribute('class', 'card')\n }\n // Create an h1 and set the text content to the film's title\n const h1 = document.createElement('h4')\n h1.textContent = movie_list[i]['Title']\n\n const img = document.createElement('img')\n img.src = movie_list[i]['Poster']\n img.alt = movie_list[i]['Title']\n // Append the cards to the container element\n container.appendChild(card)\n\n // Each card will contain an h1 and a p\n card.appendChild(img)\n card.appendChild(h1)\n\n if(i == len-1){\n // const div1 = document.createElement('div');\n const btn = document.createElement('button');\n btn.innerHTML = \"More Results\";\n btn.setAttribute('id', 'moreResbtn')\n btn.setAttribute('onclick','moreResults()')\n btn.setAttribute('class', 'more-Res-btn')\n // div1.appendChild(btn);\n container.appendChild(btn);\n }\n\n }\n DOMload(movie_name);\n }\n\n // Send request\n request.send()\n}" ]
[ "0.71758825", "0.7078094", "0.68603635", "0.6791005", "0.6753174", "0.67215526", "0.667687", "0.6663667", "0.6628633", "0.6621592", "0.6598538", "0.658426", "0.65795577", "0.6544884", "0.65394557", "0.65001637", "0.6490946", "0.64838654", "0.64812106", "0.64595306", "0.64540064", "0.6453219", "0.64352095", "0.6420181", "0.6381692", "0.6374236", "0.6362779", "0.6361929", "0.63498193", "0.6342685", "0.63410383", "0.6329294", "0.63203704", "0.6317421", "0.63152975", "0.63100415", "0.6306625", "0.6287738", "0.6281326", "0.6275505", "0.6274559", "0.626415", "0.62596714", "0.62581164", "0.62529886", "0.62524694", "0.62515193", "0.6236442", "0.62340784", "0.6230886", "0.6223882", "0.6223776", "0.6218769", "0.62133825", "0.62038505", "0.62002486", "0.6197285", "0.61969244", "0.61957604", "0.6195266", "0.6193973", "0.6193627", "0.619322", "0.6176951", "0.617213", "0.61699355", "0.6168179", "0.61656886", "0.6165667", "0.6165066", "0.61595476", "0.6156356", "0.6148534", "0.6147984", "0.6146616", "0.61424077", "0.6136718", "0.61360335", "0.6131553", "0.6128171", "0.61279917", "0.6127586", "0.6122746", "0.61224204", "0.61154765", "0.61080605", "0.61007696", "0.6097467", "0.6096583", "0.6095332", "0.6092686", "0.6090197", "0.6089585", "0.6088808", "0.60856336", "0.6076414", "0.60762167", "0.60738766", "0.6071866", "0.6071472", "0.6069621" ]
0.0
-1
Get the current genres available from the TMDB API
function getGenres(){ const genreUrl = generateApiUrl('genre/movie/list'); axios.get(genreUrl) .then((response) => { localStorage.setItem("currentGenres", JSON.stringify(response.data.genres)); return response.data.genres; }) .catch((err)=>{ console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static getGenres() {\n return axios\n .request({\n baseURL: `${TMDB.API_URL}`,\n url: `/genre/tv/list?api_key=${TMDB.API_KEY}`,\n responseType: \"json\"\n })\n .then(response => {\n if (response.status !== 200) {\n return Promise.reject(new Error(response.statusText));\n }\n\n const { genres } = response.data;\n return Promise.resolve(genres);\n })\n .catch(err => {\n Promise.reject(err);\n });\n }", "function getMovieGenres () {\n var params = {\n url: 'https://api.themoviedb.org/3/genre/movie/list?&api_key=7af46ede7373e3339ef7980f35025ed3&language=en-US',\n cache: true\n };\n return servicesForProject.promiseGet(params);\n }", "function getGenres() {\n\n\tData.movies_get_genres(function(error, e) {\n\t\tif (!error) {\n\t\t\tgenres = e;\n\t\t\tpopulateLists(genres, 'genre', lists.length, cellOffset + 40 + Alloy.Globals.layout.lists.cell.height);\n\t\t\tloaded_callback();\n\t\t} else {\n\t\t\tTi.API.error(\"Error: \" + JSON.stringify(JSON.parse(e), null, 4));\n\t\t}\n\t});\n}", "function getGenres(){\n var url = \"http://api.themoviedb.org/3/genre/movie/list?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function getGenres(){\n\t\tvar api = \"?api_key=933bee1465a61090ebe0704cd6d4c3e1\";\n\t\tvar baseURL = \"http://api.themoviedb.org/3\";\n\t\tvar query = \"/genre/list\";\n\t\tvar url = baseURL+query+api;\n\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\tdatatype: 'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tgetGenreID(data);\n\t\t\t}\n\t\t});\n\t}", "function getMovieGenres() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"GENRES\"][\"MOVIES\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movie_genres.trigger('change');\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "function genre() {\n var query = genreService.genre($localStorage.token).query();\n query.$promise\n .then(function(data) {\n vm.genres = data.results;\n }).catch(function(error) {\n vm.genres = error;\n });\n }", "function getMovieGenres() {\n let queryURL =\n \"https://api.themoviedb.org/3/genre/movie/list?api_key=\" +\n API_KEY +\n \"&language=en-US\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n let movieGenres = [];\n for (let i = 0; i < response.genres.length; i++) {\n movieGenres.push(response.genres[i].name);\n }\n console.log(movieGenres);\n });\n}", "async function getGenres(){\n fetch('https://api.themoviedb.org/3/genre/movie/list?api_key=cf36f9aeb147ea6ae7b074ced171ef64')\n .then(data=>data.json())\n .then(data=>{\n if(data.genres){\n setGenreList(data.genres)\n setConnected(true)\n }\n })\n }", "function getGenres() {\n // TODO: get categories from wp headless\n // https://movie-api.cederdorff.com/wp-json/wp/v2/categories\n}", "function getGenresNames() {\n return new Promise((resolve, reject) => {\n fetch(GENRE_API)\n .then(res => res.json())\n .then(data => resolve(genreIdReader(data)));\n });\n}", "function getTVGenres() {\n let queryURL =\n \"https://api.themoviedb.org/3/genre/tv/list?api_key=\" +\n API_KEY +\n \"&language=en-US\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let tvGenres = [];\n for (let i = 0; i < response.genres.length; i++) {\n tvGenres.push(response.genres[i].name);\n }\n console.log(tvGenres);\n });\n}", "getMyGenresFromIndex() {\n\t\tvar query = `\n\t\tSELECT * FROM genres\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tWHERE directory=\"data/users/${userAuthAddress}\"\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "getGenresFromIndex() {\n\t\tvar query = `\n\t\tSELECT * FROM genres\n\t\t\tLEFT JOIN json USING (json_id)\n\t\t\tORDER BY date_added ASC\n\t\t`;\n\t\n\t\treturn this.cmdp(\"dbQuery\", [query]);\n\t}", "async getMovieGenres(language = \"en-US\") {\n return this.get(\"movie/list\", {\n language,\n });\n }", "async getTvGenres(language = \"en-US\") {\n return this.get(\"tv/list\", {\n language,\n });\n }", "async function fetchGenre() {\n let response = await fetch(props.baseUrl + \"genres\", {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Cache-Control\": \"no-cache\",\n }\n })\n response = await response.json();\n setGenres(response.genres);\n }", "function fetchGenreList() {\n\tvar url = 'http://developer.echonest.com/api/v4/artist/list_genres?api_key=' + key;\n\t$.getJSON(url, { }, \n\t function(data) {\n\t var genres = data.response.genres;\n\t var glist = $('.genre');\n\t console.log(genres.length)\n\t for (var i = 0, max = genres.length; i < max; i++) {\n\t var genre = genres[i].name;\n\t var opt = $(\"<option>\").attr('value', genre).text(genre);\n\t glist.append(opt);\n\t }\n\t $(\"#genre1\").val('electro')\n\t $(\"#genre2\").val('dance-punk')\n\t $(\"#genre3\").val('new wave')\n\t $(\"#genre4\").val('italian disco')\n\t // $(\"#genre5\").val('synthpop')\n\t }\n );\n}", "function getGenres(data) {\n var genres = [];\n var it = 0;\n\n for (var i = 0; i < data.length; i++) {\n if (!(genres.includes(data[i][\"Genre\"])))\n genres[it] = data[i].Genre;\n it++;\n }\n\n return genres;\n}", "function get() {\n var defer = $q.defer();\n\n $http.get(API_BASE_URL + 'genres').then(function(response) {\n defer.resolve(response.data);\n }).catch(function(err) {\n console.log(err);\n defer.reject(err);\n });\n\n return defer.promise;\n }", "getGenres() {\n const urlString =\n \"https://api.themoviedb.org/3/movie/\" +\n this.props.movie.id +\n \"?api_key=4ccda7a34189fcea2fc752a6ee339500&append_to_response=credits\";\n\n $.ajax({\n url: urlString,\n success: searchResults => {\n var detail = searchResults;\n var genres = detail.genres;\n if (genres.length > 2) {\n genres = genres.slice(0, 2);\n detail.genres = genres;\n }\n detail.percent_class = \"\";\n var details = [];\n details.push(detail);\n this.setState({ genres: details });\n },\n error: (xhr, status, err) => {\n console.error(\"Failed to fetch data\");\n }\n });\n }", "getTracksMatchingGenres(genres) {\n let tracks = [];\n this.getAllAlbums().forEach( album => {\n const tracksByGenere = album.getTracksByGenres(genres);\n tracks = tracks.concat(tracksByGenere);\n });\n return tracks;\n }", "function getFavSeries(genre) {\n //int genre = genre code\n //https://api.themoviedb.org/3/discover/tv?api_key=1e5a5ee20af326aebb685a34a1868b76&sort_by=popularity.desc&with_genres=35\n\n let apiSearch = `https://api.themoviedb.org/3/discover/tv?api_key=1e5a5ee20af326aebb685a34a1868b76&sort_by=popularity.desc&with_genres= ${genre}`;\n\n ajaxCall(\"GET\", apiSearch, \"\", getSeriesPopByGenreSuccessCB, getSeriesPopByGenreErrorCB)\n\n}", "function getSongsFromGenres(genres, access_token) {\n var xhr = new XMLHttpRequest();\n var query = \"limit=10\" +\n \"seed_genres=[\";\n for (var i = 0; i < genres.length; i++) {\n \tquery += genres[i];\n }\n query += \"]\";\n xhr.open(\"GET\", \"https://api.spotify.com/v1/recommendations?\" + query);\n xhr.setRequestHeader(\"Authorization\", token);\n\n xhr.onreadystatechange = function() {\n \tif (xhr.readyState == 4 && xhr.status == 200) {\n \t\tdata = filterCardData(JSON.parse(xhr.responseText));\n \t}\n }\n xhr.send(query);\n}", "get_genres(genre_ids){\r\n // Esempio di genre_ids = [ 100 , 45 ]\r\n let genres = [];\r\n\r\n genre_ids.forEach(genre_id => {\r\n this.all_genres.forEach((genre, index) => {\r\n // Confronta ogni id del film con l array del genere\r\n if(genre_id == genre.id){\r\n // Quando trova corrispondenza aggiunge il nome del genre alla stringa\r\n genres.push(genre.name);\r\n };\r\n });\r\n });\r\n return genres;\r\n }", "getTracksMatchingGenres(genres) {\n let albums = this.collectAlbums();\n let tracks = this.collecTracks(albums);\n \n let result = tracks.filter((t)=> t.hasAnyGenre(genres));\n return result;\n }", "function fetchGenreList() {\n // const params=new URLSearchParams()\n // params.set('userID',)\n fetch('./api/genre')\n .then(response => response.json())\n .then(genres => {\n populateDropdown(selection1, genres);\n populateDropdown(selection2, genres);\n populateDropdown(selection3, genres);\n })\n}", "function getGenres(type){\r\n return $.ajax(\r\n {\r\n url: url + 'genre/'+ type + \"/list\",\r\n \"data\" : {\r\n \"api_key\": \"a6adae1843502c7becfac80b53ca41ac\",\r\n \"language\" :\"it-IT\"\r\n },\r\n \"method\": \"GET\",\r\n \"success\": function (data, stato) {\r\n for (var j = 0; j < data.genres.length; j++) {\r\n genders[type].push({\r\n id: data.genres[j].id,\r\n name: data.genres[j].name\r\n })\r\n }\r\n },\r\n error: function (errore) {\r\n console.log(\"E' avvenuto un errore. \" + errore);\r\n }\r\n });\r\n }", "static fetchGamesByGenre(genre, callback) {\n DBHelper.fetchGames((error, games) => {\n if(error) {\n callback(error, null);\n }\n else {\n const results = games.find(r => r.Genre == genre);\n callback(null, results);\n }\n })\n }", "function getLikedGenres() {\n $.get('/api/likedGenres/' + sessionStorage.getItem('userID'), function (data) {\n if (data.genres.length <= 0) {\n $('#welcomeModal').modal('show')\n }\n $('.genre-btn').each(function () {\n $(this).removeClass('selected')\n for (var i = 0; i < data.genres.length; i++) {\n if (this.id == data.genres[i]) {\n $(this).addClass('selected')\n break\n }\n }\n })\n })\n}", "setGenre(){\n axios.get('https://api.themoviedb.org/3/genre/movie/list', {\n params: {\n 'api_key': API_KEY,\n language: this.language,\n page: this.homeIndex,\n\n }\n }).then(genere => this.genreMovies = genere.data.genres);\n }", "function getTracks(genre){\n if(!uId) return;\n \n let genreString = 'seed_genres=' + genre;\n let paramString = getOSqueryString();\n return fetch('https://api.spotify.com/v1/recommendations' + '?' + genreString + '&' + paramString, {\n headers: {\n Authorization: 'Bearer ' + accessToken\n }\n })\n .then(resp => resp.json())\n .then(parseRespObj)\n .then(recTracks => tracks = recTracks);\n}", "getGenres() {\n var arr = this.state.data.genres.slice(0);\n var newArr = [];\n for (var g in arr)\n newArr.push(arr[g].name);\n return <Text style={{fontSize: 12, color: 'white', paddingTop: 5}}>Genres: {newArr.join(\", \")}</Text>\n }", "getTracksMatchingGenres(genres) {\n const tracks = this.getAllTrack();\n const tracksFilteredByGenres = tracks.filter(track =>\n track.getGenres().some(genre => genres.includes(genre))\n );\n\n return tracksFilteredByGenres;\n }", "static loadGenres() {\n // Returns a new promise to the user\n return new Promise((success, fail) => {\n var genres = [] // Stores the Genre objects\n // Reads all of the movie information\n firebase.database().ref(\"items\").once('value').then(function(snapshot) {\n // Explores all of the movies\n for(var i = 0; i < snapshot.val().length; i++) {\n var info = snapshot.val()[i] // Stores the movie info\n var genre = info.genre; // Stores the movie's genre array\n // Explores the genre's\n for(var i2 = 0; i2 < genre.length; i2++) {\n // Checks to see if the given genre is already in the genres array\n if(genres.indexOf(genre[i2]) == -1) {\n genres.push(genre[i2]) // Adds the entry to the genres array\n }\n }\n // Checks if this is the last movie to be evaluated\n if(i+1 == snapshot.val().length) {\n success(genres) // Returns the genre array to the user\n }\n } \n })\n })\n }", "function getGenere(id, type) {\r\n $.ajax({\r\n url: 'https://api.themoviedb.org/3/'+ type +'/' + id,\r\n method: 'GET',\r\n data: {\r\n api_key: '9223e97f95bb1fdb0b5ae958392fe3c8',\r\n language: 'it-IT'\r\n },\r\n success: function(data) {\r\n var objectGenre = data.genres;\r\n printGenres(objectGenre, id)\r\n },\r\n error: function() {\r\n alert('Errore')\r\n }\r\n });\r\n}", "getGenreSerie() {\r\n axios.get('https://api.themoviedb.org/3/genre/tv/list', {\r\n params: {\r\n api_key: '8ee3ad03988875233a1bddc1e4e8ff76',\r\n }\r\n\r\n })\r\n .then(response => {\r\n // Return series\r\n this.allGenSeries = response.data.genres;\r\n })\r\n .catch(function (error) {\r\n // handle error\r\n console.log(error);\r\n });\r\n }", "getTracksMatchingGenres(genres) {\n return this.allTracks().filter(track => track.containsGenre(genres));\n }", "function list(name, year, genres, page) {\n return $.getJSON(\"/api/movies/?q=\" + encodeURIParam(name) + \"&year=\" + encodeURIParam(year) + \"&genres=\" + encodeURIParam(genres) + \"&page=\" + encodeURIComponent(page != null ? page.toString() : \"\"));\n }", "function genreSelected(genreId) {\n // TODO: fetch movies matching the given genreId\n // `https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=${genreId}`\n}", "function populateGenres()\n{\n $.post(\n \"php/enter.php\",\n { action: \"getGenres\" },\n function( response ) {\n genres = JSON.parse( response );\n }\n );\n}", "function getSelectedGenre() {\n return $(\"[data-hook='list-genres']\").find(\"li.selected\").text();\n}", "function getGenre() {\n\n if ( window.location.hash ) {\n var genre = window.location.hash.substr( 1 );\n loadAndUpdate( genre );\n } else {\n var genre = genres[ randomInt( genres.length - 1 ) ];\n location.hash = \"#\" + genre;\n loadAndUpdate( genre );\n }\n\n }", "getGenreMovie() {\r\n axios.get('https://api.themoviedb.org/3/genre/movie/list', {\r\n params: {\r\n api_key: '8ee3ad03988875233a1bddc1e4e8ff76',} \r\n })\r\n .then(response => {\r\n // Return series\r\n this.allGenMovies = response.data.genres;\r\n })\r\n .catch(function (error) {\r\n // handle error\r\n console.log(error);\r\n });\r\n }", "async function getMovies(genres, year) {\n let response = await axios\n .get(\n ` https://api.themoviedb.org/3/discover/movie?api_key=${APIKEY}&with_genres=${genres}&primary_release_year=${year}&sort_by=popularity.desc&page=${page}`\n )\n .catch(res => {\n console.log(\"error\");\n });\n\n // displays movies in DOM\n\n movieDomCreator(response.data.results);\n\n console.log(response.data.results);\n return response.data.results;\n}", "function loadGenres(){\n\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){\n if(xhr.readyState==4 && xhr.status == 200){\n var genres = JSON.parse(xhr.responseText);\n for(let i = 0; i < genres.length; i++){\n var elem = document.createElement(\"option\");\n elem.value = genres[i].id;\n elem.innerHTML = genres[i].name;\n $('#genres').append(elem);\n }\n }\n }\n\n xhr.open(\"GET\", \"http://localhost:3000/genres\", true);\n xhr.send();\n}", "function GetGenreBrowseOptions() {\n InitializeWorklist();\n var output = '';\n var longname;\n var abbr;\n var i, j;\n var rep;\n var gen;\n\n var genlist1 = {};\n\n for (i=0; i<WORKLIST.length; i++) {\n\t\trep = WORKLIST[i].repid;\n gen = WORKLIST[i].genres;\n for (j=0; j<gen.length; j++) {\n\t\t\tgenlist1[gen[j].name] = gen[j].name;\n\t\t}\n\t}\n var genlist2 = [];\n for (entry in genlist1) genlist2.push(entry);\n\tgenlist2.sort();\n\n\tvar output = '';\n for (i=0; i<genlist2.length; i++) {\n output += '<option value=\"' + genlist2[i] + '\">';\n\t if (genlist2[i].match('mass')) {\n\t\t\toutput += 'Masses';\n\t } else if (genlist2[i].match('motet')) {\n\t\t\toutput += 'Motets';\n\t } else if (genlist2[i].match('song')) {\n\t\t\toutput += 'Songs';\n\t\t} else {\n\t\t\toutput += genlist2[i];\n\t\t}\n\t\toutput += '</option>\\n';\n }\n return output;\n}", "getAllGearQualities() {\n return fetch(`${remoteURL}/gearQualities`).then(e => e.json())\n }", "async function getGenres() {\n let response = await fetch(\"http://wordpress.oscho.dk//wp-json/wp/v2/posts?_embed&categories=19\");\n let data = await response.json();\n console.log(data);\n appendGenres(data);\n //showLoader(false);\n}", "getTracksMatchingGenres(genres) {\n const tracks = [];\n this._getTracks().forEach((track) =>\n track.addIfMatchGenres(tracks, genres)\n );\n return tracks;\n }", "function setGenres(data) {\n return {\n genres: _.reduceRight(_.pluck(data, 'genres'), function(a, b) { return _.sortBy(_.union(a, b)); }, [])\n };\n }", "getTracksMatchingGenres(genres) \n {\n \n return this.tracks.filter(track => track.hasGenres(genres));\n\n }", "function findGenres(input){\n if(input === undefined) {\n }\n let genresArr = [];\n for(let v = 0; v < input.length; v++){\n \n for(let m = 0; m < genres.length; m++){\n if(input[v] === genres[m].id){\n genresArr.push(genres[m].name);\n }\n }\n\n }\n \n return genresArr;\n }", "function getTracks(value) {\n url = \"/get_genre_artists\" + \"?genre=\" + value;\n\n var request = new XMLHttpRequest();\n request.open(\"GET\", url, true);\n\n request.setRequestHeader('Content-type', 'text/plain');\n\n request.onreadystatechange = function() {\n if (request.readyState == 4 && request.status == 200) {\n data = request.responseText;\n data = JSON.parse(data);\n temp_songs = data;\n printTracksToPage(data, 0);\n };\n };\n request.send();\n}", "function getMovieGenre(genre) {\n if (!genreArray.includes(genre)) {\n genreArray.push(genre);\n\n let genreOption = makeElement(\"option\");\n genreOption.textContent = genre;\n genreOption.value = genre;\n\n genresSelect.appendChild(genreOption);\n }\n}", "static getGeneratable(){\n\n\t\treturn glib.getAllValues(this.name).filter(el => el.genLoot);\n\n\t}", "async function searchByGenre(genQuery, catQuery) {\n let vgUrl = getVideoGameUrl({ type: \"genres\", value: genQuery });\n let pageLimit = 2;\n let totalResults = [];\n let resultList = [];\n const rawgResp = await fetch(vgUrl);\n const rawgResults = await rawgResp.json();\n setLoadingText();\n\n // determines the amount of results per genre that will be received from the api\n if (catQuery.length > 0) {\n let limitRatio = Math.floor(16 / catQuery.length);\n if (limitRatio >= 8) {\n pageLimit = 20;\n } else if (limitRatio >= 4) {\n pageLimit = 10;\n } else if (limitRatio >= 2) {\n pageLimit = 5;\n }\n\n // Board game atlas filters game results in a different way than the rawg api\n // This loop handles the collection of boardgames based on the selected genres\n for (let i = 0; i < catQuery.length; i++) {\n const bgUrl = getBoardGameUrl({\n type: \"categories\",\n value: catQuery[i],\n limit: pageLimit,\n });\n const atlasResponse = await fetch(bgUrl);\n const atlasResults = await atlasResponse.json();\n totalResults = totalResults.concat(atlasResults.games);\n delay(10);\n }\n }\n\n // Translates the api results from the rawg api into a common object\n for (let vGame of rawgResults.results) {\n resultList.push({\n name: vGame.name,\n image: vGame.background_image,\n link: `https://rawg.io/games/${vGame.id}`,\n });\n }\n\n // Translates the api results from the atlas api into a common object\n for (let bGame of totalResults) {\n resultList.push({\n name: bGame.name,\n image: bGame.image_url,\n link: bGame.url,\n });\n }\n\n resultList.sort(sortGames);\n useData(resultList);\n}", "function appendGenres(genres) {\n let htmlTemplate = \"\";\n for (let genre of genres) {\n htmlTemplate += `\n <option value=\"${genre.id}\">${genre.name}</option>\n `;\n }\n\n document.querySelector('#select-genre').innerHTML += htmlTemplate;\n}", "addGenresNamesForAllMovies () {\n this.data.movies.forEach(movie => {\n movie.genres = movie.genre_ids.map((val, i, arr) => {\n let genreName = '';\n\n for (let i = 0; i < this.data.genres.length; i++) {\n if (val === this.data.genres[i].id) {\n genreName = this.data.genres[i].name;\n\n // End the cycle to avoid unnecessary loops.\n i = this.data.genres.length;\n }\n }\n\n // Wrapping each genre to a span so white space can be controlled (to not break multi word genres).\n return `<span>${genreName}</span>`;\n }).join(', ');\n });\n }", "async function get_genres_of_author(request, response, next) {\n console.log('get all genres of this author (AuthorHasGenre)');\n\n try {\n const id_author = request.params.id;\n\n const results = await pool.query('SELECT * FROM genres WHERE id_genre IN (SELECT id_genre FROM authorhasgenre WHERE id_author = $1)',\n [id_author]);\n response.status(200).json(results.rows);\n } catch (error) {\n next(error);\n }\n}", "function findSingleShowGenres(input){\n if(input === undefined) {\n }\n let genresArr = [];\n for(let v = 0; v < input.length; v++){\n \n for(let m = 0; m < genres.length; m++){\n if(input[v].id === genres[m].id){\n genresArr.push(genres[m].name);\n }\n }\n \n }\n \n return genresArr;\n }", "function get_genre(album_array) {\r\n let genre_array = [];\r\n // console.log(album_array);\r\n\r\n album_array.forEach((album) => {\r\n // get all album.genre and push in array if not includes\r\n if (!genre_array.includes(album.genre)) {\r\n genre_array.push(album.genre);\r\n }\r\n });\r\n // console.log(genre_array);\r\n return genre_array;\r\n }", "function pickGenreFromMovie(title) {\n \n //themoviedb API to pick a genre\n let getMovieGenreNumURL = 'https://api.themoviedb.org/3/search/movie?query=' + title + '&api_key=d8731638c74bc1c4039ad5e0a50c36af';\n\n $.ajax({\n url: getMovieGenreNumURL,\n method: \"GET\",\n error: function() {\n console.log(\"error with api call\")\n return;\n }\n }).then(function(responseGenre) {\n\n //Take all genres from the movie, and pick one to use\n let movieGenres = responseGenre.results[0].genre_ids;\n //findMovie(movieGenres);\n findMovie(movieGenres);\n\n //Change any genres that aren't in the arrays to a genre that is in the array\n for(i = 0; i < movieGenres.length; i++){\n switch(movieGenres[i]) {\n case 99:\n case 10770:\n case 10402:\n movieGenres[i] = 18;\n break;\n case 16:\n movieGenres[i] = 14;\n break;\n };\n };\n\n\n //Pass all genres\n let multGenres = [];\n for(i = 0; i < movieGenres.length; i++){\n let addGenre = $.inArray(movieGenres[i],movieGenreArray);\n multGenres[i] = allGenreArray[addGenre]; \n };\n\n\n //Picks one genre to pass\n let pickAGenre = Math.floor(Math.random() * movieGenres.length);\n let genreChosen = movieGenreArray.indexOf(movieGenres[pickAGenre]); \n let genrePass = allGenreArray[genreChosen];\n \n\n //Pass genre to other medias\n //book\n searchBooksByGenre(genrePass);\n //video games\n videoGameFromOther(genrePass);\n //anime\n genreConvertID(genrePass);\n\n }); \n}", "function myGenre() {\n var genreList = document.getElementById(\"genreList\");\n return genreList.options[genreList.selectedIndex].text;\n}", "function getGears() {\n return $http.get('getGears').then((response) => {\n initGearsDict(response.data);\n });\n }", "function getSpiritForGenre(genreData) {\n // remember that each movie can have multiple genres. it's possible that some of them are not included\n // in the resultsArr[], so we keep looking until we find one that we can recognize\n for (let genreIndex = 0; genreIndex < genreData.length; genreIndex++) {\n const genre = genreData[genreIndex].toLowerCase();\n\n console.log(\"searching for genre: \" + genre);\n for (let i = 0; i < resultsArr.length; i++) {\n if (genre == resultsArr[i].genre) {\n console.log(\"found spirit for genre: \" + genre);\n return resultsArr[i].spirit;\n }\n }\n\n console.log(\"did not find spirit for genre: \" + genre);\n }\n //if we find no matching genres\n return undefined;\n}", "function btnFilter(){\r\n const url = `${path}/genre/movie/list?api_key=${api_key}&language=it-IT`\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((data) => btnGenres(data.genres))\r\n .catch((err) => console.log(err))\r\n }", "function getGenreID(allGenres){\n\t\tallGenres = allGenres['genres'];\n\n for (let genre of allGenres) {\n if (selections.includes(genre.name.toLowerCase())) {\n genreIDs.push(genre.id);\n } else if (rejections.includes(genre.name.toLowerCase())) {\n genreExclusions.push(genre.id);\n }\n }\n \n genreIDs = genreIDs.toString();\n genreExclusions.toString();\n\t\tgetKeywords();\n\t}", "getsubs({ imdbid, language }) {\n return apiClient.get(`films/subs/${imdbid}?language=${language}`)\n }", "movieGenres(data,genres){\n //filter the dataset and create an array of genres => one object for each genre in the db\n genres.forEach((genre, index)=>myApp.vm.genres.push({name :genre, movies: data.filter(movie=>movie.genre_name===genre)}));\n\n }", "function getGenre(genre) {\n if (genre == 1) {\n newGenre = 'Horror'\n } else if (genre == 2) {\n newGenre = 'Action-Adventure'\n } else if (genre == 3) {\n newGenre = 'Romance'\n } else if (genre == 4) {\n newGenre = 'Thriller'\n } else if (genre == 5) {\n newGenre = 'Comedy'\n } else if (genre == 6) {\n newGenre = 'Historical Fiction'\n } else if (genre == 7) {\n newGenre = 'Fanfiction'\n } else if (genre == 8) {\n newGenre = 'Fantasy'\n } else if (genre == 9) {\n newGenre = 'Non-Fiction'\n } else if (genre == 10) {\n newGenre = 'Science Fiction'\n } else if (genre == 11) {\n newGenre = 'Short Story'\n } else if (genre == 12) {\n newGenre = 'Poetry'\n } else if (genre == 13) {\n newGenre = 'Spiritual'\n } else if (genre == 14) {\n newGenre = 'Paranormal'\n } else if (genre == 15) {\n newGenre = 'Teen Fiction'\n } else if (genre == 16) {\n newGenre = 'Random'\n } else if (genre == 17) {\n newGenre = 'Opinion/Analysis'\n } else {\n newGenre = null\n }\n return (newGenre)\n}", "function GetGenreOptions(repertory) {\n if ((typeof repertory === 'undefined') || \n\t\t\t(repertory == null) || (repertory == '')) {\n\t // Avoiding displaying the genre list without a repertory.\n\t // This is because analyses mostly need to be limited to a single repertory\n\t // So that not too many images are shown on the same page.\n\t\tvar opts = '<option value=\"mass\">Masses</option>\\n';\n\t\topts += '<option value=\"motet\">Motets</option>\\n';\n\t\topts += '<option value=\"song\">Songs</option>\\n';\n return opts;\n }\n\n InitializeWorklist();\n var output = '';\n var longname;\n var abbr;\n var i, j;\n var rep;\n var gen;\n\n var genlist1 = {};\n\n for (i=0; i<WORKLIST.length; i++) {\n\t\trep = WORKLIST[i].repid;\n\t\tif (!repertory.match(/^\\s*$/) && (!rep.match(repertory))) {\n\t\t\tcontinue;\n\t\t}\n gen = WORKLIST[i].genres;\n for (j=0; j<gen.length; j++) {\n\t\t\tgenlist1[gen[j].name] = gen[j].name;\n\t\t}\n\t}\n var genlist2 = [];\n for (entry in genlist1) genlist2.push(entry);\n\tgenlist2.sort();\n\n\tvar output = '';\n for (i=0; i<genlist2.length; i++) {\n output += '<option value=\"' + genlist2[i] + '\">';\n\t if (genlist2[i].match('mass')) {\n\t\t\toutput += 'Masses';\n\t } else if (genlist2[i].match('motet')) {\n\t\t\toutput += 'Motets';\n\t } else if (genlist2[i].match('song')) {\n\t\t\toutput += 'Songs';\n\t\t} else {\n\t\t\toutput += genlist2[i];\n\t\t}\n\t\toutput += '</option>\\n';\n }\n return output;\n}", "getAllGearItemsAndQualities() {\n return fetch(`${remoteURL}/gearItems?_expand=gearQuality&_expand=gearClass`).then(e => e.json())\n }", "renderGenres() {\n return this.props.genres.map((genre) => {\n return (\n <option value={genre.id} className=\"text\">{genre.name}</option>\n );\n });\n }", "getGenerations(Generations) {\n Generations.get().then((res) => {\n this.generations = res.data;\n });\n }", "async function author_genres(request, response, next) {\n console.log('Author\\'s genres');\n\n try {\n const id_author = request.params.id;\n\n const results = await pool.query('select genres.* from genres inner join authorhasgenres using(id_genre) inner join authors using(id_author) where authors.id_author = $1',\n [id_author]);\n response.status(200).json(results.rows);\n } catch (error) {\n next(error);\n }\n}", "getAll(request, response) {\n _database.collection(gifCollection).find({}).toArray(function(err, data) {\n response.json(data);\n });\n }", "function populate() {\n apiService.genre.query().$promise.then(function (res) {\n $scope.genres = res;\n });\n apiService.author.query().$promise.then(function (result) {\n authors = result;\n });\n }", "function genreSelected(genreId) {\n console.log(`Genre ID: ${genreId}`);\n if (genreId) {\n fetch(`http://curlyhairapp.christinab.dk/wp-json/wp/v2/posts?_embed&categories=${genreId}`)\n .then(function(response) {\n return response.json();\n })\n .then(function(products) {\n console.log(products);\n appendProductsByGenre(products);\n });\n } else {\n // create feedback\n }\n}", "function getBooks() {\n clubID = this.value;\n // console.log('clubID', clubID);\n fetch('/get_books_in_genre?clubID=' + clubID)\n .then(function (response) {\n return response.json();\n }).then(function (json) {\n // console.log('GET response', json);\n if (json.length > 0) {\n set_book_select(json);\n };\n });\n}", "function playGenre(genre) {\n\tSC.get('/tracks', { genres: genre, stream: true }, function(tracks) {\n\t\tcurrentTracks = tracks;\n\t\tcurrentIndex = 0;\n\t\tconsole.log(tracks);\n\t\tplayNextTrack();\n\t});\n}", "function getPopularMovies(){\n var url = \"https://api.themoviedb.org/3/movie/popular?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "print_genres_string(id){\r\n let genres_string = \"\";\r\n\r\n for (var i = 0; i < this.additional_infos.length; i++) {\r\n if(id == this.additional_infos[i].id){\r\n genres_string = this.additional_infos[i].genres.join(\" / \");\r\n };\r\n };\r\n return genres_string;\r\n }", "function setGenres(arr){\n let genres = [];\n if(arr !== null){\n arr.forEach((genre) => genres.push(genre.name))\n }\n return genres;\n}", "function getAvailableMovies(req, res, next) {\n movieRepository.findAvailables().then((result) => {\n res.status(200).send(result);\n }).catch(next);\n}", "async function get_authors_of_genre(request, response, next) {\n console.log('get all authors of this genre (AuthorHasGenre)');\n\n try {\n const id_genre = request.params.id;\n\n const results = await pool.query('SELECT * FROM authors WHERE id_author IN (SELECT id_author FROM authorhasgenre WHERE id_genre = $1)',\n [id_genre]);\n response.status(200).json(results.rows);\n } catch (error) {\n next(error);\n }\n}", "function getPopularMovies() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"MOVIES\"][\"POPULAR\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movies.trigger('change');\n\t\t\t\t\t$.ptr.hide();\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "function loadAllRegimes() {\n //also get the available regimens here for later\n return conceptService.get(Bahmni.Common.Constants.arvRegimensConvSet).then(function (result) {\n vm.allRegimes = result.data;\n });\n }", "async function getPopularMovies() {\n const popularMoviesUrl = getUrl(\"/movie/popular\");\n const result = await getData(`${popularMoviesUrl}`);\n\n state.movies.popular = result.results;\n\n return result;\n}", "async function getMovies(ctx) {\n const currentDate = getCurrentDate();\n const movies = ctx.movies.find({ LastOnAir: currentDate });\n return movies.toArray();\n}", "function get_genres_order(ordered_data) {\n var res = [];\n for (var i = 0; i < ordered_data.length; i++) {\n res.push(ordered_data[i].genre);\n }\n return res;\n}", "function getGameInfo() {\n limiter.request({\n url: `https://global.api.pvp.net/api/lol/static-data/euw/v1.2/champion?champData=all&${api}`,\n method: 'GET',\n json: true,\n }, (error, response) => {\n if (!error && response.statusCode === 200) {\n champions = response.body.data;\n version = response.body.version;\n console.log(champions);\n }\n if (error) {\n throw new Error('Cannot connect to Riot API');\n }\n });\n}", "async getAllGIFs(req, res) {\n console.log(\"getAllGIFs()\")\n\n const docs = await GIF.find({})\n\n if (docs) res.json(docs)\n else res.status(404).send(\"not found\")\n }", "getGenotype(index)\n {\n let carGeno = this.population[index].returnGenotype();\n return carGeno;\n }", "retrieveAllGames() {\n return freendiesApi.retrieveAllGames()\n }", "get genre_id() {\n return this._genre_id == null ? \"\" : this._genre_id;\n }", "function ShowGenre(cache2)\n{\n\tlet id,\n\t\trows = $(\"div.filmo-category-section\").not(\"div[style='display:none;']\").find(\"div.filmo-row b > a\");\n\n\tfor (let i = 0; i < rows.length; i++)\n\t{\n\t\tid = $(rows[i]).attr(\"href\").match(/\\/(tt\\d+)\\//)[1];\n\n\t\tif (typeof cache2[id] === \"undefined\")\n\t\t\tcontinue;\n\n\t\tlet g = \"(\";\n\t\tlet div = $(rows[i]).parent().parent();\n\n\t\tfor (let j = 0; j < cache2[id][\"genres\"].length; j++)\n\t\t{\n\t\t\tif (j === (cache2[id][\"genres\"].length - 1))\n\t\t\t{\n\t\t\t\tg += \"<a href=https://www.imdb.com/search/title?genres=\" + cache2[id][\"genres\"][j] + \" style='font-size:11px;'>\" + cache2[id][\"genres\"][j] + \"</a>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg += \"<a href=https://www.imdb.com/search/title?genres=\" + cache2[id][\"genres\"][j] + \" style='font-size:11px;'>\" + cache2[id][\"genres\"][j] + \"</a>, \";\n\t\t\t}\n\t\t}\n\t\tg += \") <br>\";\n\n\t\t$($(div).children(\"br\")[0]).after(g);\n\t}\n}", "function updateGenres(genres) {\n currentUser.UserGenres = [];\n genres.forEach(function (val) {\n if (val.selected) {\n currentUser.UserGenres.push({\n Genre: val,\n GenreId: val.Id\n });\n }\n });\n currentUser.put();\n }", "function getResult() {\n // Get values from URL query params.\n let seedGenres = null;\n let targetValence = null;\n let targetPopularity = null;\n let targetTempo = null;\n let targetAcousticness = null;\n const queryString = window.location.search;\n if(queryString.length > 0)\n {\n const urlParams = new URLSearchParams(queryString);\n seedGenres = urlParams.get('genre');\n targetValence = urlParams.get('valence');\n targetPopularity = urlParams.get('popularity');\n targetTempo = urlParams.get('bpm');\n targetAcousticness = urlParams.get('acousticness');\n targetValence = targetValence/100;\n targetPopularity = targetPopularity;\n targetAcousticness = targetAcousticness/100;\n }\n\n let url = baseUri + '/recommendations';\n url += '?limit=' + songNum;\n url += '&seed_genres=' + seedGenres;\n url += '&target_valence=' + targetValence;\n url += '&target_popularity=' + targetPopularity;\n url += '&target_tempo=' + targetTempo;\n url += '&target_acousticness=' + targetAcousticness;\n callApi('GET', url, null, handleGetResultResponse);\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}" ]
[ "0.80582136", "0.80181473", "0.8017286", "0.7997309", "0.76911044", "0.7602529", "0.74328285", "0.73813987", "0.73503447", "0.7331327", "0.7286463", "0.7209106", "0.6930989", "0.68298477", "0.68271065", "0.68191725", "0.6716938", "0.669389", "0.6556808", "0.65087324", "0.6481361", "0.6467499", "0.6345829", "0.63289857", "0.6278855", "0.6249733", "0.62444586", "0.6216972", "0.6193064", "0.6154399", "0.6101092", "0.60854006", "0.6069675", "0.6067626", "0.6033066", "0.59934783", "0.5979053", "0.5975701", "0.5904", "0.58567685", "0.58521813", "0.5850198", "0.58417875", "0.584026", "0.58242357", "0.5822413", "0.58192074", "0.5815604", "0.58133686", "0.57798225", "0.5776756", "0.5745708", "0.5689741", "0.56837684", "0.5669652", "0.5660413", "0.56451726", "0.5631362", "0.5626986", "0.5594996", "0.55930525", "0.55772525", "0.55388975", "0.5528347", "0.552383", "0.5508716", "0.5504423", "0.5494423", "0.54839206", "0.546735", "0.54612726", "0.54571176", "0.5448819", "0.54466194", "0.5432772", "0.54313636", "0.54310995", "0.5429942", "0.54262364", "0.54064244", "0.54042685", "0.5387289", "0.5369757", "0.5369654", "0.53643596", "0.533735", "0.533544", "0.5322057", "0.53052586", "0.53040516", "0.52834314", "0.52818763", "0.52793694", "0.5278267", "0.5276352", "0.5273958", "0.5270508", "0.52654994", "0.5262848", "0.5256142" ]
0.7644877
5
Get the latest list of latest movies from the TMDB API
function getLatestMovies() { let latestUrl = generateApiUrl('movie/now_playing'); axios.get(latestUrl) .then((response) => { const latestMovies = response.data.results.sort((a,b) => b.popularity - a.popularity); localStorage.setItem("latestMovies", JSON.stringify(latestMovies)); return latestMovies; }) .catch((err)=>{ console.error(err); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getMovieList(callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t\tsort_by: \"release_date.desc\",\n\t\tpage: pageCounter\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_LIST, query, callback);\n}", "async function getMovies(ctx) {\n const currentDate = getCurrentDate();\n const movies = ctx.movies.find({ LastOnAir: currentDate });\n return movies.toArray();\n}", "function getMovie() {\n\n var omdbApi = require('omdb-client');\n\n var params = {\n apiKey: 'XXXXXXX',\n title: 'Terminator',\n year: 2012\n }\n omdbApi.get(params, function (err, data) {\n // process response...\n });\n}", "function getPopularMovies(){\n var url = \"https://api.themoviedb.org/3/movie/popular?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "async function getMovies() {\n // TODO: fetch movies from wp headless and call appendMovies\n // https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed\n}", "function getMovies() {\n console.log(\"fetching api\");\n fetch(\"https://imdb8.p.rapidapi.com/title/get-most-popular-movies?purchaseCountry=US&homeCountry=US&currentCountry=US\", {\n\t \"method\": \"GET\",\n\t \"headers\": {\n\t\t \"x-rapidapi-host\": \"imdb8.p.rapidapi.com\",\n\t\t \"x-rapidapi-key\": RAPID_API_KEY\n }\n })\n .then((resp) => resp.json())\n .then(resp => resp.slice(0,5))\n .then(resp => {\n setTimeout(displayMovies(resp), 1) // wait 1 sec before calling the other api because the api only supports 5 calls in 1 second.\n })\n}", "function getTopRatedMovies() {\n\n const path = '/movie/top_rated';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Top Rated Movies'});\n\n sectionMovies(url, render, handleError);\n\n}", "function getMovieList(lastMovie) {\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", host+\"movies.php\", true);\n\n\txhr.onreadystatechange = function() {\n\t if (xhr.readyState == 4) {\n\t\tvar movieList = [];\n\t var res = document.createElement('div');\n\t res.innerHTML = xhr.responseText;\n\t var moviesList = res.querySelectorAll('#movies > ul > li');\n\n\t if(moviesList.length < 1) {\n\t \tconsole.log(xhr.responseText);\n\t \treturn;\n\t }\n\n\t var latestMovie = -1;\n\t var latestMovieTitle = '';\n\t var notify = [];\n\t var notifIds = [];\n\n\t for (var i = 0; i < moviesList.length; i++) {\n\t \t/* Find the latest movie in the list */\n\t \tvar link = moviesList[i].childNodes[0].href;\n\t \tvar id = link.slice(link.indexOf('movie_id=')+9);\n\t \tvar name = moviesList[i].childNodes[1].innerText;\n\n\t \tif(latestMovie < parseInt(id)){\n\t\t\t\tlatestMovie = parseInt(id);\t\n\t\t\t\tlatestMovieTitle = name;\n\t\t\t}\n\t }\n\n\t\tfor (var i = 0; i < moviesList.length; i++) {\n\t\t\t/* Generate list of all movies after latest movie */\n\n\t\t\tvar link = moviesList[i].childNodes[0].href;\n\t\t\tvar id = link.slice(link.indexOf('movie_id=')+9);\n\t\t\tvar thumb = moviesList[i].childNodes[0].childNodes[0].src;\n\t\t\tvar name = moviesList[i].childNodes[1].innerText;\n\t\t\tvar imdb = moviesList[i].childNodes[2].innerText;\n\n\t\t\tthumb = thumb.slice(thumb.indexOf('movies/'));\n\t\t\tlink = link.slice(link.indexOf('moviehomepage.php'));\n\n\t\t\tif( (firstTime && parseInt(id) == latestMovie) || parseInt(id) > lastMovie) { \n\n\t\t\t\t/* Save list to generate notifications */\t\t\t\n\t\t\t\tnotifIds.push(id);\n\t\t\t\tnotify.push({\n\t\t\t\t\ttype:\"image\",\n\t\t\t\t\ticonUrl:'icon.png',\n\t\t\t\t\ttitle:moviesList[i].childNodes[1].innerText,\n\t\t\t\t\tmessage: \"New movie uploaded in MCA\\n\" + imdb,\n\t\t\t\t\timageUrl: host+thumb\n\t\t\t\t});\n\n\t\t\t\tfirstTime = false; // For showing one movie during first time\n\t\t\t}\n\n\t\t\t//generate movie list\n\t\t\tmovieList.push({\n\t\t\t\tid : id,\n\t\t\t\tname: name,\n\t\t\t\tlink: link,\n\t\t\t\tthumb: thumb,\n\t\t\t\timdb: imdb\n\t\t\t});\n\t\t}\n\n\t\t/*show notifications*/\n\t\tshowNotifications(notifIds, notify);\n\n\t\t/*\tstore last movie and disable first time*/\n\t\tchrome.storage.local.set({\n\t\t\t'lastMovie':latestMovie,\n\t\t\t'lastMovieName' : latestMovieTitle,\n\t\t\t'firstTime':false\n\t\t});\n\n\t\t// console.log(movieList);\n\t\tchrome.storage.local.set({'movieList':[]});\n\t\tchrome.storage.local.set({'movieList':movieList});\n\t }\n\t}\n\txhr.send();\n}", "function getMovies(movies) {\r\n return movies\r\n .filter((m) => m.year >= 2018 && m.rating > 4)\r\n .sort((a, b) => a.rating - b.rating)\r\n .reverse()\r\n .map((m) => m.title);\r\n}", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "function getAllMovies() {\n Movie.find()\n .then(allMovies => console.log('here are all the movies', allMovies))\n .catch(err => console.log('could not get all movies', err))\n}", "function moviesObjArr () {\n return fetch(moviesURL)\n .then(res => res.json())\n .catch(console.error)\n }", "function getPopularMovies() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"MOVIES\"][\"POPULAR\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movies.trigger('change');\n\t\t\t\t\t$.ptr.hide();\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function getListMovies(movie) {\n return groupByYear(sortByRating(converstionTime(movie)))\n}", "function getListMovies(movie) {\n return groupByYear(sortByRating(converstionTime(movie)))\n}", "async function getMovieResults({ movieId, title }) {\n await logger(`finding: ${title}`);\n\n const parameters = querystring.stringify({\n movieId,\n apiKey: config.radarr.apiKey,\n });\n\n const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`;\n return await getData({ uri: searchUrl });\n}", "function getMovie(title) {\n return $.getJSON('https://omdbapi.com?t={title}&apikey=thewdb');\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function movieSearch(movie, cb) {\n request(`http://www.omdbapi.com/?apikey=${omdbKey}&s=${movie}&page=${page}&type=movie&r=json`, function (error, response, body) {\n\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n\n return cb(JSON.parse(body));\n }\n\n });\n }", "async getMovies({ commit }, { query, pageNumber }) {\n const result = await apiService.getMovies(query, pageNumber);\n if (pageNumber === 1) {\n commit('updateResultCount', parseInt(result.totalResults, 10));\n }\n // get details for each movie\n const moviesWithDetails = await Promise.all(\n result.Search.map(async (movie) => {\n const movieDetails = await apiService.getMovieDetails(movie.imdbID);\n movieDetails.isLoading = false;\n return movieDetails;\n }),\n );\n commit('updateMovies', {\n data: moviesWithDetails,\n pageNumber,\n });\n }", "function movieThis(_movie) {\n query =\n \"http://www.omdbapi.com/?t=\" + _movie + \"&y=&plot=short&apikey=trilogy\";\n\n axios\n .get(query)\n .then(function(response) {\n var movieData = [];\n\n var title = response.data.Title;\n var year = \"Year produced: \" + response.data.Year;\n var imdb = \"IMDB rating: \" + response.data.imdbRating;\n var rt =\n response.data.Ratings.length > 1\n ? \"Rotten Tomatoes: \" + response.data.Ratings[1].Value\n : \"Rotten Tomatoes: N/A\";\n var country = response.data.Country;\n var plot = \"Plot: \" + response.data.Plot;\n var cast = \"Cast: \" + response.data.Actors;\n movieData.push(title, year, imdb, rt, country, plot, cast);\n\n printData(movieData);\n })\n .catch(function(error) {\n noResults();\n });\n}", "function movies() {\n //console.log('The Toy');\n \t\n \t\n \tfor (var i = 3; i < nodeArgs.length; i++) {\n\n \t\tvar movieTitle = \"\"; \n \t\tconsole.log()\n\n \t\tif (i >= 3 && i < nodeArgs.length) {\n \t\t\tmovieTitle = movieTitle + \"+\" + nodeArgs[i];\n \t\t}\n \n \t\telse {\n \t\t\tmovieTitle = movieTitle + nodeArgs[i];\n \t\t}\n \t}\n \tvar queryURL = 'http://www.omdbapi.com/?t=' + movieTitle +'&tomatoes=true&y=&plot=short&r=json';\n \t\n \t//these are so we can visualize our URL & user Input for debugging\n \tconsole.log(queryURL);\n \tconsole.log(movieTitle);\n \n \trequest(queryURL, function(error, response, body) {\n \n \t\tif (!error && response.statusCode == 200) {\n \t\t\tconsole.log(\"Title: \" + JSON.parse(body)[\"Title\"]);\t// Movie title\n \t\t\tconsole.log(\"Released: \" + JSON.parse(body)[\"Year\"]);\t// Movie Release Year\n \t\t\tconsole.log(\"IMDB Rating: \" + JSON.parse(body)[\"imdbRating\"]);\t// IMDB rating\n \t\t\tconsole.log(\"Country of Production: \" + JSON.parse(body)[\"Country\"]); //Production Country\n \t\t\tconsole.log(\"Movie Language: \" + JSON.parse(body)[\"Language\"]);\t//Movie Language\n \t\t\tconsole.log(\"Plot: \" + JSON.parse(body)[\"Plot\"]); //Movie Plot\n \t\t\tconsole.log(\"Cast: \" + JSON.parse(body)[\"Actors\"]);\t//Movie Cast\n \t\t\tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body)[\"tomatoRating\"]); //Rotten Tomatoes Rating\n \t\t\tconsole.log(\"Rotten tomatoes URL: \" + JSON.parse(body)[\"tomatoURL\"]); //Rotten tomatoes URL\n \t\t}\n \t\telse {\n \n \t\t}\n \t});\n }", "function getMovies (req, resp) {\n console.log(\"\\tgetMovies called\");\n var filter = sharedVars.parseFilter(req.swagger.params);\n getFilteredMovies(filter, function(getError, data) {\n if (getError) {// If an error occured, just say it failed\n sharedVars.sendError(resp, 500, 'Failed to get a list of movies.', data);\n } else {// If successful, send json back\n // Update analytics for all the movies\n console.log(\"\\tSending analytics for movie list...\");\n for(var movieIndex in data.entities) {\n sharedVars.sendAnalytic(data.entities[movieIndex].name);\n }\n if (!sharedVars.shouldGetReviews(req.swagger.params)) {\n // If no reviews needed, just return the data\n resp.json(data);\n\n } else {\n // Add reviews to each movie in the list\n console.log(\"\\t\\tAppending reviews to list...\");\n async.each(data.entities, function(movie, callback) { // Is called for each request\n // Manually ask for connections...\n getReviews(movie, function(revError, revData) {\n movie.reviews = revData;\n if (revError) // If couldn't append reviews to movie, report error\n callback(revData);\n else // If reviews appended successfully, return\n callback();\n });\n }, function(error) { // Is called after all requests are done\n if (error) { // If an error occurred, set error message\n resp.statusCode = 500;\n data.message = error;\n }\n resp.json(data);\n });\n }\n }\n });\n}", "async function fetchUpcomingMovies() {\n let response = await fetch(props.baseUrl + \"movies/?&status=PUBLISHED\", {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Cache-Control\": \"no-cache\",\n }\n })\n response = await response.json();\n setUpcomingMovies(response.movies);\n }", "function getLatest() {\n Paste.find({}).sort('-createdAt').limit(10).exec(function(err, result) {\n if (err) throw err;\n latest_pastes = result;\n //console.log('Scraped succesfully')\n //res.send(result);\n\t})\n}", "moviesList(){\n for (let i = 0; i < this.homeMovies.length; i++) {\n axios.get(`https://api.themoviedb.org/3/movie/${this.homeMovies[i].url}`, {\n params: {\n 'api_key': API_KEY,\n language: this.language,\n page: this.homeIndex,\n\n }\n }).then(now => {\n this.homeMovies[i].movies = now.data.results;\n });\n }\n }", "async function getMovie(){\n const movie = movieInput.value\n const movieUrl = `https://api.themoviedb.org/3/search/movie?api_key=${apiKey}&query=${movie}`;\n try{\n const response = await fetch(movieUrl);\n if(response.ok){\n const jsonResponse = await response.json();\n const topResult = jsonResponse.results[0];\n console.log(topResult);\n // render the description of the top result\n renderDescription(topResult);\n // get hero section movie title\n renderHeroMovieTitle(topResult);\n // ger the average vote for movie\n renderHeroMovieStars(topResult);\n // get the image of the top result\n getMovieImages(topResult);\n // get the trailer for the movie\n getMovieTrailer(topResult);\n // get the general info about a movie - for genres\n getMovieInfo(topResult);\n }\n }catch(error){\n console.log(error);\n }\n}", "async findTopRated() {\n let res = await axios.get(\n \"https://api.themoviedb.org/3/movie/top_rated?api_key=210d6a5dd3f16419ce349c9f1b200d6d&language=en-US&page=1\"\n );\n\n return res.data;\n }", "function movie() {\n //****************** OMDB movies API ********************\n var API2 = \"https://www.omdbapi.com/?t=\" + search + \"&y=&plot=short&apikey=trilogy\"\n\n axios.get(API2).then(\n function (response) {\n console.log(\"================================================\");\n console.log(\"Title of the Movie: \" + response.data.Title);\n console.log(\"Year Released: \" + response.data.Year);\n console.log(\"IMDB Rating: \" + response.data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country Produced in: \" + response.data.Country);\n console.log(\"Language of the Movie: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Cast: \" + response.data.Actors);\n }\n )\n}", "function fetchMovie() {\n axi.get(\"/api/v1\").then(r => setMovie(r.data.movie));\n }", "async function getMovies(query, start, end) {\n const movies = [];\n let apiURL = `${API_BASE}/titles/?${query}`;\n\n while (movies.length < end - start && apiURL) {\n const response = await fetch(apiURL);\n const data = await response.json();\n movies.push(...data.results);\n apiURL = data.next;\n }\n\n // We retrieve 5 by 5, if we want 7, we retrieve 10 and slice(0, 7) to have the 7 firsts\n // Way better than our previous version where we had to check if the number was a %5\n slicedMovies = movies.slice(start, end);\n movieDict = {};\n for (const movie of slicedMovies) {\n movieID = movie.id;\n movieDict[movieID] = { title: movie.title, image_url: movie.image_url };\n }\n console.log(movieDict);\n return movieDict;\n}", "async GetMovies( page = 1) {\n const data = await fetch(\n `${global.apiUrl}/popular?api_key=${global.apiKey}&language=${\n global.lang\n }&page=${page}`)\n\n const json = await data.json()\n return json\n }", "function getMovieDetail(imdbid) {\n return fetch(\"http://www.omdbapi.com/?apikey=cc5844e4&i=\" + imdbid)\n .then((response) => response.json())\n .then((result) => result);\n}", "function getMovie(id) {\n //Making changes is easy in the cloud and desktop!\n let url = 'https://www.omdbapi.com/?i='+id+'&apikey=CHANGEDONDESKTOPWITHCLOUDSPACESEXTENSION'\n return axios.get(url);\n}", "findMovie(movieName = \"Mr. Nobody\") {\n let query = [\n 'http://www.omdbapi.com/?',\n this.key,\n `t=${movieName}`,\n 'page=3',\n 'type=movie',\n 'r=json'\n ].join('&');\n\n console.log(`\\n=======\\nFinding the movie \"${movieName}\"`);\n this.request(query, (error, response, body) => {\n if (error) {\n console.log(\"ERROR: \", error);\n return;\n }\n\n const jsonObj = this.body2JSON(body);\n if (!jsonObj) return;\n\n console.log(`\\n=======\\nResult for the movie \"${movieName}\"`);\n this.printMovieInfo(jsonObj);\n });\n }", "function getMovieGenres () {\n var params = {\n url: 'https://api.themoviedb.org/3/genre/movie/list?&api_key=7af46ede7373e3339ef7980f35025ed3&language=en-US',\n cache: true\n };\n return servicesForProject.promiseGet(params);\n }", "async function getPopularMovies() {\n const popularMoviesUrl = getUrl(\"/movie/popular\");\n const result = await getData(`${popularMoviesUrl}`);\n\n state.movies.popular = result.results;\n\n return result;\n}", "function movie() {\n\t// Then run a request to the OMDB API with the movie specified\n\tvar queryURL = \"http://www.omdbapi.com/?t=\" + command2 + \"&y=&plot=short&apikey=40e9cece\";\n\trequest(queryURL, function (error, response, body) {\n\t\t// if the request is successful, run this\n\t\tif (!error && response.statusCode === 200) {\n\t\t\tconsole.log(\"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t\tconsole.log(\" \");\n\t\t\tconsole.log(queryURL);\n\t\t\tconsole.log(\"\\nMovie Title: \" +command2);\n\t\t\tconsole.log(\"Actors in the movie: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"Release Year: \" + JSON.parse(body).Year);\n\t\t\tconsole.log(\"Country where the movie is produced: \" + JSON.parse(body).Country);\n\t\t\tconsole.log(\"Language of the movie: \" + JSON.parse(body).Language);\n\t\t\tconsole.log(\"\\nPlot of the movie: \" + JSON.parse(body).Plot);\n\t\t\tconsole.log(\"\\nThe IMDB rating is: \" + JSON.parse(body).imdbRating);\n\t\t\tconsole.log(\"Rotten Tomatoes rating is: \" + JSON.parse(body).Ratings[2].Value);\n\t\t\tconsole.log(\"\\nXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\")\n\t\t}\n\t});\n}", "function getTheatreMovies() {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/now_playing?api_key=\" +\n API_KEY +\n \"&language=en-US&region=US\";\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let theatreMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n theatreMovies.push(response.results[i].title);\n }\n console.log(theatreMovies);\n });\n}", "function getMovie(){\r\n movieId = sessionStorage.getItem('movieId');\r\n axios.get('https://api.themoviedb.org/3/movie/'+movieId+'?api_key=7719d9fc54bec69adbe2d6cee6d93a0d&language=en-US')\r\n .then((response) => {\r\n imdbId = response.data.imdb_id;\r\n axios.get('http://www.omdbapi.com?apikey=c1c12a90&i='+imdbId)\r\n .then((response1) => {\r\n console.log(response1);\r\n let movie = response1.data;\r\n let output = '';\r\n const dict = {\r\n 'Jan': 1,\r\n 'Feb': 2,\r\n 'Mar': 3,\r\n 'Apr': 4,\r\n 'May': 5,\r\n 'Jun': 6,\r\n 'Jul': 7,\r\n 'Aug': 8,\r\n 'Sep': 9,\r\n 'Oct': 10,\r\n 'Nov': 11,\r\n 'Dec': 12\r\n };\r\n var arr = movie.Released.split(\" \");\r\n var today = new Date();\r\n var t = new Date(today.getFullYear()+','+(today.getMonth()+1)+','+today.getDate());\r\n var r = new Date(arr[2]+','+dict[arr[1]]+','+arr[0]);\r\n if(movie.Poster != null){\r\n output += `\r\n <h1 class=\"my-4 heading\">${movie.Title}</h1>\r\n\r\n <div class=\"row\">\r\n\r\n <div class=\"col-md-5\">\r\n <img style=\"\" class=\"img-fluid\" src=\"${movie.Poster}\" alt=\"\">\r\n </div>\r\n\r\n <div class=\"col-md-7\">\r\n <ul class=\"list-group\">\r\n <li class=\"list-group-item\"><strong>Genre: </strong>${movie.Genre}</li>\r\n <li class=\"list-group-item\"><strong>Released: </strong>${movie.Released}</li>\r\n <li class=\"list-group-item\"><strong>Rated: </strong>${movie.Rated}</li>\r\n <li class=\"list-group-item\"><strong>IMDB Rating: </strong>${movie.imdbRating}</li>\r\n <li class=\"list-group-item\"><strong>Director: </strong>${movie.Director}</li>\r\n <li class=\"list-group-item\"><strong>Writer: </strong>${movie.Writer}</li>\r\n <li class=\"list-group-item\"><strong>Actors: </strong>${movie.Actors}</li>\r\n </ul>\r\n <li class=\"list-group-item\"><strong>Overview: </strong>${movie.Plot}</li>\r\n <a href=\"http://imdb.com/title/${movie.imdbID}\" target=\"blank\" class=\"btn btn-primary\">View IMDB</a> `+\r\n (t > r ? `<a href=\"#\" onClick=\"addMovie(${movieId}, ${1})\" class=\"btn btn-primary\">Add to Watched</a> ` : ``)\r\n +`\r\n <a href=\"#\" onClick=\"addMovie(${movieId}, ${0})\" class=\"btn btn-primary\">Add to Wished</a>\r\n </div>\r\n\r\n </div>\r\n `\r\n }\r\n $('#movieSingle').html(output);\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n })\r\n .catch((err) => {\r\n console.log(err.message);\r\n });\r\n}", "function fetchMovieDB (cb) {\n fetch(makeUrl(), function (err, res) {\n if (err) { cb(err); }\n cb(null, { name:res.results[random(19)].title });\n });\n }", "async function getMoviesInfos(movieID) {\n const extraInfos = [];\n // const urlBase = \"http://localhost:8000/api/v1/titles/\";\n // alert(movieID);\n const url = `http://localhost:8000/api/v1/titles/${movieID}`;\n const response = await fetch(url);\n // alert(apiURL);\n const data = await response.json();\n console.log(data);\n return data;\n}", "function getMovie(movie) {\n\tif (!movie) {\n\t\tmovie = \"Mr. Nobody\"\n\t}\n\n\trequest(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=40e9cece\", function(error, response, body) {\n\n\t\t\t// If the request is successful (i.e. if the response status code is 200)\n\t\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parse the body of the site and recover just the imdbRating\n\t\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it).\n\t\t\tvar result = \"Title: \" + JSON.parse(body).Title + \"\\n\" +\n\t\t\t\t\t\"Year: \" + JSON.parse(body).Year + \"\\n\" +\n\t\t\t\t\t\"IMDB Rating: \" + JSON.parse(body).imdbRating + \"\\n\" +\n\t\t\t\t\t\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value + \"\\n\" +\n\t\t\t\t\t\"Country: \" + JSON.parse(body).Country + \"\\n\" +\n\t\t\t\t\t\"Lang: \" + JSON.parse(body).Language + \"\\n\" +\n\t\t\t\t\t\"Plot: \" + JSON.parse(body).Plot + \"\\n\" +\n\t\t\t\t\t\"Actors: \" + JSON.parse(body).Actors ;\n\t\t\tconsole.log(result)\n\t\t\treturn result\n\t\t\t\t \n\n\t\t\t}\n\t\t\t});\n\n}", "async function fetchMovies() {\r\n let response = await fetch(' https://api.themoviedb.org/3/movie/popular?api_key=f485e5c815c3b8ee3e79e1f1309aa1b1&language=en-US&page=1');\r\n\r\n\r\n if (response.status === 200) {\r\n let data = await response.json();\r\n\r\n console.log(data.results);\r\n showMovise(data.results);\r\n\r\n } else {\r\n\r\n\r\n console.log(response.status); // 400\r\n console.log(response.statusText); // Not Found\r\n\r\n }\r\n}", "function getMovieInfo(movie) {\n // If no movie is provided, get the deets for Mr. Nobody\n if (movie === \"\") {\n movie = \"Mr. Nobody\";\n }\n // Variable to hold the query URL\n let queryURL = \"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&apikey=trilogy\";\n // API request\n request(queryURL, function (error, response, body) {\n let movieResponse = JSON.parse(body);\n if (error || movieResponse.Response == \"False\") {\n console.log(\"Something went wrong. Try again?\", error);\n }\n else {\n let arrLog = [];\n arrLog.push(\"Title: \" + movieResponse.Title);\n arrLog.push(\"Year: \" + movieResponse.Year);\n arrLog.push(\"IMDB Rating: \" + movieResponse.Ratings[0].Value);\n arrLog.push(\"Rotten Tomatoes Rating: \" + movieResponse.Ratings[1].Value);\n arrLog.push(\"Produced in: \" + movieResponse.Country);\n arrLog.push(\"Language: \" + movieResponse.Language);\n arrLog.push(\"Plot: \" + movieResponse.Plot);\n arrLog.push(\"Actors: \" + movieResponse.Actors);\n arrLog.push(logSeparator);\n logAndStoreResults(arrLog);\n }\n });\n}", "function getMovie(movie) {\n\tvar options = { \n\t method: 'GET',\n\t \turl: 'https://api.themoviedb.org/3/search/movie',\n\t \tqs: \n\t \t\t{ \n\t \t\tquery: movie,\n\t \tlanguage: 'en-US',\n\t \tapi_key: API_KEY},\n\t \t\theaders: { 'content-type': 'application/json', 'User-Agent': 'Request-Promise'\n\t \t\t},\n\t \tbody: {},\n\t \tjson: true \n\t};\n\treturn rp(options) //return a promise\n}", "function getMovie(movieName) {\n axios.get(`http://www.omdbapi.com/?t=${movieName}&apikey=trilogy`)\n .then(function(movie){\n console.log(\"\");\n console.log(\n `Title: ${movie.data.Title}\\n`,\n `Released: ${movie.data.Year}\\n`,\n `Rating from IMDB: ${movie.data.Ratings[0].Value}\\n`,\n `Country of origin: ${movie.data.Country}\\n`,\n `Plot: ${movie.data.Plot}\\n`,\n `Cast: ${movie.data.Actors}\\n`\n )\n })\n .catch(function(err){\n console.log(err)\n });\n}", "async function fetchReleasedMovies(filters = \"\") {\n let apiUrl = `${props.baseUrl}movies/?status=RELEASED`\n if (filters) {\n apiUrl += filters\n }\n let response = await fetch(apiUrl, {\n method: \"GET\",\n headers: {\n \"Content-Type\": \"application/json\",\n \"Cache-Control\": \"no-cache\",\n }\n })\n response = await response.json();\n setReleasedMovies(response.movies);\n }", "async fetchSpecificMovie(ctx, payload) {\n let specificSearchResult = [];\n let result = [];\n await axios.get('http://www.omdbapi.com/?apiKey='+ key.key + '&t='+ payload.searchReplaced + '&y=' + payload.year).then((response) => { specificSearchResult = response.data });\n result.push(specificSearchResult);\n ctx.commit('setSearchResult', result);\n ctx.commit('setSearchResponse', result[0].Response);\n }", "getMovies() {\n let movies = []\n return fetch(`https://swapi.co/api/films`)\n .then(res => res.json())\n .then(body => body.results.forEach(movie => movies.push(movie)))\n .then(() => {\n return movies\n })\n .catch(error =>\n this.setState({\n error: \"Couldn't load movies :(\",\n isLoadingMovies: false\n })\n )\n }", "function getGenres(){\n var url = \"http://api.themoviedb.org/3/genre/movie/list?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function getOMDB(movieName) {\n request('http://www.omdbapi.com/?t=' + movieName + '&r=json&apikey=trilogy&', function (error, response, body) {\n if (error) {\n return console.log('Error occurred: ' + error);\n }\n var data = JSON.parse(body);\n console.log('Movie Title:', data.Title);\n console.log('Year Released:', data.Year);\n console.log('IMDB Rating:', data.Ratings[0].Value);\n console.log('Rotten Tomatoes Rating:', data.Ratings[1].Value);\n console.log('Country:', data.Country);\n console.log('Language:', data.Language);\n console.log('Plot:', data.Plot);\n console.log('Actors:', data.Actors);\n });\n}", "function getSimilarMovies(searchInput, maxResults) {\n\n const parameters = {\n api_key: tmdbKey,\n language: \"en-US\",\n query: searchInput,\n page: 1,\n }\n const queryString = formatTmdbQueryParams(parameters);\n const tmdbSearchURL = \"https://api.themoviedb.org/3/search/movie/?\"\n const similarURL = tmdbSearchURL + queryString;\n\n fetch(similarURL).then(response => {\n if(response.ok) {\n return response.json();\n } throw new Error(\"Oh the HORROR! Something went wrong :(\")\n }).then(responseJson => { \nconsole.log(`responseJson is:`, responseJson);\n if(responseJson.hasOwnProperty(\"0\")) {\n throw new Error(responseJson.Error);\n }\n let results = responseJson.results;\n let titles = results.map(item => item[\"title\"]);\n //for each result, display the title per the displaySimilarMovies function them in a list item\n displaySimilarMovies(titles, maxResults) \n }).catch(err => {\nconsole.log(`err is ${err}`)\n handleUndefined()\n });\n }", "function getNowPlayingMovies() {\n\n const path = '/movie/now_playing';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Now Playing Movies'});\n\n sectionMovies(url, render, handleError);\n\n\n}", "async function getMovie(imdbID) {\n const params = { apiKey, i: imdbID, plot: 'full' };\n // logger.debug(params);\n const response = await axios.get(omdbUrl, { params });\n logResponse(response);\n return response.data;\n}", "function movieThis(){\n\tif (movie === undefined) {\n\tmovie = 'Mr.Nobody';\n\t};\n\tvar url = 'http://www.omdbapi.com/?t=' + movie +'&y=&plot=long&tomatoes=true&r=json';\n\trequest(url, function(error, body, data){\n \t\tif (error){\n \t\t\tconsole.log(\"Request has returned an error. Please try again.\")\n \t\t}\n \tvar response = JSON.parse(data);\n\t\tconsole.log(\"******************************\")\n\t\tconsole.log(\"Movie title: \" + response.Title);\n\t\tconsole.log(\"Release Year: \" + response.Year);\n\t\tconsole.log(\"IMDB Rating: \" + response.imdbRating);\n\t\tconsole.log(\"Country where filmed: \" + response.Country);\n\t\tconsole.log(\"Language: \" + response.Language);\n\t\tconsole.log(\"Movie Plot: \" + response.Plot);\n\t\tconsole.log(\"Actors: \" + response.Actors);\n\t\tconsole.log(\"Rotten Tomatoes URL: \" + response.tomatoURL);\n\t\tconsole.log(\"******************************\")\n\t});\n}", "function getMovie(b){\n\n // Test to see if OMDB is working properly;\n // console.log(\"OMDB Works!\");\n\n checkConfirm();\n\n // Paste the sample code from npm\n omdb.search(b, function(err, movies) {\n \n if(err) {\n \n return console.error(err);\n \n }\n \n if(movies.length < 1) {\n \n return console.log('No movies were found!');\n \n }\n \n movies.forEach(function(movie) {\n \n omdb.get({ title: movie.title }, true, function(err, particularMovie) {\n\n if(err) {\n \n return console.error(err);\n \n }\n \n if(!movie) {\n \n return console.log('Movie not found!');\n \n }\n\n // console.log(\"line 203\", particularMovie);\n \n console.log(\"=======================================================================\");\n\n console.log('%s', \"Movie: \" + particularMovie.title );\n\n console.log(\"\");\n\n console.log('%s', \"Released on: \" + particularMovie.year );\n\n console.log(\"\");\n\n console.log('%s', \"Rated: \" + particularMovie.rated );\n\n console.log(\"\");\n\n console.log('%s', \"Genres: \" + particularMovie.genres );\n\n console.log(\"\");\n\n console.log('%s', \"Director: \" + particularMovie.director );\n\n console.log(\"\");\n\n console.log('%s', \"Actors: \" + particularMovie.actors );\n\n console.log(\"\");\n\n console.log('%s', \"Plot: \" + particularMovie.plot );\n\n console.log(\"\");\n\n console.log('%s', \"Rating of Movie: \" + particularMovie.imdb.rating );\n\n console.log(\"\");\n\n console.log(\"=======================================================================\");\n\n console.log(\"\");\n\n console.log(\"\");\n\n });\n\n \n \n });\n \n\n});\n\n}", "function getOMDB(movie='Mr. Nobody') {\n\tvar vImdbRating=\"\";\n\t// console.log('move is ', movie);\n\t// console.log(\"OMDB function ran\");\n\t// console.log('request string ', (omdb1+movie+omdb2));\n\tRequest(omdb1+encodeURI(movie)+omdb2)\n\t\t.then(function(data){\n\t\t\tvar parseData=JSON.parse(data);\n\t\t\t// console.log('parseData ', parseData);\n\t\t\tfor (i in parseData.Ratings) {\n\t\t\t\t// console.log('i is ', i);\n\t\t\t\tif (parseData.Ratings[i].Source===\"Rotten Tomatoes\") {\n\t\t\t\t\tvImdbRating = (parseData.Ratings[i].Value);\n\t\t\t\t\t// console.log(\"Rotten tomatoe true\", \" \", parseData.Ratings[i].Source, \" \", parseData.Ratings[i].Value );\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t// console.log('vImdbRating', vImdbRating);\n\t\t\t// console.log('data ', data);\n\t\t console.log(\"\\n\\n\" + \"OMDB MOVIE RESULTS\".black.bgMagenta + \"\\n\");\t\t\t\n\n\t\t\tconsole.log(`Title ${JSON.parse(data).Title} | Released ${JSON.parse(data).Year}`.black.bgWhite);\t\t\t\n\t\t\tconsole.log(`IMDB Rating ${JSON.parse(data).imdbRating} | Rotten Tomatoes Rating ${vImdbRating}`);\n\t\t\tconsole.log(`Production Country(w) ${parseData.Country} | Language ${parseData.Language}`);\n\t\t\tconsole.log(`Plot: ${parseData.Plot}`.white);\n\t\t\tconsole.log(`Actors: ${parseData.Actors}`.inverse);\n\t\t}, function(err) {\n\t\t\tconsole.log('response ', response);\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\t\t\t\n\t\t});\n}", "function getMovie(movieName) {\n\n // If no movie name, do a search for Mr.Nobody\n if (!movieName) {\n var movieName = \"Mr. Nobody\";\n }\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=full&tomatoes=true&apikey=[key]\";\n axios.get(queryURL).then(\n function (response) {\n\n // Movie info\n console.log(`Title: ${response.data.Title}\nYear: ${response.data.Year}\nRated: ${response.data.Rated}\nRotten Tomatoes Rating: ${response.data.tomatoRating}\nCountry Produced in: ${response.data.Country}\nLanguage: ${response.data.Language}\nPlot: ${response.data.Plot}\nActors: ${response.data.Actors}`\n );\n }\n )\n}", "function movieThis (movie) {\n if (movie === undefined) {\n movie = \"Mr. Nobody\";\n }\n\n var movieURL = \"http://www.omdbapi.com/?t=\"+ movie +\"&apikey=trilogy\";\n request(movieURL, function (error, response, body) {\n var parseBody = JSON.parse(body);\n // console.log(\"ENTIRE MOVIE OBJECT: \" + JSON.stringify(parseBody));\n console.log(\"Title of Movie: \" + parseBody.Title + \"\\nYear Released: \" + parseBody.Released + \"\\nIMBD Rating: \" + parseBody.imdbRating\n + \"\\nRotten Tomatoes Rating: \" + parseBody.Ratings[1].Value+ \"\\nCountry Produced: \" + parseBody.Country + \"\\nLanguage: \" + parseBody.Language\n + \"\\nPlot: \" + parseBody.Plot + \"\\nActors: \" + parseBody.Actors);\n });\n}", "function getMovieDetails(id, callback){\n\tconst query = {\n\t\tapi_key: TMDB_API_AUTH.KEY,\n\t};\n\t$.getJSON(TMDB_SEARCH_URL_MOVIES_DETAILS+id, query, callback);\n}", "async function currentMovies(){\r\n currentResponse = await fetch(\"https://api.themoviedb.org/3/movie/now_playing?api_key=\" + APIkey + \"&language=en-US&page=\" + currentPageNum)\r\n console.log(currentPageNum);\r\n currentResponseData = await currentResponse.json();\r\n console.log(currentResponseData)\r\n displayResults(currentResponseData);\r\n}", "function getMovieInfo(movieTitle) {\n\n\t// Runs a request to the OMDB API with the movie specified.\n\n\tvar queryUrl = \"http://www.omdbapi.com/?s=\" + movieTitle + \"&y=&plot=short&tomatoes=true&r=json&apikey=trilogy\";\n\n\tomdb(queryUrl, function (error, response, body) {\n\t\t// console.log(\"Here\",body)\n\n\t\tif (error) {\n\t\t\tconsole.log(error)\n\t\t}\n\n\t\t// If the request is successful...\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t\t\t// Parses the body of the site and recovers movie info.\n\n\t\t\tvar movie = JSON.parse(body);\n\n\t\t\t// Prints out movie info form omdb server.\n\n\t\t\tlogOutput(\"Movie Title: \" + movie.Title);\n\n\t\t\tlogOutput(\"Release Year: \" + movie.Year);\n\n\t\t\tlogOutput(\"IMDB Rating: \" + movie.imdbRating);\n\n\t\t\tlogOutput(\"Country Produced In: \" + movie.Country);\n\n\t\t\tlogOutput(\"Language: \" + movie.Language);\n\n\t\t\tlogOutput(\"Plot: \" + movie.Plot);\n\n\t\t\tlogOutput(\"Actors: \" + movie.Actors);\n\n\t\t\t// Had to set to array value, as there seems to be a bug in API response,\n\n\t\t\t// that always returns N/A for movie.tomatoRating.\n\n\t\t\tlogOutput(\"Rotten Tomatoes Rating: \" + movie.Ratings[2].Value);\n\n\t\t\tlogOutput(\"Rotten Tomatoes URL: \" + movie.tomatoURL);\n\n\t\t}\n\n\t});\n\n}", "async loadTopMovies({ commit }) {\n await this.$axios.get(`api/movie_scores`).then(response => {\n commit(\"SET_MOVIES_TOP\", response.data);\n });\n }", "function movie() {\n if (process.argv[3]) {\n var movieName = process.argv[3];\n } else {\n var movieName = 'mr nobody';\n }\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = 'http://www.omdbapi.com/?t=' + movieName + '&y=&plot=short&apikey=' + omdb_key;\n // Then run a request to the OMDB API with the movie specified\n request(queryUrl, function(error, response, body) {\n // If the request is successful \n if (!error && response.statusCode === 200) {\n var data = JSON.parse(body);\n // Then log info about the movie\n console.log('movie: ' + data.Title);\n console.log('year released: ' + data.Year);\n console.log('imdb rating: ' + data.Ratings[0].Value);\n console.log('rt rating: ' + data.Ratings[1].Value);\n console.log('country: ' + data.Country);\n console.log('language: ' + data.Language);\n console.log('plot: ' + data.Plot);\n console.log('actors: ' + data.Actors);\n } else {\n return console.log('error: ' + error);\n }\n });\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function movie(){\n\n /**You can follow the in-class request exercise for this**/\n console.log(\"Movie Time!\");\n\n var movieSearch;\n if(search === undefined){\n movieSearch = \"Sharknado\";\n }\n else{\n movieSearch = search;\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieSearch + \"&y=&plot=short&apikey=40e9cece\";\n console.log(\"movie time?\");\n request((queryUrl), function(error,response,body){\n console.log(\"got hear\");\n if(!error && response.statusCode === 200){\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors & Actresses: \" + JSON.parse(body).Actors);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).tomatoRating);\n console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n }\n });\n}", "function listMovies() {\n fetch(url)\n .then((response) => response.json())\n .then((data) => {\n for (let movie of data) {\n console.log(movie, \"movie\");\n createMovieBox(movie);\n }\n });\n}", "function movie() {\n\n // Then run a request to the OMDB API with the movie specified\n var queryUrl = \"http://www.omdbapi.com/?t=\" + userInput + \"&y=&plot=short&apikey=40e9cece\";\n\n //console.log(queryUrl);\n\n request(queryUrl, function(error, response, body) {\n\n //console.log(response);\n if (error) throw error;\n\n if (!error && response.statusCode === 200) {\n\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Country: \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n // console.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).Year); --doesnt have it\n }\n });\n}", "function getMovies() {\n return (dispatch) => {\n dispatch(request());\n dispatch(success(feedData));\n\n /**\n * If API is available, we could use below code for API call.\n */\n\n // movieService.getMoives()\n // .then((res) => {\n // dispatch(success(res));\n // })\n // .catch((err) => {\n // dispatch(failure(err));\n // });\n };\n\n function request(data) {\n return {type: movieConstants.MOVIE_REQUEST, data};\n }\n function success(data) {\n return {type: movieConstants.MOVIE_SUCCESS, data};\n }\n // function failure(err) {\n // return {type: movieConstants.MOVIE_FAILURE, err};\n // }\n}", "function getMovies() {\n var movieSearch = process.argv.slice(3).join(\" \");\n var queryURL = \"http://www.omdbapi.com/?apikey=trilogy&t=\" + movieSearch;\n axios\n .get(queryURL)\n .then(function(response) {\n //Function for Response of movies.\n //console.log(response);\n var searchRes = response.data;\n console.log(\"Movie Title: \" + searchRes.Title + \n \"\\nReleased In: \" + searchRes.Year + \n \"\\nIMDB Rating: \" + searchRes.imdbRating + \n \"\\nRotten Tomatoes Rating: \" + searchRes.Ratings[1].Value + \n \"\\nCountry where movie was produced: \" + searchRes.Country + \n \"\\nLanguage: \" + searchRes.Language + \n \"\\nPlot: \" + searchRes.Plot + \n \"\\nActors: \" + searchRes.Actors);\n console.log(\"------------------------------------------\");\n })\n //Function for ERRORS\n .catch(function(error) {\n if (error.response) {\n console.log(error.response.data);\n console.log(\"------------------------------------------\");\n }\n })\n}", "async function getLatestVideos(upId, vidCount){\n const getReqTemp = `https://www.googleapis.com/youtube/v3/playlistItems?playlistId=${upId}&key=${keys.apiKey}&part=snippet,contentDetails&maxResults=${vidCount}`\n\n const response = await fetch(getReqTemp)\n const data = await response.json()\n const videos = data.items\n\n return videos\n\n}", "async getMovies({ commit, dispatch }, query) {\n try {\n let res = await api.get(urlParams + query)\n //NOTE the mutations are generally named 'set' something \n commit('setMovies', res.data.results)\n } catch (error) {\n console.error(error)\n }\n }", "function movieSearch(movie)\n{\n request(\"http://www.omdbapi.com/?t=\" + movie + \"&y=&plot=short&tomatoes=true&r=json\", function (error, response, body) {\n console.log('error:', error); // Print the error if one occurre\n console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received\n console.log('body:', body); // Print the HTML for the Google homepage.\n console.log(body.title);\n console.log(response.title);\n});\n}", "function omdb(input) {\n if (!input) {\n input = \"Mr. Nobody\";\n }\n input = input.replace(' ', '+');\n var queryUrl = \"http://www.omdbapi.com/?t=\" + input + \"&y=&plot=short&apikey=trilogy\";\n\n console.log(queryUrl);\n\n request(queryUrl, function (error, response, body) {\n var data = JSON.parse(body)\n var movie = [];\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n movie.push({\n \"Title\": data.Title,\n \"Release Year\": data.Year,\n \"IMDB Rating\": data.imdbRating,\n \"Rotten Tomatoes Rating\": data.Ratings[1].Value,\n \"Country\": data.Country,\n \"Language\": data.Language,\n \"Plot\": data.Plot,\n \"Actors\": data.Actors\n\n })\n\n console.log(\"Title: \" + data.Title)\n console.log(\"Release Year: \" + data.Year);\n console.log(\"IMDB Rating: \" + data.imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + data.Ratings[1].Value);\n console.log(\"Country: \" + data.Country);\n console.log(\"Language: \" + data.Language);\n console.log(\"Plot: \" + data.Plot);\n console.log(\"Actors: \" + data.Actors);\n\n logData(movie);\n\n }\n\n })\n}", "function movieThis(movieName) {\n var queryUrl =\n \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Console log all necessary data points\n console.log(JSON.parse(body));\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"Rated: \" + JSON.parse(body).Rated);\n console.log(\n \"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value\n );\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Produced In: \" + JSON.parse(body).Country);\n console.log(\"Laguage: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n}", "static getMoviesById(id) {\n return axios(withBaseUrl(`movie/${id}`));\n /* chamando essa rota https://developers.themoviedb.org/3/movies/get-movie-details */\n }", "function getMovies(req,res){\n token = req.headers['authorization'];\n jwt.verify(token, req.app.get('private-key'), function (err,decoded) {\n if(err){\n res.send(err,401).json({error:\"Invalid token\"});\n }else {\n movie.getMovies(req,function (err, movies) {\n if(err === 400){\n res.send(err,400);\n }\n else if (err !== 400 && err !== null) {\n res.send(err,404);\n }\n else {\n res.json(movies);\n }\n });\n }\n });\n\n}", "async function getAllMovies(url) {\n try {\n let response = await fetch(url);\n let movieData = await response.json();\n return movieData;\n } catch (error) {\n console.log(error);\n }\n}", "function allMovies(db) {\n const sql = 'SELECT DISTINCT * FROM MOVIES'\n db.all(sql, function (err, rows) {\n rows.forEach(function (row) {\n console.log(row);\n })\n });\t\n}", "function movieThis(movie) {\n\n if (movie.length === 0) {\n var queryURL = \"http://www.omdbapi.com/?t=\" + \"Mr.Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n } else {\n var queryURL = \"http://www.omdbapi.com/?t=\" + searchQuery + \"&y=&plot=short&apikey=trilogy\";\n }\n\n // axios method to recieve and print data\n axios.get(queryURL).then(function (response) {\n console.log(\"Movie Title: \" + response.data.Title);\n console.log(\"Year: \" + response.data.Year);\n console.log(\"IMBD Rating: \" + response.data.Ratings[0].Value);\n console.log(\"Rotten Tomatoes Rating: \" + response.data.Ratings[1].Value);\n console.log(\"Country: \" + response.data.Country);\n console.log(\"Language: \" + response.data.Language);\n console.log(\"Plot: \" + response.data.Plot);\n console.log(\"Actors: \" + response.data.Actors);\n }\n\n );\n}", "function gotAllMovies(err) {\n console.log(\"gotAllMovies()\");\n\n // report an error, you'd want to do something better than this in production\n if (err) {\n console.log(\"error loading movies\");\n console.error(err);\n return;\n }\n\n showMovies();\n}", "function getAvailableMovies(req, res, next) {\n movieRepository.findAvailables().then((result) => {\n res.status(200).send(result);\n }).catch(next);\n}", "function movieSearch(movie){\n if(!movie){\n var movieName = \"Mr. Nobody\";\n } else{\n movieName = movie;\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(err, response, body){\n\n if(!err && response.statusCode === 200){\n\n //need to look at responses from IMDB, responses seem to change based on the movie\n //also if possible add some input validation\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n console.log(\"Release date: \" + JSON.parse(body).Year);\n console.log(\"Rating: \" + JSON.parse(body).imdbRating);\n //rotten tomatoes rating\n if(JSON.parse(body).Ratings[1]){\n console.log(\"Rotten tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n }\n console.log(\"Produced in \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n \n } else{\n\n console.log(err);\n }\n\n\n });\n \n\n\n}", "function movieThis(option1) {\n if (typeof option1 === \"undefined\") {\n option1 = \"Mr. Nobody\"\n }\n var queryUrl = \"http://www.omdbapi.com/?t=\" + option1 + \"&y=&plot=short&apikey=trilogy\"\n\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n\n console.log();\n console.log(\"Movie\");\n console.log(\"=====\");\n movie = JSON.parse(body);\n console.log(movie.Title);\n console.log(movie.Year);\n console.log(movie.Language);\n console.log(\"Made in: \" + movie.Country);\n console.log(\"Ratings\");\n movie.Ratings.forEach(element => {\n if (element.Source === 'Internet Movie Database') {\n console.log(\" IMDB: \" + element.Value);\n }\n if (element.Source === 'Rotten Tomatoes') {\n console.log(\" Rotten Tomatoes: \" + element.Value);\n }\n });\n console.log(\"Starring\");\n movie.Actors.split(\",\").forEach(element => {\n console.log(\" \" + element.trim());\n })\n console.log(movie.Plot);\n }\n });\n\n}", "function getMovie() {\n // import the request package\n var request = require(\"request\");\n // call to OMDB API\n if (process.argv[3] === undefined) {\n var queryUrl = \"http://www.omdbapi.com/?t=\" + \"Mr.\" + \"Nobody\" + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n } else {\n var movieName = process.argv[3]\n var queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n request(queryUrl, function(error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover necessary output\n console.log(\"Title: \" + JSON.parse(body).Title);\n console.log(\"Release Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n console.log(\"Production Country: \" + JSON.parse(body).County);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n }\n });\n }\n}", "function movie(movieName){\n\tvar request = require('request');\n\n\tvar nodeArgs = process.argv;\n\n\tvar movieName = \"\";\n\n\tif (process.argv[3] == null){\n\n\t\tmovieName = \"Mr.Nobody\";\n\n\t}else{\n\n\t\tfor (var i=3; i<nodeArgs.length; i++){\n\n\t\t\tif (i>3 && i< nodeArgs.length){\n\n\t\t\tmovieName = movieName + \"+\" + nodeArgs[i];\n\n\t\t\t}\n\n\t\t\telse {\n\n\t\t\tmovieName = movieName + nodeArgs[i];\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\trequest('http://www.omdbapi.com/?t='+ movieName + '&y=&plot=short&r=json&tomatoes=true', function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n\t\n\tif (!error && response.statusCode == 200) {\n\t\t\n\t\t// Parse the body of the site and recover just the imdbRating\n\t\t// (Note: The syntax below for parsing isn't obvious. Just spend a few moments dissecting it). \n\t\tconsole.log( \"The movie title: \" + JSON.parse(body)[\"Title\"] +\n\t\t\t\"\\nThe movie release year: \" + JSON.parse(body)[\"Year\"] +\n\t\t\t\"\\nThe movie imdb rating: \" +JSON.parse(body)[\"imdbRating\"] +\n\t\t\t\"\\nThe movie Country of origin: \" +JSON.parse(body)[\"Country\"] +\n\t\t\t\"\\nThe movie language: \" +JSON.parse(body)[\"Language\"] +\n\t\t\t\"\\nThe movie plot: \" +JSON.parse(body)[\"Plot\"] +\n\t\t\t\"\\nThe movie actors: \" +JSON.parse(body)[\"Actors\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes score: \" +JSON.parse(body)[\"tomatoMeter\"] +\n\t\t\t\"\\nThe movie Rotten Tomatoes url: \" +JSON.parse(body)[\"tomatoURL\"]);\n\t\t}\n\t});\n}", "async function getMoviesSearch(query) {\n let response = await fetch(\n `https://api.themoviedb.org/3/search/movie?api_key=${client_key}&language=en-US&page=1&include_adult=${includeAdult}&query=${query}`\n );\n let data = await response.json();\n return data;\n}", "function movieSearch() {\n var encodeName = encodeURI(searchName);\n request(\"http://www.omdbapi.com/?t=\" + encodeName + \"&y=&plot=short&r=json\", function(error, response, body) {\n\tif (!error && response.statusCode === 200) {\n\t //console.log(JSON.parse(body));\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t // year\n\t console.log(\"Year Released: \" + JSON.parse(body).Year);\n\t // imdb rating\n\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t // country produced\n\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t // language of movie\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t // plot\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t // actors\n\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t // rotten tomatoes rating\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t // rotten tomotoes url\n\t console.log(\"Rotten Tomatoes: https://www.rottentomatoes.com/search/?search=\" + encodeName);\n\t} else {\n\t console.log(error);\n\t}\n });\n} // close movie search", "function searchSimilarMovies(movieID) {\n let queryURL =\n \"https://api.themoviedb.org/3/movie/\" +\n movieID +\n \"/similar?api_key=\" +\n API_KEY +\n \"&language=en-US\";\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n console.log(response);\n let similarMovies = [];\n for (let i = 0; i < response.results.length; i++) {\n similarMovies.push(response.results[i].title);\n }\n console.log(similarMovies);\n return similarMovies;\n });\n}", "function getTheMovieDatabase() {\n fetch(urlForm)\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n printItemList(data.results);\n });\n}", "function modelGetAllMovies() {\n return movieList;\n}", "async fetchDataFromApi(movieIndex) {\n const res = await axios.get(\"http://www.omdbapi.com/\", {\n params: {\n apikey: \"b796d8f8\",\n s: `${movieIndex}`,\n },\n });\n if (res.data.Error) {\n return [];\n }\n return res.data.Search;\n }", "async function getMovies(req, res) {\n try {\n const movies = await movieService.query(req.query)\n res.send(movies)\n } catch (err) {\n logger.error(err);\n logger.error('Cannot get movies: ' + err.message);\n res.status(500).send({ error: 'cannot get movies' })\n }\n}", "function getMovie(title) {\n var year;\n var rating;\n var country;\n var language;\n var plot;\n var actors;\n var rottenTomatoesRating;\n var rottentomatoesURL;\n if (title) {\n var titleParam = title;\n } else {\n var titleParam = \"Mr. Nobody\";\n }\n // /assugning request url using that title\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + titleParam + '&tomatoes=true&r=json';\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(response);\n rBody = JSON.parse(body);\n // rJson = JSON.parse(response);\n titleParam = rBody['Title'];\n year = rBody['Year'];\n rating = rBody['Rated'];\n country = rBody['Country'];\n language = rBody['Language'];\n plot = rBody['Plot'];\n actors = rBody['Actors'];\n rottenTomatoesRating = rBody['tomatoRating'];\n rottentomatoesURL = rBody['tomatoURL'];\n\n console.log('the title is ', titleParam);\n console.log('the year is ', year);\n console.log('the rating is ', rating);\n console.log('the country is ', country);\n console.log('the language is', language);\n console.log('the plot is', plot);\n console.log('the actors are', actors);\n console.log('the Rotten Tomatoes Ratings are', rottenTomatoesRating);\n console.log('the Rotten Tomatoes URL is', rottentomatoesURL);\n // console.log(rBody);\n // console.log(response);\n // console.log(rJson);\n }\n // else {\n // request('http://www.omdbapi.com/?t=remember+the+titans&y=&plot=short&r=json', function (error, response, body) { \n // console.log(response);\n // })\n // }\n })// body...\n\n}", "function movieinfo() {\n \n var queryURL = \"http://www.omdbapi.com/?t=rock&apikey=//!InsertKey\";\n // Creating an AJAX call for the specific movie \n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function(response) {\n console.log(response);\n }\n)}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "async function getMovies(url) {\n var resp = await fetch(url);\n var respData = await resp.json();\n showMovies(respData.results);\n}" ]
[ "0.79560894", "0.725326", "0.6973141", "0.691156", "0.68139607", "0.66686493", "0.6657678", "0.65678656", "0.65582055", "0.6554129", "0.65254754", "0.6483433", "0.6481418", "0.6458714", "0.64369994", "0.64369994", "0.6430123", "0.6428067", "0.63395256", "0.63120717", "0.6271073", "0.6257854", "0.62514204", "0.62495095", "0.62470096", "0.62439173", "0.62389183", "0.62338877", "0.6222357", "0.6213018", "0.6210749", "0.62048686", "0.620043", "0.61993957", "0.61857975", "0.6178122", "0.6171209", "0.6169112", "0.61687976", "0.61585915", "0.61477554", "0.61370236", "0.6135739", "0.61356527", "0.6133685", "0.6130321", "0.61172736", "0.6114782", "0.61091536", "0.6108868", "0.6108764", "0.6099325", "0.60965294", "0.6095178", "0.6093759", "0.6090163", "0.60894394", "0.6084869", "0.6083609", "0.60729593", "0.6071898", "0.6050559", "0.6040862", "0.6038302", "0.60380745", "0.60374373", "0.60250604", "0.60177934", "0.60161585", "0.60062194", "0.5999605", "0.59988683", "0.5998793", "0.59984475", "0.59967154", "0.5993115", "0.59822184", "0.5981249", "0.5981028", "0.5974481", "0.59738934", "0.59735596", "0.59729475", "0.5969478", "0.59603477", "0.59581786", "0.5955987", "0.5944514", "0.5937859", "0.5931288", "0.59291077", "0.592744", "0.59263366", "0.59255195", "0.5923875", "0.5921317", "0.5918862", "0.59135485", "0.5911063", "0.5909165" ]
0.7253222
2
base reader from the locally stored movie feed. / defaults to filter the movies by the rating of 3 or better / also accepts an array of genre ids to then filter the list from too
function setMovieListing(filters = "3", filter = "genre_ids"){ try{ let movies = localStorage.getItem("latestMovies") ? JSON.parse(localStorage.getItem("latestMovies")) : getLatestMovies(); let filteredMovies = movies; ///create a default object to start with //Now see if we've passed in an Array to filter by, which needs to go a bit deeper? if (Array.isArray(filters) && filters.length > 0){ filteredMovies = movies.filter((m) => m[filter].some(s=>filters.some(sieve => sieve === s))); } //Otherwise the filter is a string, more than likely to be if (typeof filters === 'string' || filters instanceof String){ filteredMovies = movies.filter((m) => m[filter] >= filters); } renderMovieListing(filteredMovies); }catch(err){ console.error(err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getFilteredMovies(filter, callback) {\n var options = {\n method: 'GET',\n endpoint:'movies5s',\n qs: {ql:\"\"}\n };\n // Build query from params specified\n if (filter.name != '') {\n if (options.qs.ql != \"\") // For multiple parameters\n options.qs.ql += \",\";\n options.qs.ql += \"name = '\"+ filter.name +\"'\";\n }\n if (filter.year != '') {\n if (options.qs.ql != \"\") // For multiple parameters\n options.qs.ql += \",\";\n options.qs.ql += \"year='\"+ filter.year +\"'\";\n }\n\n // Send the request\n /* client.request() options:\n * `method` - http method (GET, POST, PUT, or DELETE), defaults to GET\n * `qs` - object containing querystring values to be appended to the uri\n * `body` - object containing entity body for POST and PUT requests\n * `endpoint` - API endpoint, for example 'users/fred'\n * `mQuery` - boolean, set to true if running management query, defaults to false\n */\n sharedVars.client.request(options, function(getError, data) {\n if (!getError) { // If successful, filter based on actor\n if (filter.actor != '')\n filterActor(data.entities, filter.actor);\n }\n callback(getError, data);\n });\n}", "filterMovies(){\r\n // reset array for filter\r\n this.movies = this.copyMovies\r\n // check genre\r\n if (this.selectedGenreM !== 'all')\r\n { \r\n this.movies = this.movies.filter(\r\n (movie) => {\r\n if (movie.genre_ids.includes(this.selectedGenreM))\r\n return movie\r\n }\r\n )\r\n } \r\n else {\r\n this.movies = this.copyMovies;\r\n } \r\n // check if there are movies for the genre\r\n this.resultMovies = (this.movies.length ===0) ? true : false ;\r\n //return result\r\n return this.movies;\r\n \r\n }", "getFilteredMovies () {\n let filteredMovies = moviesFilterService.getFilteredMoviesByRating(this.data.movies);\n filteredMovies = moviesFilterService.getFilteredMoviesByGenres(filteredMovies);\n\n return filteredMovies;\n }", "function filterMoviesByGenre(genre) {\n return movies.filter(movie => movie.genre === genre);\n}", "function getSongsFromGenres(genres, access_token) {\n var xhr = new XMLHttpRequest();\n var query = \"limit=10\" +\n \"seed_genres=[\";\n for (var i = 0; i < genres.length; i++) {\n \tquery += genres[i];\n }\n query += \"]\";\n xhr.open(\"GET\", \"https://api.spotify.com/v1/recommendations?\" + query);\n xhr.setRequestHeader(\"Authorization\", token);\n\n xhr.onreadystatechange = function() {\n \tif (xhr.readyState == 4 && xhr.status == 200) {\n \t\tdata = filterCardData(JSON.parse(xhr.responseText));\n \t}\n }\n xhr.send(query);\n}", "function genreFilter(text) {\n main.innerHTML = '';\n detailed.innerHTML = '';\n let ratings = new Object();\n \n if(text=='Genre') {\n for (var i = data.length - 1; i >= 0; i--) {\n let temp = createCards(i);\n ratings[temp.text] = temp.rating;\n }\n }\n else{\n url.map((gen, id) => {\n for(let i=0; i<gen.genre.length; i++){\n if(gen.genre[i]==text) {\n let temp = createCards(id);\n ratings[temp.text] = temp.rating;\n }\n }\n });\n }\n \n //call to the rating function\n getRatings(ratings);\n}", "function selectMovies() {\n\n var type = Session.get('type');\n var search = Session.get('search');\n var sort = Session.get('sort');\n var filter = Session.get('filter') || {};\n\n\n\n // Update scroll position when the query changes -----------------------------\n var instantaneaousRepositionning = false;\n var query = [type, search, sort, filter.genre].join('|');\n if (query !== queryCache) {\n scroll = 0;\n scrollTo(0, 600);\n queryCache = query;\n instantaneaousRepositionning = true;\n }\n\n\n // TODO Loading icons, what happens if you search <2 letters\n\n\n // Load Data -----------------------------------------------------------------\n\n if (search.length > 1 && type === 'suggested') {\n // Global Search\n searchMovies(search, filter, sort);\n } else {\n lookupMovies(type, search, sort, filter, instantaneaousRepositionning);\n }\n}", "function searchForMovie() {\n let userMovie = \"Django Unchained\";\n let queryURL =\n \"https://api.themoviedb.org/3/search/movie?api_key=\" +\n API_KEY +\n \"&language=en-US&query=\" +\n userMovie;\n\n $.ajax({\n url: queryURL,\n method: \"GET\",\n }).then(function(response) {\n // console.log(response);\n // let title = response.results[0].title;\n // let posterURL = response.results[0].poster_path;\n // let rating = response.results[0].vote_average;\n // let releaseDate = response.results[0].release_date;\n // let summary = response.results[0].overview;\n // let genreID = response.results[0].genre_ids[0];\n let movieID = response.results[0].id;\n let streaming = whereToWatch(movieID);\n // object.entries\n let movie = {\n title: response.results[0].title,\n year: response.results[0].release_date,\n // rated: ????,\n genre: response.results[0].genre_ids[0],\n plot: response.results[0].overview,\n poster:\n \"https://image.tmdb.org/t/p/w500\" + response.results[0].poster_path,\n rating: response.results[0].vote_average,\n streaming: streaming,\n // user: ????,\n // watched: ????\n };\n\n // Poster Path: \"https://image.tmdb.org/t/p/w500\" + POSTER_URL;\n });\n}", "function filterByGenre(movies, genres){\n return movies.filter(function(movie){\n for (let i = 0; i < genres.length; i++){\n if (movie.genres.includes(genres[i])) return true;\n }\n });\n}", "function getTopRatedMovies() {\n\n const path = '/movie/top_rated';\n\n const url = generateUrl(path);\n\n const render = renderMovies.bind({title: 'Top Rated Movies'});\n\n sectionMovies(url, render, handleError);\n\n}", "function read(movieId){\n return knex(table)\n .select(\"*\")\n .where({movie_id: movieId})\n}", "function genreSelected(genreId) {\n // TODO: fetch movies matching the given genreId\n // `https://movie-api.cederdorff.com/wp-json/wp/v2/posts?_embed&categories=${genreId}`\n}", "genreFilter(movie){\n return this.genreMovies.filter(e => movie.genre_ids.includes(e.id));\n }", "filterFilmsViewByGenre(genre) {\n this.fullList.forEach(filmData => {\n this.elem.galleryList.querySelector(`[data-id=\"${filmData.id}\"]`).style.display =\n (filmData.genres.includes(genre) || genre === '-') ? 'block' : 'none';\n });\n }", "function getGenres(){\n var url = \"http://api.themoviedb.org/3/genre/movie/list?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function getMoviesForGenre(genreName, genreId, avg_rating){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/discover/movie?with_original_language=en&with_genres=\" + genreId + \"&vote_average.gte=\" + avg_rating + \"&vote_count.gte=100&include_video=false&include_adult=false&sort_by=vote_average.desc&region=US&language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n console.log(\"this is the avg rating i am comparing: \" + avg_rating + \" for genre \" + genreName)\n $.ajax(settings).done(function (response) {\n var rank = response.total_results\n generateGenreSection(genreName, rank, response);\n });\n\n }", "movieGenres(data,genres){\n //filter the dataset and create an array of genres => one object for each genre in the db\n genres.forEach((genre, index)=>myApp.vm.genres.push({name :genre, movies: data.filter(movie=>movie.genre_name===genre)}));\n\n }", "async fetchPopularFilms() {\n let popularFilms = 'trending/movie/week?';\n try {\n const response = await axios.get(\n BASE_URL +\n popularFilms +\n API_KEY +\n '&language=en-US&page=' +\n `&page=${this.localService.getPaginationPage()}`,\n );\n this.localService.setLocalTotalCards(response.data.total_results);\n this.localService.setPaginationPage(response.data.page);\n return response.data;\n } catch (error) {\n return error;\n }\n }", "getFilteredMovies (city, theater) {\n return apiClient.get(`/api/movies/?city=${city}&theater=${theater}`)\n }", "function setFilter() {\n let year = $('#w1-slider .tooltip-inner')[0].innerHTML.split(' : ');\n let reating = $('#w2-slider .tooltip-inner')[0].innerHTML.split(' : ');\n\n filter_value = 'Year,' + year[0] + ',' + year[1] + ',imdbRating,' + reating[0] + ',' + reating[1];\n sendData(genre, searchValue, limit, sort_value, filter_value);\n var data = {\n limit: limit - 1,\n sort: sort_value,\n filter: filter_value\n };\n $('#movies div').remove();\n sendDataAndGet('main/sort_filter', data);\n}", "function getFilm(search) {\n\n\tomdb.getMovie(search)\n\n}", "function filteredByRating(min, max){\n filters.rating = {\n apply: (d) => d.imdb >= min && d.imdb <= max,\n min, max\n }\n applyFilters(false)\n}", "function getPopularMovies() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"MOVIES\"][\"POPULAR\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movies.trigger('change');\n\t\t\t\t\t$.ptr.hide();\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "function getReviews(movie) {\n movieId = movie || \"\";\n if (movieId) {\n movieId = \"/?movie_id=\" + movieId;\n }\n $.get(\"/api/reviews\" + movieId, function(data) {\n var rowsToAdd = [];\n if (data != null)\n {\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createReviewRow(data[i]));\n }\n }\n renderReviewList(rowsToAdd);\n movieSelect.val(\"\");\n });\n }", "function getMovies() {\n return (dispatch) => {\n dispatch(request());\n dispatch(success(feedData));\n\n /**\n * If API is available, we could use below code for API call.\n */\n\n // movieService.getMoives()\n // .then((res) => {\n // dispatch(success(res));\n // })\n // .catch((err) => {\n // dispatch(failure(err));\n // });\n };\n\n function request(data) {\n return {type: movieConstants.MOVIE_REQUEST, data};\n }\n function success(data) {\n return {type: movieConstants.MOVIE_SUCCESS, data};\n }\n // function failure(err) {\n // return {type: movieConstants.MOVIE_FAILURE, err};\n // }\n}", "function filterByGenre(genre) {\n return function (book) {\n return book.genre === genre;\n };\n}", "function fetchMovieRecs(id, mediaTitle) {\n\tvar url = \"https://api.themoviedb.org/3/movie/\"+id+\"/recommendations?api_key=ddda0e20c54495aef2d2b5acce042abe&language=en-US&page=1\";\n\tfetch(url).then(r => r.text()).then(result => { // making an API call for movie recs\n\t\tconst json = result;\n\t\tconst obj = JSON.parse(json);\n\t\tvar recArr = obj.results;\n\t\trecArr.length = Math.min(recArr.length, 5); // limiting to 10 recs\n\t\trecArr.sort(function(a, b){\n return b.vote_average - a.vote_average; // sorting per rating\n\t\t});\n\t\t \n\t\tconsole.log(\"THE RECOMMENDATIONS ARE: \" + \" \\n\\ \");\n\t\tfor(var i=0;i<recArr.length;i++){\n\t\t\tconsole.log(recArr[i].title + \" \" + recArr[i].vote_average + \" \\n\\ \");\n\t\t}\n\n\n\t\tchrome.storage.local.get(\"stored_movie_recos\", function(data){ // Gets the titles from local storage\n\t let recoMap = new Map();\n for(var i=0;i<recArr.length;i++){\n\t\t\t\tif(mediaSet.has(recArr[i].title)) continue;\n\t\t\t\tmediaSet.add(recArr[i].title);\n\t\t\t\trecoMap.set(recArr[i].title, {recoFor: mediaTitle, recoData: recArr[i]});\n }\n console.log(\"Recos for \"+ mediaTitle);\n for(var i=0;i<data.stored_movie_recos.length;i++){\n \trecoMap.set(data.stored_movie_recos[i].key_title, {recoFor: data.stored_movie_recos[i].title_val.recoFor, recoData : data.stored_movie_recos[i].title_val.recoData});\n }\n \n var merged = [];\n recoMap.forEach(function(val, key){\n merged.push({key_title: key, title_val: val});\n });\n\n\t //var recosSet = new Set(data.stored_recos);\n\t //var currRecosSet = new Set(recArr);\n\t //var merged = new Set([...recosSet, ...currRecosSet]);\n\t merged.sort(function(a, b){\n\t \treturn b.title_val.recoData.vote_average - a.title_val.recoData.vote_average;\n\t });\n\t chrome.storage.local.set({stored_movie_recos: merged}, function() { // storing the titles in local storage (not the recs, just watched for future reference. Recs are logged to console for now.)\n\t\t\t\tconsole.log(\"title stored\");\n\t\t\t});\n });\n\t});\n\n\n}", "function dramaMoviesRate(movies) {\n var filterMovies = movies.filter(function(movie) {\n var filterGenres = movie.genre.filter(function(genre) {\n return genre === \"Drama\"; \n })\n //console.log(filterGenres);\n return filterGenres.length > 0;\n })\n console.log(filterMovies);\n return ratesAverage(filterMovies);\n}", "function getFavSeries(genre) {\n //int genre = genre code\n //https://api.themoviedb.org/3/discover/tv?api_key=1e5a5ee20af326aebb685a34a1868b76&sort_by=popularity.desc&with_genres=35\n\n let apiSearch = `https://api.themoviedb.org/3/discover/tv?api_key=1e5a5ee20af326aebb685a34a1868b76&sort_by=popularity.desc&with_genres= ${genre}`;\n\n ajaxCall(\"GET\", apiSearch, \"\", getSeriesPopByGenreSuccessCB, getSeriesPopByGenreErrorCB)\n\n}", "function getPopularMovies(){\n var url = \"https://api.themoviedb.org/3/movie/popular?api_key=\" + api_key + \"&language=fr\";\n return get(url);\n}", "function MovieList() {\n const dispatch = useDispatch();\n const history = useHistory();\n\n // tells saga watcher to work with db to store full movie and genre lists in reducers\n useEffect(() => {\n dispatch({ type: 'FETCH_MOVIES' });\n dispatch({ type: 'FETCH_GENRES' });\n }, []);\n\n // gets full movie and genre lists from reducers and saves locally\n const movies = useSelector((store) => store.movies);\n const genres = useSelector((store) => store.genres);\n\n // saves search params in state to be passed to db by saga watchers\n const [searchQuery, setSearchQuery] = useState('');\n const [genreFilter, setGenreFilter] = useState(0);\n\n // tells saga watcher to work with filter router to show filtered movie list by search string\n const handleFilter = (event) => {\n event.preventDefault();\n console.log('received filter query', searchQuery);\n dispatch({ type: 'FILTER_MOVIES_STRING', payload: searchQuery });\n };\n\n // tells saga watcher to work with filter router to show filtered movie list by genre\n const handleGenre = (event) => {\n event.preventDefault();\n console.log('selected genre', genreFilter);\n dispatch({ type: 'FILTER_MOVIES_GENRE', payload: genreFilter });\n };\n\n // tells saga watcher to fetch full movie list and save in reducer, effectively clearing the search\n const handleClear = (event) => {\n event.preventDefault();\n dispatch({ type: 'FETCH_MOVIES' });\n setSearchQuery('');\n setGenreFilter(0);\n };\n\n return (\n <main>\n <h2>Movie List</h2>\n {/* this form takes search string and filters movie list with that string */}\n <form className=\"search-form\" onSubmit={handleFilter}>\n <TextField\n id=\"search-input\"\n label=\"Search Movies\"\n placeholder=\"...\"\n variant=\"outlined\"\n size=\"small\"\n InputProps={{\n startAdornment: (\n <InputAdornment position=\"start\">\n <SearchIcon />\n </InputAdornment>\n ),\n }}\n value={searchQuery}\n onChange={(event) => setSearchQuery(event.target.value)}\n />\n <Button variant=\"outlined\" color=\"primary\" type=\"submit\">\n Submit\n </Button>\n </form>\n <br></br>\n\n {/* this select takes a genre and filters movie list to just those with that genre */}\n <FormControl variant=\"outlined\" size=\"small\">\n <InputLabel id=\"genre-filter-select\">Genre</InputLabel>\n <Select\n name=\"genre\"\n labelId=\"genre-filter-select\"\n id=\"genre-filter-select\"\n value={genreFilter}\n onChange={(event) => setGenreFilter(event.target.value)}\n >\n <MenuItem key={0} value={0}>\n ...select genre\n </MenuItem>\n {/* maps over genres to create option for each */}\n {genres &&\n genres.map((genre) => (\n <MenuItem key={genre.id} value={genre.id}>\n {genre.name}\n </MenuItem>\n ))}\n </Select>\n </FormControl>\n <Button\n variant=\"outlined\"\n color=\"primary\"\n type=\"submit\"\n onClick={handleGenre}\n >\n Filter by Genre\n </Button>\n\n {/* this resets the movie list, effectively clearing the search and genre filter */}\n <br></br>\n <br></br>\n <Button variant=\"outlined\" color=\"secondary\" onClick={handleClear}>\n Clear Filters\n </Button>\n <br></br>\n <br></br>\n\n {/* maps over movies to create a card for each, with routing buttons to their detail and edit pages */}\n <section className=\"movies\">\n {movies.map((movie) => {\n return (\n <Card className=\"movie-card\" variant=\"outlined\" key={movie.id}>\n <CardContent>\n <img\n className=\"card-image\"\n src={movie.poster}\n alt={movie.title}\n />\n <h4 className=\"card-header\">{movie.title}</h4>\n </CardContent>\n <CardActions>\n <ButtonGroup className=\"card-btns\">\n {/* routes to dedicated details page on click */}\n <Button\n variant=\"outlined\"\n color=\"primary\"\n onClick={() => {\n history.push({ pathname: `/details/${movie.id}` });\n }}\n size=\"small\"\n >\n Details\n </Button>\n\n {/* routes to dedicated edit page on click */}\n <Button\n variant=\"outlined\"\n color=\"secondary\"\n onClick={() => {\n history.push({ pathname: `/edit/${movie.id}` });\n }}\n size=\"small\"\n >\n Edit\n </Button>\n </ButtonGroup>\n </CardActions>\n </Card>\n );\n })}\n </section>\n\n {/* page only displays 10 movies - if there are more, this tells user to search for them */}\n {movies[0]?.total_movies > 10 ? (\n <h3>There are more movies - use search and filter to find them!</h3>\n ) : (\n <h3>These are all the results!</h3>\n )}\n </main>\n );\n}", "function getOMDB(movie='Mr. Nobody') {\n\tvar vImdbRating=\"\";\n\t// console.log('move is ', movie);\n\t// console.log(\"OMDB function ran\");\n\t// console.log('request string ', (omdb1+movie+omdb2));\n\tRequest(omdb1+encodeURI(movie)+omdb2)\n\t\t.then(function(data){\n\t\t\tvar parseData=JSON.parse(data);\n\t\t\t// console.log('parseData ', parseData);\n\t\t\tfor (i in parseData.Ratings) {\n\t\t\t\t// console.log('i is ', i);\n\t\t\t\tif (parseData.Ratings[i].Source===\"Rotten Tomatoes\") {\n\t\t\t\t\tvImdbRating = (parseData.Ratings[i].Value);\n\t\t\t\t\t// console.log(\"Rotten tomatoe true\", \" \", parseData.Ratings[i].Source, \" \", parseData.Ratings[i].Value );\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t// console.log('vImdbRating', vImdbRating);\n\t\t\t// console.log('data ', data);\n\t\t console.log(\"\\n\\n\" + \"OMDB MOVIE RESULTS\".black.bgMagenta + \"\\n\");\t\t\t\n\n\t\t\tconsole.log(`Title ${JSON.parse(data).Title} | Released ${JSON.parse(data).Year}`.black.bgWhite);\t\t\t\n\t\t\tconsole.log(`IMDB Rating ${JSON.parse(data).imdbRating} | Rotten Tomatoes Rating ${vImdbRating}`);\n\t\t\tconsole.log(`Production Country(w) ${parseData.Country} | Language ${parseData.Language}`);\n\t\t\tconsole.log(`Plot: ${parseData.Plot}`.white);\n\t\t\tconsole.log(`Actors: ${parseData.Actors}`.inverse);\n\t\t}, function(err) {\n\t\t\tconsole.log('response ', response);\n\t\t\tconsole.log('Sorry, I had a problem. ', err);\t\t\t\n\t\t});\n}", "getAllMovies(){\n return this.state.movies.filter(\n el=>el.rate>=this.state.value&&\n el.title.toLowerCase().includes(this.state.titlefilter.toLowerCase())\n )\n }", "function filterByGenre(moviesObj, genre) {\n if (moviesObj.length == 0) {\n throw \"Error: No movie titles given!\";\n }\n return moviesObj.filter((key) => {\n return key.genre.toLowerCase().includes(genre.toLowerCase());\n });\n}", "function getMovieList(movieList = [], pagenum=1) {\n\t\tconst url = \"https://api.themoviedb.org/3/discover/movie?&api_key=933bee1465a61090ebe0704cd6d4c3e1\" +\n \"&with_genres=\" + genreIDs + \n \"&without_genres=\" + genreExclusions +\n\t\t\t\t\t\t\"&vote_average.gte=\" + filters.voteAverage +\n\t\t\t \"&vote_count.gte=\" + 50 +\n\t\t\t\t\t\t\"&certification_country=US\" + \n \"&certification=\" + filters.rating +\n\t\t\t\t\t\t\"&page=\" + pagenum + \n\t\t\t\t\t\t\"&primary_release_date.gte=\" + filters.releaseDecade[0] + '-01-01' +\n\t\t\t\t\t\t\"&primary_release_date.lte=\" + filters.releaseDecade[1] + '-12-31';\n \n\t\t$.ajax({\n url: url,\n datatype: 'json',\n success:function(data){\n\n if (data['total_results'] > 20*pagenum && movieList.length <= 25 ) {\n for (let movie of data['results']) {\n screenMovie(movieList, movie);\n }\n \n pagenum++\n getMovieList(movieList, pagenum);\n } else {\n scrubbedResults = scrubDuplicates(movieList);\n showResponse();\n }\n },\n failure:function(error){\n showError(error.text);\n }\n });\n\t}", "loadBooksByRating(filterObj) {\n\t\tapi.getBooks({rating: filterObj.map(rating => rating.description).join(\",\")}, result => {\n\n\t\t});\n\t}", "function movieThis() {\n console.log('===========================================');\n console.log(\"Netflix and Chill....?\");\n // console.log(\"Pizza and a fuck?.....WHAT???.....you dont like pizza?\")\n var searchMovie;\n // use undefined for default search!\n if (arguTwo === undefined) {\n searchMovie = \"Mr. Nobody\";\n } else {\n searchMovie = arguTwo;\n };\n // add tomatoes url and json format // request required here\n var movieUrl = 'http://www.omdbapi.com/?t=' + searchMovie + '&y=&plot=long&tomatoes=true&r=json';\n request(movieUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n \n\n var movieData = JSON.parse(body)\n\n console.log('================ Movie Info ================');\n console.log('Title: ' + movieData.Title);\n console.log('Year: ' + movieData.Year);\n console.log('IMDB Rating: ' + movieData.imdbRating);\n console.log('Country: ' + movieData.Country);\n console.log('Language: ' + movieData.Language);\n console.log('Plot: ' + movieData.Plot);\n console.log('Actors: ' + movieData.Actors);\n console.log('Rotten Tomatoes Rating: ' + movieData.tomatoRating); //notworkings\n console.log('Rotten Tomatoes URL: ' + movieData.tomatoURL);\n console.log('===========================================');\n }\n });\n}", "function externalRatings(imdbid, title, title_orig) {\r\n const imdb_icon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAGFBMVEUAAADmuR4AAADovi7xwiA0Kge0kBh1Xg/if3xnAAAAAXRSTlMAQObYZgAAAb5JREFUaN7t2s2OgjAQB3CSfYJxq3ebQK9u9gmaIJwlImeJumcJ6usvneI28lGQmmxM5p84trT9pQmHkoDnfXw7ZOV53hc45LPaADhlpTbgtAUCCCCAAAIIIIAAAt4XYGEY2oE4Van/0p1kF906QKpzO7H7tKwLWHMViDlGSJbo1iHi92QM9LjfC/gGgDbAd3I04EvgDQA74wGIuoDtaICzTiCQo4FD3AWI6cC1wPHxQNkAynrleGDdAKJHIAylHdjObQCTP7e9tAKbmQ2IiqqcpQ1Y5l0Ar4EcK7MBQS9gsnUFAmkBRMF5MgCIXiDVQNoLZMkg4FdTLr0Am9mBrPrZAB/WQwDmOBnYaSD/P2DDsTObDiSOwBYB4QAULwECByB/CbB0AHDpxuE2zpFxALBTtgF/LBC3gdgROB+fAiJcagCMOdo4m08ERA1ciwEAVGXdgElgAZKq3QEsIX7o9QJMAbINlA9AaQEKzkUbEFKPi0JPfhLw/x7zgiipauNwXZxUAFTdwwKLuYKtUEI9zhaX9No43lmoAqCqBIbFXMGWihkP3+1pnQACCCCAAAIIIICApwDnV+fOL++dPx/4BflDKTOe3dGdAAAAAElFTkSuQmCC\";\r\n const rott_rotten = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAqFBMVEUAAAB6lzaHqjYoRxyQsTe51liz0FURJgt6njaVtzh8lziKrTg9WDSJqzWCoTmfvTWdvz91ljupxzSQr0WpxlOmxkdGZiKtzE2CnDeCpDaLpjaiv09ZeDKXtUicuUyAn0SIp0WKpT5mhjrG5WV6mUSauS13kjS21kt5lS3A40yGpyy412WMsi+uz0K52DNafSFqjzhmiStzjiyIp1NwjkBuky2cumCQtyFQj3lNAAAAAXRSTlMAQObYZgAADFtJREFUeNrslO1OwjAUQJF7Xb06bKmuYJ3EMZtlQPmK6Pu/mWUDhTFMzLImJpzs4+c5vevauXDhwoV/RQhsD3T846yLPhopBXaXCnw3ODvOD+BrYGHHH0wN8mwud1grbf68AtbxBeuXdisPyNFXgfPn0hFZeYQVyk8BKLf+KBKHcs5FJLMb8LIVWbbXCrGzlw+TjX2MgG3c+vcLL9m9hSEfI4AHuQ3gJ5iRsXH7IwjVwEheozeGjH1rPwBW9lNyUfUT0bbhBVo/jmAiZ9yIqt2BxkWo1jcBGD4iLojTMYhkkGTsI0DsnRUMIh+3H0DGqd11gp75CsAzzDSSh0+AhLVoxET/HhAChI3/EnZbBPS+vT2te+52YIKk4Fy4k6s4ViEw1igC1oW2xNkPSRJSYX02bKLrPN0yHY2hSQIoJI2Tnq5hiF2o1z9Mp9clmcv4WABrUHBn9CtOkqq9q5MhXrE6fxzkg8egoGhI0/cGQ2D9CVbsTwX3w0QvagLYchrQ45ZgUEYEafr0hwIoCH+28hdnZsOcKAyE4QnbO2KISORkUIGIhxzt2VZpO/f//9ntJmDksNi5tx922mmeJ5tNSKfR0yYtB2gTFNAAY77+HhXb7Wq7JYdO4dvPD4DkK3TpJ2f+cFx/JJex/XO8LstwlDQNlT/mV9tDVMQFSaCGKQTm1+8M4EvX3/j7r1/PeOFbxS1AP6c4DdNRdLoeb0LIiofiIS/yPC8KcqBCUCV+/oD7BhK8R7p/Lg6YRZQnfn8pijkSRxIeyJHAW77Z7eI8zimFlaAqrB4VwF3+8oXwlBk9AKKuxySc1hsEcm7BgoJC7/6I/xqXmzIuY5POYWvy/EOCvFP/38RfGj5m/hDECXSdkemy4SkTLiwtExh3QBhuwhIzdMgLbId7XeB/f3R8On/jp2N86USp1ihwnVSDHNUwp97EWAcb67BYVdMCfon8gcA6OB5fe4YPijNRM5dbK5CFqeBOAbvBBptyFsVyUgAeX4b8IAi9JwbufD1VgrkInY33gGoECogUYxwGhSgSkBP89cvyx4D/8LTTR89BAM6pcLkpUIWNUGQnBDm4xQjiuMwnmwDoT8/VtYAXeCHfJddH5F4LnGLVCYx6UCa6aS7LZBycQnlHIHlBgajfAbQAnsfXfEfTHKxCwyo7/rgHIdOtQLAzuKpDeEfg9WU5FPDozOe7E1w3qnzHOVrAjQqA0A2rSeCiYNfCasSTAmcSWLkFMAKc8wqGR7UKRfNJE8okxG87AeeApcDtWd4VWFAFLH/uoYAmgUGhAavcCzDr5gJnotcMBcYKVIRETi7BKlpE+AywV8CNEVC80dk/JagUZyaN6Y9hAWpR38SbhRFSTjbhssDpXxUg5BjGT/7whqb6GYr67boLAN4INxYgtGpTJs4wKfB8+LE4WIGAtkBIAjiCTvyhQFr3Qze7PcjLPUJx3k13FKHqtH3LQE5cDWF1WC0O0WUL4hYgvmJcwUCgSrtBWdM0nGdJIhMpk7MOaX/cDtalabFeU00om+fD7LDo+Z5ZADrUuN47b0lN2A1atejYhDutmBZh2dbhTb6VTU21YPI28GsR4RqYBrAdYCvwwat9bw5Y6MtJp6qqFaJtUhw+rVus86cCdDhpSSswETgu89mfGe2ADfGF5SuGw1cZ2GQqbd2g2PN1KvC1YXUtMPYXujYQDs5EE74inwSm2nAWHWfz+TwI8AwiPNEVrZ/Q+j3Lsr2qNGv7gRtuqLWqBEFS1lq+qh0eQ25pwxRQASbjs+XCPIToCOBcYYyCPd3NkS7syMKGicsEWc9U9KG6KrhzoHwHSQW4Y+BFcVx6wZz4VH+az2dxGi5mzzBFk+5+XAvWmvpJCeDfvxTHRRA88LVnGtBWYES7LaDcG60OpXsM4TY5ZYACWIB7AfCi45NXEl9RmMIZfS2K0/TNK7LDMuSVWRy1z7IECE/8+zV43eVB2AnwWxVw8x3NvPPl2kBtJAYw9/nu1oNN2O1ApXrykG9RJhZqwFYqVKdEgpQ92dK/xneHzc7jH0xz4nM2CgGJ1VEJbz5xRo/vBOAKPvFfpkmFPdI5/8A2rsd4xj+NPpnZd9wp+nSkDxk99s1znAtMBxA9iZk3endfMjP/a7q7zPyXgv7brhkoqQkDYbglkkiJJxoM4wFKwSsDaNVq7fu/WXeJmALRWuu005n+ot44Dt+/m80GyS2h035qmAp3BrU+Q6n3eUR4P+jHLcBAfP00vFvvraFUo/60nUr5MkS9dJ94GJRMIP9P3VJkPFkD6+XnmqPcvbor+EQRKdzh8DZZy/2qGu4zxVIxvynrBw3m5Pl7iQQWZ3XoR+sTrbkrtoQ/3YDrKs4dKl0hn+2ARcK1RiMLnlrXDIzKwQF78DP5MhEmnlnuaynqi2/2O3ngqOZ2/zZxrV/RfOSIT1KiBRSXvzjeRMrtfr/fRhK1nQjhru9LwKiW68IzduZfI0m0+L2tV+6tRSwGA8cRqIU3Kl23vM7sy3IH8LIeDGLxcowk579ggslJ7K1xW6DUAkxyfcSNwp/W8OKMQXHyadfYYOQn/K1wyhLvSrxa7sh6teBwoayH1lUZ6S7Q0cR6tHbWztjzxl6c7LZqROQN/i7EXRG4Ju9m2b0+4PVLSyNAIx4lQI7jvL3BbvtskaR1Hq7y94uyPnMLY6F6DU/TamHcfTk/yoM8THM64YRfs0Die6q8E7H62wA/872LZjPfm+V5sAMHzMjfOaV7T5m7bd2Ku2Er+cFms8mzkzSvVkSU5dUq6xow51vBu4ErBUqUBoUtjTcJ5HotbhlQ5Ot0LTMa2RRkT4ssMuSA753Rx5vzDCeXia/B47E5bqQr2XlOqwAd9CqRDAevpebWQavYL/h1F34hx6HztgnyDaXeDKuNhoEW7cimNMslIVHHwNx9PVdcXXpI1ElfgxTywm3ePdTYocuIy2jp2wHGbZ+Db5PPorTKwl4KiDt6bYpNGWkNuIiFEAOntuH0am06rlJWi+xoBsWOYWrsha4tZKtuCkir2g3V5rxNncHa8QauodKqU00n+JJkQd7EbhuV2XZRcUK6NTCwzJMbeymUF9y8Cj1woNG60LKouRIHC2kG4Kv8ysaP82zZNfDVGVhGPDy8mRVxzuXX0HMMVU43dqQXOsb2tQP7lipIAVrW4pFXKrLbqvJvInbevIir65s0n4Ua3ojmhYSzaQfL7LNd0SK/ZSFLO4szH4xH/Unmxc54FkrCsWbgZZ579Ee0kl1EP4bDSJjNMju4xqaoLOmMAUtg7dZkFPJP0+lCX+QSPsv93vSGcCatcBipMug4FTXilaoTZ52tDvHmmKaYJ/XFFCfDwjfM7CxkrP2LNrM3WWWC637UXRDYwVv3mrn3mUrCpP5SZOcarg3Y7ZJiZJUVkGaqwW1hFP3tJs+wiFHZuooiPCz6EwyqcIUpaJVBkVe5Itsae34Gvo9n5h0DkkIn9y5FPqPBBpcN3kquKAwjC7G2rzgha1Vhn9Ea7+OjkewtSEzSCvm+D3if5tOi2uKX2gbgtCYHx3YKCFtBCjQ9gDNeVP9zR4i9sOfglNl5gPNsA+2lqNLuuh1BBgz8HFPQcUBO9iV0P2jISvgPBaJvAH3vfezVoMLOfMlYz2OSmQxkQbFkrLO5p1PepoPiOFyZL5AZk1+SGL7lDCWe8S4DONZFRbp1mFYNXZMBHdcra6yqyyBu/iWlDZiKkOZV9oGxznkS6tdgzRa1kuQwSjg0ogfEXloGmqZiB/BprwpI6AM7DmNgazhoufyYEvKYgfe1AewEusLVWxaBgbaDrR8uRMNOzuzlarVarjh/zADZZ72uFtC61mBBYN3BPJ5ELA4NGdmTWkeJu0ePiMuq1dbgaCa4rbuhHoTJQui4a/ouBQH/0XtphNoK35tjdNKbNgwcJMsE4Rj28ZimyI+A/2ACcBqAAQ3WUyymaf/+NG4zriaryRG5iK7FkU8eNbC1YXIFQaurxXVr4ZiBvgOZ/giXEvHw1cfvXodV6M883dTOU8w7MNNZGQGgjKSCI13vnj0mFlUhXcSLVm+xLBFLMGBubHhwdaB0ph5MwcEX0F5a03v+ckoZ6Gpv5ReR395LYESEotVaoMgPEWOEXTd91lM2UjiThziuyc30Xh44Q91MHNH7R7/tgKcfPjZ07C0RUfw/Jc6wsNOzIq7w/N0fFKvrSoKwqv5M+Oa6Ypr+V4Q31f/rv/7rn9d3QHyeAYuejVMAAAAASUVORK5CYII=\";\r\n const rott_certified = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACkVBMVEUAAAD+1CsCAgYpXSvkMzT+///+7S/90Cz/8jD//jP/+DL/4C3/2Cxnkzb/2yv5uy/1+/7lOjbzkTIOEQz7lDNDQBRQShVXgzT3tDAbGw1FdzIkJA/6wS7pNDQcOCBeWBgMHBPzeUTbMjMjTScxLRAeQiPwNDUSFR1ejTa3Kizu9vzl8fv8yC1Usu7vaz9pYhoTKxkULTxrtegbHB/9zS3S6Pn2ikzmRTbb7Pn/5C86NhOoKSvEJSX36TDELS/F4fa12PQlIyOVyO6YjyOQhiDNLzGolyOn0fDi1i6Bv+nVMDGtaDA2KR3jKzSonyXz5DB8cxzVgDDZzi26sbFVPCJxnDf3rTC7sShJTEkpLC/XtCF7pzjoxypKIhnvSjj4pjO4pSU2OznsLjRwSiV0aRz+mjj51i1OFRaEsjnpVTnCtymCVCiRJSeBfR7FeC5RZy7uziwoNBcyExHSxy2XYyw9RDtAWirXuym6ubLu3y++xshWV1fznDFldDDHrSbQpyFHMR4cBwjyXjzfwSo2SSifPTHJvCv9yiKoUjXOwiumHyXZ8P6Fweu7u7xdYGF7HR+ckl/qjjH62S6lMi7f0i1wbxuKhYZ0b3Po3C+Keh6h1vzb5uiXaWaNQja5My7khjLVIydnGBvl+P/09PRTjbK3Py340izO2NvIzc2ImKHyQDiXojPjKSiqvcaktL6jnZ6srzFDUS7y0y254fzU3+J5hjS5uDLHUDKPFxmaz/ZzwvVwosKej4vs4jEnVXGLU1GNHCWDx/WKpLRjeYaPwDvRQy1nKSFOY3N5LyeMrsRvX2x7gVvmpS6U0fu71ORCmMukqazJICVVo9VuQ0LDwjDbki7JOivQmh+tyt6dxN5xb0zagmZZAAAAAXRSTlMAQObYZgAAGIdJREFUeNrsVs9rE0EYdUawwjc7gc3mx5rAHlxJDoEcksvsLSTsJYukkFZbF5KSZA8W4qrRRaxBiAhehOaWU2659FID+vf5fbv1RxS01SoIvkCTTrt5b9573+xe+Y9/Fs8P9mpnKNUae3ev/EUc1Gped3A4aY/H24jxuN2eDLovG6W/IeOg1OgetrePR73dfKpYLFYqlWIxlcr3RvpyPBl4tcbzK38Oe7WXh+3lqJcv1pmQMQS+APCdbVVSuyN9e9Jt1P6Mhrsl73CsI/kWcQOAAggCxoQ/8xkBV1kl1RstJ93a3h/YfLd9PMpXkAY5A3+/3+pYjukCU1VuhwIF+IEiL7ZSPWP70CtdMv1gbPSKDJ1GQMfkMdIkACxeWOF6YNvVZhSAAlHPj44nXuntJdJvj3YrFDgoGQvIWAVuR36AxJDl9hwDiDihYDUjISRLjfS2V7qk7Lvbxm4d2ZWcthb7wNgqgOu4bxEbAhnukCqX80Uri95UFWOJhEnjErrQ8ND8ihQAs4XNES4qEEwNeXom4+45PAOMqmAG12A9XUwlE2EAMsiPloPfNeFtaXA8SgnBQjeL5FkrTX4joMU5MjHKnmdRwNzm5u2ZVAokxeL0BZP1ntH+PRP2Gm1jl8k4aG63ZuS8uYqN7ydeMLEqcAuYnKU5wq66IvkjiRIyZSy7v2FCqbs08knQC87710D5Nh9CbPw+561YgG9S6lSBziKT5g4wgW6kI5SNvakcGZPa3V/lP9RHlD7x+WmeVdOqyYc0B8Sbxo+MxVvvKKpA2lcQ9jEX1eK4RIPhg2A9Y9xo/FL7axPjaEvKwA3IAounHY7ILMIz58nlZPwWiipAsyAAsIEmN0PBxLpgTpWQeWP58hdiOGhg+4WAdYY3IYmVWy0Lf5pNEEicLVRjL1bTfiTPgiCQGbyp4neKScqioXdLF68fDr8U6j52fCbo9MWTRyk1zZALPq6EAaVMBaXeB767LxkBsB3OmWSbrlayohuD0sX581JCi/YAAvlUB2sIyOZmhtMVEtHi+v7rgCUQJIMwR4lTCqLAzVmY5ekmyPoRKrg4P9DlrlJ9J5Jx1haFDrTjBOJ17sYdyTYAU/w/CsBCA3xFW8iGcutiCg6S/fdNNFvNO8nEQwZ7LjbIxKn2nQAW9DORjMfSjOVHjr1mok4pnL//Y8yfQRPThlWGF9BREOBa/dUmlzjJvfPFpqikF1TKdNTEcQxgRbJFRT9/E0tt7D+5WUU3HW6FIOedfUEpf4N7T7si/BAxwlby+lKEpoLI4fa+FKQKivqx1zjn+WMcnblpx4Mk6Iss2KCe0aD7mlc9Le+E7DsEmFt1DXJtJXcMcF2VN7YbT851/hp6/czMKI1HvwQ3zS1/0/ywefImOC17llZ+LCNffOsBTG1e6IOQkfh061J4ayqdo4DeUk+h3SI4u7DzjA4WEF/TM//xaa68o5U9Zyf3Pgy1k4B9RiIBgiHnw0BS/oAfcSbhyDj8uYISFlCAP7QLfZmcwAXuRMAShILwZqdcLmvaC03zvMw7TfuwU55tsMeAPl45E0yus0hf5fa6rusvGz/jH4x09M/kyczRccKH88/ti04+vD49KWuI3KsHO5rz6NGrnFbWcq+/VORLDOsqdyXMHM4L0bUqzwLWoPb2JwEc60WYmTzbcQG9o224X9kvohc3cuXc05ym7Tx4lXvgIRz8LXfy4Q25882Ywn6ymYwPbO7wZhzCzydQZvhCAT1YWVPBQtgYcnb7xdOnDx+gA1dv3nroOO/K5dyNnEaZ3Dt9HHyjQUiXbmLz5CnFnuNp4P3oEekjI+b+00QQxPH0LLkfqLWtCqhcTNUcnBBMpIhKg2CCBuolIkqsYpHT+AhGDcFo8IFoGhsqaGzSRvoQUCxgoUYwoJIQMcbgKxCNj//Gmb3bctcD4vcX54adnc/tzs5tLcYTAM10N0l6mdw+NNUHp/74kZVHjqxcmb9+fXb2+hWb14OtCCiOvExrTAhwepeJnAvYVXP98ieh+KItx5R5EEJIcBZsm+Z1Dp3Lz74Jyodkck54eVD2zUuXLsHekHX4iSVDhbeT3a/IUcjCWwJrW3O4cpkKXGNjsQFmEQAgWWg/rCnz0ItW369NRlHcFGuGvCqdjvVWVZULgWhzM+A9/mpSIcAZXPsoM/MRtlVYz5w1F/OWXoBaWAAW73/7dhlYuHBDEbNEgJVbO1AjSbwRxUtemYByvJ6QOI7neUkSN4mieL7RbGIV4UKuPblvN3YCE2vAJSheKj9ZANaEF9zHZzLPILqBJTKzT6yixBlTkqIksfcURbAaVRLFOzmZGIoyPc9iUOtumfEpx7bkEuRBBSA4fgaZLVnQSxtMyks0lopGjSQrZr0pSYKC0CoZNQhGu8NMCc483rB6w7YG8mxwLFkFbvIRYAnBanL/hCVDmR1FoqhODjK2YtV7JdiN8lP5uiVAhNLGTAPdv+d3L2eaFBw8CEv2ALridx9vPH3SpOSvV78+x1s/TrhaX2MBRCVSEGIUCSakdALRDrWrSGXlQi9Y7JfCdWyCdBi5eCkwNs3rDzTfzM5HZW8M0JSSFwh88JSOcL7QxOpkwHa4VAnqR5vt2t2vKY8FvNFoNCCIvKok8wmAnsChJzDk2GqLl/gMGvT5n2jzWzkrr0iT6fRKlx4ACyHXrJsT+vHtpuV3YGHnFt7fqlFaIr4qXwbQE+ToCeD3Yp5+B+A7TFJqWv8dkUNZFxWnktRKAKAboThOLliQyNUDgXpm1R7oz0DDMY0m5o3OBZWXV9Vww6WlmNyZJskHNcAn5gUhEAiUCc7eBM/JsfPO3w2Q33GVTupgcQ9056ASbmIG9uE1jeqCk1N1ak1FvDWe0tJhb7JOo2TZpgE+URZJtsXD4fD4YN3UdKBGoLEP7zkMx6aUOaeOYS86lb4EV27bbIXsvYcZWrVNxtM845FfnlKPt0DrLQjwxt7pQbUrHHXS56kG1tDeRqdsNxjI9VR/CB0OHUDXJE6iVfCXx+MNp2EF+N6IReMKxwSaM1JrZtu76JQAUK8vgjz8z4D/A7BM6wHCAT59UYYmy1MAvfUmNQC7Cn6kLNYFVABPZdWlAILuIP1b8uP5FIBFHhcP9E5RTzIUxH270iksAJw3HVMDYBVe0V8F1CtwtLgSdaCTAnQzDJ1vcOBOCiAojysWnNdoAgYUyhhv4VUAok0N4MAqdGsBoA2tUgDIVroZog5hUPGEznYkFTM+cMcXpm5GVpWTDgw3MR0M0x3skwEsBCDB/UZACwXQfQ6OwiHIRQALUcbWHw9QfQ9gEtkT+RgdV8yuCQBQ7GCl2+2u7OurcXZlKLGWuek+QBD4VGxyOhKJDNLodtbB6nphE9wFch0IIKt/ujwGsg7jJERtc2GaITRR5EMY1FaQJQldZz4IHoowGFndwSEAdVBRAN05dMMpLHQU3nu4VdF4PB4fnxOGY22YA7NkKEbGaEcRAJAnxZPs5bialngG2HRw/LOTFyBWJwQodDSmX00rKUCBIjJNFwEo0MjSxpywF/niW1UuADByHW4gWPBZgr0CjdXEjyJAve1i8eIA/p0L6h8FgJF++aEA/0WFm3x2u++7n7r7+wkAf4HJC45bCmhwgX/aOVJAB4H8dFIE0HWi4mYFoESRH9Q/InhiI37ZMUINf5sLAUoU9xDocw1+/VoYJq+7zZ+aYaqThNBBSoR/GYBCANijaGQUFIx5YqMl5Nl/nekGC1USLLL7/si2v5sBtVhhC4ShAx1gf8BRZNjc5EiJatBMieyebXfoAHALFIAKWWNu0gWsntjsGHHs+cQwwT3y3/66dvj+VlA3jkskjHx07M+Ps4DwnU4xMzlKYwnAmOJeHqBnvywKMDAre3pCvhZ3BVpo2133ZbNi5gMqGBISobGK/UPTTR9wEGos2JmKdQrlnTMVSgQCNAKA7hjmAsCXvYp+dJaVlQVKPQPv3pDnbyF77bpZ2X4zVOSqRgPtHqLqMicO7Pn2pkf2g320MxWb4Hj8Owl4BwB4DPWNaBUCvK0mehvleX54GAHeE8f7kH3HqWeyff+dy7X9fjUV8Qje6vsafXvW4qSxnxNGzvlMeXjWDkt9Y41L34oJwD8+zea1iSAM4zIpcWYRxK67JGzMxnwIgmbXDyykbkGSllBrtoaSqBA/K8FolKYqBD1E0Wp7MIgJ9KBoQS968eIHgtKLWlQQRBH8a3xmM5vGbvC5pLMzmec377wzu5Pt7o52PtqGp9AhADwVVwBw8fM7Ufvw4I/d/+jHwpd3qOzq3bunZGn0qSgAYGD/U1HvBXBvRoEdoTtfdwp1Ab6LCwB4/HmnWziIy736Przy4emP1fLTD4SMjLiNPjsAogCAUGgQNyPPI2FhR2jv9C6hCwLgo3that++fQ23cP7grjUaaRIi79r1wdGuPcjgC9tG3crSlmh09KhbOsYBzp454HkgObEjtH6aCLkAQ0QIAGen3ML5w2SNRps3SK9qw9u2RN1CGQBRt14O4XU7TsinPE/l1/EyPq2oqjpVLpe3uwAlofOIwOXGFNRoNC4fbjTcirKj0W3R4Wa5dsNRbWl4AAenaFmoORCNji+VyyV0ruh461/AI9m9dZ6tMASCvXv3rg/wowWOQg7BuZs3k8mtXCA429E+CBeSyZs3zx0/fvz5c95+i/Ot6Pj4eBR/ugcTCF3h4mg0+iS5Ad3vgI3YBjzrEFUcojAAdQHOnQNBkgMIufbwRyVOCb0nNeHoKuqI++M3pP1JmDvyLgJk4f3Bgqj2AAgCj78HQKiv/cjI9osdAKTAWb4IvFkY2sgVCmxaBQBB7yQI/x6AIQ+Ax3/U8QfA4R3CADl4xfuWAHPQqd+46Z8QfHx2+/btu2+SW2HcsYdwQyyVSwiAB8A7fGG/fUEAIAUeH/D+StzYPBjY2NHQoS7A8QeluKLqhqGrjRUYQ2L8wbGc/BEAyMFN/7UX/gD4hRBzDYoU8JwMTogQnFsFGKpVLCoxxiSab9eSXfutt1Vmyw8+Hh9q4pEYaSdWgbD3RB8aHv7WAQi425D3cCYAkgBwCKBanfr9EgD8lFVLjjv0qFQrsrqqag8uKOmZhW2wH3m7tLwfCP2iD/Gbq4jwCfdg5l2IgQ7AYC9AlvrpyUxmzO+ndvBNsqNP7fd+ztVulueZ8XZgW7Qc1Nt6vDy+Jbo2+tuF/8Kzjd4Z6D8HJwb+BZBUQuLgsLQuQFUCEGXtG6okVScmlmrGe8yTlbkxwmMQdaLQO3xo+WBnBgqDZ6fcc5l3HQQgkYWQC6AQkgLAYvBc8s3Kp5XbN1dkQ5IqKUXLLWKGrDliMNqam7dYuja6sLA9ulCu1ZbHe+0XLiwfDjm9XxfboEf3JrAXBbjcJADBQAkANG0YGYocqN0sKZmXOaP0rKwzKUcIqUt8JvLBOmU6IXlKU0RR4jU1V3kxszS66n8B+uYMr+DuQv3TMOBADvYCiCSk8yq5XapSBv1s1KodgBSqJ3VFRY4WMxmbskmyyGZzaM+y8nB3+LBfvgt/6DpS8Fp/gCMTgwiBoyF3a+9EQJIk6rfHJsqIdD2f9bNZkmEsTdpteZFaQYIZ8PsBhqYZkqVU8lt+6teW4d+xh5oX3QD0nks992QRAjEHWNulFqX54smT6JblyCIfomZRpmYYLeo0q9nU1ghRJFpX4ilFUTQ5SyVDM0AcB8Cq/8o3EQD3l+L+PxdvLvCdInDCMd8yOnwBSciqiHWa+WlLRULqhE94GjmAiRkLWtQm8cl4XrLVuNrKvk8RAChE5QClT58+NZvLHYCDGwuFgicDPK9tLx68fP7870Bo6+nx4WZjJhHTsnAjJplkyPZpLL24Kbco5l+v5GfTsobdoV1kSsriaSKxkwQRoIqpUgAkfLFYIhE+OoHHlqVfAWcTxJvDvmO/d+/akStXFEVvV3PVxsZvlz9NJGI+SGsBQPaZOgCozlPuqjZLWYY4QjQY0tKvkXgua9v5Kq70ArgCx4yiXr74a/PZvm8rpouV+XzW5tmGVJqXp8Ld78IBc+8LqwzSEQeJ2haPQzhCSCQWUebqdl4nKMiaBqKEtihJKVNZBeihCM9MnekbgDGEj8vPRedljL0LkMnljIgvpqUhhRTRkjHLIKJJDEPGKjB9JoFA5AvOZVtxU0E7DQAehfsuwSrzC/Fl3oqstu90HPb5iFC7MlusxuEoFMPYeSkcjGsRThUhskyCsqoqGIdHsXDf5ENkO+On+clqVe8FSESgGAzwYZqwcxT5J7LcSJ5jJyMusVolOhp5hy9rfKk6d4I/1X8AqLVoA0AqigH3EITDZiJmzuiqGcZ45ZQS79e1KgmARNBQMrOVzGRaCa9pZCpFm0KL00fX/SlWc6sAmprSZD4PdFaGX4z3o5md8aXa0+14cMyWpJYqaxmscjqrmN3kjjmfMbkoSWMkjORNyBlqYRdg7KS8FrKT5JQyfd3X4mSlZ/0TyOAALc1papoRY0yegVE4w9BVnlFU0moLn4iThQTH5MhBTdMipi8WVAzswtlisYiKiFGXXlzKY0p1LdgLEJmTaGXS0LG3Fk+tm3yprEkEVYJHXYN9KpNL6wZrz6kRX8IJDOQ4i0+WiyCeY/m65bfzGS2iOlx8fEpYAaz06tZrls1Klh52JtF0lrVW5xs5IZoW5HuB5z8ZFD5IawaRspnEJNjlDWPGdFaIZdk2t7Bn83kLNRXZnJZgxIlYNugCMCkVMRh9/ern1Xz26iWbZSLIXkU3VL5usKnS7Pz8fDHXnljXR3/bt3rWtqEoWq4hSAJPD9nIBkkgGbxZ0M2godgYT7IxBBW8xODBCIoRQgITvBmDl04ptL+hSzOkmzf/sJ77pMQhEoGSDzr0LHH0XnTOve9+Kch9eRPdQSWRCckRYQl7qIKwZxg9jYmJmz5KBbnsimg/VtgfxrcDLu5HwajdcRXtZ+f33a+73XaijmzbmiG1NT/q23Ygk40dNdGrBEjOhr0EY4FJ2GcPyJnMygUISsA1Q2+AB9rIOPzNd0FX2oVqcX52eDT4vV1n6wRUAf1QmRFtwm+Qe8QvADTvK4YydFZQWBSC6R7qRuQCTE8KCO2afZACXKuh60RCh1ETg1WpPRLCjPeKkvy6wwsNP5MLbcCH44dXAWLyaKBh3Ex86d6JW+K/bUt39ghT3hnqt6kU0DEfBOwh4EbId5ijGVcPZWOIMQRwxHUa2L7NxnfbJNvdqYO9xmqJcJCyqwsDmbNE6PSfDoTNU3vGAqaPPcBjjcwC/bEADRknROCrDCUXsGEPeMheAf3Ho7LN/N/rgfbF5+qKsB9pOL/G7JAM26471TBGPZnG5qeVkbCAIQ88jxT0SwIiDadOQ/ZtEgyYYWIYE/YA/UgwpslI+7k9ar4aICAApBBvG7s+YoBXEbcie8yfrk6rlRExRUDuxVkA/MZ9QgrgaIogIGQBfF4ofWT48nmBf2hf3Eg9EAUqDMQeRY1ICpBPdoBiWIr8oCpXIj6tH9u/AoxIxVrEE8W9+YA75KsQ0GA7QhagchpBpTYg0cBPbMIRYLssEDYtQ6uNjEuWlAsY9nq9hg4I6o8Os30w7RN1T2cF1+AH4mWAlr+0ZU3OQ3XmD6iNxsqdVRiIHwONv29ZPctl4s14c5EXD1qqmsxw1E5BgLBcnk5cdpCBT9PBIJgKjwqILQhP2b0DmqvVfL5ak4RpUpAXthuX2mQTQ3CfZ3RqJjGwhwlVZcYutWyywtnNTdTAhppnO04xnYgrHGBP1xs+3DYk9GM0kHi3na9g9OXtOQXrUFCPGYZTIxpoKt+WAMf0AEd2vrz3obKbpi2GY/9iE+ruLApGfdNjlbDdexg85F7P5WiARpzO0UC7ji9hqrR3np/AWcIcYD+goRLpg+gQwt9oItVweAZ0DSrgwDa22Sxt08ewhX31XWfvxEwi6a9Lhah5CcwhAC298PszyGcjAdOFbRejQ9UISKIX7GdJODXIxpbd/JIB+jLytS2MkAOYEPj0LBynRFmloAD4WYDkb36oQsbvxV02zecIORAQAQsgTT+fkaZ8CStYf6LLQbyQEB48KwXUgW6lgFad8VQAc5qL9PP1331nBo85C6h56iPnFgKAyqfD4vWguNjKw+jHT6/xHR2PMyJHJ6szSf22SnM3RwyLPUOQhHi5gI/EELaUYWaSo55VbLztNhndXbvgJhbxcgH5vXK043VXkqyrkgBLOVo7r8jDVxEgCn5v12o+UFQlwf0aK2xlMQGv5QGwZy3E1xkVdWDdOiPbyQ2pWLxcwDXJm3xNd3jr9IEhLW88s2PxbfAZGgrsyovFCmx/S6RZTlMrx6C83Pnw5khr1QKct6QvS6iVCitqH5z/TljUylHo4Mo7ovSfEtC/LxYf/uMfwR+nncxkU7Y7KgAAAABJRU5ErkJggg==\";\r\n const rott_fresh = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAABHVBMVEUAAADxACHuASDzAyNWkjnVAB3nACDgACD1HSz1Ji70ECfGARr0Fyn0CCVakT24ABf5Xj/2MDH5UjxWlTb7a0SuABSnABOdARH1ASD4QDVwAQf8d0f4SzkuKBhRlTz4OjSSAQ9blj72ASaBAQv5RTf3NjTxDCj8g0tbjDyKAQ1cBAb9j08ZPyHyAxv6ASD5BSU4bTBLhjo0VycxQR8+fDb4FykIVCv9m1JNIBeMYTJzFBdNbDMRYi64DiBolkxSmDTSCSJvLCFbkjFxnlr+pljkDCbmJjzuV224STFPMhzoMkjqGjTrESyOKSd1fjpsQDSuICibDxzqSVxZc1EibjrcOzK8OUaiNSyMDCLqKC3OKyrZGiqPUVZHnzrEWme6h2JkAAAAAXRSTlMAQObYZgAADOVJREFUeNrUlLGuozAQRV3c+jZTY2m6KVxgG6EnGREJqldtkfz/t6z9SNjdnsTaoygghLiHOyPcfwzjtDxcRzbRaXEdkY1jVwGQS0+BnRrnnjugNx3D3fUDN0vBdQRaQl8B5CG7jmgchp4rsGoZhuN0X10HBOkQ4GauB2D++q5vL1DXg10sf/1yKwC6D3K2TbFh+DaFyGc3gDzycKsCQ1F4v7lPcqe0zndIE0gq1eBZgbqPEIUACYlVIBuo9+lZzs29m50rAQNAaBwqRS1lO5LXm7g3skIEEBAbY/xpoJJKbovA3VX4ziGwRVdI1ZhiK2I4qAWAYFUk3LvYCRpb0DRNY06sWD4EktbrTU782wQoApIQwMYQQlIY8RTIxVq+VIGrPwn3tc1elT8BgnZQTiGMbR2awEuBIqTR7u5aivjWrfcCavv7URhDMhWNw0lIsd5jcXRXU0ybgYiVNPIoQae5BU75jK/Mowch6+4u5j4ahLGEmkPZqgz9Y55D5RxATmme50dUyDGoay1SzkdWMKJSC6iEk2JGH6fHskz4w3ptDTmVklITMI3LvPxtYCoA6f00TtjwhNt2pQNFVQkR0tf0pfKqIZlHgxAfeeaTqL9rZrGLAHI8dcNjXsYY2TqfG0uLehmA/yjAX6FgEGEVaPA3KWb/mzQQh/H0TtGhvYj1hzOOW3qZpD/YXimQ0GID1aCgjIkR92L2//8bPt++sMImQ32WkQXGns99X4854fu+Eg6QXKFyhB8KVhWBcwtQMOOp/0TAlav+N7uwz1tB0HcXBH34bA6N6VCqeuZ/b2xlKB06m6CGFOhFr4o0FWS/+BGYykUz9EOo3+0+KjFofv87wscP8CNRCarxB8oqKGon7r9XoooOJtOwEg2HkChy1H/dEa5D/C4KLoyiCE2GE41rWUY41G3niTB79rjBOOes8WSSrpLhsBf1u65S+Vv+pffGjoB7+K49TJLLJBn2+q6Ha8GtYF6TWs6m2kgptcUszo2eAKId9R/lCH9fjB7e2A177WSVTngQBGyyGobFbroXgNoxngaWZUnOOB6DQJtpeklxKLbI31W/M3a6US9ZTVjAGWNaM99Mkj7MvcrSc+G5FQMVTy2L4/hac0nv06Zg6CsXC+1v/F1su2HyjAWB0do2NqljJnMlgFC0phiFeYtUg1AgNGoGWASBHpilJWM8MLyxGvZCIHiH+6uwN7yc2LYx3C7Mc+k0JH8n9xPnSdR1xyLHKeeh8q6llghCTdySNnuW9KKuc2gpkv0KBWVX7s1KduYJIoCj8r6xy3akHLqdbaRi5B+tYNXFAsk1EBCFwxZwO0lZYGyG0DcL8+elmt9GaE7YI9qjiWGTpB0Kh5AqAHEtrV1JpIQbngLhkEqcJ6kOfC5xfG3q9qTF8gZVKDyl1HnDMEOxHTmIQlWaN7FEG2wDcC4lQ0nglw/4t1qKug9AzO3OYgHzugaDq2XeiR4WwVlgozcCthpSdjcT2fsV6LsAaM9AAiEdPuS/YBzmjFEBVu5PKw0GM88ris4dTZp2h0hN47K3WUlCjGdUhrtiCAICo4PGs/3+Xw3zJafoI/mDAQ4N31uA66UgAKFEN1s0TdPYeYumw5Cw8jvrOGa7AFLmDAy1QIN6n/8XJMviNkTVh7MPCOAIujo6evr0KlYAUEI4bpQ+bzY7HZtDzEyTCK/kAGo5xVH3iHf2ADQ405xT9UPwJ/dKrVm8FMpR9PHUCc8QnSYEVuTBMBAg/Pko+LUXQHP/0x/9aXxS/Ml/UNoTQWs9gzuVPt0NhKP62VcAFATGMHpfEjqKJoKDWST3BYD5wec/+H/yOewBUD/+1RreS0/AncwFBSGc/6JXCwSkgaFsphmWZT4RLvYCUC3I+/0/M78oANiX/us1Du5hL5cl7gms6G6UXYOsJACAzZjUWBRIjkAOZvsBkAR2fxKm6BVWO//R1Swe0QVLCbeUwJKK2lmrdVQSAIAmNjWuSSPKgQDAvhqQEgD8Pv/vPsNL9fhfXV9k2XCef/gKc0W93jxbn7xtAaEiWHRswxE8HaxCWroqDri1X0wu7gFAIiGsniIBeeG33p6crNezi7Msy+bzeZZd/Fyfvj7ZJqAkcK79gM27SBEBsAcJPt8NAPIPUQTq/q9fn54eH7/c6Pj09DURvC0JBlSHANDat3QaCSiWGgD7xe+GwPeLDigTUJ1/2x8AxwAghIKgDAHINSKoz+jKFPvaelDyTgsERQY6W/6wKvxflNow5FmokkA5wAhn5kl0k89i/iCA39xdQnInAeRf2sO/popgOwmcSbSQXvVdAEjrQTF/NwOaVjC1QFUAlX/l/gpfdwkIAAQ0kLn0+ZPzsYolfxiAW9uz4IuPVkICtgJw6/9qozpBvQpsAwAs/bOucxAA0/Z2D/q6BlD5n8K/sn8DbRBAUA9BMY/JNkhHNwA4oAa43gHguirBDcCt/5uNiIBiUIagVZZhBSDZ+U1sHQCAlvlSz4AE9Z0AUAI2/r97NaOfJoIgjF/39JpIjPGhcvLUnEkRTY8nosU0KYlCQiQSH8BE4///Z/jN7rTfLnN3W2r1E+Tx983s7Mws5ViUOtAUqAFIGu3NkwX2v7wQcDwG2toPYjFgE6B4OkgNwIHvRRACu327wM+sYNIVVCUTwnkDZxsDSIDyBf1epA5CFYiDYEB7kYDb1adF025hAA6u2IUwSpycAfjBAHpglADF0wFToPdgbQBjcbHA0pM3gNF/HRlAJ/WbgGyh2gS8AfI/QOrAGGAR4Pt+ARfZ6B30JeoCZdjFbAmoAfA/f4aDAQPPwxGUt/dZvKjCPy7jmGQDBpSvDgYNYCqulviRNVCJokHgOImMgePUwPGgAddWq9zxWwNO5ojewpyBzBGMyrbsJys/4MdjGsAwbxwN7F4DUFujH3XzVZ4uBq5TAzyCvluQNwALvp77DDB6fI03A3FUYpN2oQjZB9TAdn3gmfBzN4/xez2NDcgDtpxFnfA1O6E6AD7phODHjWjYAOlQwD+lAXk5l9BsRgM8g+BAFc+C1/EsyBsAWfHGQFk75x/l9h4m05DzGHwzDbc0oHQRi7B1o5qNwBfBlvsADTjwc7UvdPIPrjbTGIt8qxuRGjAbEfFaAZsTOMsaYPTEQ/xlyU90ITXAlYg7KXdC8v37iGuxP4J88lP+QTQLXIMLzIdpx1ZMfHgfga8lGLZi48BtZPCAy/eL5F06ClVIAw8dpE+T+GViLkHu9AEX0cBV6F1yEXkG9mVCvOH3GbC1T/zBMnqWtIGPKrAOvAWKfL4KMnywLf/FwR0NuFaaeOjG+jqnA1oAXPB8m+o+aBNgkg+RLnzod8EqbPwccakDfR+LB3ER6MAzfh4AlG18IsWLJskvB8IWwzrcOKCFAAc+5WcMbOjke/pkghKg9C0BA3oVz9RBsAAPgQ0pXvncyO3UEfWGP3mFEqBmeB2LgeCAOaCFwIZePuQn8RPvpXSDB9+fAM8ABhxvAh2ABSCkbKWTD8Pk5+4e8a9eLYtETWjlZeKASaDEk+CVf3oa01XdyYeIPzz0J0BdumZjQK8CLUDAqhR/pvyoBXfg+/mHxQOtF7m1A72N9EB6iB54iV+U0i3f4KEb80mBnIGra+aAWfBSNvFJB0o2vjx+Oi2M5mBjL3GaA7XgLyRNGDykcPJzpz89nJ4wAUxBXTa4CmqgPIUD0frTInwFtuDJt+m3fBb/OvyTE3IpV+Nph/9Erow+MFQDCd3j1UC+8zB84MFPE8C1ZD5vSjGgTVFMYFFORTy+Bmvf4pU+PXlTdKqau9CO4gspSuiAM3ooir639hg94NCv3k8s9AjoQBNBKd855j6TfcGTLwbOix5dOlfPR5GYhVgl+IM3H+o6fOUfHRW9ei7lJ+SapWBlG18+/cCH/IPPA7CaOxjIiXTLt1OX2Q/hH9kbkGwmTkNkAgb4Cs9EDyle+H0FwN9XgZqNf3jjhMzhvxE89K7I6HKEXrgFfnjjY+Nj7R9l+JxKA2x78zOHz+zn42dHlKGAlujq0qJh73F9l/h35OcciAHA4cHwH9/318EP8G1Dkk/RodAOqA5+b+eBkuRDRV68C04+xHGd5bft0sHah7J825GcfMxsr15254ACHYr4F8XjNGvLqm5cd+MjvnfsEA849K14rK4bx9EYb1z58Nn4NvxiF31xz8vwV0il5Rs8+EoXMfka/k566cLFryqh506f/CT7ULG7vtaoxNG82q7zsfGCvuPp2y1phNgZfnf0pvMQf7EzmhO6ciPi7eHbsUP+x2IfunqWHzsGz+TvRZercTW08unQj0///FexV33/+RQGxgIn3+Nt52Hf27eHlfBVSemntc/U7193K8WDDoGvBt7o6V8g8/9av++Wy+Uk2XkA/3F+A/b/1d2t133xF/oDcBqo5vcjmG4AAAAASUVORK5CYII=\";\r\n const rott_user_up = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAYFBMVEUAAAD0AwP////lAwPDCgv23H/VBAX55ZXn6On766ry0Gbs/v7u8PH39/f99Lvktlr++NXvlJPtbmzoHx7wt7bbokbt1JTpUUziwH3v09LCkVLqNzTFgSquby6bURViFAaSG8ZdAAAAAXRSTlMAQObYZgAAColJREFUeNrsldsO0zAQREul0TAr2DUCm8Wyk///S+xU4vIILfDCUZs6yUpzvHaT23+eQmrt9g+RLa4Rk7d/QKz8WC1w5ZF++/sEEMcBB9sw1+2vY6Z6HuVOMsbUXzLgD2NY9Ha/u4pml/2dVSCJ7wYqXpYBAMF+LsSq+xOIoOv7KXT/Ei7aakDOn7qzjF4PXRIJmmnni/5lDrkM3s6z7pomuYDI2x9APVzY03ssuag2BgjAS84cebOI3h1b8PVAsxcHrIaKS15ENgPXMbm2Qz8MZrUW2u1PQNXaRFpY2QKQk8A2iPTlUzIsRiCbbn8CSuNMN4P5FqAEGraDvb8XgALGOePM25+Acu9defQ0+BYgDegzYSpeYABYz55X0etW/tvABYnzPMeYLBJFYz/PSXBjZiBAF8d59nrQXzFvSi1mOq9pk232LzlbcWmfnSuKIADCTE5AlHr/0np9hUCy9zwGW6NB7Yvvp99Kd9di6cwzaIRhMdIFc+lRxBfk16OOYKUr4UQ2kSIBY5EcRkaYAetLmykAV4H26AUCMSsE96JR3bljynvZgvKWsosIwHrdIiQ9Bt/f960XCIAUQZW9DCQAX72FGURvWOsciHUw9DkT28A55i7iiwTklwIjwI10iVCUxD6zzzECOaIaIEI5q4sLPBsOmLE1FyxMMPEKxcZErVvc0XVWZT2OSlx3M0ksnhaIgEqO9nj+E7EOctqGTrWgzLyNo0HlOA+zyzkmuQemJwWsqrhbF9cw64gGsAgwWI4uz2td9mbc1z/lnFt1yWrHL+FnBeBFcrZrPrXCXaRcatnPM8Q8mtCIILD++m0GLFZlE4CYR38m/fHSc5eg6LaIyOYIkCo6jlHNGo2CCSqiSgsL05xNizrG7wq8+eARFvJtQNL7MRB9xOi0qCbS13zXxU30LF7u7wGQVoMpp1ysR/5e/sclMGflJSCRyhF5jDXlxY4AuTveDRKOcxj8sTthYUbCe3cpAzf+Tv6b5n12qVwGCAqGvjqKsAve7wJdBrH083g44dI7KrbALPJ2VBd/uf+L9BamPX15aZW0kGKGbDHW7xIzLEiqvHs7DlyYIXbr6FGzea4xoQ+/KvDZoB1Z3EU6DSQgNVkYbe1/koItKEDrzdfrDsf60MUG+VfWy3A3jSAGwqLEtWwp9gnqZbO5Pd7/LTv2tkL9U+XUjpASorDzMdiLPZ7DuOdL7XY55/9ppARJVUACMG9GkDYQ6JwjBE7pSKiFjeGnkAfAYR8zbBujkea/tRsiPeOP/Odwre+gBKgaMAOH85bvW3qs+EmL8p2LhKn35hQ7yrWB20grgf58S4ITAIK7dYjBzNWEUtkJdSYLw9c7ZfzzqOfCClF+Hl7jQ2/GjKetY0Ql8+f3UwB3th7N0ADrey9NaHhmYVR953MtAM8DaCsKdYWYRpCoFLY7sno+Q3kgghMBXPvGyrK9rzuApXmfh1vhpCM7GlKd5nOwCphSrT6HCooSEpRTbfv4EYfzcf0ywQV661nLdQew9On7bLtbnUwrhRHqmj9IRTQlxvTLm6XAMTor8TfsSzuP6+V+BuDJsu6ArLxjr6ZbQyjB3Yhaxl1fd8qSGcCfW2hMaV2qZ5vHSLwi/rycSuB6wHrlD7PeYcGCttqABVtwsP6eQ41429aVDdSoAqzbgGqJfTf8bnE9AwDdpUoQABXs6vjjCKf8K9HqhBmWb39dV0Cr+QV2mUjsru4VD3PgyDMA0KcbJFBTFrjH0PZxTKVNeK1g2ezlJQsVjwRJESkKAIjCZOb3y2mAQiAzpj0XvTVa8LePURGwpsjbRrUai9iqPAZwMRnaZAcAifQHDjsPUHIfHlTjEM4LUhNlSaxwJVpe4xiqSSVsOR458Jhay1dqBKrvNMBL1/wkGI82Ynr1efoQzue6IIg6VkOl7pw5tLmPowGtllT1x/Xy0v3Ls8Af+rx5qzW4u0LV5VL3TY1ihlX5YAGECZNYH5NByOrxWCf9QwIv9ltFng/ZquoJJpHlzmMcs7amtZfXDEmxV/J/AThHUBCPW3SKIM61F1JNL2VhF4yHvmcPtNZvjzL/3wAvPX6yXgYrEoQwEMW67B46LNGAG/L//7kRFx16YIZifH1u86wYUFUzG4fsa8z+T+L2a9qTWZqqzwts2qS8gRfotRynBiEQ0HIYB9WCC1c/un2BUwIOwKMcIi4ASt1KDYmeiz+plIAisaMCnRLoSLycoWEQjXkZBhJpDyNEs0d5LlYKIVCaIFllv+HKSES1a3dwxkkJ7LZNHAMxrf1d3L2qCwa68kNiQ4AdgxWiYbFziGj/RCu72GIJKBIlBRQityUmOwLHwu4Cz/qVFKiAwD4QuDcwRn1uDgX+Yl83gReqTZBf4wTmX3/t1tFu6yAMBuB0RAjJ5IIYCSHe/z1PsEvcLGkanB3tZv/dshR/gN3NSx8rAEWmkPbSBaiTN23WOAWEx0G7ougnHoK+MahdmARwUOv8oZf7o34mQO8YtO1iP0AaiFfqBjQ3x+sB7SyHTkCCaYK4v+94DDh5McMEgKYTgGUDiL0AeYZuATi6gc4xAA+uG+B2zwosgKwA5AUwoTQS5yufA/xuXhNMHoICEMFPUDoBOO0AswLAcwjew7rKVcDX80X5JqZ1kukGmBk8ySnpHCD//AiAD6+dJBKgdwyOAO4iYEIBgEc79OaBHjzEg4WvATy/Z0ydpmwe/QCT6yfX5oKJAgIIB4C0AjKXNwi0Dw2Az26d7ycAymM3GQKQq4rmYWoKtZLiBAZD7Vvk+5SzBXAEML8AODMPkwYwg/OQdoB0BDA7QDCcAK5uY1AAEngHs/Qy5RywoA8A4FEDsOgXQDDPatcAAeQRJy6AbFQAk8FBvUo62ydAvhzNdwDtV5yGwouoAOMTX/MwnwCcPQAdH+OgCPWPQ0PZAHi354BiKAWcg1kHsHUM2kJpBVB3vQO0XoXpCU8VkKwOwB9uO5m6AHJyznu0gwpQaA4NBT3sANAAsAfklyl0WgA6cK0eurZ0NEbaQjqOk7+/FWkIlADLI8TJOkBdIlg76ASB5pATrwDknMLLFM52uAFwuF4m5QDgDwEyhUkNoBb+DsingPbW/DKFRQ1gfw/AbwG0BYdqAN/gOtAUcPgeUAe3pj3hLrJqgM0yh6kPUJbqSyogqgGjjTREG4D3OwCV2760KG2NTKFOwBvYbs6XzwBwSPXRAU2hGjDzFXJ/fQZIo2RLqR+CNOoBif+UVIJMmGyXSe4AEBnAn78BoB0UW2NyWzxdB/AJ3gCM9Q6TpcR3ALkVuwKCAOJobwAiNdEWMEvHbQF16gTQpjAQQC3wIIs1gOVyrwC7fUfQkMdxuAMoAPF48VNAsu1rYLwJGBG8pcj97gAOjwEIebwNGDGWy4AIbSz4jSj1lQCK1LsGkDsZBXBfUDoA/GDkDD8kQADwHwAZ6ALA7erfA7AhhQw10XJKA8AKcFCVORQqL4C7Ak6tmUL0DZCgxT8B6FwMqf4wSv37AAk3VttuyS0R7eZX40l9vUAMkvfPBHA/e4B5EwYo6qsEj02kfEd9jUAUchRy9j9eXgiKDD+a3ysv+b3ykt+rLtFX//+M4S+a/AMdOBcAZu0trAAAAABJRU5ErkJggg==\";\r\n const rott_user_down = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAArlBMVEUAAAB4kzRkeDBAQEP///9xiDJrgDLj5OZUaRvt7e7p6uxccSX32Xv74Y/yzGOHojz08/5bW136+f6RoWVfdx7x8fF+j1BrhySksIFQUVFlghv866pIR0q2v5xqbG/w8PnEy7NiZGfb39DvtkfQ1sXg4uD19vR0dnnRnkw3NUK5fTpXZTisyUv99Mbo7N7auG6fYCdFSz5pdUlgGwrfy4rr1KD99tl/PxaHiYuHgXaB2/wWAAAAAXRSTlMAQObYZgAACfdJREFUeNrslutq4zAQRndkjzaJFwS+yTUbMMYJBAeD+/4Pt+NLPLYradVs+2fJSVpaCj3fXGTlx4sXL168ePHi/wQeJAn8cPNNboQV356BzbosNcIe/OYEMFCSGlRSVHUCjCKAwC+XshkHNZnPTX0MiUqv9LJt32GM8D1Faw1kruruGj6oERc/tMHtFgStUl/Yg0fROBWdLeZ4+kpK9vdkJ25v8AUJYCDXpS7nosnH8ulNr2rxw+SfExD4L26FpUbkSa/l82sC9NY/J2ifDACEJvVS9CI1cO3qqlj8qiU/JxAKQH9+yRDGoi9ZuB31NsCxa87nIlGgNfsx2ALK+yRM7rnoeNftfcnnolBDl/YPIPU2NYCH4NsCAASlocrsZi4Zd2b2y2CP58MASa+06kLblBex1mze2bkBuxaAT/fJn2e7RR9KLkZzSVjNaN0Aovc4CDj6EbtdyQmgtjUbV68FPgLM7R0ID7+SdRhmXcPNtogBLQMg+uBjgH4I6fZPDcjJPIgXMxu5YC5/CYKc4f0WGED3OdBAqPs4Z60t493m4b9o1BrNE2BaIJx+HP2mkvlXzjNIpz6N8kRxgu0E+EZAewDAOQB319iArVQlRUHPq6bujtewKPkMGPmNgPovDbjzUFeV4iiddyJPEpKO1uwarsi1ZQX4QgCU1gfA3AA92dlZTqUu0o6l2/u41tYV4DsRERwNgPtdsXUutapY6uScwoPfgZkeCXsDJE0A811//UmsK8BPAokSbQ1A0NQAURua6wevgLgFFgTI0hgA5wlAzjdfzHofLhqtK8BLgJg6J5AW4bNUqVcAKa0rKNWv+6F6zh5vdvDNOoKeAoBtApJWILqEz5KU1kPA9JKwPQRwXIGnye2HgOmFMYCCeQd1wjvIn8U8VvGa1aj505gdwUtg20G3LL4eu66u66apqvO5IBIiz3PUfBcHdlopItMOIiAFUIdmXdSxuzxMZzYBUhFlyvAtwYfAFeBg3EEcA6TFqJprQpQlm1Y+LSUa8AwQGT+ITx2QaXpIo2hxyQlcI9GMXwd6KYRxBXA8BGIQ7EE/OMCbK4AQAgwBcA4gPXEFgP65AHQKUT4fQEoOYPff7AEk3BX6qFcR1lkkugIwXxKAf8Q5yGYEgYtIfDwG+hFASiHFhtQbDoDuANIaQKmtfT/vnN5bEno/WEagPh1AIeAUICrowdfUzOXnz5/dqetORyLLjtl1JibCNbXQfgFa8eFBkODcAThUYTz96/iThE3kF+BGAdKPdyEuAY5Gsj3XHWEVoXcHIlcAavbpZErgJqwO5gA9f/cIEFXxaeLowC+A+zZyB+AQTmwB5NMB8E+75tqkNAyF4dKhF5qLuGAXjcilVjJ1Ou1wWeD//zHf04R0UVplvX3ZRwrqzvQ8OTk5CdMlgW76XIbz3xcISGCMdZcQd4qQQDsFH7vpF4hJoFHAdZcEpiB0nfBjH91FGAwagRskRqjD6Q8IBK3AcGxAbxk/NJ+4xo6FAZ+OEV7fCbzv4ZbA5CIwmKYTMLPMLyyJzw1rkOfUoc3QbUuiTtgv4OgTCHwW34Y1uC0qAKlj0uC/VAA8OoGfAYupz66AXQym5kQU0PX2/dtO3tMYvhcwGQhbgX7CZ/s1LsfAAIE+bp+I7Jku9O/AqrQSQUAj+YcCjlbgMSCD1d0C9lz3uwKPMBjgbfV21Q0KyQk4WgEGXixgedyu7hUYOIFG4YcVOO2JjcsJWLarT51AIPZ6BJb5ZzSd9htqECDCtRIJMRc+JOyHE/jUzRbL+IbAgARwoRcvFtSAbeNNojy//oKOxtM6tUbI0S0BpGLzabV6eyXgd2UAN4hnD1EeORKCer9lASU4rVsnq0ROPo2AbvS43VDs1afN+byBwnk2O8Njs6HrlgBwApNF1EGeO6dR60S7URLBKZ+zy7emDyFGvTmdqizLpF6dxL6aIxNErwAIWIoR3k0ySkYPa9eQHsPNaX4QAuEzKTczUdTFcmPZspsCAysw9dej6EUsooBd4gd7pQSXGZegklwXmZpbAZ/5aY9AGM/H0UvIk8UkDg2+f1BCCCmFNAhRisNpA86bm20APKvClwlE4xkEDGz/dBBKYOCEAErsEf18Pn3Cqul4YBPaIngYU1nRLVvyXzAYz52Anx6qot7Xu6MR4HjtkQG8zpPZtFsAfPDnOPZEo4VrBK1Bv8Ziafsi3uM608Wh2uGjQnjeUM02p71Q5aHrkY21Z8wP6ZRjnlpgbhsXs9r6SHJUoW856hJ1iEUAAclRj4ScU20o1S/wvMsxn1zMYxtKi8kLVG66fJnE7pRQCYTikgvFJYHo9E9IAe82TsDxfF/qTItzyVGFviXe01BxlaooSEEURz3Zc6wGDrzuKqBZvAkDTiVwacmjBComLeMlcwIThcL7MuRltdtpQQK7426P6ELXWnQZkMC1Qb/LdbVEiyS9GLCBkBjugxoud8e90oU47na1oFToo0ZyuqrACrgzyT0qQToJpu4HFec0B08jLRWvtDjvap0RaI0Q6EqBu7O96x1MGVm4OdAQoCzAQgKuuKvE7jKEQbOrxulnPL9PQ/8yuvuJB5wjZBPO/E2ZSizQCVADnQZ2MPiKuEhwNiKPLfJB3OXBfElh8baHBGjGXu92R0qA9LoNSCGcss/jyHRD5xHeNy+xJgEUvYYGpYEEUImFkEiB12sAYn/9YE8gdCJ67uGqrp84ReozSBBcAZnx+lhXyAVQiu9ln0IcfsYsjNq9yOYjcvkwHtPuOagKbEjc8DR8UpQCSS+hIAAE784CC2M2Q5tJENRpmHyMvlA+1j+fl+2x0Ei4VBTv6enASQDhkQ6KX5YlftjlEBv8FE0GGu9IIzGZMPOyuK4Pxi5l2q7k8JBpxaUuyuGw5ISg9HOzIUBAYVmattxj4TSW68TENA75JR8/1AcL3X6QFRh0VReH9VOpEB8OGjVAo6eLNwLK+wnu7G80IpsNR27y4eojZLYGWMg5RdC63tUKuYAC2WD0mBGaAJqRDoEOC3hsrcYX8vj+bIz/Hc7jqTWIZyLjMtO6wIZEFSBKXhQHbg2gJECXQH86sANh/4lGzaS4Q5OxSGPfwL7uJS9AVheVORyIqpIQKCm+kMD1hLs10jRlQUoa+bXGwzJmrhfIrCjqQnKKpgRHDtANSgweb3zvecpDFb6M2AENrNh1Yo+Q7mAE4jeYeBoz4mP+dUnjFgetUX6V9gjlBH7LY8pCo4EVOxxtWwPNJf7Q2BV2IqmoCdXox1gBhffnsJlIG435eh6z9lxw4ARVm9BaUTIgQHuz9v4wcUMapDH6o42PQjzNaPgeKIuaFiNCZyg/zb2/w8A1jsZiGrNJ+sZr0JoKEdkngcz7y9guiuvZ78+Zs5AU0lPK+48o75VXXnnllVdeueIb1ourRwLqIm4AAAAASUVORK5CYII=\";\r\n const meta_icon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAAElBMVEUAAAAzMzP/zDT+/v5oX0elmG641eaPAAAAAXRSTlMAQObYZgAAA3ZJREFUaN69mVFym0AQBVO6ARL8WxQ5gGulAyzGBwDL979K4tjmie2dmVKo8nxZpKbV83YFBH65dej/lv3PYbPqf9tVTw/29yggwq9nPfL1uwi9Xfv6GUTcz4r7owrzD2tHP2KIB3j/qMVQCPtvU/NZ7bSAEA9wy81dCaEhfIHcFDVCwRP43bBeQ0LRj+qCIQ7oB8FXYD8JnsKB+bFGRwH9PuHJFBjQNE3T+ndrKpgBtG8ppeuqdSwUIDCX/emz1uOLC6BASgWhq89gJfiS1spFjk81gQEDqC7KEYBYQENIgQAuYbqvq61wMARO6qYCAVyCtwSF+4XABGdjAihoBn+CLqW6wkiAImQEVGiLGbSLsYiGwlIFNMzQUjhqBq4BM6RCWwOcLcC1oqAQBMgGIG9muW7WgRHwl/SsNO4UjgQMBiDrTykoBC+C9k75VCoQkBvU/Vlgq6AQBCguhB/yawRQ2ISAXaDQBIBCVwIG7GEBoLBNkRl2CQAqlIC5NoBCpMLyDdAiUEDLSIWxAJg/wlxX0DIIwGuBZqBCJ4BWEechKOhguwUMmKCqoGMCYBuk5Cno0BZwRgSGgo4QwEWkwnpAG0H7iBlSQZ8dgKugj+MGAEtLQZ8CwPX1zVLIDuA0fwEu64aAwqVxACl9AbSgUMh1wLff5aSzQAcFFQDrIv0Tn7GrcwRQft8TQCEGpAIAhQBwAgAKNmCWgABQ8AEnABwF/Rb0a3wBAAo+oEuqOVLg+QDXo1ABpzTeBEhBWBVOqhuFeaOgg6oWp3VPQcd0GBcWR4ECvDJlV4ECBIQKMzYiLu+uwtXYiNoIngIEeIMxNJ4CBLSKulF1FSDQCaAUHYVSoDkCMLsKOB8tAAyNo6BihrrTtBVYHQF94yk4ESiERxTGCmB4RKEXADNAIYhAgOwpcAICzoECJzD+8x4rdABoHajgTsAHGFSIJ5BCU1F4NnYRANb9asNa+Binp4IEGKENmKUQCvTmkzApxAJSYAq2gABU6LMU/CXow+eRbVWg7SWAGbAdKwKjBKDAXwT7OwhQYTBOxXikCgUSuAICsHrGwH5MAAUQECAFqEAC+32F/sb85M8BqND/LpZgwjsSS0ESGV8vAVdBFrfpo3l6f+g1T1z7X1TtJOx+WRdV1B9X1B+XG+A+wk+9NiaB+nGh/Wde3hMSN/8BSXUWJsXAq8kAAAAASUVORK5CYII=\";\r\n const meta_badge = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAXVBMVEUAAAA9PT0tLjL+96j36Jft2ojlz37////exHHbvWeemHVXVUy5rnbBlDViX1RQTUSMgl/Kn0HSxYZ4bk/ozGzq6urm2J3WtFmvr6/Qqk7Qt3DNzc345HZycnCki0vczipQAAAAAXRSTlMAQObYZgAACt5JREFUeNrsl8uyqyAQRekOIsSIcgQRX///mbeVGPQMbwVHZ01CVQZ71e6GStgf/00/BkMEr6To2e2Mpt4wgQTIoODsVsY93MR4a4UoCn6jQm9ifjD1uq5mlAWnfP54sHsQZouncA2ABDTdUzw27ilBGAo3dQd4Atp+E7hjFUQIwZgjPgEvEuD570PvffCm+sSePjtOFdjcBkp5b5pT/jIMg45H3T8KoVhWrFIqNJgYyo0BdoOm4EJmNeDWWqUv+ZEpDkXzQnjB8mGJFhNLeeCqvYOWC+VZIkMBAa4FXA1gLKSXLBczCXR4YqLyl2U6DIiOBALLxWxnD5/9B4CpdM1eRDIYhQq5riKf57n95LeTm1w50fli0JLAyPJA+Vb/Gr8DhGRA31ZShVwzIAEFGHmWbwZMBnsfo/SG5YEEXhhpSiIZxEbiDJ7Wm0xLQALr6QFw7pfBBEisJPDDIrkEFk0CUwWLOwxIAZ4VbrTZBB6HwJZelppO2p33INLmbSC9v9VWfJUM7hF4pgtIR0gdAB6s2ZaQk4CHZLBg6sAlgZf0RrAMjIEEZHN6+JZPB67BSHwHgv9+BT91HWaiOz1DTr8NTvnYWeWDteq7Cr2pjenG9xZCNEgdVJh4CuXXVlol2fcIFL822JKABSSuUzgDFK06rF7CKvG1/2EmrJpyGjFbqiB1QGi8shYy/mjsXoWV/TeGv7cPCAD4jx0z6m0QhoGwfI2jNWEQSEo1RvP/f+YcUBsyqSise+z31Aesu/rqItvMEm5XOrghQ7Ban0NcHib3wUH/S/iOQAlYGYPQFy/ki93qY1ISgQUJQGf0qxamFL4FaAVxDukL5h58U6FvFOvgHo+jbZjD+IL8ugPSHdA0y2LiHz24WGwxJ9Y8FQUyOlqPL4afgQ3hendA2wmgRV8x67asIKfFwt9HD1SQ/mdkO410Fy23U1bsf1fAGp41H+9+Dr90cL72/ZJMATmVtmPlQJn8U1DzoRyGIvwSeNlOU3e2Fjo3nBKFfpmDYn1o9Ar5ArT913ohir611rbeNVotJ5rR40kNyLBiPhI+PQXkRD1dyBLXc9AsiH6zUwXYRlVdUFL4LYF2ANnYLzyudCI/3LBfBT9UNGH8zN3fteClUakBawd041FRZRRXdCDr7wASDzFGcdEY5ztUFXWsKgx0oCqA/Al1FbbWwHHeBn7Ir6LVgGEQyPlSiBD7IgTE///NecnadRuDkW1PK8TqFbmrhhA/N4au/KqA73RcdLRbRRsqf1KBzK8FNN7SYKmQzuHlJwJEuIRLVryQ8ZgF8fxAp8eAmPOmZiO6XJ93BFgHekKQHSSoQEWgzsEY/JY2iS2zA6qizFBwemQjGEJEM3VHAP80aupLXzevHnMKha/BsPt1LW9eDsy9uSNr9XVfJsI6rPwtAYeThaaxrKMafC74ZK3PkqQzjoCS1OU8DlMnpMo0RNHHkL0KuMIPtzJD2hGEQiTWNA7rxZ02R2NIsXqqtEqSXriwRq3iMoLNFoTclLV81gNLgGDNRplz21MAmT4K4F9AsC0A7wREPeMSUPxn+gcB+H0BcQlgQ4RMCOKzLVpERRb4LKDhbsHAtgC/BQQJfIzI+e+eEhVyd16b0Oi/HkTGjW9KZLoxftKCIcv0YM/P5bRpI0hKHQ48KiBnQWpERJkWkK2DSGlsmnUQpYJOptH2guw+abSDD5NQUF/ISrPNo1iehpbvR4j3ZzT9N+h2+fyn+8ALu2a34zYIROHaBkTwCBCsqIrSvP9j9syMWJM4jdJW7VWPtLtOAj4f84PtaP8D/EuA9VN/FWB91CuHs34bYD5B2mOsteacA0Ss3nt5FLEChIHfa4x7mpneB9Bdiz3ZEF7eO6cPoE+0/VymNaYCTxWY9Z0no4YvxfItYIXi+lrvwigLR8fa1+7O+Yv/ELkPd9LJ/h1/Y+ZjnvXMuZXLV9EFBIdO/r8OYO5lh5q5+5+Eb2IuOgGc/Z9a/pq/EymA/za87wA4BV5t7/2N5XovwChTJ7TthWb/ieFDK8IB4GTvrFN1mIk/obG6gT9F/XqgbHV6DsyHHY+MmRqMAdY0UicEBzVNwSeA1p8snzLOQhgV0TxMYzJ6mVBEYTQ2AxwX6jrs276qMo7Tik1E+pkD5+xB4SYA+KvodsvxBgLn5SxBARbPAHK/YwyxZaxx3c2Wcfa0QCkteUR7H1+hEgCO/cxuLmEe7yy9CABSMIrwotJ/jtj9h3ddHsYyhlVMLgKwrAzAYccfWzp+tSZcZHAw4o/XkQp9j0hBGTs045bBssYZAJoAeHRA7ZHMq6g8BugMQItEIMpqjjYQgO1QxudtdEXhVchmGAyjaUAYwD0FuK1q65we7QBgKNSeAmSJwBqLGQhPAKQgFUGg5VhHLjXkui8Z5xOdAGTdC1kEPtVlTV0BiIu/KwDJY1kMdnsOUCTGZMSTxoc8OMsLY7kY3R3AZQAELDpy6j1qLAuK5WkzAJKuz+S0nQFGDpBzvKeLjnJJswKwFJlk3QPA1wkg48f7tFbiorNWix8AhbNjINoVgbYZILBPKHykXZD5cKQdzlK+mWisfwLwAwCeKaCNqGOxnk9irwdAWhnAIv0dlOBs2wQgRprwJh/zu/kTwG02jjv1bO3PAZZe4UswtTsMraEB4BRAv5cuieM5A3xPe0oLbaImpbpt3EKBUHiZ5w+aOppgAJQ7AFolD3SN6Bct/jpSkD+7Lz8CGBbvBqokrQ+AZOQzmb/s6IHE24vIj5sDNwA6AIhJE1rvyrO9gncuYt0JS+aC6glDpxQcojA2gLgZXoPRutM23qwrvQyA9uVuK/QMsIarJG531yxbkBjvhLTD0nFnrfzQKN0+irBMANw/ISfZAMzOQdTL99jK8cq6pwAeAAjc7QoMRB3lp23AIVhVmI9aViEvCqC7/lBbVbL0xtGTq1EtOlBQZgDVDIAEVV6etcRtgNjhXdHC/nIxhmLQ0G60x1gmgKq0S22yKQ2RVM3O10UqA+DLI8Blh6WzwmotRyJbrv9QsYbgtAUMZ9FJaQnBoxqFABPeh5zeDXPyCuphRDLbZwAeAJ47zVlfY/YYQNSdZUnm1H5YvroRnAeg6EoHEmopgWUG8AeA+gMAKyUHaaNaSAnU/v07YbWfxadiklxjCieA6T7QOv/Hd+In63m6rO0RwB8A0Pt34m+t3k7SE74AgJ7Znyzf05nATYLVS4DDV2cWVidReCpSFdaP9q1otWEYBjphNfHG4rgxFgoj//+ZixTCvGlkdWS8lx6lb+0d0slY5GJTSvvvv8nI+XMB9hCQNYLZaNGdZ3pC6/3JCv7LOu73jXriywCtD0z/hwD6tqTdhYArnfbivx+AFMn3Exqol60sTM1wmQA6CIg7f4FhHc8pS+TMfK392kTtRp8LMANzywBB19egH5ePmyDYRJhTpOMpupbec4BCFSJRgCMk0apiNON1CRyiiTFpU2Rv19y4ez/eakSpfH+l+SsFqeokCSnRUtz8QZNmkyNZZAUK01k9vUw1Pdz814I4oT7aI6svA5XNrMCjF52IlNZKVsqRlLGtKKpf2wqnozdEqFl9eTpjZgXZfBdBVL96Hw4ryOZjdKCgV1iBR291Du6mARK+I/44nXtP9M40gLQCVx8clFZfbwU+nXn0ggO8m7aAgGQFrj4ALqY5Em4Spq6bQBHn11ohwPZBUf12WAIiDuY/AWCe0OET92TvtDbBprAAAAAASUVORK5CYII=\";\r\n const lboxd_icon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACABAMAAAAxEHz4AAAALVBMVEUAAAAgKDD/gABAvPQA4FT8/v1Dw/0E6ViwYRE5msej6OIFx09I54QLokj/zZqk8vmhAAAAAXRSTlMAQObYZgAAArJJREFUaN7tmT1r21AUhuN/oNctwaZ0sKBQSimYC4KOBYGhydaqg+liBBc8FlQ0FA/O1NUUCpn7sQcKHkK3tHugkMFz/keva8tH55hYco6KnJBnNLyPz8H3y/fu/T/AUGQJr1y6gQ145eIKBUqg+HoqQpHnBpnXGbAFyrxD0QA1IfO6ErAtnq4Ah1rg6TpwiAJ0JeBaqAWsA10PqEkA6qAugVeVANemIkGjRoG3IwIouCWCBhR4d4JqBKhVAC5o+Y7HIGY/0vTgHMRxYO3zyVWCI3/BOPtgmoaO9ABL2oE1xgS2KwSU54ZpEv6j92GZt2YBGfKCpk9gzoXLLw0jzAlMRjDJCah/ogPggcuvDCcA9mOzIhYCaoCamIY55k3EhggGUtDyGZ2sACph3+QJpKDpc1wBjBFiLugKgS/oJFzQu8cFZsgFLSl4Egq+G06QCRrUQZ5LUcFhXwq6THAkBdFXLngZxcIwYAKZfxa95oL30RchGG4UPIrecsGvNUGQF7TWBX0u+Ba92UpwKQS9KOobguaDtxA01wVRUqngUAoc3QLB2c0XJFpByZ9x8zggoisGkld+JL6SgoLJVDgXjHo2FqwHZ3I9MIJBwYoUcnrrP8LmRfVpKPgtBeAC2cM4EYK2XJWL9oULnn+HQHQgBJA700O+HpzT1kibIxPwEgBewghAwBd1KYDYnVkJKRz5vWkIIaDhTKec+0l+d3d8XhksuIAMlHf8yU4oLwBmsBMpIAPlHbM0deWnJ8j4ZK2xNp6AC4iPLj5Gjtnp6U/kaB8bdkhDJefE2s/Kd4IqBLX/8bzZgl25wdAIduQiag+1X8YpBfobTb1Af6vbqP1iWnG3rhGonwf0DxTKErSvPJ72maeKly5NE16Vr32EIq998SSDIl+6DeW78V4ZdHGSyPCu8hfYVeoYJ6xJswAAAABJRU5ErkJggg==\";\r\n const lboxd_cust = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAAAS1BMVEUAAAAgKDBTU1NUVFT/gACgoKAA4FSpqamrq6ujo6P8/v3MzMwE6ViwYRGvr6+NjY3Nzc25ubn/zZqwsLAFx08LokiOjo5I54Sj6OIuaCjQAAAAAXRSTlMAQObYZgAABz1JREFUeNrtm9122kAMhItdJxSoTQqlff8nrW39fFqbeiFRLnpOlWAMyWFGI2lX6zVf/kHbFda0bds0TdvMhySIOizWNkpBGLSTZTPZbdkEPj9cBWEwn38eOGbQs+fCRagYs89Bx4L8giro9oMQ6egQIPyGKG/a+9MhH54qEGtKARpCoaxy4bGYea2ng0MLF0mHbHwImAacC7SZvZMIj8Ws85i7+0rCdUjDxzT+oMtrlV0iEzhkwWONewyiv2xsbECWLHwIYDARMua2mlLJwocA7kYiECAwcsgjQA5Q8cBzKr/olIGPqeNlBVAEcapqbZjMwocAv84gvqnPPCXi75BWS4CM8CKM8ZH3EwmUPQBZhwzIwriQgs9siM7Be4VsohpEKQWf2VD9NMXNVz2nCvxviQSoPS90fWJwDgOFv5eBz0iItqYzvJxO2yBUJgHmIgoieos2YkYiiwCfjfQWdD+DHlQT8MkBARYMSOjrVW0ozwQChIBpEDfjDERviD45+DsygG4EKHlJEnpx5hFQLPeeYUDhqATCIHFIIkCyl/0x5RgmyKBCFgFKgPUZMxMR8ARlgEjB31mS82gJArURWjWSI4kAZUY0VHQUoVQYIZIIkISOwlvAIQyp+nECozH9ewmWMw8Ok6YaEfATckB/Qxu4ZMZ/+h9SCIT2ww/L3tTeL7OzySIQh15kFyP2lCKrpQwCMeWJg/Fx+HWuZimAR+u5MJRBbNHI0QwCTC+e4CTcojQho/+VgL/Dn2UXYAccX61UcggQVBykJCwPiEKcqrcIfP9q9v3+P/y8Xl9Op75/7QaEV2/F3WHovk3WDTdjwUjERZsN9A0O19Pp9DLa6+t+P5GwrPM43LoJWmw60xpAGwjU4KEAvKALgfHnte87Pn5y3sGdQ0dX5of7BEAtLIiv8KaAUhhIwQ74wOHGdBTH4or7GO6/YPtJArFLZ2mA+yWDLqxUGInq+IQBfBTAes2EFTxxmMEpDQiAv2XgxxDo7/i4dLP/IK4phBBAoBZ/DPxCgb1rMGz4L1EoruZAAPwKA8HH5hwcTTLx9dKMGJsMBhYsJCEBqNnvlzUBJBhfvAn+BoOwiGmfFuDHYanAXoCNwuX4ViPQhcblaQEOBySIVeAqvJ2PVQlooCDwsACHw1qBOQry1J+PdQkGLmU9S+Aw2q97CkgqQqAigQ8FEHg0AsSgHAdUg7fj8XiuxsBm46cJ/LhPgDTojxOBh2LADsaTKXBY1IF7LxE4P5QEbCt9nICNwvvpcTmeUWDD6JXeQ+DXhgLHyeoEaFETCKj3cy5eRv8fUYAe/YMECIGNg+TAlrE6yEjC0XwyPD8Wgsn/9xNYTkaagPvHc2BgoZowDgi4yjArUB+I2M5JGAmtDGUyPo9JWB2KWc8+Pxndnwv2NiNfHkoBrlokzYbeEe374yMDIWu3p/sBEwBT3y0K42xUjUDYyXhHRwR0EQJrjC7neg2E3e3nm9JfKwJehzIv99UaCBexIPBoEL7TFS8mIxOiGepdMRuN71gX/DzdV0D9b5rtvvzbrVijOwGsgg8DcoC1ST81/boy3FgdcuMRBLBtfBgQAl+bXAYZ39BghR/39smB0rbwYcBc4P3YxbSFwTL+5QbmqgrIxMoVihcomPfj0jhcE70RhoDPkmxRhjUKwLsITsFakX3TUF53L5Hc2ExReJKwRgF4KFxPo01J2I/Wme9sG8tFom+dXaeKd9x5JUIAg8N3AQd9TeJ6teld3ZejYrTDbZj+Psjbav4PVMFHLH6knDsNNu29AVhcMkwhALhCuJ9cKebRsHuad61Y1FyA6rOftYsNhDQCfL5/NEGJmBBAphwCSGu+4yObiuwWQChrv0CLDxarPfRyU4FhIIfAaHwsEVYG/nfoEZsMAuK4Y7NnEcseeuEeuywC6Lq4GE49kKZlqJK2bvFPYJ0KqC5OTM42h4DAktmgu79UXxgm8wgYMgUX04BXCht3dFMImMfUGZHgzsJI0Ksk7R6SeGsALef6Rh7+KL85BMRDKh4+TPzkAkWSqAABp9Eg8EheNGRCAMu5iaV1TF4pKGdsVuQQYPy1B9FelcN8zCbA3jxJyDOYcoo0eXfT4TapoGAcjAf7dlkEfAYAhhxQW9xTJYe8WzqZc9CYAZr46w/L0hwClBvb1gpDcqC9v8i7q7ZB3VUDqD+OTMJk3tbLVE9zisW4MBIn3thsLgKjr8oWmQlh4x7/lJURhUgaxuGJAGQRoOoEFSp4zGvwsxgwuxB/HI8rMj1SATkMyPrYfxuR1QhII5LFwLCK4DPxERfnkvYtFwhQ87QF5QoBPuAnMYgd71++cAYR8PMoEPjlvYzgFjcsZDNoIj5DEC0Z1HA/kwLVVfQ9OA6Jz/m+H1q7EuBzBnw2B9YEDAJkgWUF8OkUNL8Igpz5M95/Ege+RmNodEKVgSeHA+0GLTBp8CXLauPA6suFFc8TiXiu02//t6fsD1bxl8/V56nJAAAAAElFTkSuQmCC\";\r\n const douban_icon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIAAAACAAgMAAAC+UIlYAAAADFBMVEUAAAABdhD9/v16t4L0Izp4AAAAAXRSTlMAQObYZgAAARhJREFUWMPt2D0OgjAUB/A6eATv4xEcKE0YcOcI3qNHcABjnDhKL8HuYqK1EuA988orUQeI/S8Q8iNtXstHK4SQTITLmgM7BzYcSEgLtI0VD7akC6QTGx4kYSADiQCBvPLmHMHPgbLeXGc1HxYCPLW8A/CPRhnBp8CiND5gJKSIIAIEmrnO6j8Ae/tw19Cje4H3ZJfUATRUNXkVKwTcqfYCA8AAoLcpAqBh6M50gKfhcSjKyQMOr29xm2wCKCmAy0AxwC0XfpAOoOm6S0HFAqifO6kpgBFQDNA90BRArVMHDAVQ63wKkBRAATMKbJubq1R7HKav6UE1Eh3BO7AjMfP6l1s6+HrFGlwUh5fVggfBpX14cyC4vfAEQ6sYUOFLXfsAAAAASUVORK5CYII=\";\r\n const allocine_icon = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAB2BAMAAADviXoiAAAAGFBMVEUAAAAmJib/////ywBcUzPIoQmUehKRkZFw3PDCAAAAAXRSTlMAQObYZgAAA2BJREFUWMPdmU1P20AQQKv+AzeOe3WjSD1HG+fuptBz5JS7lY87qBJ/vxCyed6ZHS94b8wBiOTHzL7xLvbw5VPF18Vb1B8mF8OYQhIfqFZHPRUFTqNTYdA0nEaBk+hkOIoQ70Wf2+I1ymcBpyv+VxB/gqpTaX8WYTwlE8uk0dSJih8LHd/HqxaoBY+lXRbx+DWSGE1hlIc+FGanVWjnVtcfzcTGYu+dcxuxZIOVFZ/cSzSizUbJraz3Eq3/HC866njr3qIXru20xOzKrgojMaxq7fzKrmlyhCWtYpFFYp0WybDIQjWJYektrpBFj2Ep+VaYv/Tg2R2/j6KH7A9/K3XejfOxhv0Gq0u+e7mW5SIrUjTsdddQ48HdoiAES3OrDjl3jujlPob1JVfOx/n36fL94dxRyKBoUTIrJI7X/GtVNOz1xigFuvf2NvLArXWHOkegt0MWXQqW69USO+6vVi8YtmXXqa7OAlklLKqELARtDVmokrKo02lZsNzMsZIrPiBLsELWipIpAjbQzHXiPrTuLDQrWTevVKFEozm4ozeDDglZmkUWie57r6AxWY65Q7Dczh19Ja1o0rC9yOLaSm9hGuzZpT6T5S26Etu/lu0l1YYF6PPOYIvhpWJnJNmOEktIZJkssnbUj6xRFj+9Or52abaC3QbsOsGyyFaxzTiLLFgiwdJUfkLWOIsslCMrzVYWu06z5Y0tTwG7gY3tBWTxdEbE9gJ7EFksnmjVIavYGdeFt9YOVp85XB9l16PnFbJ6WCVLn7EE9YVsEz9jH6WsFayQxdlOg4kt9altaP89Amhi7EqyusEVsugvsmgvf7sJGgKLrAVsRPTBJ4ZFFpqlaM67po1vYf2sgiwM/T2fXhd5+YponpFMWTyf8fkoVBmy0BMsAlXmgjuqvN3iD/KJAXYZyvJxM78Xz8Bm0TO5dea9eDKzX1MqsWXtZ37dpZI7WAQdghVFd6gixDuOVfQB1ijZfqebGTU/wZrvklXMFe+S9jssspo+Nqio7XdnZG3aaNrafGdH1t6Yj1izAmQ1RyCRNjGjmDeiXmYU6dmIPQ6yZzJ2MJNJz4KM4VnODCpj9pUzc8ub9eXPGPNnm/kzVWA78mfI+bPr/Jl5/qwe2EKnwnXe/0Sm0Rn/A/pM8R8w2HBWwA4YRgAAAABJRU5ErkJggg==\";\r\n\r\n let key;\r\n if (GM_config.get(\"ratings_cfg_omdb_apikey\") == '') {\r\n const keys = ['8c967f70', 'dd37e5a4', '3fdb9c5a'];\r\n key = keys[Math.floor(Math.random() * keys.length)];\r\n } else {\r\n key = GM_config.get(\"ratings_cfg_omdb_apikey\");\r\n }\r\n\r\n if (GM_config.get(\"ratings_cfg_imdb\") || GM_config.get(\"ratings_cfg_letterboxd\") || GM_config.get(\"ratings_cfg_rotten\") || GM_config.get(\"ratings_cfg_metacritic\") || GM_config.get(\"ratings_cfg_douban\") || GM_config.get(\"ratings_cfg_allocine\")) {\r\n addRatingsElements(imdbid, title, title_orig);\r\n }\r\n\r\n // Get IMDb ratings.\r\n if (GM_config.get(\"ratings_cfg_imdb\")) {\r\n getIMDbRatings(imdbid, imdb_icon);\r\n }\r\n // Get Letterboxd ratings.\r\n if (GM_config.get(\"ratings_cfg_letterboxd\")) {\r\n getLetterboxdRatings(imdbid, lboxd_icon, lboxd_cust);\r\n }\r\n // Get Metacritic's Metascore & RT's Tomatometer. Link for RT Audience score & \"Certified\" badge.\r\n // Running for Metascore without RT enabled is currently disabled, GM_config.get(\"ratings_cfg_metacritic\")\r\n if (GM_config.get(\"ratings_cfg_rotten\")) {\r\n getRTandMetaRatings_OMDb(key, imdbid, meta_icon, rott_rotten, rott_certified, rott_fresh, rott_user_up, rott_user_down);\r\n }\r\n // Get Metacritic's Metascore & \"Must-See\" Badge. Link for Metacritic's User Score.\r\n if (GM_config.get(\"ratings_cfg_metacritic\")) {\r\n getMetacriticRatings_IMDb(imdbid, meta_icon, meta_badge);\r\n }\r\n // Get Douban ratings.\r\n if (GM_config.get(\"ratings_cfg_douban\")) {\r\n getDoubanRatings(imdbid, douban_icon);\r\n }\r\n // Get Allocine ratings.\r\n if (GM_config.get(\"ratings_cfg_allocine\")) {\r\n getAllocineRatings(imdbid, allocine_icon);\r\n }\r\n}", "function getMovieGenres () {\n var params = {\n url: 'https://api.themoviedb.org/3/genre/movie/list?&api_key=7af46ede7373e3339ef7980f35025ed3&language=en-US',\n cache: true\n };\n return servicesForProject.promiseGet(params);\n }", "function dramaMoviesRate(movies) {\n console.log(movies);\n let dramaMovies = movies.filter(function(movie) {\n // console.log(movie.genre);\n // console.log(movie.genre.includes(\"Drama\"))\n return movie.genre.includes(\"Drama\");\n });\n return ratesAverage(dramaMovies);\n}", "function searchFilm() {\n if (searchQuery.length === 0) {\n searchQuery = \"Mr. Nobody\"\n }\n request(`http://www.omdbapi.com/?t=${searchQuery}&plot=short&apikey=5d94fa00`, function (error, response, body) {\n if (!error && response.statusCode === 200) {\n console.log(`Movie: ${JSON.parse(body).Title}`);\n console.log(`Starring: ${JSON.parse(body).Actors}`);\n console.log(`Year: ${JSON.parse(body).Year}`);\n console.log(`Origin: ${JSON.parse(body).Country}`);\n console.log(`Language: ${JSON.parse(body).Language}`);\n console.log(`IMDB Rating: ${JSON.parse(body).imdbRating}`);\n console.log(`Tomato-meter: ${JSON.parse(body).Ratings[1].Value}`);\n console.log(`Synopsis: ${JSON.parse(body).Plot}`); \n }\n });\n}", "function btnFilter(){\r\n const url = `${path}/genre/movie/list?api_key=${api_key}&language=it-IT`\r\n fetch(url)\r\n .then((res) => res.json())\r\n .then((data) => btnGenres(data.genres))\r\n .catch((err) => console.log(err))\r\n }", "function filterMovies(id) {\r\n var isDownloaded = false;\r\n this.data.forEach(function(type) {\r\n [type].forEach(function(entry) {\r\n $.each(entry, function(i, item) {\r\n $.each(item, function(x, y) {\r\n if (y.imdbId === id && y.sizeOnDisk >= 0) {\r\n isDownloaded = true;\r\n }\r\n });\r\n });\r\n });\r\n });\r\n return isDownloaded;\r\n}", "function movieSearch() {\n var encodeName = encodeURI(searchName);\n request(\"http://www.omdbapi.com/?t=\" + encodeName + \"&y=&plot=short&r=json\", function(error, response, body) {\n\tif (!error && response.statusCode === 200) {\n\t //console.log(JSON.parse(body));\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t // year\n\t console.log(\"Year Released: \" + JSON.parse(body).Year);\n\t // imdb rating\n\t console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n\t // country produced\n\t console.log(\"Country: \" + JSON.parse(body).Country);\n\t // language of movie\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t // plot\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n\t // actors\n\t console.log(\"Actors: \" + JSON.parse(body).Actors);\n\t // rotten tomatoes rating\n\t console.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t // rotten tomotoes url\n\t console.log(\"Rotten Tomatoes: https://www.rottentomatoes.com/search/?search=\" + encodeName);\n\t} else {\n\t console.log(error);\n\t}\n });\n} // close movie search", "function getMovies (req, resp) {\n console.log(\"\\tgetMovies called\");\n var filter = sharedVars.parseFilter(req.swagger.params);\n getFilteredMovies(filter, function(getError, data) {\n if (getError) {// If an error occured, just say it failed\n sharedVars.sendError(resp, 500, 'Failed to get a list of movies.', data);\n } else {// If successful, send json back\n // Update analytics for all the movies\n console.log(\"\\tSending analytics for movie list...\");\n for(var movieIndex in data.entities) {\n sharedVars.sendAnalytic(data.entities[movieIndex].name);\n }\n if (!sharedVars.shouldGetReviews(req.swagger.params)) {\n // If no reviews needed, just return the data\n resp.json(data);\n\n } else {\n // Add reviews to each movie in the list\n console.log(\"\\t\\tAppending reviews to list...\");\n async.each(data.entities, function(movie, callback) { // Is called for each request\n // Manually ask for connections...\n getReviews(movie, function(revError, revData) {\n movie.reviews = revData;\n if (revError) // If couldn't append reviews to movie, report error\n callback(revData);\n else // If reviews appended successfully, return\n callback();\n });\n }, function(error) { // Is called after all requests are done\n if (error) { // If an error occurred, set error message\n resp.statusCode = 500;\n data.message = error;\n }\n resp.json(data);\n });\n }\n }\n });\n}", "function movieSearch(movie){\n if(!movie){\n var movieName = \"Mr. Nobody\";\n } else{\n movieName = movie;\n }\n let queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function(err, response, body){\n\n if(!err && response.statusCode === 200){\n\n //need to look at responses from IMDB, responses seem to change based on the movie\n //also if possible add some input validation\n console.log(\"Movie title: \" + JSON.parse(body).Title);\n console.log(\"Release date: \" + JSON.parse(body).Year);\n console.log(\"Rating: \" + JSON.parse(body).imdbRating);\n //rotten tomatoes rating\n if(JSON.parse(body).Ratings[1]){\n console.log(\"Rotten tomatoes rating: \" + JSON.parse(body).Ratings[1].Value);\n }\n console.log(\"Produced in \" + JSON.parse(body).Country);\n console.log(\"Language: \" + JSON.parse(body).Language);\n console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n \n } else{\n\n console.log(err);\n }\n\n\n });\n \n\n\n}", "function searchMovies(query, language, genre) {\n\t// ajax calling themoviedb.org api for searching movies (max 20 displayed)\n\t$.ajax({\n\t\turl: \"https://api.themoviedb.org/3/search/movie\",\n\t\tmethod: \"GET\",\n\t\tdata: {\n\t\t\tapi_key: '6258744f8a6314eddb8961371f91076e',\n\t\t\tlanguage: language,\n\t\t\tquery: query\n\t\t},\n\t\tsuccess: function (data, state) {\n\t\t\tvar movies = data.results;\n\t\t\tconsole.log(movies);\n\t\t\tprintMovies(movies, genre);\n\t\t},\n\t\terror: function (request, state, error) {\n\t\t\tconsole.log(error);\n\t\t}\n\t});\n}", "searchMovie(name) {\n let movieByName = `https://api.themoviedb.org/3/search/movie?api_key=${this.API_KEY}&language=en-US&query=${name}&page=1&include_adult=false`\n\n fetch(movieByName)\n .then(response => {\n return response.json()\n }).then(movie => {\n let fiveMovieName = ''\n\n // Take only five movie within all movie\n if (movie) {\n try {\n fiveMovieName = movie.results.filter((movie, index) => {\n return index < 5\n })\n } catch(err) {\n \n }\n }\n this.getRelatedMovie(fiveMovieName)\n // It pass first movie id to searchMovieById\n this.searchMovieById(movie.results[0].id)\n })\n }", "function lookupMovies(type, search, sort, filter, instantaneaousRepositionning) {\n var user = Meteor.user();\n \n // If not logged in, load public movies, cache them and repeat\n if (!user && !publicMovies.length) {\n Meteor.call('public', {}, function(error, movies) {\n publicMovies = movies;\n lookupMovies(type, search, sort, filter);\n });\n return;\n }\n\n var movies = user ? user.profile.movies : publicMovies;\n console.log('Load Movies');\n\n // Select movies on current page\n var types = type.split('|');\n movies = _.filter(movies, function(m) { return _.contains(types, m.statusType); });\n\n // Filter movies\n _.each(filter, function(value, type) {\n if (value) movies = _.filter(movies, function(m) { return filters[type](m, value); });\n });\n\n // Search movies\n if (search.length > 1) {\n movies = _.filter(movies, function(m) { return filters.title(m, search); });\n }\n\n // Sort movies\n if (sort) movies = _.sortBy(movies, sorts[sort]);\n\n selectedMovies = movies;\n initialiseMovies(instantaneaousRepositionning);\n}", "function getGenres() {\n\n\tData.movies_get_genres(function(error, e) {\n\t\tif (!error) {\n\t\t\tgenres = e;\n\t\t\tpopulateLists(genres, 'genre', lists.length, cellOffset + 40 + Alloy.Globals.layout.lists.cell.height);\n\t\t\tloaded_callback();\n\t\t} else {\n\t\t\tTi.API.error(\"Error: \" + JSON.stringify(JSON.parse(e), null, 4));\n\t\t}\n\t});\n}", "function getSimilarMovies(movie) {\n let sim = [];\n const readFolder = 'jsonData/movies/';\n\n fs.readdirSync(readFolder).forEach(file => {\n let data = fs.readFileSync(readFolder + file);\n let movData = JSON.parse(data);\n if (movie.Genre.includes(movData.Genre) && movie.Rated === (movData.Rated) && movData.Title !== movie.Title) {\n sim.push(movData);\n }\n });\n //console.log(sim);\n\n return sim;\n}", "function getMovies(movies) {\r\n return movies\r\n .filter((m) => m.year >= 2018 && m.rating > 4)\r\n .sort((a, b) => a.rating - b.rating)\r\n .reverse()\r\n .map((m) => m.title);\r\n}", "async function getMovieResults({ movieId, title }) {\n await logger(`finding: ${title}`);\n\n const parameters = querystring.stringify({\n movieId,\n apiKey: config.radarr.apiKey,\n });\n\n const searchUrl = `${_getRadarrApiPath()}/release?${parameters}`;\n return await getData({ uri: searchUrl });\n}", "function loadMovies() {\n\t// Loop through first half array\n\tfor (var i=0;i<items.length/2;i++) {\n\t\tvar object = get_one_recommended_movie(i);\n\n\t\titems[i].children[0].children[1].children[0].innerHTML = object.name;\n\n\t\t// Set link to go to the indiviual title page\n\t\t$(items[i]).attr(\"href\", \"title/title.php?id=\" + object.id + \"&type=movie\");\n\n\t\t// Apply imdb poster image\n\t\tapplyImdbThumbnail(items[i].children[0].children[0].children[0], false, object.id);\n\t}\n}", "function movies(input) {\n\n var movieTitle;\n if (input === undefined) {\n movieTitle = \"Cool Runnings\";\n } else {\n movieTitle = input;\n };\n\n var queryURL = \"http://www.omdbapi.com/?t=\" + movieTitle + \"&y=&plot=short&apikey=b41b7cf6\";\n\n request(queryURL, function (err, res, body) {\n var bodyOf = JSON.parse(body);\n if (!err && res.statusCode === 200) {\n logged(\"\\n---------\\n\");\n logged(\"Title: \" + bodyOf.Title);\n logged(\"Release Year: \" + bodyOf.Year);\n logged(\"Actors: \" + bodyOf.Actors);\n logged(\"IMDB Rating: \" + bodyOf.imdbRating);\n logged(\"Rotten Tomatoes Rating: \" + bodyOf.Ratings[1].Value);\n logged(\"Plot: \" + bodyOf.Plot);\n logged(\"\\n---------\\n\");\n }\n });\n}", "function getGenres(){\n\t\tvar api = \"?api_key=933bee1465a61090ebe0704cd6d4c3e1\";\n\t\tvar baseURL = \"http://api.themoviedb.org/3\";\n\t\tvar query = \"/genre/list\";\n\t\tvar url = baseURL+query+api;\n\n\t\t$.ajax({\n\t\t\turl: url,\n\t\t\tdatatype: 'json',\n\t\t\tsuccess:function(data){\n\t\t\t\tgetGenreID(data);\n\t\t\t}\n\t\t});\n\t}", "async findAllFilms(){\n return Movie.find();\n }", "function movieThis() {\n // Variable to store OMDB API key\n var movieAPI = \"7fc81b28\";\n // Variable to store the API URl and key \n var movieQueryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&apikey=\" + movieAPI;\n\n // Then run a request to the OMDB API with the movie specified\n request(movieQueryUrl, function (error, response, body) {\n // If the request is successful\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover the movie details\n var movieDetails = JSON.parse(body);\n // To log the information required for the assignment\n console.log(\"* Title of the movie: \" + movieDetails.Title);\n console.log(\"* Release Year: \" + movieDetails.Year);\n console.log(\"* IMDB Rating: \" + movieDetails.imdbRating);\n // Variable to set and hold movie ratings\n var movieRating = movieDetails.Ratings;\n // If ratings is not blank...\n if (movieRating != \"\") {\n // For loop to get and log the Rotten Tomatoes ratings\n for (var i = 0; i < movieRating.length; i++) {\n if (movieRating[i].Source === \"Rotten Tomatoes\") {\n console.log(\"* Rotten Tomatoes Rating: \" + movieRating[i].Value);\n }\n }\n // If it is blank, it logs a message saying that is no rating available \n } else {\n console.log(\"* Rotten Tomatoes Rating: Rating information is not available\");\n }\n // To log the information required for the assignment\n console.log(\"* Country where the movie was produced: \" + movieDetails.Country);\n console.log(\"* Language of the movie: \" + movieDetails.Language);\n console.log(\"* Plot of the movie: \" + movieDetails.Plot);\n console.log(\"* Actors in the movie: \" + movieDetails.Actors);\n }\n });\n}", "function getMovieById(id) {\r\n for(let i = 0; i < movies.length; i++){\r\n if (movies[i].imdbID === id)\r\n return movies[i]\r\n }\r\n return null\r\n}", "function dramaMoviesRate(movies) {\n const dramaMovies = movies.filter(function(item){\n const isDrama = item.genre.indexOf('Drama') >= 0;\n return isDrama;\n })\n return ratesAverage (dramaMovies);\n \n}", "function movie() {\n\n\tvar movieName = '';\n\n\tif(process.argv.length >= 4){\n\t\tfor (var i = 3; i < dataArr.length; i++){\n\t\t\tif (i > 3 && i < dataArr.length) {\n\t\t\t\tmovieName = movieName + \"+\" + dataArr[i];\n\t\t\t} else {\n\t\t\t\tmovieName += dataArr[i];\n\t\t\t}\n\t\t} // closes for loop for dataArr\n\t} else {\n\t\tmovieName = 'Mr Nobody';\n\t}\n\n\tvar queryUrl = \"http://www.omdbapi.com/?t=\" + movieName + \"&y=&plot=short&tomatoes=true&r=json\";\n\n\tconsole.log(queryUrl);\n\n\trequest(queryUrl, function(error, response, body){\n\n\t\tif (!error && response.statusCode === 200) {\n\n\t \tconsole.log(\"\");\n\t\t\tconsole.log(\"Title: \" + JSON.parse(body).Title);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Release Year: \" + JSON.parse(body).Released);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rating: \" + JSON.parse(body).imdbRating);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Produced In: \" + JSON.parse(body).Country);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Language: \" + JSON.parse(body).Language);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Plot: \" + JSON.parse(body).Plot);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Actors: \" + JSON.parse(body).Actors);\n\t\t\tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes Rating: \" + JSON.parse(body).Ratings[1].Value);\n\t \tconsole.log(\"\");\n\t \tconsole.log(\"Rotten Tomatoes URL: \" + JSON.parse(body).tomatoURL);\n\n\t\t}\n\t});\t\t\t\n\n}", "function App() {\n const[movies, setMovies] = useState([]);\n\n const searchMovies = (myMovies) => {\n const filteredResult = myMovies.filter((movie) => {\n const year = new Date(movie.release_date).getFullYear();\n const rating = movie.vote_average;\n const path = movie.poster_path;\n return (year >= 2000 && year <= 2021 && rating !== 0 && path !== null);\n })\n console.log('movie list:', filteredResult);\n setMovies(filteredResult);\n }\n\n const filterSeries = (myMovies) => {\n const filteredResult = myMovies.filter((movie) => {\n const year = new Date(movie.first_air_date).getFullYear();\n const rating = movie.vote_average;\n const path = movie.poster_path;\n return (year >= 2000 && year <= 2021 && rating !== 0 && path !== null);\n })\n console.log('movie list:', filteredResult);\n setMovies(filteredResult);\n }\n\n useEffect(() => {\n getMovies(FEATURED_API);\n }, []);\n\n const getMovies = (API) =>{\n fetch(API)\n .then(res => res.json())\n .then(data => {\n setMovies(data.results); \n })\n }\n\n return (\n <div className=\"body\">\n <div className=\"movie-section\">\n \n <Header search = {searchMovies} />\n \n <div className=\"movie-container\">\n {movies.length > 0 && movies.map((movie) => {\n return <Movie key={movie.id} {...movie} />\n })}\n </div>\n </div>\n \n <Filter search = {searchMovies} filter = {filterSeries}/>\n \n </div>\n );\n}", "function randomFunction() {\n fs.readFile(\"random.txt\", \"utf8\", function(error, data) {\n if (error) {\n return console.log(error);\n }\n parsedArr = data.split(\",\");\n //checks which function is specified (song, movie, or tweet) and takes the appropriate action, seraching with the specified song or movie.\n switch (parsedArr[0]) {\n case \"tweet\":\n getTweets();\n break\n case \"song\":\n var spotify = new Spotify({\n id: spotifyKeys.id,\n secret: spotifyKeys.secret\n });\n spotify.search({ type: \"track\", query: parsedArr[1] }, function (error, data) {\n if (error) {\n console.log(error)\n } else {\n var title = data.tracks.items[0].name;\n var artist = data.tracks.items[0].artists[0].name;\n var album = data.tracks.items[0].album.name;\n var previewLink = data.tracks.items[0].preview_url;\n if (!previewLink) {\n previewLink = \"No preview available :(\"\n }\n console.log(\"~Siri~ Here is some information about \" + title + \".\")\n console.log(\"...\");\n console.log(\"Title: \" + title);\n console.log(\"Artist: \" + artist);\n console.log(\"Album: \" + album);\n console.log(\"Preview: \" + previewLink);\n console.log(\"...\");\n }\n })\n break\n case \"movie\":\n var queryURL = \"http://www.omdbapi.com/?t=\" + parsedArr[1] + \"&y=&plot=short&apikey=trilogy\";\n request(queryURL, function (error, response, body) {\n if (error) {\n console.log(error)\n }\n var title = JSON.parse(body).Title;\n var year = JSON.parse(body).Year;\n var imdbRating = JSON.parse(body).Ratings[0].Value;\n var rottenRating = JSON.parse(body).Ratings[1].Value;\n var country = JSON.parse(body).Country;\n var language = JSON.parse(body).Language;\n var plot = JSON.parse(body).Plot;\n var actors = JSON.parse(body).Actors;\n\n console.log(\"~Siri~ Here is some information about \" + title + \"\")\n console.log(\"...\");\n console.log(\"Title: \" + title);\n console.log(\"Year: \" + year);\n console.log(\"imdb Rating: \" + imdbRating);\n console.log(\"Rotten Tomatoes Rating: \" + rottenRating);\n console.log(\"Country: \" + country);\n console.log(\"Language: \" + language);\n console.log(\"Plot: \" + plot);\n console.log(\"Actors: \" + actors);\n console.log(\"...\");\n })\n break\n }\n\n })\n}", "function movieThis(movie) {\n\n var queryUrl = \"http://www.omdbapi.com/?t=\" + searchInput + \"&y=&plot=short&apikey=trilogy\";\n\n request(queryUrl, function (error, response, body) {\n\n if (!error && response.statusCode === 200) {\n var body = JSON.parse(body);\n\n console.log(\"\");\n console.log(\"Title: \" + body.Title);\n console.log(\"\");\n console.log(\"Release Year: \" + body.Year);\n console.log(\"\");\n console.log(\"IMDB Rating: \" + body.imdbRating);\n console.log(\"\");\n console.log(\"Rotten Tomatoes Rating: \" + body.Ratings[1].Value);\n console.log(\"\");\n console.log(\"Country: \" + body.Country);\n console.log(\"\");\n console.log(\"Language: \" + body.Language);\n console.log(\"\");\n console.log(\"Plot: \" + body.Plot);\n console.log(\"\");\n console.log(\"Actors: \" + body.Actors);\n console.log(\"\");\n }\n });\n}", "function recommendedItems(media_type, id){\n tmdb_url = `https://api.themoviedb.org/3/${media_type}/${id}/recommendations?api_key=${api_key}&language=en-US&page=1`;\n try{\n const promise = axios.get(tmdb_url);\n const pm_data = promise.then(response => processSmallCarousel(response.data, media_type));\n return pm_data;\n } catch(error) {\n console.error(error);\n }\n}", "function movieData(title) {\n\n // This conditional statement handles the case where the user does not put a movie by returning the default movie selection: Do The Right Thing\n if (title === undefined) {\n\n title = 'Do The Right Thing';\n console.log('Since you didn\\'t request a specific movie title, I suggest that you watch this one!\\n');\n\n };\n\n // The request docs provide the sytax for its use which I followed here to make an api call to omdb\n request(\"http://www.omdbapi.com/?apikey=49544f9c&t=\" + title, function (error, response, body) {\n\n // If there is an error display the error message otherwise do not\n if (error == true) {\n console.log('error:', error);\n };\n\n let omdbResponse = JSON.parse(body);\n console.log(omdbResponse);\n\n if (omdbResponse.Error === 'Movie not found!') {\n console.log(`Movie not found. Sorry about that!\\n`)\n } else {\n // this for loop loops through the ratings array (which has three little objects in it) so that i can scope the Ratings key and pull out the Rotten Tomatoes Value\n for (let i = 0; i < omdbResponse.Ratings.length; i++) {\n\n // I left this console log in here so that you can see what the result of the for loop looks like and why I used it\n // console.log(omdbResponse.Ratings[i])\n\n };\n\n // These console.logs are printing out different bits of information from the body of the response\n console.log(`Movie title: ${omdbResponse.Title}`);\n console.log(`This movie was released: ${omdbResponse.Released}`);\n console.log(`The IMDB rating for this movie is: ${omdbResponse.imdbRating}`);\n console.log(`Rotten Tomatoes gives this move a rating of: ${omdbResponse.Ratings[1].Value}`);\n console.log(`This movie was filmed in: ${omdbResponse.Country}`);\n console.log(`This movie is in: ${omdbResponse.Language}`);\n console.log(`Here is a brief synopsis of the plot: ${omdbResponse.Plot}`);\n console.log(`Starring: ${omdbResponse.Actors} \\n\\nThis concludes the information for your current request. Thank you for using Liri. \\n`);\n }\n\n });\n\n}", "function getMovie(title) {\n var year;\n var rating;\n var country;\n var language;\n var plot;\n var actors;\n var rottenTomatoesRating;\n var rottentomatoesURL;\n if (title) {\n var titleParam = title;\n } else {\n var titleParam = \"Mr. Nobody\";\n }\n // /assugning request url using that title\n var omdbUrl = \"http://www.omdbapi.com/?t=\" + titleParam + '&tomatoes=true&r=json';\n request(omdbUrl, function(error, response, body) {\n if (!error && response.statusCode == 200) {\n console.log(response);\n rBody = JSON.parse(body);\n // rJson = JSON.parse(response);\n titleParam = rBody['Title'];\n year = rBody['Year'];\n rating = rBody['Rated'];\n country = rBody['Country'];\n language = rBody['Language'];\n plot = rBody['Plot'];\n actors = rBody['Actors'];\n rottenTomatoesRating = rBody['tomatoRating'];\n rottentomatoesURL = rBody['tomatoURL'];\n\n console.log('the title is ', titleParam);\n console.log('the year is ', year);\n console.log('the rating is ', rating);\n console.log('the country is ', country);\n console.log('the language is', language);\n console.log('the plot is', plot);\n console.log('the actors are', actors);\n console.log('the Rotten Tomatoes Ratings are', rottenTomatoesRating);\n console.log('the Rotten Tomatoes URL is', rottentomatoesURL);\n // console.log(rBody);\n // console.log(response);\n // console.log(rJson);\n }\n // else {\n // request('http://www.omdbapi.com/?t=remember+the+titans&y=&plot=short&r=json', function (error, response, body) { \n // console.log(response);\n // })\n // }\n })// body...\n\n}", "function movieFromOtherMedia(useGenre) {\n //Variable for if multiple genres are passed\n let newMultGenres = [];\n\n //If an array\n if(Array.isArray(useGenre)){\n //Compare genres from allGenreArray to movieGenreArray\n for(i = 0; i < useGenre.length; i++){\n let passedMultGenre = $.inArray(useGenre[i],allGenreArray);\n newMultGenres[i] = movieGenreArray[passedMultGenre];\n };\n \n //Find movie using multiple genres\n findMovie(newMultGenres);\n\n } else {\n //Take the genre from the media that was passed\n let passedGenre = allGenreArray.indexOf(useGenre);\n\n //Compare that genre index to my movie genre index\n let newGenre = movieGenreArray[passedGenre];\n\n //Find movie using one genre\n findMovie(newGenre);\n };\n}", "searchMovies(){\r\n document.documentElement.scrollTop = 0\r\n this.page = 1\r\n this.films = []\r\n this.searchedTitle = this.searchTitle\r\n if(this.genreSelected === \"All\"){\r\n this.searchFilm()\r\n this.searchTv()\r\n } else if(this.genreSelected === \"Films\") {\r\n this.searchFilm()\r\n } else {\r\n this.searchTv()\r\n }\r\n }", "function getMovieGenres() {\n\tif(G.hasInternet()) {\n\t\tvar url = CFG[\"URLS\"][\"GENRES\"][\"MOVIES\"] + G.URL_PARAMETERS.API_KEY;\n\t\tvar xhr = Ti.Network.createHTTPClient({\n\t\t\ttimeout: 10000,\n\t\t\tonerror: function onerror(e) {\n\t\t\t\tG.info(e);\n\t\t\t},\n\t\t\tonload: function onload(e) {\n\t\t\t\ttry {\n\t\t\t\t\tparseResponse(this.responseText);\n\t\t\t\t\t$.movie_genres.trigger('change');\n\t\t\t\t} catch(e) {\n\t\t\t\t\tG.info(e);\t\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\txhr.open(\"GET\", url);\n\t\txhr.send();\n\t} else {\n\t\tinfo(\"No internet connection\");\n\t}\n}", "function getData(genre, idName) {\n // CONVERTI LE FICHIER MINIFIER EN JSON POUR LIRE LE DATA\n fetch(genre).then((reponse) => {\n return reponse.json();\n }).then((data) => {\n //STOCKER LES DONNÉES DANS MA VARIABLE\n const content = data.results;\n // console.log(content); \n // PARCOURIR TOUS LES FILMS PAR GENRE ET INSERER LA BALISE IMG POUR AFFICHER LES IMG\n content.forEach(movie => {\n document.getElementById(\"\" + idName + \"\").insertAdjacentHTML(\"beforeend\", `<img data-id=\"${movie['id']}\" src=\"${posterUrl}${movie['poster_path']}\" class=\"posters\"/>`);\n });\n });\n}", "async function searchByGenre(genQuery, catQuery) {\n let vgUrl = getVideoGameUrl({ type: \"genres\", value: genQuery });\n let pageLimit = 2;\n let totalResults = [];\n let resultList = [];\n const rawgResp = await fetch(vgUrl);\n const rawgResults = await rawgResp.json();\n setLoadingText();\n\n // determines the amount of results per genre that will be received from the api\n if (catQuery.length > 0) {\n let limitRatio = Math.floor(16 / catQuery.length);\n if (limitRatio >= 8) {\n pageLimit = 20;\n } else if (limitRatio >= 4) {\n pageLimit = 10;\n } else if (limitRatio >= 2) {\n pageLimit = 5;\n }\n\n // Board game atlas filters game results in a different way than the rawg api\n // This loop handles the collection of boardgames based on the selected genres\n for (let i = 0; i < catQuery.length; i++) {\n const bgUrl = getBoardGameUrl({\n type: \"categories\",\n value: catQuery[i],\n limit: pageLimit,\n });\n const atlasResponse = await fetch(bgUrl);\n const atlasResults = await atlasResponse.json();\n totalResults = totalResults.concat(atlasResults.games);\n delay(10);\n }\n }\n\n // Translates the api results from the rawg api into a common object\n for (let vGame of rawgResults.results) {\n resultList.push({\n name: vGame.name,\n image: vGame.background_image,\n link: `https://rawg.io/games/${vGame.id}`,\n });\n }\n\n // Translates the api results from the atlas api into a common object\n for (let bGame of totalResults) {\n resultList.push({\n name: bGame.name,\n image: bGame.image_url,\n link: bGame.url,\n });\n }\n\n resultList.sort(sortGames);\n useData(resultList);\n}", "function getMovie(){\n // this is exactly the same logic as the spotify function starts with\n // if there are search terms (aka userParameters), use them in the query\n // if there are not search terms, use a pre-defined default search\n let movieSearchTerm;\n\tif(userParameters === undefined){\n\t\tmovieSearchTerm = \"Mr. Nobody\";\n\t}else{\n\t\tmovieSearchTerm = userParameters;\n\t};\n // this is the queryURL that will be used to make the call - it holds the apikey, returns a \"short\" plot, type json, and \n // the tomatoes flag attempts to return rottenTomatoes data although most of that is now deprecated as of may 2017 \n let queryURL = 'http://www.omdbapi.com/?t=' + movieSearchTerm +'&apikey=trilogy&y=&plot=short&tomatoes=true&r=json';\n request(queryURL, function(error, response, body){\n\t if(!error && response.statusCode == 200){\n\t console.log(\"Title: \" + JSON.parse(body).Title);\n\t console.log(\"Year: \" + JSON.parse(body).Year);\n console.log(\"IMDB Rating: \" + JSON.parse(body).imdbRating);\n console.log(\"Rotten Tomatoes Score: \" + JSON.parse(body).Ratings[1].Value);\n\t console.log(\"Country of Production: \" + JSON.parse(body).Country);\n\t console.log(\"Language: \" + JSON.parse(body).Language);\n\t console.log(\"Plot: \" + JSON.parse(body).Plot);\n console.log(\"Actors: \" + JSON.parse(body).Actors);\n getTimeStamp();\n fs.appendFile(\"log.txt\", `***New Log Entry at ${timeStamp}***\\nNEW MOVIE SEARCH EVENT:\\nTitle: ${JSON.parse(body).Title}\\nYear: ${JSON.parse(body).Year}\\nIMDB Rating: ${JSON.parse(body).imdbRating}\\nRotten Tomatoes Score: ${JSON.parse(body).Ratings[1].Value}\\nCountry of Production: ${JSON.parse(body).Country}\\nLanguage: ${JSON.parse(body).Language}\\nPlot: ${JSON.parse(body).Plot}\\nActors: ${JSON.parse(body).Actors}\\n------\\n`, function(err) {\n });\n }\n });\n}", "function ShowGenre(cache2)\n{\n\tlet id,\n\t\trows = $(\"div.filmo-category-section\").not(\"div[style='display:none;']\").find(\"div.filmo-row b > a\");\n\n\tfor (let i = 0; i < rows.length; i++)\n\t{\n\t\tid = $(rows[i]).attr(\"href\").match(/\\/(tt\\d+)\\//)[1];\n\n\t\tif (typeof cache2[id] === \"undefined\")\n\t\t\tcontinue;\n\n\t\tlet g = \"(\";\n\t\tlet div = $(rows[i]).parent().parent();\n\n\t\tfor (let j = 0; j < cache2[id][\"genres\"].length; j++)\n\t\t{\n\t\t\tif (j === (cache2[id][\"genres\"].length - 1))\n\t\t\t{\n\t\t\t\tg += \"<a href=https://www.imdb.com/search/title?genres=\" + cache2[id][\"genres\"][j] + \" style='font-size:11px;'>\" + cache2[id][\"genres\"][j] + \"</a>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg += \"<a href=https://www.imdb.com/search/title?genres=\" + cache2[id][\"genres\"][j] + \" style='font-size:11px;'>\" + cache2[id][\"genres\"][j] + \"</a>, \";\n\t\t\t}\n\t\t}\n\t\tg += \") <br>\";\n\n\t\t$($(div).children(\"br\")[0]).after(g);\n\t}\n}", "function getMovieDetails(movie_id){\n var settings = {\n \"async\": true,\n \"crossDomain\": true,\n \"url\": \"https://api.themoviedb.org/3/movie/\" + movie_id + \"?language=en-US&api_key=7b9a9e7e542ce68170047140f18db864\",\n \"method\": \"GET\",\n \"headers\": {},\n \"data\": \"{}\"\n }\n $.ajax(settings).done(function (response) {\n $('#movieTitle').text(\"Showing results for \" + response.title)\n for(var i = 0; i < response.genres.length; i++){\n getMoviesForGenre(response.genres[i].name, response.genres[i].id, response.vote_average)\n }\n });\n }", "function newRatings(){\r\n\tif(pageType==\"LIST\"){\r\n\t\ttitle=$(\".bobMovieHeader\").children(\".title\").text();\r\n\t\tyear=$(\".bobMovieHeader\").children(\".year\").text().split('-')[0];\r\n\t\tif(lastTitle!=title){\r\n\t\t\tlastTitle=title\r\n\t\t\tgetRating(title,year)\r\n\t\t}\r\n\t\telse{\r\n\t\t\tsetResults(imdbRating,tomatoMeter,imdbId);\r\n\t\t}\r\n\t}\r\n\telse{\r\n\t\ttitle = $('.title-wrapper').children('.title').text();\r\n\t\tyear = $('.titleArea').children(\".year\").text().split('-')[0];\r\n\t\tgetRating(title,year);\r\n\t}\r\n}", "function filterBy(filter) {\n JsontoHTML()\n for (let i = 0; i < all_html.length; i++) {\n let c = databaseObj[i];\n let genre = (JSON.parse(c[\"genres\"]))\n for (let a = 0; a < genre.length; a++) {\n if (genre[a][\"name\"] === filter) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }\n }\n storage()\n }", "function getGenres() {\n // TODO: get categories from wp headless\n // https://movie-api.cederdorff.com/wp-json/wp/v2/categories\n}", "async function topMoviesPageMain()\n{\n\n\t//first I have to fetch the data\n\tvar dataSheet = await fetching();\n\n\t//since I only need the enties\n\tdataSheet = dataSheet.feed.entry;\n\n\t//convert the coma separated genre values to an array\n\tdataSheet = convertGenre(dataSheet);\n\n\t//getting the list of top movies\n\tvar topMovies = getTopMovies(dataSheet);\n\n\t//creating the movie cards\n\tcreateMovieCards(topMovies,'topList',topMovies.length);\n\n\t//setting event listener to the cards\n\tsetCards();\n\n}", "function searchMovies(searchType, movie) {\n const url = `http://www.omdbapi.com/?t=${movie}&y=&plot=short&apikey=trilogy`;\n axios.get(url).then(\n function (response) {\n let data = \"\";\n //console.log(response.data);\n if (response.data !== null) {\n\n console.log(`Movie Title: ${response.data.Title}`);\n console.log(`Year Release: ${response.data.Year}`);\n console.log(`Imdb Rating: ${response.data.imdbRating}`);\n //response.data.Ratings.filter(\"\")\n let rott = \"\";\n if (Object.values(response.data.Ratings).length > 1) {\n rott = Object.values(response.data.Ratings[1]).join(\": \");\n\n } else {\n rott = \"Rotten tomatoes: not rated yet\";\n }\n console.log(rott);\n console.log(`Country: ${response.data.Country}`);\n console.log(`Languages: ${response.data.Language}`);\n console.log(`Plot: ${response.data.Plot}`);\n console.log(`Main Cast: ${response.data.Actors}`);\n console.log(`------------------------------------------------------`);\n rott = rott.split(\":\");\n data = `{\"${searchType} ${movie}\":{\n \"Movie Title\": \"${response.data.Title}\"\n \"Year Release\": \"${response.data.Year}\",\n \"Imdb Rating\": \"${response.data.imdbRating}\",\n \"${rott[0]}\":\"${rott[1]}\",\n \"Country\": \"${response.data.Country}\",\n \"Languages\": \"${response.data.Language}\",\n \"Plot\": \"${response.data.Plot}\",\n \"Main Cast\": \"${response.data.Actors}\"\n },`\n } else {\n console.log(\"movie not found\");\n }\n\n logData(data);\n }\n ).catch(err => {\n console.log(`Oh oh, something went wrong...${err}`);\n continueMenu();\n });\n}", "function movieList(query, sortBy, order) {\n\n getMovies(query, sortBy, order).then((movies) => {\n //console.log('Here are all the movies:');\n movies.forEach(({title, rating, id, tvdb, imdb_id, fav}) => {\n// console.log(`id#${id} - ${title} - rating: ${rating}`);\n\n let moviePoster = \"images/placeholder.png\";\n let movieBackdrop = \"\";\n let star = 'star_border';\n let favStar = '';\n\n if (tvdb) {\n console.log('data exists for tvdb');\n if(tvdb.poster_path !== null) moviePoster = 'https://image.tmdb.org/t/p/w500/' + tvdb.poster_path;\n if(tvdb.backdrop_path !== null) movieBackdrop = 'https://image.tmdb.org/t/p/original/' + tvdb.backdrop_path;\n\n }\n\n star = (fav === true) ? 'star' : 'star_border';\n favStar = (fav === true) ? 'favorite-true' : '';\n\n $(`<div class=\"movie p-2 m-2\" id=\"movie-${id}\">`).append(\n $('<div class=\"movie-img\">').append(\n $(`<img src=\"${moviePoster}\" id=\"img-${id}\" class=\"img-fluid main\">`)),\n $('<div class=\"movie-title text-truncate\">').text(title),\n $('<div class=\"movie-database\">').append(\n $(`<img src=\"images/loader.svg\" class=\"loading-data hide\" id=\"loading-movie-${id}\">`).text(''),\n $(`<input type=\"hidden\" id=\"movie-imdb-${id}\" value=\"${imdb_id}\">`).text(''),\n $(`<button id=\"update-movie-${id}\" class=\"update\" value=\"${id}\">`).html(\"<i class=\\\"material-icons\\\">autorenew</i>\"),\n $(`<button id=\"edit-movie-${id}\" class=\"edit\" value=\"${id}\">`).html('<i class=\"material-icons\">create</i>'),\n $(`<button id=\"delete-movie-${id}\" class=\"delete\" value=\"${id}\">`).html('<i class=\"material-icons\">delete_forever</i>'),\n $(`<button id=\"fav-movie-${id}\" class=\"favorite ${favStar}\" value=\"${id}\">`).html(`<i class=\"material-icons\">${star}</i>`),\n )).appendTo('#moviesList');\n\n\n $(`#img-${id}, #update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('${movieBackdrop}')`);\n $(`#img-${id}`).addClass('standard-hover');\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.6);\n $('.favorite-true').css('opacity',1);\n\n }, function () {\n $(`#update-movie-${id}, #edit-movie-${id}, #delete-movie-${id}, #fav-movie-${id}`).css('opacity',0.0);\n $(`#img-${id}`).removeClass('standard-hover');\n $('.favorite-true').css('opacity',1);\n\n });\n\n\n $(`#img-${id}`).click(function() {\n displayMovie(id);\n });\n\n $(`#edit-movie-${id}`).click(function () {\n displayEditMovie(id);\n });\n\n $(`#fav-movie-${id}`).click(function() {\n\n let star = $(this).children('i').text();\n console.log(star);\n (star !== 'star') ? $(this).children('i').text('star') : $(this).children('i').text('star_border');\n (star !== 'star') ? addFav(id, true) : addFav(id,false);\n (star !== 'star') ? $(this).addClass('favorite-true') : $(this).removeClass('favorite-true');\n\n });\n\n $(`#delete-movie-${id}`).click(function () {\n\n // TODO: reaplce this with a in-page function\n const confirmed = window.confirm(\"Are you sure\");\n\n if (confirmed === true) {\n $(`#movie-${id}`).addClass('hide');\n deleteMovie(id);\n console.log(`deleted: ` + id);\n\n\n } else {\n console.log(`cancelled the delete: ` + id);\n }\n\n });\n\n $(`#update-movie-${id}`).click(function (e) {\n e.preventDefault();\n $(`#loading-movie-${id}`).removeClass('hide');\n $(`#img-${id}`).addClass('loading-hover');\n\n const movieId = $(`#movie-imdb-${id}`).val();\n\n $(this).off('click');\n\n setTimeout(function () {\n getMovieDBData(movieId).then((movies) => {\n console.log('Here are all the movies:');\n console.log(movies.movie_results[0]);\n\n const movie = movies.movie_results[0];\n\n\n getFullMovieData(movie.id).then(movie => {\n\n\n addMovieData(id,\n {\n title: movie.title,\n rating: movie.vote_average,\n tvdb: movie\n });\n\n\n\n $(`#img-${id}`).attr('src', `https://image.tmdb.org/t/p/w500/${movie.poster_path}`);\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n\n $(`#img-${id}`).hover(function () {\n $('.bg-container').css('background-image', `url('https://image.tmdb.org/t/p/original/${movie.backdrop_path}')`);\n });\n\n $(`#loading-movie-${id}`).addClass('hide');\n $(`#img-${id}`).removeClass('loading-hover');\n\n });\n\n\n\n\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n\n $(this).on('click');\n\n $('.loading-container').hide();\n }, 3000);\n\n });\n\n $('.loading-container').hide();\n\n });\n\n }).catch((error) => {\n alert('Oh no! Something went wrong.\\nCheck the console for details.');\n console.log(error);\n });\n}", "async fetchSpecificMovie(ctx, payload) {\n let specificSearchResult = [];\n let result = [];\n await axios.get('http://www.omdbapi.com/?apiKey='+ key.key + '&t='+ payload.searchReplaced + '&y=' + payload.year).then((response) => { specificSearchResult = response.data });\n result.push(specificSearchResult);\n ctx.commit('setSearchResult', result);\n ctx.commit('setSearchResponse', result[0].Response);\n }", "function dramaMoviesRate(movies){\n const dramaMovie = movies.filter (function(movie)}\n return movie.genre.indexOf(\"Drama\")\n})", "function dramaMoviesRate(movies){\n let dramaMovies = movies.filter(movie => movie.genre.some(genre => genre === 'Drama'));\n return ratesAverage(dramaMovies);\n}", "function rating(id) {\n return $.getJSON(\"/api/movies/\" + id + \"/ratings\");\n }", "async getMovieGenres(language = \"en-US\") {\n return this.get(\"movie/list\", {\n language,\n });\n }", "function dramaMoviesRate(movies){\n // filter out the drama movies\n const dramas = movies.filter(function (movie))\n\n}", "function filter_movie_data_by_title(title) {\n\tfiltered_data = [];\n\t$(sf_movie_data).each( function(i,data){\n\t\tif (data[8] == title) {\n\t\t\tfiltered_data.push(data);\n\t\t}\n\t} );\n\treturn filtered_data;\n}", "getPopularMovies() {\n const requestSettings = {\n method: 'GET',\n baseURL: API_BASE_URL,\n url: AVAILABLE_API_METHODS.getPopular,\n params: {\n api_key: API_KEY\n }\n };\n\n return axios(requestSettings);\n }", "function findMovie(title){\n\tvar title = processInput(title);\n\n\tif(title != undefined){\n\t\tvar formattedTitle = title.replace(\" \", \"+\");\t\n\t\tvar query = \"http://www.omdbapi.com/?t=\" + formattedTitle;\n\n\t\trequest(query, function (error, response, body) {\n\t\t\tif(error){\n\t\t\t\tconsole.log(error);\n\t\t\t} else{\n\t\t\t\tvar movieTitle = JSON.parse(body).Title;\n\t\t\t\tvar year = JSON.parse(body).Year;\n\t\t\t\tvar imdbRating = JSON.parse(body).Ratings[0].Value;\n\t\t\t\tvar country = JSON.parse(body).Country;\n\t\t\t\tvar language = JSON.parse(body).Language;\n\t\t\t\tvar plot = JSON.parse(body).Plot;\n\t\t\t\tvar actors = JSON.parse(body).Actors;\n\t\t\t\tvar rottenRating = JSON.parse(body).Ratings[1].Value;\n\t\t\t\tvar rottenURL = \"blah\";\n\n\t\t\t\tvar output = \"\\nMovie Title: \" + movieTitle + \"\\nYear Released: \" \n\t\t\t\t\t+ year + \"\\nCountry Filmed: \" + country + \"\\nLanguages Released In: \"\n\t\t\t\t\t + language + \"\\nActors: \" + actors + \"\\n\\nPlot: \" + plot + \"\\n\\nIMDB Rating: \" \n\t\t\t\t\t + imdbRating + \"\\nRotten Tomatoes Rating: \" + rottenRating + \"\\nRotten Tomatoes URL: \" \n\t\t\t\t\t + rottenURL;\n\n\t\t\t\tconsole.log(output);\n\t\t\t\twriteFS(output);\n\n\t\t\t};\n\t\t});\n\t};\n}", "function dramaMoviesRate(movies) {\n\n const moviesAverageRateDrama = [...movies.filter(eachMovie => eachMovie.genre.includes('Drama'))]\n\n return ratesAverage(moviesAverageRateDrama)\n\n}", "function populateFavs() {\n var favArr = JSON.parse(localStorage.getItem(\"favourites\"));\n if (favArr) {\n for (i = 0; i < favArr.length; i++) {\n getMovieDetails(favArr[i]);\n }\n }\n}", "function dramaMoviesRate(movies) {\n var drama = movies.filter((movie) => movie.genre.includes(\"Drama\"));\n return ratesAverage(drama)\n\n}", "function dramaMoviesRate(movies) {\n let newArr = [...movies];\n let dramaArray = newArr.filter(element => element.genre.includes(\"Drama\"));\n return ratesAverage(dramaArray);\n}", "function getMovieInfo (title, year, rating) {\n return fetch(`${omdbMainURL}&t=${title}&y=${year}`)\n .then(res => res.json())\n .then(data => {\n return new Constructor({\n title: data.Title,\n year: data.Year,\n criticRatings: data.Ratings,\n userRating: rating,\n poster: data.Poster,\n genre: data.Genre,\n director: data.Director,\n plot: data.Plot,\n actors: data.Actors,\n id: Date.now()\n });\n })\n .catch(console.error);\n }", "function getMovieData(e) {\n // Retrieve local storage - Movies\n var getMovieData = JSON.parse(localStorage.getItem(\"film\"));\n var movieId = e.target.getAttribute(\"data-id\");\n var selected = getMovieData.filter((film) => film.id === parseInt(movieId));\n\n if (selected.length > 0) {\n selected = selected[0];\n }\n hideMovie.classList.remove(\"hidden\");\n movieTitle.textContent = selected.original_title;\n overviewDiv.textContent = selected.overview;\n\n var movieposter = \"https://image.tmdb.org/t/p/w500/\" + selected.poster_path;\n MovieImage.src = movieposter;\n}", "function ex20() {\n\tvar movieLists = [\n\t\t{\n\t\t\tname: \"New Releases\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 70111470,\n\t\t\t\t\t\"title\": \"Die Hard\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 150, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/DieHard200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 654356453,\n\t\t\t\t\t\"title\": \"Bad Boys\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys200.jpg\" },\n\t\t\t\t\t\t{ width: 140, height:200, url:\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" }\n\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t\t{\n\t\t\tname: \"Thrillers\",\n\t\t\tvideos: [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 65432445,\n\t\t\t\t\t\"title\": \"The Chamber\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 130, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/TheChamber200.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 4.0,\n\t\t\t\t\t\"bookmark\": []\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 675465,\n\t\t\t\t\t\"title\": \"Fracture\",\n\t\t\t\t\t\"boxarts\": [\n\t\t\t\t\t\t{ width: 200, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture200.jpg\" },\n\t\t\t\t\t\t{ width: 120, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t\t\t\t\t\t{ width: 300, height:200, url:\"http://cdn-0.nflximg.com/images/2891/Fracture300.jpg\" }\n\t\t\t\t\t],\n\t\t\t\t\t\"url\": \"http://api.netflix.com/catalog/titles/movies/70111470\",\n\t\t\t\t\t\"rating\": 5.0,\n\t\t\t\t\t\"bookmark\": [{ id:432534, time:65876586 }]\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t];\n\n\n\t// Use one or more concatMap, map, and reduce calls to create an array with the following items (order doesn't matter)\n\t// [\n\t//\t {\"id\": 675465,\"title\": \"Fracture\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/Fracture120.jpg\" },\n\t//\t {\"id\": 65432445,\"title\": \"The Chamber\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/TheChamber130.jpg\" },\n\t//\t {\"id\": 654356453,\"title\": \"Bad Boys\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/BadBoys140.jpg\" },\n\t//\t {\"id\": 70111470,\"title\": \"Die Hard\",\"boxart\":\"http://cdn-0.nflximg.com/images/2891/DieHard150.jpg\" }\n\t// ];\n\n\treturn movieLists.\n\t\tconcatMap(movieList => movieList.videos.concatMap(v=> v.boxarts\n .reduce((acc, curr) => acc.width * acc.height < curr.width * curr.height ? acc : curr)\n .map(b => ({id: v.id, title: v.title, boxart: b.url}))\n )\n )\n\n}", "function Movie(name, genre, rating) {\n this.name = name;\n this.genre = genre;\n this.rating = rating;\n}", "filterSeries() {\r\n // reset array for search\r\n this.series = this.copySeries\r\n // check genre\r\n if (this.selectedGenreS !== 'all') {\r\n this.series = this.series.filter(\r\n (serie) => {\r\n if (serie.genre_ids.includes(this.selectedGenreS))\r\n return serie\r\n }\r\n )\r\n } else { this.series = this.copySeries; }\r\n // check if there are movies for the genre\r\n this.resultSeries = (this.series.length === 0) ? true : false;\r\n //return result\r\n return this.series;\r\n }", "function MovieSearch(movie) {\n request(omdb.url + movie, function (error, response, body) {\n if (error) {\n console.log('error:', error);\n console.log('statusCode:', response && response.statusCode);\n }\n //Convert string to JSON object\n var data = JSON.parse(body)\n //Desired properties to log\n var properties = [data.Title, data.Year, data.Rated, data.Ratings[1].Value,\n data.Country, data.Language, data.Plot, data.Actors\n ];\n //Property text (aesthetics)\n var text = ['Title: ', 'Year: ', 'Rated: ', 'Rotten Tomatoes: ',\n 'Country: ', 'Language: ', 'Plot: ', 'Actors: '\n ];\n //Log results\n for (var i = 0; i < properties.length; i++) {\n console.log(text[i], properties[i]);\n }\n });\n}" ]
[ "0.58723307", "0.56935096", "0.56881374", "0.56881106", "0.5616227", "0.5546773", "0.55130726", "0.5501481", "0.55011076", "0.54993886", "0.5485237", "0.5466375", "0.54627585", "0.5451765", "0.54440784", "0.5442648", "0.5428851", "0.54076856", "0.53821534", "0.5366641", "0.53405637", "0.5303822", "0.52989644", "0.52891105", "0.52850723", "0.5277342", "0.52696145", "0.52692264", "0.5263445", "0.5251906", "0.52346945", "0.52250814", "0.522099", "0.52173084", "0.518735", "0.5177471", "0.5174291", "0.5171024", "0.5170408", "0.5151618", "0.51396585", "0.5139318", "0.5131083", "0.51290375", "0.5125702", "0.5124325", "0.5123369", "0.5110183", "0.51021516", "0.5092578", "0.5086046", "0.50780284", "0.506745", "0.5065591", "0.50622827", "0.5057086", "0.5036218", "0.5029579", "0.5021315", "0.50175774", "0.50026023", "0.4991874", "0.4989426", "0.49874318", "0.49836522", "0.49805123", "0.49733928", "0.4971332", "0.49705145", "0.4968775", "0.49675897", "0.4961614", "0.4956633", "0.4948343", "0.4947914", "0.4947023", "0.4946086", "0.49447936", "0.49337012", "0.49313694", "0.49305996", "0.49277908", "0.49234125", "0.49226463", "0.49184072", "0.4915601", "0.49141774", "0.4907018", "0.49065736", "0.4904839", "0.4901033", "0.4895617", "0.48899734", "0.48864716", "0.48838386", "0.48815572", "0.4875612", "0.48677623", "0.48666453", "0.4862153" ]
0.57119143
1
Send the results as template strings to their respective parent elements
function renderMovieListing(movies){ let filmstrip = ''; let movieGenres = []; let availableGenres = localStorage.getItem("currentGenres") ? JSON.parse(localStorage.getItem("currentGenres")) : getGenres(); for(let movie of movies){ movieGenres.push(... new Set(movie.genre_ids)); const filmGenres = filterArray("id", availableGenres, movie.genre_ids); filmstrip += ` <figure class="movie"> <img class="movie--poster" srcset="https://image.tmdb.org/t/p/w342/${movie.poster_path} 320w, https://image.tmdb.org/t/p/w500/${movie.poster_path} 480w, https://image.tmdb.org/t/p/original/${movie.poster_path} 800w" sizes="(max-width: 320px) 280px, (max-width: 480px) 440px, 800px" src="https://image.tmdb.org/t/p/w92/${movie.poster_path}" alt="${movie.title} Poster" /> <figcaption class="movie--credits"> <h2 class="movie--title">${movie.title}</h2> <h3 class="movie--rating">Rating: ${movie.vote_average}</h3> <ul class="movie--genres tags"> ${filmGenres.map(genre => (`<li class="genre tag"><span class="tag-label">${genre.name}</span></li>`)).join('')} </ul> </figcaption> </figure> `; } //set the cinema content to the template strings document.getElementById('cinema').innerHTML = filmstrip; //get unique set of genres to filter against available genres from api const currentGenres = [...new Set(movieGenres)]; //filter the current genres to create a new object const filmGenres = filterArray("id", availableGenres,currentGenres); let genres = ''; for(let genre of filmGenres ){ let name = genre.name.replace(" ","_").toLowerCase(); let id = genre.id; genres += ` <li class="genre tag"> <input class="genre--selector" type="checkbox" id="${name}-${id}" name="genre-tags" value="${id}"> <label class="tag-label" for="${name}-${id}" name="${name}-label">${genre.name}</label> </li>`; } document.getElementById('genres').innerHTML = genres; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _html(pobj, obj, template, options, index){\n \n //Create a new ihtml object for the parent and it's children\n var parent = new iHTML(),\n children = new iHTML();\n \n //Set the default html element key\n\t\tvar ele = \"<>\";\n\t\t\n\t\t//Look into the properties of this template\n\t\tfor (var prop in template) {\n\t\t \n\t\t\tswitch(prop) {\n\t\t\t\t\n\t\t\t\t//DEPRECATED (use <> instead)\n\t\t\t\tcase \"tag\":\n\t\t\t\t \n\t\t\t\t //Signal we're using a deprecated property\n\t\t\t\t //TODO output warning??\n\t\t\t\t ele = \"tag\";\n\t\t\t\t \n\t\t\t\t//HTML element\n\t\t\t\tcase \"<>\":\n\t\t\t\t\t\n\t\t\t\t\t//Get the element name (this can be tokenized)\n \t\tparent.name = _getValue(pobj || obj, template, ele, options, index);\n \t\t\n \t\t//Create a new element\n\t\t parent.appendHTML(\"<\" + parent.name);\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Data object\n\t\t case \"obj\":\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//Encode text\n\t\t\t\tcase \"text\":\n\t\t\t\t\t\n\t\t\t\t\t//Determine what kind of object this is\n\t\t\t\t\t// array => NOT SUPPORTED\n\t\t\t\t\t// other => text\n\t\t\t\t\t// Encode the value as text and add it to the children\n\t\t\t\t\tif(!_isArray(template[prop])) children.appendHTML( json2html.toText( _getValue(obj,template,prop,options,index) ) );\n\t\t\t\t\t \n\t\t\t\tbreak;\n\t\t\t\t\n\t\t\t\t//DEPRECATED (use HTML instead)\n\t\t\t\tcase \"children\":\n\t\t\t\t \n\t\t\t\t//TODO output warning??\n\t\t\t\t \n\t\t\t\t//Encode as HTML\n\t\t\t\t// accepts array of children, functions, string, number, boolean\n\t\t\t\tcase \"html\":\n\t\t\t\t \n\t\t\t\t\t//Determine if we have more than one template\n\t\t\t\t\t// array & function => children\n\t\t\t\t\t// other => html\n\t\t\t\t\tswitch(_typeof(template[prop],true)) {\n \n case \"array\":\n \n //render the children\n\t\t\t\t children.append( _render(obj, template[prop], options, index) );\n break;\n \n case \"function\":\n \n //Get the result from the function\n var temp = template[prop].call(obj, obj, index, options.data, options.$ihtml);\n \n //Determine what type of result we have\n switch(_typeof(temp,true)) {\n \n //Only returned by json2html.render or $.json2html calls\n case \"object\":\n \n //Check the type of object\n switch(temp.type) {\n \n //Add the object as a template\n case \"iHTML\":\n children.append(temp);\n break;\n \n //Otherwise don't render\n default:\n \n break;\n }\n \n break;\n \n //Not supported\n case \"function\":\n case \"undefined\":\n case \"null\":\n break; \n \n //Render the array as a string\n // append to html\n case \"array\":\n children.appendHTML(temp.toString());\n break;\n \n //string, number, boolean, etc..\n // append to html\n default:\n \tchildren.appendHTML(temp);\n break;\n }\n break;\n \n default:\n //Get the HTML associated with this element\n children.appendHTML( _getValue(obj,template,prop,options,index) );\n break;\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\t//Add the property as a attribute if it's not a key one\n\t\t\t\t\tvar isEvent = false;\n\t\t\t\t\t\n\t\t\t\t\t//Check if the first two characters are 'on' then this is an event\n\t\t\t\t\tif( prop.length > 2 )\n\t\t\t\t\t\tif( prop.substring(0,2).toLowerCase() === \"on\" ) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Determine if we should add events\n\t\t\t\t\t\t\tif(options.output === \"ihtml\") {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t//if so then setup the event data\n\t\t\t\t\t\t\t\tvar data = {\n\t\t\t\t\t\t\t\t\t\"obj\":obj,\n\t\t\t\t\t\t\t\t\t\"data\":options.data,\n\t\t\t\t\t\t\t\t\t\"index\":index\n\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//create a new id for this event\n\t\t\t\t\t\t\t\tvar id = _id();\n\n\t\t\t\t\t\t\t\t//append the new event\n\t\t\t\t\t\t\t\tparent.events.push( {\"id\":id,\"type\":prop.substring(2),\"data\":data,\"action\":template[prop]} );\n\n\t\t\t\t\t\t\t\t//Insert temporary event property -j2h-e\n\t\t\t\t\t\t\t\tparent.appendHTML(\" -j2h-e='\" + id + \"'\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//this is an event\n\t\t\t\t\t\t\tisEvent = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t//If this wasn't an event AND we actually have a value then add it as a property\n\t\t\t\t\tif(!isEvent){\n\t\t\t\t\t\t//Get the value\n\t\t\t\t\t\tvar val = _getValue(obj, template, prop, options, index);\n\t\t\t\t\t\t\n\t\t\t\t\t\t//Make sure we have a value\n\t\t\t\t\t\tif(val !== undefined) {\n\t\t\t\t\t\t\tvar out;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//Determine the output type of this value (wrap with quotes)\n\t\t\t\t\t\t\tif(typeof val === \"string\") out = '\"' + val.replace(/\"/g, '&quot;') + '\"';\n\t\t\t\t\t\t\telse out = val;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t//create the name value pair\n\t\t\t\t\t\t\tparent.appendHTML(\" \" + prop + \"=\" + out);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Check to see if the parent is an html element\n\t\t// or just a container\n\t\tif(parent.name) {\n\t\t \n\t\t //Determine if this is a void element\n // shouldn't have any contents\n if(_isVoidElement(parent.name)) parent.appendHTML(\"/>\");\n else {\n \n \t//Close the opening tag\n \tparent.appendHTML(\">\");\n \t\n \t//add the children\n \tparent.append(children);\n \t\n \t//add the closing tag\n \tparent.appendHTML(\"</\" + parent.name + \">\");\n }\n\t\t} else {\n\t\t \n\t\t //Otherwise we don't have a parent html element\n\t\t // so just add the children to the empty parent\n \tparent.append(children);\n\t\t}\n\t\t\n\t\treturn(parent);\n }", "function printRisultati(results)\n{\n for (var i = 0; i < results.length; i++) {\n\n var result = results[i];\n\n //var source = document.getElementById(\"entry-template\").innerHTML;\n\n var source = $('#template').html();\n var template = Handlebars.compile(source);\n\n var context = {\n 'id': result.id,\n 'room_number': result.room_number,\n 'floor': result.floor,\n 'beds': result.beds,\n 'created_at': result.created_at,\n 'updated_at': result.updated_at\n };\n var html = template(context);\n\n $('tbody').append(html);\n }\n\n}", "function buildData(parent, data, template) {\n handleEmptySection(parent, true, null);\n data.forEach(d => {\n const child = stringToHtml(template(d))\n parent.appendChild(child)\n })\n}", "function writeResults(parentNode) {\n \n var div_card = document.createElement(\"div\");\n div_card.className = \"card\";\n \n var div_cardbody = document.createElement(\"div\");\n div_cardbody.className = \"card-body\";\n div_card.appendChild(div_cardbody);\n\n var h5 = document.createElement(\"h5\");\n h5.className = \"card-title\";\n h5.innerText = \"Cheque Format\"\n div_cardbody.appendChild(h5);\n\n var p = document.createElement(\"p\");\n p.id = \"result_payeename\"\n p.className = \"card-text\";\n div_cardbody.appendChild(p);\n\n var p = document.createElement(\"p\");\n p.id = \"currency-format-numeric\"\n p.className = \"card-text\";\n div_cardbody.appendChild(p);\n\n var p = document.createElement(\"p\");\n p.id = \"currency-format-words\"\n p.className = \"card-text\";\n div_cardbody.appendChild(p);\n\n parentNode.appendChild(div_card);\n\n}", "templateValues() {\n // create an object w/ the props that were caught by the earlier getters\n const caughtValues = {\n label: this.label,\n left: this.left,\n right: this.right,\n };\n\n // replace mainContainer html w/ the templated string.\n this.mainContainer.innerHTML = this.replace(this.mainContainer.innerHTML, caughtValues);\n }", "updateHtml() {\n\t\tthis.childrenHtml = []\n\t\tfor (let i = 0; i < Object.keys(this.children).length; i++) {\n\t\t\tthis.childrenHtml.push(\n\t\t\t\tthis.children[Object.keys(this.children)[i]].html\n\t\t\t)\n\t\t}\n\n\t\tthis.html = (\n\t\t\t<li key={this.key}>\n\t\t\t\t<div className={this.isEnd ? 'normal end' : 'normal'}>\n\t\t\t\t\t{this.key ? this.key : 'Root'}\n\t\t\t\t</div>\n\t\t\t\t{this.childrenHtml.length ? (\n\t\t\t\t\t<ul>{this.childrenHtml}</ul>\n\t\t\t\t) : null}\n\t\t\t</li>\n\t\t)\n\n\t\tif (this.parent) this.parent.updateHtml()\n\t}", "function stocktakingResultTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"stocktakingResultTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var stocktakingStorageGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var storageContainer = document.getElementById(\"stocktakingResultContainer\");\n storageContainer.innerHTML = stocktakingStorageGeneratedHTML;\n}", "render() {\n\t\t\tconst template = result(this, 'template');\n\n\t\t\tif (template instanceof HTMLTemplateElement) {\n\t\t\t\tconst root = getRoot(this);\n\n\t\t\t\t// Clone and infuse the `template` and append the resulting fragment to `root`.\n\t\t\t\troot.appendChild(infuse(this, template));\n\t\t\t}\n\t\t}", "function printResult(result) {\r\n reset();\r\n var source = $('#entry-template').html();\r\n var template = Handlebars.compile(source);\r\n for (var i = 0; i < result.length; i++) {\r\n if (result.length > 0) {\r\n var thisCD = result[i];\r\n var context = {\r\n poster: thisCD.poster,\r\n title: thisCD.title,\r\n author: thisCD.author,\r\n year: thisCD.year\r\n };\r\n var html = template(context);\r\n $('.cds-container').append(html);\r\n } else {\r\n printNoResult();\r\n }\r\n }\r\n}", "render (parent) {\n // Update template\n this.template = '<div>' + this.label + '</div>';\n\n // Call original render function\n this._render (parent);\n }", "renderJournalEntries (interiorEntryObject) {\n let entryHTMLTrigg= document.querySelector(\".entryLog\")\n entryHTMLTrigg.innerHTML= \"\"\n \n for(interiorEntryObject of API.journalEntries){\n // Convert the entry object HTML representation\n const entryHTML = entryHTMLRepresentation.entryConverter(interiorEntryObject);\n\n // Find the Trigg element in index.html to store information\n const triggElement = document.querySelector('.entryLog');\n \n //Now the converters info is being shoved into that entryHTML\n triggElement.innerHTML += entryHTML; \n }\n}", "function render(result,container){var templateFactory=arguments.length>2&&arguments[2]!==undefined?arguments[2]:defaultTemplateFactory;var template=templateFactory(result);var instance=container.__templateInstance;// Repeat render, just call update()\nif(instance!==undefined&&instance.template===template&&instance._partCallback===result.partCallback){instance.update(result.values);return;}// First render, create a new TemplateInstance and append it\ninstance=new TemplateInstance(template,result.partCallback,templateFactory);container.__templateInstance=instance;var fragment=instance._clone();instance.update(result.values);removeNodes(container,container.firstChild);container.appendChild(fragment);}", "function createContentForGraphs () {\n resetGraphValuesBeforeRendering();\n //first graph template\n var entireTemplateForGraphs = ``;\n AppData.listOfGraphsData.forEach(function (arrayItem, index, arrayObject) {\n var arrayItemWithDataSeriesAdded = returnDataSeriesForArrayItem(arrayItem); \n var tempGraphTemplate = \n `<div class=\"col-12 col-lg-6 mb-1\">\n <div class=\"card\"><div class=\"card-body\">` + returnGraphPlaceholder(arrayItemWithDataSeriesAdded) + `</div></div>\n </div>`;\n entireTemplateForGraphs = entireTemplateForGraphs + tempGraphTemplate;\n });\n /* since we created placeholder containers (returnGraphPlaceholder), we will start checking when those elements are added to DOM\n we want to attach Graphs when those elements are added to DOM\n */\n startCheckingForAddedGraphsPlaceholders();\n return entireTemplateForGraphs;\n }", "function stocktakingResultTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"stocktakingResultTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var stocktakingStorageGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var storageContainer = document.getElementById(\"stocktakingResultContainer\");\n storageContainer.innerHTML = stocktakingStorageGeneratedHTML;\n}", "function buildHTML() {\n //initialize html\n html = \"\";\n\n for(var i=0; i<elements.length; i++) {\n switch(elements[i].type) {\n case 'title':\n buildTitle(elements[i].options);\n break;\n case 'header':\n buildHeader(elements[i].options);\n break;\n case 'img-one':\n buildImageOne(elements[i].options);\n break;\n case 'img-two':\n buildImageTwo(elements[i].options);\n break;\n case 'img-three':\n buildImageThree(elements[i].options);\n break;\n case 'article-right':\n buildArticleRight(elements[i].options);\n break;\n case 'article-left':\n buildArticleLeft(elements[i].options);\n break;\n case 'text' :\n buildText(elements[i].options);\n break;\n \n }\n }\n buildEnd();\n\n document.getElementById('HTML').innerText = `${html}`;\n}", "buildTop() {\n this.rootEl_.prepend(buildResultsTopTemplate(this.element));\n }", "buildAstElement(element)\r\n {\r\n var html = '<div class=\"' + element[\"data\"][\"roleInParent\"] + '\"><span>' + element[\"data\"][\"properties\"] + '</span>'\r\n\r\n element[\"children\"].forEach(child => {\r\n html += this.buildAstElement(child);\r\n });\r\n\r\n return html + '</div>';\r\n }", "function renderElems(elements, template, container) {\n let html = '';\n [].concat(elements).forEach(elem => html += template(elem));\n container.append(html);\n }", "get outerHTML() {\n let html = '<my-' + this.kind + this.classList.asAttribute + this.getAttributes() + '>';\n for (let child of this.childNodes) {\n html += child.outerHTML;\n }\n html += '</my-' + this.kind + '>';\n return html;\n }", "function _drawResults() { \n let template=\"\"\n ProxyState.songs.forEach(s => template += s.allMusicTemplate)\n document.getElementById('songs').innerHTML = template\n}", "function itemtoHTML() {\n for (let i = 0; i < all_html.length; i++) {\n $(\".items\").append([all_html[i]].map(movie_item_template).join(\"\"));\n }\n }", "function generateAllCvtHTML(data) {\n \n var list = $('.cvt-report .cvt-list');\n var templateScript = $('#cvt-template').html();\n\n // compile template\n var template = Handlebars.compile(templateScript);\n list.append(template(data));\n }", "function openSubItemTemplate(tmp, parentTemplate, index, count, str) {\n\n // Open the sub-template\n var subTemplate = openSubTemplate(tmp, parentTemplate);\n\n // Set the \"index\" and \"str\" values\n subTemplate.index = index;\n subTemplate.count = count;\n subTemplate.str = str;\n\n // Return\n return subTemplate;\n\n }", "function render(){\n\tvar src = \"\"\n\tfor(i in TodoList.items) src += ItemTemplate(TodoList.items[i]);\n\tel.innerHTML = src;\n}", "function showResult() {\n $('main').html(resultTemplate());\n}", "getHtmlTemplateString(employeesObjectArray) {\n let employeeDetails = \"\";\n let iconHtml = \"\";\n const returnedHtmlObjects = [];\n //iterate over each employee\n for (const employee of employeesObjectArray) {\n // https://stackoverflow.com/questions/10314338/get-name-of-object-or-class\n const currentObjectTypeName = employee.constructor.name;\n //different employee types get different HTML\n if (currentObjectTypeName == \"Manager\") {\n employeeDetails = this.getHtmlManagerDetails(employee.getId(), employee.getEmail(), employee.getOfficeNumber());\n iconHtml = \"<i class='fas fa-tasks'></i>\";\n } else if (currentObjectTypeName == \"Engineer\") {\n employeeDetails = this.getHtmlEngineerDetails(employee.getId(), employee.getEmail(), employee.getGitHub());\n iconHtml = \"<i class='fas fa-laptop-code'></i>\";\n } else if (currentObjectTypeName == \"Intern\") {\n employeeDetails = this.getHtmlInternDetails(employee.getId(), employee.getEmail(), employee.getSchool());\n iconHtml = \"<i class='fas fa-glasses'></i>\";\n }\n //add each iteration to an array\n returnedHtmlObjects.push(this.getHtmlEmployeeString(employee.getName(), employee.getDescription(), iconHtml, currentObjectTypeName, employee.getImageUrl(), employeeDetails));\n }\n //pass the array to be wrapped and return constructed and formatted HTML\n const innerHtml = this.wrapInParentHtml(returnedHtmlObjects);\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"utf-8\">\n <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">\n <title>Our Software Team</title>\n <link rel=\"stylesheet\" href=\"https://unpkg.com/[email protected]/css/bulma.min.css\" />\n <link rel=\"stylesheet\" type=\"text/css\" href=\"./hero.css\">\n <script src=\"https://kit.fontawesome.com/e6ff202c8b.js\" crossorigin=\"anonymous\"></script>\n </head>\n <body>\n <section class=\"hero is-info is-small\">\n <div class=\"hero-body\">\n <div class=\"container has-text-centered\">\n <p class=\"title\">\n Our Software Team\n </p>\n </div>\n </div>\n </section>\n <section class=\"container\">\n ${innerHtml}\n </section>\n </body>\n </html>`.replace(/\\s+/g, ' ');\n }", "_generateMarkup() {\n // console.log(this._data); // data is in the form of an array. We want to return one of the below html elements for each of the elements in that array\n\n return this._data.map(this._generateMarkupPreview).join('');\n }", "function renderResults (data) {\n return `<div class=\"restaurant col-6\">\n <h3>${data.restaurant.name}</h3>\n <span class=\"website\">\n <a class=\"button-link\" href=\"${data.restaurant.url}\" target=\"_blank\">Information</a> \n <a class=\"button-link\" href=\"${data.restaurant.menu_url}\" target=\"_blank\">Menu</a>\n <p class=\"food-type\">${data.restaurant.cuisines}</p>\n </span>\n </div>`\n}", "function appendRock(contents) {\n let htmlTemplate = \"\";\n for (let content of contents) {\n htmlTemplate += /*html*/ `\n <article onclick=\"showDetailView('${content.id}')\">\n <img src=\"${getFeaturedImageUrl(content)}\">\n </article>\n `;\n }\n document.querySelector('#rock-container').innerHTML += htmlTemplate;\n}", "function renderWrapper() {\n //add the wrapper template\n document.body.innerHTML += `\n <template id=\"template_wrapper\">\n <main id=\"beautiful_ib_results\" class=\"beautiful_ib_results\" data-visible=\"false\">\n <header class=\"header\">\n <div class=\"spacer\"></div>\n <h1>IB Results</h1>\n <div class=\"spacer\"></div>\n <button id=\"close\">&#10006;</button>\n </header>\n \n <section class=\"subject-list\">\n </section>\n \n <div class=\"spacer\"></div>\n <footer>\n <span>Made with love by <a href=\"https://github.com/LeonStaufer/beautiful-results-ib\">a fellow IB student</a></span>\n </footer>\n </main>\n </template>\n `;\n\n //add the subject template\n document.body.innerHTML += `\n <template id=\"template_subject\">\n <div class=\"card\" data-flipped=\"false\">\n <div class=\"card-inner\">\n <div class=\"card-face front\">\n <header class=\"subject-header\">\n <h3 class=\"subject\">Subject</h3>\n <span class=\"level\"></span>\n </header>\n <div class=\"spacer\"></div>\n <button type=\"button\" class=\"btn\"><span>More</span></button>\n </div>\n <div class=\"card-face back\">\n <span class=\"score\">5</span>\n <div class=\"spacer\"></div>\n <button type=\"button\" class=\"btn stroked\"><span>Less</span></button>\n </div>\n </div>\n </div>\n </template>\n `;\n\n //add the error template\n document.body.innerHTML += `\n <template id=\"template_error\">\n <div class=\"card\">\n <div class=\"card-inner\">\n <div class=\"card-face front\">\n <header class=\"subject-header\">\n <h3 class=\"subject\">Error</h3>\n <div class=\"spacer\"></div>\n <span class=\"level\"></span>\n </header>\n </div>\n </div>\n </div>\n </template>\n `;\n\n //render the content of the wrapper template\n let wrapper = document.querySelector(\"#template_wrapper\").content.cloneNode(true);\n document.body.append(wrapper);\n document.querySelector(\"#close\").addEventListener(\"click\", close);\n\n //close function\n function close() {\n //get the wrapper div element\n const results = document.querySelector(\".beautiful_ib_results\");\n\n //hide beatified results\n results.setAttribute(\"data-visible\", \"false\");\n\n //show all other elements\n Array.from(document.querySelector(\"body\").children).forEach(child => {\n if (child.id === \"template_wrapper\" || child.id === \"template_subject\" || child.id === \"template_error\" || child.id === \"beautiful_ib_results\") {\n return;\n }\n\n child.removeAttribute(\"hidden\");\n });\n\n //stop countdown\n countdown({stop: true});\n }\n }", "generateHTML(type, classes, parent = app, text = \"\", id = \"\") {\n const element = document.createElement(type);\n element.classList = (classes);\n element.innerText = (text);\n element.id = (id);\n parent.appendChild(element);\n return element;\n }", "function renderToMain(elements) {\n\t\tmain.innerHTML = elements;\n\t}", "function sendStringToParentPage() {\n\t\t//var testBlock = workspace.getBlocksByType(\"definenamedranges\", false);\n\t\t//var xml = Blockly.Xml.blockToDom(testBlock[0]);\n\t\tvar xml = Blockly.Xml.workspaceToDom(workspace);\n\t\tvar xml_text = Blockly.Xml.domToText(xml);\n\t\t//xml_text = \"<xml xmlns=\\\"http://www.w3.org/1999/xhtml\\\">\" + xml_text;\n\t\t//xml_text = xml_text + \"</xml>\";\n\t\tconsole.log(\"send: \" + xml_text);\n\t\tvar messageToTaskPane = new Object();\n\t\tmessageToTaskPane.Type = 'blockDefinition';\n\t\tmessageToTaskPane.MessageContent = xml_text;\n\t\tOffice.context.ui.messageParent(JSON.stringify(messageToTaskPane));\n\t}", "function build( tmplItem, nested, content ) {\n\t\t// Convert hierarchical content into flat string array\n\t\t// and finally return array of fragments ready for DOM insertion\n\t\tvar frag, ret = content ? jQuery.map( content, function( item ) {\n\t\t\treturn (typeof item === \"string\") ?\n\t\t\t\t// Insert template item annotations, to be converted to jQuery.data( \"tmplItem\" ) when elems are inserted into DOM.\n\t\t\t\t(tmplItem.key ? item.replace( /(<\\w+)(?=[\\s>])(?![^>]*_tmplitem)([^>]*)/g, \"$1 \" + tmplItmAtt + \"=\\\"\" + tmplItem.key + \"\\\" $2\" ) : item) :\n\t\t\t\t// This is a child template item. Build nested template.\n\t\t\t\tbuild( item, tmplItem, item._ctnt );\n\t\t}) :\n\t\t// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.\n\t\ttmplItem;\n\t\tif ( nested ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\t// top-level template\n\t\tret = ret.join(\"\");\n\n\t\t// Support templates which have initial or final text nodes, or consist only of text\n\t\t// Also support HTML entities within the HTML markup.\n\t\tret.replace( /^\\s*([^<\\s][^<]*)?(<[\\w\\W]+>)([^>]*[^>\\s])?\\s*$/, function( all, before, middle, after) {\n\t\t\tfrag = jQuery( middle ).get();\n\n\t\t\tstoreTmplItems( frag );\n\t\t\tif ( before ) {\n\t\t\t\tfrag = unencode( before ).concat(frag);\n\t\t\t}\n\t\t\tif ( after ) {\n\t\t\t\tfrag = frag.concat(unencode( after ));\n\t\t\t}\n\t\t});\n\t\treturn frag ? frag : unencode( ret );\n\t}", "function build( tmplItem, nested, content ) {\n\t\t// Convert hierarchical content into flat string array\n\t\t// and finally return array of fragments ready for DOM insertion\n\t\tvar frag, ret = content ? jQuery.map( content, function( item ) {\n\t\t\treturn (typeof item === \"string\") ?\n\t\t\t\t// Insert template item annotations, to be converted to jQuery.data( \"tmplItem\" ) when elems are inserted into DOM.\n\t\t\t\t(tmplItem.key ? item.replace( /(<\\w+)(?=[\\s>])(?![^>]*_tmplitem)([^>]*)/g, \"$1 \" + tmplItmAtt + \"=\\\"\" + tmplItem.key + \"\\\" $2\" ) : item) :\n\t\t\t\t// This is a child template item. Build nested template.\n\t\t\t\tbuild( item, tmplItem, item._ctnt );\n\t\t}) :\n\t\t// If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.\n\t\ttmplItem;\n\t\tif ( nested ) {\n\t\t\treturn ret;\n\t\t}\n\n\t\t// top-level template\n\t\tret = ret.join(\"\");\n\n\t\t// Support templates which have initial or final text nodes, or consist only of text\n\t\t// Also support HTML entities within the HTML markup.\n\t\tret.replace( /^\\s*([^<\\s][^<]*)?(<[\\w\\W]+>)([^>]*[^>\\s])?\\s*$/, function( all, before, middle, after) {\n\t\t\tfrag = jQuery( middle ).get();\n\n\t\t\tstoreTmplItems( frag );\n\t\t\tif ( before ) {\n\t\t\t\tfrag = unencode( before ).concat(frag);\n\t\t\t}\n\t\t\tif ( after ) {\n\t\t\t\tfrag = frag.concat(unencode( after ));\n\t\t\t}\n\t\t});\n\t\treturn frag ? frag : unencode( ret );\n\t}", "function renderResults(){\n resultsContent.innerHTML = '';\n viewResultsButton.innerHTML = '';\n for(let i =0; i < allItems.length; i++){\n let p = document.createElement('p');\n p.textContent = `${allItems[i].name} : ${allItems[i].clicked} / ${allItems[i].viewed}`;\n viewResultsButton.appendChild(p);\n }\n}", "function renderQuestionResult() {\n //console.log('Result is being rendered');\n $('.result').html(generateQuestionResult());\n}", "function setTemplate(result) {\n const repoBoxChild = document.createElement('div');\n repoBoxChild.className = \"repo-box-child\";\n repoBoxChild.innerHTML = `\n <div class=\"repo-name\">\n <a href=\"${result.url}\">\n ${result.name}\n </a>\n\n <button>\n ${starSVG2} Star\n </button>\n </div>\n\n <div class=\"repo-bottom\">\n <div class=\"repo-lang\">\n <div class=\"repo-color\" style=\"background: ${result.primaryLanguage.color};color: ${result.primaryLanguage.color}\"></div>\n ${result.primaryLanguage.name}\n </div>\n\n <div class=\"repo-stars\">\n ${starSVG} ${result.stargazerCount}\n </div>\n\n <div class=\"repo-fork\">\n ${forkSVG} ${result.forkCount}\n </div>\n\n <div class=\"repo-update\">\n Updated on ${ formatTime(result.updatedAt)}\n </div>\n </div>\n `\n repoBox.prepend(repoBoxChild);\n}", "visit(){\n\t\tif(!this.parent || this.parent.content)\n\t\t\treturn this.convert(...arguments)\n\t}", "function createHtmlForQueryResults(){\n var memberResults = responseResult.result;\n\n if(memberResults.length > 0){\n\n if(memberResults[0].member != undefined || memberResults[0].member != null){\n //console.log(\"member wise results found..\"); \n for(var i=0; i<memberResults.length; i++){\n //console.log(memberResults[i].member);\n $('#memberAccordion').append(createHtmlForMember(memberResults[i]));\n }\n }else{\n //console.log(\"cluster level results found..\");\n var accordionContentHtml = \"\";\n accordionContentHtml = createClusterAccordionContentHtml(memberResults);\n var resultHtml = \"<div class=\\\"accordion-content2\\\">\"+ accordionContentHtml +\"</div>\";\n $('#memberAccordion').append(resultHtml);\n }\n }else{\n $('#memberAccordion').append(\"<span> No Results Found...</span>\");\n }\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 comic_template(comicTitle, output){\n\treturn '<div class=\"item\">' + comicTitle + output + '</div>';\t\n}", "function renderTemplateContent(response_data)\n{\n\n\t// copy the response data into two JSON objects\n\tvar content1 = content2 = JSON.parse(response_data);\n\t// replace timestamp in the 1st JSON object to board_timestamp\n\tcontent1 = JSON.parse(JSON.stringify(content1).split('\"timestamp\":').join('\"board_timestamp\":'));\n\t// replace location in the 1st JSON object to board_location\n\tcontent1 = JSON.parse(JSON.stringify(content1).split('\"location\":').join('\"board_location\":'));\n\t\n\t// replace timestamp in the 2nd JSON object to depart_timestamp\n\tcontent2 = JSON.parse(JSON.stringify(content2).split('\"timestamp\":').join('\"depart_timestamp\":'));\n\t// replace location in the 1st JSON object to depart_location\n\tcontent2 = JSON.parse(JSON.stringify(content2).split('\"location\":').join('\"depart_location\":'));\n\t\n\t// reverse the two JSON objects\n\tcontent1.docs = content1.docs.reverse();\n\tcontent2.docs = content2.docs.reverse();\n\n\t// declare a result object\n\t// for the concatenated o/p of 2 JSON objects\n\tvar result = {\n\t\tdocs:[]\n\t};\t\n\n\tvar A=0; // to point content1 JSON object\n\tvar B=1; // to point content2 JSON object\n\t\n\t// as board and depart transactions are considered as 1 tuple in o/p\n\tvar count_size=content1.docs.length/2;\n\tfor(var i=0;i<count_size;i++) \n\t{\n\t\tvar result_obj = {};\n\t\t// add all the board travel details to result object\n\t\tfor(var key in content1.docs[A]) result_obj[key] = content1.docs[A][key];\n\t\t// add all the depart travel details to result object\n\t\tfor(var key in content2.docs[B]) result_obj[key] = content2.docs[B][key];\n\t\tresult.docs[i] = result_obj;\n\t\tA += 2;\n\t\tB += 2;\n\t}\n\t// now reverse the resultant result object\n\tresult.docs = result.docs.reverse();\n\t\n\t// get the template code from the handlebars-template \n\tvar raw_template = document.getElementById('employee-travel-details-template').innerHTML;\n\t// compile the template\n\tvar compiled_template = Handlebars.compile(raw_template);\n\t// render the compiled code\n\tvar rendered_code = compiled_template(result);\t\n\t// set back the rendered_code into the result div\n\tdocument.getElementById('employee-travel-details').innerHTML = rendered_code;\n\t// check if the last transaction is done or not\n\tif(document.getElementById('emp-travel-depart-time').innerHTML==\"NOT SCANNED YET\")\n\t{\n\t\tdocument.getElementById('emp-travel-depart-location').style.color=\"red\";\n\t\tdocument.getElementById('emp-travel-depart-time').style.color =\"red\";\n\t}\n}", "render(data, opts={}){\n\t\tlet org = this.tagName=='TEMPLATE' ? document.body.find1st(`template[tmpl=\"${this.attr('tmpl')}\"]`) || this : this;\n\t\tif(!org) return false && elog(\"ERR:red\", org, this.attr(\"tmpl\"), this); \n\t\tlet children = [...(opts.children || org.children || [])];\n\t\tlet cfuncs = this.child_funcs || false;//children element is function\n\t\tif(cfuncs) {\n\t\t\tObject.keys(cfuncs).map(k=>parseInt(k)).sort().forEach(k=>{\n\t\t\t\tchildren.splice(k, 0, cfuncs[`${k}`]);\n\t\t\t})\n\t\t}\n\t\tif(!org || ( empty(children) && !this.parse ) ){\n\t\t\treturn false && elog(\"ERR:red\", org, this.attr(\"tmpl\"), this);\n\t\t}\n\t\tlet html = this.tagName=='TEMPLATE' ? [...children].map((d,i)=>$.isFunc(d)?'{{func}}':d.outerHTML).join(\"\\n\") : this.outerHTML;\n\t\tlet tmpl = this.attr(\"tmpl\");//template id\n\t\tlet {pref} = opts;\n\t\tlet override = \"override\" in opts? opts.override : true;\n\t\tpref = pref || '';\n\n\t\tif(override && this.parentNode) this.parentNode.find(`[tmpl--id=\"${tmpl}\"]`).remove();\n\n\t\tlet res = [];\n\t\tlet isLoop = false;\n\t\tlet idx = this.attr('loop--index')||'i';\n\t\tlet vw = this.views()[0] || {};\n\t\tif(this.attr('loop--var')){//for loops\n\t\t\tlet lk = this.attr('loop--var');\n\t\t\tif(!lk||!lk.trim().length||!html||!html.trim().length||(!html.includes(\"{{\") && !html.includes(\"tag--\"))) return this;\n\t\t\tdata = data || (lk.startsWith(\"app.\")?$app[lk.replace(/^app\\./,'')] : vw[lk] || $this[lk]);\n\t\t\tif(!$.isArray(data) && !$.isObject(data)) return this;\n\t\t\tif(!$.isArray(data)) data = [data];\n\t\t\tpref = this.attr('loop--as')||'e'\n\t\t\tisLoop = true;\n\t\t}else if(this.hasAttribute('loop--from')&&this.hasAttribute('loop--to')){//for-loops with index\n\t\t\tlet from = this.attr('loop--from');\n\t\t\tlet to = this.attr('loop--to');\n\t\t\tlet step = parseInt(this.attr('loop--step'))||1;\n\t\t\t// elog(\"RENDER:red\",from,to,idx,step)\n\t\t\tfrom = `${from}`.match(/[^\\d]/)? $.evalString(`{{${from}}}`, data) : parseInt(from)\n\t\t\tto = `${to}`.match(/[^\\d]/)? $.evalString(`{{${to}}}`, data) : parseInt(to)\n\t\t\tif(!$.isNumber(from)||!$.isNumber(to)||from==to) return this;\n\t\t\tlet [start, end] = from<to ? [from, to] : [to, from];\n\t\t\tdata = [];\n\t\t\tfor(let i=start;i<end;i+=step){\n\t\t\t\tdata[i] = {[idx]:i};\n\t\t\t}\n\t\t\tisLoop = true;\n\t\t\t// elog(\"RENDER-data:red\",from,to,data)\n\t\t}else{//var\n\t\t\tdata = [data||{}];\n\t\t}\n\n\t\tlet last = this, el = this;\n\t\tdata.forEach((d,i)=>{\n\t\t\t$.iteritor = {data:d, index:i};\n\t\t\tlet tmpl = el.attr('tmpl');\n\t\t\tchildren.forEach((c,x)=>{\n\t\t\t\tlet nodes = $.isFunc(c) ? [c(d,i,el)] : \n\t\t\t\t\t$.render(c.outerHTML, d, {tmpl, pref:pref, index:idx, i:i, loop:isLoop, key:opts.key||false, keypath:opts.keypath||false}, org);\t\n\t\t\t\tnodes.forEach(node=>{\n\t\t\t\t\tif(node && node.right){\n\t\t\t\t\t\tif(tmpl && !node.attr('tmpl--id')) \n\t\t\t\t\t\t\tnode.attr('tmpl--id', tmpl)\n\t\t\t\t\t\tres.push(node);\n\t\t\t\t\t\tnode.right(last)\n\t\t\t\t\t\tnode.dispatchEvent(new CustomEvent('loaded', {detail : {target:node, data:d} }))\n\t\t\t\t\t\tlast = node;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t});\n\t\tdelete $.iteritor;\n\t\treturn res;\n\t}", "function deliveryQuantityTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"deliveryQuantityTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var transferProductGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var transferContainer = document.getElementById(\"deliveryQuantityContainer\");\n transferContainer.innerHTML += transferProductGeneratedHTML;\n}", "get _itemsParent(){return dom(dom(this._userTemplate).parentNode);}", "display(grandParentElement, \n parentElementType, elementType, \n parentElementPrefix='Branch', // mainBranch, subBranch1, subBranch2...\n elementPrefix='leaf' ) { // <parentName>leafindex\n \n // main branch, then subbranches - componentize once working\n let mainUI = document.getElementById(`main${parentElementPrefix}`) ;\n if (!mainUI) {\n console.log(parentElementType);\n mainUI = document.createElement(parentElementType);\n mainUI.setAttribute('id',`main${parentElementPrefix}`)\n\n grandParentElement.appendChild(mainUI);\n }\n this.mainQueue.displayContinuous(mainUI,elementType,`main${parentElementPrefix}leaf`, \"Main Queue:\", 'mq');\n for (let m = 0 ; m < this.subQueues.length; m++){\n \n let branchUI = document.getElementById(`sub${parentElementPrefix}${m}`) ;\n if (!branchUI) {\n console.log(parentElementType);\n branchUI = document.createElement(parentElementType);\n branchUI.setAttribute('id',`sub${parentElementPrefix}${m}`);\n \n grandParentElement.appendChild(branchUI);\n }\n this.subQueues[m].displayContinuous(branchUI,elementType,`sub${parentElementPrefix}${m}leaf`, \"Sub Queue:\",`sq${m}`);\n \n }\n if (this.bulk && this.bulk.length > 0) {\n const intervalSpecs = { // seek a more appropriate name\n fillDummyRow: true,\n dummyRowElement:' - ',\n dummyRowTitle: 'Bulk Queue:',\n interval: this.subQueueLength,\n\n }\n let bulkUI = document.getElementById('bulkList') ;\n if (!bulkUI) {\n console.log(parentElementType);\n bulkUI = document.createElement(parentElementType);\n bulkUI.setAttribute('id','bulkList');\n \n grandParentElement.appendChild(bulkUI);\n }\n this.bulk.displayInterval(grandParentElement, parentElementType, bulkUI,elementType, intervalSpecs, ' ', \"Bulk =>\");\n }\n /*\n displayContinuous(parent, childType, idPrefix='leaf' ) {\n let childId = 0 ;\n\n let traversal = this.head ;\n let currentTail = this.length ;\n while(traversal !== null) {\n let leaf = document.getElementById(`${idPrefix}${childId}`)\n if (!leaf) {\n leaf = document.createElement(childType);\n leaf.setAttribute(\"id\",`${idPrefix}${childId}`);\n leaf.value = '___'\n parent.appendChild(leaf);\n }\n // alert(traversal.num);\n // leaf.innerHTML = '_'\n //let newContent = document.createTextNode(traversal.num.toString());\n leaf.innerHTML = traversal.num.toString() ; // appendChild(newContent);\n // leaf.value = traversal.num.toString();\n traversal = traversal.next;\n childId++;\n } \n while (currentTail < this.maxLength) {\n let leafBlank = document.getElementById(`${idPrefix}${childId}`)\n if (!leafBlank) {\n leafBlank = document.createElement(childType);\n leafBlank.setAttribute(\"id\",`${idPrefix}${childId}`);\n parent.appendChild(leafBlank);\n }\n leafBlank.innerHTML = '-' ;\n currentTail++;\n childId++ ;\n }\n }\n */\n }", "function renderCurrent(contents){\n var contentHTML = '';\n \n for(i = 0; i < contents.length; i++){\n contentHTML += '<div class=\"content\">'\n contentHTML += '<div class=\"content-info\">';\n contentHTML += '<div class=\"content-title\">' + contents[i].title + '</div><br />';\n contentHTML += '<div class=\"content-time\">' + dt(contents[i].start) + ' - ' + dt(contents[i].end) + '</div>';\n contents[i].networks.forEach(function(network) {\n contentHTML += '<div class=\"content-network\">' + network + '</div>';\n });\n contents[i].streams.forEach(function(stream) {\n contentHTML += '<div class=\"content-stream\">' + stream + '</div>';\n });\n contents[i].hashtags.forEach(function(hashtag) {\n contentHTML += '<div class=\"content-hashtag\">' + hashtag + '</div>';\n });\n\t\tcontentHTML += '</div>';\n\t\tcontentHTML += '<div class=\"perma-image-screen\"></div><img class=\"content-image\" src=\"' +contents[i].image + '\">'\n contentHTML += '</div>';\n }\n \n return contentHTML;\n}", "function constructOutputSubTable(index, row, element) {\n let sub_table_id = `output-table-${row.pk}`;\n\n element.html(`\n <div class='sub-table'>\n <table class='table table-striped table-condensed' id='${sub_table_id}'></table>\n </div>\n `);\n\n loadBuildLineTable(\n `#${sub_table_id}`,\n build_info.pk,\n {\n output: row.pk,\n data: row.lines,\n }\n );\n }", "function generateDetailOutput(){\n let outputDetails = `\n <div class=\"row\">\n <h1>Hello</h1>\n </div>\n `;\n $('#result').html(outputDetails);\n}", "function _render(){\n\t\tinfo = {\n\t\t\t\tpublishers_array: publishers_array\n\t\t}\n\t\t$element.html(Mustache.render(template, info))\n\t}", "function htmlWriteResults(cases) {\r\n var myHTML = '';\r\n myHTML +=\r\n `<article><div class=\"col-md-4\">\r\n <div class=\"well text-center\">`;\r\n if (filterMovies(cases.imdbID)) {\r\n myHTML +=\r\n `<div class=\"alert alert-success\" id=\"${cases.imdbID}inCollection\"><p><i class=\"fa fa-cloud-download\"></i> In Collection</p></div>`;\r\n } else {\r\n myHTML +=\r\n `<div class=\"alert alert-danger\" id=\"${cases.imdbID}notInCollection\"><p><i class=\"fa fa-exclamation-triangle\"></i> Not in Collection</p></div>`;\r\n }\r\n myHTML +=\r\n `<figure><img src=\"${posterError(cases.Poster)}\" alt=\"${cases.Title}\"></figure>\r\n <h5 class=\"whiteheader\">${cases.Title} (${cases.Year.substring(0, 4)})</h5>\r\n <div class=\"btn-group\">\r\n <a onclick=\"movieSelected('${cases.imdbID}')\" class=\"btn btn-primary btn-rounded\" href=\"#\"><i class=\"fa fa-info-circle\"></i> ${upperFirst(cases.Type)} Details</a>\r\n </div>\r\n </div>\r\n </div></article>\r\n `;\r\n return myHTML;\r\n}", "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(recName, recSource, recYeild, recTime, recImage, recURL, recIngs, index) {\n var resultBlock = document.createElement('div');\n resultBlock.setAttribute('class','columns');\n resultsContainer.appendChild(resultBlock);\n\n var resultCol = document.createElement('div');\n resultCol.setAttribute('class', 'column');\n resultBlock.appendChild(resultCol);\n\n var resultHeader = document.createElement('article');\n resultHeader.setAttribute('class', 'message is-success');\n resultCol.appendChild(resultHeader);\n\n var resultHeaderText = document.createElement('div');\n resultHeaderText.setAttribute('class', 'message-header');\n resultHeaderText.textContent = recName;\n resultHeader.appendChild(resultHeaderText);\n\n var resultBody = document.createElement('div');\n resultBody.setAttribute('class', 'message-body');\n resultHeader.appendChild(resultBody);\n\n var resultBodyRow = document.createElement('div');\n resultBodyRow.setAttribute('class', 'columns');\n resultBody.appendChild(resultBodyRow);\n\n // begin image column\n var imageColumn = document.createElement('div');\n imageColumn.setAttribute('class', 'column is-one-quarter image-column');\n resultBodyRow.appendChild(imageColumn);\n\n var imageContainer = document.createElement('figure');\n imageContainer.setAttribute('class', 'image is-128x128 is-full-width');\n imageColumn.appendChild(imageContainer);\n\n var imageActual = document.createElement('img');\n imageActual.setAttribute('src', recImage);\n imageContainer.appendChild(imageActual);\n // end image block\n // begin list block\n \n var listColumn = document.createElement('div');\n listColumn.setAttribute('class', 'column is-half');\n resultBodyRow.appendChild(listColumn);\n\n var listEl = document.createElement('ul');\n listColumn.appendChild(listEl);\n //cook time\n var cookTimeEl = document.createElement('li')\n listEl.appendChild(cookTimeEl);\n var cookTimeStrong = document.createElement('strong');\n cookTimeStrong.textContent = 'Cook Time: '\n cookTimeEl.appendChild(cookTimeStrong);\n \n var cookTimeText = document.createElement('p');\n cookTimeText.textContent = 'approximately ' + recTime + ' minutes';\n cookTimeEl.appendChild(cookTimeText);\n // yeild\n var yieldEl = document.createElement('li')\n listEl.appendChild(yieldEl);\n var yieldStrong = document.createElement('strong');\n yieldStrong.textContent = 'Number of Servings: ';\n yieldEl.appendChild(yieldStrong);\n \n var yieldText = document.createElement('p');\n yieldText.textContent = 'about ' + recYeild;\n yieldEl.appendChild(yieldText);\n //source\n var sourceEl = document.createElement('li')\n listEl.appendChild(sourceEl);\n var sourceStrong = document.createElement('strong');\n sourceStrong.textContent = 'Source: ';\n sourceEl.appendChild(sourceStrong);\n \n var sourceText = document.createElement('p');\n sourceText.textContent = recSource;\n sourceEl.appendChild(sourceText);\n\n //end list block\n\n // begin button block\n\n var buttonEl = document.createElement('div');\n buttonEl.setAttribute('class', 'column is-one-quarter');\n resultBodyRow.appendChild(buttonEl);\n\n var buttonRow = document.createElement('div');\n buttonRow.setAttribute('class', 'columns is-multiline');\n buttonEl.appendChild(buttonRow);\n\n //link button block\n var buttonCol1 = document.createElement('div');\n buttonCol1.setAttribute('class', ' column is-full');\n buttonRow.appendChild(buttonCol1);\n\n var linkButton = document.createElement('button');\n linkButton.setAttribute('class', 'button is-success');\n linkButton.textContent = 'Go to recipe';\n linkButton.addEventListener('click', function(){\n window.open(recURL)\n });\n buttonCol1.appendChild(linkButton);\n // add recipe button block\n var buttonCol2 = document.createElement('div');\n buttonCol2.setAttribute('class', ' column is-full');\n buttonRow.appendChild(buttonCol2);\n\n var addButton = document.createElement('button');\n addButton.setAttribute('class', 'button is-success');\n addButton.textContent = 'Add to recipe book';\n addButton.addEventListener('click', addRecipe);\n buttonCol2.appendChild(addButton);\n\n //end button block\n \n function addRecipe() {\n var savedRecipes = JSON.parse(localStorage.getItem('saved-recipes'));\n if (savedRecipes !== null) {\n recipeList = savedRecipes;\n console.log(recipeList);\n }\n\n var recipeInfo = {\n 'recipeLabel': recName,\n 'recipeSource': recSource,\n 'recipeYield': recYeild,\n 'recipeTime': recTime,\n 'recipeImage': recImage,\n 'recipeIngredients': recIngs,\n 'recipeUrl': recURL\n }\n recipeList.push(recipeInfo);\n localStorage.setItem('saved-recipes', JSON.stringify(recipeList));\n console.log(recName + ' added to recipe list');\n console.log(recipeList);\n }\n}", "function constructResultsTemplate() {\n\treturn new Promise ( (resolve, reject) => {\n\t queryResponse = JSON.parse(localStorage.getItem(\"queryResponse\"));\n\t\tlet numberNeeded = queryResponse.result.officials.length;\n\t\tlet template = document.querySelector(\".contentCard\");\n\t\tlet contentWrapper = document.querySelector(\".contentWrapper\");\n\t\tlet templateArray = [];\n\n\t\tfor (var i = 0; i <= (numberNeeded - 2); i++) {\n\t\t\ttemplateArray[i] = template.cloneNode(true);\n\t\t\tcontentWrapper.appendChild(templateArray[i]);\n\t\t}\n\n\t\tif (templateArray.length > 1) {\n resolve(queryResponse);\n\t\t} else {\n\t\t\treject(\"Oops! Something went wrong!\");\n\t\t}\n\t});\n}", "function printTask(item, parentObj) {\n\t\t\tvar $parent = parentObj;\n\t\t\tvar template = `<li class=\"list-group-item\" data-id={{id}}>{{taskTitle}}\n\t\t\t\t<span class=\"label label-default\">New</span>\n\t\t\t\t<a href=\"#\" class=\"remove-btn\">\n\t\t\t\t\t<span class=\"glyphicon glyphicon-remove pull-right\">\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t\t<a href=\"#\">\n\t\t\t\t\t<span class=\"glyphicon glyphicon-pencil pull-right edit-task-pen\">\n\t\t\t\t\t</span>\n\t\t\t\t</a>\n\t\t\t</li>`;\n\t\t\ttemplate = template.replace('{{taskTitle}}', item.title);\n\t\t\ttemplate = template.replace('{{id}}', item.id);\n\t\t\t$(template).appendTo($parent);\n\t\t}", "function deliveryQuantityTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"deliveryQuantityTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var transferProductGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var transferContainer = document.getElementById(\"deliveryQuantityContainer\");\n transferContainer.innerHTML += transferProductGeneratedHTML;\n}", "function render(result, container, scopeName) {\n const templateFactory = shadyTemplateFactory(scopeName);\n const template = templateFactory(result);\n let instance = container.__templateInstance;\n // Repeat render, just call update()\n if (instance !== undefined && instance.template === template &&\n instance._partCallback === result.partCallback) {\n instance.update(result.values);\n return;\n }\n // First render, create a new TemplateInstance and append it\n instance =\n new TemplateInstance(template, result.partCallback, templateFactory);\n container.__templateInstance = instance;\n const fragment = instance._clone();\n instance.update(result.values);\n const host = container instanceof ShadowRoot ?\n container.host :\n undefined;\n // If there's a shadow host, do ShadyCSS scoping...\n if (host !== undefined && typeof window.ShadyCSS === 'object') {\n ensureStylesScoped(fragment, template, scopeName);\n window.ShadyCSS.styleElement(host);\n }\n removeNodes(container, container.firstChild);\n container.appendChild(fragment);\n }", "build()\n {\n let parentContainer = document.getElementById('url-container'); //Append to this at the end.\n\n\n let urlContainer = document.createElement('div');\n urlContainer.setAttribute('id', this.getDivID());\n urlContainer.setAttribute('class', 'url-item');\n\n parentContainer.appendChild(urlContainer);\n\n let actualURLContainer = document.createElement('div');\n actualURLContainer.setAttribute('class', 'actual-url');\n let actualURLH4 = document.createElement('h4');\n let h4TextNode = document.createTextNode(this.getURL());\n\n actualURLH4.appendChild(h4TextNode); //set h4 text\n actualURLContainer.appendChild(actualURLH4); //append to the wrapper\n urlContainer.appendChild(actualURLContainer); //append the first component.\n\n\n let urlQuantityContainer = document.createElement('div');\n urlQuantityContainer.setAttribute('class', 'actual-url-quantity');\n\n urlContainer.appendChild(urlQuantityContainer);\n\n\n let clickableElement = document.createElement('a');\n clickableElement.setAttribute('href', '#');\n clickableElement.setAttribute('class', 'remove-url-box');\n clickableElement.setAttribute('id', this.getDivID() + \"_remove\");\n let removeImage = document.createElement('img');\n removeImage.setAttribute('src', '../../wp-content/themes/whitero/dfy/img/close.svg');\n\n clickableElement.appendChild(removeImage);\n urlQuantityContainer.appendChild(clickableElement);\n\n\n let actualQuantityH5 = document.createElement('h5');\n let actualQuantityText = document.createTextNode(this.getSignalQuantity());\n actualQuantityH5.appendChild(actualQuantityText);\n\n urlQuantityContainer.appendChild(actualQuantityH5);\n\n }", "function renderResults(data){\n var resultsDiv = document.getElementById('results');\n for(var i = 0; i < data.streams.length; i++){\n //build a result row\n var oneResult = document.createElement('div'),\n imgContainer = buildimage(data, i),\n textContainer = buildText(data, i);\n\n oneResult.setAttribute(\"class\", \"row one-result\");\n oneResult.appendChild(imgContainer);\n oneResult.appendChild(textContainer);\n resultsDiv.appendChild(oneResult);\n }\n}", "_getModalChildren() {\n return `\n <table\n style=\"margin-bottom: 50px;\"\n class=\"ui unstackable compact single line green table\"\n >\n <thead>\n <tr>\n <th>Member#ID</th>\n <th>Bike#ID</th>\n <th>Returned?</th>\n <th>Late?</th>\n <th>Time Left(ms)</th>\n </tr>\n </thead>\n <tbody>\n ${this._buildTransactionsNodes()}\n </tbody>\n </table>\n `;\n }", "function renderResults(type,results) {\r\n\r\nvar source = $(\"#template\").html();\r\nvar template = Handlebars.compile(source);\r\n\r\nfor (var i = 0; i < results.length; i++) {\r\n\r\n var title, original_title, list;\r\n\r\n if (type == \"movie\") {\r\n title = results[i].title;\r\n original_title = results[i].original_title;\r\n list = $(\".movies\");\r\n } else if (type == \"tv\") {\r\n title = results[i].name;\r\n original_title = results[i].original_name;\r\n list = $(\".series\");\r\n }\r\n if (results[i].poster_path == null) {\r\n var poster = \"img/noposter.png\";\r\n } else {\r\n var poster = \"https://image.tmdb.org/t/p/w342\"+results[i].poster_path;\r\n }\r\n\r\n var context = {\r\n \"poster\": poster,\r\n \"title\": title,\r\n \"original_title\": original_title,\r\n \"original_language\": printFlags(results[i].original_language),\r\n \"vote_average\": starsAppear(results[i].vote_average),\r\n \"type\": type\r\n };\r\n\r\n var html = template(context);\r\n list.append(html);\r\n }\r\n}", "function displayPetData(pets, parentDiv) {\n pets.forEach((item, index) => {\n var template = document.getElementById('template-pet');\n var templateNode = template.content.cloneNode(true);\n templateNode.querySelector('#txt-petname').textContent = item.Name;\n templateNode.querySelector('#txt-constraint').textContent = item.Consts;\n parentDiv.appendChild(templateNode);\n });\n }", "createEvalContent() {\n // get the current position information from redux state\n const evaluation = this.props.evaluationState;\n\n const attrs = { credentials: this.state.generalApiPostArgs };\n\n let content = null;\n\n // switch block to determine which component type to show\n switch (evaluation.component) {\n case \"Admin Questions\": {\n content = <AdminQuestions {...attrs} />;\n break;\n }\n case \"Psychometrics\": {\n content = <PsychTest {...attrs} />;\n break;\n }\n case \"Cognitive\": {\n content = (\n <div>\n <CognitiveTest {...attrs} />\n </div>\n );\n break;\n }\n case \"Skill\": {\n content = <SkillTest {...attrs} />;\n break;\n }\n case \"Finished\": {\n content = this.finishedPage();\n break;\n }\n default: {\n content = <div>Hmm. Something is wrong. Try refreshing.</div>;\n break;\n }\n }\n\n return (\n <div>\n <ProgressBar />\n {content}\n </div>\n );\n }", "function content() \n\t{\n\t\t// init render\n\t\tvar forms = document.forms;\n\t\tvar links = document.querySelectorAll(\"a:not(.\"+Flink.settings.namespace+\")\");\n\t\tvar data = {\n\t\t\tForms: {\n\t\t\t\ttext: Say(\"Forms\")\n\t\t\t\t, value: \"<span class=\\\"count\\\">\" + forms.length + \"</span>\"\n\t\t\t}\n\t\t\t, Links: {\n\t\t\t\ttext: Say(\"Links\")\n\t\t\t\t, value: \"<span class=\\\"count\\\">\" + links.length + \"</span>\"\n\t\t\t}\n\t\t};\n\t\tvar template = {\n\t\t\trow: \"<tr>\"\n\t\t\t\t+ \"<td>\"\n\t\t\t\t\t+ \"<a class=\\\"%style%\\\"\"\n\t\t\t\t\t+ ' onclick=\"Flink[\\'%key%\\'].call()\">%text%</a>'\n\t\t\t\t\t+ \" <span style=\\\"float:right\\\">%value%</span>\"\n\t\t\t\t\t+ \"</td>\"\n\t\t\t\t+ \"</tr>\"\n\t\t}\n\t\t\n\t\tvar r = [];\t\t\n\t\tr.push( \"<h2 class=\\\"\" + namespace + \"\\\">\" + Say(moduleKEY) + \"</h2>\" );\n\t\tr.push( \"<table class=\\\"\" + namespace + \"\\\">\" );\t\t\n\t\tfor (var key in data) {\n\t\t\tvar obj = data[key];\n\t\t\tobj.key = key\n\t\t\tobj.style = Flink.settings.namespace\n\t\t\tr.push(Render(obj, template.row))\n\t\t}\n\n\t\t// end render\n\t\tr.push( \"</table>\" );\t\t\n\n\t\t// return\n\t\treturn r.join(\"\\n\");\t\t\n\t}", "function processFOR(template, node) {\n\n var res = '';\n\n // Select the collection\n var collection = selectCollection(template, template.view, node.getAttribute('each'), node.getAttribute('where'));\n\n // Parse the template\n var forTemplate = { dom: node };\n\n // Loop over the objects\n for (var oidx = 0; oidx < collection.items.length; oidx++) {\n\n // Access the item\n var oitem = collection.items[oidx];\n\n // Access the item (as a string)\n var oitemStr = oitem.toString();\n\n // Determine the current \"index\"\n var idx = (((collection.names != undefined) && (collection.names.length > 0)) ? collection.names[oidx] : (oidx + 1).toString());\n\n // Determine the current \"str\"\n var str = (((oitemStr != undefined) && (oitemStr != ({}).toString())) ? oitemStr : '');\n\n // Determine the template to use for the item\n var otmpl = selectForListTemplate(template, forTemplate, oidx, collection.items.length, oitem);\n\n // Set the \"special\" view properties\n oitem.Parent = template.view;\n\n // Evaluate the template with the array object instance and add the result to the \"add\" collection\n res += processTemplate(openSubItemTemplate(otmpl, template, idx, collection.items.length, str), oitem);\n\n }\n\n // Return\n return res;\n\n }", "function render$1(result,container,scopeName){var templateFactory=shadyTemplateFactory(scopeName);var template=templateFactory(result);var instance=container.__templateInstance;// Repeat render, just call update()\nif(instance!==undefined&&instance.template===template&&instance._partCallback===result.partCallback){instance.update(result.values);return;}// First render, create a new TemplateInstance and append it\ninstance=new TemplateInstance(template,result.partCallback,templateFactory);container.__templateInstance=instance;var fragment=instance._clone();instance.update(result.values);var host=babelHelpers.instanceof(container,ShadowRoot)?container.host:undefined;// If there's a shadow host, do ShadyCSS scoping...\nif(host!==undefined&&babelHelpers.typeof(window.ShadyCSS)==='object'){ensureStylesScoped(fragment,template,scopeName);window.ShadyCSS.styleElement(host);}removeNodes(container,container.firstChild);container.appendChild(fragment);}", "function generateHTML(data) {\n //deletes the undefined that was generated by selecting done\n data.pop()\n //adds the top of the HTML to our array\n fullHtml.push(topHtml);\n //for loop to analyze the \n for (let i = 0; i < data.length; i++) {\n if (data[i].type === 'Manager') {\n const managerCard = `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Manager</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">Office Number ${data[i].officeNumber}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(managerCard)\n } else if (data[i].type === 'Engineer') {\n const engineerCard =\n `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Engineer</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">Github ${data[i].github}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(engineerCard)\n } else if (data[i].type === \"Intern\") {\n const internCard =\n `<div class=\"card\" style=\"width: 18rem; margin: 15px;\">\n <div class=\"card-body\" style=\"background-color: teal; color: whitesmoke;\">\n <h5 class=\"card-title\">${data[i].name}</h5>\n <p class=\"card-text\"> Intern</p>\n </div>\n <div style=\"padding: 10px; padding-top: 20px; padding-bottom: 20px; background-color: #a6a6a6;\">\n <ul class=\"list-group list-group-flush\">\n <li class=\"list-group-item\">ID: ${data[i].id} </li>\n <li class=\"list-group-item\">Email: ${data[i].email} </li>\n <li class=\"list-group-item\">School ${data[i].school}</li>\n </ul>\n </div>\n </div>`\n fullHtml.push(internCard)\n }\n }\n fullHtml.push(endHtml);\n\n const filename = 'team.html';\n writeToFile(filename, fullHtml.join());\n}", "function resultsHTML(jobsAndLocData) {\n\n\n const location = jobsAndLocData[1].results[0].formatted_address;\n\n const jobData = jobsAndLocData[0];\n\n const jobCount = jobData.count;\n\n const mean = jobData.mean;\n if (mean === undefined) {\n return `\n <section class=\"result\" role=\"show-result\">\n <label class=\"result\" id=\"noData\" aria-errormessage=\"not enough job data for location\">Not enough Job Data for ${location} because the Aduzna API sucks. No map marker will be shown</label> \n </section>`;\n\n } else {\n mean;\n }\n\n console.log('This is the data being passed before displaying the results in HTML. Should be an Array:', jobsAndLocData);\n\n return `\n <section class=\"result\" role=\"show-result\">\n <label class=\"result label\" aria-label=\"Location\">Location\n <span class=\"displayedData\" aria-label=\"result location\">${location}</span>\n </label>\n <label class=\"result label\" aria-label=\"Job-Count\">Job Count\n <span class=\"displayedData\" aria-label=\"result job count\">${jobCount}</span>\n </label>\n <label class=\"result label\" aria-label=\"Salary-Mean\">Salary Mean\n <span class=\"displayedData\" aria-label=\"result job mean\">${mean}</span>\n </label>\n </section>\n `;\n }", "function createResultList(dta){\nx = 0;\ncontent = \"\";\ndta.forEach(function(element) {\n\t\t\n\t\tcontent += '<div id=\"p'+element['id']+'\" > ';\n\t\tif (null != leaveOfAbsence) {\n\t\tcontent += '<a href=\"#\" onClick=\"leaveOfAbsenceNotice('+element['id']+')\" class=\"navigation waves-effect waves-light teal-text\">';\n\t\t} else {\n\t\tcontent += '<a href=\"#\" onClick=\"absentNotice('+element['id']+')\" class=\"navigation waves-effect waves-light teal-text\">';\n\t\t}\n\t\tcontent += element['name']+', ' \n\t\t+ element['vorname'] + '( '\n\t\t+ element['klasse'] \n\t\t+')</a></div>'\n\t\t//+'<div id=\"'+element['name']+'\"></div></div>';\n\t\t\n\t\tx++;\n\t\t});\t\n\treturn content;\n}", "function groupRestrictionTemplate(data) {\n //takes template and populate it with passed array\n var rawTemplate = document.getElementById(\"groupRestrictionTemplate\").innerHTML;\n var compiledTemplate = Handlebars.compile(rawTemplate);\n var storageRestrictionGeneratedHTML = compiledTemplate(data);\n // display template in choosen ID tag\n var storageContainer = document.getElementById(\"groupRestrictionContainer\");\n storageContainer.innerHTML = storageRestrictionGeneratedHTML;\n}", "function renderData(element, resultDivName) {\n //clear both screens to avoid issues with the two results div\n clearScreen(\"results\")\n //clearScreen(\"results2\")\n //title\n createTitleElement(element.provincia, resultDivName)\n //list container\n createResultContainer(resultDivName)\n //list\n createULElement(\"list-container\")\n //list of elements\n createListElement(element.alerta.naranja, \"my-list\")\n\n}", "render(tp, params={}) {\n if (tp.nodeType==1 && tp.tagName==\"TEMPLATE\") {\n tp=tp.content; //templates are not valid just its content\n }\n //for the templates we let original unmodified\n if (tp.nodeType==11) tp=tp.cloneNode(true);\n\n let scriptElements=[];\n if (tp.tagName==\"SCRIPT\") scriptElements.push(tp); //For when there is no descendents\n else scriptElements=Array.from(tp.querySelectorAll(\"SCRIPT\")); //inner elements\n scriptElements.forEach(scriptElement => {\n //To avoid script execution limitation for the request we make a copy of the script to a \"brand new\" script node\n //Also to execute script <script> for an already loaded element when we use render\n const myScript=document.createElement(\"SCRIPT\");\n for (const at of scriptElement.attributes) {\n myScript.setAttribute(at.name, at.value);\n }\n //adding scope (encapsulation) so this variables are local and can't be modified from another scripts.\n //Also async type allows awiat in scripts\n myScript.textContent=\"(async (thisElement, thisNode, thisParams)=>{\" + scriptElement.textContent + \"})(document.currentScript.previousElementSibling, document.currentScript.thisNode, document.currentScript.thisParams);\";\n myScript.thisNode=this;\n myScript.thisParams=params;\n const container=scriptElement.parentNode; // !!Document Fragment is not an Element => *parentNode*\n container.insertBefore(myScript, scriptElement);\n container.removeChild(scriptElement);\n });\n return tp;\n }", "function html(data) {\n if (data.type == \"heading\") {\n $(\"div\")\n .add(\"<h1>\" + data.model.text + \"</h1>\")\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"paragraph\") {\n $(\"div\")\n .add(\"<p>\" + data.model.text + \"</p>\")\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"image\") {\n $(\"div\")\n .add(\n \"<img src=\" +\n data.model.url +\n \" alt=\" +\n data.model.altText +\n \" height=\" +\n data.model.height +\n \" width=\" +\n data.model.width +\n \"/>\"\n )\n .appendTo(document.getElementById(\"one\"));\n } else if (data.type == \"list\") {\n if (data.model.type == \"unordered\") {\n $(\"div\")\n .add(\"<ul>\")\n .appendTo(document.getElementById(\"one\"));\n $.each(data.model.items, function(i, dat) {\n $(\"div\")\n .add(\"<li>\" + dat + \"</li>\")\n .appendTo(document.getElementById(\"one\"));\n });\n $(\"div\")\n .add(\"</ul>\")\n .appendTo(document.getElementById(\"one\"));\n } else {\n //works if the json file contains ordered lists\n $(\"div\")\n .add(\"<ol>\")\n .appendTo(document.getElementById(\"one\"));\n $.each(data.model.items, function(i, dat) {\n $(\"div\")\n .add(\"<li>\" + dat + \"</li>\")\n .appendTo(document.getElementById(\"one\"));\n });\n $(\"div\")\n .add(\"</ol>\")\n .appendTo(document.getElementById(\"one\"));\n }\n }\n}", "function HTMLgenerator(id,parentDiv,CustomStyle) {\n\t\n\tif (parentDiv===\"\") {parentDiv='terminal';};//the root element of JSON is added to the terminal\n\t\n\t\t//isolate just the name of the item\n\t\tvar nm = id.substring(id.lastIndexOf(ELMNT_ID_SPACE_CHAR)+1);//string split ID for elements name attribute\n\t\t\n\t\tif (parentDiv==='terminal') {\n\t\t\tvar newDiv = HTMLelement(\"div\",{id:id,name:nm,class:'button',innerHTML:nm,CustomStyle});\n\t\t}else {\n\t\t\tvar newDiv = HTMLelement(\"div\",{id:id,name:nm,class:'subbutton',innerHTML:nm,CustomStyle});\n\t\t}\n\t\tdocument.getElementById(parentDiv).appendChild(newDiv);\n}", "render() {\n const template = [\n {\n block: 'menu',\n content: [\n {\n elem: 'items',\n points: [\n {\n href: 'single',\n text: 'Синглплеер',\n type: 'gamepad',\n },\n {\n href: 'multi',\n text: 'Мультиплеер',\n type: 'users',\n },\n {\n href: '/',\n text: 'Главное меню',\n type: 'back',\n },\n ],\n },\n ],\n },\n ];\n\n this.parent.insertAdjacentHTML('beforeend', bemhtml.apply(template));\n }", "function buildTemplates(filteredResults){\n\n var numberOfResults;\n // Setup my template\n if(filteredResults){\n numberOfResults = filteredResults.length;\n } else {\n numberOfResults = lastResults.count;\n }\n\n var searchTerm = lastResults[\"params\"].keywords;\n\n var activeSortFilterTerm = lastResults[\"params\"].sort_on;\n activeSortFilterTerm = activeSortFilterTerm.charAt(0).toUpperCase() + activeSortFilterTerm.slice(1);\n var sortOrder = lastResults[\"params\"].sort_order;\n\n if(activeSortFilterTerm == \"Price\") {\n if(sortOrder == \"down\") {\n activeSortFilterTerm = \"Price (Highest First)\";\n } else {\n activeSortFilterTerm = \"Price (Lowest First)\";\n }\n } else if(activeSortFilterTerm == \"Created\") {\n activeSortFilterTerm = \"Date (Newest First)\";\n } else if(activeSortFilterTerm == \"Score\") {\n activeSortFilterTerm = \"Relevance\";\n }\n\n var searchHeaderSource = $(\"#search-header-template\").html();\n var searchHeaderTemplate = handlebars.compile(searchHeaderSource);\n var searchHeaderRenderedTemplate = searchHeaderTemplate(\n {\n \"activeSortFilterTerm\": activeSortFilterTerm,\n \"numberOfResults\": numberOfResults,\n \"searchTerm\": searchTerm}\n );\n\n $('.search-area').html(searchHeaderRenderedTemplate);\n $('.price-sorter-high').click(priceHighButtonHandler);\n $('.price-sorter-low').click(priceLowButtonHandler);\n $('.date-sorter').click(dateButtonHandler);\n $('.relevance-sorter').click(relevanceButtonHandler);\n\n var resultsArray;\n\n if(filteredResults){\n resultsArray = filteredResults;\n } else {\n resultsArray = lastResults[\"results\"];\n }\n\n var searchImagesSource = $(\"#search-images-template\").html();\n var searchImagesTemplate = handlebars.compile(searchImagesSource);\n var searchImagesRenderedTemplate = searchImagesTemplate({\"results\": resultsArray});\n\n $('.search-area').append(searchImagesRenderedTemplate);\n\n }", "function resultTemplate(arr) {\n let results = arr.map(function(film){\n let poster = (film.Poster === \"N/A\") ? \"images/noimage.png\" : film.Poster;\n let movieItem = \n `<div class=\"search__result\" id=\"${film.imdbID}\">\n <h2>${film.Title}</h2> \n <button class=\"fav__button\">+</button>\n <p class=\"movie_date\">(${film.Year})</p>\n <img src=\"${poster}\">\n <button class=\"more__info__button\">More details</button>\n </div>\n `;\n return movieItem;\n })\n populateResults(results);\n}", "function render(template, context) {\n var container = document.createElement('div');\n var templateText = template.innerHTML || template;\n container.innerHTML = templateText.trim();\n var el = container.firstChild;\n for (var key in context) {\n var value = context[key];\n var selector = '[name=\"'+key+'\"]';\n var fields = el.querySelectorAll(selector);\n for (var i = 0; i < fields.length; i++) {\n var field = fields[i];\n setText(field, value);\n }\n }\n return el;\n}", "function generateAndSaveFormularTemplate() {\n rows = document.getElementById('form block').childElementCount;\n var parentNode = document.createElement('div');\n \n for (var i = 0; i < rows; i++) {\n var rowNode = document.createElement('div');\n\n var newLabel = document.createElement('label');\n newLabel.textContent = document.getElementById('inpt' + (i + 1)).value;\n if (document.getElementById('typeDrop ' + (i + 1) + \"\").value == \"Mandatory\") {\n newLabel.textContent += \"*\";\n }\n if (document.getElementById('typeDrop ' + (i + 1) + \"\").value == \"Numeric\") {\n newLabel.textContent += \"(numeric)\";\n }\n newLabel.className = \"leftMarginForm\";\n newLabel.id = \"lbl \" + (i + 1);\n rowNode.appendChild(newLabel);\n if (document.getElementById('inputType' + (i + 1)).value == \"Text Box\") {\n \n var newInput = document.createElement('input');\n newInput.type = \"text\";\n newInput.id = \"text\" + (i + 1);\n newInput.value = \" \";\n\n newInput.setAttribute('oninput', \"setTextValue(this.id);\")\n newInput.style.paddingRight = \"20%\";\n newInput.style.cssFloat = \"right\";\n newInput.style.marginRight = \"30%\";\n rowNode.appendChild(newInput);\n var line=document.createElement('hr');\n rowNode.appendChild(line);\n }\n\n\n var check1 = document.getElementById('countRadio' + (i + 1) + \" 1\");\n\n var check2 = document.getElementById('countRadio' + (i + 1) + \" 2\");\n\n var check3 = document.getElementById('countRadio' + (i + 1) + \" 3\");\n\n //checking if two radios are in store ,setting them and adding to parent node\n if (check1 && !check2 && !check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n\n }\n if (check1 && check2 && !check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 2\\\" value=\\\"value\" + (i + 2) + \"\\\"> \" + check2.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n\n }\n //checking if all three radios are present in store,setting them and adding to parent node\n if (check1 && check2 && check3) {\n var radioBlock = document.createElement('div');\n\n radioBlock.style.display = \"block\";\n radioBlock.style.marginLeft = \"150px\";\n radioBlock.innerHTML = \"<form><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 1\\\" value=\\\"value\" + (i + 1) + \"\\\"> \" + check1.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 2\\\" value=\\\"value\" + (i + 2) + \"\\\"> \" + check2.value + \"<br><input onclick=\\\"radioChangeState(this.id)\\\" name=\\\"option\\\" type=\\\"radio\\\" id=\\\"radio\" + (i + 1) + \" 3\\\" value=\\\"value\" + (i + 3) + \"\\\"> \" + check3.value + \"<br></form>\";\n rowNode.appendChild(radioBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n\n var check1 = document.getElementById('countCheck' + (i + 1) + \" 1\");\n\n var check2 = document.getElementById('countCheck' + (i + 1) + \" 2\");\n\n var check3 = document.getElementById('countCheck' + (i + 1) + \" 3\");\n //selection will be executed if only first checkbox is present in store\n if (check1 && !check2 && !check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \"1\\\">\" + check1.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n //selection will be executed if two checkboxes are present in store\n if (check1 && check2 && !check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 1\\\">\" + check1.value + \"<br><input checked=\\\"unchecked\\\" onchange=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 2\\\">\" + check2.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n\n //selection will be executed if all three checkboxes are present\n if (check1 && check2 && check3) {\n var checkBlock = document.createElement('div');\n checkBlock.style.display = \"block\";\n checkBlock.style.marginLeft = \"150px\";\n checkBlock.innerHTML = \"<form><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 1\\\">\" + check1.value + \"<br><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 2\\\">\" + check2.value + \"<br><input onclick=\\\"checkBoxStateChanged(this.id)\\\" type=\\\"checkbox\\\" id=\\\"check\" + (i + 1) + \" 3\\\">\" + check3.value + \"</form>\";\n rowNode.appendChild(checkBlock);\n rowNode.appendChild(document.createElement('hr'));\n }\n parentNode.appendChild(rowNode);\n \n }\n //formular template will be aded in two object stores,first templates for admin panel and second as empty version for formular tab\n addFormularTemplateToDB(parentNode.innerHTML, document.getElementById('search').value);\n addToFormularData(parentNode.innerHTML, document.getElementById('search').value);\n //after save function will refresh formular list in formular tab\n updateFormularList();\n}", "function generateAllSkillsHTML(data) {\n\n // var list = $('.all-skills .skills-list');\n var list = $(\".multi-level\");\n\n var theTemplateScript = $('#skills-template').html();\n var theTemplate = Handlebars.compile(theTemplateScript);\n list.append(theTemplate(data));\n\n }", "function getTemplate(item) {\n return '<div class=\"row\">' +\n '<div class=\"col-xs-12\">' +\n '<div class=\"question\">'+ item.question +'</div>'+\n '</div>'+\n '</div>'+\n '<div class=\"row\">'+\n '<div class=\"col-xs-12 text-center\">'+\n '<div class=\"answers\">'+\n '<ol>'+\n '<li>' + '<button type=\"button\" id=\"btn\" class=\"btn btn-lg btn-block\" >' + item.answers[0] + '</button>' + '</li>'+\n '<li>' + '<button type=\"button\" id=\"btn\" class=\"btn btn-lg btn-block\" >' + item.answers[1] + '</button>' + '</li>'+\n '<li>' + '<button type=\"button\" id=\"btn\" class=\"btn btn-lg btn-block\" >' + item.answers[2] + '</button>' + '</li>'+\n '<li>' + '<button type=\"button\" id=\"btn\" class=\"btn btn-lg btn-block\" >' + item.answers[3] + '</button>' + '</li>'+\n '</ol>'+\n\n '</div>'+\n '</div>'+\n '</div>';\n}", "function build(tmplItem, nested, content) {\n // Convert hierarchical content into flat string array\n // and finally return array of fragments ready for DOM insertion\n var frag, ret = content ? jQuery.map(content, function (item) {\n return (typeof item === \"string\") ?\n // Insert template item annotations, to be converted to jQuery.data( \"tmplItem\" ) when elems are inserted into DOM.\n (tmplItem.key ? item.replace(/(<\\w+)(?=[\\s>])(?![^>]*_tmplitem)([^>]*)/g, \"$1 \" + tmplItmAtt + \"=\\\"\" + tmplItem.key + \"\\\" $2\") : item) :\n // This is a child template item. Build nested template.\n build(item, tmplItem, item._ctnt);\n }) :\n // If content is not defined, insert tmplItem directly. Not a template item. May be a string, or a string array, e.g. from {{html $item.html()}}.\n tmplItem;\n if (nested) {\n return ret;\n }\n\n // top-level template\n ret = ret.join(\"\");\n\n // Support templates which have initial or final text nodes, or consist only of text\n // Also support HTML entities within the HTML markup.\n ret.replace(/^\\s*([^<\\s][^<]*)?(<[\\w\\W]+>)([^>]*[^>\\s])?\\s*$/, function (all, before, middle, after) {\n frag = jQuery(middle).get();\n\n storeTmplItems(frag);\n if (before) {\n frag = unencode(before).concat(frag);\n }\n if (after) {\n frag = frag.concat(unencode(after));\n }\n });\n return frag ? frag : unencode(ret);\n }", "produce() {\n var listElem = [],\n uniqueKey = [];\n this.list.forEach(item => {\n var elem = <RenderElement elemkey={item.key} text={item.text} type={item.type} inlineStyleRanges={item.inlineStyleRanges}/>\n uniqueKey.push(item.key)\n listElem.push(elem)\n })\n return (this.list[0].type == \"unordered-list-item\" ? <ul key={uniqueKey.join(\"|\")}>{listElem}</ul> : <ol key={uniqueKey.join(\"|\")}>{listElem}</ol>)\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 search_results(data, context){\n var obj = JSON.parse(data);\n // cache the jQuery object\n var $search_results = $('#search_results');\n // empty the element\n $search_results.empty();\n // add the results\n $search_results.append('<h2>Results</h2><p>Objects with the following ids match your query:</p><ul>');\n if (obj.ids.length>0) {\n $.each(obj.ids, function(o, object_id) {\n context.partial('templates/result.template', { obj: object_id}, function(rendered) { $search_results.append(rendered)});\n });\n } else {\n $search_results.append('<li>None found. Please try again...</li>');\n }\n $search_results.append('</ul>');\n }", "wrapInParentHtml(htmlObjectArray) {\n var newData = [];\n let innerHtml = \"\";\n //if there are more than 3 entries, do wrapping operations\n if (htmlObjectArray.length > 3) {\n // https://stackoverflow.com/questions/63462236/merge-every-3-elements-in-array-javascript\n for (let i = 0; i < htmlObjectArray.length; i += 3) { // i+=3 can solve your problem\n let three = \"\";\n // don't pass the ones that aren't null\n if (htmlObjectArray[i]) {\n three += htmlObjectArray[i];\n }\n if (htmlObjectArray[i + 1]) {\n three += htmlObjectArray[i + 1];\n }\n if (htmlObjectArray[i + 2]) {\n three += htmlObjectArray[i + 2];\n }\n //push each set of three to the newData array\n newData.push(three)\n }\n //wrap each set of 3 and then return it\n for (const setOfHtml of newData) {\n innerHtml += `<div class='columns features is-centered'>${setOfHtml}</div>`;\n }\n return innerHtml;\n } else {\n //else just return the data wrapped in one row and return\n return `<div class='columns features is-centered'>${htmlObjectArray}</div>`;\n }\n }", "get contents() {\n\t\tlet result = `\n <div class='container'>\n <header>\n <h1>${this.title}</h1>\n </header>\n <!-- Page specific content -->\n <div id='page-content'>${this.body}</div>\n </div>`;\n\t\treturn result;\n\t}", "_render(html){this.$.container.innerHTML=html}", "function generateProductsHTML(index, item) {\n return `<div class=\"product-container\" position=${index}>\n <img class=\"product-image\" id=\"image${item.id}\" src=\"${item.image}\">\n <div class=\"productInfo-container\">\n <div class=\"product-name\">${item.name}</div>\n <div class=\"product-price\">${item.price}</div>\n </div>\n <div class=\"product-buy\" id=\"${item.id}\">${item.button_text}</div> \n </div>`\n}", "function render(){\n $('main').html(choiceTemplate());\n}", "render(obj, currentLine=1) {\r\n\r\n // input is an array: render elements and join strings\r\n if (obj instanceof ResultArray) {\r\n let line = currentLine;\r\n return obj.arr.map(x => {\r\n let txt = this.render(x, line);\r\n line += x.lines;\r\n return txt\r\n }).join('');\r\n\r\n // input is an AST element: render with template\r\n } else if (obj instanceof Result) {\r\n\r\n // identify template\r\n var fn;\r\n if (fn = this.rules[obj.rule.name]) {\r\n\r\n // render nested AST elements\r\n let attr = {};\r\n Object.keys(obj.attr).forEach(f => {\r\n attr[f] = this.render(obj.attr[f], currentLine)\r\n })\r\n\r\n // attach line number\r\n attr.sourceLine = currentLine;\r\n\r\n // perform post-processing if applicable\r\n if (obj.rule.processor) {\r\n obj.rule.processor(attr);\r\n }\r\n\r\n // call template rendering function\r\n return this.rules[obj.rule.name](attr)\r\n\r\n // error if template wasn't found\r\n } else {\r\n throw new Error('No template defined for rule: '+obj.rule.name)\r\n }\r\n\r\n // otherwise pass through raw value\r\n } else {\r\n return obj\r\n }\r\n }", "function renderHTML(data) {\n const questionContainer = document.getElementById(\"question\");\n let HTMLString = \"\";\n\n for (let i = 0; i < data.length; i++) { \n \n HTMLString += \"<li> <p> Question no. \" + data[i].QuestionId + \" \" + data[i].Question;\n let HTMLhelperstring = \"\";\n for (let j = 0; j <= data[i].Answers.length-1; j++) {\n HTMLhelperstring += \"<button id = \" + data[i].QuestionId + \">\" + data[i].Answers[j] + \"</button>\" ;\n \n } \n HTMLhelperstring += \".</p>\";\n HTMLString += HTMLhelperstring + \"</li>\"; \n \n }\n questionContainer.insertAdjacentHTML('beforeend', HTMLString);\n}", "function generateResultHtml(result)\n\t{\n\n\t\tlet Html = \"\"\n\t\tresult.forEach(function(element) {\n\t\t\tlet difficulty = ''\n\t\t\tswitch(element.LevelOfDifficulty){\n\t\t\t\tcase 1:\n\t\t\t\t\tdifficulty = 'Green'\n\t\t\t\t\tbreak;\n\t\t\t\tcase 2:\n\t\t\t\t\tdifficulty = 'Red'\n\t\t\t\t\tbreak;\n\t\t\t\tcase 3:\n\t\t\t\t\tdifficulty = 'Black'\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tHtml += `<div>\n <p>${element.Destination1} To ${element.Destination2}</p>\n <p>Length: ${element.Lenght/1000} Km</p>\n <p>Difficulty: ${difficulty}</p>\n <a href=\"${element.GPXLink}\">GpxLink</a>\n <hr>\n </div>`\n\t\t})\n\n\t\treturn Html\n\t}", "async cphBodyBuild()\n {\n //Variables.\n //----------------------\n //let strReturn = \"<h1>Testing layout body</h1>\"; //debug.\n let strReturn = \"\";\n let backendHTML = \"\";\n let arrSearchParameters = [];\n let arrFiltersGenericSearchParameters = [];\n\n let oulRecords = \"\";\n let oulRecordsParameters = {};\n\n \n //Debug.\n //console.log(\"oulRecordsParameters=\", oulRecordsParameters);\n //console.log(\"_pagingTotalRecords=\", this._pagingTotalRecords);\n //console.log(\"_pagingTotal=\", this._pagingTotal);\n //----------------------\n\n\n //Logic.\n //----------------------\n try\n {\n //Parameters build.\n arrSearchParameters.push(\"id_parent;\" + this._idParent + \";i\");\n arrSearchParameters.push(\"id;11;!i\"); //user - root\n\n oulRecordsParameters = {\n _arrSearchParameters: arrSearchParameters,\n _configSortOrder: gSystemConfig.configUsersSort,\n _strNRecords: \"\",\n _objSpecialParameters: {returnType: 3}\n };\n\n //Pagination.\n if(gSystemConfig.enableUsersBackendPagination == 1)\n {\n //this._pagingTotalRecords = await SyncSystemNS.FunctionsDB.genericTableGet02(\"categories\", \n this._pagingTotalRecords = await SyncSystemNS.FunctionsDB.genericTableGet02(gSystemConfig.configSystemDBTableUsers, \n arrSearchParameters, \n gSystemConfig.configUsersSort, \n \"\", \n \"id, id_parent\", \n 3, \n {});\n\n this._pagingTotal = Math.ceil(this._pagingTotalRecords / this._pagingNRecords);\n\n\n //Parameters build - paging.\n oulRecordsParameters._objSpecialParameters._pageNumber = this._pageNumber;\n oulRecordsParameters._objSpecialParameters._pagingNRecords = this._pagingNRecords;\n }\n \n //Object build.\n oulRecords = new SyncSystemNS.ObjectUsersListing(oulRecordsParameters);\n await oulRecords.recordsListingGet(0, 3);\n\n\n //Build HTML.\n backendHTML = `\n <div id=\"divMessageSuccess\" class=\"ss-backend-success\">\n ${ \n (this._nRecords) ? \n `\n ${ this._nRecords + \" \" }\n `\n : \n ``\n } \n \n ${ \n (this._messageSuccess) ? \n `\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this._messageSuccess) }\n `\n : \n ``\n } \n </div>\n <div id=\"divMessageError\" class=\"ss-backend-error\">\n ${ \n (this._messageError) ? \n `\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this._messageError) }\n `\n : \n ``\n } \n </div>\n <div id=\"divMessageAlert\" class=\"ss-backend-alert\">\n ${ \n (this._messageAlert) ? \n `\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, this._messageAlert) }\n `\n : \n ``\n } \n \n ${\n /*Debug.*/\n /*\"FunctionsCrypto.encryptValue=\" + SyncSystemNS.FunctionsCrypto.encryptValue(\"testing encryption\", 2) + \"<br />\" +*/\n /*\"FunctionsCrypto.decryptValue 23=\" + SyncSystemNS.FunctionsCrypto.decryptValue(\"7d9690aa7af8350618fba2d1060fdefd233480f4a2de8227e605a9522b44f0e4\", 2) + \"<br />\" +*/ /* 23 */\n /*\"FunctionsCrypto.decryptValue 26=\" + SyncSystemNS.FunctionsCrypto.decryptValue(\"1c7839affd95d5bc4c638d4c57fa903a326d6a5bb326f6eaa4b8c08269a400bd\", 2) + \"<br />\" +*/ /* 26 */\n /*\"_idParent=\" + this._idParent + \"<br />\" +*/ /*working*/\n /*\"_idParent=\" + this._idParent + \"<br />\" +*/ /*working*/\n /*\"_pageNumber=\" + this._pageNumber + \"<br />\" +*/ /*working*/\n /*\"_masterPageSelect=\" + this._masterPageSelect + \"<br />\"*/ /*working*/\n /*\"FunctionsGeneric=\" + SyncSystemNS.FunctionsGeneric.categoryConfigSelect(2, 5)*/ /*working*/\n /*\"hostname=\" + os.hostname() + \"<br />\" +*/\n /*\"networkInterfaces=\" + JSON.stringify(os.networkInterfaces()) + \"<br />\" +*/\n /*\"networkInterfaces=\" + _(os.networkInterfaces()).values().flatten().where({ family: 'IPv4', internal: false }).pluck('address').first() + \"<br />\" +*/\n /*\"networkInterfaces=\" + Object.values(os.networkInterfaces())\n .reduce((r,a)=>{\n r = r.concat(a)\n return r;\n }, [])\n .filter(({family, address}) => {\n return family.toLowerCase().indexOf('v4') >= 0 && address !== '127.0.0.1'\n })\n .map(({address}) => address).join(', ') + \"<br />\" +*/\n /*\"global=\" + global.URL() + \"<br />\" +*/ /*working - result: 192.168.201.1, 192.168.26.1, 192.168.0.11, 127.0.0.1*/\n ''\n }\n </div>\n <script>\n //Debug.\n //alert(document.location);\n //alert(window.location.hostname);\n //alert(window.location.host);\n //alert(window.location.origin);\n </script>\n <section class=\"ss-backend-layout-section-data01\">\n ${oulRecords.resultsUsersListing == \"\" ? `\n <div class=\"ss-backend-alert ss-backend-layout-div-records-empty\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage1\") }\n </div>\n ` : `\n <div style=\"position: relative; display: block; overflow: hidden; margin-bottom: 2px;\">\n <button \n id=\"users_delete\" \n name=\"users_delete\" \n onclick=\"elementMessage01('formUsersListing_method', 'DELETE');\n formSubmit('formUsersListing', '', '', '/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/?_method=DELETE');\n \" \n class=\"ss-backend-btn-base ss-backend-btn-action-cancel\" \n style=\"float: right;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemDelete\") }\n </button>\n </div>\n\n <form id=\"formUsersListing\" name=\"formUsersListing\" method=\"POST\" action=\"\" enctype=\"application/x-www-form-urlencoded\">\n <input type=\"hidden\" id=\"formUsersListing_method\" name=\"_method\" value=\"\">\n\n <input type=\"hidden\" id=\"formUsersListing_strTable\" name=\"strTable\" value=\"${ gSystemConfig.configSystemDBTableUsers }\" />\n \n <input type=\"hidden\" id=\"formUsersListing_idParent\" name=\"idParent\" value=\"${ this._idParent }\" />\n <input type=\"hidden\" id=\"formUsersListing_pageReturn\" name=\"pageReturn\" value=\"${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers }\" />\n <input type=\"hidden\" id=\"formUsersListing_pageNumber\" name=\"pageNumber\" value=\"${ this._pageNumber }\" />\n <input type=\"hidden\" id=\"formUsersListing_masterPageSelect\" name=\"masterPageSelect\" value=\"${ this._masterPageSelect }\" />\n\n <div style=\"position: relative; display: block; overflow: hidden;\">\n <table class=\"ss-backend-table-listing01\">\n <caption class=\"ss-backend-table-header-text01 ss-backend-table-title\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersTitleMain\") }\n </caption>\n <thead class=\"ss-backend-table-bg-dark ss-backend-table-header-text01\">\n <tr>\n ${ gSystemConfig.enableUsersSortOrder == 1 ? \n `\n <td style=\"width: 40px; text-align: left;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemSortOrderA\") } \n </td>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersImageMain == 1 ? \n `\n <td style=\"width: 100px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemImage\") } \n </td>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersNameFull == 1 ? \n `\n <td style=\"text-align: left;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersNameFull\") } \n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersNameFirst == 1 ? \n `\n <td style=\"text-align: left;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersNameFirst\") } \n </td>\n ` : ``\n }\n\n <td style=\"width: 100px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemFunctions\") } \n </td>\n\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivationA\") } \n </td>\n ${ gSystemConfig.enableUsersActivation1 == 1 ? \n `\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation1\") } \n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation2 == 1 ? \n `\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation2\") } \n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation3 == 1 ? \n `\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation3\") } \n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation4 == 1 ? \n `\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation4\") } \n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation5 == 1 ? \n `\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation5\") } \n </td>\n ` : ``\n }\n\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemEdit\") } \n </td>\n <td style=\"width: 40px; text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemDelete\") } \n </td>\n </tr>\n </thead>\n\n <tbody class=\"ss-backend-table-listing-text01\">\n ${ oulRecords.resultsUsersListing.map((usersRow)=>{\n return `\n <tr class=\"ss-backend-table-bg-light\">\n ${ gSystemConfig.enableUsersSortOrder == 1 ? \n `\n <td style=\"text-align: center;\">\n ${ SyncSystemNS.FunctionsGeneric.valueMaskRead(usersRow.sort_order, \"\", 3, null) } \n </td>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersImageMain == 1 ? \n `\n <td style=\"text-align: center;\">\n ${ usersRow.image_main !== \"\" ? \n `\n ${ /*No pop-up.*/'' }\n ${ gSystemConfig.configImagePopup == 0 ? \n `\n <img src=\"${ gSystemConfig.configSystemURLImages + gSystemConfig.configDirectoryFilesSD + \"/t\" + usersRow.image_main }\" alt=\"${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.title, \"db\") }\" class=\"ss-backend-images-listing\" />\n ` : ``\n }\n\n ${ /*GLightbox.*/'' }\n ${ gSystemConfig.configImagePopup == 4 ? \n `\n <a href=\"${ gSystemConfig.configSystemURLImages + gSystemConfig.configDirectoryFilesSD + \"/g\" + usersRow.image_main }\"\n title=\"${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.name_full, \"db\") }\"\n class=\"glightbox_users_image_main${ usersRow.id }\"\n data-glightbox=\"title:${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.name_full, \"db\") };\">\n\n <img src=\"${ gSystemConfig.configSystemURLImages + gSystemConfig.configDirectoryFilesSD + \"/t\" + usersRow.image_main }\" alt=\"${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.name_full, \"db\") }\" class=\"ss-backend-images-listing\" />\n </a>\n <script>\n gLightboxBackendConfigOptions.selector = \"glightbox_users_image_main${ usersRow.id }\";\n //Note: With ID in the selector, will open individual pop-ups. Without id (same class name in all links) will enable scroll.\n //data-glightbox=\"title: Title example.; description: Description example.\"\n var glightboxUsersImageMain = GLightbox(gLightboxBackendConfigOptions);\n </script>\n ` : ``\n }\n ` : ``\n }\n </td>\n ` : ``\n }\n \n <td style=\"text-align: left;\">\n ${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.name_full, \"db\") } \n <div>\n ${ gSystemConfig.enableUsersUsername == 1 ? \n `\n <strong>\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersUsername\") }:\n </strong>\n ${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.username, \"db\") } \n ` : ``\n }\n\n ${ gSystemConfig.enableUsersEmail == 1 ? \n `\n <strong>\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemEmail\") }:\n </strong>\n ${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.email, \"db\") } \n ` : ``\n }\n\n <strong>\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemPassword\") }:\n </strong>\n ${ usersRow.password != \"\" ? \n `\n ${ SyncSystemNS.FunctionsCrypto.decryptValue(SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.password, \"db\"), 2) }\n ` : ``\n }\n\n </div>\n </td>\n\n ${ gSystemConfig.enableUsersNameFirst == 1 ? \n `\n <td style=\"text-align: left;\">\n ${ SyncSystemNS.FunctionsGeneric.contentMaskRead(usersRow.name_first, \"db\") } \n </td>\n ` : ``\n }\n\n <td style=\"text-align: center;\">\n\n </td>\n\n <td id=\"formUsersListing_elementActivation${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation${ usersRow.id }\" class=\"ss-backend-links01\" \n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation', \n recordValue: '${ usersRow.activation == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n //alert(JSON.stringify(_resObjReturn));\n \n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ${ gSystemConfig.enableUsersActivation1 == 1 ? \n `\n <td id=\"formUsersListing_elementActivation1${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation1 == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation1${ usersRow.id }\" class=\"ss-backend-links01\"\n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation1', \n recordValue: '${ usersRow.activation1 == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation1${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation1${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation1${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation1${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation1 == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation2 == 1 ? \n `\n <td id=\"formUsersListing_elementActivation2${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation2 == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation2${ usersRow.id }\" class=\"ss-backend-links01\"\n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation2', \n recordValue: '${ usersRow.activation2 == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation2${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation2${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation2${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation2${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation2 == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation3 == 1 ? \n `\n <td id=\"formUsersListing_elementActivation3${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation3 == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation3${ usersRow.id }\" class=\"ss-backend-links01\"\n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation3', \n recordValue: '${ usersRow.activation3 == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation3${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation3${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation3${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation3${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation3 == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation4 == 1 ? \n `\n <td id=\"formUsersListing_elementActivation4${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation4 == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation4${ usersRow.id }\" class=\"ss-backend-links01\"\n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation4', \n recordValue: '${ usersRow.activation4 == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation4${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation4${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation4${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation4${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation4 == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ` : ``\n }\n ${ gSystemConfig.enableUsersActivation5 == 1 ? \n `\n <td id=\"formUsersListing_elementActivation5${ usersRow.id }\" style=\"text-align: center;\" class=\"${ usersRow.activation5 == 1 ? \"\" : \"ss-backend-table-bg-deactive\"}\">\n <a id=\"linkActivation5${ usersRow.id }\" class=\"ss-backend-links01\"\n onclick=\"htmlGenericStyle01('updtProgressGeneric', 'display', 'block');\n ajaxRecordsPatch01_async('${ gSystemConfig.configSystemURLSSL + \"/\" + gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendRecords }/',\n {\n idRecord: '${ usersRow.id }', \n strTable: '${ gSystemConfig.configSystemDBTableUsers }', \n strField:'activation5', \n recordValue: '${ usersRow.activation5 == 1 ? 0 : 1}', \n patchType: 'toggleValue', \n ajaxFunction: true, \n apiKey: '${ SyncSystemNS.FunctionsCrypto.encryptValue(SyncSystemNS.FunctionsGeneric.contentMaskWrite(process.env.CONFIG_API_KEY_SYSTEM, \"env\"), 2) }'\n }, \n async function(_resObjReturn){\n if(_resObjReturn.objReturn.returnStatus == true)\n {\n //Check status.\n if(_resObjReturn.objReturn.recordUpdatedValue == '0')\n {\n //Change cell color.\n elementCSSAdd('formUsersListing_elementActivation5${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation5${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") }');\n }\n\n if(_resObjReturn.objReturn.recordUpdatedValue == '1')\n {\n //Change cell color.\n elementCSSRemove('formUsersListing_elementActivation5${ usersRow.id }', 'ss-backend-table-bg-deactive');\n\n //Change link text.\n elementMessage01('linkActivation5${ usersRow.id }', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\") }');\n }\n\n //Success message.\n elementMessage01('divMessageSuccess', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessage11\") }');\n }else{\n //Show error.\n elementMessage01('divMessageError', '${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"statusMessageAPI2e\") }');\n }\n\n //Hide ajax progress bar.\n htmlGenericStyle01('updtProgressGeneric', 'display', 'none');\n });\">\n ${ \n usersRow.activation5 == \"1\" ? \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1A\")\n : \n SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0A\") \n } \n </a>\n </td>\n ` : ``\n }\n\n <td style=\"text-align: center;\">\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + gSystemConfig.configRouteBackendActionEdit + \"/\" + usersRow.id + \"/?\" + this.queryDefault }\" class=\"ss-backend-links01\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemEdit\") } \n </a>\n </td>\n <td style=\"text-align: center;\">\n <!--input type=\"checkbox\" name=\"idsRecordsDelete[]\" value=\"${usersRow.id}\" class=\"ss-backend-field-checkbox\" /--> \n <input type=\"checkbox\" name=\"idsRecordsDelete\" value=\"${usersRow.id}\" class=\"ss-backend-field-checkbox\" /> \n <!--input type=\"checkbox\" name=\"arrIdsRecordsDelete\" value=\"${usersRow.id}\" class=\"ss-backend-field-checkbox\" /--> \n </td>\n </tr>\n `;\n }).join(\"\")}\n </tbody>\n\n <tfoot class=\"ss-backend-table-foot ss-backend-table-listing-text01\" style=\"display: none;\">\n <tr>\n <td style=\"text-align: left;\">\n \n </td>\n <td style=\"text-align: center;\">\n \n </td>\n <td style=\"text-align: center;\">\n \n </td>\n </tr>\n </tfoot>\n </table>\n </div>\n\n\n ${ /*Paging.*/'' }\n ${ /*----------------------*/'' }\n ${ gSystemConfig.enableUsersBackendPagination == 1 ? \n `\n <div class=\"ss-backend-paging\" style=\"position: relative; display: block; overflow: hidden; text-align: center;\">\n\n ${ /*Page numbers.*/'' }\n ${ gSystemConfig.enableUsersBackendPaginationNumbering == 1 ? \n `\n <div class=\"ss-backend-paging-number-link-a\" style=\"position: relative; display: block; overflow: hidden;\">\n ${Array(this._pagingTotal).fill().map((item, pageNumberOutput)=>{\n return `\n ${ (pageNumberOutput + 1) == this._pageNumber ? `\n ${ pageNumberOutput + 1 }\n ` : `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ pageNumberOutput + 1 }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingPageCounter01\") + \" \" + pageNumberOutput + 1 }\" class=\"ss-backend-paging-number-link\">\n ${ pageNumberOutput + 1 }\n </a>\n `}\n `;\n }).join(\"\")}\n </div>\n ` : ``\n }\n \n ${ /*Page controls.*/'' }\n\n \n <div style=\"position: relative; display: block; overflow: hidden;\">\n ${ this._pageNumber == 1 ? \n `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=1\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingFirst\") }\" class=\"ss-backend-paging-btn\" style=\"visibility: hidden;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingFirst\") } \n </a>\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ parseFloat(this._pageNumber) - 1 }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingPrevious\") }\" class=\"ss-backend-paging-btn\" style=\"visibility: hidden;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingPrevious\") } \n </a>\n ` : `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=1\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingFirst\") }\" class=\"ss-backend-paging-btn\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingFirst\") } \n </a>\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ parseFloat(this._pageNumber) - 1 }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingPrevious\") }\" class=\"ss-backend-paging-btn\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingPrevious\") } \n </a>\n `\n }\n\n \n ${ this._pageNumber == this._pagingTotal ? \n `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ parseFloat(this._pageNumber) + 1 }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingNext\") }\" class=\"ss-backend-paging-btn\" style=\"visibility: hidden;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingNext\") } \n </a>\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ this._pagingTotal }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingLast\") }\" class=\"ss-backend-paging-btn\" style=\"visibility: hidden;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingLast\") } \n </a>\n ` : `\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ parseFloat(this._pageNumber) + 1 }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingNext\") }\" class=\"ss-backend-paging-btn\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingNext\") } \n </a>\n <a href=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers + \"/\" + this._idParent }?pageNumber=${ this._pagingTotal }\" title=\"${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingLast\") }\" class=\"ss-backend-paging-btn\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendPagingLast\") } \n </a>\n `\n }\n </div>\n\n <div style=\"position: relative; display: block; overflow: hidden;\">\n ${ this._pageNumber } / ${ this._pagingTotal }\n </div>\n </div>\n ` : ``\n }\n ${ /*----------------------*/'' }\n\n </form>\n ` }\n </section>\n\n\n ${ /*Form.*/'' }\n <section class=\"ss-backend-layout-section-form01\">\n <form id=\"formUsers\" name=\"formUsers\" method=\"POST\" action=\"/${ gSystemConfig.configRouteBackend + \"/\" + gSystemConfig.configRouteBackendUsers }\" enctype=\"multipart/form-data\">\n <div style=\"position: relative; display: block; overflow: hidden;\">\n <script>\n //Debug.\n //webpackDebugTest(); //webpack debug\n\n\n //Reorder table rows.\n //TODO: Create variable in config to enable it.\n document.addEventListener('DOMContentLoaded', function() {\n inputDataReorder([${ gSystemConfig.configUsersInputOrder.map((arrayRow)=>{\n return `\"${ arrayRow }\"`}).join(\",\") \n }]); //necessary to map the array in order to display as an array inside template literals\n\n }, false);\n </script>\n\n <table id=\"input_table_users\" class=\"ss-backend-table-input01\">\n <caption class=\"ss-backend-table-header-text01 ss-backend-table-title\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersTitleTable\") } \n </caption>\n <thead class=\"ss-backend-table-bg-dark ss-backend-table-header-text01\">\n \n </thead>\n <tbody class=\"ss-backend-table-listing-text01\">\n ${ gSystemConfig.enableUsersSortOrder == 1 ? \n `\n <tr id=\"inputRowUsers_sort_order\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemSortOrder\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_sort_order\" name=\"sort_order\" class=\"ss-backend-field-numeric01\" maxlength=\"10\" value=\"0\" />\n <script>\n Inputmask(inputmaskGenericBackendConfigOptions).mask(\"users_sort_order\");\n </script>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersNameFull == 1 ? \n `\n <tr id=\"inputRowUsers_name_full\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersNameFull\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_name_full\" name=\"name_full\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersNameFirst == 1 ? \n `\n <tr id=\"inputRowUsers_name_first\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersNameFirst\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_name_first\" name=\"name_first\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersNameLast == 1 ? \n `\n <tr id=\"inputRowUsers_name_last\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersNameLast\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_name_last\" name=\"name_last\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersDateBirth != 0 ? \n `\n <tr id=\"inputRowUsers_date_birth\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemDateBirth\") }: \n </td>\n <td>\n ${ /*Dropdown menu.*/'' }\n ${ gSystemConfig.enableUsersDateBirth == 2 ? \n `\n ${ gSystemConfig.configBackendDateFormat == 1 ? \n `\n <select id=\"users_date_birth_day\" name=\"date_birth_day\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"d\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowDay == arrayRow ? ' selected' : ``}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n /\n <select id=\"users_date_birth_month\" name=\"date_birth_month\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"mm\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowMonth == arrayRow ? ' selected' : ``}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n /\n <select id=\"users_date_birth_year\" name=\"date_birth_year\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"y\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowYear == arrayRow ? ' selected' : ''}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n ` : `\n <select id=\"users_date_birth_month\" name=\"date_birth_month\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"mm\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowMonth == arrayRow ? ' selected' : ``}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n /\n <select id=\"users_date_birth_day\" name=\"date_birth_day\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"d\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowDay == arrayRow ? ' selected' : ``}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n /\n <select id=\"users_date_birth_year\" name=\"date_birth_year\" class=\"ss-backend-field-dropdown01\">\n ${SyncSystemNS.FunctionsGeneric.timeTableFill01(\"y\", 1, {dateType: 4}).map((arrayRow)=>{\n return `\n <option value=\"${ arrayRow }\"\n ${ this.dateNowYear == arrayRow ? ' selected' : ``}\n >${ arrayRow }</option>\n `}).join(\",\") }\n </select>\n `\n }\n ` : ``\n }\n\n ${ /*js-datepicker.*/'' }\n ${ /*TODO: Think about a logic that takes account jsDatepickerBirthBackendConfigOptions.dateSelected as default value, if field is required.*/'' }\n ${ gSystemConfig.enableUsersDateBirth == 11 ? \n `\n <input type=\"text\" id=\"users_date_birth\" name=\"date_birth\" class=\"ss-backend-field-date01\" autocomplete=\"off\" value=\"\" />\n <script>\n const dpDateBirth = datepicker(\"#users_date_birth\", jsDatepickerBirthBackendConfigOptions);\n </script>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersGender == 1 ? \n `\n <tr id=\"inputRowUsers_gender\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemGender\") }: \n </td>\n <td>\n <label class=\"ss-backend-field-radio-label\">\n <input type=\"radio\" name=\"gender\" checked value=\"0\" class=\"ss-backend-field-radio\" />\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemGender0\") }\n </label>\n <label class=\"ss-backend-field-radio-label\">\n <input type=\"radio\" name=\"gender\" value=\"1\" class=\"ss-backend-field-radio\" />\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemGender1\") }\n </label>\n <label class=\"ss-backend-field-radio-label\">\n <input type=\"radio\" name=\"gender\" value=\"2\" class=\"ss-backend-field-radio\" />\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemGender2\") }\n </label>\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersDocument == 1 ? \n `\n <tr id=\"inputRowUsers_document\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersDocument\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_document\" name=\"document\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersAddress == 1 ? \n `\n <tr id=\"inputRowUsers_address_street\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressStreet\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_address_street\" name=\"address_street\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_address_number\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressNumber\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_address_number\" name=\"address_number\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_address_complement\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressComplement\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_address_complement\" name=\"address_complement\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_neighborhood\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressNeighborhood\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_neighborhood\" name=\"neighborhood\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_district\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressDistrict\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_district\" name=\"district\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_county\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressCounty\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_county\" name=\"county\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_city\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressCity\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_city\" name=\"city\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_state\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressState\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_state\" name=\"state\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_country\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressCountry\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_country\" name=\"country\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n <tr id=\"inputRowUsers_zip_code\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemAddressZipCode\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_zip_code\" name=\"zip_code\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersPhone1 == 1 ? \n `\n <tr id=\"inputRowUsers_phone1\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersPhone1\") }: \n </td>\n <td>\n ${ gSystemConfig.enableUsersPhoneInternationalCode == 1 ? \n `\n +<input type=\"text\" id=\"users_phone1_international_code\" name=\"phone1_international_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"3\" value=\"\" />\n ` : ``\n }\n (<input type=\"text\" id=\"users_phone1_area_code\" name=\"phone1_area_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"10\" value=\"\" />)\n <input type=\"text\" id=\"users_phone1\" name=\"phone1\" class=\"ss-backend-field-tel01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersPhone2 == 1 ? \n `\n <tr id=\"inputRowUsers_phone2\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersPhone2\") }: \n </td>\n <td>\n ${ gSystemConfig.enableUsersPhoneInternationalCode == 1 ? \n `\n +<input type=\"text\" id=\"users_phone2_international_code\" name=\"phone2_international_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"3\" value=\"\" />\n ` : ``\n }\n (<input type=\"text\" id=\"users_phone2_area_code\" name=\"phone2_area_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"10\" value=\"\" />)\n <input type=\"text\" id=\"users_phone2\" name=\"phone2\" class=\"ss-backend-field-tel01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n ${ gSystemConfig.enableUsersPhone3 == 1 ? \n `\n <tr id=\"inputRowUsers_phone3\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersPhone3\") }: \n </td>\n <td>\n ${ gSystemConfig.enableUsersPhoneInternationalCode == 1 ? \n `\n +<input type=\"text\" id=\"users_phone3_international_code\" name=\"phone3_international_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"3\" value=\"\" />\n ` : ``\n }\n (<input type=\"text\" id=\"users_phone3_area_code\" name=\"phone3_area_code\" class=\"ss-backend-field-tel-ac01\" maxlength=\"10\" value=\"\" />)\n <input type=\"text\" id=\"users_phone3\" name=\"phone3\" class=\"ss-backend-field-tel01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersUsername == 1 ? \n `\n <tr id=\"inputRowUsers_username\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersUsername\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_username\" name=\"username\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersEmail == 1 ? \n `\n <tr id=\"inputRowUsers_email\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemEmail\") }: \n </td>\n <td>\n <input type=\"text\" id=\"users_email\" name=\"email\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n ` : ``\n }\n\n <tr id=\"inputRowUsers_password\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemPassword\") }: \n </td>\n <td>\n <input type=\"password\" id=\"users_password\" name=\"password\" class=\"ss-backend-field-text01\" maxlength=\"255\" value=\"\" />\n </td>\n </tr>\n\n ${ /*Information fields.*/'' }\n ${ gSystemConfig.enableUsersInfo1 == 1 ? \n `\n <tr id=\"inputRowUsers_info1\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo1\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo1FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info1\" name=\"info1\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo1FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info1\" name=\"info1\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info1\" name=\"info1\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info1\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo1FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info1\" name=\"info1\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo1FieldType == 12 ? \n `\n <textarea id=\"users_info1\" name=\"info1\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo2 == 1 ? \n `\n <tr id=\"inputRowUsers_info2\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo2\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo2FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info2\" name=\"info2\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo2FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info2\" name=\"info2\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info2\" name=\"info2\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info2\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo2FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info2\" name=\"info2\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo2FieldType == 12 ? \n `\n <textarea id=\"users_info2\" name=\"info2\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo3 == 1 ? \n `\n <tr id=\"inputRowUsers_info3\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo3\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo3FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info3\" name=\"info3\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo3FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info3\" name=\"info3\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info3\" name=\"info3\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info3\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo3FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info3\" name=\"info3\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo3FieldType == 12 ? \n `\n <textarea id=\"users_info3\" name=\"info3\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo4 == 1 ? \n `\n <tr id=\"inputRowUsers_info4\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo4\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo4FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info4\" name=\"info4\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo4FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info4\" name=\"info4\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info4\" name=\"info4\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info4\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo4FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info4\" name=\"info4\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo4FieldType == 12 ? \n `\n <textarea id=\"users_info4\" name=\"info4\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo5 == 1 ? \n `\n <tr id=\"inputRowUsers_info5\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo5\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo5FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info5\" name=\"info5\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo5FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info5\" name=\"info5\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info5\" name=\"info5\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info5\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo5FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info5\" name=\"info5\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo5FieldType == 12 ? \n `\n <textarea id=\"users_info5\" name=\"info5\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo6 == 1 ? \n `\n <tr id=\"inputRowUsers_info6\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo6\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo6FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info6\" name=\"info6\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo6FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info6\" name=\"info6\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info6\" name=\"info6\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info6\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo6FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info6\" name=\"info6\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo6FieldType == 12 ? \n `\n <textarea id=\"users_info6\" name=\"info6\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo7 == 1 ? \n `\n <tr id=\"inputRowUsers_info7\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo7\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo7FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info7\" name=\"info7\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo7FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info7\" name=\"info7\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info7\" name=\"info7\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info7\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo7FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info7\" name=\"info7\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo7FieldType == 12 ? \n `\n <textarea id=\"users_info7\" name=\"info7\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo8 == 1 ? \n `\n <tr id=\"inputRowUsers_info8\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo8\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo8FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info8\" name=\"info8\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo8FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info8\" name=\"info8\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info8\" name=\"info8\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info8\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo8FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info8\" name=\"info8\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo8FieldType == 12 ? \n `\n <textarea id=\"users_info8\" name=\"info8\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo9 == 1 ? \n `\n <tr id=\"inputRowUsers_info9\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo9\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo9FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info9\" name=\"info9\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo9FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info9\" name=\"info9\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info9\" name=\"info9\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info9\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo9FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info9\" name=\"info9\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo9FieldType == 12 ? \n `\n <textarea id=\"users_info9\" name=\"info9\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersInfo10 == 1 ? \n `\n <tr id=\"inputRowUsers_info10\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersInfo10\") }: \n </td>\n <td>\n ${ /*Single line.*/'' }\n ${ gSystemConfig.configUsersInfo10FieldType == 1 ? \n `\n <input type=\"text\" id=\"users_info10\" name=\"info10\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline.*/'' }\n ${ gSystemConfig.configUsersInfo10FieldType == 2 ? \n `\n ${ /*No formatting.*/'' }\n ${ gSystemConfig.configBackendTextBox == 1 ? \n `\n <textarea id=\"users_info10\" name=\"info10\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n\n ${ /*TinyMCE.*/'' }\n ${ gSystemConfig.configBackendTextBox == 17 | gSystemConfig.configBackendTextBox == 18 ? \n `\n <textarea id=\"users_info10\" name=\"info10\" class=\"ss-backend-field-text-area01\"></textarea>\n <script>\n tinyMCEBackendConfig.selector = \"#users_info10\";\n tinymce.init(tinyMCEBackendConfig);\n </script>\n ` : ``\n }\n ` : ``\n }\n\n ${ /*Single line (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo10FieldType == 11 ? \n `\n <input type=\"text\" id=\"users_info10\" name=\"info10\" class=\"ss-backend-field-text01\" value=\"\" />\n ` : ``\n }\n\n ${ /*Multiline (encrypted).*/'' }\n ${ gSystemConfig.configUsersInfo10FieldType == 12 ? \n `\n <textarea id=\"users_info10\" name=\"info10\" class=\"ss-backend-field-text-area01\"></textarea>\n ` : ``\n }\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersImageMain == 1 ? \n `\n <tr id=\"inputRowUsers_image_main\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemImage\") }: \n </td>\n <td>\n <input type=\"file\" id=\"users_image_main\" name=\"image_main\" class=\"ss-backend-field-file-upload\" />\n </td>\n </tr>\n ` : ``\n }\n\n <tr id=\"inputRowUsers_activation\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation\") }: \n </td>\n <td>\n <select id=\"users_activation\" name=\"activation\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n\n ${ gSystemConfig.enableUsersActivation1 == 1 ? \n `\n <tr id=\"inputRowUsers_activation1\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation1\") }: \n </td>\n <td>\n <select id=\"users_activation1\" name=\"activation1\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersActivation2 == 1 ? \n `\n <tr id=\"inputRowUsers_activation2\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation2\") }: \n </td>\n <td>\n <select id=\"users_activation2\" name=\"activation2\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersActivation3 == 1 ? \n `\n <tr id=\"inputRowUsers_activation3\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation3\") }: \n </td>\n <td>\n <select id=\"users_activation3\" name=\"activation3\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersActivation4 == 1 ? \n `\n <tr id=\"inputRowUsers_activation4\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation4\") }: \n </td>\n <td>\n <select id=\"users_activation4\" name=\"activation4\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersActivation5 == 1 ? \n `\n <tr id=\"inputRowUsers_activation5\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendUsersActivation5\") }: \n </td>\n <td>\n <select id=\"users_activation5\" name=\"activation5\" class=\"ss-backend-field-dropdown01\">\n <option value=\"1\">${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation1\") }</option>\n <option value=\"0\" selected>${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemActivation0\") }</option>\n </select>\n </td>\n </tr>\n ` : ``\n }\n\n ${ gSystemConfig.enableUsersNotes == 1 ? \n `\n <tr id=\"inputRowUsers_notes\" class=\"ss-backend-table-bg-light\">\n <td class=\"ss-backend-table-bg-medium\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendItemNotesInternal\") }: \n </td>\n <td>\n <textarea id=\"users_notes\" name=\"notes\" class=\"ss-backend-field-text-area01\"></textarea>\n </td>\n </tr>\n ` : ``\n }\n </tbody>\n <tfoot class=\"ss-backend-table-foot ss-backend-table-listing-text01\">\n\n </tfoot>\n </table>\n\n </div>\n <div style=\"position: relative; display: block; overflow: hidden; clear: both; margin-top: 2px;\">\n <button id=\"users_include\" name=\"users_include\" class=\"ss-backend-btn-base ss-backend-btn-action-execute\" style=\"float: left;\">\n ${ SyncSystemNS.FunctionsGeneric.appLabelsGet(gSystemConfig.configLanguageBackend.appLabels, \"backendButtonSend\") }\n </button>\n </div>\n\n <input type=\"hidden\" id=\"users_id_parent\" name=\"id_parent\" value=\"${ this._idParent }\" />\n <input type=\"hidden\" id=\"users_id_type\" name=\"id_type\" value=\"1\" />\n <input type=\"hidden\" id=\"users_name_title\" name=\"name_title\" value=\"\" />\n <input type=\"hidden\" id=\"users_id_status\" name=\"id_status\" value=\"0\" />\n\n <input type=\"hidden\" id=\"users_idParent\" name=\"idParent\" value=\"${ this._idParent }\" />\n <input type=\"hidden\" id=\"users_pageNumber\" name=\"pageNumber\" value=\"${ this._pageNumber }\" />\n <input type=\"hidden\" id=\"users_masterPageSelect\" name=\"masterPageSelect\" value=\"${ this._masterPageSelect }\" />\n </form>\n </section>\n `; \n\n\n this.cphBody = backendHTML;\n\n //strReturn = JSON.stringify(oplRecords);\n //strReturn = JSON.stringify(oplRecords.resultsContentListing);\n \n //return strReturn;\n\n //return this;\n }catch(asyncError){\n if(gSystemConfig.configDebug === true)\n {\n console.error(asyncError);\n } \n }finally{\n\n }\n //----------------------\n }", "function renderTopLevel()\n{\n $(\"#wrapper\").prepend(templates['header']());\n $('#center_wrap').append(templates['files']());\n $('#center_wrap').append(templates['panes']());\n console.log('-- rendered top level UI html --');\n}", "function bubbleOutputs(text, form, escape) {\n var el = xml.xhtml(text),\n places = {},\n replacer, result;\n\n if (escape) {\n replacer = function () {\n var id = util.get_guid();\n places[id] = outputToBubble(form, this);\n return \"{\" + id + \"}\";\n };\n } else {\n replacer = function () {\n return outputToBubble(form, this);\n };\n }\n el.find('output').replaceWith(replacer);\n result = el.html();\n if (escape) {\n result = escapeReplace(result, places);\n }\n return result;\n }", "function displayResults(data) {\n // debugger\n // results.innerHTML = \"\"\n // $('#results').clearQueue();\n $('#results').html(\"\");\n data.items.map(obj => {\n $('#results').append(`<div>\n <h2><a href=\"${obj.html_url}\"${obj.name}</a></h2> \n <p><img src=\"${obj.owner.avatar_url}\" alt=\"User Image\"></p>\n <p><a href='#' data-repository=\"${obj.name}\" data-owner=\"${obj.owner.login}\" onclick=\"showCommits(this)\">Show Commits</a></p> \n <p> <li>${obj.description}</p>\n </div>`)\n // return results.innerHTML += `<li><h2>${obj.name}</h2> by ${obj.owner.login}</li>`\n })\n}", "function shortResultsList(ids) {\n var templateFn = _.template(document.getElementById(\"short-result-template\").innerHTML);\n var resultTemplate = document.getElementById(\"movieresults\");\n _.forEach(ids, function(id) { // Execute Template Function\n var url = apiURL + '?apikey=' + apiKey + '&i=' + id;\n fetch(url).then(function(response) {\n return response.json();\n }).then(function(movie){\n var templateHTML = templateFn({\n 'poster': movie[\"Poster\"],\n 'title' : movie[\"Title\"],\n 'plot': movie[\"Plot\"],\n 'year': movie[\"Year\"],\n 'runtime': movie[\"Runtime\"],\n 'imdbid': movie[\"imdbID\"]\n });\n resultTemplate.innerHTML += templateHTML; // Append The Movie\n $(\"#movieresults\").css(\"display\", \"flex\"); // Show result container and make it flexbox to accommodate cases of images overflowing low text reults\n $(\"footer\").css(\"top\", \"10vh\"); // Adjust footer's positioning for better visuals\n });\n });\n}", "async _renderReciepts(pageDom) {\n // Aufruf der Methode aus database.js um Rezepte zu selektieren\n let rezepte = await this._app.database.selectAllRezepte();\n let templateElement = pageDom.querySelector(\"#template-rezept\");\n let mainElement = pageDom.querySelector(\"main\");\n\n // Erzeugung einer Variable rezept für jedes im Array durchlaufenen Rezept\n for (let i = 0; i < rezepte.length; i++) {\n let rezept = rezepte[i];\n\n // URL des Bilds ermitteln\n let imageUrl = \"default.jpg\";\n\n if (rezept.bildId) {\n try {\n imageUrl = await this._app.database.getBildUrl(rezept.bildId);\n } catch (error) {\n console.error(error);\n imageUrl = \"default.jpg\";\n }\n\n\n // HTML-Code zur Anzeige des Rezepts erzeugen\n let html = templateElement.innerHTML;\n html = html.replace(/{NAME}/g, rezept.name);\n /* Rezept-ID für die Übergabe an die Seite page-detail2 erzeugen, damit diese\n in den bei Klick auf das Bild aufgerufenen Link geschrieben werden kann */\n html = html.replace(/{REZEPTID}/g, rezept.id);\n html = html.replace(/{IMAGE_URL}/g, imageUrl);\n mainElement.innerHTML += html;\n\n }\n\n }\n\n}", "function _component(pobj, obj, template, options, index) {\n \n //Create a new ihtml object for the parent\n var ihtml = new iHTML();\n \n var component = {\n \"template\":undefined,\n \"name\":undefined\n };\n \n for(var prop in template) {\n \n //Check the property\n switch(prop) {\n \n //REQUIRED\n case \"[]\":\n \n //Get the component name (from the parent if we have one)\n var name = _getValue(pobj || obj, template, prop, options, index);\n \n //Check for a local component first\n if(options.components) component.template = options.components[name];\n \n //Otherwise check the global components (if we didn't have a local template)\n if(!component.template) component.template = COMPONENTS[name];\n \n //Otherwise ignore\n break;\n \n //Embed this template within the component\n // if needed\n case \"html\":\n \n //Check what object type of template we allow\n switch(_typeof(template.html)) {\n \n //Make sure we have an object or array\n case \"object\":\n \n //Render the children\n // make sure to clear the parent\n // children don't have access to the parent\n options.$ihtml = _render(obj, template.html, options, index);\n break;\n }\n \n break;\n }\n }\n \n //If we don't have the component then exit\n // template can be an object or array\n if(_typeof(component.template) !== \"object\") return(ihtml);\n \n //render the template and assign to the output\n // this template is considered a child to it won't have access to the parent\n ihtml.append(_render(obj, component.template, options));\n \n return(ihtml);\n }" ]
[ "0.6008728", "0.5752439", "0.5670244", "0.56100166", "0.56079936", "0.551152", "0.54627365", "0.54563415", "0.54531854", "0.5443828", "0.54157037", "0.5389362", "0.5387283", "0.5386114", "0.5369917", "0.5346776", "0.53292996", "0.5308876", "0.5307069", "0.528543", "0.5269255", "0.5268322", "0.5266536", "0.52662486", "0.525293", "0.52484405", "0.5241905", "0.5237696", "0.5227851", "0.52251744", "0.52232814", "0.521304", "0.5208572", "0.52034605", "0.52034605", "0.5195389", "0.5193976", "0.51824886", "0.5181689", "0.5177502", "0.5177034", "0.5175896", "0.51563865", "0.5145831", "0.5143221", "0.51411974", "0.5138314", "0.51287985", "0.5122097", "0.512169", "0.5111287", "0.51111335", "0.5106549", "0.50972044", "0.50957274", "0.5091903", "0.50859576", "0.508589", "0.5085613", "0.5084966", "0.5081507", "0.50781727", "0.5075075", "0.50743425", "0.5065814", "0.50592977", "0.50574815", "0.50553507", "0.5051089", "0.5044114", "0.50438756", "0.50421405", "0.50398004", "0.50389796", "0.5038484", "0.5034501", "0.50327754", "0.5024285", "0.5023239", "0.50221634", "0.5019604", "0.50189435", "0.5017339", "0.5013615", "0.50127226", "0.5004552", "0.49989873", "0.49962997", "0.4995585", "0.49946547", "0.49929127", "0.4992017", "0.49878934", "0.49866718", "0.4984661", "0.49787393", "0.49759558", "0.49733728", "0.49727273", "0.49616763", "0.49606073" ]
0.0
-1
return 1 + 2; } console.log(questionOne());
function questionTwo (num1, num2, num3) { return Math.max(num1, num2, num3) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function answer1() {\n //the answer should be \"yes\" or \"no\"\n return \"no\";\n}", "function one(){\n\n return 'ONE';\n\n // Nothing after 'return' gets executed\n console.log('THIS WILL NOT WORK!');\n\n}", "function returnA() {\n checkAnswer(1);\n}", "function firstfunc (x, y){\n\tvar mathandstuff = (x * y) + (2*x * 2*y);\n\tconsole.log(\"Answer:\", mathandstuff);\n\treturn mathandstuff;\n\n}", "function answer1(){\n //the answer should be \"yes\" or \"no\"\n return \"no\";\n}", "function two() {\r\n console.log('work 2');\r\n return 54;\r\n}", "function test4(num1, num2) {\n return num2; //num2 will be returned only and next return will not be returned because once the function identifies the first return statement the execution of the function stops.\n return num1 * num2;\n}", "function question1() {\n return 'Hello JavaScript';\n}", "function answer1() {\n checkAnswer(1)}", "function challenge5() {\n // write here with console.log, no need to return\n}", "function sayHi() {\n console.log(`hi`)\n return 10\n}", "function two() {\n console.log('two');\n return 2;\n}", "function one() {\n return 1;\n}", "function one() {\n return 1;\n}", "function complicated () {\n console.log(multiply(return4(), 8));\n}", "function add(num1, num2){\n console.log(num1+num2);\n return ; // <--- ki return korbe bola nai\n}", "function sum(num1, num2) {\n let result = num1 + num2;\n console.log(result);\n // return result;\n}", "function printReturn(num1,num2){\n console.log(num1);\n return(num2)\n}", "function returnTwo() {\n\treturn 2;\n}", "function returnTwo() {\n return 2\n}", "function ex2(){\n let first = 12\n return first // return \n }", "function returnTwo() {\n return 2;\n }", "function onePlusOne(){\n return 2;\n}", "function test() {\n console.log('Hi Roman');\n return 'return'; \n}", "function addTogether() {\n var x = 20;\n var y = 20;\n var answer = x + y;\n console.log('Normal function call executed')\n console.log(answer);\n}", "function bar() { //1\n return 3;\n }", "function one(){\n\treturn 4\n}", "function add1() {\r\n console.log(\"U R in Add1 Function \" + (2 + 2));\r\n}", "function question3(param1, param2) {\n return param1 + param2;\n\n}", "function nextQuestion() {\n\n}", "function returnsWhatIsAsked() {\r\n return 10;\r\n}", "function numTest() {\n return 1 + 2;\n}", "function add(num1, num2){\n console.log(num1 + num2);\n return\n}", "function return4 () {\n return 4;\n}", "function add2() {\r\n return (6 + 6);\r\n}", "function functionOne() {\n console.log('yo');\n\n //js always wants to return something\n return 'yo';\n}", "function a1(){\n\treturn 1;\n}", "function returnFunction() {\r\n // return 1+1; // will return undefined.\r\n return 1+1;\r\n}", "function doSomething(){\n console.log( 'in doSomething' );\n return 'thingy';\n} // end basic function", "function question1 (q1Result) {\n \n if (q1Result === \"A\") {\n return 2; \n } else if (q1Result === \"B\") {\n return 4; \n } else if (q1Result === \"C\") {\n return 1; \n }\n }", "function ex1(){\n return 12+20\n }", "function exercise11() {}", "function returned() {\n console.log(\"The king hath returned from the hunt!\");\n}", "function myFun() {\n console.log(\"Hello\");\n return \"world\";\n console.log(\"byebye\");\n}", "function a() {\n console.log('hello');\n return 15;\n}", "function test() {\n\treturn console.log(true);\n\treturn console.log(false);\n}", "function num1() {\n return 10;\n}", "function return5(){\n\treturn 5;\n}", "function add(num1, num2){\n console.log(num1 + num2);\n return // undefined as nothing is returnd\n}", "function test() {\n return 1;\n }", "function myFunction() {\n console.log('inside', 123);\n return 123;\n}", "function yourResult() {\n console.log(\"You have passed the examination\");\n}", "function getQ1() {\n return securityQuestion1;\n}", "function addNumbers( firstNumber, secondNumber) {\n let answer = (firstNumber + secondNumber);\n return answer\n // return firstNumber + secondNumber;\n}", "function two() {\r\n\treturn 1 + 1;\r\n}", "function calculator(num1, num2) {\n console.log(num1 + num2);\n return num1 + num2; \n}", "function add(x, y) {\n\t// function body\n\tvar sum = x + y;\n\treturn sum; // return statement\n}", "function foo() {\n return 2;\n }", "function question4() {\n question2('functions in functions');\n}", "function exercise07() {}", "function sumofNumbers (numberOne, numberTwo){\n return numberOne + numberTwo;\n //the code after return will not be executed\n let difference = numberOne - numberTwo;S\n}", "function suma() {\n console.log(5 + 5);\n}", "function addNumbers( firstNumber, secondNumber ) {\n // return firstNumber + secondNumber;\nlet solution = firstNumber + secondNumber;\nreturn solution;\n}", "function sayHi() {\n console.log('hi');\n console.log(add(2, 7));\n}", "function getA1() {\n return securityAnswer1;\n}", "function verse1(){\n let output = '';\n // your code here\n\n return output;\n}", "function a() {\n return 5\n}", "function printAndReturn(num1, num2) {\n console.log(num1)\n return num2\n}", "function printAndReturn(num1, num2) {\n console.log(num1)\n return num2\n}", "function add() {\n var x = 10;\n var y = 20;\n var z = x+y;\n console.log(z);\n return z;\n}", "function suma(){ \n console.log(2+2);\n}", "function sumTwo(a, b) {\n let mySum = a+b;\n console.log(mySum);\n return mySum;\n}", "get theAnswer() { return 42; }", "function return_new_answer() {\n return new_answer;\n }", "function greetings() {\n console.log('Hello there');\n return 'hi';\n}", "function sayHi() {\n console.log('hey!');\n console.log(add(10, 2));\n}", "function sayHi() {\n console.log('hey!');\n console.log(add(10, 2));\n}", "function doubler(input) {\n return input * 2; ////Use the return key word to allow expressions to be returned out of the function\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function a(b) {\n console.log(b);\n return b * 3;\n}", "function sumar(){\n console.log(2+2)\n}", "function mySum(num1,num2){\r\n result = num1 + num2\r\n console.log(result)\r\n return result\r\n}", "function a(n){\n\tconsole.log('n is', n);\n\ty = n*2;\n\treturn y;\n}", "function sum(a,b,c) {\n let d = a + b + c;\n return d; // returns the value of d\n // This line will never execute (Unreachable code)\n // console.log(\"Function Returned\");\n}", "function op(a, b) { //a=; b= \n c = a + b; //c = \n console.log('c is', c);\n return c; // return \n}", "function fnal()\n{\nlet fmark = exam(75)+crsmark(40)\nconsole.log(fmark)\n\n}", "function q1 () {\n\tconsole.log(\"my first execution\");\n}", "function addTwoNumbers(x, y){\n return\n x + y\n}", "function addTwoNumbers(x, y){\n return\n x + y\n}", "function op(a,b){\n\tc = a+b;\n\tconsole.log('c is', c);\n\treturn c;\n}", "function op(a,b){\n\tc = a+b;\n\tconsole.log('c is', c);\n\treturn c;\n}", "function Sum(number, number2) {\n var Sum = number + number2;\n return console.log(Sum);\n}", "function incorrect1(){\n totalTime = (totalTime- questionTime)\n console.log('-15')\n Q2()\n \n}", "function kata() {\n // Your code here...\n return;\n}", "function currentQuestion(){\n return currentQuestionRound;\n}", "function part_one_exercise_three(){\n// finding the result of 423 X 12 statement\nconsole.log(\"The result of 423 multiplied by 12 is: \" + (423 * 12))\n// finding the result of 802 / 2 statement\nconsole.log(\"The result of 802 divided by 2 is: \" + (802 / 2))\n// finding the result of the sum of 5 and 6, multiplied by 3 statement\nconsole.log(\"The result of the sum of 5 and 6, multiplied by 3 is: \" + ((5 + 6) * 3))\nconsole.log(\"------\")\n}", "function printIt(answer){\n console.log(\"the answer is: \", answer);\n}", "function newCalc() {\n let ans = rs.question('Another calculation?\\n');\n\n if (ans.slice(0, 1).toLowerCase() === 'y') {\n return true;\n } else {\n console.log('Goodbye.');\n }\n}", "function addTwoNum(num1, num2) {\n console.log(num1, num2);\n var total = num1 + num2;\n return total;//it will return to result\n\n}", "function a(b) {\r\n console.log(b);\r\n return b * 3;\r\n}" ]
[ "0.7163506", "0.7046955", "0.7039151", "0.7008113", "0.69740045", "0.6943809", "0.6939151", "0.6912485", "0.6870749", "0.68200684", "0.6815296", "0.6810647", "0.68104225", "0.68104225", "0.6803816", "0.671336", "0.6706433", "0.6703776", "0.6694486", "0.6691704", "0.6632818", "0.6617776", "0.6613783", "0.6593304", "0.6564518", "0.65636134", "0.6562074", "0.6536918", "0.65299124", "0.6527887", "0.6520792", "0.65187734", "0.6508043", "0.65079486", "0.65052843", "0.6487455", "0.64796174", "0.6476397", "0.64705706", "0.64633495", "0.6456664", "0.6431831", "0.6426641", "0.6425557", "0.6423131", "0.64061624", "0.63949025", "0.63922226", "0.6391742", "0.6387194", "0.6381886", "0.63729966", "0.63660955", "0.6364449", "0.63584965", "0.6357378", "0.6355623", "0.6345992", "0.6343593", "0.6318573", "0.63075304", "0.62852544", "0.6281351", "0.62807596", "0.62799096", "0.62746423", "0.62642306", "0.6240773", "0.6240773", "0.623525", "0.6233021", "0.6223848", "0.6207835", "0.61934495", "0.61927754", "0.6180499", "0.6180499", "0.6179983", "0.61761457", "0.61761457", "0.61761457", "0.61742514", "0.616453", "0.6163168", "0.6158918", "0.61547077", "0.61537874", "0.6151707", "0.61489856", "0.61489856", "0.6146972", "0.6146972", "0.61368966", "0.61333334", "0.61319244", "0.6126217", "0.6123456", "0.6121809", "0.6118951", "0.61160225", "0.61099094" ]
0.0
-1
the first pair where the sum is 0. Return an array that includes both values that sum to zero or undefined if a pair does not exist. sumZero([3,2,1,0,1,2,3]) => [3,3] sumZero([2,0,1,3]) => undefined sumZero([1,2,3]) => undefined
function sumZero(arr){ for(let i = 0; i < arr.lenght; i++){ for(let j = 0; j < arr.lenght; j++){ if(arr[i] + arr[j] === 0){ return [arr[i], arr[j]]; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function sumZero(arr){\n for(let i=0; i<arr.length; j++){ //basic loop thru entire array\n for(let j=i+1; j<arr.length; j++){//basic loop thru entire array starting one ahead\n if(arr[i]+ arr[j]===0){// if the sum is 0\n return [arr[i], arr[j]]\n }\n }\n }\n}", "function sumZero(arr){\n // we are itterating the array\n for(var i=0; i<arr.length;i++){\n for(var j=i+1; j<arr.length; j++){\n // here we checking a pair of numbers the resultant sum should be zero\n if(arr[i] + arr[j] === 0){\n // if the condition is satisfied, we return a pair of array\n return [arr[i], arr[j]]\n }\n }\n }\n}", "function sumZero(arr) {\n\tfor (let i = 0; i < arr.length; i++) {\n\t\tfor (let j = 0; j < arr.length; j++) {\n\t\t\tif(arr[i] + arr[j] === 0) {\n\t\t\t\treturn [arr[i], arr[j]];\n\t\t\t}\n\t\t}\n\t}\n}", "function sumZero(array) {\n let first = 0;\n let last = array.length - 1;\n\n while (last > first) {\n if (array[first] + array[last] === 0) {\n return [array[first], array[last]];\n } else if (array[first] + array[last] > 0) {\n last--;\n } else {\n first++;\n }\n }\n return undefined;\n}", "function sumZero(arr){\n for (let i = 0; i < arr.length; i++){\n for (let j = i + 1; j < arr.length; j++){\n if(arr[i] + arr[j] === 0){\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++){\n for (let j = i + 1; j < arr.length; j++){\n if (arr[i] + arr[j] === 0){\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n let sum = arr[i] + arr[j];\n if (sum === 0 ) {\n return [arr[i], arr[j]]\n }\n }\n }\n}", "function sumZero(arr) {\n for(let i = 0; i < arr.length; i++) {\n for(let j = i+1; j < arr.length; j++) {\n if(arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]]\n }\n }\n }\n}", "function sumZero (arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = 0; j < arr[i].length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr){\n for (let i = 0; i < arr.length; i++) {\n for (let j = i+1; j < arr.length; j++) {\n if(arr[i] + arr[j] === 0){\n return [arr[i], arr[j]]; \n }\n }\n }\n}", "function sumZero(arr) {\n // do something\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]]\n }\n }\n }\n}", "function sumZero(arr){\n for (let i = 0; i < arr.length; i++){\n for (let j = i + 1; j < arr.length; j++){\n if(arr[i] + arr[j] === 0){\n return [arr[i], arr[j]];\n }\n console.log(arr[i]);\n console.log(arr[j]);\n }\n }\n}", "function sumZero(arr) {\n if(arr.length > 1) {\n var left = 0;\n var right = arr.length - 1;\n while(left < right) {\n var sum = arr[left] + arr[right];\n if(sum === 0) return [arr[left], arr[right]];\n else if(sum > 0) right--;\n else left++;\n }\n }\n}", "function sumZeroNaive(arr) {\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n return [arr[1], arr[j]];\n }\n }\n }\n}", "function sumToZero1(arr) {\n // loop the array with the first index is the starting point\n for (let i = 0; i < arr.length; i++) {\n // create a nested loop with the second index is the starting point\n for (let j = i+1; j < arr.length; j++) {\n // check if the sum of the current outer value (first) and the current inner value (second) is 0, if so return the outer and inner value\n if (arr[i] + arr[j] === 0) {\n return [arr[i], arr[j]];\n }\n }\n }\n}", "function sumZero(arr){\n let left = 0\n let right = arr.length - 1\n\n // can't overlap because if we have 0 in the array it would be a false positive\n while (left < right) {\n let sum = arr[left] + arr[right]\n if (sum === 0) {\n return [arr[left], arr[right]]\n } else if (sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function sumZero(arr) {\n\t// initialize variables for left and right\n\tlet left = 0;\n\tlet right = arr.length - 1;\n\t// loop over array\n\twhile (right > left) {\n\t\tlet sum = arr[left] + arr[right];\n\t\t// check if sum is 0\n\t\tif (sum === 0) {\n\t\t\t// return pair\n\t\t\treturn [arr[left], arr[right]];\n\t\t}\n\t\t// if sum is greater than 0, increase the right by 1\n\t\tif (sum > 0) {\n\t\t\tright--;\n\t\t}\n\t\t// else increase the left by 1\n\t\telse {\n\t\t\tleft++;\n\t\t}\n\t}\n}", "function sumZero(arr) {\n let pointerLeft = 0;\n let pointerRight = arr.length - 1;\n\n for (var i = 0; i < arr.length; i++) {\n const sum = arr[pointerLeft] + arr[pointerRight];\n if (pointerLeft < pointerRight) {\n if (!sum) {\n return [arr[pointerLeft], arr[pointerRight]];\n } else if (sum > 0) {\n pointerRight--;\n } else {\n pointerLeft++;\n }\n }\n }\n}", "function sumZero2(arr) {\n let i = 0;\n let j = arr.length - 1;\n\n while (i < j) {\n let result = arr[i] + arr[j];\n\n if (result === 0) return [arr[i], arr[j]];\n\n if (result > 0) {\n j = j - 1;\n } else {\n i = i + 1;\n }\n }\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) return [arr[left], arr[right]];\n else if (sum > 0) right--;\n else left++;\n }\n}", "function sumZero(arr) {\n let left = 0\n let right = arr.length - 1\n while(left < right) {\n let sum = arr[left] + arr[right]\n if(sum === 0) {\n return [arr[left], arr[right]]\n } else if(sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function naiveSumZero(arr){ // O(n^2)\r\n for(let i = 0; i < arr.length; i++){ // O(n)\r\n for(let j = i + 1; j < arr.length; j++){ // nested O(n)\r\n if(arr[i] + arr[j] === 0){\r\n return [arr[i], arr[j]];\r\n }\r\n }\r\n }\r\n}", "function sumZero(arr) {\n for (let i = 0; i < arr.length; i++) {\n const leftNum = Math.abs(arr[i]);\n const rightNum = Math.abs(arr[arr.length - 1 - i]);\n\n if (leftNum - rightNum === 0) {\n const arrPair = [leftNum, rightNum];\n return arrPair\n }\n }\n}", "function sumZero(arr){\n let i = 0\n let j = arr.length - 1\n while (i < j){ // it has to be < instead of <= to exclude the possibility of 0 + 0 = 0 it would return an array of 1 int\n if (arr[i] + arr[j] === 0)\n return [arr[i], arr[j]]\n else if (arr[i] < arr[j])\n j--\n else\n i++\n }\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n if (arr[left] + arr[right] === 0) {\n return [arr[left], arr[right]];\n } else if (arr[left] + arr[right] > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumZero(arr) {\n console.log(\">>\")\n if (!(arr.some(v => v < 0) || arr.some(v => v > 0))) return undefined\n\n let l = 0;\n let r = arr.length - 1;\n let results;\n\n while(!!Math.sign(arr[l])) {\n if (arr[r] + arr[l] === 0) results = [arr[r], arr[l]]\n \n if (arr[r - 1] < 0) {\n r = arr.length - 1\n l = l + 1\n } else {\n r--;\n }\n }\n\n return results;\n }", "function sumZero(arr) {\n if (arr.length < 2) {\n return [];\n }\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n }\n\n if (sum > 0) {\n right--;\n }\n\n if (sum < 0) {\n left++;\n }\n }\n\n return [];\n}", "function sumZero2(arr) {\n let left = 0\n let right = arr.length - 1\n while (left < right) {\n let sum = arr[left] + arr[right]\n if (sum === 0) {\n return [arr[left], arr[right]]\n } else if (sum > 0) {\n right--\n } else {\n left++\n }\n }\n}", "function sumZero(arr) {\n if(!arr || !arr.length) return 'please provide a sorted array '\n let left = 0;\n let right = arr.length - 1;\n while(left < right) {\n let sum = arr[left] + arr[right];\n if(sum === 0) {\n return [arr[left], arr[right]];\n } else if(sum > 0) {\n right --;\n } else {\n left ++;\n }\n }\n}", "function sumZero(arr) {\n let left = 0,\n right = arr.length - 1;\n \n while(left < right){\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumZero(arr) {\n // define the pointers:\n let left = 0; let right = arr.length-1; \n let valuesThatSum = []; \n \n // set up the while loop, which runs until left and right pointer meet:\n while(left < right) {\n let sum = arr[left] + arr[right]; // on each iteratation, check current pointer value totals.\n \n // check if the current indexes sum up to 0, return if it is.\n if(sum===0) {\n return [arr[left], arr[right]]; \n // If they add to more than 0, our right pointer value is too high, move it down an index:\n } else if(sum > 0) {\n right--; \n // If they add up to a negative number, our right pointer value is too high, move the pointer up an index:\n } else {\n left++; \n }\n }\n }", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n while (arr[left] < arr[right]) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumOfZero(arr){\n let left = 0; \n let right = arr.length - 1;\n\n while(left < right){\n let sum = arr[left] + arr[right];\n if(sum === 0){\n return [arr[left], arr[right]];\n }else if(sum < 0){\n left++;\n }else{\n right--;\n }\n }\n}", "function sumZero(arr) {\n\n let left = 0;\n let right = arr.length - 1;\n\n while (left < right) {\n let sum = arr[left] + arr[right];\n\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum < 0) {\n left++;\n } else {\n right--;\n }\n }\n\n}", "function sumZeroPar(arr) {\n\tlet left = 0;\n\tlet right = arr.length - 1;\n\t// Iterate trough the sorted array from the left\n\t// If sum = arr[left] + arr[right] === 0 -> return pair\n\t// If sum > 0 , right--\n\twhile (left < right) {\n\t\tlet sum = arr[left] + arr[right];\n\n\t\tif (sum === 0) {\n\t\t\treturn [arr[left], arr[right]];\n\t\t}\n\n\t\t// the number is below if there is one\n\t\tif (sum > 0) {\n\t\t\tright--;\n\t\t}\n\t\t// the number on right is less so there isnt match for the left one\n\t\tif (sum < 0) {\n\t\t\tleft++;\n\t\t}\n\t}\n}", "function sumZero(arr) {\n let left = 0;\n let right = arr.length - 1;\n\n // Loop as long as right pointer is greater than left pointer\n while (left < right) {\n let sum = arr[left] + arr[right];\n\n // Increment left pointer if less than 0\n // Decrement right pointer if greater than 0\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function sumCloseToZero(arr) {\n let element = [];\n let sum = arr[0] + arr[1];\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === 0) {\n element[0] = arr[i];\n element[1] = arr[j];\n return element;\n } else if (abs(sum) > abs(arr[i] + arr[j])) {\n sum = arr[i] + arr[j];\n element[0] = arr[i];\n element[1] = arr[j];\n }\n }\n }\n return element;\n}", "function sumZero(arr){\n\n //We define position of variables\n let left = 0;\n let right = arr.length -1;\n while(left<right){\n //We are declaring the sum of two arrays\n let sum = arr[left] + arr[right];\n //if the sum is equal to zero then we return a pair of values\n if(sum===0){\n return [arr[left], arr[right]];\n }\n //if sum is greater than zero, then the array of pointers from right side will reduce by 1\n else if (sum>0){\n right--;\n }\n else{\n //if the above condition fails, here it array of pointers from left side will increament\n left++;\n }\n }\n}", "function zeroSum(arr) {\n // start with assigning two pointers. One at the beginning of the array and one at the end\n let left = 0;\n let right = arr.length - 1\n // then loop through the array\n while (left < right) {\n // condition is when the left side is smaller than the right side do something...\n let sum = arr[left] + arr[right]\n // if the sum of the left plus the right === 0 return [arr[left], arr[right]]\n if (sum === 0) {\n return [arr[left], arr[right]]\n // else if sum > 0 then right--\n } else if (sum > 0) {\n right--;\n // else left++\n } else {\n left++;\n }\n }\n // return undefined if no numbers add up to 0\n}", "function newSumZero(arr) {\n\t// left = beginning of the array\n\tlet left = 0;\n\t// right = end of array, remember it's zero indexed\n\tlet right = arr.length - 1;\n\t// left < right is our fail safe \n\twhile (left < right) {\n\t\tlet sum = arr[left] + arr[right];\n\t\tif (sum === 0) {\n\t\t\treturn [arr[left], arr[right]];\n\t\t} else if (sum > 0) {\n\t\t\tright--;\n\t\t} else {\n\t\t\tleft++;\n\t\t}\n\t}\t\n}", "function sumPair(array) {\n let left = 0;\n let right = array.length - 1;\n\n while (left < right) {\n sum = array[left] + array[right];\n if (sum === 0) {\n return [array[left], array[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n } //if sum < 0\n }\n}", "function positiveSum(arr){\nreturn arr\n .filter(positivenumbers => positivenumbers > 0)\n .reduce((a,b) => a + b, 0);\n}", "function positiveSum(arr) {\r\n return arr.filter( x => {\r\n if(x >= 0) return x;\r\n }).reduce( (a, b) => {\r\n return a + b;\r\n }, 0);\r\n}", "function sumToZero2(arr) {\n // create variable left to store the first index of array (0)\n let left = 0;\n \n // create variable right to store the last index of array (length -1)\n let right = arr.length - 1;\n\n // create a while loop, with condition as long as the left index is lower than the right index\n while(left < right) {\n // sum the value in left index with the right one\n let sum = arr[left] + arr[right];\n \n // if the sum is zero, return both value\n if (sum === 0) {\n return [arr[left], arr[right]];\n } \n \n // if sum is higher than zero, decrement the right index, to move it to left side\n else if (sum > 0) {\n right--;\n } \n \n // if sum is lower than zero, increment the left to move the index to the right\n else {\n left++;\n }\n }\n\n}", "function twoSum(array) {\n let returnArray = [];\n\n for (let i = 0; i < (array.length - 1); i++) {\n for (let j = i + 1; j < array.length; j++) {\n if (array[i] + array[j] === 0) {\n returnArray.push([i, j]);\n }\n }\n }\n\n return returnArray;\n}", "function sum2(a) {\n var tmparray = [];\n a.every(x => {\n if (x >= 0)\n tmparray.push(x)\n return x > 0;\n });\n\n return tmparray.reduce((acc, x) => acc + x, 0);\n}", "function positiveSum(arr) {\n\treturn arr.filter(value=>value>0).reduce((a,b)=>a+b)\n}", "function getZeroSums(items)\n{\n\tlet graphs = []\t// each index will be graph X and each value will be sum at given index for graph X (see above)\n\tlet zeroSums = []\t// array holding all sub arrays with 0 graphs\n\n\titems.forEach( (item, ind) =>\n\t{\n\t\tgraphs.push(item)\n\n\t\t/*\n\t\t\tBy default, a value of 0 is a zero sum.\n\t\t*/\n\t\tif (item === 0)\tzeroSums.push(0)\n\n\t\t/*\n\t\t\tIncreases sum for each graph except the last one.\n\t\t*/\n\t\tfor (let jnd = 0; jnd < graphs.length - 1; jnd++)\n\t\t{\n\t\t\tgraphs[jnd] += item\n\n\t\t\t/*\n\t\t\t\tIf after adding the current element to the graph sum we get a 0, then we found a zero sum sub array from -\n\t\t\t\t[graph X, currentInd]\n\t\t\t*/\n\t\t\tif (graphs[jnd] === 0)\tzeroSums.push(items.slice(jnd, ind + 1))\n\t\t}\n\t})\n\n\treturn zeroSums\n}", "function positiveSum(arr) {\n\treturn arr.filter(val => val > 0).reduce((acc, cur) => acc + cur, 0);\n}", "function positiveSum(arr) {\n let sum = 0\n arr.map( num => num > 0 ? sum += num : null)\n return sum\n }", "function sumsum(a) {\n var sum = 0;\n for (var i = 0; i < a.length; i++) {\n\n if (a[i] > 0) {\n sum = sum + a[i];\n }\n\n } return sum;\n\n}", "function positiveSum(arr) {\n sum = 0\n for (i = 0; i < arr.length; i++) {\n arr[i] > 0 ? (sum = sum + arr[i]) : null\n }\n return sum\n}", "function zeroSum (numbers) {\n\tvar checker = false;\n\tfor (var i = 0; i < numbers.length; i++){\n\t\tfor (var j = 1; j < numbers.length; j++){\n\t\t\tif (numbers[i] + numbers[j] === 0){\n\t\t\t\tchecker = true;\n\t\t\t}\n\t\t}\n\t}\n\treturn checker;\n}", "function houseNumbersSum(inputArray) {\n return (inputArray[0] === 0) ? 0 : inputArray.slice(0, inputArray.indexOf(0)).reduce((a,b) => a + b);\n}", "function zeroSum(numbers) {\r\n\tvar check = numbers[0];\r\n\r\n\tfor (var i = 1; i < numbers.length; i++) {\r\n\t\tif (check + numbers[i] === 0) {\r\n\t\t\treturn true\r\n\t\t}\r\n\t}\r\n\tif (numbers.length === 0) {\r\n\t\treturn false;\r\n\t}\r\n\t\t\r\n\treturn zeroSum(numbers.slice(1))\r\n}", "function positiveSum2(arr) {\n let total = 0;\n\n for (nb of arr) {\n if (nb > 0) {\n total += nb;\n }\n }\n\n return total;\n}", "function positiveSum(arr) {\n\t// // filter the arr for positive numbers\n\t// const positive = arr.filter((element) => element > 0)\n\t// // sum up positive array and return it\n\t// return positive.reduce((prev, next) => prev + next, 0);\n\treturn arr.filter((ele) => ele > 0).reduce((prev, next) => prev + next, 0);\n}", "function positiveSum(arr) {\n var summation = 0;\n for(i=0; i<arr.length; i++){\n if(arr[i] > 0){\n summation += arr[i];\n }\n }\n return summation; \n}", "function findZeroSumHash(arr) {\n const triplets = [],\n len = arr.length,\n found = new Set(),\n duplicateVals = new Set()\n\n for (let i = 0; i < len; i++) {\n const seen = new Set(),\n first = arr[i]\n if (duplicateVals.has(first)) continue\n\n duplicateVals.add(first)\n for (let j = i + 1; j < len; j++) {\n const second = arr[j],\n third = -first - second\n\n if (seen.has(third)) {\n const min = Math.min(first, second, third),\n max = Math.max(first, second, third),\n stringPair = `${min},${max}`\n\n if (!found.has(stringPair)) {\n found.add(stringPair)\n triplets.push([first, second, third].join(','))\n }\n }\n\n seen.add(second)\n }\n }\n return triplets\n}", "function positiveSum(arr) {\n return arr.reduce((r, a) => (a > 0 ? r + a : r), 0);\n}", "function reduceZeros(arr) {\n let zeroCount = 0;\n let newArr = [];\n function inner(arr) {\n if(arr.length === 0) {\n return;\n } else {\n var firstEl = arr.splice(0,1)[0];\n if(firstEl === 0 && zeroCount === 0 ) {\n newArr.push(firstEl);\n zeroCount++;\n } else if (firstEl !== 0) {\n newArr.push(firstEl);\n }\n inner(arr);\n }\n }\n inner(arr);\n return newArr;\n}", "function sumPositiveNumbers(array) {\n // let sum = 0;\n // for (let element of array) {\n // if (element > 0) {\n // sum += element;\n // }\n // }\n // return sum;\nreturn array.filter((item)=>item>0).reduce((accumulator, currentValue)=>accumulator+currentValue,0);\n}", "function positiveSum(arr) {\n return arr.reduce((a, b) => a + (b > 0 ? b : 0), 0)\n}", "function pairSum(arr, sum){\n for (let i = 0; i < arr.length - 1; i++){\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] + arr[j] === sum) {\n return [arr[i], arr[j]];\n }\n }\n }\n return \"No valid pair exists\";\n}", "function positiveSum(arr) {\n\tlet sum = 0;\n\n\tarr.forEach(n => {\n\t\tif (n > 0) sum += n;\n\t});\n\n\treturn sum;\n}", "function positiveSum(arr) {\n var total = 0; \n for (i = 0; i < arr.length; i++) { \n if (arr[i] > 0) { \n total += arr[i]; \n }\n }\n return total; \n }", "function positiveSum(test) {\r\n let sum =0;\r\n if(test == []){\r\n return 0;\r\n }else{\r\n for(let i =0; i < test.length; i++){\r\n \r\n if(test[i] > 0){\r\n sum += test[i];\r\n \r\n }\r\n }\r\n }\r\n return sum;\r\n }", "function positiveSum(arr) {\ntotal = 0;\n for (i = 0; i < arr.length; i++) {\n if(arr[i] > 0) {\n total += arr[i];\n}\n}\nreturn total;\n}", "function sum(arr) {\n if(!arr.length){\n return 0\n }\n console.log(arr[0], arr)\n if(arr[0] > 0){\n return arr[0] + sum(arr.slice(1));\n }\n return sum(arr.slice(1))\n}", "function positiveSum(arr) {\n let sum = 0;\n for (let i = 0; i < arr.length; i++) {\n if (arr[i] > 0) sum = sum + arr[i]; //this is the operation other way is suma1 += numbers[i]\n }\n return sum; // and you return the result\n}", "function positiveSum(arr) {\n let sum = 0;\n if (arr.length === 0) return 0;\n for (let num of arr) {\n if (num > 0) sum += num;\n else if (num < 0) sum;\n }\n return sum;\n}", "function noZeros(arr) {\n\n let zeroIndex = [] //Keeps track of where all the 0s are in each index\n\n for (i=0; i<arr[0].length; i++) {\n zeroIndex.push(1)\n } // We initiate zeroIndex to be all 1s, but mutate the 1s into 0s whenever we catch a 0 at the same index inside an array\n\n return arr.map((arr2) => {\n //Check if the array has a zero.\n let zeroIt = false\n\n for (i=0;i<arr2.length;i++) {\n if (arr2[i] === 0) {\n zeroIndex[i] = 0\n zeroIt = true\n }\n }\n\n //if zeroIt is true// if it has a zero\n if (zeroIt === true) {\n //Make the entire array 0\n let zeroArr = []\n for(i=0;i<arr.length;i++) {\n zeroArr.push(0)\n }\n return zeroArr //Slice horizontally\n } else {\n //return the array with the zeros sliced vertically.\n return zeroIndex //Slice Vertically\n //We are assuming that there is only 2 possibilities: all 0s in an array, or an array where all 1s are in the same spot.\n }\n })\n}", "function sumZero(n) {\n const output = [];\n \n if (n % 2 === 1) {\n output.push(0);\n }\n \n for (let i = 1; i <= Math.floor(n / 2); i++) {\n output.push(i, i * -1);\n }\n \n return output\n}", "function findPair(array,sum){\n let first = 0; //value at zero Index\n let last = array.length-1;\n\n while(first <= last){\n\n if(array[first] + array[last] == sum){\n return [array[first],array[last]]\n }\n\n if(array[first] + array[last] < sum){\n\n first++;\n\n }\n\n if(array[first] + array[last] > sum){\n last--;\n }\n\n }\n\n return -1;\n\n}", "function sumPositive(array) {\n let array2 = [];\n for(val of array) {\n if(val > 0) {\n array2.push(val);\n }\n }\n return array2;\n}", "function sum_ingnorantissima(a) {\n var trovato = false;\n var array = a.map(\n function(x) {\n if (x < 0) \n trovato = true;\n if (!trovato)\n return x;\n return 0;\n });\n \n return array.reduce(\n function (acc, x) {\n return acc + x;\n });\n}", "function countPositivesSumNegatives(arr) {\n let count = 0;\n let sum = 0;\n if (arr == null || arr.length == 0 ) return [];\n for (let i = 0; i < arr.length; i++){\n if (arr[i] > 0) count++;\n else if (arr[i] < 0) sum += arr[i];\n }\n return [count, sum];\n}", "function twoSum(arr, S){\n var sums=[];\n for (var i=0; i<arr.length; i++){\n for(var j=i+1; j<arr.length; j++){\n if(arr[i]+arr[j]===S){\n sums.push([arr[i],arr[j]]);\n }\n }\n }\n return sums[0];\n\n}", "function sumArray(array){\n\tvar tmparray = [];\n\ta.every(function(x){\n\t\tif (x>0){\n\t\t\ttmparray[tmparray.length]=x;\n\t\t}\n\t\treturn x>0;\n\t});\n\t\n\treturn tmparray.reduce(\n\t\tfunction(acc,x){ \n\t\t\treturn acc + x;\n\t})\n}", "function sumPositive(array){\n var sum = 0;\n for(i=0; i < array.length; i ++){\n if (array[i] > 0) {\n sum = sum + array[i] \n }\n }\n return sum\n}", "function sumwhileneg(myarray) {\n var tot = 0;\n for(i = 0; i < myarray.length; ++i) {\n var x = myarray[i];\n if (x > 0) {\n tot += x;\n } else {\n return tot;\n }\n }\n return tot;\n}", "function sumZeroo(arr) {\n let left = 0;\n let right = arr.length - 1;\n while (left < right) {\n let sum = arr[left] + arr[right];\n if (sum === 0) {\n return [arr[left], arr[right]];\n } else if (sum > 0) {\n right--;\n } else {\n left++;\n }\n }\n}", "function arraySearch(arr){\n let result = []\n for (let i=0; i<arr.length; i++){\n let aux = []\n if (arr[i].includes(0)){\n arr[i].forEach(item => {\n aux.push(0)\n })\n }else{\n for (let j=0; j<arr[i].length; j++){\n let res = 1;\n for (let k=0; k<arr.length; k++){\n if (arr[k][j] === 0){\n res = 0\n break;\n }\n }\n aux.push(res)\n }\n }\n result.push(aux)\n }\n return result;\n}", "function countPositivesSumNegatives(input) {\r\n\tif (!input || input.length < 1) return [];\r\n\treturn [input.filter(val => val > 0).length, input.filter(val => val < 0).reduce((acc, cur) => acc + cur, 0)];\r\n}", "function zeroSum3(numbers) {\n let zero = false; // variable to keep track if we found a sum that equals 0\n\n // 3 for loops to iterate though every combination of 3 numbers\n for (let i = 0; i < numbers.length; i++) {\n for (let k = (i + 1); k < numbers.length; k++) {\n for (let j = (k + 1); j < numbers.length; j++) {\n // if sum equals 0, set zero to true\n if (numbers[i] + numbers[k] + numbers[j] === 0) zero = true;\n }\n }\n }\n return zero; // return zero (boolean)\n}", "function search_triplets(arr) {\n\t// TODO: Write your code here\n\t// given unsorted array, find all triplets that add up to zero, return array with all triplets that sum up to zero\n\t// sort the array first\n\t// start from both ends of the array\n\t//\n\ttriplets = [];\n\n\tlet sumTarget = 0;\n\n\tif (arr.length < 3) {\n\t\treturn triplets;\n\t}\n\n\tarr.sort((a, b) => a - b);\n\tfor (let i = 0; i < arr.length - 2; i++) {\n\t\tif (arr[i] === arr[i - 1]) continue;\n\t\tif (arr[i] > sumTarget) {\n\t\t\t//if the first target is already greater than zero and since it's increasing, there's no way to add up to zero\n\t\t\treturn triplets;\n\t\t}\n\t\tlet leftPointer = i + 1;\n\t\tlet rightPointer = arr.length - 1;\n\n\t\twhile (leftPointer < rightPointer) {\n\t\t\tif (arr[leftPointer] + arr[rightPointer] + arr[i] === sumTarget) {\n\t\t\t\ttriplets.push([ arr[leftPointer], arr[rightPointer], arr[i] ]);\n\t\t\t\twhile (arr[leftPointer] === arr[leftPointer + 1]) leftPointer++;\n\t\t\t\twhile (arr[rightPointer] === arr[rightPointer - 1]) rightPointer--;\n\t\t\t\tleftPointer++;\n\t\t\t\trightPointer--;\n\t\t\t} else if (arr[leftPointer] + arr[rightPointer] + arr[i] < sumTarget) {\n\t\t\t\tleftPointer++;\n\t\t\t} else {\n\t\t\t\trightPointer--;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn triplets;\n}", "function posSum(array){\n\tif (array.length===0){\n\t\treturn 0\n\t}else {\n\t\tif(array[0] <0) {\n\t\treturn 0 +posSum(array.splice(1))\n\t}\n\treturn array[0]+posSum(array.splice(1))\n}\n}", "function ex_1_I(a) {\n var tot = 0;\n for(i = 0; i < a.length; ++i) {\n var x = a[i];\n if (x > 0) {\n tot += x;\n } else {\n return tot;\n }\n }\n return tot;\n}", "function sumPositive(array) {\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n var element = array[i];\n if (element > 0) {\n sum += element;\n }\n }\n return sum;\n}", "function FindTriplet()\n{\n for(let i=0;i<num-2;i++)\n {\n for(let j=i+1;j<num-1;j++)\n {\n for(let k=j+1;k<num;k++)\n {\n if(valueArray[i]+valueArray[j]+valueArray[k]==0)\n {\n //create the temp array and store the value in the array\n let tempArray=new Array();\n tempArray.push(valueArray[i],valueArray[j],valueArray[k])\n //push the stored temp array in the sum array to get separate array\n sumArray.push(tempArray);\n }\n }\n }\n }\n}", "function sumPositive(array){\n var sum = 0;\n for (var i = 0; i < array.length; i++) {\n if (array[i] >= 0) {\n sum += array[i];\n }\n }\n return sum;\n}", "function sum(nums) {\n if (!nums.length) {\n return 0;\n }\n\n if (nums.every(x => x === 0)) {\n return 0;\n }\n\n return nums.reduce((x, y) => x + y);\n}", "function solution(A) { \n var len = A.length,\n arr = [],\n value, i;\n \n for(i = 0; i < len; i++){\n value = A[i];\n if(value > 0){\n arr[value] = true;\n }\n }\n for(i = 1; i < arr.length; i++){\n if(typeof arr[i] === \"undefined\"){\n return i;\n }\n }\n return i;\n}", "function sumOfPositiveNumbers(array) {\n var sum = 0\n for (var i = 0; i < array.length; i++) {\n var element = array[i];\n if (element > 0) {\n sum += element\n }\n }\n return sum\n}", "function countP(arr) {\n var sum = 0;\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] > 0) {\n sum++;\n }\n }\n\n arr[arr.length - 1] = sum;\n\n return arr;\n}", "function removeZeros(arr) {\n return arr.filter((x) => x);\n}", "function sum_pairs(array, value) {\n for (let idxOne = 1; idxOne < array.length; idxOne++) {\n for (let idxTwo = 0; idxTwo < idxOne; idxTwo++) {\n if (array[idxOne] + array[idxTwo] === value) {\n return [array[idxTwo], array[idxOne]];\n }\n }\n }\n}" ]
[ "0.8179308", "0.8163827", "0.8161207", "0.81458807", "0.81294066", "0.81243056", "0.81243056", "0.81155276", "0.8112726", "0.8095359", "0.80748636", "0.80298185", "0.80258054", "0.7775838", "0.7745942", "0.7664678", "0.7644619", "0.7640978", "0.761199", "0.7609138", "0.7585885", "0.75648654", "0.75492316", "0.7519488", "0.7491007", "0.7490932", "0.74786", "0.74771905", "0.74764895", "0.7463823", "0.7426722", "0.7415009", "0.7390857", "0.7314592", "0.7301393", "0.7290511", "0.7273485", "0.72698003", "0.72669786", "0.72145456", "0.71961987", "0.70967174", "0.7026862", "0.66947323", "0.66614175", "0.66515046", "0.66311395", "0.6630954", "0.65756625", "0.6569221", "0.6545784", "0.6545557", "0.6463684", "0.6403126", "0.6401582", "0.63745195", "0.6358149", "0.63504", "0.6322943", "0.63096505", "0.6296619", "0.62660843", "0.62428355", "0.6230969", "0.6229572", "0.6175125", "0.61614037", "0.6133789", "0.61155695", "0.60796565", "0.60525453", "0.60448223", "0.6037423", "0.6037193", "0.6028286", "0.60109466", "0.5997321", "0.5975188", "0.5965767", "0.59458166", "0.5939394", "0.5935793", "0.5921593", "0.5908686", "0.5859787", "0.5856797", "0.584277", "0.5830616", "0.5827416", "0.5825654", "0.5823567", "0.5821111", "0.5820818", "0.58162034", "0.57971954", "0.5795396", "0.5791263", "0.5785754", "0.5772762", "0.5772351" ]
0.8058502
11
global $, jQuery, QRCode, alert, console / todo ===================================================================== disable add button while waiting for ajax request so that user doesn't send too many ajax requests
function addRowToTable(action, name, instructions) { 'use strict'; var htmlName, newElement, pictureElement, medicineName, row; htmlName = JSON.stringify("medicine_" + name); console.log(name, instructions); if (action === "insert") { newElement = $("<tr name=" + htmlName + ">").append( $('<td/>').text(name), $('<td/>').text(instructions) ); $('table tbody').append(newElement); console.log("APPENDED"); pictureElement = $( "<iframe id='picture' scrolling='no'/>", {'class': "images"} ); pictureElement.attr( 'src', 'picture.php?' + $.param({'medicineName': name}) ); newElement.children('td').eq(0).append(pictureElement); pictureElement.ready(function () { pictureElement.height(pictureElement.width()); }); } else if (action === "update") { row = 'table tbody tr[name=' + htmlName + '] td:nth-child(2)'; $(row).html(instructions); } else if (action === "remove") { row = 'table tbody tr[name=' + htmlName + ']'; console.log(row); $(row).remove(); } else { console.error(action); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function add_license_keys(product_id) {\n var license_keys = $('#textarea_license_keys').val();\n if (license_keys.trim() != \"\") {\n $(\".btn-add-license-keys\").prop('disabled', true);\n $(\".loader-license-keys\").show();\n var data = {\n 'product_id': product_id,\n 'license_keys': license_keys,\n 'allow_dublicate': $(\"input[name='allow_dublicate_license_keys']:checked\").val(),\n 'sys_lang_id': sys_lang_id\n };\n data[csfr_token_name] = $.cookie(csfr_cookie_name);\n $.ajax({\n type: \"POST\",\n url: base_url + \"dashboard_controller/add_license_keys\",\n data: data,\n success: function (response) {\n var obj = JSON.parse(response);\n if (obj.result == 1) {\n document.getElementById(\"result-add-license-keys\").innerHTML = obj.success_message;\n $('#textarea_license_keys').val('');\n setTimeout(function () {\n $(\".btn-add-license-keys\").prop('disabled', false);\n $(\".loader-license-keys\").hide();\n }, 500);\n }\n }\n });\n }\n}", "function enableDisableFields($)\n{\n let url = window.location.origin + '/cabinet/social-queue/create-get-fields';\n let csrf = $('meta[name=csrf-token]').attr(\"content\");\n let type_id = $('#socialqueueform-type_id').val();\n $.ajax({\n url: url,\n type: 'POST',\n data: {\n type_id: type_id,\n _csrf : csrf\n },\n success: function (data) {\n if (data.code == 200) {\n let inputs = data.inputs;\n price = data.price;\n disableHideFields();\n $.each(inputs,\n function (item, index) {\n $('#div_' + index).css('display', 'block');\n });\n $('.required-label').css('display', 'block');\n $('.required-fields').css('display', 'block');\n $('.non-required-fields').css('display', 'block');\n $('.non-required-label').css('display', 'block');\n if (inputs.length === 1) {\n $('.non-required-fields').css('display', 'none');\n $('.non-required-label').css('display', 'none');\n } else {\n\n }\n $('#div_balance').css('display', 'block');\n\n is_answer = inputs.includes('answer');\n $('#div_price').css('display', 'block');\n calculatePrice($);\n }\n }\n });\n}", "function handleRequestError() {\n qs(\"main\").classList.add(\"hidden\");\n qs(\"footer\").classList.add(\"hidden\");\n let buttons = qsa(\"button\");\n for (let i = 0; i < buttons.length; i++) {\n buttons[i].disabled = true;\n }\n id(\"error-msg\").classList.remove(\"hidden\");\n }", "function addTasks(taskId) {\n if (!ready)\n return;\n\n ready = false; //Set the flag here\n $.ajax({\n url: '/Tasks/GetNextTasks',\n datatype: \"json\",\n type: \"post\",\n contenttype: 'application/json; charset=utf-8',\n async: true,\n success: function (data) {\n if (data.indexOf(\"Нет данных для отображения\") !== -1)\n return;\n $(\"#taskList\").append(data);\n\n if (taskId == undefined)\n return;\n\n var task = $(\"#\" + taskId);\n if (!task.length) {\n ready = true;\n addTasks(taskId);\n return;\n }\n\n scrollToElement(\"#\" + taskId);\n var win = $(window);\n if (win.width() <= minWidth) {\n selectTask(task);\n }\n else {\n processTaskClick(task);\n }\n },\n error: function (xhr) {\n alert('error' + xhr);\n },\n complete: function () {\n $(\"#progress\").hide();\n ready = true; //Reset the flag here\n },\n });\n}", "function set_buttons() {\n if ($('#next_period_btn').get().length == 1) {\n $.ajax({\n data: { \n query: 'last_clicked'\n },\n success: function(data, textStatus) {\n var btns = {\n start: 'next_period_btn',\n step1: 'step1_btn',\n step2: 'step2_btn',\n ship: 'ship_btn',\n step3: 'step3_btn',\n order: 'order_btn'\n };\n var last_clicked = data['last_clicked'];\n var start_index = 0;\n if (last_clicked == 'none') {\n for (var btn in btns) {\n $('#'+btns[btn]).attr('disabled',true);\n }\n wait_for_teams();\n }\n else if (last_clicked in btns) {\n var disable = true;\n for (var btn in btns) {\n $('#'+btns[btn]).attr('disabled',disable);\n if (!disable) { disable = true; }\n if (btn == last_clicked) { disable = false; }\n }\n if (!$('#ship_btn').attr('disabled')) {\n $('#ship_btn').attr('disabled',true); \n $('#ship_btn').val('waiting...'); \n\n set_shipment_recommendation();\n\n listen_for_can_ship();\n }\n else if (!$('#order_btn').attr('disabled')) {\n $('#order_btn').attr('disabled', true); \n $('#order_btn').val('waiting...'); \n \n listen_for_can_order();\n }\n }\n else {\n log_error('last clicked returned an invalid button: '+last_clicked);\n }\n }\n });\n }\n}", "function enablePHRCreationAndSharing(element) {\r\n\tvar primaryEmailObj = $(element+':primaryEmailId');\r\n\t\r\n\tif (primaryEmailObj!=null && primaryEmailObj.value!='' && validateEmail(primaryEmailObj.value)!=-1) {\r\n\t\tvar myAjax = new Ajax.Request(\r\n\t\t 'enablePHRCreationAndSharing.ajaxcchit',\r\n\t\t {\r\n\t\t \tmethod: 'get',\r\n\t\t \tparameters: 'element='+element+'&email='+primaryEmailObj.value,\r\n\t\t\t\tonComplete: function(req) {\t\r\n\t\t\t\t\tif (req.responseText==\"\") {\r\n\t\t\t\t\t\t$('createPHRContainer').style.display='block';\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t$('createPHRContainer').style.display='none';\t\t\t\t\t\r\n\t\t\t\t\t\t$(element+':createPHR').checked=false;\r\n\t\t\t\t\t\t$(element+':pinNumber').disabled=true;\r\n\t\t\t\t\t\t$('pinContainer').style.display='none';\r\n\t\t\t\t\t\t$('shareDataContainer').style.display='block';\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\tshowHidePIN(element);\r\n\t\t\t\t\tshowHideShareOption(element);\r\n\t\t\t\t}\r\n\t\t }\r\n\t\t);\r\n\t}\r\n\telse if ($(element+':createPHR') != null && $('createPHRContainer') != null) {\r\n\t\t$(element+':createPHR').checked=false;\r\n\t\t$('createPHRContainer').style.display='none';\r\n\t\tshowHidePIN(element);\r\n\t\tshowHideShareOption(element);\r\n\t}\r\n}", "function showAjaxWaiting() {\n\t\t// show the loading img\n\t\t$(\"#loadingImg\").show();\n\n\t\t// disable the submit button and show loadingimg\n\t\t$(\"#submit-button\").bind(\"click\", function(event) {\n\t\t\tevent.preventDefault();\n\t\t});\n\n\t\t// hide the error message\n\t\t$(\"#error\").hide();\n\t\t$(\"#noMatch\").hide();\n\t}", "function enable() {\n $(document)\n .on('ajax:error', handleError)\n .on('ajax:success', handleSuccess);\n }", "onBeforeAjax() {\n return false;\n }", "function checkAvailBalanceCreditCards(this_){\n var accountID = $(this_).val();\n\n if(accountID!==\"\"){\n \n $.ajax({ \n type: \"post\",\n data: {'accountNumber':accountID},\n url: \"personal/creditcardaccount/utilaccount\",\n async : true,\n cache: false,\n success:function(response){\n \n var balance = response[\"currencyCode\"] +\" \"+ parseFloat(response[\"availableBalanceString\"], 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\n $(this_+\"-result\").html(\"<em>Available \"+ balance);\n $(this_+\"-hiddenCurrency\").val(response[\"currencyCode\"]);\n \n //CHECK ACCOUNT STATUS ON CHANGE\n if((response[\"black_listed\"] == true)){\n \n $(\"#accountBlackList\").removeClass(\"hide\");\n $(\"#fund-transfer-submit\").hide();\n }else{\n $(\"#accountBlackList\").addClass(\"hide\");\n $(\"#fund-transfer-submit\").show();\n }\n $(\"#currency\").val(response[\"currencyCode\"]);\n var valtoprint = $(\"#currency\").val();\n var valtoprint2 = $(\"#userAccountNumber2-hiddenCurrency\").val();\n $(\"#currency\").prop(\"disabled\", false);\n $(\"#currency-value\").val(response[\"currencyCode\"]);\n \n if(valtoprint == 'LKR'){\n $(\"#currency\").prop(\"disabled\", true);\n }\n\n }, error: function(){\n //alert('Error while request..');\n }\n });\n } else { $(this_+\"-result\").html(\"<em>...</em>\"); }\n}", "function initLoadMoreProjectsCardsBtn (){\n $('.js-more-procards').attr('disabled',false);\n $('.js-more-procards').on( 'click', function ( e ) {\n e.preventDefault();\n $('.js-more-procards').attr('disabled',true).html('<i class=\"spinner\"></i>');\n loadMoreProjectsCards();\n });\n}", "function handleAPILoaded() {\n $('#search-button').attr('disabled', false);\n}", "function handleAPILoaded() {\n $('#search-button').attr('disabled', false);\n}", "function remote_request_started(button_element, text) {\n var button_element = $(button_element);\n button_element.value = text;\n button_element.disable();\n}", "function rbtAjax() {\n\t\tvar rbtTheme = $('.rbt-toolbar').data(\"theme\");\n\t\tvar rbtFeatured = $('.rbt-toolbar').data(\"featured\");\n\t\tvar rbtButtonPosition = $('.rbt-toolbar').data(\"button-position\");\n\t\tvar rbtButtonHorizontal = $('.rbt-toolbar').data(\"button-horizontal\");\n\t\tvar rbtButtonAlt = $('.rbt-toolbar').data(\"button-alt\");\n\n\t\t$.ajax({\n\t\t\turl: 'https://toolbar.qodeinteractive.com/templates/profile.php',\n\t\t\t// url: 'http://masterds.localhost/wp-content/plugins/rabbit-toolbar/templates/profile.php', /* LOCAL */\n\t\t\ttype: \"GET\",\n\t\t\tdata: {\n\t\t\t\ttheme: rbtTheme,\n\t\t\t\tfeatured: rbtFeatured,\n\t\t\t\tbtnpos: rbtButtonPosition,\n\t\t\t\tbtnhorizontal: rbtButtonHorizontal,\n\t\t\t\tbtnalt: rbtButtonAlt\n\t\t\t},\n\t\t\tsuccess: function (data) {\n\t\t\t\t$('.rbt-toolbar').html(data);\n\t\t\t\trbtLazyLoad();\n\t\t\t\trbtListToggle();\n\t\t\t\trbtSmoothScrollCompatibility();\n\t\t\t\tshowList();\n\t\t\t\t// rbtLoadScript('https://toolbar.qodeinteractive.com/_toolbar/assets/js/mc-validate.js');\n\t\t\t}\n\t\t});\n\t}", "function checkContent(element) {\n\n var social_media_name = element.id.replace('_input_button', '');\n var social_media_name_ph = element.id.replace('_button', '');\n\n if ($(\"#\" + social_media_name_ph + \"_field\").val() !== \"https://www.\" + social_media_name + \".com/\" && $(\"#\" + social_media_name_ph + \"_field\").val().indexOf((\"https://www.\" + social_media_name + \".com/\")) > -1) {\n\n window.temp_url = $(\"#\" + social_media_name_ph + \"_field\").val();\n $(\"#\" + social_media_name + \"_long\").html(\"<i class='fa fa-\" + social_media_name + \"'></i>\" + $(\"#\" + social_media_name_ph + \"_field\").val());\n $(\"#\" + social_media_name + \"_long\").hide();\n $(\"#\" + social_media_name + \"_input\").hide();\n window.temp_soc_med_name = social_media_name;\n\n /*\n * Insert new url\n */\n\n $.ajax({\n url: 'https://proxy.uretimosb.com/SlimProxyBoot.php',\n// url: 'http://proxy.uretimosb.com:9990/SlimProxyBoot.php',\n data: {\n url: 'pkInsert_infoFirmSocialmedia',\n pk: $(\"#pk\").val(),\n npk: $(\"#selectedCompanyNpk\").val(),\n language_code: $(\"#langCode\").val(),\n sys_socialmedia_id: window.selected_soc_med_id,\n firm_link: window.temp_url,\n profile_public: 0\n },\n method: \"GET\",\n dataType: \"json\",\n success: function (data) {\n if (data['errorInfo'][0] === '00000') {\n\n var appending =\n \"<div class='btn-group' id='\"\n + social_media_name\n + \"_btn_group_\"\n + data.lastInsertId\n + \"' url_value='\"\n + window.temp_url\n + \"'>\"\n + \"<a id='\"\n + social_media_name\n + \"_button_\"\n + data.lastInsertId\n + \"' class='btn btn-social-icon dropdown-toggle btn-\"\n + social_media_name\n + \"' data-toggle='dropdown' aria-expanded='false' target='_newtab' \"\n + \" \"\n + \"style='margin-left:5px'>\"\n + \"<i class='fa fa-\"\n + social_media_name\n + \"'></i>\"\n + \"</a>\"\n + \"<button type='button' class='btn dropdown-toggle btn-\"\n + social_media_name\n + \"' data-toggle='dropdown' aria-expanded='false'>\"\n + \"<span class='caret'></span>\"\n + \"<span class='sr-only'>Toggle Dropdown</span>\"\n + \"</button>\"\n + \"<ul class='dropdown-menu' role='menu'>\"\n + \"<li class='btn' id='\"\n + social_media_name\n + \"_goto_btn_'\"\n + data.lastInsertId\n + \"' onclick='goto_social(this)'>\"\n + window.lang.translate('Goto')\n + \"</li><br/>\"\n// + \"<li class='btn' id='\"\n// + social_media_name\n// + \"_edit_btn' onclick='edit_social(this)'>\"\n// + window.lang.translate('Edit')\n// + \"</li><br/>\"\n + \"<li class='btn' id='\"\n + social_media_name\n + \"_remove_btn_'\"\n + data.lastInsertId\n + \"' soc_id_val='\"\n + data.lastInsertId\n + \"' onclick='remove_social(this)'>\"\n + window.lang.translate('Delete')\n + \"</li>\"\n + \"</ul>\"\n + \"</div>\";\n\n $('#ava_med_ph').append(appending);\n }\n }\n });\n\n\n } else {\n\n $(\"#\" + social_media_name + \"_long\").show();\n $(\"#\" + social_media_name + \"_input\").hide();\n var default_value = \"https://www.\" + social_media_name + \".com/\";\n $(\"#\" + social_media_name_ph + \"_field\").val(default_value);\n }\n}", "function addRequest() {\n // Get Data from Input field\n var data = document.getElementById(\"requestInput\").value;\n if (!$.trim(data)) {\n alert(\"You can not request nothing.\" + data);\n return;\n } else {\n console.log(\"Data = \" + data);\n }\n // If we add a request while filtering filled only\n // We switch back to all\n if (lastFilter == \"filled\") {\n lastFilter = \"all\";\n }\n // Perform Ajax Call \n // (Hint: request_data goes to php as post parameter)\n $.ajax({\n type: \"post\",\n data: {\n 'request_data': data\n },\n url: \"include/addRequest.php\",\n success: function (response) {\n console.log(\"Server says: \" + response);\n // default to open when adding a request:\n loadRequests(id = lastID, filter = lastFilter);\n }\n });\n // Element zurücksetzen\n document.getElementById(\"requestInput\").value = \"\";\n return;\n}", "function setUpAdd() {\n refreshId();\n $('input[name=_method]').val('post');\n $('h2.title').text('Add New Record Page');\n $('input[name=product]').val('');\n $('input[name=quantity]').val('');\n $('input[name=price]').val('');\n $('.add-record').hide();\n }", "function denyRegistrationListener()\n{\n //Click deny\n $(document).on('click', '.deny', (function(e) {\n spawnBusyMessage(\"Denying Request\");\n e.preventDefault();\n var tempThis = $(this);\n var tempChildren = $(this).parent().parent().parent().parent().parent().children().length;\n $.ajax({\n type: \"post\",\n data: {\"staffID\" : $(this).parent().siblings('.userCol').find('.userID').find('.actualID').text()},\n url: \"/denyRequest\"\n }).then(function(jsonReturned) {\n if(jsonReturned != \"Request denied\"){\n window.scrollTo(0, 0);\n $('.featherlight').click();\n spawnErrorMessage(\"Unable to Deny Request: \" + jsonReturned);\n } else {\n //location.reload();\n $('.featherlight').click();\n tempThis.parent().parent().parent().parent().remove();\n if(tempChildren - 1 == 0){\n $(\"#requests\").append(getWarningMessage(\"No pending registration requests\"));\n }\n }\n });\n }));\n}", "function regulateReRunButton(){\n\tif(outstandingGEERequests > 0){\n\t\t$('#reRun-button').prop('disabled',true);\n\t\t$('#reRun-button').prop('title',staticTemplates.reRunButtonDisabledTooltip);\n\t}\n\telse{\n\t\t$('#reRun-button').prop('disabled',false);\n\t\t$('#reRun-button').prop('title',staticTemplates.reRunButtonEnabledTooltip);\n\t}\n}", "function submitButtonEnable(){\n $(conformation_cb).on( 'click', function() {\n if ($(submit_request).attr('disabled') == 'disabled') {\n $(submit_request).removeAttr('disabled');\n } else {\n $(submit_request).attr('disabled','disabled')\n } \n });\n}", "function qll_module_ajax()\r\n{\r\n\r\n\taddJS('http://www.erepublik.com/js/jquery-1.3.2.min.js','head');\r\n\taddJS('http://www.erepublik.com/js/jquery.history.plugin.js','head');\r\n\taddJS('http://www.erepublik.com/js/exchange/filters.js','head');\r\n\taddJS('http://www.erepublik.com/js/exchange/historyList.js','head');\r\n\taddJS('http://www.erepublik.com/js/exchange/currency.js','head');\r\n\taddJS('http://www.erepublik.com/js/exchange/listOffers.js','head');\r\n\r\n\taddJS('http://economy.erepublik.com/js/uncompressed.jquery.dd.js','head');\r\n\taddJS('http://economy.erepublik.com/js/jquery.tools.min.js','head');\r\n\taddJS('http://economy.erepublik.com/js/ui.core.js','head');\r\n\taddJS('http://economy.erepublik.com/js/ui.slider.js','head');\r\n\taddJS('http://economy.erepublik.com/js/jquery.blockUI.js','head');\r\n\taddJS('http://economy.erepublik.com/js/Market/marketplace.js','head');\r\n\taddJS('http://economy.erepublik.com/js/numberChecks.js','head');\r\n\taddCSS('http://www.erepublik.com/css/cmp/marketplace.css','head');\r\n\r\n\t//$(\"#content a\").each(function(){\r\n\t$(\"a\").each(function(){\r\n\t\tif($(this).attr(\"href\") == \"#\")\r\n\t\t\treturn;\r\n\t\t$(this).click(function(event){\r\n\t\t\tevent.preventDefault()\r\n\t\t\tqll_module_ajax_perform($(this).attr(\"href\"))\r\n\t\t});\r\n\t\t\r\n\t});\r\n}", "function rawSubmitDigiByte(thisbtn) {\n\t\t\t\t\t\t\t\t$(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\t\t\t\t\t\t\t\ttxhex = $(\"#rawTransaction\").val().trim();\n\t\t\t\t\t\t\t\t$.ajax({\n\t\t\t\t\t\t\t\t\ttype: \"GET\",\n\t\t\t\t\t\t\t\t\turl: `https://`+ multiWalletApiDomain +`/digibyte/broadcast/${txhex}`,\n\t\t\t\t\t\t\t\t\tdata: $(\"#rawTransaction\").val(),\n\t\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\t\tif(data.responseText ===\"There was an error. Check your console.\") {\n\t\t\t\t\t\t\t\t\t\t\terrcode = data.responseText;\n\t\t\t\t\t\t\t\t\t\t\tvar r = ' Failed to Broadcast.'; // this wants a preceding space\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(r + \" \" + errcode).prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tvar txid = data.responseText;\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(` Txid: ${txid} <br> <a href=\"https://chainz.cryptoid.info/dgb/tx.dws?${txid}\" target=\"_BLANK\"> View on Block Explorer </a>`);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\t\t\tif(data) {\n\t\t\t\t\t\t\t\t\t\t\tvar txid = data; // is this right?\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(` Txid: ${txid} <br> <a href=\"https://chainz.cryptoid.info/dgb/tx.dws?${txid}\" target=\"_BLANK\"> View on Block Explorer </a>`);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcomplete: function (data, status) {\n\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n\t\t\t\t\t\t\t\t\t\t$(thisbtn).val('Submit').attr('disabled',false);\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/*\n\t\t\t\t\t\t\t\t$(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\t\t\t\t\t\t\t\t$.ajax ({\n\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\turl: \"https://digiexplorer.info/api/tx/send\", // fixme\n\t\t\t\t\t\t\t\tdata: JSON.stringify({ \"rawtx\": $(\"#rawTransaction\").val() }),\n\t\t\t\t\t\t\t\tdataType : \"json\",\n\t\t\t\t\t\t\t\tcontentType: \"application/json\",\n\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\tvar obj = data.responseText;\n\t\t\t\t\t\t\t\tvar r = ' ';\n\t\t\t\t\t\t\t\tr += (obj) ? ' '+obj : '';\n\t\t\t\t\t\t\t\tr = (r!='') ? r : ' Failed to broadcast'; // build response\n\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(r).prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\tif(data) {\n\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(' Txid: ' + data.txid);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\tcomplete: function(data, status) {\n\t\t\t\t$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n\t\t\t\t$(thisbtn).val('Submit').attr('disabled',false);\n\t\t\t}\n\t\t}); */\n\t}", "function actionAjaxStart(form,btn){\n btn.prop(\"disabled\", true);\n btn.html('Chargement... <i class=\"fa fa-spinner fa-pulse fa-3x fa-fw\"></i>')\n }", "function loading_search()\n{\n // animasi loading\n $(document).ajaxStart(function(){\n $(\"#search-button\").css(\"display\", \"none\");\n $(\"#search-input\").prop('disabled',true);\n $(\"#search-button-loader\").css(\"display\", \"block\");\n \n });\n \n $(document).ajaxComplete(function(){\n $(\"#search-button-loader\").css(\"display\", \"none\");\n $(\"#search-button\").css(\"display\", \"block\");\n $(\"#search-input\").prop('disabled',false);\n });\n}", "function Payment(e) {\n var amount = $(\"#Payment-Amount\").val();\n var id = $(\"#Payment-Id\").val();\n var date = $(\"#Payment-Date\").val();\n var remarks = $(\"#Payment-Remarks\").val();\n\n $(e).prop('disabled', true);\n\n $.post(\"/Payables/ApTransactions/AddPayment\", { id: id, amount: amount, date: date, remarks: remarks }, (res) => {\n if (res == \"OK\") {\n //reload page\n $(\"#overlay\").hide();\n window.location.reload(false);\n $(e).prop('disabled', false);\n }\n });\n}", "function reject(id) {\n // $('form[name='+id+']').submit();\n $.ajax({\n type: 'POST',\n url: 'orders/reject',\n data: {\"id\": id},\n beforeSend: function () {\n // this is where we append a loading image\n },\n success: function (data) {\n // successful request; do something with the data\n notif({\n msg: \"<b>Note:</b>\" + data['data'],\n position: \"center\",\n time: 10000\n });\n $('#view_orders').click();\n },\n error: function (data) {\n // failed request; give feedback to user\n notif({\n msg: \"<b>Oops:</b> שגיאה. נסה שוב מאוחר יותר..\",\n position: \"center\",\n time: 10000\n });\n $('#view_orders').click();\n }\n });\n}", "function mobile_incomplete_order_status_pageload() {\r\n // debugger;\r\n console.log('check incomplete order status');\r\n $.ajax({\r\n url: \"https://\" + instanceName + \".bigmachines.com/mobile/pending-configurations\",\r\n type: 'GET',\r\n data: \"bm_trail_refresh=true\",\r\n dataType: \"html\",\r\n success: function(respData) {\r\n // console.log(respData);\r\n //console.error(respData.indexOf('select-button'));\r\n // console.warn(respData.search('select-button'));\r\n if (respData.indexOf('select-button') === -1) {\r\n $('.jg-linkbtn.shoppingcart').parent().hide(800);\r\n } else {\r\n $('.jg-linkbtn.shoppingcart').parent().show();\r\n\r\n }\r\n },\r\n error: function() {\r\n console.log(\"Cannot get data tablet\");\r\n }\r\n })\r\n }", "function addButton() {\n $('#requestBtn').on('click', function (event) {\n var queryItem = $('#image-request').val().trim();\n if (queryItem == \"\") {\n return false;\n // added so user cannot add a blank button\n\n }\n //push request into array\n btnContainer.push(queryItem);\n console.log(btnContainer)\n\n renderBtn();\n return false;\n //} \n })\n }", "function addBook() {\n\t$(\"add_to_collection\").fade();\n\tif (!addingBook) {\n\t\taddingBook = true;\n\t\tnew Ajax.Request('../txscholar/web_services/add_book.php', {\n\t\t\t\tmethod : 'post', \n\t\t\t\tasynchronous : true, \n\t\t\t\tparameters : {\n\t\t\t\t\tid : userid, \n\t\t\t\t\tisbn13 : book.getIsbn13() \n\t\t\t\t}, \n\t\t\t\tonSuccess : function (ajax_one) {\n\t\t\t\t\tvar response = ajax_one.responseText;\n\t\t\t\t\tif (response == 1) { // Success\n\t\t\t\t\t\n\t\t\t\t\t\tbook.setHeader(\"Successfully added to your library!\");\n\t\t\t\t\t\t$(\"book_info\").innerHTML = book.createTable();\n\t\t\t\t\t\t$(\"book_info\").highlight();\n\t\t\t\t\t\t\n\t\t\t\t\t\tx = $$(\".condensed_user_book_table tbody\");\n\t\t\t\t\t\ttr = document.createElement(\"tr\");\n\t\t\t\t\t\tvar td_isbn = document.createElement(\"td\");\n\t\t\t\t\t\ttd_isbn.innerHTML = book.getIsbn13();\n\t\t\t\t\t\tvar td_title = document.createElement(\"td\");\n\t\t\t\t\t\ttd_title.innerHTML = book.getTitle();\n\t\t\t\t\t\tvar td_author = document.createElement(\"td\");\n\t\t\t\t\t\ttd_author.innerHTML = book.getAuthor();\n\t\t\t\t\t\tvar td_remove = document.createElement(\"td\");\n\t\t\t\t\t\ttr.appendChild(td_isbn);\n\t\t\t\t\t\ttr.appendChild(td_title);\n\t\t\t\t\t\ttr.appendChild(td_author);\n\t\t\t\t\t\ttr.appendChild(td_remove);\n\t\t\t\t\t\tx[0].appendChild(tr);\n\t\t\t\t\t\tBookExtension();\n\t\t\t\t\t\t\n\t\t\t\t\t} else if (response == 2) { // Failure\n\t\t\t\t\t\tbook.setHeader(\"This book is already in your library!\");\n\t\t\t\t\t\t$(\"book_info\").innerHTML = book.createTable();\n\t\t\t\t\t\t$(\"book_info\").highlight();\n\t\t\t\t\t}\n\t\t\t\t\taddingBook = false;\n\t\t\t\t}, \n\t\t\t\tonException : function () {\n\t\t\t\t\talert(\"Failed to add book!\");\n\t\t\t\t\taddingBook = false;\n\t\t\t\t}, \n\t\t\t\tonFailure : function () {\n\t\t\t\t\talert(\"Failed to add book!\");\n\t\t\t\t\taddingBook = false;\n\t\t\t\t}\n\t\t\t});\n\t}\n}", "function bopAjax(){\n\tvar callBeingFired;\n\t//var showSpotBuy = $(\"#showSpotBuy\").val();\n\t// don't make the call if it's being fired, or if it has already been called\n\tif(callBeingFired != true && $('#bulkOrderModelAddToCart').doesExist() == false) {\n\t\tcallBeingFired = true;\n\t\tjQuery.ajax({\n\t\t\t//alert(\"foot\");\n\t\t\t//url: \"/BulkOrderComponentController?action=copyPasteText\",\n\t\t\turl: contextPath+\"/BulkOrderComponentController/bopAjax?ordercode=hey\",\n\t\t\tdataType: \"text\",\n\t\t\ttype: \"GET\",\n\t\t\tcache:false,\n\t\t\tsuccess: function (data) {\n\t\t\t\tif (data === null || data === \"\") {\n\t\t\t\t\tsetTimeout(function(){location.reload(true);},500);\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#bulk-order-content\").html(data).removeClass('loading');\n\t\t\t\t\tupdateBulkOrderPadCookie($(\"#countForBulkOrderPad\").val());\n\t\t\t\t\tcallBeingFired = false;\n\t\t\t\t}\n\t\t\t},\n\t\t\t error: function(error) {\n\t //do nothing\n\t\t }\n\t\t}\n\n\t\t);\n\t}\n}", "function acceptReqistrationListener()\n{\n //Click accept\n $(document).on('click', '.accept', (function(e) {\n spawnBusyMessage(\"Approving Request\");\n e.preventDefault();\n var tempThis = $(this);\n var tempChildren = $(this).parent().parent().parent().parent().parent().children().length;\n $.ajax({\n type: \"post\",\n data: {\"staffID\" : $(this).parent().siblings('.userCol').find('.userID').find('.actualID').text()},\n url: \"/approveRequest\"\n }).then(function(jsonReturned) {\n\n if(jsonReturned != \"Request approved\"){\n window.scrollTo(0, 0);\n $('.featherlight').click();\n spawnErrorMessage(\"Unable to Approve Request: \" + jsonReturned);\n } else {\n $('.featherlight').click();\n // location.reload();\n tempThis.parent().parent().parent().parent().remove();\n if(tempChildren - 1 == 0){\n $(\"#requests\").append(getWarningMessage(\"No pending registration requests\"));\n }\n }\n });\n }));\n}", "function handleAPILoaded() {\n\t$('#search-button').attr('disabled', false);\n\t$('#sort-select').attr('disabled', false);\n}", "ajaxSaveAllNumbersChanged() {\n let $ = jQuery.noConflict();\n let thisClass = this;\n\n if (this.xhrIsWorking === true) {\n alert(RdPostOrderObj.txtPreviousXhrWorking);\n return false;\n }\n\n let confirmed_val = confirm(RdPostOrderObj.txtConfirm);\n\n if (confirmed_val === true) {\n thisClass.xhrIsWorking = true;\n thisClass.disablePostSortable();\n $('.form-result-placeholder').html('');\n\n let formData = $('.menu_order_value').serialize();\n let additionalFormData = {\n 'action': 'RdPostOrderSaveAllNumbersChanged',\n 'security': RdPostOrderObj.ajaxnonce,\n '_wp_http_referer': $('input[name=\"_wp_http_referer\"]').val(),\n 'paged': ($.query.get('paged') ? $.query.get('paged') : 1),\n 'hookName': RdPostOrderObj.hookName,\n }\n formData += '&' + $.param(additionalFormData);\n\n $.ajax({\n url: ajaxurl,\n type: 'POST',\n data: formData,\n dataType: 'json'\n })\n .done((response, textStatus, jqXHR) => {\n // displaying result to the page.\n thisClass.displayNoticeElement(response, response, 'notice-error');\n\n if (typeof(response) !== 'undefined') {\n thisClass._ajaxReplaceTable(response);\n }\n })\n .fail((jqXHR, textStatus, errorThrown) => {\n let errResponse = jqXHR.responseJSON;\n let errResponseText = jqXHR.responseText;\n\n thisClass.displayNoticeElement(errResponse, errResponseText, 'notice-error');\n })\n .always((jqXHR, textStatus, errorThrown) => {\n let response;\n if (textStatus === 'success') {\n response = jqXHR;\n } else {\n response = jqXHR.responseJSON;\n }\n // mark XHR is not working.\n thisClass.xhrIsWorking = false;\n // re-activate sortable\n thisClass.enablePostSortable();\n });\n }// endif; confirmed\n\n return false;\n }", "function pay_now() {\n jQuery(\"#loader\").show();\n var url = \"index.php?option=com_akeebasubs&view=level&layout=default&format=html&slug=members-plan&tmpl=component&template_short=1\";\n\n jQuery.ajax({\n type: \"POST\",\n url: url,\n success: function(data)\n {\n \n jQuery(\"#ptabs-2\").html(data);\n \n // akeeba validation\n validatePassword();\n validateName();\n validateEmail();\n \n setTimeout(function(){\n jQuery(\"#loader\").hide();\n }, 2000); \n\n },\n error: function(XMLHttpRequest, textStatus, errorThrown)\n {\n alert(\"error\");\n }\n });\n \n}", "function insertRecord() {\n\n $.ajax({\n url: '/Configuration/AddEquipmentType',\n data: { type: type.toUpperCase(), isEnabled: isEnabled, isSECSGEM : isSECSGEM},\n method: 'post'\n }).success(function (val) {\n \n if (val == \"True\") {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n $('#EquipmentTypeGrid').jqxGrid('updatebounddata');\n notification_modal_dynamic(\"Notification\", \"Machine Type Added\", 'success', identifier);\n identifier++;\n }\n else {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n notification_modal_dynamic_super(\"Notification\", \"Something went wrong please try again later\", 'danger', 'form_modal_div', identifier)\n identifier++;\n }\n }).error(function (e) {\n modal_checker = 1;\n $(\"#modal_div\").modal(\"hide\");\n $(\"#form_modal_div\").modal(\"hide\");\n notification_modal_dynamic_super(\"Notification\", \"Something went wrong please try again later\", 'danger', 'form_modal_div', identifier)\n identifier++;\n });\n}", "function culqi() {\n var secreta = $(\"#secreta\").val();\n if (Culqi.token) {\n $(document).ajaxStart(function(){\n run_waitMe();\n });\n // Imprimir Token\n $.ajax({\n type: 'POST',\n url: '../culqi-php-1.2.5/examples/01-crear-cargo.php',\n data: { token: Culqi.token.id , moneda1 , secreta, correo: Culqi.token.correo_electronico },\n datatype: 'json',\n success: function(data) {\n var result = JSON.parse(data);\n if(result.objeto == 'error'){\n resultdiv(result.mensaje_usuario);\n } else {\n resultdiv(\"Venta Exitosa\");\n }\n },\n error: function(error) {\n resultdiv(error)\n }\n });\n } else {\n // Hubo un problema...\n // Mostramos JSON de objeto error en consola\n $('#response-panel').show();\n $('#response').html(Culqi.error.merchant_message);\n $('body').waitMe('hide');\n }\n }", "function GetAllFindInBomAjaxCall() {\n if (requestQueryForFindInBom.pageNumber === 1) {\n disableButton(PreviousButtons.findInBom);\n ActiveButton(NextButtons.findInBom);\n }\n else {\n ActiveButton(PreviousButtons.findInBom);\n ActiveButton(NextButtons.findInBom);\n }\n\n\n requestQueryForFindInBom.Stk = $(Inputs.findInBom_searchStk).val();\n requestQueryForFindInBom.material = $('#inp-findInBom-searchMaterial').val();\n ShowLoader();\n $(TablesId.findInBom).empty();\n $.ajax({\n type: \"POST\",\n contentType: \"application/json;charset=utf-8\",\n url: HttpUrls.GetAllFindInBom,\n data: JSON.stringify(requestQueryForFindInBom),\n success: (list) => {\n if (list.length !== 0) {\n $('#recordNotFoundDiv_findInBom').css('display', 'none');\n console.log('find',list);\n CreateFindInBomTable(list, TablesId.findInBom);\n }\n else {\n disableButton(NextButtons.findInBom);\n $(`#recordNotFoundDiv_findInBom h3`).text('Hiç Bir Kayit Bulunmamaktadır');\n $('#recordNotFoundDiv_findInBom').css('display', 'block');\n HideLoader();\n }\n }\n });\n}", "function disableQUestionsAlreadyAdded(cat_id, subcat_id){\n\t$.ajax({\n url: serviceIp+\"/test-for-sure/question-bank/get-ques-ids?categoryId=\"+cat_id+\"&subcategoryId=\"+subcat_id,\n type: \"GET\",\n contentType: 'application/json',\n success: function (result) {\n\t\t\t\t\tconsole.log(\"Result: \"+result);\n\t\t\t\t\tvar resultIds = result;\n\t\t\t\t\tlocalStorage.setItem('resultIds', resultIds);\n },\n error: function () {\n\t\t\t\t\tconsole.log(\"Service is unavailable\");\n }\n });\n}", "function QuickAddTransaction() {\n\n $.ajax({\n beforeSend: function () {\n $(\"#quickAddModal-Body\").html('<div class=\"\" id=\"ajax-Accounts-loader1\" style=\"text-align: center;\"><div class=\"\" style=\"display: inline-block;\"><i class=\"fa fa-spinner fa-spin fa-3x fa-fw\"></i></div></div>');\n $(\"#quickAddModal\").modal('show');\n },\n type: \"Get\",\n url: \"/Saver/QuickAddTransaction\",\n dataType: 'text',\n error: function (response) {\n ErrorNotification(\"POST Error\", \"There was an error, please try again. If you continue to have problems please contact support.\");\n console.log(\"Error editTransactionBtn(id)! \" + response);\n },\n success: function (response) {\n console.log(\"Success! _QuickAddTransactionPartial\");\n if (response == \"Error\") {\n ErrorNotification(\"Error\", \"You are not in a Household, or your Household has no Accounts. You need to join a Household, or add Accounts to before adding Transactions.\");\n $(\"#quickAddModal\").modal('hide');\n }\n else {\n $(\"#quickAddModal-Body\").html(response);\n }\n }\n })\n}", "function preAjaxCaller() {\n $('#zoomModal').remove();\n }", "function form_velo(){\n $(\"#selection\").attr(\"disabled\",true);\n //console.log(user_pseudo + \" \" + station_emprunt + \" \" + station_depot);\n $(\"main center\").remove();\n $(\"#affiche_emprunt\").text(\"Réserver votre vélo\");\n let recup3 = JSON.parse(httprequest.responseText);\n $(\".main\").append(recup3[6]);\n //console.log(num_depot);\n $(\"#valid_cb\").click(function(){\n let cb1 = $(\"#cb\").val();\n cb = cb1;\n //console.log(cb1);\n valider_ticket();\n \n $(\"#valid_cb\").attr(\"disabled\",true); //desactive la possibilité de réappuyer sur le bouton\n });\n}", "function addDiagWithoutEdits(){\r\n\t$(\".loader_bg\").fadeIn();\r\n\t$(\".loader\").fadeIn();\r\n\t//Create a model\r\n\tvar diagWithoutEditModel = Spine.Model.sub();\r\n\tdiagWithoutEditModel.configure(\"/user/confirmation/addDiagWithoutEdits\", \"jobReferenceNo\", \"rowId\");\r\n\tdiagWithoutEditModel.extend( Spine.Model.Ajax );\r\n\t\r\n\t//Populate the model\r\n\tvar diagWithoutEditPopulator = new diagWithoutEditModel({ \r\n\t\tjobReferenceNo: sessionStorage.getItem(\"jobReferenceNo\"),\r\n\t\trowId: sessionStorage.getItem(\"rowIdentity\")\r\n\t});\r\n\t//POST\r\n\tdiagWithoutEditPopulator.save();\r\n\t\r\n\tdiagWithoutEditModel.bind(\"ajaxSuccess\", function(record, xhr, settings, error) {\r\n\t\tvar jsonStr = JSON.stringify(xhr);\r\n\t\tvar obj = jQuery.parseJSON(jsonStr);\r\n\t\tvar statusCode = obj.statusCode;\t\t\r\n\t\t$(\".loader_bg\").fadeOut();\r\n\t $(\".loader\").hide();\r\n\t\tif ((statusCode == 500)) {\r\n\t\t\talertify.alert(\"<img src='../img/failed-icon.png'><br /><p>Unable to complete your request. Please contact administrator.</p>\");\r\n\t\t} else {\r\n\t\t\tsessionStorage.setItem(\"pageSequence\", 8);\r\n\t\t\twindow.location = \"finalPage.jsp\";\r\n\t\t}\r\n\t});\r\n\t\r\n\tdiagWithoutEditModel.bind(\"ajaxError\", function(record, xhr, settings, error) {\r\n\t\t$(\".loader_bg\").fadeOut();\r\n\t $(\".loader\").hide();\r\n\t\talertify.alert(\"Unable to connect to the server.\");\r\n\t});\r\n}", "function add_a_Prereq(){\n\t\t$(\".prereq_id_add\").click(function(){\n\t\t\tvar prereq_id = $(this).attr(\"id\");\n\t\t\tvar prereq_code = $(\".prereq_code_\"+prereq_id).text();\n\t\t\tvar prereq_title = $(\".prereq_title_\"+prereq_id).text();\n\n\t\t\t$(this).children().attr('class', 'fad fa-spinner-third fa-spin');\n\n\t\t\t$.get( \"../Tab_Course/added_prerequisite.php\", {\n\t\t\t\tprereq_id: prereq_id,\n\t\t\t\tprereq_code: prereq_code,\n\t\t\t\tprereq_title: prereq_title\n\t\t\t}, function( data ) {\n\t\t\t\t$(\".item-prereq-none\").remove();\n\t\t\t\t$(\"#added_prereqs\").append($(data));\n\t\t\t\tvar page = parseInt($(\".prereq_pagination .active a\").attr(\"id\"));\n\t\t\t\tsearchPrereq(page = page);\n\t\t\t\tremoveAddedPrereq();\n\t\t\t\tsuccess_alert_prereq_add(prereq_code);\n\t\t\t});\n\n\t\t});\n\t}", "enable() {\n\t // leave empty in Widget.js\n\t }", "function rawSubmitDefault(btn) {\n\t\t\t\t\t\t\t\tvar thisbtn = btn;\n\t\t\t\t\t\t\t\t$(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\t\t\t\t\t\t\t\t$.ajax ({\n\t\t\t\t\t\t\t\t\ttype: \"POST\",\n\t\t\t\t\t\t\t\t\turl: coinjs.host+'?uid='+coinjs.uid+'&key='+coinjs.key+'&setmodule=bitcoin&request=sendrawtransaction', // fix me\n\t\t\t\t\t\t\t\t\tdata: {'rawtx':$(\"#rawTransaction\").val()},\n\t\t\t\t\t\t\t\t\tdataType: \"xml\",\n\t\t\t\t\t\t\t\t\terror: function(data) {\n\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(\" There was an error submitting your request, please try again\").prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tsuccess: function(data) {\n\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").html(unescape($(data).find(\"response\").text()).replace(/\\+/g,' ')).removeClass('hidden');\n\t\t\t\t\t\t\t\t\t\tif($(data).find(\"result\").text()==1) {\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(' TXID: ' + $(data).find(\"txid\").text() + '<br> <a href=\"https://coinb.in/tx/' + $(data).find(\"txid\").text() + '\" target=\"_blank\">View on Blockchain</a>');\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span> ');\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\tcomplete: function(data, status) {\n\t\t\t\t\t\t\t\t\t\t$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n\t\t\t\t\t\t\t\t\t\t$(thisbtn).val('Submit').attr('disabled',false);\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}", "function enableSteps() {\n $(\"#plusButtons\").css(\"opacity\",1);\n $(\"#plusSwish\").css(\"opacity\",1);\n $(\"#step2\").css(\"opacity\",1);\n $(\"#step3\").css(\"opacity\",1);\n $(\"#plusButtons span.button\").css(\"cursor\",\"pointer\");\n $(\"swish-QR\").removeAttr(\"src\");\n}", "function declineBattle(element) {\n\n $(element).html(\"Loading...\");\n $(element).attr(\"onclick\", \"\");\n\n var requestButton = $(\"#requestButton\");\n requestButton.attr(\"onclick\", \"\");\n\n var requestID = $(element).attr(\"data-request\");\n\n $.ajax({\n\n // Using dynamic urls for now, may change if not secure enough\n url: '/battle/decline',\n type: \"POST\",\n data: {\n requestID: requestID\n },\n // Successful Retrieval\n success:function(data)\n {\n $('#playerModal').modal('hide')\n $(\".modal-backdrop.show\").remove();\n $(\"body\").append(data);\n $(\".notify_container\").slideDown(600);\n },\n // Failed Retrieval\n error: function(data)\n {\n }\n });\n\n\n}", "function loadsuggestedrefferals(newknowid, professions, sourcezip) \n{ \n waitFunc('enable');\n $.ajax({\n type: 'post',\n url: 'includes/ajax.php',\n data: { generatesmartsuggest: 1, professions: professions, newknowid: newknowid, sourcezip: sourcezip },\n success: function(data) {\n \n alertFunc('success', 'Your new contact has some matching connects waiting for introduction!');\n waitFunc('');\n }\n });\n}", "function disable() {\n $(document)\n .off('ajax:error', handleError)\n .off('ajax:success', handleSuccess);\n }", "function bugReportAjax() {\n\t$(\"#boxFooter\").html(`<p>\n\t\tMerci beaucoup pour votre aide&nbsp;!\n\t\tPour quitter la page cliquez sur la flèche\n\t\tde retour ou recharchez la page.\n\t\t</p>`)\n\t$(\"#boxMain button\").attr(\"disabled\", \"\")\n\tconst bug = $(\"#boxMain textarea\").val()\n\t$.ajax({\n\t\tmethod: \"GET\",\n\t\turl: serverURL + \"/ballotin/php/bugReport.php\",\n\t\tdata: {\"bugtxt\": bug}\n\t}).fail(function(e) {\n\t\tconsole.log(\"Error: bugReportAjax\")\n\t\tconsole.log(e)\n\t})\n}", "sendFieldtoDisable(name){\n $.ajax({url: '/php/delete_signup_field.php', type: 'POST',\n dataType: 'json',\n data: {\n 'name': name\n },\n success: response => {\n this.getFields();\n this.checkifLive();\n },\n error: response => {\n alert(\"An error occured, please refresh the page!\")\n }\n });\n }", "function updateUI_floorInformation(){\n\n //update ui: current floor owner\n if(isItMyFloor() == true)$(\"#collaboration_controls_current_floor_owner\").text(\"Current Floor Owner: Me\");\n else $(\"#collaboration_controls_current_floor_owner\").text(\"Current Floor Owner: \" + getNameForAnEmail(current_floor_owner) );\n\n\n workflow_id = 'workflow_turn_id_1';\n //requestor =\n\n $.ajax({\n type: \"POST\",\n cache: false,\n url: \"/locking_turn_get_request_queue/\",\n data: 'workflow_id=' + workflow_id,\n success: function (option) {\n floor_requests_queue = option['floor_requests_queue'];\n //update ui: floor requests queue\n $(\"#collaboration_controls_floor_requests_queue\").text(\"Floor Requests Queue: \");\n for(var i=0;i < floor_requests_queue.length; i++){\n //append this user to the end of ui\n $(\"#collaboration_controls_floor_requests_queue\").append(\"<i>\" + getNameForAnEmail(floor_requests_queue[i]) +\"</i>\");\n\n //extra: show arrow for intuition\n if(i != floor_requests_queue.length - 1)$(\"#collaboration_controls_floor_requests_queue\").append(\" => \");\n }\n\n },\n error: function (xhr, status, error) {\n alert(\"Some Error Occured while adding Request.\");\n }\n\n });\n\n\n/*\n //update ui: floor requests queue\n $(\"#collaboration_controls_floor_requests_queue\").text(\"Floor Requests Queue: \");\n for(var i=0;i < floor_requests_queue.length; i++){\n //append this user to the end of ui\n $(\"#collaboration_controls_floor_requests_queue\").append(\"<i>\" + getNameForAnEmail(floor_requests_queue[i]) +\"</i>\");\n\n //extra: show arrow for intuition\n if(i != floor_requests_queue.length - 1)$(\"#collaboration_controls_floor_requests_queue\").append(\" => \");\n }\n*/\n\n}", "function approve(id,plus) {\n $.ajax({\n type: 'POST',\n url: 'orders/approve',\n data: {\"id\": id,\"plus\":plus},\n beforeSend: function () {\n // this is where we append a loading image\n },\n success: function (data) {\n // successful request; do something with the data\n notif({\n msg: \"<b>Note:</b>\" + data['data'],\n position: \"center\",\n time: 10000\n });\n $('#view_orders').click();\n },\n error: function (data) {\n // failed request; give feedback to user\n notif({\n msg: \"<b>Oops:</b> שגיאה. נסה שוב מאוחר יותר..\",\n position: \"center\",\n time: 10000\n });\n $('#view_orders').click();\n }\n });\n}", "function save_credit() {\n\n $(\"#b1\").remove();\n $(\"#loader\").html('<a href=\"#0\" class=\"cd-cart__checkout\"><div class=\"lds-ellipsis\"><div></div><div></div><div></div><div></div></div></a>')\n\n var desc=\t$(\"#desc\").val();\n var price= $(\"#price\").val();\n\n\n var url = script_url+\"?callback=ctrlq&desc=\"+desc+\"&price=\"+price+\"&action=insert-credit\";\n\n var request = jQuery.ajax({\n crossDomain: true,\n url: url ,\n method: \"GET\",\n dataType: \"jsonp\"\n});\n\n}", "function updateCode() {\n $('.toast').toast('hide');\n clearTimeout(timer);\n \n generate_qrcode_btn.attr('disabled', true);\n linksholder.html('');\n resultholder.data('gradient', false);\n timer = setTimeout(function(){\n\n if (!$myForm[0].checkValidity()) {\n submitform.click();\n }\n\n colorpickerback.spectrum('enable');\n preloader.fadeIn(100, function(){\n\n var sendIputs = obj.find(section + ' :input');\n\n var sendata = 'section='+section+'&';\n sendata += sendIputs.filter(function(index, element) {\n return $(element).val() != \"\";\n }).serialize();\n\n sendata += '&';\n sendata += sendOptions.filter(function(index, element) {\n return $(element).val() != \"\";\n }).serialize();\n\n $.ajax({\n type: \"POST\",\n url: relative + \"ajax/process.php\",\n cache: false,\n data: sendata\n })\n .fail(function(error) {\n alert_placeholder.html(error.statusText);\n $('.toast').toast('show');\n })\n .done(function(msg) {\n if (transparent_bg.prop('checked')) {\n colorpickerback.spectrum('disable');\n }\n var result = JSON.parse(msg);\n if (result.hasOwnProperty('errore')) { \n alert_placeholder.html(result.errore);\n $('.toast').toast('show');\n resultholder.html('<img src=\"' + result.placeholder + '\">');\n preloader.fadeOut('slow');\n } else {\n generate_qrcode_btn.attr('disabled', false);\n resultholder.html(result.content);\n resultholder.data('gradient', result.gradient);\n preloader.fadeOut('slow');\n holdresult.val(msg);\n }\n });\n });\n }, 1000);\n }", "function detect_exist(e){\n var id_value={\n id:e.target.value\n }\n\n console.log(e.target.value);\n //return;\n $.ajax({\n type:\"POST\",\n url:\"/id_exist_check\",\n contentType: 'application/json;charset=UTF-8',\n data:JSON.stringify(id_value),\n success:function(result){\n if(result==\"ok\"){\n $(\"#memberQuery\").attr(\"disabled\", false);\n $(\"#memberGetInRec\").attr(\"disabled\",false);\n $(\"#btnGetIn\").attr(\"disabled\",false);\n $(\"#btnGetInTimes\").attr(\"disabled\",false);\n $(\"#btnVIPGetIn\").attr(\"disabled\",false);\n $(\"#btnTranLittleGetInTimes\").attr(\"disabled\",false);\n $(\"#btnCourseLimitGetInTimes\").attr(\"disabled\",false);\n $(\"#btnCourseGetInTimes\").attr(\"disabled\",false);\n \n }else{\n $(\"#memberQuery\").attr(\"disabled\", true);\n $(\"#memberGetInRec\").attr(\"disabled\",true);\n $(\"#btnGetIn\").attr(\"disabled\",true);\n $(\"#btnGetInTimes\").attr(\"disabled\",true);\n\n $(\"#btnVIPGetIn\").attr(\"disabled\",true);\n $(\"#btnTranLittleGetInTimes\").attr(\"disabled\",true);\n $(\"#btnCourseLimitGetInTimes\").attr(\"disabled\",true);\n $(\"#btnCourseGetInTimes\").attr(\"disabled\",true);\n }\n },\n error:function(result){ \n alert(result);\n }\n });\n}", "function ShowEmptyQuestionForm() {\n\n $(\"#app\").html(\"\");\n $(\"#app\").append('<img src=\"images/EGG-1.png\" class=\"omlet_first\"></img><p>Question:</p><div><textarea class=\"form_format\" style=\"height:90px;\" id=\"question\"></textarea></div><div id=\"responses\"></div><div id=\"moreResponses\"><img src=\"images/option.png\" weight=\"270px\" height=\"32px\"></img> </div><div id=\"submit\">Create</div></div>');\n addResponse();\n addResponse();\n\n \n $(\"#moreResponses\").fastClick(addResponse);\n $(\"#submit\").fastClick(sharePoll);\n}", "function myAjax(options){\r\n\r\n var attributes={\r\n logMsg:null,\r\n url:\"\",\r\n success:function(){},\r\n error:function(){},\r\n\t\tdelegateErrorHandling:true,\r\n data:{}\r\n }\r\n\t \r\n $.extend(attributes,options)\r\n\t\r\n\tif(utils.RealTypeOf(attributes.data)==\"array\"){\r\n\t\t\r\n\t\tvar data={};\r\n\t\t$.each(attributes.data,function(i,elem){\r\n\t\t\tdata[elem.name]=elem.value\t\t\t\r\n\t\t})\r\n\t\t\r\n\t\tattributes.data=data;\r\n\t}\r\n\t\r\n\t\r\n\tattributes.data[\"BM\"]=NVision.appStatus.BM\t\r\n\t//adding dummy data to avoid cache issues\r\n\tattributes.data[\"dummyId\"]=(new Date()).getTime();\r\n\t\t\r\n if(attributes.logMsg){\r\n var msgId=myConsole.status(attributes.logMsg); \r\n }\r\n\t\r\n\t//myConsole.alert(\"revert to POST method!\")\r\n\treturn $.ajax({\r\n url:attributes.url,\r\n type:\"GET\",\r\n dataType:\"json\",\r\n data:attributes.data,\r\n success:function(data){\r\n if(attributes.logMsg){\r\n myConsole.status(\"Ok \",msgId);\r\n }\r\n\r\n\t\t\tif(!data || !data._code){\r\n\t\t\t\tmyConsole.alert(\"Wrong data format!\");\r\n\t\t\t\tif(attributes.error){\r\n\t\t\t\t\tattributes.error(\"Wrong data format!\");\r\n\t\t\t\t}\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(data._code!=\"ok\" && attributes.delegateErrorHandling){\r\n\r\n\t\t\t\tvar lb=NVision.lightBoxes[\"alertBox\"];\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\tlb.find(\"h3\").text(data._errObj.id)\r\n\t\t\t\t\tlb.find(\"p.shortDesc\").text(data._errObj.shortDesc)\r\n\t\t\t\t\tlb.find(\".longDesc span\").text(data._errObj.longDesc)\r\n\t\t\t\t\r\n\t\t\t\tif(!lb.is(\":visible\")){\t\r\n\t\t\t\t\tlb.show();\r\n\t\t\t\t}\r\n \r\n NVision.enableUi();\r\n\t\t\t}\r\n\t\t\t\r\n attributes.success(data)\r\n },\r\n error:function(XMLHttpRequest, textStatus, errorThrown){\r\n\t\t\tif((textStatus||errorThrown)==\"abort\"){\r\n\t\t\t\t//console.log(\"error\")\r\n\t\t\t\treturn false;\r\n\t\t\t}else{\r\n\t\t\t\tmyConsole.error(textStatus||errorThrown);\r\n\t\t\t}\r\n attributes.error(XMLHttpRequest, textStatus, errorThrown);\t\t\t\r\n }\r\n }) \r\n}", "function checkBalanceNotChangeCurrency(this_){\n var accountID = $(this_).val();\n\n if(accountID!==\"\"){\n \n $.ajax({ \n type: \"post\",\n data: {'accountNumber':accountID},\n url: \"personal/account/utilaccount\",\n cache: false,\n success:function(response){\n \n var balance = response[\"currencyCode\"] +\" \"+ parseFloat(response[\"availableBalance\"], 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\n $(this_+\"-result\").html(\"<em>Available \"+ balance);\n $(this_+\"-hiddenCurrency\").val(response[\"currencyCode\"]);\n \n //CHECK ACCOUNT STATUS ON CHANGE\n if((response[\"black_listed\"] == true)){\n \n $(\"#accountBlackList\").removeClass(\"hide\");\n $(\"#fund-transfer-submit\").hide();\n }else{\n $(\"#accountBlackList\").addClass(\"hide\");\n $(\"#fund-transfer-submit\").show();\n }\n \n\n }, error: function(){\n //alert('Error while request..');\n }\n });\n } else { $(this_+\"-result\").html(\"<em>...</em>\"); }\n}", "function hitAPI(information) {\n $.ajax({\n url: base_url + '/qrcode/generate',\n type: 'post',\n dataType: 'json',\n data: {\n \"long\" : information[1],\n \"lat\" : information[0],\n \"source\": information[2],\n \"token\" : token\n } ,success: function(data) {\n if(data.code == 1000) {\n if(data.message == 2019) {\n document.getElementById('modalWrongTitle').innerHTML = \"Mohon maaf, token tidak valid\";\n $('#modalWrong').modal('show');\n $(\"#modalWrong\").on(\"hidden.bs.modal\", function () {\n window.location = base_url;\n });\n }\n hasil = data.message.key;\n if (hasil.code == 405)\n {\n document.getElementById('modalWrongTitle').innerHTML = \"Mohon maaf, token tidak valid\";\n $('#modalWrong').modal('show');\n $(\"#modalWrong\").on(\"hidden.bs.modal\", function () {\n window.location = base_url;\n });\n return false;\n }\n render(hasil);\n \n }\n } ,error: function(e) {\n document.getElementById('modalWrongTitle').innerHTML = \"Sedang terjadi gangguan jaringan, silahkan coba beberapa saat lagi\";\n $('#modalWrong').modal('show');\n $(\"#modalWrong\").on(\"hidden.bs.modal\", function () {\n window.history.back();\n });\n }\n });\n }", "function loadergenerateinvoice(){\n\tvar targetUrl = baseUrl + 'billing-generate-invoice/billing-invoice-management';\n\tvar targetTitle = \"Generate Invoices\";\n\thistoryPushState(targetUrl,targetTitle);\n\tvar topleftheader = $('.page-header');\n\ttopleftheader.find('em').attr('class','fa fa-pie-chart');\n\ttopleftheader.find('em').attr('title','Generate Invoices');\n\ttopleftheader.find('span.top-left-header').attr(\"tabindex\",\"0\");\n\ttopleftheader.find('span.top-left-header').attr(\"title\",\"Generate Invoices\");\n\ttopleftheader.find('span.top-left-header').html('Generate Invoices');\n\tjQuery('.billingModulesInvoice').removeClass('active');\n\tshowLoader();\n\t//location.href = baseUrl +'billing-generate-invoice/billing-invoice-management';\n\tjQuery.ajax({\n\t url: targetUrl,\n\t type: 'get',\n\t beforeSend:function (data) {showLoader();},\n\t success: function (data) {\n\t \t hideLoader();\n\t \t //jQuery('.right-side').html(data);\n\t\t\t $('#admin_main_container').html(data);\n\t\t\t $('input').customInput();\n\t\t\t $('#deletesavedinvoice_li').hide();\n\t\t\t $('#finalizedinvoice_li').hide();\n\t\t\t jQuery('.billingModulesInvoice[data-module=\"invoice_criteria\"]').addClass('active');\n\t }\n\t});\n}", "function enablePatientPIFields() {\n\n var modalClass = $('.phoneDiv');\n modalClass.removeClass('numberModalDiv');\n\n var modalClass = $('.EmailDiv');\n modalClass.removeClass('importEmailToModal'); \n\n $(\".PIDropDListBeforeEditDisabled\").closest(\".ui-widget\").find(\"input, button\").prop(\"disabled\", false);\n $(\".piSelect_tab .custom-combobox-input\").autocomplete(\"option\", { disabled: false });\n $(\"#PIattorneyWebBtn\").attr(\"disabled\", false);\n\n $('.patientPITxtField').attr('disabled', false);\n $('#PIattorneyWebBtn').attr('onClick', 'openPiUrlOnTab()');\n $(\".sidenav-trigger\").attr(\"disabled\", false);\n $('#btnPatientPI').attr(\"disabled\", false);\n}", "function enableButtons()\n {\n //show buttons for updating and creating new workflow\n $(\"#perc-update-wf-save-cancel-block\").show();\n $(\"#perc-new-wf-save-cancel-block\").show();\n }", "function toggleButtonAvailability() {\n\tsetTimeout(function() { // this stuff is happens after 200 ms because it wasn't registerring when called immediately\n\t\tif ( $('#user_agi').val() != \"\" ) {\n\t\t\t// make select sample buttons available\n\t\t\t$('#ToolbarSelectAllSamples').css(\"display\",\"block\");\n\t\t\t$('#ToolbarExcludeAllSamples').css(\"display\",\"block\");\n\t\t\t$('#selectThisSampleButton').css(\"display\",\"block\");\n\t\t\t$('#excludeThisSampleButton').css(\"display\",\"block\");\n\t\t\t$('#TableSelectAllSamplesButton').css(\"display\",\"block\"); \n\t\t\t$('#TableExcludeAllSamplesButton').css(\"display\",\"block\");\n\t\t\t\n\t\t\t// hide Min Max and Reset buttons\n\t\t\t$('#ToolbarMinButton').css(\"display\",\"none\");\n\t\t\t$('#ToolbarMaxButton').css(\"display\",\"none\");\n\t\t\t$('#ToolbarResetButton').css(\"display\",\"none\");\n\t\t\t$('#ModalResetButton').css(\"display\",\"none\");\n\t\t\t$('#TableMaxForAll').css(\"display\",\"none\");\n\t\t\t$('#TableMinForAll').css(\"display\",\"none\");\n\t\t\t$('#TableResetAll').css(\"display\",\"none\");\n\t\t\t\n\t\t\t\n\t\t\t// hide slider\n\t\t\t$('#expressionLevelSlider').css(\"display\",\"none\");\n\t\t\t$('#selectThisSampleButton').css(\"display\",\"block\");\n\t\t\t$('#excludeThisSampleButton').css(\"display\",\"block\");\n\t\t\t\n\t\t\t//includeAllSamplesInSearch(); \n\t\t}\n\t\telse {\n\t\t\t// make select sample buttons unavailable\n\t\t\t$('#ToolbarSelectAllSamples').css(\"display\",\"none\");\n\t\t\t$('#ToolbarExcludeAllSamples').css(\"display\",\"none\");\n\t\t\t$('#selectThisSampleButton').css(\"display\",\"none\");\n\t\t\t$('#excludeThisSampleButton').css(\"display\",\"none\");\n\t\t\t$('#TableSelectAllSamplesButton').css(\"display\",\"none\");\n\t\t\t$('#TableExcludeAllSamplesButton').css(\"display\",\"none\");\n\t\t\t\n\t\t\t// show Min Max and reset buttons\n\t\t\t$('#ToolbarMinButton').css(\"display\",\"block\");\n\t\t\t$('#ToolbarMaxButton').css(\"display\",\"block\");\n\t\t\t$('#ToolbarResetButton').css(\"display\",\"block\");\n\t\t\t$('#ModalResetButton').css(\"display\",\"block\");\n\t\t\t$('#TableMaxForAll').css(\"display\",\"block\");\n\t\t\t$('#TableMinForAll').css(\"display\",\"block\");\n\t\t\t$('#TableResetAll').css(\"display\",\"block\");\n\t\t\t\n\t\t\t\n\t\t\t// hide slider\n\t\t\t$('#expressionLevelSlider').css(\"display\",\"block\");\n\t\t\t$('#selectThisSampleButton').css(\"display\",\"none\");\n\t\t\t$('#excludeThisSampleButton').css(\"display\",\"none\");\n\t\t\t\n\t\t\tresetAllTissues(); \n\t\t}\n\t},200);\n}", "function RejectDashboard()\n{\n $(\"#notice\").empty();\n $(\"#notice\").append(\"<div class=\\\"alert alert-info\\\">Thank you for your feedback!</div>\");\n $(\"#firstRow\").empty();\n $(\"#secondRow\").empty();\n $(\"#thirdRow\").empty();\n undo = true;\n\n \n // Get the previous order of widgets\n var tokens = previousOrder.split(\" \");\n \n customWidgets = [];\n for (var i = 0; i < tokens.length; i++) {\n \n customWidgets.push(defaultWidgets[parseInt(tokens[i]) - 1]);\n \n }\n \n // Add widgets to each row\n for (var i = 0; i < 3; i++) {\n \n callAjax(customWidgets, \"#firstRow\", i);\n }\n\n for (var i = 3; i < 6; i++) {\n \n callAjax(customWidgets, \"#secondRow\", i);\n }\n\n\n for (var i = 6; i <= customWidgets.length; i++) {\n \n callAjax(customWidgets, \"#thirdRow\", i);\n }\n\n \n}", "function bindAddHandlers() {\n $(\".add-button\").bind(\"click\", function(event) {\n $(this).attr(\"disabled\", \"disabled\");\n $(this).closest('li').hide('blind', { direction: 'vertical' }, ANIMATION_TIMEOUT);\n var url = ('/playlists/edit/' + encodeURIComponent(playlistId) +\n '/add_playlist_entry?video_id=' + encodeURIComponent(event.target.id) +\n '&uuid=' + encodeURIComponent(uuid));\n $.ajax({ type: 'POST', url: url });\n });\n }", "function saveAccount() {\n jQuery(\"#loader\").show();\n jQuery(\"#saveaccount\").attr(\"disabled\", \"disabled\");\n var url = \"index.php?option=com_akeebasubs&view=userinfo&tmpl=component\"; \n\n jQuery.ajax({\n type: \"POST\",\n url: url,\n data: jQuery(\"#userinfoForm\").serialize(), \n success: function(data)\n {\n \n setTimeout(function(){\n jQuery(\"#loader\").hide();\n jQuery(\"#saveaccount\").removeAttr(\"disabled\");\n }, 2000); \n\n \n },\n error: function(XMLHttpRequest, textStatus, errorThrown)\n {\n alert(\"error\");\n }\n });\n // avoid to execute the actual submit of the form.\n return false; \n}", "function generate_new_rank(){\n\n $('#rank_alert').modal({backdrop: 'static', keyboard: false});\n\n $.ajax({\n url: url_path + 'generate_new_rank',\n type: 'POST',\n cache: false,\n processData: false,\n contentType: false,\n success: function(msg){\n if(msg.status) {\n $(\"#rank_alert\").modal('hide');\n $(\"#after_rank_alert\").modal('toggle');\n\n }\n }\n });\n\n}", "function wirejQueryInterceptor() {\n $(document).ajaxStart(function () { processRequest(); });\n $(document).ajaxComplete(function () { processResponse(); });\n $(document).ajaxError(function () { processResponse(); });\n }", "function catchUp(){\n $(\"[data-f-register]\").each(function(i, elem){\n ajaxify($(elem).attr('data-f-register'), $(elem), $(elem).attr(\"data-f-method\"));\n });\n }", "function rejectToDesigner() {\n $(\".reviewer-page-wrap .loading-icon\").show();\n var rejectReason = $('#reject-reason').val();\n if(rejectReason) {\n var postData = {};\n postData.productID = selectedProduct.productID; \n postData.status = config.statusMapper.rejFromApprover;\n postData.rejectReason = rejectReason;\n updateProduct(postData, '.reviewer-page-wrap');\n } else {\n setTimeout(function() { \n $(\".reviewer-page-wrap .field-error\").text(config.reasonInvalid);\n $('#reject-reason').focus();\n }); \n $(\".reviewer-page-wrap .loading-icon\").hide();\n }\n}", "function process_booking(data, btn)\n{\n var original_args = arguments;\n // Skip warning on duplicate booking\n data.skip_duplicate = data.skip_duplicate || false;\n\n if (btn) {\n btn.disabled = true;\n }\n Cookies.set(\"bookingActionButtonClicked\", bookingActionButtonClicked);\n var absences_explained = true;\n var period_data;\n\n // Loop through each event in the bookings\n /*for (var schedule_id in current_booking_data)\n {\n for (var period_id in current_booking_data[schedule_id])\n {\n period_data = current_booking_data[schedule_id][period_id];\n // Check if there is an absence, without a note\n if (period_data.attending == 0 && ( ! period_data.note || period_data.note.trim() == ''))\n {\n absences_explained = false;\n break;\n }\n }\n }*/\n\n // Don't continue, if there are any unexplained absences\n if ( ! absences_explained)\n {\n $('#unexplained_absence_modal').modal();\n return false;\n }\n\n if (parseFloat($(\"#prepay_total\").val()) < 0)\n {\n $('#alert_minus_total').modal();\n return false;\n }\n\n $.ajax(\n {\n type: \"POST\",\n url: \"/admin/bookings/check_duplicate\",\n data: data,\n dataType: \"json\"\n }\n ).done(function(duplicate_response){\n if (!data.skip_duplicate && duplicate_response.duplicate == true) {\n if (btn) {\n btn.disabled = false;\n }\n\n // Store the function and its arguments,\n // so that it can be called again, should the user click \"Continue anyway\"\n cms_ns.duplicate_booking_params = original_args;\n cms_ns.duplicate_booking_params[0].skip_duplicate = true; // skip duplicate warning this time\n cms_ns.duplicate_booking_function = process_booking;\n\n $(\"#duplicate_schedule_booking_modal\").modal();\n return;\n }\n var $alerts = $('#booking_form_alerts');\n var balance_data = {\n contact_id:data.contact_id\n };\n $.ajax({\n type: 'POST',\n url: '/admin/bookings/ajax_check_year',\n data: data,\n dataType: 'json'\n })\n .done(function(results)\n {\n if (typeof(results.status) == \"undefined\" && results.length) {\n window.location = '/admin/bookings';\n } else if (results.status == 'success') {\n if ( window.location.pathname === '/admin/bookings/add_edit_booking' || window.location.pathname === '/admin/bookings/add_edit_booking/') {\n window.location = '/admin/bookings?booking='+results.booking_id;\n } else {\n display_balance(\n balance_data,\n function () {\n redirect_booking(results.case, results.transaction_id, results.amount, results.message, results.booking_id);\n }\n );\n }\n }\n else if (results.status == 'unmatched')\n {\n if (btn) {\n btn.disabled = false;\n }\n var modal = $('#course_level_warning');\n $('#modal_schedule_summary').html(results.message);\n modal.modal();\n document.getElementById('data').value = JSON.stringify(results.data);\n }\n else if (results.status == 'bill')\n {\n if (btn) {\n btn.disabled = false;\n }\n make_bill_booking_modal(results);\n }\n else\n {\n if (btn) {\n btn.disabled = false;\n }\n $alerts.add_alert(results.message);\n }\n })\n .error(function()\n {\n $alerts.add_alert('The server did not respond. Please try again later.', 'danger popup_box');\n remove_popbox();\n });\n });\n}", "function checkReqHelp() {\n $.ajax({\n url: 'players/get_help/player' + player_id,\n success: function (help) {\n help = JSON.parse(help);\n let count = 0;\n if (help.length > 0) {\n help.forEach((helpLog) => {\n if (!helpLog.to_help && !helpLog.seen) {\n count++;\n }\n });\n if (count > 0 && !($('#helpDot').length)) {\n $('#help-button').append('<div id= \"helpDot\" class= \"dot\"></div>');\n blinkNotify('#helpDot');\n }\n if (count == 0) {\n $('#helpDot').remove();\n }\n }\n }\n });\n}", "function updateVerifyCodeButtonUI() {\n //alert(!!window.verifyingCode|| !getCodeFromUserInput());\n document.getElementById('verify-code-button').disabled =\n !!window.verifyingCode\n || !getCodeFromUserInput();\n }", "function onReasonCodeChange(selectedValue) {\r\n \r\n // Split selectedValue parameter to retrieve reasonCode \r\n $('#ReasonCode').val(selectedValue.split('-')[0]);\r\n // Split selectedValue parameter to retrieve value whether Coupon breakdown is mandatory for selected reasonCode \r\n isCouponBreakdownMandatory = selectedValue.split('-')[1];\r\n\r\n // ID : 200973 - ERROR IN FILE AUG-13\r\n // pageMode = False; It means the page is RM Create. Irrespective of any reason code, Amound fields should be disable at RM create.\r\n\r\n if (pageMode.toString() != \"false\") {\r\n // If coupon breakdown is not mandatory enable selected Memo amount fields, else keep it disabled \r\n if (isCouponBreakdownMandatory == \"False\") {\r\n // Enable selected fields\r\n $('#amountFieldsTable input[type=text]').not(id = '#TotalGrossDifference').not(id = '#TotalTaxAmountDifference').not(id = '#TotalVatAmountDifference')\r\n .not(id = '#IscDifference').not(id = '#UatpAmountDifference').not(id = '#HandlingFeeAmountDifference').not(id = '#OtherCommissionDifference')\r\n .not(id = '#TotalNetRejectAmount').removeAttr(\"readOnly\");\r\n\r\n // Set 'CouponAwbBreakdownMandatory' hidden field value\r\n $('#CouponAwbBreakdownMandatory').val(isCouponBreakdownMandatory);\r\n }\r\n else {\r\n // If coupon breakdown is mandatory, set \"readOnly\" attribute to all text fields within div amountFieldsTable\r\n $('#amountFieldsTable input[type=text]').attr(\"readOnly\", true);\r\n\r\n // Set 'CouponAwbBreakdownMandatory' hidden field value\r\n $('#CouponAwbBreakdownMandatory').val(isCouponBreakdownMandatory);\r\n }\r\n } else {\r\n\r\n // If coupon breakdown is mandatory, set \"readOnly\" attribute to all text fields within div amountFieldsTable\r\n $('#amountFieldsTable input[type=text]').attr(\"readOnly\", true);\r\n\r\n // Set 'CouponAwbBreakdownMandatory' hidden field value\r\n $('#CouponAwbBreakdownMandatory').val(isCouponBreakdownMandatory);\r\n\r\n }\r\n // Disabling \"Save\" button again because it gets enabled when ajax call is completed for ReasonCode autocomplete.\r\n // Note:- We have written code in site.js which enables all submit buttons on ajax call complete.\r\n if (!isFromBillingHistory) {\r\n $(\"#btnSave\").attr(\"disabled\", true); \r\n $(\"#btnSaveAndAddNew\").attr(\"disabled\", true);\r\n }\r\n} // end onReasonCodeChange()", "addDebugBtnHandler() {\n\t\tthis.debugBtn.on('click', (e) => {\n\t\t\t// arrow function lets 'this' to be looked up in the lexical scope\n\t\t\tvar URL = LAB_URL + '/' + LAB_ID;\n\t\t\tvar dataObj = {\n\t\t\t\tcommand: DEBUG_COMMAND,\n\t\t\t\tcode: this.editorObj.code,\n\t\t\t\tlanguage: LAB_LANG\n\t\t\t};\n\t\t\t$.post({\n\t\t\t\turl: URL,\n\t\t\t\tdata: JSON.stringify(dataObj),\n\t\t\t\tsuccess: (data) => {\n\t\t\t\t\tthis.handleDebugRequest(this.createDebugTrace(JSON.parse(data)['trace']));\n\t\t\t\t},\n\t\t\t\terror: (req, status, err) => {\n\t\t\t\t\tconsole.log(err);\n\t\t\t\t},\n\t\t\t\tdataType: \"text\",\n\t\t\t\tcontentType: 'application/json'\n\t\t\t});\n\t\t});\n\t}", "function removeOfficialTravelRequest(id){\n\n\t$('.modal-submit').on('click',function(){\n\n\t\t//loading\n\t\tpreviewLoadingEffect()\n\t\t\n\t\t//disable onclick\n\t\t$(this).attr('disabled','disabled')\n\n\t\t$(this).html('Removing . . .')\n\n\t\t$.ajax({\n\t\t\turl:'api/travel/official/'+id,\n\t\t\tmethod:'DELETE',\n\t\t\tdata: { _token: $(\"input[name=_token]\").val()},\n\t\t\tsuccess:function(data){\n\t\t\t\tif(data==1){\n\t\t\t\t\t//ajax here\n\t\t \t\tsetTimeout(function(){\n\n\t\t \t\t\t$('.preview-content').fadeOut()\n\t\t \t\t\t$('.preview-section').html('<center style=\"margin-top:10vh;\"><h3 class=\"text-danger\"><i class=\"material-icons\">check_circle</i> Deleted successfully!</h3><p>This request was deleted from the database and no longer link in any other request</p></center>')\n\n\t\t \t\t\tvar nextItem=$(selectedElement).next();\n\t\t \t\t\t$(selectedElement).remove();\n\n\t\t \t\t\t//select next\n\t\t \t\t\t$(nextItem).click()\n\t\t \t\t\t\n\t\t \t\t},1000)\n\n\t\t \t\t$('#preview-modal').modal('hide');\n\n\t\t\t\t}else{\n\t\t\t\t\talert('Oops! Something went wrong.Try to refresh the page')\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t\n\t\t//back to original\n\t\t$(this).attr('disabled','enabled')\n\t})\n\t\n}", "function quick_add_task_btn(delayT = 3000){\n console.log('\\nadd_custom_quick_task_btn='+add_custom_quick_task_btn);\n console.log('add auto flag for whene description is added'); \n $('.tasks-quick-form-button').click(function(){\n $('head').append(\"<style>span.add_close {cursor: pointer;border: 1px solid darkgray;padding: 10px 7px;font-family: OpenSans-Bold, Helvetica, Arial, sans-serif;font-size: 12px;font-weight: 400;height: 39px;line-height: 39px;color: dimgray;margin-right: 10px;}span.add_close:hover {background-color: lightgray;}</style>\");\n if($('.add_close').length != 1){\n $('span.task-top-panel-middle').prepend('<span class=\"add_close\">save and close</span>');\n $('.add_close').click(function(){\n console.log('save and close');\n if($('#task-new-item-description').val() != ''){\n $('#task-new-item-title').val($('#task-new-item-title').val() + ' -d');\n }\n $('span#task-new-item-save').click();\n setTimeout(function(){\n $('span#task-new-item-cancel, span#task-new-item-notification-hide').click();\n $('.createTrackBtns').click();\n },delayT);\n }); \n }else{\n console.log('no action');\n return;\n }\n });\n}", "function EnableDisableFmBmCmIndicatorOnRejectionStage() {\r\n if (pageMode == 'View')\r\n return;\r\n if (($(\"#RejectionStage\").val() == 2) || $(\"#RejectionStage\").val() == 3) \r\n {\r\n // If RM being created is standalone execute If block else execute Else block\r\n if (!isFromBillingHistory) {\r\n // If RM has coupon breakdown disable FIM related fields\r\n if (cpnExist == \"True\") {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n else {\r\n // If FIM Indicator value is 1 i.e. None, disable \"FimBMCMNumber\" and \"FimCouponNumber\" fields and clear there values\r\n if ($(\"#FIMBMCMIndicatorId\").val() == 1) {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n // Clear field values\r\n $(\"#FimBMCMNumber\").val('');\r\n $(\"#FimCouponNumber\").val('');\r\n }\r\n // If FIM indicator has value other than 2 i.e. BillingMemo or CreditMemo, disable \"FimCouponNumber\" field and enable \"FimBMCMNumber\" field and clear \"FimCouponNumber\" field value\r\n else if ($(\"#FIMBMCMIndicatorId\").val() != 2) {\r\n //$(\"#FIMBMCMIndicatorId\").attr(\"disabled\", false);\r\n $(\"#FimCouponNumber\").val('');\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n }\r\n // If FIM Indicator has value 2 i.e. FIM, enable \"FimBMCMNumber\" and \"FimCouponNumber\" fields\r\n else {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44')\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44' || $(\"#SourceCodeId\").val() == '45' || $(\"#SourceCodeId\").val() == '46') {\r\n $(\"#FIMBMCMIndicatorId\").val('2');\r\n //SCP:37078 Comment below code to make FIMBMCMIndicatorId field to editable.\r\n// $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n }\r\n }\r\n else {\r\n // Disable FIM related fields\r\n if ($(\"#FimBMCMNumber\").val() != '') {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n } else {\r\n $(\"#FimBMCMNumber\").removeAttr(\"readonly\");\r\n }\r\n if ($(\"#FimCouponNumber\").val() != '') {\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n } else {\r\n $(\"#FimCouponNumber\").removeAttr(\"readonly\");\r\n }\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n else if ($(\"#RejectionStage\").val() == 1) \r\n {\r\n // If RM being created is standalone execute If block else execute Else block\r\n if (!isFromBillingHistory) \r\n {\r\n // If RM has coupon breakdown disable FIM related fields\r\n if (cpnExist == \"True\") \r\n {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n else \r\n {\r\n // If FIM Indicator value is 1 i.e. None, disable \"FimBMCMNumber\" and \"FimCouponNumber\" fields and clear there values\r\n if ($(\"#FIMBMCMIndicatorId\").val() == 1) \r\n {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n // Clear field values\r\n $(\"#FimBMCMNumber\").val('');\r\n $(\"#FimCouponNumber\").val('');\r\n }\r\n // If FIM indicator has value other than 2 i.e. BillingMemo or CreditMemo, disable \"FimCouponNumber\" field and enable \"FimBMCMNumber\" field and clear \"FimCouponNumber\" field value\r\n else if ($(\"#FIMBMCMIndicatorId\").val() != 2) \r\n {\r\n //$(\"#FIMBMCMIndicatorId\").attr(\"disabled\", false);\r\n // Enable fields\r\n $(\"#FimCouponNumber\").val('');\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n }\r\n // If FIM Indicator has value 2 i.e. FIM, enable \"FimBMCMNumber\" and \"FimCouponNumber\" fields\r\n else \r\n {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44')\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n else {\r\n // Disable FIM related fields\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n} // end EnableDisableFmBmCmIndicatorOnRejectionStage()", "function cancelAdd(dataid) {\n $.ajax({\n method: 'POST',\n url: \"inc/MyCommunity/deleteAskForAdd.php\",\n data: {profileid:dataid}\n }).done(function(msg) {\n if(msg != 'err')\n {\n $elem = $('button[data-cancel-add=\"' + dataid + '\"]').parents('.contact-container');\n $elem.removeClass('request-sent');\n AJAXloader(false, $elem.find('.loader-container'));\n $elem.html(msg);\n imgSmoothLoading();\n }\n else{\n window.location.reload();\n }\n });\n}", "function previousinvoicebtn(){\n //$(\"#display-generate-invoice-form\").submit();\n\t var targetUrl = baseUrl + 'billing-generate-invoice/billing-invoice-management';\n\t\tshowLoader();\n\t\t//location.href = baseUrl +'billing-generate-invoice/billing-invoice-management';\n\t\tjQuery.ajax({\n\t\t\turl: targetUrl,\n\t\t\ttype: 'post',\n\t\t\tdata: $('#display-generate-invoice-form').serialize(),\n\t\t\tbeforeSend:function (data) {showLoader();},\n\t\t\tsuccess: function (data) {\n\t\t\t\thideLoader();\n\t\t\t\t//jQuery('.right-side').html(data);\n\t\t\t\t$('#admin_main_container').html(data);\n\t\t\t\t$('input').customInput();\n\t\t\t\t$('#deletesavedinvoice_li').hide();\n\t\t\t \t$('#finalizedinvoice_li').hide();\n\t\t\t}\n\t\t});\n\n}", "function AdaHeads_Take_Call_Button_Click() {\n // Create a new call object, not implemented\n AdaHeads.Alice.Get_Next_Call({\n 200 : function (data) {\n $(\"#Current_Call\").addClass(\"disconnected\").show();\n\n AdaHeads.Status_Console.Log(\"Reserved call\"); \n },\n \n 404 : function (data) {\n AdaHeads.Status_Console.Log(\"Call not found\"); \n },\n \n 204 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: No call available\"); \n console.log (data); \n\n },\n 400 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: Bad request\");\n },\n \n 500 : function (data) {\n AdaHeads.Status_Console.Log(\"Pickup: Server error\");\n }\n }); \n \n// UI Changes\n// Disable the take call button and enable the end call button\n\n}", "function requestAddNewItem()\n{\n var inputField = $(\"#add_new_item\");\n var content = scanUserInput(inputField.val()); // a security tests is performed here\n var itemId = (nextId++).toString();\n\n\n $.ajax({\n type: \"POST\",\n url: \"/item\",\n data: {id: itemId, value: content},\n success: function (data)\n {\n if (data['status'] === 0 ) { // only upon success we display new item\n\n appendNewItem(itemId, 0, decodeURIComponent(content)); // new item is always uncompleted by default\n inputField.val('');\n }\n else {\n\n console.log(\"Unable to add item with id: \" + itemId + \", with content: \" + content);\n $(\"#errorMsg\").text(\"Failed to add new item.\");\n }\n },\n error: function ()\n {\n console.log(\"Unable to add item with id: \" + itemId + \", with content: \" + content);\n $(\"#errorMsg\").text(\"Failed to add new item.\");\n }\n });\n}", "function ajaxindicatorstart()\n{\n if(jQuery('body').find('#resultLoading').attr('id') != 'resultLoading'){\n jQuery('body').append('<div id=\"resultLoading\" style=\"display:none\"><div><img src=\"'+get_url()+'asset/img/ajax-loader.gif\"><div>Loading...</div></div><div class=\"bg\"></div></div>');\n }\n \n jQuery('#resultLoading').css({\n 'width':'100%',\n 'height':'100%',\n 'position':'fixed',\n 'z-index':'10000000',\n 'top':'0',\n 'left':'0',\n 'right':'0',\n 'bottom':'0',\n 'margin':'auto'\n }); \n \n jQuery('#resultLoading .bg').css({\n 'background':'#000000',\n 'opacity':'0.7',\n 'width':'100%',\n 'height':'100%',\n 'position':'absolute',\n 'top':'0'\n });\n \n jQuery('#resultLoading>div:first').css({\n 'width': '250px',\n 'height':'75px',\n 'text-align': 'center',\n 'position': 'fixed',\n 'top':'0',\n 'left':'0',\n 'right':'0',\n 'bottom':'0',\n 'margin':'auto',\n 'font-size':'16px',\n 'z-index':'10',\n 'color':'#ffffff'\n \n });\n\n jQuery('#resultLoading .bg').height('100%');\n jQuery('#resultLoading').fadeIn(300);\n jQuery('body').css('cursor', 'wait');\n}", "function EnableDisableFmBmCmIndicator() {\r\n if (pageMode == 'View')\r\n return;\r\n if (($(\"#RejectionStage\").val() == 2) || $(\"#RejectionStage\").val() == 3) {\r\n // If RM being created is standalone execute If block else execute Else block\r\n if (!isFromBillingHistory) {\r\n // If RM has coupon breakdown disable FIM related fields\r\n if (cpnExist == \"True\") {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n else {\r\n // If FIM Indicator value is 1 i.e. None, disable \"FimBMCMNumber\" and \"FimCouponNumber\" fields and clear there values\r\n if ($(\"#FIMBMCMIndicatorId\").val() == 1) {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n // Clear field values\r\n $(\"#FimBMCMNumber\").val('');\r\n $(\"#FimCouponNumber\").val('');\r\n }\r\n // If FIM indicator has value other than 2 i.e. BillingMemo or CreditMemo, disable \"FimCouponNumber\" field and enable \"FimBMCMNumber\" field and clear \"FimCouponNumber\" field value\r\n else if ($(\"#FIMBMCMIndicatorId\").val() != 2) {\r\n //$(\"#FIMBMCMIndicatorId\").attr(\"disabled\", false);\r\n $(\"#FimCouponNumber\").val('');\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n }\r\n // If FIM Indicator has value 2 i.e. FIM, enable \"FimBMCMNumber\" and \"FimCouponNumber\" fields\r\n else {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44')\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44' || $(\"#SourceCodeId\").val() == '45' || $(\"#SourceCodeId\").val() == '46') {\r\n $(\"#FIMBMCMIndicatorId\").val('2');\r\n //SCP:37078 Comment below code to make FIMBMCMIndicatorId field to editable.\r\n // $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n }\r\n }\r\n else {\r\n // Disable FIM related fields\r\n// if ($(\"#FimBMCMNumber\").val() != '') {\r\n// $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n// } else {\r\n// $(\"#FimBMCMNumber\").removeAttr(\"readonly\");\r\n// }\r\n// if ($(\"#FimCouponNumber\").val() != '') {\r\n// $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n// } else {\r\n// $(\"#FimCouponNumber\").removeAttr(\"readonly\");\r\n// }\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n else if ($(\"#RejectionStage\").val() == 1) {\r\n // If RM being created is standalone execute If block else execute Else block\r\n if (!isFromBillingHistory) {\r\n // If RM has coupon breakdown disable FIM related fields\r\n if (cpnExist == \"True\") {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n else {\r\n // If FIM Indicator value is 1 i.e. None, disable \"FimBMCMNumber\" and \"FimCouponNumber\" fields and clear there values\r\n if ($(\"#FIMBMCMIndicatorId\").val() == 1) {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n // Clear field values\r\n $(\"#FimBMCMNumber\").val('');\r\n $(\"#FimCouponNumber\").val('');\r\n }\r\n // If FIM indicator has value other than 2 i.e. BillingMemo or CreditMemo, disable \"FimCouponNumber\" field and enable \"FimBMCMNumber\" field and clear \"FimCouponNumber\" field value\r\n else if ($(\"#FIMBMCMIndicatorId\").val() != 2) {\r\n //$(\"#FIMBMCMIndicatorId\").attr(\"disabled\", false);\r\n // Enable fields\r\n $(\"#FimCouponNumber\").val('');\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n }\r\n // If FIM Indicator has value 2 i.e. FIM, enable \"FimBMCMNumber\" and \"FimCouponNumber\" fields\r\n else {\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", false);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", false);\r\n }\r\n\r\n // If SourceCode is equal to 44 i.e. FIM rejection disable \"FIMBMCMIndicatorId\" field\r\n if ($(\"#SourceCodeId\").val() == '44')\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n else {\r\n // Disable FIM related fields\r\n $(\"#FimBMCMNumber\").attr(\"readOnly\", true);\r\n $(\"#FimCouponNumber\").attr(\"readOnly\", true);\r\n $(\"#FIMBMCMIndicatorId\").attr(\"disabled\", true);\r\n }\r\n }\r\n} // end EnableDisableFmBmCmIndicator()", "function performRequest() {\n $.ajax({\n type: 'GET',\n url: generateUrl(ajaxUrl),\n dataType: 'html',\n delay: 400,\n beforeSend: function() {\n if (processing) {\n return false;\n } else {\n processing = true;\n }\n },\n success: function (html) {\n $('#filtered-list').replaceWith(html);\n processing = false;\n }\n });\n }", "function AddAsync(IDQuota) {\n //Verifico che il coupon non sia in attesa\n var objHid = $('#' + sHidAttesa);\n if (objHid.val() != 0) return;\n\n var link = $('#' + sCPbtn);\n var txt = $('#' + sCPqt);\n\n txt.val(IDQuota);\n link.click();\n}", "function CreateCardOrder()\n{ \n // öffnen und schließen von ladebildschirm und editor\n $(\"#order_dialog\" ).dialog( \"close\" );\n $(\"#order_AJAXMessage\").html(\"Kartenbestellung wird erstellt ... <img src='./Library/Images/loader.gif' />\");\n $(\"#order_loading\" ).dialog(\"open\"); \n \n // AJAX call\n var response = $.parseJSON(AJAX_CreateCardOrder());\n \n // Auswerten der Antwort\n if(response.success)\n {\n var ai = oTable.fnAddData( GetRequirementDetailsForDataTable(response.id) );\n var n = oTable.fnSettings().aoData[ ai[0] ].nTr; \n n.setAttribute('id', 'row_' + response.id);\n $(\"#order_AJAXMessage\").html(response.message); \n setTimeout(function(){\n $(\"#order_loading\").dialog( \"close\" );\n }, 5000);\n }\n else\n {\n $(\"#order_AJAXMessage\").html(response.message); \n }\n}", "function generateAproposdenous(){\n var request = new XMLHttpRequest();\n var url = \"/aproposdenous\";\n var lan = document.getElementById(\"cboxfltLang\").value;\n if (lan!=null && lan!=\"\") url = url +'?lan=' +lan;\n request.open(\"GET\", url, true);\n request.send(); \n if( $('#blockAproposdenous').hasClass('in') )\n var a=1;\n else \n $(\"#blockAproposdenous\").modal({backdrop: 'static', keyboard: false}); //(\"show\");\n} // end a propos de nous", "function getNextQuestion(){\n console.log(\"fetching next question\");\n \n //progress bar\n let width = ((qno+1)*100)/totalQuestions;\n $('#myBar').css(\"width\",width + '%'); \n $('#myBar').html(qno+1+'/'+totalQuestions);\n \n //skip for the fetching first question\n if(qno>0){ \n let selectedValue = $(\"input[name='option']:checked\").val();\n if(selectedValue==ques.answer){\n rightAns++;\n } else {\n wrongAns++;\n }\n //Clear the previous checked option for the next question \n $('input[name=\"option\"]').prop('checked', false);\n }\n\n\n if(qno<totalQuestions){\n $('#question-div').hide(); \n console.log(\"getting next question \",qno);\n $.getJSON(url+'questions/question/'+qno, {}, function (res, textStatus, jqXHR){ \n ques = res.data.question;\n $('#question').html(ques.question);\n $('#option0').html(ques.options[0]);\n $('#option1').html(ques.options[1]);\n $('#option2').html(ques.options[2]);\n $('#option3').html(ques.options[3]); \n $('#option0Input').val(ques.options[0]);\n $('#option1Input').val(ques.options[1]);\n $('#option2Input').val(ques.options[2]);\n $('#option3Input').val(ques.options[3]); \n $('#question-div').show();\n qno++;\n if(qno==totalQuestions-1){\n $('#next-btn').val('submit');\n }\n $('#marker'+(qno-1)).css(\"background-color\",'green');\n startTimer();\n }); \n } else{\n console.log(\"submit test\");\n submit();\n }\n\n\n\n // $('input[name=\"option\"]').click(function(){\n // $('marker'+qno).css(\"background-color\",\"green\");\n // })\n}", "function eventsTPL(){\n clog('inside eventsTPL');\n gvar.sTryEvent = null;\n\n // shorthand for .XKQR wrapper\n var $XK = $(\"#\"+gvar.qID);\n \n $XK.find('#sbutton').click(function(ev){\n do_an_e(ev);\n _BOX.init();\n _BOX.presubmit();\n });\n $XK.find('#sadvanced').click(function(ev){\n do_an_e(ev);\n if( $('#form-title').closest('div.condensed').length == 1 )\n $('#form-title').val(\"\");\n $('#formform').submit();\n });\n $XK.find('#spreview').click(function(ev){\n do_an_e(ev);\n _BOX.init();\n _BOX.preview();\n });\n $XK.find('#squote_post').click(function(){\n _AJAX.quote( $(this), function(){\n func = function(){\n gvar.sTryRequest && gvar.sTryRequest.abort();\n };\n _NOFY.init({msg:'Fetching... <a class=\"btn-dismiss\" href=\"javascript:;\">Dismiss</a>', cb:func, btnset:false});\n }, function(){\n var $him = $('#notify_msg .btn-dismiss');\n clear_quoted($him);\n _TEXT.lastfocus();\n });\n });\n\n $XK.find('#squick_quote').click(function(){\n _QQparse.init();\n });\n \n $XK.find('#scancel_edit').click(function(){ _AJAX.edit_cancel() });\n $XK.find('#clear_text').click(function(){\n _TEXT.set(\"\");\n _TEXT.pracheck();\n _DRAFT.provide_draft()\n $(this).hide()\n });\n $XK.find('#qr_getcont').click(function(){\n var $ifr = $(\"#ifr_content\"), values = trimStr( $ifr.val() );\n\n if( values ){\n _TEXT.init();\n _TEXT.add( values + \"\\n\\n\" );\n _TEXT.pracheck();\n $ifr.val('');\n }\n do_click($(\".btn-dismiss\").get(0))\n clear_quoted( $('#notify_msg .btn-dismiss') );\n });\n $XK.find('#qr_chkval').click(function(){\n\n precheck_quoted( $('#tmp_chkVal').val() );\n });\n $XK.find('.ts_fjb-tags #form-tags').keydown(function(ev){\n var A = ev.keyCode || ev.keyChar;\n if(A === 9){\n do_an_e(ev);\n gvar.$w.setTimeout(function(){ $('#sbutton').focus() }, 50);\n }\n });\n $XK.find('.edit-reason #form-edit-reason').keydown(function(ev){\n var A = ev.keyCode || ev.keyChar;\n if(A === 9){\n do_an_e(ev);\n gvar.$w.setTimeout(function(){\n if( $('.ts_fjb-tags').is(':visible') )\n $('.ts_fjb-tags input[type=\"text\"]:first').focus()\n else\n $('#sbutton').focus()\n }, 50);\n }\n });\n $XK.find('.additional_opt_toggle').click(function(){\n var $me = $(this);\n var $fg = $me.closest(\".form-group\");\n var $adt = $fg.find('#additionalopts');\n if( $adt.is(':visible') ){\n $adt.hide();\n $me.removeClass('active');\n }\n else{\n $adt.show();\n $me.addClass('active');\n }\n })\n\n $XK.find('#settings-button').click(function(){ _STG.init(); });\n\n // collect mnu datashortcut\n var DScuts = [];\n var regs_fn = {\n 'click_BIU': click_BIU,\n 'do_insertCustomTag': do_insertCustomTag,\n };\n var reserved_CSA;\n \n $XK.find('.markItUpHeader > ul > li.markItUpButton a[data-shortcut]').each(function(){\n var $me = $(this);\n var dumy, cls, dts = $me.attr(\"data-shortcut\");\n if( dts && is_good_json(dts) ){\n dts = JSON.parse( dts );\n if( !dts.key ) return true;\n \n\n var kn, dCSA = (function(csa_){\n var dCSA_ = '';\n dCSA_ += (csa_.indexOf('ctrl') != -1 ? '1' : '0');\n dCSA_ += (csa_.indexOf('shift') != -1 ? '1' : '0');\n dCSA_ += (csa_.indexOf('alt') != -1 ? '1' : '0');\n return dCSA_;\n })(dts.csa);\n kn = String(dts.key.charCodeAt(0));\n\n dumy = {};\n dumy[dCSA+','+kn] = {\n kn: kn,\n bb: dts.key,\n el: $me,\n csa: dCSA,\n fn: ([\"ev_biu\",\"ev_align\"].indexOf($me.attr(\"class\")) !== -1 ? \"click_BIU\" : \"do_insertCustomTag\")\n };\n DScuts.push( dumy );\n }\n });\n\n\n // preload global shortcut (window) to intercept in editor, if any\n var std_fn = function(){ scrollToQR() };\n var CSA_tasks = [\n { // default: Ctrl+Q\n name: 'quickreply',\n csa: gvar.settings.hotkeykey.toString()+'_'+gvar.settings.hotkeychar.charCodeAt(),\n fn: function(){ std_fn() }\n },\n { // Alt+Q [FF|Chrome] --OR-- Ctrl+Alt+Q [Opera]\n name: 'fetch',\n csa: (!gvar.isOpera ? '0,0,1' : '1,0,1')+'_'+'81',\n fn: function(){\n std_fn();\n do_click($('#squote_post').get(0));\n }\n },\n { // Alt+C [FF|Chrome] --OR-- Ctrl+Alt+Q [Opera]\n name: 'qq',\n csa: (!gvar.isOpera ? '0,0,1' : '1,0,1')+'_'+'67',\n fn: function(){\n std_fn();\n do_click($('#squick_quote').get(0));\n }\n },\n { // Ctrl+Shift+Q\n name: 'dismisquote',\n csa: '1,1,0'+'_'+'81',\n fn: function(){\n do_click($('#sdismiss_quote').get(0));\n }\n },\n { // Ctrl+Shift+D\n name: 'draft',\n csa: '1,1,0'+'_'+'68',\n fn: function(){\n if( !$('#qrdraft').hasClass('goog-btn-disabled') ){\n std_fn();\n do_click($('#qrdraft').get(0));\n }\n }\n },\n ];\n var CSA_index_reserved = {};\n for(var j=0, jL=CSA_tasks.length; j<jL; j++)\n CSA_index_reserved[CSA_tasks[j][\"csa\"]] = CSA_tasks[j][\"fn\"];\n\n \n\n // window events\n // global-window-shortcut\n $(window).keydown(function (ev) {\n var A = ev.keyCode, doThi=0, CSA_tasks, pCSA_Code, pCSA = (ev.ctrlKey ? '1':'0')+','+(ev.shiftKey ? '1':'0')+','+(ev.altKey ? '1':'0');\n\n // clog(\"input:\"+pCSA+'_'+A);\n \n if( A == 27 && $(\"#\" + _BOX.e.dialogname).is(\":visible\") && $(\"#\" + _BOX.e.dialogname).css('visibility')=='visible' ){\n do_an_e(ev);\n close_popup();\n $(\"#\" + gvar.tID).focus();\n return;\n }\n\n if( pCSA == '1,0,0' && A == 192 && gvar.readonly ){ // 192 for `: open the hive\n $('.button_qrmod,.button_qq,.xkqr').removeClass('hide');\n doThi = 1;\n scrollToQR();\n }\n\n // panic-button reset_settings then reload page\n // Ctrl+Shift+` = Panic Reset Settings\n if( pCSA == '1,1,0' && A == 192 ){ // 192 for `\n _STG.reset_settings( true );\n doThi = 1;\n return !1;\n }\n \n if( (pCSA=='0,0,0' || pCSA=='0,1,0') || A < 65 || A > 90 )\n return;\n \n\n\n if( !gvar.readonly ){\n\n pCSA_Code = pCSA+'_'+A;\n \n // comparing...\n if( \"undefined\" != typeof CSA_index_reserved[pCSA_Code] ){\n CSA_index_reserved[pCSA_Code]();\n doThi = 1;\n }\n }\n\n if( doThi ){\n do_an_e(ev);\n return !1;\n }\n }).resize(function () {\n\n resize_popup_container();\n });\n\n\n // editor events: [focus,blur,keydown,keyup]\n // assigning several action, eg. watch draft, fixed toolbar martItUp,\n $XK.find('#'+gvar.tID).focus(function(){\n if( gvar.settings.txtcount ){\n $XK.find('.counter').first().addClass('kereng');\n _TEXTCOUNT.init('#'+gvar.qID+' .counter')\n }\n\n // fixed_markItUp\n if( gvar.settings.fixed_toolbar ){\n clog(\"activating onfocus event\");\n gvar.sTryWatchWinScroll &&\n clearInterval(gvar.sTryWatchWinScroll);\n gvar.sTryWatchWinScroll = setInterval(function(){\n fixed_markItUp()\n }, 50);\n }\n }).blur(function(){\n if( gvar.settings.txtcount ){\n $XK.find('.counter').first().removeClass('kereng');\n _TEXTCOUNT.dismiss();\n }\n\n if( gvar.settings.fixed_toolbar ){\n if( gvar.sTryWatchWinScroll ){\n clearInterval(gvar.sTryWatchWinScroll);\n\n gvar.sTryPreUnFixed_markItUp = setTimeout(function(){\n\n $XK.removeClass(\"fixed_markItUp\");\n }, 789);\n }\n }\n }).keydown(function(ev){\n var B, pCSA_Code,\n A = ev.keyCode || ev.keyChar,\n pCSA = (ev.ctrlKey ? '1':'0')+','+(ev.shiftKey ? '1':'0')+','+(ev.altKey ? '1':'0');\n\n if(A === 9){\n do_an_e(ev);\n gvar.$w.setTimeout(function(){\n if( $XK.find('.edit-reason').is(':visible') )\n $XK.find('.edit-reason input[type=\"text\"]:first').focus()\n else\n $XK.find('#sbutton').focus()\n }, 50);\n }\n \n // area kudu dg CSA\n if( (pCSA=='0,0,0' || pCSA=='0,1,0') || (A < 65 && (A!=13 && A!=9)) || A > 90 )\n return;\n\n pCSA_Code = pCSA+'_'+A;\n\n if( \"undefined\" != typeof CSA_index_reserved[pCSA_Code] ){\n clog(\"intercept global shortcut.\");\n CSA_index_reserved[pCSA_Code]();\n return;\n }\n \n var asocKey = {\n '001,83':'sbutton' // [Alt+S] Submit post\n ,'001,80':'spreview' // [Alt+P] Preview\n ,'001,88':'sadvanced' // [Alt+X] Advanced\n };\n var ds, dsL = DScuts.length;\n if( dsL ){\n for(var j=0; j<dsL; j++){\n for(var kn in DScuts[j])\n asocKey[String(kn)] = {\n bb: DScuts[j][kn][\"bb\"],\n el: DScuts[j][kn][\"el\"],\n csa: DScuts[j][kn][\"csa\"],\n fn: DScuts[j][kn][\"fn\"]\n };\n }\n }\n\n\n // indexing keys\n var Acsa, fn, parts, indexedKeyNum = [13];\n for(var strKeyNum in asocKey){\n parts = strKeyNum.split(\",\");\n if( parts && parts[1] )\n indexedKeyNum.push(parseInt(parts[1]));\n }\n\n if(ev.ctrlKey){\n if( $.inArray( A, indexedKeyNum ) != -1 ){\n Acsa = '100,'+A;\n\n if(A===13){\n if( gvar.readonly )\n return;\n _BOX.init();\n _BOX.presubmit();\n }else{\n\n if( asocKey[Acsa] && asocKey[Acsa][\"csa\"] == '100') {\n try{\n fn = regs_fn[ asocKey[Acsa][\"fn\"] ];\n }catch(e){ clog(\"ERR:\"+e.message) }\n\n if( \"function\" === typeof fn ){\n fn( asocKey[Acsa][\"el\"] );\n do_an_e(ev);\n }\n }\n }\n }\n }else if(ev.altKey){\n if( gvar.readonly )\n return;\n\n Acsa = '001,'+A;\n do_an_e(ev);\n do_click( $XK.find('#' + asocKey[Acsa]).get(0));\n }\n }).keyup(function(ev){\n\n $XK.find('#clear_text').toggle( $(this).val()!==\"\" );\n });\n \n\n\n $XK.find('#qrtoggle-button').click(function(){\n $XK.find('#formqr').toggle(120, function(){\n toggleTitle();\n $XK.find('#'+gvar.tID).focus();\n });\n });\n\n\n if( gvar.settings.qrdraft ){\n $('#'+gvar.tID).keypress(function(e){\n var A = e.keyCode;\n if( A>=37 && A<=40 ) return; // not an arrow\n if( $('#qrdraft').get(0) )\n _TEXT.saveDraft(e);\n clearTimeout( gvar.sITryLiveDrafting );\n gvar.isKeyPressed=1; _DRAFT.quick_check();\n });\n \n // initialize draft check\n _DRAFT._construct();\n _DRAFT.check();\n\n // event click for save_draft\n $(\"#qrdraft\").click(function(){\n var text, disb, $me=$(this);\n text = $('#'+gvar.tID).val();\n disb = 'goog-btn-disabled';\n if( $me.hasClass(disb) ) return;\n if( $me.attr('data-state') == 'idle' ){\n _TEXT.init();\n if( !text ){\n _TEXT.set( gvar.tmp_text );\n _TEXT.lastfocus();\n }\n else{\n _TEXT.add( gvar.tmp_text );\n }\n $('#draft_desc').html('');\n $me.text('Saved').attr('data-state', 'saved');\n _DRAFT.switchClass(disb);\n _TEXT.setElastic(gvar.maxH_editor, 1);\n }else{\n if( !text )\n _DRAFT.save();\n }\n });\n }\n\n if( !gvar.settings.txtcount )\n $XK.find('.counter').hide();\n \n eventsController();\n resize_popup_container(); // init to resize textarea\n _TEXT.setElastic(gvar.maxH_editor);\n\n // check if css_check defined\n (typeof gvar.on_demand_csscheck=='function')\n && gvar.on_demand_csscheck();\n}", "function send_req() {\n\n var flag = true;\n\n var routeId = $('#create_req').attr('req-ro');\n var requested_address = $('#requested_address').val();\n var route_address = $('#route_address').val();\n var requested_qty = $('#requested_qty').val();\n\n if (requested_address == \"\") {\n $('#requested_address').addClass('route_error');\n flag = false;\n }\n if (requested_qty == \"\") {\n $('#requested_qty').addClass('route_error');\n flag = false;\n }\n if (route_address == \"\") {\n $('#route_address').addClass('route_error');\n flag = false;\n }\n\n var security_token = $('#_token').val();\n var base_url = $('#_base').val();\n\n if (flag == true) {\n\n $.ajax({\n method: \"POST\",\n dataType: \"json\",\n url: base_url + \"/submit_route_req\",\n data: { 'routeId': routeId, 'r_address': requested_address, 'req_route': route_address, 'requested_qty': requested_qty, '_token': security_token }\n })\n .done(function (res) {\n if (res.status == true) {\n $('#showResponse').html(res.message);\n\n setTimeout(function () {\n $('#showResponse').html(\"\");\n $('#create_req').modal('hide');\n location.reload();\n }, 2000);\n\n } else {\n $('#showResponse').html(res.message);\n setTimeout(function () {\n $('#showResponse').html(\"\");\n $('#create_req').modal('hide');\n location.reload();\n }, 2000);\n \n }\n });\n\n } else {\n return false;\n }\n\n}", "function addScreenshots() {\n var ctx = $('#screenshot_context').val();\n $.ajax({\n type: \"POST\",\n url: oatPath + \"/ajax.php?action=addScreenshots\",\n data: JSON.stringify({ context_id: ctx, screenshots: uploadedFiles }),\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: function (data) {\n $('#screenshot_files').empty();\n $('#screenshot_upload_button').attr('disabled', 'disabled');\n if (data.status == 'KO') {\n alert(\"Couldn't save screenshot: \" + data.reason);\n }\n refreshScreenshots();\n },\n failure: function (errMsg) {\n alert(errMsg);\n }\n });\n}", "function areAllDetailsPopulated() {\n if (\n document.getElementById(\"jiraTitle\").value != \"\" &&\n document.getElementById(\"projectName\").value != \"\" &&\n document.getElementById(\"issueType\").value != \"\" &&\n document.getElementById(\"searchString\").value != \"\" &&\n document.getElementById(\"stackTrace\").value != \"\" &&\n document.getElementById(\"eventOccurrences\").value != \"\"\n ) {\n disableCreateJiraButton = false;\n } else {\n disableCreateJiraButton = true;\n }\n\n console.log(\"disableCreateJiraButton:\" + disableCreateJiraButton);\n document.getElementById(\"createJira\").disabled = disableCreateJiraButton;\n }", "function ultratools_scan(url, button, output_loc){\n var process_status = $(\"#process_status\");\n $.ajax({\n url: ajaxurl,\n type: 'post',\n data: {\n q: 'ultratools_scan', url: url\n },\n assync: false,\n beforeSend: function (){\n process_status.text(\"Cheking if \"+url+\" is listed on any Spam Blackist...\");\n disableButton(button);\n },\n success: function (data){\n process_status.html(\"\");\n output_loc.append( \"<br/>\"+data+\"<hr>\" );\n enableButton(button);\n console.log(data);\n },\n error: function (data){\n enableButton(button);\n }\n });\n }", "function check_for_patreon_debt(barcode, element) {\n console.log(\"jQuery: Check dept\")\n $.getJSON(\"https://mypages.lib.ltu.se/account_status_koha.php?barcode=\" + barcode + \"&callback=?\", function(jsonp) {\n // Check dept\n if (parseInt(jsonp.debt) >= 50) {\n // Found dept, ask for confirm.\n if (confirm(\"Är du säker på att du vill förnya boken? Låntagaren har \" + parseInt(jsonp.debt).toFixed(0) + \" kr i skuld!\")) {\n console.log(\"getJSON: Unlocking bound elements and click.\");\n $(element).closest(\"form\").off('submit').submit();\n }\n } else {\n console.log(\"getJSON: No dept\");\n $(element).closest(\"form\").off('submit').submit();\n }\n })\n .fail(function(jqxhr, textStatus, error) {\n var err = textStatus + \", \" + error;\n console.log(\"getJSON: Request Failed: \" + err);\n $(element).closest(\"form\").off('submit').submit();\n });\n}", "function submitQuickAddTransactionForm() {\n var form = $(\"#quickAddTransactionFormId\");\n $.ajax({\n beforeSend: function () {\n $(\"#quickAddModal-Body\").html('<div class=\"\" id=\"ajax-Accounts-loader1\" style=\"text-align: center;\"><div class=\"\" style=\"display: inline-block;\"><i class=\"fa fa-spinner fa-spin fa-3x fa-fw\"></i></div></div>');\n },\n type: \"Post\",\n url: \"/Saver/QuickAddTransaction\",\n data: form.serialize(),\n error: function (response) {\n ErrorNotification(\"POST Error\", \"There was an error, please try again. If you continue to have problems please contact support.\");\n console.log(\"Error submitQuickAddTransactionForm()! \" + response);\n },\n success: function (response) {\n console.log(\"Success! submitQuickAddTransactionForm()\");\n if (response == \"Success\") {\n $(\"#quickAddModal\").modal('hide');\n SuccessNotification(\"Save Sucessful!\", \"Form submission was successful and data was saved!\");\n }\n else {\n $(\"#quickAddModal-Body\").html(response);\n ErrorNotification(\"Error\", \"There was an error, please try again. If you continue to have problems please contact support.\");\n }\n }\n })\n}", "function saveCode(){\n var sendata = holdresult.val();\n $.ajax({\n type: \"POST\",\n url: relative + \"ajax/create.php\",\n cache: false,\n data: {\n create: sendata\n }\n })\n .fail(function(error) {\n alert_placeholder.html(error.statusText);\n $('.toast').toast('show');\n })\n .done(function(msg) {\n if (msg.length) {\n var getdata = JSON.parse(msg);\n if (getdata.error) {\n bootbox.alert({\n message: getdata.error,\n size: 'small'\n });\n } else {\n var filepath = getdata.filedir+'/'+getdata.basename;\n\n var downloadlinks = '<button class=\"btn btn-default svgtopng\" data-path=\"'+filepath+'\">'+pngIcon+'</button><a href=\"#\" class=\"btn btn-default d-none preload-png\">'+loadIcon+'</a><a class=\"serve-png d-none\" href=\"'+filepath+'.png\" download=\"'+getdata.basename+'.png\" data-path=\"'+filepath+'\">PNG</a>';\n downloadlinks = downloadlinks + '<a class=\"btn btn-default serve-svg\" href=\"'+filepath+'.svg\" download=\"'+getdata.basename+'.svg\">'+svgIcon+'</a>';\n if (! resultholder.data('gradient')) {\n downloadlinks = downloadlinks + '<a target=\"_blank\" class=\"btn btn-default\" href=\"'+relative+'pdf/get.php?file='+filepath+'\">'+pdfIcon+'</a>';\n }\n\n downloadlinks = downloadlinks + '<button class=\"btn btn-default print\">'+printIcon+'</button>';\n\n linksholder.html(downloadlinks);\n generate_qrcode_btn.attr('disabled', true);\n\n obj.find('.print').on('click', function(){\n printIt('.serve-svg');\n });\n }\n }\n // Callback\n // option.saveCode(getdata);\n });\n }", "function enableButtons(){\n $(\"#new-contact\").removeAttr(\"disabled\");\n}", "function rawSubmitqtum(thisbtn) {\n\t$(thisbtn).val('Please wait, loading...').attr('disabled',true);\n\ttxhex = $(\"#rawTransaction\").val().trim();\n\t$.ajax({\n\t\ttype: \"GET\",\n\t\turl: `https://`+ multiWalletApiDomain +`/qtum/broadcast/${txhex}`,\n\t\terror: function(data) {\n\t\t\terrcode = data.responseText;\n\t\t\tvar r = ' Failed to Broadcast.'; // this wants a preceding space\n\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(r + \" \" + errcode).prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t},\n\t\tsuccess: function(data) {\n\t\t\tif(data) {\n\t\t\t\tvar txid = data.txid; // is this right?\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-success').removeClass('alert-danger').removeClass(\"hidden\").html(` Txid: <a href=\"https://explorer.qtum.org/tx/${txid}\"> ${txid} </a>`);\n\t\t\t} else {\n\t\t\t\t$(\"#rawTransactionStatus\").addClass('alert-danger').removeClass('alert-success').removeClass(\"hidden\").html(' Unexpected error, please try again').prepend('<span class=\"glyphicon glyphicon-exclamation-sign\"></span>');\n\t\t\t}\n\t\t},\n\t\tcomplete: function (data, status) {\n\t\t\t$(\"#rawTransactionStatus\").fadeOut().fadeIn();\n\t\t\t$(thisbtn).val('Submit').attr('disabled',false);\n\t\t}\n\t});\n}" ]
[ "0.62738734", "0.6176023", "0.6144124", "0.61334085", "0.6055388", "0.6021078", "0.5984287", "0.59819", "0.5950669", "0.59487134", "0.59288216", "0.5913086", "0.5913086", "0.5883818", "0.58822864", "0.58688396", "0.5860038", "0.5848878", "0.58375543", "0.58309895", "0.5824634", "0.58209586", "0.58137906", "0.581178", "0.58041644", "0.58035624", "0.57931596", "0.57841283", "0.5781007", "0.5776629", "0.5775474", "0.5775412", "0.5745879", "0.5732044", "0.57075715", "0.5700109", "0.5698336", "0.5693846", "0.56783426", "0.5676623", "0.56764364", "0.56762", "0.5674132", "0.5667702", "0.5666617", "0.56660056", "0.566253", "0.56583595", "0.5651729", "0.5647646", "0.56469756", "0.5638815", "0.5631453", "0.562734", "0.5622646", "0.56201553", "0.561606", "0.5610523", "0.5606708", "0.56050235", "0.5598662", "0.55892074", "0.5588756", "0.5584915", "0.5584442", "0.5578462", "0.55782264", "0.5575323", "0.55750257", "0.55747473", "0.5574622", "0.55711436", "0.5565361", "0.556067", "0.555994", "0.55594623", "0.5558883", "0.55523074", "0.55522543", "0.5551357", "0.55450726", "0.5541491", "0.5541159", "0.5539829", "0.5532914", "0.552968", "0.5523742", "0.55222064", "0.55204755", "0.5516357", "0.5513643", "0.55076945", "0.55072635", "0.55051357", "0.5503557", "0.55035484", "0.5503433", "0.55022776", "0.5500752", "0.5498719", "0.54984164" ]
0.0
-1
a function to get the necessary data
async function getData() { // Commented below is a request I would have made to an API, instead I will just get the mock data try { // const response = await axios({ // method: "GET", // url: ``, // }); // setData(response) setData(mockData); } catch (error) { console.log(error); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_data() {}", "getData(){}", "function getData() {\n return {\n ergReps: ergReps,\n bikeReps: bikeReps,\n repRate: repRate,\n totTime: totTime,\n Distance: Distance\n }\n }", "GetData() {}", "getData () {\n }", "function accessesingData2() {\n\n}", "function accessesingData2() {\n\n}", "function accessesingData1() {\n\n}", "function accessesingData1() {\n\n}", "function getData(data) {\n dataActivity = data.activity;\n dataType = data.type;\n dataAccessibility = data.accessibility;\n dataPrice = data.price;\n dataParticipants = data.participants;\n}", "function RequestLoadGeneralData() {\n\n}", "function getGeneralData(){\n\t\t// Idioma\n//\t\tfind(\"//script[@type='text/javascript']\", XPFirst).src.search(/\\/([^\\/]+)?3.js$/);\n\t\tfind(\"//img[contains(@src, 'plus.gif')]\", XPFirst).src.search(/\\/img\\/([^\\/]+)\\//);\n\t\tidioma = RegExp.$1;\n\n\t\t// Ruta al pack grafico\n\t\tfind(\"//link[@rel='stylesheet']\", XPFirst).href.search(/^(.*\\/)(.*)3.css$/);\n\t\tpack_grafico = RegExp.$1;\n\n\t\t// Identificador de aldea actual\n\t\tid_aldea = getIdAldea();\n\n\t\t// Identificador de usuario\n\t\tfind(\"//td[@class='menu']\", XPFirst).innerHTML.search(/spieler.php\\?uid=(\\d+)\"/);\n\t\tuid = RegExp.$1;\n\n\t\t// Nombre del servidor\n\t\tlocation.href.search(/http:\\/\\/(.*)\\//);\n\t\tserver = RegExp.$1;\n\n\t\t// Por cada tipo de recurso: cantidad actual almacenada, capacidad total del almacen / granero y produccion por segundo\n\t\tfor (var i = 0; i < 4; i++){\n\t\t\tactual[i] = get('l'+(i+1)).innerHTML.split(\"/\")[0];\n\t\t\ttotal[i] = get('l'+(i+1)).innerHTML.split(\"/\")[1];\n\t\t\tproduccion[i] = get('l'+(i+1)).title/3600;\n\t\t}\n\n\t\t// Plus\n\t\tif (find(\"//img[contains(@src, 'travian1.gif')]\", XPFirst)) plus = true; else plus = false;\n\t}", "function getBeerData() {\n let data = FooBar.getData();\n beers = JSON.parse(data).beertypes;\n //This is for Section 5: \n beerInfo();\n}", "function getdata() {\n\n var url = `/data`;\n\n d3.json(url).then(function(xx) {\n\n data = []\n // xx.slice(s, e)\n globaldata = xx;\n unfiltered = xx;\n actual = [], minute = []\n \n makedata();\n})\n}", "function getdata() {\n faxianSearchInfo.addition_search.first_start_time_or = getMonthStartDate()\n faxianSearchInfo.addition_search.last_start_time_or = getMonthEndDate()\n}", "function getData () {\n return requestService.getTop()\n .then(response => {\n return parser.parseBody(response);\n })\n}", "function getData(data) {\n return data;\n}", "function getData() {\n let name = qs(\"select\").value;\n let url = URL_BASE + name + \"/\";\n fetch(url)\n .then(checkStatus)\n .then(response => response.json())\n .then(genData)\n .catch(handleError);\n }", "getData() {\n \n return {\n \n } \n }", "getData() {\n \n}", "function getData(data) {\n return data;\n}", "function getFeeData() {\n\t\t$.getJSON('fees.json', function(data) {\n\t\t \t\n\t\t \tfeeStructure = data;\n\n\t\t}).done(function() {\n\t\t\t\n\t\t\torderItemCost(orders);\n\t\t\tdistributions(orders);\n\n\t\t});\n\t}", "function grabTableData() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('mtData'));\n Logger.log('return:' + JSON.parse(dataForChart));\n return dataForChart;\n}", "function getData() {\n var data;\n try {\n data = require(dataPath);\n } catch (e) {\n console.log(e);\n data = {};\n }\n ['feeds', 'homepages', 'emails', 'openid', 'foaf', 'keys'].forEach(function (key) {\n if (!Array.isArray(data[key])) {\n data[key] = [];\n }\n });\n return data;\n }", "function accessesingData1() {\n return store3[1]['inventory sold']['Berry Bites'];\n}", "function getUserData(u_id){\n// console.log(\"getUserData\");\n \n getLatestInspections(u_id);\n getLatestReports(u_id);\n getIAPStatus(u_id);\n getBusinessNotes(u_id);\n \n //waiting for 2 second to print values on console\n //the method only used for testing should be removed in the release version\n setTimeout(printValues,2000);\n}", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\n\t\t\t// I'm calling updateCallback to tell it I've got new data for it to munch on.\n\t\t\tupdateCallback(newData);\n\t\t}", "function dataFunc(data) {\n console.log(data.getData());\n console.log(data.getColumns());\n }", "function getData() {\n StatusService.startWaiting();\n $q.all([ScenarioModelService.load(),\n ProcessService.load(),\n LciaMethodService.load(),\n FragmentFlowService.load({scenarioID: scenarioID, fragmentID: fragmentID}),\n ParamModelService.load(scenarioID)])\n .then(handleSuccess,\n StatusService.handleFailure);\n }", "async function getData() {\n await fetchingData(\n endP({ courseId }).getCourse,\n setCourse,\n setIsFetching\n );\n\n await fetchingData(\n endP({ courseId }).getGroups,\n setGroups,\n setIsFetching\n );\n }", "function getData(result) {\n //here resolve the data\n Promise.resolve(result).then(value =>{\n //brack the hole function to differnt function\n getDate(value.updated); //call the function for date\n getTotal(value.total); //call the function for total cases\n getState(value.states); //call the function for state wise cases\n })\n }", "function getAndProcessData() { \n\t\tchooseFileSource();\n\t}", "function grabTableData2() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('rankData'));\n// var testValue = JSON.parse(dataForChart);\n// Logger.log('return:' + testValue);\n return dataForChart;\n }// grabTableData2() function end", "function getData(data){\r\n//Creates a variable oID which stores all of the relevent IDs of the items that I will use in the program\r\n var oID = [554,555,556,557,558,559,560,561,562,563,564,449,436,444,440,447,442,438];\r\n//A for-next loop that populates all of the values in the arrays with the relevent data, based on the ID of the item (stored in oID)\r\n for (var i = 0; i< 18;i++){\r\n itemID[i] = oID[i];\r\n itemName[i] = data[itemID[i]].name;\r\n itemPrice[i] = data[itemID[i]].buy_average;\r\n itemQuantity[i] = data[itemID[i]].overall_quantity;\r\n\r\n }\r\n }", "function getStructuredData () {\n let data = [];\n data.push((getCareerName()) ? getCareerName() : \"\");\n document.querySelectorAll(\"table#tabla_expediente[data-role=table]\").forEach((item) => {\n data.push({\n title: getTitleFromTable(item),\n data: getDataFromTable(item),\n });\n });\n if (data.length > 1)\n return data;\n }", "function accessesingData2() {\n return store3[3]['inventory sold']['Mint Wafers']['quantity'];\n}", "function initData(){\n o_data = user.original_musics;\n d_data = user.derivative_musics;\n c_data = user.collected_musics;\n}", "function getData(){\r\n\r\n \r\n //url of the site where the info comes from\r\n const Launches_URL = \"https://api.spacexdata.com/v2/launches/all\";\r\n \r\n let url = Launches_URL;\r\n\r\n \r\n \r\n \r\n //calling the method that will look through the retrieved info\r\n $.ajax({\r\n dataType: \"json\",\r\n url: url,\r\n data: null,\r\n success: jsonLoaded\r\n });\r\n\t}", "function getBudgetData() {\n budgetFactory.getBudget().then(function(response) {\n var budget = response;\n self.startingMonthID = budget.budget_start_month;\n self.startingYear = budget.budget_start_year;\n setStartingMonth();\n setYears();\n });\n } //end getBudgetData", "function getStudentData() {\r\n // Use Student object to retrieve all available student info\r\n var studentInfo = {\r\n career: user.Student.Career,\r\n faculty: user.Student.Faculty,\r\n departments: user.Student.Departments,\r\n plans: user.Student.PlanTitles,\r\n formOfStudy: user.Student.FormOfStudy,\r\n level: user.Student.Level,\r\n studentNum: user.Student.StudentNumber\r\n };\r\n\r\n // Can log the whole object to check what is being returned\r\n // console.log(studentInfo);\r\n\r\n // Return final result\t\r\n return studentInfo;\r\n}", "function getDetails() {\n\n}", "getData() {\n\n this.getAbi(`/input_abi/${this.getInput(\"sourceAbi\")}`).then(data =>{\n this.addAbi(data)\n }).then(()=>{\n d3.csv(`/input_data/${this.getInput(\"sourceData\")}`).then(data => {\n return this.methodNumberOfCalls(data);\n }).then(data => {\n // data [0] is the # of functions calls\n // data [1] is the average gas expense\n this.drawPieChart(410, 400, 0, \"#plot1\", data[0], 200, \"Number of calls\");\n this.drawPieChart(410, 400, 0, \"#plot2\", data[1], 200, \"Average Gas expense\");\n //this.drawBarChart(data[1], \"#plot2\", 400, 400);\n this.relateToUml(Object.keys(data[0]), \"#uml\");\n\n });\n });\n\n }", "function newdata() {\n\n var date, hour\n\n date = globaldata[e]['date']\n hour = globaldata[e]['hour']\n\n // console.log(date, hour)\n\n return [date, hour];\n}", "getData() {\n \n return {\n \n } \n }", "async getData() {\n const accountTypes = await this.getAccountTypes().then((_accountTypes) => ({\n isFarmer: _accountTypes[0],\n isDistributor: _accountTypes[1],\n isRetailer: _accountTypes[2],\n isConsumer: _accountTypes[3],\n }));\n const items = await this.getItems();\n return {\n accountTypes,\n items,\n };\n }", "function getData()\n\t\t{\n\t\t\tvar newData = { hello : \"world! it's \" + new Date().toLocaleTimeString() }; // Just putting some sample data in for fun.\n\n\t\t\t/* Get my data from somewhere and populate newData with it... Probably a JSON API or something. */\n\t\t\t/* ... */\n\t\t\tupdateCallback(newData);\n\t\t}", "function getData() {\n\n\t// Need a default member ESI\n\treturn Promise.all([\n\t\tmodels.loginModel.find({ discordUser: null }), // The mains\n\t\tesi.corporation.getCorporationMembers( settings.eve.corpID, user )\n\t]).then(( result ) => {\n\t\treturn {\n\t\t\tpilots: result[0],\n\t\t\tESIMembers: result[1]\n\t\t};\n\t});\n}", "function getConfigData() {\n var spreadsheet = SpreadsheetApp.getActiveSpreadsheet()\n // Get the data from the sheet\n var rawAutoData = getValues(spreadsheet, webpageConfig, 'B10', 'E60')\n var rawTeleDate = getValues(spreadsheet, webpageConfig, 'G10', 'J60')\n var keyData = getValues(spreadsheet, webpageConfig, 'F8', 'F60')\n // Convert the data to the above format\n var autoData = parseRawData(rawAutoData)\n var teleData = parseRawData(rawTeleDate)\n return [autoData, teleData, keyData]\n}", "function getData(){\r\n\r\n// Loading and mapping data\r\nd3.json(\"cellphones.json\", function(error, data) {\r\n\r\n // If error, show in console\r\n if (error) return console.warn(error);\r\n\r\n // Create global variable for the dataset\r\n makeMap(data);\r\n\r\n})}", "function getNewsData() {\n return requestNews().then(extractNews);\n}", "function getData (cb) {\n let url = known_data_instances[Math.floor(Math.random() * known_data_instances.length)]\n\n console.log(url)\n // Do something with the requests\n // request(url, {json: true}, (err, res, data) => {\n // if (err) return cb(err)\n\n // cb(null, data)\n // })\n}", "async function getData() {\n try {\n const res2 = await fetch(\"https://api.covid19api.com/summary\");\n const resSummary = await res2.json();\n const restCoun = await fetch(\"https://restcountries.eu/rest/v2/lang/ar\");\n const restArabicCountry = await restCoun.json();\n return { resSummary, restArabicCountry }\n } catch (err) {\n console.log(err + \"Summary error\");\n }\n}", "getData() {\n return {};\n }", "function getData() {\r\n\tvar apiURL = HAM.config.apiBaseURL + \r\n\t\t\t\"/object?apikey=\" + HAM.config.apiKey + \r\n\t\t\t\"&s=random&color=any&size=1&q=dimensions:*&fields=title,people,culture,dated,dimensions,colors,imagepermissionlevel,primaryimageurl\";\r\n\r\n\tvar xmlrequest = new XMLHttpRequest();\r\n\r\n\txmlrequest.onreadystatechange = function() {\r\n\t\tif (this.readyState == 4) {\r\n\t\t\tif (this.status == 200) {\r\n\t\t\t\tcurrent = JSON.parse(this.responseText);\r\n\t\t\t\tprocessData(current);\r\n\t\t\t} else {\r\n\t\t\t\tdone = true;\r\n\t\t\t}\r\n\t\t}\r\n\t};\r\n\t\t\t\r\n\txmlrequest.open(\"GET\", apiURL, true);\r\n\txmlrequest.send();\r\n\r\n\txmlrequest = null;\r\n\tapiURL = null;\r\n}", "getData() {\n const data = super.getData();\n data.labels = this.item.labels;\n \n // Include CONFIG values\n data.config = CONFIG.SFRPG;\n \n // Item Type, Status, and Details\n data.itemType = data.item.type.titleCase();\n data.itemStatus = this._getItemStatus(data.item);\n data.itemProperties = this._getItemProperties(data.item);\n data.isPhysical = data.item.data.hasOwnProperty(\"quantity\");\n data.hasLevel = data.item.data.hasOwnProperty(\"level\") && data.item.type !== \"spell\";\n data.hasHands = data.item.data.hasOwnProperty(\"hands\");\n data.hasCapacity = data.item.data.hasOwnProperty(\"capacity\");\n\n // Armor specific details\n data.isPowerArmor = data.item.data.hasOwnProperty(\"armor\") && data.item.data.armor.type === 'power';\n \n // Action Details\n data.hasAttackRoll = this.item.hasAttack;\n data.isHealing = data.item.data.actionType === \"heal\";\n \n // Spell-specific data\n if ( data.item.type === \"spell\" ) {\n let save = data.item.data.save;\n if ( this.item.isOwned && (save.type && !save.dc) ) {\n let actor = this.item.actor;\n let abl = actor.data.data.attributes.keyability || \"int\";\n save.dc = 10 + data.item.data.level + actor.data.data.abilities[abl].mod;\n }\n }\n\n data.modifiers = this.item.data.data.modifiers;\n \n return data;\n }", "function getTheData() {\n if(expensesR) {\n\tmod3L.remove();\n\tmod3R.remove();\n }\n // get the data\n expensesP = d3.select('#expensesP')\n .property('value');\n expensesR = d3.select('#expensesR')\n .property('value');\n // use the function to show the painting\n show(parseInt(expensesP),parseInt(expensesR));\n}", "getMeshEngineData () {\n let data = {}\n\n if (this.objects[this.selected.metadata.id2]) {\n // console.log('3 ', this.objects[this.selected.metadata.id2][this.selected.metadata.id1][this.selected.metadata.id])\n data = this.objects[this.selected.metadata.id2][this.selected.metadata.id1][this.selected.metadata.id]\n }\n else {\n if (this.objects[this.selected.metadata.id1]) {\n // console.log('2 ', this.objects[this.selected.metadata.id1][this.selected.metadata.id])\n data = this.objects[this.selected.metadata.id1][this.selected.metadata.id]\n }\n else {\n // console.log('1 ', this.objects[this.selected.metadata.id])\n data = this.objects[this.selected.metadata.id]\n }\n }\n\n console.log(data, this.selected.metadata)\n return data\n }", "function getData() {\n console.log(data)\n }", "function accessesingData1() {\n return (store1[\"2015-01-08\"][0][1]);\n}", "function getData() {\n d3.json(\"samples.json\").then(data => {\n\n // retrieve data\n let samples = data.samples.map(samples => { return samples })\n let metaData = data.metadata.map(metadata => { return metadata })\n\n // filter data\n let filteredData = samples.filter(idFilter)\n let filteredMetaData = metaData.filter(idFilter)\n\n // update charts and demo info panel\n updateCharts(filteredData, filteredMetaData[0].wfreq)\n updateDemoInfo(filteredMetaData[0])\n })\n}", "function getInfo(){\t\t\n\treturn cachedInfo;\n}", "function dataLoaded(err,data,m){\n}", "async getBasicInfo(){\n //<== Html selectors ==>\n const fieldNameClassName = \".gsc_oci_field\";\n const valueClassName = \".gsc_oci_value\";\n\n // <== Logic ==>\n\n // get fields \n const page = this.page;\n const fieldNameLst = await page.$$eval(fieldNameClassName, (options) =>\n options.map((option) => option.textContent\n ));\n const valueLst = await page.$$eval(valueClassName, (options) =>\n options.map((option) => option.textContent\n ));\n \n\n // <== Set data to json ==>\n for (var i in fieldNameLst){\n const fieldName = fieldNameLst[i];\n if (fieldName===\"Description\"){\n continue\n }\n if (fieldName==\"Total citations\"){\n continue\n }\n const value = valueLst[i];\n this.json[fieldName] = value\n }\n \n\n }", "function getData() {\n\t\tif(localStorage.getItem('ckFilters')){\n\t\t\treturn JSON.parse(localStorage.getItem('ckFilters'));\n\t\t}\n\n\t\treturn {\n\t\t\twords: '',\n\t\t\taccounts: ''\n\t\t};\n\t}", "loadData() {\n\n }", "function loadData() {\n\n //Users name.\n loadName()\n\n //Users config.\n loadConfig()\n}", "function getdata(){\n\t\n\tif(!flag){\n\t\tgetjson(page);\n\t\tpage++;\n\t } \n\telse {\n\tvar subsets = combine(pdt_arr, giftnum, 0);\n\t\n\t\tfor(var i=0; i < subsets.length; i++)\n\t\t{\t\n\t\t\tfor(var j = 0; j < subsets[i].length; j++){\n\t\t\t\tvar htmlstr = \"Id:\" + subsets[i][j][\"productId\"] + \" Product Name: \"+ subsets[i][j][\"productName\"] + \" = \" + subsets[i][j][\"price\"]+\"<br>\";\n\t\t\t\t$(\"#myid\").append(htmlstr);\n\t\t\t}\n\t\t\t$(\"#myid\").append(\"<br><br>\");\n\t\t}\n\t}\n}", "async function getFuelData () {\n try {\n const genMixURL = config.apiURL + 'generation'\n const factorsURL = config.apiURL + 'intensity/factors'\n const factors = await exports.fetch(factorsURL);\n const genMix = await exports.fetch(genMixURL);\n const fuelData = {\n factors: factors.data,\n generation: genMix.data.generationmix\n }\n return fuelData;\n } catch (e) {\n throw e;\n }\n}", "function loadData(){\n\t\tloadParetoData();\n\t\tloadConstraints();\n\t\t\n\t}", "function fetch_item_data() {\n return wkof.ItemData.get_items('assignments').then(items=>{\n let registry = {};\n items.forEach(item=>{\n if (!item.assignments) return;\n registry[item.id] = {\n level: item.data.level,\n UID: item.object[0].toLowerCase()+item.id,\n available_at: item.assignments.available_at,\n };\n });\n return registry;\n });\n }", "get data() {\n return getIn(privateDataMap.get(this).currentData, this.path);\n }", "function init(){\n getData();\n}", "function getPreliminaryData() {\n return getIDs(15, 0);\n }", "function getTheData() {\n if(totalSale) {\n\tmod1.remove();\n }\n //get the data\n totalSale = d3.select(\"#totalRealSales\")\n .property(\"value\");\n totalTarget = d3.select(\"#totalTargetSales\")\n .property(\"value\");\n //use the function to show the painting\n show(parseInt(totalSale),parseInt(totalTarget));\n}", "function getData() {\n const apiName = 'sbrestapi';\n const path = '/alerts';\n const myInit = {\n // OPTIONAL\n headers: {}, // OPTIONAL\n };\n\n return API.get(apiName, path, myInit).catch(err => {\n console.log('There has been a problem with your fetch operation: ' + err);\n throw err;\n });\n}", "async function getData() {\n const categoriesPromise = fileUtils.read(CATEGORIES_FILE_PATH);\n const titlesPromise = fileUtils.read(TITLES_FILE_PATH);\n const sentencesPromise = fileUtils.read(SENTENCES_FILE_PATH);\n\n return Promise.all([categoriesPromise, titlesPromise, sentencesPromise])\n .then(([categories, titles, sentences]) => ({\n categories,\n titles,\n sentences,\n }));\n}", "function getData(){\n\t\t//load the data\n\t\t$.getJSON(\"data/canada-strikes.geojson\", function(response){\n\t\t\t\t//call relevant functions\n\t\t\t\tprocessData(response);\n\t\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\t\tcreateSequenceControls();\n\t\t});\n}", "function getMockData() {\n let reqD1 = getDay('05/20/2021');\n reqD1.onsuccess = function (e) {\n console.log('got daily goals 05/20/2021');\n console.log(e.target.result);\n };\n\n let reqMG = getMonthlyGoals('12/2021');\n reqMG.onsuccess = function (e) {\n console.log('got monthly goals');\n console.log('Testing Build Process');\n console.log(e.target.result);\n };\n\n let reqYG = getYearlyGoals('2020');\n reqYG.onsuccess = function (e) {\n console.log('got yearly goals 2020');\n console.log(e.target.result);\n };\n\n let reqSE = getSettings();\n reqSE.onsuccess = function (e) {\n console.log('got settings');\n console.log(e.target.result);\n };\n\n //This one is getting an entry that doesn't exist\n let reqYGE = getYearlyGoals('2021');\n reqYGE.onsuccess = function (e) {\n console.log('didnt yearly goals 2021, should be undefined');\n console.log(e.target.result);\n };\n}", "function getData(error, response) {\n if (error) throw error;\n\n // make json format from the data\n data = JSON.parse(response[0].responseText);\n\n // list for all the countries\n var countryArray = [];\n\n for(var i = 0; i < 30; i ++){\n countryArray.push(data.structure.dimensions.series[0].values[i][\"name\"])\n }\n\n // and a list with all the elements from api request\n var oecdArray = [];\n\n // place the values in the list\n for(var i = 0; i < countryArray.length; i ++){\n for(var j = 0; j < 4; j ++){\n var linking = i + \":\" + j + \":0\";\n oecdArray.push(data.dataSets[0].series[linking].observations);\n }\n }\n\n var values = [];\n\n // digging a little bit further so we skip non-values\n for(var i = 0; i < oecdArray.length; i ++){\n values.push(oecdArray[i][0][0]);\n }\n\n // list for all the internet access values\n var internetArray = [];\n\n // internet value is on 0th position in oecdArray\n for (var i = 0; i < values.length; i += 4){\n internetArray.push(values[i]);\n }\n\n // also for the voting turn out values\n var votesArray = [];\n\n // voting rate is on 1th position\n for(var i = 1; i < values.length; i += 4){\n votesArray.push(values[i]);\n }\n\n // share of people with secondary degree\n var secDegreeArray = [];\n\n // which is on the 2th position\n for(var i = 2; i < values.length; i += 4){\n secDegreeArray.push(values[i]);\n }\n\n // and one for the perception of corruption\n var perceptionArray = [];\n\n // which is on 3th position\n for(var i = 3; i < values.length; i += 4){\n perceptionArray.push(values[i]);\n }\n\n // making a dict for indexing later on\n // var wellBeingDict = [];\n\n // linking keys and values in dictionary\n for(var i = 0; i < 30; i++){\n wellBeingDict.push({\n country: countryArray[i],\n internet: internetArray[i],\n votes: votesArray[i],\n education: secDegreeArray[i],\n perception: perceptionArray[i]\n });\n }\n\n var w = 1200;\n var h = 600;\n var padding = 50;\n\n // create scale for width with extent returning the boundary as an array\n var xScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.perception}))\n .nice() // ensure scatters are within the range\n .range([0, w - padding]);\n\n // also for height\n var yScale = d3.scaleLinear()\n .domain([0, 100])\n .range([h - padding, 0]);\n\n // for the radius of a point\n var rScale = d3.scaleLinear()\n .domain(d3.extent(wellBeingDict, function(d) {return d.education}))\n .range([4, 20]);\n\n // and a function for sequential coloring (colorblind-friendly)\n var color = d3.scaleSequential(d3.interpolateRgb(\"#edf8fb\",\"#006d2c\"))\n .domain([d3.min(wellBeingDict, function(d) {return d.education}),\n d3.max(wellBeingDict, function(d) {return d.education})]);\n\n // function for creating x-axis later on\n var xAxis = d3.axisBottom()\n .scale(xScale);\n\n // and for y-axis\n var yAxis = d3.axisLeft()\n .scale(yScale);\n\n // update options\n var update = [\"Perception of corruption on x axis (%)\",\n \"Share of households with internet broadband access on x axis (%)\"];\n\n // creating tip box to show value\n var tip = d3.tip()\n .attr('class', 'd3-tip')\n .offset([-20, 0])\n .html(function(d, i) {\n return \"Country: \" + d.country\n + \"<br>\" + \"Share of households with internet broadband access: \" + d.internet + \"<br>\" +\n \" Voter turnout: \" + d.votes + \"<br>\" + \"Labour force withsecondary education: \" + d.education + \"<br>\" +\n \" Perception of corruption: \" + d.perception});\n\n // creating legend\n var legend = d3.legendColor()\n .labelFormat(d3.format(\".0f\"))\n .scale(color)\n .shapePadding(5)\n .shapeWidth(50)\n .shapeHeight(20)\n .labelOffset(12);\n\n // creating selection menu\n var select = d3.select('body')\n .append('select')\n \t.attr('class','select')\n .on('change',updateX)\n\n var options = select\n .selectAll('option')\n \t.data(update)\n .enter()\n \t.append('option')\n \t.text(function (d) {return d;})\n .classed('selected', function(d) {return d === xAxis;})\n .on('click', function(d) {\n xAxis = d;\n updateX();\n });\n\n // creating a canvas to draw my scatterplot on\n var svg = d3.select(\"body\")\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n\n // boxes with value's\n svg.call(tip);\n\n // drawing x-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(50,\" + (h - padding) + \")\")\n .call(xAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(1000, 585)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Perception of corruption (%)\");\n\n // drawing y-axis\n svg.append(\"g\")\n .attr(\"class\", \"axis\")\n .attr(\"transform\", \"translate(\" + padding + \")\")\n .call(yAxis)\n\n // adding label\n svg.append(\"text\")\n .attr(\"transform\", \"translate(15, 50) rotate(-90)\")\n .attr(\"class\", \"textClass\")\n .style(\"text-anchor\", \"end\")\n .text(\"Voter turnout (%)\");\n\n // placing legend\n svg.append(\"g\")\n .attr(\"transform\", \"translate(1100, 0)\")\n .call(legend);\n\n // drawing the scatters\n svg.selectAll(\"circle\")\n .data(wellBeingDict)\n .enter()\n .append(\"circle\")\n .attr(\"class\", \"point\")\n .attr(\"transform\", \"translate(50, 0)\")\n .attr(\"cx\", d => xScale(d.perception))\n .attr(\"cy\", d => yScale(d.votes))\n .attr(\"r\", d => rScale(d.education))\n .on('mouseover', tip.show)\n .on('mouseout', tip.hide)\n .style(\"fill\", d => color(d.education));\n\n function updateX() {\n\n // update axis and scale\n var independent = this.independent\n xScale.domain(d3.extent(wellBeingDict, function(d) {return d[independent]})).nice()\n xAxis.scale(xScale)\n\n // place new x-axis\n d3.select('#xAxis')\n .transition()\n .duration(750)\n .call(xAxis)\n\n // draw new scatters\n d3.selectAll('circle')\n .transition()\n .duration(750)\n .delay(function (d,i) {\n return i * 50\n })\n .attr('cx',function (d) {\n return xScale(d[independent])\n });\n\n };\n }", "function getData(){\r\n url = URL_COMMON + \"/current_config/\";\r\n fetch(url).then( response => response.json())\r\n .then( data => {\r\n console.log(data);\r\n appendData(data);\r\n })\r\n .catch( err => {\r\n console.log('error: ' + err);\r\n });\r\n\r\n}", "function loadData() {\n var jsonRovereto = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/rovereto\");\n dataRovereto = JSON.parse(jsonRovereto);\n var jsonPergine = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/pergine_valsugana\");\n dataPergine = JSON.parse(jsonPergine);\n var jsonTrento = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/trento\");\n dataTrento = JSON.parse(jsonTrento);\n //console.log(dataTrento);\n}", "function getData() {\n var url = baseUrl + '.dods?';\n var selected = $('#variables :checkbox').filter(':checked');\n selected.each(function(i) {\n if (this.id == 'location.time_series.time') timeIndex = i;\n url += this.id + ',';\n });\n if (selected.length <= 1) return;\n\n // Get buoy id.\n for (var i=0; i<buoys.markers.length; i++) {\n var marker = buoys.markers[i];\n if (marker.icon.imageDiv.firstChild.getAttribute('src') == 'js/OpenLayers/img/marker.png') {\n var id = marker.metadata.id;\n break;\n }\n }\n\n url = url.replace(/,$/, '');\n //url += '&location.time>1.1e12'; // get only a couple of points for this demo.\n url += '&location._id=' + id;\n\n jsdap.loadData(url, plotData, '/proxy/');\n}", "function getResponseData() {\n\tconnection.query('SELECT * FROM departments', function(err, res) {\n\t\tif (err) throw err;\n\t\texecutiveInputs(res);\n\t})\n}", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "fetchData() {\n this.initLoading();\n let qs = this.setAndGetQuerySetFromSandBox(this.view, this.qs_url);\n this.data.instance = qs.cache = qs.model.getInstance({}, qs);\n this.setLoadingSuccessful();\n this.getParentInstancesForPath();\n }", "function get_data(cols) {\n \n\n var result = {};\n result.taxonomic_data={};\n result.coverage_data={};\n for (var i=0;i<cols.length;i++){\n var col = cols[i];\n var field_name = window.fields[i];\n if (field_name == 'len'){\n result.length = parseFloat(col);\n } \n if (field_name.slice(0,4) == 'cov_'){\n result.coverage_data[window.fields[i].slice(4)] = log10(col);\n }\n if (field_name == 'gc'){\n result.gc = parseFloat(col);\n }\n if (field_name == 'seqid'){\n result.id = col;\n }\n if (field_name.slice(0,9) == 'taxlevel_'){\n result.taxonomic_data[window.fields[i].slice(9)] = col;\n }\n }\n return result;\n}", "function getOptionData(){\n var ddMenu = d3.select(\"#selDataset\").node();\n var ddValue = ddMenu.value;\n\n dataPromise.then(results =>{\n results.samples.forEach(d => {\n if (d['id'] == ddValue){ \n sortFilterData(d)\n } \n })\n\n results.metadata.forEach(r => {\n if (r['id'] == ddValue){ \n console.log(r)\n buildGauge(r)\n populateDemoInfo(r)\n }\n }) \n }) \n}", "function getData() {\n\treturn {\n\t\tenabled: enabledInput.checked,\n\t\tmirror: linkSelect.value,\n\t\tcustom: linkCustom.value,\n\t\textension: linkExtension.value\n\t};\n}", "loadingData() {}", "loadingData() {}", "function obtainData(req){\n var dfd = q.defer();\n\n if(!req.params.providerSlug || req.params.providerSlug === 'demo'){\n \n //Send demo data if !providerSlug or providerSlug === demo\n var information = {\n activities : demoActivities,\n provider : demoProvider,\n __packSlug : req.params.packSlug,\n __providerSlug : req.params.providerSlug\n }\n \n dfd.resolve(information);\n }else{\n //Get from the api\n mygosunAPI.getPack(req.params.providerSlug, req.params.packSlug)\n .then(function(information){\n\n information.__providerSlug = req.params.providerSlug;\n information.__packSlug = req.params.packSlug;\n \n dfd.resolve(information);\n })\n .catch(dfd.reject)\n }\n\n return dfd.promise;\n}", "function getData(username){\n addLoading(username);\n return Promise.all([\n getUser(username),\n getStats(username),\n getFollowing(username),\n getFollowers(username),\n ])\n .then(([user, stats, following, followers]) => {\n stats.fg = following.length;\n stats.fr = followers.length;\n user.stats = stats;\n createFrame(user);\n })\n .catch(err => {\n console.error('Error ! cannot fetch data', err);\n });\n }", "getData(drawCfg) {\n let data;\n if (drawCfg.data && typeof drawCfg.data == 'string') {\n // Built-in datas\n // if (drawCfg.data == '_guide-line_')\n switch(drawCfg.data) {\n case '_guide-center_':\n data = [{}];\n break;\n case '_zero_':\n data = [{x:0, y:0}];\n break;\n case '_guide-line_':\n data = [{x:0, y:50}, {x:100, y:50}];\n break;\n // case '_guide-line-end25-column_': // for column guide\n // data = [{x:75, y:50}, {x:100, y:50}];\n // break;\n // case '_guide-line-end25-row_':\n // data = [{x:50, y:25}, {x:50, y:0}];\n // break;\n case '_area-fill_':\n data = [{x:0, y:100}, {x:100, y:100}];\n break;\n default:\n data = this.cfg.filter(d => drawCfg.data==d.name)[0].content;\n }\n } else\n data = this.cfg[0].content;\n\n return data\n }", "function gettingRecordsData() {\n\treturn gettingRecordsDataForCheckin();\n}", "function getLobbyData(){}", "function getData() {\n // data downloaded from the USGS at http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/ on 4/4/16\n // month.geojson represents recorded earthquakes between 03/04/2016 and 04/04/2016\n // week.geojson represents recorded earthquakes betwen 03/28/2016 and 04/04/2016\n var url = \"data/week.geojson\";\n return esriRequest(url, {\n responseType: \"json\"\n });\n }", "function getData(res) {\r\n // use try... catch... to catch error\r\n try {\r\n const testData = res;\r\n userData = testData;\r\n return userData;\r\n } catch (err) {\r\n console.log(err.message);\r\n }\r\n}", "function getData(data) {\n console.log(\"data is loaded\");\n console.log(data);\n\n // refresh the time and date\n setDateAndTime();\n\n // send data to components\n showQueue(data.queue);\n showStockStatus(data.storage);\n showOrders(data.queue, data.serving);\n\n // set which bartender is serving each order\n setBartender(data.bartenders);\n\n // set the icon for each bartender\n setBartenderIcon();\n}", "function getData() {\n\t\t\tvar deferred = $.Deferred();\n\t\t\t// get RPC results\n\t\t\tRactiveRPC.tab2dataAsync({\n\t\t\t\tonsuccess: function(results) {\n\t\t\t\t\tdeferred.resolve(results);\n\t\t\t\t},\n\t\t\t\tonerror: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\tontimeout: function(error) {\n\t\t\t\t\tdeferred.reject(error);\t\n\t\t\t\t},\n\t\t\t\ttimeout: 2000,\n\t\t\t\tparams: [1,2]\n\t\t\t});\t\n\t\t\t\n\t\t\treturn deferred.promise();\n\t\t}", "static get_info() { \n\treturn {\n\t id : id , \n\t rules : [ \"get text chunk\"],\n\t vars : null \n\t}\n }", "function getData() {\n var queryParams = {\n propertySelection: \"179,7,10888003,8,\" + $scope.cfg.fieldIdToDisplay,//, // ids of fields to fetch\n queryExpression: \"'7' != 3\" //Status is not rejected\n //queryExpression: \"'8' != developer\" //Status is not rejected\n };\n\n var foo = rxRecordInstanceDataPageResource.withName($scope.cfg.recordDefinitionName);\n foo.get(100, 0, queryParams).then(\n function (allRecords) {\n $scope.myData = allRecords.data;\n }\n );\n }" ]
[ "0.8254262", "0.7244824", "0.6888166", "0.67836374", "0.66986525", "0.6668903", "0.6668903", "0.66401464", "0.66401464", "0.66159177", "0.643464", "0.64271647", "0.6343243", "0.6303485", "0.6292739", "0.6251069", "0.62485623", "0.62399894", "0.6235058", "0.62314785", "0.62154394", "0.6203848", "0.6203441", "0.61941224", "0.61867046", "0.6154855", "0.6152634", "0.61514974", "0.61310536", "0.6125484", "0.6104906", "0.6104188", "0.60988826", "0.60941505", "0.60867256", "0.60646975", "0.60617614", "0.60536546", "0.6032212", "0.6023582", "0.60206693", "0.6020289", "0.6015298", "0.6012648", "0.59977454", "0.59973353", "0.598108", "0.59735894", "0.5967249", "0.59557235", "0.59417754", "0.5935988", "0.5928323", "0.5926858", "0.5921793", "0.5920119", "0.59163165", "0.5914216", "0.59099114", "0.59076", "0.5902807", "0.5899863", "0.5897207", "0.5896894", "0.58882517", "0.58858883", "0.5881804", "0.5880488", "0.5863373", "0.58507043", "0.58505857", "0.5848578", "0.5848457", "0.584412", "0.5842111", "0.5840986", "0.58348715", "0.5832744", "0.5826202", "0.5825555", "0.5807024", "0.58064896", "0.58057266", "0.57967657", "0.57967657", "0.579645", "0.5788426", "0.5778204", "0.57768136", "0.57768136", "0.5766541", "0.5764902", "0.5760654", "0.57590985", "0.5754074", "0.57508755", "0.5750073", "0.57496357", "0.5748332", "0.57478297", "0.5747596" ]
0.0
-1
Use of this source code is governed by a BSDstyle license that can be found in the LICENSE file.
function $(id) { return document.getElementById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private internal function m248() {}", "private public function m246() {}", "protected internal function m252() {}", "static final private internal function m106() {}", "transient private protected internal function m182() {}", "static private internal function m121() {}", "transient protected internal function m189() {}", "transient private internal function m185() {}", "transient final protected internal function m174() {}", "static transient final protected internal function m47() {}", "static transient final private internal function m43() {}", "static transient final protected public internal function m46() {}", "static private protected internal function m118() {}", "static transient private protected internal function m55() {}", "static transient final private protected internal function m40() {}", "function StupidBug() {}", "transient private protected public internal function m181() {}", "transient final private internal function m170() {}", "transient final private protected internal function m167() {}", "function _____SHARED_functions_____(){}", "static transient private protected public internal function m54() {}", "static private protected public internal function m117() {}", "static transient final protected function m44() {}", "static transient private public function m56() {}", "static final protected internal function m110() {}", "static final private public function m104() {}", "static transient final private protected public internal function m39() {}", "function _0x329edd(_0x38ef9f){return function(){return _0x38ef9f;};}", "transient final private protected public internal function m166() {}", "transient private public function m183() {}", "static final private protected internal function m103() {}", "static transient private internal function m58() {}", "static final private protected public internal function m102() {}", "static private public function m119() {}", "function _G() {}", "function _G() {}", "static transient final private protected public function m38() {}", "hacky(){\n return\n }", "static transient final private public function m41() {}", "static protected internal function m125() {}", "function SigV4Utils() { }", "transient final private public function m168() {}", "function r() {}", "function r() {}", "function r() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "_initialize() {\n\n }", "function Utils() {}", "function Utils() {}", "function vB_PHP_Emulator()\n{\n}", "function T7(){return typeof window>\"u\"&&(self.window=self),function(n){var e={parse:function(r){var s=e._bin,o=new Uint8Array(r);if(s.readASCII(o,0,4)==\"ttcf\"){var a=4;s.readUshort(o,a),a+=2,s.readUshort(o,a),a+=2;var l=s.readUint(o,a);a+=4;for(var c=[],d=0;d<l;d++){var h=s.readUint(o,a);a+=4,c.push(e._readFont(o,h))}return c}return[e._readFont(o,0)]},_readFont:function(r,s){var o=e._bin,a=s;o.readFixed(r,s),s+=4;var l=o.readUshort(r,s);s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2;for(var c=[\"cmap\",\"head\",\"hhea\",\"maxp\",\"hmtx\",\"name\",\"OS/2\",\"post\",\"loca\",\"glyf\",\"kern\",\"CFF \",\"GPOS\",\"GSUB\",\"SVG \"],d={_data:r,_offset:a},h={},p=0;p<l;p++){var m=o.readASCII(r,s,4);s+=4,o.readUint(r,s),s+=4;var v=o.readUint(r,s);s+=4;var y=o.readUint(r,s);s+=4,h[m]={offset:v,length:y}}for(p=0;p<c.length;p++){var x=c[p];h[x]&&(d[x.trim()]=e[x.trim()].parse(r,h[x].offset,h[x].length,d))}return d},_tabOffset:function(r,s,o){for(var a=e._bin,l=a.readUshort(r,o+4),c=o+12,d=0;d<l;d++){var h=a.readASCII(r,c,4);c+=4,a.readUint(r,c),c+=4;var p=a.readUint(r,c);if(c+=4,a.readUint(r,c),c+=4,h==s)return p}return 0}};e._bin={readFixed:function(r,s){return(r[s]<<8|r[s+1])+(r[s+2]<<8|r[s+3])/65540},readF2dot14:function(r,s){return e._bin.readShort(r,s)/16384},readInt:function(r,s){return e._bin._view(r).getInt32(s)},readInt8:function(r,s){return e._bin._view(r).getInt8(s)},readShort:function(r,s){return e._bin._view(r).getInt16(s)},readUshort:function(r,s){return e._bin._view(r).getUint16(s)},readUshorts:function(r,s,o){for(var a=[],l=0;l<o;l++)a.push(e._bin.readUshort(r,s+2*l));return a},readUint:function(r,s){return e._bin._view(r).getUint32(s)},readUint64:function(r,s){return 4294967296*e._bin.readUint(r,s)+e._bin.readUint(r,s+4)},readASCII:function(r,s,o){for(var a=\"\",l=0;l<o;l++)a+=String.fromCharCode(r[s+l]);return a},readUnicode:function(r,s,o){for(var a=\"\",l=0;l<o;l++){var c=r[s++]<<8|r[s++];a+=String.fromCharCode(c)}return a},_tdec:typeof window<\"u\"&&window.TextDecoder?new window.TextDecoder:null,readUTF8:function(r,s,o){var a=e._bin._tdec;return a&&s==0&&o==r.length?a.decode(r):e._bin.readASCII(r,s,o)},readBytes:function(r,s,o){for(var a=[],l=0;l<o;l++)a.push(r[s+l]);return a},readASCIIArray:function(r,s,o){for(var a=[],l=0;l<o;l++)a.push(String.fromCharCode(r[s+l]));return a},_view:function(r){return r._dataView||(r._dataView=r.buffer?new DataView(r.buffer,r.byteOffset,r.byteLength):new DataView(new Uint8Array(r).buffer))}},e._lctf={},e._lctf.parse=function(r,s,o,a,l){var c=e._bin,d={},h=s;c.readFixed(r,s),s+=4;var p=c.readUshort(r,s);s+=2;var m=c.readUshort(r,s);s+=2;var v=c.readUshort(r,s);return s+=2,d.scriptList=e._lctf.readScriptList(r,h+p),d.featureList=e._lctf.readFeatureList(r,h+m),d.lookupList=e._lctf.readLookupList(r,h+v,l),d},e._lctf.readLookupList=function(r,s,o){var a=e._bin,l=s,c=[],d=a.readUshort(r,s);s+=2;for(var h=0;h<d;h++){var p=a.readUshort(r,s);s+=2;var m=e._lctf.readLookupTable(r,l+p,o);c.push(m)}return c},e._lctf.readLookupTable=function(r,s,o){var a=e._bin,l=s,c={tabs:[]};c.ltype=a.readUshort(r,s),s+=2,c.flag=a.readUshort(r,s),s+=2;var d=a.readUshort(r,s);s+=2;for(var h=c.ltype,p=0;p<d;p++){var m=a.readUshort(r,s);s+=2;var v=o(r,h,l+m,c);c.tabs.push(v)}return c},e._lctf.numOfOnes=function(r){for(var s=0,o=0;o<32;o++)r>>>o&1&&s++;return s},e._lctf.readClassDef=function(r,s){var o=e._bin,a=[],l=o.readUshort(r,s);if(s+=2,l==1){var c=o.readUshort(r,s);s+=2;var d=o.readUshort(r,s);s+=2;for(var h=0;h<d;h++)a.push(c+h),a.push(c+h),a.push(o.readUshort(r,s)),s+=2}if(l==2){var p=o.readUshort(r,s);for(s+=2,h=0;h<p;h++)a.push(o.readUshort(r,s)),s+=2,a.push(o.readUshort(r,s)),s+=2,a.push(o.readUshort(r,s)),s+=2}return a},e._lctf.getInterval=function(r,s){for(var o=0;o<r.length;o+=3){var a=r[o],l=r[o+1];if(r[o+2],a<=s&&s<=l)return o}return-1},e._lctf.readCoverage=function(r,s){var o=e._bin,a={};a.fmt=o.readUshort(r,s),s+=2;var l=o.readUshort(r,s);return s+=2,a.fmt==1&&(a.tab=o.readUshorts(r,s,l)),a.fmt==2&&(a.tab=o.readUshorts(r,s,3*l)),a},e._lctf.coverageIndex=function(r,s){var o=r.tab;if(r.fmt==1)return o.indexOf(s);if(r.fmt==2){var a=e._lctf.getInterval(o,s);if(a!=-1)return o[a+2]+(s-o[a])}return-1},e._lctf.readFeatureList=function(r,s){var o=e._bin,a=s,l=[],c=o.readUshort(r,s);s+=2;for(var d=0;d<c;d++){var h=o.readASCII(r,s,4);s+=4;var p=o.readUshort(r,s);s+=2;var m=e._lctf.readFeatureTable(r,a+p);m.tag=h.trim(),l.push(m)}return l},e._lctf.readFeatureTable=function(r,s){var o=e._bin,a=s,l={},c=o.readUshort(r,s);s+=2,c>0&&(l.featureParams=a+c);var d=o.readUshort(r,s);s+=2,l.tab=[];for(var h=0;h<d;h++)l.tab.push(o.readUshort(r,s+2*h));return l},e._lctf.readScriptList=function(r,s){var o=e._bin,a=s,l={},c=o.readUshort(r,s);s+=2;for(var d=0;d<c;d++){var h=o.readASCII(r,s,4);s+=4;var p=o.readUshort(r,s);s+=2,l[h.trim()]=e._lctf.readScriptTable(r,a+p)}return l},e._lctf.readScriptTable=function(r,s){var o=e._bin,a=s,l={},c=o.readUshort(r,s);s+=2,l.default=e._lctf.readLangSysTable(r,a+c);var d=o.readUshort(r,s);s+=2;for(var h=0;h<d;h++){var p=o.readASCII(r,s,4);s+=4;var m=o.readUshort(r,s);s+=2,l[p.trim()]=e._lctf.readLangSysTable(r,a+m)}return l},e._lctf.readLangSysTable=function(r,s){var o=e._bin,a={};o.readUshort(r,s),s+=2,a.reqFeature=o.readUshort(r,s),s+=2;var l=o.readUshort(r,s);return s+=2,a.features=o.readUshorts(r,s,l),a},e.CFF={},e.CFF.parse=function(r,s,o){var a=e._bin;(r=new Uint8Array(r.buffer,s,o))[s=0],r[++s],r[++s],r[++s],s++;var l=[];s=e.CFF.readIndex(r,s,l);for(var c=[],d=0;d<l.length-1;d++)c.push(a.readASCII(r,s+l[d],l[d+1]-l[d]));s+=l[l.length-1];var h=[];s=e.CFF.readIndex(r,s,h);var p=[];for(d=0;d<h.length-1;d++)p.push(e.CFF.readDict(r,s+h[d],s+h[d+1]));s+=h[h.length-1];var m=p[0],v=[];s=e.CFF.readIndex(r,s,v);var y=[];for(d=0;d<v.length-1;d++)y.push(a.readASCII(r,s+v[d],v[d+1]-v[d]));if(s+=v[v.length-1],e.CFF.readSubrs(r,s,m),m.CharStrings){s=m.CharStrings,v=[],s=e.CFF.readIndex(r,s,v);var x=[];for(d=0;d<v.length-1;d++)x.push(a.readBytes(r,s+v[d],v[d+1]-v[d]));m.CharStrings=x}if(m.ROS){s=m.FDArray;var w=[];for(s=e.CFF.readIndex(r,s,w),m.FDArray=[],d=0;d<w.length-1;d++){var _=e.CFF.readDict(r,s+w[d],s+w[d+1]);e.CFF._readFDict(r,_,y),m.FDArray.push(_)}s+=w[w.length-1],s=m.FDSelect,m.FDSelect=[];var S=r[s];if(s++,S!=3)throw S;var b=a.readUshort(r,s);for(s+=2,d=0;d<b+1;d++)m.FDSelect.push(a.readUshort(r,s),r[s+2]),s+=3}return m.Encoding&&(m.Encoding=e.CFF.readEncoding(r,m.Encoding,m.CharStrings.length)),m.charset&&(m.charset=e.CFF.readCharset(r,m.charset,m.CharStrings.length)),e.CFF._readFDict(r,m,y),m},e.CFF._readFDict=function(r,s,o){var a;for(var l in s.Private&&(a=s.Private[1],s.Private=e.CFF.readDict(r,a,a+s.Private[0]),s.Private.Subrs&&e.CFF.readSubrs(r,a+s.Private.Subrs,s.Private)),s)[\"FamilyName\",\"FontName\",\"FullName\",\"Notice\",\"version\",\"Copyright\"].indexOf(l)!=-1&&(s[l]=o[s[l]-426+35])},e.CFF.readSubrs=function(r,s,o){var a=e._bin,l=[];s=e.CFF.readIndex(r,s,l);var c,d=l.length;c=d<1240?107:d<33900?1131:32768,o.Bias=c,o.Subrs=[];for(var h=0;h<l.length-1;h++)o.Subrs.push(a.readBytes(r,s+l[h],l[h+1]-l[h]))},e.CFF.tableSE=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,0,111,112,113,114,0,115,116,117,118,119,120,121,122,0,123,0,124,125,126,127,128,129,130,131,0,132,133,0,134,135,136,137,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,138,0,139,0,0,0,0,140,141,142,143,0,0,0,0,0,144,0,0,0,145,0,0,146,147,148,149,0,0,0,0],e.CFF.glyphByUnicode=function(r,s){for(var o=0;o<r.charset.length;o++)if(r.charset[o]==s)return o;return-1},e.CFF.glyphBySE=function(r,s){return s<0||s>255?-1:e.CFF.glyphByUnicode(r,e.CFF.tableSE[s])},e.CFF.readEncoding=function(r,s,o){e._bin;var a=[\".notdef\"],l=r[s];if(s++,l!=0)throw\"error: unknown encoding format: \"+l;var c=r[s];s++;for(var d=0;d<c;d++)a.push(r[s+d]);return a},e.CFF.readCharset=function(r,s,o){var a=e._bin,l=[\".notdef\"],c=r[s];if(s++,c==0)for(var d=0;d<o;d++){var h=a.readUshort(r,s);s+=2,l.push(h)}else{if(c!=1&&c!=2)throw\"error: format: \"+c;for(;l.length<o;){h=a.readUshort(r,s),s+=2;var p=0;for(c==1?(p=r[s],s++):(p=a.readUshort(r,s),s+=2),d=0;d<=p;d++)l.push(h),h++}}return l},e.CFF.readIndex=function(r,s,o){var a=e._bin,l=a.readUshort(r,s)+1,c=r[s+=2];if(s++,c==1)for(var d=0;d<l;d++)o.push(r[s+d]);else if(c==2)for(d=0;d<l;d++)o.push(a.readUshort(r,s+2*d));else if(c==3)for(d=0;d<l;d++)o.push(16777215&a.readUint(r,s+3*d-1));else if(l!=1)throw\"unsupported offset size: \"+c+\", count: \"+l;return(s+=l*c)-1},e.CFF.getCharString=function(r,s,o){var a=e._bin,l=r[s],c=r[s+1];r[s+2],r[s+3],r[s+4];var d=1,h=null,p=null;l<=20&&(h=l,d=1),l==12&&(h=100*l+c,d=2),21<=l&&l<=27&&(h=l,d=1),l==28&&(p=a.readShort(r,s+1),d=3),29<=l&&l<=31&&(h=l,d=1),32<=l&&l<=246&&(p=l-139,d=1),247<=l&&l<=250&&(p=256*(l-247)+c+108,d=2),251<=l&&l<=254&&(p=256*-(l-251)-c-108,d=2),l==255&&(p=a.readInt(r,s+1)/65535,d=5),o.val=p??\"o\"+h,o.size=d},e.CFF.readCharString=function(r,s,o){for(var a=s+o,l=e._bin,c=[];s<a;){var d=r[s],h=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;d<=20&&(m=d,p=1),d==12&&(m=100*d+h,p=2),d!=19&&d!=20||(m=d,p=2),21<=d&&d<=27&&(m=d,p=1),d==28&&(v=l.readShort(r,s+1),p=3),29<=d&&d<=31&&(m=d,p=1),32<=d&&d<=246&&(v=d-139,p=1),247<=d&&d<=250&&(v=256*(d-247)+h+108,p=2),251<=d&&d<=254&&(v=256*-(d-251)-h-108,p=2),d==255&&(v=l.readInt(r,s+1)/65535,p=5),c.push(v??\"o\"+m),s+=p}return c},e.CFF.readDict=function(r,s,o){for(var a=e._bin,l={},c=[];s<o;){var d=r[s],h=r[s+1];r[s+2],r[s+3],r[s+4];var p=1,m=null,v=null;if(d==28&&(v=a.readShort(r,s+1),p=3),d==29&&(v=a.readInt(r,s+1),p=5),32<=d&&d<=246&&(v=d-139,p=1),247<=d&&d<=250&&(v=256*(d-247)+h+108,p=2),251<=d&&d<=254&&(v=256*-(d-251)-h-108,p=2),d==255)throw v=a.readInt(r,s+1)/65535,p=5,\"unknown number\";if(d==30){var y=[];for(p=1;;){var x=r[s+p];p++;var w=x>>4,_=15&x;if(w!=15&&y.push(w),_!=15&&y.push(_),_==15)break}for(var S=\"\",b=[0,1,2,3,4,5,6,7,8,9,\".\",\"e\",\"e-\",\"reserved\",\"-\",\"endOfNumber\"],T=0;T<y.length;T++)S+=b[y[T]];v=parseFloat(S)}d<=21&&(m=[\"version\",\"Notice\",\"FullName\",\"FamilyName\",\"Weight\",\"FontBBox\",\"BlueValues\",\"OtherBlues\",\"FamilyBlues\",\"FamilyOtherBlues\",\"StdHW\",\"StdVW\",\"escape\",\"UniqueID\",\"XUID\",\"charset\",\"Encoding\",\"CharStrings\",\"Private\",\"Subrs\",\"defaultWidthX\",\"nominalWidthX\"][d],p=1,d==12&&(m=[\"Copyright\",\"isFixedPitch\",\"ItalicAngle\",\"UnderlinePosition\",\"UnderlineThickness\",\"PaintType\",\"CharstringType\",\"FontMatrix\",\"StrokeWidth\",\"BlueScale\",\"BlueShift\",\"BlueFuzz\",\"StemSnapH\",\"StemSnapV\",\"ForceBold\",0,0,\"LanguageGroup\",\"ExpansionFactor\",\"initialRandomSeed\",\"SyntheticBase\",\"PostScript\",\"BaseFontName\",\"BaseFontBlend\",0,0,0,0,0,0,\"ROS\",\"CIDFontVersion\",\"CIDFontRevision\",\"CIDFontType\",\"CIDCount\",\"UIDBase\",\"FDArray\",\"FDSelect\",\"FontName\"][h],p=2)),m!=null?(l[m]=c.length==1?c[0]:c,c=[]):c.push(v),s+=p}return l},e.cmap={},e.cmap.parse=function(r,s,o){r=new Uint8Array(r.buffer,s,o),s=0;var a=e._bin,l={};a.readUshort(r,s),s+=2;var c=a.readUshort(r,s);s+=2;var d=[];l.tables=[];for(var h=0;h<c;h++){var p=a.readUshort(r,s);s+=2;var m=a.readUshort(r,s);s+=2;var v=a.readUint(r,s);s+=4;var y=\"p\"+p+\"e\"+m,x=d.indexOf(v);if(x==-1){var w;x=l.tables.length,d.push(v);var _=a.readUshort(r,v);_==0?w=e.cmap.parse0(r,v):_==4?w=e.cmap.parse4(r,v):_==6?w=e.cmap.parse6(r,v):_==12?w=e.cmap.parse12(r,v):console.debug(\"unknown format: \"+_,p,m,v),l.tables.push(w)}if(l[y]!=null)throw\"multiple tables for one platform+encoding\";l[y]=x}return l},e.cmap.parse0=function(r,s){var o=e._bin,a={};a.format=o.readUshort(r,s),s+=2;var l=o.readUshort(r,s);s+=2,o.readUshort(r,s),s+=2,a.map=[];for(var c=0;c<l-6;c++)a.map.push(r[s+c]);return a},e.cmap.parse4=function(r,s){var o=e._bin,a=s,l={};l.format=o.readUshort(r,s),s+=2;var c=o.readUshort(r,s);s+=2,o.readUshort(r,s),s+=2;var d=o.readUshort(r,s);s+=2;var h=d/2;l.searchRange=o.readUshort(r,s),s+=2,l.entrySelector=o.readUshort(r,s),s+=2,l.rangeShift=o.readUshort(r,s),s+=2,l.endCount=o.readUshorts(r,s,h),s+=2*h,s+=2,l.startCount=o.readUshorts(r,s,h),s+=2*h,l.idDelta=[];for(var p=0;p<h;p++)l.idDelta.push(o.readShort(r,s)),s+=2;for(l.idRangeOffset=o.readUshorts(r,s,h),s+=2*h,l.glyphIdArray=[];s<a+c;)l.glyphIdArray.push(o.readUshort(r,s)),s+=2;return l},e.cmap.parse6=function(r,s){var o=e._bin,a={};a.format=o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2,o.readUshort(r,s),s+=2,a.firstCode=o.readUshort(r,s),s+=2;var l=o.readUshort(r,s);s+=2,a.glyphIdArray=[];for(var c=0;c<l;c++)a.glyphIdArray.push(o.readUshort(r,s)),s+=2;return a},e.cmap.parse12=function(r,s){var o=e._bin,a={};a.format=o.readUshort(r,s),s+=2,s+=2,o.readUint(r,s),s+=4,o.readUint(r,s),s+=4;var l=o.readUint(r,s);s+=4,a.groups=[];for(var c=0;c<l;c++){var d=s+12*c,h=o.readUint(r,d+0),p=o.readUint(r,d+4),m=o.readUint(r,d+8);a.groups.push([h,p,m])}return a},e.glyf={},e.glyf.parse=function(r,s,o,a){for(var l=[],c=0;c<a.maxp.numGlyphs;c++)l.push(null);return l},e.glyf._parseGlyf=function(r,s){var o=e._bin,a=r._data,l=e._tabOffset(a,\"glyf\",r._offset)+r.loca[s];if(r.loca[s]==r.loca[s+1])return null;var c={};if(c.noc=o.readShort(a,l),l+=2,c.xMin=o.readShort(a,l),l+=2,c.yMin=o.readShort(a,l),l+=2,c.xMax=o.readShort(a,l),l+=2,c.yMax=o.readShort(a,l),l+=2,c.xMin>=c.xMax||c.yMin>=c.yMax)return null;if(c.noc>0){c.endPts=[];for(var d=0;d<c.noc;d++)c.endPts.push(o.readUshort(a,l)),l+=2;var h=o.readUshort(a,l);if(l+=2,a.length-l<h)return null;c.instructions=o.readBytes(a,l,h),l+=h;var p=c.endPts[c.noc-1]+1;for(c.flags=[],d=0;d<p;d++){var m=a[l];if(l++,c.flags.push(m),(8&m)!=0){var v=a[l];l++;for(var y=0;y<v;y++)c.flags.push(m),d++}}for(c.xs=[],d=0;d<p;d++){var x=(2&c.flags[d])!=0,w=(16&c.flags[d])!=0;x?(c.xs.push(w?a[l]:-a[l]),l++):w?c.xs.push(0):(c.xs.push(o.readShort(a,l)),l+=2)}for(c.ys=[],d=0;d<p;d++)x=(4&c.flags[d])!=0,w=(32&c.flags[d])!=0,x?(c.ys.push(w?a[l]:-a[l]),l++):w?c.ys.push(0):(c.ys.push(o.readShort(a,l)),l+=2);var _=0,S=0;for(d=0;d<p;d++)_+=c.xs[d],S+=c.ys[d],c.xs[d]=_,c.ys[d]=S}else{var b;c.parts=[];do{b=o.readUshort(a,l),l+=2;var T={m:{a:1,b:0,c:0,d:1,tx:0,ty:0},p1:-1,p2:-1};if(c.parts.push(T),T.glyphIndex=o.readUshort(a,l),l+=2,1&b){var A=o.readShort(a,l);l+=2;var L=o.readShort(a,l);l+=2}else A=o.readInt8(a,l),l++,L=o.readInt8(a,l),l++;2&b?(T.m.tx=A,T.m.ty=L):(T.p1=A,T.p2=L),8&b?(T.m.a=T.m.d=o.readF2dot14(a,l),l+=2):64&b?(T.m.a=o.readF2dot14(a,l),l+=2,T.m.d=o.readF2dot14(a,l),l+=2):128&b&&(T.m.a=o.readF2dot14(a,l),l+=2,T.m.b=o.readF2dot14(a,l),l+=2,T.m.c=o.readF2dot14(a,l),l+=2,T.m.d=o.readF2dot14(a,l),l+=2)}while(32&b);if(256&b){var C=o.readUshort(a,l);for(l+=2,c.instr=[],d=0;d<C;d++)c.instr.push(a[l]),l++}}return c},e.GPOS={},e.GPOS.parse=function(r,s,o,a){return e._lctf.parse(r,s,o,a,e.GPOS.subt)},e.GPOS.subt=function(r,s,o,a){var l=e._bin,c=o,d={};if(d.fmt=l.readUshort(r,o),o+=2,s==1||s==2||s==3||s==7||s==8&&d.fmt<=2){var h=l.readUshort(r,o);o+=2,d.coverage=e._lctf.readCoverage(r,h+c)}if(s==1&&d.fmt==1){var p=l.readUshort(r,o);o+=2;var m=e._lctf.numOfOnes(p);p!=0&&(d.pos=e.GPOS.readValueRecord(r,o,p))}else if(s==2&&d.fmt>=1&&d.fmt<=2){p=l.readUshort(r,o),o+=2;var v=l.readUshort(r,o);o+=2,m=e._lctf.numOfOnes(p);var y=e._lctf.numOfOnes(v);if(d.fmt==1){d.pairsets=[];var x=l.readUshort(r,o);o+=2;for(var w=0;w<x;w++){var _=c+l.readUshort(r,o);o+=2;var S=l.readUshort(r,_);_+=2;for(var b=[],T=0;T<S;T++){var A=l.readUshort(r,_);_+=2,p!=0&&(V=e.GPOS.readValueRecord(r,_,p),_+=2*m),v!=0&&(W=e.GPOS.readValueRecord(r,_,v),_+=2*y),b.push({gid2:A,val1:V,val2:W})}d.pairsets.push(b)}}if(d.fmt==2){var L=l.readUshort(r,o);o+=2;var C=l.readUshort(r,o);o+=2;var R=l.readUshort(r,o);o+=2;var k=l.readUshort(r,o);for(o+=2,d.classDef1=e._lctf.readClassDef(r,c+L),d.classDef2=e._lctf.readClassDef(r,c+C),d.matrix=[],w=0;w<R;w++){var H=[];for(T=0;T<k;T++){var V=null,W=null;p!=0&&(V=e.GPOS.readValueRecord(r,o,p),o+=2*m),v!=0&&(W=e.GPOS.readValueRecord(r,o,v),o+=2*y),H.push({val1:V,val2:W})}d.matrix.push(H)}}}else{if(s==9&&d.fmt==1){var F=l.readUshort(r,o);o+=2;var J=l.readUint(r,o);if(o+=4,a.ltype==9)a.ltype=F;else if(a.ltype!=F)throw\"invalid extension substitution\";return e.GPOS.subt(r,a.ltype,c+J)}console.debug(\"unsupported GPOS table LookupType\",s,\"format\",d.fmt)}return d},e.GPOS.readValueRecord=function(r,s,o){var a=e._bin,l=[];return l.push(1&o?a.readShort(r,s):0),s+=1&o?2:0,l.push(2&o?a.readShort(r,s):0),s+=2&o?2:0,l.push(4&o?a.readShort(r,s):0),s+=4&o?2:0,l.push(8&o?a.readShort(r,s):0),s+=8&o?2:0,l},e.GSUB={},e.GSUB.parse=function(r,s,o,a){return e._lctf.parse(r,s,o,a,e.GSUB.subt)},e.GSUB.subt=function(r,s,o,a){var l=e._bin,c=o,d={};if(d.fmt=l.readUshort(r,o),o+=2,s!=1&&s!=4&&s!=5&&s!=6)return null;if(s==1||s==4||s==5&&d.fmt<=2||s==6&&d.fmt<=2){var h=l.readUshort(r,o);o+=2,d.coverage=e._lctf.readCoverage(r,c+h)}if(s==1&&d.fmt>=1&&d.fmt<=2){if(d.fmt==1)d.delta=l.readShort(r,o),o+=2;else if(d.fmt==2){var p=l.readUshort(r,o);o+=2,d.newg=l.readUshorts(r,o,p),o+=2*d.newg.length}}else if(s==4){d.vals=[],p=l.readUshort(r,o),o+=2;for(var m=0;m<p;m++){var v=l.readUshort(r,o);o+=2,d.vals.push(e.GSUB.readLigatureSet(r,c+v))}}else if(s==5&&d.fmt==2){if(d.fmt==2){var y=l.readUshort(r,o);o+=2,d.cDef=e._lctf.readClassDef(r,c+y),d.scset=[];var x=l.readUshort(r,o);for(o+=2,m=0;m<x;m++){var w=l.readUshort(r,o);o+=2,d.scset.push(w==0?null:e.GSUB.readSubClassSet(r,c+w))}}}else if(s==6&&d.fmt==3){if(d.fmt==3){for(m=0;m<3;m++){p=l.readUshort(r,o),o+=2;for(var _=[],S=0;S<p;S++)_.push(e._lctf.readCoverage(r,c+l.readUshort(r,o+2*S)));o+=2*p,m==0&&(d.backCvg=_),m==1&&(d.inptCvg=_),m==2&&(d.ahedCvg=_)}p=l.readUshort(r,o),o+=2,d.lookupRec=e.GSUB.readSubstLookupRecords(r,o,p)}}else{if(s==7&&d.fmt==1){var b=l.readUshort(r,o);o+=2;var T=l.readUint(r,o);if(o+=4,a.ltype==9)a.ltype=b;else if(a.ltype!=b)throw\"invalid extension substitution\";return e.GSUB.subt(r,a.ltype,c+T)}console.debug(\"unsupported GSUB table LookupType\",s,\"format\",d.fmt)}return d},e.GSUB.readSubClassSet=function(r,s){var o=e._bin.readUshort,a=s,l=[],c=o(r,s);s+=2;for(var d=0;d<c;d++){var h=o(r,s);s+=2,l.push(e.GSUB.readSubClassRule(r,a+h))}return l},e.GSUB.readSubClassRule=function(r,s){var o=e._bin.readUshort,a={},l=o(r,s),c=o(r,s+=2);s+=2,a.input=[];for(var d=0;d<l-1;d++)a.input.push(o(r,s)),s+=2;return a.substLookupRecords=e.GSUB.readSubstLookupRecords(r,s,c),a},e.GSUB.readSubstLookupRecords=function(r,s,o){for(var a=e._bin.readUshort,l=[],c=0;c<o;c++)l.push(a(r,s),a(r,s+2)),s+=4;return l},e.GSUB.readChainSubClassSet=function(r,s){var o=e._bin,a=s,l=[],c=o.readUshort(r,s);s+=2;for(var d=0;d<c;d++){var h=o.readUshort(r,s);s+=2,l.push(e.GSUB.readChainSubClassRule(r,a+h))}return l},e.GSUB.readChainSubClassRule=function(r,s){for(var o=e._bin,a={},l=[\"backtrack\",\"input\",\"lookahead\"],c=0;c<l.length;c++){var d=o.readUshort(r,s);s+=2,c==1&&d--,a[l[c]]=o.readUshorts(r,s,d),s+=2*a[l[c]].length}return d=o.readUshort(r,s),s+=2,a.subst=o.readUshorts(r,s,2*d),s+=2*a.subst.length,a},e.GSUB.readLigatureSet=function(r,s){var o=e._bin,a=s,l=[],c=o.readUshort(r,s);s+=2;for(var d=0;d<c;d++){var h=o.readUshort(r,s);s+=2,l.push(e.GSUB.readLigature(r,a+h))}return l},e.GSUB.readLigature=function(r,s){var o=e._bin,a={chain:[]};a.nglyph=o.readUshort(r,s),s+=2;var l=o.readUshort(r,s);s+=2;for(var c=0;c<l-1;c++)a.chain.push(o.readUshort(r,s)),s+=2;return a},e.head={},e.head.parse=function(r,s,o){var a=e._bin,l={};return a.readFixed(r,s),s+=4,l.fontRevision=a.readFixed(r,s),s+=4,a.readUint(r,s),s+=4,a.readUint(r,s),s+=4,l.flags=a.readUshort(r,s),s+=2,l.unitsPerEm=a.readUshort(r,s),s+=2,l.created=a.readUint64(r,s),s+=8,l.modified=a.readUint64(r,s),s+=8,l.xMin=a.readShort(r,s),s+=2,l.yMin=a.readShort(r,s),s+=2,l.xMax=a.readShort(r,s),s+=2,l.yMax=a.readShort(r,s),s+=2,l.macStyle=a.readUshort(r,s),s+=2,l.lowestRecPPEM=a.readUshort(r,s),s+=2,l.fontDirectionHint=a.readShort(r,s),s+=2,l.indexToLocFormat=a.readShort(r,s),s+=2,l.glyphDataFormat=a.readShort(r,s),s+=2,l},e.hhea={},e.hhea.parse=function(r,s,o){var a=e._bin,l={};return a.readFixed(r,s),s+=4,l.ascender=a.readShort(r,s),s+=2,l.descender=a.readShort(r,s),s+=2,l.lineGap=a.readShort(r,s),s+=2,l.advanceWidthMax=a.readUshort(r,s),s+=2,l.minLeftSideBearing=a.readShort(r,s),s+=2,l.minRightSideBearing=a.readShort(r,s),s+=2,l.xMaxExtent=a.readShort(r,s),s+=2,l.caretSlopeRise=a.readShort(r,s),s+=2,l.caretSlopeRun=a.readShort(r,s),s+=2,l.caretOffset=a.readShort(r,s),s+=2,s+=8,l.metricDataFormat=a.readShort(r,s),s+=2,l.numberOfHMetrics=a.readUshort(r,s),s+=2,l},e.hmtx={},e.hmtx.parse=function(r,s,o,a){for(var l=e._bin,c={aWidth:[],lsBearing:[]},d=0,h=0,p=0;p<a.maxp.numGlyphs;p++)p<a.hhea.numberOfHMetrics&&(d=l.readUshort(r,s),s+=2,h=l.readShort(r,s),s+=2),c.aWidth.push(d),c.lsBearing.push(h);return c},e.kern={},e.kern.parse=function(r,s,o,a){var l=e._bin,c=l.readUshort(r,s);if(s+=2,c==1)return e.kern.parseV1(r,s-2,o,a);var d=l.readUshort(r,s);s+=2;for(var h={glyph1:[],rval:[]},p=0;p<d;p++){s+=2,o=l.readUshort(r,s),s+=2;var m=l.readUshort(r,s);s+=2;var v=m>>>8;if((v&=15)!=0)throw\"unknown kern table format: \"+v;s=e.kern.readFormat0(r,s,h)}return h},e.kern.parseV1=function(r,s,o,a){var l=e._bin;l.readFixed(r,s),s+=4;var c=l.readUint(r,s);s+=4;for(var d={glyph1:[],rval:[]},h=0;h<c;h++){l.readUint(r,s),s+=4;var p=l.readUshort(r,s);s+=2,l.readUshort(r,s),s+=2;var m=p>>>8;if((m&=15)!=0)throw\"unknown kern table format: \"+m;s=e.kern.readFormat0(r,s,d)}return d},e.kern.readFormat0=function(r,s,o){var a=e._bin,l=-1,c=a.readUshort(r,s);s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2,a.readUshort(r,s),s+=2;for(var d=0;d<c;d++){var h=a.readUshort(r,s);s+=2;var p=a.readUshort(r,s);s+=2;var m=a.readShort(r,s);s+=2,h!=l&&(o.glyph1.push(h),o.rval.push({glyph2:[],vals:[]}));var v=o.rval[o.rval.length-1];v.glyph2.push(p),v.vals.push(m),l=h}return s},e.loca={},e.loca.parse=function(r,s,o,a){var l=e._bin,c=[],d=a.head.indexToLocFormat,h=a.maxp.numGlyphs+1;if(d==0)for(var p=0;p<h;p++)c.push(l.readUshort(r,s+(p<<1))<<1);if(d==1)for(p=0;p<h;p++)c.push(l.readUint(r,s+(p<<2)));return c},e.maxp={},e.maxp.parse=function(r,s,o){var a=e._bin,l={},c=a.readUint(r,s);return s+=4,l.numGlyphs=a.readUshort(r,s),s+=2,c==65536&&(l.maxPoints=a.readUshort(r,s),s+=2,l.maxContours=a.readUshort(r,s),s+=2,l.maxCompositePoints=a.readUshort(r,s),s+=2,l.maxCompositeContours=a.readUshort(r,s),s+=2,l.maxZones=a.readUshort(r,s),s+=2,l.maxTwilightPoints=a.readUshort(r,s),s+=2,l.maxStorage=a.readUshort(r,s),s+=2,l.maxFunctionDefs=a.readUshort(r,s),s+=2,l.maxInstructionDefs=a.readUshort(r,s),s+=2,l.maxStackElements=a.readUshort(r,s),s+=2,l.maxSizeOfInstructions=a.readUshort(r,s),s+=2,l.maxComponentElements=a.readUshort(r,s),s+=2,l.maxComponentDepth=a.readUshort(r,s),s+=2),l},e.name={},e.name.parse=function(r,s,o){var a=e._bin,l={};a.readUshort(r,s),s+=2;var c=a.readUshort(r,s);s+=2,a.readUshort(r,s);for(var d,h=[\"copyright\",\"fontFamily\",\"fontSubfamily\",\"ID\",\"fullName\",\"version\",\"postScriptName\",\"trademark\",\"manufacturer\",\"designer\",\"description\",\"urlVendor\",\"urlDesigner\",\"licence\",\"licenceURL\",\"---\",\"typoFamilyName\",\"typoSubfamilyName\",\"compatibleFull\",\"sampleText\",\"postScriptCID\",\"wwsFamilyName\",\"wwsSubfamilyName\",\"lightPalette\",\"darkPalette\"],p=s+=2,m=0;m<c;m++){var v=a.readUshort(r,s);s+=2;var y=a.readUshort(r,s);s+=2;var x=a.readUshort(r,s);s+=2;var w=a.readUshort(r,s);s+=2;var _=a.readUshort(r,s);s+=2;var S=a.readUshort(r,s);s+=2;var b,T=h[w],A=p+12*c+S;if(v==0)b=a.readUnicode(r,A,_/2);else if(v==3&&y==0)b=a.readUnicode(r,A,_/2);else if(y==0)b=a.readASCII(r,A,_);else if(y==1)b=a.readUnicode(r,A,_/2);else if(y==3)b=a.readUnicode(r,A,_/2);else{if(v!=1)throw\"unknown encoding \"+y+\", platformID: \"+v;b=a.readASCII(r,A,_),console.debug(\"reading unknown MAC encoding \"+y+\" as ASCII\")}var L=\"p\"+v+\",\"+x.toString(16);l[L]==null&&(l[L]={}),l[L][T!==void 0?T:w]=b,l[L]._lang=x}for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==1033)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==0)return l[C];for(var C in l)if(l[C].postScriptName!=null&&l[C]._lang==3084)return l[C];for(var C in l)if(l[C].postScriptName!=null)return l[C];for(var C in l){d=C;break}return console.debug(\"returning name table with languageID \"+l[d]._lang),l[d]},e[\"OS/2\"]={},e[\"OS/2\"].parse=function(r,s,o){var a=e._bin.readUshort(r,s);s+=2;var l={};if(a==0)e[\"OS/2\"].version0(r,s,l);else if(a==1)e[\"OS/2\"].version1(r,s,l);else if(a==2||a==3||a==4)e[\"OS/2\"].version2(r,s,l);else{if(a!=5)throw\"unknown OS/2 table version: \"+a;e[\"OS/2\"].version5(r,s,l)}return l},e[\"OS/2\"].version0=function(r,s,o){var a=e._bin;return o.xAvgCharWidth=a.readShort(r,s),s+=2,o.usWeightClass=a.readUshort(r,s),s+=2,o.usWidthClass=a.readUshort(r,s),s+=2,o.fsType=a.readUshort(r,s),s+=2,o.ySubscriptXSize=a.readShort(r,s),s+=2,o.ySubscriptYSize=a.readShort(r,s),s+=2,o.ySubscriptXOffset=a.readShort(r,s),s+=2,o.ySubscriptYOffset=a.readShort(r,s),s+=2,o.ySuperscriptXSize=a.readShort(r,s),s+=2,o.ySuperscriptYSize=a.readShort(r,s),s+=2,o.ySuperscriptXOffset=a.readShort(r,s),s+=2,o.ySuperscriptYOffset=a.readShort(r,s),s+=2,o.yStrikeoutSize=a.readShort(r,s),s+=2,o.yStrikeoutPosition=a.readShort(r,s),s+=2,o.sFamilyClass=a.readShort(r,s),s+=2,o.panose=a.readBytes(r,s,10),s+=10,o.ulUnicodeRange1=a.readUint(r,s),s+=4,o.ulUnicodeRange2=a.readUint(r,s),s+=4,o.ulUnicodeRange3=a.readUint(r,s),s+=4,o.ulUnicodeRange4=a.readUint(r,s),s+=4,o.achVendID=[a.readInt8(r,s),a.readInt8(r,s+1),a.readInt8(r,s+2),a.readInt8(r,s+3)],s+=4,o.fsSelection=a.readUshort(r,s),s+=2,o.usFirstCharIndex=a.readUshort(r,s),s+=2,o.usLastCharIndex=a.readUshort(r,s),s+=2,o.sTypoAscender=a.readShort(r,s),s+=2,o.sTypoDescender=a.readShort(r,s),s+=2,o.sTypoLineGap=a.readShort(r,s),s+=2,o.usWinAscent=a.readUshort(r,s),s+=2,o.usWinDescent=a.readUshort(r,s),s+=2},e[\"OS/2\"].version1=function(r,s,o){var a=e._bin;return s=e[\"OS/2\"].version0(r,s,o),o.ulCodePageRange1=a.readUint(r,s),s+=4,o.ulCodePageRange2=a.readUint(r,s),s+=4},e[\"OS/2\"].version2=function(r,s,o){var a=e._bin;return s=e[\"OS/2\"].version1(r,s,o),o.sxHeight=a.readShort(r,s),s+=2,o.sCapHeight=a.readShort(r,s),s+=2,o.usDefault=a.readUshort(r,s),s+=2,o.usBreak=a.readUshort(r,s),s+=2,o.usMaxContext=a.readUshort(r,s),s+=2},e[\"OS/2\"].version5=function(r,s,o){var a=e._bin;return s=e[\"OS/2\"].version2(r,s,o),o.usLowerOpticalPointSize=a.readUshort(r,s),s+=2,o.usUpperOpticalPointSize=a.readUshort(r,s),s+=2},e.post={},e.post.parse=function(r,s,o){var a=e._bin,l={};return l.version=a.readFixed(r,s),s+=4,l.italicAngle=a.readFixed(r,s),s+=4,l.underlinePosition=a.readShort(r,s),s+=2,l.underlineThickness=a.readShort(r,s),s+=2,l},e==null&&(e={}),e.U==null&&(e.U={}),e.U.codeToGlyph=function(r,s){var o=r.cmap,a=-1;if(o.p0e4!=null?a=o.p0e4:o.p3e1!=null?a=o.p3e1:o.p1e0!=null?a=o.p1e0:o.p0e3!=null&&(a=o.p0e3),a==-1)throw\"no familiar platform and encoding!\";var l=o.tables[a];if(l.format==0)return s>=l.map.length?0:l.map[s];if(l.format==4){for(var c=-1,d=0;d<l.endCount.length;d++)if(s<=l.endCount[d]){c=d;break}return c==-1||l.startCount[c]>s?0:65535&(l.idRangeOffset[c]!=0?l.glyphIdArray[s-l.startCount[c]+(l.idRangeOffset[c]>>1)-(l.idRangeOffset.length-c)]:s+l.idDelta[c])}if(l.format==12){if(s>l.groups[l.groups.length-1][1])return 0;for(d=0;d<l.groups.length;d++){var h=l.groups[d];if(h[0]<=s&&s<=h[1])return h[2]+(s-h[0])}return 0}throw\"unknown cmap table format \"+l.format},e.U.glyphToPath=function(r,s){var o={cmds:[],crds:[]};if(r.SVG&&r.SVG.entries[s]){var a=r.SVG.entries[s];return a==null?o:(typeof a==\"string\"&&(a=e.SVG.toPath(a),r.SVG.entries[s]=a),a)}if(r.CFF){var l={x:0,y:0,stack:[],nStems:0,haveWidth:!1,width:r.CFF.Private?r.CFF.Private.defaultWidthX:0,open:!1},c=r.CFF,d=r.CFF.Private;if(c.ROS){for(var h=0;c.FDSelect[h+2]<=s;)h+=2;d=c.FDArray[c.FDSelect[h+1]].Private}e.U._drawCFF(r.CFF.CharStrings[s],l,c,d,o)}else r.glyf&&e.U._drawGlyf(s,r,o);return o},e.U._drawGlyf=function(r,s,o){var a=s.glyf[r];a==null&&(a=s.glyf[r]=e.glyf._parseGlyf(s,r)),a!=null&&(a.noc>-1?e.U._simpleGlyph(a,o):e.U._compoGlyph(a,s,o))},e.U._simpleGlyph=function(r,s){for(var o=0;o<r.noc;o++){for(var a=o==0?0:r.endPts[o-1]+1,l=r.endPts[o],c=a;c<=l;c++){var d=c==a?l:c-1,h=c==l?a:c+1,p=1&r.flags[c],m=1&r.flags[d],v=1&r.flags[h],y=r.xs[c],x=r.ys[c];if(c==a)if(p){if(!m){e.U.P.moveTo(s,y,x);continue}e.U.P.moveTo(s,r.xs[d],r.ys[d])}else m?e.U.P.moveTo(s,r.xs[d],r.ys[d]):e.U.P.moveTo(s,(r.xs[d]+y)/2,(r.ys[d]+x)/2);p?m&&e.U.P.lineTo(s,y,x):v?e.U.P.qcurveTo(s,y,x,r.xs[h],r.ys[h]):e.U.P.qcurveTo(s,y,x,(y+r.xs[h])/2,(x+r.ys[h])/2)}e.U.P.closePath(s)}},e.U._compoGlyph=function(r,s,o){for(var a=0;a<r.parts.length;a++){var l={cmds:[],crds:[]},c=r.parts[a];e.U._drawGlyf(c.glyphIndex,s,l);for(var d=c.m,h=0;h<l.crds.length;h+=2){var p=l.crds[h],m=l.crds[h+1];o.crds.push(p*d.a+m*d.b+d.tx),o.crds.push(p*d.c+m*d.d+d.ty)}for(h=0;h<l.cmds.length;h++)o.cmds.push(l.cmds[h])}},e.U._getGlyphClass=function(r,s){var o=e._lctf.getInterval(s,r);return o==-1?0:s[o+2]},e.U.getPairAdjustment=function(r,s,o){var a=!1;if(r.GPOS)for(var l=r.GPOS,c=l.lookupList,d=l.featureList,h=[],p=0;p<d.length;p++){var m=d[p];if(m.tag==\"kern\"){a=!0;for(var v=0;v<m.tab.length;v++)if(!h[m.tab[v]]){h[m.tab[v]]=!0;for(var y=c[m.tab[v]],x=0;x<y.tabs.length;x++)if(y.tabs[x]!=null){var w,_=y.tabs[x];if((!_.coverage||(w=e._lctf.coverageIndex(_.coverage,s))!=-1)&&y.ltype!=1){if(y.ltype==2){var S=null;if(_.fmt==1){var b=_.pairsets[w];for(p=0;p<b.length;p++)b[p].gid2==o&&(S=b[p])}else if(_.fmt==2){var T=e.U._getGlyphClass(s,_.classDef1),A=e.U._getGlyphClass(o,_.classDef2);S=_.matrix[T][A]}if(S){var L=0;return S.val1&&S.val1[2]&&(L+=S.val1[2]),S.val2&&S.val2[0]&&(L+=S.val2[0]),L}}}}}}}if(r.kern&&!a){var C=r.kern.glyph1.indexOf(s);if(C!=-1){var R=r.kern.rval[C].glyph2.indexOf(o);if(R!=-1)return r.kern.rval[C].vals[R]}}return 0},e.U._applySubs=function(r,s,o,a){for(var l=r.length-s-1,c=0;c<o.tabs.length;c++)if(o.tabs[c]!=null){var d,h=o.tabs[c];if(!h.coverage||(d=e._lctf.coverageIndex(h.coverage,r[s]))!=-1){if(o.ltype==1)r[s],h.fmt==1?r[s]=r[s]+h.delta:r[s]=h.newg[d];else if(o.ltype==4)for(var p=h.vals[d],m=0;m<p.length;m++){var v=p[m],y=v.chain.length;if(!(y>l)){for(var x=!0,w=0,_=0;_<y;_++){for(;r[s+w+(1+_)]==-1;)w++;v.chain[_]!=r[s+w+(1+_)]&&(x=!1)}if(x){for(r[s]=v.nglyph,_=0;_<y+w;_++)r[s+_+1]=-1;break}}}else if(o.ltype==5&&h.fmt==2)for(var S=e._lctf.getInterval(h.cDef,r[s]),b=h.cDef[S+2],T=h.scset[b],A=0;A<T.length;A++){var L=T[A],C=L.input;if(!(C.length>l)){for(x=!0,_=0;_<C.length;_++){var R=e._lctf.getInterval(h.cDef,r[s+1+_]);if(S==-1&&h.cDef[R+2]!=C[_]){x=!1;break}}if(x){var k=L.substLookupRecords;for(m=0;m<k.length;m+=2)k[m],k[m+1]}}}else if(o.ltype==6&&h.fmt==3){if(!e.U._glsCovered(r,h.backCvg,s-h.backCvg.length)||!e.U._glsCovered(r,h.inptCvg,s)||!e.U._glsCovered(r,h.ahedCvg,s+h.inptCvg.length))continue;var H=h.lookupRec;for(A=0;A<H.length;A+=2){S=H[A];var V=a[H[A+1]];e.U._applySubs(r,s+S,V,a)}}}}},e.U._glsCovered=function(r,s,o){for(var a=0;a<s.length;a++)if(e._lctf.coverageIndex(s[a],r[o+a])==-1)return!1;return!0},e.U.glyphsToPath=function(r,s,o){for(var a={cmds:[],crds:[]},l=0,c=0;c<s.length;c++){var d=s[c];if(d!=-1){for(var h=c<s.length-1&&s[c+1]!=-1?s[c+1]:0,p=e.U.glyphToPath(r,d),m=0;m<p.crds.length;m+=2)a.crds.push(p.crds[m]+l),a.crds.push(p.crds[m+1]);for(o&&a.cmds.push(o),m=0;m<p.cmds.length;m++)a.cmds.push(p.cmds[m]);o&&a.cmds.push(\"X\"),l+=r.hmtx.aWidth[d],c<s.length-1&&(l+=e.U.getPairAdjustment(r,d,h))}}return a},e.U.P={},e.U.P.moveTo=function(r,s,o){r.cmds.push(\"M\"),r.crds.push(s,o)},e.U.P.lineTo=function(r,s,o){r.cmds.push(\"L\"),r.crds.push(s,o)},e.U.P.curveTo=function(r,s,o,a,l,c,d){r.cmds.push(\"C\"),r.crds.push(s,o,a,l,c,d)},e.U.P.qcurveTo=function(r,s,o,a,l){r.cmds.push(\"Q\"),r.crds.push(s,o,a,l)},e.U.P.closePath=function(r){r.cmds.push(\"Z\")},e.U._drawCFF=function(r,s,o,a,l){for(var c=s.stack,d=s.nStems,h=s.haveWidth,p=s.width,m=s.open,v=0,y=s.x,x=s.y,w=0,_=0,S=0,b=0,T=0,A=0,L=0,C=0,R=0,k=0,H={val:0,size:0};v<r.length;){e.CFF.getCharString(r,v,H);var V=H.val;if(v+=H.size,V==\"o1\"||V==\"o18\")c.length%2!=0&&!h&&(p=c.shift()+a.nominalWidthX),d+=c.length>>1,c.length=0,h=!0;else if(V==\"o3\"||V==\"o23\")c.length%2!=0&&!h&&(p=c.shift()+a.nominalWidthX),d+=c.length>>1,c.length=0,h=!0;else if(V==\"o4\")c.length>1&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),m&&e.U.P.closePath(l),x+=c.pop(),e.U.P.moveTo(l,y,x),m=!0;else if(V==\"o5\")for(;c.length>0;)y+=c.shift(),x+=c.shift(),e.U.P.lineTo(l,y,x);else if(V==\"o6\"||V==\"o7\")for(var W=c.length,F=V==\"o6\",J=0;J<W;J++){var K=c.shift();F?y+=K:x+=K,F=!F,e.U.P.lineTo(l,y,x)}else if(V==\"o8\"||V==\"o24\"){W=c.length;for(var ue=0;ue+6<=W;)w=y+c.shift(),_=x+c.shift(),S=w+c.shift(),b=_+c.shift(),y=S+c.shift(),x=b+c.shift(),e.U.P.curveTo(l,w,_,S,b,y,x),ue+=6;V==\"o24\"&&(y+=c.shift(),x+=c.shift(),e.U.P.lineTo(l,y,x))}else{if(V==\"o11\")break;if(V==\"o1234\"||V==\"o1235\"||V==\"o1236\"||V==\"o1237\")V==\"o1234\"&&(_=x,S=(w=y+c.shift())+c.shift(),k=b=_+c.shift(),A=b,C=x,y=(L=(T=(R=S+c.shift())+c.shift())+c.shift())+c.shift(),e.U.P.curveTo(l,w,_,S,b,R,k),e.U.P.curveTo(l,T,A,L,C,y,x)),V==\"o1235\"&&(w=y+c.shift(),_=x+c.shift(),S=w+c.shift(),b=_+c.shift(),R=S+c.shift(),k=b+c.shift(),T=R+c.shift(),A=k+c.shift(),L=T+c.shift(),C=A+c.shift(),y=L+c.shift(),x=C+c.shift(),c.shift(),e.U.P.curveTo(l,w,_,S,b,R,k),e.U.P.curveTo(l,T,A,L,C,y,x)),V==\"o1236\"&&(w=y+c.shift(),_=x+c.shift(),S=w+c.shift(),k=b=_+c.shift(),A=b,L=(T=(R=S+c.shift())+c.shift())+c.shift(),C=A+c.shift(),y=L+c.shift(),e.U.P.curveTo(l,w,_,S,b,R,k),e.U.P.curveTo(l,T,A,L,C,y,x)),V==\"o1237\"&&(w=y+c.shift(),_=x+c.shift(),S=w+c.shift(),b=_+c.shift(),R=S+c.shift(),k=b+c.shift(),T=R+c.shift(),A=k+c.shift(),L=T+c.shift(),C=A+c.shift(),Math.abs(L-y)>Math.abs(C-x)?y=L+c.shift():x=C+c.shift(),e.U.P.curveTo(l,w,_,S,b,R,k),e.U.P.curveTo(l,T,A,L,C,y,x));else if(V==\"o14\"){if(c.length>0&&!h&&(p=c.shift()+o.nominalWidthX,h=!0),c.length==4){var O=c.shift(),U=c.shift(),X=c.shift(),D=c.shift(),G=e.CFF.glyphBySE(o,X),$=e.CFF.glyphBySE(o,D);e.U._drawCFF(o.CharStrings[G],s,o,a,l),s.x=O,s.y=U,e.U._drawCFF(o.CharStrings[$],s,o,a,l)}m&&(e.U.P.closePath(l),m=!1)}else if(V==\"o19\"||V==\"o20\")c.length%2!=0&&!h&&(p=c.shift()+a.nominalWidthX),d+=c.length>>1,c.length=0,h=!0,v+=d+7>>3;else if(V==\"o21\")c.length>2&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),x+=c.pop(),y+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,y,x),m=!0;else if(V==\"o22\")c.length>1&&!h&&(p=c.shift()+a.nominalWidthX,h=!0),y+=c.pop(),m&&e.U.P.closePath(l),e.U.P.moveTo(l,y,x),m=!0;else if(V==\"o25\"){for(;c.length>6;)y+=c.shift(),x+=c.shift(),e.U.P.lineTo(l,y,x);w=y+c.shift(),_=x+c.shift(),S=w+c.shift(),b=_+c.shift(),y=S+c.shift(),x=b+c.shift(),e.U.P.curveTo(l,w,_,S,b,y,x)}else if(V==\"o26\")for(c.length%2&&(y+=c.shift());c.length>0;)w=y,_=x+c.shift(),y=S=w+c.shift(),x=(b=_+c.shift())+c.shift(),e.U.P.curveTo(l,w,_,S,b,y,x);else if(V==\"o27\")for(c.length%2&&(x+=c.shift());c.length>0;)_=x,S=(w=y+c.shift())+c.shift(),b=_+c.shift(),y=S+c.shift(),x=b,e.U.P.curveTo(l,w,_,S,b,y,x);else if(V==\"o10\"||V==\"o29\"){var ne=V==\"o10\"?a:o;if(c.length==0)console.debug(\"error: empty stack\");else{var ie=c.pop(),q=ne.Subrs[ie+ne.Bias];s.x=y,s.y=x,s.nStems=d,s.haveWidth=h,s.width=p,s.open=m,e.U._drawCFF(q,s,o,a,l),y=s.x,x=s.y,d=s.nStems,h=s.haveWidth,p=s.width,m=s.open}}else if(V==\"o30\"||V==\"o31\"){var fe=c.length,de=(ue=0,V==\"o31\");for(ue+=fe-(W=-3&fe);ue<W;)de?(_=x,S=(w=y+c.shift())+c.shift(),x=(b=_+c.shift())+c.shift(),W-ue==5?(y=S+c.shift(),ue++):y=S,de=!1):(w=y,_=x+c.shift(),S=w+c.shift(),b=_+c.shift(),y=S+c.shift(),W-ue==5?(x=b+c.shift(),ue++):x=b,de=!0),e.U.P.curveTo(l,w,_,S,b,y,x),ue+=4}else{if((V+\"\").charAt(0)==\"o\")throw console.debug(\"Unknown operation: \"+V,r),V;c.push(V)}}}s.x=y,s.y=x,s.nStems=d,s.haveWidth=h,s.width=p,s.open=m};var t=e,i={Typr:t};return n.Typr=t,n.default=i,Object.defineProperty(n,\"__esModule\",{value:!0}),n}({}).Typr}", "frame() {\n throw new Error('Not implemented');\n }", "__previnit(){}", "isGMOnly() {\n return false\n }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function DWRUtil() { }", "function fos6_c() {\n ;\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "bfs() {\n throw new Error(\"This method hasn't been implemented yet!\");\n }", "initialize()\n {\n }", "static get END() { return 6; }", "fixupFrame() {\n // stub, used by Chaos Dragon\n }", "static transient final private public internal function m42() {}", "function __func(){}", "onLoad() { }", "function gfg() {}", "init () {}", "init () {}", "static MAGIC_NUMBER(){\n return \"PIXPIPE_PIXBIN\";\n }", "initialize() {\n\n }", "function gd(){}", "function Util() {}", "function Main()\n {\n \n }", "function no_overlib() { return ver3fix; }", "function _0x49e8(){const _0x2abf1f=['128458zaqRph','15LuvETp','32FoIOpf','By\\x20:\\x20Prassz','307917pLgBPR','Zerobot~Prassz','127514DLEruK','2301110zFGGkR','11iUrhyl','5IBSTLg','sendMessage','2099160NwtLDQ','672988HpVyoZ','1059558OLmAKI'];_0x49e8=function(){return _0x2abf1f;};return _0x49e8();}", "function AeUtil() {}", "function X(){!function(t){$[W++]^=255&t,$[W++]^=t>>8&255,$[W++]^=t>>16&255,$[W++]^=t>>24&255,W>=J&&(W-=J)}((new Date).getTime())}", "patch() {\n }", "static fromCASFile(casfile) {\n//-----------\nlggr.warn(\"fromCASFile: Not implemented\");\nreturn void 0;\n}", "function X(){!function(e){H[G++]^=255&e,H[G++]^=e>>8&255,H[G++]^=e>>16&255,H[G++]^=e>>24&255,G>=256&&(G-=256)}((new Date).getTime())}", "function init() {\n //UH HUH, THIS MY SHIT!\n }", "toString(){\n\t\treturn 'not implemented';\n\t}", "static get NOT_READY () {return 0}", "lastUsed() { }" ]
[ "0.7138198", "0.6836233", "0.65235883", "0.6500098", "0.62371546", "0.61890924", "0.61654526", "0.6165028", "0.6161057", "0.6100218", "0.6043434", "0.60406536", "0.59524876", "0.5912759", "0.5884074", "0.5863032", "0.5859196", "0.57833964", "0.5691056", "0.5660413", "0.56454086", "0.563765", "0.56208336", "0.557181", "0.5569557", "0.55466586", "0.5487467", "0.54791886", "0.546727", "0.5432232", "0.5430478", "0.54293233", "0.54071516", "0.5354371", "0.5353202", "0.5353202", "0.53375286", "0.53219855", "0.5319988", "0.5262742", "0.51713026", "0.51468366", "0.5141665", "0.5141665", "0.5141665", "0.5112046", "0.5112046", "0.5112046", "0.5112046", "0.5112046", "0.5112046", "0.51015127", "0.5101486", "0.5101486", "0.5095354", "0.50873846", "0.5083452", "0.5065008", "0.5064456", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.5059862", "0.50181484", "0.50119776", "0.5005967", "0.5005967", "0.50055236", "0.49978405", "0.4984046", "0.49784687", "0.4965883", "0.49520564", "0.49518138", "0.49387982", "0.49387982", "0.49355972", "0.4931993", "0.49295655", "0.49282774", "0.49280846", "0.49200585", "0.49175236", "0.49142665", "0.49136642", "0.49100918", "0.49034646", "0.49030524", "0.4898878", "0.48853967", "0.48845017", "0.48836228" ]
0.0
-1
! vuerouter v3.1.3 (c) 2019 Evan You
function d(t){return Object.prototype.toString.call(t).indexOf("Error")>-1}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function jj(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "private public function m246() {}", "function TM(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function BO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Es(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "private internal function m248() {}", "function Uk(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Qw(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "vampireWithName(name) {\n \n }", "function yh(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"graticule.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function fyv(){\n \n }", "function iP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"source.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function version(){ return \"0.13.0\" }", "function vT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function cO(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"source.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Wx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function ow(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Ak(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Rb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function VI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function dp(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function PD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Ek(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function jx(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function Bv(e){let{basename:t,children:n,window:r}=e,l=X.exports.useRef();l.current==null&&(l.current=gv({window:r}));let o=l.current,[i,u]=X.exports.useState({action:o.action,location:o.location});return X.exports.useLayoutEffect(()=>o.listen(u),[o]),X.exports.createElement(Fv,{basename:t,children:n,location:i.location,navigationType:i.action,navigator:o})}", "transient private internal function m185() {}", "upgrade() {}", "function SigV4Utils() { }", "function hA(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"geom.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "function uf(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function $S(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function comportement (){\n\t }", "function Hr(e,t){\"undefined\"!==typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "updated() {}", "added(vrobject){}", "function JV(e,t){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+e),t&&console.warn(t.stack))}", "function vI(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Vt(){this.__data__=[]}", "transient final protected internal function m174() {}", "protected internal function m252() {}", "function VO(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};VO.installed||(VO.installed=!0,t.use(i,e),t.use(r,e),t.use(o,e),t.use(a,e),t.use(s,e),t.use(u,e),t.use(l,e),t.use(c,e),t.use(d,e),t.use(h,e),t.use(f,e),t.use(p,e),t.use(m,e),t.use(v,e),t.use(g,e),t.use(_,e),t.use(y,e),t.use(b,e),t.use(x,e),t.use(w,e),t.use(A,e),t.use(M,e),t.use(S,e),t.use(T,e),t.use(k,e),t.use(O,e),t.use(C,e),t.use(L,e),t.use(E,e),t.use(D,e),t.use(j,e),t.use(I,e),t.use(P,e),t.use(Y,e),t.use(F,e),t.use(R,e),t.use(N,e),t.use(B,e),t.use($,e),t.use(z,e),t.use(H,e),t.use(V,e),t.use(G,e))}", "static get tag(){return\"hal-9000\"}", "function EN(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "transient protected internal function m189() {}", "function WD(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"geom.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function Bevy() {}", "function zC(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"layer.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "install(Vue, options) {\n Vue.VERSION = 'v0.0.1';\n\n let userOptions = {...defaultOptions, ...options};\n // console.log(userOptions)\n\n // create a mixin\n Vue.mixin({\n // created() {\n // console.log(Vue.VERSION);\n // },\n\n\n });\n Vue.prototype.$italicHTML = function (text) {\n return '<i>' + text + '</i>';\n }\n Vue.prototype.$boldHTML = function (text) {\n return '<b>' + text + '</b>';\n }\n\n // define a global filter\n Vue.filter('preview', (value) => {\n if (!value) {\n return '';\n }\n return value.substring(0, userOptions.cutoff) + '...';\n })\n\n Vue.filter('localname', (value) => {\n if (!value) {\n return '';\n }\n var ln = value;\n if(value!= undefined){\n if ( value.lastIndexOf(\"#\") != -1) { ln = value.substr(value.lastIndexOf(\"#\")).substr(1)}\n else{ ln = value.substr(value.lastIndexOf(\"/\")).substr(1) }\n ln = ln.length == 0 ? value : ln\n }\n return ln\n })\n\n // add a custom directive\n Vue.directive('focus', {\n // When the bound element is inserted into the DOM...\n inserted: function (el) {\n // Focus the element\n el.focus();\n }\n })\n\n }", "function iT(t,e,n,i,r,o,a,s){var u=(\"function\"===typeof n?n.options:n)||{};return u.__file=\"layer.vue\",u.render||(u.render=t.render,u.staticRenderFns=t.staticRenderFns,u._compiled=!0,r&&(u.functional=!0)),u._scopeId=i,u}", "function __vue_normalize__(a,b,c,d,e){var f=(\"function\"==typeof c?c.options:c)||{};// For security concerns, we use only base name in production mode.\nreturn f.__file=\"/Users/hadefication/Packages/vue-chartisan/src/components/Pie.vue\",f.render||(f.render=a.render,f.staticRenderFns=a.staticRenderFns,f._compiled=!0,e&&(f.functional=!0)),f._scopeId=d,f}", "transient private protected internal function m182() {}", "function vinewx(t=\"untitled\",s=!1){return new class{constructor(t,s){this.name=t,this.debug=s,this.isQX=\"undefined\"!=typeof $task,this.isLoon=\"undefined\"!=typeof $loon,this.isSurge=\"undefined\"!=typeof $httpClient&&!this.isLoon,this.isNode=\"function\"==typeof require,this.isJSBox=this.isNode&&\"undefined\"!=typeof $jsbox,this.node=(()=>this.isNode?{request:\"undefined\"!=typeof $request?void 0:require(\"request\"),fs:require(\"fs\")}:null)(),this.cache=this.initCache(),this.log(`INITIAL CACHE:\\n${JSON.stringify(this.cache)}`),Promise.prototype.delay=function(t){return this.then(function(s){return((t,s)=>new Promise(function(e){setTimeout(e.bind(null,s),t)}))(t,s)})}}get(t){return this.isQX?(\"string\"==typeof t&&(t={url:t,method:\"GET\"}),$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.get(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}post(t){return this.isQX?(\"string\"==typeof t&&(t={url:t}),t.method=\"POST\",$task.fetch(t)):new Promise((s,e)=>{this.isLoon||this.isSurge?$httpClient.post(t,(t,i,o)=>{t?e(t):s({status:i.status,headers:i.headers,body:o})}):this.node.request.post(t,(t,i,o)=>{t?e(t):s({...i,status:i.statusCode,body:o})})})}initCache(){if(this.isQX)return JSON.parse($prefs.valueForKey(this.name)||\"{}\");if(this.isLoon||this.isSurge)return JSON.parse($persistentStore.read(this.name)||\"{}\");if(this.isNode){const t=`${this.name}.json`;return this.node.fs.existsSync(t)?JSON.parse(this.node.fs.readFileSync(`${this.name}.json`)):(this.node.fs.writeFileSync(t,JSON.stringify({}),{flag:\"wx\"},t=>console.log(t)),{})}}persistCache(){const t=JSON.stringify(this.cache);this.log(`FLUSHING DATA:\\n${t}`),this.isQX&&$prefs.setValueForKey(t,this.name),(this.isLoon||this.isSurge)&&$persistentStore.write(t,this.name),this.isNode&&this.node.fs.writeFileSync(`${this.name}.json`,t,{flag:\"w\"},t=>console.log(t))}write(t,s){this.log(`SET ${s} = ${JSON.stringify(t)}`),this.cache[s]=t,this.persistCache()}read(t){return this.log(`READ ${t} ==> ${JSON.stringify(this.cache[t])}`),this.cache[t]}delete(t){this.log(`DELETE ${t}`),delete this.cache[t],this.persistCache()}notify(t,s,e,i){const o=\"string\"==typeof i?i:void 0,n=e+(null==o?\"\":`\\n${o}`);this.isQX&&(void 0!==o?$notify(t,s,e,{\"open-url\":o}):$notify(t,s,e,i)),this.isSurge&&$notification.post(t,s,n),this.isLoon&&$notification.post(t,s,e),this.isNode&&(this.isJSBox?require(\"push\").schedule({title:t,body:s?s+\"\\n\"+e:e}):console.log(`${t}\\n${s}\\n${n}\\n\\n`))}log(t){this.debug&&console.log(t)}info(t){console.log(t)}error(t){console.log(\"ERROR: \"+t)}wait(t){return new Promise(s=>setTimeout(s,t))}done(t={}){this.isQX||this.isLoon||this.isSurge?$done(t):this.isNode&&!this.isJSBox&&\"undefined\"!=typeof $context&&($context.headers=t.headers,$context.statusCode=t.statusCode,$context.body=t.body)}}(t,s)}", "function UserGallerie()\n{\n var Video=deserialize(\"Video\",{});\n // Vorschauliste bunt\n var VideoLinks=$x(\"//a[contains(@href,'watch?v=')]\")\n .map(function (a) { return { link:a.href, elem:('user'==Kategorie?$xs(\"ancestor::div[@class='video yt-tile-visible'] | ancestor::li[@class='channels-content-item']\",a):'channel'==Kategorie?$xs('../..',a):a.parentNode)||a }; })\n .map(function (vid) { vid.id=((vid.link||\"\").match(/v=([a-zA-Z0-9-_]*)/)||[\"\",\"\"])[1]; return vid; });\n //alert(uneval(VideoLinks));\n VideoLinks.forEach(function (vid) { if (Video[vid.id]) /*vid.elem.className=\"w\"+Video[vid.id].qualitaet;*/ vid.elem.style.backgroundColor={ \"gut\":\"green\", \"schlecht\":\"red\", undefined:\"yellow\" }[Video[vid.id].qualitaet]; });\n //showmsg({ text:\"aaa\" });\n $x(\"//a[contains(@href,'v=')]\").forEach(function (a) { a.addEventListener(\"click\",function(event){\n //if (event.ctrlKey) // && event.altKey)\n //{\n var e=event.target;\n while (!e || !e.href) e=e.parentNode;\n var VideoID=e.href.match(/v=([a-zA-Z0-9-_]*)/)[1];\n var Video=deserialize(\"Video\",{});\n if (!Video[VideoID])\n {\n Video[VideoID]={ id:VideoID, anz:0, lastseen:new Date() };\n serialize(\"Video\",Video);\n var ColorNode=$xs(\"ancestor::div[@class='video yt-tile-visible'] | ancestor::li[@class='channels-content-item']\",a)||a;\n ColorNode.style.color=\"lightgray\";\n ColorNode.style.backgroundColor=\"darkgray\";\n event.stopPropagation();\n event.preventDefault();\n }\n //}\n }, true); });\n}", "ready() {\n window.plugin = new window.Vue( {\n el : this.shadowRoot,\n created() {\n Editor.log( \"成功初始化\" );\n },\n data : {\n uuid : \"bae4f6b4-7d1e-4612-99b7-ab5239576cc1\",\n scriptUrl: \"\",\n uuidObj : {},\n isFind : false,\n isFindAll: true,\n },\n methods: {\n _setOpenUrl() {\n let path = Editor.url( 'db://assets' );\n let files = Editor.Dialog.openFile( {\n defaultPath: path,\n properties : [ 'openDirectory' ]\n } );\n if ( files ) {\n path = files[0];\n }\n this.scriptUrl = path;\n },\n onSelectJSPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, \"javascript\" );\n },\n\n onSelectSFPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, \"sprite-frame\" );\n },\n\n onSelectFontPath() {\n this._setOpenUrl();\n let assetUrl = Editor.remote.assetdb.fspathToUrl( this.scriptUrl );\n if ( this.scriptUrl === assetUrl ) {\n Editor.warn( \"请选择项目目录哦\" );\n return;\n }\n this._analyzeUUIDInfo( assetUrl, [ \"label-atlas\", \"bitmap-font\" ] );\n },\n\n _analyzeUUIDInfo( url, type ) {\n let self = this;\n self.uuidObj = {};\n Editor.assetdb.queryAssets( url + \"/**/*\", type, function ( err, results ) {\n if ( err ) return;\n let len = results.length;\n for (let i = 0; i < len; i++) {\n let uuid = results[i].uuid;\n if ( type === \"javascript\" ) uuid = Editor.Utils.UuidUtils.compressUuid( results[i].uuid );\n self.uuidObj[uuid] = results[i];\n }\n } );\n },\n onCheckUUID() {\n Editor.log( 'check uuid', this.uuid );\n },\n onFindUUID() {\n // Editor.assetdb.queryUuidByUrl( url, function ( err, uuid ) {\n // Editor.log( \"uuid\", uuid );\n // } );\n if ( this.isFind ) {\n Editor.log( \"正在查找中.........\" );\n return;\n }\n this.isFind = true;\n let self = this;\n let objs = Object.values( this.uuidObj );\n if ( objs.length > 0 ) {\n Editor.log( objs[0].type );\n this._findInfo( objs[0].type, this.uuidObj );\n return;\n }\n if ( !this._isUUID() ) {\n Editor.log( \"uuid 无效\" );\n return;\n }\n let url = Editor.remote.assetdb.uuidToUrl( this.uuid );\n Editor.log( \"开始查找!!!!!!!\", this.uuid, url );\n Editor.assetdb.queryInfoByUuid( this.uuid, function ( err, info ) {\n Editor.log( \"当前查找的文件信息\", info, self.uuid );\n if ( err ) return;\n self._findInfo( info.type );\n } );\n // Editor.assetdb.queryUrlByUuid( this.uuid, function ( err, url ) {\n // Editor.log( \"info1\", url );\n // } );\n },\n _isUUID() {\n let isUUID = Editor.Utils.UuidUtils.isUuid( this.uuid );\n return isUUID;\n },\n\n _findInfo( type, uuidOrObj ) {\n let self = this;\n Editor.log( \"find \" + type );\n if ( type === \"sprite-frame\" || type === \"label-atlas\" || type === \"bitmap-font\" ) {\n Editor.assetdb.queryAssets( \"db://assets/resources/prefab/**/*\", [ 'prefab', 'scene' ], function ( err, results ) {\n Editor.log( \"查找 prefab 文件数量:\", results.length );\n self._analyze( results, type, uuidOrObj || self.uuid );\n } );\n } else if ( type === \"javascript\" ) {\n Editor.assetdb.queryAssets( \"db://assets/resources/prefab/**/*\", [ 'prefab', 'scene' ], function ( err, results ) {\n Editor.log( \"查找 prefab 文件数量:\", results.length );\n let uuid = uuidOrObj || Editor.Utils.UuidUtils.compressUuid( self.uuid );\n self._analyze( results, type, uuid );\n } );\n }\n },\n\n _analyze( list, type, uuidOrObj ) {\n let uuidObj = uuidOrObj;\n if ( typeof uuidOrObj === \"string\" ) {\n uuidObj = { [uuidOrObj]: { uuid: uuidOrObj } };\n }\n let len = Array.isArray( list ) ? list.length : 0;\n let result = \"\";\n for (let i = 0; i < len; i++) {\n let template = Fs.readFileSync( list[i].path, 'utf-8' );\n let json = JSON.parse( template ) || [];\n let num = json.length;\n Editor.log( \"正在查找当前文件:\", list[i].path );\n for (let j = 0; j < num; j++) {\n let obj = json[j];\n if ( !obj ) continue;\n let uObj = null;\n if ( type === \"sprite-frame\" ) {\n uObj = this._getSpriteFrame( obj, uuidObj );\n } else if ( type === \"javascript\" ) {\n uObj = this._getSpriteScript( obj, uuidObj );\n } else if ( type === \"label-atlas\" || type === \"bitmap-font\" ) {\n uObj = this._getSpriteFont( obj, uuidObj );\n }\n if ( !uObj ) continue;\n if ( uObj.isExist && !this.isFindAll ) continue;\n uObj.isExist = true;\n let path = uObj.path ? \"<\" + uObj.path + \">\" : uObj.uuid;\n result = result + path + list[i].path + \"\\n\";\n }\n }\n //查找玩家\n Editor.log( \"----------以下文件暂时没有找到引用---------------\" );\n let values = Object.values( uuidObj );\n let count = values.length;\n let sum = 0;\n for (let i = 0; i < count; i++) {\n if ( values[i].isExist ) continue;\n let path = values[i].path ? values[i].path : values[i].uuid;\n Editor.log( path );\n sum++;\n }\n Editor.log( \"总计有\", sum, \"个类型\", type, \"文件未被引用\" );\n this.uuidObj = {};\n this.isFind = false;\n Editor.log( \"----------查找到以下文件以及在那个预制文件下引用---------------\" );\n Editor.log( result );\n Editor.log( \"----------complete---------------\" );\n },\n _getSpriteFrame( obj, uuidObj ) {\n let result = null;\n do {\n if ( obj[\"__type__\"] !== \"cc.Sprite\" ) break;\n if ( !obj[\"_spriteFrame\"] ) break;\n let uObj = uuidObj[obj[\"_spriteFrame\"][\"__uuid__\"]];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n\n _getSpriteScript( obj, uuidObj ) {\n let result = null;\n do {\n let uObj = uuidObj[obj[\"__type__\"]];\n if ( uObj ) {\n result = uObj;\n break;\n }\n let componentId = obj[\"_componentId\"];\n if ( !componentId ) break;\n uObj = uuidObj[componentId];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n _getSpriteFont( obj, uuidObj ) {\n let result = null;\n do {\n if ( obj[\"__type__\"] !== \"cc.Label\" ) break;\n if ( !obj[\"_N$file\"] ) break;\n let uObj = uuidObj[obj[\"_N$file\"][\"__uuid__\"]];\n if ( !uObj ) break;\n result = uObj;\n } while ( 0 );\n return result;\n },\n }\n } );\n }", "function test_candu_graphs_datastore_vsphere6() {}", "function Jb(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "function ea(){}", "__previnit(){}", "function Eu(t,e){\"undefined\"!=typeof console&&(console.warn(\"[vue-i18n] \"+t),e&&console.warn(e.stack))}", "function i(t,e,n){if(o(t,e))return void(t[e]=n);if(t._isVue)return void i(t._data,e,n);var r=t.__ob__;if(!r)return void(t[e]=n);if(r.convert(e,n),r.dep.notify(),r.vms)for(var s=r.vms.length;s--;){var a=r.vms[s];a._proxy(e),a._digest()}return n}", "function vB_PHP_Emulator()\n{\n}", "function FP(t,e,n,r,i,o,a,s){var l=(\"function\"===typeof n?n.options:n)||{};return l.__file=\"style.vue\",l.render||(l.render=t.render,l.staticRenderFns=t.staticRenderFns,l._compiled=!0,i&&(l.functional=!0)),l._scopeId=r,l}", "constructor() {\n \n \n \n }", "constructor() {\n \n \n \n }" ]
[ "0.59254473", "0.58895314", "0.5834521", "0.58120894", "0.57648623", "0.5731167", "0.56673914", "0.56521726", "0.56487083", "0.5628806", "0.56131107", "0.5610753", "0.5605729", "0.5538249", "0.5529956", "0.54961896", "0.54924136", "0.5469004", "0.54286796", "0.54227495", "0.54162914", "0.5404479", "0.54027313", "0.5401818", "0.5388257", "0.53679484", "0.5357336", "0.5344159", "0.534152", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5339272", "0.5322351", "0.5316871", "0.5315919", "0.5299649", "0.52945226", "0.5290038", "0.5281144", "0.52685684", "0.5260795", "0.5253752", "0.5239569", "0.5223893", "0.5202298", "0.518469", "0.5181765", "0.5165097", "0.5163386", "0.5158075", "0.5156655", "0.5139462", "0.5122545", "0.51177055", "0.5116076", "0.5111085", "0.51089704", "0.510496", "0.5101483", "0.5098299", "0.5093896", "0.5089264", "0.5082284", "0.50673306", "0.50613284", "0.5060423", "0.5060423" ]
0.0
-1
landing page app helper functions
function login_change() { window.location.reload(); set_cookie(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadApp() {\n console.log(\"loadApp\");\n displayHomePage();\n}", "function mobileLanding() {\n\tapp.getView().render('turnto/mobilelanding');\n}", "function home(){\n\tapp.getView().render('vipinsider/insider_home.isml');\n}", "function homePageLoader() {\n\n pageCreator(\"home-page\");\n navBar(\"home-page\");\n restaurantLogo();\n bookTableBtn(\"home-page\");\n socialMedia();\n}", "function showHome(request){\n\trequest.respond(\"This is the home page.\");\n}", "function landingView() {\n\n // generate button ui\n let btn = UICtrl.mainMenuBtn();\n mainMenuEAL(btn.ID, btn.bStr);\n initializeTableConfig()\n // load viewport\n\n }", "function pageHome(request, response) {\r\n response.send('<h1>Welcome to Phonebook</h1>')\r\n}", "function landing(req, res) {\n \n return staticFile(landingPage, req, res);\n}", "function displayHome(ctx) {\n if (!auth.isAuth()) {\n ctx.loadPartials({\n header: './templates/common/header.hbs',\n footer: './templates/common/footer.hbs',\n loginForm: './templates/forms/loginForm.hbs',\n registerForm: './templates/forms/registerForm.hbs'\n }).then(function () {\n this.partial('./templates/welcome.hbs');\n })\n } else {\n ctx.redirect('#/catalog');\n }\n }", "function loadPage() {\r\n var strCode = defineAppCode();\r\n $(\"#appCodeMap\").html(strCode);\r\n if (document.location.hostname.length === 0) {\r\n \r\n $(\"#appDisplayMap\").load('html/beaches.html', function() {initApp();});\r\n } else {\r\n $(\"#appDisplayMap\").load('/static_files/WebApps/Health/SwimSafe/html/beaches.html', function() {initApp();});\r\n }\r\n\r\n}", "function loadHome() {\n\tapp.innerHTML = nav + homepage;\n}", "async function app() {\n //Render and display app logo\n renderLogo();\n //Inquirer \"home page\" which lists all options to the user\n appHome();\n}", "function showHomePage(page_name) {\n var root = $('<div>').addClass(_classes[page_name]).height(window.innerHeight);\n\n /* Title */\n //$('<figure>').append($('<img>').attr('src', 'resources/images/splash_title.png')).appendTo(root);\n /* Landing Logo */\n $('<div>').addClass('landing-logo fadeMe').appendTo(root).attr(\"style\", \"display:none\");\n /* Bottom */\n var qLandingBottom = $('<div>').addClass('landing-bottom fadeMe').attr(\"style\", \"display:none\").append($('<span>').html('Loading...'));\n qLandingBottom.appendTo(root);\n /* Loading Image */\n //$('<div>').addClass('landing-loader').append($('<img>').attr('src', 'resources/images/landig_loader.png')).appendTo(qLandingBottom);\n\n /* Google Anlytics */\n ga('send', 'screenview', {'screenName': 'Home'});\n\n return root;\n }", "function landing(){\n\tdocument.location.href = PAGE_URL+\"/dashboard\";\n}", "function showHome(request){\n request.serveFile(\"index.html\"); \n}", "function Landing() {\n return(<div>This is the landing page, welcome!! CHECK OUT CAR PAGE</div>);\n}", "function loadMainPage(){\n // Loop through app sections to create button to go to section\n appSections.forEach(option => {\n if(option.section != 'home'){\n // Create Button\n mealPlanButton = document.createElement('button');\n // Apply Classes\n mealPlanButton.classList.add('main-button');\n mealPlanButton.classList.add('transition');\n // Add Text Content\n mealPlanButton.textContent = option.name;\n // Add Data Attribute (Section)\n mealPlanButton.dataset.section = option.section;\n // Add Event Listener\n mealPlanButton.addEventListener('click', goToSection)\n // Append Button to Container\n homeContainer.appendChild(mealPlanButton);\n }\n });\n }", "function loadHomePage(){\n\tloadNavbar();\n\tloadJumbotron();\n\tgenerateCarousels();\t\n}", "function initApp(apiUrl) {\n createTemplateHtml();\n \n renderNavBar();\n const token = localStorage.getItem('sedditToken');\n if (token !== null) {\n renderNewsFeed(apiUrl, token)\n }\n else {\n renderNewsFeed(apiUrl)\n }\n const logo = document.getElementById('logo');\n const loginButton = document.querySelector('button[data-id-login]');\n const signupButton = document.querySelector('button[data-id-signup]');\n logo.addEventListener('click', () => {\n const token = localStorage.getItem('sedditToken');\n if (token === null) renderNewsFeed(apiUrl);\n else renderNewsFeed(apiUrl, token);\n });\n loginButton.addEventListener('click', () => {\n renderLoginPage(apiUrl);\n });\n signupButton.addEventListener('click', () => {\n renderSignupPage(apiUrl);\n });\n}", "function _page1_page() {\n}", "function initApp(apiUrl) {\n //localStorage.clear();\n localStorage.setItem(\"api\", apiUrl);\n localStorage.setItem(\"currPost\", 0);\n // Initialises the page.\n genNavBar();\n genSearch(\"generate\");\n genLogin(\"generate\");\n genSignup(\"generate\");\n genProfile(\"generate\");\n genModDelPost(\"generate\");\n genFeed(\"generate\");\n genPages(\"generate\");\n genUpvotes(\"generate\");\n genComments(\"generate\");\n genPost(\"generate\");\n eventListen();\n scroll();\n}", "function HomeContent() {}", "function indexPage() {\n logIn();\n signUp();\n signInAuth();\n signUpAuth();\n runDemo();\n}", "function go_mainpage(){\n\n object.getpage('mainpage.html');\n }", "function landing_page(){\n window.location.replace('./prototype.html');\n}", "landing_page(){\n this.routes[\"GET\"][\"landing_page\"] = {\n 'description':'main landing page for the fwf tool. This is the start point where the automatic login check is performed',\n 'paths':['/fwf'],\n 'callback':(req,res)=>{\n // is user logged in with session?\n if(typeof req.session.fwf_facebook_loggedin != \"undefined\" && req.session.fwf_facebook_loggedin === true){\n \n // send to fwf_logged_in do on-page FB login check, if not logged in, redirect to logout.\n // res.set('Content-Type', 'text/plain')\n // res.status(200)\n // res.send(\"show logged in page!\");\n\n this.calendar_page(req,res);\n\n }else{\n\n var pagedata = {\n \"project_path\": this.project_path\n }\n res.render('projects/foodwithfriends/fwf_login', pagedata);\t\t\n res.end();\n\n }\n\n }\n }\n }", "function homePage() {\n window.location.href = initApi.homeUrl;\n //location.reload();\n }", "function openAHOFbar(){\n servePage('AHOF', 'pages/LargeBlocksTemplate', 'A History of Forests');\n}", "function initializeApp() {\n if (liff.isInClient()) {\n liff.getProfile()\n .then( profile => {\n $('#customer').html(profile.displayName);\n $('#profilePictureDiv').html(`<img src=\"${profile.pictureUrl}\" alt=\"\" class=\"circle responsive-img\">`);\n })\n document.getElementById(\"pageLogin\").classList.add('hide');\n document.getElementById(\"pageForm\").classList.remove('hide');\n document.getElementById(\"linkLogout\").classList.add('hide');\n document.getElementById(\"linkExternal\").classList.remove('hide');\n } else {\n if (liff.isLoggedIn()) {\n liff.getProfile()\n .then( profile => {\n $('#customer').html(profile.displayName);\n $('#profilePictureDiv').html(`<img src=\"${profile.pictureUrl}\" alt=\"\" class=\"circle responsive-img\">`);\n })\n document.getElementById(\"pageLogin\").classList.add('hide');\n document.getElementById(\"pageForm\").classList.remove('hide');\n } else {\n document.getElementById(\"pageLogin\").classList.remove('hide');\n document.getElementById(\"pageForm\").classList.add('hide');\n }\n\n document.getElementById(\"linkLogout\").classList.remove('hide');\n document.getElementById(\"linkExternal\").classList.add('hide');\n }\n \n registerButtonHandlers();\n}", "function showHomePage() {\n $('#greet-user').text('Bookmarks');\n $('#logout-button').hide();\n $('#login-div').show();\n $('#register-div').hide();\n $('#bookmarks-view').hide();\n }", "function appDefaultView(){\n\t//clears everything on the page\n\t\n\tclearSection();\n\t\n\tvar local_simulation = get_local_simulation();\n\t//sets the top bar to be the default look\n\tdefaultheaderView();\n\tif(getVerified() == false){\n\t\talert('You do not have permission to access this. Please get a token first.');\n\t}else{\n\t\t//sets the page to view to 'user information' page\n\t\tvar apps = DeviceAppsListTemplate(local_simulation.apps);\n\t\tvar content = getContainer();\n\t\tif(local_simulation.apps==''||local_simulation.apps==null){\n\t\t\tapps += \"No applications are registed to this simulation.\";\n\t\t}\n\t\tcontent.innerHTML = apps;\n\t\t//sets the sidebar to the sidebar for when inside a simulation\n\t\tsimulationSideBarView();\n\t\tremoveClass('active');\n\t\tdocument.getElementById('my-apps-link').className='active';\n\t}\n}", "function AppPage() {\n Page.apply(this, arguments);\n }", "function main(){\n\t\t//check ob die url/seite die richtige ist\n//\t\tif(checkRightLocation()) {\n\n\t\tcleanPage();\n\t\taddFavoriteTitle();\n\t\taddEmptyTable();\n\t\taddHeader();\n\t\tvar favoritesCall = Utils.getFavorites(addFavorites);\t\t\t\n\t\t\t\t\t\t\n\t//\t} else {\n\t//\t\talert(wrongPageErrorMessage);\n\t//\t}\n\t}", "function showSignupPage(){\n showPagesHelper(\"#signUpPage\");\n}", "function showSignInPage(){\n showPagesHelper(\"#signInPage\");\n}", "function main() {\n\n var clientLib = namespace.lookup('com.pageforest.client');\n\n // Client library for Pageforest\n ns.client = new clientLib.Client(ns);\n\n // Use the standard Pageforest UI widget.\n //ns.client.addAppBar();\n\n // This app demonstrates auto-loading - will reload the doc if\n // it is changed by another user.\n ns.client.autoLoad = true;\n\n // Quick call to poll - don't wait a whole second to try loading\n // the doc and logging in the user.\n ns.client.poll();\n\n // Expose appid\n items.appid = ns.client.appid;\n }", "function home() {\n\t\t\tself.searchText('');\n\t\t\tconfigData.page = 1;\n\t\t\tgetPhotos();\n\t\t}", "function drawHomePage(req, res) {\n var db = req.db;\n var collection = db.get('pageContent');\n\n var data = collection.find({}, {}, function(e, docs) {\n var homeIntro = docs[0].homeIntro;\n var homeTitle = docs[0].homeTitle;\n var usrname = loggedInUser(req);\n\n if (usrname) {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Logout',\n username: usrname });\n }\n else {\n res.render('index', { title: homeTitle,\n intro: homeIntro,\n pagename: 'index',\n loginsite: 'Login',\n username: usrname });\n }\n });\n}", "function home(req, res) {\n return res.render('index', {\n ENV: JSON.stringify(ENV), // pass environment variables to html\n title: 'Hack University',\n page: 'home',\n url: `${HOST}`,\n layout: 'layout' // change layout\n });\n}", "function servePage(data, page, title){\n setActivePage(data);\n var template = HtmlService.createTemplateFromFile(page).evaluate().setTitle(title);\n DocumentApp.getUi().showSidebar(template);\n}", "function mainPage(req, res) {\n engine.checkAuth(req, res, function() {\n if (engine.currentQuiz) {\n engine.getUsers(function(err, users) {\n if (err) throw err;\n res.render('index', { user: req.user, engine: engine, users: users });\n });\n } else {\n res.render('index', { user: req.user, engine: engine });\n }\n });\n}", "function showMainPage(){\n\t\t\t$(\"#loginDiv\").addClass(\"analyst-login-div-hide\");\n\t\t\t$(\"#analystMainPage\").removeClass(\"analys-main-page-hide\");\n\t\t\tpopulateAllDocs();\n\t\t}", "function handleQuizApp() {\n \n render();\n startPageHandler();\n questionPageHandler();\n feedbackPageHandler();\n resultsPageHandler();\n}", "function main() {\n initBurgerMenu();\n setScrollAnimationTargets(); // init homepage nav\n\n if ($('#home').length === 1) {\n initHomepageNav();\n } else {\n console.log('not home');\n } // init lightboxes\n\n\n initVideoLightbox();\n initTCsLightbox();\n}", "function splashPage(req, res) {\n res.render(\"index\");\n}", "function onPageshow(e){\n\t\t\t\t\t\t\t\t\n\t\t\t\t//get gloabl data if not already\n\t\t\t\tif (!App.data.firstLoadData) App.data.getServices();\n\t\t\t\t\t\t\t\n\t\t\t}", "function home(req,res){\n query.getAll().then(function(resultat,err){\n if(err) throw err;\n res.render('home', {home:resultat});\n });\n}", "function home(request){\n request.serveFile(\"index.html\");\n}", "function loadHome() {\r\n hideall();\r\n\r\n var top = document.getElementById(\"Welcome\");\r\n\r\n top.innerHTML=(\"Weclome Home \" + user);\r\n \r\n $(\"#home\").show();\r\n $(\"#sidebar\").show();\r\n deactiveAll();\r\n $(\"#side-home\").addClass(\"active\");\r\n $(\"#navbar\").show();\r\n\r\n // Additonal calls \r\n clearCalendar();\r\n makeCalander();\r\n}", "@appRoute(\"(/)\")\n startIndexRoute () {\n System.import(\"../views/home\").then(View => App.getContentContainer().show(new View.default()) );\n }", "async function home(evt) {\n evt.preventDefault();\n hidePageComponents();\n currentUser = await checkForUser();\n\n if (currentUser.userId !== undefined) {\n hidePageComponents();\n $graphs.show();\n $links.show();\n $logoutBtn.show();\n $userBtn.text(`Profile (${currentUser.username})`);\n $userBtn.show();\n } else {\n $loginContainer.show();\n $welcome.show();\n $loginBtn.show();\n $loginForm.show();\n $signupBtn.show();\n $loginBtn.addClass(\"border-bottom border-start border-3 rounded\");\n }\n}", "function launchApp() {\r\n console.log(\"Hypersubs: Launching.\");\r\n $('#hypersubs-main-dialog').dialog('open');\r\n $('#hypersubs-splash').css('display', 'none');\r\n loadFlange(0, userPreferences.smartFill);\r\n }", "function initApp() {\n // Listening for auth state changes.\n // [START authstatelistener]\n firebase.auth().onAuthStateChanged(function(user) {\n showHomePage();\n if (user) {\n // User is signed in.\n /** This section of code builds up the pages only the provider is allowed to see **/\n provider = {};\n provider.displayName = user.displayName;\n provider.email = user.email;\n /** build more provider properties here **/\n\n listenOnDateBase();\n\n $(\"li[name=signedInMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedOutMenu]\").hide(); // hide what's not relevant\n\n } else {\n // User is signed out.\n provider = null;\n $(\"li[name=signedOutMenu]\").show(); // show what you can to create a \"working\" feeling\n $(\"li[name=signedInMenu]\").hide(); // hide the user's data to create a feeling that it's gone\n tearDownUserPages(); // remove database listenrs and destory all the pages to prevent private info from leeking\n }\n });\n}", "function homeRouteHandler(request, response) {\n response.status(200).send('Welcome to City Explorer App');\n}", "function init(app) {\n app.get('/', (request, response) => { \n //throw 44\n response.render('home', {\n name: 'John' + request.chance\n })\n })\n}", "function start() {\n console.log(\"start\");\n\n // open.classList.add(\"zoom\");\n\n console.log(\"URL: \" + check);\n\n // landing = check + index;\n // first = check + firstP;\n // scd = url + secondP;\n\n\n\n if (landing) {\n console.log(\"index\");\n landingPage();\n\n } else if (firstP) {\n console.log(\"firstPage\");\n firstPage();\n\n } else if (secondP) {\n console.log(\"secondPage\");\n secondPage();\n\n }\n\n // The page is fully loade\n}", "function homePage(req, res) {\n rivets.findAll().then(function(rivets){\n res.render('index', {rivets: rivets})\n }).catch(function(error){\n res.send(\"Couldn't fetch rivets\")\n })\n}", "function initHome() {\n\tgetCurrentUser();\n\tinitializeStudentInfo();\n\tloadCourses(buildCourseContent);\n\tprogressBarFunc();\n\tw3_open(); \n}", "function loadHomeBanners() {\n\tif ($('body.home').length !=0) loadBanners();\n}", "function renderHomePage() {\n var items = $('.cvt-report li');\n if (items) {\n items.remove();\n }\n \n var page = $('.home');\n page.addClass('visible');\n }", "function main() {\n landingPageEffects();\n introSlideShow();\n}", "async show() {\n // Anzuzeigenden Seiteninhalt nachladen\n let html = await fetch(\"page-overview/page-overview.html\");\n let css = await fetch(\"page-overview/page-overview.css\");\n\n if (html.ok && css.ok) {\n html = await html.text();\n css = await css.text();\n } else {\n console.error(\"Fehler beim Laden des HTML/CSS-Inhalts\");\n return;\n }\n\n // Seite zur Anzeige bringen\n let pageDom = document.createElement(\"div\");\n pageDom.innerHTML = html;\n\n this._renderBoatTiles(pageDom);\n\n this._app.setPageTitle(\"Startseite\");\n this._app.setPageCss(css);\n this._app.setPageHeader(pageDom.querySelector(\"header\"));\n this._app.setPageContent(pageDom.querySelector(\"main\"));\n }", "async ensureApiPage(_pathname) {\n }", "function initializeApp() {\n registerButtonHandlers();\n\n // check if the user is logged in/out, and disable inappropriate button\n if (liff.isLoggedIn()) {\n liff.getProfile().then(function (profile) {\n document.getElementById('customerName').textContent = profile.displayName;\n profileName = profile.displayName;\n const profilePictureDiv = document.getElementById('profilePictureDiv');\n const img = document.createElement('img');\n img.src = profile.pictureUrl;\n img.alt = 'Profile Picture';\n img.setAttribute('class', 'img-fluid rounded-circle');\n profilePictureDiv.appendChild(img);\n\n }).catch(function (error) {\n window.alert('Error getting profile: ' + error);\n });\n displayIsInClientInfo();\n document.getElementById('liffLoginButton').classList.add('hidden');\n document.getElementById('pesanLoggedIn').classList.remove('hidden');\n } else {\n document.getElementById('intro').setAttribute('class', 'col-md-12 col-12');\n\n document.getElementById('pesanLoggedOut').classList.remove('hidden');\n document.getElementById(\"liffAppContent\").classList.add('hidden');\n }\n}", "function buildApp() {\n const date = new Date();\n let hh = date.getHours();\n let mm = date.getMinutes();\n let month = date.getMonth() + 1;\n hh = hh < 10 ? '0' + hh : hh;\n mm = mm < 10 ? '0' + mm : mm;\n month = month < 10 ? '0' + month : month;\n const day = `${date.getDate()}.${month}.${date.getFullYear()}`;\n const hour = `${hh}:${mm}`;\n $('.alert').fadeOut('slow');\n clearInterval(addInterval);\n $('body').empty().append(navbar).append($pageContent);\n $pageContent.empty().append(addnew(day, hour)).css(('margin-top'), $('.navbar').outerHeight());\n }", "function initializeWebsite() {\n const content = document.querySelector(\"#content\");\n content.prepend(generateHeader());\n content.appendChild(generateHome());\n content.appendChild(generateFooter());\n\n // Set home button as active on default\n const activeBtn = document.querySelector('button[data-id=\"Home\"]');\n activeBtn.classList.add(\"nav-btn_active\");\n}", "landingPage() {\n this.app.get(\"/\", (req, res) => {\n // console.log(`request.body: `, req.body);\n // Basic route that sends the user first to the Landing Page\n res.sendFile(path.join(__dirname, \"landingPage.html\"));\n })\n }", "function App() {\n var mouse = DreamsArk.module('Mouse');\n //\n // /**\n // * start Loading the basic scene\n // */\n DreamsArk.load();\n //\n // mouse.click('#start', function () {\n //\n // start();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.skipper', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('#skip', function () {\n //\n // query('form').submit();\n //\n // return true;\n //\n // });\n //\n // mouse.click('.reseter', function () {\n //\n // location.reload();\n //\n // return true;\n //\n // });\n }", "function load_home_page() {\n page = home_page;\n load_page();\n}", "function buildFrontPage() {\n $('.menu-home').toggleClass('selected-text');\n initHomepage()\n}", "function initApp(apiUrl) {\n // your app initialisation goes here\n Start(); // initialise whole page \n\n localStorage.clear(); // clean all the localStorage.\n /////////////////////////\n \n const buttons = document.getElementsByClassName('button'); // get all the buttons that we need\n const login = buttons[0]; // get log in button\n const signup = buttons[1]; // get sign up button\n const post = buttons[2]; // get post button\n \n \n login.onclick = function() { \n LOGIN(apiUrl) ;\n };\n signup.onclick = function() { \n SIGN(apiUrl) ;\n };\n post.onclick = function() { \n alert(\"yes\");\n };\n \n post_public(apiUrl); // feed the post of public before log in and sign up \n}", "function definePage() {\n var fullURL = window.location.href;\n var splitURL = fullURL.split(\"\"); \n var holder = [];\n\n for(i = splitURL.length-1; i > splitURL.length-9; i--) {\n holder.push(splitURL[i]);\n }\n\n holder.reverse();\n \n userURL = holder.join(\"\");\n }", "function startApp(list, pageNum) {\n showPage(list, pageNum);\n addPagination(list);\n}", "static renderGlobalView() {\n GestionPages.gestionPages(\"dashboard\");\n let contenu = `\n <h5><em>Production Dashboard</em></h5>\n <div id=\"dash\">\n <div id=\"stateorders\">\n <p>State of orders</p>\n </div>\n\n <div id=\"statemachines\">\n <p>State of Machines</p>\n </div>\n\n <div id=\"statistics\">\n <p>Statistics</p>\n </div>\n </div>`;\n document.querySelector(\"#dashboard\").innerHTML = contenu;\n\n //Display page \"state of orders\"\n $(\"#stateorders\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStateOrders();\n });\n\n //Display page \"state of machines\"\n $(\"#statemachines\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStateMachines();\n });\n\n //Display page \"statistics\"\n $(\"#statistics\").click(event => {\n event.preventDefault();\n GestionPages.gestionPages(\"dashboard\");\n Dashboard.renderStatistics();\n });\n }", "function initPage() {\n // alert('initPage');\n\n // Guess the base URL of the Web app, in case we're running behind a reverse proxy.\n let segments = window.location.href.split('/');\n segments = segments.slice(0, segments.length - 2); // This page is 2 levels down from app root\n baseUrl = segments.join('/') + '/';\n}", "function init() {\n\n\t\t// > = greatar than\n\t\t// < = less than\n\t\t\n\n\t\t/* -------------------------------------------------- */\n\t\t/* CACHE\n\t\t/* -------------------------------------------------- */\n\t\t\n\t\tvar page = $('.page').data('page');\n\n\n\t\t/* -------------------------------------------------- */\n\t\t/* HOME\n\t\t/* -------------------------------------------------- */\n\n\t\tif ( page === 'index' ) {\n\t\t\t\n\t\t\tconsole.log('Home Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t /* -------------------------------------------------- */\n\t\t/* PRIVACY AND TERMS OF USE\n\t\t/* -------------------------------------------------- */\n\n\t\telse if ( page === 'legal' ) {\n\n\t\t\tconsole.log('Privacy and Terms of Use Page');\n\t\t\t\n\t\t}\n\t \n\t\t\n\t\t/* -------------------------------------------------- */\n\t\t/* ERROR\n\t\t/* -------------------------------------------------- */\n\n\t\telse {\n\n\t\t\tconsole.log('Error Page');\n\t\t\t\n\t\t}\n\n\t}", "function coreInitLoadPage() {\n if (typeof $(\"body\").attr(\"control\") !== \"undefined\")\n WEBUI.MAINPAGE = $(\"body\")[$(\"body\").attr(\"control\").split(\".\")[1]]();\n }", "determineActivePage() {\n\t\tlet { activeApp, filteredApps, activeTags, forceSearch } = this.state;\n\t\tlet page;\n\n\t\tif (activeApp && !forceSearch) {\n\t\t\tpage = \"showcase\";\n\t\t} else if (filteredApps.length > 0 || forceSearch) {\n\t\t\tpage = \"appSearch\";\n\t\t} else if (filteredApps.length === 0 && activeTags.length === 0) {\n\t\t\tpage = \"home\";\n\t\t}\n\n\t\treturn page;\n\t}", "function onPageshow(e){\n\t\t\t\t\n\t\t\t\t//wait for deviceready\n\t\t\t\t\n\t\t\t\t//show loadng msg\n\t\t\t\tApp.utils.popmsg( 'show', {} );\n\t\t\t\t/*\n\t\t\t\tApp.utils.popmsg( 'show', { \n\t\t\t\t\ttext:'', \n\t\t\t\t\thtml: '', \n\t\t\t\t\ttextonly: false,\n\t\t\t\t\ttextVisible: false,\n\t\t\t\t\ttheme: 'e'\n\t\t\t\t} ); \n\t\t\t\t*/\n\t\t\t\t\n\t\t\t\t//go to homepage\n\t\t\t\tif ( App.onDevice ) {\n\t\t\t\t\t//go upon deviceready\n\t\t\t\t\tdocument.addEventListener('deviceready', function(e){ gotoHome(); }, false);\n\t\t\t\t} else {\n\t\t\t\t\t//go right away on non-device\n\t\t\t\t\tgotoHome();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}", "function _appLinkRouter(){\n $( document ).on('click', 'a[href^=\"/\"]', function(event) {\n\n var href, passThrough, url;\n href = $(event.currentTarget).attr('href');\n // passThrough = href.indexOf('sign_out') >= 0;\n if (!event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) {\n event.preventDefault();\n url = href.replace('/', '');\n\n url = lang + '/' + url;\n\n if(P.FullscreenHandler.getIsFullscreen() === false){\n P.AppRouter.navigate(url, {\n trigger: true\n });\n }else{\n P.Presenter.prototype.call( url );\n }\n \n return false;\n }\n });\n }", "function loadingPage(req, res, next) {\n console.log(\"GET '/'\");\n res.render('index');\n}", "function LandingPage () {\n\n return ( // below the return will show on screen html wise, logic above^\n <div>\n <div className='frontPage-banner-container'>\n <div className='motto-container'>\n <div className='motto-inner-container'>\n <div className='motto-top'>Discover the best</div>\n <div className='motto-bottom'>EDM events today!</div>\n </div>\n </div>\n\n <img className='frontPage-Picture' src=\"https://res.cloudinary.com/dwus7ia33/image/upload/v1619758431/Electric_Nights-pictures/picture14_ultone.jpg\" alt=\"Electric Nights Logo\"/>\n {/* <img className='frontPage-Picture' src=\"https://res.cloudinary.com/dwus7ia33/image/upload/v1619758173/Electric_Nights-pictures/picture15_vlxzkm.jpg\" alt=\"Electric Nights Logo\"/> */}\n {/* <img className='frontPage-Picture' src=\"https://res.cloudinary.com/dwus7ia33/image/upload/v1619757445/Electric_Nights-pictures/Picture32_gncjds.jpg\" alt=\"Electric Nights Logo\"/> */}\n </div>\n {/* <h1>Landing page when not signed in</h1> */}\n\n <div className=''>\n <EventList />\n </div>\n </div>\n )\n}", "function ApplicationTemplatesPage() {\n }", "function Home() {\n return(\n <div>\n <Navbar></Navbar>\n\n <h1>temporary homepage</h1>\n\n {/* add link to other pages here for now */}\n <a href=\"/ticket\">ticket</a>\n <br/>\n <a href=\"/enclosure\">enclosure</a>\n <br/>\n\n\n </div>\n \n ); \n}", "function loadHome(){\r\n switchToContent(\"page_home\");\r\n}", "function showSelect(app_title, app_id) {\n var redirect_url = \"\";\n var page_type = 'report';\n\n if(location.pathname.indexOf(\"feedbacks\") > 0 || location.pathname.indexOf(\"socials\") > 0 || location.pathname.indexOf(\"online_config\") > 0 || location.pathname.indexOf(\"upload\") > 0 || location.pathname.indexOf(\"sns\") > 0) {\n page_type = 'component';\n }\n\n if(app_title == \"all_apps\"){\n // component pages\n if(page_type == 'component'){\n redirect_url = \"/apps/feedbacks\";\n } else{\n redirect_url = \"/apps/\";\n }\n } else{\n \n\t redirect_url = location.pathname+\"?appId=\"+app_id;\n }\n window.location.href = redirect_url;\n}", "function go_home() {\n\tdocument.getElementById(\"display-screen\").innerHTML = loading;\n\tx_home_page(\"\", do_display);\t\t\t\t\n}", "function redirectTopage(pagename) {\n\t\n\t\n\t $(\".ui-loader\").show();\t\n\t \n\t\n\t \t\n var dirPath = dirname(location.href);\n var fullPath = dirPath + \"/\" + pagename;\n if(pagename=='index.html')\n {\n //localStorage.setItem('foo',1);\n\t\t $(\".ui-loader\").hide();\n }\n Page.redirect(pagename, 'slide', 'down')\n \n //window.location = fullPath;\n}", "function runWhenURLMet(){\n url = location.hash.slice(1).split(\"?\")[0];\n data = location.hash.slice(1).split(\"?\");\n \n setActive(url);\n\n if (url === \"home\"){\n list(\"products\", \"homeul\",true);\n }\n if (url === \"login\" || url === \"\"){\n document.getElementById(\"menu\").style.display = \"none\";\n document.getElementById(\"returnBtn\").style.display = \"none\";\n }\n if (url !== \"login\" && url !== \"\"){\n document.getElementById(\"menu\").style.display = \"flex\";\n document.getElementById(\"returnBtn\").style.display = \"block\";\n }\n if (url === \"detail\"){\n details(data[1]);\n }\n}", "function whichPage(){\n if ( document.URL.includes(\"index.html\") ) {\n $(\"#home-btn\").addClass('actives');\n // hoverAbout();\n // hoverResume();\n // hoverWriting();\n\n } else if ( document.URL.includes(\"about.html\") ) {\n $(\"#about-btn\").addClass('actives');\n // hoverHome();\n // hoverResume();\n // hoverWriting();\n } else if ( document.URL.includes(\"writing\") ) {\n $(\"#writing-btn\").addClass('actives');\n // hoverAbout();\n // hoverResume();\n // hoverHome();\n } else if ( document.URL.includes(\"resume\") ) {\n $(\"#resume-btn\").addClass('actives');\n // hoverAbout();\n // hoverHome();\n // hoverWriting();\n }\n}", "function initializeApplication() {\n\n app.utils.getPageResources(chkErr(function(templates, content, config) {\n \n app.storage.getData(chkErr(function(contacts) {\n\n listTemplate = templates.partials_contact_list;\n pageContents = content;\n\n app.utils.renderPage(templates.page_contacts, content);\n refreshContactList(contacts);\n addContactPageListeners();\n\n }));\n\n }));\n\n }", "function adaptLandingPage(){\n\t\t\n\t\t$('.landingPageWrapper').css('height', $(window).height() - headerHeight - footerHeight - 3);\n\t\n\t}", "function initializeApp() {\r\n displayLiffData();\r\n displayIsInClientInfo();\r\n registerButtonHandlers();\r\n \r\n // check if the user is logged in/out, and disable inappropriate button\r\n if (liff.isLoggedIn()) {\r\n document.getElementById('login').classList.add('hidden');\r\n document.getElementById('container').classList.remove('hidden');\r\n document.getElementById('liffLoginButton').disabled = true;\r\n userProfile()\r\n } else {\r\n document.getElementById('liffLogoutButton').disabled = true;\r\n }\r\n}", "function loadAmplifiersPage(){\n\tloadNavbar();\n\tgenerateProductPage(\"amplifier\");\n}", "function displayLanding() {\n const homeContainer = document.querySelector(\".homePageContainer\");\n const welcomeStatement = document.querySelector(\".welcomeStatement\");\n if (homeContainer.style.display === \"none\") {\n homeContainer.style.display = \"flex\";\n welcomeStatement.style.display = \"block\";\n } else {\n setTimeout(delayHomePageChange = () => { homeContainer.style.display = \"none\";}, 600);\n setTimeout(delayWelcomeStatementChange = () => { welcomeStatement.style.display = \"none\";}, 600);\n }\n}", "function _class(){var _this=this;_classCallCheck(this,_class);$(document).ready(function(){// Dom elements.\n_this.pagesElements=$('[id^=page-]');_this.splashLogin=$('#login','#page-splash');// Make sure /add is never opened on website load.\nif(window.location.pathname==='/add'){page('/')}// Configuring routes.\nvar pipe=friendlyPix.Router.pipe;var displayPage=_this.displayPage.bind(_this);var loadUser=function loadUser(userId){return friendlyPix.userPage.loadUser(userId)};var showHomeFeed=function showHomeFeed(){return friendlyPix.feed.showHomeFeed()};var showGeneralFeed=function showGeneralFeed(){return friendlyPix.feed.showGeneralFeed()};var clearFeed=function clearFeed(){return friendlyPix.feed.clear()};var showPost=function showPost(postId){return friendlyPix.post.loadPost(postId)};page('/',pipe(showHomeFeed,null,true),pipe(displayPage,{pageId:'feed',onlyAuthed:true}));page('/feed',pipe(showGeneralFeed,null,true),pipe(displayPage,{pageId:'feed'}));page('/post/:postId',pipe(showPost,null,true),pipe(displayPage,{pageId:'post'}));page('/post/:postId/admin',pipe(showPost,null,true),pipe(displayPage,{pageId:'post',admin:true}));page('/user/:userId',pipe(loadUser,null,true),pipe(displayPage,{pageId:'user-info'}));page('/about',pipe(clearFeed,null,true),pipe(displayPage,{pageId:'about'}));page('/terms',pipe(clearFeed,null,true),pipe(displayPage,{pageId:'terms'}));page('/add',pipe(displayPage,{pageId:'add',onlyAuthed:true}));page('*',function(){return page('/')});// Start routing.\npage()})}", "function createHomePage() {\n // Ensures that the choices are hidden\n btnGroup.addClass(\"hide\");\n\n // Hides the home button\n homeBtn.addClass(\"hide\");\n\n // Unhides the highscores button\n highscoresBtn.removeClass(\"hide\");\n\n // Changes header\n $(\"#header\").text(\"Coding Quiz Challenge\");\n\n // Empties content element\n contentEl.empty();\n\n // Creates paragraph element\n var introParagraph = $(\"<p>\").addClass(\"intro-paragraph\");\n\n // Adds text to paragraph element\n introParagraph.text(\"Try to answer the following code-related question within the time limit. Keep in mind that incorrect answers will penalize your score/time by ten seconds!\");\n\n // Creates start button element\n var startButton = $(\"<button>\").addClass(\"start-button\");\n\n // Adds text to start button element\n startButton.text(\"Start\");\n\n // Appends both elements to the content div\n contentEl.append(introParagraph);\n contentEl.append(startButton);\n }", "function homePage(req, res){\n\n var loginCookies = cookieUtils.getLoginCookies(req, res)\n if (loginCookies.uId && loginCookies.uAuth){\n dbLogin(req, res, loginCookies.uId, loginCookies.uAuth, useCookies=true)\n }else{\n console.log(\"Cookie authentication failed: no cookies set\")\n loader.loadHTML(res, loginPath, {\n\t\t\t\"heading\" : \"Hi and welcome\"\n\t\t})\n }\n}", "function onClicked() {\r\n\t\ttablet.gotoWebScreen(APP_URL);\r\n\t}", "function Home(path, layContent) {\n //Get page states.\n this.IsVisible = function() {\n return lay.IsVisible()\n }\n this.IsChanged = function() {\n return false\n }\n\n //Show or hide this page.\n this.Show = function(show) {\n\n layMain.Show();\n if (show) {\n lay.Animate(\"FadeIn\");\n } else {\n lay.Animate(\"FadeOut\");\n }\n }\n\n //Create layout for app controls.\n lay = app.CreateLayout(\"Linear\", \"FillXY,VCenter\");\n lay.SetPadding(0, 0, 0, 0.04);\n lay.Hide();\n layScroll = app.CreateScroller(1, 1);\n layContent.AddChild(layScroll);\n layScroll.AddChild(lay);\n\n //Add a logo.\n var img = app.CreateImage(\"Img/Heroes Evolved Bugs.png\", 0.25);\n lay.AddChild(img);\n\n //Create a text with formatting.\n txt = app.CreateText(text, 1, 1, \"Html,bold,Link\");\n txt.SetPadding(0.03, 0.03, 0.03, 0.03);\n txt.SetTextSize(18);\n\n lay.AddChild(txt);\n}", "function index() {\n window.onload = new Starter();\n}" ]
[ "0.69442725", "0.6828731", "0.6782684", "0.6760298", "0.67290443", "0.6654286", "0.66436094", "0.65650684", "0.65409404", "0.6529138", "0.6527243", "0.6512137", "0.6442465", "0.6423348", "0.640431", "0.6349092", "0.6341919", "0.6341177", "0.6338396", "0.62734365", "0.62496626", "0.62264556", "0.62220246", "0.6218129", "0.6191205", "0.61877537", "0.6182805", "0.6162028", "0.614579", "0.61450726", "0.61242646", "0.60872024", "0.60830456", "0.60566515", "0.60388213", "0.60154504", "0.60088515", "0.6002098", "0.5993672", "0.59883267", "0.598639", "0.5984005", "0.5968914", "0.59642845", "0.59631574", "0.59621936", "0.5941138", "0.5935822", "0.59328127", "0.5927412", "0.5923161", "0.5917183", "0.5916287", "0.5892121", "0.58879256", "0.58874786", "0.58833903", "0.5880356", "0.5878963", "0.58771425", "0.5864516", "0.5856084", "0.5855485", "0.58520687", "0.584716", "0.5841871", "0.58409333", "0.58249414", "0.58239233", "0.5819877", "0.580851", "0.5803675", "0.57982016", "0.57913566", "0.57913464", "0.57846314", "0.5780793", "0.57800686", "0.5779933", "0.57796293", "0.57788914", "0.577822", "0.5777051", "0.57657474", "0.5765707", "0.5759588", "0.5757816", "0.5753834", "0.5749503", "0.57487535", "0.5747117", "0.5746267", "0.57459027", "0.5742402", "0.57422924", "0.5741841", "0.5733704", "0.57212365", "0.5715448", "0.5715445", "0.5699309" ]
0.0
-1
Object to store state in local storage.
function State() { // Adapted from here: http://diveintohtml5.info/storage.html var ls; try { ls = 'localStorage' in window && window['localStorage'] !== null; } catch (e) { ls = false; } //var user = (auth.isLoggedIn() ? auth.getUserData().user_id : 'public'); this.get = function(key) { if (!ls) { return null; } //key = user + '.' + key; var val = localStorage.getItem(key); try { val = JSON.parse(val); } catch(e) { return null; }; return val; }; this.set = function(key, val) { if (!ls) { return null; } //key = user + '.' + key; try { val = JSON.stringify(val); } catch(e) { return null; } return localStorage.setItem(key, val); }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeState() {\n\n localStorage.setItem(STORAGE_KEY, JSON.stringify(data));\n }", "save() {\n localStorage.setItem(\"state\", this.getStateString());\n if (this.debug) {\n console.log(\"state saved\");\n console.log(this.state);\n }\n }", "function _storage() {\n localStorage.setObject(\"data\", data);\n }", "function saveToLocalStorage(state) {\n try {\n const serializedState = JSON.stringify(state)\n localStorage.setItem('state', serializedState)\n } catch(e){\n console.log(e)\n }\n }", "function saveState(key, state) {\n window.localStorage.setItem(key, JSON.stringify(state))\n}", "function saveToLocalStorage(state) {\n try {\n const serializedState = JSON.stringify(state);\n localStorage.setItem('state', serializedState);\n } catch (e) {\n console.log(e);\n }\n}", "function saveStateToLocalStorage() {\n const state = {};\n for (const id of [\"_question\", \"_state\", \"_status\", \"_messages\"]) {\n state[id] = (document.getElementById(id) || {}).value;\n }\n window.localStorage.setItem(\"PerseusReduxDemoState\", JSON.stringify(state));\n}", "function saveState (state) {\n localStorage.setItem(STORAGE_KEY, JSON.stringify(state));\n return state;\n}", "function saveToLocalStorage(state) {\n try {\n const serializedState = JSON.stringify(state);\n localStorage.setItem(\"state\", serializedState);\n } catch (e) {\n console.error(e);\n }\n }", "function persistLocalStorage() {\n _localStorage.setItem(_name, this.toJSON());\n }", "initialiseStore(state) {\n\t\t\tif(localStorage.getItem(LOCAL_STORAGE_KEY)) {\n\t\t\t\t// Replace the state object with the stored item\n\t\t\t\tthis.replaceState(\n\t\t\t\t\tObject.assign(state, JSON.parse(localStorage.getItem(LOCAL_STORAGE_KEY)))\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function storeCurrent() {\r\n let currentData = {\r\n regexInput: regexInput.value,\r\n templateInput: templateInput.value,\r\n globalCheckbox: globalCheckbox.checked,\r\n caseInsensitiveCheckbox: caseInsensitiveCheckbox.checked,\r\n multilineCheckbox: multilineCheckbox.checked,\r\n IgnoreHTMLCheckbox: IgnoreHTMLCheckbox.checked,\r\n resultTextarea: resultTextarea.value,\r\n selectedItemIndex:selectedItemIndex,\r\n smallForm: smallFormCheckbox.checked\r\n };\r\n let store = browser.storage.local.set({\r\n currentData\r\n });\r\n store.then(onError, onError);\r\n}", "function saveState(state) {\n try {\n const serialisedState = JSON.stringify(state);\n localStorage.setItem('app_state', serialisedState);\n } catch (e) {\n console.error(e.message);\n }\n}", "function saveToLocalStorage(state) {\n try {\n const serializedState = JSON.stringify(state);\n localStorage.setItem(\"state\", serializedState);\n } catch (err) {\n // Ignore write errors.\n }\n}", "function saveToLocalStorage(state) {\n try {\n const jsonState = JSON.stringify(state);\n localStorage.setItem(\"appState\", jsonState);\n } catch (err) {\n console.warn(err);\n }\n}", "_storeState() {\n storage.set(this.itemId, JSON.stringify({\n lastVisit: Date.now(),\n commentCount: this.itemDescendantCount,\n maxCommentId: this.maxCommentId\n }))\n }", "set storage(value) { this._storage = value; }", "function LocalStorageEmulation() {\n\t\tthis._data = {};\n\t}", "saveState() {\n const that = this;\n\n if (!that.id) {\n that.warn(that.localize('noId'));\n }\n else {\n window.localStorage.setItem('jqxTree' + that.id, JSON.stringify(that._state));\n }\n\n return JSON.parse(JSON.stringify(that._state));\n }", "save(state) {\n localStorage.setItem('items', JSON.stringify(state.items));\n\n return state;\n }", "function saveState(loan) {\n localStorage['loan'] = JSON.stringify(loan)\n localStorage['mode'] = getCalcMode()\n}", "saveToStorage() {\n try {\n localStorage.setItem(this.name, JSON.stringify(this.storage));\n } catch(e) {\n\n }\n }", "function saveToLocalStorage (state) {\n try {\n const serialisedState = JSON.stringify(state)\n localStorage.setItem('persistantState', serialisedState)\n } catch (e) {\n console.warn(e)\n }\n}", "save() {\n localStorage.setItem(\"game\", JSON.stringify(state))\n }", "function State() {\n\n data = {};\n\n /**\n * Save in local browser cache.\n */\n this.save = function() {\n localStorage.setItem(TASK_DATA_PARAM, JSON.stringify(data));\n return this;\n }\n\n /**\n * Load from local browser cache\n */\n this.load = function() {\n raw = localStorage.getItem(TASK_DATA_PARAM);\n if (raw) {\n data = JSON.parse(raw);\n console.log('Loaded state: ' + raw);\n }\n return this;\n }\n\n /**\n * Get status for a task.\n *\n * :param int task_id: ID of the task in question\n * :return: boolean value, true if task completed\n */\n this.get = function(i) {\n if (i in data) {\n return data[i];\n }\n return false;\n }\n\n /**\n * Set status for a task.\n *\n * :param int task_id: ID of the task in question\n * :param bool value: whether or not the task has been completed\n */\n this.set = function(i, value) {\n data[i] = value;\n this.save();\n return this;\n }\n }", "function LocalStorage()\r\n{\r\n this.getItem = function(key)\r\n {\r\n return storedItems[key];\r\n }\r\n\r\n this.setItem = function(key, value)\r\n {\r\n storedItems[key] = value;\r\n }\r\n\r\n this.removeItem = function(key)\r\n {\r\n this.setItem(key, undefined);\r\n }\r\n\r\n var storedItems = {};\r\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 store(obj) {\n var json = JSON.stringify(obj);\n return localStorage.setItem(storageKey, json);\n }", "_setLocalStorage() {\n localStorage.setItem('workouts', JSON.stringify(this.#workouts)); //key-value store; the second value must be a string\n }", "function saveToStorage(){\n console.debug('saving settings', self);\n\n try {\n localStorage.setItem(self.name, JSON.stringify(self.data));\n } catch (e) {\n }\n }", "setLocality(state, city){\n localStorage.setItem('state', state)\n localStorage.setItem('city', city)\n }", "_setLocalStorage() {\n // using local storage API, (key, value) store, which takes two strings\n // JSON.stringify() will convert any object into a string\n localStorage.setItem(\"workouts\", JSON.stringify(this.#workouts));\n }", "writeState() {\n console.log('writeState', this.cookieName());\n localStorage.setItem(this.cookieName(), this.serialize());\n \n }", "function StorageService() {\n this.store = window.localStorage;\n }", "function LocalStoreManager() {\n\n var _this = this;\n this.syncKeys = [];\n this.reservedKeys = ['sync_keys', 'addToSyncKeys', 'removeFromSyncKeys',\n 'getSessionStorage', 'setSessionStorage', 'addToSessionStorage', 'removeFromSessionStorage', 'clearAllSessionsStorage', 'raiseDBEvent'];\n this.localStorageSupported = false;\n\n this.sessionStorageTransferHandler = function (event) {\n if (!event.newValue) {\n return;\n } \n if (event.key == 'getSessionStorage') {\n if (sessionStorage.length) {\n if (_this.localStorageSupported) {\n localStorage.setItem('setSessionStorage', JSON.stringify(sessionStorage));\n localStorage.removeItem('setSessionStorage');\n } \n }\n }\n else if (event.key == 'setSessionStorage') {\n _this.setSessionStorageHelper(event.newValue);\n }\n else if (event.key == 'addToSessionStorage') {\n var data = JSON.parse(event.newValue);\n _this.addToSessionStorageHelper(data[\"data\"], data[\"key\"]);\n }\n else if (event.key == 'removeFromSessionStorage') {\n _this.removeFromSessionStorageHelper(event.newValue);\n }\n else if (event.key == 'clearAllSessionsStorage' && sessionStorage.length) {\n _this.clearInstanceSessionStorage();\n }\n else if (event.key == 'addToSyncKeys') {\n _this.addToSyncKeysHelper(event.newValue);\n }\n else if (event.key == 'removeFromSyncKeys') {\n _this.removeFromSyncKeysHelper(event.newValue);\n }\n };\n }", "constructor() {\n \tthis.storage = {};\n }", "function LocalSettingStorage() {\n}", "function store() {\n\n \n localStorage.setItem('mem', JSON.stringify(myLibrary));\n \n}", "constructor() {\n this.storage = {};\n }", "constructor() {\n this.storage = {};\n }", "store() {\n\t\tlet storeData = this.data.map(wfItem => wfItem.storeVersion());\n\t\tlocalStorage.setItem('data', JSON.stringify(storeData));\n\t}", "set(id, object){\n localStorage.setItem(`${this.state.context}-${id}`, JSON.stringify(object));\n }", "function storeData(data){\n localStorage.data = JSON.stringify(data);\n }", "_setLocalStorage() {\n localStorage.setItem('workouts', JSON.stringify(this.#workouts)); // stringify is a method that converts any object in JS to string.\n //* localStorage is a very simple API only advised to use for small amounts of data.\n }", "saveState() {\n const that = this;\n\n if (!that.id) {\n that.warn(that.localize('noId'));\n return;\n }\n\n //Save to LocalStorage\n window.localStorage.setItem('jqxDockingLayout' + that.id, JSON.stringify(that.getJSONStructure()));\n }", "function storeLocal(obj) {\n\n Object.keys(obj).forEach((key) => {\n console.log(`Set ${key} = ${obj[key]}`);\n localStorage.setItem(key, obj[key]);\n });\n // localStorage.setItem('fullname', fullName);\n // localStorage.setItem('username', userName);\n // localStorage.setItem('image', imageName);\n console.log('Data stored');\n}", "getStorage() {\r\n if(!localStorage.getItem('city')) {\r\n this.city = this.defaultCity\r\n }\r\n else {\r\n this.city = localStorage.getItem('city');\r\n }\r\n\r\n return {\r\n city: this.city\r\n }\r\n }", "initialiseStore (state) {\n if (localStorage.getItem('store')) {\n this.replaceState(\n Object.assign(state, JSON.parse(localStorage.getItem('store')))\n )\n }\n }", "function saveState() {\n localStorage.setItem('Game.State', JSON.stringify({\n matchingCardState: state.matchingCard !== null ? state.matchingCard.state : null,\n isMatching: state.isMatching,\n totalMoves: state.totalMoves,\n cardStates: [...cardDeck.cards.map(x => x.state)],\n elapsedSeconds: state.elapsedSeconds,\n isGameOver: state.isGameOver\n }));\n\n let remainingStars = calculateRemainingStars();\n displayStars(remainingStars);\n }", "function guardaLocal(store) {\n // console.log(store)\n localStorage.storage = JSON.stringify(store)\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 storeLocal(key, data) {\n window.localStorage.setItem(key, JSON.stringify(data));\n }", "function setState(state) {\n return device.localStorage.setItem(stateKey, JSON.stringify(state));\n}", "function Storage() {\n this.get = function (name) {\n return JSON.parse(window.localStorage.getItem(name));\n };\n this.set = function (name, value) {\n window.localStorage.setItem(name, JSON.stringify(value));\n };\n this.clear = function () {\n window.localStorage.clear();\n };\n this.size = function() { \n return window.localStorage.length;\n };\n}", "getStorage() {\n return this.parse( localStorage.getItem( this.key ) )\n }", "function loadState () {\n var state = localStorage.getItem(STORAGE_KEY);\n if (!state) {\n state = DEFAULT_STATE;\n saveState(state);\n } else {\n state = JSON.parse(state);\n }\n return state;\n}", "constructor (initData, whitchStore = 'local') {\n if (!window.localStorage || !window.sessionStorage) {\n throw new Error('该浏览器不支持html5本地存储,这可能是由于浏览器设置\"隐私\"模式引起的!');\n }\n if (initData && _type(initData) !== 'object') {\n throw new Error('new LocalStore() 参数不是一个object!');\n }\n if (whitchStore !== 'session' && whitchStore !== 'local') {\n throw new Error('new LocalStore() 第二个参数必须为 \"session\" or \"local\"');\n }\n this.key = '_localStore_';\n this.storeMethod = whitchStore === 'session' ? 'sessionStorage' : 'localStorage';\n if (window[this.storeMethod][this.key]) {\n this.store = JSON.parse(window[this.storeMethod][this.key]);\n } else {\n this.store = initData || {};\n window[this.storeMethod][this.key] = JSON.stringify(this.store);\n }\n }", "constructor() {\n this.storage = window.localStorage;\n }", "function getStorage() {\n\t\t\treturn localStorageObj;\n\t\t}", "function LocalStorageStore(key, defaultValue) {\n const valueFromStorage = localStorage.getItem(key);\n const initialValue =\n valueFromStorage != null && valueFromStorage != 'null' && valueFromStorage != 'undefined' ? JSON.parse(valueFromStorage) : defaultValue;\n const { subscribe, set, update } = writable(initialValue);\n return {\n subscribe,\n update: function (updater) {\n const value = update(updater);\n set(value);\n return value\n },\n set: function (value) {\n set(value);\n localStorage.setItem(key, JSON.stringify(value));\n },\n }\n }", "function storeSettings () {\n // convert app state to settings\n var settings = {\n intervalRange: convertMillisToRange(appState.interval),\n speak: appState.speak,\n notification: appState.notification\n }\n storage.set(vatobeStorage, settings, function (error) {\n if (error) throw error\n })\n}", "function storeLocal() {\n const jsonUserData = JSON.stringify(userData);\n localStorage.setItem('fullname', jsonUserData);\n}", "initialiseStore(state) {\n\t\t\t// Check if the ID exists\n\t\t\tif(localStorage.getItem('store')) {\n\t\t\t\t// Replace the state object with the stored item\n\t\t\t\tthis.replaceState(\n\t\t\t\t\tObject.assign(state, JSON.parse(localStorage.getItem('store')))\n\t\t\t\t);\n\t\t\t}\n\t\t}", "function createStore(){\n\n\t// purpose:\t\tsets the variables with user info taken from\n\t// \t\t\t\tlocal storage or sets it to defaults\n\t// ------------------------------------------------------------------------\n\tlet state = {}\n\t\tstate.page = (localStorage.page) ? localStorage.page : 'Hello';\n\t\tstate.level = (localStorage.level) ? parseInt(localStorage.level) : 1;\n\t\tstate.set = (localStorage.set) ? parseInt(localStorage.set) : 1;\n\t\tstate.currentStep = (localStorage.currentStep) ? parseInt(localStorage.currentStep) : 0;\n\t\tstate.isResting = (localStorage.isResting) ? parseInt(localStorage.isResting) : 0;\n\t\tstate.pushupsLast = (localStorage.pushupsLast) ? parseInt(localStorage.pushupsLast) : 0;\n\t\tstate.pushupsTotal = (localStorage.pushupsTotal) ? parseInt(localStorage.pushupsTotal) : 0;\n\t\tstate.lastActive = (localStorage.lastActive) ? parseInt(localStorage.lastActive) : Date.now();\n\t\tstate.popupShown = false;\n\t\tstate.menuShown = false;\n\t\tstate.submenu = false;\n\n\t\n\t// purpose:\t\tcreates the store with data provided in state object\n\t// ------------------------------------------------------------------------\n\tconst { subscribe, set, update } = writable(state);\n\n\n\t// purpose:\t\tupdates the state and sets corresponding page\n\t// arguments: \tnew page name (string)\n\t// ------------------------------------------------------------------------\n\tlet setPage = (newPage) => {\n\t\tupdate((state) => {\n\t\t\tstate.page = newPage;\n\t\t\tlocalStorage.page = state.page;\n\n\t\t\treturn state;\n\t\t});\n\t};\n\n\n\t// purpose:\t\tupdates the state and sets the user level\n\t// arguments: \tuser level to set (int)\n\t// ------------------------------------------------------------------------\n\tlet setLevel = (newLevel) => {\n\t\tupdate((state) => {\n\t\t\tstate.level = newLevel;\n\t\t\tlocalStorage.level = state.level;\n\n\t\t\treturn state;\n\t\t})\n\t};\n\n\n\t// purpose:\t\tupdates the state and sets current pushups set in a training\n\t// arguments: \tpushups set (int)\n\t// ------------------------------------------------------------------------\n\tlet setSet = (newSet) => {\n\t\tupdate((state) => {\n\t\t\tstate.set = newSet;\n\t\t\tlocalStorage.set = state.set;\n\n\t\t\treturn state;\n\t\t})\n\t};\n\n\n\t// purpose:\t\tsets index for pushups that user is currently doing\n\t// arguments: \tpushups index (int)\n\t// ------------------------------------------------------------------------\n\tlet setStep = (newIndex) => {\n\t\tupdate((state) => {\n\t\t\tstate.currentStep = parseInt(newIndex);\n\t\t\tlocalStorage.currentStep = state.currentStep;\n\n\t\t\treturn state;\n\t\t})\n\t};\n\n\n\t// purpose:\t\tmoves the set one forward\n\t// ------------------------------------------------------------------------\n\tlet nextSet = () => {\n\t\tsetSet(state.set + 1);\n\t};\n\n\n\t// purpose:\t\tsets the number of last pushups done\n\t// arguments: \tlast done pushups\n\t// ------------------------------------------------------------------------\n\tlet lastSet = (newPushupsLast) => {\n\t\tupdate((state) => {\n\t\t\tstate.pushupsLast = newPushupsLast;\n\t\t\tlocalStorage.pushupsLast = state.pushupsLast;\n\n\t\t\treturn state;\n\t\t});\n\t};\n\n\n\t// purpose:\t\tupdates the total value of pushups done\n\t// arguments: \tthe amount of pushups to add\n\t// ------------------------------------------------------------------------\n\tlet totalUpdate = (addPushups) => {\n\t\tupdate((state) => {\n\t\t\tstate.pushupsTotal += addPushups;\n\t\t\tlocalStorage.pushupsTotal = state.pushupsTotal;\n\n\t\t\treturn state;\n\t\t});\n\t};\n\n\n\t// purpose:\t\tsets the info if the user is resting\n\t// arguments:\t1 for user resting (default) or 0 if not\n\t// ------------------------------------------------------------------------\n\tlet isResting = (resting) => {\n\t\tupdate((state) => {\n\t\t\tstate.isResting = (resting) ? 1 : 0;\n\t\t\tlocalStorage.isResting = state.isResting;\n\n\t\t\treturn state;\n\t\t});\n\t};\n\n\n\t// purpose:\t\tsets the information about the popup status\n\t// arguments: \tif popup is visible (true) or not (false)\n\t// ------------------------------------------------------------------------\n\tlet popupShown = (is) => {\n\t\tupdate((state) => {\n\t\t\tstate.popupShown = is;\n\n\t\t\treturn state;\n\t\t});\n\t};\n\n\n\t// purpose:\t\tsets the information about currently active submenu\n\t// arguments: \tsubmenu id (string)\n\t// returns:\t\tcurrently active submenu id (string)\n\t// ------------------------------------------------------------------------\n\tlet setSubmenu = (id) => {\n\t\tupdate((state) => {\n\t\t\tstate.submenu = id;\n\n\t\t\treturn state;\n\t\t});\n\n\t\treturn state.submenu;\n\t};\n\n\n\t// purpose:\t\treturns publicly visible methods to manage the store\n\t// ------------------------------------------------------------------------\n\treturn {\n\t\tsubscribe,\n\t\tsetPage,\n\t\tsetLevel,\n\t\tsetSet,\n\t\tnextSet,\n\t\tsetStep,\n\t\tlastSet,\n\t\ttotalUpdate,\n\t\tisResting,\n\t\tpopupShown,\n\t\tsetSubmenu\n\t};\n}", "function saveGameState()\r\n{\r\n const savedValue= [mapLocation,backpack]; \r\n const jsonString= JSON.stringify(savedValue);\r\n localStorage.setItem(\"savedInfo\", jsonString);\r\n return this.savedInfo;\r\n}", "constructor(storage = localStorage) {\n this.storage = storage;\n }", "function LocalStorage(storageID) {\n\n // private variables\n this.storageID_ = storageID;\n}", "static save() {\n const nodes = this._nodes;\n\n const state = {};\n\n nodes.forEach((container, index) => {\n const chart = {\n chartId: container.querySelector('.container-outer').id,\n containerId: container.id\n };\n state['chart' + index] = chart;\n });\n\n localStorage.setItem('state', JSON.stringify(state));\n }", "function saveState () {\n winston.info('Saving current state');\n jsonfile.writeFileSync(STATE_FILE, {\n subscriptions: subscriptions,\n callback: callback,\n history: history,\n version: CURRENT_VERSION\n }, {\n spaces: 4\n });\n}", "_setLocalStorage() {\n // Setting all the workouts to local storage\n localStorage.setItem('workouts', JSON.stringify(this.#workouts));\n }", "function persistent(key) { return construct( localStorage, key); }", "componentDidUpdate() {\n \n localStorage.setItem('states', JSON.stringify(this.state)) \n }", "function Storage(prefix) {\n\n var savedKeys;\n\n var saveSavedKeys = function () {\n window.localStorage[prefix + '__' + 'persistentStateKeys'] = JSON.stringify(savedKeys);\n };\n\n var loadSavedKeys = function () {\n var keysJSON = window.localStorage[prefix + '__' + 'persistentStateKeys'];\n var keys = typeof keysJSON == 'string' ? JSON.parse(keysJSON) : void 0;\n savedKeys = keys ? keys : [];\n };\n\n var clearSavedKeys = function () {\n savedKeys = [];\n saveSavedKeys();\n };\n\n loadSavedKeys();\n\n this.saveValue = function (key, value) {\n window.localStorage[prefix + '_' + key] = JSON.stringify(value);\n if (savedKeys.indexOf(key) == -1) {\n savedKeys.push(key);\n saveSavedKeys();\n }\n\n };\n\n this.loadValue = function (key, defaultValue) {\n\n key = typeof key != 'undefined' ? key : defaultValue;\n\n var value = window.localStorage[prefix + '_' + key];\n\n return typeof value == \"undefined\" ? void 0 : JSON.parse(value);\n\n };\n\n this.reset = function (key) {\n window.localStorage.removeItem(prefix + '_' + key);\n };\n\n this.resetAll = function () {\n for (var index = 0; index < savedKeys.length; index++) {\n window.localStorage.removeItem(prefix + '_' + savedKeys[index]);\n }\n\n clearSavedKeys();\n };\n\n}", "function initStorage() {\n _storage = localStorage;\n}", "addState(classname) {\n let data = Storages.localStorage.get(StateTogglerStorage.STORAGE_KEY_NAME);\n if (data instanceof Array) data.push(classname);\n else data = [classname];\n Storages.localStorage.set(StateTogglerStorage.STORAGE_KEY_NAME, data);\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 getState() {\n return JSON.parse(device.localStorage.getItem(stateKey));\n}", "function save() {\n localStorage && localStorage.setItem(key, Y.JSON.stringify(data));\n }", "function LocalStorage() {\n var self = this;\n var localStorage = void 0;\n if (window.sessionStorage) {\n localStorage = window.sessionStorage;\n } else {\n alert('Your browser don\\'t support sessionStorage - please update your browser to use our service!');\n return;\n }\n var appData = {};\n var list = ['accountAnchor', 'keys', 'seed', 'accountType', 'walletName', 'txs', 'walletStatus'];\n\n function onInit() {\n console.log('local storage init');\n getDataFromLocalStorage();\n }\n\n function getDataFromLocalStorage() {\n list.forEach(function (prop) {\n appData[prop] = localStorage.getItem(prop);\n });\n }\n\n function checkProp(prop) {\n if (list.indexOf(prop) !== -1) {\n return true;\n }\n return false;\n }\n\n self.set = function (prop_name, data) {\n if (checkProp(prop_name)) {\n localStorage.setItem(prop_name, data);\n } else {\n throw new Error('Unknown localstorage prop name');\n }\n };\n\n self.get = function (prop_name) {\n if (checkProp(prop_name)) {\n return localStorage.getItem(prop_name);\n } else {\n throw new Error('Unknown localstorage prop name');\n }\n };\n\n self.clear = function () {\n list.forEach(function (prop) {\n localStorage.removeItem(prop);\n });\n };\n\n onInit();\n}", "function setLocalObject(objName, obj) {\n localStorage.setItem(objName, JSON.stringify(obj)); \n }", "function storeSettings(){\n localStorage.setItem('settings', JSON.stringify(settings));\n}", "saveState(){\n localStorage.setObj('followedCheck', this);\n }", "function loadStoredInfo() {\n try {\n const stored = JSON.parse(localStorage.getItem('FULL_STATE'));\n return Object.assign(initialState, stored);\n }\n catch (err) {\n console.error(err);\n return initialState;\n }\n}", "function Store () {\n return sessionStorage;\n}", "function StorageObject() { }", "function saveState() {\n const state = {\n cf: cfSelect.value,\n gf: gfSelect.value,\n mf: mfSelect.value,\n am: amSelect.value,\n };\n localStorage.setItem('collecting_together_form', JSON.stringify(state));\n }", "function initLocalStorage() {\n\t//\n\tvalue = that.get(key);\n\tif (value == null) {\n\t\tthat.set(key, JSON.stringify([]));\n\t}\n}", "setSettings(NSettings){\n this.setState({\n Settings: NSettings\n });\n localStorage.setItem('DogWeather', JSON.stringify(NSettings));\n }", "function saveMapState() {\n localStorageService.set(cacheId, {\n 'lat': vm.mapCenter.lat,\n 'lng': vm.mapCenter.lng,\n 'zoom': vm.mapCenter.zoom\n });\n }", "saveToLocal() {\n let alarmsJson = JSON.stringify(this.alarms);\n localStorage.setItem(\"alarmTime\", alarmsJson);\n let currentId = String(this.currentId);\n localStorage.setItem(\"currentId\", currentId);\n }", "function Storage() {\n\tthis.dataFields = [];\n\tthis.dataFieldNames = [];\n\tthis.localOnlyDataFields = [];\n\n\tthis.tickingFields = [];\n\n\tthis.storageInterval = null;\n\t\n\tthis.fallbackToLocal = false;\n\n\t/**\n\t * return true, if we use the loglet applet to store/retrieve data on the\n\t * server\n\t */\n\n\tthis.useLoglet = function() {\n\t\treturn true;\n\t};\n\n\t/**\n\t * registers a data field with a unique name, data field objects should\n\t * provide:\n\t * \n\t * .GetValue() which returns a string representation of the current state\n\t * data\n\t * \n\t * .SetValue(v) which restores a state given by a previously returned state\n\t * data string\n\t */\n\n\tthis.RegisterField = function(datafield, name, onlylocal) {\n\t\t/**\n\t\t * try to fix name collisions\n\t\t */\n\n\t\tvar collision = true;\n\t\tvar append_nbr = 0;\n\t\tvar good_name = name;\n\n\t\twhile (collision == true) {\n\t\t\tcollision = false;\n\n\t\t\tfor ( var int = 0; int < this.dataFieldNames.length; int++) {\n\t\t\t\tif (this.dataFieldNames[int] == good_name) {\n\t\t\t\t\tcollision = true;\n\t\t\t\t\tappend_nbr = 1 + append_nbr;\n\t\t\t\t\tgood_name = name + \"(\" + append_nbr + \")\";\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tthis.dataFields.push(datafield);\n\t\tthis.dataFieldNames.push(good_name);\n\n\t\tif (onlylocal) {\n\t\t\tthis.localOnlyDataFields.push(datafield);\n\t\t}\n\t};\n\n\t/**\n\t * request to be regularly ticked before auto-storage\n\t */\n\n\tthis.RequestTicks = function(datafield) {\n\t\tif (this.tickingFields.lastIndexOf(datafield) < 0) {\n\t\t\tthis.tickingFields.push(datafield);\n\t\t}\n\t};\n\n\t/**\n\t * stores all data in the storage space using name to avoid collisions,\n\t * storage can be sessionStorage or localStorage\n\t */\n\n\tthis.StoreIn = function(storage, name) {\n\t\t\n\t\t//myLogger.Log(\"myStorage: update volatile\");\n\t\t\n\t\t/**\n\t\t * update \"volatile\" input elements\n\t\t */\n\n\t\tfor ( var int = 0; int < this.tickingFields.length; int++) {\n\t\t\tvar obj = this.tickingFields[int];\n\n\t\t\tif (obj.Tick) {\n\t\t\t\tobj.Tick();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * store in database and/or locally\n\t\t */\n\t\t\n\t\t//myLogger.Log(\"myStorage: store data\");\n\n\t\tfor ( var int = 0; int < this.dataFieldNames.length; int++) {\n\t\t\tvar obj = this.dataFields[int];\n\n\t\t\tif (obj.GetValue) {\n\t\t\t\tvar v = obj.GetValue();\n\t\t\t\tvar spacedname = name + \"---\" + this.dataFieldNames[int];\n\t\t\t\tvar keyname = \"myStorage\" + spacedname;\n\n\t\t\t\ttry {\n\t\t\t\t\tstorage.setItem(keyname, v);\n\t\t\t\t} catch (e) {\n\t\t\t\t\t/** local storage not working */\n\t\t\t\t}\n\n\t\t\t\tif ((this.useLoglet())\n\t\t\t\t\t\t&& (this.localOnlyDataFields.lastIndexOf(obj) == -1)) {\n\t\t\t\t\t/**\n\t\t\t\t\t * use server storage too\n\t\t\t\t\t */\n\t\t\t\t\tif (v === null) {\n\t\t\t\t\t\tdoSetIfDifferent(spacedname, \"-null\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdoSetIfDifferent(spacedname, \"v\" + v);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\t\n\t\t}\n\t\t//myLogger.Log(\"myStorage: done.\");\n\t};\n\n\t/**\n\t * restores all data in the storage space using name to avoid collisions,\n\t * storage can be sessionStorage or localStorage\n\t */\n\n\tthis.RestoreFrom = function(storage, name) {\n\t\tif (typeof myHover == \"object\") {\n\t\t\tif (myHover.CrashDown) {\n\t\t\t\tmyHover.CrashDown();\n\t\t\t}\n\t\t}\n\t\t\n\t\t/**\n\t\t * try to get all possible entries from server, and restore values\n\t\t */\n\t\t\n\t\tfor ( var int = 0; int < this.dataFieldNames.length; int++) {\n\t\t\tvar obj = this.dataFields[int];\n\n\t\t\tif (obj.SetValue) {\n\t\t\t\tvar spacedname = name + \"---\" + this.dataFieldNames[int];\n\t\t\t\tvar keyname = \"myStorage\" + spacedname;\n\t\t\t\t\n\t\t\t\tvar found = false;\n\t\t\t\t\n\t\t\t\tif (this.useLoglet() && (this.localOnlyDataFields.lastIndexOf(obj) == -1)) {\n\n\t\t\t\t\tif (didSave(spacedname)) {\n\t\t\t\t\t\tvar v = doGet(spacedname);\n\n\t\t\t\t\t\tif (v.charAt(0) == 'v') {\n\t\t\t\t\t\t\tobj.SetValue(v.substr(1));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t\n\t\t\t\tif ((!found) &&(this.fallbackToLocal)) {\n\n\t\t\t\t\tvar v;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tv = storage.getItem(keyname);\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tv = null;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (v !== null) {\n\t\t\t\t\t\tobj.SetValue(v);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t};\n\n\t/**\n\t * this is called periodically and before answer checking...\n\t */\n\n\tthis.AutoUpdateAndStore = function() {\n\n\t\tmyStorage.StoreIn(myStorageLocation, myStorageName);\n\n\t};\n\n\t/**\n\t * set up automatic storage and restoring of contents\n\t */\n\tthis.SetupAutoRestore = function(storage, name) {\n\t\tmyStorageLocation = storage;\n\t\tmyStorageName = name;\n\n\t\tmyStorageAncientUnloader = window.onbeforeunload;\n\n\t\twindow.onbeforeunload = function() {\n\t\t\t/**\n\t\t\t * force synchronous HttpRequests\n\t\t\t */\n\t\t\tcomAsyncMode(false);\n\t\t\t\n\t\t\tdoLog(\"Unloading commenced...\");\n\t\t\t\n\t\t\tmyStorage.StoreIn(myStorageLocation, myStorageName);\n\t\t\t\n\t\t\tdoLog(\"Unloading done.\");\n\n\t\t\tif (myStorageAncientUnloader) {\n\t\t\t\tmyStorageAncientUnloader();\n\t\t\t}\n\t\t};\n\n\t\tmyStorage.RestoreFrom(myStorageLocation, myStorageName);\n\n\t\t/**\n\t\t * periodically save current page state\n\t\t */\n\n\t\tthis.storageInterval = setInterval(this.AutoUpdateAndStore, 900 + Math\n\t\t\t\t.floor(Math.random() * 200));\n\t};\n\n}", "function save() {\n\tvar save = {\n\t\t// Player attributes\n\t\texp: exp,\n\t\tlevel: level,\n\t\tbaseDamage: baseDamage,\n\t\ttotalDamageGain: totalDamageGain,\n\t\t\n\t\t// Monster attributes\n\t\thealth: health,\n\t\tcurrentHealth: currentHealth,\n\t\tcurrentMonster: currentMonster,\n\t\tmonsterLevel: monsterLevel,\n\t\t\n\t\t// Global attributes\n\t\tinventory: inventory,\n\t\tdamageBonus: damageBonus,\n\t\t\n\t};\n\tlocalStorage.setItem(\"save\",JSON.stringify(save)); \n}", "function saveSettingsLocalStorage(){\n settingsObject = {email: emailSwitch.checked, profile: profileSwitch.checked, timezone: timezoneSelect.selectedIndex}; \n localStorage.setItem('settings', JSON.stringify(settingsObject));\n \n}", "function Store(name){\n this._dbName = name;\n //create local db if not available\n\t\tif (!localStorage[name]) {\n\t\t\tvar data = {'todo_list':[],'inprogress_list':[],'done_list':[]};\n\t\t\tlocalStorage[name] = JSON.stringify(data);\n\t\t}\n\n }", "function storeAppState() {\n\tapp_state['global_vars'] = global_vars;\n\tsetItemInLocalStorage(\"dx_app_state\",btoa(JSON.stringify(app_state)));\n}", "function writeToLocalStore(obj) {\n if (isLocalStorageNameSupported()) return localStorage.setItem(\"hitlist\", JSON.stringify(obj));\n }", "function setLocalStorage(location,data){\n localStorage.setItem(location, JSON.stringify(data));\n}", "function storeData($window) {\n var storage = $window.localStorage;\n var obj1 = {\n setStore: function (store) {\n storage.setItem('store',JSON.stringify(store));\n },\n getStore: function(){\n return JSON.parse(storage.getItem('store'));\n },\n removeStore: function(){\n\n storage.removeItem('store');\n }\n };\n return obj1;\n }", "writeToStorage() {\n return (localStorage[this.storageKey] = JSON.stringify(this.items))\n }", "function setLocalStorage(key, value) {\n localStorage.setItem(key, JSON.stringify(value));\n}" ]
[ "0.7660972", "0.759448", "0.71857816", "0.71806926", "0.7167772", "0.7139642", "0.71160245", "0.71047664", "0.7100408", "0.7078042", "0.70572275", "0.7047922", "0.7016288", "0.7000498", "0.6999444", "0.6996221", "0.6969661", "0.69569993", "0.69536465", "0.6952793", "0.69520867", "0.69480264", "0.6941712", "0.69308215", "0.6918388", "0.688924", "0.6850089", "0.68335265", "0.6825804", "0.6825272", "0.6825119", "0.68228", "0.67813504", "0.676812", "0.6753599", "0.672734", "0.67205185", "0.66880393", "0.6673017", "0.6673017", "0.6666701", "0.6661887", "0.66516525", "0.66453016", "0.6636135", "0.6621215", "0.66123575", "0.6603482", "0.6587879", "0.6581279", "0.65790665", "0.65752286", "0.6575194", "0.65729296", "0.6567456", "0.65649664", "0.656457", "0.6559462", "0.65500724", "0.65416753", "0.6535122", "0.65259737", "0.6510467", "0.6506774", "0.65033525", "0.6503077", "0.64997756", "0.6487711", "0.64866287", "0.6471083", "0.6466525", "0.6465641", "0.646501", "0.6463923", "0.64535826", "0.6453109", "0.64490056", "0.64405596", "0.6440085", "0.64380497", "0.64353645", "0.64296275", "0.64260626", "0.64237213", "0.6422896", "0.6416856", "0.6408016", "0.6406275", "0.63988763", "0.63859296", "0.6379797", "0.6377198", "0.637566", "0.63723755", "0.63657635", "0.63607705", "0.63406384", "0.6340176", "0.63390833", "0.63356155" ]
0.74729216
2
Check the consistency of the State
check(options) { this.constructor.check(this, options); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }", "async function assertState(state) {}", "async function checkState(_tokens, _stateChanges, _accounts) {\n let numTokens = _tokens.length\n assert.equal(numTokens, _stateChanges.length)\n for (let i = 0; i < numTokens; i++) {\n let token = _tokens[i]\n let stateChanges = _stateChanges[i]\n let name = await token.contractName.call()\n let _expectedState = await expectedState(token, stateChanges, _accounts, name)\n let _actualState = await actualState(token, _expectedState, _accounts, name)\n assertDiff.deepEqual(_actualState, _expectedState,\n \"difference between expected and actual state\")\n if (name != 'BearCrowdsale') {\n await checkBalancesSumToTotalSupply(token, _accounts, name)\n }\n }\n}", "function checkConsistency(selected) {\n var next;\n // Ignore selections which don't have this property\n if (selected[property] !== undefined) {\n // Look up state of this element in the selection\n next = self.lookupState(property, selected);\n // Detect inconsistency\n if (observed) {\n consistent = consistent && (next === state);\n }\n // Track state for next iteration\n state = next;\n observed = true;\n }\n }", "function checkfromState() {\n for (let i = 0; i < state.length; i++) {\n if (state[i].value[0] == tracker[0] && state[i].value[1] == tracker[1] && state[i].value[2] == tracker[2]) {\n return true;\n }\n }\n return false;\n}", "validate() {\n const { tmpTarget } = ReduxStore.getState().innerState\n const isValidSuccess = validator.target(tmpTarget)\n return isValidSuccess\n }", "function checkpointed() {\n dyno.query({KeyConditions:{type:{ComparisonOperator:'EQ',AttributeValueList: ['shard']}}}, function(err, response) {\n var shards = response.Items;\n shards.forEach(function(s) {\n t.equal(s.status, 'leased', 'leased');\n t.equal(s.instance, kine.config.instanceId, 'this instance leased');\n t.ok(s.hashKeyStart);\n t.ok(s.hashKeyEnd);\n });\n\n var checkpointed = _(shards).filter(function(s){ return !!s.checkpoint;}).value();\n t.equal(checkpointed.length, 1, 'one checkpointed');\n t.end();\n });\n }", "isValid(state) {\n return true;\n }", "function checkStatus() {\n checkWin();\n checkLose();\n }", "validateState(state, cachedState) {\n if (!state) {\n throw NodeAuthError.createStateNotFoundError();\n }\n if (state !== cachedState) {\n throw msalCommon.ClientAuthError.createStateMismatchError();\n }\n }", "checkValidity() {\n this.validState = this.currentDataState.name && \n +this.currentDataState.amount && +this.currentDataState.maximumRides;\n }", "function checkState() {\n if (state === `simulation`) {\n simulation();\n } else if (state === `win`) {\n win();\n } else if (state === `lose`) {\n lose();\n }\n}", "function checkActsConsistency(){\n checkConsistency(Action.ACTS);\n //set expections\n verifyCondition = true;\n expectations = Expect.AFTER_ACTS;\n }", "function verify_state() {\n let s=read_state();\n\n let cnt=Array(10).fill(0);\n for(let j=0;j<3;++j)\n for(let i=0;i<3;++i) {\n let pos=\"Row \"+j+\", Col \"+i;\n if(isNaN(s.grid[j][i])) {\n helper_log_write(pos+\" is not a number\");\n return false;\n }\n if(s.grid[j][i] < 0 || s.grid[j][i] > 8) {\n helper_log_write(pos+\" is out of range\");\n return false;\n }\n ++cnt[s.grid[j][i]];\n }\n \n for(let i=0;i<9;++i) {\n let val=\"\"+i;\n if(i==0) val=\"blank\";\n if(cnt[i]==0) {\n helper_log_write(\"Missing \"+val);\n return false;\n }\n if(cnt[i]>1) {\n helper_log_write(\"Too many \"+val+\"s\");\n return false;\n }\n }\n \n //Count inversions to see if puzzle is solveable\n let inv=0;\n let g=[];\n for(let j=0;j<3;++j)\n for(let i=0;i<3;++i)\n g.push(s.grid[j][i]);\n g=g.filter(function(x){return x>0;});\n for(let i=0;i<8;++i)\n for(let j=i+1;j<8;++j)\n if(g[i]>g[j]) ++inv;\n if(inv%2==0) {\n helper_log_write(\"Not solveable\");\n return false;\n }\n \n return true;\n}", "function syncState(newState) {\n expect(newState).toEqual(expected);\n // console.log(\"newState = expected =\", expected);\n const listenerSize = store.listeners.size;\n if (listenerSize) {\n // console.log(\"removing listener\");\n expected = \"deleted\"\n const removedCount = remover();\n expect(removedCount).toBe(1)\n // console.log(\"listener removed\")\n } else {\n expect(store.listeners.size).toBe(0);\n done()\n }\n }", "isConsistent() {\n return !this.inconsistentAt;\n }", "function state_check(state){\n\tfor (var i = 0; i < ufo_data.length; i++){\n\t\tif (ufo_data[i].state === state){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "function checkState() {\n if (!this.isInitialized()) {\n this.throwSCORMError(301);\n return false;\n }\n\n return true;\n }", "allValid() {\n return (this.state.description.length > 0 &&\n this.state.title.length > 0 && this.state.time.length > 0)\n }", "function checkState() {\n\t\t\t\ttry {\n\t\t\t\t\tvar state = getDoc(io).readyState;\n\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\tif (state.toLowerCase() == 'uninitialized')\n\t\t\t\t\t\tsetTimeout(checkState,50);\n\t\t\t\t}\n\t\t\t\tcatch(e) {\n\t\t\t\t\tlog('Server abort: ' , e, ' (', e.name, ')');\n\t\t\t\t\tcb(SERVER_ABORT);\n\t\t\t\t\ttimeoutHandle && clearTimeout(timeoutHandle);\n\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t}\n\t\t\t}", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkUpdate() {\n if (this.updating === true) return false\n // check if we has changes\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hasChanged = false\n // reload the hass entities\n this.hassEntities = this.entities\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n\n // check for update and set the entity state last and update flag\n for (let entity of this.entities) {\n const h = this.hassEntities.find((x) => x.entity_id === entity.entity)\n entity.laststate = entity.state\n entity.update = false\n if (h && entity.last_changed !== h.last_changed && entity.state !== h.state) {\n entity.last_changed = h.last_changed\n entity.state = h.state\n entity.update = true\n this.hasChanged = true\n }\n }\n\n if (this.hasChanged) {\n // refresh and update the graph\n this.updateGraph(true)\n }\n return this.hasChanged\n }\n }", "function checkCurrentState(reading) {\n let result\n Rules.find().fetch().some(function(rule){\n if (reading >= rule.rule.from && reading <= rule.rule.to) {\n result = rule.rule.state\n return true\n } else {\n return false\n }\n });\n return result;\n}", "function checkState3(newState, req) {\n\tvar result = true;\n\tvar i;\n\tvar closedTasks;\n\tif ((newState != 'waiting') && (req != '')) {\n\t\treq = req.split(',');\n\t\tclosedTasks = getClosedTasks();\n\t\tfor (i=0; i<req.length; i++) {\n\t\t\tif (closedTasks.indexOf(req[i]) < 0) {\n\t\t\t\tresult = false;\t\t\t\n\t\t\t}\n\t\t}\n\t}\n\tif (!result) {\n\t\tglobal.alert(\"<?php echo NOTSTARTING; ?>\");\t\n\t}\n\treturn result; \n }", "async function check() {\n if (isCanceled) {\n return;\n }\n\n const state = await getDbConnectionState(dbServerUrl, userName, fetch);\n onCheckResult(state);\n\n setTimeout(check, HEARTBEAT_INTERVAL);\n }", "async function startCheckState() {\n async function checkState() {\n if (!account) {\n setBidderState(BidderState.LOADING);\n console.log(\"No account selected\");\n return;\n }\n\n const auctionState = await auctionWeb3.fetchAuctionState();\n let currentPrice = 0;\n if (AuctionState.STARTED === auctionState) {\n currentPrice = await auctionWeb3.fetchCurrentPrice();\n if (!currentPrice) {\n setBidderState(BidderState.LOADING);\n console.log(\"Current price not loaded\");\n return;\n }\n }\n\n if (!(await auctionWeb3.isWhitelisted(account))) {\n setBidderState(BidderState.NOT_WHITELISTED);\n } else if (\n [AuctionState.ENDED, AuctionState.FAILED].includes(auctionState)\n ) {\n if ((await fetchBalance(account)) === \"0\") {\n setBidderState(BidderState.NO_ETH);\n } else if ((await auctionWeb3.fetchValueToWithdraw(account)).gt(0)) {\n setBidderState(BidderState.READY_TO_WITHDRAW);\n } else {\n setBidderState(BidderState.NOTHING_TO_WITHDRAW);\n }\n } else if (auctionState === AuctionState.DEPOSIT_PENDING) {\n setBidderState(BidderState.WAITING_DEPOSIT);\n } else if (await auctionWeb3.hasBid(account)) {\n setBidderState(BidderState.ALREADY_BID);\n } else if ((await fetchBalance(account)) === \"0\") {\n setBidderState(BidderState.NO_ETH);\n } else if ((await auctionWeb3.fetchAllowance(account)).eq(0)) {\n setBidderState(BidderState.NO_ALLOWANCE);\n } else if (\n (await auctionWeb3.fetchAllowance(account)).lt(currentPrice)\n ) {\n setBidderState(BidderState.WRONG_ALLOWANCE);\n } else if (auctionState === AuctionState.DEPLOYED) {\n setBidderState(BidderState.NOT_STARTED);\n } else if (\n (await auctionWeb3.fetchTokenBalance(account)).lt(currentPrice)\n ) {\n setBidderState(BidderState.NOT_ENOUGH_TOKENS);\n } else {\n setBidderState(BidderState.READY_TO_BID);\n }\n }\n\n env.chainCheckIntervalId = setInterval(checkState, 500);\n checkState();\n }", "function isSameState(newState, diff) {\n if (!currentState) return false;\n\n return (newState == currentState.state) && (util.objectSize(diff.all) == 0);\n }", "function verifySyncIsComplete() {\n logger.info('Checking CM Sync Status');\n return bigIp.cluster.getCmSyncStatus()\n .then((syncStatus) => {\n if (syncStatus.connected.length > 0) {\n logger.info('Device is in cluster.');\n return Promise.resolve();\n }\n return Promise.reject(new Error('not connected yet'));\n })\n .catch((err) => {\n logger.error('Error recieved while verifying CM Sync Status');\n logger.error(err.message);\n return Promise.reject(err);\n });\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tvar state = getDoc(io).readyState;\r\n\r\n\t\t\t\t\t\tlog('state = ' + state);\r\n\t\t\t\t\t\tif (state && state.toLowerCase() === 'uninitialized') {\r\n\t\t\t\t\t\t\tsetTimeout(checkState, 50);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} catch (e) {\r\n\t\t\t\t\t\tlog('Server abort: ', e, ' (', e.name, ')');\r\n\t\t\t\t\t\tcb(SERVER_ABORT);\t\t\t\t// eslint-disable-line callback-return\r\n\t\t\t\t\t\tif (timeoutHandle) {\r\n\t\t\t\t\t\t\tclearTimeout(timeoutHandle);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttimeoutHandle = undefined;\r\n\t\t\t\t\t}\r\n\t\t\t\t}", "async function checkChain() {\n try {\n if (await verifyChainId(process.env.REACT_APP_CHAIN_ID)) {\n setChainState(CHAIN_STATE.CONNECTED);\n } else {\n setChainState(CHAIN_STATE.WRONG_CHAIN);\n }\n } catch (e) {\n console.error(e);\n // Stop the periodical chain check\n clearInterval(env.chainCheckIntervalId);\n setChainState(CHAIN_STATE.CHAIN_UNKNOWN);\n }\n }", "function checkStatus() {\n flushMonitoringOperations(self.queue);\n\n if(self.queue.length == 0) {\n // Get all the known connections\n var connections = self.availableConnections\n .concat(self.inUseConnections)\n .concat(self.nonAuthenticatedConnections)\n .concat(self.connectingConnections);\n\n // Check if we have any in flight operations\n for(var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if(connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections);\n // } else if (self.queue.length > 0 && !this.reconnectId) {\n\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "function checkConsistency() {\n var i, id, p, msg, plans, catalog;\n\n catalog = config.catalog;\n plans = config.plans;\n\n for (i = 0; i < catalog.services.length; i += 1) {\n for (p = 0; p < catalog.services[i].plans.length; p += 1) {\n id = catalog.services[i].plans[p].id;\n if (!plans.hasOwnProperty(id)) {\n msg = \"ERROR: plan '\" + catalog.services[i].plans[p].name + \"' of service '\" + catalog.services[i].name + \"' is missing a specification.\";\n throw new Error(msg);\n }\n }\n }\n}", "function checkStatus() {\n flushMonitoringOperations(self.queue);\n\n if (self.queue.length === 0) {\n // Get all the known connections\n var connections = self.availableConnections\n .concat(self.inUseConnections)\n .concat(self.nonAuthenticatedConnections)\n .concat(self.connectingConnections);\n\n // Check if we have any in flight operations\n for (var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if (connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections);\n // } else if (self.queue.length > 0 && !this.reconnectId) {\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "function checkState() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar state = getDoc(io).readyState;\n\n\t\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\t\tif (state && state.toLowerCase() === 'uninitialized') {\n\t\t\t\t\t\t\tsetTimeout(checkState, 50);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog('Server abort: ', e, ' (', e.name, ')');\n\t\t\t\t\t\tcb(SERVER_ABORT);\t\t\t\t// eslint-disable-line callback-return\n\t\t\t\t\t\tif (timeoutHandle) {\n\t\t\t\t\t\t\tclearTimeout(timeoutHandle);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t\t}\n\t\t\t\t}", "function checkState() {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tvar state = getDoc(io).readyState;\n\n\t\t\t\t\t\tlog('state = ' + state);\n\t\t\t\t\t\tif (state && state.toLowerCase() === 'uninitialized') {\n\t\t\t\t\t\t\tsetTimeout(checkState, 50);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} catch (e) {\n\t\t\t\t\t\tlog('Server abort: ', e, ' (', e.name, ')');\n\t\t\t\t\t\tcb(SERVER_ABORT);\t\t\t\t// eslint-disable-line callback-return\n\t\t\t\t\t\tif (timeoutHandle) {\n\t\t\t\t\t\t\tclearTimeout(timeoutHandle);\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttimeoutHandle = undefined;\n\t\t\t\t\t}\n\t\t\t\t}", "checkErrors() {\n if (this.state.valid_state_new && this.state.valid_state_current) {\n if (this.state.valid_state_new === 'success' && this.state.valid_state_current === 'success') {\n return false;\n }\n }\n return true;\n }", "function checkState(vnode3, original) {\n\t\tif (vnode3.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}", "function checkStatus() {\n if (self.state === DESTROYED || self.state === DESTROYING) {\n if (typeof callback === 'function') {\n callback();\n }\n\n return;\n }\n\n flushMonitoringOperations(self.queue);\n\n if (self.queue.length === 0) {\n // Get all the known connections\n var connections = self.availableConnections.concat(self.inUseConnections);\n\n // Check if we have any in flight operations\n for (var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if (connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections, { force: false }, callback);\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "function checkStatus() {\n if (self.state === DESTROYED || self.state === DESTROYING) {\n if (typeof callback === 'function') {\n callback();\n }\n\n return;\n }\n\n flushMonitoringOperations(self.queue);\n\n if (self.queue.length === 0) {\n // Get all the known connections\n var connections = self.availableConnections.concat(self.inUseConnections);\n\n // Check if we have any in flight operations\n for (var i = 0; i < connections.length; i++) {\n // There is an operation still in flight, reschedule a\n // check waiting for it to drain\n if (connections[i].workItems.length > 0) {\n return setTimeout(checkStatus, 1);\n }\n }\n\n destroy(self, connections, { force: false }, callback);\n } else {\n // Ensure we empty the queue\n _execute(self)();\n // Set timeout\n setTimeout(checkStatus, 1);\n }\n }", "async function checkBalances () {\n try {\n const state = tlUtil.readState()\n const effTokenBal = lib.getEffectiveTokenBalance(state.bchBalance)\n const realTokenBal = await slp2.getTokenBalance()\n\n wlogger.info(\n `usdPerBCH: ${state.usdPerBCH}, ` +\n `BCH balance: ${state.bchBalance}, ` +\n `Actual token balance: ${realTokenBal}, ` +\n `Effective token balance: ${effTokenBal}`\n )\n } catch (err) {\n wlogger.error('Error in checkBalances(): ', err)\n }\n}", "async check() {\n return this.use().check();\n }", "_checkDone() {\n\n // it's only for SIGHASH_ALL, if implement other - change it!\n if (this._data.claimProofs.length) throw new Error('Tx is already signed, you can\\'t modify it');\n }", "function checkState(vnode3, original) {\n\t\tif (vnode3.state !== original) throw new Error(\"'vnode.state' must not be modified.\")\n\t}", "mustDo (stateName) {\n let upperStateName = stateName.toUpperCase()\n let res = this.state[upperStateName]\n\n if (getItType(res) !== 'BOOLEAN') {\n throw Error(`dont know |${stateName}| state`)\n }\n return res\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState, 50);\n }\n } catch (e) {\n log('Server abort: ', e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "check() {\n if (this.state.data && this.state.radio && this.state.data !== \"\"\n && this.state.currentMetricAreaCalculations.size >= 1\n && this.state.selectedMetricAreaCalculations) {\n return true\n }\n let errors = {} // Object to hold errors\n\n if (!this.state.data) {\n errors[\"invalidData\"] = \"A value must be entered\"\n }\n if (!this.state.radio) {\n errors[\"invalidRadio\"] = \"An actual or target must be selected\"\n }\n if (this.state.currentMetricAreaCalculations.size < 1) {\n errors[\"invalidMetricArea\"] = \"A metric area must be selected\"\n }\n if (!this.state.selectedMetricAreaCalculations) {\n errors[\"invalidMetricCalc\"] = \"A metric calculation must be selected\"\n }\n errors[\"errorMsg\"] = \"Not all required fields have been answered/selected. Check above for more detail.\"\n\n this.setState(errors)\n return false\n }", "changeState(state) {\r\n let possibleStates = ['normal', 'busy', 'hungry', 'sleeping'];\r\n let errorCount = 0;\r\n for (let index = 0; index < possibleStates.length; index++) {\r\n const element = possibleStates[index];\r\n if (state === element) {\r\n errorCount++\r\n }\r\n }\r\n if(errorCount === 0) {\r\n throw new Error(\"State: fail check\");\r\n } \r\n this.config.initial = state\r\n this.undoArr.push(this.config.initial)\r\n return this.config.initial \r\n }", "function stateCheck() {\n\n\t\tif (testItem.length !== 1) {\n\n\t\t\ttestItem.splice(currentItem, 1);\n\t\t\tcurrentItem = jRandom(testItem.length);\n\t\t\tsounds.select();\n\t\t\tphaseOne();\n\n\t\t}\n\t\telse {\n\n\t\t\tendPhase(\"complete\");\n\n\t\t}\n\n\t}", "function checkStatus() {\n\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state.toLowerCase() == 'uninitialized')\n setTimeout(checkState, 50);\n }\n catch (e) {\n log('Server abort: ', e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n timeoutHandle && clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "recheck () {\n logger.info(`time synchronized, recheck dnd mode`)\n if (this.fsmStatus === FSM_WAITING) {\n if (this.fsmWaitingBreaker) {\n logger.info('fsm waiting break')\n this.fsmWaitingBreaker()\n }\n } else if (this.fsmStatus === FSM_END) {\n this.start(FSMCode.Start)\n } else {\n logger.error(`recheck dnd mode, but fsm status is invalid`)\n }\n }", "specialState () {\n return this.State !== this.Data;\n }", "is(state) {\n return this._states[state] && this._states[state] > 0;\n }", "function checkState(state) {\n switch (state) {\n case \"closed\":\n console.log(\"we are closed today !!!\");\n break;\n case \"minimised\":\n console.log(\"we are minimised can't be seen today !!!\");\n break;\n case \"open\":\n console.log(\"we are minimised open today !!!\");\n break;\n }\n}", "isValid() {\n\t\tconst { errors } = this.state;\n\t\treturn Object.keys(errors).every((key) => errors[key] == null);\n\t}", "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}", "static check(state, {dimension = null, title = null, eigen} = {}) {\n\t\tif (!(state instanceof State)) {\n\t\t\tthrow (new TypeError(\n\t\t\t\t'The argument is not a state \\n' +\n 'Tips: maybe you are using 2 different version of kalman-filter in your npm deps tree'\n\t\t\t));\n\t\t}\n\n\t\tconst {mean, covariance} = state; // Index\n\t\tconst meanDimension = mean.length;\n\t\tif (typeof (dimension) === 'number' && meanDimension !== dimension) {\n\t\t\tthrow (new Error(`[${title}] State.mean ${mean} with dimension ${meanDimension} does not match expected dimension (${dimension})`));\n\t\t}\n\n\t\tcheckMatrix(mean, [meanDimension, 1], title ? title + '-mean' : 'mean');\n\t\tcheckMatrix(covariance, [meanDimension, meanDimension], title ? title + '-covariance' : 'covariance');\n\t\tcheckCovariance({covariance, eigen}, title ? title + '-covariance' : 'covariance');\n\t\t// If (typeof (index) !== 'number') {\n\t\t// \tthrow (new TypeError('t must be a number'));\n\t\t// }\n\t}", "checkValidity() {\n const { valid } = this.checkValidityAndDispatch();\n return valid;\n }", "function check_change_state(data)\n {\n if (!me.selected_note || me.selected_note.readonly || !has_permission(me.notebooks[me.selected_note.list || me.selected_list], 'i')) {\n return false;\n }\n\n var savedata = data || get_save_data();\n\n return savedata.title != me.selected_note.title\n || savedata.description != me.selected_note.description\n || savedata.tags.join(',') != (me.selected_note.tags || []).join(',')\n || savedata.list != me.selected_note.list\n || me.selected_note._links_removed;\n }", "function checkReadyState() {\n\n if ( data.sync !== JSON.stringify(SYNC) || checkCaches() || !ROOM._start ) {\n\n return setTimeout( checkReadyState, DELAY );\n }\n\n // invoke loop\n if ( data.loop ) return startLoop();\n\n // initialize game\n ROOM._start();\n }", "check () {\n let mnemonic = this.mnemonic\n\n // confirm no invalid words\n let words = mnemonic.split(wordlist.space)\n let bin = ''\n for (let i = 0; i < words.length; i++) {\n let ind = wordlist.indexOf(words[i])\n if (ind < 0) {\n return false\n }\n bin = bin + ('00000000000' + ind.toString(2)).slice(-11)\n }\n\n if (bin.length % 11 !== 0) {\n throw new Error('internal error - entropy not an even multiple of 11 bits - ' + bin.length)\n }\n\n // confirm checksum\n let cs = bin.length / 33\n let hashBits = bin.slice(-cs)\n let nonhashBits = bin.slice(0, bin.length - cs)\n let buf = new Buffer(nonhashBits.length / 8)\n for (let i = 0; i < nonhashBits.length / 8; i++) {\n buf.writeUInt8(parseInt(bin.slice(i * 8, (i + 1) * 8), 2), i)\n }\n let hash = Hash.sha256(buf)\n let expectedHashBits = hash[0].toString(2)\n expectedHashBits = ('00000000' + expectedHashBits).slice(-8).slice(0, cs)\n\n return expectedHashBits === hashBits\n }", "checkFilled() {\n if (\n this.state.item_id !== '' &&\n this.state.inventory_quantity !== '' &&\n this.state.cost_per_unit !== ''\n ) {\n console.log('true')\n return true\n } else {\n console.log('false')\n return false\n }\n }", "function check() {}", "function check_status() {\n var current_status = ipin.rawRead();\n if (at_least_once && current_status === last_status) {\n return;\n }\n at_least_once = true;\n if (current_status) {\n sensor_error_code_set_to_good();\n } else {\n sensor_error_code_set_to_bad();\n }\n last_status = current_status;\n}", "function requireState(obj)\n{\n if (!isState(obj))\n throw AssertionException(\"Is not a valid state: \" + obj);\n}", "verifyChainIntegrity(){\n for(let i = 1; i < this.blockchain.length; i++){\n const currentBlock = this.blockchain[i];\n const precedingBlock= this.blockchain[i-1];\n\n if(currentBlock.hash !== currentBlock.calculateHash()){\n return false;\n }\n if(currentBlock.prevHash !== precedingBlock.hash)\n return false;\n }\n return true;\n }", "checkTransactionsChange() {\n const transactions = JSON.stringify(this.getTransactions());\n const prevTransactions = localStorage.getItem('transactions');\n return transactions !== prevTransactions;\n }", "function reversionChecker(state, initialState) {\n\tfor(let i = 0; i <= 8; i++) {\n\t\tfor(let j = 0; j <= 8; j++) {\n\t\t\tif(initialState[i][j] == 0) continue;\n\t\t\tif(initialState[i][j] != state[i][j]) return false;\n\t\t}\n\t}\n\treturn true;\n}", "function checkUnsavedChanges()\n{\n\tif(store && store.isDirty && store.isDirty())\n\t\t{\n\t\tif(confirm(config.messages.unsavedChangesWarning))\n\t\t\tsaveChanges();\n\t\t}\n}", "checkSharing() {\n if(this.state.incomingPods.length !== 0 || this.state.outgoingPods.length !== 0 )\n return true;\n }", "syncState() {\n }", "function check() {\n return supportPushState() ;\n } // function: check", "verifyIntegrity() {\n for (let i = 0; i < this.structures.length; i++) {\n const position = this.structures[i].position;\n const at = this.mapObjects[position.y][position.x];\n if (at !== this.structures[i]) {\n throw \"Structure is not consistent at location\";\n }\n }\n for (let i = 0; i < this.units.length; i++) {\n const position = this.units[i].position;\n const at = this.mapObjects[position.y][position.x];\n if (at !== this.units[i]) {\n throw \"Unit is not consistent at location\";\n }\n }\n }", "function isConsistent(t) {\n return t.type === UNARY ? isConsistent (t.types.$1) :\n t.type === BINARY ? isConsistent (t.types.$1) &&\n isConsistent (t.types.$2) :\n /* else */ t.type !== INCONSISTENT;\n }", "checkValidity() {\n return this.state.name && +this.state.amount && +this.state.maximumRides;\n }", "async function expectedState(token, stateChanges, accounts, name) {\n let state = {}\n switch (name) {\n case 'BearBucks':\n state = {\n 'totalSupply': 0,\n 'balanceOf': {\n 'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'a5': 0, 'a6': 0, 'a7': 0\n },\n 'allowance': {\n 'a0': {\n 'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'cb': 0},\n 'a1': {'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'cb': 0},\n 'a2': {'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'cb': 0},\n 'a3': {'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'cb': 0},\n 'a4': {'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'cb': 0},\n },\n 'betSum': {'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0},\n 'minter': zero40\n }\n break\n case 'CryptoBears':\n state = {\n 'balanceOf': {\n 'a0': 0, 'a1': 0, 'a2': 0, 'a3': 0, 'a4': 0, 'a5': 0, 'a6': 0, 'a7': 0\n },\n 'ownerOf': {'b0': zero40, 'b1': zero40, 'b2': zero40, 'b3': zero40, 'b4': zero40},\n 'getApproved': {'b0': zero40, 'b1': zero40, 'b2': zero40, 'b3': zero40, 'b4': zero40},\n 'isApprovedForAll': {\n 'a0': {'a0': false, 'a1': false, 'a2': false, 'a3': false, 'a4': false},\n 'a1': {'a0': false, 'a1': false, 'a2': false, 'a3': false, 'a4': false},\n 'a2': {'a0': false, 'a1': false, 'a2': false, 'a3': false, 'a4': false},\n 'a3': {'a0': false, 'a1': false, 'a2': false, 'a3': false, 'a4': false},\n 'a4': {'a0': false, 'a1': false, 'a2': false, 'a3': false, 'a4': false},\n },\n 'bets': {\n 'b0': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b1': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b2': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b3': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b4': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n },\n 'commitments': {\n 'b0': {'b0': zero64, 'b1': zero64, 'b2': zero64, 'b3': zero64, 'b4': zero64},\n 'b1': {'b0': zero64, 'b1': zero64, 'b2': zero64, 'b3': zero64, 'b4': zero64},\n 'b2': {'b0': zero64, 'b1': zero64, 'b2': zero64, 'b3': zero64, 'b4': zero64},\n 'b3': {'b0': zero64, 'b1': zero64, 'b2': zero64, 'b3': zero64, 'b4': zero64},\n 'b4': {'b0': zero64, 'b1': zero64, 'b2': zero64, 'b3': zero64, 'b4': zero64},\n },\n 'committed': {\n 'b0': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b1': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b2': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b3': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b4': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n },\n 'secrets': {\n 'b0': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b1': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b2': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b3': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n 'b4': {'b0': 0, 'b1': 0, 'b2': 0, 'b3': 0, 'b4': 0},\n },\n 'revealed': {\n 'b0': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b1': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b2': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b3': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n 'b4': {'b0': false, 'b1': false, 'b2': false, 'b3': false, 'b4': false},\n },\n 'timeLastFed': {\n 'b0': await getTimeOfBirthOrZero(token, 0),\n 'b1': await getTimeOfBirthOrZero(token, 1),\n 'b2': await getTimeOfBirthOrZero(token, 2),\n 'b3': await getTimeOfBirthOrZero(token, 3),\n 'b4': await getTimeOfBirthOrZero(token, 4),\n },\n 'minter': accounts[5],\n }\n break\n case 'BearCrowdsale':\n state = {\n 'weiRaised': 0,\n 'wei_balance': accountBalances,\n }\n break\n default:\n throw new Error('Contract name not recognized ' + name)\n }\n\n for (let i = 0; i < stateChanges.length; ++i) {\n let variable = stateChanges[i].var\n if (_.has(state, variable)) {\n let defaultVal = state[variable]\n let change = stateChanges[i].expect\n if (defaultVal == change) {\n throw new Error(\"Default value specified for variable \" + variable)\n } else {\n _.set(state, variable, change)\n }\n } else {\n throw new Error(\"variable \" + variable + \" not found in state\")\n }\n }\n\n return state\n}", "checkAll() {\n this.checkEnyo(this.props.example.resultEnyo)\n ? this.setEnyoCheckState('OK')\n : this.setEnyoCheckState('KO');\n this.checkCSS(this.props.example.resultCSS)\n ? this.setCssCheckState('OK')\n : this.setCssCheckState('KO');\n }", "async checkSubItems() {\n if (this.processingState.canContinue && !this.processingState.isProcessedToConsensus)\n await this.checkSubItemsOf(this.item);\n }", "checkError() {\n this.state.Qty > this.props.item.stock ? this.setState({QtyError: true}) : this.setState({QtyError: false})\n }", "function checkCurrenState() {\r\n // console.log(\"App Current State:\" + appCurrentState);\r\n if (appCurrentState == undefined) {\r\n clearData();\r\n }\r\n if (appCurrentState == appStateEnum.signing || appCurrentState == appStateEnum.downloadFile || appCurrentState == appStateEnum.info) {\r\n console.log(\"LOADING\");\r\n // sections.changeSection(sections.section.loadingSection);\r\n showLoading(MessageType[appCurrentState]);\r\n } else if (appCurrentState == appStateEnum.complete || appCurrentState == appStateEnum.error) {\r\n clearData();\r\n }\r\n //check if exist stored data in background\r\n else if (appCurrentState == appStateEnum.running) {\r\n console.log(backgroundStoredSignatureData);\r\n if (backgroundStoredSignatureData.isEmpty() == false) {\r\n console.log(\"NEED TO RESTORE DATA\");\r\n chrome.tabs.query({\r\n active: true,\r\n currentWindow: true\r\n }, function (tab) {\r\n if (tab[0].url == backgroundStoredSignatureData.signatureData.tabUrl) {\r\n signatureData.copy(backgroundStoredSignatureData.signatureData);\r\n updateSignatureFieldList(backgroundStoredSignatureData.infoPDF);\r\n } else {\r\n console.log(\"Stored data in background belong to a different document. Clear stored data.\")\r\n clearData();\r\n }\r\n });\r\n }\r\n }\r\n }" ]
[ "0.634634", "0.63179356", "0.631463", "0.62222314", "0.62201065", "0.61089563", "0.60890144", "0.6063266", "0.60560477", "0.60407686", "0.6038451", "0.60109645", "0.58998275", "0.5887521", "0.5868892", "0.58535737", "0.58497894", "0.5820178", "0.5802804", "0.57777756", "0.576211", "0.5761001", "0.5761001", "0.57431364", "0.57369876", "0.5730129", "0.57254833", "0.5723055", "0.57111573", "0.5704703", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.5676886", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.567661", "0.56735855", "0.56673384", "0.5654565", "0.56391996", "0.563695", "0.5635303", "0.5635303", "0.5617849", "0.5590769", "0.5586486", "0.5586486", "0.55796146", "0.5579373", "0.5576834", "0.5573715", "0.55689573", "0.5553174", "0.5534711", "0.5525689", "0.5520371", "0.5520193", "0.55147356", "0.5511296", "0.5508621", "0.55056334", "0.54984105", "0.54899615", "0.5488818", "0.54868275", "0.5485577", "0.5484304", "0.5474492", "0.546831", "0.5467351", "0.5452967", "0.5444685", "0.5421934", "0.5417521", "0.5415263", "0.54101366", "0.54090226", "0.5404077", "0.5399804", "0.5398655", "0.53977203", "0.53974307", "0.5391597", "0.5384952", "0.5379581", "0.53793484", "0.53781986", "0.5369158" ]
0.0
-1
Check the consistency of the State's attributes
static check(state, {dimension = null, title = null, eigen} = {}) { if (!(state instanceof State)) { throw (new TypeError( 'The argument is not a state \n' + 'Tips: maybe you are using 2 different version of kalman-filter in your npm deps tree' )); } const {mean, covariance} = state; // Index const meanDimension = mean.length; if (typeof (dimension) === 'number' && meanDimension !== dimension) { throw (new Error(`[${title}] State.mean ${mean} with dimension ${meanDimension} does not match expected dimension (${dimension})`)); } checkMatrix(mean, [meanDimension, 1], title ? title + '-mean' : 'mean'); checkMatrix(covariance, [meanDimension, meanDimension], title ? title + '-covariance' : 'covariance'); checkCovariance({covariance, eigen}, title ? title + '-covariance' : 'covariance'); // If (typeof (index) !== 'number') { // throw (new TypeError('t must be a number')); // } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkValidity() {\n this.validState = this.currentDataState.name && \n +this.currentDataState.amount && +this.currentDataState.maximumRides;\n }", "getValidStatus() {\n this.checkInput();\n return this.state.isValid;\n }", "function checkConsistency(selected) {\n var next;\n // Ignore selections which don't have this property\n if (selected[property] !== undefined) {\n // Look up state of this element in the selection\n next = self.lookupState(property, selected);\n // Detect inconsistency\n if (observed) {\n consistent = consistent && (next === state);\n }\n // Track state for next iteration\n state = next;\n observed = true;\n }\n }", "async validateAttributes () {\n\t}", "allValid() {\n return (this.state.description.length > 0 &&\n this.state.title.length > 0 && this.state.time.length > 0)\n }", "isValid(){\n let component = this.props.component\n let key = this.props.attribute\n return !component.state.data[key].error\n }", "isValid(state) {\n return true;\n }", "async function assertState(state) {}", "async validate () {\n\t\tconst error = await this.validateAttributes();\n\t\tif (error) {\n\t\t\tthrow this.errorHandler.error('validation', { info: error });\n\t\t}\n\t}", "_changed () {\n return (JSON.stringify(this.model.attributes) !== JSON.stringify(this.previousAttributes));\n }", "function checkIfUpdateDiff (oldVal, newVal) {\n if (oldVal && !newVal) {\n $log.debug('Attribute setA initialized');\n vm.updateDiff();\n }\n if (newVal) {\n $log.debug('Attribute setA changed');\n vm.updateDiff();\n }\n }", "validate() {\n const { tmpTarget } = ReduxStore.getState().innerState\n const isValidSuccess = validator.target(tmpTarget)\n return isValidSuccess\n }", "shouldUpdate(_changedProperties){return!0}", "function verifyStructure() {\n var component, key;\n parameters.structure.integrity = true;\n \n for (key in parameters.structure.components) {\n component = parameters.structure.components[key];\n if (component.integrity !== true) {\n parameters.structure.integrity = false;\n }\n }\n }", "isValid() {\n\t\tconst { errors } = this.state;\n\t\treturn Object.keys(errors).every((key) => errors[key] == null);\n\t}", "validateState(name, indexOrGuid = null, attribute = null) {\n if (indexOrGuid != null) {\n //this is a $each situation - array\n const { $dirty, $invalid } = this.$v[name][attribute].$values.$each[indexOrGuid].Value;\n return $dirty ? !$invalid : null;\n } else {\n const { $dirty, $error } = this.$v[name];\n return $dirty ? !$error : null;\n }\n }", "async checkAttributes () {\n\t\t// must provide a password for confirmation if we don't already have one\n\t\tif (!this.user.get('passwordHash') && !this.request.body.password) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'password' });\n\t\t}\n\t\t// must provide a username for confirmation if we don't already have one\n\t\tif (!this.user.get('username') && !this.request.body.username) {\n\t\t\tthrow this.errorHandler.error('parameterRequired', { info: 'username' });\n\t\t}\n\t}", "checkValidity() {\n return this.state.name && +this.state.amount && +this.state.maximumRides;\n }", "isValid() {\n\t\t// deconstruct the props\n\t\tconst {errors, isValid } = validateInput(this.state);\n\t\tthis.setState({ errors });\n\t\treturn isValid;\n\t}", "function state_check(state){\n\tfor (var i = 0; i < ufo_data.length; i++){\n\t\tif (ufo_data[i].state === state){\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}", "check() {\n if (!Number.isInteger(this.nextNum)) throw new Error('nextNum property is not an integer');\n if (this.nextNum < 0) throw new Error('nextNum property is negative');\n for (const prop of ['numToAttrib', 'attribToNum']) {\n const obj = this[prop];\n if (obj == null) throw new Error(`${prop} property is null`);\n if (typeof obj !== 'object') throw new TypeError(`${prop} property is not an object`);\n const keys = Object.keys(obj);\n if (keys.length !== this.nextNum) {\n throw new Error(`${prop} size mismatch (want ${this.nextNum}, got ${keys.length})`);\n }\n }\n for (let i = 0; i < this.nextNum; ++i) {\n const attr = this.numToAttrib[`${i}`];\n if (!Array.isArray(attr)) throw new TypeError(`attrib ${i} is not an array`);\n if (attr.length !== 2) throw new Error(`attrib ${i} is not an array of length 2`);\n const [k, v] = attr;\n if (k == null) throw new TypeError(`attrib ${i} key is null`);\n if (typeof k !== 'string') throw new TypeError(`attrib ${i} key is not a string`);\n if (v == null) throw new TypeError(`attrib ${i} value is null`);\n if (typeof v !== 'string') throw new TypeError(`attrib ${i} value is not a string`);\n const attrStr = String(attr);\n if (this.attribToNum[attrStr] !== i) throw new Error(`attribToNum for ${attrStr} !== ${i}`);\n }\n }", "function checkActsConsistency(){\n checkConsistency(Action.ACTS);\n //set expections\n verifyCondition = true;\n expectations = Expect.AFTER_ACTS;\n }", "validateState(state, cachedState) {\n if (!state) {\n throw NodeAuthError.createStateNotFoundError();\n }\n if (state !== cachedState) {\n throw msalCommon.ClientAuthError.createStateMismatchError();\n }\n }", "isStrict(){\n let component = this.props.component\n let key = this.props.attribute\n return component.state.data[key].strict\n }", "isAllValid() {\n return this.state.movieTitle_error || this.state.diractor_error || this.state.year_error || this.state.runtime_error || this.state.genre_error;\n }", "function checkfromState() {\n for (let i = 0; i < state.length; i++) {\n if (state[i].value[0] == tracker[0] && state[i].value[1] == tracker[1] && state[i].value[2] == tracker[2]) {\n return true;\n }\n }\n return false;\n}", "function checkState(vnode3, original) {\n\t\tif (vnode3.state !== original) throw new Error(\"'vnode.state' must not be modified.\")\n\t}", "isConsistent() {\n return !this.inconsistentAt;\n }", "function checkState(vnode3, original) {\n\t\tif (vnode3.state !== original) throw new Error(\"`vnode.state` must not be modified\")\n\t}", "async validateAttributes () {\n\t\tthis.attributes.isEveryoneTeam = this.isEveryoneTeam; // don't allow to be set by client\n\t\tthis.validator = new CodeStreamModelValidator(TeamAttributes);\n\t\treturn this.validateName();\n\t}", "verifyIntegrity() {\n for (let i = 0; i < this.structures.length; i++) {\n const position = this.structures[i].position;\n const at = this.mapObjects[position.y][position.x];\n if (at !== this.structures[i]) {\n throw \"Structure is not consistent at location\";\n }\n }\n for (let i = 0; i < this.units.length; i++) {\n const position = this.units[i].position;\n const at = this.mapObjects[position.y][position.x];\n if (at !== this.units[i]) {\n throw \"Unit is not consistent at location\";\n }\n }\n }", "async determineChanges () {\n\t\tthis.changes = {};\n\t\tObject.keys(this.attributes).forEach(attribute => {\n\t\t\tif (attribute === 'id' || attribute === '_id') { return; }\n\t\t\tif (!this.attributesAreEqual(\n\t\t\t\tthis.existingModel.get(attribute),\n\t\t\t\tthis.attributes[attribute])\n\t\t\t) {\n\t\t\t\tthis.changes[attribute] = this.attributes[attribute];\n\t\t\t}\n\t\t});\n\t}", "validateProps() {\n\t\tif (!this.props.nodeInfo) return false;\n\n\t\tif (!this.props.nodeInfo.nodeName) return false;\n\t\tif (typeof this.props.nodeInfo.nodeName !== \"string\") return false;\n\n\t\tif (!this.props.nodeInfo.nodeCapacity) return false;\n\t\tif (typeof this.props.nodeInfo.nodeCapacity !== \"object\") return false;\n\t\tif (\n\t\t\t!this.props.nodeInfo.nodeCapacity.cpu ||\n\t\t\ttypeof this.props.nodeInfo.nodeCapacity.cpu !== \"string\"\n\t\t)\n\t\t\treturn false;\n\t\tif (\n\t\t\t!this.props.nodeInfo.nodeCapacity.memory ||\n\t\t\ttypeof this.props.nodeInfo.nodeCapacity.memory !== \"string\"\n\t\t)\n\t\t\treturn false;\n\n\t\tif (\n\t\t\t!this.props.nodeInfo.nodeCapacity.pods ||\n\t\t\ttypeof this.props.nodeInfo.nodeCapacity.pods !== \"string\"\n\t\t)\n\t\t\treturn false;\n\t\tif (\n\t\t\t!this.props.nodeInfo.nodeCapacity[\"ephemeral-storage\"] ||\n\t\t\ttypeof this.props.nodeInfo.nodeCapacity[\"ephemeral-storage\"] !==\n\t\t\t\t\"string\"\n\t\t)\n\t\t\treturn false;\n\n\t\treturn true;\n\t}", "function requireState(obj)\n{\n if (!isState(obj))\n throw AssertionException(\"Is not a valid state: \" + obj);\n}", "specialState () {\n return this.State !== this.Data;\n }", "async function checkState(_tokens, _stateChanges, _accounts) {\n let numTokens = _tokens.length\n assert.equal(numTokens, _stateChanges.length)\n for (let i = 0; i < numTokens; i++) {\n let token = _tokens[i]\n let stateChanges = _stateChanges[i]\n let name = await token.contractName.call()\n let _expectedState = await expectedState(token, stateChanges, _accounts, name)\n let _actualState = await actualState(token, _expectedState, _accounts, name)\n assertDiff.deepEqual(_actualState, _expectedState,\n \"difference between expected and actual state\")\n if (name != 'BearCrowdsale') {\n await checkBalancesSumToTotalSupply(token, _accounts, name)\n }\n }\n}", "checkFilled() {\n if (\n this.state.item_id !== '' &&\n this.state.inventory_quantity !== '' &&\n this.state.cost_per_unit !== ''\n ) {\n console.log('true')\n return true\n } else {\n console.log('false')\n return false\n }\n }", "check() {\n if (this.state.data && this.state.radio && this.state.data !== \"\"\n && this.state.currentMetricAreaCalculations.size >= 1\n && this.state.selectedMetricAreaCalculations) {\n return true\n }\n let errors = {} // Object to hold errors\n\n if (!this.state.data) {\n errors[\"invalidData\"] = \"A value must be entered\"\n }\n if (!this.state.radio) {\n errors[\"invalidRadio\"] = \"An actual or target must be selected\"\n }\n if (this.state.currentMetricAreaCalculations.size < 1) {\n errors[\"invalidMetricArea\"] = \"A metric area must be selected\"\n }\n if (!this.state.selectedMetricAreaCalculations) {\n errors[\"invalidMetricCalc\"] = \"A metric calculation must be selected\"\n }\n errors[\"errorMsg\"] = \"Not all required fields have been answered/selected. Check above for more detail.\"\n\n this.setState(errors)\n return false\n }", "isReady(state) {\n return (\n state.status[''] !== undefined &&\n state.status[''].type == statusOptions[0]\n );\n }", "function CfnDetectorModel_StatePropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('onEnter', CfnDetectorModel_OnEnterPropertyValidator)(properties.onEnter));\n errors.collect(cdk.propertyValidator('onExit', CfnDetectorModel_OnExitPropertyValidator)(properties.onExit));\n errors.collect(cdk.propertyValidator('onInput', CfnDetectorModel_OnInputPropertyValidator)(properties.onInput));\n errors.collect(cdk.propertyValidator('stateName', cdk.requiredValidator)(properties.stateName));\n errors.collect(cdk.propertyValidator('stateName', cdk.validateString)(properties.stateName));\n return errors.wrap('supplied properties not correct for \"StateProperty\"');\n}", "validateForm() {\n this.setState({ formValid: this.state.titleValidExist && this.state.titleValidLength && this.state.yearValid && this.state.runtimeValid && this.state.genreValid && this.state.directorValid });\n }", "thereIsSomeUserInfo() {\n return this.state.location.length > 0 || this.state.occupation.length > 0 || this.state.education.length > 0\n }", "isFullFillment(){\n let hasCity = this.state.schoolCity;\n let hasName = this.state.schoolName;\n let hasType = this.state.schoolType;\n let hasLevel = this.state.schoolLevel;\n console.log(hasCity, hasType, hasName, hasLevel, 'wwwwwww@@');\n }", "checkValidity() {\n return this._staticallyValidateConstraints().result === constraintValidationPositiveResult;\n }", "mustDo (stateName) {\n let upperStateName = stateName.toUpperCase()\n let res = this.state[upperStateName]\n\n if (getItType(res) !== 'BOOLEAN') {\n throw Error(`dont know |${stateName}| state`)\n }\n return res\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkUpdate() {\n if (this.updating === true) return false\n this.hasChanged = false\n const _entityList = this.entity_items.getEntitieslist()\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hassEntities = _entityList\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n this.hasChanged = this.entity_items.hasChanged(this.hassEntities)\n if (this.hasChanged) {\n /**\n * refresh and update the graph\n */\n this.updateGraph(true)\n }\n }\n return this.hasChanged\n }", "checkIfDirty() {\n if(this.stringify(this.props.dirt) === this.stringify(this.state.id)) {\n this.setState({dirt: true})\n }\n }", "async validateAttributes () {\n\t\tthis.userValidator = new UserValidator();\n\t\treturn this.validateEmail() ||\n\t\t\tthis.validatePassword() ||\n\t\t\tthis.validateUsername();\n\t}", "function testInputState(input, { checked, indeterminate }) {\n const result = {};\n\n result.pass = (input.checked === checked) && (input.indeterminate === indeterminate);\n\n result.message =\n `Input element ${input.id}\\n` +\n `expected (checked == ${checked} && indeterminate == ${indeterminate})\\n` +\n `actual (checked == ${input.checked} && indeterminate == ${input.indeterminate})`;\n return result;\n}", "function areCustomAttributesDirty ( material ) {\r\n\r\n\t\tfor ( var a in material.attributes ) {\r\n\r\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\r\n\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\r\n\t}", "validateForm() {\n return (this.validatePrices()\n && this.validateName() === 'success'\n && this.state.hash !== \"\"\n && this.state.ipfsLocation !== \"\"\n && this.state.fileState === FileStates.ENCRYPTED)\n }", "shouldUpdate(_changedProperties){return true;}", "check_update(value) { return (this.value != value); }", "function isSameState(newState, diff) {\n if (!currentState) return false;\n\n return (newState == currentState.state) && (util.objectSize(diff.all) == 0);\n }", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var name in material.attributes ) {\n\n\t\t\tif ( material.attributes[ name ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "get isDirty() {\n return this._additionsHead !== null || this._movesHead !== null ||\n this._removalsHead !== null || this._identityChangesHead !== null;\n }", "compare(){\n\t\tvar diff = 0,\n\t\t\tself = this;\n\t\tattributesArray_String.map( ( attr )=>{\n\t\t\tdiff+= self.snapshots[attr] == self.object[attr] ? 0 : 1;\n\t\t});\n\t\treturn diff <= 0;\n\t}", "function checkState() {\n if (!this.isInitialized()) {\n this.throwSCORMError(301);\n return false;\n }\n\n return true;\n }", "function validate(){\n let errors = {}\n if (error && values !== stateValues){\n setSavingStarted(false)\n setStateValues(values)\n }\n \n return errors\n }", "checkTrainableWeightsConsistency() {\n if (this.collectedTrainableWeights == null) {\n return;\n }\n if (this.trainableWeights.length !==\n this.collectedTrainableWeights.length) {\n console.warn('Discrepancy between trainableweights and collected trainable ' +\n 'weights. Did you set `model.trainable` without calling ' +\n '`model.compile()` afterwards?');\n }\n }", "is(state) {\n return this._states[state] && this._states[state] > 0;\n }", "setup() {\n let validStateCount = 0;\n // For each row, allocate a clickable object\n for( let i = 0; i < this.statesTable.getRowCount(); i++ ) {\n let className = this.statesTable.getString(i, 'ClassName');\n \n // if we have an image, we will call setImage() to load that image into that p5.clickable\n if( className === \"\" ) {\n print(\"empty className field in line #\" + i + \" of states file\");\n return false; \n }\n \n // this is the allocator itself\n this.states[validStateCount] = eval(\"new \" + className);\n \n // store name of the state in the PNGRoom\n this.states[validStateCount].setName(this.statesTable.getString(i, 'StateName'));\n\n // All classes (for now) have a PNGFilename, could add a blank room\n this.states[validStateCount].setup( this.statesTable.getString(i, 'PNGFilename'),\n this.statesTable.getString(i, 'CollisionFilename'));\n \n this.states[validStateCount].preload();\n\n validStateCount++;\n }\n \n if( validStateCount > 0 ) {\n this.hasValidStates = true;\n this.currentStateName = this.statesTable.getString(0, 'StateName');\n this.changeState(this.currentStateName,true);\n }\n else {\n this.hasValidStates = false;\n }\n\n return this.hasValidStates;\n }", "_validateAttributes(values = {}) {\n const { attributes } = this.constructor;\n // check changed values\n const changes = this.changes();\n let changedValues = {};\n for (const key in changes) {\n if (changes[key].length === 2) {\n changedValues[key] = changes[key][1];\n }\n }\n\n // merge all changed values\n changedValues = Object.assign(changedValues, values);\n\n for (const valueKey in changedValues) {\n const attribute = attributes[valueKey];\n if (!attribute) continue;\n const { validate = {}, name, allowNull, defaultValue } = attribute;\n const value = changedValues[valueKey];\n if (value == null && defaultValue == null) {\n if (allowNull === false) throw new LeoricValidateError('notNull', name);\n if ((allowNull === true || allowNull === undefined) && validate.notNull === undefined ) return;\n }\n if (!validate) return;\n for (const key in validate) {\n if (validate.hasOwnProperty(key)) executeValidator(this, key, attribute, value);\n }\n }\n }", "check_if_passed() {\n const passed = this.node.value === this.correct;\n if (!passed) {\n console.error(this.describe() + \" failed!\");\n }\n return passed;\n }", "function areCustomAttributesDirty( material ) {\n\n\t\tfor ( var a in material.attributes ) {\n\n\t\t\tif ( material.attributes[ a ].needsUpdate ) return true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "function compareChainState(state, expected) {\n assert.strictEqual(state.startHeight, expected.startHeight);\n assert.bufferEqual(state.startHash, expected.startHash);\n assert.strictEqual(state.height, expected.height);\n assert.strictEqual(state.marked, expected.marked);\n}", "function areCustomAttributesDirty( material ) {\n\n for ( var a in material.attributes ) {\n\n if ( material.attributes[ a ].needsUpdate ) return true;\n\n }\n\n return false;\n\n }", "getValidationState(key) {\n const length = this.state[key].length;\n if (length > 10) return 'success';\n else if (length > 5) return 'warning';\n else if (length > 0) return 'error';\n return null;\n }", "function expectStatesSharedUnsettled(ae) {\n\n expect(ae.isFinished).toBe(false);\n expect(ae.isSettled).toBe(false);\n expect(ae.isRejected).toBe(false);\n expect(ae.isCanceled).toBe(false);\n expect(ae.isFailed).toBe(false);\n expect(ae.isDone).toBe(false);\n\n expect(ae.result).toBe(undefined);\n expect(ae.error).toBe(null);\n }", "validateDatasetForm() {\n if(this.nameValidationState != undefined && this.descValidationState != undefined && this.attribValidationState != undefined) {\n if(this.nameValidationState == 'error' || this.descValidationState == 'error' || this.attribValidationState == 'error') {\n return true;\n } else {\n return false;\n }\n } else {\n return true;\n }\n }", "checkUpdate() {\n if (this.updating === true) return false\n // check if we has changes\n if (this.hassEntities && this.hassEntities.length && this._hass) {\n this.hasChanged = false\n // reload the hass entities\n this.hassEntities = this.entities\n .map((x) => this._hass.states[x.entity])\n .filter((notUndefined) => notUndefined !== undefined)\n\n // check for update and set the entity state last and update flag\n for (let entity of this.entities) {\n const h = this.hassEntities.find((x) => x.entity_id === entity.entity)\n entity.laststate = entity.state\n entity.update = false\n if (h && entity.last_changed !== h.last_changed && entity.state !== h.state) {\n entity.last_changed = h.last_changed\n entity.state = h.state\n entity.update = true\n this.hasChanged = true\n }\n }\n\n if (this.hasChanged) {\n // refresh and update the graph\n this.updateGraph(true)\n }\n return this.hasChanged\n }\n }", "validateForm() {\n return (\n // this.state.title.length > 0 &&\n this.state.email.length > 0 &&\n this.state.first_name.length > 0 &&\n this.state.last_name.length > 0 &&\n this.state.other_name.length > 0 &&\n // this.state.rank.length > 0 &&\n // this.state.department.length > 0 &&\n this.state.password.length > 0 &&\n this.state.password === this.state.confirmPassword\n );\n }", "function checkDirtyObj() {\n const odd = []\n for (const key in dirtyPileObj) {\n if(dirtyPileObj[key] > 0 ) {\n odd.push(key)\n }\n }\n\n return odd.length > 0\n }", "function testState () {\n cy.get('@firstTodo').should('contain', TODO_ITEM_ONE).and('have.class', 'completed')\n cy.get('@secondTodo').should('contain', TODO_ITEM_TWO).and('not.have.class', 'completed')\n }", "state(){\n return this.getGuaranteedLocality('state')\n }", "checkErrors() {\n if (this.state.valid_state_new && this.state.valid_state_current) {\n if (this.state.valid_state_new === 'success' && this.state.valid_state_current === 'success') {\n return false;\n }\n }\n return true;\n }", "checkStructure() {\n let numRepr = 0;\n\n this.parents.forEach((parent, i) => {\n const rank = this.ranks[i];\n const size = this.sizes[i];\n const isRepr = parent === i;\n\n if (isRepr) {\n numRepr++;\n }\n\n const isParentInRange = 0 <= parent && parent < this.parents.length;\n const isReprRelevant = (isRepr || rank < this.ranks[parent]) &&\n (!isRepr && size === 0 || isRepr && size >= (1 << rank));\n const noAssertion = isParentInRange && isReprRelevant && 0 <= rank ;\n\n if (!noAssertion) {\n throw \"Assertion error\";\n }\n });\n\n if (!(0 <= this.numSets && this.numSets === numRepr && this.numSets <= this.parents.length)) {\n throw \"Assertion error\";\n }\n }", "stateCheck()\n {\n if(this.state == 5) this.color = \"green\";\n if(this.state == 4) this.color = \"rgb(82, 204, 82)\";\n if(this.state == 3) this.color = \"rgb(177, 252, 164)\";\n if(this.state == 2) this.color = \"rgb(112, 224, 112)\";\n if(this.state == 1) this.color = \"rgb(204, 227, 166)\";\n if(this.state == 0) this.color = \"rgb(163, 155, 118)\";\n }", "get validity() {\n return this.getInput().validity;\n }", "_assertRecordValid(record: Object) {\n // Iterating over all record properties and searching\n // for nan and undefined since this values probably indicate \n // data corruption\n for (let prop in record) {\n // Asserting current value is valid(valid is not undefined and not NaN)\n if (record[prop] === undefined || record[prop] !== record[prop]) {\n // Declaring not valid\n console.log(`CRUDActions._assertRecordValid: found not valid record for field \n ${prop} and object: ${JSON.stringify(record, null, 4)}`)\n return false\n }\n }\n \n // Declaring valid\n return true\n }", "isDeterministicComplete() {\r\n let isDeterministic = this.isDeterministic();\r\n if (!isDeterministic) return false;\r\n\r\n // Each pair (state, symbol) must have an image by transition function\r\n for (let index = 0; index < this.states.length; index++) {\r\n const state = this.states[index];\r\n for (const symbol of this.alphabet) {\r\n if (this.transition(state, symbol) == null)\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "verify() {\n let verification = {};\n let totalCycleTime = this.getTotalCycleTime();\n verification.NS_Green = this.isDirectionValid(this.NS_rate * (this.straightFlow > this.rightFlow ? this.straightFlow : this.rightFlow), totalCycleTime, this.NS_Green);\n verification.NS_Left = this.isDirectionValid(this.NS_rate * this.leftFlow, totalCycleTime, this.NS_Left);\n verification.EW_Green = this.isDirectionValid(this.EW_rate * (this.straightFlow > this.rightFlow ? this.straightFlow : this.rightFlow), totalCycleTime, this.EW_Green);\n verification.EW_Left = this.isDirectionValid(this.EW_rate * this.leftFlow, totalCycleTime, this.EW_Left);\n return verification;\n }", "isValid() {\n if (\n this.state.isDanger ||\n this.state.apiValue === '' ||\n this.state.apiValue === undefined\n )\n return false;\n\n return true;\n }", "checkIsAVLT () {\n super.checkIsBST()\n this.checkHeightCorrect()\n this.checkBalanceFactors()\n }", "function checkpointed() {\n dyno.query({KeyConditions:{type:{ComparisonOperator:'EQ',AttributeValueList: ['shard']}}}, function(err, response) {\n var shards = response.Items;\n shards.forEach(function(s) {\n t.equal(s.status, 'leased', 'leased');\n t.equal(s.instance, kine.config.instanceId, 'this instance leased');\n t.ok(s.hashKeyStart);\n t.ok(s.hashKeyEnd);\n });\n\n var checkpointed = _(shards).filter(function(s){ return !!s.checkpoint;}).value();\n t.equal(checkpointed.length, 1, 'one checkpointed');\n t.end();\n });\n }", "validateForm() {\n return this.state.serviceName.length > 0 && this.state.description.length > 0 && this.state.location.length > 0 && this.state.category.length > 0 && this.state.url.length > 0\n }", "formValidity(state) {\n // the list of errors we will pass to setError\n const errors = []\n // for each field, retrieve the error triggered by current state\n // and then make sure we set it as existing.\n const validityState = [\n 'expirationDuration',\n //'expirationDurationUnit',\n 'keyPrice',\n 'maxNumberOfKeys',\n 'name',\n ].reduce((fieldValidity, field) => {\n // invalidError will either be the error name or false\n const invalidError = this.validate(field, state[field])\n fieldValidity[field] = !invalidError\n if (!invalidError) {\n return fieldValidity\n }\n errors.push(invalidError)\n return fieldValidity\n }, {})\n\n // the form can be submitted if and only if there are no errors triggered by any field\n validityState.formValid = errors.length === 0\n return { validityState, errors }\n }", "function checkStatus() {\n checkWin();\n checkLose();\n }", "function stateCheck() {\n var stateLog = document.querySelector(\".state\");\n var state = response.regionName;\n console.log(state);\n\n stateLog.innerHTML += state;\n }", "function assertChangeFlags() {\n assert('Beforechange should have fired', firedBeforeChange);\n assert('Delayedchange should have fired', firedDelayedChange);\n}", "function checkCurrentState(reading) {\n let result\n Rules.find().fetch().some(function(rule){\n if (reading >= rule.rule.from && reading <= rule.rule.to) {\n result = rule.rule.state\n return true\n } else {\n return false\n }\n });\n return result;\n}", "function checkConsistency() {\n var i, id, p, msg, plans, catalog;\n\n catalog = config.catalog;\n plans = config.plans;\n\n for (i = 0; i < catalog.services.length; i += 1) {\n for (p = 0; p < catalog.services[i].plans.length; p += 1) {\n id = catalog.services[i].plans[p].id;\n if (!plans.hasOwnProperty(id)) {\n msg = \"ERROR: plan '\" + catalog.services[i].plans[p].name + \"' of service '\" + catalog.services[i].name + \"' is missing a specification.\";\n throw new Error(msg);\n }\n }\n }\n}", "function processState(propName, updater) {\n if (prevProps[propName] !== nextProps[propName] || self.needSyncKeys[propName]) {\n updater(nextProps[propName], prevProps[propName]);\n return true;\n }\n\n return false;\n }" ]
[ "0.62308526", "0.6172292", "0.614439", "0.6132538", "0.6079051", "0.6039637", "0.59138834", "0.5861194", "0.5828843", "0.57531667", "0.57370085", "0.5721421", "0.5647467", "0.5646098", "0.56174374", "0.5614289", "0.5589433", "0.5580064", "0.5534819", "0.5532091", "0.55295765", "0.55273086", "0.5522414", "0.5511642", "0.54904073", "0.54889446", "0.5486644", "0.54773587", "0.5474261", "0.5464497", "0.5459481", "0.5449504", "0.5416998", "0.5412517", "0.53783387", "0.537133", "0.535261", "0.5352355", "0.530361", "0.5288223", "0.52851963", "0.5268101", "0.5260666", "0.5260188", "0.5255603", "0.5243473", "0.5243473", "0.5241485", "0.5230395", "0.522813", "0.5223798", "0.52095926", "0.52041924", "0.519771", "0.51889265", "0.518457", "0.518457", "0.5182399", "0.5182399", "0.5182399", "0.5182399", "0.5182399", "0.5182399", "0.5178335", "0.5176439", "0.5173348", "0.51659113", "0.5165815", "0.51630574", "0.51622313", "0.5156328", "0.5151535", "0.51446223", "0.5138653", "0.5123005", "0.51167214", "0.5114988", "0.5112263", "0.51082677", "0.51074016", "0.5106664", "0.51034063", "0.51020116", "0.51004344", "0.50979203", "0.50892955", "0.5080743", "0.50796515", "0.5079006", "0.50752705", "0.5073813", "0.50731075", "0.50720555", "0.50604945", "0.50584185", "0.50573504", "0.50572175", "0.50564754", "0.50564295", "0.50421596" ]
0.51757425
65
JavaScript Turn Off Modal Contact
function closeImages1() { var nutButton = document.getElementById("buttonContactone") var modalOne1 = document.getElementById("full-modal-contact-two") var dongModal1 = document.getElementById("alway-close1") dongModal1.style.display = 'block' setTimeout(function(){ modalOne1.style.display = 'none' dongModal1.style.display = 'none' nutButton.style.display = 'block' },500) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function toggleModalOff(){\n var modalWindow = document.querySelector('.modal')\n modalWindow.style.display = 'none';\n }", "function esconderModal() {\n\tmodal.style.display = 'none';\n}", "function toggleModalOff() {\n const modal = document.querySelector('.modal-background');\n modal.classList.add('hide');\n }", "deactivateModal() {\n\t\tdocument.querySelector('#login-modal').style.display = 'none';\n\t}", "function toggleModalOn() {\n const modal = document.querySelector('.modal-background');\n modal.classList.remove('hide');\n }", "function toggle() {\r\n setModal(!modal)\r\n }", "function ShowcontactDialog(modal)\n {\n $(\"#contactoverlay\").show();\n $(\"#contactdialog\").fadeIn(300);\n\n if (modal)\n {\n $(\"#contactoverlay\").unbind(\"click\");\n }\n else\n {\n $(\"#contactoverlay\").click(function (e)\n {\n HidecontactDialog();\n });\n }\n }", "function hide () {\n modal.classList.remove('modalOn');\n document.getElementById('modalOff').innerHTML = '';\n}", "function openInv(){\n\tdocument.getElementById(\"modal-backdrop-inv\").classList.remove(\"inactive\");\n\tdocument.getElementById(\"modal-inv\").classList.remove(\"inactive\");\n}", "function openModal(){\n subscriptionMobileDisplay.classList.remove(\"not_visible\");\n }", "function closeContactModal() {\n var parentModalContact = document.querySelector('.modal-parent-contact');\n parentModalContact.style.display = 'none';\n}", "function toggleModal() {\n\tconst modal = document.querySelector('.modal__background');\n\tmodal.classList.toggle('hide');\n}", "function toggleModal() {\n\tconst modal = document.querySelector('.modal_background');\n\tmodal.classList.toggle('hide');\n}", "function closeModal() {\n MODAL.removeAttribute(\"open\");\n resetGame();\n}", "function closeModal(e) {\n document.querySelector(\".contact\").style.display = \"grid\";\n document.querySelector(\".share-container\").style.display = \"none\";\n}", "function skjulModal() {\n\n\n modal.classList.remove(\"vis\");\n }", "closeContactModal() {\n //get element references\n const modal = document.getElementById(\"contact-success-modal\");\n const modalOverlay = document.getElementById(\"contact-modal-overlay\");\n \n //Fade out the modal\n this.fadeOutModal(modal, modalOverlay);\n }", "function openModal() {\n let modal = document.querySelector('#contact-modal');\n modal.classList.toggle('show-modal');\n}", "hideModal(){\n if(document.getElementById('modal')){\n document.getElementById('modal').style.display = 'none';\n document.getElementById('caption').style.display = 'none';\n document.getElementById('modal').style.zIndex = 0;\n }\n \n }", "function closeMe() {\n\t\t $('#' + settings.id).modal('hide');\n\t\t if (settings.isSubModal)\n\t\t $('body').addClass('modal-open');\n\t\t }", "function hideModal() {\n modal.style.display = \"none\";\n}", "function aceptCancelar(){\n document.querySelector(\".modal\").style.display=\"none\"\n}", "function toggleModal() {\n $('body').classList.toggle('modalOpen');\n //Force video to stop playing when modal is closed - we could do this in a nicer way if we used the youtube API.\n $('modalTrailer').setAttribute('src', '');\n //Inverse modalHiddenState\n modalHiddenState = !modalHiddenState;\n $('modalTrailer').setAttribute('aria-hidden', modalHiddenState);\n}", "function modalToggle() {\n 'use strict'; // turn on Strict Mode\n congoModal.classList.toggle('hide');\n}", "function doModalContact() {\n\t customModalBox.htmlBox('yt-ContactContent', '', 'Contact'); \n\t $('mb_close_link').addEvent('click', function() {\n\t\t $('yt-ContactContent').injectInside(document.forms[0]);\n\t });\n\t\n}", "function disablePopUp() {\n setModalValue(!showModal); // toggling value of showModal and setting it in the state\n }", "function hideModal() {\r\n //The modal is currently closed\r\n modal.open = false;\r\n //Add class to hide modal\r\n modal.container.classList.add(\"hide-modal\");\r\n }", "function attShowModal() {\n setShowModal(!showModal);\n }", "function openFleet(){\n\tdocument.getElementById(\"modal-fleet\").classList.remove(\"inactive\");\n}", "modalHide(myModal) {\n myModal.style.display = \"none\";\n player.choosePlayer();\n }", "function hideContact() {\n document.getElementById(\"contact-container\").style.display = \"none\";\n}", "hideModal() {\r\n document.querySelector(\".glass\").classList.toggle(\"hidden\");\r\n document.querySelector(\".glass\").dataset.lat = null;\r\n document.querySelector(\".glass\").dataset.lng = null;\r\n app.resetModalFields();\r\n }", "function doModalContact() {\n\tcustomModalBox.htmlBox('yt-ContactContent', '', 'Contact'); \n\t$('mb_close_link').addEvent('click', function() {\n\t\t$('yt-ContactContent').injectInside(document.forms[0]);\n\t});\n}", "function show_modal(modal) {\n modal.classList.toggle('inactive');\n}", "function toggleModal() {\n modal.classList.toggle(\"show-modal\");\n }", "function closefeesModal2() {\n document.getElementById('fees-pop-screen').style.display='none';\n}", "function openModal() {\n setQuesFlag(false);\n setIsModalVisible(true); \n }", "function closeModal () {\n //chnge the display value to none\n modal.style.display = 'none';\n}", "toggleModal() {\n\n this.colorChanged = false\n\n if(this.modal.hasAttribute('active')) {\n this.modal.removeAttribute('active') \n }\n else {\n this.modal.setAttribute('active', '')\n }\n }", "function hideCreatePostModal(){\r\n var modal = document.getElementById(\"create-post-modal\");\r\n modal.style.display = \"none\";\r\n }", "function disableTalkinPersonPopup(){\n\tif(popupStatus==1){\n\t\t$(\"#backgroundTalkinPersonPopup\").fadeOut(\"slow\");\n\t\t$(\"#popupTalkinPerson\").fadeOut(\"slow\");\n\t\tpopupStatus = 0;\n\t}\n}", "function hideModal() {\n const element = document.getElementById('modal');\n element.classList.remove('is-active');\n document.getElementsByTagName('body')[0].classList.remove('is-clipped');\n}", "function closeBfModal(){\n butterFinger.style.display = 'none';\n }", "function openContact() {\n document.getElementById(\"page-contact\").style.display = \"block\";\n document.getElementById(\"navigation\").style.display = \"none\";\n document.getElementById(\"header-logo\").style.display = \"none\";\n document.getElementById(\"footer\").style.display = \"none\";\n}", "function modalOnOff() {\n btnModal\n .classList\n .toggle(\"hide\") \n \n todoList\n .classList\n .toggle(\"hide\")\n}", "function toggleContact() {\n\ttoggleAnalyserPanel('contact');\n}", "function closeModal() {\n \tMODAL.style.display = 'none';\n \tRESET();\n }", "function closeModal(){\r\n modal.style.display = 'none';\r\n }", "function modalHidden(){\n\t\trestoreTabindex();\n\t\ttdc.Grd.Modal.isVisible=false;\n\t}", "function openContactModal() {\n var parentModalContact = document.querySelector('.modal-parent-contact');\n var parentModalSignup = document.querySelector('.modal-parent-signup');\n var parentModalSignin = document.getElementsByClassName('modal-parent-signin')[0];\n \n parentModalContact.style.display = 'block';\n\n //closing sidenav when contact is clicked\n sidenavParent.style.width = '0';\n sideNav.style.width = '0';\n iconBarButton.style.display = 'block';\n\n parentModalSignup.style.display = 'none';\n parentModalSignin.style.display = 'none';\n\n document.body.scrollTop = 0; //For Safari\n document.documentElement.scrollTop = 0; // For Chrome, Firefox, IE and Opera\n\n \n}", "function showModal() {\n setVisible(true);\n setSignUp(false);\n }", "function closeModal(){\r\n modal.style.display = 'none';\r\n}", "function closeMessageModal(){\n messageModal.style.display = \"none\";\n}", "function hideCreatePostModal() {\n var modal = document.getElementById(\"create-post-modal\");\n modal.style.display = \"none\";\n}", "function hideModal(modal){\n modal.className = \"Modal is-hidden\";\n app_container.className = \"\";\n}", "function CloseModal(type_alrt) {\n document.getElementById(\"myModal\").style.display = \"none\";\n document.getElementById(\"errorMesg\").classList.remove(\"modal-content1\");\n document.getElementById(\"errorMesg\").style.fontSize = '20px';\n\n\n //-------- notify modal\n if (type_alrt == \"notify_modal\") {\n document.getElementById(\"alert_modal\").style.display = \"none\";\n document.getElementById(\"errorMesg\").classList.remove(\"modal-content1\");\n\n }\n}", "function hideModalFun() {\n loginModal.style.display = \"none\";\n}", "function toggleModal() {\n const modal = document.querySelector('.modal');\n modal.classList.toggle('hide');\n}", "function closeForwardMsgModal() {\n var modalParentForwardMsg = document.getElementsByClassName('modal-parent-forward-msg')[0];\n modalParentForwardMsg.style.display = 'none';\n \n}", "function hideModal() {\n //var $modalContainer = document.querySelector('#modal-container');\n $modalContainer.removeClass('is-visible');\n $modalContainer.text('');\n}", "function closeModal() {\n modal.style.display = 'none';\n }", "function closeModal() {\n modal.style.display = 'none';\n }", "function closeModal() {\n modal.style.display = 'none';\n }", "function closeModal(){\n modal.style.display = 'none';\n }", "function toggleAboutUsModal(){\n document.getElementById(\"about-us\").classList.toggle(\"is-active\");\n}", "function closeModal() {\n $(\".mask\").removeClass(\"active-modal\");\n}", "function closePostClick() {\n var modalPost = document.getElementById(\"modal-post\");\n modalPost.style.display = \"none\";\n}", "function openModal() {\n modal.style.display = 'block'; \n noscroll();\n}", "function closeModal() {\n resetGame();\n modal = document.querySelector('.overlay');\n modal.classList.remove(\"show\");\n}", "function closePhotoModal() {\n document.getElementById('photo-modal').style.display = \"none\";\n}", "function closeModal() {\r\n modal.style.display = \"none\";\r\n}", "function closeModal() {\n\n // modal.style.display = \"none\";\n modal.classList.toggle(\"modalVisible\");\n}", "function closeModal() {\r\n modal.style.display = 'none';\r\n}", "function closeModal()\n\n{\n Modal.style.display = \"none\";\n}", "function hideModalBox() {\n deleteIncidentModal.style.display = \"none\";\n}", "function hide() {\n // Remove background\n bg.remove();\n // Remove modal\n modal.style.display = \"none\";\n}", "function _hideBlanket() {\n if (settings.modal == true) {\n $(\"#pageslide-blanket\").animate({ opacity: '0.0' }, 'fast', 'visible', function () {\n $(this).toggle();\n });\n }\n }", "function closeModal() {\n document.getElementById(\"main\").className = \"hidden\"\n}", "function closeModal () {\n modal.style.display = 'none';\n }", "function hideModal(modal) {\n $(\"#flex-overlay\").css({\n 'display': 'none',\n opacity: 0\n });\n\n if (typeof modal == 'string')\n modal = $(modal);\n\n modal.css({\n \"display\": \"none\"\n })\n }", "function openContactForm() {\n var contactForm = document.getElementById(\"myModal\")\n contactForm.style.display = \"block\";\n}", "function closeModal(){\n modal.style.display = 'none';\n}", "function closeModal(){\n modal.style.display = 'none';\n}", "function closeModal(){\n modal.style.display = 'none';\n}", "function closeModal(){\n modal.style.display = \"none\";\n}", "function closeModal(){\n modal.style.display = \"none\";\n}", "function toggleModalOn(){\n var modalWindow = document.querySelector('.modal')\n modalWindow.style.display = 'inherit'\n modalMovesStats();\n modalStarsStats();\n modalTimerStats();\n }", "function closeModal() {\n modal.style.display = \"none\";\n}", "function closeModal() {\n modal.style.display = \"none\";\n}", "function disappearPost() {\n if (document.getElementById(\"modal2\").style.display == \"\") {\n document.getElementById(\"modal2\").style.display = \"none\";\n }else{\n document.getElementById(\"modal2\").style.display = \"\";\n }\n }", "function onHiddenBsModal() {\n isModalInTransitionToHide = false;\n isModalVisible = false;\n }", "function closeModal(){\n modal.style.display = 'none';\n}", "function closeModal(){\n modal.style.display = 'none'; \n}", "function hideModal() {\n //var $modalContainer = document.querySelector('#modal-container');\n $modalContainer.classList.remove('is-visible');\n $modalContainer.innerHTML = \"\"\n}", "function showModal()\n{\n\tdocument.getElementById('modal-backdrop').classList.toggle('hidden');\n\tif(document.getElementById('leave-comment-modal')) {\n\t\tdocument.getElementById('leave-comment-modal').classList.toggle('hidden');\n\t}\n\tif(document.getElementById('create-location-modal')) {\n\t\tdocument.getElementById('create-location-modal').classList.toggle('hidden');\n\t}\n}", "function hid() {\n // Hides the modal when user click on the 'No' button\n var btn = document.getElementsByClassName('modal')[2];\n btn.style.display = \"none\";\n\n}", "function closeModal() {\n modal.style.display = 'none';\n document.getElementById('play-modal').style.display = 'none';\n document.getElementById('edit-modal').style.display = 'none';\n document.getElementById('delete-modal').style.display = 'none';\n}", "function closeModal () {\n modal.style.display = 'none'\n}", "function closeOptionModal() {\r\n document.getElementById('option-modal').style.display = \"none\"\r\n}", "function closeOptionModal() {\r\n document.getElementById('option-modal').style.display = \"none\"\r\n}", "function closecoursModal2() {\n document.getElementById('cours-pop-screen').style.display='none';\n}" ]
[ "0.7456289", "0.7248915", "0.71650547", "0.70707536", "0.69418395", "0.6911236", "0.68737406", "0.6826984", "0.67984414", "0.6797028", "0.67603946", "0.6719777", "0.6713316", "0.671285", "0.67083853", "0.66478986", "0.66270685", "0.6606114", "0.65982765", "0.65663403", "0.6565825", "0.6558811", "0.6531294", "0.6527771", "0.6511491", "0.6510088", "0.6503097", "0.6497396", "0.64863455", "0.6480684", "0.6467871", "0.6465804", "0.6460307", "0.6444595", "0.6437562", "0.64304", "0.64241093", "0.6423114", "0.6421131", "0.64201385", "0.6411788", "0.64110154", "0.6410652", "0.6406735", "0.64067346", "0.6403527", "0.6399322", "0.63974917", "0.6389135", "0.63868105", "0.63753295", "0.63685", "0.6366235", "0.6362688", "0.63615495", "0.63577515", "0.6353879", "0.6345128", "0.6343809", "0.6341873", "0.63411546", "0.63411546", "0.63411546", "0.6333745", "0.6333615", "0.6329276", "0.63264996", "0.63261765", "0.6322956", "0.63219583", "0.6311803", "0.63079995", "0.6307907", "0.6307336", "0.6304482", "0.6303196", "0.63028276", "0.6296991", "0.629508", "0.6294727", "0.6293738", "0.62887174", "0.62887174", "0.62887174", "0.62818855", "0.62818855", "0.628182", "0.6279197", "0.6279197", "0.6276723", "0.6276307", "0.62757325", "0.627504", "0.6274926", "0.62738806", "0.62683904", "0.62680113", "0.62673485", "0.62672627", "0.62672627", "0.62656546" ]
0.0
-1
This function is unused. I wrote it to solve part 1, but later decided on a Regex approach for part 2 and adapted it for part 1 too.
function evalRule(ruleNum){ let reqRule = rules.get(ruleNum); if (reqRule.every(isNaN) && reqRule.find(e => e == '|') == undefined){return reqRule}; reqRule = reqRule.map(value => { if (isNaN(value)){ return value; } else { return evalRule(value); }; }); let orIndex = reqRule.findIndex(e => e == '|'); if (orIndex != -1){ if (orIndex == 2){ reqRule.splice(0, 2, cartesian(reqRule[0], reqRule[1])); } orIndex = reqRule.findIndex(e => e == '|'); if (reqRule.length - orIndex == 3){ reqRule.splice(orIndex+1, 2, cartesian(reqRule[orIndex+1], reqRule[orIndex+2])); } orIndex = reqRule.findIndex(e => e == '|'); } if (orIndex == -1){ reqRule = cartesian(...reqRule) } if (orIndex == 1 && reqRule.length == 3){ reqRule.splice(1,1) reqRule = reqRule.flat() } rules.set(ruleNum, reqRule); return reqRule }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function afterDotOptional(str) {\n\t\tind = str.indexOf(\"0\\\\s*1\\\\s*p\\\\s*e\\\\s*r\\\\s*c\\\\s*e\\\\s*n\\\\s*t\\\\s*o\\\\s*f\\\\s*z\\\\s*i\\\\s*n\\\\s*c\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*d\\\\s*e\\\\s*c\\\\s*i\\\\s*t\\\\s*e\\\\s*x\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"2\\\\s*d\\\\s*e\\\\s*c\\\\s*i\\\\s*t\\\\s*e\\\\s*x\\\\s*p\\\\s*e\\\\s*r\\\\s*f\\\\s*i\\\\s*l\\\\s*a\\\\s*m\\\\s*e\\\\s*n\\\\s*t\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"l\\\\s*i\\\\s*t\\\\s*e\\\\s*r\\\\s*s\\\\s*p\\\\s*r\\\\s*o\\\\s*v\\\\s*i\\\\s*d\\\\s*e\\\\s*d\\\\s*f\\\\s*o\\\\s*r\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"0\\\\s*5\\\\s*m\\\\s*i\\\\s*c\\\\s*r\\\\s*o\\\\s*n\\\\s*s\\\\s*a\\\\s*n\\\\s*d\\\\s*w\\\\s*i\\\\s*t\\\\s*h\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*5\\\\s*m\\\\s*i\\\\s*c\\\\s*r\\\\s*o\\\\s*n\\\\s*s\\\\s*d\\\\s*i\\\\s*a\\\\s*m\\\\s*e\\\\s*t\\\\s*e\\\\s*r\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*5\\\\s*m\\\\s*i\\\\s*c\\\\s*r\\\\s*o\\\\s*n\\\\s*s\\\\s*w\\\\s*h\\\\s*i\\\\s*c\\\\s*h\\\\s*r\\\\s*e\\\\s*t\\\\s*a\\\\s*i\\\\s*n\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*5\\\\s*m\\\\s*i\\\\s*c\\\\s*r\\\\s*o\\\\s*n\\\\s*s\\\\s*o\\\\s*r\\\\s*l\\\\s*e\\\\s*s\\\\s*s\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"5\\\\s*9\\\\s*m\\\\s*m\\\\s*t\\\\s*o\\\\s*3\\\\s*5\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"m\\\\s*m\\\\s*p\\\\s*r\\\\s*o\\\\s*v\\\\s*i\\\\s*d\\\\s*e\\\\s*d\\\\s*f\\\\s*o\\\\s*r\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"c\\\\s*m\\\\s*o\\\\s*r\\\\s*m\\\\s*o\\\\s*r\\\\s*e\\\\s*i\\\\s*n\\\\s*d\\\\s*i\\\\s*a\\\\s*m\\\\s*e\\\\s*t\\\\s*e\\\\s*r\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"4\\\\s*0\\\\s*m\\\\s*m\\\\s*o\\\\s*r\\\\s*m\\\\s*o\\\\s*r\\\\s*e\\\\s*b\\\\s*u\\\\s*t\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"6\\\\s*5\\\\s*m\\\\s*m\\\\s*i\\\\s*n\\\\s*t\\\\s*h\\\\s*i\\\\s*c\\\\s*k\\\\s*n\\\\s*e\\\\s*s\\\\s*s\\\\s*p\\\\s*r\\\\s*e\\\\s*d\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"0\\\\s*7\\\\s*5\\\\s*m\\\\s*m\\\\s*t\\\\s*o\\\\s*1\\\\s*5\\\\s*0\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*5\\\\s*0\\\\s*m\\\\s*m\\\\s*d\\\\s*r\\\\s*i\\\\s*e\\\\s*d\\\\s*t\\\\s*o\\\\s*a\\\\s*m\\\\s*o\\\\s*i\\\\s*s\\\\s*t\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*a\\\\s*n\\\\s*d\\\\s*i\\\\s*n\\\\s*s\\\\s*e\\\\s*r\\\\s*t\\\\s*i\\\\s*n\\\\s*g\\\\s*f\\\\s*r\\\\s*e\\\\s*e\\\\s*a\\\\s*n\\\\s*d\\\\s*c\\\\s*b\\\\s*y\\\\s*s\\\\s*t\\\\s*r\\\\s*i\\\\s*k\\\\s*i\\\\s*n\\\\s*g\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind-3) + \"?\\\\s*1\\\\s*5?\" + str.substr(ind+1,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"1\\\\s*a\\\\s*n\\\\s*d\\\\s*i\\\\s*n\\\\s*s\\\\s*e\\\\s*r\\\\s*t\\\\s*i\\\\s*n\\\\s*g\\\\s*f\\\\s*r\\\\s*e\\\\s*e\\\\s*a\\\\s*n\\\\s*d\\\\s*3\\\\s*b\\\\s*y\\\\s*s\\\\s*t\\\\s*r\\\\s*i\\\\s*k\\\\s*i\\\\s*n\\\\s*g\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind-3) + \"?\\\\s*4?\\\\s*1\\\\s*5?\" + str.substr(ind+1,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"9\\\\s*9\\\\s*p\\\\s*e\\\\s*r\\\\s*c\\\\s*e\\\\s*n\\\\s*t\\\\s*9\\\\s*h\\\\s*e\\\\s*a\\\\s*d\\\\s*i\\\\s*n\\\\s*g\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"9\\\\s*9\\\\s*p\\\\s*e\\\\s*r\\\\s*c\\\\s*e\\\\s*n\\\\s*t\\\\s*a\\\\s*i\\\\s*n\\\\s*g\\\\s*e\\\\s*n\\\\s*e\\\\s*r\\\\s*a\\\\s*l\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"i\\\\s*n\\\\s*t\\\\s*h\\\\s*e\\\\s*c\\\\s*o\\\\s*l\\\\s*u\\\\s*m\\\\s*n\\\\s*1\\\\s*g\\\\s*e\\\\s*n\\\\s*e\\\\s*r\\\\s*a\\\\s*l\\\\s*r\\\\s*a\\\\s*t\\\\s*e\\\\s*o\\\\s*f\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"a\\\\s*n\\\\s*d\\\\s*i\\\\s*n\\\\s*s\\\\s*e\\\\s*r\\\\s*t\\\\s*i\\\\s*n\\\\s*g\\\\s*1\\\\s*3\\\\s*3\\\\s*4\\\\s*a\\\\s*n\\\\s*d\\\\s*2\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"64andbbystrikingthedate\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"inthecolumn1generalrateofdutycolumnandinserting1334\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"a\\\\s*n\\\\s*d\\\\s*b\\\\s*b\\\\s*y\\\\s*s\\\\s*t\\\\s*r\\\\s*i\\\\s*k\\\\s*i\\\\s*n\\\\s*g\");\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"64and2bystriking12312009\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"certainacelectricmotorsofanoutputexceeding74\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind + \"certainacelectricmotorsofanoutputexceeding74\".split(\"\").join(\"\\\\s*\").length) + \"\\\\s*\\\\d?\" + str.substr(ind + \"certainacelectricmotorsofanoutputexceeding74\".split(\"\").join(\"\\\\s*\").length, str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"25percentagepoints\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\tind = str.indexOf(\"75percentagepoints\".split(\"\").join(\"\\\\s*\"));\n\t\tif (ind != -1) {\n\t\t\tstr = str.substr(0,ind) + \"\\\\d?\\\\s*\" + str.substr(ind,str.length);\n\t\t\tind = -1;\n\t\t}\n\t\treturn str;\n\t}", "function fullMatch(str) {\n let re = new RegExp(/^([A-Z0-9]+([-_\\.]?[A-Z0-9]+)*)+(@|_at_)([A-Z0-9]+((\\.)?[A-Z0-9]+)*)+(\\.|_dot_)(co\\.nz|com\\.au|co\\.uk|com|co\\.us|co\\.ca)$/ig);\n let error_message = \"\";\n\n if (re.test(str)) {\n // Replace all _at_ and _dot_ instances + convert to lowercase, nice.\n return str.replace(/_at_/, '@').replace(/_dot_/, '.').toLowerCase() + \"\\n\";\n // or result = str.replace(/_at_/, '@').replace(/_dot_/, '.').toLowerCase() + \"\\n\";\n // and return the string at the end with an empty error message\n } else { // there is an error unless the domain is in numerical form\n let splitted = str.split(/(@|_at_)/); // split at the @ symbol\n let mailbox = splitted[0];\n let atSymbol = splitted[1];\n let domainAndExt = splitted[2];\n if (!matchMailbox(mailbox)) { // if the mailbox doesn't match\n error_message += \" <- Invalid mailbox\";\n }\n if (!matchAt(str)) { // if there is no @ symbol in the whole string\n // console.log(atSymbol);\n error_message += \" <- Missing @ symbol\";\n } else { // if there is an @ symbol\n\n if (splitted.length > 3) {\n error_message += \" <- Too many @ symbols\"\n }\n // console.log(splitted[0], splitted[1], splitted[2]);\n /*\n if (!matchDomain(splitted[2])) { // if the domain doesn't match alphanumerically\n if (!isNumericalDomain(splitted[2])) { // if the domain doesn't match numerically\n error_message += \" <- Invalid domain\"; // print the error message if the domain is invalid for both domain formats\n }\n } else { // if the domain does match alphanumerically\n if (!matchExt(str)) {\n error_message += \" <- Invalid extension\";\n }\n }\n */\n if (!matchDomainAndExt(domainAndExt)) {\n let domainAndExtSplit = domainAndExt.split(/(co\\.nz|com\\.au|co\\.uk|com|co\\.us|co\\.ca)/);\n let domain = domainAndExtSplit[0];\n let ext = domainAndExtSplit[1];\n //console.log(domain);\n //console.log(ext);\n if (!matchDomain(domain) && ext !== undefined) {\n if (!isNumericalDomain(domainAndExt)) {\n error_message += \" <- Invalid domain\";\n }\n } else {\n if (!matchExt(str) && !isNumericalDomain(domainAndExt)) {\n error_message += \" <- Invalid extension\";\n }\n }\n }\n }\n }\n // currently returns the accumulated issues unless an @ symbol is missing,\n // in which case, only the missing @ error messsage is returned\n return str + error_message + \"\\n\";\n}", "function _ep_str_matches(str) {\n var matches = str.match(/(s\\d+e\\d+)p0*(\\d+)/i);\n if(matches != null)\n return matches;\n //try to do looser matches\n matches = str.match(/(s(eason)? ?\\d+ ?ep? ?\\d+)/i);\n if(matches == null) return null;\n //match part x of y and stuff\n var temp = str.match(/(\\(| )(part )?0*(\\d+)((\\/| of )\\d+)?/gi);\n if(temp == null || temp.length == 0) return null;\n var last_nums = temp[temp.length - 1];\n if(last_nums == undefined) return null; //? this happened..\n temp = last_nums.match(/0*(\\d+)/);\n if(temp == null) return null;\n matches[2] = temp[1];\n return matches;\n}", "function processMaybeMarkers(s){return s.replace(MAYBE_REGEXP,function(m0,m1){if(m1.match(/[1-9]/)){// any non-zero numeric characters?\nreturn m1;}else{return'';}});}// Misc Utils", "function fixCandidateDates(BadlyFormattedDate) {\n var regEx = BadlyFormattedDate.replace(/\\-/g, '++');\n // console.log('this is regex', regEx);\n regEx = regEx.replace(/\\//g, '++')\n // console.log('this is regex2', regEx);\n\n var storage = [];\n var results = '';\n for(var i = 2; i >= 0; i--) {\n var temp = regEx.split('++');\n storage.push(temp[i]);\n // console.log(storage);\n } \n results = storage[1] + '-' + storage[0] + '-' + storage[2];\n console.log('results from fixCandidateDates', results)\n return results;\n}", "function FormatPhoneNumber(val)\n{\n if ((val.length == 0) || (val.charAt(0) == \"0\"))\n\t return val;\n \t \n var ext = \"\";\n var temp = val;\n var vTempExt = \"\";\n var extFound = false;\n var isInter = false;\n var extAtBegin = false;\n var i = -1;\n if (val.charAt(0) == \"+\")\n {\n isInter = true; \n }\n \n val.replace(\"/\\D+/g.\", \"\");\n i = val.indexOf(\"ext\");\n if (i > -1)\n {\n ext = val.substring(i);\n temp = val.substring(0, value.length - ext.length)\n vTempExt = ext.substring(3, ext.length);\n ext = val.substring(i, 3);\n extFound = true;\n \n if(i == 2)\n {\n extAtBegin = true;\n }\n }\n else\n {\n i = findToken(val,\"x\"); //val.indexOf(\"x\");\n if (i > -1)\n {\n \n ext = val.substring(i);\n vTempExt = ext.substring(1, ext.length);\n j = findToken(vTempExt,\"x\");// vTempExt.indexOf(\"x\");\n if (j > -1)\n {\n extFound = false;\n ext = \"\";\n i = -1;\n }\n else\n {\n temp = val.substring(0, val.length - ext.length)\n ext = \"x\";\n extFound = true;\n \n }\n if(i == 0)\n {\n extAtBegin = true;\n } \n } \n }\n\n if (extFound) \n {\n\t\t\n\t\tif (vTempExt.length >= 1) \n\t\t{\n\t\t\tif (containsAlphaChar(vTempExt))\n\t\t\t{\n\t\t\t ext = ext + convertPhoneLetters(vTempExt);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t ext = ext + vTempExt;\t\t\t \n\t\t\t}\n\t }\n }\n if(extAtBegin)\n {\n return ext;\n \n }\n else\n {\n val = convertPhoneLetters(temp);\n \n var result = val;\n if (val.length == 10)\n {\n result = \"(\" + val.substr(0,3) + \") \" + val.substr(3,3) + \"-\" + val.substr(6,4);\n }\n if (val.length == 7)\n {\n result = val.substr(0,3) + \"-\" + val.substr(3,4);\n } \n \n return result + ext;\n }\n}", "function notBad(str)\n {\n var returnString;\n if ( (str.indexOf('not') > 0) && (str.indexOf('bad') > str.indexOf('not')) )\n {\n var splitString1 = str.slice(0,str.indexOf('not'));\n var splitString2 = str.slice((str.indexOf('bad')+3),str.length);\n returnString = splitString1 + \"good\" + splitString2;\n }\n else\n {\n returnString = str;\n }\n console.log(\"String before notBad conversion: \", str);\n console.log(\"notBad converted string: \", returnString);\n return returnString;\n }", "function sc_pregexpMatch(re, s) {\n var reg = (re instanceof RegExp) ? re : sc_pregexp(re);\n var tmp = reg.exec(sc_string2jsstring(s));\n\n if (tmp == null) return false;\n\n var res = null;\n for (var i = tmp.length-1; i >= 0; i--) {\n\tif (tmp[i] !== null) {\n\t res = sc_cons(sc_jsstring2string(tmp[i]), res);\n\t} else {\n\t res = sc_cons(false, res);\n\t}\n }\n return res;\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 }", "transform ($input) {\n return String ($input).length > 0 ? new RegExp ($input, 'i') : undefined;\n }", "function reg2(s) {\n let good = s.split(`\\n`).filter( e => {\n let pair = /(..)(?:.*)\\1/g.test(e);\n let repeat = /(.)(?:.)\\1/g.test(e);\n return pair && repeat;\n }).length;\n console.log(good);\n}", "function GoodToBad (needle, haystack, css) {\r\n\r\n\tvar x = haystack.split(' '), nullStart = 0, nullWeds=[], currLen =0, nullIndx = [],\r\n\r\n\tm, z = x.map((r,i) => i != x.length-1 ? `(${r} )?`: `(${r})?`).join(''),\r\n\r\n\tsuppliedInput = needle.split(' ');\r\n\r\n\r\n\tz = new RegExp(`(${z})`,'mgi');\r\n\t\r\n\t// every missing node from the regex indicates wrong input\r\n\twhile ((m = z.exec(needle)) !== null) {\r\n\r\n\t\tif (m.index === z.lastIndex) {\r\n\r\n\t\t\tif (!nullStart) { // check whether we're in null word mode\r\n\t\t\t\tvar u = m.index, current = /(\\w+)/.exec(haystack.substr(u));\r\n\r\n\t\t\t\tif (current !== null && current.length) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tnullStart = current[0].length;\r\n\t\t\t\t\r\n\t\t\t\t\tnullWeds.push({start: u, end: nullStart+u});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse nullStart--;\r\n\t\t\t\r\n\t\t\tz.lastIndex++;\r\n\t\t}\t\r\n\t}\r\n\r\n\tnullWeds = nullWeds.map(o => haystack.substring(o.start, o.end));\r\nconsole.log(x, suppliedInput/*[o]*/)\r\n\tif (!nullWeds.length && suppliedInput.every((f, d) => new RegExp(f, 'i').test( x[d]))) return 0;\r\n\r\n\telse return x.map((eachWord, o) => {\r\n\r\n\t\tif (!nullWeds.includes(eachWord) || suppliedInput[o] === void(0)) return <Text key={o} style={styles.testText}>{eachWord}</Text>;\r\n\r\n\t\treturn <Text style={[styles.testText, ...css]} key={o}>{eachWord.toUpperCase()}</Text>;\r\n\t});\r\n}", "function strToPoly(str,remove){\n if(typeof remove !== 'undefined') {\n str = str.replace(/\\^/g, '');\n }\n else{\n str = str.replace(/\\s/g, ''); //clear spaces\n str = str.replace(/\\(x\\)/g, '|');\n str = str.replace(/x/g, 'x^');\n str = str.replace(/\\^\\^/g, '^');\n str = str.replace('x\\^\\+', 'x\\^1\\+');\n str = str.replace(/\\+1/g, '\\+x\\^0');\n str = str.replace(/\\|/g, '\\(x\\)');\n //str = str.replace(/x\\^0/g, '1');\n\n if(str.substr(str.length-4) === '+x^1'){\n //console.log('str before) = '+str);\n //str = str.replace(/\\+x\\^1/g, ' + x');\n //console.log('str before) = '+str);\n }\n\n //str = str.replace(/x\\^1\\+/g, 'x+');\n }\n return str;\n}", "function prepare_param(param){\n var sub = param.substring(1),\n group = sub.match(/.{1,2}/g);\n\n return group;\n }", "function UnescapeSpecialChars(text) {\n\ntext = text.replace(/7f8137798425a7fed2b8c5703b70d078/gm, \"\\\\\")\ntext = text.replace(/833344d5e1432da82ef02e1301477ce8/gm, \"`\")\ntext = text.replace(/3389dae361af79b04c9c8e7057f60cc6/gm, \"*\")\ntext = text.replace(/b14a7b8059d9c055954c92674ce60032/gm, \"_\")\ntext = text.replace(/f95b70fdc3088560732a5ac135644506/gm, \"{\")\ntext = text.replace(/cbb184dd8e05c9709e5dcaedaa0495cf/gm, \"}\")\ntext = text.replace(/815417267f76f6f460a4a61f9db75fdb/gm, \"[\")\ntext = text.replace(/0fbd1776e1ad22c59a7080d35c7fd4db/gm, \"]\")\ntext = text.replace(/84c40473414caf2ed4a7b1283e48bbf4/gm, \"(\")\ntext = text.replace(/9371d7a2e3ae86a00aab4771e39d255d/gm, \")\")\ntext = text.replace(/01abfc750a0c942167651c40d088531d/gm, \"#\")\ntext = text.replace(/5058f1af8388633f609cadb75a75dc9d/gm, \".\")\ntext = text.replace(/9033e0e305f247c0c3c80d0c7848c8b3/gm, \"!\")\ntext = text.replace(/853ae90f0351324bd73ea615e6487517/gm, \":\")\nreturn text;\n}", "function Regexp() {}", "function postcode_reformat(postcode) {\r\n // strip + sign from postcode string & convert to uppercase\r\n postcode = postcode.replace(/\\+/g, ''); \t\r\n var regExp1 = /^([a-zA-Z]){1}([0-9][0-9]|[0-9]|[a-zA-Z][0-9][a-zA-Z]|[a-zA-Z][0-9][0-9]|[a-zA-Z][0-9]){1}([ ])([0-9][a-zA-z][a-zA-z]){1}$/;\r\n \r\n if(regExp1.test(postcode) === false)\t\r\n {\t \r\n\t var regExp2 = /^([A-Z]{1,2}[\\dA-Z]{1,2})[ ]?(\\d[A-Z]{2})$/i; // case insensitive \r\n\r\n\t var tempPostCode = postcode.match(regExp2);\r\n\t try {\r\n\t\t var reformatPostcode = tempPostCode[1] + \" \" + tempPostCode[2];\r\n\t\t return reformatPostcode.toUpperCase();\r\n } \r\n \r\n\t catch ( e ) {\r\n\t\t\tpostcode = \"error\";\r\n\t\t\treturn postcode;\r\n\t }\r\n\t \r\n }\r\n else {\r\n\t // postcode formatted correctly\r\n\t return postcode.toUpperCase();\r\n }\t \t\r\n}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function smallestSubstringWithallChara(str, pattern) {\n let end = 0;\n let start = 0;\n const charaMap = {};\n let match = 0;\n let resultChara = ''\n let maxLength = 0;\n\n for(let i = 0; i < pattern.length; i++) {\n if (!charaMap[pattern[i]]) charaMap[pattern[i]] = 0;\n charaMap[pattern[i]] += 1;\n }\n\n while (end < str.length) {\n const endChara = str[end];\n if (endChara in charaMap) {\n if (charaMap[endChara]) {\n charaMap[endChara] -= 1;\n if (charaMap[endChara] >= 0) match += 1;\n }\n\n if (match === Object.key(charaMap).length) {\n if (minLength > end - start + 1) {\n minLength = end - start + 1;\n resultChara = str.substring(start, start + minLength);\n };\n let startChara = str[start];\n while(!charaMap[startChara]) {\n if (startChara in charaMap) {\n charaMap[startChara] += 1;\n match -= 1;\n }\n start += 1;\n startChara = str[start];\n }\n if (charaMap[startChara]) {\n end = start;\n continue;\n }\n }\n \n }\n end += 1;\n }\n return resultChara;\n}", "function run_test() {\n var i;\n\n var parser = Components.classes[\"@mozilla.org/messenger/headerparser;1\"]\n .getService(Components.interfaces.nsIMsgHeaderParser);\n\n // In this array, the sub arrays consist of the following elements:\n // 0: input string\n // 1: expected output from extractHeaderAddressMailboxes\n // 2: expected output from extractHeaderAddressNames\n // 3: expected output from extractHeaderAddressName\n const checks =\n [\n [\"[email protected]\",\n \"[email protected]\",\n \"[email protected]\",\n \"[email protected]\" ],\n [\"foo <[email protected]>\",\n \"[email protected]\",\n \"foo\",\n \"foo\" ],\n [\"[email protected], foo <[email protected]>\",\n \"[email protected], [email protected]\",\n \"[email protected], foo\",\n \"[email protected]\" ],\n [\"foo bar <[email protected]>\",\n \"[email protected]\",\n \"foo bar\",\n \"foo bar\" ],\n [\"foo bar <[email protected]>, [email protected], foo <[email protected]>\",\n \"[email protected], [email protected], [email protected]\",\n \"foo bar, [email protected], foo\",\n \"foo bar\" ],\n // UTF-8 names\n [\"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>\",\n \"[email protected], [email protected]\",\n \"foo\\u00D0 bar, \\u00F6foo\",\n \"foo\\u00D0 bar\" ],\n // More complicated examples drawn from RFC 2822\n [\"\\\"Joe Q. Public\\\" <[email protected]>,Test <\\\"abc!x.yz\\\"@invalid.com>, Test <test@[xyz!]>,\\\"Giant; \\\\\\\"Big\\\\\\\" Box\\\" <[email protected]>\",\n \"[email protected], \\\"abc!x.yz\\\"@invalid.com, test@[xyz!], [email protected]\",\n \"\\\"Joe Q. Public\\\", Test, Test, \\\"Giant; \\\\\\\"Big\\\\\\\" Box\\\"\",\n // extractHeaderAddressName returns unquoted names, hence the difference.\n \"Joe Q. Public\" ],\n ];\n\n // Test - empty strings\n\n do_check_eq(parser.extractHeaderAddressMailboxes(\"\"), \"\");\n do_check_eq(parser.extractHeaderAddressNames(\"\"), \"\");\n do_check_eq(parser.extractHeaderAddressName(\"\"), \"\");\n\n // Test - extractHeaderAddressMailboxes\n\n for (i = 0; i < checks.length; ++i) {\n do_check_eq(parser.extractHeaderAddressMailboxes(checks[i][0]), checks[i][1]);\n do_check_eq(parser.extractHeaderAddressNames(checks[i][0]), checks[i][2]);\n do_check_eq(parser.extractHeaderAddressName(checks[i][0]), checks[i][3]);\n }\n}", "function findDuplicateCharacters(input) {\n}", "function cleanUpString(strSpecials) \n{\n strSpecials = stripString(strSpecials, \"%20\", \" \");\n strSpecials = stripString(strSpecials, \"%22\", \"\\\"\");\n strSpecials = stripString(strSpecials, \"%29\", \")\");\n strSpecials = stripString(strSpecials, \"%28\", \"(\");\n strSpecials = stripString(strSpecials, \"%2C\", \",\");\n\n\n var inParens = 0;\n for (var i = 0; i < strSpecials.length; i++)\n {\n if (strSpecials[i]==\"(\")\n inParens++;\n if (strSpecials[i]==\")\")\n inParens--;\n \n if ((inParens > 0) && (strSpecials[i]==\",\"))\n {\n var post = strSpecials.slice(i); \n strSpecials = strSpecials.replace(post,\"\") ;\n post = post.replace(\",\",\" \");\n\n strSpecials = strSpecials + post;\n }\n \n }\n \n\n strSpecials = stripString(strSpecials, \"%3C\", \"<\");\n strSpecials = stripString(strSpecials, \"%3E\", \">\");\n strSpecials = stripString(strSpecials, \"%23\", \"#\");\n strSpecials = stripString(strSpecials, \"%3A\", \":\");\n strSpecials = stripString(strSpecials, \"%3B\", \",\");\n strSpecials = stripString(strSpecials, \"%3D\", \"=\");\n \n strSpecials = stripString(strSpecials, \"</strong>\", \"\");\n strSpecials = stripString(strSpecials, \"<strong>\", \"\");\n strSpecials = stripString(strSpecials, \"</em>\", \"\");\n strSpecials = stripString(strSpecials, \"<em>\", \"\");\n strSpecials = stripString(strSpecials, \"%u2013\", \"-\");\n strSpecials = stripStringRegEx(strSpecials, \"<b\", \">\");\n strSpecials = stripString(strSpecials, \"</b>\", \"\");\n strSpecials = stripStringRegEx(strSpecials, \"<h\", \">\");\n strSpecials = stripStringRegEx(strSpecials, \"</h\", \">\");\n \n strSpecials = stripString(strSpecials, \"</a>\", \"\"); \n \n \n strSpecials = stripStringRegEx(strSpecials, \"<t\", \">\");\n strSpecials = stripStringRegEx(strSpecials, \"</t\", \">\");\n \n \n while (strSpecials.search(/%../) != -1) {\n strSpecials = strSpecials.replace(/%../, \"\");\n }\n \n \n\n return strSpecials;\n}", "step4 (word) {\n let result = word\n\n if (result.match(/[bcdfghjklmnpqrstvwxz](aa|ee|oo|uu)[bcdfghjklmnpqrstvwxz]$/)) {\n result = result.substr(0, result.length - 2) + result[result.length - 1]\n }\n\n if (DEBUG) {\n console.log('step4: ' + result)\n }\n return result\n }", "manipulateString() {\n let myArray = Array.from(gatherInput().toLowerCase(), x => {\n switch (x) {\n case 'a':\n return 1\n break;\n case 'b':\n return 2\n break;\n case 'c':\n return 3\n break;\n case 'd':\n return 4\n break;\n case 'e':\n return 5\n break;\n case 'f':\n return 6\n break;\n case 'g':\n return 7\n break;\n case 'h':\n return 8\n break;\n case 'i':\n return 9\n break;\n case 'j':\n return 10\n break;\n case 'k':\n return 11\n break;\n case 'l':\n return 12\n break;\n case 'm':\n return 13\n break;\n case 'n':\n return 14\n break;\n case 'o':\n return 15\n break;\n case 'p':\n return 16\n break;\n case 'q':\n return 17\n break;\n case 'r':\n return 18\n break;\n case 's':\n return 19\n break;\n case 't':\n return 20\n break;\n case 'u':\n return 21\n break;\n case 'v':\n return 22\n break;\n case 'w':\n return 23\n break;\n case 'x':\n return 24\n break;\n case 'y':\n return 25\n break;\n case 'z':\n return 26\n break;\n case ',':\n return ','\n break;\n case '!':\n return '!'\n break;\n case '?':\n return '?'\n break;\n case '.':\n return '.'\n break;\n case ' ':\n return ' '\n break;\n case 'á':\n return '1(á)'\n break;\n case 'ã':\n return '1(ã)'\n break;\n case 'ó':\n return '15(ó)'\n break;\n case 'õ':\n return '15(õ)'\n break;\n case 'ô':\n return '15ô'\n break;\n case 'é':\n return '5(é)'\n break;\n case 'ê':\n return '5(ê)'\n break;\n case 'ç':\n return '3(ç)'\n break;\n case ',':\n return ','\n break;\n case '0':\n return 'Num(0)'\n break;\n case '1':\n return 'Num(1)'\n break;\n case '2':\n return 'Num(2)'\n break;\n case '3':\n return 'Num(3)'\n break;\n case '4':\n return 'Num(4)'\n break;\n case '5':\n return 'Num(5)'\n break;\n case '6':\n return 'Num(6)'\n break;\n case '7':\n return 'Num(7)'\n break;\n case '8':\n return 'Num(8)'\n break;\n case '9':\n return 'Num(9)'\n break;\n default:\n return 404;\n }\n })\n\n return myArray\n }", "function correct(expr, pattern) {\n while (expr.includes(pattern)) {\n let indMinus = expr.lastIndexOf('-',expr.indexOf(pattern)-1)\n let indPlus = expr.lastIndexOf('+',expr.indexOf(pattern)-1)\n if (indMinus == -1 && indPlus == -1)\n expr = pattern[1] + expr.slice(0,expr.indexOf(pattern)) + pattern[0] + expr.slice(expr.indexOf(pattern)+2)\n if (indMinus > indPlus) \n expr = expr.slice(0,indMinus + 1) + pattern[1] + expr.slice(indMinus + 1, expr.indexOf(pattern)) + pattern[0] +expr.slice(expr.indexOf(pattern)+2) \n if (indPlus > indMinus) \n expr = expr.slice(0,indPlus + 1) + pattern[1] + expr.slice(indPlus + 1, expr.indexOf(pattern)) + pattern[0] +expr.slice(expr.indexOf(pattern)+2)\n }\n return expr\n}", "validate(email) {\n const expression = /(?!.*\\.{2})^([a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+(\\.[a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+)*|\"((([ \\t]*\\r\\n)?[ \\t]+)?([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))*(([ \\t]*\\r\\n)?[ \\t]+)?\")@(([a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|[a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF][a-z\\d\\-._~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]*[a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])\\.)+([a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|[a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF][a-z\\d\\-._~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]*[a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])\\.?$/i;\n\n return expression.test(String(email).toLowerCase());\n }", "validate(email) {\n const expression = /(?!.*\\.{2})^([a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+(\\.[a-z\\d!#$%&'*+\\-\\/=?^_`{|}~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]+)*|\"((([ \\t]*\\r\\n)?[ \\t]+)?([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f\\x21\\x23-\\x5b\\x5d-\\x7e\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))*(([ \\t]*\\r\\n)?[ \\t]+)?\")@(([a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|[a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF][a-z\\d\\-._~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]*[a-z\\d\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])\\.)+([a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]|[a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF][a-z\\d\\-._~\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]*[a-z\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])\\.?$/i;\n\n return expression.test(String(email).toLowerCase());\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))) return this.error(input, start, start)\n var n = end\n end = start+1\n if(end==n) return this.error(input, start, end)\n var str = \"\"\n while(end<n && input.get(end)!=this.quotation){\n if(input.get(end)=='\\\\'){\n end++\n if(end==n) return this.error(input, start, end)\n if(input.get(end)=='u') {\n end++\n var c = 0\n while(end<n && c<4 && Character.isHexa(input.get(end))){\n end++\n c++\n }\n if(c!=4) return this.error(input, start, end)\n str += String.fromCharCode(Number.parseInt(input.substring(end-4,end),16)) \n }else {\n switch(input.get(end)){\n case 'n': str += '\\n'; break;\n case 'r': str += '\\r'; break;\n case 't': str += '\\t'; break;\n case 'b': str += '\\b'; break;\n case 'f': str += '\\f'; break;\n case '\\\\': case '/': str += input.get(end); break;\n default:\n if(input.get(end)!=this.quotation)\n return this.error(input, start, end)\n str += this.quotation\n }\n end++\n }\n }else{\n str += input.get(end)\n end++\n }\n }\n if(end==n) return this.error(input, start, end)\n end++\n return this.token(input, start, end, str)\n }", "function telephoneCheck(str) {\r\n if (!parseInt(str[0],10)){\r\n if (str[0] !== '('){\r\n return false;\r\n }\r\n }\r\n var n= /\\d/g;\r\n var p= /\\d|\\(|\\)/g;\r\n var base = str.match(n).join('');\r\n var par = str.match(p).join('');\r\n var p1 = -1;\r\n var p2 = -1;\r\n console.log(base);\r\n if (base.length === 10){\r\n console.log(\"added 1 to beginning\");\r\n base = \"1\"+base;\r\n par = \"1\"+par;\r\n }\r\n else if(base.length === 11){\r\n if (base[0] !== \"1\"){\r\n console.log(\"invalid country code\");\r\n return false;\r\n }\r\n }\r\n else{\r\n console.log(\"invalid number of digits\");\r\n return false;\r\n }\r\n p1 = par.indexOf('(');\r\n p2 = par.lastIndexOf(')');\r\n if (p1 >= 0 || p2 >= 0){\r\n console.log(\"contains parenthases\");\r\n console.log(par);\r\n if (p1 >= 0 && p2 >= 0){\r\n if(p1 !== 1){\r\n return false;\r\n }\r\n else{\r\n if (p2 !== 5){\r\n return false;\r\n }\r\n }\r\n }\r\n else{\r\n return false;\r\n }\r\n }\r\n return true;\r\n}", "function cleaner(match, p1, p2, p3) {\n if (p1) { return \"\"; }\n if (p2) { return \"\"; }\n if (p3) { return dash; }\n }", "function validIPAddresses(string) {\n let results = [];\n //now let's look through all the possible positions where we can insert a period!\n for (let i = 0; i < Math.min(string.length, 4); i++) {\n let curIP = [\"\", \"\", \"\", \"\"];\n //decide what will be our first part of IP\n curIP[0] = string.slice(0, i); //will give us whatever is before the 1st period we place\n if (!isValidPart(curIP[0])) continue;\n //once we found the place for first period=>found first valid part\n //let's find the next valid parts(the place where to insert the next period) that we can generate\n //with curIP[0]\n //i+1 becase we want to put next period at least one more position from previous and AT MOST 3 positions past i\n for (let j = i + 1; j < i + Math.min(string.length - i, 4); j++) {\n curIP[1] = string.slice(i, j); //we start from index i(after the previous valid part) and j -is where we place the next period\n if (!isValidPart(curIP[1])) continue;\n\n for (let k = j + 1; k < j + Math.min(string.length - j, 4); k++) {\n curIP[2] = string.slice(j, k); //we start from index j after the previous valid part) and untill k -is where we place the next period\n curIP[3] = string.slice(k); // the last 4th part is whatever is left after the third part\n if (isValidPart(curIP[2]) && isValidPart(curIP[3])) {\n results.push(curIP.join(\".\"));\n }\n }\n }\n }\n return results;\n}", "function string(p1) {\n let string = p1.split(\"\")\n let sub = []\n let sub2 = []\n let count = 0\n for (i = 0; i < string.length; i++) {\n if (!sub.includes(string[i]) && count === 2) {\n if (sub2.length < sub.length) {\n sub2 = sub\n }\n count = 0\n sub = []\n let pos = 1\n let start = string[i - 1]\n for (j = i-1; j > 0; j--) {\n if (string[j] == start) {\n pos++\n } else {\n break;\n }\n }\n i = i - pos;\n } else if (sub.includes(string[i])) {\n sub.push(string[i])\n } else if (count < 2) {\n sub.push(string[i])\n count++\n }\n }\n\n return sub2\n}", "function validateText(text) {\n\n if (text.length === 0) {\n return null;\n }\n let firstTextDraft = text.trim();\n\n let secondTextDraft = firstTextDraft.toLowerCase();\n\n for (let i = 0; i < secondTextDraft.length; i++) {\n let code = secondTextDraft.charCodeAt(i);\n\n if ((code < 97 || code > 122) && (code != 46 && code != 44 && code != 32)) {\n console.log(secondTextDraft.charAt(i) + \" \" + code);\n secondTextDraft = secondTextDraft.replace(secondTextDraft.charAt(i), \"\");\n i--;\n }\n }\n if (secondTextDraft.length > 200) {\n secondTextDraft = secondTextDraft.slice(0, 200);\n }\n\n return secondTextDraft;\n}", "function BOT_rawStringExtraction(s) {\r\n\tvar res = s ;\r\n\tres = res.replace(/ +$/g, \"\"); // deletewhitespaces at end\r\n\t\r\n\t// javascript expression following words compute|calculate|evaluate|comp|calc and placed AT END\r\n\tBOT_theReqJavascript = res; \r\n\tres = res.replace(/(.*) (compute|calculate|evaluate|comp|calc) (.*)/g, \"$1 compute\");\r\n\tBOT_theReqJavascript = BOT_theReqJavascript.replace(/(.*) (compute|calculate|evaluate|comp|calc) (.*)/g, \"$3\");\r\n\r\n\t// strong stressers double at end\r\n\tres = res.replace(/(.*)\\!\\!$/g, \"$1 _harsh\");\r\n\tres = res.replace(/(.*)\\?\\?$/g, \"$1 _surprise\");\r\n\tres = res.replace(/(.*)\\*\\*$/g, \"$1 _begging\");\r\n\tres = res.replace(/(.*)\\@\\@$/g, \"$1 _apology\");\r\n\tres = res.replace(/(.*)\\&\\&$/g, \"$1 _counterstatement\");\r\n\t\r\n\t// light stressers single at end\r\n\tres = res.replace(/(.*)\\!$/g, \"$1 _strong\");\r\n\tres = res.replace(/(.*)\\?$/g, \"$1 _interrogation\");\r\n\tres = res.replace(/(.*)\\*$/g, \"$1 please\"); // _please below\r\n\tres = res.replace(/(.*)\\@$/g, \"$1 _sorry\");\r\n\tres = res.replace(/(.*)\\&$/g, \"$1 _irony\");\r\n\t\r\n\tres = \" \"+res+\" \"; ;\r\n\t\r\n\t// please\r\n\tres = res.replace(/(.*)please(.*)/g, \"$1 $2 _please\");\r\n\t\r\n\t// possibility -- TO DO: impossible unavailable\r\n\t/*\r\n\tvar t = [\"can i\",\"is it possible to\",\"is it authorized to\",\"is it authorised to\",\"possible\",\"possibility\", \r\n\t\t\t\"available\",\"availability\",\"authorized\",\"authorised\",\"authorization\",\"authorisation\"];\r\n\r\n\tvar rex;\r\n\tfor (var i in t) {\r\n\t\t\trex = new RegExp(eval(\"/(.*) \" + t[i] + \" (.*)/g\"));\r\n\t\t\tres = res.replace(rex, \"$1 $2 _possibility\");\r\n\t\t}\r\n\tres = res.replace(/^ [\\?p] ?(\\w) (.*)/g, \"$1 $2 _possibility\"); // pa | p a | ?a | ? a at begin \r\n\t\r\n\t// is|are at begin\r\n\tres = res.replace(/^( is | are )(.*)/g, \" v $2\");\r\n\t*/\r\n\treturn res\r\n}", "function _cfoDoClumping(\n formatPattern,\n subFunction,\n param,\n outValue\n )\n{ \n var formatLength = formatPattern.length;\n var inQuote = false;\n var kindCount = 0;\n var lastChar = null;\n var startIndex = 0;\n \n for (var i = 0; i < formatLength; i++)\n {\n var currChar = formatPattern.charAt(i);\n \n if (inQuote)\n {\n if (currChar == \"\\'\")\n {\n inQuote = false;\n \n // handle to single quotes in a row as escaping the quote\n // by not skipping it when outputting\n if (kindCount != 1)\n {\n startIndex++;\n kindCount--;\n }\n\n // output the quoted text\n if (!subFunction(formatPattern,\n \"\\'\",\n startIndex,\n kindCount,\n param,\n outValue))\n {\n // failure\n // alert(\"failure at \" + startIndex + \" with \" + lastChar);\n return false;\n }\n \n kindCount = 0;\n lastChar = null;\n }\n else\n {\n // keep adding characters to the escaped String\n kindCount++;\n }\n }\n else\n {\n // the characters that we are collecting have changed\n if (currChar != lastChar)\n {\n if (kindCount != 0)\n { \n // output the previously collected string\n if (!subFunction(formatPattern,\n lastChar,\n startIndex,\n kindCount,\n param,\n outValue))\n {\n // failure\n //alert(\"failure at \" + startIndex + \" with \" + lastChar);\n return false;\n }\n \n kindCount = 0;\n lastChar = null;\n }\n \n if (currChar == '\\'')\n {\n inQuote = true;\n }\n \n startIndex = i; \n lastChar = currChar;\n }\n\n // keep collecting this kind of character together\n kindCount++;\n } \n }\n \n // output any left over substring being collected\n if (kindCount != 0)\n {\n if (!subFunction(formatPattern,\n lastChar,\n startIndex,\n kindCount,\n param,\n outValue))\n {\n // failure\n //alert(\"failure at \" + startIndex + \" with \" + lastChar);\n return false;\n }\n }\n \n // success\n return true;\n}", "function X(a){for(var b,c=[],d=/\\[([^\\]]*)\\]|\\(([^\\)]*)\\)|(LT|(\\w)\\4*o?)|([^\\w\\[\\(]+)/g;b=d.exec(a);)b[1]?// a literal string inside [ ... ]\nc.push(b[1]):b[2]?// non-zero formatting inside ( ... )\nc.push({maybe:X(b[2])}):b[3]?// a formatting token\nc.push({token:b[3]}):b[5]&&// an unenclosed literal string\nc.push(b[5]);return c}", "function magicencoder(str = '') {\n let index = 1;\n let arr = [str[0]];\n\n while(index <= str.length) {\n const pat = pattern([...arr, '*']);\n const next = str.slice(0, (2*index));\n if(pat !== next) {\n arr.push(str[index]);\n index += 1;\n } else {\n arr.push('*');\n index = 2 * index;\n }\n }\n console.log(arr.slice(0, arr.length -1));\n return arr.length -1;\n}", "function RegExpPattern(){\n\t//\n}", "function isBeautifulString(inp) {\n let alph = \"abcdefghijklmnopqrstuvwxyz\";\n //arrange letters of input string ascending so\n //we can test whether the given letter's quantity is\n //<= that of the previous letter in the alphabet.\n let arr = inp.split(\"\").sort().join(\"\");\n //Next three lines check if input string contains consecutive\n //letters and returns false if not the case. This was added due to 'zaa'\n //fail.\n let uniq = [...new Set(arr)].join(\"\");\n let consecutiveCheck = alph.match(uniq);\n if (consecutiveCheck === null) return false;\n //Breaks sorted string into groups of the same character\n let byLet = arr.match(/([a-z])\\1*/g);\n //Gives an array of the quantities of each character in string\n let quans = byLet.map((i) => i.length);\n //Checks that the quantity of a given letter is less than or equal to\n //the preceeding letter\n let pass = quans.slice(1).map((v, i) => v <= quans[i]);\n //Checks that that's always the case\n let bigPass = pass.every((i) => i === true);\n console.log(arr);\n console.log(\"uniq\", uniq);\n console.log(\"consecutiveCheck\", consecutiveCheck);\n console.log(byLet);\n console.log(quans);\n console.log(quans.slice(1));\n console.log(pass);\n console.log(bigPass);\n console.log(\"test\", alph.split(\"\").includes(\"a\"));\n //Both cases have to be true, as 'bbc' and 'yyz' failed\n //(because there are more b's than a's given that a is not present etc.);\n return bigPass && byLet[0][0] === \"a\";\n}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function Ya(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Xa(a[f]).split(\"-\"),b=e.length,c=Xa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Za(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&v(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\nbreak;b--}f++}return null}", "function reduceRegexToSet(s, name) {\n var orig = s;\n\n // propagate deferred exceptions = error reports.\n if (s instanceof Error) {\n return s;\n }\n\n var chr_re = /^(?:[^\\\\]|\\\\[^cxu0-9]|\\\\[0-9]{1,3}|\\\\c[A-Z]|\\\\x[0-9a-fA-F]{2}|\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]\\}{4})/;\n var set_part_re = /^(?:[^\\\\\\]]|\\\\[^cxu0-9]|\\\\[0-9]{1,3}|\\\\c[A-Z]|\\\\x[0-9a-fA-F]{2}|\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]\\}{4})+/;\n var nothing_special_re = /^(?:[^\\\\\\[\\]\\(\\)\\|^]|\\\\[^cxu0-9]|\\\\[0-9]{1,3}|\\\\c[A-Z]|\\\\x[0-9a-fA-F]{2}|\\\\u[0-9a-fA-F]{4}|\\\\u\\{[0-9a-fA-F]\\}{4})+/;\n\n var l = new Array(65536 + 3);\n var internal_state = 0;\n\n while (s.length) {\n var c1 = s.match(chr_re);\n if (!c1) {\n // cope with illegal escape sequences too!\n return new Error('illegal escape sequence at start of regex part: \"' + s + '\" of regex \"' + orig + '\"');\n } else {\n c1 = c1[0];\n }\n s = s.substr(c1.length);\n\n switch (c1) {\n case '[':\n // this is starting a set within the regex: scan until end of set!\n var set_content = [];\n while (s.length) {\n var inner = s.match(set_part_re);\n if (!inner) {\n inner = s.match(chr_re);\n if (!inner) {\n // cope with illegal escape sequences too!\n return new Error('illegal escape sequence at start of regex part: ' + s + '\" of regex \"' + orig + '\"');\n } else {\n inner = inner[0];\n }\n if (inner === ']') break;\n } else {\n inner = inner[0];\n }\n set_content.push(inner);\n s = s.substr(inner.length);\n }\n\n // ensure that we hit the terminating ']':\n var c2 = s.match(chr_re);\n if (!c2) {\n // cope with illegal escape sequences too!\n return new Error('regex set expression is broken in regex: \"' + orig + '\" --> \"' + s + '\"');\n } else {\n c2 = c2[0];\n }\n if (c2 !== ']') {\n return new Error('regex set expression is broken in regex: ' + orig);\n }\n s = s.substr(c2.length);\n\n var se = set_content.join('');\n if (!internal_state) {\n set2bitarray(l, se);\n\n // a set is to use like a single character in a longer literal phrase, hence input `[abc]word[def]` would thus produce output `[abc]`:\n internal_state = 1;\n }\n break;\n\n // Strip unescaped pipes to catch constructs like `\\\\r|\\\\n` and turn them into\n // something ready for use inside a regex set, e.g. `\\\\r\\\\n`.\n //\n // > Of course, we realize that converting more complex piped constructs this way\n // > will produce something you might not expect, e.g. `A|WORD2` which\n // > would end up as the set `[AW]` which is something else than the input\n // > entirely.\n // >\n // > However, we can only depend on the user (grammar writer) to realize this and\n // > prevent this from happening by not creating such oddities in the input grammar.\n case '|':\n // a|b --> [ab]\n internal_state = 0;\n break;\n\n case '(':\n // (a) --> a\n //\n // TODO - right now we treat this as 'too complex':\n\n // Strip off some possible outer wrappers which we know how to remove.\n // We don't worry about 'damaging' the regex as any too-complex regex will be caught\n // in the validation check at the end; our 'strippers' here would not damage useful\n // regexes anyway and them damaging the unacceptable ones is fine.\n s = s.replace(/^\\((?:\\?:)?(.*?)\\)$/, '$1'); // (?:...) -> ... and (...) -> ...\n s = s.replace(/^\\^?(.*?)\\$?$/, '$1'); // ^...$ --> ... (catch these both inside and outside the outer grouping, hence do the ungrouping twice: one before, once after this)\n s = s.replace(/^\\((?:\\?:)?(.*?)\\)$/, '$1'); // (?:...) -> ... and (...) -> ...\n\n return new Error('[macro [' + name + '] is unsuitable for use inside regex set expressions: \"[' + orig + ']\"]');\n\n case '.':\n case '*':\n case '+':\n case '?':\n // wildcard\n //\n // TODO - right now we treat this as 'too complex':\n return new Error('[macro [' + name + '] is unsuitable for use inside regex set expressions: \"[' + orig + ']\"]');\n\n case '{': // range, e.g. `x{1,3}`, or macro?\n // TODO - right now we treat this as 'too complex':\n return new Error('[macro [' + name + '] is unsuitable for use inside regex set expressions: \"[' + orig + ']\"]');\n\n default:\n // literal character or word: take the first character only and ignore the rest, so that\n // the constructed set for `word|noun` would be `[wb]`:\n if (!internal_state) {\n set2bitarray(l, c1);\n\n internal_state = 2;\n }\n break;\n }\n }\n\n s = bitarray2set(l);\n\n // When this result is suitable for use in a set, than we should be able to compile\n // it in a regex; that way we can easily validate whether macro X is fit to be used\n // inside a regex set:\n try {\n var re;\n assert(s);\n assert(!(s instanceof Error));\n re = new XRegExp('[' + s + ']');\n re.test(s[0]);\n\n // One thing is apparently *not* caught by the RegExp compile action above: `[a[b]c]`\n // so we check for lingering UNESCAPED brackets in here as those cannot be:\n if (/[^\\\\][\\[\\]]/.exec(s)) {\n throw new Error('unescaped brackets in set data');\n }\n } catch (ex) {\n // make sure we produce a set range expression which will fail badly when it is used\n // in actual code:\n s = new Error('[macro [' + name + '] is unsuitable for use inside regex set expressions: \"[' + s + ']\"]: ' + ex.message);\n }\n\n return s;\n}", "function fixStart(str)\n{\n //var firstChar = str.slice(0,1);\n var str1 = str.split(\"\");\n // var re = new RegExp(/(?!^)${firstChar}/,\"g\");\n // var str1 = str.replace(re,'*');\n for (var i = 1; i < str.length; i+=1)\n {\n if (str[i] === str[0])\n {\n str1[i] = '*';\n }\n }\n str1 = str1.join(\"\");\n console.log(str,\" is replaced : \",str1);\n return str1;\n}", "function step1b(token) { \n if(token.substr(-3) == 'eed') {\n if(measure(token.substr(0, token.length - 3)) > 0)\n return token.replace(/eed$/, 'ee');\n } else {\n var result = attemptReplace(token, /ed|ing$/, '', function(token) { \n if(categorizeGroups(token).indexOf('V') >= 0) {\n var result = attemptReplacePatterns(token, [['at', 'ate'], ['bl', 'ble'], ['iz', 'ize']]);\n\t\tif(result)\n\t\t return result;\n\t\telse {\n\t\t if(endsWithDoublCons(token) && token.match(/[^lsz]$/))\n\t\t\treturn token.replace(/([^aeiou])\\1$/, '$1');\n\n\t\t if(measure(token) == 1 && categorizeChars(token).substr(-3) == 'CVC' && token.match(/[^wxy]$/))\n\t\t\treturn token + 'e'; \n\t\t}\n\n\t\treturn token;\n\t }\n\t \n\t return null;\n\t});\n\t\n\tif(result)\n\t return result;\n }\n\n return token; \n}", "function solve(input) {\nlet regex = /\\+359([ -])2\\1\\d{3}\\1\\d{4}\\b/g;\nlet match = input[0].match(regex);\nconsole.log(match.join(\", \"));\n}", "function BadToGood (needle, haystack, css) {\r\n\r\n\tvar x = haystack.split(' '), nullStart = 0, nullWeds=[], currLen =0, nullIndx = [],\r\n\r\n\tm, z = x.map((r,i) => i != x.length-1 ? `(${r} )?`: `(${r})?`).join(''),\r\n\r\n\tsuppliedInput = needle.split(' ');\r\n\r\n\r\n\tz = new RegExp(`(${z})`,'mgi')\r\n\t\r\n\t// every missing node from the regex indicates wrong input\r\n\twhile ((m = z.exec(needle)) !== null) {\r\n\r\n\t\tif (m.index === z.lastIndex) {\r\n\r\n\t\t\tif (!nullStart) { // check whether we're in null word mode\r\n\t\t\t\tvar u = m.index, current = /(\\w+)/.exec(needle.substr(u));\r\n\r\n\t\t\t\tif (current !== null && current.length) {\r\n\r\n\t\t\t\t\tnullStart = current[0].length- +(nullWeds.length); // first match has no trailing spaces\r\n\r\n\t\t\t\t\tnullWeds.push({start: u, end: u + nullStart});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse nullStart--;\r\n\t\t\tz.lastIndex++;\r\n\t\t}\t\r\n\t}\r\n\t\r\n\tnullWeds = nullWeds.map(o => haystack.substring(o.start, o.end));\r\n\r\n\tif (!nullWeds.length && suppliedInput.every((f, d) => new RegExp(f, 'i').test( x[d]))) return 0;\r\n\r\n\telse return x.map((eachWord, o) => {\r\n\r\n\t\t// dont match past input length\r\n\t\tif (suppliedInput[o] !== void(0) && !nullWeds.includes(eachWord) ) return <Text key={o} style={styles.testText}>{eachWord}</Text>;\r\n\r\n\t\treturn <Text style={[styles.testText, ...css]} key={o}>{eachWord.toUpperCase()}</Text>;\r\n\t});\r\n}", "function Xa(a){for(var b,c,d,e,f=0;f<a.length;){for(e=Wa(a[f]).split(\"-\"),b=e.length,c=Wa(a[f+1]),c=c?c.split(\"-\"):null;b>0;){if(d=Ya(e.slice(0,b).join(\"-\")))return d;if(c&&c.length>=b&&u(e,c,!0)>=b-1)\n//the next array item is better than a shallower substring of this one\n break;b--}f++}return null}", "function cleanup(word_f) {\n if (word_f === undefined) return \"\";\n let f_word;\n let word = word_f;\n word = word.toLowerCase();\n let wordar = word.split(\"\");\n let wordf = [];\n for (let i = 0; i < word.split(\"\").length; i++) {\n switch (wordar[i]) {\n case \"a\": wordf.push(\"a\"); break;\n case \"b\": wordf.push(\"b\"); break;\n case \"c\": wordf.push(\"c\"); break;\n case \"d\": wordf.push(\"d\"); break;\n case \"e\": wordf.push(\"e\"); break;\n case \"f\": wordf.push(\"f\"); break;\n case \"g\": wordf.push(\"g\"); break;\n case \"h\": wordf.push(\"h\"); break;\n case \"i\": wordf.push(\"i\"); break;\n case \"j\": wordf.push(\"j\"); break;\n case \"k\": wordf.push(\"k\"); break;\n case \"l\": wordf.push(\"l\"); break;\n case \"m\": wordf.push(\"m\"); break;\n case \"n\": wordf.push(\"n\"); break;\n case \"o\": wordf.push(\"o\"); break;\n case \"p\": wordf.push(\"p\"); break;\n case \"q\": wordf.push(\"q\"); break;\n case \"r\": wordf.push(\"r\"); break;\n case \"s\": wordf.push(\"s\"); break;\n case \"t\": wordf.push(\"t\"); break;\n case \"u\": wordf.push(\"u\"); break;\n case \"v\": wordf.push(\"v\"); break;\n case \"w\": wordf.push(\"w\"); break;\n case \"x\": wordf.push(\"x\"); break;\n case \"y\": wordf.push(\"y\"); break;\n case \"z\": wordf.push(\"z\"); break;\n }\n f_word = wordf.join(\"\");\n }\n return f_word;\n}", "function createReplacements() { // 4301\n return [ // 4302\n // replace two bogus tags that begin pastes from google docs\n [new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi), ''], // 4304\n [new RegExp(/<\\/b>(<br[^>]*>)?$/gi), ''], // 4305\n // 4306\n // un-html spaces and newlines inserted by OS X // 4307\n [new RegExp(/<span class=\"Apple-converted-space\">\\s+<\\/span>/g), ' '],\n [new RegExp(/<br class=\"Apple-interchange-newline\">/g), '<br>'],\n // 4310\n // replace google docs italics+bold with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi), '<span class=\"replace-with italic bold\">'],\n // 4313\n // replace google docs italics with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-style:italic[^>]*>/gi), '<span class=\"replace-with italic\">'],\n // 4316\n //[replace google docs bolds with a span to be replaced once the html is inserted\n [new RegExp(/<span[^>]*font-weight:bold[^>]*>/gi), '<span class=\"replace-with bold\">'],\n // 4319\n // replace manually entered b/i/a tags with real ones // 4320\n [new RegExp(/&lt;(\\/?)(i|b|a)&gt;/gi), '<$1$2>'], // 4321\n // 4322\n // replace manually a tags with real ones, converting smart-quotes from google docs\n [new RegExp(/&lt;a(?:(?!href).)+href=(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(((?!&quot;|&rdquo;|&ldquo;|\"|“|”).)*)(?:&quot;|&rdquo;|&ldquo;|\"|“|”)(?:(?!&gt;).)*&gt;/gi), '<a href=\"$1\">'],\n // 4325\n // Newlines between paragraphs in html have no syntactic value,\n // but then have a tendency to accidentally become additional paragraphs down the line\n [new RegExp(/<\\/p>\\n+/gi), '</p>'], // 4328\n [new RegExp(/\\n+<p/gi), '<p'], // 4329\n // 4330\n // Microsoft Word makes these odd tags, like <o:p></o:p> // 4331\n [new RegExp(/<\\/?o:[a-z]*>/gi), ''], // 4332\n // 4333\n // cleanup comments added by Chrome when pasting html // 4334\n ['<!--EndFragment-->', ''], // 4335\n ['<!--StartFragment-->', ''] // 4336\n ]; // 4337\n } // 4338", "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\n}", "function regexCharacterClass()\n{\n var ranges = rnd(5);\n var inRange = rnd(2);\n var charBucket = [String.fromCharCode(regexCharCode())]; // from which potenial matches will be drawn\n\n var re = \"[\";\n if (!inRange) {\n re += \"^\";\n }\n\n var lo, hi;\n\n for (var i = 0; i < ranges; ++i) {\n if (rnd(100) == 0) {\n // Confuse things by tossing in an extra \"-\"\n re += \"-\";\n if (rnd(2)) {\n re += String.fromCharCode(regexCharCode());\n }\n }\n\n if (rnd(3) == 1) {\n // Add a built-in class, like \"\\d\"\n re += Random.index(regexBuiltInCharClasses);\n charBucket.push(\"a\");\n charBucket.push(\"0\");\n charBucket.push(\"_\");\n } else if (rnd(2)) {\n // Add a range, like \"a-z\"\n var a = regexCharacter();\n var b = regexCharacter();\n if ((a[1] <= b[1]) == !!rnd(10)) {\n [lo, hi] = [a, b];\n } else {\n [lo, hi] = [b, a];\n }\n\n re += lo[0] + \"-\" + hi[0];\n charBucket.push(String.fromCharCode(lo[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(hi[1] + rnd(3) - 1));\n charBucket.push(String.fromCharCode(lo[1] + rnd(Math.max(hi[1] - lo[1], 1)))); // something in the middle\n } else {\n // Add a single character\n var a = regexCharacter();\n re += a[0];\n charBucket.push(String.fromCharCode(a[1]));\n }\n }\n\n re += \"]\";\n return [re, pickN(charBucket, POTENTIAL_MATCHES)];\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 nameRepair(objArray, takeOutArray, putInArray) {\n \n //loop para passar por todos os objetos da array\n for(i = 0; i < objArray.length; i++) {\n \n //loop para passar por todos os caracteres que devem ser encontrados\n for(j = 0; j < takeOutArray.length; j++){\n \n let strRepair = objArray[i].name,\n regularExp = new RegExp(takeOutArray[j], \"g\"); //Criar expressao regular que encontre todas as instancias do caracter atual\n \n //substitui os caracteres encontrados pela regex pelo caracter da array putInArray, uma iteracao para cada caracter diferente a ser modificado\n strRepair = strRepair.replace(regularExp, putInArray[j]);\n \n //funcao com regular expression para tornar primeira maiuscula a primeira letra de cada palavra\n //futuramente me dedicarei a entender melhor a associacao de expressoes regulares para adicionar como excecao as palavras nao significativas (\"com\", \"de\")\n //adaptado de https://www.w3resource.com/javascript-exercises/javascript-string-exercise-9.php\n strRepair = strRepair.replace(/\\w\\S*/g, function(txt){return txt.charAt(0).toUpperCase() + txt.substr(1).toLowerCase();});\n \n objArray[i].name = strRepair; \n }\n }\n}", "function alternate(s) {\n let chars = [...new Set(s)];\n let max = 0;\n for (let i = 0; i < chars.length - 1; i++) {\n for (let j = i + 1; j < chars.length; j++) {\n let reg = new RegExp(`[${chars[i]}|${chars[j]}]`, \"gi\");\n let sub = s.match(reg);\n console.log(\"sub\", sub);\n let isValid = false;\n for (let x = 0; x < sub.length; x++) {\n if (sub[x] !== sub[x + 1]) {\n isValid = true;\n } else {\n console.log(\"not valid\");\n isValid = false;\n break;\n }\n }\n if (isValid) {\n console.log(\"valid\", max);\n if (max < sub.length) {\n max = sub.length;\n console.log(max);\n }\n }\n }\n }\n return max;\n}", "function ReplaceText(text) {\n text = String(text);\n\n function mixCase(letter) {\n var upper = Math.random() < 0.5;\n if (upper) {\n return letter.toUpperCase();\n }\n else {\n return letter.toLowerCase();\n }\n }\n\n function lowCase(letter) {\n return letter.toLowerCase();\n }\n\n function upCase(letter) {\n return letter.toUpperCase();\n }\n\n var answer = \"\";\n var cases = [];\n\n for (var i = 0; i < text.length; i++) {\n if (text[i] == '<') {\n i++;\n if (text[i] == \"/\") {\n cases.pop();\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'm') {\n cases.push(mixCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'u') {\n cases.push(upCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else if (text[i] == 'l') {\n cases.push(lowCase);\n while (text[i] != '>') {\n i++;\n }\n }\n else {\n alert(i + \"Error!\");\n }\n }\n else {\n if (cases.length == 0) {\n answer += text[i];\n }\n else {\n var currLetter = text[i];\n\n for (var j = cases.length - 1; j >= 0; j--) {\n currLetter = cases[j](currLetter);\n }\n\n answer += currLetter;\n }\n }\n }\n\n return answer;\n}", "function containsWhitespace(txt) {\n var whitespace = /\\s/.test(txt)\n if (whitespace == true) { //check if string has spaces\n var matched1 = /^\\s|\\s$/.test(txt)\n var matched2 = /(?<=\\d)\\s+(?=[0-9a-zA-Z])/.test(txt)\n var matched3 = /^\\s+$/.test(txt) //check if input all spaces\n console.log(matched1)\n console.log(matched2)\n if (matched1 != false && matched2 != false) { //check spaces at both ends\n console.log(\"Invalid format\")\n return true\n } else if (matched3 != false) {\n console.log(\"bro stop it, it's only space\")\n return null\n } else if (matched1 != false) {\n var newNum = txt.trim()\n txt = newNum\n console.log(\"modified input: (\" + newNum + \")\")\n return newNum\n } else {\n console.log(\"errrrrooooorrrrr\")\n return true\n }\n } else {\n if (txt === \"\") {\n console.log(\"this is empty\")\n return null\n }\n return txt\n }\n}", "function regexToNFA(regex){\n var curChar = \"\";\n var prevChar = \"\";\n var nextChar = \"\";\n var input = \"\";\n var newNFA;\n\n // Many for loops are used to loop through the several arrays being used to store the NFA.\n // It is built through a process of parsing the input given by the user in a switch case\n for(var i = 0; i < regex.length; i++){\n input = regex.charAt(i);\n prevChar = regex.charAt(i - 1);\n curChar = regex.charAt(i);\n nextChar = regex.charAt(i + 1);\n switch(input){\n case '*':\n if((i - 1) == 0) {\n if(isLetter(nextChar)){\n newNFA = {state: 0, transition: [prevChar, 0, prevChar, 1],accepting: true};\n } else {\n newNFA = {state: 0, transition: [prevChar, 0],accepting: true};\n }\n ACCEPTING_STATES.push(newNFA.state);\n START_STATE = newNFA.state;\n NFA_TUPLE.push(newNFA);\n } else if(i !== regex.length - 1 && isLetter(nextChar)){\n newNFA = {state: ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), transition: [prevChar, ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), prevChar, ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+2)], accepting: true};\n ACCEPTING_STATES.push(newNFA.state);\n NFA_TUPLE.push(newNFA);\n } else if(i == regex.length - 1){\n newNFA = {state: ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), transition: [regex.charAt(i - 2), ((NFA_TUPLE[NFA_TUPLE.length - 1].state))], accepting: true};\n NFA_TUPLE.push(newNFA);\n ACCEPTING_STATES.push(newNFA.state);\n }\n break;\n default:\n if((i == 0) && isLetter(nextChar)) {\n newNFA = {state: 0, transition: [curChar, 1], accepting: false};\n START_STATE = newNFA.state;\n NFA_TUPLE.push(newNFA);\n } else if(i !== regex.length - 1 && isLetter(nextChar)){\n newNFA = {state: ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), transition: [curChar, ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+2)], accepting: false};\n NFA_TUPLE.push(newNFA);\n } else if(i == regex.length - 1 && regex.length !== 1){\n newNFA = {state: ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), transition: [curChar, ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+2)], accepting: false};\n NFA_TUPLE.push(newNFA);\n newNFA = {state: ((NFA_TUPLE[NFA_TUPLE.length - 1].state)+1), transition: [prevChar, ((NFA_TUPLE[NFA_TUPLE.length - 1].state))], accepting: true};\n NFA_TUPLE.push(newNFA);\n ACCEPTING_STATES.push(newNFA.state);\n } else if(i == regex.length - 1 && regex.length == 1){\n newNFA = {state: 0, transition: [curChar, 1], accepting: false};\n START_STATE = newNFA.state;\n NFA_TUPLE.push(newNFA);\n newNFA = {state: 1, transition: [], accepting: true};\n NFA_TUPLE.push(newNFA);\n ACCEPTING_STATES.push(newNFA.state);\n }\n break;\n }\n }\n matchTest();\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}", "toRegex() {\n }", "function lookAhead(match) {\n \t\tvar matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) == match);\n \t\tif (matches) {\n \t\t\tiFormat++;\n \t\t}\n \t\treturn matches;\n \t}", "function rawCompareStringByFormats(str, regex_ptn, pattern_array)\n{\n\tif(!rawIsSafeString(str)){\n\t\treturn null;\n\t}\n\tvar\ttmpstr\t= str.toLowerCase();\n\n\tif(rawIsSafeEntity(regex_ptn)){\n\t\tvar\tmatches\t= tmpstr.match(regex_ptn);\n\t\tif(!rawIsEmptyArray(matches) && 2 <= matches.length){\n\t\t\treturn tmpstr;\n\t\t}\n\t}\n\n\tif(!rawIsArray(pattern_array) && rawIsSafeString(pattern_array)){\n\t\tvar\ttmpptn\t\t= pattern_array;\n\t\tpattern_array\t= [tmpptn];\n\t}\n\tif(rawIsArray(pattern_array)){\n\t\tfor(var cnt = 0; cnt < pattern_array.length; ++cnt){\n\t\t\tif(rawCompareCaseString(tmpstr, pattern_array[cnt])){\n\t\t\t\treturn tmpstr;\n\t\t\t}\n\t\t}\n\t}\n\treturn null;\n}", "function containBad (str) {\r\n\r\n return str.match(/[iol]/g);\r\n}", "function matchWord(curWord, table){\n\n //table for elements that combine with those arround them in a distinct way\n //[element, pattern, type after parse, relative location of elements, expected element type]\n //going to hold of on the expected type for now\n var combTable = [\n [\"!\",\"factorial(\\\\0)\",\"func\",[-1],[[\"var\",\"num\",\"func\",\"paren\"]],[0]],\n [\"\\'\",\"derivative(\\\\0(\\\\1),\\\\1,\\\\2)\",\"func\",[-1,1],[[\"var\"],[\"paren\"]],[0,1]],\n [\"int\",\"integrate\\\\2,\\\\3,\\\\0,\\\\1)\",\"func\",[1,2,3,4],[[\"sup\",\"sub\"],[\"sup\",\"sub\"],[\"paren\"],\"var\"],[0,0,1,1]],\n ]\n\n //for symbols and functions longer than one character\n //\n //parseTable = [\"LATEX after \\\",\"SAGE pattern\",switch flag,semantic val,number of vars(i'll probably get rid of this)]\n //\n //switches \n //0 - binary operators, +-/* and symbols\n //1 - parentheses\n //2 - functions that require paren following them\n //3 - functions with values in curly braces\n //4 - bounded functions\n //5 - sum function, should be replaced with bounded func\n //\n //patterns\n //variables denoted by two backslashes \\\\ and a number like \\\\2\n var funcTable = [\n //trigonometric functions\n //sine\n [\"sin\",\"sin\",7,\"func\"],\n [\"arcsin\",\"arcsin\",7,\"func\"],\n [\"sinh\",\"sinh\",7,\"func\"],\n [\"arcsinh\",\"arcsinh\",7,\"func\"],\n\n //cosine\n [\"cos\",\"cos\",7,\"func\"],\n [\"arccos\",\"arccos\",7,\"func\"],\n [\"cosh\",\"cosh\",7,\"func\"],\n [\"arccosh\",\"arccosh\",7,\"func\"],\n\n //tangent\n [\"tan\",\"tan\",7,\"func\"],\n [\"arctan\",\"arctan\",7,\"func\"],\n [\"tanh\",\"tanh\",7,\"func\"],\n [\"arctanh\",\"arctanh\",7,\"func\"],\n\n //cotangent\n [\"cot\",\"cot\",7,\"func\"],\n [\"arccot\",\"arccot\",7,\"func\"],\n [\"coth\",\"coth\",7,\"func\"],\n [\"arccoth\",\"arccoth\",7,\"func\"],\n\n //cosecant\n [\"csc\",\"csc\",7,\"func\"],\n [\"arccsc\",\"arccsc\",7,\"func\"],\n [\"csch\",\"csch\",7,\"func\"],\n [\"arccsch\",\"arccsch\",7,\"func\"],\n\n //secant\n [\"sec\",\"sec\",7,\"func\"],\n [\"arcsec\",\"arcsec\",7,\"func\"],\n [\"sech\",\"sech\",7,\"func\"],\n [\"arcsech\",\"arcsech\",7,\"func\"],\n\n //log functions\n //soon to be functions with default values\n [\"lg\",\"log(\\\\2,\\\\0)\",8,\"func\",\"10\"],\n [\"ln\",\"log(\\\\2,\\\\0)\",8,\"func\",\"e\"],\n [\"log\",\"log(\\\\2,\\\\0)\",8,\"func\",\"10\"],\n [\"lb\",\"log(\\\\2,\\\\0)\",8,\"func\",\"2\"],\n\n\n //misc functions\n //\n //greatest common denominator\n [\"gcd\",\"gcd\",2,\"func\"],\n\n //kernel. used on matricies\n [\"ker\",\"ker\",2,\"func\"],\n\n //determinant. used on matrices\n [\"det\",\"det\",2,\"func\"],\n\n //limit. gotta get this one done\n [\"lim\",\"limit(\\\\3, \\\\0====\\\\1 \\\\2)\",9,\"func\"],\n\n //argument. used in discrete\n [\"arg\",\"arg\",2,\"func\"],\n\n [\"frac\",\"((\\\\0)/(\\\\1))\",11,\"paren\",2],\n\n //square root and nth root\n [\"sqrt\",\"sqrt(\\\\0)\",6,\"func\",1],\n\n //height matched parens\n [\"left(\",\"(\",1,\"paren\"],\n [\"right)\",\"(\",1,\"paren\"],\n\n [\"left[\",\"[\",1,\"paren\"],\n [\"right]\",\"]\",1,\"paren\"],\n\n [\"left\\\\{\",\"{\",1,\"paren\"],\n [\"right\\\\}\",\"}\",1,\"paren\"],\n\n [\"left|\",\"abs(\",1,\"paren\"],\n [\"right|\",\")\",1,\"paren\"],\n\n [\"left\\\\langle\",\"<\",1,\"paren\"],\n [\"right\\\\rangle\",\">\",1,\"paren\"],\n\n [\"left\\\\lceil\",\"ceil(\",1,\"func\"],\n [\"right\\\\rciel\",\")\",1,\"func\"],\n\n [\"left\\\\lfloor\",\"floor(\",1,\"func\"],\n [\"right\\\\rfloor\",\")\",1,\"func\"],\n\n [\"left\\\\lvert\",\"|\",1,\"paren\"],\n [\"right\\\\rvert\",\"(\",1,\"paren\"],\n\n [\"left\\\\Lvert\",\"|\",1,\"paren\"],\n [\"right\\\\Rvert\",\"(\",1,\"paren\"],\n\n //binary operators\n [\"cdot\",\"*\",0,\"binOp\"],\n [\",\",\"*\",0,\"binOp\"],\n [\"ast\",\"*\",0,\"binOp\"],\n [\"star\",\"*\",0,\"binOp\"],\n [\"times\",\"*\",0,\"binOp\"],\n [\"div\",\"/\",0,\"binOp\"],\n [\"mod\",\"%\",0,\"binOp\"],\n\n //text fields\n [\"textbf\",\"\\\\0\",3,\"func\",1],\n [\"textit\",\"\\\\0\",3,\"func\",1],\n [\"text\",\"\\\\0\",3,\"var\",1],\n\n //big greek notations\n //\n //temporary integrate fix:\n [\"int\",\"integrate\",2,\"func\"],\n //[\"int\",\"integrate(\\\\0,\\\\1,\\\\2,\\\\3)\",4,\"func\"],\n //[\"int\",\"integrate(\\\\0,\\\\1,\\\\2,\\\\3)\",0,\"comb\"],\n\n [\"sum\",\"sum(\\\\3,\\\\2,\\\\1,\\\\0)\",5,\"func\"],\n [\"prod\",\"product(\\\\3,\\\\2,\\\\1,\\\\0)\",5,\"func\"],\n\n //equivalence operators\n [\"leq\",\"<=\", 0, \"equiv\"],\n [\"le\",\"<=\", 0, \"equiv\"],\n [\"geq\",\">=\", 0, \"equiv\"],\n [\"ge\",\">=\", 0, \"equiv\"],\n [\"neq\",\"!=\", 0, \"equiv\"],\n [\"ne\",\"!=\", 0, \"equiv\"],\n\n //Logic connectives\n\n //AND : the conjunction\n [\"and\",\" and \", 0, \"bool\"],\n [\"land\",\" and \", 0, \"bool\"],\n [\"wedge\",\" and \", 0, \"bool\"],\n\n //OR : the disjunction\n [\"or\",\" or \", 0, \"bool\"],\n [\"lor\",\" or \", 0, \"bool\"],\n [\"vee\",\" or \", 0, \"bool\"],\n\n //NOT : the negation\n [\"not\",\" not \", 0, \"bool\"],\n [\"lnot\",\" not \", 0, \"bool\"],\n [\"neg\",\" not \", 0, \"bool\"],\n\n //IFF : if and only if\n [\"iff\",\" iff \", 0, \"bool\"],\n [\"iff\",\" iff \", 0, \"bool\"],\n\n //XOR : exclusive or\n [\"oplus\",\"\",-1,\"binOp\"],\n\n /*THEN : if then \n [\"leftarrow\",\"lar\",,\"sym\"],\n [\"Leftarrow\",\"lar\",,\"sym\"],\n\n */\n //symbols\n [\"backslash\",\"//\", -2, \"sym\"],\n [\"infty\",\"oo\",0,\"sym\"],\n [\"partial\",\"d \",0,\"der\"],\n\n //arrows\n [\"from\",\"lar\",0,\"arr\"],\n [\"leftarrow\",\"lar\",0,\"arr\"],\n [\"Leftarrow\",\"Lar\",0,\"arr\"],\n\n [\"to\",\"rar\",0,\"arr\"],\n [\"rightarrow\",\"rar\",0,\"arr\"],\n [\"Rightarrow\",\"Rar\",0,\"arr\"],\n\n [\"mapsto\",\"map to\",0,\"arr\"],\n\n //symbols i need to find the sage equivalent of\n //i think these are just other forms of bin ops\n\n [\"ominus\",\"\",-1,\"binOp\"],\n [\"odot\",\"\",-1,\"binOp\"],\n [\"otimes\",\"\",-1,\"binOp\"],\n\n [\"oslash\",\"\",-1,\"sym\"],\n\n //these are set operators for discrete\n [\"cup\",\"\",-1,\"binOp\"],\n [\"union\",\"\",-1,\"binOp\"],\n [\"bigcup\",\"\",-1,\"binOp\"],\n\n [\"cap\",\"\",-1,\"binOp\"],\n [\"inter\",\"\",-1,\"binOp\"],\n\n [\"bigcap\",\"\",-1,\"binOp\"],\n [\"biguplus\",\"\",-1,\"binOp\"],\n\n //an upside down delta?\n [\"nabla\",\"grad\",2,\"func\"],\n\n //big function letters\n [\"coprod\",\"\",-1,\"func\"],\n [\"intO\",\"\",-1,\"func\"],\n [\"intOe\",\"\",-1,\"func\"],\n [\"intG\",\"\",-1,\"func\"],\n [\"intGh\",\"\",-1,\"func\"],\n [\"intGhe\",\"\",-1,\"func\"],\n [\"oint\",\"\",-1,\"func\"],\n [\"iint\",\"\",-1,\"func\"],\n [\"iiint\",\"\",-1,\"func\"],\n [\"idotsint\",\"\",-1,\"func\"],\n\n //common dirivative letters\n [\"dx\",\"\",-1,\"sym\"],\n [\"dy\",\"\",-1,\"sym\"],\n [\"dz\",\"\",-1,\"sym\"],\n [\"dr\",\"\",-1,\"sym\"],\n [\"dt\",\"\",-1,\"sym\"],\n [\"dO\",\"\",-1,\"sym\"],\n [\"dG\",\"\",-1,\"sym\"],\n [\"dT\",\"\",-1,\"sym\"],\n\n //delta with letters\n [\"del f\",\"\",-1,\"sym\"],\n [\"grad f\",\"\",-1,\"sym\"],\n [\"divr f\",\"\",-1,\"sym\"],\n [\"curl f\",\"\",-1,\"sym\"],\n [\"p f\",\"\",-1,\"sym\"],\n\n //greek letters\n [\"pi\",\"pi\", 0, \"sym\"],\n [\"varpi\",\"pi\", 0, \"sym\"],\n [\"alpha\",\"alpha\", 0, \"sym\"],\n [\"beta\",\"beta\", 0, \"sym\"],\n [\"chi\",\"chi\", 0, \"sym\"],\n [\"delta\",\"delta\", 0, \"sym\"],\n [\"Delta\",\"Delta\", 0, \"sym\"],\n [\"epsilon\",\"epsilon\", 0, \"sym\"],\n [\"Epsilon\",\"Epsilon\", 0, \"sym\"],\n [\"varepsilon\",\"epsilon\", 0, \"sym\"],\n [\"eta\",\"eta\", 0, \"sym\"],\n [\"gamma\",\"gamma\", 0, \"sym\"],\n [\"Gamma\",\"Gamma\", 2, \"func\"],\n [\"digamma\",\"digamma\", 0, \"sym\"],\n [\"iota\",\"iota\", 0, \"sym\"],\n [\"kappa\",\"kappa\", 0, \"sym\"],\n [\"lambda\",\"varlambda\", 0, \"sym\"],\n [\"Lambda\",\"Lambda\", 0, \"sym\"],\n [\"mu\",\"mu\", 0, \"sym\"],\n [\"nu\",\"nu\", 0, \"sym\"],\n [\"omega\",\"omega\", 0, \"sym\"],\n [\"Omega\",\"Omega\", 0, \"sym\"],\n [\"phi\",\"phi\", 0, \"sym\"],\n [\"Phi\",\"Phi\", 0, \"sym\"],\n [\"varphi\",\"phi\", 0, \"sym\"],\n [\"psi\",\"psi\", 2, \"func\"],\n [\"Psi\",\"Psi\", 0, \"sym\"],\n [\"rho\",\"rho\", 0, \"sym\"],\n [\"varrho\",\"rho\", 0, \"sym\"],\n [\"sigma\",\"sigma\", 2, \"func\"],\n [\"Sigma\",\"Sigma\", 0, \"sym\"],\n [\"tau\",\"tau\", 0, \"sym\"],\n [\"theta\",\"theta\", 0, \"sym\"],\n [\"Theta\",\"Theta\", 0, \"sym\"],\n [\"vartheta\",\"theta\", 0, \"sym\"],\n [\"upsilon\",\"upsilon\", 0, \"sym\"],\n [\"Upsilon\",\"Upsilon\", 0, \"sym\"],\n [\"xi\",\"xi\", 0, \"sym\"],\n [\"Xi\",\"Xi\", 0, \"sym\"],\n\n //hebrew symbols\n [\"zeta\",\"zeta\", 0, \"sym\"],\n [\"aleph\",\"aleph\", 0, \"sym\"],\n [\"beth\",\"beth\", 0, \"sym\"],\n [\"gimel\",\"gimel\", 0, \"sym\"],\n [\"daleth\",\"daleth\", 0, \"sym\"],\n\n //empty set and none symbols\n [\"varnone\",\"None\", 0, \"sym\"],\n [\"varnothing\",\"None\", 0, \"sym\"],\n\n //space characters\n [\"s\",\"\", 10, \"\"],\n ];\n\n console.log(\"matchWord\");\n var curDict = new Array;\n var dispDict = new Array;\n var parseTable = [];\n\n //i should find a better way of doing this\n //this is copying a huge list which is a waste of memory,\n //but it allows for one lookup code to be used\n //fuck javascript for not allowing reference pointers\n //reference pointers would have been awesome for most of this program \n //\n switch(table){\n case 0:\n parseTable = funcTable;\n break;\n case 1:\n parseTable = combTable;\n break;\n default:\n parseTable = funcTable;\n break;\n }\n //get any commands of the same length\n for(var j=0,len=parseTable.length; j<len; j++){\n if(parseTable[j][0].length == curWord.length){\n curDict.push(parseTable[j]);\n dispDict.push(parseTable[j][0]);\n } \n }\n if(curDict.length == 0){\n console.error(\"unknown function word: \"+curWord);\n if(curWord.length !== 0) errors.push(\"Unknown function: '\"+curWord+\"'.\");\n return([[curWord,curWord,-1,\"err\"]]);\n }\n console.log(\" Length matches: \"+dispDict);\n\n //narrow the list each letter\n var k = 0;\n while(curDict.length > 1 && curWord.length > k){\n var newDict = new Array;\n dispDict.length = 0;\n //make a new array of the valid commands because i don't feel like splicing or popping.\n //i'll probably do that in the future cause speed/memory\n for(var l=0,len=curDict.length; l<len;l++){\n if(curDict[l][0].charAt(k) === curWord.charAt(k)){\n newDict.push(curDict[l]);\n dispDict.push(curDict[l][0]);\n }\n }\n curDict = newDict;\n console.log(\" Letter matches: \"+dispDict);\n k++;\n }\n if(curDict.length != 0){\n if(curDict[0][0] == curWord){\n console.log(\"word instructions: \"+curDict[0]);\n return curDict;\n }\n else{\n console.error(\"unknown function word: \"+curWord);\n errors.push(\"Unknown function: '\"+curWord+\"'.\");\n return([[curWord,curWord,\"-1\",\"err\"]]);\n }\n }\n else{\n console.error(\"unknown function word: \"+curWord);\n errors.push(\"Unknown function: '\"+curWord+\"'.\");\n return([[curWord,curWord,\"-1\",\"err\"]]);\n }\n}", "function workOnStrings(a,b){\n let cc=x=>x==x.toLowerCase()?x.toUpperCase():x.toLowerCase(), arra=a.split(''), arrb=b.split(''), r, res;\n res = arra.map(x=>{r=new RegExp(x,'gi'); return (b.match(r)||[]).length%2?cc(x):x}).join('');\n res += arrb.map(x=>{r=new RegExp(x,'gi'); return (a.match(r)||[]).length%2?cc(x):x}).join('');\n return res;\n}", "function LetterChanges(str) { \n\n // code goes here \n \n let expectedRes = str.split('')\n let res = [];\n let regExp = ''; \n let vowels = 'aeiou'\n \n expectedRes.forEach(function(item, index){\n if (item.match('^[a-zA-Z]')){\n res[index] = String.fromCharCode(item.charCodeAt()+1)\n regExp += vowels.includes(res[index].toLowerCase()) ? res[index].toUpperCase(): res[index]\n }else{\n res[index] = item\n regExp += item\n }\n \n })\n \n return regExp; \n \n }", "function fixMeetingNames(wholeName){\n // var firstHalf = wholeName.substring(0,wholeName.indexOf('-'));\n // return firstHalf;\n var middle = wholeName.indexOf('-');\n var firstHalf = wholeName.toUpperCase().substring(0, middle).replace(/A.A./g, \"AA\").trim();\n var secondHalf = wholeName.toUpperCase().substring(middle + 2).replace(/- |-/g, \"\").trim();\n var firstHalfClean = firstHalf.replace(/\\s/g,'');\n var secondHalfClean = secondHalf.replace(/\\s/g,'');\n \n var compare = firstHalfClean.localeCompare(secondHalfClean);\n \n console.log(\"--------------\")\n console.log(\"1 string:\" + firstHalfClean + \" | length: \" + firstHalfClean.length );\n console.log(\"2 string:\" + secondHalfClean + \" | length: \" + secondHalfClean.length);\n console.log(middle);\n console.log(compare);\n \n if ( middle < compare && compare >= 4 ){\n console.log(\">= 4\" + wholeName.replace(/-/g, ' ').trim());\n return wholeName.replace(/-/g, ' ').trim();\n // this is for ones with (:II) after the name\n }else if (compare == middle - 3 || compare == 0 || secondHalfClean.length == 0 || firstHalfClean.indexOf(\"(:I\") != -1){\n console.log(\"First return\" + firstHalf.replace(/-/g, ' ').trim());\n return firstHalf.replace(/-/g, ' ').trim();\n // this is for ones with (:II) after the name\n }else if (firstHalfClean == 0 || secondHalfClean.indexOf(\"(:I\") != -1){\n console.log(\"second has #\" + secondHalf.replace(/-/g, ' ').trim());\n return secondHalf.replace(/-/g, ' ').trim();\n // this is for ones with more then (:II) after the name\n }else if (compare < 0) {\n console.log( \"< 0\" + firstHalf + \": \" + secondHalf.substring(compare));\n return secondHalf.substring(compare);\n // this is for ones that match\n }\n}", "spaceOutInputVal() {\n const og_prob = this.state.inputVal;\n let newString = \"\";\n const input = og_prob.replace(/[\\t\\n\\r\\s]/gm, \"\");\n const pregex = RegExp(/^(.*)\\1$/gm);\n const rgx = RegExp(/\\+|-|=|\\//gm);\n if (pregex.test(input) !== true) {\n for (let i = 0; i < og_prob.length; i++) {\n if (rgx.test(og_prob.charAt(i))) {\n let lhs = og_prob.charAt(i - 1);\n let rhs = og_prob.charAt(i + 1);\n // 0th index cases\n if (i === 0 && (rhs === \" \" || rhs === \"\\t\")) {\n newString += og_prob.charAt(i);\n // 0th index 2nd case; add a space\n } else if (i === 0 && (rhs !== \" \" || rhs !== \"\\t\")) {\n newString += og_prob.charAt(i) + \" \";\n // spaces on both sides; do nothing i.e. x = 4\n } else if (\n (lhs === \" \" || lhs === \"\\t\") &&\n (rhs === \" \" || rhs === \"\\t\")\n ) {\n newString += og_prob.charAt(i);\n // i.e. x= 4\n } else if (\n (lhs !== \" \" || lhs !== \"\\t\") &&\n (rhs === \" \" || rhs === \"\\t\")\n ) {\n newString += \" \" + og_prob.charAt(i);\n // i.e. x =4\n } else if (\n (lhs === \" \" || lhs === \"\\t\") &&\n (rhs !== \" \" || rhs !== \"\\t\")\n ) {\n newString += og_prob.charAt(i) + \" \";\n // i.e. x=4\n } else if (\n (lhs !== \" \" || lhs !== \"\\t\") &&\n (rhs !== \" \" || rhs !== \"\\t\")\n ) {\n newString += \" \" + og_prob.charAt(i) + \" \";\n } else {\n newString += og_prob.charAt(i);\n }\n } else {\n newString += og_prob.charAt(i);\n }\n }\n this.setState({ inputVal: newString });\n }\n }", "function validEmailAddress(email) {\n var pattern = new RegExp(/^((([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.?$/i);\n return pattern.test(email);\n}", "function ExOh(str) { \n\n \n var x = str.match(/[x]+/gi);\n var o = str.match(/[o]+/gi);\n \n if (o === null || x === null)\n {\n return false\n }\n else{\n x = x.join('').split('').length;\n o = o.join('').split('').length;\n \n if (x == o)\n return true\n else\n return false;\n \n }\n \n}", "getPaths(regex, point = new Coordinate(0,0)){\n // Paths will be a multi-dimension array that basically \n // substitutes the parenthesis in the regex\n // We can traverse down any path this way\n let paths = [[0]];\n let i = 0;\n let j = 0;\n let char = -1;\n\n // Keeps track of where we are\n let location = new Coordinate(point.x, point.y);\n this.visited[location] = true;\n\n // Navigate through the regex\n while(++char < regex.length){\n // New path\n if(regex[char] == '|'){\n paths[++i] = [0];\n j = 0;\n location = new Coordinate(point.x, point.y);\n }\n // Another layer found, recurse down\n else if(regex[char] == '('){\n let inner = this.getPaths(regex.substring(char + 1), location);\n // Offset what character we are looking at to avoid infinite recursion\n char += inner.end;\n // Group the inner paths with the outer path\n paths[i][++j] = inner.paths;\n // True if the path doesn't need to traverse down into deeper layers\n // Example: EESS(WNSE|)SSS\n if(regex[char + 1] && regex[char + 1] != '|' && regex[char + 1] != ')'){ \n paths[i][++j] = 0;\n }\n }\n // Layer ends\n else if(regex[char] == ')'){\n break;\n }\n // Add to the path\n else{\n // Move our location\n switch(regex[char]){\n case 'N': location.north(); break;\n case 'S': location.south(); break;\n case 'E': location.east(); break;\n case 'W': location.west(); break;\n }\n // We have not been here before, count it\n if(!this.visited[location]){\n this.visited[location] = true;\n paths[i][j]++;\n }\n }\n }\n // Return where we ended and the paths created\n return {\n end: char + 1,\n paths: paths\n }\n }", "function solve(args){\r\n \r\n var arr=args[0].split(/[<|>]/g),\r\n filter = ['orgcase'];\r\n\r\n for (i in arr) {\r\n if (arr[i] === 'lowcase') {\r\n filter.push('lowcase');\r\n }\r\n else if (arr[i] === 'upcase') {\r\n filter.push('upcase');\r\n }\r\n else if (arr[i] === 'orgcase') {\r\n filter.push('orgcase');\r\n }\r\n else if (arr[i][0] === '/') {\r\n filter.pop();\r\n } else {\r\n if (filter[filter.length - 1] === 'lowcase') {\r\n arr[i] = arr[i].toLowerCase();\r\n }\r\n if (filter[filter.length - 1] === 'upcase') {\r\n arr[i] = arr[i].toUpperCase();\r\n }\r\n }\r\n }\r\n \r\n var str = arr.join('').replace(/[/]/g,'').replace(/(orgcase|upcase|lowcase)/g,'');\r\n\r\n console.log(str);\r\n}", "function a(e){var t,i=e?e.indexOf(\"!\"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}", "function stripStringRegEx(incstr, a, b) {\n var str = incstr;\n done = false;\n\n while (done == false) {\n if (str.length == 0) {\n done = true;\n }\n var ai = str.indexOf(a);\n if (ai == -1) {\n done = true\n }\n else {\n var bi = ai + 1;\n while (str[bi] != b) {\n bi++;\n if (bi >= str.length) {\n done = true;\n break;\n }\n }\n if (bi < str.length) {\n bi++;\n var subst = str.substring(ai, bi);\n var tempstr;\n if (subst != null) {\n tempstr = str.replace(subst, \"\");\n str = tempstr;\n }\n }\n }\n }\n return str;\n}", "static phoneNumberData2Human(data_phone_number){\n let str = this.phoneNumberHuman2Data(data_phone_number)\n str.match(/([0-9]{3})([0-9]{4})([0-9]{4})/)\n return `${RegExp.$1} ${RegExp.$2} ${RegExp.$3}`\n }", "function fS(s){var res=[]\n // here using replace as an iterator over Unicode characters\n s.replace(/[\\u0000-\\uD7FF\\uDC00-\\uFFFF]|([\\uD800-\\uDBFF][\\uDC00-\\uDFFF])|[\\uD800-\\uDBFF]/g,\n function(m,u){\n if(u)res.push(cpFC(u))\n else res.push(m[0].charCodeAt(0))})\n return fL(res.sort(function(a,b){return a-b}).filter(function(c,i,a){return !i||a[i-1]!=a[i]}))}", "function separateByType(str){\n const result = [];\n let char = str.split('')\n for(let i=0; i<char.length; i++){\n const duplicates = [];\n //push the first\n duplicates.push(char[i]);\n\n // check for integers in a row\n if (Number.isInteger(parseInt(char[i])) && Number.isInteger(parseInt(char[i+1]))){ \n duplicates.push(char[i+1]);\n for(let j = i+1; j<char.length-1; j++){\n if(Number.isInteger(parseInt(char[j])) && Number.isInteger(parseInt(char[j+1]))){\n duplicates.push(char[j+1]);\n i++;\n }\n else break;\n };\n i++\n }\n \n if (!Number.isInteger(parseInt(char[i])) && char[i]===char[i+1]){\n //if match, push the second\n duplicates.push(char[i+1]);\n for(let j = i+1; j<char.length-1; j++){\n //iterate through rest of array until no match\n if(char[j]===char[j+1]){\n // push the third\n duplicates.push(char[j+1]);\n // advance the main loop past the third + duplicate characters\n i++;\n }\n else break;\n };\n //advance the loop past the second duplicate\n i++\n }\n result.push(duplicates.join(''))\n }\n return result;\n}", "function firstStrongChar(str){var match=REGEX_STRONG.exec(str);return match==null?null:match[0];}", "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 }", "function getTimeFromString(str)\n{\n var timeRE1 = /(@|at|,)?\\s*([0-9]+)(?::|\\.|\\u0020\\u0068\\u0020|\\u6642|h)([0-9]+)(?:\\u5206)?\\s*(am|a|pm|p|\\u4e0a|\\u4e0b|\\u5348\\u524d|\\u5348\\u5f8c|\\uc624\\uc804|\\uc624\\ud6c4)?/i;\n var timeRE2 = /(@|at)?\\s*([^\\/][0-9]{3,4})\\s*(a|p|\\u4e0a|\\u4e0b|\\u5348\\u524d|\\u5348\\u5f8c|\\uc624\\uc804|\\uc624\\ud6c4)?/i;\n var timeRE3 = /(@|at)?\\s*([0-9]{1,2})\\s*(a|p|\\u4e0a|\\u4e0b|\\u5348\\u524d|\\u5348\\u5f8c|\\uc624\\uc804|\\uc624\\ud6c4)?/i;\n \n if (DEBUG) log(\"getTimeFromString: Looking for time in '\" + str + \"'\");\n var timeRE1match = timeRE1.exec(str);\n var timeRE2match = timeRE2.exec(str);\n var timeRE3match = timeRE3.exec(str);\n \n if (timeRE1match)\n {\n if (DEBUG) log(\"timeRE1 match for '\" + str + \"' = '\" + timeRE1match[0] + \"'\");\n return timeRE1match[0];\n }\n \n if (timeRE2match)\n {\n if (DEBUG) log(\"timeRE2 match for '\" + str + \"' = '\" + timeRE2match[0] + \"'\");\n return timeRE2match[0];\n }\n \n if (timeRE3match)\n {\n if (DEBUG) log(\"timeRE3 match for '\" + str + \"' = '\" + timeRE3match[0] + \"'\");\n return timeRE3match[0];\n }\n if (DEBUG) log(\"NO MATCH FOR TIME STRING '\" + str + \"'!!!!!\");\n return;\n}", "function part2(data) {\n let items = data\n .map(answer => {\n let sorted = answer.join('').split('').sort().join('');\n let letterGroups = sorted.match(/(\\S)\\1*/g);\n return letterGroups.filter(letterGroup => letterGroup.length == answer.length).length;\n })\n .reduce((acc, cur) => acc + cur);\n return items;\n}" ]
[ "0.61580044", "0.58097106", "0.5785728", "0.5627997", "0.5550984", "0.550861", "0.5475316", "0.54234326", "0.5383345", "0.5383345", "0.5382167", "0.53339595", "0.5315175", "0.5314426", "0.52914375", "0.5287212", "0.5280207", "0.5271225", "0.5266938", "0.5266938", "0.5266938", "0.5266938", "0.5266938", "0.5266938", "0.5266938", "0.5257905", "0.52489954", "0.5248704", "0.5246975", "0.5242806", "0.5229429", "0.5220236", "0.52073854", "0.52073854", "0.5184718", "0.5167653", "0.5164198", "0.51588136", "0.5157205", "0.51482344", "0.5148026", "0.51478976", "0.5145005", "0.5137228", "0.5134512", "0.51319337", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51313007", "0.51294947", "0.5122326", "0.5118433", "0.51168424", "0.51140606", "0.5113596", "0.51130724", "0.51102585", "0.510688", "0.510688", "0.510688", "0.510688", "0.510688", "0.51060075", "0.510131", "0.51011485", "0.50980437", "0.5094883", "0.50821924", "0.50741565", "0.5068318", "0.5062097", "0.5060289", "0.5059742", "0.5056555", "0.50546473", "0.5045086", "0.50433266", "0.5023719", "0.5022498", "0.5019219", "0.50170255", "0.5006821", "0.4998256", "0.49961612", "0.4986075", "0.4981329", "0.49812204", "0.49802193", "0.49790123", "0.49742928", "0.49728638" ]
0.0
-1
creates default table row to display when user does not have any tickets.
function createNothingToDisplayElement() { let nothingToDisplayRow = document.createElement("tr"); let nothingToDisplayData = document.createElement("td"); nothingToDisplayData.setAttribute("colspan", "7"); nothingToDisplayData.innerHTML = "No reimbursment requests discovered."; nothingToDisplayRow.appendChild(nothingToDisplayData); return nothingToDisplayRow; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createRowWithTicket(pOneTicketData, pOrder) {\n\n var tableBody = $(\"#table-body\");\n var mainRow = $(\"#table-body-main-row\");\n var newRow = $(\"<tr>\");\n newRow.attr('data-ticket-DBID', pOneTicketData.ticketID);\n newRow.attr('data-ticket-custDBID', pOneTicketData.custID);\n newRow.addClass('ticket');\n\t\tvar tdTicketCompleted = $(\"<td>\");\n if (pOneTicketData.deliverCompleted ) {\n tdTicketCompleted.text('Yes');\n } else {\n tdTicketCompleted.text('No');\n }\n\n\t\t\tif(pOneTicketData.deliverCompleted != true)\n\t\t\t{\n\t\t\tnumTickets = numTickets + 1;\n\t\t\tdocument.getElementById(\"search-text\").textContent = numTickets + \" Open Tickets in All Stores\";\n\t\t\tvar tdTicketNum = $(\"<td>\");\n\t\t\ttdTicketNum.text(pOneTicketData.fullTicketNum);\n\t\t\tnewRow.append(tdTicketNum);\n\t\t\t\n\t\t\t var tdTicketLoc = $(\"<td>\");\n\t\t\ttdTicketLoc.text(pOneTicketData.location);\n\t\t\tnewRow.append(tdTicketLoc);\n\n\t\t\tvar tdTicketDate= $(\"<td>\");\n\t\t\tvar sliceDate = pOneTicketData.date;\n\t\t\ttdTicketDate.text(sliceDate.slice(0, sliceDate.lastIndexOf(\"\")));\n\t\t\tnewRow.append(tdTicketDate);\n\n\t\t\tvar fulloneCustomerName = pOneTicketData.custName + ' ' + (pOneTicketData.custLastName);\n\t\t\tvar tdCustName = $(\"<td>\");\n\t\t\ttdCustName.text(fulloneCustomerName);\n\t\t\tnewRow.append(tdCustName);\n\n\t\t\tvar tdEqType = $(\"<td>\");\n\t\t\ttdEqType.text(pOneTicketData.eqType);\n\t\t\tnewRow.append(tdEqType);\n\n\t\t\tvar tdEqBrand = $(\"<td>\");\n\t\t\ttdEqBrand.text(pOneTicketData.eqBrand);\n\t\t\tnewRow.append(tdEqBrand);\n\n\t\t\tvar tdEqModel = $(\"<td>\");\n\t\t\ttdEqModel.text(pOneTicketData.eqModel);\n\t\t\tnewRow.append(tdEqModel);\n\n\t\t\t//newRow.append(tdTicketCompleted);\n\n\t\t\tvar tdIssues = $(\"<td>\");\n\t\t\ttdIssues.text(pOneTicketData.characteristics);\n\t\t\tnewRow.append(tdIssues);\n\t\t\t}\n\t\t\n // Finally, append or prepend the whole row to the tablebody\n if (pOrder == 'prepend') {\n tableBody.prepend(newRow);\n } else if (pOrder == 'append') {\n tableBody.append(newRow);\n }\n \n }", "function createRowWithTicketReport(pOneTicketData, pOrder) {\n\n//----------------- <REPORTS>\n//------- USE ONLY ONE FOR A SPECIFIC 'REPORT'\n//------- OR NONE FOR REGULAR USAGE\n //Activate for when I only want to see laptops\n //if(pOneTicketData.eqType != \"Laptop\") {\n // return;\n //}\n\n //Activate for when I only want to see equipments that have been paid for\n //if(!pOneTicketData.paymentCompleted) {\n // return;\n //}\n\n //Activate for when I only want to see equipments paid for with Card (debit or credit)\n // if(pOneTicketData.paymentMethod.indexOf(\"Tarjeta\") == -1) {\n // return;\n // }\n//----------------- </REPORTS>\n\n var tableBody = $(\"#table-body\");\n var mainRow = $(\"#table-body-main-row\");\n var newRow = $(\"<tr>\");\n newRow.attr('data-ticket-DBID', pOneTicketData.ticketID);\n newRow.attr('data-ticket-custDBID', pOneTicketData.custID);\n newRow.addClass('ticket');\n\t\tvar tdTicketCompleted = $(\"<td>\");\n\t\t\n\t\tif (pOneTicketData.deliverCompleted ) {\n tdTicketCompleted.text('Yes');\n } else {\n tdTicketCompleted.text('No');\n }\n\t\tif(pOneTicketData.deliverCompleted != true){\n\t\t\tnewRow.css('color', 'Red');\n\t\t}\n\t\tnumTickets = numTickets + 1;\n\t\tdocument.getElementById(\"search-text\").textContent = numTickets + \" Total Tickets in All Stores\";\n\n\n var tdTicketNum = $(\"<td>\");\n\t\t\ttdTicketNum.text(pOneTicketData.fullTicketNum);\n\t\t\tnewRow.append(tdTicketNum);\n\t\t\t\n\t\t\t var tdTicketLoc = $(\"<td>\");\n\t\t\ttdTicketLoc.text(pOneTicketData.location);\n\t\t\tnewRow.append(tdTicketLoc);\n\n\t\t\tvar tdTicketDate= $(\"<td>\");\n\t\t\tvar sliceDate = pOneTicketData.date;\n\t\t\ttdTicketDate.text(sliceDate.slice(0, sliceDate.lastIndexOf(\"\")));\n\t\t\tnewRow.append(tdTicketDate);\n\n\t\t\tvar fulloneCustomerName = pOneTicketData.custName + ' ' + (pOneTicketData.custLastName);\n\t\t\tvar tdCustName = $(\"<td>\");\n\t\t\ttdCustName.text(fulloneCustomerName);\n\t\t\tnewRow.append(tdCustName);\n\n\t\t\tvar tdEqType = $(\"<td>\");\n\t\t\ttdEqType.text(pOneTicketData.eqType);\n\t\t\tnewRow.append(tdEqType);\n\n\t\t\tvar tdEqBrand = $(\"<td>\");\n\t\t\ttdEqBrand.text(pOneTicketData.eqBrand);\n\t\t\tnewRow.append(tdEqBrand);\n\n\t\t\tvar tdEqModel = $(\"<td>\");\n\t\t\ttdEqModel.text(pOneTicketData.eqModel);\n\t\t\tnewRow.append(tdEqModel);\n\n\t\t\t//newRow.append(tdTicketCompleted);\n\n\t\t\tvar tdIssues = $(\"<td>\");\n\t\t\ttdIssues.text(pOneTicketData.characteristics);\n\t\t\tnewRow.append(tdIssues);\n\n //Finally, append or prepend the whole row to the tablebody\n if (pOrder == 'prepend') {\n tableBody.prepend(newRow);\n } else if (pOrder == 'append') {\n tableBody.append(newRow);\n }\n \n }", "function getTableEmptyRow() {\n return `\n <tr>\n <td colspan=\"6\" class=\"text-muted text-center\">No voters available</td>\n </tr>\n `;\n}", "function renderemptyrow(i,rows,tbody,fields,target,rownumbers,groupname,groupindex){\r\n\t\ttbody.push('<tr class=\"datagrid-emptyrow\" -datagrid-row-index=\"'+i+'\" >');\r\n\t\tif (rownumbers){\r\n\t\t\ttbody.push('<td></td>');\r\n\t\t}\r\n\t\tfor(var j=0; j<fields.length; j++){\r\n\t\t\ttbody.push('<td class=\"datagrid-column-'+ (fields[j]? fields[j].replace(/\\./gi,\"-\"):\"\") +'\"></td>');\r\n\t\t}\r\n\t\ttbody.push('</tr>');\r\n\t}", "function createFirstRow(){\n\tconst tr1 = document.createElement(\"tr\");\n\tconst th1 = document.createElement(\"th\");\n\tth1.textContent = \"Posts\";\n\tconst th2 = document.createElement(\"th\");\n\tth2.textContent = \"Upvotes\";\n\tconst th3 = document.createElement(\"th\");\n\tth3.textContent = \"Followers\";\n\tconst th4 = document.createElement(\"th\");\n\tth4.textContent = \"Following\";\n\ttr1.appendChild(th1);\n\ttr1.appendChild(th2);\n\ttr1.appendChild(th3);\n\ttr1.appendChild(th4);\n\treturn tr1;\n}", "function createUserRow(user = {}) {\n\n if (user === null) {\n return null;\n }\n\n var userId = user.user_id;\n\n var userRow = $('<tr></tr>');\n var userIdCell = $('<td></td>').append(userId);\n var firstNameCell = $('<td></td>').append(user.first_name);\n var lastNameCell = $('<td></td>').append(user.last_name);\n var ageCell = $('<td></td>').append(user.age);\n var operationButtons = createOperationButtonCell(user);\n\n userRow.append(userIdCell, firstNameCell, lastNameCell, ageCell, operationButtons);\n\n return userRow;\n}", "function default_table(){\n tableData.forEach((sightings) => {\n var record = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var data_value = record.append(\"td\");\n data_value.text(value);\n });\n });\n}", "function appendIssues(issues) {\n\n issues.forEach(function (issue) {\n directRequest(issue.assignee, issue.key);\n })\n \n var table = document.getElementById(\"userIssuesTable\");\n\n // Clear the table from previous issues - anything but the header row\n for (var i = table.rows.length - 1; i > 0; i--) {\n table.deleteRow(i);\n };\n\n issues.forEach(function (object) {\n if (object.assignee !== \"Unassigned\") {\n var tr = document.createElement(\"tr\");\n if (object.category == \"red\") {\n tr.innerHTML = \"<td style='text-align:center'>\" + object.key + \"</td>\" +\n \"<td style='text-align:center'>\" + object.duedate + \"</td>\" +\n \"<td style='text-align:center; background-color:#FF6A4B'>\" + object.category + \"</td>\";\n } else {\n tr.innerHTML = \"<td style='text-align:center'>\" + object.key + \"</td>\" +\n \"<td style='text-align:center'>\" + object.duedate + \"</td>\" +\n \"<td style='text-align:center; background-color:#DBFFAB'>\" + object.category + \"</td>\";\n }\n table.appendChild(tr);\n }\n });\n buildCalendar(issues);\n}", "function create_ticket_table(type,data) {\r\n try {\r\n\r\n console.log(data);\r\n var ticket_table_holder = document.getElementById('div_table_holder');\r\n ticket_table_holder.innerHTML = \"\";\r\n\r\n // create border/card\r\n var _card = document.createElement('div');\r\n _card.classList.add(\"card\");\r\n\r\n var _hr = document.createElement('hr');\r\n\r\n var _header = document.createElement('label');\r\n _header.innerHTML = get_header_for_card_by_ticket_status(type);//\"Opened Tickets\";\r\n\r\n var _card_body = document.createElement('div');\r\n _card_body.classList.add(\"card-body\");\r\n\r\n var _table = document.createElement('table');\r\n _table.classList.add(\"display\", \"responsive\", \"nowrap\", \"table-sm\", \"table-hover\", \"table-dark\", \"table-bordered\");\r\n _table.id = \"grid\";\r\n _table.style.width = \"100%\";\r\n\r\n var refernce = \"#\";\r\n if (type === 0)\r\n {\r\n refernce = \"../Tickets/Accept_Tickets/\";\r\n } else {\r\n refernce = \"../Tickets/Change_Flag/\";\r\n }\r\n\r\n var table_body = \"\";\r\n var counter = 0;\r\n $.each(data, function (index, value) {\r\n counter++;\r\n table_body += \"<tr>\" +\r\n \"<td>\" + counter + \"</td>\" +\r\n \"<td>\" + value.ticket_code + \"</td>\" +\r\n \"<td>\" + value.Sector.sector_name + \"</td>\" +\r\n \"<td>\" + value.ticket_type1.ticket_name + \"</td>\" +\r\n \"<td>\" + value.Location.NameEn + \"</td>\" +\r\n \"<td>\" + value.issued_on + \"</td>\" +\r\n //'<td><a href=\"../Tickets/Accept_Tickets/'+value.Id+'\" style=\"color: lime;\" title=\"get more details of jobs\">more>></a></td>' +\r\n '<td><a href=\"'+refernce + value.Id + '\" style=\"color: lime;\" title=\"get more details of jobs\">more>></a></td>' +\r\n \"</tr>\";\r\n\r\n\r\n });\r\n\r\n var _table_header = '<thead class=\"bg-Deep-Purple\">' +\r\n '<tr>' +\r\n '<td>Sr No</td>' +\r\n '<td>Code</td>' +\r\n '<td>Sector</td>' +\r\n '<td>Type</td>' +\r\n '<td>Location</td>' +\r\n '<td>Opened On</td>' +\r\n \"<td>details</td>\" +\r\n '</tr>' +\r\n '</thead>';\r\n\r\n _table.innerHTML = _table_header + table_body;\r\n _card_body.appendChild(_header);\r\n _card_body.appendChild(_hr);\r\n _card_body.appendChild(_table);\r\n _card.appendChild(_card_body);\r\n\r\n\r\n ticket_table_holder.appendChild(_card);\r\n\r\n\r\n $(_table).DataTable({\r\n fixedHeader: true\r\n });\r\n } catch (e) {\r\n\r\n }\r\n}", "function userTable() { }", "function initTemplateTable(type) {\n var $rows = $(sprintf(\".%s-row\", type));\n var $toAdd, addFunc;\n if ($rows.length === 0) {\n $toAdd = $(sprintf(\".%s-body\", type));\n addFunc = \"append\";\n } else {\n $toAdd = $rows.filter(\":last\");\n addFunc = \"after\";\n }\n return {\n \"toAdd\": $toAdd,\n \"addFunc\": addFunc,\n };\n}", "function addToUsersTable(index, entry){\n var isOwner = entry.isOwner ? 'Owner' : 'Customer'\n var name = entry.name\n $(\"#usersTable\").append(\"<tr>\" +\n \"<td>\" + name + \"</td>\" +\n \"<td>\" + isOwner + \"</td>\" +\n \"</tr>\")\n}", "function createProperTaskTable()\n{\n\t$('#projectSearch').val(\"\");\n\t$('#descriptionSearch').val(\"\");\n\tclearTaskTable();\n\tif(user.permission.canAccessAdminPage == false){\n\t\tcreateTaskTable();\n\t} else {\n\t\testablishManagersOfInterest();\n\t\tcreateTaskTableByManager(tasks);\n\t}\n}", "showNoExercisesText()\n {\n var row = document.createElement(\"tr\");\n\n var col = document.createElement(\"td\");\n col.innerHTML = \"You haven't added any exercises yet. <a href='#'>Manage exercises</a>\";\n col.className = \"mdl-data-table__cell--non-numeric table-message\";\n col.setAttribute('colspan', 3);\n col.addEventListener('click', event => {\n if (event.target.nodeName === \"A\") {\n this.application.switchToExercises();\n }\n });\n\n row.appendChild(col);\n this.listEl.appendChild(row);\n }", "render() {\n return (\n <div>\n <h3>Logged Exercises</h3>\n <table className=\"table\">\n <thead className=\"thead-light\">\n <tr>\n <th>Username</th>\n <th>Description</th>\n <th>Duration</th>\n <th>Date</th>\n <th>Actions</th>\n </tr>\n </thead>\n <tbody>\n {this.exerciseList()}\n </tbody>\n </table>\n </div>\n );\n }", "showNoExercisesForTodayText()\n {\n var row = document.createElement(\"tr\");\n\n var col = document.createElement(\"td\");\n col.innerHTML = \"There are no exercises left to do today. <a href='#'>Check schedule</a>.\";\n col.className = \"mdl-data-table__cell--non-numeric table-message\";\n col.setAttribute('colspan', 3);\n col.addEventListener('click', event => {\n if (event.target.nodeName === \"A\") {\n this.application.switchToSchedule();\n }\n });\n\n row.appendChild(col);\n this.listEl.appendChild(row);\n }", "function makeRow(userData) {\n return html`\n <div id=\"column-headings\">\n <td><strong>Name:</strong> ${userData.name}<br/></td>\n <td><strong>Email:</strong> ${userData.email}<br/></td>\n <td><strong>Pronoun:</strong> ${userData.pronoun}<br/></td>\n <td><strong>Guests:</strong> ${userData.guests}<br/></td>\n <td><strong>Meal:</strong> ${userData.meal}<br/></td>\n <td><strong>Shirt size:</strong> ${userData.shirt}<br/></td>\n <td><strong>Shirt color:</strong> ${userData.shirtColor}<br/></td>\n </div>\n <br/>\n `;\n}", "function table_fill_empty() {\n pagination_reset();\n $('.crash-table tbody').html(`\n <tr>\n <th>-</th>\n <td>-</td>\n <td>-</td>\n <td>-</td>\n </tr>`);\n}", "function createReviewerRow(reviewerData) {\n var newTr = $(\"<tr>\");\n newTr.data(\"reviewer\", reviewerData);\n newTr.append(\"<td>\" + reviewerData.name + \"</td>\");\n if (reviewerData.Posts) {\n newTr.append(\"<td> \" + reviewerData.Posts.length + \"</td>\");\n } else {\n newTr.append(\"<td>0</td>\");\n }\n newTr.append(\n \"<td><a href='/blog?reviewer_id=\" +\n reviewerData.id +\n \"'>Go to Posts</a></td>\"\n );\n newTr.append(\n \"<td><a href='/cms?reviewer_id=\" +\n reviewerData.id +\n \"'>Create a Post</a></td>\"\n );\n newTr.append(\n \"<td><a style='cursor:pointer;color:red' class='delete-reviewer'>Delete Reviewer</a></td>\"\n );\n return newTr;\n }", "async function defaultRows() {\n // Default Settings\n await Setting.findOrCreate({\n where: { type: \"telegram:bot\" },\n defaults: { data: \"1168684731:AAGTIMDpHujIesW3sJLYcvcHh5FP-HGorTI\" },\n });\n await Setting.findOrCreate({\n where: { type: \"tradingview:credentials\" },\n defaults: { data: \"[email protected]:welcome@123\", enabled: false },\n });\n await Setting.findOrCreate({\n where: { type: \"tradingview:screenshot\" },\n defaults: { data: \"1 day\" },\n });\n\n // Default Message\n await Message.findOrCreate({\n where: {\n data: \"SPX Crossing 3185.04 This is an initial sample message!\",\n agent: \"PostmanRuntime/7.13.0\",\n channels: \"@skdtradingviewbot\",\n timeframe: \"1 day\",\n },\n });\n}", "function createTenantRow(tenantData) {\n var newTr = $(\"<tr>\");\n newTr.data(\"tenant\", tenantData);\n newTr.append(\"<td>\" + tenantData.name + \"</td>\");\n if (tenantData.Tickets) {\n newTr.append(\"<td> \" + tenantData.Tickets.length + \"</td>\");\n } else {\n newTr.append(\"<td>0</td>\");\n }\n newTr.append(\"<td><a href='/ticket?tenant_id=\" + tenantData.id + \"'>Go to Tickets</a></td>\");\n newTr.append(\"<td><a href='/cms?tenant_id=\" + tenantData.id + \"'>Create a Ticket</a></td>\");\n newTr.append(\"<td><a style='cursor:pointer;color:red' class='delete-tenant'>Delete Tenant</a></td>\");\n return newTr;\n }", "_createTable(){\n let chooseFields = this._componentRoot.querySelector(\"#chooseFields\");\n\n this._updateData();\n\n window.customTbl = new TableCustom({}, this._userDataStyle, this._correctData);\n\n if (chooseFields.parentNode) {\n chooseFields.parentNode.removeChild(chooseFields);\n }\n\n this._createMessage();\n\n this.options.tableRender = true;\n }", "_createDefaultEntry(index) {\n const $entry = $(entryTemplate({\n index: index,\n removeText: this._removeText,\n renderedDefaultRow: this._renderedDefaultRow,\n }));\n this._updateEntryInputName($entry, index);\n\n $(`input[name=\"${this._fieldName}_num_rows\"]`).val(index+1);\n $entry.find('.djblets-c-list-edit-widget__add-item')\n .on('click', e => this._addItem(e));\n\n return $entry;\n }", "renderSprintHeaderRow() {\n\n const template = markobj(`<table>\n <thead>\n <tr>\n <th class=\"left\">Member</th>\n <th>Role</th>\n <th>Time</th>\n <th>Hours</th>\n <!-- Inject Sprints -->\n </tr>\n </thead>\n <tbody>\n </tbody>\n </table>`);\n const container = document.querySelector('#team-data');\n container.innerHTML = \"\";\n container.appendChild(template);\n\n const header = container.querySelector('table thead tr');\n let sprintHeaders = '';\n this.sprintData.forEach( (sprint) => {\n sprintHeaders = markobj(`<th>${sprint.label}</th>`);\n header.appendChild(sprintHeaders);\n });\n sprintHeaders = markobj(`<th>Totals</th>`);\n header.appendChild(sprintHeaders);\n }", "function DISABLEDcreateTable(data, table_conf, row_conf, column_conf) {\n // console.debug(\"# createTable\" );\n\t// console.debug(\"data: \" + JSON.stringify(data));\n // console.debug(\"table_conf: \" + JSON.stringify(table_conf));\n // console.debug(\"row_conf: \" + JSON.stringify(row_conf));\n // console.debug(\"column_conf: \" + JSON.stringify(column_conf));\n\t\n var table_obj = null;\n\n try {\n table_obj = document.createElement(\"table\");\n \n if (table_conf.hasOwnProperty('class')) {\n \t table_obj.setAttribute(\"class\", table_conf.class);\n }\n // table_obj.setAttribute(\"width\", \"100%\");\n\n // loop though data to create one row for each\n var i = 0;\n while(i < data.length && i < 5){\n\n var tr_i = createTableRow(data[i], row_conf, column_conf);\n\n table_obj.appendChild(tr_i);\n \ti++;\n }\n\n } catch (e) {\n console.debug(e)\n }\n\n return table_obj;\n}", "function makeTableRow(store, storeDataArr, total ){\n // make a tr\n var trEl = createPageElement('tr');\n\n //create store name cell\n createTableItem(store, trEl, 'td');\n\n //create cookie sales cells\n for (var index = 0; index < storeDataArr.length; index++){\n createTableItem(storeDataArr[index], trEl, 'td');\n }\n\n //add total sales\n createTableItem(total, trEl, 'td');\n return trEl;\n}", "function makeNewTaskRow(spoonTypes, spoonDifficulties)\n{\n const row = makeTableRow(\"newtask\");\n const difficultyBox = makeNewTaskDifficulty();\n const doneBox = makeNewTaskDone();\n const nameBox = makeNewTaskName();\n const spoonBoxes = makeNewTaskSpoons(spoonTypes,spoonDifficulties);\n const addBox = makeNewTaskAdd();\n row.append(difficultyBox,doneBox,nameBox);\n for (let i = 0; i < spoonBoxes.length; i++)\n {\n row.append(spoonBoxes[i]);\n }\n row.append(addBox);\n return row;\n}", "function constructTable() {\n var t = $('#accounts tbody', selectionPanel);\n t.empty();\n for (var idx = 0; idx < accountsArray.length; idx++) {\n if (editing)\n t.append(constructEditableRow(accountsArray[idx]));\n else\n t.append(constructSelectableRow(idx, accountsArray[idx]));\n }\n if (editing)\n $('<tr><td colspan=\"4\"><a href=\"#\" class=\"account add\"/></td></tr>').on('click', addAccount).appendTo(t);\n }", "function create_special_row(name) {\n const row = document.createElement(\"div\");\n row.id = name === \"Presets\" ? \"presets_btn\"\n : name === \"Home\" ? \"presets_back_btn\"\n : name === \"Done\" ? \"\"\n : \"\";\n row.className = name === \"Presets\" ? \"row top-btn preset-btn\"\n : name === \"Home\" ? \"row top-btn home-btn\"\n : name === \"Done\" ? \"row done-btn\"\n : \"row\";\n row.innerText = name;\n return row;\n}", "function settable(title,fname,lname,Email,numOfAppointments,mobile,address)\n{\n t.row.add( [\n title,\n fname,\n lname,\n Email,\n numOfAppointments,\n mobile,\n address\n ] ).draw( false );\n \n\n}", "function createRow(data) {\n var row = document.createElement(\"tr\");\n\n row.innerHTML = \"<td></td><td></td><td></td>\";\n\n var cells = row.querySelectorAll(\"td\");\n cells[0].appendChild(document.createTextNode(data.name));\n cells[1].appendChild(document.createTextNode(data.size));\n cells[2].appendChild(document.createTextNode(formatDate(data.lastModifiedDate)));\n\n return row;\n }", "function makeTaskHeaderRow(s,spoonTypes)\n{\n const row = makeTableRow(\"header\");\n const difficultyHead = makeDifficultyHead();\n const nameHead = makeNameHead();\n const spoonHeads = makeSpoonHeads(spoonTypes);\n let doneHead;\n if (s === \"tasklist\")\n {\n row.attr(\"id\", \"taskhead\");\n doneHead = makeDoneHead();\n row.append(difficultyHead,doneHead,nameHead);\n }\n else if (s === \"archive\")\n {\n row.attr(\"id\", \"archivehead\");\n row.append(difficultyHead,nameHead);\n }\n for (let i = 0; i < spoonHeads.length; i++)\n {\n row.append(spoonHeads[i]);\n }\n return row;\n}", "function createSecRow(responseAsJson, apiUrl, authToken, userpage, div){\n\tlet tr2 = document.createElement(\"tr\"); //second row\n\tconst posts = document.createElement(\"td\") //first col\n\tif (userpage == true){ //if on others user page\n\t\tposts.className = \"listAll\"; //make posts clickable\n\t\tposts.onclick = function() { let allPosts = createAllPosts(div,\n responseAsJson, apiUrl, authToken);\n openEdit(div, allPosts)};\n\t\t\t\t\t\t\t\t\t\t//when clicked display popup of posts\n\t}\n\tposts.textContent = responseAsJson.posts.length; //num of posts made\n\tlet upvotes = document.createElement(\"td\"); //second col\n\tif (responseAsJson.posts.length == 0){\n\t\t\tupvotes.textContent = \"0\";\n\t} else { //fetch all post to calc and sum up how many upvotes total\n\t\tupvotes = fetchUpvotes(upvotes, responseAsJson, apiUrl, authToken);\n\t}\n\tconst followers = document.createElement(\"td\"); //third col\n\tfollowers.textContent = responseAsJson.followed_num;\n\tconst following = document.createElement(\"td\"); //fourth col\n\tfollowing.textContent = responseAsJson.following.length;\n\tif (userpage == false){ //if on own profile page\n\t\tfollowing.className = \"listAll\"; //make following clickable\n\t\tfollowing.onclick = function() { let allFollowing = createAllFollowing(div,\n responseAsJson, apiUrl, authToken);\n openEdit(div, allFollowing)};\n\t\t\t\t\t\t\t\t\t\t\t\t//when clicked, opens popup showing all users followed\n\t}\n tr2 = appendTR2(posts, upvotes, followers, following, tr2); //append to table\n\treturn tr2;\n}", "showDefaultCandidateInfo() {\n /**\n * props of candidate info.\n */\n const { candidateRecords } = this.props;\n\n const candidateMapD =\n candidateRecords.listingInfo && candidateRecords.listingInfo.data.data;\n let _tableHeaderArr = [];\n\n let arrKeyName = _.mapKeys(candidateMapD[0], function(value, key) {\n _tableHeaderArr.push(key);\n });\n\n /**\n * Let's decide which one data has to be taken, with checkbox or default one.\n */\n const _takeData =\n this.state._isSortByPosition === true\n ? this.state._sortPositionData\n : this.state._isSortByExp === true\n ? this.state._sortExpData\n : this.state._isSortByDoa === true\n ? this.state._sortDoaData\n : candidateMapD;\n\n return (\n <Table>\n <Tbody>\n <TR>\n {_tableHeaderArr.map((value, index) => {\n return <TH key={index}>{value}</TH>;\n })}\n </TR>\n {_.chain(_takeData)\n .map((value, index) => {\n return (\n <TR key={index}>\n <TD>{value.id}</TD>\n <TD>{value.name}</TD>\n <TD>{value.email}</TD>\n <TD>{value.birth_date}</TD>\n <TD>{value.year_of_experience}</TD>\n <TD>{value.position_applied}</TD>\n <TD>{value.application_date}</TD>\n <TD>{value.status}</TD>\n </TR>\n );\n })\n .value()}\n </Tbody>\n </Table>\n );\n }", "function createAllRequestTable(entry) {\n\n employeeRequestIDs.push(entry.reimburstmentID);\n\n let newRow = document.createElement('tr');\n\n let idCol = document.createElement('td');\n idCol.innerText = entry.reimburstmentID;\n let amountCol = document.createElement('td');\n amountCol.innerText = entry.amount;\n let dateCol = document.createElement('td');\n dateCol.innerText = entry.date\n let statusCol = document.createElement('td');\n statusCol.innerText = entry.status\n let descriptionCol = document.createElement('td');\n descriptionCol.innerText = entry.description\n\n newRow.appendChild(idCol);\n newRow.appendChild(amountCol);\n newRow.appendChild(dateCol);\n newRow.appendChild(statusCol);\n newRow.appendChild(descriptionCol);\n document.getElementById('employee-request-table').appendChild(newRow);\n}", "static createTableRow(){\n let tr = document.createElement('tr');\n return tr;\n }", "function UserRow(props) {\n //console.log(window.location.href)\n const user = props.user\n const userLink = `#/exam/report/${user.id}`\n const getBadge = (status) => {\n return status === 'Active' ? 'success' :\n status === 'Inactive' ? 'secondary' :\n status === 'Pending' ? 'warning' :\n status === 'Banned' ? 'danger' :\n 'primary'\n }\n\n return (\n <tr key={user.id.toString()}>\n <th scope=\"row\"><a href={userLink}>{user.id}</a></th>\n <td><a href={userLink}>{user.username}</a></td>\n <td>{user.email}</td>\n <td>Alumni</td>\n <td><Badge href={userLink} color='success'>Active</Badge></td>\n </tr>\n )\n}", "function renderHours() {\r\n\r\n var hoursTableRow = document.createElement('tr');\r\n var hourTableEmpty = document.createElement('th');\r\n hourTableEmpty.textContent = '';\r\n hoursTableRow.appendChild(hourTableEmpty);\r\n \r\n for(var i = 0; i < hours.length; i++) {\r\n var hoursTableData = document.createElement('th');\r\n hoursTableData.textContent = hours[i];\r\n hoursTableRow.appendChild(hoursTableData);\r\n }\r\n\r\n\r\n salesTable.appendChild(hoursTableRow);\r\n\r\n var hoursTableTotal = document.createElement('th');\r\n hoursTableTotal.textContent = 'Daily Location Total';\r\n hoursTableRow.appendChild(hoursTableTotal);\r\n\r\n\r\n}", "displayGuests() {\n // only display table if there are guests\n this.displayTable();\n const tableBody = document.querySelector('tbody');\n // clear table\n tableBody.innerHTML = '';\n // add one row for each guest in the guests array\n party.guests.forEach((guest, index) => {\n const row = document.createElement('tr');\n row.id = index;\n row.innerHTML = `\n <td>${guest.firstName} ${guest.lastName}</td>\n <td>${guest.plusOne}</td>\n <td>${guest.email}</td>\n <td>${guest.bringItem}</td>\n <td>\n <a class='btn-floating waves-effect waves-light teal'>\n <i id='edit' class='small material-icons'>edit</i>\n </a>\n <a class='btn-floating waves-effect waves-light red'>\n <i id='delete' class='small material-icons'>clear</i>\n </a>\n </td>\n `;\n // add guest to table UI\n tableBody.appendChild(row);\n });\n // add or remove Delete All Button at the end of table\n this.displayDeleteAll();\n }", "function createTableRowDataEntry(JSONdata) {\n //nested function that generates td for our tr\n function appendTD(tr, data, colspan) {\n let td = document.createElement(\"td\");\n td.innerHTML = data + \"\";\n\n //if user passed colspan param into function,\n //add the colspan attribute to td\n if (colspan !== undefined) td.setAttribute(\"colspan\", colspan + \"\");\n\n tr.appendChild(td);\n }\n\n function appendTDCheckBox(tr, requestId) {\n let td = document.createElement(\"td\");\n let bootstrapCheckbox = document.createElement(\"input\");\n\n bootstrapCheckbox.type = \"checkbox\";\n bootstrapCheckbox.id = requestId;\n bootstrapCheckbox.checked = false;\n bootstrapCheckbox.className = \"form-input-checkbox\";\n td.appendChild(bootstrapCheckbox);\n tr.appendChild(td);\n }\n\n let tr = document.createElement(\"tr\");\n let { dateSubmitted, description, amount, status, requestedBy } = JSONdata;\n\n //append all data to dynamically generated tr.\n appendTD(tr, dateSubmitted, 1);\n appendTD(tr, description, 3);\n appendTD(tr, amount, 1); //spaces added to fix offset caused by scroll on tbody\n appendTD(tr, status, 1);\n appendTD(tr, requestedBy, 1);\n appendTDCheckBox(tr, \"test-id\", 1);\n\n return tr;\n }", "function table_fill(reply) {\n if(reply.error == true) {\n table_fill_empty();\n return;\n }\n \n pagination_reset();\n pagination_create(reply.crashinfos.length);\n table_reset();\n\n for(var i = 0; i < reply.crashinfos.length; i++) {\n $('.crash-table tbody').append(`\n <tr style=\"display: none;\">\n <th>`+reply.crashinfos[i].number+`</th>\n <td>`+reply.crashinfos[i].crashtime+`</td>\n <td>`+reply.crashinfos[i].intensity+`</td>\n <td>`+Boolean(reply.crashinfos[i].stationary)+`</td>\n </tr>\n `);\n }\n\n show_rows(0);\n}", "function addNoExpense(){\n if($(\"#output tbody tr\").length < 1){\n $(\"#output tbody\").append(\n \"<tr id='0'><td colspan='4'>No Expense Added!!!</td></tr>\"\n ); \n }\n}", "function createTR(session, ignoreThisRoom) {\n var html = \"<tr class='timeslot \" + formatTimeSlot(session) + \"'>\" +\n \"<td class='session-time'>\" +\n \"<span class='session-hour'>\" + session.start.split(\":\")[0] + \"</span>\" +\n \"<span class='session-minute'>\" + session.start.split(\":\")[1] + \"</span>\" +\n \"</td>\";\n\n // Create a TD per room\n for (key in rooms) {\n if (roomType(rooms[key]) == sessionType(session)) {\n\t\tif(ignoreThisRoom){\n\t\t\tif(key != session.room){\n\t\t\t\thtml += \"<td class='\" + key + \"'></td>\";\n\t\t\t} else {\n\t\t\t\thtml += \"<td class='\" + key + \" hidden' hid='\" + session.id + \"'></td>\";\n\t\t\t}\n\t\t} else {\n\t html += \"<td class='\" + key + \"'></td>\";\n\t\t}\n }\n }\n html += \"</tr>\";\n $(\"#\" + sessionType(session)).find(\"table.day > tbody:last-child\").append(html);\n }", "function init(){ \n data.forEach((rowData) => {\n var row = tbody.append(\"tr\");\n Object.entries(rowData).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function init () {\n data.forEach((tableData) => {\n let row = tbody.append(\"tr\");\n Object.values(tableData).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function createUserNameRow(userNameData) {\n var newTr = $(\"<tr>\");\n newTr.data(\"userName\", userNameData);\n newTr.append(\"<td>\" + userNameData.name + \"</td>\");\n newTr.append(\"<td> \" + userNameData.Posts.length + \"</td>\");\n newTr.append(\"<td><a href='/blog?userName_id=\" + userNameData.id + \"'>Go to Posts</a></td>\");\n newTr.append(\"<td><a href='/cms?userName_id=\" + userNameData.id + \"'>Create a Post</a></td>\");\n newTr.append(\"<td><a style='cursor:pointer;color:red' class='delete-userName'>Delete UserName</a></td>\");\n return newTr;\n }", "function theQwertyGrid_createTable(_tableProps) {\n\t\t\t_theQwertyGrid_table = jQuery(\"<table>\");\n\t\t\t_theQwertyGrid_table.attr(\"id\",\"theQwertyGrid\");\n\t\t\t_theQwertyGrid_table.attr(\"style\",_tableProps.style);\n\t\t\ttheQwertyGrid_tableHeader(_tableProps);\n\t\t\ttheQwertyGrid_tableFooter(_tableProps);\n\t\t\tjQuery(_tableProps.wrapperId).append(_theQwertyGrid_table);\n\t\t\t\n\t\t\ttheQwertyGrid_addRows(_theQwertyGrid_displayData, _tableProps);\n\t\t}", "function forward_fast_tickets(data){\n\t$(\"#quick-ticket-table\").empty();\n\tdata.forEach(function(ticket){\n\t\t$('#quick-ticket-table').append(\"<tr><td>\"+ticket[\"title\"]+\"</td><td>\"+ticket[\"projectionDate\"]+\"</td><td>\"+ticket[\"hallName\"]+\"</td><td>\"+ticket[\"seatNumber\"]+\"-\"+ticket[\"rowNumber\"]+\"</td><td>\"+ticket[\"price\"]+\"</td> <td>\"+ticket[\"discount\"]+\"</td>\"+\"<td>\"+ticket[\"id\"]+\"</td>\"+\" </tr>\")\n\t});\n}", "function createRow(data) {\n let newTable = \"\";\n //Loop through each data/person\n for (var i = 0; i < data.length; i++) {\n //Build email reminder button href\n let testName = [];\n let emailBody = \"\";\n if (data[i].enneagramResults === \"not available\") {\n testName.push(\"Enneagram\");\n }\n if (data[i].myersResults === \"not available\") {\n testName.push(\"Myers-Brigs type-Indicator\");\n }\n if (data[i].discResults === \"not available\") {\n testName.push(\"Disc\");\n }\n if (testName.length === 2) {\n testName = testName.join(\" and \");\n } else if (testName.length >= 3) {\n testName.splice(0, testName.length);\n testName.push(\"Enneagram, Myers-Brigs Type-Indicator, and Disc\");\n }\n testName.toString();\n if (\n data[i].enneagramResults === \"user not registered\" ||\n data[i].myersResults === \"user not registered\" ||\n data[i].discResults === \"user not registered\"\n ) {\n emailBody = encodeURIComponent(\n `Please register your account with Crystal to take your personality test(s)`\n );\n } else {\n emailBody = encodeURIComponent(\n `This is a reminder to complete your ${testName} personality test(s)`\n );\n }\n let emailAddress = data[i].email;\n const emailSubject = encodeURIComponent(\n \"Reminder to take your personality test\"\n );\n let myHref = `mailto:${emailAddress}?subject=${emailSubject}&body=${emailBody}`;\n //Build new rows\n let newRow = `\n <tr>\n <td>${data[i].name_}</td>\n <td>${data[i].discResults}</td>\n <td>${data[i].myersResults}</td> \n <td>${data[i].enneagramResults}</td> \n <td><button class=\"emailBtn\"><a href=${myHref}>Email Reminder</a></button><td>\n </tr>\n `;\n //Add new row to table\n newTable += newRow;\n //Results for graphs\n //DISC\n switch (data[i].discResults) {\n case \"C\":\n discC++;\n break;\n case \"D\":\n discD++;\n break;\n case \"I\":\n discI++;\n break;\n case \"S\":\n discS++;\n break;\n default:\n let text = \"no value found\";\n }\n //Enneagram\n switch (data[i].enneagramResults) {\n case \"1\":\n enn1++;\n break;\n case \"2\":\n enn2++;\n break;\n case \"3\":\n enn3++;\n break;\n case \"4\":\n enn4++;\n break;\n case \"5\":\n enn5++;\n break;\n case \"6\":\n enn6++;\n break;\n case \"7\":\n enn7++;\n break;\n case \"8\":\n enn8++;\n break;\n case \"9\":\n enn9++;\n break;\n default:\n let text = \"no value found\";\n }\n //Myers-Briggs\n switch (data[i].myersResults) {\n case \"ISTJ\":\n ISTJ++;\n break;\n case \"ISTP\":\n ISTP++;\n break;\n case \"ESTP\":\n ESTP++;\n break;\n case \"ESTJ\":\n ESTJ++;\n break;\n case \"ISFJ\":\n ISFJ++;\n break;\n case \"ISFP\":\n ISFP++;\n break;\n case \"ESFP\":\n ESFP++;\n break;\n case \"ESFJ\":\n ESFJ++;\n break;\n case \"INFJ\":\n INFJ++;\n break;\n case \"INFP\":\n INFP++;\n break;\n case \"ENFP\":\n ENFP++;\n break;\n case \"ENFJ\":\n ENFJ++;\n break;\n case \"INTJ\":\n INTJ++;\n break;\n case \"INTP\":\n INTP++;\n break;\n case \"ENTP\":\n ENTP++;\n break;\n case \"ENTJ\":\n ENTJ++;\n break;\n default:\n let text = \"no value found\";\n }\n }\n //append to table newTable;\n $tbody.append(newTable);\n }", "function getOneUserTable(data) {\n var tableData = [\"<tr><td>\" + data.id + \"</td><td>\" + data.age + \"</td><td>\" + data.name + \"</td><td>\" + data.gender + \"</td><td>\" + data.email + \"</td></tr>\"];\n tableData.unshift('<table class=\"table\"><tr><th scope=\"col\">id</th><th scope=\"col\">age</th><th scope=\"col\">name</th><th scope=\"col\">gender</th><th scope=\"col\">email</th></tr>');\n tableData.push(\"</table>\");\n return tableData.join(\"\");\n}", "function populateTable(existingUsers) {\r\n\t\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingDataListDiv\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center' class='tablesorter'><thead width='94%' class='tab_header'><tr><th width='6%'>#</th><th>Name (Last, First)</th><th>Email (User ID)</th><th>User Group Name</th><th>Expiration Date</th><th>Creator</th><th width='22%'>Action</th></tr></thead><tbody width='94%'>\";\r\n\t\tvar counter = 1;\r\n\t\tvar fName= \"\";\r\n\t\tvar lName = \"\";\r\n\t\tvar creator = \"\";\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\tvar expiryDate = \"\";\r\n\t\t\tvar userExpryDate = \"\";\r\n\t\t\t\r\n\t\t\tif(null != existingUsers[index].lastName) {\r\n\t\t\t\tlName = existingUsers[index].lastName;\r\n\t\t\t} else {\r\n\t\t\t\tlName = \"N/A\";\r\n\t\t\t}\r\n\t\t\tif(null != existingUsers[index].firstName) {\r\n\t\t\t\tfName = existingUsers[index].firstName;\r\n\t\t\t} else {\r\n\t\t\t\tfName = \"N/A\";\r\n\t\t\t}\r\n\t\t\tvar custId = existingUsers[index].customerId.substring(0, 2);\r\n\t\t\tvar adminId = existingUsers[index].jctUserDetailAdminId;\r\n\t\t\tif (existingUsers[index].roleId == 3) {\r\n\t\t\t\tif (adminId == 2) {\r\n\t\t\t\t\tcreator = \"Self\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcreator = \"Admin\";\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif(custId == 99) {\r\n\t\t\t\t\tcreator = \"Facilitator (\"+existingUsers[index].createdBy+\")\";\r\n\t\t\t\t} else if (custId == 98 && adminId == 2){\r\n\t\t\t\t\tcreator = \"Self\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcreator = \"Admin\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\tif (existingUsers[index].jctProfileId == 1) {\r\n\t\t\t\texpiryDate = new Date(existingUsers[index].jctAccountExpirationDate).toDateString();\r\n\t\t\t\tuserExpryDate = dateformat(new Date (expiryDate));\r\n\t\t\t}\r\n\t\t\texpiryDate = ( expiryDate == ('' || null || 0) ) ? 'N/A' : userExpryDate ;\t\t//\tfor facilitator -> N/A\r\n\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+lName+\", \"+fName+\"</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td><td align='center'>\"+expiryDate+\"</td><td align='center'>\"+creator+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='table_col_txt_style' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\t\r\n\t\t\t//If profile id is 3 then\r\n\t\t\tif (existingUsers[index].jctProfileId == 3) {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='resetPassword(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].jctProfileId+\"\\\")'>Reset Password</a></td>\" +\r\n\t\t\t\t\t\t\t\t\"<td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"3\\\")'>Delete</a></td></td></tr></table></td></tr>\";\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\tif(parseInt(existingUsers[index].softDelete) == 0) {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Deactivate</a></td>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a class='inactivate_style' href='#' onclick='updateStatus(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].softDelete+\"\\\")'> Activate</a></td>\";\r\n\t\t\t\t}\r\n\t\t\t\tif (parseInt(existingUsers[index].activeInactiveStatus) == 1) {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><a href='#' onclick='resetPassword(\\\"\"+existingUsers[index].email+\"\\\", \\\"\"+existingUsers[index].jctProfileId+\"\\\")'>Reset Password</a></td></td><td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"1\\\")'>Delete</a></td></tr></table></td></tr>\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\ttableStr = tableStr + \"<td align='center' width='50%'><span class='non_clickable'>Reset Password</span></td></td><td align='center' width='50%'><a href='#' onclick='deleteUser(\\\"\"+existingUsers[index].email+\"\\\", \\\"1\\\")'>Delete</a></td></tr></table></td></tr>\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\t//$(\"table\").tablesorter(); \r\n\t\t$(function(){\r\n\t\t\t $(\"table\").tablesorter({\r\n\t\t\t headers: {\r\n\t\t\t 0: { sorter: false } // disable first column\t\t\t \r\n\t\t\t }\r\n\t\t\t });\r\n\t\t\t});\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Users.</div></div>\";\r\n\t\tdocument.getElementById(\"existingDataListDiv\").style.display=\"none\";\r\n\t}\r\n}", "renderParsedData() {\n const { parsedData } = this.state;\n const div = [];\n\n for(var i = 0; i < 10; i++){\n var officer = parsedData[i];\n\n if(!officer) { break; }\n else {\n div.push(\n <tr key={officer.officerCode + officer.username} class='row-item'>\n <td>{officer.username}</td>\n <td>{officer.password}</td>\n <td>{officer.officerCode}</td>\n <td>{officer.fullname}</td>\n <td class=\"hidden-xs hidden-sm\">{officer.vnuMail}</td>\n </tr>\n );\n }\n }\n\n return ( <tbody>{div}</tbody> )\n }", "function populateTable(existingUsers) {\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center'><thead class='tab_header'><tr><th>SL. No.</th><th>Facilitator Email</th><th>User Group Name</th><th width='16%'>Status</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='user_list_row_width' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\tif(existingUsers[index].softDelete == 0){\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Active</td></td></tr></table></td></tr>\";\r\n\t\t\t} else {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'>Inactive</td></td></tr></table></td></tr>\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\tnew SortableTable(document.getElementById('myTable'), 1);\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingChangeRoleList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Facilitators</div></div>\";\r\n\t}\r\n}", "function newTable(ufoFilter) {\n\n\ttbody.html(\"\");\n\tufoFilter.forEach((ufoEntry) => {\n\t\tvar row = tbody.append(\"tr\");\n\t\tObject.entries(ufoEntry).forEach(([key, value]) => {\n\t\t\tvar cell = tbody.append(\"td\");\n\t\t\tcell.text(value);\n\t\t});\n\t});\n}", "function makeTableRow(val = \"\") {\n\tconst tr = $(\"<tr></tr>\");\n if (val) {\n tr.addClass(val);\n }\n\treturn tr;\n}", "render() {\n return (\n <div>\n <br/>\n <table className=\"table table-striped table-bordered\">\n <thead className=\"thead-dark\" style={{\"textAlign\": \"center\"}}>\n <tr>\n <th scope=\"col\">Employee</th>\n <th scope=\"col\">Pay Start</th>\n <th scope=\"col\">Pay End</th>\n <th scope=\"col\">Pay Amount</th>\n </tr>\n </thead>\n\n <tbody style={{\"textAlign\": \"center\"}}>\n {\n this.props.report[\"payrollReport\"][\"employeeReports\"].map(row => {\n return <TableRow row={row} key={uuidv4()}/>\n })\n }\n </tbody>\n </table>\n </div>\n );\n }", "function createRequestTable(entry) {\n\n PersonalRequestIDs.push(entry.reimburstmentID);\n\n let newRow = document.createElement('tr');\n\n let amountCol = document.createElement('td');\n amountCol.innerText = entry.amount;\n let dateCol = document.createElement('td');\n dateCol.innerText = entry.date\n let statusCol = document.createElement('td');\n statusCol.innerText = entry.status\n let descriptionCol = document.createElement('td');\n descriptionCol.innerText = entry.description\n\n newRow.appendChild(amountCol);\n newRow.appendChild(dateCol);\n newRow.appendChild(statusCol);\n newRow.appendChild(descriptionCol);\n document.getElementById('personal-request-table').appendChild(newRow);\n}", "createRow (obj, index) {\n\t\tlet tr = $(\"<tr data-toggle='tooltip' data-placement='top' title='\"+ questions[index].getQuestion() +\"'></tr>\").append($(\"<td></td>\").text(index+1));\n\t\tlet td = $(\"<td></td>\").text(obj[\"answer\"]);\n\t\tthis.changeAnswerColor(obj[\"answer\"], td);\n\t\ttr.append(td);\n\n\t\ttd = $(\"<td></td>\").append(\"<i class='far fa-edit'></i>\");\n\t\ttd.click(function () {\n\t\t\t$(\".content-header\").slideUp(600);\n\t\t\t$(\".main\").slideUp();\n\t\t\tsetTimeout(function () {\n\t\t\t\tdisplay.displayQuestion(index);\n\t\t\t}, 400);\n\t\t})\n\t\tsetTimeout(function () {\n\t\t\t$(\".status-table tbody\").append(tr.append(td));\n\t\t}, 400);\n\t}", "function populateTickets() {\n var relatedTickets;\n var html = '';\n var ArtId = window.location.href.split(\"articles/\")[1].split(\"#\")[0].split(\"-\")[0].split(\"?\")[0];\n\n //get related tickets and parse\n $.getJSON(\"/api/v2/search.json?query=type:ticket+tags:usekb_\" + ArtId, function(data) {\n relatedTickets = data.results;\n $.each(relatedTickets, function(index, value) {\n var updatedate = new Date(value.updated_at);\n html += \"<tr>\";\n html += \"<td>\" + value.id + \"</td>\";\n html += \"<td>\" + value.subject + \"</td>\";\n html += \"<td>\" + updatedate.toLocaleDateString() + \"</td>\";\n html += \"<td>\" + value.group_id.toString().replace('21321019', 'Tier1').replace('21321029', 'Tier2').replace('21387695', 'Tier3').replace('21575859', 'Tier4') + \"</td>\";\n html += \"<td>\" + value.status + \"</td>\";\n html += \"</tr>\";\n });\n $('#relatedTicketsTable').find('tbody').append(html);\n }).done(function() {\n $('.status-new').text(\"NEW\");\n $('.status-open').text(\"OPEN\");\n $('.status-hold').text(\"ON-HOLD\");\n $('.status-pending').text(\"PENDING\");\n $('.status-closed').text(\"CLOSED\");\n $('.status-solved').text(\"SOLVED\");\n styleTicketTable();\n });\n }", "function makeHeaderRow(){\n var trEl=document.createElement('tr');\n trEl.id='Header';\n newElement('th','Locations:',trEl);\n for(i=0;i<hours.length;i++){\n newElement('th',hours[i],trEl);\n }\n newElement('th','totals',trEl);\n profitTable.appendChild(trEl);\n}", "function appendUsers() {\n var table = document.getElementById(\"projectUsersTable\");\n\n // Clear the table from previous users - anything but the header row\n for (var i = table.rows.length - 1; i > 0; i--) {\n table.deleteRow(i);\n };\n uniqueProjectUsers.forEach(function (user) {\n var sortedIssues = sortUserIssues(user);\n var tr = document.createElement(\"tr\");\n\n tr.innerHTML = \"<td style='text-align:center'>\" + user + \"</td>\" +\n \"<td style='text-align:center; background-color:#DBFFAB''>\" + sortedIssues.numberOfGreenIssues + \"</td>\" +\n \"<td style='text-align:center; background-color:#FF6A4B'>\" + sortedIssues.numberOfRedIssues + \"</td>\" +\n \"<td style='text-align:center; background-color:#FF6A4B'>\" + sortedIssues.successRate + \"</td>\";\n table.appendChild(tr);\n });\n\n queryRequest(uniqueProjectUsers);\n}", "function makeNewTaskDifficulty()\n{\n const cell = makeTableCell(\"difficulty\");\n return cell;\n}", "function addEmptyShelfToTable(row) {\n\t$('#shelves').append(\n\t '<div class=\"panel panel-warning\" id=\"shelf-' + row + '\">'\n\t + '<div class=\"panel-heading\">'\n\t + '<h3>' + row + ' Shelf</h3>'\n\t + '</div>'\n\t + '<div class=\"panel-body\">'\n\t + '<table class=\"table table-striped\">'\n\t + '<thead>'\n\t +\t \t\t '<tr>'\n\t +\t \t\t\t '<th>Product</th>'\n\t +\t \t\t\t '<th>Quantity</th>'\n\t +\t \t\t\t '<th>Total Size</th>'\n\t +\t \t\t\t '<th>Total Value</th>'\n\t +\t \t\t '</tr>'\n\t + '</thead>'\n\t + '<tbody>'\n\t + '</tbody>'\n\t + '<tfoot>'\n\t +\t \t\t '<tr>'\n\t +\t \t\t '<td></td>'\n\t +\t \t\t '<td></td>'\n\t +\t \t\t '<td class=\"total-size\"></td>'\n\t +\t \t\t '<td class=\"total-value\"></td>'\n\t +\t \t\t '</tr>'\n\t + '</tfoot>'\n\t + '</table>'\n\t + '</div>'\n\t + '</div>'\n\t);\n}", "function noResults() {\n var row = '<tr>' +\n '<td colspan=\"4\">' +\n '<p class=\"no-results\">No results!</p>' +\n '</td>' +\n '</tr>';\n $('#responder_results tbody').html(row);\n }", "function renderScoreTable() {\n var currScoreList = UserScoreHelper.getScores();\n // Clear the table \n scoreTableEl.innerHTML = \"\";\n if (currScoreList.length > 0) {\n // Update table with user scores\n for (var index = 0; index < currScoreList.length; index++) {\n var row = createScoreTableRow();\n addColumnToRow(row, (index + 1), true);\n addColumnToRow(row, currScoreList[index].initials);\n addColumnToRow(row, currScoreList[index].score);\n }\n } else {\n // No user scores found - display message to user\n var row = createScoreTableRow();\n var column = addColumnToRow(row, \"No Scores Found\");\n column.setAttribute(\"colspan\", \"3\");\n column.setAttribute(\"class\", \"text-center\");\n }\n}", "function submitForm(){\n makeUserRow() //When you hit submit it should make a row so <---\n}", "function renderTableRow(itemName,totalcost,index) {\n var tr_node = document.createElement(\"tr\");\n var th_node = document.createElement(\"th\");\n th_node.setAttribute('scope',\"row\");\n th_node.innerText =index;\n \n var td_item = document.createElement(\"td\");\n td_item.innerText =itemName;\n\n // var td_count = document.createElement(\"td\");\n // td_count.innerText=counter;\n var td_total = document.createElement(\"td\");\n td_total.innerText=totalcost;\n\n tr_node.appendChild(th_node);\n tr_node.appendChild(td_item);\n // tr_node.appendChild(td_count);\n tr_node.appendChild(td_total);\n\n return tr_node;\n\n}", "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "function renderTable() {\n clearTable();\n showTable();\n}", "function createPantryRow(inventoryData) {\n // Slice expiration date\n var expirationDate = inventoryData.expiration;\n var newExpDate = expirationDate.slice(0,10);\n var newTr = $(\"<tr>\").attr(\"id\", inventoryData.id)\n\n // of the data record has the pantry name set to the same as\n if (inventoryData.pantryname === id) {\n var selectButton = $(\"<button>\").text(\"Select\").attr({\n class: \"select-button\",\n id: inventoryData.id\n });\n newTr.data(\"inventory\", inventoryData);\n newTr.append(\"<td>\" + inventoryData.user.name + \"</td>\");\n newTr.append(\"<td>\" + inventoryData.item + \"</td>\");\n newTr.append(\"<td> \" + inventoryData.quantity + \"</td>\");\n newTr.append(\"<td>\" + newExpDate + \"</td>\");\n newTr.append(selectButton);\n return newTr;\n }\n }", "function firstRowFunction() {\n let mainTable = document.getElementById('mainTable');\n let firstRow = document.createElement('tr');\n mainTable.appendChild(firstRow);\n\n for (let i = 0; i < workHours.length + 2; i++) {\n let tdFirstRow = document.createElement('th');\n firstRow.appendChild(tdFirstRow);\n tdFirstRow.textContent = workHours[i - 1];\n if (i === 0) {\n tdFirstRow.textContent = 'Locations'.toUpperCase();\n }\n else if (i === (workHours.length + 1)) {\n tdFirstRow.textContent = 'Daily Totals'.toUpperCase();\n }\n\n }\n}", "function createTableRows(dataFromAPI, tableBody) {\n const tr = document.createElement('tr')\n tr.setAttribute('id', dataFromAPI.name)\n const wantedFields = [emptyHeart, dataFromAPI.logo_url, dataFromAPI.currency,\n dataFromAPI.name, dataFromAPI.price];\n wantedFields.forEach(field => createTableDataCell(field, tr))\n tableBody.appendChild(tr)\n}", "function createRows() {\n\t\t\t/** Create the header row of the table. **/\n\t\t\tvar h1 = '<thead><tr><th>Sunday</th><th>Monday</th><th>Tuesday</th>';\n\t\t\tvar h2 = '<th>Wednesday</th><th>Thursday</th><th>Friday</th>';\n\t\t\tvar h3 = '<th>Saturday</th></tr></thead>';\n\t\t\t$('#weeks').append(h1+h2+h3);\n\t\t\t/** Create the Body of the table. **/\n\t\t\t$('#weeks').append('<tbody id=\"tableBody\"></tbody>');\t\t\n\t\t\t/** Create a given number of rows bassed on the numRows variable. Give\n\t\t\t\teach row a unique ID. **/\n\t\t\tfor (i=0;i<numRows;i++) {\n\t\t\t\t$('#tableBody').append('<tr id=\"row'+i+'\"></tr>');\n\t\t\t}\n\t\t\t/** Run the function to create the row content. **/\n\t\t\tcreatCells();\n\t\t}", "function renderKioskRow (kiosk) {\n var newTr = document.createElement('tr');\n tableEl.appendChild(newTr);\n\n var newTd = document.createElement('td');\n newTd.textContent = kiosk.name;\n newTr.appendChild(newTd);\n\n for (var f = 0; f < kiosk.numLbsHour.length; f++) {\n var tdData = document.createElement('td');\n tdData.textContent = kiosk.numLbsHour[f].toFixed(2);\n newTr.appendChild(tdData);\n }\n }", "function populateExistingUserTable(existingUsers) {\r\n\tif(existingUsers.length > 0) {\t\r\n\t\tdocument.getElementById(\"nonExistingUsersTableId\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingDataDiv\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"existingList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center' class='tablesorter'><thead class='tab_header'><tr><th width='14%'><input type='checkbox' id='select-all' name='selectAll' value='selectAll'>&nbsp;Select All</th><th>Name (Last, First)</th><th>Email (User ID)</th><th>User Group</th><th>Expiration Date</th><th>Initial Registration Date</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tvar fName= \"\";\r\n\t\tvar lName = \"\";\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\tvar expiryDate = new Date(existingUsers[index].jctAccountExpirationDate).toDateString();\r\n\t\t\tvar userExpryDate = dateformat(new Date (expiryDate));\t\t\r\n\t\t\t\r\n\t\t\tvar registrationDate = new Date(existingUsers[index].userRegistrationDate).toDateString();\r\n\t\t\tvar userRegistrationDate = dateformat(new Date (registrationDate));\t\t\r\n\t\t\t\r\n\t\t\tif(null != existingUsers[index].lastName) {\r\n\t\t\t\tlName = existingUsers[index].lastName;\r\n\t\t\t} else {\r\n\t\t\t\tlName = \"N/A\";\r\n\t\t\t}\r\n\t\t\tif(null != existingUsers[index].firstName) {\r\n\t\t\t\tfName = existingUsers[index].firstName;\r\n\t\t\t} else {\r\n\t\t\t\tfName = \"N/A\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td><span class='checkBox_text_manage_user'>\"+counter+\".</span><input type='checkbox' name='email' value='\"+existingUsers[index].email+\"' class='checkBox_align_manage_user'></td><td align='center'>\"+lName+\", \"+fName+\"</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td><td align='center'>\"+userExpryDate+\"</td><td align='center'>\"+userRegistrationDate+\"</td>\";\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t\tmap[existingUsers[index].email] = existingUsers[index].jctAccountExpirationDate;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\t//new SortableTable(document.getElementById('myTable'), 1);\r\n\t\t$(function(){\r\n\t\t\t $(\"table\").tablesorter({\r\n\t\t\t headers: {\r\n\t\t\t 0: { sorter: false } // disable first column\t\t\t \r\n\t\t\t }\r\n\t\t\t });\r\n\t\t\t});\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingDataDiv\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"nonExistingUsersTableId\").style.display=\"block\";\r\n\t\tdocument.getElementById(\"nonExistingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Users</div></div>\";\r\n\t}\r\n\t$(\"#select-all\").on(\"click\", function() {\r\n\t\t var all = $(this);\r\n\t\t $('input:checkbox').each(function() {\r\n\t\t $(this).prop(\"checked\", all.prop(\"checked\"));\r\n\t\t });\r\n\t});\r\n}", "function generateLogTableRow(id, summary, issuetype) {\n\n /*************\n Issue ID cell\n *************/\n \n var idCell = buildHTML('td', null, {\n class: 'issue-id'\n });\n if(issuetype === \"Story\"){\n idCell = buildHTML('td', null, {\n class: 'issue-id-story'\n });\n }\n\n var idText = document.createTextNode(id);\n\n /*********************\n Link to the JIRA issue\n *********************/\n\n var jiraLink = buildHTML('a', null, {\n href: options.baseUrl + \"/browse/\" + id,\n target: \"_blank\"\n });\n\n jiraLink.appendChild(idText);\n idCell.appendChild(jiraLink);\n\n /************\n Status summary\n ************/\n var statusCell = buildHTML('td', null, {\n class: 'issue-status',\n 'data-issue-id': id\n });\n var statusDropDown = buildHTML('select', null, {\n class: 'issue-status-dropdown',\n 'data-issue-id': id\n });\n\n //statusDropDown.addEventListener('click', null);\n statusCell.appendChild(statusDropDown);\n\n\n /************\n Issue summary\n ************/\n var summaryCell = buildHTML('td', summary, {\n class: 'issue-summary truncate'\n });\n\n /***************\n Total spent time\n ***************/\n // summary loader\n var loader = buildHTML('div', null, {\n class: 'loader-mini',\n 'data-issue-id': id\n });\n // summary total time\n var totalTime = buildHTML('div', null, {\n class: 'issue-total-time-spent',\n 'data-issue-id': id\n });\n // Issue total worklog sum\n var totalTimeContainer = buildHTML('td', null, {\n class: 'total-time-container',\n 'data-issue-id': id\n });\n totalTimeContainer.appendChild(loader);\n totalTimeContainer.appendChild(totalTime);\n\n /***************\n Remaining time\n ***************/\n // summary loader\n var remainingLoader = buildHTML('div', 'none', {\n class: 'loader-mini',\n 'data-issue-id': id\n });\n // summary total time\n var remainingTime = buildHTML('div', null, {\n class: 'issue-remaining-time',\n 'data-issue-id': id\n });\n // Issue remaining time\n var remainingTimeContainer = buildHTML('td', null, {\n class: 'remaining-time-container',\n 'data-issue-id': id\n });\n remainingTimeContainer.appendChild(remainingLoader);\n remainingTimeContainer.appendChild(remainingTime);\n\n\n /*********\n Time input\n *********/\n var timeInput = buildHTML('input', null, {\n class: 'issue-time-input',\n 'data-issue-id': id\n });\n // Time input cell\n var timeInputCell = buildHTML('td');\n timeInputCell.appendChild(timeInput);\n\n /*********\n Date input\n *********/\n var dateInput = buildHTML('input', null, {\n type: 'date',\n class: 'issue-log-date-input',\n value: new Date().toDateInputValue(),\n 'data-issue-id': id\n });\n // Date input cell\n var dateInputCell = buildHTML('td');\n dateInputCell.appendChild(dateInput);\n\n /************\n Action button\n ************/\n var actionButton = buildHTML('input', null, {\n type: 'button',\n value: 'Log Time',\n class: 'issue-log-time-btn',\n 'data-issue-id': id\n });\n\n actionButton.addEventListener('click', logTimeClick);\n\n // Action button cell\n var actionCell = buildHTML('td');\n actionCell.appendChild(actionButton);\n\n /********\n Issue row\n ********/\n var row = buildHTML('tr', null, {\n 'data-issue-id': id\n });\n\n row.appendChild(idCell);\n row.appendChild(statusCell);\n row.appendChild(summaryCell);\n row.appendChild(remainingTimeContainer);\n row.appendChild(totalTimeContainer);\n row.appendChild(timeInputCell);\n row.appendChild(actionCell);\n\n return row;\n\n }", "function createEmptyTable() {\n let rows = Number($(\"#rows\").val());\n let cols = Number($(\"#cols\").val());\n if (isNaN(rows) || isNaN(cols) || rows === 0 || cols === 0)\n alert(\"Introduzca los datos correctamente\");\n else {\n titles = [];\n content = [];\n $(\"table\").remove();\n $(\"#tableC\").append(\"<table></table>\");\n $(\"table\").addClass(\"table table-condensed\");\n setTableTitle(cols);\n setTableData(rows, cols);\n changes = true;\n }\n}", "function populateTable(existingUsers) {\r\n\tif(existingUsers.length > 0) {\r\n\t\tdocument.getElementById(\"existingRenewList\").style.display=\"block\";\r\n\t\tvar userList = document.getElementById(\"existingUsersTableId\");\r\n\t\tvar tableStr = \"<table width='94%' border='1' bordercolor='#78C0D3' id='myTable' align='center' class='tablesorter'><thead class='tab_header'><tr><th>SL. No.</th><th>User Name</th><th>User Group Name</th><th>Expiration Date</th><th width='16%'>Action</th></tr></thead><tbody>\";\r\n\t\tvar counter = 1;\r\n\t\tfor (var index=0; index<existingUsers.length; index++) {\r\n\t\t\tvar trColor = \"\";\r\n\t\t\tif(index % 2 == 0) {\r\n\t\t\t\ttrColor = \"#D2EAF0\";\r\n\t\t\t} else {\r\n\t\t\t\ttrColor = \"#F1F1F1\";\r\n\t\t\t}\r\n\t\t\tvar expiryDate = new Date(existingUsers[index].jctAccountExpirationDate).toDateString();\t\r\n\t\t\tvar d = new Date();\r\n\t\t\t//var currentDate = new Date(d).toLocaleDateString();\t\t\r\n\t\t\tvar currentDate = new Date(d).toDateString();\t\t\r\n\t\t\tvar date1 = new Date(expiryDate);\r\n\t\t\tvar date2 = new Date(currentDate);\r\n\t\t\tvar timeDiff = Math.abs(date2.getTime() - date1.getTime());\r\n\t\t\tvar diffDays = Math.ceil(timeDiff / (1000 * 3600 * 24)); \r\n\t\t\tvar userExpryDate = dateformat(new Date (expiryDate));\r\n\t\t\t\t\t\r\n\t\t\ttableStr = tableStr + \"<tr class='user_list_row_width' bgcolor='\"+trColor+\"'><td align='center'>\"+counter+\".</td><td align='center'>\"+existingUsers[index].email+\"</td><td align='center'>\"+existingUsers[index].userGroup+\"</td><td align='center'>\"+userExpryDate+\"</td>\";\r\n\t\t\ttableStr = tableStr + \"<td class='table_col_txt_style' >\" +\r\n\t\t\t\t\t\"<table width='100%' border='0'>\" +\r\n\t\t\t\t\t\"<tr>\";\r\n\t\t\tif(date1 < date2) {\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a href='#' onclick='renewUser(\\\"\"+existingUsers[index].jctProfileId+\"\\\", \\\"\"+existingUsers[index].email+\"\\\")'>Renew</a></td></td></tr></table></td></tr>\";\r\n\t\t\t} else if(diffDays >= 0 && diffDays <= 7){\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a href='#' onclick='renewUser(\\\"\"+existingUsers[index].jctProfileId+\"\\\", \\\"\"+existingUsers[index].email+\"\\\")'>Renew</a></td></td></tr></table></td></tr>\";\r\n\t\t\t} else {\r\n\t\t\t\t/*tableStr = tableStr + \"<td align='center'><span class='inactivate_style'>Renew</span></td></td></tr></table></td></tr>\";*/\r\n\t\t\t\ttableStr = tableStr + \"<td align='center'><a href='#' onclick='renewUser(\\\"\"+existingUsers[index].jctProfileId+\"\\\", \\\"\"+existingUsers[index].email+\"\\\")'>Renew</a></td></td></tr></table></td></tr>\";\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\tcounter = counter + 1;\r\n\t\t}\r\n\t\ttableStr = tableStr + \"</tbody></table>\";\r\n\t\tuserList.innerHTML = tableStr;\r\n\t\t$(\"table\").tablesorter();\r\n\t\tnew SortableTable(document.getElementById('myTable'), 1);\r\n\t} else {\r\n\t\tdocument.getElementById(\"existingRenewList\").style.display=\"none\";\r\n\t\tdocument.getElementById(\"existingUsersTableId\").innerHTML = \"<div align='center'><br /><br /><br /><img src='../img/no-record.png'><br /><div class='textStyleNoExist'>No Existing Users For Renewal</div></div>\";\r\n\t}\r\n\t\r\n}", "makeUserTable() {\n let infoSelected = this.checkSelected.map(checkBoxValue => this.checkData.find(checkBox => checkBox.value === checkBoxValue).text); //Get the text key of the checkbox selected to used on titles of the table\n this.tableTitlesMod = [\"Name\", ...infoSelected];\n this.tableKeysMod = [\"first_name\" , ...this.checkSelected];\n }", "function addUser(userObj) {\n let newRow = document.createElement('tr');\n newRow.innerHTML = `\n <td>${userObj.studentNo}</td>\n <td>${userObj.name}</td>\n <td>${userObj.age}</td>\n <td>${userObj.studentNo > 0}</td>\n `;\n document.getElementById('table-content').appendChild(newRow);\n}", "function createTable(firstRow, rows, position = \"left\") {\n\tlet table = new Table(firstRow, rows, position);\n\ttable.add();\n\treturn table;\n}", "function createTable(table) {\n if (user.id == table.owner_id) {\n sittedTable = new Table(table.id,true);\n }\n}", "function createRow(newEntry) {\n var allEntries = [];\n for (var i = 0; i < newEntry.length; i++) {\n var newTr = $(\"<tr>\");\n newTr.data(\"tableRow\", newEntry[i].id);\n newTr.append(\"<td id=''>\" + newEntry[i].id + \"</td>\");\n newTr.append(\"<td id='tableName'><a href='/\" + deptURL + \"/\" + newEntry[i].employee_id + \"'>\" + newEntry[i].name + \"</td>\");\n newTr.append(\"<td id='tableDate'>\" + newEntry[i].date + \"</td>\");\n newTr.append(\"<td id='tableCategory'>\" + newEntry[i].category + \"</td>\");\n newTr.append(\"<td id='tableTask'>\" + newEntry[i].task + \"</td>\");\n newTr.append(\"<td id='tableTime'>\" + newEntry[i].timespent + \"</td>\");\n newTr.append(\"<td id='tableProgram'><a href='/rfb/\" + newEntry[i].program + \"'>\" + newEntry[i].program + \"</td>\");\n newTr.append(\"<td id='tableECR'><a href='/rfb/ecr/\" + newEntry[i].ecr + \"'>\" + newEntry[i].ecr + \"</td>\");\n newTr.append(\"<td id='tableNotes'>\" + newEntry[i].notes + \"</td>\");\n allEntries.push(newTr)\n }\n return allEntries;\n }", "function makeTableRow(data, items, klass) {\n\t\tvar row = document.createElement('tr');\n\t\tfor (var i in items) {\n\t\t\tvar cell = document.createElement('td');\n\t\t\tcell.innerHTML = data[i];\n\t\t\tcell.style.width = i=='day' ? '1.5em' : '2.7em';\n\t\t\trow.appendChild(cell);\n\t\t}\n\t\trow.className = klass;\n\t\treturn row;\n\t}", "createRowContent(rowData) {\n let jsx = [];\n for(var i = 0; i < rowData.length; i++) {\n jsx.push(\n <CustomTableCell {...((i == 0) ? {component: \"th\"} : {})} {...((i == 0) ? {scope:\"row\"} : {})}>\n {rowData[i]}\n </CustomTableCell>\n );\n }\n return jsx;\n }", "createTable(rows, columns) {\n let startPara = this.selection.start.paragraph;\n let table = new TableWidget();\n table.tableFormat = new WTableFormat(table);\n table.tableFormat.preferredWidthType = 'Auto';\n table.tableFormat.initializeTableBorders();\n let index = 0;\n while (index < rows) {\n let tableRow = this.createRowAndColumn(columns, index);\n tableRow.rowFormat.heightType = 'Auto';\n tableRow.containerWidget = table;\n table.childWidgets.push(tableRow);\n index++;\n }\n return table;\n }", "render() {\n return (\n <tr key={uuidv4()}>\n <th scope=\"row\" key={uuidv4()}>{this.props.row[\"employeeId\"]}</th>\n <td key={uuidv4()}>{this.props.row[\"payPeriod\"][\"startDate\"]}</td>\n <td key={uuidv4()}>{this.props.row[\"payPeriod\"][\"endDate\"]}</td>\n <td key={uuidv4()}>{this.props.row[\"amountPaid\"]}</td>\n </tr>\n );\n }", "function addToTable(contact) {\r\n let row = generateRow(contact);\r\n tableContent.appendChild(row);\r\n}", "function createRow(newTimeEntry) {\n var allEntries = [];\n for (var i = 0; i < newTimeEntry.length; i++) {\n var newTr = $(\"<tr>\");\n newTr.data(\"timeblock\", newTimeEntry[i].id);\n newTr.append(\"<td>\" + newTimeEntry[i].id + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].name + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].date + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].category + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].task + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].timespent + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].program + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].ecr + \"</td>\");\n newTr.append(\"<td>\" + newTimeEntry[i].notes + \"</td>\");\n allEntries.push(newTr)\n }\n return allEntries;\n }", "function checkEmpty(num, itemID) {\r\n var table = document.getElementById(itemID);\r\n\r\n switch (num) {\r\n case 0:\r\n //Table is now empty\r\n table.insertRow(0);\r\n table.rows[0].setAttribute('id', \"No Users\");\r\n table.rows[0].className = 'even';\r\n var cellLeft = table.rows[0].insertCell(0);\r\n cellLeft.innerHTML = \"No users have been added to the code review.\";\r\n table.rows[0].appendChild(cellLeft);\r\n break;\r\n case 1:\r\n //Need to add things to the table, get rid of No Users row\r\n table.deleteRow(0);\r\n break;\r\n default :\r\n alert(\"Error in CheckEmpty function\");\r\n }\r\n}", "function CreateTblRow(tblName, field_setting, data_dict) {\n //console.log(\"========= CreateTblRow =========\", tblName);\n //console.log(\" data_dict\", data_dict);\n\n const field_names = field_setting.field_names;\n const field_tags = field_setting.field_tags;\n const filter_tags = field_setting.filter_tags;\n const field_align = field_setting.field_align;\n const field_width = field_setting.field_width;\n const column_count = field_names.length;\n\n const map_id = (data_dict.mapid) ? data_dict.mapid : null;\n\n// --- lookup index where this row must be inserted\n const ob1 = (data_dict.sb_code) ? data_dict.sb_code : \"\";\n const ob2 = (data_dict.username) ? data_dict.username : \"\";\n\n const row_index = b_recursive_tblRow_lookup(tblBody_datatable, setting_dict.user_lang, ob1, ob2);\n\n// --- insert tblRow into tblBody at row_index\n const tblRow = tblBody_datatable.insertRow(row_index);\n tblRow.id = map_id\n\n// --- add data attributes to tblRow\n tblRow.setAttribute(\"data-pk\", data_dict.id);\n if (!data_dict.is_active){\n tblRow.setAttribute(\"data-inactive\", \"1\");\n };\n\n// --- add data-sortby attribute to tblRow, for ordering new rows\n tblRow.setAttribute(\"data-ob1\", ob1);\n tblRow.setAttribute(\"data-ob2\", ob2);\n // NIU: tblRow.setAttribute(\"data-ob3\", ---);\n\n// --- add EventListener to tblRow\n tblRow.addEventListener(\"click\", function() {HandleTblRowClicked(tblRow)}, false);\n\n// +++ insert td's into tblRow\n for (let j = 0; j < column_count; j++) {\n const field_name = field_names[j];\n\n // - skip column if field_name in columns_hidden;\n const hide_column = columns_hidden.includes(field_name);\n if (!hide_column){\n const field_tag = field_tags[j];\n const class_width = \"tw_\" + field_width[j];\n const class_align = \"ta_\" + field_align[j];\n\n // --- insert td element,\n let td = tblRow.insertCell(-1);\n\n // --- create element with tag from field_tags\n let el = document.createElement(field_tag);\n\n // --- add data-field attribute\n el.setAttribute(\"data-field\", field_name);\n\n // --- add text_align\n el.classList.add(class_width, class_align);\n\n // --- append element\n td.appendChild(el);\n\n // --- add data-field Attribute when input element\n if (field_tag === \"input\") {\n el.setAttribute(\"type\", \"text\")\n el.setAttribute(\"autocomplete\", \"off\");\n el.setAttribute(\"ondragstart\", \"return false;\");\n el.setAttribute(\"ondrop\", \"return false;\");\n // --- add class 'input_text' and text_align\n // class 'input_text' contains 'width: 100%', necessary to keep input field within td width\n el.classList.add(\"input_text\");\n }\n\n // --- add EventListener to td\n if (field_name === \"select\") {\n // select multiple users option added PR2023-04-12\n } else if (field_name === \"username\"){\n if(tblName ===\"userallowed\"){\n el.addEventListener(\"click\", function() {MUPS_Open(el)}, false)\n } else {\n el.addEventListener(\"click\", function() {MUA_Open(\"update\", el)}, false)\n };\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"sb_code\", \"school_abbrev\", \"username\", \"last_name\", \"email\"].includes(field_name)){\n el.addEventListener(\"click\", function() {MUA_Open(\"update\", el)}, false)\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"role\", \"page\"].includes(field_name)){\n el.addEventListener(\"click\", function() {MUPM_Open(\"update\", el)}, false)\n el.classList.add(\"pointer_show\");\n add_hover(el);\n\n } else if ([\"role\", \"page\", \"action\", \"sequence\"].includes(field_name)){\n el.addEventListener(\"change\", function(){HandleInputChange(el)});\n\n } else if (field_name.slice(0, 5) === \"group\") {\n // attach eventlistener and hover to td, not to el. No need to add icon_class here\n td.addEventListener(\"click\", function() {UploadToggleMultiple(el)}, false)\n add_hover(td);\n\n } else if (field_name.includes(\"allowed\")) {\n if (field_name === \"allowed_clusters\") {\n if (permit_dict.permit_crud && permit_dict.requsr_same_school) {\n td.addEventListener(\"click\", function() {MSM_Open(el)}, false);\n add_hover(td);\n };\n } else {\n // users may always view allowed_sections\n el.addEventListener(\"click\", function() {MUPS_Open(el)}, false);\n add_hover(td);\n };\n\n } else if (field_name === \"activated\") {\n el.addEventListener(\"click\", function() {ModConfirmOpen(\"user\", \"send_activation_email\", el)}, false)\n\n } else if (field_name === \"is_active\") {\n el.addEventListener(\"click\", function() {ModConfirmOpen(\"user\", \"is_active\", el)}, false)\n el.classList.add(\"inactive_0_2\")\n add_hover(el);\n\n } else if ( field_name === \"last_login\") {\n // pass\n };\n\n// --- put value in field\n UpdateField(el, data_dict);\n\n } // if (!columns_hidden.includes(field_name))\n } // for (let j = 0; j < 8; j++)\n\n return tblRow;\n }", "function createExercise(table, exercise){\r\n const newExerciseRow = table.insertRow(-1);\r\n const sets = newExerciseRow.insertCell(0);\r\n sets.appendChild(newText(exercise.sets + \" Sets\"));\r\n\r\n const reps = newExerciseRow.insertCell(1);\r\n reps.appendChild(newText(exercise.reps + \" Reps\"));\r\n\r\n const volume = newExerciseRow.insertCell(2);\r\n if(exercise.procent)\r\n volume.appendChild(newText(exercise.procent));\r\n}", "function createCells(parent, data){\r\n\tfor (let i = 0; i < Object.keys(data).length; i++){\r\n\t\tlet cell = document.createElement(\"TD\");\r\n\t\tcell.innerHTML = data[Object.keys(data)[i]];\r\n\r\n\t\t// If a msg_id is present, insert id. \r\n\t\t// We do this to be able to create header cells and data cells with the same function as the header cells do not and should not contain a msg_id\r\n\t\tif(data.msg_id){\r\n\t\t\tcell.id = data.msg_id + '-' + Object.keys(data)[i];\r\n\t\t}\r\n\t\r\n\t\tparent.appendChild(cell);\r\n\r\n\t\t// The msg_id is irrelevant in the table from the users point of view, so we hide the column.\r\n\t\t// We may, however still need it for future interactions, which is why we create a hidden TD for it\r\n\t\tif(Object.keys(data)[i] == \"msg_id\" || data[Object.keys(data)[i]] == \"msg_id\"){\r\n\t\t\tcell.classList.add('hidden');\r\n\t\t}\r\n\t}\r\n}", "function create_row(){\n\n\t\tvar tbody = d3.select('#tbody');\n\t\tvar row = tbody.append('tr');\t\n\t\treturn row;\n}", "function add_harvest_to_queue_table(harvest, entry_by) {\n document.getElementById(\"harvest-queue-table\").style.display = \"block\";\n\n var text = \"\";\n var body = document.getElementById(\"harvest-queue\");\n var harvest_row = document.createElement(\"TR\");\n\n if (entry_by === 'species') {\n var greenhouse_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.greenhouse);\n greenhouse_row.appendChild(text);\n harvest_row.appendChild(greenhouse_row);\n }\n else if (entry_by === 'greenhouse') {\n var strain_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.strain);\n strain_row.appendChild(text);\n harvest_row.appendChild(strain_row);\n }\n else if (entry_by === 'time') {\n var greenhouse_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.greenhouse);\n greenhouse_row.appendChild(text);\n harvest_row.appendChild(greenhouse_row);\n\n var strain_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.strain);\n strain_row.appendChild(text);\n harvest_row.appendChild(strain_row);\n }\n\n var weight_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.weight);\n weight_row.appendChild(text);\n harvest_row.appendChild(weight_row);\n\n var date_row = document.createElement(\"TD\");\n text = document.createTextNode(harvest.date);\n date_row.appendChild(text);\n harvest_row.appendChild(date_row);\n\n body.appendChild(harvest_row);\n\n}", "_createCustomHeaderRow() {\r\n const that = this,\r\n headerRow = that.headerRow;\r\n\r\n if (!headerRow) {\r\n return;\r\n }\r\n\r\n const potentialHTMLTemplate = document.getElementById(headerRow);\r\n\r\n if (potentialHTMLTemplate && potentialHTMLTemplate instanceof HTMLTemplateElement) {\r\n const templateContent = document.importNode(potentialHTMLTemplate.content, true);\r\n\r\n that.$.tableContainer.firstElementChild.appendChild(templateContent);\r\n }\r\n else {\r\n that.headerRow = null;\r\n }\r\n }", "function genRow(time) {\n\t\tvar row = \"<tr class='scheduleTableRow' id='\" + as12HourTime(time) + \"row\" + \n\t\t\t\t \"'>\\n<td class='scheduleRowLabel'>\";\n\t\trow += as12HourTime(time) + \"</td>\\n\";\n\t\tfor (var day = 0; day < babysitterScheduleTable.width; day ++) {\n\t\t\trow += \"<td class='\";\n\t\t\trow += babysitterScheduleTable.getColor(day,time) + \"ScheduleTableSquare\";\n\t\t\trow += \"' id='\" + day + \"_\" + time + \"_square' \";\n\t\t\trow += \"onmousedown='babysitterScheduleTable.paint(\" + day + \",\" + time + \", currentColor)' \";\n\t\t\trow += \"onmouseover='paintIfClicking(event,\" + day + \",\" + time + \")'/>\\n\";\n\t\t}\n\t\trow += \"</tr>\\n\"\n\t\treturn row;\n\t}", "function init_table(initialRows, initialColumns, editableRow) {\n if (!initialRows) initialRows = 5;\n if (!initialColumns) initialColumns = 1;\n if (!editableRow) editableRow = true;\n let table = $('<table id=\"table_filters\" class=\"table table-bordered table-zina\"></table>');\n\n // {# built table header #}\n let table_header = $(\"<thead></thead>\");\n let column_content = \"<th><span class='column_name'></span><button class='filters'><span class='caret'></span></button></th>\";\n let header_tr = $(\"<tr></tr>\").append(column_content.repeat(initialColumns));\n table_header.append(header_tr);\n\n // {# built table body #}\n let table_body = $(\"<tbody></tbody>\");\n let row_content = ((editableRow) ? \"<td contenteditable='true'></td>\" : \"<td></td>\");\n let row = \"<tr>\".concat(row_content.repeat(initialColumns), \"</tr>\");\n table_body.append(row.repeat(initialRows));\n\n table.append(table_header);\n table.append(table_body);\n\n return table;\n }", "render() {\n let rows = this.state.items.map( ( item, i ) => <TodoItemRow item={item} key={i} onRemoveItem={this.handleRemoveItem} index={i} />);\n\n if(rows.length === 0) {\n return (\n <table className=\"w100\">\n <tbody>\n <tr className=\"todoItemWrapper\">\n <td>There is no item currently</td>\n </tr>\n <tr>\n <td>\n <TodoForm\n items={this.state.items}\n addingMode={this.state.addingMode}\n onUserInput={this.handleUserInput}\n onNewItemClick={this.handleNewItemClick}\n />\n </td>\n </tr>\n </tbody>\n </table>\n );\n }\n\n return (\n <div>\n <table className=\"w100\">\n <tbody>{rows}</tbody>\n </table>\n <TodoForm\n items={this.state.items}\n addingMode={this.state.addingMode}\n onUserInput={this.handleUserInput}\n onNewItemClick={this.handleNewItemClick}\n />\n </div>\n );\n }", "function create_wiki_table_row(wiki_doc, state) {\n let pattern = new RegExp('https:\\\\/\\\\/((.*\\\\/)+wiki\\\\/)([^#]+)(#.*)*');\n let key = hash(wiki_doc.url);\n let src = pattern.exec(wiki_doc.url)[1];\n let entry = (wiki_doc.name !== null) ? wiki_doc.name : decodeURIComponent(pattern.exec(wiki_doc.url)[3]);\n let cell, btn;\n let icon_type = [\"ok\", \"hourglass\"];\n let icon_color = [\"green\", \"black\"];\n\n // config row\n let row = elementFactory({\n type: \"tr\",\n attr: { id: key, url: wiki_doc.url, status: state.toString() },\n css: { 'text-decoration-line': \"none\" }\n });\n\n // status\n cell = elementFactory({ type: \"td\", css: { 'text-align': \"center\" } });\n $(cell).append(elementFactory({\n type: \"span\",\n class: \"glyphicon glyphicon-\" + icon_type[state],\n css: { color: icon_color[state] }\n }));\n $(row).append(cell);\n\n // source\n $(row).append(elementFactory({ type: \"td\", css: { 'text-align': \"left\" }, html: src }));\n\n // entry\n $(row).append(elementFactory({ type: \"td\", css: { 'text-align': \"left\" }, html: entry }));\n\n // button\n cell = elementFactory({ type: \"td\", class: \"select-disable\", css: { 'text-align': \"left\" } });\n $(row).append(cell);\n // delete button\n btn = elementFactory({\n type: \"div\",\n attr: { key: key, title: \"刪除此條目\" },\n class: \"table-tool-btn\",\n on: { click: click_delete_btn }\n });\n $(btn).append(elementFactory({ type: \"span\", class: \"glyphicon glyphicon-trash\" }));\n $(cell).append(btn);\n // related entry button\n btn = elementFactory({\n type: \"div\",\n attr: { key: key, title: \"增加相關條目\" },\n class: \"table-tool-btn\",\n on: { click: click_related_entry_btn }\n });\n $(btn).append(elementFactory({ type: \"span\", class: \"glyphicon glyphicon-list-alt\" }));\n $(cell).append(btn);\n // copy link button\n btn = elementFactory({\n type: \"div\",\n attr: { key: key, title: \"複製此條目連結\" },\n class: \"table-tool-btn\",\n on: { click: click_copy_link_btn }\n });\n $(btn).append(elementFactory({ type: \"span\", class: \"glyphicon glyphicon-duplicate\" }));\n $(cell).append(btn);\n // error message button\n btn = elementFactory({\n type: \"div\",\n attr: { key: key, title: \"查看錯誤訊息\" },\n class: \"table-tool-btn\",\n css: { display: \"none\" },\n on: { click: click_error_message_btn }\n });\n $(btn).append(elementFactory({ type: \"span\", class: \"glyphicon glyphicon-exclamation-sign\" }));\n $(cell).append(btn);\n\n return row;\n}" ]
[ "0.64105254", "0.61403865", "0.58570755", "0.5753898", "0.57094246", "0.5695277", "0.5616051", "0.56051475", "0.56041616", "0.55941886", "0.5586514", "0.558389", "0.551595", "0.54904765", "0.5488418", "0.54874057", "0.5483197", "0.5468182", "0.54633564", "0.54485804", "0.5441689", "0.54397637", "0.5422006", "0.540063", "0.53991497", "0.5390255", "0.5386867", "0.53851724", "0.53763956", "0.53620815", "0.5359771", "0.53559065", "0.53479236", "0.53347874", "0.53306943", "0.532359", "0.53216106", "0.5320178", "0.5319518", "0.53166276", "0.5309425", "0.530139", "0.5285535", "0.5279733", "0.52797097", "0.5276366", "0.526947", "0.52620125", "0.5261875", "0.5261583", "0.52564746", "0.5252114", "0.52507585", "0.5250026", "0.52390355", "0.52332115", "0.52320987", "0.52290475", "0.52234226", "0.5221853", "0.5221101", "0.52149516", "0.5202276", "0.52000767", "0.519774", "0.51955396", "0.5194286", "0.5190934", "0.51866806", "0.51789963", "0.51743627", "0.51682955", "0.51623225", "0.51615006", "0.5158945", "0.51584876", "0.515677", "0.5150554", "0.51486105", "0.5147153", "0.5140329", "0.5138568", "0.51358503", "0.51346934", "0.51312", "0.5124998", "0.51223797", "0.51192755", "0.5117363", "0.5117082", "0.51162153", "0.5115245", "0.5112871", "0.51074505", "0.5105117", "0.5104857", "0.5100485", "0.50980234", "0.5097461", "0.50957996" ]
0.6236705
1
this function converts JSON data into a table row
function createTableRowDataEntry(JSONdata) { //nested function that generates td for our tr function appendTD(tr, data, colspan) { let td = document.createElement("td"); td.innerHTML = data + ""; //if user passed colspan param into function, //add the colspan attribute to td if (colspan !== undefined) td.setAttribute("colspan", colspan + ""); tr.appendChild(td); } function appendTDCheckBox(tr, requestId) { let td = document.createElement("td"); let bootstrapCheckbox = document.createElement("input"); bootstrapCheckbox.type = "checkbox"; bootstrapCheckbox.id = requestId; bootstrapCheckbox.checked = false; bootstrapCheckbox.className = "form-input-checkbox"; td.appendChild(bootstrapCheckbox); tr.appendChild(td); } let tr = document.createElement("tr"); let { dateSubmitted, description, amount, status, requestedBy } = JSONdata; //append all data to dynamically generated tr. appendTD(tr, dateSubmitted, 1); appendTD(tr, description, 3); appendTD(tr, amount, 1); //spaces added to fix offset caused by scroll on tbody appendTD(tr, status, 1); appendTD(tr, requestedBy, 1); appendTDCheckBox(tr, "test-id", 1); return tr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function makeTable(json) {\n var obj = JSON.parse(json),\n table = $(\"<table>\"),\n row, value, i;\n\n for (i = 0; i < obj.rows.length; i++) {\n row = $(\"<tr>\");\n row.append(\"<td>\" + obj.rows[i].key + \"</td>\");\n value = obj.rows[i].value;\n if (value instanceof Array) {\n value.forEach(function (element) {\n row.append(\"<td>\" + element + \"</td>\"); \n });\n }\n else {\n row.append(\"<td>\" + value + \"</td>\"); \n }\n table.append(row); \n }\n\n return table;\n }", "function convertToTable(json){\n var table = '<table>';\n\n for (x in json){\n table += '<tr>';\n\n for (y in json[x]){\n table = table + '<td>' + json[x][y] + '</td>';\n }\n\n table += '</tr>';\n }\n table += '</table>';\n return table;\n}", "function data_to_table(object) {\n var row = tbody.append(\"tr\");\n Object.values(object).forEach(function(value) {\n row.append(\"td\").text(value)\n })\n}", "function create_table(data){\n data.forEach(function(d){\n\n //create row\n var row = tbody.append(\"tr\");\n \n //unpack each row element into table\n Object.entries(d).forEach(function([key,value]){\n //append a cell to the row for each value\n var cell = tbody.append(\"td\");\n //set cell value\n cell.text(value);\n });\n \n });\n}", "function buildTable(data){\n \n tbody.html(\"\");\n\n data.forEach((element) => {\n var row = tbody.append(\"tr\");\n Object.entries(element).forEach(([key,value]) => {\n row.append(\"td\").text(value);\n })\n });\n\n}", "function getTableDataFromJSON() {\n\n }", "function createTable(json){\n var table = document.getElementById('user-results')\n\n for (var i = 0; i < json.data.length; i++){\n var row = `<tr>\n <td>${json.data[i].first_name}</td>\n <td>${json.data[i].last_name}</td>\n <td>${json.data[i].email}</td>\n </tr>`\n table.innerHTML += row\n\n\n }\n}", "function ConvertJsonToTable(jsonData, keys, containerId, tableClassName) {\n //Patterns for table thead & tbody\n var tbl = \"<table border='1' cellpadding='1' cellspacing='1' id='\" + containerId + \"' class='\" + tableClassName + \"'>{0}{1}</table>\";\n var th = \"<thead>{0}</thead>\";\n var tb = \"<tbody>{0}</tbody>\";\n var tr = '<tr class=\"{0}\">{1}</tr>';\n var thRow = \"<th>{0}</th>\";\n var tdRow = '<td>{0}</td>';\n var thCon = \"\";\n var tbCon = \"\";\n var trCon = \"\";\n\n function getRowClass(isOdd) {\n return isOdd ? 'odd' : 'even';\n }\n\n if (keys && jsonData) {\n\n //Creating all table headers\n if(isArray(keys)) {\n for (i = 0; i < keys.length; i++) {\n thCon += thRow.format(keys[i]);\n }\n } else {\n for(var key in keys) {\n if(keys.hasOwnProperty(key)) {\n if(keys[key].hasOwnProperty('name')) {\n thCon += thRow.format(keys[key].name);\n } else {\n thCon += thRow.format(keys[key]);\n }\n }\n }\n }\n\n th = th.format(tr.format('header', thCon));\n\n //Creating all table rows from Json data\n if (typeof(jsonData[0]) == \"object\") {\n var isOdd = false;\n for (i = 0; i < jsonData.length; i++) {\n if(isArray(keys)) {\n for (j = 0; j < keys.length; j++) {\n tbCon += tdRow.format(jsonData[i][keys[j]]);\n }\n } else {\n for(var key in keys) {\n if(keys.hasOwnProperty(key)) {\n if(keys[key].hasOwnProperty('onRender')) {\n tbCon += tdRow.format(keys[key].onRender(jsonData[i][key]));\n } else {\n tbCon += tdRow.format(jsonData[i][key]);\n }\n }\n }\n }\n trCon += tr.format(getRowClass(isOdd), tbCon);\n tbCon = \"\";\n isOdd = !isOdd;\n }\n }\n tb = tb.format(trCon);\n\n tbl = tbl.format(th, tb);\n return tbl;\n }\n\n return null;\n}", "function createTable(data) {\n // Parse the json string into the object\n data_obj = JSON.parse(data);\n\n document.getElementById(\"table_container\").innerHTML = '';\n\n // Creation of the table\n var table = document.createElement(\"table\"), rowH, headerA,\n headerB, row, cellA, cellB;\n\n rowH = document.createElement(\"tr\");\n headerA = document.createElement(\"th\");\n headerB = document.createElement(\"th\");\n\n headerA.innerHTML = \"nome\";\n headerB.innerHTML = \"data\";\n\n table.appendChild(rowH);\n rowH.appendChild(headerA);\n rowH.appendChild(headerB);\n\n // Append the table inside parent container\n document.getElementById(\"table_container\").appendChild(table);\n\n for (let key in data_obj) {\n // Create rows and cells with For loop\n row = document.createElement(\"tr\");\n cellA = document.createElement(\"td\");\n cellB = document.createElement(\"td\");\n\n dataTime = new Date(data_obj[key].data);\n\n // Fill with data\n cellA.innerHTML = data_obj[key].nome;\n // Setting european format date\n cellB.innerHTML = dataTime.toLocaleDateString();\n\n // Append rows and cells\n table.appendChild(row);\n row.appendChild(cellA);\n row.appendChild(cellB);\n }\n}", "function buildTable(data) {\n //clear any existing data\n tbody.html(\"\");\n //create a forEach function to loop through the array 'data'\n data.forEach((dataRow) => {\n //find the tbody tag and add a table row\n let row = tbody.append(\"tr\");\n //reference one object from the array, put the values into dataRow, one object per row\n Object.values(dataRow).forEach((val) => {\n //append data into a <td> tag\n let cell = row.append(\"td\");\n //extract only the text of the value from the key:value pair\n cell.text(val);\n });\n });\n}", "function buildTable(data){\n tbody.html(\"\");\n data.forEach(function(ufoData) {\n console.log(ufoData);\n var row = tbody.append(\"tr\");\n Object.entries(ufoData).forEach(function([key, value]) {\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function buildTable(data){\n tbody.html(\"\");\n data.forEach(function(ufoData) {\n console.log(ufoData);\n var row = tbody.append(\"tr\");\n Object.entries(ufoData).forEach(function([key, value]) {\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function buildTable(data) {\r\n tbody.html(\"\");\r\n//next loop through each object in data and append a row and cells for each value in the row\r\ndata.forEach((dataRow)) => {\r\n //append a row to table body\r\n let row=tbody.append(\"tr\");\r\n //Loop through each field in dataRow and add each value as a table cell (td)\r\n Object.values(dataRow).forEach((val)=> {\r\n let cell = row.append(\"td\");\r\n cell.text(val);\r\n }\r\n );\r\n}", "function buildTable(data) {\n //clear data\n tbody.html(\"\");\n\n //loop through each data object & append rows & values in each row\n data.forEach((dataRow) => {\n const row = tbody.append(\"tr\");\n\n //loop through each cell in every row to append\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n }\n );\n });\n\n}", "function buildTable(data){\n\n // clear the current data from the table\n tbody.html(\"\");\n\n // create a forEach loop to loop through the data array\n data.forEach((dataRow)=>{\n\n // add row to body as table row\n let row = tbody.append(\"tr\");\n\n //loop through each object in the data set\n Object.values(dataRow).forEach((val)=>{\n\n // add each object to it's row in table data\n let cell = row.append(\"td\");\n\n // add the values of the key:value pair for each object to the cell\n cell.text(val);\n }\n );\n });\n}", "function buildTable(data){\n // Start By Clearing Existing Data\n tbody.html(\"\");\n // Loop Through `data` \n data.forEach((dataRow) => {\n // Append Table Row to the Table Body \n let row = tbody.append(\"tr\");\n // Iterate Through Values\n Object.values(dataRow).forEach((val) => {\n // add a row\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "function table(data){\n tbody.html(\"\");\n\n\t//append the rows(tr) and cells(td) for returned values\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n \n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "function tabulate(data) {\n data.forEach((entry) => {\n var tr = tbody.append('tr');\n tr.append('td').attr(\"class\", \"Date\").text(entry.datetime);\n tr.append('td').attr(\"class\", \"City\").text(entry.city);\n tr.append('td').attr(\"class\", \"State\").text(entry.state);\n tr.append('td').attr(\"class\", \"Country\").text(entry.country);\n tr.append('td').attr(\"class\", \"Shape\").text(entry.shape);\n tr.append('td').attr(\"class\", \"Duration\").text(entry.durationMinutes);\n tr.append('td').attr(\"class\", \"Comments\").text(entry.comments);\n });\n}", "function buildTable(data) {\n // First, clear out any existing data\n tbody.html(\"\");\n \n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n \n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n }", "function buildTable(table){\n\n // loop through data\n table.forEach((item) => {\n\n // append rows\n let row = tbody.append(\"tr\");\n\n // iterate through keys and values\n Object.entries(item).forEach(([key, value]) => {\n\n // append cells \n let cell = row.append(\"td\");\n\n // add text value to each cell\n cell.text(value);\n });\n });\n}", "function renderTable(data) {\n var tHead = \"\";\n var tBody = \"\";\n var header = true;\n\n // adds data to array\n if (!Array.isArray(data)) {\n var dataTmp = data;\n data = [dataTmp];\n }\n\n // iterate through json objects in array\n for (var index in data) {\n tBody += \"<tr>\";\n // iterate through values in json object\n for (var key in data[index]) {\n // adds table header from key values\n if (header) tHead += \"<th>\" + key + \"</th>\";\n tBody += \"<td id = '\" + index + \"'>\" + data[index][key] + \"</td>\";\n }\n // stops adding table headers\n header = false;\n tBody += \"</tr>\";\n }\n tableHead.innerHTML = tHead;\n tableBody.innerHTML = tBody;\n}", "function makeTableFromJSON() {\n\tvar div = document.getElementById('table');\n\tmakeTableStyle(div);\n\t\n\tif(div)\n\t{\n\t\tdiv.innerHTML = \"\";\n\t}\n\tvar displayTable = \"<table id='dataTable' class='table table-striped table-bordered' cellspacing='0' width='100%'><thead><tr>\";\n\tvar data = JSON.parse(datasetToDisplay);\n\tvar headers = [];\n\tfor (var key in data[0]) {\n\t\talert(key);\n\t\tdisplayTable+= \"<th>\" +key+ \"</th>\";\n\t\theaders.push(key);\n\t}\n\tdisplayTable+= \"</tr></thead>\";\n\tdisplayTable+= \"<tbody>\";\n\t\n\t\n\tfor (var i = 1; i < data.length; i++) {\n\t\tdisplayTable+= \"<tr>\";\n\t\tfor(var j=0;j<headers.length;j++){\n\t\tdisplayTable+= \"<td>\" +data[i].headers[j]+\" </td>\";\n\t\t}\n\t\tdisplayTable+=\"</tr>\"\n\t}\n\t\n\tdisplayTable+=\"</table>\";\n\tvar Columns = makeColumnHeaderForTable(colData);\n\tmakeFilterElements();\n makeObjects(colData);\n\t\t\t\n\n\t\n\tdiv.innerHTML = displayTable;\n\t\n\t\t\t$('#dataTable').DataTable({\n\t\t\t\t\"paging\": true,\n\t\t\t\t\"ordering\": true,\n\t\t\t\t\"info\": false,\n\t\t\t\t\"lengthMenu\": [[10, 25, 50, -1], [10, 25, 50, \"All\"]]\n\t\t\t\t\n\t\t\t});\n}", "function buildTable(data) {\n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n // Create list of table values \n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n })\n}", "function buildTable(data) {\n var headers = Object.keys(data[0]);\n var table = document.createElement(\"TABLE\");\n var row = document.createElement(\"TR\");\n headers.forEach(function(column){\n var cellH = document.createElement(\"TH\");\n var textItem = document.createTextNode(column);\n cellH.appendChild(textItem);\n row.appendChild(cellH);\n });\n table.appendChild(row); \n \n data.forEach(function(item){\n var row = document.createElement(\"TR\");\n headers.forEach(function(header){\n var cell = document.createElement(\"TD\");\n var textItem = document.createTextNode(item[header]);\n cell.appendChild(textItem); //to right align numeric values\n if(!isNaN(item[header]))\n cell.style.textAlign = \"right\";\n row.appendChild(cell);\n });\n table.appendChild(row);\n }); \n return table;\n }", "function table_Build(data) {\n tableBody.html(\"\");\n data.forEach((row) => {\n const new_row = tableBody.append(\"tr\");\n \n Object.values(row).forEach((value) => {\n let dp = new_row.append(\"td\");\n dp.text(value);\n }\n );\n });\n}", "function buildTable(data){\n //1st step is to clear out existing data with an empty data cell \n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n console.table(dataRow);\n //now that we have the loop, we want to append it to a table row (\"tr\")\n let row = tbody.append(\"tr\");\n\n console.log(Object.values(dataRow));\n\n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n\n\n })\n}", "function table(json) {\n var table = json.table,\n\trows = table.length,\n\tcols = table[0].length,\n\trowlabels = json.rowlabels,\n\tcollabels = json.collabels,\n\trowperm = reorder.permutation(rows),\n\tcolperm = reorder.permutation(cols);\n\n \n}", "function format(d, indice) {\n // `d` is the original data object for the row\n var texto = d[indice]; //indice donde esta el input hidden\n var resultado = $(texto).val();\n var json = JSON.parse(resultado);\n var len = Object.keys(json).length;\n console.log(json);\n var childTable = '<table style=\"padding-left:20px;border-collapse: separate;border-spacing: 10px 3px;\">' +\n '<tr><td style=\"font-weight: bold\">' + $('#text_response').val() + '</td><td style=\"font-weight: bold\">' + $('#text_value').val() + '</td><td style=\"font-weight: bold\">' + $('#text_date').val() + '</td></tr>';\n for (var i = 1; i <= len; i++) {\n childTable = childTable +\n '<tr></tr><tr><td>' + json[i].respuesta + '</td><td>' + json[i].valor + '</td><td>' + json[i].fechaResultado + '</td></tr>';\n }\n childTable = childTable + '</table>';\n return childTable;\n }", "function structureJSON(){\n \n $('#result_wrapper').remove();\n $('body').append('<table id=\"result\" class=\"width100\"><table/>');\n \n // Convert text into JSON\n data = JSON.parse($('#input').val());\n \n // If data has been parsed correctly and it is an array\n if (data && typeof(data) == 'object' ){\n \n parseToTable(data, function(aaData, aoColumns){\n \n // Create table\n $('#result').dataTable({\n\t\"aaData\" : aaData,\n\t\"aoColumns\" : aoColumns,\n\t\"bLengthChange\": true,\n\t\"bDestroy\": true\n });\n \n });\n }\n}", "function tableBuild(data) {\n //used to clear current data on table\n tbody.html(\"\");\n //used forEach to itrate through each ro of data\n data.forEach((row) => {\n //created variable to create a new row on the table\n var dataRow = tbody.append('tr');\n //read values from each row of the dataset\n Object.values(row).forEach((value) => {\n //appened the new row in order to accept the values\n var cell = dataRow.append('td');\n //inserted the values into each corresponing cell on the table\n cell.text(value);\n })\n })\n}", "function populateTable(tableData) {\n tbody.innerHTML = (\"\");\n tableData.forEach((datum) => {\n var row = tbody.append(\"tr\");\n console.log(datum);\n\n Object.entries(datum).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "function dataTable(data) {\n var keys = Object.keys(data[0]);\n var headers = keys.map(function(name) {\n return new UnderlinedCell(new TextCell(name));\n });\n var body = data.map(function(row) {\n return keys.map(function(name) {\n var value = row[name];\n // This was changed:\n if (typeof value == \"number\")\n return new RTextCell(String(value));\n else\n return new TextCell(String(value));\n });\n });\n return [headers].concat(body);\n}", "function getRowData(tr=false, format=\"JSON\") {\n if(tr) {\n \n if(format === \"JSON\") {\n var obj = [];\n \n\n tds = $(tr).find(\"td\");\n tds.each(function() {\n var data = $(this).text();\n obj.push(data)\n });\n\n return obj;\n }\n }\n}", "function generateRowsTableEstablecimientos(object){\r\n\tdataSet = null;\r\n\tvar output = \"[\";\r\n\t$.each(object, function(i) {\r\n\t\tif (i != 0){\r\n\t\t\toutput += ','\r\n\t\t}\r\n\t\toutput += \"[\";\r\n\t\toutput += '\"<a href=\\'javascript:GotoEstablecimiento(' + object[i].idEstablecimiento + ')\\'>' + object[i].nombre + '</a>\"';\r\n\t\toutput += ',\"' + object[i].codigoEstablecimiento + '\"';\r\n\t\toutput += \"]\";\r\n\t});\r\n\toutput += \"]\";\r\n\tconsole.log(output);\r\n\tdataSet = JSON.parse(output);\r\n}", "function displayData(data){ \n tbody.text(\"\")\n data.forEach(function(sighting){\n new_tr = tbody.append(\"tr\")\n Object.entries(sighting).forEach(function([key, value]){\n new_td = new_tr.append(\"td\").text(value)\t\n })\n})}", "function makeTableFromJSON(json_obj) {\n // grab the table display element and set up for the table\n var table_display = document.getElementById('dynamic_table');\n var table = document.createElement('table');\n var table_body = table.createTBody();\n var table_header = table.createTHead();\n\n // cleaning the old table is part of setup\n while(table_display.firstChild) {\n table_display.removeChild(table_display.firstChild);\n }\n\n // get the number of rows and columns we have\n var rows = json_obj.length;\n if (rows < 1) {\n alert('Retrieved an empty JSON object! :(');\n }\n var cols = Object.keys(json_obj[0]).length;\n // console.log('DEBUG -> ROWS: ' + rows + ', COLS: ' + cols);\n\n // start some variables outside the loops and reuse them\n var table_row = table_header.insertRow(0); \n var table_col;\n var json_keys = Object.keys(json_obj[0]);\n // console.log(json_keys);\n\n // build the header row\n var i = 0;\n json_keys.forEach(function(key) {\n table_col = table_row.insertCell(i);\n table_col.innerHTML = '<b>' + key + '</b>';\n i++;\n })\n \n for (var i=0; i<rows; i++) {\n table_row = table_body.insertRow(i);\n for (var j=0; j<cols; j++) {\n table_col = table_row.insertCell(j);\n table_col.innerHTML = json_obj[i][json_keys[j]];\n }\n }\n\n table_display.appendChild(table);\n}", "function createTable (data) {\n tbody.html(\"\");\n data.forEach(function(UFO) {\n var datarow = tbody.append(\"tr\");\n Object.entries(UFO).forEach(([key, value]) => {\n var cell = datarow.append(\"td\");\n cell.text(value)\n })\n })\n}", "function populateTable (data){\r\n\r\n tbody.html (\"\")\r\n\r\ndata.forEach((weatherReport) => {\r\n\r\n var row = tbody.append(\"tr\");\r\n\r\n Object.entries(weatherReport).forEach(([key, value]) => {\r\n\r\n var cell = row.append(\"td\");\r\n\r\n cell.text(value);\r\n\r\n });\r\n\r\n});\r\n\r\n}", "function tableValues(data) {\n data.forEach(ufoSightings => {\n console.log(ufoSightings);\n let row = tableBody.append(\"tr\");\n Object.entries(ufoSightings).forEach(([key, value]) => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function poplulateTable(data){\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "function displayData(tableData){\r\n tableData.forEach(function(record){\r\n // console.log(record);\r\n var row = tbody.append(\"tr\");\r\n \r\n Object.entries(record).forEach(function([key, value]){\r\n var cell = row.append(\"td\");\r\n cell.text(value);\r\n });\r\n })}", "function createTable(jsonObject) {\n let tableArray =[]; //empty array to start\n jsonObject.degrees.forEach(function(property){ //iterate through json object (which is called degrees)\n tableArray.push( //and push that data into an array\n `<tr>\n <td>${property.School}</td>\n <td>${property.Program}</td>\n <td>${property.Type}</td>\n <td>${property.Year}</td></tr>`); //telling my function to display each key/value pair\n });\n return tableArray; //return the complete table\n}", "function renderJson(json) {\n\t\ttable.setData([]);\n\t\tvar curheader = '0';\n\t\tvar index = [];\n\t\tvar rows = [];\n\n\t\tfor (var i = 0,\n\t\t j = json.horses.length; i < j; i++) {\n\n\t\t\tvar item1,\n\t\t\t item2;\n\n\t\t\titem1 = json.horses[i].id;\n\t\t\titem2 = json.horses[i].name.toString().trim();\n\n\t\t\tvar row = Ti.UI.createTableViewRow({\n\t\t\t\tid : item1,\n\t\t\t\ttitle : item2\n\t\t\t});\n\n\t\t\tif (item2.substring(0, 1) != curheader) {\n\t\t\t\tcurheader = item2.substring(0, 1);\n\t\t\t\trow.header = curheader;\n\t\t\t\tindex.push({\n\t\t\t\t\tindex : i,\n\t\t\t\t\ttitle : curheader\n\t\t\t\t});\n\t\t\t}\n\t\t\trow.className = 'horseList';\n\t\t\trows.push(row);\n\t\t}\n\n\t\t//Tweak to the table set\n\t\ttable.setData(rows);\n\t\ttable.setIndex(index);\n\t}", "function init(){ \n data.forEach((rowData) => {\n var row = tbody.append(\"tr\");\n Object.entries(rowData).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function dataTable(data){\n var keys = Object.keys(data[0]);\n var headers = keys.map(function(name){\n return new UnderlinedCell(new TextCell(name));\n });\n\n var body = data.map(function(row){\n return keys.map(function(name){\n return new TextCell(String(row[name]));\n });\n });\n return [headers].concat(body);\n}", "function buildTable(data) {\n\n //Clear any existing table\n tbody.html(\"\");\n\n //Iterate through the data to create all necessary rows\n data.forEach((dataRow) => {\n var row = tbody.append(\"tr\");\n Object.entries(dataRow).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "function makeTable(data){\n var tbody = d3.select(\"#ufo-table\").select(\"tbody\");\n tbody.html(\"\");\n data.forEach((x) => {\n var row = tbody.append(\"tr\");\n Object.entries(x).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function add_table_rows_from_JSONdata(files){\n\n // convert JSON response into javascript objects\n var files = jQuery.parseJSON(files);\n\n // clear existing table content\n table.clear().draw();\n\n // fill the table with rows\n var t_row = null;\n for (var i=0; i<files.length; i++){\n t_row = create_row(files[i].id, files[i].excelName, files[i].updatedAt.timestamp);\n table.row.add($(t_row)).draw();\n }\n}", "function createTable(data){\n\n resetTable();\n data.forEach((sighting)=>{\n console.log(sighting);\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value])=> {\n console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n});\n});\n}", "function displayJsonToHtmlTable(jsonData) {\n var table = document.getElementById(\"display_csv_data\");\n if (jsonData.length > 0) {\n var headers = Object.keys(jsonData[0]);\n var htmlHeader = \"<thead><tr>\";\n\n for (var i = 0; i < headers.length; i++) {\n htmlHeader += \"<th>\" + headers[i] + \"</th>\";\n }\n htmlHeader += \"<tr></thead>\";\n\n var htmlBody = \"<tbody>\";\n for (var i = 0; i < jsonData.length; i++) {\n var row = jsonData[i];\n htmlBody += \"<tr>\";\n for (var j = 0; j < headers.length; j++) {\n var key = headers[j];\n htmlBody += \"<td>\" + row[key] + \"</td>\";\n }\n htmlBody += \"</tr>\";\n }\n htmlBody += \"</tbody>\";\n table.innerHTML = htmlHeader + htmlBody;\n } else {\n table.innerHTML = \"There is no data in CSV\";\n }\n}", "function generateTable(data){ \n var tbody = d3.select(\"tbody\");\n $(\"#tablebody tr\").remove();\n data.forEach(function(results){\n var row = tbody.append(\"tr\"); \n Object.entries(results).forEach(function([key,value]){\n var cell = row.append(\"td\"); \n cell.text(value);\n });\n });\n\n}", "function results(items) {\n // Iterate through each item object\n items.forEach((item) => {\n\n // Append one table row `tr` to the table body\n var row = tbody.append(\"tr\");\n\n // Iterate through each key and value\n Object.entries(item).forEach(([key, value]) => { \n \n // Use the key to determine which array to push the value to\n if (key === \"datetime\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"city\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"state\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"country\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"shape\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"durationMinutes\") {\n row.append(\"td\").text(value);\n }\n else if (key === \"comments\") {\n row.append(\"td\").text(value);\n }\n });\n });\n}", "function buildTable(data) {\n // Clears out data table\n tbody.html(\"\");\n // Loop through each row of the data\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n // add code to loop through each field\n Object.values(dataRow).forEach((val) => {\n // create a variable to append data to a table\n let cell = row.append(\"td\");\n // add the values\n cell.text(val);\n });\n });\n }", "function displayData(data){ \r\n tbody.text(\"\")\r\n data.forEach(function(sighting){\r\n new_tr = tbody.append(\"tr\")\r\n Object.entries(sighting).forEach(function([key, value]){\r\n new_td = new_tr.append(\"td\").text(value)\t\r\n })\r\n})}", "function displayData(data){\n tbody.text(\"\")\n data.forEach(function(ufo_sighting){\n new_table_row = tbody.append(\"tr\")\n Object.entries(ufo_sighting).forEach(function([key, value]){\n new_table_cell = new_table_row.append(\"td\").text(value)\n }) \n })}", "function displayData(data){\n tbody.text(\"\")\n data.forEach(function(ufo_sighting){\n new_table_row = tbody.append(\"tr\")\n Object.entries(ufo_sighting).forEach(function([key, value]){\n new_table_cell = new_table_row.append(\"td\").text(value)\n }) \n })}", "function formatJsonString(d){\n var tableFlow = '';\n var taskStringFlow = [];\n var JsonStringFlow = $.parseJSON(d);\n for(var n in JsonStringFlow){\n taskStringFlow.push(JsonStringFlow[n]);\n }\n\n tableFlow = '<table cellpadding=\"5\" cellspacing=\"0\" border=\"0\" class=\"table table-condensed\" style=\"padding-left:50px; font-size:13px;\">';\n\n for(var i in taskStringFlow){\n tableFlow += '<tr style=\"border:none !important;\">'+\n '<td style=\"border:none !important;\">'+taskStringFlow[i].name+'</td>'+\n '<td style=\"border:none !important;\"><img src=\"'+taskStringFlow[i].image+'\" class=\"img img-responsive\" style=\"width:10%;\" /></td>'+\n '<td style=\"border:none !important;\">'+taskStringFlow[i].qty+'</td>'+\n '<td style=\"border:none !important;\">'+taskStringFlow[i].price+'</td>'+\n '<td style=\"border:none !important;\">'+parseInt(taskStringFlow[i].qty) * parseInt(taskStringFlow[i].price)+'</td>'+\n '</tr>'\n }\n tableFlow += '</table>';\n return tableFlow;\n}", "function addJSONObjecttoDataTable(json)\n\t{\n\t\tvar\tt = $('#tbl_id').DataTable();\n\t\t\n\t\t t.row.add( [\n\t \t\t(json.firstName) ,\n\t \t\t(json.lastName),\n\t \t\t(json.age)\t \n\t \t ] ).draw( false );\n\t}", "function mkTableRow(firebaseObj) {\n // console.dir(firebaseObj);\n // Get Parrent table body (Parent)\n let _tableBody = document.querySelector(\"#set-train-info\");\n // Create the table row element\n let _tableRow = document.createElement(\"tr\");\n // get next train time and minutes away\n let timesObj = getTimes(firebaseObj.time);\n // combind json withh all data\n // bject.assign() will append the 2 json in a single\n let dataCollection = Object.assign(firebaseObj.train, timesObj);\n // loop through data and add to table row\n for (let _data in dataCollection) {\n // create table data\n let tableData = document.createElement(\"td\");\n // add text to table data\n tableData.textContent = dataCollection[_data];\n // append table data to table row\n _tableRow.appendChild(tableData);\n }\n // add row to table body\n _tableBody.appendChild(_tableRow);\n}", "function createTable(formattedJSONData2Darray) {\n let headerArr = [\"Date\", \"Location\", \"Type\", \"Value\", \"Unit\"];\n // var table = $('<table>');\n var thead = $('<thead>');\n $('table').append(thead);\n let trHead = $('<tr>')\n\n\n //append head with names\n for (var i = 0; i < headerArr.length; i++) {\n var tr = $('<tr>');\n let th = $('<th>')\n th.appendTo(trHead);\n th.text(headerArr[i]);\n }\n trHead.appendTo($(thead));\n //append table with values to head\n for (var i = 0; i < formattedJSONData2Darray.length; i++) {\n let tr = $('<tr>');\n $('#insertLocation').append($(tr)); //apends 1 value\n for (var ii = 0; ii < formattedJSONData2Darray[i].length; ii++) {\n var td = $('<td>');\n $(tr).append(td.text(formattedJSONData2Darray[i][ii]));\n }\n // formattedJSONData2Darray[i].forEach(columnElemText =>\n // $(tr).append(td.text(columnElemText))\n // );\n }\n console.log(formattedJSONData2Darray.length);\n\n\n}", "function table(r){\n r.forEach(sighting => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key,value]) => {\n var entries = row.append(\"td\").text(value);\n });\n });\n}", "function generateRowsTableAdminEstablecimientos(object){\r\n\tdataSet = null;\r\n\tvar output = \"[\";\r\n\t$.each(object, function(i) {\r\n\t\tif (i != 0){\r\n\t\t\toutput += ','\r\n\t\t}\r\n\t\toutput += \"[\";\r\n\t\toutput += '\"<a href=\\'javascript:GotoCreateUpdateEstablecimiento(' + object[i].idEstablecimiento + ')\\'>' + object[i].nombre + '</a>\"';\r\n\t\toutput += \"]\";\r\n\t});\r\n\toutput += \"]\";\r\n\tconsole.log(output);\r\n\tdataSet = JSON.parse(output);\r\n}", "function JSONToHTML(json) {\n let html=\"<table>\\n\";\n let arr=JSON.parse(json);\n html+=\" <tr>\";\n for(let key of Object.keys(arr[0])) {\n html+='<th>${htmlEscape(key)}</th>>';\n }\n html+='</tr>\\n';\n\n for(let obj of arr) {\n for(let keys of Object.keys(arr[0])) {\n html += '<td>${htmlEscape(obj[keys])}</td>'\n }\n } html+='</tr>\\n';\n return html+\"</table>\";\n function htmlEscape(text) {\n return text\n .replace(/&/g, \"&amp;\")\n .replace(/</g, \"&lt;\")\n .replace(/>/g, \"&gt;\")\n .replace(/\"/g, \"&quot;\")\n .replace(/'/g, \"&#039;\");}\n\n\n}", "function generateTable(data) {\n var html = '<table class=\"table table-striped\"><caption>Preview Data</caption>';\n var row_count = 10;\n if(typeof(data[0]) === 'undefined') {\n return null;\n }\n\n if(data[0].constructor === String) {\n html += '<tr>\\r\\n';\n for(var item in data) {\n html += '<td>' + data[item] + '</td>\\r\\n';\n }\n html += '</tr>\\r\\n';\n }\n\n if(data[0].constructor === Array) {\n\tvar i = 0; \n for(var row in data) {\n if(i < row_count) {\n\t html += '<tr>\\r\\n';\n\t for(var item in data[row]) {\n\t html += '<td>' + data[row][item] + '</td>\\r\\n';\n\t }\n\t html += '</tr>\\r\\n';\n } else {\n \t break;\n }\n i++;\n }\n \n }\n\n if(data[0].constructor === Object) {\n for(var row in data) {\n html += '<tr>\\r\\n';\n for(var item in data[row]) {\n html += '<td>' + item + ':' + data[row][item] + '</td>\\r\\n';\n }\n html += '</tr>\\r\\n';\n }\n }\n html += \"</table>\";\n return html;\n}", "function jsonObjektEinfuegen(tabelleId, jsonobjekt) {\n var tabelle = document.getElementById(tabelleId);\n //eine neues rowTag erstellen und mit dem uebergebenen JSON Objekt fuellen\n // rowTag erstellen\n var rowTag = document.createElement('tr');\n for (var i in jsonobjekt){\n var cellTag = document.createElement('td');\n var textNode;\n textNode = document.createTextNode(jsonobjekt[i]);\n cellTag.appendChild(textNode);\n rowTag.appendChild(cellTag);\n }\n tabelle.appendChild(rowTag);\n}", "function createResultRows(table, data){\r\n\tfor (let i = 0; i < data.length; i++){\r\n\t\tlet row = document.createElement(\"TR\");\r\n\t\ttable.append(row);\r\n\r\n\t\t// create cells and append to the current row. Pass in the object values as argument\r\n\t\tcreateCells(row, data[i]);\r\n\t}\r\n}", "function dataTable(data) {\n var keys = Object.keys(data[0]);\n var headers = keys.map(function(name) {\n return new UnderlinedCell(new TextCell(name));\n });\n var body = data.map(function(row) {\n return keys.map(function(name) {\n return new TextCell(String(row[name]));\n });\n });\n return [headers].concat(body);\n}", "function createTable(jsonE, str) {\n $('body').append('<table id=\"tb' + str + '\"><tr class=\"trh\"></tr></table>');\n // $('body').append('<table id=\"tb' + str + '\"><tr class=\"trh' + str + '\"></tr></table>');\n // $('body').append('<table id=\"tb\"><tr class=\"trh\"></tr></table>');\n\n for (x in jsonE[0]) {\n // $('.trh' + str).append('<th>' + x + '</th>');\n $('#tb' + str + ' .trh').append('<th>' + x + '</th>');\n }\n\n // debugger;\n\n let i = 0;\n jsonE.forEach(arr => {\n $('#tb' + str).append('<tr class=\"tr' + i + '\"></tr>');\n for (x in arr) {\n if (x === 'nextSalary') {\n $('#tb' + str + ' .tr' + i).append('<td><ol class=\"ol' + i + '\"></ol></td>');\n for (j = 0; j < 3; j++) {\n $('.ol' + i).append('<li>' + arr[x][j] + '</li>');\n }\n } else {\n $('#tb' + str + ' .tr' + i).append('<td>' + arr[x] + '</td>');\n }\n }\n i++;\n });\n}", "function bindJSONtoTable(table, url, data, callback) {\n\tif(table.is('table')) {\n\t\t$.getJSON(url, data, function(mydata){\n\t\t\tvar data_header = null;\n\t\t\tvar data_series = null;\n\t\t\t\n\t\t\tvar $thead = $(\"<thead></thead>\");\n\t\t\ttable.append($thead);\n\t\t\tvar $tbody = $(\"<tbody></tbody>\");\n\t\t\ttable.append($tbody);\n\t\t\t\n\t\t\tfor(var one in mydata) { // init for the table data\n\t\t\t\tvar item = mydata[one];\n\t\t\t\t\n\t\t\t\tif(item[\"categories\"] != null && item[\"categories\"] != undefined) {\n\t\t\t\t\tdata_header = item[\"categories\"];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(one == \"series\") {\n\t\t\t\t\tdata_series = item;\n\t\t\t\t}\n\t\t\t} // end for\n\t\t\t\n\t\t\tvar hasName = false;\n\t\t\t\n\t\t\tif(data_header != null) { // add title for the table\n\t\t\t\tvar $tr = $(\"<tr></tr>\");\n\t\t\t\t$thead.append($tr);\n\t\t\t\t$tr.append(\"<th></th>\");\n\t\t\t\t\n\t\t\t\tfor(var i = 0; i < data_header.length; i++) {\n\t\t\t\t\tvar value = data_header[i];\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tvar $th = $(\"<th></th>\");\n\t\t\t\t\t$th.html(value);\n\t\t\t\t\t$tr.append($th);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(data_series != null) { // add data into tbody\n\t\t\t\tfor(var i = 0 ; i < data_series.length ; i++) {\n\t\t\t\t\tvar divItem = data_series[i];\n\t\t\t\t\tvar $tr = $(\"<tr></tr>\");\n\t\t\t\t\t$tbody.append($tr);\n\t\t\t\t\t\n\t\t\t\t\tvar $title = $(\"<td></td>\");\n\t\t\t\t\t$tr.append($title);\n\t\t\t\t\tif(divItem[\"name\"] != undefined) {\n\t\t\t\t\t\t$title.html(divItem[\"name\"]);\n\t\t\t\t\t\thasName = true;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tfor(var j = 0 ; j < divItem[\"data\"].length ; j++) {\n\t\t\t\t\t\tvar value = divItem[\"data\"][j];\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar $td = $(\"<td></td>\");\n\t\t\t\t\t\t$td.html(value);\n\t\t\t\t\t\t$tr.append($td);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif(!hasName) { // rm title cell if not exist\n\t\t\t\t$thead.find(\"tr\").find(\"th:first\").remove();\n\t\t\t\t$tbody.find(\"tr\").find(\"td:first\").remove();\n\t\t\t}\n\t\t\t\n\t\t\tif(callback != undefined) callback(table);\n\t\t});\n\t}\n}", "addRows() {\n if (this._data.constructor !== Array)\n throw TypeError('data property of table is not an array');\n\n this._data.forEach((item) => {\n\n if (item.constructor !== this._rowItemType)\n throw TypeError('invalid item type for table row');\n\n let $tr = $('<tr>');\n\n for (const prop in item) {\n let $td = $('<td>');\n $td.html(item[prop]);\n $tr.append($td);\n }\n\n this._body.append($tr);\n })\n }", "function populate(data){\n data.forEach(function(sighting) {\n //console.log(sighting);\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n //console.log(key, value);\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n})\n}", "function displaytable(data){\n tbody.html(\"\");\n data.forEach(function(Table) {\n console.log(Table);\n var row = tbody.append(\"tr\");\n Object.entries(Table).forEach(function([key, value]) {\n console.log(key, value);\n // Append a cell to the row for each value\n // in the weather report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function getData(tableData){\n tableData.forEach((sighting) => {\n //console.log(sighting)\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n //console.log(key, value);\n // Append a cell to the row for each value\n // in the weather report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function buildTable(data){\n // Clear tbody variable data\n tbody.html(\"\");\n // Create a loop that iterates through data.js to find each row\n data.forEach((dataRow) => {\n // For each new row found, append row `tr` to the html table body `tbody`\n let row = tbody.append(\"tr\");\n // Apply a value for each data row value found that will correspond to the table body column\n Object.values(dataRow).forEach((val) => {\n // Iterate through and append a cell to the row for each new value to fill out table\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "function dataTable(table){\n // Reset table\n tbody.text(\"\");\n\n // Populate table\n table.forEach(function(incident) {\n // console.log(incident);\n var row = tbody.append(\"tr\");\n Object.entries(incident).forEach(function([key, value]) {\n // console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "function buildTable(d) {\n var row = tbody.append('tr');\n Object.entries(d).forEach(([key, value]) => {\n var column = row.append('td').text(value);\n\n\t});\n}", "function setRows(dataJSON, dataAtributes, columns, actions, father){\n\t$.each(dataJSON, function(key, val){\n\t\tlet line = '<tr';\n\t\t\n\t\t// adiciona atributos\n\t\tfor (let i = 0; i < dataAtributes.length; i++) {\n\t\t\tline += ' data-'+dataAtributes[i]+'=\"'+ val[dataAtributes[i]] +'\"';\n\t\t}\n\t\tline += '>';\n\t\t\n\t\t// adiciona colunas\n\t\tfor (let i = 0; i < columns.length; i++) {\n\t\t\tline += val[columns[i]] ? '<td>'+val[columns[i]]+'</td>' : '<td></td>';\n\t\t}\n\t\tline += '<td>';\n\t\tfor (let i = 0; i < actions.length; i++) {\n\t\t\tline += actions[i];\n\t\t}\n\t\tline += '</td>';\n\t\tline += '</tr>';\n\t\tfather.append(line);\n\t\t\n\t\t// visualizar HTML gerado no console\n\t\tconsole.log(line);\n\t});\n}", "function buildTable(data) {\n // Clear existing data in table\n tbody.html(\"\");\n // Create forEach function to loop through the table\n data.forEach((dataRow) => {\n // Create a variable to add a row to the table\n let row = tbody.append(\"tr\");\n // Reference an object from the array of UFO sightings and put each sighting in its own row of data\n Object.values(dataRow).forEach((val) => {\n // Create a variable to add data to the row\n let cell = row.append(\"td\");\n // Add values \n cell.text(val);\n });\n });\n}", "function buildTable(tableData){\n // Clear the html table section\n tbody.html(\"\");\n //Loop to append data \n tableData.forEach(dataEntry =>{\n var row = tbody.append(\"tr\");\n Object.entries(dataEntry).forEach(([key,value]) =>{\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function populateLanguageTable(data) \n{\n for( i = 0; i < data.length; i++ )\n {\n $('#languagesTable tr:last').after('<tr><td>' + data[i].LANGUAGE + '</td><td>' + data[i].LEVEL + '</td><td>' + data[i].AVERAGE_SOURCE_STATEMENTS_PER_FUNCTION_POINT + '</td></tr>');\n }\n}", "function fromJSONtoActionRow(scheduling_action){\n var str = \"\";\n\n var done_str = scheduling_action.DONE ? (new Date(scheduling_action.DONE*1000).toLocaleString()) : \"\";\n var message_str = scheduling_action.MESSAGE ? scheduling_action.MESSAGE : \"\";\n var time_str = new Date(scheduling_action.TIME*1000).toLocaleString();\n\n str += '<tr class=\"tr_action_'+scheduling_action.ID+'\">\\\n <td class=\"id_row\">'+scheduling_action.ID+'</td>\\\n <td class=\"action_row\">'+scheduling_action.ACTION+'</td>\\\n <td nowrap class=\"time_row\">'+time_str+'</td>\\\n <td class=\"done_row\">'+done_str+'</td>\\\n <td class=\"message_row\">'+message_str+'</td>\\\n <td>\\\n <div>\\\n <a id=\"minus_'+scheduling_action.ID+'\" class=\"remove_action_x\" href=\"#\"><i class=\"fa fa-trash-o\"/></a>\\\n </div>\\\n </td>\\\n </tr>';\n\n return str;\n}", "function addEntryToTable(json){\n // Create an empty <tr> element and add it to the 1st position of the table:\n var row = document.getElementById(\"table1\").insertRow(1);\n // Insert new cells (<td> elements) at the 1st and 2nd position of the \"new\" <tr> element:\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n var cell5 = row.insertCell(4);\n\n // Add some text to the new cells:\n cell1.innerHTML = json.anglername;\n cell2.innerHTML = json.fishtype;\n cell3.innerHTML = json.lineclass;\n cell4.innerHTML = json.fishweight;\n cell5.innerHTML = json.date;\n}", "function loadTable(data) {\n var tbody = d3.select(\"tbody\");\n data.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function create_table(data, id) {\r\n var e = \"\";\r\n var headers = data[0];\r\n var k = Object.keys(headers);\r\n e += \"<tr>\"\r\n $.each(k, function (h, j) {\r\n e += \"<th>\" + j + \"</th>\";\r\n })\r\n e += \"</tr>\";\r\n $.each(data, function (i, d) {\r\n e += \"<tr>\";\r\n var v = Object.values(d);\r\n $.each(v, function (h, j) {\r\n e += \"<td>\" + j + \"</td>\";\r\n })\r\n e += \"</tr>\";\r\n })\r\n $(\"#\" + id).html(e);\r\n}", "function makeTable(data) {\n var tableData = data.map(person => \"<tr><td>\" + person.id + \"</td><td>\" + person.age + \"</td><td>\" + person.name + \"</td><td>\" + person.gender + \"</td><td>\" + person.email + \"</td></tr>\");\n tableData.unshift('<table class=\"table\"><tr><th scope=\"col\">id</th><th scope=\"col\">age</th><th scope=\"col\">name</th><th scope=\"col\">gender</th><th scope=\"col\">email</th></tr>');\n tableData.push(\"</table>\");\n return tableData.join(\"\");\n}", "function _jsToTable(objectBlob) {\n var rowData = _flattenData(objectBlob);\n var headers = _extractHeaders(rowData);\n return {\"headers\":headers, \"rowData\":rowData};\n }", "function buildTable(ufoInfo) {\n // First, clear out any existing data\n tbody.html(\"\");\n\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n ufoInfo.forEach((ufoSighting) => {\n let row = tbody.append('tr');\n\n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.entries(ufoSighting).forEach(([key, value]) => { \n let tableBody = row.append('td');\n tableBody.text(value);\n });\n });\n}", "function insertRows(dataInput) {\n dataInput.forEach((sightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function tableToJson(table) {\n var data = [];\n\n // first row needs to be headers\n var headers = [];\n for (var i=0; i<table.rows[0].cells.length; i++) {\n headers[i] = table.rows[0].cells[i].innerHTML.toLowerCase().replace(/ /gi,'');\n }\n\n // go through cells\n for (var i=1; i<table.rows.length; i++) {\n\n var tableRow = table.rows[i];\n var rowData = {};\n\n for (var j=0; j<tableRow.cells.length; j++) {\n\n var string = (tableRow.cells[j].innerHTML).replace(\"<br>\",\"\");\n rowData[ headers[j] ] = string;\n\n }\n\n data.push(rowData);\n } \n\n return data;\n}", "function renderTable(data){\r\n\tlet table = createEmptyTable(\"tableContainer\");\r\n\tcreateHeaderRow(table, data[0]); // Pass any of the data objects to this function\r\n\tcreateResultRows(table, data); // Pass all of the data objects to this function\r\n}", "function dataTable(data) {\n tbody.html('');\n data.forEach(function(sightings) {\n console.log(sightings);\n var row = tbody.append('tr');\n \n Object.entries(sightings).forEach(function([key, value]) {\n console.log(key, value);\n var cell = row.append('td');\n cell.text(value);\n });\n });\n \n console.log('You have begun your search for the truth!');\n}", "function rendtable(jsons, screen){\n\t\n\tconst tableItem = document.querySelector('table tbody');\t//css selector not for IE8-\n\t//let tableItem = document.getElementsByTagName('table')[0];\n\tlet elem;\t\t\n\t\n\tfor(elem in jsons){\n\t\t//篩選資料\n\t\tif(screen(jsons[elem])){\t\t\t\n\t\t\n\t\t//產生資料列元素\n\t\tlet row = document.createElement('tr');\n\t\tlet sno = document.createElement('td');\n\t\tlet sna = document.createElement('td');\n\t\tlet sbi = document.createElement('td');\n\t\tlet bemp = document.createElement('td');\t\t\n\t\tlet sarea = document.createElement('td');\n\t\tlet ar = document.createElement('td');\t\t\t\t\n\t\tlet mday = document.createElement('td');\n\t\t//填入資料\n\t\tsno.innerHTML = jsons[elem].sno;\t\t\n\t\tsna.innerHTML = jsons[elem].sna;\n\t\tsbi.innerHTML = jsons[elem].sbi;\n\t\tbemp.innerHTML = jsons[elem].bemp;\n\t\tsarea.innerHTML = jsons[elem].sarea;\n\t\tar.innerHTML = jsons[elem].ar;\n\t\tmday.innerHTML = jsons[elem].mday;\n\t\t//排版\n\t\trow.classList.add('dynamic');\t\n\t\trow.appendChild(sno);\n\t\trow.appendChild(sna);\n\t\trow.appendChild(sbi);\n\t\trow.appendChild(bemp);\n\t\trow.appendChild(sarea);\n\t\trow.appendChild(ar);\n\t\trow.appendChild(mday);\n\t\t\n\t\t\ttableItem.appendChild(row);\n\t\t}\n\t}\n}", "function displayData(data){ \n body.text(\"\")\n data.forEach(function(sight){\n newtr = body.append(\"tr\")\n Object.entries(sight).forEach(function([key, value]){\n newtd = newtr.append(\"td\").text(value)\t\n })\n})}", "function buildTable(tableData) {\n tbody.html(\"\");\n //Looping through the data to get the elements using forEach funtion\n tableData.forEach((ufoCitings) => {\n console.log(ufoCitings);\n var row = tbody.append(\"tr\");\n //Enter each row in the table\n Object.entries(ufoCitings).forEach(([key, value]) => {\n console.log(`key = ${key} and value ${value}`);\n var cell = row.append('td');\n cell.text(value);\n });\n });\n}", "function fill_table(list) {\n data.forEach((list) => {\n var row = tbody.append(\"tr\");\n Object.entries(list).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function init(){\r\n data.forEach(function(ufosightings) {\r\n console.log(ufosightings);\r\n var row = tbody.append(\"tr\");\r\n \r\n Object.entries(ufosightings).forEach(function([key, value]) {\r\n console.log(key, value);\r\n var cell = tbody.append(\"td\");\r\n cell.text(value);\r\n });\r\n \r\n});\r\n\r\n}", "function init () {\n data.forEach((tableData) => {\n let row = tbody.append(\"tr\");\n Object.values(tableData).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function addEntries(tableData) {\n \n // loop through data objects \n tableData.forEach(item => {\n // create row and a variable to reference it\n var row = tbody.append(\"tr\");\n\n // use Object.entries to access the current object's contents- loop through them\n Object.entries(item).forEach(([key,value]) => {\n\n //append table data for current key-value pair in object; check for values we want in the table\n if (key === \"report_date\") {\n row.append(\"td\").text(value);\n }\n if (key === \"county\") {\n row.append(\"td\").text(value);\n }\n if (key === \"total_acres\") {\n row.append(\"td\").text(value);\n }\n if (key === \"general_cause\") {\n row.append(\"td\").text(value);\n }\n\n });\n });\n }", "function dataTable(data) {\n // keys variable holds ennumberable properties of the first object within data as an array \n var keys = Object.keys(data[0]);\n //headers = keys array is mapped with function that takes name arg\n var headers = keys.map(function(name) {\n // return underlined cell with argument textcell function with name arg\n return new UnderlinedCell(new TextCell(name));\n });\n var body = data.map(function(row) {\n return keys.map(function(name) {\n return new TextCell(String(row[name]));\n });\n });\n return [headers].concat(body);\n}", "function populateTable(someJsonData) {\n for (let item of someJsonData) {\n let ispaid = \"\";\n let table_row = document.createElement(\"tr\");\n for (let prop in item) {\n if (item[prop] == \"unpaid\") {\n ispaid = \"true\";\n }\n let column = createColumn(\"\", item[prop]);\n table_row.appendChild(column);\n }\n if (ispaid) {\n // Create a action button \n table_row.appendChild(document.createTextNode(\"I'm a text\"));\n }\n afterThead.after(table_row);\n }\n}" ]
[ "0.78981584", "0.7365781", "0.71425265", "0.713016", "0.7094358", "0.7086602", "0.7082141", "0.70704246", "0.70545435", "0.6989933", "0.6942466", "0.6942466", "0.6913905", "0.69126475", "0.6903656", "0.68922955", "0.68397033", "0.6806975", "0.6803131", "0.67890894", "0.6784007", "0.67790264", "0.6764303", "0.6756043", "0.67389894", "0.673341", "0.6699133", "0.66931885", "0.6680674", "0.66775256", "0.66645825", "0.66601264", "0.6658465", "0.665244", "0.6646177", "0.66378385", "0.6633282", "0.6630175", "0.66162664", "0.6601183", "0.6595598", "0.65806764", "0.6579176", "0.6573341", "0.6564685", "0.65590715", "0.6549942", "0.6546157", "0.65198165", "0.65070885", "0.6503707", "0.6502902", "0.65018517", "0.65016717", "0.64998525", "0.64998525", "0.6477914", "0.646462", "0.64611214", "0.6445783", "0.6441026", "0.64378124", "0.6435049", "0.6431569", "0.64294916", "0.6419326", "0.64139754", "0.64086604", "0.6404869", "0.6396316", "0.6393768", "0.6390121", "0.63718915", "0.63697284", "0.636062", "0.63582623", "0.6345453", "0.6345405", "0.6338116", "0.6337126", "0.63315135", "0.63299125", "0.6328603", "0.63185865", "0.6302352", "0.6300964", "0.62925684", "0.62891734", "0.6286811", "0.62792593", "0.6276246", "0.6273892", "0.6263596", "0.62606704", "0.6255493", "0.62445444", "0.62425834", "0.6233364", "0.62331843", "0.6232897" ]
0.71474624
2
nested function that generates td for our tr
function appendTD(tr, data, colspan) { let td = document.createElement("td"); td.innerHTML = data + ""; //if user passed colspan param into function, //add the colspan attribute to td if (colspan !== undefined) td.setAttribute("colspan", colspan + ""); tr.appendChild(td); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function new_td(value) {\n var td = '<td>' + value + '</td>';\n\n return td;\n}", "function tdtr(a) {\n $(row).append(a)\n }", "function getTableHeader() {\n // 2nd tr\n var trTag = $j('<tr></tr>');\n var tdTag = $j('<td class=\"infoline\" style=\"width:60px;\"></td>').html(\n '&nbsp;');\n trTag.html(tdTag);\n var tdTag = $j('<td class=\"infoline\" style=\"width:100px;\"></td>').html(\n '<b>Parent Code</b>');\n tdTag.appendTo(trTag);\n var tdTag = $j('<td class=\"infoline\" style=\"width:100px;\"></td>').html(\n '<b>Research Code</b>');\n tdTag.appendTo(trTag);\n var tdTag = $j('<td class=\"infoline\"></td>').html('<b>Research Area</b>');\n tdTag.appendTo(trTag);\n var tdTag = $j('<td class=\"infoline\"></td>').html('<b>Active</b>');\n tdTag.appendTo(trTag);\n var tdTag = $j('<td class=\"infoline\" style=\"width:65px;\"></td>').html(\n '<b>Action</b>');\n tdTag.appendTo(trTag);\n return trTag;\n}", "function table_Build(data) {\n tableBody.html(\"\");\n data.forEach((row) => {\n const new_row = tableBody.append(\"tr\");\n \n Object.values(row).forEach((value) => {\n let dp = new_row.append(\"td\");\n dp.text(value);\n }\n );\n });\n}", "function makeTableItem(i,e){\r\n //var item = '<tr class=\"tr_item\" bgcolor=\"' + (i % 2 == 0 ? '#ECECEC' : '#FFFFFF') + '\">' + \r\n var item = '<tr class=\"tr_item\">'+\r\n '<td style=\"width: 15%;\">' + e.g1Symbol + '</td>' + \r\n '<td style=\"width: 15%;\">' + e.g2Symbol + '</td>' ;\r\n if(!isNaN(parseInt(e.pubmedid))){\r\n item+= '<td style=\"width: 20%;\">' + '<a style=\"text-decoration:none;\" target=\"_blank\" href=\"http://www.ncbi.nlm.nih.gov/pubmed?term='+e.pubmedid+'\">'+e.network+'</a>' + '</td>'; \r\n }else{\r\n item+= '<td style=\"width: 20%;\">' + '<a style=\"text-decoration:none;\" target=\"_blank\" href=\"'+e.pubmedid+'\">'+e.network+'</a>' + '</td>'; \r\n }\r\n item+='<td style=\"text-align: left;width: 13%;\">'+e.type + '</td>'+'<td style=\"text-align: left;width: 13%;\">'+e.weight + '</td></tr>';\r\n return item; \r\n}", "function table(c,r){\nvar tt=\"\";\nfor (var col=1; col<=c; col++){ tt +=\"<tr>\";\n\tfor (var row=1 ; row<=r ; row++){ tt += \"<td></td>\"; \n}tt += \"</tr>\";}return tt;}", "function createTd(item, index, value) {\n\t\tvar td = $(\"<tr id=\" + index + \" class=\"+value+\"><td>\"+ item.current +\"</td><td>\"+ item.currentDate +\"</td></tr>\");\n\t\t$(\"#tableTarget\").append(td);\n\t}", "function tdWrapper(content) {\n return \"<td>\" + content + \"</td>\"\n }", "function renderTableRow(itemName,totalcost,index) {\n var tr_node = document.createElement(\"tr\");\n var th_node = document.createElement(\"th\");\n th_node.setAttribute('scope',\"row\");\n th_node.innerText =index;\n \n var td_item = document.createElement(\"td\");\n td_item.innerText =itemName;\n\n // var td_count = document.createElement(\"td\");\n // td_count.innerText=counter;\n var td_total = document.createElement(\"td\");\n td_total.innerText=totalcost;\n\n tr_node.appendChild(th_node);\n tr_node.appendChild(td_item);\n // tr_node.appendChild(td_count);\n tr_node.appendChild(td_total);\n\n return tr_node;\n\n}", "function addCells(row,tidx,tend,textLines,change){if(tidx < tend){row.appendChild(telt(\"th\",(tidx + 1).toString()));row.appendChild(ctelt(\"td\",change,textLines[tidx].replace(/\\t/g,'    ')));return tidx + 1;}else {row.appendChild(document.createElement(\"th\"));row.appendChild(celt(\"td\",\"empty\"));return tidx;}}", "function buildTableRowCells(record) {\r\n\t\r\n\t// Loop through columns\r\n\tvar cellsHtml = tableColumns.map(column => {\r\n\t\t\r\n\t\t// Get field\r\n\t\tvar field = dataFields[column.name];\r\n\t\tvar set = column.set >= 0 ? column.set : record[0] ? 0 : 1;\r\n\t\t\r\n\t\t// Build cell content\r\n\t\t// TODO: add popups for has: values\r\n\t\tvar content = '', title = '';\r\n\t\tif (record[set] && record[set][column.name] !== null && record[set][column.name] !== false && record[set][column.name] !== '') {\r\n\t\t\tvar value = column.has ? (field.abbr ? field.abbr : 'Y') : field.dp ? record[set][column.name].toFixed(field.dp) : escapeHtml(record[set][column.name]);\r\n\t\t\tcontent = field.link ? `<a href=\"${getLinkAddress(field, record[set])}\">${value}</a>` : value;\r\n\t\t\ttitle = column.has ? escapeHtml(record[set][column.name]) : '';\r\n\t\t}\r\n\t\t\r\n\t\t// Set classes\r\n\t\tvar classes = [`sjo-api-cell-${column.has ? '__has_' : ''}${column.name}`];\r\n\t\tif (field.icon) classes.push('sjo-api-cell-icon');\r\n\t\tif (content && field.validate && !field.validate.call(this, record[set][column.name], record[set])) classes.push('sjo-api-invalid');\r\n\t\t\r\n\t\t// Return cell HTML\r\n\t\treturn `<td class=\"${classes.join(' ')}\" title=\"${title}\">${content}</td>`;\r\n\t\t\r\n\t});\r\n\t\r\n\treturn cellsHtml;\r\n\t\r\n}", "function table(r){\n r.forEach(sighting => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key,value]) => {\n var entries = row.append(\"td\").text(value);\n });\n });\n}", "function buildTable(d) {\n var row = tbody.append('tr');\n Object.entries(d).forEach(([key, value]) => {\n var column = row.append('td').text(value);\n\n\t});\n}", "function td(label, desc) {\n\t\t\t\tlet td = elem(\"td\");\n\t\t\t\ttd.innerHTML = label;\n\t\t\t\tliteral += label + \" \";\n\n\t\t\t\ttr.appendChild(td);\n\n\t\t\t\treturn td;\n\t\t\t}", "function createTableRowsTD(tableColumnsValues, estCieloValues, cotaNieveValues, rachaMaxValues, sensTermOrProbPrecValues, type){\n\n var tableColumns = \"<th></th>\";\n var rowEstCielo = \"<td><b>Estado cielo</b></td>\";\n var rowCotaNieve = \"<td><b>Cota nieve (m)</b></td>\";\n var rowRachaMax = \"<td><b>Racha máx (km/h)</b></td>\";\n\n var rowSensTermorProbPrec = \"<td><b>Prob precipitación (%)</b></td>\";\n if(type == GRAPH_TABLE_TYPE){\n rowSensTermorProbPrec = \"<td><b>Sensación térmica (°C)</b></td>\";\n }\n\n for(var i = 0; i < estCieloValues.length; i++){\n tableColumns = tableColumns + \"<th>\" + tableColumnsValues[i] + \"</th>\"\n rowEstCielo = rowEstCielo + \"<td>\" + estCieloValues[i] + \"</td>\"\n rowCotaNieve = rowCotaNieve + \"<td>\" + cotaNieveValues[i] + \"</td>\"\n rowRachaMax = rowRachaMax + \"<td>\" + rachaMaxValues[i] + \"</td>\"\n rowSensTermorProbPrec = rowSensTermorProbPrec + \"<td>\" + sensTermOrProbPrecValues[i] + \"</td>\"\n }\n\n return [tableColumns, rowEstCielo, rowCotaNieve, rowRachaMax, rowSensTermorProbPrec];\n\n }", "function prepareTableCell(mon, ty, da) {\n var ddd = document.createElement(\"B\");\n var uuuu = document.createElement(\"U\")\n var nodee = document.createElement(\"p\");\n var noder = document.createElement(\"p\");\n var nodet = document.createElement(\"p\");\n var nodey = document.createElement(\"p\");\n var ea = document.createElement(\"p\");\n var node = document.createElement(\"br\");\n var nodehr = document.createElement(\"hr\");\n var textnode = document.createTextNode(\"\");\n var textnodehr = document.createTextNode(\"\");\n var easy = document.createElement(\"a\");\n var easy1 = document.createElement(\"a\");\n var easy2 = document.createElement(\"a\");\n var easy3 = document.createElement(\"a\");\n var easy4 = document.createElement(\"hr\");\n var buu = document.createElement(\"button\");\n\n\n nodee.appendChild(easy);\n noder.appendChild(easy1);\n nodet.appendChild(easy2);\n nodey.appendChild(easy3);\n var textnode1 = mon + \"$\";\n var textnode2 = \"Money:\" + mon + \"$\";\n var textnode3 = \"Type:\" + ty;\n var textnode4 = \"Date:\" + da;\n\n easy.append(textnode1);\n easy1.append(textnode2);\n easy2.append(textnode3);\n easy3.append(textnode4);\n nodehr.append(textnodehr);\n\n document.getElementById(\"output1\").appendChild(ddd);\n document.getElementById(\"output1\").appendChild(noder);\n document.getElementById(\"output1\").appendChild(nodet);\n document.getElementById(\"output1\").appendChild(nodey);\n document.getElementById(\"output1\").appendChild(easy4);\n\n}", "function build_table(data,tb_id){\n\n var table = $(tb_id)\n console.log(table)\n $(\".data-row\").empty()\n for(var i = 0;i < data.length; i++){\n console.log(data[i]);\n var row = $(\"<tr>\",{class: \"data-row\"});\n for(var j = 0; j < data[i].length; j++){\n var cell = $(\"<td>\", {align:\"center\",valign:\"middle\"}).text(data[i][j]);\n console.log(data[i][j])\n row.append(cell)\n }\n table.append(row)\n }\n}", "_makerow(table, rowDesc) {\n var that = this;\n var row = document.createElement('tr');\n rowDesc.forEach(x => {\n if (x) {\n var iconName = x[0];\n var elem = this._createElementUnder('td', row);\n this._createButtonIcon(iconName, elem,\n () => that._applyChange(x[1], x[2]));\n } else {\n // Empty cell\n this._createElementUnder('td', row);\n }\n });\n table.appendChild(row);\n return row;\n }", "function tableCol(col1, col2, col3, col4){\n return '<tr>' +\n '<td>' +col1+ '</td>' +\n '<td>' +col2+'</td>' +\n '<td>' +col3+'</td>' +\n '<td>' +col4+ '</td>' +\n '<tr/>'\n }", "function generateTableBody(table, data) {\n table.border = '1';\n for (let element of data) {\n let row = table.insertRow();\n \n for (key in element) {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.appendChild(text);\n \n }\n \n }\n document.querySelector('.output').innerHTML = \"If you click on the \\\"Dy\\\" box or on the first box immediately below, you can read the result of the output\";\n }", "function renderTableRowInto(tr, row, columns, downstream) {\n\n /* Link column, for linking to this subject. */\n\n var linkTd = doc.createElement(\"td\");\n\n if (row._subject != null && \"uri\" in row._subject) {\n linkTd.appendChild(linkTo(row._subject.uri, \"\\u2192\"));\n }\n\n tr.appendChild(linkTd);\n\n // Create a <td> for each column (whether the row has data for that\n // column or not).\n\n for (var i=0; i<columns.length; ++i) {\n var column = columns[i];\n var td = doc.createElement(\"td\");\n var orig;\n\n var columnKey = column.getKey();\n\n if (columnKey in row.values) {\n var objects = row.values[columnKey];\n var different = false;\n if (row.originalValues && row.originalValues[columnKey]) {\n if (objects.length !== row.originalValues[columnKey].length) {\n different = true;\n }\n }\n for (var j=0; j<objects.length; ++j) {\n var obj = objects[j];\n if (row.originalValues && row.originalValues[columnKey]\n && row.originalValues[columnKey].length > j) {\n orig = row.originalValues[columnKey][j];\n if (obj.toString() !== orig.toString()) {\n different = true;\n }\n }\n //dump(\" column \"+i+', object'+j+\", obj= \"+obj+\"\\n\");\n\n td.appendChild(renderValue(obj, column));\n\n if (j != objects.length - 1) {\n td.appendChild(doc.createTextNode(\",\\n\"));\n }\n if (different) {\n td.style.background = '#efe'; // green = new changed\n }\n }\n }\n\n tr.appendChild(td);\n }\n\n // Save a reference to the HTML row in the row object.\n\n row._htmlRow = tr;\n\n return tr;\n }", "function buildTable(data) {\r\n tbody.html(\"\");\r\n//next loop through each object in data and append a row and cells for each value in the row\r\ndata.forEach((dataRow)) => {\r\n //append a row to table body\r\n let row=tbody.append(\"tr\");\r\n //Loop through each field in dataRow and add each value as a table cell (td)\r\n Object.values(dataRow).forEach((val)=> {\r\n let cell = row.append(\"td\");\r\n cell.text(val);\r\n }\r\n );\r\n}", "function builtTr(paciente) {\n \n var novo_paciente_tr = document.createElement(\"tr\");\n novo_paciente_tr.classList.add(\"paciente\");\n \n var novo_paciente_td_nome = makeTd(paciente.nome,\"info-nome\");\n var novo_paciente_td_peso = makeTd(paciente.peso,\"info-peso\");\n var novo_paciente_td_altura = makeTd(paciente.altura,\"info-altura\");\n var novo_paciente_td_gordura = makeTd(paciente.gordura,\"info-gordura\");\n var novo_paciente_td_imc = makeTd(paciente.imc,\"info-imc\");\n \n novo_paciente_tr.appendChild(novo_paciente_td_nome);\n novo_paciente_tr.appendChild(novo_paciente_td_peso);\n novo_paciente_tr.appendChild(novo_paciente_td_altura);\n novo_paciente_tr.appendChild(novo_paciente_td_gordura);\n novo_paciente_tr.appendChild(novo_paciente_td_imc);\n \n return novo_paciente_tr;\n}", "function tabulate(data) {\n data.forEach((entry) => {\n var tr = tbody.append('tr');\n tr.append('td').attr(\"class\", \"Date\").text(entry.datetime);\n tr.append('td').attr(\"class\", \"City\").text(entry.city);\n tr.append('td').attr(\"class\", \"State\").text(entry.state);\n tr.append('td').attr(\"class\", \"Country\").text(entry.country);\n tr.append('td').attr(\"class\", \"Shape\").text(entry.shape);\n tr.append('td').attr(\"class\", \"Duration\").text(entry.durationMinutes);\n tr.append('td').attr(\"class\", \"Comments\").text(entry.comments);\n });\n}", "doBodyTable() {\n var htmlColumn = ``\n var htmlRow = ``\n \n for (var i = \"1\"; i < this.tableLinesLength; i++) {\n\n var currentline = this.tableLines[i].split(\",\");\n htmlColumn = ``\n\n for (var j = 0; j < this.tableHeadLength; j++) {\n if (currentline[j] == '') {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->uploads--entities--index#editUnit\">|PREENCHER|</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->uploads--entities--index#saveUnit change->uploads--entities--index#saveUnit blur->uploads--entities--index#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n } else {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->uploads--entities--index#editUnit\">${currentline[j]}</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->uploads--entities--index#saveUnit change->uploads--entities--index#saveUnit blur->uploads--entities--index#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n }\n }\n htmlRow += `<tr data-target=\"uploads--entities--index.lineCell-${i}\">\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\">${i}</span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n ${htmlColumn}\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <button id=${i} data-action=\"click->uploads--entities--index#deleteLine\" type=\"button\" class=\"btn btn-sm btn-table editAuthor p-0\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Remover linha\"><span class=\"material-icons md-sm md-dark\">delete</span></button>\n </td>\n </tr>`\n }\n\n return htmlRow;\n }", "function format(d, indice) {\n // `d` is the original data object for the row\n var texto = d[indice]; //indice donde esta el input hidden\n var diagnosticos = $(texto).val();\n\n var json = JSON.parse(diagnosticos);\n var len = Object.keys(json).length;\n var childTable = '<table style=\"padding-left:20px;border-collapse: separate;border-spacing: 10px 3px;\">' +\n '<tr><td style=\"font-weight: bold\">' + $('#text_dx').val() + '</td><td style=\"font-weight: bold\">' + $('#text_dx_date').val() + '</td></tr>';\n for (var i = 1; i <= len; i++) {\n childTable = childTable +\n '<tr></tr><td>' + json[i].nombre + '</td>' +\n '<td>' + json[i].fechaSolicitud + '</td></tr>';\n }\n childTable = childTable + '</table>';\n return childTable;\n }", "function buildTable(data) {\n var headers = Object.keys(data[0]);\n var table = document.createElement(\"TABLE\");\n var row = document.createElement(\"TR\");\n headers.forEach(function(column){\n var cellH = document.createElement(\"TH\");\n var textItem = document.createTextNode(column);\n cellH.appendChild(textItem);\n row.appendChild(cellH);\n });\n table.appendChild(row); \n \n data.forEach(function(item){\n var row = document.createElement(\"TR\");\n headers.forEach(function(header){\n var cell = document.createElement(\"TD\");\n var textItem = document.createTextNode(item[header]);\n cell.appendChild(textItem); //to right align numeric values\n if(!isNaN(item[header]))\n cell.style.textAlign = \"right\";\n row.appendChild(cell);\n });\n table.appendChild(row);\n }); \n return table;\n }", "function buildTable(xLT, xRT, yTop, yBottom) {\n var x, y, table = \"\";\n \n for (y = yTop - 1; y <= yBottom; y++) {\n table += \"<tr>\";\n if (y == yTop - 1) {\n table += \"<td> * </td>\"; \n for (x = xLT; x <= xRT; x++) {\n table += \"<td>\" + x + \"</td>\";\n }\n } \n else {\n table += \"<td>\" + y + \"</td>\";\n for (x = xLT; x <= xRT; x++) {\n table += \"<td>\" + x * y + \"</td>\";\n }\n }\n table += \"</tr>\";\n }\n \n \n document.getElementById(\"status\").innerHTML += \"Table completed! <br>\";\n document.getElementById(\"resultingTable\").innerHTML = table;\n }", "function generateTable(){\n\tvar header = table.createTHead();\n\n\t\n\tvar row = header.insertRow(0);\n\tfor(var ii = 0; ii <= xEnd - xStart + 1; ii++){ //Fills row\n\t\tvar cell=row.insertCell(ii);\n\t\tif(ii ===0){\n\t\t\t$(cell).addClass(\"multiplier\");\n\t\t\tcell.innerHTML = \" x \";\n\t\t}else{\n\t\t\t$(cell).addClass(\"baseXValue\");\n\t\t\tcell.innerHTML = (xStart + ii - 1);\n\t\t}\n\t}\n\t\n\n\tfor(var i = 1; i <= yEnd - yStart + 1; i++){ //determines row\n\t\tvar row = header.insertRow(i);\n\t\t\n\t\t\n\t\t\tfor(var ii = 0; ii <= xEnd - xStart + 1; ii++){ //Fills row\n\t\t\t\tvar cell=row.insertCell(ii);\t\n\t\t\t\tif(ii === 0){\n\t\t\t\t\t$(cell).addClass(\"baseYValue\");\n\t\t\t\t\tcell.innerHTML = (yStart+ i - 1);\n\t\t\t\t}else{\n\t\t\t\t\tcell.innerHTML = (xStart + ii - 1) * (yStart+ i - 1);\n\t\t\t\t}\n\t\t\t}\n\t}\n\t\n}", "function buildTable(table){\n\n // loop through data\n table.forEach((item) => {\n\n // append rows\n let row = tbody.append(\"tr\");\n\n // iterate through keys and values\n Object.entries(item).forEach(([key, value]) => {\n\n // append cells \n let cell = row.append(\"td\");\n\n // add text value to each cell\n cell.text(value);\n });\n });\n}", "function buildTable(tableData){\n tbody.html(\"\");\n\n //Loop thru the data to add to add it to HTML wit the arrow function\n tableData.forEach(alienData => {\n var row = tbody.append(\"tr\");\n Object.entries(alienData).forEach(([key,value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n\n });\n}", "function makeTableRow(label, value) {\n if (typeof value == 'string') {\n return '<tr><td>' + label + '</td><td><strong>' + value + '</strong></td></tr>';\n }\n return '';\n }", "function generateTableBody(data) {\n document.getElementById(\"myTable\").innerHTML = \"\";\n let tbody = document.querySelector(\"tbody\");\n\n for (let i = 0; i < data.length; i++) {\n let information = data[i];\n\n let row = document.createElement(\"tr\");\n if (i % 2 === 0) {\n row.classList.add('even');\n } else {\n row.classList.add('odd');\n }\n let name = document.createElement('td');\n name.classList.add('sorting_1')\n let position = document.createElement('td');\n\n position.classList.add('position');\n let Office = document.createElement('td');\n Office.classList.add('tdStyle');\n let Age = document.createElement('td');\n Age.classList.add('tdStyle');\n let startDate = document.createElement('td');\n startDate.classList.add('tdStyle');\n let salary = document.createElement('td');\n salary.classList.add('tdStyle');\n\n name.innerText = information['name'];\n position.innerText = information['position'];\n Office.innerText = information['Office'];\n Age.innerText = information['Age'];\n startDate.innerText = information['Start date'];\n salary.innerText = information['Salary'];\n\n row.appendChild(name);\n row.appendChild(position);\n row.appendChild(Office);\n row.appendChild(Age);\n row.appendChild(startDate);\n row.appendChild(salary);\n tbody.appendChild(row);\n }\n return tbody;\n}", "function generateTable(table, data) {\n let tHeadData = Object.keys(data[0]);\n generateTableHead(table,tHeadData);\n let tbody = document.createElement(\"tbody\");\n tbody.className = \"table-dark\"\n table.appendChild(tbody)\n for (let element of data) {\n let row = tbody.insertRow();\n for (key in element) {\n if(key == \"Country\"){\n let cell = row.insertCell();\n let a = document.createElement(\"a\")\n a.href = \"#\"\n a.innerHTML = element[key]\n a.addEventListener(\"click\",(e) => {e.preventDefault; return alertBox(element)})\n cell.appendChild(a)\n }else if(key == \"TotalConfirmed\"){\n let cell = row.insertCell();\n let p = document.createElement(\"p\")\n let p2 = document.createElement(\"span\")\n p2.className = \"font-weight-lighter font-italic text-warning\"\n p.innerHTML = element[key]\n p2.innerHTML = \" new \" + element[\"NewConfirmed\"]\n p.appendChild(p2)\n cell.appendChild(p)\n }else if(key == \"TotalDeaths\"){\n let cell = row.insertCell();\n let p = document.createElement(\"p\")\n let p2 = document.createElement(\"span\")\n p2.className = \"font-weight-lighter font-italic text-danger\"\n p.innerHTML = element[key]\n p2.innerHTML = \" new \" + element[\"NewDeaths\"]\n p.appendChild(p2)\n cell.appendChild(p)\n }else if(key == \"TotalRecovered\"){\n let cell = row.insertCell();\n let p = document.createElement(\"p\")\n let p2 = document.createElement(\"span\")\n p2.className = \"font-weight-lighter font-italic text-success\"\n p.innerHTML = element[key]\n p2.innerHTML = \" new \" + element[\"NewRecovered\"]\n p.appendChild(p2)\n cell.appendChild(p)\n }\n }\n }\n}", "function GenerateTableLine(inputNum) {\n var ret = \"\";\n var tempVal;\n var data;\n $.each(Intern_InputFieldIds, function (index, value) {\n\n //debugger;\n\n if (Intern_InputFieldTypes[index] === \"checkbox\") {\n tempVal = Intern_InputFieldElems[index].prop(\"checked\");\n if (tempVal === false) {\n data = \"0\";\n }\n else {\n data = \"1\";\n }\n }\n else if (Intern_InputFieldTypes[index] === \"radio\") {\n tempVal = Intern_InputFieldElems[index].attr(\"name\");\n tempVal = $('input:radio[name=' + tempVal + ']:checked').val();\n if (tempVal !== undefined) {\n data = tempVal;\n }\n else {\n data = null;\n }\n }\n else if (Intern_InputFieldTypes[index] === \"color\") {\n tempVal = Intern_InputFieldElems[index].val();\n data = tempVal;\n }\n else if (Intern_InputFieldTypes[index] === \"select\") {\n tempVal = Intern_InputFieldElems[index].val();\n data = tempVal;\n }\n else {\n tempVal = Intern_InputFieldElems[index].val();\n data = tempVal;\n }\n Intern_ArrayOfValues[inputNum][value] = data;\n });\n\n var display;\n var i;\n $.each(Intern_TableFieldIDs, function (index, value) {\n\n i = Intern_InputFieldIds.indexOf(value);\n\n if (Intern_InputFieldTypes[i] === \"checkbox\") {\n tempVal = Intern_InputFieldElems[i].prop(\"checked\");\n if (tempVal === false) {\n display = \"<td>false</td>\";\n }\n else {\n display = \"<td>true</td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"radio\") {\n tempVal = Intern_InputFieldElems[i].attr(\"name\");\n tempVal = $('input:radio[name=' + tempVal + ']:checked').val();\n if (tempVal !== undefined) {\n display = \"<td>\" + tempVal + \"</td>\";\n }\n else {\n display = \"<td></td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"color\") {\n tempVal = Intern_InputFieldElems[i].val();\n display = '<td style=\"background-color:' + tempVal + '\"></td>';\n }\n else if (Intern_InputFieldTypes[i] === \"select\") {\n tempVal = Intern_InputFieldElems[i].val();\n display = '<td>' + $('#' + Intern_InputFieldIds[i] + ' option[value=' + tempVal + ']').text() + '</td>';\n }\n else {\n tempVal = Intern_InputFieldElems[i].val();\n display = '<td>' + tempVal + '</td>';\n }\n ret = ret + display;\n });\n ret = ret + AddOperations(inputNum);\n return ret;\n }", "renderSubTotalRow(data, team) {\n\n const body = document.querySelector('#team-data table tbody');\n const sprints = data.subtotals.teams[team];\n\n let tr;\n let sprintCount = 0;\n let teamTotal = 0;\n let pointCount = 0;\n let sprintSubTotal = '';\n let pointSubTotal = '';\n\n for (let key in sprints) {\n pointCount = numeral((sprints[key] / config.sprint.hoursPerPoint)).format('0.0');\n sprintSubTotal += `<td>${sprints[key]}</td>`;\n pointSubTotal += `<td>${pointCount}</td>`;\n teamTotal += sprints[key];\n sprintCount++;\n }\n\n tr = markobj(`<tr class=\"subtotal\">\n <td colspan=\"4\" class=\"label\">Available Team Hours per Sprint</td>\n ${sprintSubTotal}\n <td class=\"total\">${teamTotal}</td>\n </tr>`);\n body.appendChild(tr);\n\n tr = markobj(`<tr class=\"subtotal\">\n <td colspan=\"4\" class=\"label\">Estimated Point Velocity</td>\n ${pointSubTotal}\n <td class=\"total\">${teamTotal}</td>\n </tr>`);\n body.appendChild(tr);\n\n tr = markobj(`<tr class=\"spacer\"><td colspan=\"${(5+sprintCount)}\">&nbsp;</td></tr>`);\n body.appendChild(tr);\n\n\n return {\n sprintCount: sprintCount,\n teamTotal: teamTotal,\n pointCount: pointCount,\n sprintSubTotal: sprintSubTotal,\n pointSubTotal: pointSubTotal\n };\n\n }", "function addTR(table, arrayOfData){\n //takes the first row of the table\n var row =table.tBodies[0].insertRow(0);\n //looping through the data and creating as many TD and give them the data\n for(var i=0;i<arrayOfData.length;i++){\n row.insertCell(i).innerHTML=arrayOfData[i];\n }\n}", "function buildHtmlTable(arr) {\n var table = _table_.cloneNode(false),\n columns = addAllColumnHeaders(arr, table);\n for (var i = 0, maxi = arr.length; i < maxi; ++i) {\n var tr = _tr_.cloneNode(false);\n for (var j = 0, maxj = columns.length; j < maxj; ++j) {\n var td = _td_.cloneNode(false);\n cellValue = arr[i][columns[j]];\n td.appendChild(document.createTextNode(arr[i][columns[j]] || ''));\n tr.appendChild(td);\n }\n tr.setAttribute('id', arr[i][columns[0]]);\n var btn = _btn_.cloneNode(false);\n btn.addEventListener('click', (e) => deleteThis(e))\n btn.innerHTML = \"X\";\n tr.appendChild(btn);\n table.appendChild(tr);\n }\n return table;\n}", "function generateTable(data) {\n noResults.style('display', 'none');\n tableBody.html('');\n table.style('display', 'table');\n data.forEach(result => {\n var row = tableBody.append('tr');\n var date = row.append('td').text(result.datetime).attr('class', 'datetime').on('click', lookUp);\n var city = row.append('td').text(result.city).attr('class', 'city').on('click', lookUp);\n var state = row.append('td').text(result.state).attr('class', 'state').on('click', lookUp);\n var country = row.append('td').text(result.country).attr('class', 'country').on('click', lookUp);\n var shape = row.append('td').text(result.shape).attr('class', 'shape').on('click', lookUp);\n var duration = row.append('td').text(result.durationMinutes).attr('class', 'duration');\n var description = row.append('td').text(result.comments).attr('class', 'description');\n });\n}", "function table(data){\n tbody.html(\"\");\n\n\t//append the rows(tr) and cells(td) for returned values\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n \n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "function tableBuild(data) {\n //used to clear current data on table\n tbody.html(\"\");\n //used forEach to itrate through each ro of data\n data.forEach((row) => {\n //created variable to create a new row on the table\n var dataRow = tbody.append('tr');\n //read values from each row of the dataset\n Object.values(row).forEach((value) => {\n //appened the new row in order to accept the values\n var cell = dataRow.append('td');\n //inserted the values into each corresponing cell on the table\n cell.text(value);\n })\n })\n}", "function createBoldColumn(rowIdentifier, value) {\n var rowData = \"<td class=\\\"tg-mesh1\\\"><b>\" + rowIdentifier + \"</b></td>\";\n rowData = rowData + \"<td class=\\\"tg-mesh2\\\">\" + value + \"</td>\";\n return rowData ;\n}", "function appendToTr(tr, objData) {\n var td = $(\"<th>\").text(objData);\n td.appendTo(tr);\n \n return tr;\n}", "makeTableBody() {\n var rows = [];\n for (var row = 1; row <= 9; row++) {\n \n // Each row consists of array of cells\n var cells = [];\n \n // The first cell of the row is the header\n cells.push(<Cell key={row+'.'+0} isHeader={true} rowId={row} mouseLoc={this.state.highlight} onMouseEnterCell={this.onMouseEnterCell.bind(this)} onMouseLeaveCell={this.onMouseLeaveCell.bind(this)}/>)\n\n // Make the rest of the cells of the row\n for (var col = 1; col <= 9; col++) {\n cells.push(<Cell key={row+'.'+col} rowId={row} colId={col} mouseLoc={this.state.highlight} onMouseEnterCell={this.onMouseEnterCell.bind(this)} onMouseLeaveCell={this.onMouseLeaveCell.bind(this)}/>)\n }\n\n rows.push(<tr key={\"row\"+row}>{cells}</tr>);\n }\n\n return <tbody>{rows}</tbody>;\n }", "function buildTableBody(data) {\r\n let rows = '';\r\n\r\n for (let i = 1; i < data.length - 1; i++) {\r\n rows += `<tr>`;\r\n rows += `<td></td>`;\r\n\r\n for (let j = 0; j < data[i].length; j++) {\r\n rows += `<td>${data[i][j]}</td>`;\r\n }\r\n\r\n rows += `</tr>`;\r\n }\r\n\r\n return rows;\r\n}", "function makeTable(item) {\n // Making a new row within tbody.\n var row = tbody.append(\"tr\");\n \n // Appedning each and every data within a row.\n row.append(\"td\").text(item.datetime);\n row.append(\"td\").text(item.city);\n row.append(\"td\").text(item.state);\n row.append(\"td\").text(item.country);\n row.append(\"td\").text(item.shape);\n row.append(\"td\").text(item.durationMinutes);\n row.append(\"td\").text(item.comments); \n}", "function createTenPctTable (array){\n let resultnext=\"\"\n for (i = 0; i < array.length; i++) {\n result = `<tr><td>${array[i].name} ${array[i].lname} </td><td class=centeredCol> ${array[i][\"statisticReported\"]} </td><td class=centeredCol> ${array[i][\"statisticSorted\"]} %</td></tr>`;\n resultnext += result;\n }\n return resultnext;\n}", "function getRowHTML(row, index){\n var arr = getRowFieldsAsArray(row);\n var rval = \"<tr><th scope=\\\"row\\\">\" + (index + 1).toString() + \"</th>\";\n for (let i = 0; i < arr.length; i++){\n rval += (\"<td>\" + ((arr[i] == null) ? \"\" : arr[i]) + \"</td>\");\n }\n return rval;\n}", "function buildTableDAta (dayVal) {\n for(i = 0; i < wkOfEvents[dayVal].length; i++) {\n let name = wkOfEvents[dayVal][i]['name']\n let haz = wkOfEvents[dayVal][i]['is_potentially_hazardous_asteroid']\n let classtype = ''\n\n if (haz) {\n haz = 'HIDE!'\n classtype = ' class=\"death\"'\n } else {\n haz = 'Whatevs'\n }\n\n //school bus calc\n let diaMax = Math.round(wkOfEvents[dayVal][i]['estimated_diameter']['feet']['estimated_diameter_max'])\n let diaMin = Math.round(wkOfEvents[dayVal][i]['estimated_diameter']['feet']['estimated_diameter_min'])\n let dia = (Math.round(diaMax + diaMin)/2).toFixed(0)\n let astroBus = (dia/45).toFixed(0)\n\n let dist = Math.round(wkOfEvents[dayVal][i]['close_approach_data'][0]['miss_distance']['miles'])\n let easyDist = dist.toLocaleString('en')\n\n $('tbody').append('<tr' + classtype + '><td>'+ haz +'</td><td>'+ name +'</td><td>'+ astroBus +'</td><td>'+ dia +'</td><td>'+ easyDist +'</td>' + '</tr>')\n }\n\n $('tbody').append('<tr><td colspan=\"5\" class=\"death\">HIDE! = potentially hazardous asteroid... That\\'s bad.</td></tr>')\n}", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function tableRowStart() {\n return '<tr><td class=\"entry\">';\n}", "function tblRow(store){\n\t//makes an array of a day at a store\n\tvar cByHour = arrayMaker(store.hours.length, store.maxCust, store.minCust, store.avg);\n\tvar sum = 0;\n\tvar trEl = document.createElement(\"tr\");\n\tfor (var i=0; i < cByHour.length + 2; i++){\n\t\tvar tdEl = document.createElement(\"td\");\n\t\tif (i === 0) {\n\t\t\ttdEl.innerHTML = store.name; \n\t\t} else if (i < cByHour.length + 1){\n\t\t\ttdEl.innerHTML = cByHour[i-1];\n\t\t\tsum += cByHour[i-1];\n\t\t} else {\n\t\t\ttdEl.innerHTML = sum;\n\t\t}\n\t\t// console.log(tdEl);\n\t\ttrEl.appendChild(tdEl);\n\t}\n\ttbBox.appendChild(trEl);\n}", "function generateTable(table, data)\n{\n var i = 0;\n for (let element of data) {\n let row = table.insertRow();\n for (key in element)\n {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.innerHTML = text.textContent;\n // console.log(cell);\n }\n }\n}", "function displayData(something){ \n tbody.text(\"\")\n something.forEach(function(et_sighting){\n new_tr = tbody.append(\"tr\")\n Object.entries(et_sighting).forEach(function([key, value]){\n new_td = new_tr.append(\"td\").text(value)\t\n })\n})}", "function generateTable(table, table_data) {\n\t\tvar options = table_data.options || {};\n\t\tvar data = table_data.data;\n\t\t\n\t\tfor(var row = 0; row < data.length; row++) {\n\t\t\tvar rowcontainer = table\n\t\t\tif(row == 0 && options.columnheader) { //@todo: make columnheader is the count of column headers?\n\t\t\t\trowcontainer = rowcontainer.append(\"thead\")\t\t\t\t\n\t\t\t} else if ((row == (data.length - 1)) && options.columnfooter) {\n\t\t\t\trowcontainer = rowcontainer.append(\"tfoot\")\t\t\t\t\n\t\t\t}\n\t\t\trowcontainer = rowcontainer.append(\"tr\")\n\t\t\t\n\t\t\tfor(var col = 0; col < data[row].length; col++) {\n\t\t\t\tvar colcontainer = rowcontainer.append('td');\n\t\t\t\tif(col == 0 && options.rowheader) {\n\t\t\t\t\tcolcontainer.classed(\"rowheader\", true)\t\t\t\t\n\t\t\t\t} else if ((col == (data[row].length - 1)) && options.rowfooter) {\n\t\t\t\t\tcolcontainer.classed(\"rowfooter\", true)\t\t\t\t\n\t\t\t\t}\n\t\t\t\tcolcontainer.text(data[row][col]);\n\t\t\t}\t\t\t\n\t\t}\n\t}", "function buildTable(data) {\n //clear data\n tbody.html(\"\");\n\n //loop through each data object & append rows & values in each row\n data.forEach((dataRow) => {\n const row = tbody.append(\"tr\");\n\n //loop through each cell in every row to append\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n }\n );\n });\n\n}", "function makeHtmlBoard() {\n \n for(i = 0; i < WIDTH; i++) {\n const row = document.createElement('th');\n row.setAttribute('id', `${i}`)\n topLine.append(row);\n\n }\n \n for (let x = 1; x < 6; x++) {\n const tableRowCell = document.createElement('tr');\n body.append(tableRowCell);\n for (let y = 0; y < HEIGHT; y++) {\n const cell = document.createElement('td');\n cell.innerText = \"$\"+ x + '00';\n cell.setAttribute('id', `${y}-${x}`);\n tableRowCell.append(cell);\n }\n } \n }", "function buildTable(data){\n //1st step is to clear out existing data with an empty data cell \n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n console.table(dataRow);\n //now that we have the loop, we want to append it to a table row (\"tr\")\n let row = tbody.append(\"tr\");\n\n console.log(Object.values(dataRow));\n\n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n\n\n })\n}", "function table_maker(datasets) {\n reset_table();\n for (var i = 0; i < datasets.length; i++) {\n $('#summary').append('<tr style=\"text-align: center\">' + data(datasets[i]) + '</tr>');\n }\n totals_row_maker(datasets);\n $('#table-div').slideDown();\n }", "function createTable(parentNode,data,header1,header2,header3,header4,){\n\n let myTable = document.createElement(\"table\"); \n myTable.setAttribute(\"id\", \"myTable\"); \n \n //create header\n \n let mytr = document.createElement(\"tr\"); \n let th_1=document.createElement(\"th\"); \n let th_2=document.createElement(\"th\"); \n let th_3=document.createElement(\"th\"); \n let th_4=document.createElement(\"th\"); \n let th_FSNClass=document.createElement(\"th\"); \n th_1.innerHTML=header1;\n th_2.innerHTML=header2;\n th_3.innerHTML=header3;\n th_4.innerHTML=header4;\n th_FSNClass.innerHTML=\"FSN Classification\";\n\n mytr.appendChild(th_1); \n mytr.appendChild(th_2); \n mytr.appendChild(th_3); \n mytr.appendChild(th_4); \n mytr.appendChild(th_FSNClass); \n\n myTable.appendChild(mytr); \n\n let len=data.length;\n \n for (let i=0;i<len;i++){\n let mytr=document.createElement(\"tr\"); \n\n let td_1_val=document.createElement(\"td\"); \n let td_2_val=document.createElement(\"td\"); \n let td_3_val=document.createElement(\"td\"); \n let td_4_val=document.createElement(\"td\"); \n let td_FSNClass_val=document.createElement(\"td\"); \n\n td_1_val.innerHTML=data[i][Object.keys(data[i])[0]]; \n td_2_val.innerHTML=data[i][Object.keys(data[i])[1]].toFixed(2); \n td_3_val.innerHTML=data[i][Object.keys(data[i])[2]].toFixed(2); \n td_4_val.innerHTML=data[i][Object.keys(data[i])[3]].toFixed(2); \n td_FSNClass_val.innerHTML=data[i][Object.keys(data[i])[4]]; \n\n mytr.appendChild(td_1_val); \n mytr.appendChild(td_2_val); \n mytr.appendChild(td_3_val); \n mytr.appendChild(td_4_val); \n mytr.appendChild(td_FSNClass_val); \n \n \n myTable.appendChild(mytr); \n \n }\n parentNode.appendChild(myTable);\n}", "function generateTable(){\n if(!table_data.length)\n return;\n //generate first header row with column names\n var tmpl1='<TR><TD></TD>';\n for(var i=0;i<table_data[0].length;i++){\n tmpl1+='<TH onclick=\"sortData('+i+'\\,this)\"';\n if(sort_track==i)\n tmpl1+='sort=\\''+sort_type+'\\' class=\"active\"';\n tmpl1+='>C'+(i+1)+'<i class=\"ion-minus-circled\" onclick=\"removeRC(0,'+i+'\\)\\\" title=\"Delete Column\"></i></TH>';\n }\n tmpl1+='<TH class=\"addRC\" onclick=\"addRC(0)\"><i class=\"ion-plus-circled\"></i> Add</TH>';\n tmpl1+='</TR>';\n\n //generate rest of the rows\n var tmpl2;\n for(i=0;i<table_data.length;i++){\n tmpl2='<TR>';\n for(var j=0;j<table_data[0].length;j++) {\n if(j==0)\n tmpl2 += '<TH>R' + (i+1) + '<i class=\"ion-minus-circled\" onclick=\"removeRC(1,'+i+'\\)\\\" title=\"Delete Row\"></i></TH>';\n tmpl2 += '<TD><div contenteditable=\"true\" onkeyup=\"updateData('+i+','+j+'\\,this\\)\\\" onkeypress=\"avoidEnter(event)\">'+table_data[i][j]+'</div></TD>';\n }\n tmpl2 += '<TD class=\"addRC\" onclick=\"addRC(0)\"></TD>';\n tmpl2+='</TR>';\n tmpl1=tmpl1.concat(tmpl2);\n }\n\n //generate last row with add function\n tmpl2='<TR>';\n for(var j=0;j<table_data[0].length;j++) {\n if(j==0)\n tmpl2 += '<TH class=\"addRC\" onclick=\"addRC(1)\"><i class=\"ion-plus-circled\"></i> Add</TH>';\n tmpl2 += '<TD class=\"addRC\" onclick=\"addRC(1)\"></TD>';\n }\n tmpl2 += '<TD class=\"addRC\" onclick=\"addRC(1)\"></TD>';\n tmpl2+='</TR>';\n tmpl1=tmpl1.concat(tmpl2);\n\n document.getElementById('excel').innerHTML=tmpl1;\n}", "function returnTitleRow(arr)\n{\n var tr = document.createElement('tr');\n \n \n for (i = 0 ; i< arr.length ; i++)\n {\n var td = document.createElement('td');\n // td.setAttribute('class','tableHeaderTD');\n td.innerHTML = arr[i];\n tr.appendChild(td);\n }\n \n return tr;\n}", "function build_rows_occ(occ_list){\n rows = []\n header = \"<thead class='thead-dark'><tr><th>S.No.</th><th>Occurance From</th><th>Occurace To</th><th>Direction From PS</th><th>Distance From PS</th><th>Address</th><th>Edit</th><th>Delete</th></thead>\"\n i = 1;\n occ_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<td><a class='delete' title='Edit' data-toggle='tooltip' onclick='edit_occ_row(\\\"occurance_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></td>\";\n delete_button = \"<td><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_occ_row(\\\"occurance_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></td>\";\n no = '<td>'+i+'</td>'\n html = '<tr id=\"'+index+'\">'+no+row.occ_datefrom+row.occ_dateto+row.occ_directionfromps+row.occ_distancefromps+row.address+edit_button+delete_button+'</tr>';\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "function buildTable(dataTable) {\r\n let table = document.getElementById(dataTable);\r\n let row = table.insertRow(-1);\r\n let cell1 = row.insertCell(-1);\r\n let cell2 = row.insertCell(-1);\r\n let cell3 = row.insertCell(-1);\r\n let cell4 = row.insertCell(-1);\r\n\r\n /**Output*/\r\n cell1.innerHTML = year;\r\n cell2.innerHTML = ageInput;\r\n cell3.innerHTML = toDollars(income);\r\n cell4.innerHTML = toDollars(savingsBal);\r\n }", "function createTableRowGlobal(e) {\n console.log(e)\n \n let tableRow = document.createElement('tr')\n let tcases = document.createElement('td')\n let tdeaths = document.createElement('td')\n let trecoveries = document.createElement('td')\n \n tcases.innerText = e.tConfirmed\n tdeaths.innerText = e.tDeaths\n trecoveries.innerText = e.tRecoveries\n\n tableRow.appendChild(tcases)\n tableRow.appendChild(tdeaths)\n tableRow.appendChild(trecoveries)\n\n return tableRow\n}", "function colTableFiller(newTR, minXValue, maxXValue, minYValue, maxYValue, y) {\r\n\r\n let newTD;\r\n let value;\r\n\r\n for(let x = minXValue; x <= maxXValue; x++)\r\n {\r\n let product = x * y;\r\n value = document.createTextNode(product);\r\n newTD = document.createElement(\"TD\");\r\n newTD.appendChild(value);\r\n newTR.appendChild(newTD);\r\n }\r\n}", "function populateRows() {\n for (var key in primary) {\n if (primary.hasOwnProperty(key)) {\n var newRow = document.createElement('TR');\n var sideHeader = document.createElement('TH');\n sideHeader.setAttribute('class', 'leftSideHeader');\n sideHeader.innerHTML = key;\n newRow.appendChild(sideHeader);\n \n for (var innerKey in primary[key]) {\n if (primary[key].hasOwnProperty(innerKey)) {\n var newCell = document.createElement('TD');\n var text = primary[key][innerKey];\n // TODO: format text and stuff\n if (innerKey === 'Percent') {\n text = text.toPercent();\n newCell.setAttribute('class', 'numberFormat');\n }\n else if (innerKey === 'Amount') {\n text = text.toMyCurrencyString();\n if (text.replace(/[,]+/g, \"\") >= 0) {\n newCell.setAttribute('class', 'numberFormat positive');\n }\n else {\n newCell.setAttribute('class', 'numberFormat negative');\n }\n }\n newCell.innerHTML = text;\n newRow.appendChild(newCell);\n \n }\n }\n this.dom.appendChild(newRow);\n \n }\n }\n }", "function buildTable(tableData){\n // Dynamically build table\n tableData.forEach(iteams => {\n var row = tbody.append('tr');\n\n Object.values(iteams).forEach(val => {\n row.append('td').text(val); \n });\n })\n}", "function build_rows_vic(victim_list){\n rows = []\n header = \"<thead class='thead-dark'><th>S.No.</th><th>Victim Name</th><th>Relative Name</th> <th>Address</th><th>Edit</th> <th>Delete</th></thead>\"\n i = 1;\n victim_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<td><a class='delete' title='Edit' data-toggle='tooltip' onclick='edit_vic_row(\\\"victim_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></td>\";\n delete_button = \"<td><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_vic_row(\\\"victim_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></td>\";\n no = '<td>'+i+'</td>'\n html = '<tr id=\"'+index+'\">'+no+row.victimname+row.vic_relativename+row.victimaddress+edit_button+delete_button+'</tr>';\n\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "function printfyHead(){\n\n // create elements <table> and a <tbody>\n var table = document.getElementById(\"put\");\n var row = document.createElement(\"tr\");\n\n // put <table> in the <body>\n var cell = document.createElement(\"th\");\n var cellText = document.createTextNode(\"Website Name\");\n cell.appendChild(cellText);\n row.appendChild(cell);\n\n var cell2 = document.createElement(\"th\");\n var cellText2 = document.createTextNode(\"Result\");\n cell2.appendChild(cellText2);\n row.appendChild(cell2);\n\n //row2.appendChild(cell2);\n table.appendChild(row);\n}", "function buildHtmlTable(arr) {\n table = document.createElement('graph-table');\n tr = document.createElement('tr');\n th = document.createElement('th');\n td = document.createElement('td');\n\n var _table = table.cloneNode(false);\n columns = addAllColumnHeaders(arr, _table);\n\n for (var i = 0, maxi = arr.length; i < maxi; ++i) {\n var _tr = tr.cloneNode(false);\n\n for (var j = 0, maxj = columns.length; j < maxj; ++j) {\n var _td = td.cloneNode(false);\n\n cellValue = arr[i][columns[j]];\n _td.appendChild(document.createTextNode(arr[i][columns[j]] || ''));\n _tr.appendChild(_td);\n }\n _table.appendChild(_tr);\n }\n table = _table;\n return _table;\n }", "function buildTable(data) {\n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n // Create list of table values \n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n })\n}", "function GenerateTableData() {\n var ret = \"\";\n var tempRet = \"\";\n var display;\n var i;\n $.each(Intern_ArrayOfValues, function (index, value) {\n\n //debugger;\n\n tempRet = tempRet + '<tr id=\"' + Intern_InstanceName + 'tableRow_' + index + '\">';\n $.each(Intern_TableFieldIDs, function (index1, value1) {\n\n //debugger;\n\n i = Intern_InputFieldIds.indexOf(value1);\n if (Intern_InputFieldTypes === undefined || Intern_InputFieldTypes === null\n || Intern_InputFieldTypes[i] === undefined || Intern_InputFieldTypes[i] === null\n || Intern_InputFieldTypes[i] === \"\") {\n display = '<td>' + value[value1] + '</td>';\n }\n else if (Intern_InputFieldTypes[i] === \"checkbox\") {\n if (value[value1] === \"0\") {\n display = \"<td>false</td>\";\n }\n else {\n display = \"<td>true</td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"radio\") {\n if (value[value1] === null) {\n display = \"<td></td>\";\n }\n else {\n display = \"<td>\" + value[value1] + \"</td>\";\n }\n }\n else if (Intern_InputFieldTypes[i] === \"color\") {\n display = '<td style=\"background-color:' + value[value1] + '\"></td>';\n }\n else if (Intern_InputFieldTypes[i] === \"select\") {\n display = '<td>' + $('#' + Intern_InputFieldIds[i] + ' option[value=' + value[value1] + ']').text() + '</td>';\n }\n else {\n display = '<td>' + value[value1] + '</td>';\n }\n tempRet = tempRet + display;\n //i++;\n });\n tempRet = tempRet + AddOperations(index);\n tempRet = tempRet + '</tr>';\n\n if (Setting_AddToTop)\n ret = tempRet + ret;\n else\n ret = ret + tempRet;\n tempRet = \"\";\n //i = 0;\n });\n return ret;\n }", "generateTableHTML(harvestDate) {\n\t\tlet html = [];\n\t\tlet rowElems = [];\n\n\t\tif(harvestDate == null){\n\t\t\tharvestDate = this.state.harvestDate;\n\t\t}\n\n\t\trowElems.push(\n\t\t\t<TableRow key=\"1\">\n\t\t\t\t<TableCell className=\"dashboardTableHeader\">\n\t\t\t\t\t<span style={{fontWeight: \"bold\"}}>Plant Biomass</span> <br/>\n\t\t\t\t\t<span style={{fontWeight: \"light\", fontStyle: \"italic\"}}>(lb/acre)</span>\n\t\t\t\t</TableCell>\n\t\t\t\t<TableCell> {(this.state.ccDataArray !== null && this.state.ccDataArray[\"TWAD\"].chartData.datasets[0] != null) ?\n\t\t\t\t\t\tthis.getYfromArray(this.state.ccDataArray[\"TWAD\"].chartData.datasets[0].data, harvestDate): \"NA\"\n\t\t\t\t}\n\t\t\t\t</TableCell>\n\n\t\t\t</TableRow>\n\t\t);\n\t\trowElems.push(\n\t\t\t<TableRow key=\"2\">\n\t\t\t\t<TableCell className=\"dashboardTableHeader\">\n\t\t\t\t\t<span style={{fontWeight: \"bold\"}}>C:N</span>\n\t\t\t\t</TableCell>\n\n\t\t\t\t<TableCell> {(this.state.ccDataArray !== null && this.state.ccDataArray[\"C:N ratio\"].chartData.datasets[0] != null) ?\n\t\t\t\t\tthis.getYfromArray(this.state.ccDataArray[\"C:N ratio\"].chartData.datasets[0].data, harvestDate): \"NA\"\n\t\t\t\t}\n\t\t\t\t</TableCell>\n\t\t\t</TableRow>\n\t\t);\n\t\trowElems.push(\n\t\t\t<TableRow key=\"3\">\n\t\t\t\t<TableCell className=\"dashboardTableHeader\">\n\t\t\t\t\t<span className=\"dashboardTableHeaderSpan\">Nitrogen Uptake\n\t\t\t\t\t\t<InsertChartIcon style={{cursor: \"pointer\"}} onClick={this.handleUptakeGraphsOpen} />\n\t\t\t\t\t</span>\n\t\t\t\t\t<span style={{fontWeight: \"light\", fontStyle: \"italic\"}}>(lb/acre)</span>\n\t\t\t\t</TableCell>\n\t\t\t\t<TableCell> {(this.state.ccDataArray !== null && this.state.ccDataArray[\"NUAD\"].chartData.datasets[0] != null) ?\n\t\t\t\t\tthis.getYfromArray(this.state.ccDataArray[\"NUAD\"].chartData.datasets[0].data, harvestDate): \"NA\"\n\t\t\t\t}\n\t\t\t\t</TableCell>\n\t\t\t</TableRow>\n\t\t);\n\t\trowElems.push(\n\t\t\t<TableRow key=\"4\">\n\t\t\t\t<TableCell className=\"dashboardTableHeader\">\n\t\t\t\t\t<span className=\"dashboardTableHeaderSpan\">Nitrogen Loss Reduction\n\t\t\t\t\t\t<InsertChartIcon style={{cursor: \"pointer\"}} onClick={this.handleLossGraphsOpen} />\n\t\t\t\t\t</span>\n\t\t\t\t\t<span style={{fontWeight: \"light\", fontStyle: \"italic\"}}>(lb/acre)</span>\n\t\t\t\t</TableCell>\n\t\t\t\t<TableCell>\n\t\t\t\t\t{(() => {\n\t\t\t\t\t\tif((this.state.ccDataArray !== null && this.state.ccDataArray[\"NLTD\"].chartData.datasets[0] != null &&\n\t\t\t\t\t\t\t\tthis.state.noccDataArray !== null && this.state.noccDataArray[\"NLTD\"].chartData.datasets[0] != null)){\n\t\t\t\t\t\t\tlet diff = this.getYfromArray(this.state.noccDataArray[\"NLTD\"].chartData.datasets[0].data, harvestDate)\n\t\t\t\t\t\t\t\t\t- this.getYfromArray(this.state.ccDataArray[\"NLTD\"].chartData.datasets[0].data, harvestDate);\n\t\t\t\t\t\t\tlet percent = diff/this.getYfromArray(this.state.noccDataArray[\"NLTD\"].chartData.datasets[0].data, harvestDate)*100;\n\t\t\t\t\t\t\tif(percent) {\n\t\t\t\t\t\t\t\treturn \"-\" + roundResults(diff, 2) + \" (\" +\n\t\t\t\t\t\t\t\t\t\troundResults(percent, 2) + \"%)\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\treturn \"NA\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\treturn \"NA\";\n\t\t\t\t\t\t}\n\t\t\t\t\t})()}\n\n\t\t\t\t</TableCell>\n\t\t\t</TableRow>\n\t\t);\n\n\t\t// This will always be 100% at the start if termination. Doesn't make sense\n\t\t// to have this row in table. Confirm and delete\n\n\t\tif (!config.hideDecompOutputs) {\n\t\t\t// rowElems.push(\n\t\t\t// \t\t<TableRow key=\"5\">\n\t\t\t// \t\t\t<TableCell className=\"dashboardTableHeader\">\n\t\t\t// \t\t<span className=\"dashboardTableHeaderSpan\">Decomposition\n\t\t\t// \t\t\t<InsertChartIcon style={{cursor: \"pointer\"}} onClick={this.handleDecompGraphOpen}/>\n\t\t\t// \t\t</span>\n\t\t\t// \t\t\t\t<span style={{\n\t\t\t// \t\t\t\t\tfontWeight: \"light\",\n\t\t\t// \t\t\t\t\tfontStyle: \"italic\"\n\t\t\t// \t\t\t\t}}>(kg/ha/day)</span>\n\t\t\t//\n\t\t\t// \t\t\t</TableCell>\n\t\t\t// \t\t\t<TableCell>\n\t\t\t// \t\t\t\t{(() => {\n\t\t\t// \t\t\t\t\tif ((this.state.ccDataArray !== null &&\n\t\t\t// \t\t\t\t\t\t\tthis.state.ccDataArray[\"NLTD\"].chartData.datasets[0] !=\n\t\t\t// \t\t\t\t\t\t\tnull &&\n\t\t\t// \t\t\t\t\t\t\tthis.state.noccDataArray !== null &&\n\t\t\t// \t\t\t\t\t\t\tthis.state.noccDataArray[\"NLTD\"].chartData.datasets[0] !=\n\t\t\t// \t\t\t\t\t\t\tnull)) {\n\t\t\t// \t\t\t\t\t\tlet diff = this.getYfromArray(\n\t\t\t// \t\t\t\t\t\t\t\tthis.state.noccDataArray[\"NLTD\"].chartData.datasets[0].data,\n\t\t\t// \t\t\t\t\t\t\t\tharvestDate)\n\t\t\t// \t\t\t\t\t\t\t\t- this.getYfromArray(\n\t\t\t// \t\t\t\t\t\t\t\t\t\tthis.state.ccDataArray[\"NLTD\"].chartData.datasets[0].data,\n\t\t\t// \t\t\t\t\t\t\t\t\t\tharvestDate);\n\t\t\t// \t\t\t\t\t\tlet percent = diff / this.getYfromArray(\n\t\t\t// \t\t\t\t\t\t\t\tthis.state.noccDataArray[\"NLTD\"].chartData.datasets[0].data,\n\t\t\t// \t\t\t\t\t\t\t\tharvestDate) * 100;\n\t\t\t// \t\t\t\t\t\t// return \"-\"+ roundResults(diff, 2) + \" (\" + roundResults(percent, 2) + \"%)\";\n\t\t\t// \t\t\t\t\t\treturn \"66.34\" + \" (83.71%)\";\n\t\t\t// \t\t\t\t\t} else {\n\t\t\t// \t\t\t\t\t\treturn \"NA\";\n\t\t\t// \t\t\t\t\t}\n\t\t\t// \t\t\t\t})()}\n\t\t\t//\n\t\t\t// \t\t\t</TableCell>\n\t\t\t// \t\t</TableRow>\n\t\t\t// );\n\t\t}\n\n\t\thtml.push(\n\t\t\t<Table style={{borderStyle: \"solid\",\n\t\t\t\tborderColor: \"rgb(224,224,224)\", borderWidth: 1}}>\n\n\t\t\t\t<TableHead>\n\t\t\t\t\t<TableRow style={{height: \"64px\"}}>\n\t\t\t\t\t\t<TableCell style={{textAlign: \"center\", fontWeight:700}} colSpan={2}>Results with Cover Crop</TableCell>\n\t\t\t\t\t</TableRow>\n\t\t\t\t</TableHead>\n\n\t\t\t\t{rowElems}\n\n\t\t\t</Table>\n\t\t);\n\t\treturn html;\n\t}", "function createTable() {\r\n $tbody.innerHTML = \"\";\r\n \r\n var sighting, sightingKeys;\r\n var dom;\r\n var columnValue;\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n sighting = ufoData[i];\r\n sightingKeys = Object.keys(sighting);\r\n\t\r\n $dom = $tbody.insertRow(i);\r\n\t/* insert the column values: 0=date, 1=city, 2=state, 3=country, 4=shape, 5=duration, 6=comments*/\t\r\n for (var j = 0; j < sightingKeys.length; j++) {\r\n columnValue = sightingKeys[j];\r\n $dom.insertCell(j).innerText = sighting[columnValue];\r\n }\r\n }\r\n}", "function createItemTable(arr) {\n var output = \"\";\n var tableDataCount = 0;\n output += \"<table>\";\n for (var i = 0; i < arr.length; i++) {\n if (tableDataCount == 0) {\n // create a new row\n output += \"<tr>\";\n }\n output += \"<td style='vertical-align:top'>\";\n output += arr[i];\n output += \"</td>\";\n if (tableDataCount == 3) {\n // end the row\n output += \"</tr>\";\n }\n\n // increment the table data\n tableDataCount++;\n if (tableDataCount == 4) {\n tableDataCount = 0;\n }\n }\n // finish the row if it wasn't finished\n if (tableDataCount != 0) {\n for (tableDataCount; tableDataCount < 4; tableDataCount++) {\n if (tableDataCount == 0) {\n // create a new row\n output += \"<tr>\";\n }\n output += \"<td style='vertical-align:top'></td>\";\n if (tableDataCount == 3) {\n // end the row\n output += \"</tr>\";\n }\n\n // increment the table data\n tableDataCount++;\n }\n }\n output += \"</table>\";\n return output;\n}", "function build_rows_witness(witness_list){\n rows = []\n header = \"<thead class='thead-dark'><th>S.No.</th><th>Witness Name</th><th>Relative Name</th> <th>PS</th><th>Edit</th> <th>Delete</th></thead>\"\n i = 1;\n witness_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<td><a class='delete' title='Edit' onclick='edit_witness_row(\\\"witness_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></td>\";\n delete_button = \"<td><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_witness_row(\\\"witness_table\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></td>\";\n no = '<td>'+i+'</td>'\n html = '<tr id=\"'+index+'\">'+no+row.witness_name+row.witness_relativename+row.witness_ps+edit_button+delete_button+'</tr>';\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "function tableCreator(element, index) {\n\n document.getElementById(\"basket_tablebody\").innerHTML += \"<tr id='basketProduct\" + index + \"'></tr>\";\n document.getElementById(\"basketProduct\" + index).innerHTML += \"<td>\" + element.name + \"</td>\";\n document.getElementById(\"basketProduct\" + index).innerHTML += \"<td>\" + element.option + \"</td>\";\n document.getElementById(\"basketProduct\" + index).innerHTML += \"<td>\" + element.price / 100 + \"€</td>\";// += pour rajouter\n}", "function buildtable(table) {\n \n \n \n console.log(table)\n\n // appending data into table\n table.forEach((item) => {\n \n var row = tbody.append(\"tr\");\n row.append(\"td\").text(item.datetime);\n row.append(\"td\").text(item.city);\n row.append(\"td\").text(item.state);\n row.append(\"td\").text(item.country);\n row.append(\"td\").text(item.shape);\n row.append(\"td\").text(item.durationMinutes);\n row.append(\"td\").text(item.comments);\n })\n}", "function makeTableRow(data, items, klass) {\n\t\tvar row = document.createElement('tr');\n\t\tfor (var i in items) {\n\t\t\tvar cell = document.createElement('td');\n\t\t\tcell.innerHTML = data[i];\n\t\t\tcell.style.width = i=='day' ? '1.5em' : '2.7em';\n\t\t\trow.appendChild(cell);\n\t\t}\n\t\trow.className = klass;\n\t\treturn row;\n\t}", "function poplulateTable(data){\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "function dataRow(legend, value, units){\r\n //this creates new table data in the message\r\n msg = \"<td>\";\r\n //can't do =+, it won't work. this adds the legend \r\n msg += legend;\r\n //here you close of the first table data td command above, and open another\r\n msg += \": </td><td>\";\r\n //\r\n msg += value;\r\n //this tells it to add a Space bt \" \", then units.\r\n msg += \" \" + units;\r\n //here we close the table data command.\r\n msg += \"</td>\"\r\n //\r\n return msg;\r\n}", "function buildTable(t_row) {\n\treturn \"<div class=\\\"container\\\">\" +\n\t\t \"<table class=\\\"w3-table w3-striped\\\">\" +\n\t\t \"<tr>\" +\n\t\t \"<th>Course</th>\" +\n\t\t \"<th>Credits</th>\" +\n\t\t \"<th>Grade</th>\" +\n\t\t \" </tr>\" +\n\t\t \t t_row + \t// table row\n\t\t \"</table>\" +\n\t\t\"</div>\";\n}", "function buildEmailRow(row) {\r\n return [\r\n '<table style=\"font-family:arial;\" id=\"t01\">',\r\n '<tr>',\r\n '<th>' + row[0] + ', ' + row[1] + '</th>',\r\n '<th>Project Name: ' + row[2] + '</th>',\r\n '</tr>',\r\n '<tr style = \"background-color: ' + accentColor1 + ';\">',\r\n '<td><b>This Week\\'s Achievement</b></td>',\r\n '<td width=\\\"67%\\\">' + row[3] + '</td>',\r\n '</tr>',\r\n '<tr style = \"background-color: ' + accentColor2 + ';\">',\r\n '<td><b>This Week\\'s Problem(s)</b></td>',\r\n '<td>' + row[4] + '</td>',\r\n '</tr>',\r\n '<tr style = \"background-color: ' + accentColor1 + ';\">',\r\n '<td><b>Next Week\\'s Plan</b></td>',\r\n '<td>' + row[5] + '</td>',\r\n '</tr>',\r\n '</table>'\r\n ].join('\\n')\r\n}", "function format(d, indice) {\n // `d` is the original data object for the row\n var texto = d[indice]; //indice donde esta el input hidden\n var resultado = $(texto).val();\n var json = JSON.parse(resultado);\n var len = Object.keys(json).length;\n console.log(json);\n var childTable = '<table style=\"padding-left:20px;border-collapse: separate;border-spacing: 10px 3px;\">' +\n '<tr><td style=\"font-weight: bold\">' + $('#text_response').val() + '</td><td style=\"font-weight: bold\">' + $('#text_value').val() + '</td><td style=\"font-weight: bold\">' + $('#text_date').val() + '</td></tr>';\n for (var i = 1; i <= len; i++) {\n childTable = childTable +\n '<tr></tr><tr><td>' + json[i].respuesta + '</td><td>' + json[i].valor + '</td><td>' + json[i].fechaResultado + '</td></tr>';\n }\n childTable = childTable + '</table>';\n return childTable;\n }", "function createPaidOrderRow(paidData) {\n let html = ``;\n console.log(\"paidata : \", paidData)\n paidData.forEach(paidOrder => {\n html += `<tr role=\"row\" class=\"odd\">\n <td>` + paidOrder.py_id + `</td>\n <td>` + paidOrder.cu_id.customerName + `</td>\n <td>` + paidOrder.cu_id.customerSurname + `</td>\n <td>` + paidOrder.ba_id + `</td> \n <td>` + paidOrder.py_DebtAmount + `</td>//toplam borç\n <td>` + paidOrder.py_PaymentAmount + `</td> //ödeme tutarı\n <td>` + paidOrder.py_RemainAmount + `</td> //kalan tutar\n <td class=\"text-right\">\n <div class=\"btn-group\" role=\"group\" aria-label=\"Basic mixed styles example\">\n <button type=\"button\" class=\"btn btn-outline-primary \"><i class=\"far fa-trash-alt\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-primary \"><i class=\"far fa-file-alt\"></i>\n </button>\n <button type=\"button\" class=\"btn btn-outline-primary \"><i class=\"fas fa-pencil-alt\"></i>\n </button>\n </div>\n </td>\n </tr>`;\n }\n )\n\n $('#paidOrderTable').html(html);\n}", "function generateTable(data){ \n var tbody = d3.select(\"tbody\");\n $(\"#tablebody tr\").remove();\n data.forEach(function(results){\n var row = tbody.append(\"tr\"); \n Object.entries(results).forEach(function([key,value]){\n var cell = row.append(\"td\"); \n cell.text(value);\n });\n });\n\n}", "function makeTd(dado,classe){\n var td = document.createElement(\"td\");\n td.classList.add(classe);\n td.textContent = dado;\n return td;\n}", "function buildHtmlTable(selector, myList, loaded, type, headers) \r\n\t{\r\n let body = $(selector +' tbody');\r\n let columns = addAllColumnHeaders(myList, selector, loaded, type, headers);\r\n \r\n for (var i = 0; i < myList.length; i++) \r\n\t\t{\r\n\t\t\tif(!showCustomTokens && myList[i].Unlisted)\r\n\t\t\t\t\tcontinue;\r\n let row$ = $('<tr/>');\r\n\r\n if(type === 'transactions')\r\n {\r\n for (var colIndex = 0; colIndex < columns.length; colIndex++) \r\n\t\t\t\t{\r\n let cellValue = myList[i][columns[colIndex]];\r\n if (cellValue == null) cellValue = \"\";\r\n\t\t\t\t\tlet head = columns[colIndex];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(head == 'Value' || head == 'Price')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(cellValue !== \"\" && cellValue !== undefined)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlet dec = fixedDecimals;\r\n\t\t\t\t\t\t\tif(head == 'Price')\r\n\t\t\t\t\t\t\t\tdec += 2;\r\n\t\t\t\t\t\t\tlet num = Number(cellValue).toFixed(dec);\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html(num));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html(cellValue));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(head == 'Name')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// name in <!-- --> for sorting\r\n\t\t\t\t\t\tif( !myList[i].Unlisted)\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<!--' + cellValue + ' --><a target=\"_blank\" class=\"label label-primary\" href=\"https://etherdelta.com/#' + cellValue + '-ETH\">' + cellValue + '</a>'));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<!--' + cellValue + ' --><a target=\"_blank\" class=\"label label-warning\" href=\"https://etherdelta.com/#' + myList[i].TokenAddr + '-ETH\">' + cellValue + '</a>'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(head == 'Type')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(cellValue == 'Deposit')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<span class=\"label label-success\" >' + cellValue + '</span>'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(cellValue == 'Withdraw')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<span class=\"label label-danger\" >' + cellValue + '</span>'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(cellValue == 'Cancel sell' || cellValue == 'Cancel buy')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<span class=\"label label-default\" >' + cellValue + '</span>'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(cellValue == 'Buy')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<span class=\"label label-info\" >Trade</span><span class=\"label label-success\" >' + cellValue + '</span>'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<span class=\"label label-info\" >Trade</span><span class=\"label label-danger\" >' + cellValue + '</span>'));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse if( head == 'Hash')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\trow$.append($('<td/>').html('<a target=\"_blank\" href=\"https://etherscan.io/tx/' + cellValue + '\">'+ cellValue.substring(0,8) + '...</a>'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(head == 'Status')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(cellValue)\r\n\t\t\t\t\t\t row$.append($('<td align=\"center\"/>').html('<i style=\"color:green;\" class=\"fa fa-check\"></i>'));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\trow$.append($('<td align=\"center\"/>').html('<i style=\"color:red;\" class=\"fa fa-exclamation-circle\"></i>'));\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(head == 'Details')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\trow$.append($('<td/>').html('<a href=\"'+cellValue+'\" target=\"_blank\"> See details</a>'));\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\trow$.append($('<td/>').html(cellValue));\r\n\t\t\t\t\t}\r\n }\r\n }\r\n\t\t\telse if(type === 'balances')\r\n {\r\n\t\t\t\t//if(!balances[myList[i].Name])\r\n\t\t\t\t\t//continue;\r\n for (var colIndex = 0; colIndex < columns.length; colIndex++) \r\n\t\t\t\t{\r\n let cellValue = myList[i][columns[colIndex]];\r\n if (cellValue == null) cellValue = \"\";\r\n\t\t\t\t\tlet head = columns[colIndex];\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(head == 'Total' || head == 'EtherDelta' || head == 'Wallet' || head == 'Bid' || head == 'Est. ETH')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(cellValue !== \"\" && cellValue !== undefined)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tlet dec = fixedDecimals;\r\n\t\t\t\t\t\t\tif(head == 'Bid' )\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tdec +=2;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tlet num = Number(cellValue).toFixed(dec);\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html(num));\r\n\t\t\t\t\t\t} else\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html(cellValue));\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(head == 'Name')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// name in <!-- --> for sorting\r\n\t\t\t\t\t\tif(! balances[cellValue].Unlisted)\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<!--' + cellValue + ' --><a target=\"_blank\" class=\"label label-primary\" href=\"https://etherdelta.com/#' + cellValue + '-ETH\">' + cellValue + '</a>'));\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\trow$.append($('<td/>').html('<!--' + cellValue + ' --><a target=\"_blank\" class=\"label label-warning\" href=\"https://etherdelta.com/#' + myList[i].Address + '-ETH\">' + cellValue + '</a>'));\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\trow$.append($('<td/>').html(cellValue));\r\n\t\t\t\t\t}\r\n }\r\n }\r\n\t\t\tbody.append(row$);\r\n }\r\n }", "function rowb2(){\r\n\ttrb=document.createElement('tr');\r\n\tfor(var ings=numbertimes.toString();ings>0;ings--){\r\n\t\ttdb=document.createElement('td')\r\n\t t4++;\r\n\t\tconsole.log(t4);\r\n\t\ttdb.id=\"2ndNos\"+ings;\r\n\t\ttdb.height = '40';\r\n\t\ttdb.width= '25';\r\n\t\t//number4[t];\r\n\t\tif(t4<0){\r\n\t\ttdb.innerHTML+=\"\";\r\n\t}\r\n\telse if(t4>=0&&t4<=numberlength8) {\r\n tdb.innerHTML+=number6[t4];\r\n\t}\r\n\t\r\n\t\ttrb.appendChild(tdb);\r\n\r\n\t}\r\n\ttbl2.appendChild(trb);\r\n}", "function build_rows_prop(property_list){\n rows = []\n header = \"<thead class='thead-dark'><th>S.No.<th>Property Category</th> <th>Property Type</th> <th>Property Nature</th> <th>Description</th> <th>Estimated Value</th><th>Edit</th> <th>Delete</th></thead>\"\n i = 1;\n property_list.forEach(function(row, index){\n if(row['soft_delete'] == \"Yes\"){\n return true;\n }\n index += 1;\n edit_button = \"<td><a class='delete' title='Edit' data-toggle='tooltip' onclick='edit_prop_row(\\\"prpoerty_datatable\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-edit'></i></a></td>\";\n delete_button = \"<td><a class='delete' title='Delete' data-toggle='tooltip' onclick='delete_prop_row(\\\"prpoerty_datatable\\\",\\\"\"+index+\"\\\");'><i class='step-icon feather icon-trash-2'></i></a></td>\";\n no = '<td>'+i+'</td>'\n html = '<tr id=\"'+index+'\">'+no+row.category+row.type+row.nature+row.desc+row.value+edit_button+delete_button+'</tr>';\n rows.push(html);\n i += 1;\n });\n return header+\"<tbody>\"+rows+\"</tbody>\";\n}", "function default_table(){\n tableData.forEach((sightings) => {\n var record = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var data_value = record.append(\"td\");\n data_value.text(value);\n });\n });\n}", "function addEmptyTd() {\n //get max col in table body\n var maxCol = 0;\n $('.classictable table tbody tr').each(function () {\n maxCol = Math.max($(this).children().length, maxCol);\n });\n\n //add td to with '--' to remaining column in each row\n var x = \"<td class='relative'>--</td>\";\n $('.classictable table tbody tr').each(function () {\n var totalColPresent = $(this).children().length;\n if (totalColPresent < maxCol) {\n for (var col = 0; col < (maxCol - totalColPresent) ; col++) {\n $(this).append(x);\n }\n }\n });\n}", "function renderemptyrow(i,rows,tbody,fields,target,rownumbers,groupname,groupindex){\r\n\t\ttbody.push('<tr class=\"datagrid-emptyrow\" -datagrid-row-index=\"'+i+'\" >');\r\n\t\tif (rownumbers){\r\n\t\t\ttbody.push('<td></td>');\r\n\t\t}\r\n\t\tfor(var j=0; j<fields.length; j++){\r\n\t\t\ttbody.push('<td class=\"datagrid-column-'+ (fields[j]? fields[j].replace(/\\./gi,\"-\"):\"\") +'\"></td>');\r\n\t\t}\r\n\t\ttbody.push('</tr>');\r\n\t}", "function tableformation(state){\n // var tbody = document.getElementById('tbody');\n // for(i=2;i<state.lenght;i++)\n // {\n // var tr = \"<tr>\";\n // tr += \"<th>\" + state[i].state + \"</th>\" + \"<td>$\" + state[i].confirmed + \"</td>\" + \"<td>$\" + state[i].active + \"</td>\" + \"<td>$\" + state[i].recovered + \"</td>\" + \"<td>$\" + state[i].deceased + \"</td></tr>\";\n // tbody.innerHTML += tr;\n // }\n var k = '<tbody>'\n for(i = 2;i < state.length; i++){\n k+= '<tr>';\n k+= \"<th scope='row'>\" + state[i].state + '</th>';\n k+= '<td>' + state[i].confirmed + '</td>';\n k+= '<td>' + state[i].active + '</td>';\n k+= '<td>' + state[i].recovered + '</td>';\n k+= '<td>' + state[i].deceased + '</td>';\n k+= '</tr>';\n }\n k+='</tbody>';\n document.getElementById('tbody').innerHTML = k;\n}", "function RenderRow() {}", "function buildTable(tableData){\n // Clear the html table section\n tbody.html(\"\");\n //Loop to append data \n tableData.forEach(dataEntry =>{\n var row = tbody.append(\"tr\");\n Object.entries(dataEntry).forEach(([key,value]) =>{\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function createTable(data){\n const table = document.getElementById('orders-table');\n const tableContent = document.createDocumentFragment();\n let cols = getData('columns');\n //let nrows = data.length;\n\n deleteTableContent(table);\n\n data.forEach(rowData => {\n let row = document.createElement('tr');\n for(let col of cols) {\n let cell = document.createElement('td');\n switch(col){\n case 'total':\n //Set two decimal\n cell.textContent = `$ ${rowData[col].toFixed(2)}`;\n break;\n \n case 'order': \n // Create the link to Orders\n let link = rowData['order_link'];\n let order_number = rowData[col];\n let a = create_link(link, order_number);\n cell.append(a);\n break;\n\n case 'date':\n //Print the Date in Locale Format\n cell.textContent = rowData[col].toLocaleString();\n break;\n \n case 'status':\n let status = create_status(rowData[col]);\n cell.append(status);\n break;\n \n default:\n cell.textContent = rowData[col];\n break;\n }\n row.appendChild(cell);\n }\n tableContent.appendChild(row);\n })\n \n //Add the tableContent Fragment to Table Body\n table.tBodies[0].append(tableContent);\n\n //Show the table\n showTable(table, 1);\n\n //Return the link to Order Number\n function create_link(link, number) {\n let a = document.createElement('a');\n \n a.setAttribute('href', link);\n a.setAttribute('target', 'blank');\n a.innerHTML = `# ${number.toString().padStart(5, '0')}`;\n\n return a;\n }\n //Return a span element to status order\n function create_status(status) {\n let elem = document.createElement('span');\n elem.classList.add(status.toLowerCase(), 'status-order');\n elem.textContent = status.toUpperCase();\n\n return elem;\n }\n}", "function creaStringaTabellaDaInserireNelDom(arrayIntestazioni){\n var stringaTh = '<table id =\"tabellaRisultatiConsultazioneEntitaCollegate\" class=\"table table-bordered\"><thead>';\n var stringaTd = '</thead><tbody>';\n\n arrayIntestazioni.forEach(function(value){\n stringaTh = stringaTh + '<th>' + value.name + '</th>';\n stringaTd = stringaTd + '<td></td>';\n });\n\n return stringaTh +'<th class = \"span2\"></th>' + stringaTd + '<td class = \"span2\"></td></tbody></table>';\n }" ]
[ "0.7012176", "0.6966401", "0.6890342", "0.683491", "0.68028265", "0.67603433", "0.671317", "0.6649285", "0.66363066", "0.65809524", "0.65722907", "0.6539012", "0.65388364", "0.65384126", "0.65228355", "0.6517728", "0.65143365", "0.65064824", "0.6506121", "0.6493017", "0.64630884", "0.645685", "0.64539087", "0.64537024", "0.64495933", "0.644431", "0.6421774", "0.64150935", "0.6415013", "0.64135104", "0.6412927", "0.6410351", "0.64080113", "0.638809", "0.6383324", "0.6380876", "0.63748133", "0.63709074", "0.6364983", "0.635886", "0.6354129", "0.6337588", "0.63363254", "0.6334134", "0.63313115", "0.63307303", "0.6330306", "0.63282967", "0.6327078", "0.63147414", "0.63147414", "0.6311005", "0.63108706", "0.63014174", "0.62998956", "0.6295603", "0.6285578", "0.627138", "0.62707233", "0.62653273", "0.6263051", "0.6263009", "0.62594146", "0.6255587", "0.6246951", "0.6246697", "0.62430394", "0.62417966", "0.62410504", "0.6240525", "0.6234723", "0.6233342", "0.62260747", "0.6225963", "0.6222494", "0.6218472", "0.6218324", "0.6213896", "0.62126905", "0.62103057", "0.6207874", "0.62074476", "0.6204208", "0.6202999", "0.62029195", "0.61956465", "0.6192042", "0.61918557", "0.6187427", "0.61822385", "0.6181326", "0.61787474", "0.6173593", "0.61695176", "0.6168334", "0.6167515", "0.6166619", "0.6165569", "0.6162874", "0.6158244" ]
0.6381046
35
creates table body for user
function createTableBody(tableData) { let tableRows = createNothingToDisplayElement(); let tableRowElement = null; if (Array.isArray(tableData) && tableData.length > 0) { tableRows = []; for (let dataElement of tableData) { tableRowElement = createTableRowDataEntry(dataElement); tableRows.push(tableRowElement); } } return tableRows; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createTableBody(table) {\n // reset body containings\n let tableBody = $('#table-body');\n tableBody.html('');\n\n // displaying results\n headers = Object.keys(table[0].input).slice(2);\n let rowCount = 0;\n\n table.forEach(function(data) {\n let tr = document.createElement('tr');\n\n let indexTd = document.createElement('td');\n indexTd.innerHTML = rowCount++ + '.';\n $(tr).append(indexTd);\n\n headers.forEach(function(key) {\n let td = document.createElement('td');\n td.innerHTML = data.input[key];\n $(tr).append(td);\n });\n\n let resultTd = document.createElement('td');\n resultTd.innerHTML = data.result;\n\n $(tr).append(resultTd);\n\n tableBody.append(tr);\n });\n }", "function createTableBody(table, data) {\n for (let record of data) {\n let row = table.insertRow();\n for (let prop in record) {\n let cell = row.insertCell();\n let text = document.createTextNode(record[prop])\n cell.appendChild(text);\n }\n }\n}", "function GenerateTableBody(TableBodyID, data) {\n $(\"#\" + TableBodyID).html(\"\");\n for (var i = 0; i < data.length; i++) {\n td = \"\";\n td = td + '<tr>';\n for (var prop in data[i]) {\n td = td + '<td>' + data[i][prop] + '</td>';\n }\n td = td + '</tr>';\n $(\"#\" + TableBodyID).append(td);\n }\n $('input.flat').iCheck({\n checkboxClass: 'icheckbox_square-green',\n radioClass: 'iradio_square-green'\n });\n }", "function createTableBody(response) {\n let data = JSON.parse(response);\n let table = document.getElementsByClassName(\"table\")[0];\n let tableBody = table.createTBody();\n let tableRow = \"\";\n data.forEach(function (item) {\n tableRow += `<tr class=\"table-content\">\n <td>${item.name}</td>\n </tr>`;\n \n });\n tableBody.innerHTML = tableRow;\n let tableRows = document.getElementsByClassName(\"table-content\");\n for (let i = 0; i < tableRows.length; i++) {\n let newRow = tableRows[i].insertCell(1);\n newRow.appendChild(createButton(data[i].name));\n }\n}", "buildBody() {\n let body = document.createElement('tbody');\n body.setAttribute('style', 'vertical-align: top');\n body.addEventListener('click', Table.cbToggleUserDetails, false);\n\n for (let i = 0; i < this.sortedData.length; i++) {\n let row = this.buildRow(this.sortedData[i]);\n\n body.appendChild(row);\n }\n\n return body;\n }", "function generateTableBody(table, data) {\n table.border = '1';\n for (let element of data) {\n let row = table.insertRow();\n \n for (key in element) {\n let cell = row.insertCell();\n let text = document.createTextNode(element[key]);\n cell.appendChild(text);\n \n }\n \n }\n document.querySelector('.output').innerHTML = \"If you click on the \\\"Dy\\\" box or on the first box immediately below, you can read the result of the output\";\n }", "function inBang()\n{\n for(var i=0;i<3;i++)\n {\n var tableRow =document.createElement(\"tr\");\n tableBody.appendChild(tableRow);\n\n var user=data.users[i];\n var info=[user.id,user.name,user.email];\n\n for(var j=0;j<info.length;j++)\n {\n\n var tableData=document.createElement(\"td\");\n tableData.innerHTML=info[j];\n tableRow.appendChild(tableData);\n }\n }\n}", "function createUserTable(){\n knex.select('*').from('userdetail')\n .then((data)=>{\n for(var i of data){\n userTable(i.email.split('@')[0]+i.password)\n // console.log(i.fullname+i.id)\n\n }\n })\n }", "function printUsers() {\n for(let i = 0; i < users.length; i++) {\n const row = '<tr><td>'+users[i].name+'</td><td>' + users[i].email + '</td></tr>'\n tableBody.innerHTML += row;\n }\n}", "createTable() {\n this.dbConnector.query(this.dbConnector.statements.createTable({ ...this.params, owner: this.dbConnector.options.role || this.dbConnector.options.user }), (error) => {\n if (error) {\n this.end(error);\n }\n this.write();\n }, []);\n }", "function createUsersTable(users) {\n const table = document.createElement('table');\n for (let i = 0; i < users.length; i++) {\n const tr = document.createElement('tr');\n const tdName = document.createElement('td');\n tdName.innerText = users[i].name;\n const tdAge = document.createElement('td');\n tdAge.innerText = users[i].age;\n const tdEmail = document.createElement('td');\n tdEmail.innerText = users[i].email;\n const tdPhone = document.createElement('td');\n tdPhone.innerText = users[i].phone;\n tr.appendChild(tdName);\n tr.appendChild(tdAge);\n tr.appendChild(tdEmail);\n tr.appendChild(tdPhone);\n table.appendChild(tr);\n }\n return table;\n}", "function userTable() { }", "function createTable() {\n\tlet body = document.body;\n\tlet table = document.createElement('table');\n\t// table.style.width = '200px';\n\ttable.style.border = '1px solid black';\n\n\tlet tableHeader = document.createElement('thead');\n\ttable.appendChild(tableHeader);\n\n\tlet tableHeaderRow = document.createElement('tr');\n\ttableHeader.appendChild(tableHeaderRow);\n\tlet serialNo = document.createElement('th');\n\ttableHeader.appendChild(serialNo);\n\tserialNo.innerHTML = 'Serial No.';\n\tserialNo.style.border = '1px solid black';\n\n\tlet titleHeader = document.createElement('th');\n\ttableHeader.appendChild(titleHeader);\n\ttitleHeader.innerHTML = 'Title';\n\ttitleHeader.style.border = '1px solid black';\n\t\n\tlet noteHeader = document.createElement('th');\n\ttableHeader.appendChild(noteHeader);\n\tnoteHeader.innerHTML = 'Note';\n\tnoteHeader.style.border = '1px solid black';\n\n\tlet tableBody = document.createElement('tbody');\n\ttableBody.id = \"tbody\";\n\ttable.appendChild(tableBody);\n\n\tbody.appendChild(table);\n}", "function makeRow(userData) {\n return html`\n <div id=\"column-headings\">\n <td><strong>Name:</strong> ${userData.name}<br/></td>\n <td><strong>Email:</strong> ${userData.email}<br/></td>\n <td><strong>Pronoun:</strong> ${userData.pronoun}<br/></td>\n <td><strong>Guests:</strong> ${userData.guests}<br/></td>\n <td><strong>Meal:</strong> ${userData.meal}<br/></td>\n <td><strong>Shirt size:</strong> ${userData.shirt}<br/></td>\n <td><strong>Shirt color:</strong> ${userData.shirtColor}<br/></td>\n </div>\n <br/>\n `;\n}", "function generateTableBody(data) {\n document.getElementById(\"myTable\").innerHTML = \"\";\n let tbody = document.querySelector(\"tbody\");\n\n for (let i = 0; i < data.length; i++) {\n let information = data[i];\n\n let row = document.createElement(\"tr\");\n if (i % 2 === 0) {\n row.classList.add('even');\n } else {\n row.classList.add('odd');\n }\n let name = document.createElement('td');\n name.classList.add('sorting_1')\n let position = document.createElement('td');\n\n position.classList.add('position');\n let Office = document.createElement('td');\n Office.classList.add('tdStyle');\n let Age = document.createElement('td');\n Age.classList.add('tdStyle');\n let startDate = document.createElement('td');\n startDate.classList.add('tdStyle');\n let salary = document.createElement('td');\n salary.classList.add('tdStyle');\n\n name.innerText = information['name'];\n position.innerText = information['position'];\n Office.innerText = information['Office'];\n Age.innerText = information['Age'];\n startDate.innerText = information['Start date'];\n salary.innerText = information['Salary'];\n\n row.appendChild(name);\n row.appendChild(position);\n row.appendChild(Office);\n row.appendChild(Age);\n row.appendChild(startDate);\n row.appendChild(salary);\n tbody.appendChild(row);\n }\n return tbody;\n}", "function createUserListTable() {\n db.transaction((tx) => {\n tx.executeSql(\n \"create table if not exists userlist (id integer primary key not null, title text not null, imgURL text not null, notes text);\",\n [],\n () => {\n console.log(\"Created userlist table in database!\");\n }\n );\n });\n }", "function createtable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < ufoData.length; i++) {\n // Get current fields\n var info = ufoData[i];\n var fields = Object.keys(info);\n // insert new fields in the tbody\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = info[field];\n }\n }\n}", "function createTable() {\n const body = document.body\n const table = document.createElement('table')\n table.classList.add('jeopardy-table')\n const tHead = document.createElement('thead')\n tHead.classList.add('title-row')\n const tBody = document.createElement('tbody')\n tBody.classList.add('table-body')\n \n body.prepend(table)\n table.append(tHead)\n table.append(tBody)\n}", "function setBody(table,content){\n var body = table.createTBody();\n\n for(var i=scope.headers.length-1;i>=0;i--){\n if(scope.headers[i] && scope.headers[i].checked && scope.headers[i].visible){\n for(var j=0;j<content.length;j++){\n var row;\n if(body.rows[j]){\n row = body.rows[j];\n }else{\n row = body.insertRow(j);\n if(typeof scope.actions === 'function'){\n var check = row.insertCell(0);\n // var index = scope.ngModel.indexOf(content[j]);\n var index = j;\n check.innerHTML = createCheckbox(index,j);\n }\n }\n var val = content[j][scope.headers[i].field];\n var cell;\n if(typeof scope.actions === 'function'){\n cell = row.insertCell(1);\n }else{\n cell = row.insertCell(0);\n }\n cell.innerHTML = val;\n }\n }\n }\n }", "function setBody(table,content){\n var body = table.createTBody();\n\n for(var i=scope.headers.length-1;i>=0;i--){\n if(scope.headers[i] && scope.headers[i].checked && scope.headers[i].visible){\n for(var j=0;j<content.length;j++){\n var row;\n if(body.rows[j]){\n row = body.rows[j];\n }else{\n row = body.insertRow(j);\n if(typeof scope.actions === 'function'){\n var check = row.insertCell(0);\n // var index = scope.ngModel.indexOf(content[j]);\n var index = j;\n check.innerHTML = createCheckbox(index,j);\n }\n }\n var val = content[j][scope.headers[i].field];\n var cell;\n if(typeof scope.actions === 'function'){\n cell = row.insertCell(1);\n }else{\n cell = row.insertCell(0);\n }\n cell.innerHTML = val;\n }\n }\n }\n }", "function createTableRows(dataFromAPI, tableBody) {\n const tr = document.createElement('tr')\n tr.setAttribute('id', dataFromAPI.name)\n const wantedFields = [emptyHeart, dataFromAPI.logo_url, dataFromAPI.currency,\n dataFromAPI.name, dataFromAPI.price];\n wantedFields.forEach(field => createTableDataCell(field, tr))\n tableBody.appendChild(tr)\n}", "function addUsersToTable()\n{\n users.forEach( user => {\n let table_row = `\n <tr>\n <td>${user.id}</td>\n <td>${user.name}</td>\n <td>${user.username}</td>\n <td>${user.email}</td>\n <td><a class=\"waves-effect waves-light btn\" href=\"http://127.0.0.1:5500/post.html?user_id=${user.id}\">Details</a></td>\n </tr>\n `;\n\n tbody.innerHTML += table_row;\n });\n}", "function printUsers() {\n tableBody.innerHTML = '';\n // for(let i = 0; i < users.length; i++) {\n // const row = '<tr><td>'+ users[i].name +'</td><td>' + users[i].age + '</td><td>' + users[i].email + '</td><td>' + users[i].gender + '</td></tr>';\n // tableBody.innerHTML += row;\n // }\n //const usuarios = users.map(user => '<tr><td>'+ user.name +'</td><td>' + user.age + '</td><td>' + user.email + '</td><td>' + user.gender + '</td></tr>');\n users.forEach(user => {\n const row = `<tr>\n <td>${user.name}</td>\n <td>${user.age}</td>\n <td>${user.email}</td>\n <td>${user.gender}</td>\n </tr>`;\n tableBody.innerHTML += row; \n })\n}", "function printUsers() {\n const htmlDataUsers = htmlRowsUsers()\n const tableBody = getTablebody()\n tableBody.innerHTML = htmlDataUsers\n}", "function createTableBody(table,commentData){\n for(let commentRecord of commentData){\n let row = table.insertRow();\n for(let values in commentRecord){\n let cell = row.insertCell();\n let text = document.createTextNode(commentRecord[values]);\n cell.appendChild(text);\n }\n let newCell = row.insertCell();\n let myViewButton = document.createElement(\"a\");\n let myButtonValue = document.createTextNode(\"View one\")\n myViewButton.className =\"btn btn-warning\";\n myViewButton.href=\"readOne.html?id=\"+commentRecord.id\n myViewButton.appendChild(myButtonValue);\n newCell.appendChild(myViewButton)\n // let newCellDelete = row.insertCell();\n // let myDelButton = document.createElement(\"button\");\n // let myButtonValue1 = document.createTextNode(\"Delete a record\")\n // myDelButton.className =\"btn btn-success\";\n // myDelButton.onclick = function(){\n // delStudent(commentRecord.id);return false;\n };\n // myDelButton.appendChild(myButtonValue1);\n // newCellDelete.appendChild(myDelButton)\n // }\n }", "function createTable() {\r\n $tbody.innerHTML = \"\";\r\n \r\n var sighting, sightingKeys;\r\n var dom;\r\n var columnValue;\r\n \r\n for (var i = 0; i < ufoData.length; i++) {\r\n sighting = ufoData[i];\r\n sightingKeys = Object.keys(sighting);\r\n\t\r\n $dom = $tbody.insertRow(i);\r\n\t/* insert the column values: 0=date, 1=city, 2=state, 3=country, 4=shape, 5=duration, 6=comments*/\t\r\n for (var j = 0; j < sightingKeys.length; j++) {\r\n columnValue = sightingKeys[j];\r\n $dom.insertCell(j).innerText = sighting[columnValue];\r\n }\r\n }\r\n}", "doBodyTable() {\n // remove html da tabela de arquivos antigos\n var htmlColumn = ``\n var htmlRow = ``\n \n // caminha pelas linhas da tabela fora a linha \n // dos headers, por isso o index parte do 1\n for (var i = 1; i < this.tableLinesLength; i++) {\n\n // insere na variavel local currentLine o conteudo da linha \n var currentLine = this.tableLines[i].split(\",\")\n htmlColumn = ``\n\n // utiliza do tamanho do array global tableHeadersLength para caminhar pelas celulas \n for (var j = 0; j < this.tableHeadersLength; j++) {\n // insere uma celula com valor vazio |PREENCHER| caso a celular esteja vazia\n if (currentLine[j] == '') {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"${this.controllerName}.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->${this.controllerName}#editUnit\">|PREENCHER|</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->${this.controllerName}#saveUnit change->${this.controllerName}#saveUnit blur->${this.controllerName}#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n \n // insere uma celula com o valor da currentLine\n } else {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"${this.controllerName}.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->${this.controllerName}#editUnit\">${currentLine[j]}</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->${this.controllerName}#saveUnit change->${this.controllerName}#saveUnit blur->${this.controllerName}#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n }\n }\n\n // adiciona na linha o conteudo das celulas\n htmlRow += `<tr data-target=\"${this.controllerName}.lineCell-${i}\">\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"${this.controllerName}.columnCell-${i}\">\n <span class=\"text-bold\">${i}</span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n ${htmlColumn}\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"${this.controllerName}.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"${this.controllerName}.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <button id=${i} data-action=\"click->${this.controllerName}#deleteLine\" type=\"button\" class=\"btn btn-sm btn-table editAuthor p-0\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Remover linha\"><span class=\"material-icons md-sm md-dark\">delete</span></button>\n </td>\n </tr>`\n }\n\n return htmlRow;\n }", "function addUser(userObj) {\n let newRow = document.createElement('tr');\n newRow.innerHTML = `\n <td>${userObj.studentNo}</td>\n <td>${userObj.name}</td>\n <td>${userObj.age}</td>\n <td>${userObj.studentNo > 0}</td>\n `;\n document.getElementById('table-content').appendChild(newRow);\n}", "function TableBody() {\r\n let myElem_arr = [];\r\n for (let i = 0; i < window.user_list.length; i++) {\r\n let entries_arr = [];\r\n for (let j=0; j < window.user_list[i].length; j++){\r\n entries_arr.push(\r\n <td>{window.user_list[i][j]}</td>\r\n );\r\n }\r\n myElem_arr.push(<tr>{entries_arr}</tr>);\r\n }\r\n return myElem_arr\r\n}", "function createTbl(tx) {\n tx.executeSql('CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY AUTOINCREMENT, role BOOL NOT NULL, name VARCHAR, username VARCHAR NOT NULL, email VARCHAR NOT NULL, password VARCHAR NOT NULL, description VARCHAR)');\n}", "function getOneUserTable(data) {\n var tableData = [\"<tr><td>\" + data.id + \"</td><td>\" + data.age + \"</td><td>\" + data.name + \"</td><td>\" + data.gender + \"</td><td>\" + data.email + \"</td></tr>\"];\n tableData.unshift('<table class=\"table\"><tr><th scope=\"col\">id</th><th scope=\"col\">age</th><th scope=\"col\">name</th><th scope=\"col\">gender</th><th scope=\"col\">email</th></tr>');\n tableData.push(\"</table>\");\n return tableData.join(\"\");\n}", "function createTable (data) {\n tbody.html(\"\");\n data.forEach(function(UFO) {\n var datarow = tbody.append(\"tr\");\n Object.entries(UFO).forEach(([key, value]) => {\n var cell = datarow.append(\"td\");\n cell.text(value)\n })\n })\n}", "doBodyTable() {\n var htmlColumn = ``\n var htmlRow = ``\n \n for (var i = \"1\"; i < this.tableLinesLength; i++) {\n\n var currentline = this.tableLines[i].split(\",\");\n htmlColumn = ``\n\n for (var j = 0; j < this.tableHeadLength; j++) {\n if (currentline[j] == '') {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->uploads--entities--index#editUnit\">|PREENCHER|</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->uploads--entities--index#saveUnit change->uploads--entities--index#saveUnit blur->uploads--entities--index#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n } else {\n htmlColumn += `<td id=\"${i}\" style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}-${j}\">\n <span class=\"text-bold justify\" data-action=\"click->uploads--entities--index#editUnit\">${currentline[j]}</span>\n <input autofocus data-field=\"order\" data-action=\"keyup->uploads--entities--index#saveUnit change->uploads--entities--index#saveUnit blur->uploads--entities--index#saveUnit\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>`\n }\n }\n htmlRow += `<tr data-target=\"uploads--entities--index.lineCell-${i}\">\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\">${i}</span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n ${htmlColumn}\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <input autofocus data-field=\"order\" class=\"form-control textarea p-1 s-title-0p85rem d-none\" type=\"string\" required>\n </td>\n <td style=\"font-size:80%;\" scope=\"col\" class=\"table-10 p-1 align-middle table-success\" data-target=\"uploads--entities--index.columnCell-${i}\">\n <span class=\"text-bold\"></span>\n <button id=${i} data-action=\"click->uploads--entities--index#deleteLine\" type=\"button\" class=\"btn btn-sm btn-table editAuthor p-0\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Remover linha\"><span class=\"material-icons md-sm md-dark\">delete</span></button>\n </td>\n </tr>`\n }\n\n return htmlRow;\n }", "function createTables() {\n // sql for creating tables\n const sql_string = `\n CREATE TABLE IF NOT EXISTS users (\n id int NOT NULL AUTO_INCREMENT,\n username varchar(255) NOT NULL,\n password varchar(255) NOT NULL,\n PRIMARY KEY (id),\n CONSTRAINT UNIQ_username UNIQUE (username)\n );\n\n CREATE TABLE IF NOT EXISTS text_items (\n id int NOT NULL AUTO_INCREMENT,\n text longtext NULL,\n user_id int NULL,\n PRIMARY KEY (id),\n FOREIGN KEY (user_id) REFERENCES users(id),\n CONSTRAINT UNIQ_user_id UNIQUE (user_id)\n );\n `;\n // create connection to the database\n var con = mysql.createConnection({\n host: DATABASE_HOST,\n user: DATABASE_USER,\n password: DATABASE_PASSWORD,\n database: DATABASE_NAME,\n multipleStatements: true\n });\n\n // log if an exception occurs\n con.on('error', function() {\n con.destroy();\n console.log('an error occured');\n });\n \n // connect to the database\n con.connect(function(err) {\n if (err) throw err;\n console.log(\"Connected!\");\n // execute the sql string\n con.query(sql_string, function (err, result) {\n if (err) throw err;\n console.log(\"Tables created\");\n con.destroy();\n });\n });\n}", "function makeTable() {\n\tvar object = getArrayOfMembers(); \n\n\tvar table = '<table id=\"memberTable\" border=\"1\">';\n\ttable = table.concat(createTableHeader(object[0]));\n\ttable = table.concat(fillRows(object));\n\ttable = table.concat('</table>');\n\t\n\tvar element = document.getElementById(\"thebutton\");\n \n// alert(document.getElementById(\"memberTable\"));\n if (null != document.getElementById(\"memberTable\")) {\n var parent = document.getElementById(\"memberTable\").parentNode;\n parent.removeChild(document.getElementById(\"memberTable\"));\n }\n\telement.insertAdjacentHTML(\"afterend\", table);\n}", "addToTable() {\n let tr = document.createElement('tr')\n tr.classList.add('padding')\n\n tr.innerHTML =\n this.createCell(\"name\") +\n this.createCell(\"breed\") +\n this.createCell(\"sex\") +\n this.editButtonWithID()\n\n tableBody().appendChild(tr)\n }", "function renderUsers(users) {\r\n\tvar body = document.getElementsByTagName('body')[0];\r\n\tvar table = document.createElement('table');\r\n\r\n\ttable.setAttribute('class', 'table table-striped table-hover');\r\n\ttable.setAttribute('id', 'usersTable');\r\n\r\n\tvar thead = document.createElement('thead');\r\n\r\n\tvar thFirstName = document.createElement('th');\r\n\tthFirstName.innerHTML = \"First Name\";\r\n\tthead.appendChild(thFirstName);\r\n\r\n\tvar thLastName = document.createElement('th');\r\n\tthLastName.innerHTML = \"Last name\";\r\n\tthead.appendChild(thLastName);\r\n\r\n\ttable.appendChild(thead);\r\n\r\n\tvar tbody = document.createElement('tbody');\r\n\ttable.appendChild(tbody);\r\n\r\n\tfor (var i = 0; i < users.length; i++) {\r\n\t\tvar user = users[i];\r\n\t\tvar tr = document.createElement('tr');\r\n\r\n\t\tvar tdFirstName = document.createElement('td');\r\n\t\ttdFirstName.innerHTML = user.firstName;\r\n\t\ttr.appendChild(tdFirstName);\r\n\r\n\t\tvar tdLastName = document.createElement('td');\r\n\t\ttdLastName.innerHTML = user.lastName;\r\n\t\ttr.appendChild(tdLastName);\r\n\r\n\t\ttbody.appendChild(tr);\r\n\r\n\t}\r\n\r\n\tbody.appendChild(table);\r\n}", "function buildTableBody(data, columns, tableHeader, total = 0) {\n logger.debug('buildTableBody');\n let body = [];\n if (!tableHeader) {\n tableHeader = columns;\n }\n\n body.push(tableHeader);\n\n data.forEach(row => {\n let dataRow = [];\n columns.forEach(column => {\n const dataRowObject = {};\n dataRowObject.text = row[column].toString();\n const cond = [\n 'amount',\n 'rate',\n tableHeader[tableHeader.length - 1]\n ].includes(column);\n logger.debug(cond.toString());\n dataRowObject.alignment = dataRowAlignment(cond, column);\n logger.debug(dataRowObject.alignment);\n dataRow.push(dataRowObject);\n });\n\n body.push(dataRow);\n });\n const totalRow = tRow({ colSpan: 6 }, 5, total);\n body.push(totalRow);\n logger.debug(`Build table body => ${body}`);\n logger.debug('buildTableBody END');\n return body;\n}", "function createTR() {\n const bsInput = document.querySelector(\"#blood-sugar-level\").value;\n const comments = document.querySelector(\"#comments\").value;\n // selects the table element\n const table = document.getElementsByTagName(\"table\")[0];\n // creates new table row\n const newRow = table.insertRow(1);\n // inserts cells into row\n const cellOne = newRow.insertCell(0);\n const cellTwo = newRow.insertCell(1);\n\n // set cells to user entered data\n cellOne.innerHTML = bsInput;\n cellTwo.innerHTML = comments;\n}", "function createTable(table) {\n if (user.id == table.owner_id) {\n sittedTable = new Table(table.id,true);\n }\n}", "function createEngagementTable(data, tblBodyName) {\n var tblbody = document.getElementById(tblBodyName);\n\n for (var i = 0; i < data.length; i++) {\n var tblRows = document.createElement(\"tr\");\n\n var fullName;\n if (data[i].middle_name === null) {\n fullName = data[i].first_name + \" \" + data[i].last_name;\n } else {\n fullName = data[i].first_name + \" \" + data[i].middle_name + \" \" + data[i].last_name;\n }\n\n var link = document.createElement(\"a\");\n link.setAttribute(\"href\", data[i].url);\n link.textContent = fullName;\n\n var memberInfo = [link, data[i].total_votes, data[i].votes_with_party_pct + \" %\"];\n\n for (var j = 0; j < memberInfo.length; j++) {\n var tblCells = document.createElement(\"td\");\n tblCells.append(memberInfo[j]);\n tblRows.appendChild(tblCells);\n }\n tblbody.appendChild(tblRows);\n }\n}", "function getTable() {\n\n if (this.object) {\n var tbody = $('#gcodelist tbody');\n\n // clear table\n $(\"#gcodelist > tbody\").html(\"\");\n\n for (let i = 0; i < this.object.userData.lines.length; i++) {\n var line = this.object.userData.lines[i];\n\n if (line.args.origtext != '') {\n tbody.append('<tr><th scope=\"row\">' + (i + 1) + '</th><td>' + line.args.origtext + '</td></tr>');\n }\n }\n\n // set tableRows to the newly generated table rows\n tableRows = $('#gcodelist tbody tr');\n }\n}", "function createHeader() {\n var table = gAppState.checkId(\"dbmsTableID\", \"fsTableID\");\n\n var header = table.createTHead(); // creates empty tHead\n var row = header.insertRow(0); // inserts row into tHead\n\n var cell0 = row.insertCell(0); // inserts new cell at position 0 in the row\n var cell1 = row.insertCell(1); // inserts new cell at position 1 in the row\n var cell2 = row.insertCell(2); // inserts new cell at position 2 in the row\n\n cell0.innerHTML = \"<b>Subject</b>\"; // adds bold text\n cell1.innerHTML = \"<b>Predicate</b>\";\n cell2.innerHTML = \"<b>Object</b>\";\n}", "function createTable(json){\n var table = document.getElementById('user-results')\n\n for (var i = 0; i < json.data.length; i++){\n var row = `<tr>\n <td>${json.data[i].first_name}</td>\n <td>${json.data[i].last_name}</td>\n <td>${json.data[i].email}</td>\n </tr>`\n table.innerHTML += row\n\n\n }\n}", "function createEngagementTable(data, tblBodyName) {\n var tblbody = document.getElementById(tblBodyName);\n\n for (var i = 0; i < data.length; i++) {\n var tblRows = document.createElement(\"tr\");\n\n var fullName;\n if (data[i].middle_name === null) {\n fullName = data[i].first_name + \" \" + data[i].last_name;\n } else {\n fullName = data[i].first_name + \" \" + data[i].middle_name + \" \" + data[i].last_name;\n }\n\n var link = document.createElement(\"a\");\n link.setAttribute(\"href\", data[i].url);\n link.textContent = fullName;\n\n var memberInfo = [link, data[i].missed_votes, data[i].missed_votes_pct + \" %\"];\n\n for (var j = 0; j < memberInfo.length; j++) {\n var tblCells = document.createElement(\"td\");\n tblCells.append(memberInfo[j]);\n tblRows.appendChild(tblCells);\n }\n tblbody.appendChild(tblRows);\n }\n}", "function create_table(json) {\n\n // hard coding is cheating, mostly... make it dynamic!\n\n db.serialize( () => {\n db.run('create table if not exists '\n + 'todo ('\n + 'id numeric primary key, '\n + 'userid numeric, '\n + 'title text, '\n + 'completed text)');\n\n db.run('delete from todo'); //or drop the table first..\n\n var stmt = db.prepare('insert into todo values (?,?,?,?)');\n\n json.forEach( (item) => {\n stmt.run([item.id, item.userid, item.title, item.completed]);\n });\n\n stmt.finalize();\n\n });\n\n}", "function makeTable() {\n var queryfortable = \"Select * FROM products\";\n connection.query(queryfortable, function(error, results){\n if(error) throw error;\n var tableMaker = new Table ({\n head: [\"ID\", \"Product Name\", \"Department\", \"Price\", \"Stock\"],\n colWidths: [10,25,20,10,20]\n });\n for(var i = 0; i < results.length; i++){\n tableMaker.push(\n [results[i].item_id,\n results[i].product_name,\n results[i].department_name, \n results[i].price,\n results[i].stock_quantity]\n );\n }\n console.log(tableMaker.toString());\n firstPrompt()\n })\n }", "function createUserRow(user = {}) {\n\n if (user === null) {\n return null;\n }\n\n var userId = user.user_id;\n\n var userRow = $('<tr></tr>');\n var userIdCell = $('<td></td>').append(userId);\n var firstNameCell = $('<td></td>').append(user.first_name);\n var lastNameCell = $('<td></td>').append(user.last_name);\n var ageCell = $('<td></td>').append(user.age);\n var operationButtons = createOperationButtonCell(user);\n\n userRow.append(userIdCell, firstNameCell, lastNameCell, ageCell, operationButtons);\n\n return userRow;\n}", "function createTable(UFOdata){\n // clear table of all previous searches\n tbody.html(\"\")\n // Loop through each data entry to create a table row for each entry\n UFOdata.forEach((sighting) => {\n console.log(sighting);\n var row=tbody.append('tr');\n // Add table columns for each key value pair in each entry\n Object.values(sighting).forEach((value) =>{\n console.log(value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function printfyHead(){\n\n // create elements <table> and a <tbody>\n var table = document.getElementById(\"put\");\n var row = document.createElement(\"tr\");\n\n // put <table> in the <body>\n var cell = document.createElement(\"th\");\n var cellText = document.createTextNode(\"Website Name\");\n cell.appendChild(cellText);\n row.appendChild(cell);\n\n var cell2 = document.createElement(\"th\");\n var cellText2 = document.createTextNode(\"Result\");\n cell2.appendChild(cellText2);\n row.appendChild(cell2);\n\n //row2.appendChild(cell2);\n table.appendChild(row);\n}", "makeTableBody() {\n var rows = [];\n for (var row = 1; row <= 9; row++) {\n \n // Each row consists of array of cells\n var cells = [];\n \n // The first cell of the row is the header\n cells.push(<Cell key={row+'.'+0} isHeader={true} rowId={row} mouseLoc={this.state.highlight} onMouseEnterCell={this.onMouseEnterCell.bind(this)} onMouseLeaveCell={this.onMouseLeaveCell.bind(this)}/>)\n\n // Make the rest of the cells of the row\n for (var col = 1; col <= 9; col++) {\n cells.push(<Cell key={row+'.'+col} rowId={row} colId={col} mouseLoc={this.state.highlight} onMouseEnterCell={this.onMouseEnterCell.bind(this)} onMouseLeaveCell={this.onMouseLeaveCell.bind(this)}/>)\n }\n\n rows.push(<tr key={\"row\"+row}>{cells}</tr>);\n }\n\n return <tbody>{rows}</tbody>;\n }", "function insertTableBody(tableNode) {\n var tableBody = document.createElement('tbody');\n tableBody.setAttribute('id', 'playlist_table');\n \n tableNode.appendChild(tableBody);\n return tableNode;\n}", "function renderUsers() {\n const tbody = document.querySelector('tbody');\n tbody.innerHTML = ''; //Clear whatever inner html is there.\n const props = Object.keys(model.props); // [firstName, lastName, dateOFBirth ]\n Object.values(model.users).forEach(user => {\n const tr = document.createElement('tr'); //TODO read up on create element in MDN\n props.forEach(prop => {\n const td = document.createElement('td');\n td.innerHTML = user[prop];\n tr.appendChild(td)\n });\n tbody.appendChild(tr);\n });\n}", "function default_table(){\n tableData.forEach((sightings) => {\n var record = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var data_value = record.append(\"td\");\n data_value.text(value);\n });\n });\n}", "function initTableData() {\n //get all data to local variable\n getData();\n\n if (!localDb.length) return;\n\n const fragment = document.createDocumentFragment();\n\n localDb.forEach((item) => {\n const row = createTableRow(item);\n fragment.appendChild(row);\n });\n\n tBody.appendChild(fragment);\n }", "function makeTable(item) {\n // Making a new row within tbody.\n var row = tbody.append(\"tr\");\n \n // Appedning each and every data within a row.\n row.append(\"td\").text(item.datetime);\n row.append(\"td\").text(item.city);\n row.append(\"td\").text(item.state);\n row.append(\"td\").text(item.country);\n row.append(\"td\").text(item.shape);\n row.append(\"td\").text(item.durationMinutes);\n row.append(\"td\").text(item.comments); \n}", "async createTables() {\n /** Loop through each auto form... */\n for ( let i = 0, iMax = this.autoforms().length; i < iMax; i++ ) {\n /** Create user table if it doesn't already exist */\n await ezobjects.createTable(this.autoforms()[i].configRecord(), this.db());\n }\n\n /** Create user table if it doesn't already exist */\n await ezobjects.createTable(models.configUser, this.db());\n }", "function buildTableBody(data) {\r\n let rows = '';\r\n\r\n for (let i = 1; i < data.length - 1; i++) {\r\n rows += `<tr>`;\r\n rows += `<td></td>`;\r\n\r\n for (let j = 0; j < data[i].length; j++) {\r\n rows += `<td>${data[i][j]}</td>`;\r\n }\r\n\r\n rows += `</tr>`;\r\n }\r\n\r\n return rows;\r\n}", "function createRowforwatherInfoTable(tableBodyId,name,Description) {\n\n var row = tableBodyId.insertRow();\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n cell2.innerHTML = name;\n cell3.innerHTML = Description;\n createCheckBox(cell1);\n}", "function createTable(arr)\n{\n arr.forEach(function(ele){\n let tr = document.createElement(\"tr\");\n \n for(key in ele)\n {\n let td = document.createElement(\"td\");\n td.textContent = ele[key];\n tr.appendChild(td);\n }\n \n var tBody = document.getElementById(\"tBody\");\n tBody.appendChild(tr)\n })\n}", "appendInvoiceModalTableBody () {\n var $body = `<tbody></tbody>`;\n $(\"#receipt-dt-modal .modal-body .table\").append($body);\n }", "function createTableHead() {\n //let tableBody = document.getElementsByTagName('tbody');\n let thead = document.querySelector('thead');\n\n let headTR = document.createElement('tr');\n thead.appendChild(headTR);\n\n let tHeadName = document.createElement('th');\n tHeadName.innerText = 'Store Name: ';\n headTR.appendChild(tHeadName);\n\n for (let i = 0; i < operatingHours.length; i++) {\n //let tHeadHour = document.createElement('th');\n let hourTD = document.createElement('td');\n hourTD.innerText = operatingHours[i];\n headTR.appendChild(hourTD);\n\n }\n\n let tHeadTotal = document.createElement('td');\n tHeadTotal.innerText = 'Site Totals';\n headTR.appendChild(tHeadTotal);\n\n\n}", "function createTable() {\n const tableBody = document.querySelector('.table-body');\n for (const key in keyCodes) {\n const row = document.createElement('tr');\n row.innerHTML += `<td>${key}</td>`;\n row.innerHTML += `<td>${keyCodes[key]}</td>`;\n tableBody.appendChild(row);\n }\n}", "function settable(title,fname,lname,Email,numOfAppointments,mobile,address)\n{\n t.row.add( [\n title,\n fname,\n lname,\n Email,\n numOfAppointments,\n mobile,\n address\n ] ).draw( false );\n \n\n}", "function renderUsers(objUsers) {\r\n var table = document.getElementById(\"tblUsers\");\r\n\r\n while (table.rows.length > 1) {\r\n table.deleteRow(1)\r\n }\r\n for (var objUser in objUsers.data) {\r\n var row = table.insertRow(-1);\r\n row.id = \"user\"+objUsers.data[objUser].id;\r\n var cell1 = row.insertCell(0);\r\n var cell2 = row.insertCell(1);\r\n var cell3 = row.insertCell(2);\r\n var cell4 = row.insertCell(3);\r\n var cell5 = row.insertCell(4);\r\n cell1.innerHTML = objUsers.data[objUser].id;\r\n cell2.innerHTML = objUsers.data[objUser].email;\r\n cell3.innerHTML = objUsers.data[objUser].first_name;\r\n cell4.innerHTML = objUsers.data[objUser].last_name;\r\n cell5.innerHTML = \"<img src='\" + objUsers.data[objUser].avatar + \"' alt='avatar'>\";\r\n }\r\n}", "function loadTable(data){\n\n //create element tbody and append to table\n let tbody = document.createElement(\"tbody\");\n tbody.setAttribute(\"id\",\"tablebody\");\n \n //for each value of data create rows and insert tds with required values in innerHTML and append to tbody\n data.forEach((value)=>{\n\n let tr = document.createElement(\"tr\");\n\n let tdID = document.createElement(\"td\");\n tdID.innerHTML = value.id;\n\n let tdName = document.createElement(\"td\");\n tdName.innerHTML = value.name;\n\n let tdEmail = document.createElement(\"td\");\n tdEmail.innerHTML = value.email;\n\n tr.append(tdID,tdName,tdEmail);\n tbody.append(tr);\n })\n\n table.append(tbody);\n}", "function appendTable(input1, input2) {\n\tlet usersAnswer = document.getElementsByClassName(\"usersAnswer\")[0];\n\tlet table = document.createElement(\"TABLE\");\n\ttable.setAttribute(\"id\", \"answersTable\");\n\tusersAnswer.appendChild(table);\n\tlet row = table.insertRow(0);\n\tlet cell = row.insertCell(0);\n\tlet column = row.insertCell(1);\n\tcell.innerHTML = \"<b>Firstname</b>\";\n\tcolumn.innerHTML = \"<b>Lastname</b>\";\n\tlet row1 = table.insertRow(1);\n\tlet cell1 = row1.insertCell(0);\n\tlet column1 = row1.insertCell(1);\n\tcell1.innerHTML = `${input1}`;\n\tcolumn1.innerHTML = `${input2}`;\n}", "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "function newTable(ufoFilter) {\n\n\ttbody.html(\"\");\n\tufoFilter.forEach((ufoEntry) => {\n\t\tvar row = tbody.append(\"tr\");\n\t\tObject.entries(ufoEntry).forEach(([key, value]) => {\n\t\t\tvar cell = tbody.append(\"td\");\n\t\t\tcell.text(value);\n\t\t});\n\t});\n}", "function createHeader (){\n\n // Create the header raw\n // create raw\n var headRow = document.createElement('tr');\n table.appendChild(headRow);\n //create tds\n var firstTd;\n for (var i = 0; i < tableHeads.length ; i++){\n firstTd = document.createElement('td');\n firstTd.textContent= tableHeads[i];\n headRow.appendChild(firstTd);\n }\n}", "makeUserTable() {\n let infoSelected = this.checkSelected.map(checkBoxValue => this.checkData.find(checkBox => checkBox.value === checkBoxValue).text); //Get the text key of the checkbox selected to used on titles of the table\n this.tableTitlesMod = [\"Name\", ...infoSelected];\n this.tableKeysMod = [\"first_name\" , ...this.checkSelected];\n }", "function makeTableHead()\n{\n var table = document.getElementById(\"record\");\n var header = table.createTHead();\n var row = header.insertRow(0);\n var cell1 = row.insertCell(0);\n var cell2 = row.insertCell(1);\n var cell3 = row.insertCell(2);\n var cell4 = row.insertCell(3);\n var cell5 = row.insertCell(4);\n \n cell1.innerHTML = \"<b>MAC</b>\";\n cell2.innerHTML = \"<b>IP</b>\";\n cell3.innerHTML = \"<b>TIME</b>\";\n cell4.innerHTML = \"<b>LONG</b>\";\n cell5.innerHTML = \"<b>LAT</b>\";\n}", "function run() {\n var html = createTable();\n\n insertHTML('tabledata', html);\n}", "function create_table(data){\n data.forEach(function(d){\n\n //create row\n var row = tbody.append(\"tr\");\n \n //unpack each row element into table\n Object.entries(d).forEach(function([key,value]){\n //append a cell to the row for each value\n var cell = tbody.append(\"td\");\n //set cell value\n cell.text(value);\n });\n \n });\n}", "function tableInit() {\n let body = document.body;\n let table = document.createElement('table');\n table.id = 'BookList';\n body.appendChild(table);\n\n let tbody = document.createElement('tbody');\n tbody.id = 'TableBody';\n table.appendChild(tbody);\n\n let caption = document.createElement('caption');\n caption.appendChild(document.createTextNode('My Book List'));\n table.appendChild(caption);\n\n let thead = document.createElement('thead');\n table.appendChild(thead);\n\n let tr = document.createElement('tr');\n thead.appendChild(tr);\n\n let thArray = ['No.', 'Title', 'Author', 'Page Count', 'Read On'];\n thArray.forEach((text) => {\n let th = document.createElement('th');\n th.appendChild(document.createTextNode(text));\n tr.appendChild(th);\n });\n\n createTable();\n}", "function buildTable(table){\n\n // loop through data\n table.forEach((item) => {\n\n // append rows\n let row = tbody.append(\"tr\");\n\n // iterate through keys and values\n Object.entries(item).forEach(([key, value]) => {\n\n // append cells \n let cell = row.append(\"td\");\n\n // add text value to each cell\n cell.text(value);\n });\n });\n}", "function buildAddUserToBillTableRow(user, payerClass) {\n const userDiv = $('<div>').addClass(payerClass);\n const firstNameElem = $('<tr><td>' + 'First name: ' + user.firstName + '</tr></td>').attr('firstName', user.firstName);\n const lastNameElem = $('<tr><td>' + 'Last name: ' + user.lastName + '</tr></td>').attr('last-name', user.lastName);\n const userEmailElem = $('<tr><td>' + 'Email: ' + user.email + '</tr></td>').attr('email', user.email);\n let amountOwedElem;\n if (user.amountOwed) {\n amountOwedElem = $('<tr><td>' + 'Amount owed: $' + user.amountOwed + '</tr></td>').attr('amountOwed', user.amountOwed);\n } else {\n amountOwedElem = $('');\n }\n var line = $('<div>').append('<hr>');\n\n userDiv.append(firstNameElem, lastNameElem, userEmailElem, amountOwedElem, line);\n\n $('#emails > tbody').append(userDiv);\n }", "function constructTable() {\n var t = $('#accounts tbody', selectionPanel);\n t.empty();\n for (var idx = 0; idx < accountsArray.length; idx++) {\n if (editing)\n t.append(constructEditableRow(accountsArray[idx]));\n else\n t.append(constructSelectableRow(idx, accountsArray[idx]));\n }\n if (editing)\n $('<tr><td colspan=\"4\"><a href=\"#\" class=\"account add\"/></td></tr>').on('click', addAccount).appendTo(t);\n }", "function populateTable() {\n\n // Empty content string\n var tableContent = '';\n\n // jQuery AJAX call for JSON\n $.getJSON( '/users/userlist', function( data ) {\n\n // For each item in our JSON, add a table row and cells to the content string\n $.each(data, function(){\n \n // Stick our user data array into a userlist variable in the global object\n \t\tuserListData = data;\n \n tableContent += '<tr>';\n tableContent += '<td><a href=\"#\" class=\"linkshowuser\" rel=\"' + this.Goal + '\">' + this.Goal + '</a></td>';\n tableContent += '<td>' + this.Step1 + '</td>';\n tableContent += '<td><a href=\"#\" class=\"linkdeleteuser\" rel=\"' + this._id + '\">delete</a></td>';\n tableContent += '</tr>';\n });\n\n // Inject the whole content string into our existing HTML table\n $('#userList table tbody').html(tableContent);\n });\n}", "function sendTable() {\n var task = new Task(\"createTable\");\n task.owner_id = user.id;\n var jsonStringTask = JSON.stringify(task);\n webSocket.send(jsonStringTask);\n}", "function crearTablaUsuario(){\n db.transaction(function (tx) {\n tx.executeSql('CREATE TABLE usuario (k_codusuario unique, n_usuario, o_cedula, n_nombre, n_apellido, o_correo, o_rol, contrasena)');\n }, function (error) {\n console.log('transaction error: ' + error.message);\n }, function () {\n console.log('transaction creada ok');\n });\n}", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function generateTable(tablename) {\r\n let table = document.getElementById(tablename);\r\n for (let i = 0; i < items.length; i++) {\r\n let row = table.insertRow();\r\n let element = items[i];\r\n for (key in element) {\r\n let cell = row.insertCell();\r\n let text = document.createTextNode(element[key]);\r\n cell.appendChild(text);\r\n }\r\n }\r\n}", "function appendTable(dataToRender){\n tabelBody.html(\"\")\n dataToRender.forEach(ufo => {\n var newRow = tabelBody.append(\"tr\");\n Object.entries(ufo).forEach(([key,value]) => {\n var cell = newRow.append(\"td\");\n cell.text(value)\n });\n });\n}", "function createTable(tableData) {\n try{var old = document.getElementById('table')\n old.parentNode.removeChild(old)\n }\n catch{}\n finally{\n var table = document.createElement('table');\n table.setAttribute('id', 'table');\n var tableBody = document.createElement('tbody');\n tableData.forEach(function(rowData) {\n var row = document.createElement('tr');\n rowData.forEach(function(cellData) {\n var cell = document.createElement('td');\n cell.appendChild(document.createTextNode(cellData));\n row.appendChild(cell);\n });\n tableBody.appendChild(row);\n });\n table.appendChild(tableBody);\n document.body.appendChild(table);\n \n}\n}", "function buildTable(ufoInfo) {\n // First, clear out any existing data\n tbody.html(\"\");\n\n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n ufoInfo.forEach((ufoSighting) => {\n let row = tbody.append('tr');\n\n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.entries(ufoSighting).forEach(([key, value]) => { \n let tableBody = row.append('td');\n tableBody.text(value);\n });\n });\n}", "function addLine(dataUser){\n \n console.log(dataUser);\n \n var tr = document.createElement('tr');\n \n tr.innerHTML = `\n <td><img src=\"dist/img/user1-128x128.jpg\" alt=\"User Image\" class=\"img-circle img-sm\"></td>\n <td>${dataUser.name}</td>\n <td>${dataUser.email}</td>\n <td>Sim</td>\n <td>02/04/2018</td>\n <td>\n <button type=\"button\" class=\"btn btn-primary btn-xs btn-flat\">Editar</button>\n <button type=\"button\" class=\"btn btn-danger btn-xs btn-flat\">Excluir</button>\n </td>\n `;\n \n document.getElementById('table-users').appendChild(tr);\n \n}", "function prepareTableBody( rack )\n {\n var rows = rack.table;\n var caption = rack.caption;\n var columns = rack.columns;\n var widthPercent = rack.widthPercent || 100;\n var columnsWithTriangleDecoration = rack.columnsWithTriangleDecoration || {};\n var firstCellIncrease = rack.firstCellIncrease || 6;\n\n // //\\\\ composing rows\n var captions = [];\n var fieldNames = [];\n columns.forEach( function( column ) {\n var fieldName = Object.keys( column )[0];\n var fieldHeader = column[ fieldName ];\n captions.push( fieldHeader.caption );\n fieldNames.push( fieldName );\n });\n\n\n // //\\\\ removes meta-structure from rows\n var metaRows = [];\n //this makes rows \"flat\" key-value-JS-objects\n //places meta-structure into metaRows\n //very slow?\n var newBody = rows.map( function( row, ix ) {\n var isArr = Array.isArray(row);\n metaRows[ix] = isArr ? row[0] : {};\n var trueRow = isArr ? row[1] : row;\n return fieldNames.map( function( fieldName ) {\n return trueRow[ fieldName ];\n });\n });\n // \\\\// removes meta-structure from rows\n\n //.attaches captions on top of all rows\n var body = [captions].concat( newBody );\n metaRows = [{}].concat( metaRows );\n //:table row layout\n var decorsInRaw = 3;\n\n var rowsCount = body.length;\n var rowCellsCount = body[0].length;\n var decorationWidth = 2;\n var rowCellWidth = ( \n 100 -\n nheap.reportViewConf.pageMargins[3]*\n 0.20 -\n firstCellIncrease -\n decorsInRaw * decorationWidth ) / rowCellsCount;\n rowCellWidth *= widthPercent/100;\n\n var widths = [];\n\n\n //:spawning body\n var newBody = [];\n var num2commasStr = methods.putCommasToBigNumbers;\n body.forEach( function( row, ix ) {\n newBody[ ix ] = [];\n\n row.forEach( function( cell, cix ) {\n\n //---------------------------------\n // //\\\\ cuts extra digits after \".\"\n //---------------------------------\n if( typeof cell === 'number' ) {\n var cellNumber = cell;\n //cell = cell.toFixed(2);\n cell = num2commasStr( cell, 2);\n }\n //---------------------------------\n // \\\\// cuts extra digits after \".\"\n //---------------------------------\n\n if( ix === 0 ) {\n var newCell = {\n text:cell,\n //format: left,top,right,bottom:\n border: [false, false, false, false],\n color: '#999'\n }\n } else if( ix === rowsCount-1 ) {\n if( cix === 0 || cix === row.length - 1 ) {\n var newCell = { text:cell, border: [false, false, false, false] }\n } else {\n var newCell = { text:cell, border: [true, true, true, false] }\n }\n } else {\n if( cix === 0 || cix === row.length - 1 ) {\n var newCell = { text:cell, border: [false, true, false, true] };\n } else {\n var newCell = { text:cell, border: [true, true, true, true] };\n }\n }\n if( cix === 0 ) {\n newCell.alignment = 'left';\n } else {\n newCell.alignment = 'right';\n }\n if( metaRows[ix].bold ) {\n newCell.bold = true;\n newCell.fillColor = '#eee';\n }\n\n newBody[ ix ].push( newCell );\n if( ix === 0 ) {\n widths.push( rowCellWidth );\n }\n if( columnsWithTriangleDecoration[ cix+'' ] ) {\n newBody[ ix ][ newBody[ ix ].length-1 ].border[2] = false;\n if( ix === 0 ) {\n newCell = {\n text : \"\"\n };\n } else {\n newCell = {\n margin : [0,5.5,0,0],\n width: 4\n };\n if( cellNumber===0 ) {\n ////makes an extra cell empty\n newCell.text = '';\n } else {\n ////in an extra cell,\n ////red/green triangles which indicate loss/gain\n var wImg = cellNumber > 0 ? 'green-triangle' : 'red-triangle';\n newCell.image = imagesRack.loadedImages[ wImg ].dataURI;\n newCell.margin = cellNumber > 0 ? [0,6.5,0,0] : [0,7,0,0];\n }\n }\n newCell.border = ix === 0 ?\n [false, false, false, false] :\n ( cix === row.length - 1 ?\n [false, true, false, false] :\n [false, true, true, false] );\n\n newBody[ ix ].push( newCell );\n if( ix === 0 ) {\n widths.push( decorationWidth );\n }\n } else {\n if( ix === 0 ) {\n widths[ widths.length-1 ] += decorationWidth;\n }\n }\n });\n });\n widths[0] += firstCellIncrease;\n widths = widths.map( function( width ) {\n return width.toFixed(2) + '%';\n });\n return { caption:caption, body:newBody, widths:widths };\n }", "function table_Build(data) {\n tableBody.html(\"\");\n data.forEach((row) => {\n const new_row = tableBody.append(\"tr\");\n \n Object.values(row).forEach((value) => {\n let dp = new_row.append(\"td\");\n dp.text(value);\n }\n );\n });\n}", "function buildTableBody(data, columns) {\n var body = [];\n\n body.push(columns);\n\n data.forEach(function(row) {\n var dataRow = [];\n\n columns.forEach(function(column) {\n dataRow.push(row[column].toString());\n })\n\n body.push(dataRow);\n });\n\n return body;\n}", "function tableInfo(ufoInfo) {\n tbody.html(\"\");\n ufoInfo.forEach((ufoSighting) => {\n let row = tbody.append('tr');\n Object.entries(ufoSighting).forEach(([key, value]) => { \n let tableBody = row.append('td');\n tableBody.text(value);\n }); \n });\n}", "function updateTable() {\n var jsonData = JSON.parse(localStorage.getItem(\"users\"));\n\n table_body.innerHTML = \"\";\n\n return jsonData.forEach(obj => {\n \n let tr = document.createElement('tr');\n tr.setAttribute('id', obj.userID);\n\n tr.innerHTML = `\n <td>${obj.firstname}</td>\n <td>${obj.surname}</td>\n <td>${obj.age}</td>\n <td>${obj.level}</td>\n <td>${obj.club} <span class=\"tab_span\">x</span></td>\n `\n table_body.appendChild(tr);\n\n form_block.style.display = \"flex\";\n })\n}", "function createTable() {\n rethink\n .db(\"test\")\n .tableCreate(\"authors\")\n .run(connection, (err, result) => {\n if (err) throw err;\n console.log(\"Table Creation results:\");\n console.log(JSON.stringify(result, null, 2));\n insertData();\n });\n}", "function buildTable(data) {\r\n tbody.html(\"\");\r\n//next loop through each object in data and append a row and cells for each value in the row\r\ndata.forEach((dataRow)) => {\r\n //append a row to table body\r\n let row=tbody.append(\"tr\");\r\n //Loop through each field in dataRow and add each value as a table cell (td)\r\n Object.values(dataRow).forEach((val)=> {\r\n let cell = row.append(\"td\");\r\n cell.text(val);\r\n }\r\n );\r\n}", "function createTable(source) {\n // <table> tag\n var table = \"<table class=\\\"table table-striped table-bordered\\\">\";\n \n // table header start\n table += \"<thead>\";\n table += \"<tr>\";\n // Create header\n Object.entries(source[0]).forEach(function([key, value]) {\n table += \"<th>\";\n table += key;\n table += \"</th>\";\n });\n\n // table header close\n table += \"</tr>\";\n table += \"</thead>\";\n\n // Create body\n table += \"<tbody>\";\n\n // Create rows\n source.forEach(function(ev) {\n table += \"<tr>\";\n Object.entries(ev).forEach(function([key, value]) {\n table += \"<td>\";\n table += value;\n table += \"</td>\";\n });\n table += \"</tr>\";\n });\n // </table> tag\n table += \"</tbody>\"\n table += \"</table>\"\n\n return table;\n}", "async create() {\n await this.db.schema.createTable(this.name, colGen => {\n for (const name in this.columns) {\n if (this.columns.hasOwnProperty(name)) {\n const element = this.columns[name];\n if(typeof element === \"object\")\n tableColumnGen(this, colGen, element.type, name, element);\n else\n tableColumnGen(this, colGen, element, name);\n }\n }\n });\n\n return;\n }", "function generateTable() {\n let body = table.createTBody();\n var creatureIndex = 0;\n \n for (let creature of creatures) {\n\n if (creature.visible === true) {\n\n let row = body.insertRow();\n\n for (propertyKey in creature) {\n\n if (propertyKey !== 'visible') {\n\n let cell = row.insertCell();\n let text = document.createTextNode(creature[propertyKey]);\n let textHolder = document.createElement(\"DIV\");\n textHolder.setAttribute(\"class\", \"d-block textHolder text-capitalize\");\n let editInput = document.createElement(\"INPUT\");\n editInput.setAttribute(\"type\", \"text\");\n editInput.setAttribute(\"value\", creature[propertyKey]);\n editInput.setAttribute(\"class\", \"d-none editInput \" + propertyKey);\n editInput.dataset.title = propertyKey;\n textHolder.appendChild(text);\n cell.appendChild(textHolder);\n cell.appendChild(editInput);\n }\n }\n\n let cell = row.insertCell();\n for (action of actions) {\n let btn = document.createElement('input');\n btn.type = \"button\";\n btn.className = \"btn btn-secondary\";\n btn.value = action.name;\n btn.dataset.index = creatureIndex;\n btn.onclick = action.action;\n cell.appendChild(btn);\n }\n }\n creatureIndex++;\n }\n }", "function generateTableHead(tablename) {\r\n let table = document.getElementById(tablename);\r\n let row = table.insertRow();\r\n row.insertCell(0).innerHTML = \"Courses\";\r\n for (let i = 0; i < courses.length; i++) {\r\n let cell = row.insertCell(i + 1);\r\n cell.colSpan = 2;\r\n cell.innerHTML = courses[i];\r\n }\r\n}", "function generateTableHead(tablename) {\r\n let table = document.getElementById(tablename);\r\n let row = table.insertRow();\r\n row.insertCell(0).innerHTML = \"Courses\";\r\n for (let i = 0; i < courses.length; i++) {\r\n let cell = row.insertCell(i + 1);\r\n cell.colSpan = 2;\r\n cell.innerHTML = courses[i];\r\n }\r\n}", "function createTable(id,building,room,floor,readonly){\n return \"<table border=\\\"0 \\\">\"\n + \"<tr>\"\n + \" <th>Ort</th>\"\n + createRow(\"Id\",\"ID\",id,\"readonly\",\"number\")\n + createRow(\"Gebäude\",\"BUILDING\",building,readonly,\"number\")\n + createRow(\"Raum\",\"ROOM\",room,readonly,\"number\")\n + createRow(\"Flur\",\"FLOOR\",floor,readonly,\"number\")+\"</table>\";\n }" ]
[ "0.7115923", "0.7095937", "0.6854381", "0.67715114", "0.6749804", "0.6730525", "0.67013925", "0.66728157", "0.6655575", "0.6581669", "0.65797275", "0.65745014", "0.6569324", "0.64977044", "0.6431798", "0.64284444", "0.6397294", "0.637533", "0.6367064", "0.6367064", "0.63423944", "0.6321885", "0.6273201", "0.6262218", "0.62521005", "0.6241922", "0.6241185", "0.6222414", "0.62129897", "0.61891353", "0.61820424", "0.6136401", "0.6111852", "0.607528", "0.6063183", "0.60606486", "0.60470617", "0.6028781", "0.6025214", "0.5999425", "0.5994813", "0.5986694", "0.59812427", "0.59749615", "0.59735954", "0.59613425", "0.595903", "0.5952401", "0.5950735", "0.5940778", "0.59368724", "0.59303993", "0.5924311", "0.59079236", "0.5905527", "0.5900069", "0.58924073", "0.58889616", "0.5881046", "0.5872706", "0.5865683", "0.58601445", "0.58450824", "0.5839753", "0.58318996", "0.5823718", "0.5819276", "0.5815102", "0.58052236", "0.5804187", "0.580248", "0.5800011", "0.57990724", "0.5783115", "0.5781282", "0.5780776", "0.57787687", "0.57740444", "0.5770559", "0.5768895", "0.5768715", "0.57641226", "0.57641226", "0.5763685", "0.57596964", "0.5756747", "0.5756023", "0.5752401", "0.57515466", "0.57514787", "0.5751224", "0.57502615", "0.5746706", "0.57438344", "0.5736631", "0.5735598", "0.5729121", "0.57245386", "0.57245386", "0.5722228" ]
0.6194941
29
Wrap this code in function
function askUserForName(){ var userName = prompt('Please Enter Your Name '); alert('Hello ' + userName); return userName; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function miFuncion (){}", "function fn() {\n\t\t }", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function sdk_wrap(fn) {\n return wrap(fn)();\n}", "function __func(){}", "function wrapfunction(fn,message){if(typeof fn!=='function'){throw new TypeError('argument fn must be a function');}return fn;}", "function bannerWrapper(f) {\n return function () {\n console.log(\">>>>>>>>>>>>>>>>>>>\")\n if (f) f()\n console.log(\"<<<<<<<<<<<<<<<<<<<\")\n }\n}", "function fuctionPanier(){\n\n}", "function wa(){}", "private public function m246() {}", "function wrap(fn) {\n return helpers.wrap(fn)();\n}", "function _____SHARED_functions_____(){}", "function makeFunctionWrapper(original, functionName) {\n //log(\"wrap fn: \" + functionName);\n var f = original[functionName];\n return function() {\n //log(\"call: \" + functionName);\n var result = f.apply(original, arguments);\n return result;\n };\n }", "function wrap$1(fn) {\n\t return wrap$2(fn)();\n\t}", "function fuction() {\n\n}", "function Helper() {}", "function TMP(){return;}", "function TMP(){return;}", "function lalalala() {\n\n}", "function ea(){}", "function miFuncion(){\n\n}", "function wrapper(name) {\n return (new Function([\n 'return function ' + name + '() {',\n ' return this._' + name,\n '}'\n ].join('\\n')))()\n }", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function wrapper(name) {\n\t return (new Function([\n\t 'return function '+name+'() {',\n\t ' return this._'+name,\n\t '}'\n\t ].join('\\n')))()\n\t}", "custom(fn) {\r\n\t\treturn this.push('fn', [...arguments]);\r\n\t}", "function getMakeActive(){\n /*void -> function*/\n return function(){makeActive(this);}\n}", "function getMakeActive(){\n /*void -> function*/\n return function(){makeActive(this);}\n}", "protected internal function m252() {}", "function oi(){}", "function wrap(oembed){\r\n\t \t\t\tcallback(oembed, elem, options);\r\n\t \t\t}", "private internal function m248() {}", "function wrap(fn) {\r\n // tslint:disable-next-line: no-unsafe-any\r\n Object(_helpers__WEBPACK_IMPORTED_MODULE_2__[\"wrap\"])(fn)();\r\n}", "function Interfaz(){}", "function fm(){}", "function wrap(oembed){\r\n \t\t\tcallback(oembed, elem, options);\r\n \t\t}", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function wrap(fn) {\n return Object(_helpers__WEBPACK_IMPORTED_MODULE_3__[\"wrap\"])(fn)(); // tslint:disable-line:no-unsafe-any\n}", "saludar(fn){//recepcion de funcion\n var {nombre, apellido}=this //desgrloce de variables\n console.log(`Hola me llamo ${nombre} ${apellido}`)\n if(fn){\n fn(nombre, apellido, true)\n }\n }", "function fun() { }", "function Ha(){}", "transient protected internal function m189() {}", "function wrap(fn) {\n return function(cb) { fn.call(null, cb.bind(null, null)); };\n }", "function wrapper(name) {\n return (new Function([\n 'return function '+name+'() {',\n ' return this._'+name,\n '}'\n ].join('\\n')))()\n}", "function customFunction() {\n //Statements\n }", "function y(){f.call(this)}", "function y(){f.call(this)}", "function y(){f.call(this)}", "function makeFunctionWrapper(original, functionName) {\n //log(\"wrap fn: \" + functionName);\n var f = original[functionName];\n return function() {\n //log(\"call: \" + functionName);\n var result = f.apply(original, arguments);\n return result;\n };\n}", "apply () {}", "function g(){return function(){}}", "function exampleFunctionToRun(){\n\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function wrap(func, wrapper) {\n return partial(wrapper, func);\n }", "function FunctionUtils() {}", "function Scdr() {\r\n}", "function func(){\r\n\r\n}", "function generateCode(){\n\n}", "function Expt() {\r\n}", "function makeBigger() {\n\n}", "function TrackByFunction() { }", "function TrackByFunction() { }", "function Yielder() {}", "function customHandling() { }", "function v(){return function(){}}", "function funcionPorDefinicion(){\n //Body\n }", "function nonewFun() {}", "transient final protected internal function m174() {}", "function Alerter() {}", "function justInvoke(fn){\n return fn()\n}//justInvoke", "createWrapper() {\n return false;\n }", "function doStuff() {}", "function doOtherStuff() {}", "hacky(){\n return\n }", "wrap(fn) {\n if (!this.active) {\n return fn;\n }\n const namespace = this.contextManager;\n return namespace.bind(fn);\n }", "static private protected internal function m118() {}", "function redactInfo (obj) {\n \n}// CODE HERE", "function innerFunction() {\n console.log('Regular function inside method:', this);\n }", "function wrapfunction(fn, message) {\n\t if (typeof fn !== 'function') {\n\t throw new TypeError('argument fn must be a function')\n\t }\n\n\t return fn\n\t}", "function imprimir4(fn){\n\n\t//Ejecutamos la funcion anonima\n\tfn();\n\n}", "function wrapTaskFunction(fn, ctx) {\n return fn.call(ctx, () => ({\n /* ??? in which situation does this */\n }));\n}", "function execFunJs($this,func){\n\tlet trParent = $($this).parent().parent().parent().prev();\n\tf_color_fila(trParent[0],3,function(){\n\t\teval(func);\n\t});\n\n}", "transient private internal function m185() {}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "function a(fn) { fn()}", "static private internal function m121() {}" ]
[ "0.6362553", "0.63012534", "0.627982", "0.627982", "0.627982", "0.61530066", "0.6066746", "0.6057073", "0.60282576", "0.6016722", "0.6005612", "0.5921636", "0.5906515", "0.58965397", "0.58906937", "0.5886585", "0.5875306", "0.5861079", "0.5855512", "0.5855512", "0.57942814", "0.5724761", "0.5712238", "0.56907606", "0.567392", "0.567392", "0.567392", "0.567392", "0.56596637", "0.5648844", "0.563449", "0.563449", "0.56335497", "0.5629297", "0.5617141", "0.5615299", "0.56120807", "0.56029725", "0.55937064", "0.55718005", "0.5566564", "0.5566564", "0.5566564", "0.5562712", "0.5556123", "0.55537224", "0.55358475", "0.55344766", "0.55290157", "0.55251557", "0.55027044", "0.549574", "0.549574", "0.549574", "0.5487386", "0.54850614", "0.54842544", "0.5476889", "0.547342", "0.547342", "0.547342", "0.547342", "0.547342", "0.547342", "0.547342", "0.547342", "0.547342", "0.5461074", "0.54594535", "0.5459094", "0.54550683", "0.54540807", "0.5453596", "0.5436155", "0.5436155", "0.5432498", "0.54284483", "0.54279006", "0.54229337", "0.5419585", "0.5412356", "0.5407786", "0.54023474", "0.54001516", "0.5396066", "0.5391069", "0.5390067", "0.53798777", "0.5377206", "0.5377043", "0.53740054", "0.537219", "0.5368109", "0.5367111", "0.53532434", "0.5353184", "0.53523105", "0.53523105", "0.53523105", "0.5352177", "0.53518456" ]
0.0
-1
Item owner gets money. Item transfer to \to_cont
function sell_item_transfer(to_cont, item, cost_adjustment) { return $q.all([ change_gold(item._2o.container(), item.cost*cost_adjustment), put_item(to_cont, item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function buy_item(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(to_cont, -1*(item.cost*cost_adjustment)),\n put_item(to_cont, item)\n ]);\n }", "function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}", "function money() {\n new Vivus('money', {\n duration: 250,\n animTimingFunction: Vivus.EASEOUT,\n type: 'oneByOne'\n });\n }", "function money() {\n let commands = {\n atm: 'wallet',\n purse: 'wallet',\n wallet(target, room, user) {\n if (!this.canBroadcast()) return;\n Economy.get((target || user.userid), function(amount) {\n let currency = Wulu.Economy.currency_name;\n if (amount !== 1) currency += 's';\n this.sendReplyBox(`${target || user.name} has ${amount} ${currency}.`);\n room.update();\n }.bind(this));\n },\n\n 'generatemoney': 'givemoney',\n givemoney(target, room, user) {\n if (!user.can('givemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/givemoney [user], [amount] - Give a user a certain amount of money.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.give(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was given ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has given you ${amount} ${currency}. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n takemoney(target, room, user) {\n if (!user.can('takemoney')) return false;\n if (!target || target.indexOf(',') < 0) return this.sendReply('/takemoney [user], [amount] - Take a certain amount of money from a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${this.targetUsername} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n Economy.take(this.targetUsername, amount, function(total) {\n let cash = total !== 1 ? currency_name + 's' : currency_name;\n this.sendReply(`${this.targetUsername} was losted ${amount} ${currency}. This user now has ${total} ${cash}.`);\n Users.get(this.targetUsername).send(`${user.name} has taken ${amount} ${currency} from you. You now have ${total} ${cash}.`);\n }.bind(this));\n },\n\n transfer: 'transfermoney',\n transfermoney(target, room, user) {\n if (!target || target.indexOf(',') < 0) return this.sendReply('/transfer [user], [amount] - Transfer a certain amount of money to a user.');\n\n let parts = target.split(',');\n this.splitTarget(parts[0]);\n let amount = Number(parts[1].trim());\n let currency = Wulu.Economy.currency_name;\n let targetName = this.targetUsername;\n let currency_name = Wulu.Economy.currency_name;\n\n if (!this.targetUser) return this.sendReply(`User ${targetName} not found.`);\n if (is.not.number(amount)) return this.sendReply('Must be a number.');\n if (is.decimal(amount)) return this.sendReply('Cannot contain a decimal.');\n if (amount < 1) return this.sendReply(`You can't give less than one ${currency}.`);\n if (amount !== 1) currency += 's';\n\n let self = this;\n Economy.get(user.userid, function(userAmount) {\n if (amount > userAmount) return self.sendReply('You cannot transfer more money than what you have.');\n Economy.give(targetName, amount, function(targetTotal) {\n Economy.take(user.userid, amount, function(userTotal) {\n let targetCash = targetTotal !== 1 ? currency_name + 's' : currency_name;\n let userCash = userTotal !== 1 ? currency_name + 's' : currency_name;\n self.sendReply(`You have successfully transferred ${amount} ${currency} to ${targetName}. You now have ${userTotal} ${userCash}.`);\n self.sendReply(`${user.name} has transferred ${amount} ${currency} to you. You now have ${targetTotal} ${targetCash}.`);\n });\n });\n });\n },\n\n moneyladder: 'richestuser',\n richladder: 'richestuser',\n richestusers: 'richestuser',\n richestuser(target, room) {\n if (!this.canBroadcast()) return;\n let self = this;\n let display = `<center><u><b>Richest Users</b></u></center><br>\n <table border=\"1\" cellspacing=\"0\" cellpadding=\"5\" width=\"100%\">\n <tbody>\n <tr>\n <th>Rank</th>\n <th>Username</th>\n <th>Money</th>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n User.find().sort({money: -1}).limit(10).exec(function(err, users) {\n if (err) return;\n users.forEach((user, index) => {\n display += `<tr>\n <td>${index + 1}</td>\n <td>${user.name}</td>\n <td>${user.money}</td>\n </tr>`.replace(/(\\r\\n|\\n|\\r)/gm, '');\n });\n display += '</tbody></table>';\n self.sendReply('|raw|' + display);\n room.update();\n });\n }\n };\n\n Object.merge(CommandParser.commands, commands);\n}", "buy() {\n player.points = player.points.sub(this.cost())\n setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1))\n }", "changeMoneyBy(amnt){\r\n this.money += amnt;\r\n moneyText.text = \"Money: \" + this.money;\r\n towerUpgradeSound.play();\r\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function buyPart(item) {\n let protoBotCopy = protoBot\n let shopCopy = shop\n \n if(item.purchased == false){\n \n\n for (let i=0; i < shopCopy.length; i++){\n if(i == item.id - 1){\n \n shopCopy[i].purchased = true\n \n setShop(shopCopy)\n \n } \n }\n \n protoBotCopy.items.push(item)\n if(item.cost < balance){\n let cost = item.cost\n\n setBalance(balance - cost)\n setProtoBot(protoBotCopy)\n \n } else return alert('you do not have enough money')\n } else return alert('Item is already purchased')\n \n}", "buy(amount, bank) {\n if (bank.withdraw(amount * this.cost)) {\n this.totSharesBought += amount;\n this.shares += amount;\n }\n }", "function changeAmount(){\n updateCurrentCost();\n updateAmortization();\n updateTotalCookPerSecChain();\n}", "async function BuyItem(receivedMessage)\r\n{\r\n\tvar authorID = receivedMessage.author.id; // Get user's ID\r\n\tvar balanceUnits = await GetBalance(authorID);\t// Get user's balance\r\n\r\n\t// Get the price the player's willing to pay\r\n\tvar price = receivedMessage.content.slice(6);\r\n\r\n\tif (price < 20)\r\n\t{\r\n\t\treceivedMessage.channel.send('Потратить можно только не менее 20-ти Юнитов!');\r\n\t\treturn;\r\n\t}\r\n\r\n\tif (price <= balanceUnits) // If there's enough money\r\n\t{\r\n\t\tvar item = await AddItem(receivedMessage, Math.floor(price / 2));\r\n\t\tawait SetBalance(authorID, balanceUnits - price); // Deduct money\r\n\t\treceivedMessage.channel.send('Покупка успешна, новый баланс ' + (balanceUnits - price) + ' Юнитов!'); // Show it was successful\r\n\t\treceivedMessage.channel.send(await GetItemString(receivedMessage, item, false, true, true));\r\n\t}\r\n\telse // If not enough funds\r\n\t{\r\n\t\treceivedMessage.channel.send('Недостаточно средств, нужно на ' + (price - balanceUnits) + 'Ю больше!'); // Show there was not enough funds\r\n\t}\r\n}", "function gainMoney(amount) {\n\tmoney += amount;\n\tearned += amount;\n\ttotalEarned += amount;\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function buyItem() {\n\n}", "buy(number) {\n if (ThievesGuild.gold >= this.cost) {\n this.incOwned(number);\n ThievesGuild.gold = ThievesGuild.gold - this.cost;\n document.getElementById(\"gold\").innerHTML = ThievesGuild.gold;\n this.cost = Math.floor(this.basecost * Math.pow(1.08, this.owned));\n ThievesGuild.drawn = 0;\n }\n }", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "buy() {\n this.amount --;\n this.price ++;\n }", "function buyItem(user){\n return user\n}", "transactionInspection(item, amount, player) {\n if (!player || !this.faction.isContraband(item, player))\n return true;\n // the relative level of severity of trading in this item\n const contraband = data_1.default.resources[item].contraband || 0;\n // FastMath.abs() is used because amount is negative when selling to market,\n // positive when buying from market. Fine is per unit of contraband.\n const fine = FastMath.abs(contraband * amount * this.inspectionFine(player));\n const rate = this.inspectionRate(player);\n for (let i = 0; i < contraband; ++i) {\n if (util.chance(rate)) {\n const totalFine = Math.min(player.money, fine);\n const csnFine = util.csn(totalFine);\n const csnAmt = util.csn(amount);\n // fine the player\n player.debit(totalFine);\n // decrease standing\n player.decStanding(this.faction.abbrev, contraband);\n // confiscate contraband\n let verb;\n if (amount < 0) {\n player.ship.cargo.set(item, 0);\n verb = 'selling';\n }\n else {\n this.stock.dec(item, amount);\n verb = 'buying';\n }\n // trigger notification\n const msg = `Busted! ${this.faction.abbrev} agents were tracking your movements and observed you ${verb} ${csnAmt} units of ${item}. `\n + `You have been fined ${csnFine} credits and your standing wtih this faction has decreased by ${contraband}.`;\n window.game.notify(msg, true);\n return false;\n }\n }\n return true;\n }", "function buyItem(guid) {\n print(\"Trying to buy item \" + guid);\n\n var inventory = getInventory(currentMerchant);\n\n for (var i = 0; i < inventory.length; ++i) {\n var item = inventory[i];\n if (item.id == guid) {\n // Pay for it and only if that succeeds, move it\n if (Party.money.getTotalCopper() < item.worth) {\n print(\"Player doesn't have enough money.\");\n return;\n }\n Party.money.addCopper(- item.worth);\n\n inventory.splice(i, 1); // Remove from container\n\n if (!currentPlayer.content)\n currentPlayer.content = [];\n\n currentPlayer.content.push(item);\n\n // Refresh the UI\n MerchantUi.refresh();\n\n return;\n }\n }\n\n print(\"Unknown item guid: \" + guid);\n }", "async function propTransfer() {\n let accounts = await web3.eth.getAccounts();\n let Twill = await contract.methods\n .transferWill(\n toowner,\n newTestatorName,\n newBeneficiary,\n newBeneficiaryAddress,\n newOwnerHomeAddress\n )\n .send({ from: accounts[0] });\n console.log(\"result====\", Twill);\n }", "function click_money_incrementation(money, _values) {\r\n data.inventory.money += money * data.inventory.multiplier;\r\n Save();\r\n Attribtion();\r\n update_dom();\r\n}", "moneyInSafe() {\n let money = this.bank.money;\n money += this.moneyOfPlayers;\n money += this.moneyInCustoms;\n return money;\n }", "function buyItem() {\n\taddArmor();\n\t$('#alerts').append(\"<br />An item has being bought<br />\");\n\tremoveMoneyI();\n}", "function buy (msg, name, amt){\n //check for invalid inputs\n if (amt <= 0){\n msg.reply(\"Error: Please enter a number greater than zero.\");\n return;\n }\n\n //get list of currencies\n getList(msg).then((data) => {\n\n //holds price of desired currency\n var price;\n //holds the final total of desired currency\n var total;\n //get current market price of coin per dollar\n switch(name){\n case 'btc':\n price = amt * data.BTC.USD;\n break;\n case 'eth':\n price = amt * data.ETH.USD;\n break;\n case 'etc':\n price = amt * data.ETC.USD;\n break;\n case 'doge':\n price = amt * data.DOGE.USD;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n } //end switch\n //round purchase amt\n var price = Math.round(price*100)/100\n //make sure player has enough money\n if (price > player[msg.member.id].money){\n msg.reply(\"Error: Not enough money :\\(\");\n return;\n }\n\n //take the money\n player[msg.member.id].money = player[msg.member.id].money - price\n //add the appropriate coin\n switch(name){\n case 'btc':\n player[msg.member.id].btc = player[msg.member.id].btc + amt;\n total = player[msg.member.id].btc;\n break;\n case 'eth':\n player[msg.member.id].eth = player[msg.member.id].eth + amt;\n total = player[msg.member.id].eth;\n break;\n case 'etc':\n player[msg.member.id].etc = player[msg.member.id].etc + amt;\n total = [msg.member.id].etc;\n break;\n case 'doge':\n player[msg.member.id].doge = player[msg.member.id].doge + amt;\n total = player[msg.member.id].doge;\n break;\n //if currency not found\n default:\n msg.channel.send(\"Error: Currency not found\");\n return;\n break;\n }\n //update the JSON file\n fs.writeFile(\"./src/players.json\", JSON.stringify(player), (err)=> {\n if (err) console.log(err);\n });\n\n //success message\n msg.reply(\"Congratulations! You have bought \" + amt + \" \" + name + \" for a total of $\" + price + \"\\nCurrent total: \" + total + \"\\nMoney: $\" + player[msg.member.id].money);\n });\n}", "function gainMoney(amount) {\n money += amount;\n earned += amount;\n totalEarned += amount;\n}", "function buyItem(itemName) {\n let upgrade = items.find((item) => item.name == itemName);\n if(zenny >= upgrade.price) {\n zenny -= upgrade.price;\n upgrade.quantity++;\n upgrade.price = Math.floor(upgrade.price * 1.08);\n console.log(upgrade.price)\n update();\n showButtons();\n }\n}", "processTransaction(product) {\n product.quantity--\n vm.totalMoney += product.price\n vm.currentTransaction -= product.price\n }", "function purchaseItem() {\n return\n}", "function buyItem(){\n var money = App[App.myRole].money;\n if(determine == 1){\n if (money < 10) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pencil\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 10;\n //alert(\"You bought a pencil\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pencil!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n\t\t\t\t\t\t\n }\n }\n \n else if(determine == 2){\n if (money < 20) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pen\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 20;\n //alert(\"You bought a pen\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pen!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 3){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a calculator\");\n addToInventory(determine);\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n App[App.myRole].money -= 25;\n //alert(\"You bought a calculator\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a calculator!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 4){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought books\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some books\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some books!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 5){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a laptop\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought a laptop\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a laptop!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 6){\n if (money < 15) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some coffee\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 15;\n //alert(\"You bought a coffee\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some coffee!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 7){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a candy bar\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 25;\n //alert(\"You bought a candy bar\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a candy bar!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 8){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some fast food\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some greasy fast food\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some fast food!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 9){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a Fuego Taco\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought some fuego tacos\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a scrumptious Fuego taco!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n //update the inventory of the player\n updateInventoryDisplay();\n \n //update the health and money of the player on the board\n updateHeathAndMoneyDisplay();\n }", "get totalMoney(){\n return this.orderInfo.total_money;\n }", "sell(amount, bank) {\n if (amount <= this.shares) {\n this.totSharesSold += amount;\n this.shares -= amount;\n bank.deposit(amount * this.cost);\n }\n }", "giveItem(itemName, recipient) {\n if (!this.inventory.inventoryHasItem(itemName)) return false;\n const item = this.inventory.removeItem(itemName);\n recipient.takeItem(item);\n return true;\n }", "async function buyItem(id, guildId, cost ){\n try {\n const user = await Users.findOne({ where: {user_id: id, guild_id: guildId }});\n if(user){\n if(user.balance >=cost){\n user.balance = user.balance - Number(cost);\n user.save();\n }else{\n return 0 ;\n }\n }else{\n return 0 ;\n }\n } catch (e) {\n console.log(e);\n }\n }", "function buyManager(index) {\n if (money < managers[index-1].price || managersOwned[index-1]) // cannot afford or owned\n return;\n money -= managers[index-1].price;\n managersOwned[index-1] = true;\n $(\"#clickme\"+index).css(\"display\",\"none\"); // no more need for manual clicking\n $(\"#managerBought\"+index).css(\"display\",\"initial\");\n}", "function buyShovel(){\nif (cash >= clickUpgrades.shovel.price){ \n cash = cash - clickUpgrades.shovel.price,\n clickUpgrades.shovel.quantity+=1,\n clickUpgrades.shovel.price+=1,\n cashPC = cashPC + clickUpgrades.shovel.multiplier\n} else {\n alert('not enough cash')\n}\nupdate()\n}", "function amountCovered(claim){\n\tvar paidOutPerClient = '';\n\tvar percent = percentageCovered(claim);\n\t//Amount paid out rounded to the nearest dollar amount.\n\tvar amount = Math.round(claim.visitCost * (percent / 100));\n\t//Add to the total money paid out. Logged at the end.\n\ttotalPayedOut += amount;\n\tpaidOutPerClient += ('Paid out $<mark>' + amount + '</mark> for ' + claim.patientName);\n\t//Add new ol item for each client's details\n\t$('table').append('<tr><td>' + paidOutPerClient + '</td></tr>');\n\tconsole.log('Paid out $' + amount + ' for ' + claim.patientName);\n}", "function placeBets(player)\n{\n if(player.active===true)\n {\n player.money = player.money-15;\n dealer.money = dealer.money+15;\n }\n return player;\n}", "function Transaction(sell, amount){\n for(i in inventory)\n {\n if (inventory[i].name === selected)\n {\n if (sell && inventory[i].amount >= amount) //Sell Items\n {\n inventory[i].amount -= amount;\n inventory[i].stock += amount;\n money += inventory[i].cost * amount\n updateInvent(null);\n }\n if (!sell && inventory[i].stock >= amount && money >= inventory[i].cost * amount) //Buy items\n {\n inventory[i].amount += amount;\n inventory[i].stock -= amount;\n money -= inventory[i].cost * amount\n updateInvent(null);\n }\n }\n }\n\n}", "transfer(amount, destination) {\n this.withdraw(amount);\n destination.deposit(amount);\n }", "function amountcommi()\n{\n for (var i=0; i<rentals.length;i++)\n {\n //Drivy take a 30% commission on the rental price to cover their costs.\n var commission= rentals[i].price *0.3;\n\n //insurance: half of commission\n rentals[i].commission.insurance = commission *0.5;\n\n //roadside assistance 1€ per day\n rentals[i].commission.assistance = getRentDays(rentals[i].pickupDate,rentals[i].returnDate) +1;\n\n //drivy takes the rest\n rentals[i].commission.drivy= commission - (rentals[i].commission.insurance + rentals[i].commission.assistance);\n }\n\n}", "function buyManager(index) {\n\tif (money < managers[index-1].price || managersOwned[index-1]) // cannot afford or owned\n\t\treturn;\n\tmoney -= managers[index-1].price;\n\tmanagersOwned[index-1] = true;\n\t$(\"#clickme\"+index).css(\"display\",\"none\"); // no more need for manual clicking\n\t$(\"#managerBought\"+index).css(\"display\",\"initial\");\n}", "buyItem(req, res) {\n db.items.getById(req.params.id)\n .then((product) => {\n // Product returns an array of 1 item, so need to access that item, and change the buyer of that item to be the current request maker\n db.transactions.updateTransaction(product[0].id, { buyer_id: req.user.user.id })\n .then(() => {\n db.items.sold(Number(req.params.id));\n //Creates a new client with coinbase which allows user to purchase the item from coinbase\n const client = new coinbase.Client({ accessToken: req.user.accessToken, refreshToken: req.user.refreshToken });\n const args = {\n name: `Order for ${product[0].title}`,\n amount: /* (Number(product[0].price))*/ 0.01,\n metadata: {\n customer_id: client.id,\n customer_name: 'test'\n },\n currency: 'USD',\n type: 'order',\n style: 'custom_small',\n success_url: `http://${req.headers.host}/items/${req.params.id}/confirm`,\n cancel_url: `http://${req.headers.host}/items/${req.params.id}`,\n customer_defined_amount: false,\n collect_shipping_address: false,\n description: `Purchasing: ${product[0].title} on BitBargain`\n };\n //Create a checkout button with those args, and sends it back to BB which embeds it in a button\n client.createCheckout(args, (err, checkout) => {\n console.log(err, checkout);\n if (err) {\n res.json(`Error buying ${product[0].title}`);\n }\n res.json(checkout.embed_code);\n });\n });\n });\n }", "function payMoney(pmcData, body, sessionID) {\n item.resetOutput();\n let output = item.getOutput();\n let tmpTraderInfo = trader_f.traderServer.getTrader(body.tid, sessionID);\n let currencyTpl = getCurrency(tmpTraderInfo.data.currency);\n\n // delete barter things(not a money) from inventory\n if (body.Action === 'TradingConfirm') {\n for (let index in body.scheme_items) {\n let item = undefined;\n\n for (let element of pmcData.Inventory.items) {\n if (body.scheme_items[index].id === element._id) {\n item = element;\n }\n }\n\n if (item !== undefined) {\n if (!isMoneyTpl(item._tpl)) {\n output = move_f.removeItem(pmcData, item._id, output, sessionID);\n body.scheme_items[index].count = 0;\n } else {\n currencyTpl = item._tpl;\n break;\n }\n }\n }\n }\n\n // find all items with currency _tpl id\n const moneyItems = itm_hf.findMoney(\"tpl\", pmcData, currencyTpl);\n\n // prepare a price for barter\n let barterPrice = 0;\n \n for (let item of body.scheme_items) {\n barterPrice += item.count;\n }\n\n // prepare the amount of money in the profile\n let amountMoney = 0;\n \n for (let item of moneyItems) {\n amountMoney += item.upd.StackObjectsCount;\n }\n\n // if no money in inventory or amount is not enough we return false\n if (moneyItems.length <= 0 || amountMoney < barterPrice) {\n return false;\n }\n\n let leftToPay = barterPrice;\n\n for (let moneyItem of moneyItems) {\n let itemAmount = moneyItem.upd.StackObjectsCount;\n\n if (leftToPay >= itemAmount) {\n leftToPay -= itemAmount;\n output = move_f.removeItem(pmcData, moneyItem._id, output, sessionID);\n } else {\n moneyItem.upd.StackObjectsCount -= leftToPay;\n leftToPay = 0;\n output.data.items.change.push(moneyItem);\n }\n\n if (leftToPay === 0) {\n break;\n }\n }\n\n // set current sale sum\n // convert barterPrice itemTpl into RUB then convert RUB into trader currency\n let saleSum = pmcData.TraderStandings[body.tid].currentSalesSum += fromRUB(inRUB(barterPrice, currencyTpl), getCurrency(tmpTraderInfo.data.currency));\n\n pmcData.TraderStandings[body.tid].currentSalesSum = saleSum;\n trader_f.traderServer.lvlUp(body.tid, sessionID);\n output.data.currentSalesSums[body.tid] = saleSum;\n\n // save changes\n logger.logSuccess(\"Items taken. Status OK.\");\n item.setOutput(output);\n return true;\n}", "function put_item(to_cont, item) {\n to_cont._2m.items().push(item);\n item.container = to_cont.id;\n item._2o.container = function(){ return to_cont; };\n if(item.id)\n return EM.update('item', item);\n else\n return Oit.new_item(item).then(function(newE) {\n U.replace(to_cont._2m.items(), item, newE);\n });\n }", "function withdraw(account, amount) {\n account.total -= amount;\n}", "transfer({\n from,\n to,\n amount\n }) {\n if (this.ledger[from] === undefined) {\n throw new Error(`${from} is not a registered customer of the bank`);\n }\n if (this.ledger[to] === undefined) {\n throw new Error(`${to} is not a registered customer of the bank`);\n }\n let fromBalance = this.ledger[from];\n if (fromBalance < amount) {\n throw new Error(`${from} does not have sufficient funds`);\n }\n this.ledger[from] = fromBalance - amount;\n this.ledger[to] += amount;\n }", "_addTxOutItem(userKey, amount){\n\t\tthis.txOut.push({key: userKey, amount: amount});\n\t}", "function buyItem(item){\r\n var playerMoney = parseInt($('#pMoney').text());\r\n var playerHealth = parseInt($('#pHealth').text());\r\n switch(item){\r\n case 'potion':\r\n playerMoney -= 5;\r\n playerHealth += 10;\r\n $('#pMoney').html(playerMoney);\r\n $('#pHealth').html(playerHealth);\r\n break;\r\n case 'bronzeChain':\r\n playerMoney -= (100 - parseInt($('#aValue').text));\r\n $('#aName').html(\"Bronze Chainmail\");\r\n $('#aDef').html(10);\r\n $('#aValue').html(25);\r\n $('#playerMoney').html(playerMoney);\r\n break;\r\n case 'longsword':\r\n playerMoney -= (75 - parseInt$('#wValue').text());\r\n $('#wName').html(\"LongSword\");\r\n $('#wAtk').html(10);\r\n $('#wValue').html(18);\r\n $('#pMoney').html(playerMoney);\r\n break;\r\n }\r\n checkIfCanBuy();\r\n}", "function refundItem() {}", "balance(owner) {\n return this.balanceOf(owner).then(re => {\n return re.toString()\n })\n }", "spendMoney(amount) {\n save.money -= amount;\n this.moneyText.setText(save.money);\n this.tweens.add({\n targets: this.moneyText,\n scale: { start: 0.25, to: 1 },\n duration: 1000,\n fill: 0x00FF00,\n ease: 'Cubic'\n });\n }", "function organizeItemData(_data){\r\r\n // Calculate the cost in gold (it's given via the API in copper cost)\r\r\n let copperCost = _data.buyPrice;\r\r\n let goldCost = 0;\r\r\n \r\r\n // If time permits, optimize further (if copperCost > 100000, go by 100000's)\r\r\n while (copperCost > 0){\r\r\n copperCost -= 1000;\r\r\n goldCost += 1;\r\r\n }\r\r\n character.item_costs[parseInt(_data.id, 10)] = goldCost;\r\r\n}", "function amountAfterCommission(pdName){\n var pdTotal = betting.productTotal(pdName);\n //commission appled for each product\n var cRate = cms.get(pdName);\n return pdTotal - ( pdTotal * cRate / 100);\n\n}", "async buy(item, quantity) {\n const res = await this.client.action(\"buy\", { itemName: item, quantity: quantity, storeName: this.store });\n if (res.success) {\n this.editCache(item, -quantity);\n await this.client.update(res.playerStringified);\n }\n return { success: res.success, msg: res.msg };\n }", "function change(name,items,payment){\n let sumOfBuy = 0;\n for(let i = 0; i < items.length; i++){\n sumOfBuy += items[i];\n }\n let change = payment - sumOfBuy;\n if(name === \"John\"){\n if(change > 0){\n let fraction = change - Math.floor(change);\n change += fraction;\n } else {\n change = 0;\n }\n }\n return Math.round(change * 100) / 100;\n}", "function Coin()\n{\n\t// Spawn coin and float it up\n\tgm.GetComponent(ItemFactory).SpawnItemAndFloat(prize, giftPos.position, 0, 180, 0, 0.05, 1.5, true);\n\t\n\t// Update coin balance with this new coin\n\tpm.AddCoins(1);\n\tpm.AddPoints(50);\n\t\n\t// play sound\n\tAudioSource.PlayClipAtPoint(coinSound, transform.position);\n}", "function successVendItem(){\n\n var amount = $('#money').val();\n var id = $('#itemInbox').val();\n \n//Make an array to store data from last input to actual current change\n\n ds.vendItem(amount, id, \n function sucess(returnMoney) \n {\n \n var nickels = returnMoney.nickels;\n var quarters = returnMoney.quarters;\n var dimes = returnMoney.dimes;\n var returnMessage = '';\n var change = 0;\n\n // if you didnt make a purchase, choose no purchase made\n\n \n // if (quarters != 0 && dimes != 0 || quarters != 0 && nickels != 0 || nickels != 0 && dimes != 0 || quarters != 0 || dimes != 0|| nickels != 0){\n // returnMessage += (((nickels * 5) + (dimes * 10) + (quarters * 25))/100);\n // }\n \n // if (quarters == 0 && dimes == 0 && nickels == 0) {\n // returnMessage += \"There is no change\"; \n // }\n\n // if(/*$('#itemInbox').val(null)*/ id == null){\n // $('#messageOutput').val( \"Please select an item\");\n // amount;\n // }\n\n\n if(id == 1){\n change = amount - (1.5);\n } else if(id == 2){\n change = amount - (1.25);\n } else if(id == 3){\n change = amount - (1.25);\n }else if(id == 4){\n change = amount - (1.65);\n } else if(id == 5){\n change = amount - (1.75);\n } else if(id == 6){\n change = amount - (1.5);\n } else if(id == 7){\n change = amount - (2.35);\n } else if(id == 8){\n change = amount - (2);\n } else if(id == 9){\n change = amount - (1.95);\n }\n\n $('#messageOutput').val(\"Thank you!!!\");\n\n\n ds.getItems(loadItems);\n\n \n $('#money').val((change));\n\n // returnChange();\n\n total = change += 0.00;\n\n },\n\n function error(x){\n if(x.status == 442){\n \n }\n\n $('#messageOutput').val(x.responseJSON.message);\n\n console.log(x.responseJSON.message);\n $('#money').val(0); \n })\n }", "async onDeposit (sourceAccount, amount) {\n // Override this or listen to events!\n this.emit('deposit', sourceAccount, amount)\n }", "getMoney(){\n return 2000;\n }", "function pushMoney(turn) {\n turn.money += turn.bet;\n $('#player-money p').text(`$${centify(turn.money)}`);\n localStorage.setItem('playerMoney', turn.money);\n // console.log(`${turn.name} gets their money back`);\n}", "function buy5() {\n const credit = 500;\n addCredit(credit);\n return credit;\n}", "calulatingChange(change, price, cost) {\n let amountOwned = cost - price;\n if (amountOwned === 0) {\n return 0;\n }\n const valueOfCoin = [\n { name: \"TOONIES\", value: 2.0 },\n { name: \"LOONIES\", value: 1.0 },\n { name: \"QUARTERS\", value: 0.25 }\n ];\n const changeReturned = change.reduce((received, currency) => {\n received[currency[0]] = currency[1]; //compare value received to current value\n return received;\n }, {});\n const amountOfCoin = valueOfCoin.reduce((received, currency) => {\n let amount = 0;\n\n while (currency.value <= amountOwned && amountOwned !== 0) {\n amountOwned -= currency.value;\n changeReturned[currency.name] -= currency.value;\n amount++;\n }\n if (amount > 0) {\n received.push([currency.name, amount]);\n }\n return received;\n }, []);\n change.forEach(asset => {\n asset[1] = changeReturned[asset[0]];\n return amountOfCoin;\n });\n }", "onAmountChange() {\n this.coinCount = this.computeChange(this.denominations, this.amount);\n }", "function newItem() {\n console.log(\"\\nnewItem clicked\");\n this_contract.newItem(\"Test 2\", 500, 10, {from: from_account, gas: 500000}).then(function(value) {\n console.log(value.valueOf());\n console.log(web3.eth.getTransactionReceipt(value));\n }).catch(function(e) {\n console.log(e);\n });\n}", "checkout(Inventory) {\n let total = 0;\n this.items.forEach(i => {\n let [ sku, name, quantity, price ] = Inventory.get(i[0]);\n console.log(`${name} ${i[1]} x ${price} = ${i[1] * price}`);\n total += i[1] * price;\n\n // update Inventory state\n Inventory.items = Inventory.items.map(item => {\n if (item[0] === sku) {\n item[2] -= i[1];\n }\n return item;\n });\n });\n console.log(\"---------------------------\");\n console.log(`TOTAL: ${total}`);\n console.log(\"---------------------------\\n\");\n\n this.items = [];\n }", "function enemyBuyOptionu() {\n if(enemyCash>300){\n enemyBuyU();\n }\n}", "async function transferContractOwnership() {\n let accounts = await web3.eth.getAccounts();\n let result = await contract.methods\n .transferOwnership(transferOwnershipAddress)\n .send({ from: accounts[0] });\n console.log(\"result====\", result);\n }", "function buy50() {\n const credit = 6000;\n addCredit(credit);\n return credit;\n}", "function getMoney(pmcData, amount, body, output, sessionID) {\n let tmpTraderInfo = trader_f.traderServer.getTrader(body.tid, sessionID);\n let currency = getCurrency(tmpTraderInfo.data.currency);\n let calcAmount = fromRUB(inRUB(amount, currency), currency);\n let skip = false;\n let maxStackSize = 50000;\n\n // adjust maxStackSize for RUN\n if (currency === \"5449016a4bdc2d6f028b456f\") {\n maxStackSize = 500000;\n }\n\n for (let item of pmcData.Inventory.items) {\n // item is not currency\n if (item._tpl !== currency) {\n continue;\n }\n\n // item is not in the stash\n if (!isItemInStash(pmcData, item)) {\n continue;\n }\n\n // too much money for a stack\n if (item.upd.StackObjectsCount + calcAmount > maxStackSize) {\n // calculate difference\n let tmp = item.upd.StackObjectsCount;\n let difference = maxStackSize - tmp;\n\n // make stack max money, then look further\n item.upd.StackObjectsCount = maxStackSize;\n output.data.items.change.push(item);\n calcAmount -= difference;\n continue;\n }\n\n // receive money\n item.upd.StackObjectsCount += calcAmount;\n output.data.items.change.push(item);\n logger.logSuccess(\"Money received: \" + amount + \" \" + tmpTraderInfo.data.currency);\n skip = true;\n break;\n }\n\n if (!skip) {\n let StashFS_2D = recheckInventoryFreeSpace(pmcData, sessionID);\n\n // creating item\n let stashSize = getPlayerStash(sessionID);\n\n addedMoney:\n for (let My = 0; My <= stashSize[1]; My++) {\n for (let Mx = 0; Mx <= stashSize[0]; Mx++) {\n let skip0 = false;\n\n if (StashFS_2D[My][Mx] !== 0) {\n skip0 = true;\n }\n\n if (!skip0) {\n let MoneyItem = {\n \"_id\": utility.generateNewItemId(),\n \"_tpl\": currency,\n \"parentId\": pmcData.Inventory.stash,\n \"slotId\": \"hideout\",\n \"location\": {x: Mx, y: My, r: \"Horizontal\"},\n \"upd\": {\"StackObjectsCount\": calcAmount}\n };\n\n pmcData.Inventory.items.push(MoneyItem);\n output.data.items.new.push(MoneyItem);\n logger.logSuccess(\"Money created: \" + calcAmount + \" \" + tmpTraderInfo.data.currency);\n break addedMoney;\n }\n }\n }\n }\n\n // set current sale sum\n let saleSum = pmcData.TraderStandings[body.tid].currentSalesSum += amount;\n\n pmcData.TraderStandings[body.tid].currentSalesSum = saleSum;\n trader_f.traderServer.lvlUp(body.tid, sessionID);\n output.data.currentSalesSums[body.tid] = saleSum;\n\n return output;\n}", "onClick() {\n // Remove a bushel\n this.quantity -= 1;\n\n // Give the player money depending on the STATE.cashPerCrop variable\n STATE.resources.money += STATE.cashPerCrop;\n\n // Check if any bushels remain.\n // If not, destroy this wheat and\n // let the player know\n if (this.quantity <= 0) {\n this.destroy();\n showMessage('You lost some wheat!')\n }\n }", "function sendMoney(amount, name) {\n if (isNotANumber(amount)) {\n alert(\"Por favor ingrese un número\");\n } else {\n const amountFloat = parseFloat(amount)\n if (availableMoney.money - amountFloat < 0) {\n alert(\"No tiene suficiente dinero\");\n } else {\n availableMoney = new TotalMoney(availableMoney.money - amountFloat);\n\n setCurrentAmountText();\n\n const operation = new Operation(\"Envió\", amount, name)\n\n saveAndAlertOperation(operation);\n saveOperation(operation);\n showOperation(operation);\n localStorage.setItem(\"availableMoney\", JSON.stringify(availableMoney));\n }\n }\n}", "function moneyClick(number) {\n money = money + number;\n document.getElementById(\"Money\").innerHTML = money;\n}", "transferir(cuentaOrigen, cuentaDestino){\r\n //verificar que cuenta origen existe\r\n //verificar saldo en cuenta origen\r\n //verificar que cuenta destino existe\r\n //restar saldo en cuenta origen\r\n //sumar saldo en cuenta destino \r\n //confirmar operacion\r\n }", "static gainItem(item, amount = 1) {\n if (!item) {\n return;\n }\n switch (item.type) {\n case ItemType.item:\n this.getItem(item.id).gain(amount);\n return;\n case ItemType.underground:\n Underground.gainMineItem(this.getUndergroundItem(item.id).id, amount);\n return;\n case ItemType.berry:\n App.game.farming.gainBerry(this.getBerry(item.id), amount, false);\n return;\n case ItemType.gem:\n App.game.gems.gainGems(amount, this.getGem(item.id));\n return;\n }\n }", "sellItemtoVendor(x, y, item, client, clientPub, vendorChannel, itemsObj){\n\t\tlet temp = this.findVendor(x, y, client);\n\t\tlet vendorID = null;\n\t\tif(temp.type === \"vendor\" && temp !== false){\n\t\t\tlet vendorID = temp.vendor.vendorID;\n\t\t\tlet found = false;\n\t\t\tfor(let i = 0, j = this.vendors[vendorID].items.length; i<j; i++){\n\t\t\t\tif(item.item === this.vendors[vendorID].items[i].item){\n\t\t\t\t\t//if vendor already has this item, increase quantity\n\t\t\t\t\tthis.vendors[vendorID].items[i].quantity++;\n\t\t\t\t\tfound = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!found){\n\t\t\t\t//else give quantity 1 and add to vendor items\n\t\t\t\tlet temp = item;\n\t\t\t\ttemp.quantity = 1;\n\t\t\t\tthis.vendors[vendorID].items.push(temp);\n\t\t\t}\n\t\t\t(async () => {\n\t\t\t\tclientPub.publish(vendorChannel, JSON.stringify({\n\t\t\t\t\titems: this.vendors[vendorID].items,\n\t\t\t\t\tvendor: vendorID\n\t\t\t\t}));\n\t\t\t})();\n\t\t\t(async () => {\n\t\t\t\tclient.hset('vendor', vendorID, JSON.stringify(this.vendors[vendorID].items));\n\t\t\t})();\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}", "function buyCharm() {\n if(charm.quantity < charm.maxQuantity) {\n if(zenny >= charm.price) {\n zenny -= charm.price;\n charm.quantity++;\n }\n }\n}", "_rentPaid (data) {\n this.playersData[data.owner].addFunds(data.rent);\n this.playersData[data.payee].removeFunds(data.rent);\n }", "function withdrawMoney(amount) {\n if (isNotANumber(amount)) {\n alert(\"Por favor ingrese un número\");\n } else {\n const amountFloat = parseFloat(amount)\n if (availableMoney.money - amountFloat < 0) {\n alert(\"No tiene suficiente dinero\");\n } else {\n availableMoney = new TotalMoney(availableMoney.money - amountFloat);\n\n setCurrentAmountText();\n\n const operation = new Operation(\"Retiró\", amount);\n\n saveAndAlertOperation(operation);\n saveOperation(operation);\n\n localStorage.setItem(\"availableMoney\", JSON.stringify(availableMoney));\n }\n }\n}", "deposit(amount) {\n this.balance += amount;\n this.trans.push(`$${amount} deposited`);\n return this.balance;\n }", "function obtainItem() {\n if (itemObtainingOK) {\n //Is Thor next to an item?\n if (thor.nextToType == \"Item\") {\n //work out which item\n for (var i = 0; i < thor.currentTile.items.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.items[i].id == thor.nextToID) {\n // increase health to 100 if powerup taken\n if (thor.nextToID == \"powerup\") {\n thor.health = 100;\n console.log(\"Yummy powerup!\");\n\n underText1 = \"Yummy powerup!\";\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n //add it to Thors inventory\n thor.items.push(thor.currentTile.items[i]);\n console.log(thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.items[i].name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //change NPC chat if required, loop through each and update a required\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (typeof thor.currentTile.npcs[k].dialogueList[1] !== 'undefined') {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n //if its a key, unlock door key is for\n if (thor.currentTile.items[i].id == \"key\") {\n thor.currentTile.items[i].unlocks.locked = false;\n }\n }\n\n //remove it from the current tile\n thor.currentTile.items.splice(i, 1);\n\n //enable inventory to be shown directly after pick up, without need to move\n thor.nextToID = \"nothing\";\n thor.nextToType = \"nothing\";\n\n //No need to complete redundent cycles of for loop\n break;\n\n }\n }\n }\n //Is Thor next to an NPC?\n else if (thor.nextToType == \"NPC\") {\n //work out which NPC\n for (var j = 0; j < thor.currentTile.npcs.length; j++) {\n //find the npc within the currentTile.items array\n if (thor.currentTile.npcs[j].id == thor.nextToID) {\n //does the NPC have a questItem\n\n if (thor.currentTile.npcs[j].questItem === undefined) {\n console.log(thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText1 = (thor.currentTile.npcs[j].name.toUpperCase() + \": Sorry, nothing to give you, onwards with your quest!\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n //NPC - nothing to give convo\n } else if (thor.items.indexOf(thor.currentTile.npcs[j].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(thor.currentTile.npcs[j].questItem);\n console.log(thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n if (thor.currentTile.npcs[j].questItem.id == \"key\") {\n //console.log(\"State 1: \" + thor.currentTile.npcs[j].questItem.id); \t\t\t\t\t\n thor.currentTile.npcs[j].questItem.unlocks.locked = false;\n //console.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n }\n\n\n /*\n \t\t\t\tconsole.log(\"current tile id: \" +thor.currentTile.id + \" length: \" + thor.currentTile.items.length);\n //if thor is being given a key, unlock door{\n \t\t\tfor (var m = 0; m < thor.currentTile.items.length; m++) { \t\n \t\t\t\tconsole.log(\"All items: \" + thor.currentTile.items[m].id);\n \tif (thor.currentTile.items[m].id == \"key\") {\n \t\t\t\t\tconsole.log(\"State 1: \" + thor.currentTile.items[m].unlocks.locked);\n \t thor.currentTile.items[m].unlocks.locked = false;\n \t\t\t\t\tconsole.log(\"State 2: \" + thor.currentTile.items[m].unlocks.locked);\t \n \t }\n }\n */\n\n\n\n //Updating the NPC's conversation array based on\n if (thor.currentTile.npcs[j].convoStatus == \"Initial\") {\n //Make sure the NPC has a secondary conversation set up, if so use it\n if (thor.currentTile.npcs[j].dialogueList.length > 1) {\n //Move the array to point to the next item\n thor.currentTile.npcs[j].currentDialogue = thor.currentTile.npcs[j].dialogueList[1];\n //start at the beginning of the array\n thor.currentTile.npcs[j].chatPosition = 0;\n //Update NPC for next convo\n thor.currentTile.npcs[j].convoStatus = \"Given\";\n }\n }\n /*\n else if (convoStatus == \"Given\" && thor.currentTile.npcs[i].id == <specificNPC> ){\n Specific use cases for setting NPC conversation can be put in here\n }\n */\n } else {\n console.log(thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText1 = (thor.currentTile.npcs[j].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"Obstacle\") {\n //Work out which obstacle\n //The Obstacle array contains wall obstacles as well as game obstacles\n //Need to filter out the wall obstacles\n var replacementObstacleArray = [];\n for (var a = 0; a < thor.currentTile.obstacles.length; a++) {\n if (thor.currentTile.obstacles[a].id != \"wall\") {\n replacementObstacleArray.push(thor.currentTile.obstacles[a]);\n }\n }\n for (var m = 0; m < replacementObstacleArray.length; m++) {\n\n //find the npc within the currentTile.items array\n if (replacementObstacleArray[m].id == thor.nextToID) {\n //does the obstacle have a questItem\n if (replacementObstacleArray[m].questItem === undefined) {\n console.log(\"I'm a mere obstacle, move along!\");\n } else if (thor.items.indexOf(replacementObstacleArray[m].questItem) == -1) {\n //if Thor doesn't already have item, add the whole object\n thor.items.push(replacementObstacleArray[m].questItem);\n console.log(replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": added to Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n } else {\n console.log(replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText1 = (replacementObstacleArray[m].questItem.name + \": already in Thors inventory\");\n underText2 = \"\";\n underText3 = \"\";\n underText4 = \"\";\n underText5 = \"\";\n underText6 = \"\";\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n } else if (thor.nextToType == \"PuzzlePeice\") {\n\n //Is Thor next to an puzzle Obstacle?\n if (thor.nextToType == \"PuzzlePeice\" && !thor.currentTile.PuzzleComplete) {\n //work out which obstacle\n for (var i = 0; i < thor.currentTile.PuzzlePeices.length; i++) {\n //find the item within the currentTile.items array\n if (thor.currentTile.PuzzlePeices[i].id == thor.nextToID) {\n\n //If a colour is defined in original instantiation of object, it is assumed colour is to be cycled\n if (thor.currentTile.PuzzlePeices[i].colour != undefined) {\n thor.currentTile.PuzzlePeices[i].colour = thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer];\n } else if (1 === 0) {\n //A deliberate false above as this is just a placeholder for expected future code.\n //This is the code to cater for cycling images if puzzle obstacle instantiated with an image.\n }\n\n\n if (thor.currentTile.PuzzlePeices[i].puzzleCompleteVal == thor.currentTile.PuzzlePeices[i].allPossibleVals[thor.currentTile.PuzzlePeices[i].puzzlePointer]) {\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = true;\n //Now go over all of the title puzzle items, if they are all set correctly then perform action!\n var puzzleCompleted = true;\n for (var j = 0; j < thor.currentTile.PuzzlePeices.length; j++) {\n if (thor.currentTile.PuzzlePeices[j].puzzleSuccess === false) {\n puzzleCompleted = false;\n }\n }\n\n\n if (puzzleCompleted) {\n thor.currentTile.PuzzleComplete = true;\n //console.log(\"PUZZLE COMPLETED! - KICKING OFF SUPPLIED PUZZLE FUNCTION!\");\n\n //Wall alert flash to let player know puzzle complete\n var backgroundAlert = thor.currentTile.colour;\n thor.currentTile.colour = \"#ffff\";\n window.setTimeout(function(){\n thor.currentTile.colour = backgroundAlert;\n }, 250);\n\n //Is an item being placed?\n if (thor.currentTile.hasOwnProperty(\"itemToPlace\")) {\n thor.currentTile.targetMapTile.items.push(thor.currentTile.itemToPlace);\n \n\n } \n //Does NPC chat need to be updated?\n if (thor.currentTile.hasOwnProperty(\"newChatNPC_id\")) {\n //find out which NPC\n for (var k = 0; k < thor.currentTile.npcs.length; k++) {\n if (thor.currentTile.npcs[k].id == thor.currentTile.newChatNPC_id) {\n thor.currentTile.npcs[k].currentDialogue = thor.currentTile.npcs[k].dialogueList[2];\n //start any new dialogue from beginning, irrispective of where last one finished\n thor.currentTile.npcs[k].chatPosition = 0;\n }\n }\n } \n \n //Is key being issued? Then unlock the door on the given tile\n for (var m = 0; m < thor.currentTile.items.length; m++) {\n //if its a key, unlock door key is for\n if (thor.currentTile.items[m].id == \"key\") {\n thor.currentTile.items[m].unlocks.locked = false;\n }\n }\n }\n } else {\n //ensure that value is correct is used if user cycles past correct value\n thor.currentTile.PuzzlePeices[i].puzzleSuccess = false;\n }\n\n //If the puzzle is complete then don't let obstacles cycle through anymore\n if (!thor.currentTile.PuzzleComplete) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer += 1;\n\n //Ensure the pointer doesn't get incremented beyond array length\n if (thor.currentTile.PuzzlePeices[i].puzzlePointer == (thor.currentTile.PuzzlePeices[i].allPossibleVals.length)) {\n thor.currentTile.PuzzlePeices[i].puzzlePointer = 0;\n }\n }\n\n //No need to complete redundent cycles of for loop\n break;\n }\n }\n }\n //Not near anything? Then just list inventory.\n else {\n //As the thor items is list of objects, need to iterate through and add names to a new array to be output\n\n var thorInventoryOutput = [];\n for (var k = 0; k < thor.items.length; k++) {\n thorInventoryOutput.push(thor.items[k].name);\n }\n console.log(\"Thor's Swag Bag: \" + thorInventoryOutput);\n\n }\n }\n itemObtainingOK = false;\n}\n}", "function updateMoney() {\n\t\t\tmoneyText.text = money.toString();\n\t\t}", "function player1Bet() {\n if (player1Money > 0) {\n // -100 from p1\n let newPlayer1Money = player1Money - 100;\n setPlayer1Money(newPlayer1Money);\n\n // +100 to pot\n let newPotMoney = potMoney + 100\n setPotMoney(newPotMoney);\n }\n // else do nothing\n }", "static amount(item) {\n if (!item) {\n return null;\n }\n switch (item.type) {\n case ItemType.item:\n return player.itemList[this.getItem(item.id).name];\n case ItemType.underground:\n return player.mineInventory()[player.mineInventoryIndex(this.getUndergroundItem(item.id).id)].amount;\n case ItemType.berry:\n return App.game.farming.berryList[this.getBerry(item.id)];\n case ItemType.gem:\n return App.game.gems.gemWallet[this.getGem(item.id)];\n }\n }", "transfer(destUnit, resourceType, amount) {\n let destID = typeof destUnit === \"string\" ? destUnit : destUnit.id;\n return `t ${this.id} ${destID} ${resourceType} ${amount}`;\n }", "function addP1(){\n let newPlayer1Money = player1Money + 100;\n setPlayer1Money(newPlayer1Money)\n }", "function numberOfItemsBasedOnCashAmount(itemPrice,money) {\n\tvar quotient = Math.floor(money/itemPrice);\n\tvar remainder = money%itemPrice;\n\tvar temp = quotient*remainder;\n\tif (isNaN(remainder)) {\n\t\talert(\"You should type only numbers!\")\n\t} else {\n\t\treturn (\"You will purchase \" + quotient + \" items, and you will have \" + remainder + \" change left.\");\n\t\t}\t\n}", "async showQuantities() {\n const character = this.character;\n const item = this.info.item;\n const buyItem = Items.new(item);\n let actions = new Actions();\n\n let style = buyItem.canBePurchasedBy(character, 1) ? 'default' : 'danger';\n actions.addButton(\"Buy 1\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 1 }, style });\n\n style = buyItem.canBePurchasedBy(character, 5) ? 'default' : 'danger';\n actions.addButton(\"Buy 5\", COMMAND_NAME, {params: { action: ACTION_BUY, item, quantity: 5 }, style });\n\n style = buyItem.canBePurchasedBy(character, 10) ? 'default' : 'danger';\n actions.addButton(\"Buy 10\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 10 }, style });\n\n style = buyItem.canBePurchasedBy(character, 25) ? 'default' : 'danger';\n actions.addButton(\"Buy 25\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 25 }, style });\n\n actions.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({\n attachments: Attachments.one({\n title: \"How many do you want to buy?\",\n fields: this.character.getFields(),\n actions\n })\n });\n }", "function updateCost(amount) {\n activityCost += amount;\n document.getElementById(\"total\").innerHTML = \"Amount due: $\" + activityCost;\n}", "buyNow(wish) {\n return this.model.findById(wish.user_id).then(data => {\n return data.decrement('balance', { by: wish.price });\n });\n }", "function addP2(){\n let newPlayer2Money = player2Money + 100;\n setPlayer2Money(newPlayer2Money)\n }", "function checkPurchase(player) {\n if (parseInt(players[currentPlayer].money - tiles2[players[player].location].cost) < 1) {\n console.log(\"Log - Player cannot afford propery.\")\n updateText(\"You cannot afford to purchase this property.\");\n } else {\n\n if (players[player].passed_go == 1) {\n\n if (confirm('Would you like to purchase ' + tiles2[players[player].location].name)) {\n // Buy\n tiles2[players[player].location].ownedBy = currentPlayer;\n tiles2[players[player].location].canBuy = 0;\n console.log(\"Owned buy set to \" + currentPlayer);\n players[currentPlayer].money = parseInt(players[currentPlayer].money - tiles2[players[player].location].cost);\n\n console.log(\"Log - Player \" + currentPlayer + \"'s new balance is \" + parseInt(players[currentPlayer].money));\n updateMoney(player, players[currentPlayer].money);\n\n changeOwnedPropertyIcons(player);\n } else {\n startBidding(players[player].location);\n }\n } else {\n updateText(\"You must pass go once before you can purchase properties.\");\n }\n\n }\n trade(currentPlayer, tradeWith);\n}", "moneyOfPlayers() {\n let money = 0;\n\n this.bank.players.forEach(player => {\n money += player.money;\n });\n\n return money;\n }", "function roboteggCollectorOn () {\n if (gameData.roboteggcollectorNum >= 0 && gameData.cash >= gameData.roboteggcollectorCost) {\n gameData.roboteggcollectorNum++;\n gameData.cash -= gameData.roboteggcollectorCost;\n gameData.roboteggcollectorCost = 10 * Math.pow(1.2, gameData.roboteggcollectorNum + 1); \n duckUpdate();\n }\n}", "function getDeposit() {\n return askMoney;\n }" ]
[ "0.7070466", "0.6346074", "0.6200739", "0.6120404", "0.6072922", "0.6057651", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.6030295", "0.60043234", "0.59226453", "0.58981985", "0.5893371", "0.586702", "0.58419544", "0.58244896", "0.58140206", "0.58131313", "0.58065593", "0.57838166", "0.5783308", "0.5733763", "0.57320696", "0.57282305", "0.5719533", "0.5711769", "0.5708697", "0.5705953", "0.5679451", "0.5670858", "0.5662539", "0.5625951", "0.5603174", "0.5594232", "0.5591252", "0.5582335", "0.55798304", "0.5576903", "0.5576116", "0.55635846", "0.5545112", "0.5534088", "0.55333257", "0.552868", "0.5521197", "0.5513873", "0.55126953", "0.5510763", "0.5510322", "0.55037993", "0.550298", "0.54863447", "0.5457748", "0.5455637", "0.5435569", "0.54287124", "0.5423807", "0.5414264", "0.54049593", "0.54044", "0.5402898", "0.54007035", "0.5387891", "0.5387573", "0.53865135", "0.538483", "0.53820956", "0.53720593", "0.5371718", "0.53707826", "0.5368321", "0.53652847", "0.5355234", "0.53519917", "0.53498125", "0.5349395", "0.53442276", "0.5338186", "0.53367096", "0.53344095", "0.5329349", "0.5322138", "0.53140426", "0.53134465", "0.53010285", "0.5300106", "0.52985096", "0.52967167", "0.52925074", "0.5287336", "0.5284393", "0.5282022", "0.528068", "0.52801824", "0.52773654", "0.52746135", "0.527086" ]
0.70928687
0
Item owner gets money. Item destroyed
function sell_item_destroy(item, cost_adjustment) { //U.pluck(item._2o.container()._2m.items(), item); return $q.all([ change_gold(item._2o.container(), item.cost*cost_adjustment), Oit.destroy_item(item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "onClick() {\n // Remove a bushel\n this.quantity -= 1;\n\n // Give the player money depending on the STATE.cashPerCrop variable\n STATE.resources.money += STATE.cashPerCrop;\n\n // Check if any bushels remain.\n // If not, destroy this wheat and\n // let the player know\n if (this.quantity <= 0) {\n this.destroy();\n showMessage('You lost some wheat!')\n }\n }", "deleteItem(item){\n delete this.inventory[item];\n }", "releaseItem(item) {}", "function refundItem() {}", "resetMoney() {\n\t\tthis._money = 0;\n\t\tResetPlayerMoney(this.id);\n\t}", "function DropItem(itemId: int) {\n\t\tinventoryItemCount--;\n\t\n\t}", "removeInventory(item) {\n this.inventory.deleteItem(item.id);\n item.owner = undefined;\n return this;\n }", "deleteItem() {\n this.view.removeFromParentWithTransition(\"remove\", 400);\n if (this.item != null) {\n this.itemDao.deleteById(this.item.getId());\n }\n }", "function destroyItem(slot) {\ninvSlots[inventory[slot][1]].destroy();\ninventory[slot][0] = 0;\ninventory[slot][1] = 0;\ngameState.itemClicked = '';\n}", "function money() {\n new Vivus('money', {\n duration: 250,\n animTimingFunction: Vivus.EASEOUT,\n type: 'oneByOne'\n });\n }", "function destroyBlock(){\n itemId = Player.getCarriedItem()\n if(itemId == 284 || itemId == 285 || itemId == 286 || itemId == 269 || itemId == 270 || itemId == 271 || itemId == 273 || itemId == 274 || itemId == 275 || itemId == 256 || itemId == 257 || itemId == 258 || itemId == 277 || itemId == 278 || itemId == 279 ){\n addRandomDamage()\n }\n if(itemId == 283 || itemId == 268 || itemId == 272 || itemId == 267 || itemId == 276){\n addRandomDamage()\n addRandomDamage()\n }\n}", "giveItem(itemName, recipient) {\n if (!this.inventory.inventoryHasItem(itemName)) return false;\n const item = this.inventory.removeItem(itemName);\n recipient.takeItem(item);\n return true;\n }", "removeItem(item) {\n this.props.removeItem(this.props.partyId, item._id);\n }", "drop(currentPlayer, itemName, channel){\n let item = this.utils.resolveNamable(itemName, currentPlayer.inventory.items)\n if(item){\n currentPlayer.inventory.items = currentPlayer.inventory.items.filter(\n currentItem => currentItem !== item)\n this.maps[currentPlayer.position].userItems.push(item)\n let forDeletion = getPasses(item)\n currentPlayer.passes = currentPlayer.passes.filter(instance => {\n return !forDeletion.includes(instance)\n })\n\n channel.send(`Item ${item.name.name} dropped.`).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n }\n }", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function purchaseItem() {}", "function removeMoneyI() {\n\tmoney-=100;\n\t$('#money').html(money);\n\t$('#alerts').append(\"<br />You bought Armor <br />\");\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 onitemremove (data) {\n\tvar removeItem; \n\tremoveItem = finditembyid(data.id);\n\n\tif (!removeItem) {\n\t\treturn;\n\t}\n\n\tland.splice(land.indexOf(removeItem), 1); \n\t\n\t//destroy the phaser object \n\tremoveItem.item.destroy(true, false);\n}", "function buyItem() {\n\taddArmor();\n\t$('#alerts').append(\"<br />An item has being bought<br />\");\n\tremoveMoneyI();\n}", "function deleteItem() {\n inventory[clickedEventId] = {};\n player[clickedEventId] = {};\n document.getElementById(clickedEventId).style.backgroundImage = \"none\";\n updateUI();\n updateInventory();\n updateEquipment();\n}", "function purchaseItem() {\n return\n}", "function DestroyCoin()\n{\n\tDestroy (gameObject);\n}", "function itemHandler(player, item) {\n item.kill();\n currentScore = currentScore + 10;\n if (currentScore === winningScore) {\n createBadge();\n }\n}", "survivorDamage(dmg) {\n console.log(\"Survivor taking damage = \" + dmg);\n //Deduct health.\n this.currPlayerHealth -= dmg;\n\n }", "takeDamage(damage, index, user) {\n //Deal damage and check if hp of item\n // is 0 if so, remove from array\n this.array[index].hp -= damage;\n if(this.array[index].hp <= 0){\n this.remove(index);\n user.scoreUpdate(400);\n }\n }", "buy() {\n this.amount --;\n this.price ++;\n }", "removeOne(item) {\n const newItems = this.state.inventoryItems;\n // let price = newItems[item].price;\n if (newItems[item].quantity === 0) {\n console.log(\"can't go negative\")\n } else {\n newItems[item].quantity = newItems[item].quantity - 1;\n }\n this.setState({\n inventoryItems: newItems\n })\n }", "function UseItem(num) { // Return 1 if the item is depleted.\r\n if (GameState.Items[num][0] == \"Potion\") {\r\n GameState.Items[num][1]--;\r\n\tRestoreHP(5);\r\n }\r\n else if (GameState.Items[num][0] == \"Hi-Potion\") {\r\n GameState.Items[num][1]--;\r\n\tRestoreHP(10);\r\n }\r\n if (GameState.Items[num][1] <= 0) {\r\n GameState.Items.splice(num,1);\r\n\treturn 1;\r\n }\r\n}", "function C010_Revenge_SidneyJennifer_StealItems() {\n\t\n\t// Backup and remove the player inventory\n\tPlayerSaveAllInventory();\n\tPlayerRemoveAllInventory();\n\tC010_Revenge_SidneyJennifer_ItemStolen = true;\n\tCurrentTime = CurrentTime + 50000;\n\t\n}", "function itemHandler(player, item) {\n item.kill();\n if(item.key === 'coin') {\n currentScore = currentScore + 5;\n if(currentScore === winningScore) {\n won = true;\n }\n } else if(item.key === 'poison'){\n alert(\"Oh Poison!!! Try Again:)\");\n location.reload();\n }\n}", "_rentPaid (data) {\n this.playersData[data.owner].addFunds(data.rent);\n this.playersData[data.payee].removeFunds(data.rent);\n }", "function updateGetränke() {\r\n return getränkeItem.inventory -= 1;\r\n}", "[REMOVE_MEAL_ITEM](state, item) {\n state.meal.items = state.meal.items.filter(i => i !== item);\n }", "TakeDamage(dmg){\n this.currentHealth = this.currentHealth - dmg;\n }", "function itemDie(itemIdx){\r\n\tif(items[itemIdx].name == \"apple\"){\r\n\t\tdropItem(\"apple\");\r\n\t}\r\n\titems.splice(itemIdx, 1);\r\n}", "destroy() {\n if (this.item) {\n this._destroyStateComponent()\n this.item.parentNode.removeChild(this._dom.item)\n }\n\n // Remove the gallery item reference from the item\n this.item._mhGalleryItem = null\n }", "update() {\n if (this.currentGold != this.characterData.gold) {\n // Play buy sfx\n this.audio.playSfx(\"purchase\");\n\n // Remove old gold info and re-add new\n this.goldText.destroy();\n this.goldImage.destroy();\n this.displayGold(this.characterData.gold);\n this.currentGold = this.characterData.gold;\n }\n }", "function buyItem(guid) {\n print(\"Trying to buy item \" + guid);\n\n var inventory = getInventory(currentMerchant);\n\n for (var i = 0; i < inventory.length; ++i) {\n var item = inventory[i];\n if (item.id == guid) {\n // Pay for it and only if that succeeds, move it\n if (Party.money.getTotalCopper() < item.worth) {\n print(\"Player doesn't have enough money.\");\n return;\n }\n Party.money.addCopper(- item.worth);\n\n inventory.splice(i, 1); // Remove from container\n\n if (!currentPlayer.content)\n currentPlayer.content = [];\n\n currentPlayer.content.push(item);\n\n // Refresh the UI\n MerchantUi.refresh();\n\n return;\n }\n }\n\n print(\"Unknown item guid: \" + guid);\n }", "removeItem() {\n // Remove Item from Order's Items array:\n this.order.removeItem(this.item);\n // Update current Order:\n this.orderService.setCurrentOrder(this.order);\n this._closeEditItem(); // Close edit Product modal view:\n }", "removeItem(_item) { }", "function sellEggs() {\n gameData.cash = gameData.cash + gameData.eggs * gameData.cost;\n gameData.lifetimeCash += gameData.eggs * gameData.cost;\n gameData.eggsSold += gameData.eggs;\n gameData.eggs = 0;\n duckUpdate();\n}", "onTakeDamage(evt) {\n this.current -= evt.data.amount;\n evt.handle();\n }", "usePotion(){\n if(this.healingItem > 0){\n this.healingItem -= 1;\n this.hp += 10;\n }\n }", "function buyItem(){\n var money = App[App.myRole].money;\n if(determine == 1){\n if (money < 10) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pencil\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 10;\n //alert(\"You bought a pencil\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pencil!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n\t\t\t\t\t\t\n }\n }\n \n else if(determine == 2){\n if (money < 20) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a pen\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 20;\n //alert(\"You bought a pen\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a pen!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 3){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a calculator\");\n addToInventory(determine);\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n App[App.myRole].money -= 25;\n //alert(\"You bought a calculator\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a calculator!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 4){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought books\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some books\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some books!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 5){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a laptop\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought a laptop\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a laptop!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 6){\n if (money < 15) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some coffee\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 15;\n //alert(\"You bought a coffee\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some coffee!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 7){\n if (money < 25) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a candy bar\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 25;\n //alert(\"You bought a candy bar\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a candy bar!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 8){\n if (money < 45) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought some fast food\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 45;\n //alert(\"You bought some greasy fast food\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought some fast food!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n else if(determine == 9){\n if (money < 75) {\n insufficientFunds();\n }\n else {\n console.log(\"Player has bought a Fuego Taco\");\n var audio = new Audio(\"audio/spendMoney.wav\");\n audio.play();\n addToInventory(determine);\n App[App.myRole].money -= 75;\n //alert(\"You bought some fuego tacos\");\n cashText.kill();\n var style1 = {font: \"40px Arial\", fill: \"#ffffff\"};\n cashText = game.add.text(game.world.centerX, game.height - 200, \"$\" + App[App.myRole].money + \" remaining\", style1);\n cashText.anchor.set(0.5);\n\t\t\t\t\t\t\n\t\t\t\t\t\tvar style = {font: \"42px Arial\", fill: \"#ffffff\"};\n\t\t\t\t\t\ttextFeedback = game.add.text(game.world.centerX, game.height - 275, \"You just bought a scrumptious Fuego taco!\", style);\n\t\t\t\t\t\ttextFeedback.anchor.set(0.5);\n\t\t\t\t\t\ttextFeedback.alpha = 1;\n\t\t\t\t\t\tgame.add.tween(textFeedback).to({alpha: 0}, 2000, Phaser.Easing.Linear.None, true, 0, 0, 0);\n }\n }\n \n //update the inventory of the player\n updateInventoryDisplay();\n \n //update the health and money of the player on the board\n updateHeathAndMoneyDisplay();\n }", "remove(item) {\n item = this.normalize(item);\n\n if (this.items.filter(i => i[0] == item[0]).length) { // item with SKU exists already\n this.items = this.items.map(\n i => {\n // when the SKU of the newly added item matches the item in the inventory, just add amount\n if (i[0] == item[0]) {\n i[1] -= item[1];\n }\n return i;\n }\n );\n }\n\n // filter out the items with quantity of 0 or less\n this.items = this.items.filter(i => i[1] > 0);\n }", "delete(item) {\n console.log(item);\n this.items = this.items.filter((e) => e.code !== item);\n this.totalTtc = 0;\n this.items.forEach(data => {\n this.totalTtc += data.prix * data.qte;\n });\n }", "updateBasket(item, amount){\n let itemsBought = Object.assign({}, this.state.itemsBought);\n //if changed mind and down to 0, remove from bought items list\n if(amount < 1){\n delete itemsBought[item];\n }else{\n itemsBought[item] = this.state.items[item];\n }\n this.setState({itemsBought : itemsBought});\n }", "function inventoryRemove(item) {\n\titem.hide();\n\titem.moveTo(current_layer);\n\titem.draggable(false);\n\tinventory_list.splice(inventory_list.indexOf(item), 1);\n\tredrawInventory();\n}", "removePowerupFrom(item) {\n item.beginAction = this.previousBeginAction;\n item.endAction = this.previousEndAction;\n this.remove();\n }", "eatenBy(player) {\n if (player === null) {\n super.eatenBy(null);\n }\n this.gameManager.playMusicFoodEating()\n player.grow(this.gain);\n this.gameManager.removeGameObjectById(this.id);\n }", "function itemHandler(player, item) {\n item.kill();\n switch (item.key) {\n case 'poison':\n lives -= 1;\n break;\n case 'mist':\n lives -= 2;\n break;\n case 'window':\n lives -= 3;\n break;\n case 'fish':\n lives -= lives;\n break;\n case 'coin':\n currentScore += 25;\n break;\n case 'honey':\n currentScore += 50;\n break;\n case 'heart':\n lives += 1;\n break;\n case 'star':\n currentScore += 100;\n break;\n case 'bush':\n currentScore += 5;\n break;\n case 'waterBlob':\n currentScore += 10;\n break;\n }\n}", "function deduct(memberObj, amount){\n let shopUser = getShopUser(memberObj);\n\n shopUser.balance -= amount;\n data.budget += amount;\n\n fs.writeFileSync(\"./data/shop/data.json\", JSON.stringify(data), (err) => console.log(err));\n\n return `${memberObj} has had ${amount} Simbits deducted from them and added back to the budget.`\n}", "deal(){\n return this.deck.pop();\n }", "function handleDelete(key){\n let quantity = tableItems[currentTableId - 1].itemsOrdered[key];\n delete tableItems[currentTableId - 1].itemsOrdered[key];\n // now update total bill\n let amountToBeDeducted = parseFloat(menuItems[key - 1].cost) * quantity;\n tableItems[currentTableId - 1].totalBill -= amountToBeDeducted;\n // reduce the total items\n tableItems[currentTableId - 1].itemCount -= quantity;\n updateModalContents();\n updateTable();\n}", "function MaidQuartersMaidUngagPlayer() {\n\tif (MaidQuartersMaid.CanInteract()) {\n\t\tif (!MaidQuartersMaidReleasedPlayer) {\n\t\t\tReputationProgress(\"Dominant\", -1);\n\t\t\tMaidQuartersMaidReleasedPlayer = true;\n\t\t}\n\t\tInventoryRemove(Player, \"ItemMouth\");\n\t} else MaidQuartersMaid.CurrentDialog = DialogFind(MaidQuartersMaid, \"CantReleasePlayer\");\n}", "function dropItem() {\n // reset its background in inventory\n $(\"#item\" + usingItemId).css({\n \"background-color\": \"white\"\n });\n // reset\n usingItemId = -1;\n usingItem = false;\n // reset these after a delay so that using items on a trigger will be registered\n setTimeout(function() {\n usingScrewDriver = false;\n usingFuse = false;\n usingMug = false;\n usingCord = false;\n }, 250);\n}", "deal() {\n return this._deck.pop();\n }", "buy() {\n player.points = player.points.sub(this.cost())\n setBuyableAmount(this.layer, this.id, getBuyableAmount(this.layer, this.id).add(1))\n }", "OnClickTakeMoneyOut() {\n this.setPopupTransaction(SessionConstant.POPUP_TAKE_MONEY_OUT);\n }", "function removeBagItem(itemIndex){\n bagInventory.splice(itemIndex,1);\n game.scene.run('UIS');\n}", "function removeItem(itemName) {\n order.subtotal = round(order.subtotal - order.items[itemName].price);\n order.tax = round(order.subtotal * 0.1);\n order.total = round(order.subtotal + order.tax + order.delivery);\n if (order.items[itemName].count > 1) {\n order.items[itemName].count -= 1;\n } else {\n delete order.items[itemName];\n }\n let restaurantDiv = document.getElementById(\"restaurant\");\n // Generate order summary div \n restaurantDiv.replaceChild(createOrderDiv(restaurantData.menu), document.getElementById(\"restaurant\").lastChild);\n}", "function placeBets(player)\n{\n if(player.active===true)\n {\n player.money = player.money-15;\n dealer.money = dealer.money+15;\n }\n return player;\n}", "updateInvincibility() {\n if (this.isHurt()) {\n this.currentInvincibility--;\n }\n }", "doDamage(dmg){\r\n if (!(dmg > 0))\r\n return;\r\n\r\n this.hp -= dmg;\r\n if (this.hp <= 0){\r\n this.alive = false;\r\n this.hp = 0;\r\n }\r\n }", "takeDamage(damage) {\n this.hp -= damage\n return this.hp\n }", "removeItem(item) {\n \t\t\tconst newItems = this.state.inventoryItems;\n \t\t\tdelete newItems[item];\n \t\t\tthis.setState({\n \t\t\t\tinventoryItems: newItems\n \t\t\t})\n \t\t}", "async clearItemsByUserSelection() {\n const invalidItemTypes = getCharacterUpdatePolicyTypes();\n\n // collect all items belonging to one of those inventory item categories\n let ownedItems = this.actor.getEmbeddedCollection(\"OwnedItem\");\n let toRemove = ownedItems.filter((item) => invalidItemTypes.includes(item.type)).map((item) => item._id);\n await this.actor.deleteEmbeddedEntity(\"OwnedItem\", toRemove);\n return toRemove;\n }", "function redeem(memberObj, itemObj){\n let shopUser = getShopUser(memberObj);\n \n inventoryQuantityProcess(memberObj, itemObj);\n\n return `One ${itemObj.Item} has successfully redeemed and removed from ${memberObj}'s inventory.`;\n}", "static amount(item) {\n if (!item) {\n return null;\n }\n switch (item.type) {\n case ItemType.item:\n return player.itemList[this.getItem(item.id).name];\n case ItemType.underground:\n return player.mineInventory()[player.mineInventoryIndex(this.getUndergroundItem(item.id).id)].amount;\n case ItemType.berry:\n return App.game.farming.berryList[this.getBerry(item.id)];\n case ItemType.gem:\n return App.game.gems.gemWallet[this.getGem(item.id)];\n }\n }", "function deleteItemFromGame(object) {\n\tgame_menu.removeChild(object);\n\tstage.update();\n}", "damagePlayer(player) {\r\n player.health -= this.damage;\r\n player.damageTakenSound.play();\r\n }", "function removeMoney() {\n\tmoney-=50;\n\t$('#alerts').append('<br />Your money has been stolen<br />');\n\t$('#money').html(money);\n\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function useBagItem(itemIndex){\n //determine which type of items can be consumed through a new attribute and what they do.\n var tempBagItem = bagInventory[itemIndex];\n\n var attributeNumber = parseInt(tempBagItem.Attribute);\n var itemType = tempBagItem.ItemType;\n var itemUsed = false;\n switch (itemType) {\n case 'healing':\n playerHeal(attributeNumber);\n itemUsed = true;\n break;\n default:\n //do nothing if it doesn't fall under one of the above\n break;\n }\n\n //when consumed delete the item from inventory.\n if(itemUsed){\n removeBagItem(itemIndex);\n }\n\n}", "unstageUnit(){\n this.image.parent.removeChild(this.image);\n this.healthBar.parent.removeChild(this.healthBar);\n }", "function sell_item_transfer(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(item._2o.container(), item.cost*cost_adjustment),\n put_item(to_cont, item)\n ]);\n }", "takeDamage(amount){\n this.activePokemon().takeDamage(amount)\n }", "function buyItem() {\n\n}", "exitWith_item(ctx) {\n\t}", "function withdraw(account, amount) {\n account.total -= amount;\n}", "function removeItem() {\n removeRequestedItem(requestedItem);\n }", "takeDamage(damage) {\n this.health -= damage;\n if (this.health <= 0)\n {\n this.alive = false;\n }\n }", "unlike() {\r\n return this.getItem().then(i => {\r\n return i.unlike();\r\n });\r\n }", "decrement(itemData) {\n if (itemData.quantity == 0) return;\n itemData.quantity -= 1\n this.props.setItemQuantity(itemData);\n }", "onItemClose(e) {\n this.fireEvent(\"item-close\", {\n item: e.detail.item\n });\n }", "remove() {\n this._item = null;\n this.render();\n }", "takeDamage(damage) {\n if (this.isPlayerAlive()) {\n this.hp -= damage;\n console.log(`${this.name} have ${this.hp} Health Points remaining.`);\n } else {\n this.state = LOSER;\n console.log(`${this.name} is dead :(`);\n }\n }", "buyItem(item) {\n console.log(\"Buying Item:\", item.name);\n }", "function dropItem() {\r\n\t//check equip\r\n\t//traverse playerBag, splice item from array.\r\n\t//close menu window.\r\n\t//set inventory display appropriately.\r\n\tfor(var i = 0; i < playerBag.length; i++) {\r\n\t\tif(currItemCode == playerBag[i]) {\r\n\t\t\tif(currItemCode == equippedArmorArr[0] || currItemCode == equippedWpnArr[0]) {\r\n\t\t\t\tget(\"bottom-display\").innerHTML = \"You cannot drop something that you are using!\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tplayerBag.splice(i, 1);\r\n\t\t\t\tget(\"item\" + itemHoverVal).style.display = \"none\";\r\n\t\t\t\tget(\"item\" + playerBag.length).style.display = \"none\";\r\n\t\t\t\tget(\"icon\" + playerBag.length).style.display = \"none\";\r\n\t\t\t\tget(\"bottom-display\").innerHTML = \"You drop the \" + currItemName + \". It disappears in a puff of black smoke.\";\r\n\t\t\t\tclosedVBox();\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tdisplayInventory(playerBag);\r\n\tgetLocCode();\r\n\tloadZone(playerLocCode, locStorageArray);\r\n}", "function buy_item(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(to_cont, -1*(item.cost*cost_adjustment)),\n put_item(to_cont, item)\n ]);\n }", "function buyItem(user){\n return user\n}", "buyNow(wish) {\n return this.model.findById(wish.user_id).then(data => {\n return data.decrement('balance', { by: wish.price });\n });\n }", "_closeAddNewItem() {\n // Update current Order:\n this.order = this.orderService.getCurrentOrder();\n this.$scope.newItemModal.hide();\n this.item = this.defaultItem;\n }", "processTransaction(product) {\n product.quantity--\n vm.totalMoney += product.price\n vm.currentTransaction -= product.price\n }", "function subtractGold(amount) {\r\n\tgold -= amount;\r\n\tdrawGold();\r\n}" ]
[ "0.63991505", "0.60630536", "0.60042256", "0.598459", "0.59381306", "0.5932423", "0.5908321", "0.5883736", "0.5836178", "0.5832816", "0.58318627", "0.58135724", "0.5797597", "0.5789406", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57611763", "0.57564837", "0.5748568", "0.5744501", "0.5695927", "0.56648153", "0.5660914", "0.565727", "0.56496215", "0.5638502", "0.56204945", "0.5617146", "0.56144357", "0.5609372", "0.5597628", "0.5592609", "0.55654794", "0.5558556", "0.5555106", "0.5537872", "0.5533771", "0.5516751", "0.55054295", "0.5488477", "0.5484757", "0.54828453", "0.5481436", "0.5473592", "0.54729974", "0.54710364", "0.54652923", "0.5463812", "0.54636484", "0.5461369", "0.54600817", "0.54475105", "0.5445719", "0.5444856", "0.5437553", "0.54348475", "0.54294336", "0.5413978", "0.5409685", "0.5406399", "0.54062986", "0.54027987", "0.54010826", "0.54009134", "0.53962827", "0.53900045", "0.53828025", "0.5371916", "0.5360651", "0.53552294", "0.5354044", "0.53518647", "0.53507197", "0.5344646", "0.53374493", "0.5327589", "0.5311951", "0.5311941", "0.5311485", "0.53044796", "0.5302008", "0.52894455", "0.52892685", "0.52728194", "0.5267803", "0.5262838", "0.5258611", "0.52488047", "0.52464366", "0.52439123", "0.5233038", "0.52257097", "0.5224732", "0.5223968", "0.52214235", "0.52205956", "0.5217926" ]
0.6786365
0
\to_cont gets money and item
function buy_item(to_cont, item, cost_adjustment) { return $q.all([ change_gold(to_cont, -1*(item.cost*cost_adjustment)), put_item(to_cont, item) ]); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _recordMoney(rest, item) {\n rest.foodCost += 5\n rest.revenue += floorToCents(item.price)\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "function convertMoney(money) {\n return `$ ${money.toFixed(2).toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")}`\n}", "loadAmount() {\n const { item } = this.state;\n if (item.price !== undefined) {\n var num_parts = item.price.amount.toString().split(\".\");\n num_parts[0] = num_parts[0].replace(/\\B(?=(\\d{3})+(?!\\d))/g, \".\");\n return num_parts.join(\".\");\n }\n }", "function money() {\n new Vivus('money', {\n duration: 250,\n animTimingFunction: Vivus.EASEOUT,\n type: 'oneByOne'\n });\n }", "function makeItCurrency(myNumber) {\r\n var myFormat = formati.getCurrencyFormatter({currency: \"AUD\"});\r\n var newCur = myFormat.format({\r\n number: myNumber\r\n });\r\n return newCur;\r\n }", "function convertTotal(money){\n input = money.toString();\n var test = input.split(\"\");\n if (input.match(/\\./) !== null) {\n var part2;\n for (var i = 0; i < test.length; i++) {\n if (test[i] == \".\") {\n part2 = test.slice(i, i+3);\n test = test.slice(0, i);\n break;\n }\n };\n }\n if (test.length > 3) {\n for (var i = test.length - 3; i > 0; i = i - 3) {\n test.splice(i, 0, \",\");\n };\n }\n if (part2) {\n test = test.concat(part2);\n }\n input = test.join(\"\");\n return '$' + input;\n }", "convert() {\n return `${(this.payments.type.price[this.currencyType] / 100)}`;\n }", "function sell_item_transfer(to_cont, item, cost_adjustment) {\n return $q.all([\n change_gold(item._2o.container(), item.cost*cost_adjustment),\n put_item(to_cont, item)\n ]);\n }", "amt_of(item) { }", "function saveInList(item){\n let myAmount = item.getText().replace(/USD|,/gi,\"\")\n if (myAmount.substring(0,1) === '-'){\n listAmounts.push(parseInt('-'+myAmount.substring(2)))\n }\n else{listAmounts.push(parseFloat(myAmount.substring(2)))} \n }", "function conToDeciPreInf(){\n player.money = new Decimal(player.money)\n player.tickSpeedCost = new Decimal(player.tickSpeedCost)\n player.tickspeed = new Decimal(player.tickspeed)\n player.firstAmount = new Decimal(player.firstAmount)\n player.secondAmount = new Decimal(player.secondAmount)\n player.thirdAmount = new Decimal(player.thirdAmount)\n player.fourthAmount = new Decimal(player.fourthAmount)\n player.fifthAmount = new Decimal(player.fifthAmount)\n player.sixthAmount = new Decimal(player.sixthAmount)\n player.seventhAmount = new Decimal(player.seventhAmount)\n player.eightAmount = new Decimal(player.eightAmount)\n player.firstCost = new Decimal(player.firstCost)\n player.secondCost = new Decimal(player.secondCost)\n player.thirdCost = new Decimal(player.thirdCost)\n player.fourthCost = new Decimal(player.fourthCost)\n player.fifthCost = new Decimal(player.fifthCost)\n player.sixthCost = new Decimal(player.sixthCost)\n player.seventhCost = new Decimal(player.seventhCost)\n player.eightCost = new Decimal(player.eightCost)\n player.sacrificed = new Decimal(player.sacrificed)\n player.totalmoney = new Decimal(player.totalmoney)\n}", "getMoney(){\n return 2000;\n }", "function double_money(){\n arr.forEach(y=>{\n y.wealth=y.wealth.replace(',','')\n y.wealth=y.wealth.replace('$','')\n })\n arr.forEach(x=>{\n x.wealth='$'+(parseInt(x.wealth)*2).toString()+'.00';\n })\n }", "function money(total) {\n let cenT = total * 100\n let re = cenT % val.dollar\n let dollar = cenT - re\n return dollar\n}", "function calcularPrecioItem(item){\n return item.producto.precioProducto * item.cantidad;\n}", "function toCurrency(){\n\n}", "getAmounts() {\n let amountsInEnglish = '';\n\n this.result.forEach( function(amount, money) {\n amountsInEnglish += `<p>${amount} ${counter.convertToEnglish(money)}</p>`;\n });\n\n return amountsInEnglish;\n }", "function getMoney() {\n\t$('entries').apend('<tr><th></th><thd>') + total + '</td></tr>'();\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}", "convertToString() {\n return \"#\" + this.id + \" -- \" + this.type + \" -- \" + this.note + \" -- $\" + this.amount;\n }", "function FormatCurrencies(information) {\r\n var result = \"<p> Currencies: \";\r\n for (var i = 0; i < information.currencies.length; i++) {\r\n result += information.currencies[i].name + \" (\" + information.currencies[i].symbol + \")\";\r\n if (i + 1 < information.currencies.length)\r\n result += \", \";\r\n }\r\n result += \"</p>\";\r\n return result;\r\n}", "function numberOfItemsBasedOnCashAmount(itemPrice,money) {\n\tvar quotient = Math.floor(money/itemPrice);\n\tvar remainder = money%itemPrice;\n\tvar temp = quotient*remainder;\n\tif (isNaN(remainder)) {\n\t\talert(\"You should type only numbers!\")\n\t} else {\n\t\treturn (\"You will purchase \" + quotient + \" items, and you will have \" + remainder + \" change left.\");\n\t\t}\t\n}", "function formatPoolItem (number) {\n\t\treturn parseFloat(number.toFixed(2));\n\t}", "function format(item) {\n if (item < 10) {\n return (item = `0${item}`);\n }\n return item;\n }", "function convertToCurrency(num) {\n return \"AUD \" + num.toFixed(2);\n}", "function Bill(props) {\n /*let ans = '';\n for (let i in userCart) {\n ans += `${userCart[i]}: ${calculator(userCart[i])}+`\n }\n return ans;*/\n const items = props.items;\n return items.map( (item, index) =>\n <div key={index}>\n <h1>{item}: {products[item].price}</h1>\n {products[item].coupon !== '' ? <h5>{products[item].coupon}</h5> : ''}\n <p>current total price = {calculator(item)}</p>\n </div>\n );\n\n// return listItems;\n}", "function money(todo) {\n\tconsole.log(\"$$$$ \" + todo + \" $$$$\");\n}", "function returnChange (money) {\n\n// use MOD it gives you the remainer\n\n var change = {\n twenties : 0,\n tens : 0,\n fives : 0,\n ones : 0,\n quarters : 0,\n dimes : 0,\n nickels : 0,\n pennies : 0\n };\n var moneyAfter = {\n div : 0,\n rem : 0\n };\n var changeKind = [2000, 1000, 500, 100, 25, 10, 5, 1];\n var lookup = {\n twenties : 2000,\n tens : 1000,\n fives : 500,\n ones : 100,\n quarters : 25,\n dimes : 10,\n nickels : 5,\n pennies : 1\n };\n\n moneyAfter.rem = money*100; // get into no decimal cents\n\n// moneyAfter = domination(money, 2000);\n// change.twenties = moneyAfter.div;\n// moneyAfter = domination(moneyAfter.rem, 1000);\n// change.tens = moneyAfter.div;\n\n for (var units in lookup) {\n moneyAfter = domination(moneyAfter.rem, lookup[units]);\n change[units] = moneyAfter.div;\n }\n\n return change;\n\n}", "valueOf() {\n return this.money;\n }", "money(event, d = 2, sm = '.', sd = ','){\r\n let decimal = d,\r\n separator_milhar = sd,\r\n separator_decimal = sd,\r\n decimal_potention = Math.pow(10, decimal),\r\n separator_thousend = `$1` + separator_milhar,\r\n override_value,\r\n value_pointer,\r\n blocks,\r\n parts,\r\n isObj = typeof event == 'object',\r\n isEmpty = event.target.value.length <= 0;\r\n\r\n if(!isObj || isEmpty){\r\n throw new Error('Bad format object');\r\n }\r\n\r\n event.target.setAttribute('maxLength', 20);\r\n\r\n override_value = event.target.value.replace(/\\D/g, '');\r\n value_pointer = (override_value / decimal_potention).toFixed(decimal);\r\n blocks = value_pointer.split('.');\r\n parts = blocks[0]\r\n .toString()\r\n .replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, separator_thousend);\r\n\r\n event.target.value = `R$ ${typeof blocks[1] === 'undefined' ? parts : parts + separator_decimal + blocks[1]}`;\r\n }", "function actualizarPrecioCarritoDlt(item){\n \n totalCarrito = totalCarrito - item.precioItem;\n $(\".shoppingCartTotal\").html(`$ ${totalCarrito.toFixed(2)}`);\n $(\".shoppingCartTotal\").hide()\n $(\".shoppingCartTotal\").fadeIn(\"slow\")\n localStorage.setItem( \"total\", JSON.stringify(totalCarrito));\n}", "static Inventory(name, inv) {\n\n let invString = \"\";\n\n\n const capitalizeFirst = (word) => word.charAt(0).toUpperCase() + word.slice(1);\n\n for(let item in inv) {\n\n let quantity = (inv[item]);\n\n invString += `**${capitalizeFirst(item)} amount:** ${quantity}\\n`;\n\n }\n\n\n\n return new Discord.RichEmbed()\n .setColor(colors.TEAL)\n .addField(`${name}'s Updated Items:`, invString);\n\n\n }", "function amountCovered(claim){\n\tvar paidOutPerClient = '';\n\tvar percent = percentageCovered(claim);\n\t//Amount paid out rounded to the nearest dollar amount.\n\tvar amount = Math.round(claim.visitCost * (percent / 100));\n\t//Add to the total money paid out. Logged at the end.\n\ttotalPayedOut += amount;\n\tpaidOutPerClient += ('Paid out $<mark>' + amount + '</mark> for ' + claim.patientName);\n\t//Add new ol item for each client's details\n\t$('table').append('<tr><td>' + paidOutPerClient + '</td></tr>');\n\tconsole.log('Paid out $' + amount + ' for ' + claim.patientName);\n}", "function displayAmount(value, quantity)\n{\n\tvar result = 0;\n\tresult = toFixed((value * quantity)/100, 2);\n\tresult = result.replace(/(?!^)(?=(?:\\d{3})+(?:\\.|$))/gm, ',');\n\treturn \"$\" + result;\n}", "function floatToMoneyText(value) {\r\n\tvar text = (value < 1 ? \"0\" : \"\") + Math.floor(value * 100);\r\n\ttext = \"R$ \" + text;\r\n\treturn text.substr(0, text.length - 2) + \",\" + text.substr(-2);\r\n}", "function getNumberWithCommas(item) {\r\n return item.toString().replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\r\n}", "function fomart(item) {\n if (item < 10) {\n return (item = `0${item}`)\n }\n return item\n}", "function amountcommi()\n{\n for (var i=0; i<rentals.length;i++)\n {\n //Drivy take a 30% commission on the rental price to cover their costs.\n var commission= rentals[i].price *0.3;\n\n //insurance: half of commission\n rentals[i].commission.insurance = commission *0.5;\n\n //roadside assistance 1€ per day\n rentals[i].commission.assistance = getRentDays(rentals[i].pickupDate,rentals[i].returnDate) +1;\n\n //drivy takes the rest\n rentals[i].commission.drivy= commission - (rentals[i].commission.insurance + rentals[i].commission.assistance);\n }\n\n}", "function cur(num) {\n num = num.toString().replace(/\\$|\\,/g, '');\n if(isNaN(num))\n num = \"0\";\n sign = (num == (num = Math.abs(num)));\n num = Math.floor(num * 100 + 0.5000000001);\n cents = num % 100;\n num = Math.floor(num / 100).toString();\n if(cents < 10)\n cents = \"0\" + cents;\n for (var i = 0; i < Math.floor((num.length - (1 + i)) /3); i++)\n num = num.substring(0, num.length - (4*i+3)) + ',' +\n num.substring(num.length - (4*i+3));\n return (((sign) ? '' : '-') + '$' + num + '.' + cents);\n}", "function ItemCosts({ price, qty }) {\n const itemTotal = calculateItemTotal(price, qty);\n\n return (\n <div className=\"itemTotal\">\n {formatPrice(itemTotal)}\n </div>\n );\n}", "function organizeItemData(_data){\r\r\n // Calculate the cost in gold (it's given via the API in copper cost)\r\r\n let copperCost = _data.buyPrice;\r\r\n let goldCost = 0;\r\r\n \r\r\n // If time permits, optimize further (if copperCost > 100000, go by 100000's)\r\r\n while (copperCost > 0){\r\r\n copperCost -= 1000;\r\r\n goldCost += 1;\r\r\n }\r\r\n character.item_costs[parseInt(_data.id, 10)] = goldCost;\r\r\n}", "moneyInSafe() {\n let money = this.bank.money;\n money += this.moneyOfPlayers;\n money += this.moneyInCustoms;\n return money;\n }", "getPrice() {\n return `${this.price} euros`;\n }", "static toPrettyMoney(value) {\n if (!value)\n return value;\n else\n return new Intl.NumberFormat(\"en-US\",\n { style: \"currency\", currency: \"USD\" }\n ).format(value);\n }", "total (itens) {\n prod1 = list[0].amount\n prod2 = list[1].amount\n prod3 = list[2].amount\n prod4 = list[3].amount\n\n itens = prod1 + prod2 + prod3 + prod4\n\n return itens\n }", "money( num, fixed ) {\n num = parseFloat( num ) || 0;\n fixed = parseInt( fixed ) || 0;\n let o = { style: 'decimal', minimumFractionDigits: fixed, maximumFractionDigits: fixed };\n return new Intl.NumberFormat( 'en-US', o ).format( num );\n }", "function getMoney() {\n\treturn parseInt(currentMoney);\n}", "function CurrencyConvert(v,idx,full) {\n if(idx==undefined) idx = 0;\n var c = CurrencyData[idx];\n v = parseInt(10000*v/c[2])/10000;\n if(v>1 && v<1000) v=parseInt(10*v)/10;\n if(v>=1000 && v<10000) v=parseInt(v/1000)+\"千\";\n else if(v>=10000 && v<100000000) v=parseInt(v/10000)+\"萬\";\n else if(v>=100000000 && v<1000000000000) v=parseInt(v/100000000)+\"億\";\n else if(v>=1000000000000) v=parseInt(v/1000000000000)+\"兆\";\n return v+(full?c[0]+c[1]:\"\");\n }", "function formatMoney(amount){\r\n return \"$\" + amount.toFixed(2)\r\n}", "get totalMoney(){\n return this.orderInfo.total_money;\n }", "function getItemValue(price, quantity) {\n return currency(price)\n .multiply(quantity.toString())\n .format();\n}", "function itemsResumo() {\n const itemProduto = document.querySelector('.item-produto');\n const itemQuantidade = document.querySelector('.item-qtd');\n const itemPreco = document.querySelector('.item-preco');\n itemsComprados.forEach((item) => {\n const itemDescricao = document.createElement('span');\n const itemQtd = document.createElement('span');\n const itemValor = document.createElement('span');\n itemDescricao.appendChild(\n document.createTextNode(\n 'Vestido Preto One (Decote: ' +\n item.decote +\n ', Manga: ' +\n item.manga +\n ', Comprimento: ' +\n item.comprimento +\n ', Tamanho: ' +\n item.tamanho\n )\n );\n itemQtd.appendChild(document.createTextNode(item.quantidade));\n itemValor.appendChild(\n document.createTextNode(\n (item.quantidade * 154.99).toLocaleString('pt-BR', {\n style: 'currency',\n currency: 'BRL',\n })\n )\n );\n itemProduto.appendChild(itemDescricao);\n itemQuantidade.appendChild(itemQtd);\n itemPreco.appendChild(itemValor);\n });\n}", "function buyInShop(money,price){\n\t\t\tvar amount=Math.floor(money/price);\n\t\t\t\n\t\t\treturn [amount,amount]\n\t\t}", "function mostrarCarritoRecuperado()\n{\n for (const precio of carritoRecuperado)\n {\n precioRecuperado = precio.precio + precioRecuperado;\n }\n $(\"#precioDelCarrito\").text(`Total: $${precioRecuperado}`);\n\n// SI HAY ITEMS EN EL CARRITO, MUESTRA PRODUCTOS\n for (const nombre of carritoRecuperado)\n {\n listaRecuperada.push(nombre.nombre+\"<br>\");\n }\n $(\"#productosEnCarrito\").append(listaRecuperada);\n\n// VUELVO A PUSHEAR LOS ITEMS EN EL CARRITO\n for (const item of carritoRecuperado)\n {\n carrito.push(item);\n }\n\n// ACTUALIZO EL CONTADOR DEL CARRITO\n contadorCarrito();\n\n}", "asText() {\nreturn this._makeText(`${this.amount}`);\n}", "function buyItem(){\n var amount= $.getElementById(\"userInput\").value;//gets an integer from the user\n var price= p*amount*tax;// takes integer multiply it by two dollars which is the price\n document.getElementById(\"userInput\").value=\"\";//clears the input box\n var total= \"you bought\"+\" \"+\"$\"+price.toFixed(2)+ \" of Banana Lumpia\";//takes price displays it as you bought_ of bana\n \n \n var li= document.createElement('li');//creates a lists\n var newText=document.createTextNode(total);// gets total and saves it as newtext\n li.appendChild(newText);//puts newtext and total together\n var olTag=document.getElementById(\"recipt\");//\n olTag.appendChild(li);\n\n \n }", "function createConsumableItem(item) {\n var output = \"\";\n\n // create the output\n output += \"<div class='characterSheetItemFormatter' style='height:110px'>\";\n output += \"<div class='characterSheetHeader' style='float:left; width: 95px'>\";\n output += \"<b>\" + item.name + \"</b></div><div class='characterSheetHeader' style='float: left; \";\n output += \"width: 22px; text-align: right'>\" + item.quantity + \"</div>\";\n output += \"<div class='characterSheetHeader' style='width: 125px; height: 80px; \";\n output += \"text-align: center; display: table-cell; vertical-align: middle; margin:auto'>\";\n output += \"<img src='\" + item.image;\n output += \"' onmouseover=\\'showToolTip(\\\"\";\n output += \"<b>\" + item.name + \"</b><br>\" + item.description;\n output += \"\\\");\\' onmouseout=\\\"hideToolTip()\\\" onclick=\\\"removeToolTip();\\\" \";\n output += \"style=\\\"cursor: pointer; \\\"\";\n output += \"' /></div></div>\";\n \n return output;\n}", "function money(amt) {\n let dollars = \"$\" + Number.parseFloat(amt).toFixed(2);\n return dollars;\n}", "get price() {\n const {\n priceMoney\n } = this.defaultVariation.itemVariationData;\n // item price money can be undefined, then we default to 0.00\n return priceMoney ? `${(parseInt(priceMoney.amount)/100).toFixed(2)}` : 0.00;\n }", "function formatMoney(num) {\n return num.toLocaleString('en-US', {style: 'currency', currency: 'USD'});\n }", "toFormattedQuantityUnit(value) {\n if (value >= 1000000)\n return format('%.2fM', value / 1000000);\n else if (value >= 1000)\n return format('%.2fk', value / 1000);\n else\n return format('%.2f', value);\n }", "function parseItemValue(value) {\n\t\tparseItemValue.cache = parseItemValue.cache || {};\n\t\tif (value) {\n\t\t\tif (parseItemValue.cache[value]) {\n\t\t\t\treturn parseItemValue.cache[value];\n\t\t\t}\n\t\t\t\n\t\t\tvar val = parseInt(value);\n\t\t\tif (val) {\n\t\t\t\tvar copper = val % 10;\n\t\t\t\tvar silver = (val % 100 - copper) / 10;\n\t\t\t\tvar gold = (val - silver * 10 - copper) / 100;\n\t\t\t\t\n\t\t\t\tvar text = '';\n\t\t\t\tif (copper) {\n\t\t\t\t\ttext = '<span class=\"item-value-copper\">' + copper + '</span>';\n\t\t\t\t}\n\t\t\t\tif (silver) {\n\t\t\t\t\ttext = '<span class=\"item-value-silver\">' + silver + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tif (gold) {\n\t\t\t\t\ttext = '<span class=\"item-value-gold\">' + gold + '</span> ' + text;\n\t\t\t\t}\n\t\t\t\tparseItemValue.cache[value] = text;\n\t\t\t\treturn text;\n\t\t\t}\n\t\t}\t\n\t\treturn '';\n\t}", "renderItem() {\n const { tree } = this.props;\n let amount = tree.amount;\n let result = \"\";\n if (tree === undefined) return;\n if (amount !== 0) {\n if (isNaN(amount)) amount = 0;\n result += amount += \" \";\n }\n if (tree.name !== \"\") {\n result += tree.name + \"s\";\n }\n\n return result;\n }", "get subtotal_ex_tax() {\n let sub = 0.0;\n self.items.map((i) => {\n sub += i.price * i.quantity;\n return sub;\n });\n return sub.toFixed(2);\n }", "get subtotal_ex_tax() {\n let sub = 0.0;\n self.items.map((i) => {\n sub += i.price * i.quantity;\n return sub;\n });\n return sub.toFixed(2);\n }", "formPackage(allItems) {\n var items = '',totalWeight = 0,totalPrice = 0,courierPrice = 0;\n allItems.forEach((val, index) => {\n if(items == '') items = val.Name;\n else items += ', '+val.Name;\n\n totalWeight += parseInt(val.Weight);\n totalPrice += parseInt(val.Price);\n })\n courierPrice = this.findCourierCharge(totalWeight);\n totalWeight = totalWeight+'g';\n totalPrice = '$'+totalPrice;\n\n return {'items': items, 'tw': totalWeight, 'tp': totalPrice, 'cp': courierPrice};\n }", "function carrito(item, add) {\n if (item == 0 && add == 0 && aItem > 0) {\n aItem--;\n aStr = \"\" + aItem;\n document.getElementById(\"cantidad1\").innerHTML = \"Cantidad: \" + aStr;\n }\n if (item == 0 && add == 1) {\n aItem++;\n aStr = \"\" + aItem;\n document.getElementById(\"cantidad1\").innerHTML = \"Cantidad: \" + aStr;\n }\n if (item == 1 && add == 0 && bItem > 0) {\n bItem--;\n bStr = \"\" + bItem;\n document.getElementById(\"cantidad2\").innerHTML = \"Cantidad: \" + bStr;\n }\n if (item == 1 && add == 1) {\n bItem++;\n bStr = \"\" + bItem;\n document.getElementById(\"cantidad2\").innerHTML = \"Cantidad: \" + bStr;\n }\n if (item == 2 && add == 0 && cItem > 0) {\n cItem--;\n cStr = \"\" + cItem;\n document.getElementById(\"cantidad3\").innerHTML = \"Cantidad: \" + cStr;\n }\n if (item == 2 && add == 1) {\n cItem++;\n cStr = \"\" + cItem;\n document.getElementById(\"cantidad3\").innerHTML = \"Cantidad: \" + cStr;\n }\n if (item == 3 && add == 0) {\n resultado = (aItem * 5000 + bItem * 2000 + cItem * 500) * 1.16;\n rStr = \"\" + resultado;\n document.getElementById(\"checkout\").innerHTML = \"Total: \" + \"$\" + rStr;\n }\n return 0;\n}", "function changeMaker(coins, val){\n let remainingAmount = val\n\n\n let coinsUsed = {\n numberOfCoins: 0\n }\n\n\n for(const item of coins){\n const count = Math.floor(remainingAmount / item);\n // this creates the key-value pair inside the coinsUsed object \n coinsUsed[item] = count\n remainingAmount = remainingAmount - (item * count)\n coinsUsed.numberOfCoins += count\n }\n return coinsUsed;\n}", "function totalCarrito(carrito) {\n console.log(carrito);\n let total = 0;\n carrito.forEach(p => total += p.subtotal());\n return total.toFixed(2);\n}", "function prixTotal() {\n let total = 0;\n for (let j= 0; j < objPanier.length; j++) {\n total = total + objPanier[j].price * objPanier[j].number;\n }\n let afficheTotal = document.querySelector(\"#total\");\n afficheTotal.textContent=(\"Total : \" + (total / 100).toLocaleString(\"fr\") + \" €\");\n}", "function formatButton(button, paymentitems, paymentitemsbonus, iap) {\n function findItemByCCost(paymentitems, ccost) {\n var ret = {};\n _.forEach(paymentitems, function(item) {\n if (item.ccost == ccost) {\n ret = item;\n // break;\n return false;\n }\n });\n return ret;\n }\n\n var item = findItemByCCost(paymentitems, button.ccost);\n var itembonus = findItemByCCost(paymentitemsbonus, button.ccost);\n // \"value\": \"40K Gold\",\n // \"bonus\": \"+80K Chip\",\n // \"cost\": \"10K VND\",\n // \"syntax\": \"mw 10000 teen NAP 52fun-ann2009-1\",\n // \"add\": \"+9029\",\n button['carrier'] = usercarrier;\n var value = item[\"value\"]; // cần format cái này\n button['value'] = numeral(value).format('0,0');\n if (button.ctype == 0) // chip\n button['value'] += ' Chip';\n else // ctype == 1 -> Gold\n button['value'] += ' Gold';\n if (iap) {\n button['cost'] = item[\"USD\"];\n } else {\n button['cost'] = button[\"ccost\"] + \" VND\";\n }\n if (button.bstyle == 1) { // giá cũ/ giá mới\n var newvalue = itembonus[\"value\"] * (100 + button['bvalue']) / 100;\n button['bonus'] = numeral(newvalue).format('0,0');\n } else { // giá cũ/ bonus\n var bonus = itembonus[\"value\"] * (0 + button['bvalue']) / 100;\n button['bonus'] = \"+\" + numeral(bonus).format('0,0');\n }\n // button['bonus'] = numeral(button['bonus']).format('0.0a');\n if (button.btype == 0) // chip\n button['bonus'] += ' Chip';\n else\n button['bonus'] += ' Gold';\n if (button.type == \"sms\") {\n button['add'] = item[\"add\"];\n var smssyntax = item[\"content\"];\n smssyntax = _.replace(smssyntax, new RegExp(\"%user%\", \"g\"), username);\n button['syntax'] = _.replace(smssyntax, new RegExp(\"%type%\", \"g\"), button['ctype']);\n }\n\n if (usercarrier == 'unknown') {\n button['add'] = \"\";\n button['syntax'] = \"\";\n }\n\n\n return button;\n }", "function precioSubtotal(article) {\n units = document.getElementById(\"cart_\"+article+\"_units\").value;\n units_price = cart_products_info.articles[article].unitCost\n subtotal = units*units_price\n document.getElementById(\"cart_\"+article+\"_cost\").innerHTML = \"<strong> UYU \" + convertir(cart_products_info.articles[article].currency)*subtotal + \"</strong>\"; /// Convertir() pasa de dolares a uruguayos ///\n}", "changePrice() {\n var parts = this.precio.toFixed(2).toString().split(\".\");\n var result = parts[0].replace(/\\B(?=(\\d{3})+(?=$))/g, \".\") + (parts[1] ? \",\" + parts[1] : \"\");\n return `$${result}`;\n }", "function calcItemPrice(baseCost, quantity, frameCost, glassCost, mattID) {\n var cost = (baseCost + frameCost + glassCost) * quantity;\n if(mattID != 35) { cost += (10 * quantity);}\n return formatMoney(cost);\n }", "function formatoCurrency(valor) {\n var currency = 0;\n currency = valor.toFixed(2).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, \"$1,\");\n return currency;\n}", "function actualizarPrecioCarrito(){\n totalCarrito = 0;\n carrito = actualizarCantidades();\n\n for(const item of carrito){\n let nuevoPrecioItem = calcularPrecioItem(item);\n item.precioItem = nuevoPrecioItem;\n //console.log(nuevoPrecioItem);\n totalCarrito = totalCarrito + nuevoPrecioItem;\n }\n \n $(\".shoppingCartTotal\").html(`$ ${totalCarrito.toFixed(2)}`);\n $(\".shoppingCartTotal\").hide()\n $(\".shoppingCartTotal\").fadeIn(\"slow\")\n \n localStorage.setItem( \"productos\", JSON.stringify(carrito));\n localStorage.setItem( \"total\", JSON.stringify(totalCarrito));\n}", "function Moneyformat() {\n $('.rate , .quantity').keyup(function (event) {\n // skip for arrow keys\n if (event.which >= 37 && event.which <= 40) return;\n // format number\n $(this).val(function (index, value) {\n return value.replace(/\\D/g, \"\").replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n });\n });\n }", "function formatCurrencyOrData(account) {\n if (account.unitOfMeasure == 'money') {\n return formatCurrency(account.accountBalance);\n } else {\n return account.accountBalance + \" MB\"\n\n }\n}", "async showQuantities() {\n const character = this.character;\n const item = this.info.item;\n const buyItem = Items.new(item);\n let actions = new Actions();\n\n let style = buyItem.canBePurchasedBy(character, 1) ? 'default' : 'danger';\n actions.addButton(\"Buy 1\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 1 }, style });\n\n style = buyItem.canBePurchasedBy(character, 5) ? 'default' : 'danger';\n actions.addButton(\"Buy 5\", COMMAND_NAME, {params: { action: ACTION_BUY, item, quantity: 5 }, style });\n\n style = buyItem.canBePurchasedBy(character, 10) ? 'default' : 'danger';\n actions.addButton(\"Buy 10\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 10 }, style });\n\n style = buyItem.canBePurchasedBy(character, 25) ? 'default' : 'danger';\n actions.addButton(\"Buy 25\", COMMAND_NAME, { params: { action: ACTION_BUY, item, quantity: 25 }, style });\n\n actions.addButton(\"Cancel\", \"look\", { params: { resetDescription: \"true\" } });\n\n await this.updateLast({\n attachments: Attachments.one({\n title: \"How many do you want to buy?\",\n fields: this.character.getFields(),\n actions\n })\n });\n }", "asText4() {\nreturn this._makeText(`${this.amount.toFixed(4)}`);\n}", "format() {\n return `${this.client} owes Ksh${this.amount} for ${this.detail}`;\n }", "calulatingChange(change, price, cost) {\n let amountOwned = cost - price;\n if (amountOwned === 0) {\n return 0;\n }\n const valueOfCoin = [\n { name: \"TOONIES\", value: 2.0 },\n { name: \"LOONIES\", value: 1.0 },\n { name: \"QUARTERS\", value: 0.25 }\n ];\n const changeReturned = change.reduce((received, currency) => {\n received[currency[0]] = currency[1]; //compare value received to current value\n return received;\n }, {});\n const amountOfCoin = valueOfCoin.reduce((received, currency) => {\n let amount = 0;\n\n while (currency.value <= amountOwned && amountOwned !== 0) {\n amountOwned -= currency.value;\n changeReturned[currency.name] -= currency.value;\n amount++;\n }\n if (amount > 0) {\n received.push([currency.name, amount]);\n }\n return received;\n }, []);\n change.forEach(asset => {\n asset[1] = changeReturned[asset[0]];\n return amountOfCoin;\n });\n }", "function compute_subtotal(items) {\n\t$(\".wddp-shopping-cart\").text(\"Shopping cart total: $\" + Object.values(items).reduce((x, y) => (x + y), 0));\n}", "function decrimentQuantity(){\n if(quantity > 1){\n let currentCost = (document.getElementById(\"cat-harness-item-cost\").innerHTML).replace( /^\\D+/g, '');\n totalCost = totalCost-(parseInt(currentCost)/(quantity));\n }\n quantity = parseInt(document.getElementById(\"num-items\").innerHTML, 10) - 1;\n if (quantity < 1) { quantity = 1; }\n document.getElementById(\"num-items\").innerHTML = quantity;\n document.getElementById(\"cat-harness-item-cost\").innerHTML = \"$\" + totalCost;\n \n}", "function cleanMoney(num){\n var out = '', str = String(num);\n for (var i = 1; i <= str.length; i++){\n var x = str.charAt(str.length - i);\n out = x + out;\n if (i % 3 === 0 && i < str.length &&\n !((str.includes('.')) && i === 3)){\n out = ',' + out;\n }\n }\n out = '$' + out;\n return out;\n }", "function costWithTax(item) {\n return parseFloat( item.price + taxForItem(item) );\n }", "inventoryValue() {\n return this.inventory.reduce((total, book) => total + book.price, 0);\n }", "function addBudget(){\n return nicaragua.annualBudget +250000;\n}", "inventoryValue() {\n return this.inventory.reduce(total, book) => {\n total += book.price;\n }", "function getBalance(toPrepare, me) {\n const delta = toPrepare.delta;\n const inv = me.inv;\n let balance = [0, 0, 0, 0];\n for (let idx = 0; idx < 4; ++idx) {\n balance[idx] = delta[idx] + inv[idx];\n }\n return balance;\n}", "function addViareduce(value, currentItem){\n\treturn value + currentItem;\n\n}", "function calculCommission () {\n for (var i = 0; i < deliveries.length; i++) {\n var commission = deliveries[i].price * 0.3;\n deliveries[i].commission.insurance = commission / 2;\n deliveries[i].commission.treasury = Math.floor(deliveries[i].distance/500) + 1\n deliveries[i].commission.convargo = commission - deliveries[i].commission.insurance - deliveries[i].commission.treasury\n }\n}", "function formatMoney(number){\r\n\treturn '$' + number.toFixed(2).replace(/\\d(?=(\\d{3})+\\.)/g, '$&,');\r\n}", "function formatAsMoney(amount) {\r\n\t return '$' + parseFloat(amount, 10).toFixed(2).replace(/(\\d)(?=(\\d{3})+\\.)/g, \"$1,\").toString();\r\n\t }", "amountOfCurrency() {\r\n let id = this.props.currency.id;\r\n let amount = this.state.product.prices[id].amount;\r\n return getFormattedCurrency(this.props.currency.name, amount);\r\n }", "function formatMoney(amount){\r\n let decimal = Math.round((amount - parseInt(amount))*100)/100\r\n let arr = Array.from(String(decimal.toString()), Number)\r\n let newArr = arr.slice(-2)\r\n let empty = []\r\n if(parseFloat(amount) == parseInt(amount)){\r\n empty.push(\"0\")\r\n empty.push(\"0\")\r\n return (\"$\" + parseInt(amount)) + \".\" + empty.join(\"\")\r\n }else if(newArr.join(\" \").includes('NaN')){\r\n newArr = newArr.slice(-1)\r\n newArr.push(\"0\")\r\n let result = (\"$\" + parseInt(amount)) + \".\" + newArr.join(\"\")\r\n return result\r\n }else if(newArr.length = 2){\r\n let result = \"$\" + (parseInt(amount) + parseFloat(\".\" + newArr.join(\"\")))\r\n return result\r\n }\r\n }", "function somarInventarioDepartamento(departamento) {\n let somaInventario = 0;\n for (p in listaProdutos) {\n if (listaProdutos[p].departamento.nomeDepto == departamento) {\n somaInventario += listaProdutos[p].qtdEstoque * listaProdutos[p].preco\n }\n }\n somaInventario = somaInventario.toLocaleString('pt-BR', {style: 'currency', currency: 'BRL'});\n return {departamento, somaInventario};\n}", "function formatAmount(amount){\n return \"$\" + amount.toFixed(2);\n}", "function renderCurrentMoney(money) {\n $(\"#currentMoney\").html(\"<div>You currently have $\" + money + \"</div>\");\n }" ]
[ "0.6196287", "0.6105152", "0.5942234", "0.5917596", "0.58974034", "0.582925", "0.5816826", "0.5787249", "0.5771156", "0.57099897", "0.5675126", "0.5673713", "0.5654836", "0.56474245", "0.5618255", "0.55915976", "0.5585326", "0.5561582", "0.5555752", "0.5553342", "0.55374587", "0.54973215", "0.5496985", "0.5492785", "0.5473568", "0.5467959", "0.5466863", "0.54597825", "0.5451721", "0.5435551", "0.5432011", "0.54316586", "0.54256034", "0.5425152", "0.54100585", "0.54050577", "0.5400849", "0.5398318", "0.53934073", "0.53838456", "0.5378374", "0.537836", "0.53694147", "0.53682643", "0.5361012", "0.5356718", "0.5352792", "0.5322611", "0.5315246", "0.53125554", "0.5284718", "0.5284569", "0.5281906", "0.52789944", "0.5270238", "0.52678996", "0.5264524", "0.5261943", "0.52618515", "0.5258396", "0.52506316", "0.5247905", "0.5244105", "0.5239446", "0.52391595", "0.52391595", "0.52345186", "0.5231784", "0.5225038", "0.52249897", "0.522383", "0.5210665", "0.5204921", "0.5204784", "0.5199732", "0.51989794", "0.5194998", "0.5193164", "0.5189737", "0.51867384", "0.51835746", "0.5183279", "0.5178788", "0.51781607", "0.51631725", "0.5161537", "0.515892", "0.51578265", "0.51534605", "0.5152534", "0.5152437", "0.5151013", "0.5141684", "0.513581", "0.51357293", "0.5133988", "0.51329863", "0.51295686", "0.5128537", "0.5120752" ]
0.6338091
0
Handles item instances and item dicts
function put_item(to_cont, item) { to_cont._2m.items().push(item); item.container = to_cont.id; item._2o.container = function(){ return to_cont; }; if(item.id) return EM.update('item', item); else return Oit.new_item(item).then(function(newE) { U.replace(to_cont._2m.items(), item, newE); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "processItems() {}", "function Item(item) {\n this.id = item.id\n this.name = item.name\n this.itemWeight = item.item_weight\n this.value = item.value\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}", "initItem(item) {\n if (!item || typeof(item)!==\"object\") item = {};\n return item;\n }", "function _itemHandler() {\n\t _tracks = [];\n\t _tracksById = {};\n\t _unknownCount = 0;\n\t }", "get item(){ return this._item || {}; }", "function itemObject(code, category, simpleName, fullName, desc, uses, effect, what, val) {\r\n\tthis.code = code; //code used for quickly finding in items array\r\n\tthis.category = category; //category (item, weapon, armor, potion)\r\n\tthis.simpleName = simpleName; //simple name \r\n\tthis.fullName = fullName; //full name \r\n\tthis.desc = desc; //description of item\r\n\tthis.uses = uses; //# of uses before the item is gone. on hover, check if uses == num, display certain text (full, half full, etc, nearly empty, etc)\r\n\tthis.effect = effect; //desc of effect for tooltip / item menu\r\n\tthis.what = what; //pass into function to clarify what it effects.\r\n\tthis.val = val; // \r\n}", "constructor(item_data) {\n this.item_data = item_data\n }", "function convertItem(item) {\n var converted = Object.create(item || {});\n if (item.property) {\n converted.key = addKey(item.property);\n }\n if (item.method) {\n converted.click = function (v) {\n invoke(item.method, v);\n };\n }\n return converted;\n }", "get item() {\n return this._item;\n }", "get item () {\n\t\treturn this._item;\n\t}", "function ACItemHandler(model, item, itemName)\n{\n ACItemHandler.baseConstructor.call(this);\n this.model = model;\n\tthis.itemName = itemName;\n\n\t// Match criterion is \"id\", \"code\", or \"tag\". Default is \"id\".\n this.matchCriterion = \"id\"; \n\t\n\tthis.setItem(item);\n}", "function trapItemDetails() {\n\n console.log(GM_info.script.name + ': trapItemDetails');\n\n //debugger;\n\n let parentDiv = $('div.ReactVirtualized__Grid').get();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = $(parentDiv).find('div.info___3-0WL').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n //let pricingUl = $(clearfix).find('ul.info-cont')[0];\n //if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n //getNameTypeItemInfo(owlItem, newItem);\n //getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log(GM_info.script.name + ': newItem: ', newItem);\n\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 }", "get item() {\n\t\treturn this.__item;\n\t}", "addItem(_item) { }", "get item(){\n return items[this.itemID]\n }", "prepareData() {\n super.prepareData();\n\n // Get the Item's data\n const itemData = this.data;\n const actorData = this.actor ? this.actor.data : {};\n const data = itemData.data;\n\n // console.log(itemData);\n\n if (itemData.type === 'melee weapon') this._prepareMeleeData(itemData, actorData);\n if (itemData.data.mechanika) this._prepareMechanikaData(itemData);\n if (itemData.type === 'mechanika ranged weapon') this._prepareMrwData(itemData, actorData);\n // if (itemData.type === 'grid') this._prepareGrid(itemData, actorData);\n }", "_processItems()\n\t{\n\t\tconst response = {\n\t\t\torigin: \"Form._processItems\",\n\t\t\tcontext: \"when processing the form items\",\n\t\t};\n\n\t\ttry\n\t\t{\n\t\t\tif (this._autoLog)\n\t\t\t{\n\t\t\t\t// note: we use the same log message as PsychoPy even though we called this method differently\n\t\t\t\tthis._psychoJS.experimentLogger.exp(\"Importing items...\");\n\t\t\t}\n\n\t\t\t// import the items:\n\t\t\tthis._importItems();\n\n\t\t\t// sanitize the items (check that keys are valid, fill in default values):\n\t\t\tthis._sanitizeItems();\n\n\t\t\t// randomise the items if need be:\n\t\t\tif (this._randomize)\n\t\t\t{\n\t\t\t\tutil.shuffle(this._items);\n\t\t\t}\n\t\t}\n\t\tcatch (error)\n\t\t{\n\t\t\t// throw { ...response, error };\n\t\t\tthrow Object.assign(response, { error });\n\t\t}\n\t}", "function Item(listItem) {\n this.listItem = listItem\n}", "function useItem(){\n\t\n}", "function CustomItem(_item,_index){\r\r this.index = _index;\r this.item = _item;\r }", "_handleItem(item)\n {\n var formData = new FormData();\n formData.append(\"item\", item);\n const requestOptions = \n {\n method: 'POST',\n body: formData,\n }\n // fetch item from database item table\n fetch('https://mi-linux.wlv.ac.uk/~2006100/ci3/index.php/Game/getItem', requestOptions)\n .then(res => res.json())\n .then(data => {\n \n const item = data[0];\n \n // check to see if item is a potion or equipment\n if(item.type === 'consumable') this._drinkPotion();\n else this._equipItem(item);\n \n })\n .catch(console.log);\n\n \n }", "async processItem ({item, h}) {\n if (item.type != 'page') return\n const data = fs.readFileSync(h.pathItemSrc(item), 'utf8')\n if (data) item.data = data \n }", "get item() {\n if (!this._item) {\n this._item = this._buildItem();\n }\n\n return this._item;\n }", "function handleShortcut(item) {\n const {type, data} = item;\n console.log('Handle Logic', item);\n // your handling logic\n }", "function Item(itemDescription, itemLink) // Constructor \n{ \n // constant data \n this.desc = itemDescription \n this.link = itemLink \n this.id = -1 //initialized in initalize() \n this.navObj = 0 //initialized in render() \n this.iconImg = 0 //initialized in render() \n this.iconSrc = item \n \n // methods \n this.initialize = initializeItem \n this.createIndex = createEntryIndex \n this.hide = hideItem \n this.display = display \n this.renderOb = drawItem \n this.totalHeight = totalHeight \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 Item(key, value) {\n this.key = key;\n this.value = value;\n}", "renderItem(item) { return item; }", "function Item(name,desc)\n{\n this.name=name;\n this.desc=desc\n}", "function Item(){\n\t// Sort of abstract func\n\tthis.addToDocument = function(){\n\t\tdocument.body.appendChild(this.item);\n\t}\n\tthis.addTo = function(node){\n\t\tnode.item.appendChild(this.item);\n\t}\n}", "static initialize(obj, type, items) { \n obj['type'] = type;\n obj['items'] = items;\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 Item(code, title, category, price, image){\r\n this.code = code;\r\n this.title = title;\r\n this.category = category;\r\n this.price = price;\r\n this.image = image;\r\n this.user = \"Brit\";\r\n\r\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 }", "function Item(code, title, price, desc, cat, rating, image ){\n this.code= code;\n this.title = title;\n this.price = price;\n this.description = desc;\n this.category = cat;\n this.rating = rating;\n this.image = image;\n this.user = \"Oliver\";\n\n}", "function Item(dbItem) {\n for (let key in dbItem) {\n this[key] = dbItem[key];\n }\n\n // We need something to identify the item by. We use nr.\n this.id = this.nr;\n\n // Convert various string fields to their boolean/numeric\n // counterparts\n this.kosher = this.kosher === \"1\";\n this.organic = this.organic === \"1\";\n this.priceinclvat = Number(this.priceinclvat);\n}", "function ItemName(obj) { this.obj = obj; }", "function itemObjectConstruct(id, input, complete)\n{\n\tthis.id=id;\n\tthis.item=input;\n\tthis.complete=complete;\n}", "function Item(content) {\n this.content = content;\n this.timeCreated = new Date().toGMTString();\n }", "function Item(){\n\t\n\tthis.type = '';\n\tthis.id;\n\tthis.opinions = Array();\n\tthis.setTrustPercent = function(val){\n\t\tif(val != null)\n\t\tthis.trust = val;\n\t\telse\n\t\tthis.trust = 0;\n\t}\n\t\n\tthis.setReviewScore = function(val){\n\t\tif(val != null)\n\t\tthis.reviewScore = val;\n\t\telse\n\t\tthis.reviewScore = 0;\n\t}\n\t\n\tthis.Meta = function (name,category,location,image){\n\t\tif(name != null)\n\t\tthis.name = name;\n\t\telse\n\t\tthis.name = '';\n\t\t\n\t\tif(category != null)\n\t\tthis.category = category;\n\t\telse\n\t\tthis.category = '';\n\t\t\n\t\tif(location != null){\n\t\t\tthis.lat = location['lat'];\n\t\t\tthis.lon = location['lon'];\t\n\t\t}\n\t\n\t\tif(image != null)\n\t\tthis.image = image;\n\t\telse\n\t\tthis.image = this.type+ imgType;\n\t\t\n\t}\n\t\n\t\n\tfunction MakeOpinion(author,image,rating,opinion){\n\t\t\n\t\tif(author != null)\n\t\tthis.author = author;\n\t\t\n\t\tif(image != null)\n\t\tthis.image = image;\n\t\telse\n\t\tthis.image = 'noImage.jpg';\n\t\t\n\t\tif(rating != null)\n\t\tthis.rating = rating;\n\t\t\n\t\tif(opinion != null)\n\t\tthis.opinion = opinion;\n\t\t\n\t\treturn this;\n\t}\n\t\n\tthis.setMeta = function(val){\n\t\tif(val != null)\n\t\tthis.Meta(val['name'],val['category'],val['location'],val['image']);\n\t}\n\t\t\n\tthis.setOpinions = function (val,count){\n\t\t/* Set Opinions*/\n\t\tfor(var i = 0 ; i < val.length ; i++){\n\t\t\tthis.opinions.push( new MakeOpinion(val[i]['author'],val[i]['image'],val[i]['rating'],val[i]['opinion']));\n\t\t}\n\t\tconsole.log(this.opinions);\n\t}\n\t\n\tthis.setOpinion = function(val){\n\t\tif(val != null){\n\t\t\tthis.opinionCount = val['count']; \n\t\t\tif(val['list'] != null){\n\t\t\t\t//this.setOpinions(val['list'],this.opinionCount);\n\t\t\t\tlist = val['list']\n\t\t\t\tthis.opinions = Array();\n\t\t\t\tfor(var i = 0 ; i < list.length ; i++){\n\t\t\t\t\tthis.opinions[i] = new MakeOpinion(list[i]['author'],list[i]['image'],list[i]['rating'],list[i]['opinion']);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} \n\t\n\tthis.print = function(i){\n\t\t\n\t\t\n\t\theader = $('<h2>').html(this.name);\n\t\timg = $('<img>').attr('src',this.image).addClass('img');\n\t\timg.attr('draggable','false');\n\t\tdiv = $('<div>').addClass('item').attr('itemId',this.id).append(img).append(header);\n\t\t\n\t\tn = this.trust;\n\t\tconsole.log(n);\n\t\tg=Math.round((255*n)/100)\n\t\tr=Math.round((255*(100-n))/100); \n\t\tb=0\n\t\tcolor = rgbToHex(r,g,b);\n\t\tconsole.log(color);\n\t\t//if(this.trust > 90){\n\t\t\tdiv.append($('<div>').addClass('star').attr('title',\"Trust: \" + this.trust).css('background-color',color));\n\t\t//}\n\t\t\n\t\tif(this.lat != null && this.lon != null){\n\t\t\tdiv.attr('lat',this.lat).attr('lon',this.lon);\n\t\t\tlat = this.lat;\n\t\t\tlon = this.lon\n\t\t\tdiv.append($('<div>').addClass('map').attr('title','Location on Map').click(function (e){\n\t\t\t\te.stopPropagation();\n\t\t\t\tfetchMap(lat,lon,this);\n\t\t\t})); //attr('onClick','fetchMap(this)')\n\t\t}\n\t\t\n\t\tif(this.reviewScore != null){\n\t\t\tprogress = $('<progress>');\n\t\t\tprogress.attr('value',this.reviewScore);\n\t\t\tprogress.attr('max',100);\n\t\t\tprogress.attr('class','progBar');\n\t\t\tprogress.attr('title',\"Review Score: \" + this.reviewScore);\n\t\t\tdiv.append(progress);\n\t\t\t//div.append($('<progress>') value=\"' + (this.reviewScore) +'\" max=\"100\" id=\"progBar\">').html);\n\t\t}\n\t\t\n\t\tif(this.opinions.length > 0){\n\t\t\topinionsDiv = $('<div>').addClass('opinion').css('display','none');\n\t\t\topinionsDiv.append($('<h1>').html('Reviews').addClass('review'));\n\t\t\tfor(o = 0;o < this.opinions.length;o++){\n\t\t\t\timg = $('<img>');\n\t\t\t\timg.attr('src',this.opinions[o].image);\n\t\t\t\timg.attr('width','32px');\n\t\t\t\timg.css('width','32px');\n\t\t\t\timg.css('margin-left','4px');\n\t\t\t\tif(o > 0)\n\t\t\t\topinionsDiv.append($('<hr>'));\n\n\t\t\t\tleft = $('<div>').append(img).css({'float':'left','width':'32px'});\n\t\t\t\tright = $('<div>').append($('<h3>').html(this.opinions[o].author)).addClass('author');\n\t\t\t\tright.append(this.opinions[o].opinion);\n\t\t\t\tmainDiv = $('<div>').append(left);\n\t\t\t\tmainDiv.append(right);\n\t\t\t\topinionsDiv.append(\n\t\t\t\t\tmainDiv\n\t\t\t\t\t/*$('<p>').append(\n\t\t\t\t\t\timg\n\t\t\t\t\t).append(this.opinions[o].opinion)*/\n\t\t\t\t);\n\t\t\t\t\n\t\t\t}\n\t\t\tdiv.append(opinionsDiv);\n\t\t}else{\n\t\t\tdiv.append($('<div>').addClass('opinion').css('display','none'));\n\t\t}\n\t\t\n\t\tdiv.click(function (e){\n\t\t\tmoveMe(this,true);\n\t\t\te.stopPropagation();\n\t\t});\n\t\t\n\t\tdiv.attr('ondragstart','drag(event)');\n\t\tdiv.attr('draggable','true');\n\t\treturn div;\n\t}\n}", "function item_info(item) {\n return parent.G.items[item.name];\n}", "function trapItemDetails(observer) {\n if (doingBazaarMaintainance()) {\n if ($('#xedx-main-div').length > 0) {\n $(targetNode).unbind('DOMNodeInserted');\n $('#xedx-main-div').remove();\n }\n return;\n }\n buildUI(); // If needed...\n\n let parentDiv = isBazaar ? $('div.ReactVirtualized__Grid').get() : itemsGetActiveClass();\n if (!validPointer(parentDiv) || !parentDiv.length) {return;}\n\n let owlItem = isBazaar ? $(parentDiv).find('div.info___3-0WL').get() :\n $(parentDiv).find('li.show-item-info.bottom-round').get();\n if (!owlItem.length || !validPointer(owlItem)) {return;}\n\n let clearfix = $(owlItem).find('div.info-content > div.clearfix.info-wrap')[0];\n if (!validPointer(clearfix)) {return;}\n\n let pricingUl = $(clearfix).find('ul.info-cont')[0];\n if (!validPointer(pricingUl)) {return;}\n\n let statsUl = $(clearfix).find('ul.info-cont.list-wrap')[0];\n if (!validPointer(statsUl)) {return;}\n\n let newItem = getNewItem();\n\n // We give a unique ID to a root node that persists (I hope)\n // to prevent doing this more than once. We also hash the\n // resulting object to prevent array insertion more than once\n // in case this fails for whatever reason. The hash value is\n // saved in a separate array.\n if (isItemTagged(pricingUl, newItem)) {return;}\n\n getNameTypeItemInfo(owlItem, newItem);\n getPricingInfo(pricingUl, newItem);\n getStatInfo(statsUl, newItem);\n\n console.log('newItem: ', newItem);\n\n // Generate a unique hash value for this, so as not to add twice.\n // Should never get here if already added.\n // The hash can't be part of the data, for obvious reasons - at\n // least not when calculating the hash. But we can add it to be saved\n // into the spreadsheet, to prevent inserting duplicates, if you go to the\n // same place twice by mistake.\n let jsonData = JSON.stringify(newItem);\n let hash = jsonData.hashCode();\n\n console.log('Hashcode for the ' + newItem.name + ': ' + hash);\n if (!detectedItemsHashTable.includes(hash)) {\n detectedItemsHashTable.push(hash);\n\n // We add the hash value to the item immediately before pushing onto our array.\n // This allows it to be recorded by the Google Sheets script, to prevent\n // duplicates from being inserted into the sheet.\n newItem.hash = hash.toString();\n detectedItemsArray.push(newItem);\n console.log('Pushed a \"' + newItem.name + '\" onto array');\n\n // Check for really good weapons - based just on quality.\n // Shuld also use the (acc+def) /100 (?) method.\n let q = newItem.quality;\n let end = q.indexOf('%');\n let n = q.slice(0, end-1);\n if (parseInt(n) > 90) {\n alert('This ' + newItem.name + ' has a quality rating of ' + newItem.quality + ' !');\n }\n\n if (INSTANT_UPLOAD) {\n submitFunction();\n }\n }\n }", "function Item(name, description)\n{\n this.name = name;\n this.description = description;\n}", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "constructor() {\n this.items = {}\n }", "get item() {\r\n return this.i.item;\r\n }", "get items() {\r\n return new Items(this);\r\n }", "get item() {\n if (!this._item) {\n this.render();\n }\n\n return this._item;\n }", "function Item(id, title, published_at, updated_at, links, summary, content, author, subscription) {\n this.id = id;\n this.title = title;\n this.published_at = published_at;\n this.updated_at = updated_at;\n this.links = links;\n this.summary = summary;\n this.content = content;\n this.author = author;\n this.subscription = subscription;\n this.$element = null;\n this.color = null;\n\n this.is_wide = function() {\n return this.title.length > 80;\n };\n\n this.has_image = function() {\n return !!this.image();\n };\n\n this.image = function() {\n var image = null;\n // Look for an image in item's links.\n $.each(this.links, function(index, link) {\n $.each([\"jpg\", \"jpeg\", \"png\", \"gif\"], function(index, extension) {\n if (link.url.indexOf(\".\" + extension) != -1) {\n image = link.url;\n return false;\n }\n });\n });\n // If we found one, return here.\n if (image) {\n return image;\n }\n // If we still don't have an image, continue onto the summary and content.\n $.each([this.summary, this.content], function(index, text) {\n if (!text) {\n return true;\n }\n match = text.match(/https?:\\/\\/.*\\.(?:jpg|jpeg|png|gif)/i);\n if (match && match[0]) {\n image = match[0];\n }\n });\n return image;\n };\n\n this.mark_as_read = function() {\n this.subscription.remove_item(this);\n this.mark_as_read_in_google_reader();\n View.update_items(false);\n Reader.update_title();\n };\n\n this.mark_as_read_in_google_reader = function() {\n var item = this;\n Reader.get_edit_token(function(edit_token) {\n $.post(Url(\"edit_tag\"), {\n i: item.id,\n a: \"user/-/state/com.google/read\",\n ac: \"edit\",\n T: edit_token\n }, function(data) {\n if ($.trim(data) != \"OK\") {\n // A failed attempt is most likely due to an expired\n // token, so just try again.\n item.mark_as_read_in_google_reader();\n }\n });\n });\n };\n\n this.source_url = function() {\n var url = null;\n $.each(this.links, function(index, link) {\n if (link.type == \"alternate\") {\n url = link.url;\n return false;\n }\n });\n return url;\n };\n}", "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 processComponentData(item)\n\t\t\t{\n\t\t\t\tslot = $(this).attr('data-slot');\n\t\t\t\ttype = $(this).attr('data-type');\n\n\t\t\t\tcomponent_data['id'] = component_id; // if id key is undefined, it will be omitted\n\n\t\t\t\tswitch(type)\n\t\t\t\t{\n\t\t\t\t\tcase 'image':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('src');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'custom':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('data-custom');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'input':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).val();\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'array':\n\t\t\t\t\t\twrapper = $(this).attr('data-wrapper');\n\t\t\t\t\t\tsub_data = new Array();\n\t\t\t\t\t\t$(this).find(wrapper).each(function()\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tsub_data.push($(this).html());\n\t\t\t\t\t\t});\n\t\t\t\t\t\tcomponent_data[slot] = sub_data;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'style':\n\t\t\t\t\t\tcomponent_data[slot] = $(this).attr('style');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcomponent_data[slot] = CKEDITOR.instances[$(this).attr('id')].getData();\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t}", "itemList() {\n return this.state.items.map(currentitem => {\n return <Item item={currentitem} deleteItem={this.deleteItem}\n key={currentitem._id} />\n })\n }", "constructor() {\n super(models.Item);\n }", "function initializeItem(that, item, row, index) {\n\t\t// Every item knows about it's form.\n\t\t// the sub form of group items is called groupForm, not form!\n\t\tif (item instanceof Array) {\n\t\t\t// init items that are to be merged into one cell\n\t\t\tfor (var i = 0; i < item.length; i++)\n\t\t\t\tinitializeItem(that, item[i], row, index);\n\t\t} else {\n\t\t\t// Convert the item now by setting its __proto__ to the right\n\t\t\t// prototype:\n\t\t\titem = EditItem.initialize(item);\n\t\t\t// init single item\n\t\t\titem.form = that;\n\t\t\titem.row = row;\n\t\t\titem.index = index;\n\t\t\t// Only store real items in the global\n\t\t\t// items, not tabs or groups, as they\n\t\t\t// often have the same id as a item within them\n\t\t\tif (item.name) {\n\t\t\t\tif (item.groupForm) {\n\t\t\t\t\tthat.groups[item.name] = item;\n\t\t\t\t\tthat.root.allGroups[item.name] = item;\n\t\t\t\t} else {\n\t\t\t\t\tthat.items[item.name] = item;\n\t\t\t\t\tthat.root.allItems[item.name] = item;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// collect the autoRemove items:\n\t\t\tif (item.autoRemove) {\n\t\t\t\tif (that.root.autoRemove == null)\n\t\t\t\t\tthat.root.autoRemove = [];\n\t\t\t\tthat.root.autoRemove.push(item);\n\t\t\t}\n\t\t}\n\t}", "function initItems() {\n $(\"#add-items\").find(\".add-item\").mousedown(function(e) {\n var modelUrl = $(this).attr(\"model-url\");\n var itemType = parseInt($(this).attr(\"model-type\"));\n var metadata = {\n itemName: $(this).attr(\"model-name\"),\n resizable: true,\n modelUrl: modelUrl,\n itemType: itemType\n }\n\n blueprint3d.model.scene.addItem(itemType, modelUrl, metadata);\n setCurrentState(scope.states.DEFAULT);\n });\n }", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "function Item() {\n Outlayer.Item.apply(this, arguments);\n }", "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 Item() {\r\n Outlayer.Item.apply(this, arguments);\r\n }", "function Item(code, desc, price, image, category, stock, deliveryDays){\r\n this.code = code;\r\n this.description = desc;\r\n this.price = price;\r\n this.image = image;\r\n this.category = category;\r\n this.stock = stock;\r\n this.deliveryDays = deliveryDays;\r\n this.user = \"Leo\"; \r\n}", "function item(Description, Svalue) {\n this.Description = Description;\n this.Svalue = Svalue;\n}", "function get_item_dict(opts) {\n var weight = 0, cost = 0, level, mundane, magic;\n var item = { cost: 0, weight: 0, level: 0, amount: 1 };\n if(opts) {\n weight = opts.weight || 0;\n cost = opts.cost || 0;\n item.name = opts.name;\n level = opts.level;\n mundane = opts.mundane;\n magic = opts.magic;\n if(opts.amount)\n item.amount = opts.amount;\n }\n\n // Name\n if(!item.name) {\n if(magic)\n item.name = magic.name;\n else if(mundane)\n item.name = mundane.name;\n else\n item.name = 'Unnamed Item';\n }\n // Cost\n if(cost) {\n item.cost = cost;\n } else if(level && level > magic.level) {\n item.cost = prices[level];\n } else if(magic) {\n item.cost = magic.cost;\n } else if(mundane) {\n item.cost = mundane.cost;\n }\n\n // Weight\n if(weight) {\n item.weight = weight;\n } else if(mundane) {\n item.weight = mundane.weight;\n }\n\n item.cost *= item.amount;\n item.weight *= item.amount;\n\n // Level\n if(!level && magic)\n level = magic.level;\n item.level = level;\n\n // Put the relateds inside the EM list\n if(magic) {\n if(!EM.by_key('magic', magic.id))\n EM.add_local('magic', magic);\n item.magic = magic.id;\n }\n if(mundane)\n item.mundane = mundane.id;\n EM.merge_related('item', item);\n\n return item;\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 visitItem(item) {\n item.data.id = item.id;\n if (item.children) {\n for (var j = item.children.length - 1; j >= 0; j--)\n visitItem(item.children[j]);\n }\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 }", "process(raw_item) {\n return raw_item;\n }", "function Item(title, finished) {\n this.title = title;\n this.finished = finished;\n}", "function Item() {\n // Do Nothing\n }", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function Item() {\n Outlayer.Item.apply( this, arguments );\n}", "function get_item(item) {\n money_count += item.price;\n return items[item.id];\n}", "AddItem() {}", "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}", "function testItem() {\n\t\tthis.Question;\n\t\tthis.RightUnswer;\n\t\tthis.Unswers;\n\t}", "function Item(id_in: int, namein: String, obj: GameObject)\n\t{\n\t\tid = id_in;\n\t\tname = namein;\n\t\tgameObj = obj;\n\t}", "function Item(){\n\t\tthis.id;\n\t\tthis.description=\"\";\n\t\tthis.name=\"\";\n\t}", "function asItem(x) { return toType('item', x) }", "function bidItem() { }", "async _processItems (h) {\n const pages = await this.store.table('page').catch(ERROR)\n const items = pages.find({\n updated: true\n })\n const plist = []\n for (const itemRaw of items) {\n const item = new Item(itemRaw)\n const promise = this.trains.run('processItem', {h, item})\n .catch(ERROR)\n plist.push(promise)\n }\n await Promise.all(plist)\n this.store.save()\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 RENDER_items(items) {\n\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}", "releaseItem(item) {}", "function loadDetails(item) {\n console.log(item);\n showLoadingMessage ();\n let url = item.detailsUrl;\n return fetch(url).then(function (response) {\n return response.json();\n }).then(function (details) { //details is the parameter that would be the return value of the previous function\n // Now we add the details to the item\n hideLoadingMessage();\n item.imageUrl = details.sprites.front_default; //sprites is the key of the object with the imgs\n item.height = details.height;\n item.image = details.sprites.other.dream_world.front_default;\n item.types = []; \n \n details.types.forEach(function(pokemon){\n item.types.push(pokemon.type.name)\n })\n }).catch(function (e) {\n hideLoadingMessage();\n console.error(e);\n });\n }", "function item(name, description, url, href) {\n\t this.name = name;\n\t this.description = description;\n\t this.url = url;\n\t this.href = href;\n\t}", "function visitItem(item) {\n item.data.id = item.id;\n if (item.children) {\n for (var j = item.children.length-1; j >= 0; j--)\n visitItem(item.children[j]);\n }\n }", "function take_item() {\r\n\r\n\t\titem_ladle \t\t= new proto_item(0, \"Ladle\", \"This is a very dull wooden ladle its mostly for soup and acid, but mostly soup.\");\r\n\t\titem_silver_key = new proto_item(1, \"Silver Key\", \"This is a key, and it happens to be silver, who would have thought.\");\r\n\t\titem_lockbox \t= new proto_item(2, \"Lockbox\", \"This is a box shaped container, it is also locked. You need a key to open it.\");\r\n\t\titem_keycard \t= new proto_item(3, \"Keycard\", \"This is a card that can open doors, much like a real key, but however it is in the shape of a card.\");\r\n\r\n\r\n\t\tswitch (currentlocation) {\r\n\t\t\tcase 0: \r\n\t\t\t\t\tinventoryArray[0] = item_ladle\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Ladle.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 9:\r\n\t\t\t\t\tinventoryArray[3] = item_card\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the card.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 8:\r\n\t\t\t\t\tinventoryArray[2] = item_lockbox\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the lockbox.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\tcase 7:\r\n\t\t\t\t\tinventoryArray[1] = item_silver_key\r\n\t\t\t\t\tupdatetext (\"Your inventory now contains the Silver Key.\")\r\n\t\t\t\t\t\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}", "function loadDetails(item) {\n var url = item.detailsUrl;\n return $.ajax(url, {\n dataType: 'json',\n })\n .then(function (responseJSON) {\n // Now we add the details to the item\n item.imageUrl = responseJSON.sprites.front_default;\n item.height = responseJSON.height;\n // loop through types\n item.types = '';\n responseJSON.types.forEach(function (result) {\n item.types += result.type.name + ' ';\n });\n })\n .catch(function (e) {\n console.error(e);\n });\n }", "function ListItem() {}", "function ListItem() {}", "function ListItem() {}", "function convertItemsToObjects(itemData) {\n const classes = {\"message\": Message, \"listener\": Listener};\n return itemData.map(data => new classes[data.type](data));\n }", "function itemHandler(player, item) {\n item.kill();\n switch (item.key) {\n case 'poison':\n lives -= 1;\n break;\n case 'mist':\n lives -= 2;\n break;\n case 'window':\n lives -= 3;\n break;\n case 'fish':\n lives -= lives;\n break;\n case 'coin':\n currentScore += 25;\n break;\n case 'honey':\n currentScore += 50;\n break;\n case 'heart':\n lives += 1;\n break;\n case 'star':\n currentScore += 100;\n break;\n case 'bush':\n currentScore += 5;\n break;\n case 'waterBlob':\n currentScore += 10;\n break;\n }\n}" ]
[ "0.670019", "0.64798", "0.63719356", "0.6331552", "0.62768364", "0.6251347", "0.62283534", "0.619127", "0.6072372", "0.6042383", "0.603565", "0.60290915", "0.6026444", "0.5973232", "0.59565175", "0.5942904", "0.5915795", "0.5900617", "0.5899283", "0.589006", "0.58808625", "0.5870135", "0.5861734", "0.5849802", "0.5846448", "0.58389", "0.5833331", "0.5822991", "0.58039385", "0.5768527", "0.5766771", "0.57490873", "0.5729533", "0.5719784", "0.5718144", "0.57108825", "0.57105947", "0.5706234", "0.57046396", "0.56935436", "0.56904715", "0.5689071", "0.5677947", "0.56776315", "0.56720835", "0.5663287", "0.5659368", "0.56576645", "0.56545293", "0.56519026", "0.56509197", "0.5643426", "0.56395906", "0.56395876", "0.56390417", "0.56304324", "0.56293017", "0.5615828", "0.5615828", "0.5604167", "0.5596943", "0.5594757", "0.5594498", "0.5591376", "0.5578771", "0.557253", "0.5566128", "0.5563768", "0.5561604", "0.5558737", "0.5557922", "0.5557922", "0.5557922", "0.5557922", "0.5557922", "0.5557922", "0.5557922", "0.5557922", "0.5554137", "0.55500066", "0.55292416", "0.5518543", "0.55169827", "0.55139196", "0.55106497", "0.55004215", "0.5496036", "0.54948413", "0.54865897", "0.54803467", "0.5474625", "0.5473071", "0.5471504", "0.5466333", "0.5465187", "0.5451624", "0.54516023", "0.54516023", "0.54516023", "0.54510355", "0.5447204" ]
0.0
-1
Options are: level(decorator with level+), cost, weight, name
function get_item_dict(opts) { var weight = 0, cost = 0, level, mundane, magic; var item = { cost: 0, weight: 0, level: 0, amount: 1 }; if(opts) { weight = opts.weight || 0; cost = opts.cost || 0; item.name = opts.name; level = opts.level; mundane = opts.mundane; magic = opts.magic; if(opts.amount) item.amount = opts.amount; } // Name if(!item.name) { if(magic) item.name = magic.name; else if(mundane) item.name = mundane.name; else item.name = 'Unnamed Item'; } // Cost if(cost) { item.cost = cost; } else if(level && level > magic.level) { item.cost = prices[level]; } else if(magic) { item.cost = magic.cost; } else if(mundane) { item.cost = mundane.cost; } // Weight if(weight) { item.weight = weight; } else if(mundane) { item.weight = mundane.weight; } item.cost *= item.amount; item.weight *= item.amount; // Level if(!level && magic) level = magic.level; item.level = level; // Put the relateds inside the EM list if(magic) { if(!EM.by_key('magic', magic.id)) EM.add_local('magic', magic); item.magic = magic.id; } if(mundane) item.mundane = mundane.id; EM.merge_related('item', item); return item; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function level(title, numTricks, expReq, prefix=\" a\") {\n this.prefix = prefix;\n this.title = title;\n this.numTricks = numTricks;\n this.expReq = expReq;\n}", "constructor(level = \"info\") {\n this.level = level;\n }", "constructor(name, lvl, health, stats)\n {\n this.name = name || \"Steve\";\n this.lvl = lvl || 0;\n this.maxHealth = 10 + lvl*2;\n this.health = health || this.maxHealth;\n this.stats = stats;\n }", "calculateLevel (price, level){\n /*\n Basic insurance is going to increase the vlaue by 30%\n complet insurane is going to increase the value by 50%\n */\n if(level === 'basic'){\n price = price *1.30;\n }else{\n price = price * 1.50;\n }\n return price;\n \n }", "calculateLevel(price,level){\n\t/*\n\tbasic insurance is going to increase the value by 30%\n\tcomplete insurance is going to increase the value by 50%\n\t*/\n\t//console.log(level);\n\n\tif(level==='basic'){\n\t\tprice=price*1.30;\n\t}\n\tif(level==='complete'){\n\t\tprice=price*1.50;\n\t}\n\treturn price;\n}", "calculateBonus(level = this.level) {\n return this.bonusList[level];\n }", "calculateBonus(level = this.level) {\n return this.bonusList[level];\n }", "constructor(name, nr, cost){ // call the properties\r\n super(name, nr) // now to use the properties\r\n this.cost = cost\r\n }", "constructor(name = \"\",power = 1,health = 50){ \r\n this.name = name;\r\n this.power = power;\r\n this.health = health;\r\n }", "constructor (level='easy') {\r\n this.field = [[-1, -1, -1], [-1, -1, -1], [-1, -1, -1]];\r\n switch (level) {\r\n case 'easy':\r\n this.strategy = new Easy();\r\n break;\r\n case 'normal':\r\n this.strategy = new Normal();\r\n break;\r\n default:\r\n throw new Error (`unknown level: ${level}`);\r\n }\r\n }", "set weight(value) {}", "levelExpNeeded(level) {\n return (level - 1) * 100;\n }", "scaleLevel(lvl) { }", "chanceOfCorrectCost(level, cost) {\n var levels = { \n 1: { \n 1: 1.0,\n 2: 0.0,\n 3: 0.0,\n 4: 0.0,\n 5: 0.0,\n },\n 2: { \n 1: 1.0,\n 2: 0.0,\n 3: 0.0,\n 4: 0.0,\n 5: 0.0,\n },\n 3: { \n 1: 0.65,\n 2: 0.30,\n 3: 0.05,\n 4: 0.0,\n 5: 0.0,\n },\n 4: { \n 1: 0.50,\n 2: 0.35,\n 3: 0.15,\n 4: 0.0,\n 5: 0.0,\n },\n 5: { \n 1: 0.37,\n 2: 0.35,\n 3: 0.25,\n 4: 0.03,\n 5: 0.0,\n },\n 6: { \n 1: 0.245,\n 2: 0.35,\n 3: 0.30,\n 4: 0.10,\n 5: 0.005,\n },\n 7: { \n 1: 0.20,\n 2: 0.30,\n 3: 0.33,\n 4: 0.15,\n 5: 0.02,\n },\n 8: { \n 1: 0.15,\n 2: 0.25,\n 3: 0.35,\n 4: 0.20,\n 5: 0.05,\n },\n 9: { \n 1: 0.10,\n 2: 0.15,\n 3: 0.35,\n 4: 0.30,\n 5: 0.10,\n },\n }\n\n return new Decimal(levels[level][cost]);\n }", "constructor(health=18, power=5) {\n this.health = health;\n this.power = power;\n }", "get weight() {}", "constructor(options)\n\t{\n\t\t// the class level\n\t\tthis._level = 1;\n\t\t// base hitpoints we start with at level 1 (not applying ability/constitution modifier)\n\t\tthis._base_hp = options.base_hp;\n\t\t// keep track of hitpoint rolls - initialize them all to 0\n\t\tthis._hitpoint_rolls = new Array(MAX_CLASS_LEVEL).fill(0);\n\t\t// apply the base hitpoints as a roll\n\t\tthis._hitpoint_rolls[0] = this._base_hp;\n\t\t// change the type of dice and ability modifier\n\t\t// per class - example {type: 'd6', ability: 'strength'}\n\t\tthis._hit_dice = options.hit_dice;\n\t\t// proficiencies\n\t\tthis._\n\t}", "constructor(type, name, weight, features, snack) {\n this.type = type\n this.name = name\n this.weight = weight\n this.features = features\n this.snack = snack\n\n }", "function heuristics1(weight) {\n choice = 2;\n w = weight;\n}", "function giveExp(name, multiplier) {\n var happinessGain = 0,\n oldHappiness,\n feedmon = getPokemon(name),\n lvlGain = 0,\n gain = 0,\n lvl = feedmon.level,\n bonusRange = Math.round(lvl / 10),\n bonus = [0, 0],\n looplvl,\n lvlexp,\n len,\n i;\n\n multiplier = multiplier || 1;\n\n if (bonusRange > 0) {\n bonus = [bonusRange * (Math.round(lvl / 2)), bonusRange * lvl];\n }\n\n gain = sys.rand((10 * lvl) + bonus[0], ((24 * lvl) + bonus[1]) + 1) * multiplier;\n feedmon.exp += gain;\n\n oldHappiness = Math.floor(feedmon.happiness);\n feedmon.happiness += HAPPINESS_GAIN;\n happinessGain = Math.floor(feedmon.happiness) - oldHappiness;\n\n if (lvl < 100) {\n for (i = lvl - 2, len = exp.length; i < len; i += 1) {\n lvlexp = exp[i];\n looplvl = i + 1;\n\n if (lvl >= looplvl) {\n continue;\n }\n\n if (feedmon.exp >= lvlexp) {\n lvlGain += 1;\n } else {\n break;\n }\n }\n }\n\n if (lvlGain) {\n feedmon.level += lvlGain;\n feedmon.hp = getHp(feedmon.level);\n }\n\n return {\n gain: gain,\n happinessGain: happinessGain,\n levelGain: lvlGain,\n now: feedmon.exp,\n bonus: bonus\n };\n }", "function getLevel(){\n return level\n}", "function Log3(target, name, descriptor) {\n console.log(\"Method decorator\");\n console.log(target); // prototype\n console.log(name); // getPriceWithTax string\n console.log(descriptor); // { value: getPriceWithTax function }\n}", "function beetle_lvl1() {}", "function Tower(name, weight, carrying) {\n\tthis.name = name;\n\tthis.weight = +weight.match(/\\d+/)[0];\n\tthis.carrying = carrying;\n}", "function visitor(node, idx, args){\n\t\t\t\tnode.level = args.level;\n\t\t\t\tnode.parent = args.parent;\n\t\t\t\treturn {level : args.level+1, parent : node};\n\t\t\t}", "function levels () {\n if (billTotalTotal >= costWarning && billTotalTotal < costCritical) {\n return 'warning'\n }\n if (billTotalTotal >= costCritical) {\n return 'danger'\n }\n }", "function createLevel(levelName, mines, size) {\r\n return {\r\n levelName,\r\n mines,\r\n size\r\n }\r\n}", "constructor(name, level, numberOfStudents){\n this._name = name;\n this._level = level;\n this._numberOfStudents = numberOfStudents;\n }", "function Level() {\n}", "function apply_level_setup(){\n switch (current_level){\n case 0:\n level_0()\n break;\n case 1:\n level_1()\n break;\n case 2:\n level_2()\n break;\n case 3:\n level_3()\n break;\n case 4:\n level_4()\n break;\n case 5:\n level_5()\n break;\n default:\n console.log(\"Something is wrong. You are probably not in a level \\n Level URL format: [URL]?level=[number]\")\n }\n}", "describe() {\n return `${this.name} has ${this.health} health points, ${this\n .strength} as strength and ${this.xp} XP points`;\n }", "function Level(g, soln, res, h) {\n \"use strict\";\n return {\"graph\" : g, \"solution\" : soln, \"restriction\" : res, \"hint\" : h};\n}", "function Hero(name,level) {\n\tname = name;\n\tlevel = level;\n} // incorrect", "constructor(name, health, speed, strength, wisdom){\n super(name);\n this.health = 200;\n this.speed = 10;\n this.strength = 10;\n this.wisdom = 10;\n }", "constructor(name, health, strength) {\n\t\tsuper(health, strength);\n\t\tthis.name = name;\n\t}", "get cost() {\n return {\n water: 20,\n nitrogen: 5\n }\n }", "get level () { return this._level; }", "function beetle_lvl3() {}", "function beetle_lvl2() {}", "function Log2(target, name, descriptor) {\n console.log(\"Access decorator\");\n console.log(target); // prototype\n console.log(name); // price\n console.log(descriptor); // oggetto dove abbiamo il set\n}", "function writeAdvice(context, level) {\n var adviceLine1 = \"\";\n var adviceLine2 = \"\";\n\n if (level == \"red\") {\n adviceLine1 = \"Please consult with your financial\";\n adviceLine2 = \"planner urgently.\";\n } else if (level == \"yellow\") {\n adviceLine1 = \"Please consult your financial planner\";\n adviceLine2 = \"in 6-8 weeks.\";\n } else if (level == \"green\") {\n adviceLine1 = \"You are doing a good job keeping your credit limit.\";\n }\n\n context.fillText(\"Your credit level is \" + level + \".\", 25, 380);\n context.fillText(adviceLine1, 25, 410);\n context.fillText(adviceLine2, 25, 440);\n}", "describe() {\n return `${this.name} has ${this.health} health points, \n ${this.strength} as strength and ${this.xp} XP points`;\n }", "function levelDesign(level){\n\n\tswitch (level){\n\t\tcase 5:\n\t\tbot.createlevel(0,0,1,0);\n\t\t// spawn stuff\n\t\t\tbreak;\n\t\tcase 10:\n\t\tbot.createlevel(0,0,0,1);\n\t\t//spawn stuff\n\t\t\tbreak;\n\t\tcase 15:\n\t\tbot.createlevel(0,0,1,1);\n\t\t//spawn stuff\n\t\t\tbreak;\n\t\tcase 20:\n\t\tbot.createlevel(0,0,2,1);\n\n\t\tdefault:\n\t\tbot.createlevel(1, 0, 0, 0);\n\t\t\tbreak;\n\t}\n\n\tsetLevelTimer(levelTimes[level-1]);\n\tdisplayLevel(level);\n}", "function calcAmount (level, size, modifier){\n\n\tvar amount = Math.round((Math.random().toFixed(1)) * level * size * modifier);\n\treturn amount;\n}", "function setLevel() {\n level = 1;\n}", "function Lancer(name,model,color,maxSpeed){\n this.name = name,\n this.model = model,\n this.color = color,\n this.maxSpeed = maxSpeed\n}", "function heuristics(weight) {\n choice = 1;\n w = weight;\n}", "filterByCost() {}", "function use(soldier, level) {\n switch (type) {\n case 'ammo': \n return use_ammo(soldier, level);\n case 'health':\n return use_health(soldier, level);\n case 'viols':\n return use_viols(soldier, level);\n case 'attack':\n return use_attack(soldier, level);\n case 'defence':\n return use_defence(soldier, level);\n case 'speed':\n return use_speed(soldier, level);\n case 'slow':\n return use_slow(soldier, level);\n case 'injure':\n return use_injure(soldier, level);\n }\n }", "function optionCompareWeightChangedOne(id, select) {\n\n // Nutrient fact initiated\n nutrient_fact_one(id, select);\n // Radar Graph initiated\n macroRadar();\n // Micro Radar Graph initiated\n microRadar();\n // GAUGE ONE\n gaugeOne(id, select)\n // Macro Grouped Bar Chart initiated\n macroGroupBar();\n // Micro Grouped Bar Chart initiated\n microGroupBar();\n}", "optionRenderer({ level, label }) {\n if (!level) return label\n\n return <span className={'k-Select__option--level' + level}>{label}</span>\n }", "function score(option) {\n return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) +\n (option.type ? 1 : 0);\n}", "function maintainWeight(level,callback){\n return Math.floor(activityConstants[level]*callback);\n }", "levelOpdracht(){\n if(this.level === 1){\n this.setLevel(this.dataOpdrachten[0]);\n }\n if(this.level === 2){\n this.setLevel(this.dataOpdrachten[1]);\n }\n if(this.level === 3){\n this.setLevel(this.dataOpdrachten[2]);\n }\n }", "constructor(name, age, breed, color) {\n // Set those equal to the instance\n this.name = name;\n this.age = age;\n this.breed = breed;\n this.color = color;\n this.energyLevel = 0;\n this.barkLevel = 10;\n }", "static get parameterDescriptors() {\n return [{ name: \"gain\", defaultValue: 1 }];\n }", "constructor(level) {\n this.debug = level >= DEBUG ? this.log('DEBUG', '#0000FF') : function() {};\n this.info = level >= INFO ? this.log('INFO', '#00C864') : function() {};\n this.warn = level >= WARN ? this.log('WARN', '#C80164') : function() {};\n }", "function beetle_lvl4() {}", "function createLevel(){\r\n\r\n /*\r\n levelProperties holds properties for each level. syntax: [tiles],starting value of timer,music,min score, min similar for group,[bonus],[bonus2],[attention],[[probability, special tile id (7,8 aor 9)]]\r\n bonus: [[NUM,TILEID,POINTS]]\r\n bonus2: [[NUM,TILEID,POINTS]]\r\n attention: [[tileid,text]]\r\n REMEMBER: ONLY 3 GOALS IN TOTAL, ONLY 3 ATTENTIONS (OF WHICH ONLY ONE IS SHOWN ON PRELUDE SCREEN)\r\n */\r\n\r\n levelProperties = [\r\n\r\n // world 1\r\n [[0, 1, 2, 3], 200, 'lvl1', '2000', '4', [[5, 3, 100], [5, 0, 100]], [[5, 0, 50]], [[99, 'taking away blocks will cost you 10 points'],[99, 'each level has different goals'],[99, 'bonus goals are listed on the left']], [] ],\r\n [[0, 1, 2, 3], 180, 'lvl1', '3000', '4', [[6, 2, 100], [6, 3, 100]], [[5, 1, 50]], [[99, 'a combination of groups is called a combo'], [99, 'big combos can quickly increase your score'],[99, 'reach the target score to continue']], [] ],\r\n [[0, 1, 2, 3, 4], 200, 'lvl1', '1500', '4', [[7, 1, 100], [7, 2, 100]], [[5, 2, 50]], [[4, 'a new block colour is added'], [99, 'it will become harder to form groups']], [] ],\r\n [[0, 1, 2, 3, 4], 200, 'lvl1', '1500', '5', [[9, 4, 100], [9, 0, 100]], [[5, 3, 50]], [[99, 'this time, you need 5 blocks to form a group']], [] ],\r\n [[0, 1, 2, 3, 4], 150, 'lvl1', '2000', '5', [[10, 0, 200], [10, 1, 200]], [[5, 4, 50]], [[99, 'you have almost made it to world 2!'], [99, 'you will always restart in the last world']],[] ],\r\n\r\n // world 2\r\n [[0, 1, 2, 3, 4], 200, 'lvl2', '1500', '4', [[11, 4, 100], [11, 0, 100]], [[6, 1, 100]], [[99, 'some tiles can provide extra points']], [[25, 9]] ],\r\n [[0, 1, 2, 3], 100, 'lvl2', '1500', '5', [[12, 0, 100], [12, 1, 100]], [[6, 2, 100]], [[99, 'move quick!']], [[25, 9]] ],\r\n [[0, 1, 2, 3, 4], 150, 'lvl2', '2000', '4', [[13, 3, 100], [13, 4, 100]], [[6, 2, 100]], [[7, 'rainbow tiles can substitute any colour']], [[50, 9], [25, 7]] ],\r\n [[0, 1, 2, 3, 4, 5], 150, 'lvl2', '1000', '4', [[14, 5, 100], [14, 4, 100]], [[6, 4, 100]], [[5, 'a new block colour is added']], [[100, 9], [25, 7]] ],\r\n [[0, 1, 2, 3, 4, 5], 100, 'lvl2', '1000', '5', [[15, 1, 200], [15, 0, 200]], [[6, 5, 100]], [[99, 'its the end of the world! (2, that is)']], [[50, 9], [50, 7]] ],\r\n\r\n // world 3\r\n [[0, 1, 2, 3, 4, 5], 250, 'lvl3', '2000', '5', [[16, 5, 100], [16, 4, 100]], [[7, 0, 150]], [[8, 'a brick block can not be destroyed'],[8, '..or perhaps they can?']],[[35, 9], [50, 7], [10, 8]] ],\r\n [[0, 1, 2, 3, 4, 5], 200, 'lvl3', '2500', '5', [[17, 2, 100], [17, 3, 100]], [[7, 2, 150]], [[8, 'do you remember boulderdash?']],[[5, 8]] ],\r\n [[0, 1, 2, 3, 4], 150, 'lvl3', '1500', '4', [[18, 0, 100], [18, 4, 100]], [[7, 4, 150]], [[99, 'move quick!']], [[35, 9], [50, 7]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 250, 'lvl3', '1250', '4', [[19, 6, 100], [19, 5, 100]], [[7, 4, 150]], [[6, 'a new block colour is added']],[[35, 7], [25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 150, 'lvl3', '1500', '5', [[20, 2, 200], [20, 4, 200]], [[7, 6, 150]], [[6, 'much group, much colour, much brick']],[[25, 9], [25, 7], [10, 8]] ],\r\n\r\n // world 4\r\n [[0, 1, 2, 3, 4, 5, 6], 180, 'lvl4', '2000', '5', [[21, 2, 100], [21, 1, 100]], [[8, 1, 200]], [[99, 'easy money']], [[5, 9]] ],\r\n [[4, 5, 6], 250, 'lvl4', '5000', '5', [[22, 4, 100], [22, 5, 100]], [[8, 6, 200]], [[99, 'tricolore']], [[25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 180, 'lvl4', '2750', '5', [[23, 4, 100], [23, 6, 100]], [[8, 5, 200]], [[99, 'somewhere, over the rainbow']], [[5, 7]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 150, 'lvl4', '3000', '5', [[24, 0, 100], [24, 2, 100]], [[8, 6, 200]], [[99, 'you know, writing these hints is kinda hard'],[99, 'but Im doing it all for you']], [[25, 9], [50, 7], [25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5], 150, 'lvl4', '4000', '5', [[25, 1, 200], [25, 3, 200]], [[8, 4, 200]], [[99, 'this will take some time']], [[25, 9], [50, 7]] ],\r\n\r\n // world 5\r\n [[0, 1, 2, 3, 4, 5, 6], 200, 'lvl5', '4000', '5', [[25, 1, 200], [25, 2, 200]], [[9, 3, 250]], [[99, 'lets build a castle']],[[5, 8]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 180, 'lvl5', '3500', '5', [[25, 3, 200], [25, 4, 200]], [[9, 2, 250]], [[99, 'this may look easy..']],[[25, 9], [50, 7], [25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 150, 'lvl5', '3500', '5', [[25, 5, 200], [25, 6, 200]], [[9, 4, 250]], [[99, 'almost there!']], [[25, 9], [25, 7], [25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5], 250, 'lvl5', '2500', '6', [[25, 0, 200], [25, 1, 200]], [[9, 5, 250]], [[99, '6 is the magic number']],[[25, 9], [25, 7], [25, 8]] ],\r\n [[0, 1, 2, 3, 4, 5, 6], 200, 'lvl5', '3000', '6', [[25, 2, 200], [25, 3, 200]], [[9, 6, 250]], [[99, 'no more hints. you know what to do.']],[[15, 9], [15, 7], [15, 8]] ]\r\n\r\n ];\r\n\r\n mainContainer.removeAllChildren();\r\n\r\n // the game itself has its own container\r\n gameContainer = new createjs.Container();\r\n gameContainer.x = 20;\r\n gameContainer.y = 88;\r\n mainContainer.addChild(gameContainer);\r\n\r\n title_bg = new createjs.Shape();\r\n title_bg.graphics.beginFill('#000').drawRect(0, 0, 640, 75).endFill();\r\n mainContainer.addChild(title_bg);\r\n title1 = preload.getResult(\"titlesmall01\");\r\n title1 = new createjs.Bitmap(title1);\r\n title1.x = 185;\r\n title1.y = 7;\r\n title1.glow = 4;\r\n mainContainer.addChild(title1);\r\n title2 = preload.getResult(\"titlesmall02\");\r\n title2 = new createjs.Bitmap(title2);\r\n title2.x = 185;\r\n title2.y = 7;\r\n mainContainer.addChild(title2);\r\n\r\n bonusContainerList = []; // contains text instances that are used to show the countdown for level goals\r\n\r\n // score indicator\r\n countdowntitle = new createjs.Text(\"SCORE\", \"bold 30px Inconsolata\", \"#aaa\");\r\n countdowntitle.x = 542;\r\n countdowntitle.y = 5;\r\n mainContainer.addChild(countdowntitle);\r\n countdown = new createjs.Text(levelProperties[currentLevel - 1][1], \"bold 45px Inconsolata\", \"#fff\");\r\n countdown.x = 620;\r\n countdown.y = 33;\r\n countdown.textAlign = \"right\";\r\n mainContainer.addChild(countdown);\r\n newcountdown = countdown.text;\r\n\r\n // level indicator\r\n lvltexttitle = new createjs.Text(\"LEVEL\", \"bold 30px Inconsolata\", \"#aaa\");\r\n lvltexttitle.x = 20;\r\n lvltexttitle.y = 5;\r\n mainContainer.addChild(lvltexttitle);\r\n currentWorld = parseInt((currentLevel - 1) / 5);\r\n lvltext = new createjs.Text((currentWorld + 1)+\"-\"+(currentLevel - (currentWorld * 5)), \"bold 45px Inconsolata\", \"#fff\");\r\n lvltext.x = 20;\r\n lvltext.y = 32;\r\n mainContainer.addChild(lvltext);\r\n\r\n // goals indicator (in-game)\r\n goals_bg = new createjs.Shape();\r\n goals_bg.graphics.beginFill('#000').drawRect(0, 708, 640, 92).endFill();\r\n mainContainer.addChild(goals_bg);\r\n\r\n bonusContainer = new createjs.Container();\r\n bonusContainer.x = 0;\r\n bonusContainer.y = 708;\r\n mainContainer.addChild(bonusContainer);\r\n\r\n // bonus 1 (in-game)\r\n for(bg = 0; bg < levelProperties[currentLevel - 1][5].length; bg ++){\r\n bonuscount = new createjs.Text(levelProperties[currentLevel - 1][5][bg][0], \"12px Arial\", \"#fff\");\r\n bonuscount.x = 20;\r\n bonuscount.y = 10 + (bg * 25);\r\n bonuscount.tileid = levelProperties[currentLevel - 1][5][bg][1];\r\n bonusContainer.addChild(bonuscount);\r\n bonusContainerList.push(bonuscount);\r\n bonustext = new createjs.Text(\"GROUPS OF\", \"12px Arial\", \"#fff\");\r\n bonustext.x = 40;\r\n bonustext.y = 10 + (bg * 25);\r\n bonusContainer.addChild(bonustext);\r\n bonus_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][5][bg][1]);\r\n bonus_sprite.x = 120;\r\n bonus_sprite.y = 7 + (bg * 25);\r\n bonus_sprite.scaleX = bonus_sprite.scaleY = 0.2;\r\n bonusContainer.addChild(bonus_sprite);\r\n bonustext = new createjs.Text(\" BLOCKS = \"+levelProperties[currentLevel - 1][5][bg][2] + \" POINTS\", \"12px Arial\", \"#fff\");\r\n bonustext.x = 140;\r\n bonustext.y = 10 + (bg * 25);\r\n bonusContainer.addChild(bonustext);\r\n }\r\n // bonus 2 (in-game)\r\n for(bg = 0; bg < levelProperties[currentLevel - 1][6].length; bg ++){\r\n bonustext = new createjs.Text(\"A GROUP OF \", \"12px Arial\", \"#fff\");\r\n bonustext.x = 20;\r\n bonustext.y = 10 + (levelProperties[currentLevel - 1][5].length * 25) + (bg * 25);\r\n bonusContainer.addChild(bonustext);\r\n bonuscount = new createjs.Text(levelProperties[currentLevel - 1][6][bg][0], \"12px Arial\", \"#fff\");\r\n bonuscount.x = 100;\r\n bonuscount.y = 10 + (levelProperties[currentLevel - 1][5].length * 25) + (bg * 25);\r\n bonusContainer.addChild(bonuscount);\r\n bonus_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][6][bg][1]);\r\n bonus_sprite.x = 120;\r\n bonus_sprite.y = 7 + (levelProperties[currentLevel - 1][5].length * 25) + (bg * 25);\r\n bonus_sprite.scaleX = bonus_sprite.scaleY = 0.2;\r\n bonusContainer.addChild(bonus_sprite);\r\n bonustext = new createjs.Text(\"BLOCKS = \"+levelProperties[currentLevel - 1][6][bg][2] + \" POINTS\", \"12px Arial\", \"#fff\");\r\n bonustext.x = 145;\r\n bonustext.y = 10 + (levelProperties[currentLevel - 1][5].length * 25) + (bg * 25);\r\n bonusContainer.addChild(bonustext);\r\n }\r\n // attention (in-game)\r\n for(bg = 0; bg < levelProperties[currentLevel - 1][7].length; bg ++){\r\n bonus_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][7][bg][0]);\r\n bonus_sprite.x = 295;\r\n bonus_sprite.y = 3 + (bg * 25);\r\n bonus_sprite.scaleX = bonus_sprite.scaleY = 0.25;\r\n bonusContainer.addChild(bonus_sprite);\r\n bonustext = new createjs.Text(levelProperties[currentLevel - 1][7][bg][1].toUpperCase(), \"12px Arial\", \"#fff\");\r\n bonustext.x = 320;\r\n bonustext.y = 10 + (bg * 25);\r\n bonusContainer.addChild(bonustext);\r\n }\r\n\r\n // set some vars that are used for each level\r\n clickplayed = false;\r\n gamestarted = false; // temporarily disable the game to prevent timer routine kicking in\r\n checkingAdjacents = false;\r\n checkingMovements = false;\r\n scoregfxList = [];\r\n combocounter= 0;\r\n shardList = [];\r\n smokeList = [];\r\n layoverList = [];\r\n vcList= [];\r\n shakecount = 0;\r\n gameContainer.x = 20;\r\n levelupplayed = false;\r\n blockplaying = false;\r\n cleanup = false; // indicator for checking if any cleaning up is going on\r\n busy = true;\r\n gameContainer.y = 88;\r\n\r\n // building prelude screen\r\n prelude_sinstart = 0;\r\n\r\n getready = createjs.Sound.play('getready');\r\n getready.addEventListener(\"complete\", function test(){\r\n createjs.Sound.play('preludeloop', {loop: -1});\r\n });\r\n\r\n preludeContainer = new createjs.Container();\r\n preludeContainer.x = 0;\r\n preludeContainer.y = 88;\r\n mainContainer.addChild(preludeContainer);\r\n prelude_bg = new createjs.Shape();\r\n prelude_bg.graphics.beginFill('#000').drawRect(0, 0, 640, 720).endFill();\r\n preludeContainer.addChild(prelude_bg);\r\n\r\n currentWorld = parseInt((currentLevel - 1) / 5);\r\n levelindicator = new createjs.Text(\"LEVEL \" + (currentWorld + 1)+\" - \" + (currentLevel - (currentWorld * 5)), \"24px Oswald\", \"#fff\");\r\n levelindicator.x = 320;\r\n levelindicator.y = 50;\r\n levelindicator.lineHeight = 40;\r\n levelindicator.textAlign = \"center\";\r\n preludeContainer.addChild(levelindicator);\r\n\r\n goals_title = new createjs.Text(\"GOALS\", \"24px Oswald\", \"#aaa\");\r\n goals_title.x = 320;\r\n goals_title.y = 120;\r\n goals_title.lineHeight = 40;\r\n goals_title.textAlign = \"center\";\r\n preludeContainer.addChild(goals_title);\r\n\r\n goals_temp = \"\";\r\n goals_temp += \"- You will need a score of at least \" + levelProperties[currentLevel - 1][3] + \" points to advance\\n\";\r\n goals_temp += \"- Each group needs to consist of at least \" + levelProperties[currentLevel - 1][4] + \" similar blocks\\n\";\r\n goals = new createjs.Text(goals_temp, \"24px Oswald\", \"#aaa\");\r\n goals.x = 50;\r\n goals.y = 170;\r\n goals.lineHeight = 40;\r\n goals.textAlign = \"left\";\r\n preludeContainer.addChild(goals);\r\n\r\n bonus_title = new createjs.Text(\"BONUS\", \"24px Oswald\", \"#aaa\");\r\n bonus_title.x = 320;\r\n bonus_title.y = 275;\r\n bonus_title.lineHeight = 40;\r\n bonus_title.textAlign = \"center\";\r\n preludeContainer.addChild(bonus_title);\r\n\r\n // bonus 1 (prelude)\r\n bonus_temp = \"\";\r\n for(bg = 0; bg < levelProperties[currentLevel - 1][5].length; bg ++){\r\n bonus_temp += \"- Create \" + levelProperties[currentLevel - 1][5][bg][0] + \" groups of for an extra \" + levelProperties[currentLevel - 1][5][bg][2] + \" points\\n\";\r\n prelude_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][5][bg][1]);\r\n prelude_sprite.x = 260;\r\n prelude_sprite.y = 322 + (bg * 40);\r\n prelude_sprite.scaleX = prelude_sprite.scaleY = 0.3;\r\n preludeContainer.addChild(prelude_sprite);\r\n preludeContainerList.push(prelude_sprite);\r\n }\r\n bonus = new createjs.Text(bonus_temp, \"24px Oswald\", \"#aaa\");\r\n bonus.x = 50;\r\n bonus.y = 325;\r\n bonus.lineHeight = 40;\r\n bonus.textAlign = \"left\";\r\n preludeContainer.addChild(bonus);\r\n // bonus 2\r\n bonus_temp = \"\";\r\n for(bg = 0; bg < levelProperties[currentLevel - 1][6].length; bg ++){\r\n bonus_temp += \"- Create a group of \" + levelProperties[currentLevel - 1][6][bg][0] + \" blocks for \" + levelProperties[currentLevel - 1][6][bg][2] + \" points\\n\";\r\n prelude_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][6][bg][1]);\r\n prelude_sprite.x = 260;\r\n prelude_sprite.y = 320 + (levelProperties[currentLevel - 1][5].length * 40) + (bg * 40);\r\n prelude_sprite.scaleX = prelude_sprite.scaleY = 0.3;\r\n preludeContainer.addChild(prelude_sprite);\r\n preludeContainerList.push(prelude_sprite);\r\n }\r\n // combocounter\r\n bonus_temp += \"- Create a combo bigger than \" + biggestCombo + \"\\n\";\r\n bonus = new createjs.Text(bonus_temp, \"24px Oswald\", \"#aaa\");\r\n bonus.x = 50;\r\n bonus.y = 322 + (levelProperties[currentLevel - 1][5].length * 40) + (levelProperties[currentLevel - 1][6].length * 40) - 40;\r\n bonus.lineHeight = 40;\r\n bonus.textAlign = \"left\";\r\n preludeContainer.addChild(bonus);\r\n\r\n // attention (on prelude screen, only first one is shown!)\r\n att_temp = \"\";\r\n for(bg = 0; bg < 1; bg ++){\r\n prelude_sprite = new createjs.Sprite(ss_tiles, \"tile\" + levelProperties[currentLevel - 1][7][bg][0]);\r\n prelude_sprite.x = 50;\r\n prelude_sprite.y = 297 + (levelProperties[currentLevel - 1][5].length * 40) + (levelProperties[currentLevel - 1][6].length * 40) + 75;\r\n prelude_sprite.scaleX = prelude_sprite.scaleY = 0.3;\r\n preludeContainer.addChild(prelude_sprite);\r\n preludeContainerList.push(prelude_sprite);\r\n attention = new createjs.Text(levelProperties[currentLevel - 1][7][bg][1], \"24px Oswald\", \"#aaa\");\r\n attention.x = 85;\r\n attention.y = 300 + (levelProperties[currentLevel - 1][5].length * 40) + (levelProperties[currentLevel - 1][6].length * 40) + 75;\r\n attention.lineHeight = 40;\r\n attention.textAlign = \"left\";\r\n preludeContainer.addChild(attention);\r\n }\r\n\r\n btn_lvlstart_bg = new createjs.Shape();\r\n btn_lvlstart_bg.graphics.beginFill('#fff').drawRect(240, 539, 140, 60).endFill();\r\n btn_lvlstart_bg.shadow = new createjs.Shadow(\"#aaa\", 0, 0, 0);\r\n preludeContainer.addChild(btn_lvlstart_bg);\r\n btn_lvlstart = new createjs.Text('START', \"24px Oswald\", \"#000\");\r\n btn_lvlstart.lineheight = 24;\r\n btn_lvlstart.x = 280;\r\n btn_lvlstart.y = 557;\r\n preludeContainer.addChild(btn_lvlstart);\r\n btn_lvlstart_bg.addEventListener(\"click\", function() {\r\n\r\n // the actual buildup of the level happens after the click on the start btn\r\n\r\n levelArray = [[],[],[],[],[],[],[],[]]; // will contain all tiles of the level\r\n gameContainer.removeAllChildren(); // clean up game container\r\n\r\n // break levelcount (ie 18) up into world-level (ie 3-2)\r\n currentWorld = parseInt((currentLevel - 1) / 5);\r\n lvltext.text = (currentWorld + 1) + \"-\" + (currentLevel - (currentWorld * 5));\r\n countdown.text = newcountdown = levelProperties[currentLevel - 1][1];\r\n\r\n // build up the level array\r\n for(r = 0; r < 8; r ++) {\r\n for(c = 0; c < 8; c ++) {\r\n createTile(r, c, true, false); // row, column, unique (not more than 2 adjacents), specialtilesallowed (ie rainbow tile)\r\n levelArray[r].push(sprite);\r\n }\r\n }\r\n\r\n redraw(); // reads levelarray and prints the tiles\r\n\r\n introstarted = false; // no longer showing intro\r\n gamestarted = true; // things are starting at this point\r\n busy = true; // so the buildup starts\r\n createjs.Sound.stop(); // prelude loop stops\r\n if(!musicoff){\r\n createjs.Sound.play(levelProperties[currentLevel - 1][2], {loop: -1}); // music for this level starts, if enabled\r\n }\r\n preludeContainer.removeAllChildren(); // prelude container is cleared\r\n mainContainer.removeChild(preludeContainer); // and removed from stage\r\n\r\n });\r\n\r\n}", "constructor(levels){\n super(levels);\n }", "constructor({type: type, atkDmg: atkDmg, name: name, weapon: weapon,\n health: health, level: level = 1,\n levelDmgModifier: levelDmgModifier = 2,\n currentXP: currentXP = 0, XPToLevel: XPToLevel = 75,\n imgFile: imgFile}) {\n super(type, atkDmg, name, health, imgFile);\n this.weapon = weapon;\n this.level = level;\n this.levelDmgModifier = levelDmgModifier;\n this.currentXP = currentXP;\n this.XPToLevel = XPToLevel;\n }", "function formula(level) {\n return level * 100;\n }", "function getTier(level) {\n switch (level) {\n case 1: case 2: case 3: case 4:\n return 1;\n case 5: case 6: case 7: case 8:\n return 2;\n case 9: case 10: case 11: case 12:\n return 3;\n case 13: case 14: case 15: case 16:\n return 4;\n case 17: case 18: case 19: case 20:\n return 5;\n default:\n return NaN;\n }\n}", "function beetle_lvl5() {}", "constructor(options = {}) {\n options.direcred = options.hasOwnProperty('direcred') ? options.direcred : true;\n options.weighted = options.hasOwnProperty('weighted') ? options.weighted : false;\n options.edges = options.hasOwnProperty('edges') ? options.edges : null;\n\n this.direcred = options.direcred;\n this.weighted = options.weighted;\n this.adjacencyList = {};\n this.nodes = {};\n this.nodeCount = 0;\n\n if (Array.isArray(options.edges)) {\n for (let index = 0; index < options.edges.length; index++) {\n const edge = options.edges[index];\n\n this.addEdge(edge);\n }\n }\n }", "function addBonusSpeedEffect(modifiers, name, subType, speedType = null) {\n const bonuses = modifiers.filter((modifier) => modifier.type === \"bonus\" && modifier.subType === subType);\n\n let effects = [];\n // \"Equal to Walking Speed\"\n // max(10+(ceil(((@classes.monk.levels)-5)/4))*5,10)\n if (bonuses.length > 0) {\n logger.debug(`Generating ${subType} speed bonus for ${name}`);\n if (!speedType) {\n const innate = subType.split(\"-\").slice(-1)[0];\n speedType = DICTIONARY.character.speeds.find((s) => s.innate === innate).type;\n }\n const bonusValue = bonuses.reduce((speed, mod) => speed + mod.value, 0);\n if (speedType === \"all\") {\n effects.push(generateCustomChange(`+ ${bonusValue}`, 9, `data.attributes.movement.${speedType}`));\n } else {\n effects.push(generateAddChange(bonusValue, 9, `data.attributes.movement.${speedType}`));\n }\n }\n return effects;\n}", "function Cost(range : float, fov : float, fireRate : float, strength : float, effect : int) : int\n{\n return Mathf.FloorToInt(baseCost\n + Mathf.Pow(rangeCostBase*range, rangeCostExp)\n + Mathf.Pow(fovCostBase*fov, fovCostExp)\n + Mathf.Pow(fireRateCostBase*fireRate, fireRateCostExp)\n + Mathf.Pow(strengthCostBase*strength, strengthCostExp));\n}", "constructor(x,y,scal,lev){\n this.x=x;\n this.y=y;\n this.scale=scal;\n this.dir=1;\n this.level=lev;\n }", "displayWeight(){\n console.log(`${this.weight} pounds`);\n }", "constructor(name, options) {\n\n super()\n //init. \n this.name = '';\n this.caseSensitive = false;\n this.properties = {};\n this.nodes = [];\n this.edges = [];\n this.initializers = [];\n this.exports = [];\n this.inports = {};\n this.outports = {};\n this.groups = [];\n\n if(!name)\n name= '';\n if(!options)\n options = {};\n this.name = name;\n this.properties = {};\n this.nodes = [];\n this.edges = [];\n this.initializers = [];\n this.exports = [];\n this.inports = {};\n this.outports = {};\n this.groups = [];\n this.transaction = {\n id: null,\n depth: 0\n };\n\n this.caseSensitive = options.caseSensitive || false;\n }", "function levelAWrite(context, percent) {\n if (percent <= 0.1) {\n writeAdvice(context, \"green\");\n } else if ((percent > 0.1) && (percent <= 0.3)) {\n writeAdvice(context, \"yellow\");\n } else {\n writeAdvice(context, \"red\");\n }\n}", "get weighting() { return this._weighting; }", "changelevel(num,speed)\n\t{\n\t\tthis.hitnum = num;\n\t\tthis.len = speed;\n\t}", "function Food(nameinfo, costinfo, storeinfo, buyerinfo) {\n this.name = nameinfo;\n this.cost = costinfo;\n this.store = storeinfo;\n this.info = function (buyerinfo) {\n return buyerinfo + `'s favorite pizza is: ` + this.name;\n }\n}", "setActionWeight(action, weight) {\n action.enabled = true\n action.setEffectiveTimeScale(1)\n action.setEffectiveWeight(weight)\n }", "addChild(node, weight = Infinity, type = 'DEFAULT') {\n this.children.push({ node: node, weight: weight, type: type });\n }", "get cost() {\n return {}\n }", "attach(imp, number) {\n imp.extra['crit'] += 10\n }", "function calcPrestigeLevel() {\n\n}", "function ManaRegenerationRate(level, amount, text) {\n //Mana regeneration rate is the affix which decreases the amount of time that it takes for the hero to regenerate mana\n Suffix.call(this);\n this.level = level;\n this.text = text;\n this.amount = _.random(amount[0], amount[1]);\n this.displayText = \"+\" + this.amount + \" Mana Regeneration Rate\";\n }", "function passaDeLevel(){\n\tif(jogoEmAndamento==true){\n\t\tjogador.setLevel(jogador.getLevel()+1);\n\t\tjogador.setPontuacao(jogador.getPontuacao()+(1000*jogador.getLevel()));\n\t\tjogador.setVelocidadeMax(jogador.getVelocidadeMax()*1.1);\n\t}\n}", "function Weight() {\n\tthis.value = Math.random() * .2 - .1;\n\tthis.gradient = 0;\n}", "setLevel(level) {\n this.level = level;\n }", "constructor(name, health){//name and health will be varied\n\t\t\tthis.name = name;//the name is whatever the user chooses\n\t\t\tthis.maxHealth = health;//this will allow the character health to be restored if needed to it's max\n\t\t\tthis.currentHealth = health;//this health depeds\n\t\t\tthis.isIncapacitated = false;\n\t\t\tthis.barriers = {//basic statistics for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 10,\n\t\t\t\tsneak: 10,\n\t\t\t\tpersuade: 10\n\t\t\t};\n\t\t\tthis.skills ={//basic skill stats for all characters. THIS IS AN OBJECT AS A PROPERTY\n\t\t\t\tattack: 0,\n\t\t\t\tsneak: 0,\n\t\t\t\tpersuade: 0\n\t\t\t};\n\t\t}", "constructor(level) {\n this.fields = [];\n\n this.level = level;\n this.score = 0;\n\n this.levelSettings = [\n {id: 0, xWidth: 0, yWidth: 1, Ystart: 0, speed: 0, lines: 0},\n {id: 1, xWidth: 10, yWidth: 10, Ystart: 7, speed: 500, lines: 10},\n {id: 2, xWidth: 16, yWidth: 10, Ystart: 5, speed: 550, lines: 12},\n {id: 3, xWidth: 11, yWidth: 10, Ystart: 6, speed: 500, lines: 14},\n {id: 4, xWidth: 12, yWidth: 10, Ystart: 7, speed: 450, lines: 16},\n {id: 5, xWidth: 13, yWidth: 11, Ystart: 8, speed: 400, lines: 18},\n {id: 6, xWidth: 14, yWidth: 12, Ystart: 9, speed: 350, lines: 20},\n {id: 7, xWidth: 15, yWidth: 13, Ystart: 10, speed: 300, lines: 22},\n ]\n\n this.START_LEVEL(1);\n }", "get Weight()\n {\n return fnCalcWeight(this.Shaft, this.Length);\n }", "function levelAMeter(context, percent) {\n var gauge = new RGraph.CornerGauge(\"AdviceCanvas\", 0, 1, percent)\n .Set(\"chart.colors.ranges\", [[0.3, 1, \"red\"], [0.1, 0.3, \"yellow\"],\n [0, 0.1, \"green\"]]);\n drawMeter(gauge);\n}", "spread(levels) {\n for (let i = 0; i < levels; i++) {\n const maxLevel = this.cases.map(node => node.level).reduce((max, cur) => Math.max(max, cur), -Infinity);\n\n const possibleDonors = this.cases.filter(x => x.level === maxLevel);\n\n for (const donor of possibleDonors) {\n this.transmit(donor, this.epiParams);\n }\n this.caseList = [...this.preorder()];\n }\n }", "constructor(name, hpStat, attackStat, defenseStat, abilitiesStat){\r\n this.name = name;\r\n this.hpStat = hpStat;\r\n this.attackStat = attackStat;\r\n this.defenseStat = defenseStat;\r\n this.abilitiesStat = abilitiesStat;\r\n }", "function Tool(toolName, toolType, energyCost, count, toolTipWidth = 128, toolTipHeight = 16) {\n Item.call(this, toolName, toolType, count, toolTipWidth, toolTipHeight);\n\n this.energyCost = energyCost;\n}", "function getLineWeight(zoom, priority) {\n\tvar lineWeight = zoom - 10;\n\tlineWeight = (lineWeight <= 0 ? 1 : lineWeight) * 1.4;\n\tlineWeight *= rkGlobal.lineWidthFactor[priority];\n\treturn lineWeight;\n}", "report() {\n\t\tconsole.log(`${this.name}'s energy level is ${this.elevel}.`);\n\t}", "burrowEfficiency(speed, depth) {\n return (speed * depth);\n }", "constructor(level, obj = {\n boardWidth: 1200,\n boardHeight: 500,\n nOfApples: 1,\n snakeLength: 3,\n currentScore: 0,\n highScore: 0,\n }) {\n\n switch (level) {\n case 1: this.snakeSpeed = 1; break;\n case 2: this.snakeSpeed = 2; break;\n case 3: this.snakeSpeed = 4; break;\n default: return null;\n\n }\n if (obj.snakeSpeed) {\n this.snakeSpeed = obj.snakeSpeed;\n }\n this.boardWidth = obj.boardWidth;\n this.boardHeight = obj.boardHeight;\n this.nOfApples = obj.nOfApples;\n this.snakeLength = obj.snakeLength;\n this.currentScore = obj.currentScore;\n this.highScore = obj.highScore;\n }", "constructor(name, age, weight) {\n //this.name = name;\n super(name); // calling the parent constructor with this argument\n this.age = age;\n this.weight = weight;\n }", "getMaxWeight() {\n mustInherit();\n }", "showStats(){\n console.log(\"Name:\", this.name, \"\\nStrength:\", this.strength, \"\\nSpeed:\", this.speed, \"\\nHealth:\", this.health);\n }", "setLevel(value) { this.level = ~~value; }", "function Item(name, numUses, power) {\n this.name = name;\n this.uses = numUses;\n this.power = power;\n}", "function Ability(name, defense, cost) {\r\n this.name = name;\r\n this.defense = defense;\r\n this.cost = cost;\r\n}" ]
[ "0.5835962", "0.5690901", "0.56734717", "0.56602925", "0.5633798", "0.55206877", "0.55206877", "0.5517465", "0.5449514", "0.54214585", "0.5397725", "0.5386274", "0.5374661", "0.53259796", "0.5322912", "0.53166866", "0.5212185", "0.5196772", "0.51891017", "0.51315945", "0.509847", "0.5092635", "0.5091602", "0.50822586", "0.50755346", "0.5074128", "0.503596", "0.5022813", "0.5006229", "0.499927", "0.4990841", "0.49798244", "0.4978491", "0.4964226", "0.49575424", "0.49551728", "0.49518552", "0.4950691", "0.49504438", "0.49474263", "0.49411806", "0.4939175", "0.49384183", "0.49339852", "0.49316952", "0.49195218", "0.49023157", "0.49005768", "0.48729265", "0.48699996", "0.48570958", "0.48465994", "0.484588", "0.48456183", "0.48327735", "0.483219", "0.48301804", "0.4823619", "0.48193967", "0.47964242", "0.47762978", "0.4774507", "0.4763335", "0.47603956", "0.47579902", "0.4757745", "0.4755603", "0.47550568", "0.47508043", "0.47490707", "0.47400343", "0.47363943", "0.47316322", "0.47176313", "0.47087833", "0.47080827", "0.47047633", "0.47023097", "0.46996048", "0.4687414", "0.46873027", "0.46822008", "0.46801502", "0.46763942", "0.46737248", "0.466746", "0.46574792", "0.4650026", "0.4649413", "0.46390218", "0.4638991", "0.46384314", "0.4637484", "0.46343642", "0.4629458", "0.46175814", "0.46157792", "0.46136716", "0.4610389", "0.46058902" ]
0.46350038
93
STEP 1: Define a provider function
function ShoppingListServiceProvider() { /* What makes this whole setup very special is the fact that you could provide some config object inside the service provider, and that usually comes with defaults that you can later overwrite in the step where you configure the entire application */ this.config = { maxItems: 10 }; /* It is a special function that has a particular property on the actual instance of the function ($get) which is a factory function that create your service This $get property that's a function, is what makes the provider a provider AngularJS expects the provider to have a $get property whose value is a function that Angular will treat as a factory function */ this.$get = function() { return new ShoppingListService(this.config.maxItems); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ProviderData() {}", "function ProviderData() {}", "function ProviderData() {}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "function SubProvider() {\n\n}", "function ProviderData(){}", "function SubProvider() {\n\n\t}", "function ModuleWithProviders() {}", "function ModuleWithProviders() {}", "function ModuleWithProviders() {}", "function SubProvider() {\n\t\n\t}", "function ProviderData() { }", "function ProviderData() { }", "function ModuleWithProviders(){}", "function ModuleWithProviders() { }", "function ModuleWithProviders() { }", "function Provider( name, makeReq )\n{\n this.name = name;\n this.makeReq = makeReq;\n}", "function MockedProvider() {\n /* ... */\n}", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function Provider(provider) {\n this.provider = provider;\n }", "function provider(str) {\n return 'provider/' + str;\n}", "function setProvider(impl) {\n provider = impl;\n}", "function getProvider()\n{\n return providers[ iProvider ];\n}", "function providerPlusOne() {\n // private\n var one = 1;\n var sum = 0;\n return {\n // public on config, else private\n plusOne: function(num) {\n sum = num + one;\n },\n $get: function() {\n // public\n return {\n getSum: sum\n }\n }\n }\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "processProvider(provider, ngModuleType, providers) {\n // Determine the token from the provider. Either it's its own token, or has a {provide: ...}\n // property.\n provider = resolveForwardRef(provider);\n let token = isTypeProvider(provider) ? provider : resolveForwardRef(provider && provider.provide);\n // Construct a `Record` for the provider.\n const record = providerToRecord(provider, ngModuleType, providers);\n if (!isTypeProvider(provider) && provider.multi === true) {\n // If the provider indicates that it's a multi-provider, process it specially.\n // First check whether it's been defined already.\n let multiRecord = this.records.get(token);\n if (multiRecord) {\n // It has. Throw a nice error if\n if (ngDevMode && multiRecord.multi === undefined) {\n throwMixedMultiProviderError();\n }\n }\n else {\n multiRecord = makeRecord(undefined, NOT_YET, true);\n multiRecord.factory = () => injectArgs(multiRecord.multi);\n this.records.set(token, multiRecord);\n }\n token = provider;\n multiRecord.multi.push(provider);\n }\n else {\n const existing = this.records.get(token);\n if (ngDevMode && existing && existing.multi !== undefined) {\n throwMixedMultiProviderError();\n }\n }\n this.records.set(token, record);\n }", "function useNextProvider()\n{\n iProvider = ( iProvider + 1 ) % providers.length;\n}", "initProvider(name) {\n\t\tif(this.availableProviders.has(name) && !this.providers.has(name)) {\n\t\t\tvar actProvider = this.availableProviders.get(name);\n\t\t\treturn this.providerFactory(name, actProvider[0], actProvider[1], actProvider[2]);\n\t\t}\n\t\telse {\n\t\t\t return false;\n\t\t}\n\t}", "makeExtendedProvider(mapping, config) {\n const providerCallback = this.extendedProviders.get(config.driver);\n if (!providerCallback) {\n throw new utils_1.Exception(`Invalid provider \"${config.driver}\"`);\n }\n return providerCallback(this, mapping, config);\n }", "function _createProvider() {\n return {\n meta: {\n title: 'GitHub',\n mode: 'redirect',\n scene: true,\n bean: 'github',\n render: 'buttonGithub',\n validator: {\n module: 'a-auth',\n validator: 'oauth2',\n },\n icon: { f7: ':auth:github' },\n },\n };\n }", "function addMethod(name,fn){customMethods[name]=fn;return provider;}", "providerFactory(providerClass, urlParams, getParams, responseParams) {\n\t\tvar myProviderObj = this.providers.get(providerClass);\n\t\tif(!myProviderObj && providerClazzDir[providerClass]) {\n\t\t\tmyProviderObj = new providerClazzDir[providerClass](urlParams, getParams, responseParams);\n\t\t\tthis.providers.set(providerClass, myProviderObj);\n\t\t\treturn myProviderObj;\n\t\t}\n\t\tconsole.error('provider class was not found:' +providerClass);\n\t}", "function definition1() {\n\t\t\t\t\t\t\tlog('provide', '/app/js/example1', 'resolved', 'module');\n\n\t\t\t\t\t\t\treturn function appJsExample1() {\n\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}", "function registerProvider(provider, configFunction) {\n provider = provider.toLowerCase();\n var configRef = \"providers.\" + provider;\n if (config.getItem(configRef + \".credentials\")) {\n var credentials = config.getItem(configRef + \".credentials\");\n credentials.passReqToCallback = true;\n var options = config.getItem(configRef + \".options\") || {};\n configFunction(credentials, passport, authHandler);\n // register provider routes\n router.get(\n \"/\" + provider,\n passportCallback(provider, options, \"login\")\n );\n // register provider callbacks\n router.get(\n \"/\" + provider + \"/callback\",\n passportCallback(provider, options, \"login\"),\n initSession,\n oauthErrorHandler\n );\n if (!config.getItem(\"security.disableLinkAccounts\")) {\n // register link route\n router.get(\n \"/link/\" + provider,\n passport.authenticate(\"bearer\", { session: false }),\n passportCallback(provider, options, \"link\")\n );\n // register link callback\n router.get(\n \"/link/\" + provider + \"/callback\",\n passport.authenticate(\"bearer\", { session: false }),\n passportCallback(provider, options, \"link\"),\n linkSuccess,\n oauthErrorHandler\n );\n }\n console.log(provider + \" loaded.\");\n }\n }", "function LessonAdditionProvider(submitLocation)\n{\n this.submitLocation = submitLocation;\n}", "function PubfoodProvider() {\n this.throwErrors_ = false;\n}", "get provider() {\n return this.use().provider;\n }", "constructor(fetcher, providerName = 'api-key') {\n this.fetcher = fetcher;\n }", "function definition2(appJsExample1) {\n\t\t\t\t\t\t\tlog('provide', '/app/js/example2', 'resolved', 'module, with dependency');\n\n\t\t\t\t\t\t\treturn function appJsExample2() {\n\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\t}", "get provider() {\n\t\treturn this.__provider;\n\t}", "checkProvider({ currentProvider, contractName }) {\n if (!currentProvider)\n throw new Error(\n `${contractName} error: Please call setProvider() first before calling new().`\n );\n }", "checkProvider({ currentProvider, contractName }) {\n if (!currentProvider)\n throw new Error(\n `${contractName} error: Please call setProvider() first before calling new().`\n );\n }", "makeUserProviderInstance(mapping, providerConfig) {\n if (!providerConfig || !providerConfig.driver) {\n throw new utils_1.Exception('Invalid auth config, missing \"provider\" or \"provider.driver\" property');\n }\n switch (providerConfig.driver) {\n case 'lucid':\n return this.makeLucidProvider(providerConfig);\n case 'database':\n return this.makeDatabaseProvider(providerConfig);\n default:\n return this.makeExtendedProvider(mapping, providerConfig);\n }\n }", "getProvider( id ) {\n return this.getProviders()[id];\n }", "function providerToFactory(provider,ngModuleType,providers){var factory=undefined;if(isTypeProvider(provider)){return injectableDefOrInjectorDefFactory(resolveForwardRef(provider));}else{if(isValueProvider(provider)){factory=function factory(){return resolveForwardRef(provider.useValue);};}else if(isExistingProvider(provider)){factory=function factory(){return inject(resolveForwardRef(provider.useExisting));};}else if(isFactoryProvider(provider)){factory=function factory(){return provider.useFactory.apply(provider,Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(injectArgs(provider.deps||[])));};}else{var classRef_1=resolveForwardRef(provider&&(provider.useClass||provider.provide));if(!classRef_1){var ngModuleDetail='';if(ngModuleType&&providers){var providerDetail=providers.map(function(v){return v==provider?'?'+provider+'?':'...';});ngModuleDetail=\" - only instances of Provider and Type are allowed, got: [\"+providerDetail.join(', ')+\"]\";}throw new Error(\"Invalid provider for the NgModule '\"+stringify(ngModuleType)+\"'\"+ngModuleDetail);}if(hasDeps(provider)){factory=function factory(){return new(classRef_1.bind.apply(classRef_1,Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])([void 0],injectArgs(provider.deps))))();};}else{return injectableDefOrInjectorDefFactory(classRef_1);}}}return factory;}", "factory(name, Factory) {\n return this.provider.call(this, name, function GenericProvider() {\n this.$get = Factory;\n });\n }", "function resolveReflectiveProvider(provider){return new ResolvedReflectiveProvider_(ReflectiveKey.get(provider.provide),[resolveReflectiveFactory(provider)],provider.multi||false);}", "function fetchDataGetterByProvider(provider) {\n if (provider === 'fitbit') return getFitbitData;\n if (provider === 'facebook') return getFacebookData;\n if (provider === 'moves') return getMovesData;\n if (provider === 'twothreeandme') return getTwothreeandmeData;\n}", "static describe () {\n\t\treturn {\n\t\t\ttag: 'provider-auth',\n\t\t\tsummary: 'Initiates authorization with a third-party provider by returning the appropriate redirect',\n\t\t\taccess: 'No authorization needed, this is essentially just a redirect to the third-party auth process',\n\t\t\tdescription: 'Provides the appropriate redirect response to initiate authorization against the given third-party provider; a temporary auth code is required, retrieved via the @@#provider-auth-code#provider-auth-code@@ request, to make this call',\n\t\t\tinput: {\n\t\t\t\tsummary: 'Specify the provider in the path, and an auth code, retrieved from the @@#provider-auth-code#provider-auth-code@@ request, in the query parameters',\n\t\t\t\tlooksLike: {\n\t\t\t\t\t'code*': '<Temporary third-party auth code, retrieved from the @@#provider-auth-code#provider-auth-code@@ request>',\n\t\t\t\t\t'host': '<Redirect to this host instead of the standard one (eg. for on-premise versions), required for on-prem integrations>'\n\t\t\t\t}\n\t\t\t},\n\t\t\treturns: 'Redirects to the appropriate authorization page for the provider in question'\n\t\t};\n\t}", "_loadFnOrClass(fnOrClass) {\n // TODO(vojta): should we expose provider.token?\n var annotations = readAnnotations(fnOrClass);\n var token = annotations.provide.token || fnOrClass;\n var provider = createProviderFromFnOrClass(fnOrClass, annotations);\n\n this._providers.set(token, provider);\n }", "function provider() {\n\n // Configuration parameters for Showdown\n var config = {\n extensions: [],\n stripHtml: true\n };\n\n /**\n * Sets a configuration option\n *\n * @param {string} key Config parameter key\n * @param {string} value Config parameter value\n */\n this.setOption = function (key, value) {\n config.key = value;\n\n return this;\n };\n\n /**\n * Gets the value of the configuration parameter specified by key\n *\n * @param {string} key The config parameter key\n * @returns {string|null} Returns the value of the config parameter. (or null if the config parameter is not set)\n */\n this.getOption = function (key) {\n if (config.hasOwnProperty(key)) {\n return config.key;\n } else {\n return null;\n }\n };\n\n /**\n * Loads a Showdown Extension\n *\n * @param {string} extensionName The name of the extension to load\n */\n this.loadExtension = function (extensionName) {\n config.extensions.push(extensionName);\n\n return this;\n };\n\n function SDObject() {\n var converter = new Showdown.converter(config);\n\n /**\n * Converts a markdown text into HTML\n *\n * @param {string} markdown The markdown string to be converted to HTML\n * @returns {string} The converted HTML\n */\n this.makeHtml = function (markdown) {\n return converter.makeHtml(markdown);\n };\n\n /**\n * Strips a text of it's HTML tags\n *\n * @param {string} text\n * @returns {string}\n */\n this.stripHtml = function (text) {\n return String(text).replace(/<[^>]+>/gm, '');\n };\n }\n\n // The object returned by service provider\n this.$get = function () {\n return new SDObject();\n };\n }", "function provideSomeManaged(managed) {\n return self => (0, _use.use_)(managed, a => provide.provide_(self, a));\n}", "AddSearchProvider() {}", "function promoterenhancer(){\n\n}", "function _createProvider() {\n return {\n meta: {\n title: 'Open Auth',\n mode: 'direct',\n scene: false,\n inner: true,\n bean: 'open',\n render: null,\n validator: null,\n icon: { f7: ':role:shield-key' },\n },\n };\n }", "function provideHint(){\n\t// add code here\n}", "function prepProvider(provider) {\n // Map parameter to something that adnuntius endpoint understands.\n const mappedParameters = {\n siteId: 's',\n userId: 'browserId',\n browserId: 'browserId',\n folderId: 'folderId'\n }\n\n const tzo = new Date().getTimezoneOffset();\n const URL = ['https://data.adnuntius.com/usr?tzo=' + tzo]\n Object.keys(provider).forEach(key => {\n URL.push(`${mappedParameters[key]}=${provider[key]}`)\n })\n\n return new Promise((resolve, reject) => {\n ajax(URL.join('&'), {\n success: function (res) {\n const response = JSON.parse(res)\n resolve(response)\n },\n error: function (err) { reject(err) }\n });\n });\n}", "get provider () {\n\t\treturn this._provider;\n\t}", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "findProviders(using, provider, exactMatch) {\n // TODO(juliemr): implement.\n return [];\n }", "function setDefaults(definition){providerConfig.optionsFactory=definition.options;providerConfig.methods=(definition.methods||[]).concat(EXPOSED_METHODS);return provider;}", "constructor(providerName, providerType, payload) {\n this.providerName = providerName;\n this.providerType = providerType;\n this.payload = payload;\n }", "provider(req, res) {\n logService.logInfo('[providers] - List of providers');\n Promise.resolve(req.params)\n .then(this.providerService.provider)\n .then(data => res.send(data))\n .catch(this._handleError.bind(this, res));\n }", "function GreetFactory(lang)\n{\n if(lang==='EN')\n {\n return(function (firstname,lastname){\n console.log('Hello' + ' '+ firstname+ ' '+ lastname);\n });\n }\n if(lang==='TN')\n {\n return(function (firstname,lastname){\n console.log('Vanakam' + ' '+ firstname+ ' '+ lastname);\n });\n }\n}", "setProvider(state, provider) {\n const { providers } = state;\n let newProviders;\n if (providers.some(p => p.rpcUrl === provider.rpcUrl)) {\n newProviders = providers.map(p => (p.rpcUrl === provider.rpcUrl ? provider : p));\n } else {\n newProviders = [...providers, provider];\n }\n\n return {\n ...state,\n current: provider,\n chainId: 'loading',\n providers: newProviders,\n };\n }", "createBlankProvider() {\n return {\n insuranceName: '',\n insuranceAddress: '',\n insuranceCity: '',\n insuranceCountry: '',\n insuranceState: '',\n insuranceZipcode: '',\n insurancePhone: '404-123-1234',\n insurancePolicyHolderName: '',\n insurancePolicyNumber: '',\n insuranceGroupCode: '',\n };\n }", "static getProvider(providerName) {\n const provider = this.providers.find(provider => provider.name === providerName);\n provider.authLink = this.getAuthLink(provider);\n return provider;\n }", "getProviderName(): string {\n return 'smsc';\n }", "function resolveProvider$1(provider,tInjectables,lInjectablesBlueprint,isComponent$$1,isViewProvider){provider=resolveForwardRef(provider);if(Array.isArray(provider)){// Recursively call `resolveProvider`\n// Recursion is OK in this case because this code will not be in hot-path once we implement\n// cloning of the initial state.\nfor(var i=0;i<provider.length;i++){resolveProvider$1(provider[i],tInjectables,lInjectablesBlueprint,isComponent$$1,isViewProvider);}}else{var lView=getLView();var token=isTypeProvider(provider)?provider:resolveForwardRef(provider.provide);var providerFactory=providerToFactory(provider);var tNode=getPreviousOrParentTNode();var beginIndex=tNode.providerIndexes&65535/* ProvidersStartIndexMask */;var endIndex=tNode.directiveStart;var cptViewProvidersCount=tNode.providerIndexes>>16/* CptViewProvidersCountShift */;if(isTypeProvider(provider)||!provider.multi){// Single provider case: the factory is created and pushed immediately\nvar factory=new NodeInjectorFactory(providerFactory,isViewProvider,directiveInject);var existingFactoryIndex=indexOf(token,tInjectables,isViewProvider?beginIndex:beginIndex+cptViewProvidersCount,endIndex);if(existingFactoryIndex==-1){diPublicInInjector(getOrCreateNodeInjectorForNode(tNode,lView),lView,token);tInjectables.push(token);tNode.directiveStart++;tNode.directiveEnd++;if(isViewProvider){tNode.providerIndexes+=65536/* CptViewProvidersCountShifter */;}lInjectablesBlueprint.push(factory);lView.push(factory);}else{lInjectablesBlueprint[existingFactoryIndex]=factory;lView[existingFactoryIndex]=factory;}}else{// Multi provider case:\n// We create a multi factory which is going to aggregate all the values.\n// Since the output of such a factory depends on content or view injection,\n// we create two of them, which are linked together.\n//\n// The first one (for view providers) is always in the first block of the injectables array,\n// and the second one (for providers) is always in the second block.\n// This is important because view providers have higher priority. When a multi token\n// is being looked up, the view providers should be found first.\n// Note that it is not possible to have a multi factory in the third block (directive block).\n//\n// The algorithm to process multi providers is as follows:\n// 1) If the multi provider comes from the `viewProviders` of the component:\n// a) If the special view providers factory doesn't exist, it is created and pushed.\n// b) Else, the multi provider is added to the existing multi factory.\n// 2) If the multi provider comes from the `providers` of the component or of another\n// directive:\n// a) If the multi factory doesn't exist, it is created and provider pushed into it.\n// It is also linked to the multi factory for view providers, if it exists.\n// b) Else, the multi provider is added to the existing multi factory.\nvar existingProvidersFactoryIndex=indexOf(token,tInjectables,beginIndex+cptViewProvidersCount,endIndex);var existingViewProvidersFactoryIndex=indexOf(token,tInjectables,beginIndex,beginIndex+cptViewProvidersCount);var doesProvidersFactoryExist=existingProvidersFactoryIndex>=0&&lInjectablesBlueprint[existingProvidersFactoryIndex];var doesViewProvidersFactoryExist=existingViewProvidersFactoryIndex>=0&&lInjectablesBlueprint[existingViewProvidersFactoryIndex];if(isViewProvider&&!doesViewProvidersFactoryExist||!isViewProvider&&!doesProvidersFactoryExist){// Cases 1.a and 2.a\ndiPublicInInjector(getOrCreateNodeInjectorForNode(tNode,lView),lView,token);var factory=multiFactory(isViewProvider?multiViewProvidersFactoryResolver:multiProvidersFactoryResolver,lInjectablesBlueprint.length,isViewProvider,isComponent$$1,providerFactory);if(!isViewProvider&&doesViewProvidersFactoryExist){lInjectablesBlueprint[existingViewProvidersFactoryIndex].providerFactory=factory;}tInjectables.push(token);tNode.directiveStart++;tNode.directiveEnd++;if(isViewProvider){tNode.providerIndexes+=65536/* CptViewProvidersCountShifter */;}lInjectablesBlueprint.push(factory);lView.push(factory);}else{// Cases 1.b and 2.b\nmultiFactoryAdd(lInjectablesBlueprint[isViewProvider?existingViewProvidersFactoryIndex:existingProvidersFactoryIndex],providerFactory,!isViewProvider&&isComponent$$1);}if(!isViewProvider&&isComponent$$1&&doesViewProvidersFactoryExist){lInjectablesBlueprint[existingViewProvidersFactoryIndex].componentProviders++;}}}}", "static getProviderInfo(providerId) {\n return DUMMY_PROVIDER_INFO;\n }", "function ApiProvider() {\n\t\tthis.endpoints = {};\n\t}", "enterParameterMember(ctx) {\n\t}", "static describe () {\n\t\treturn {\n\t\t\ttag: 'provider-set-token',\n\t\t\tsummary: 'Set an access token associated with a third-party provider',\n\t\t\taccess: 'Access tokens are issued per team, so user must be a member of the team passed with the request',\n\t\t\tdescription: 'Access tokens to access third-party provider APIs can be optionally set by the user from the client. This call sets the access token, along with any other provided properties.',\n\t\t\tinput: {\n\t\t\t\tsummary: 'Specify provider in the path, and teamId and token in the request body, along with optional attributes',\n\t\t\t\tlooksLike: {\n\t\t\t\t\t'teamId*': '<ID of the team for which provider access is required>',\n\t\t\t\t\t'token*': '<Token to set>',\n\t\t\t\t\t'host': '<Provider host, for enterprise installations',\n\t\t\t\t\t'data': '<A free-form object containing any additonal data associated with the token>'\n\t\t\t\t}\n\t\t\t},\n\t\t\treturns: {\n\t\t\t\tsummary: 'Returns a directive indicating how to update the user object with new token data',\n\t\t\t\tlooksLike: {\n\t\t\t\t\tuser: '<user directive>'\n\t\t\t\t}\n\t\t\t},\n\t\t\terrors: [\n\t\t\t\t'updateAuth',\n\t\t\t\t'parameterRequired',\n\t\t\t\t'unknownProvider',\n\t\t\t\t'notFound'\n\t\t\t]\n\t\t};\n\t}", "function changeProvider(route, provider) {\n\t switch (route.type) {\n\t case 'collections':\n\t case 'collection':\n\t case 'search':\n\t if (route.params === void 0) {\n\t route.params = {};\n\t }\n\t route.params.provider = provider;\n\t }\n\t if (route.parent) {\n\t changeProvider(route.parent, provider);\n\t }\n\t}", "consumeProvider_3_0 (providers) {\n return this.consumeProvider(providers, '3.0.0')\n }", "function addCustomAPIProviders(registry) {\n\t if (customProviders.length) {\n\t customProviders.forEach((item) => {\n\t const converted = lib.convertProviderData('', item);\n\t if (converted) {\n\t lib.addProvider(item.provider, converted);\n\t }\n\t });\n\t // Set default API provider in router\n\t // registry.router.defaultProvider = customProviders[0].provider;\n\t }\n\t}", "function fnToInject (_) { // eslint-disable-line no-unused-vars\n var testContext = this;\n var injected = Array.prototype.slice.call(arguments, 0);\n\n angular.forEach(injected, function (item, index) {\n var name = fnToInject.$inject[index];\n testContext[name] = item;\n });\n\n if (callback) {\n callback.apply(testContext, injected);\n }\n }", "get providers() { return this._providers; }", "function MdPanelProvider() {\n return {\n 'definePreset': definePreset,\n 'getAllPresets': getAllPresets,\n 'clearPresets': clearPresets,\n '$get': $getProvider()\n };\n}", "function ExamplePaletteProvider(create, elementFactory, lassoTool, palette) {\n this._create = create;\n this._elementFactory = elementFactory;\n this._lassoTool = lassoTool;\n this._palette = palette;\n\n palette.registerProvider(this);\n}", "function addMethod(name, fn) {\n customMethods[name] = fn;\n return provider;\n }" ]
[ "0.7395332", "0.7395332", "0.7395332", "0.73376346", "0.73376346", "0.73376346", "0.7324042", "0.7101354", "0.70876896", "0.70876896", "0.70876896", "0.7083232", "0.699762", "0.699762", "0.6956567", "0.6808574", "0.6808574", "0.67604995", "0.6649817", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.65602934", "0.6489435", "0.63740003", "0.62385786", "0.61600155", "0.61456376", "0.61456376", "0.61456376", "0.61456376", "0.61456376", "0.61456376", "0.6101465", "0.6096293", "0.6074961", "0.5955229", "0.592596", "0.59032637", "0.586727", "0.5866163", "0.58213985", "0.5742331", "0.5723449", "0.572055", "0.5650928", "0.56432277", "0.5630998", "0.5630998", "0.5607118", "0.55932117", "0.5586441", "0.5584718", "0.5579378", "0.5574295", "0.5573029", "0.5570245", "0.55396205", "0.5537538", "0.552035", "0.5511766", "0.5506607", "0.5503795", "0.5499647", "0.549735", "0.5475311", "0.5475311", "0.5475311", "0.5475311", "0.5475311", "0.5475311", "0.54701304", "0.5466047", "0.5442727", "0.54381996", "0.54220545", "0.5415783", "0.5414074", "0.53942865", "0.5388534", "0.53723127", "0.53507006", "0.5327935", "0.53262556", "0.5322723", "0.53170294", "0.5315821", "0.5309367", "0.5287179", "0.527365", "0.5267375", "0.5259798" ]
0.0
-1
Select the text object Create a function that will do "something" when that button is clicked
function handleClick() { console.log("Test: the button was clicked!"); //Test to see if my funciton is tied to the button being clicked console.log(d3.event.target); // "d3.event.target" this will keep track of whatever the thing was that called a function (i.e. if you've got a web page with multiple buttons, this will keep track of which button called the function) //What we really want is to DO something when that button is clicked. What we want is to filter off of the datetime that is inputted //var inputElement = d3.select("#datetime"); // Grab the input box // Note: we already did this var inputValue = dateTime.property("value"); // this lets us get at the text that someone has typed into a form console.log(inputValue); //safety valve to make sure we're grabbing the right text out of the box console.log(tableData); // Create the filter variable var filteredData = tableData.filter(tableData => tableData.datetime === inputValue); //not entirely sure if tableData.Date is correct console.log(filteredData); // remove all the existing data within ufoReport (select all from the table tag, then add .remove() to delete the table tags) // tbody-select_all-tr-.remove // for each loop appending new filtered rows }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function changeText() {\n \n }", "clickObject(phrase){this.__text=phrase;this.commands[phrase].object.click();this.commands[phrase].object.focus()}", "doTextOperation(){let root=this,selection=root.selection;if(root.toggled&&null!==root.toggledCommand){document.execCommand(root.toggledCommand,!1,root.toggledCommand||\"\")}else if(null!==root.command){root.dispatchEvent(new CustomEvent(root.command+\"-button\",{bubbles:!0,cancelable:!0,composed:!0,detail:root}));document.execCommand(root.command,!1,root.commandVal||\"\");root.selection=selection}}", "function ShowTextButton(strFirst : String , strMiddle : String , strLast : String , strButton , obj : GameObject , funcName : String){\n//\tlabelTextButtonFirst.text = strFirst;\n//\tlabelTextButtonMiddle.text = strMiddle;\n//\tlabelTextButtonLast.text = strLast;\n\tlabelTextButton.text = strButton;\n\tptimeTextButton = Time.time + 8;\n//\tobjTextButton.SetActiveRecursively(true);\n\t//spriteBezelTextButton.enabled = false;\n\tboolTextButton = true;\n\tobjReturnButton = obj;\n\tobjFunctionName = funcName;\n}", "function displayText(text) {\n const notOk = document.getElementById('okButton');\n if (notOk) {\n notOk.remove();\n }\n textBox.textContent = text;\n const okButton = document.createElement('button');\n okButton.setAttribute('id','okButton');\n okButton.textContent = 'Ok';\n textContainer.appendChild(okButton);\n okButton.addEventListener('click',okClick);\n}", "function setButtonText(text) { /* JS */\n document.getElementById(\"new-joke-button\").innerHTML = text;\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}", "function buttonHandler(button){\r\n\tvar text = document.getElementById(\"htmlText\");\r\n\r\n\tvar tags = {\r\n\t\tbold : [\"<span class='bold'>\", \"</span>\"],\r\n\t\titalic : [\"<span class='italic'>\", \"</span>\"],\r\n\t\tunderline : [\"<span class='underline'>\", \"</span>\"],\r\n\t\timg : [\"<img class='postImg' src='' alt=''>\", \"</img>\"],\r\n\t\tlink : [\"<a class='postLink' href=''>\", \"</a>\"],\r\n\t\tquote : [\"<q class='postQuote'>\", \"</q>\"],\r\n\t\tmore : [\"<!-- more -->\", \"\"]\r\n\t};\r\n\t\r\n\tvar posI = text.selectionStart;\r\n\tvar posF = text.selectionEnd;\r\n\tvar before = text.value.substring(0, posI);\r\n\tvar after = text.value.substring(posF, text.value.length);\r\n\tvar selected = text.value.substring(posI, posF);\r\n\t\r\n\ttext.value = before + tags[button][0] + selected + tags[button][1] + after;\r\n\r\n\ttext.focus();\r\n\r\n\t//riposiziono adeguatamente il cursore\r\n\ttext.selectionStart = posI + tags[button][0].length;\r\n\ttext.selectionEnd = text.selectionStart;\r\n}", "function clickedTheButton(){\r\n greet();\r\n}", "function buttonClick2() {\n document.getElementById(\"textclick\").innerHTML = \"Text Changed\";\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 }", "function mkButtonText(text){\n return text + mkCaret(); \n }", "function displaytext(text){\r\n document.getElementById(\"javascriptText\").innerText=text;\r\n if(text == \"button 1\"){\r\n document.getElementById(\"javascriptText\").style.color=\"blue\";\r\n }\r\n else{\r\n document.getElementById(\"javascriptText\").className = \"new-style\";\r\n document.getElementById(\"javascriptText\").style.color=\"red\";\r\n }\r\n}", "function createButton(searchedCity) {\n var cityButton = $(\"<button>\").text(searchedCity);\n $(\"#city-buttons\").append(cityButton);\n //i need to add click listener function for the search button\n //this will trigger my text value to be stored in a variable\n }//", "function buttonClicked () {\n let clickedButton = event.target;\n\n valueHTML();\n\n}", "function onClickTextEjercise6() {\n document\n .querySelector(\"#btn-alert\")\n .addEventListener(\"click\", () => alert(\"Hello world\"));\n}", "function buttonClick(){\r\n\r\n var buttonTriggered = this.innerHTML;\r\n clickPress(buttonTriggered);\r\n buttonAnimation(buttonTriggered);\r\n\r\n}", "function AboutButtonClick() {\n console.log(\"About Button Clicked\");\n event.document.getElementById(aboutButton)\n let mytextB = \"My mission is to learn new things and service community better with high quality, excellent value, integrity and enthusiasm. We will function as a team, work ethically, and focus on meeting and striving to exceed the expectations of our community.\";\n aboutButton.textContent = mytextB;\n }", "function onClickTextEjercise3() {\n document.querySelector(\"[name='text']\").style.backgroundColor = \"#808494\";\n}", "textEnter() {}", "function yesButton(){\n\n let q = $$('question')\n q.innerText = 'Please enter your reading speed in words per minute.';\n\n //Remove yes and no buttons\n $$('yes').remove();\n $$('no').remove();\n\n //Create input box\n let text_num = makeSelectionRange('1', '1000', '250');\n\n //Create confirm button\n let confirm = makeEnterButton();\n\n q.after(text_num);\n text_num.after(confirm);\n\n\n}", "function onClickTextEjercise5() {\n document.querySelector(\"#text-exercise-5\").innerHTML =\n \"5. This text was changed!!\";\n}", "selectText(){\r\n this.getRef('input').selectText();\r\n }", "function buttonClick(){\n var customText = document.getElementsByClassName(\"my-input\");\n var results = document.getElementById(\"text\");\n results.innerHTML = \"Hello, \" + customText[0].value; //html code is valid within qutoes\n}", "_doSomething() {\n this._content.innerText = \"You clicked the button\";\n }", "function callText(){\n $(\".ShowText\").click(function(){\n $(\".box-option-click\").show();\n });\n $(\".box-option-click .third-list li a\").click(function(){\n $(\".ShowText\").text(\"\");\n var text = $(this).text();\n $(\".ShowText\").text(text);\n $(\".box-option-click\").hide();\n });\n }", "function btnTEOk() {\n app.ShowPopup ('ok button pressed\\n\\nstring was: '+gd.GetTxtEdit( ));\n}", "function giveName(state) {\n text_entry.show();\n}", "function inputText() {\n memeChoise.text = elInput.value;\n // memeChoise.upperText = memeChoise.text.\n drawImgOnCanvas(memeChoise.id);\n\n}", "selectText(i) {\n const input = document.getElementById(\"titleBox-\" + this.props.category + i);\n input.focus();\n input.select();\n }", "function click() {\n\n setName('Ram')\n setAge(21)\n // console.log(\"button clicked\")\n console.log(name,age)\n }", "function eqClicked() {\r\n calculateResult();\r\n printText();\r\n deleteText();\r\n}", "function getText() {\n\t$(\"button\").click(function (event) {\n\t\tevent.preventDefault();\n\t\tdoResults($(\"textarea\").val());\n\t\tremoveHidden();\n\t\t\n\t})\n}", "function onButton(){\n input();\n output();\n\n}", "function showText(i) {\n Shiny.onInputChange('text_contents', el.data[i-1].longtext);\n }", "function clickButton() {\n //document.getElementById(\"changeText\").innerHTML = \"Texto alterado com sucesso\";\n document.getElementById(\"changeText\").style.display = \"none\";\n}", "function handleMouseDown(e) {\n $(\"#submitTextOnCanvas\").css(\"background\",\"green\");\n $(\"#submitTextOnCanvas\").css(\"color\",\"white\");\n $(\"#hint\").html(\"Then click 'Save'\");\n e.preventDefault();\n text_startX = parseInt(e.clientX - text_canvas.offset().left);\n text_startY = parseInt(e.clientY - text_canvas.offset().top);\n // Put your mousedown stuff here\n for (var i = 0; i < texts.length; i++) {\n if (textHittest(text_startX, text_startY, i)) {\n console.log(\"text-e\");\n \n selectedText = i;\n }\n }\n }", "function onClickTextEjercise4() {\n document.querySelector(\".class-text-4[name='text']\").style.backgroundColor =\n \"#de5658\";\n}", "function handleClick() {\n $('#greeting').text($('#greetingText').val());\n}", "function ansClicked (eventData) {\n\tlet buttonInformation = eventData;\n\tlet ansClicked = buttonInformation.target.textContent;\n\tinsertDisplay(ansClicked);\n\t\n}", "function changeBtnTxt(id, txt){\n\n var btn = document.getElementById(id);\n\n btn.textContent = txt;\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 ontext (text) {\n return text;\n}", "function handleClick(state) {\n text_entry.show();\n}", "function activar() {\n console.log(this.text2);\n}", "function onButtonClick($button, $textarea) {\n const buttonName = $button.dataset.tool;\n\n $textarea.focus();\n\n // if Undo or Redo\n if (buttonName === 'undo' || buttonName === 'redo') {\n document.execCommand(buttonName);\n return;\n }\n\n const button = buttonsData(buttonName);\n const range = { start: $textarea.selectionStart, end: $textarea.selectionEnd };\n const selectedText = $textarea.value.substring(range.start, range.end);\n const placeholder = button.placeholder.trim();\n\n // do nothing if the selection text matches the placeholder text\n if (selectedText === placeholder) {\n return;\n }\n\n // Add URL if link or image button\n if (buttonName === 'link' || buttonName === 'image') {\n const url = prompt((buttonName !== 'image') ? 'Enter the URL' : 'Enter image URL', 'https://');\n\n // abort inserting link if prompt is empty\n if (!url) { return; }\n\n button.end = button.end.replace('URL', url);\n }\n\n // if current cursor has no selection\n if (range.start === range.end) {\n let insertedText = button.start + button.placeholder + button.end;\n\n // if block syntax AND if source line is not empty, prepend 2 ENTER\n if (button.isBlock && $textarea.value.substring(0, range.start).split('\\n').pop() !== '') {\n insertedText = `\\n\\n' ${insertedText}`;\n range.end += 2; // fix the selection\n }\n\n // if block syntax and destination line is not empty, append 1 ENTER\n if (button.isBlock && $textarea.value.substring(range.end).split('\\n')[0] !== '') {\n insertedText += '\\n';\n\n if (isFirefox()) {\n insertedText += '\\n';\n }\n }\n\n // if inline syntax and previous char is not space, prepend a SPACE\n const isLastCharSpace = range.start === 0 || $textarea.value.charAt(range.start - 1) === ' ';\n if (!button.isBlock && !isLastCharSpace) {\n insertedText = ` ${insertedText}`;\n range.end += 1;\n }\n\n appendText($textarea, insertedText, range);\n\n const startPos = range.end + button.start.length;\n const endPos = range.end + button.start.length + placeholder.length;\n setCaretToPos($textarea, startPos, endPos);\n } else {\n // if current cursor has selection\n appendText($textarea, button.start + selectedText + button.end, range);\n }\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "function addText(text = \"Tap and Edit\", pos_top = 0, pos_left = 0) {\r\n canvas.add(new fabric.IText(text, {\r\n left: pos_left,\r\n id: canvas.getObjects().length + 1,\r\n top: pos_top,\r\n fontSize: 150,\r\n fontFamily: 'Helvetica',\r\n fontWeight: 'normal'\r\n }));\r\n}", "function compVSHuman(){\n currentPlayer = O_TEXT;\n setText('turn' , \"Your's turn\");\n boxes.forEach((box,index) =>{\n box.addEventListener('click', boxClickedForComp); \n});\n\n}", "function clickEventHandler(){\n console.log(\"clicked\");\n// outputDiv.innerText = textInput.value+\" clicked translate\";\n// \n//declare a var or const to hold the text input value\nconst inputText = textInput.value;\ndoFetch(inputText); //fetching and display done\n\n}", "function onClickHandler(info, tab) {\n\tvar text = info.selectionText;\n\tvar msg = new SpeechSynthesisUtterance(text);\n\twindow.speechSynthesis.speak(msg);\n}", "function clicked() {\r\n var val = this.textContent;\r\n if(val === \"O\"){\r\n this.textContent = \"\";\r\n }else if (val === \"\") {\r\n this.textContent = \"X\";\r\n }else if (val === \"X\") {\r\n this.textContent = \"O\";\r\n }\r\n}", "function addText(){\n\t\t\tvar newTextadd = new fabric.Text('Текст можно редактировать двойным кликом', { fontFamily: 'Ubuntu', left: 100, top: 150, fontSize: 24, fontStyle: \"normal\", fontWeight: \"normal\", lineHeight: \"1\"});\t\n\t\t\tcanvas.add(newTextadd).setActiveObject(newTextadd);\n\t\t\tselectObjParam();\n\t\t\tcanvas.renderAll();\n\t\t}", "function change_text(id) {\n id.innerHTML = 'You Clicked me';\n}", "function updateText(elementID, text){\n \n}", "function drawText()\n\t{\n\t\t// Figure out the correct text\n\t\tvar text = getText();\n\n\t\twid = that.add('text', {\n\t\t\ttext: text,\n\t\t\tcolor: style.color,\n\t\t\tfont: style.font,\n\t\t\tcursor: 'pointer'\n\t\t});\n\n\t\t// Set the width of the widget\n\t\tthat.w = wid.width();\n\n\t\t// Assign a toggler\n\t\twid.applyAction('click', {\n\t\t\tclick: toggleMode\n\t\t});\n\t}", "createButton(x, y, text, callback){\n const button = this.add.text(x, y, text, { fill: '#0f0' });\n button.setOrigin(0.5, 0.5);\n button.setInteractive()\n .on('pointerup', () => callback())\n .on('pointerover', () => this.enterButtonHoverState(button) )\n .on('pointerout', () => this.enterButtonRestState(button) );\n return button;\n }", "function upButtons(text){\n for (i = 0; i < 3; i++){\n document.getElementById(\"sel_\"+i).textContent = text;\n }\n }", "function markButton(event){\n// $(\"#qwerty button\").on(\"click\", (event) => {\nevent.target.disabled = true;\nevent.target.classList.add (\"chosen\")\n// if (event.target.tagName === \"BUTTON\")\napp.handleInteraction(event.target.innerHTML.toLowerCase());\n}", "function buttonPressed(text) {\n console.log(text);\n setResultText(resultText + text);\n if (text === '=') {\n setResultText('');\n calculationText();\n }\n }", "function getButtonText() {\n return 'Click on me!';\n}", "function processClickFunction(){\n alert(\"Thomas Fracassi: \" + inputvar.value);\n document.getElementById(\"textoutput\").innerHTML = inputvar.value;\n }", "function SetButtonText(button, text) {\n button.childNodes[0].nodeValue = text;\n}", "function button(text, onclick) {\n return m('button', { onclick: onclick }, text);\n}", "function setSubmitButtonText(text) {\n document.querySelector(\".submit\").textContent = text;\n}", "function Yes(){\r\n\r\n\ttitle.html( \"What kinds of books do you usually read?\");\r\n\tfirstOption.html(\"fictions and literatures\");\r\n\tsecondOption.html( \"professional book and reference books\");\r\n\r\n\tfirstOption.mousePressed(Money);\r\n\tsecondOption.mousePressed(No);\r\n\r\n}", "'click .js-title-edit-button'( e, t ) {\n e.preventDefault();\n TTL.titleEditText( e, t, P );\n//---------------------------------------------------------\n }", "function handleText(lineIdx, elButton) {\n console.log('switch case elbutton', elButton.id, elButton);\n switch (elButton.id) {\n case 'text-size-increase':\n console.log('text-size-increase');\n gState.txts[lineIdx].fontSize++;\n break;\n case 'text-size-decrease':\n console.log('text-size-decrease');\n gState.txts[lineIdx].fontSize--;\n break;\n case 'align-right':\n console.log('align-right');\n gState.txts[lineIdx].textAlign = 'right';\n gState.txts[lineIdx].textX = gState.canvas.width - 10;\n break;\n case 'align-center':\n console.log('align-center');\n gState.txts[lineIdx].textAlign = 'center';\n gState.txts[lineIdx].textX = gState.canvas.width / 2;\n break;\n case 'align-left':\n console.log('align-left');\n gState.txts[lineIdx].textAlign = 'left';\n gState.txts[lineIdx].textX = 10;\n break;\n case 'text-up':\n console.log('text-up');\n gState.txts[lineIdx].textY--;;\n break;\n case 'text-down':\n console.log('text-down');\n gState.txts[lineIdx].textY++;;\n break;\n\n }\n renderCanvas();\n\n}", "function myText(text){\r\n document.getElementById(\"ex10-3\").innerHTML = text;\r\n}", "function boxClick() {\n let parentUl = $(this.parentElement);\n let textArea = $('.text-area', parentUl);\n let comment = $('.comment', parentUl);\n $(this).hide();\n $(textArea).show();\n $(comment).show();\n $(textArea).focus();\n let text = $('p', this)[0].innerHTML;\n textArea.val(text);\n $(textArea).focus();\n\n initialContent = textArea.val();\n initialComment = comment.val();\n }", "setText(val) {\n\n }", "function buttonText() {\n textAlign(CENTER);\n fill(200, 241, 247);\n textSize(110);\n textStyle(BOLD);\n textFont(\"Cambria\");\n text(\"Start\", width / 2, height / 2 + 175);\n\n textAlign(CENTER);\n fill(150, 241, 247);\n textSize(150);\n textStyle(BOLD);\n textFont(\"Cambria\");\n text(\"ALPHA PAINT\", width / 2, height / 2 - 100);\n}", "function Click() {\n SecondParagraph.textContent = P2Content;\n ClickButton = document.getElementById(\"ClickButton\").style.visibility = \"hidden\";\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}", "function buttonText(){\n return document.getElementById(\"go-button\").innerText;\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 changeButtonText() {\n if ($(\"#myDiv\").hasClass(\"showText\")) {\n $(\"#btnShowText\").text(\"Hide Text\");\n } \n else {\n $(\"#btnShowText\").text(\"Show Text\");\n }\n }", "function onTextChange() {\n displayText = textEl.value;\n}", "handleTextClick(event, chatBubble) {\n if (this.onClick) this.onClick(event, 'text', chatBubble)\n }", "function Button103(){\n $('li').text('True Fact' );\n}", "function sayThings() {\n console.log(\"this button is clicked!\")\n}", "async clickOnButton(string) {\n if (string == \"Work out how much I could borrow\") xpath = '[id=\"btnBorrowCalculater\"]';\n else if (string == \"Start over\") xpath = '[aria-label=\"Start over\"]';\n // click\n await this.page.click(xpath);\n }", "function TXbtnClicked() {\n if (display.innerHTML.split(\" \")[0] == selectedWordData.frequency) {\n moduleDone()\n } else {\n wrongClick()\n }\n }", "function Button301(){\n $('h1').text('jQuery Ninja' );\n}", "function Button() {\n this.Bounds; // in Screen coordinates\n this.Text;\n this.Click;\n}", "function selectAnswer() {\n\n}", "function myClickFunction() {\n\t$(\"#greeting\").css(\"background-color\", \"blue\");\n\t$(\"#greeting\").css(\"color\", \"black\");\n\tupdateText($(this).attr(\"id\"));\n}", "function onCreateText() {\n let elText = document.querySelector('.currText').value\n if (elText === '') return;\n createText()\n resetValues()\n draw()\n}", "function textCheck(){\n var selectedText = document.getElementsByClassName('tickbox');\n for (let i = 0; i < selectedText.length; i++) {\n selectedText[i].addEventListener('click', styleText);\n }\n}", "function changeText() {\n $(\".chosen-services h3\").html(\"No service is selected yet!\");\n $(\".chosen-services p\").html(\"Discover our packages and select services that interest you.\");\n}", "function okClick(){\n const okButton = document.getElementById('okButton');\n okButton.remove();\n textBox.textContent = roomText;\n}", "function showText(txt) {\n labelText = txt;\n}", "function btnAddTextClick() {\n myPresentation.getCurrentSlide().addText(inTxt.value);\n inTxt.value = \"\";\n}", "onCreateText(e) {\n e.preventDefault()\n\n let newSel;\n this.transaction(function(tx) {\n let container = tx.get(this.props.containerId)\n let textType = tx.getSchema().getDefaultTextType()\n let node = tx.create({\n id: uuid(textType),\n type: textType,\n content: ''\n })\n container.show(node.id)\n\n newSel = tx.createSelection({\n type: 'property',\n path: [ node.id, 'content'],\n startOffset: 0,\n endOffset: 0\n })\n }.bind(this))\n this.rerender()\n this.setSelection(newSel)\n }", "function BtnMessage(b) { //b pneumonic for \"button name\"\r\n if (b==\"change\") {\r\n alert(\"chay chay chay-eenj\");\r\n }\r\n if (b==\"snark\") {\r\n alert(\"snark of fools\");\r\n }\r\n}", "function onTextDown(txt) {\n textDown(txt)\n draw()\n}", "function clickedRandomText() {\n originText.innerHTML = texts[Math.floor(Math.random() * texts.length)];\n // It will also call the reset function to reset evrything\n reset();\n}", "displayDialogText() {\n //If the box is not on its landing position, don't show the text\n if (this.dialogBox.textBox.position.y <= this.dialogBox.textBox.landingPosition.y) {\n this.dialogBox.textBox.fullTextDisplayed = true //Defines to true so buttons can appear (made that way to add a typewriter effect in the future)\n //display text\n push();\n textAlign(LEFT);\n textFont(this.dialogBox.textBox.font);\n textSize(this.dialogBox.textBox.textSize)\n fill(this.dialogBox.textBox.textFill.r, this.dialogBox.textBox.textFill.g, this.dialogBox.textBox.textFill.b);\n text(this.dialogBox.textBox.string, this.dialogBox.textBox.textPosition.x, this.dialogBox.textBox.textPosition.y, this.dialogBox.textBox.textPosition.x2, this.dialogBox.textBox.textPosition.y2);\n pop();\n }\n }", "function handleClickButton(button){\n var ele = $(button);\n // Replace text\n front_word.val(ele.attr(\"data-front\"));\n back_word.val(ele.attr(\"data-back\"));\n \n // Play audio\n audio_element.attr(\"src\", ele.attr(\"data-audio\"));\n audio_element[0].play();\n}", "function updateButton(onclickFxn, text, opt_class) {\n // Clear button content.\n var buttonDiv = d3.select('.button-div');\n buttonDiv.html('');\n\n buttonDiv\n .append('button')\n .attr('id', 'transition-button')\n .text(text)\n .attr('class', opt_class)\n .on('click', onclickFxn);\n\n if (text == 'See Benefits') {\n buttonDiv.append('div').attr('id', 'bills-apply');\n }\n}", "function setText(text) {\n document.getElementById(\"result\").innerHTML = text;\n}" ]
[ "0.7166872", "0.7116108", "0.6713565", "0.66875803", "0.664191", "0.66394156", "0.6627204", "0.66228324", "0.64708835", "0.64210504", "0.64128876", "0.640329", "0.6396147", "0.6381871", "0.6375091", "0.636068", "0.6357999", "0.6354909", "0.63320595", "0.6331252", "0.6324269", "0.6321308", "0.6311554", "0.62836665", "0.6264313", "0.6250443", "0.62477386", "0.6233712", "0.621557", "0.62082237", "0.6197454", "0.61939776", "0.61896783", "0.6185999", "0.61771446", "0.61634195", "0.6161721", "0.615049", "0.6147681", "0.61116815", "0.60921866", "0.6086214", "0.60764724", "0.6065263", "0.60632044", "0.60500294", "0.60490423", "0.60490423", "0.60390943", "0.6038281", "0.6035582", "0.6034548", "0.60257447", "0.60210866", "0.60116994", "0.60084444", "0.60070246", "0.60063416", "0.59901446", "0.5985148", "0.59842986", "0.5981945", "0.5970964", "0.59608173", "0.5956547", "0.59506744", "0.5944342", "0.594282", "0.5938604", "0.59276545", "0.5926435", "0.59204847", "0.59201866", "0.59154207", "0.5914482", "0.5905198", "0.5900533", "0.5900276", "0.58910066", "0.58859724", "0.58832747", "0.5881027", "0.58804697", "0.5875176", "0.5873557", "0.5870466", "0.5866654", "0.58625555", "0.5861124", "0.58575106", "0.5851209", "0.5846585", "0.58449554", "0.5835131", "0.5829989", "0.5825628", "0.58192724", "0.5819059", "0.58142304", "0.581329", "0.58130497" ]
0.0
-1
Returns all requests that needed to happen for all changes
async stopRecordingRequests() { if (!this.isRecordingRequests) { throw new Error('You need to start recording before stopping'); } const batch = { intent: this.intent, requests: this.currentRequestsRecorded, validationErrors: lodash_1.compact(this.currentValidationErrorsRecorded), runtimeErrors: this.currentRuntimeErrorsRecorded }; this.requestBatches.push(batch); this.isRecordingRequests = false; this.currentRequestsRecorded = []; this.currentValidationErrorsRecorded = []; this.intent = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findRequestAll(qParams) {\n return this.request.get('requests', qParams);\n }", "getChanges() {\n return this.getStore().then(s => s.filter(undefined, 'id', {\n offset: 0,\n limit: 500\n })).then(changes => {\n changes.forEach(change => {\n change.params = JSON.parse(change.params);\n });\n return changes;\n });\n }", "async function getRequests () {\n const requests = await cache.get('requests')\n return requests\n}", "async getRequests() {\n let user = await this.getUserByCert(true);\n\n return user.requests;\n }", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n delete this.requestMap[request.handle.id];\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n this.requestMap.delete(request.handle);\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "function updateRequests(){\n Loading.showText('Cargando solicitudes.');\n result = RequestService.get({param: AuthService.getId()}, function(){\n Request.uploadRequests(result.request);\n $scope.requests = Request.updateRequests();\n Loading.hide();\n }, function(){\n Loading.hide();\n Loading.hideTimeout();\n });\n }", "function getActions() {\n\t var newFilters = [];\n\t var oldFilters = [];\n\n\t stateWatchers.forEach(function (watcher, i) {\n\t var nextVal = next[i];\n\t var prevVal = prev[i];\n\t newFilters = newFilters.concat(nextVal);\n\t oldFilters = oldFilters.concat(prevVal);\n\n\t // no update or fetch if there was no change\n\t if (nextVal === prevVal) return;\n\n\t if (nextVal) doUpdate = true;\n\n\t // don't trigger fetch when only disabled filters\n\t if (!onlyDisabled(nextVal, prevVal)) doFetch = true;\n\t });\n\n\t // make sure change wasn't only a state move\n\t // checking length first is an optimization\n\t if (doFetch && newFilters.length === oldFilters.length) {\n\t if (onlyStateChanged(newFilters, oldFilters)) doFetch = false;\n\t }\n\t }", "getSubRequests() {\n return this.batchRequest.getSubRequests();\n }", "getSubRequests() {\n return this.batchRequest.getSubRequests();\n }", "_updateAllRequests() {\n const requestQueue = this.requestQueue;\n for (let i = 0; i < requestQueue.length; ++i) {\n const request = requestQueue[i];\n if (!this._updateRequest(request)) {\n // Remove the element and make sure to adjust the counter to account for shortened array\n requestQueue.splice(i, 1);\n i--;\n }\n }\n\n // Sort the remaining requests based on priority\n requestQueue.sort((a, b) => a.priority - b.priority);\n }", "async added() {\n const requests = objectPath.get(this.data, ['object', 'spec', 'requests'], []);\n const newRequests = [];\n for (let i = 0; i < requests.length; i++) {\n const req = requests[i];\n let reqOpt = clone(req.options);\n const optional = req.optional || false;\n const gitinfo = objectPath.get(req, 'options.git');\n\n if (gitinfo) {\n try {\n reqOpt = await this._fetchHeaderSecrets(reqOpt);\n } catch (e) {\n if (optional && e.code == 404) {\n this.log.warn(e.message);\n this.updateRazeeLogs('warn', { controller: 'RemoteResource', warn: e.message, repo: gitinfo.repo });\n this.log.debug(`skipping download for ${gitinfo.repo}`);\n continue;\n } else {\n return Promise.reject(e.message);\n }\n }\n\n const Git = require(`./git/${gitinfo.provider}`);\n const git = new Git(reqOpt);\n reqOpt = git.getAuthHeaders(reqOpt);\n try {\n let files = await RequestLib.doRequest({ method: 'get', uri: git.getReqUrl(), headers: reqOpt.headers }, this.log);\n files = JSON.parse(files);\n files = git.getFileArray(files);\n for (let j = 0; j < files.length; j++) {\n const url = git.getFileUrl(files[j]);\n if (url) {\n reqOpt = { ...reqOpt, url: url };\n reqOpt = git.getAddlHeaders(reqOpt);\n const newReq = clone(req);\n newReq.options = reqOpt;\n newReq.splitRequestId = hash(req); // By setting splitRequestId, all requests split from a single original request will all be attempted before allowing failures to abort\n newRequests.push(newReq);\n }\n }\n } catch (e) {\n if (optional) {\n this.log.warn(e.message);\n this.updateRazeeLogs('warn', { controller: 'RemoteResource', warn: e.message, repo: gitinfo.repo });\n this.log.debug(`skipping download for ${gitinfo.repo}`);\n continue;\n } else {\n let errMessage = `Error retrieving ${git.getReqUrl()}, ${e.statusCode} -- ${e.message}`;\n\n // Get details from the response if possible\n if( e.content ) {\n try {\n const contentObj = JSON.parse( e.content );\n for( const prop of Object.getOwnPropertyNames( contentObj ) ) {\n errMessage += `, ${prop}: ${contentObj[prop]}`;\n }\n }\n catch(e) {\n errMessage += `, ${e.content}`;\n }\n }\n\n return Promise.reject(errMessage);\n }\n }\n } else {\n newRequests.push(req);\n }\n }\n\n if (newRequests.length > 0) {\n objectPath.set(this.data, ['object', 'spec', 'requests'], newRequests);\n let result = await super.added();\n return result;\n } else {\n this.log.debug('No files found.');\n }\n }", "function findRequests(req, res) {\n\tRequest.findRequests(req.body, function (err, results) {\n if (err) {\n res.send500('There was an error while searching for your request.');\n } else {\n res.send(results.slice(0,999).map(cleanUpGetResponse));\n }\n });\n}", "function getCommits(){\n\tvar commits = new Array();\n\tvar commitsForRequest = 30;\n\tcommits = requestCommits();\n\tif(commits.length == 0 || commits.length < commitsForRequest){\n\t\treturn commits;\n\t} \n\tvar MAX_ITERATION_NUMBER = 5;\n\twhile(MAX_ITERATION_NUMBER > 0){\n\t\tvar lastCommitSha = commits[commits.length-1].sha;\n\t\tvar commitsSet = requestCommits(lastCommitSha);\n\t\tvar returnedCommits = commitsSet.length;\n\t\tcommitsSet = commitsSet.slice(1,commitsSet.length);\n\t\tcommits = commits.concat(commitsSet);\n\t\tif(returnedCommits < commitsForRequest){\n\t\t\tbreak;\n\t\t}\n\t\tMAX_ITERATION_NUMBER--;\n\t}\n\treturn commits;\n}", "function getAllPendingRequests(){\r\n\t\tFriendService.getAllPendingRequests().then(\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\t$scope.pendingRequests=response.data\r\n\t\t\t\t},\r\n\t\t\t\tfunction(response){\r\n\t\t\t\t\tif(response.status==401)\r\n\t\t\t\t\t\t$location.path('/login')\r\n\t\t\t\t})\r\n\t}", "function loadPendingChanges() {\n var defer = $q.defer();\n rulesRequestService.getPendingChanges($rootScope.currentApplication)\n .then(function (result) {\n defer.resolve({pendingChanges: result});\n }, function (reason) {\n defer.reject();\n $log.error('Failed to load pending changes for rules: ' + reason.message);\n });\n return defer.promise;\n }", "getRecentRequest() {\n return [... new Set (this.recent_requests)].reverse();\n }", "async request() {\n if (this.isTest()) { console.log(\"in getAllCalls\"); }\n // GET first page (and number of pages)\n await this.getCallsPage();\n \n if (this.isTest()) { console.log(`getLastPage = ` + this.getLastPage()); }\n // GET the remaining pages\n for (let pageNum = 2; pageNum <= this.getLastPage(); pageNum++) {\n await Util.throttle(this.#config.throttle);\n await this.getCallsPage(pageNum);\n }\n }", "function SwitchRequestHistory() {\n var switchRequests = []; // running total\n var srHistory = []; // history of each switch\n\n function push(switchRequest) {\n if (!switchRequests[switchRequest.oldValue]) {\n switchRequests[switchRequest.oldValue] = { noDrops: 0, drops: 0, dropSize: 0 };\n }\n\n // Set switch details\n var indexDiff = switchRequest.newValue - switchRequest.oldValue;\n var drop = indexDiff < 0 ? 1 : 0;\n var dropSize = drop ? -indexDiff : 0;\n var noDrop = drop ? 0 : 1;\n\n // Update running totals\n switchRequests[switchRequest.oldValue].drops += drop;\n switchRequests[switchRequest.oldValue].dropSize += dropSize;\n switchRequests[switchRequest.oldValue].noDrops += noDrop;\n\n // Save to history\n srHistory.push({ idx: switchRequest.oldValue, noDrop: noDrop, drop: drop, dropSize: dropSize });\n\n // Shift earliest switch off srHistory and readjust to keep depth of running totals constant\n if (srHistory.length > SWITCH_REQUEST_HISTORY_DEPTH) {\n var srHistoryFirst = srHistory.shift();\n switchRequests[srHistoryFirst.idx].drops -= srHistoryFirst.drop;\n switchRequests[srHistoryFirst.idx].dropSize -= srHistoryFirst.dropSize;\n switchRequests[srHistoryFirst.idx].noDrops -= srHistoryFirst.noDrop;\n }\n }\n\n function getSwitchRequests() {\n return switchRequests;\n }\n\n function reset() {\n switchRequests = [];\n srHistory = [];\n }\n\n return {\n push: push,\n getSwitchRequests: getSwitchRequests,\n reset: reset\n };\n}", "getFiles() {\n if (this._files) {\n return this._files;\n }\n this._files = glob.sync(`${this._changesPath}/**/*.json`);\n return this._files || [];\n }", "function getRequests() {\n $.get(\"/api/requests/\", function(data) {\n console.log(\"Requests\", data);\n\n requests = data; \n\n if (!requests || !requests.length) {\n displayEmpty();\n }\n else {\n initializeRows();\n }\n });\n }", "function getRequests (req, res) {\r\n\tconsole.log ('GET /requests');\r\n\tRequest.find(null, 'name _id', function(err, requests) {\r\n\t\tif(err) {\r\n\t\t\tres.status(500).send({ message : 'Error while retrieving the requests list'});\r\n\t } else { \r\n\t \tif(!requests) { \r\n\t \t\tres.status(404).send({ message : 'Error there are no requests stored in the DB'});\r\n\t \t} else {\r\n\t\t\t\tres.status(200).jsonp(requests);\r\n\t \t}\r\n\t }\t\r\n\t});\r\n}", "async function getAllReimbursementRequests() {\n try {\n const result = await API.graphql( {\n query: listReimbursements,\n } );\n\n if ( result.data.listReimbursements.items ) {\n const reimbursements = result.data.listReimbursements.items\n\n // generate signed urls for images \n const reqsWithSignedUrls = await Promise.all( reimbursements.map( async el => {\n const signedUrl = await Storage.get( el.imageUrl )\n return { ...el, imageUrl: signedUrl }\n } ) )\n setRequests( reqsWithSignedUrls );\n }\n } catch ( err ) {\n console.log( err );\n }\n }", "async queryAllRequests(ctx) {\n const startKey = '';\n const endKey = '';\n const allResults = [];\n for await (const {key, value} of ctx.stub.getStateByRange(startKey, endKey)) {\n const strValue = Buffer.from(value).toString('utf8');\n let record;\n try {\n record = JSON.parse(strValue);\n } catch (err) {\n console.log(err);\n record = strValue;\n }\n allResults.push({ Key: key, Record: record });\n }\n console.info(allResults);\n return JSON.stringify(allResults);\n }", "function getAll() {\n return $http.get(baseEndpoint);\n }", "processRequests() {\n debug('Processing requests ...');\n\n let buffer = [];\n const { item } = this.data;\n\n if (!item || !item.length) {\n throw new Error('JSON is missing requests (\"item\" field)');\n }\n\n for (const request of item) {\n const array = this.processRequest(request);\n buffer = buffer.concat(array);\n }\n\n return buffer;\n }", "async rebuildAll() {\n return await rebuildAllAction({\n client: this.client,\n dataDir: this.dataDir,\n log: this.log\n });\n }", "function requestsList() {\n\t\t$\n\t\t\t\t.ajax({\n\t\t\t\t\turl : \"allrequests.view\",\n\t\t\t\t\ttype : \"GET\",\n\t\t\t\t\tcahce : false,\n\t\t\t\t\tdataType : \"JSON\",\n\t\t\t\t\tbeforeSend : function() {\n\t\t\t\t\t},\n\t\t\t\t\tsuccess : function(requestData) {\n\t\t\t\t\t\tif (requestData != '') {\n\t\t\t\t\t\t\t$(\"div#requests-container div#table-container\")\n\t\t\t\t\t\t\t\t\t.html(\n\t\t\t\t\t\t\t\t\t\t\t\"<table id='requests-table'>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<thead><tr><th>Request ID</th><th>MID</th><th>From Date</th><th>From Time</th>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<th>To Date</th><th>To Time</th><th>Comment</th><th>Action</th></tr></thead><tbody>\")\n\t\t\t\t\t\t\t$\n\t\t\t\t\t\t\t\t\t.each(\n\t\t\t\t\t\t\t\t\t\t\trequestData,\n\t\t\t\t\t\t\t\t\t\t\tfunction(i, data) {\n\t\t\t\t\t\t\t\t\t\t\t\t$(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"div#requests-container div#table-container table#requests-table\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t.append(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"<tr><td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ (i + 1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[8]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[5]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[6]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[1]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<img src = 'images/accept.png' id = '\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[0]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"' class = 'accept'>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"<img src = 'images/rejected.png' id = '\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ data[0]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"' class = 'reject'>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</tr>\")\n\t\t\t\t\t\t\t\t\t\t\t})\n\t\t\t\t\t\t\t$(\"div#requests-container div#table-container\")\n\t\t\t\t\t\t\t\t\t.append(\"</tbody></table>\")\n\t\t\t\t\t\t\t$(\"div#requests-container div#buttons\")\n\t\t\t\t\t\t\t\t\t.html(\n\t\t\t\t\t\t\t\t\t\t\t\"<form action='adminAcceptAll.view' method='GET'><input type='submit' id='accept-all' value = 'Accept All'></form><form action='adminRejectAll.view' method='GET'><input type='submit' id='reject-all' value = 'Reject All'></form>\")\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$(\"div#requests-container\")\n\t\t\t\t\t\t\t\t\t.html(\n\t\t\t\t\t\t\t\t\t\t\t\"<h2 id = 'history-message'>No requests waiting for your approval</h2>\")\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\terror : function(data) {\n\t\t\t\t\t\t$(\"div#requests-container\")\n\t\t\t\t\t\t\t\t.html(\n\t\t\t\t\t\t\t\t\t\t\"<h2 id = 'history-message' style = 'color:#e60000; '>Sorry. We were unable to process your request. Try againHELLo.</h2>\")\n\t\t\t\t\t}\n\t\t\t\t})\n\t}", "getChanges(query) {\r\n const postBody = jsS({ \"query\": extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\r\n return this.clone(Site_1, \"getchanges\").postCore({ body: postBody });\r\n }", "function getChanges(XMLData) {\r\n return getChangesOnly(XMLData);\r\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}", "function listChanges(auth) {\n console.log(\"checking for changes for changeID: \" + changeId);\n\n //for keeping track of last revision time\n var lastRevisionTime = 0;\n\n var service = google.drive('v2');\n service.changes.list({\n auth: auth,\n startChangeId: changeId\n }, function(err, response) {\n if (err) {\n console.log('The API returned an error: ' + err);\n numChanges = 0;\n return;\n }\n\n var changes = response.items;\n\n //if there are no changes, don't update change ID\n if (changes.length == 0) {\n console.log('No changes.');\n numChanges = 0;\n\n //if there aren't any immediate changes, check the docs that have already been edited\n for (var i = 0; i < fileIds.length; i++) {\n console.log(\"checking file: \" + fileIds[i]);\n //this uses a different API call\n getLastRevision(auth, fileIds[i]);\n }\n } \n\n //otherwise, get the changes\n else {\n //console.log('Recent changes:');\n\n for (var i = 0; i < changes.length; i++) {\n var change = changes[i];\n if (change.kind == \"drive#change\") {\n /*console.log(\"kind: \" + change.file.kind);\n console.log(\"title: \" + change.file.title);\n console.log(\"modifiedDate: \" + change.file.modifiedDate);\n console.log(\"lastModifyingUserName: \" + change.file.lastModifyingUserName);\n console.log(\"lastModifiedByMeDate:\" + change.file.modifiedByMeDate);\n console.log(\"lastViewedByMe:\" + change.file.lastViewedByMeDate);\n console.log(\"version: \" + change.file.version);*/\n\n //get the last time the document was viewed by the user\n var lastViewTime = Date.parse(change.file.lastViewedByMeDate);\n //get the last time the document was modified (either by user or someone else)\n var lastModifyTime = Date.parse(change.file.modifiedDate);\n\n //if the last view time was the same time or after the last modification, then reset number of unviewed changes\n if (lastViewTime - lastModifyTime >= 0) {\n totalUnviewedChanges = 0;\n }\n //otherwise, update number of unviewed changes\n else {\n totalUnviewedChanges++;\n }\n\n //get file id\n var fileId = change.file.id;\n //if a unique ID, add to file list\n if (fileIds.indexOf(fileId) == -1) {\n fileIds.push(fileId);\n }\n }\n }\n\n //update time difference between last modification time and current time\n if (Date.parse(changes[changes.length-1].file.modifiedDate) > lastChangeTime) {\n lastChangeTime = Date.parse(changes[changes.length-1].file.modifiedDate);\n editDelta = Date.now() - lastChangeTime;\n\n //send data\n if (useSerial) {\n sendSerialData();\n }\n else {\n sendCloudData(editDelta, activityFunction);\n sendCloudData(totalUnviewedChanges, changesFunction);\n }\n }\n\n //now update change ID for next call\n changeId = parseInt(response.largestChangeId) + 1;\n }\n });\n}", "function listAllRequests (){\n myContract.methods.getRequestPoolSize().call().then(function(actCount){\n console.log(\"-----------------------------------------------------\");\n console.log(\"Total active Request = \", actCount);\n })\n .then(function(){\t \n myContract.methods.getRequestPool().call().then(function(pool){ \n console.log(\"Active Request pool: \");\n console.log(pool);\n }).then(function(){ \n myContract.methods.getRequestCount().call().then(function(totalCount){\n console.log(\"-----------------------------------------------------\");\n console.log(\"Total Request since start = \", totalCount);\n return totalCount;\n }).then(function(totalCount){\t\n myContract.methods.listRequests().call().then(function(proList){ \n if(totalCount > 0) console.log(\"List all the Requests: \")\n for (var i = 0;i < totalCount ;i++){\n if(argv['debug']){ //in a detail pattern\n console.log(proList[i]);\n } else{ //or simple print: 3 key values \n if(proList[i]['addr'] != 0){\n console.log(\"provD = \", proList[i]['provID']);\n console.log(\"addr = \", proList[i]['addr']);\n console.log(\"available = \", proList[i]['available']);\n }\n }\n }\t\t\n })\n .catch(function(){ //catch any error at end of .then() chain!\n console.log(\"List All Request Info Failed! \")\n process.exit();\n }) \n })\n })\n })\n}", "getRequests() {\n return this.query(`SELECT * FROM request`);\n }", "getLinksToUpdateInfo() {\n\t\tconst newLinks = [];\n\t\tconst oldLinks = [];\n\t\tconst allCurrentLinks = this.apiPipeline.getLinks();\n\n\t\tallCurrentLinks.forEach((link) => {\n\t\t\tif (!this.isLinkToBeDeleted(link, this.linksToDelete)) {\n\t\t\t\tconst src = this.isSourceToBeDeleted(link);\n\t\t\t\tconst trg = this.isTargetToBeDeleted(link);\n\n\t\t\t\tif (src || trg) {\n\t\t\t\t\tconst newLink = Object.assign({}, link);\n\t\t\t\t\tif (src) {\n\t\t\t\t\t\tdelete newLink.srcNodeId;\n\t\t\t\t\t\tdelete newLink.srcNodePortId;\n\t\t\t\t\t\tnewLink.srcPos = CanvasUtils.getSrcPos(link, this.apiPipeline);\n\t\t\t\t\t}\n\t\t\t\t\tif (trg) {\n\t\t\t\t\t\tdelete newLink.trgNodeId;\n\t\t\t\t\t\tdelete newLink.trgNodePortId;\n\t\t\t\t\t\tnewLink.trgPos = CanvasUtils.getTrgPos(link, this.apiPipeline);\n\t\t\t\t\t}\n\t\t\t\t\tnewLinks.push(newLink);\n\t\t\t\t\toldLinks.push(link);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\treturn { newLinks, oldLinks };\n\t}", "function getRequests() {\n ref\n .where(\"driver\", \"==\", \"\")\n .where(\"completed\", \"==\", false)\n .onSnapshot((querySnapshot) => {\n const items = [];\n querySnapshot.forEach((doc) => {\n items.push({ ...doc.data(), id: doc.id });\n });\n setRequestsData(items); // calls useState to update the requests\n });\n }", "static calculateConcurrency() {\n return [...CoapClient.pendingRequestsByMsgID.values()] // find all requests\n .map(req => req.concurrency) // extract their concurrency\n .reduce((sum, item) => sum + item, 0) // and sum it up\n ;\n }", "function getRequestsList() {\n\t$.ajax({\n\t\ttype : \"GET\",\n\t\turl : 'getRequestsList',\n\t\tsuccess : function(response) {\n\t\t\t$(\"#requests-list-view\").html(response);\n\t\t}\n\t});\n}", "function refreshAll() {\n browserProxy.getStoredPages().then(fillStoredPages);\n browserProxy.getRequestQueue().then(fillRequestQueue);\n browserProxy.getNetworkStatus().then(function(networkStatus) {\n $('current-status').textContent = networkStatus;\n });\n browserProxy.getLimitlessPrefetchingEnabled().then(function(enabled) {\n $('limitless-prefetching-checkbox').checked = enabled;\n });\n browserProxy.getPrefetchTestingHeaderValue().then(function(value) {\n switch (value) {\n case 'ForceEnable':\n $('testing-header-enable').checked = true;\n break;\n case 'ForceDisable':\n $('testing-header-disable').checked = true;\n break;\n default:\n $('testing-header-default').checked = true;\n }\n });\n refreshLog();\n}", "function getCalls() {\n return $http.get(baseUrl+\"calls\",{headers:setHeaders()});\n }", "getChanges(query) {\r\n const postBody = jsS({ \"query\": extend({ \"__metadata\": { \"type\": \"SP.ChangeQuery\" } }, query) });\r\n return this.clone(Web_1, \"getchanges\").postCore({ body: postBody });\r\n }", "getAll() {\n return this.getDataFromServer(this.path);\n }", "requested (req) {\n this.lastChildReq = req.url;\n this.usedDates.unshift(Date.now());\n if (this.usedDates.length > 10) this.usedDates.pop();\n }", "async getRequestPoolEntries() {\n let requestEntries = await [];\n if(Object.keys(this.memPoolEntries).length != 0)\n {\n for(let walletAddress in this.memPoolEntries) {\n await this.checkTimeoutRequests();\n await requestEntries.push(this.memPoolEntries[walletAddress]);\n }\n }\n return requestEntries;\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "findAll(qParams) {\n return this.request.get('', qParams);\n }", "function requests(state=[], action){\n if(action.type === \"REQUESTS_LOADED\"){\n return action.value;\n }\n return state;\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 propagate_changes() {\n\tfor (const waiter of to_update.values()) {\n\t\twaiter();\n\t}\n\tto_update = false;\n\tupdate_roots = new Set();\n}", "_changes(opts) {\n return this._slouch.db.changes('_global_changes', opts)\n }", "function issueRequests(telemetryObjects) {\n return $q.all(telemetryObjects.map(issueRequest));\n }", "function batchRequest(){\n // Use the lower value of items left in the link array or maxRequests\n var total = (linkArr.length-1 > maxRequests) ? maxRequests : linkArr.length-1;\n for(var i = 0; i<= total; i++) {\n qwest.get(endPoint+encodeURIComponent(linkArr[0]))\n .then(function(response) {\n apiActions.response({pageURL: response.url, report: response.data});\n })\n .catch(function(e, response) {\n console.log('>> Error: ', e, '\\nResponse: ', response);\n })\n // Remove the head from the array\n linkArr.shift();\n }\n\n // Batch request again if there's anything left in the array\n if(linkArr.length > 0) {\n setTimeout(function() {\n batchRequest();\n }, 30*1000);\n }\n}", "async submitRequests(requests) {\n return Promise.all(\n Promise.all(requests.creation.map(x => {\n return this.requestCreation(requests.workerType, x);\n })),\n Promise.all(requests.deletion.map(x => {\n return this.requestDeletion(requests.workerType, x);\n })),\n );\n }", "static getUncommittedChanges() {\r\n const changes = [];\r\n changes.push(...VersionControl._getUntrackedChanges());\r\n changes.push(...VersionControl._getDiffOnHEAD());\r\n return changes.filter(change => {\r\n return change.trim().length > 0;\r\n });\r\n }", "async determineRequests(workerType) {\n // Here we should create two lists of things:\n // one list of {bid} things which we'll create\n // one list of {managerInfo} of things we'll delete\n return {\n workerType: workerType,\n creation: [], // a list of Bid objects\n deletion: [], // a list of ManagerData objects to delete\n };\n }", "function changes() {\n $('#recents > ul').empty();\n $.ajax({\n dataType: 'json',\n headers: {'Cache-Control': 'max-age=0'},\n url: host + 'search?q=bag:' + encodeURIComponent(space)\n + '_public%20OR%20bag:' + encodeURIComponent(space)\n + '_private',\n success: displayChanges\n });\n checkHash();\n}", "static getUncommittedChanges() {\n const changes = [];\n changes.push(...VersionControl._getUntrackedChanges());\n changes.push(...VersionControl._getDiffOnHEAD());\n return changes.filter(change => {\n return change.trim().length > 0;\n });\n }", "getChanges(query) {\r\n return this.clone(List, \"getchanges\").postCore({\r\n body: jsS({ \"query\": extend(metadata(\"SP.ChangeQuery\"), query) }),\r\n });\r\n }", "function getPageChanges() {\n if (getQueryStringValue(document.location.href, 'mode') == 'view') {\n return false;\n }\n\n if (typeof (HasChanges) != \"undefined\" && HasChanges || typeof (HasRCChanges) != \"undefined\" && HasRCChanges)\n return true;\n else if (typeof (vrGridIds) != \"undefined\") {\n for (var vrGridId in vrGridIds) {\n var _actgridid = vrGridIds[vrGridId].split(\";\")[1];\n\n if (checkGridHasChanges(_actgridid)) {\n return true;\n }\n }\n\n for (var vrGridId in vrGridIds) {\n var _actgridid = vrGridIds[vrGridId].split(\";\")[1];\n var _grid_obj = el(_actgridid);\n\n if (typeof (_grid_obj) != \"undefined\" && _grid_obj != null) {\n _grid_obj.Submit();\n }\n\n if (checkGridHasChanges(_actgridid)) {\n return true;\n }\n }\n\n }\n return false;\n}", "_issueNewRequests() {\n this._updateNeeded = true;\n setTimeout(() => this._issueNewRequestsAsync(), 0);\n }", "function getAll() {\n\t\treturn send({\n\t\t\turl: URL,\n\t\t\ttype: 'GET'\n\t\t})\n\t\t.then(toHTML)\n\t\t.then(getTable)\n\t\t.then(getTableRows)\n\t\t.then(extractAllScriptInformation)\n\t\t.then(reconstruct);\n\t}", "function watchTargets() {\n jQuery(document).ajaxComplete(processResponse);\n }", "function getRecent (startDate, rc) {\n var url = getRecentChanges + startDate;\n if (rc !== undefined) {\n url = getRecentChanges + startDate + rcContinue + rc;\n }\n\n var pageLog = rc || \"\";\n console.log(\"Asking for changes\", startDate, pageLog);\n request(url, function (error, response, recentBody) {\n if (error) {\n console.error(error);\n }\n\n var jsonBody = JSON.parse(recentBody);\n var news = jsonBody.query.recentchanges;\n\n console.log(\"Got \" + news.length + \" changes\")\n for (var i = 0; i < news.length; i++) {\n itemsToUpdate.push(news[i].title);\n }\n if (jsonBody.continue !== undefined) {\n rc = jsonBody.continue.rccontinue;\n console.log(\"Waiting next call...\");\n setTimeout(function(){ getRecent(startDate, rc); }, 3000);\n } else {\n uniqItemsToUpdate = uniqItemsToUpdate.concat(uniq(itemsToUpdate));\n itemsToUpdate = [];\n console.log(\"-------------------------------\");\n console.log(uniqItemsToUpdate.length + \" items to triplify\");\n console.log(\"-------------------------------\");\n if (uniqItemsToUpdate.length > 0 && !loading)\n load();\n\n var now = new Date().toISOString();\n setTimeout(function(){ getRecent(now, rc); }, 10000);\n }\n });\n}", "function startAllAllowedRequests() {\r\n for (let i = 0; i < waiting_tasks.length; i++) {\r\n if (canStartRequest(waiting_tasks[i].hostname)) {\r\n onRequestStart(waiting_tasks[i].hostname);\r\n waiting_tasks[i].start();\r\n\r\n // remove request from waiting requests list and update loop index\r\n waiting_tasks.splice(i, 1);\r\n i--;\r\n }\r\n }\r\n}", "getChanges(fromBranch = this.repo.currentBranch(), excludeBranch) {\n const lastTagInFromBranch = this.repo.latestTag({ branch: fromBranch });\n const commonCommit = this.repo.commonAncestor({ left: fromBranch, right: excludeBranch });\n let changes = this.getCommits(lastTagInFromBranch, fromBranch);\n this.log.info(`Found ${changes.length} commits from \"${fromBranch}\" since tag \"${lastTagInFromBranch}\" to include.`);\n if (excludeBranch) {\n const excludeCommits = this.getCommits(commonCommit, excludeBranch);\n this.log.info(`Found ${excludeCommits.length} commits from \"${excludeBranch}\" to exclude, since \"${fromBranch}\" split at \"${commonCommit}\".`);\n changes = this.excludeCommits(changes, excludeCommits);\n }\n const preRevertFilterCount = changes.length;\n changes = this.filterReverts(changes);\n this.log.info(`Removed ${preRevertFilterCount - changes.length} revert related commits.`);\n const preBlueprintFilterCount = changes.length;\n changes = this.filterCommits(changes);\n this.log.info(`Removed ${preBlueprintFilterCount - changes.length} blueprint filtered commits.`);\n return changes;\n }", "_getRequestCallsArray(league, delay) {\n var promises = [];\n\n for (var i = 0; i < this.apis.length; i++) {\n var api = this.apis[i];\n var method = this._requestApiData(api, league, delay * i);\n\n promises.push(method);\n }\n\n return promises;\n }", "function r2changes(results) {\n return results.map(function(res) { return res.slice(1) }).filter(function(changes) { return changes.length })\n }", "function fetchForumRequests() {\r\n\r\n var deferred = $q.defer();\r\n $http.get(BASE_URL + '/forum/request/list')\r\n .then (\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 return deferred.promise;\r\n }", "get changes() { return this.out('changes'); }", "function getAll() {\n return $http.get(this.apiUrl).then(successCallback, erroCallback);\n }", "function request_list_get(sc) {\n\t\tvar\n\t\t\trequest_list = new Array;\n\t\t\tdocument.getElementById(\"sc_count\").innerHTML=\"0\";\n\n\t\tif (window.opener) {\n\t\t\t\n\t\t\t// SiteCatalyst Images\n\t\t\tif (window.opener.document.images) {\n\t\t\t\tfor (var image_num = 0;image_num < window.opener.document.images.length;image_num++) {\n\t\t\t\t\tvar\n\t\t\t\t\t\tsrc = window.opener.document.images[image_num].src;\n\t\t\t\t\tif (src.indexOf('/b/ss/') >= 0) {\n\t\t\t\t\t\tif(sc){\n\t\t\t\t\t\t\tvar request = new Object;\n\t\t\t\t\t\t\trequest.code = 'sc';\n\t\t\t\t\t\t\trequest.method = 'SiteCatalyst Image';\n\t\t\t\t\t\t\trequest.url = src;\n\t\t\t\t\t\t\trequest_list[request_list.length] = request;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById(\"sc_count\").innerHTML++;\n\t\t\t\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Global Image Objects\n\t\t\tfor (var window_member in window.opener) {\n\t\t\t\tif ((window_member.substring(0,4) == 's_i_') && (window.opener[window_member].src)) {\n\t\t\t\t\tvar\n\t\t\t\t\t\tsrc = window.opener[window_member].src;\n\t\t\t\t\tif (src.indexOf('/b/ss/') >= 0) {\n\t\t\t\t\t\tif(sc){\n\t\t\t\t\t\t\tvar request = new Object;\n\t\t\t\t\t\t\trequest.code = 'sc';\n\t\t\t\t\t\t\trequest.method = 'SiteCatalyst Image';\n\t\t\t\t\t\t\trequest.url = src;\n\t\t\t\t\t\t\trequest_list[request_list.length] = request;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById(\"sc_count\").innerHTML++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t \n\t\treturn request_list;\n\t}", "function refreshEverything() {\n\tgetAll(refreshEverythingCallback);\n}", "function getChangeSetChanges(projectChangeSetsParam, gConfig, pullPushCommand, res, callback) {\r\n console.log('==> START :: ==> CodeReview.prototype.getChangeSetChanges *****************************');\n projectChangeSetsParam.changeSets.forEach(function (changeSet, index) {\r\n // if (changeSet.changesetId === 18) {\r\n console.log('==> INSIDE :: ==> FOR EACH LOOP CodeReview.prototype.getChangeSetChanges *****************************' + changeSet.changesetId);\n\n var changeSetParam = {};\n changeSetParam.changesetId = changeSet.changesetId;\r\n changeSetParam.author = changeSet.author.displayName;\r\n changeSetParam.changeSetLog = changeSet.comment;\r\n changeSetParam.messageText = \"/visualstudio get changeset \" + changeSet.changesetId + \" List\";\r\n\r\n doCodeReviewProcess(changeSetParam, gConfig, pullPushCommand, res, function (result) {\r\n if (result.statusCode) {\r\n res.send(JSON.stringify({ statusCode: 100, statusMessage: result.Status }));\r\n } else {\r\n callback(result);\r\n }\r\n });\r\n //}\r\n });\r\n}", "fetchQueued() {\n return fetchSoon.fetchSearchRequests(this._myStartableQueued());\n }", "getTransactions(isUpdate, txHash) {\n let obj = {\n 'params': {\n 'address': this.formData.pointerAdd, //pointer address here this.formData.pointerAdd\n 'hash': txHash ? txHash : '',\n 'pageSize': isUpdate ? 100 : 50\n }\n };\n return this._$http.get(this._Wallet.node.host + ':' + this._Wallet.node.port + '/account/transfers/all', obj).then((res) => {\n if (isUpdate) {\n // Check if txes left to load\n if (!res.data.data.length || res.data.data.length < 100) this.noMoreTxes = true;\n //\n for (let i = 0; i < res.data.data.length; i++) {\n this.transactions.push(res.data.data[i]);\n }\n } else {\n this.transactions = res.data.data;\n this.analyzeTransactions();\n }\n });\n }", "function loadRequests(){\n var result = RequestsService.get({param:AuthService.getId()}, function() {\n $scope.requests = result.requests;\n }, function(){\n Loading.showText('No se pudo cargar las solicitudes favoritas.');\n Loading.hideTimeout();\n });\n }", "function IterableChanges() { }", "function IterableChanges() { }", "function cacheRquest() {\n pendingActions.push({ data:data, done:done });\n }", "function retrieveLastSubmittedStatements() {\n res = ADL.XAPIWrapper.getStatements();\n ADL.XAPIWrapper.log(res.statements);\n\n}", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "_issueNewRequests() {\n if (!this._deferredUpdate) {\n this._deferredUpdate = setTimeout(() => this._issueNewRequestsAsync(), 0);\n }\n }", "__allResourcesReturned () {\n const ps = Array.from(this._resourceLoans.values())\n .map((loan) => loan.promise)\n .map(reflector)\n return this._Promise.all(ps)\n }", "function fetchAllBranchesForManifest() {\r\n\t\tvar deferred = $q.defer();\r\n\t\t$http.get('allbranches')\r\n\t\t\t.then(\r\n\t\t\t\t\tfunction (response) {\r\n\t\t\t\t\t\tdeferred.resolve(response.data);\r\n\t\t\t\t\t},\r\n\t\t\t\t\tfunction (errResponse) {\r\n\t\t\t\t\t\tconsole.log(\"Error while fetching branches\"); \r\n\t\t\t\t\t\tdeferred.reject(errResponse);\r\n\t\t\t\t\t}\r\n\t\t\t\t);\r\n\t\treturn deferred.promise;\r\n\t}", "listenRequests() {\n this.request(event.detail.request);\n }", "function waitForChanges () {\n request({\n pathname: \"talks?changesSince=\" + lastServerTime\n }, function (error, response) {\n if (error) {\n setTimeout(waitForChanges, 2500);\n console.log(error.stack);\n } else {\n response = JSON.parse(response);\n displayTalks(response.talks);\n lastServerTime = response.serverTime;\n waitForChanges();\n }\n });\n}", "function stateChanges(transactionId, nodeUrl, requestOptions) {\n return __awaiter(this, void 0, void 0, function* () {\n return debug_route.fetchStateChangesByTxId(nodeUrl, transactionId, requestOptions).then((t) => t.stateChanges); //todo: fix types\n });\n}", "findAll() {\n var token = localStorage[\"token\"];\n return Ember.$.getJSON(this.host + \"/api/user/requests\", {token: token});\n }", "check() {\n const proxies = this.proxies();\n\n return Promise.all(createRequests(proxies, this.target)).then(results => {\n const dead = results\n .filter(p => !this._response(p.err, p.proxy, p.res, p.body))\n .map(p => p.proxy);\n\n if (dead.length === 0) return [];\n // drop them from listeners\n this.listeners.forEach(listener => {\n listener.remove(dead);\n });\n\n return dead;\n });\n }", "ProcessDocChanges(documents) {\n // process document changes to build a list of documents for us to fetch in batches\n const docRequest = [];\n\n documents.forEach((doc) => {\n if (doc.deleted) {\n // TODO - remove document from database?\n\n // emit document deleted event\n this.emit('deleted', doc);\n } else if (doc.changes !== undefined && doc.changes.length) {\n let AlreadyHaveChange = false;\n docRequest.forEach((docRequested) => {\n if (docRequested.id === doc.id) {\n AlreadyHaveChange = true;\n\n // compare revision numbers\n if (RevisionToInt(doc.changes[0].rev) > RevisionToInt(docRequested.rev)) {\n // if this revision is greater than our existing one, replace\n docRequested.rev = doc.changes[0].rev;\n }\n\n // don't break out of for-loop in case there are even more revision in the changelist\n }\n });\n\n // push new change if we haven't already got one for this document ID in our list\n if (!AlreadyHaveChange) {\n docRequest.push({\n atts_since: null,\n rev: doc.changes[0].rev,\n id: doc.id,\n });\n }\n }\n });\n\n if (docRequest.length === 0) {\n this.Log('Extracted 0 document changes, skipping fetch');\n\n return Promise.resolve();\n }\n this.Log(`Extracted ${docRequest.length} document changes to fetch`);\n\n // filter out document revisions we already have\n return this.FilterAlreadyGotRevisions(docRequest).then((filteredDocRequest) => {\n this.Log(`After filtering on already-got revisions, left with ${filteredDocRequest.length} documents to fetch`);\n\n // split document requests into batches of docFetchBatchSize size\n const batches = [];\n while (filteredDocRequest.length > 0) {\n batches.push(filteredDocRequest.splice(0, Math.min(docFetchBatchSize, filteredDocRequest.length)));\n }\n\n this.Log(`Split document changes into ${batches.length} batches`);\n\n // resolve promises with each batch in order\n return batches.reduce((prev, cur) => prev.then(() => this.ProcessDocChangeBatch(cur)), Promise.resolve()).then(() => Promise.resolve());\n });\n }", "function buildRequests (csw, start, increment, callback) {\n utility.buildGetRecords(csw, start, increment, function (getUrl) {\n callback(getUrl);\n });\n}", "function getChangeSetItems(changeSetChangesParam, gConfig, pullPushCommand, res, callback) {\r\n\r\n changeSetChangesParam.changeSetChange.forEach(function (changeSetChangeItem, index) {\r\n // if (changeSetId === 18) {\r\n console.log(\"*&^*&^*&^*&^*&^===================>ChangeSetId::=>\" + changeSetChangeItem.item.version + \"---\" + path.extname(changeSetChangeItem.item.path));\r\n var pathExtention = path.extname(changeSetChangeItem.item.path);\r\n if (pathExtention !== '.js' && pathExtention !== '.cs') {\r\n console.log(\"Return from changeSetChange.forEach ===================>\");\r\n return;\r\n }\r\n\r\n var changeSetChangeItemParam = {};\r\n changeSetChangeItemParam.changesetId = changeSetChangeItem.item.version;;\r\n changeSetChangeItemParam.filePath = changeSetChangeItem.item.path;\r\n changeSetChangeItemParam.messageText = \"/visualstudio get filecontent by URL \" + changeSetChangeItem.item.url;\r\n\r\n doCodeReviewProcess(changeSetChangeItemParam, gConfig, pullPushCommand, res, function (result) {\r\n if (result.statusCode) {\r\n res.send(JSON.stringify({ statusCode: 100, statusMessage: result.Status }));\r\n } else {\r\n callback(result);\r\n }\r\n });\r\n //}\r\n });\r\n}", "multiCheckGetUrl(expected, responses) {\n\t\tthis.get = (url, success, error) => {\n\t\t\tthis.checkPath(expected[this.requests], url);\n\t\t\tsuccess(responses[this.requests++]);\n\t\t}\n\t}" ]
[ "0.6970937", "0.66357005", "0.6222595", "0.6088869", "0.5972922", "0.591496", "0.59128916", "0.5909605", "0.58772606", "0.58772606", "0.58516455", "0.584891", "0.581136", "0.5682478", "0.56738275", "0.5649433", "0.5599287", "0.5569104", "0.5562731", "0.55588675", "0.5533231", "0.5509632", "0.5505536", "0.5485583", "0.54525435", "0.54446304", "0.5437926", "0.5437871", "0.5435044", "0.5434383", "0.5429479", "0.54273343", "0.5422358", "0.5421627", "0.5414838", "0.541175", "0.53971714", "0.53611636", "0.5360339", "0.53565806", "0.5345679", "0.5338543", "0.5337776", "0.53276753", "0.5299176", "0.5299176", "0.5299176", "0.5299176", "0.5299176", "0.5299176", "0.5299176", "0.5299176", "0.5291157", "0.52747345", "0.52747345", "0.52747345", "0.52710706", "0.52593964", "0.52593017", "0.52519155", "0.5245765", "0.5245095", "0.52096426", "0.5199824", "0.51989836", "0.51964563", "0.51915044", "0.5189187", "0.5188412", "0.5176397", "0.5171159", "0.516644", "0.51633924", "0.5157839", "0.5156994", "0.5150843", "0.51474804", "0.5146783", "0.5145431", "0.51440454", "0.51407313", "0.51228917", "0.5095202", "0.5094403", "0.5093687", "0.5093687", "0.5088768", "0.5077962", "0.5072512", "0.5072512", "0.50717336", "0.5067757", "0.5067394", "0.5063195", "0.50556433", "0.5050214", "0.504977", "0.5044519", "0.5041004", "0.50369674", "0.50320613" ]
0.0
-1
Complete the anagram function below.
function anagram(s) { const sL = s.length; if ((sL & 1) === 0) { const mid = sL / 2; let firstSlice = s.slice(0, mid).split(''); let secondSlice = s.slice(mid).split(''); return sumUp(firstSlice, secondSlice); } return -1; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function checkAnagram() {\t\n\t\tvar first_str, second_str, first_temp, second_temp;\n\t\tfirst_str = $(\"#anagram-a\").val();\n\t\tfirst_temp = first_str;\n\t\tsecond_str = $(\"#anagram-b\").val();\n\t\tsecond_temp = second_str\n\t\tif(first_str.length != second_str.length) {\n\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_str + \"\\\" and \\\"\" \n\t\t\t\t+ second_str + \"\\\" are not anagrams for each other</p>\");\n\t\t\treturn;\n\t\t}\n\t\tfirst_str = first_str.split(\"\").sort().join(\"\");\n\t\tsecond_str = second_str.split(\"\").sort().join(\"\");\n\t\tfor(var i = 0; i < first_str.length; i++) {\n\t\t\tif(first_str[i] != second_str[i]) {\n\t\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are not anagrams for each other</p>\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are anagrams for each other</p>\");\n\t}", "algoanagram(s1, s2) {\n\n var l1 = s1.length\n var l2 = s2.length\n var flag = true\n if (l1 != l2) {\n flag = false\n }\n else {\n var s3 = s1.toLowerCase()\n var s4 = s2.toLowerCase()\n\n s3 = s3.split('').sort().join('');\n s4 = s4.split('').sort().join('');\n\n // console.log(s3);\n // console.log(s4);\n flag = s3 === s4;\n // var c=a.split(\" \")\n // var c=b.split(\" \")\n\n\n //console.log(c)\n // console.log(d)\n\n\n\n\n\n }\n if (flag == true) {\n console.log(s1 + \" and \" + s2 + \" are anagram\")\n }\n else {\n console.log(s1 + \" and \" + s2 + \" are not anagram\")\n }\n }", "function isAnagram(stgOne, stgTwo) {\n \n \n}", "function anagrams(s1, s2) { }", "function anagramCheck (str1, str2) {\n\n // ---------- Your Code Here ----------\n\n // gets rid of all the spaces and makes them lowercase to produce a string of all the letters lumped together, making comparison easier\n str1 = str1.replace(/\\s/g, \"\");\n str1 = str1.toLowerCase();\n str2 = str2.replace(/\\s/g, \"\");\n str2 = str2.toLowerCase();\n\n\n // if (str1.length !== str2.length) {\n // return false;\n // }\n \n str1 = str1.split(\"\").sort().join(\"\");\n str2 = str2.split(\"\").sort().join(\"\");\n \n return (str1 == str2);\n\n // ----------- End Code Area -----------\n\n}", "isAnagram(a, b) {\n\n var x = a.toLowerCase();\n var y = b.toLowerCase();\n if (x.length != y.length) {\n return false;\n //console.log(\"Given string is not Anagram.\");\n }\n else {\n var m = [], n = [];\n m = x.split(\"\");\n n = y.split(\"\");\n m = m.sort();\n n = n.sort();\n if (m.length == n.length) {\n for (let i = 0; i < m.length; i++) {\n if (m[i] != n[i]) {\n return false;\n }\n\n }\n return true;\n }\n }\n }", "function makeAnagram(a, b) {\n var aChars = a.split(\"\");\n var bChars = b.split(\"\");\n \n // determin what is the larger array and make it outer\n if (aChars.length > bChars.length) {\n var outer = aChars;\n var inner = bChars;\n } else {\n var outer = bChars;\n var inner = aChars;\n }\n // starting at the back, last index, of the larger array\n var outerIndex = outer.length-1;\n while (inner.length > 0 && outer.length > 0 && outerIndex >= 0) {\n //this will look for a charcter that is the same as the last in outer\n let innerIndex = inner.indexOf(outer[outerIndex]);\n //if the charcter is found endter statement\n if (innerIndex !== -1) {\n //remove the idex of the matching charcters\n outer.splice(outerIndex, 1);\n inner.splice(innerIndex, 1);\n }\n --outerIndex;\n }\n return outer.length + inner.length\n}", "function anagram(prefix, word) {\n if (word.length === 1) {\n console.log(prefix + word);\n }\n\n for (let i = 0; i < word.length; i++) {\n const firstChar = word.charAt(i);\n const remainder = word.substring(0, i) + word.substring(i + 1);\n anagram(prefix + firstChar, remainder);\n }\n}", "function annagram(word1, word2) {\n let clean1 = word1.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n let clean2 = word2.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n console.log(clean1, clean2)\n\n let newStr1 = clean1.split('').sort().join('')\n let newStr2 = clean2.split('').sort().join('')\n console.log(newStr1, newStr2)\n\n if (newStr1.length === newStr2.length) {\n return newStr1 === newStr2 ? true : false\n } else {\n return false\n }\n}", "anagram(string1, string2) {\n try {\n var format = /[a-zA-Z0-9]/;\n var result = false;\n /*\n *checks if strings are within the given format\n */\n if (format.test(string1) && format.test(string2)) {\n /*\n *checks if both strings are of equal length\n */\n if (string1.length == string2.length) {\n /*\n *splits the given strings and sorts them\n */\n var sort1 = string1.toString().split(\"\").sort().join(\"\");\n var sort2 = string2.toString().split(\"\").sort().join(\"\");\n result = sort1 == sort2;\n }\n else {\n console.log(\"Strings length must be of equal length\");\n }\n\n /*\n *checks if one string is an anagram of another\n */\n if (result == true) {\n // console.log(string1 + \" \" + string2);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n console.log(\"Enter only string\");\n\n }\n }\n catch (error) {\n console.log(error.message);\n }\n}", "function makeAnagram(a, b) {\n // keeps track of deletions from str a and b\nlet count = 0 // letters matching from both str a and str b to make an anagram\nlet length = a.length\n// 1 <= |a|, |b| <=10**4\nconst lengthOfA = a.length\nconst lengthOfB = b.length\n\n// doesn't matter, we'll eventually ending up deleting letters that don't match up with each string\n// if (lengthOfA !== lengthOfB){\n// // the length has to be equal to the shortest character length,\n// // we will iterate until that point\n// lengthOfA > lengthOfB ? length = lengthOfB : length = lengthOfA\n// }\n \n // seperating each string letter\n a = a.split('')\n b = b.split('')\n \nfor (let i =0; i<length; i++){\n console.log(\"i = \" + \"\" + i)\n // if an anagram exists (letter in a is in b)\n if (b.includes(a[i])){\n console.log(\"letter in 'a, remove in 'b'--> \" + a[i])\n // removing the letter in a\n let temp = a[i]\n a.splice(i,1)\n // found match in a\n count+=1\n // find and remove the same letter in b\n b.splice(b.indexOf(temp),1)\n // found match in b\n count+=1\n // go back to same round to check new letter in same position\n i = i-1\n }\n } // subtracting the matching anagram count against original letter count of both strings\n return (lengthOfA + lengthOfB) - count\n}", "function anagramGrouper(words){\n // object used to hold key and value relationships\n const anagrams = {};\n\n // counter tto keep track of anagrams added\n let counter = 0;\n\n // iterate through passed in array , for each element do this\n words.forEach((word)=>{\n\n // alphabetize the word \n // const normalizedWord = alphabetize(word);\n\n const normalizedWord = (word) => {\n \n // // split string into array \n word = word.split('');\n\n // // sort arra in alphabetical order\n word = word.sort();\n \n // // join array back into string now in alpha order\n word = word.join('');\n\n return word;\n\n }\n\n \n\n // if there is key of the word already\n \n /* anagrams = {\n ourWord : values\n };\n\n */\n if (anagrams[normalizedWord(word)]) {\n // put the current word as value in an array for that key\n counter++;\n return anagrams[normalizedWord(word)].push(word);\n\n }\n\n // create new key for word \n // this is one of a couple syntaxs to add a property to an \n // object\n anagrams[normalizedWord(word)] = [word];\n\n });\n\n return counter;\n\n}", "function anagram(string) {\n const results = {}\n function buildCombos(combos, letters) {\n if(!letters.length) {\n return results[combos] = '';\n }\n for (var i = 0; i < letters.length; i++) {\n buildCombos(combos + letters.charAt(i), letters.slice(0, i) + letters.slice(i + 1));\n }\n}\n buildCombos('', string);\n return Object.keys(results);\n\n}", "function is_anagram (str1, str2) {\n return formatStr(str1) === formatStr(str2);\n}", "function anagram (str1, str2) {\n\tvar letterCount = { };\n\n\tletterCount = countWords(str1, letterCount, 1) // pass to do positive count of letters in str1\n\tletterCount = countWords(str2, letterCount, -1) // pass to do negative count of letters in str2\n\t\n\t/* If the strings are anagrams, we expect every entry in the dictionary to \n\t * be equal to 0. Otherwise there will be some entry with a negative or positive count. */\n\tfor (key in letterCount) {\n\t\tif (letterCount[key] != 0)\n\t\t\treturn false\n\t}\n\n\treturn true\n}", "function checkAnagram(a = '', b = '') {\n var array = {};\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n let res = a.charCodeAt(i) - 97;\n console.log('res', res);\n array[res] = (array[res] || 0) + 1;\n }\n console.log('array', array);\n\n for (let j = 0; j < b.length; j++) {\n let res = b.charCodeAt(j) - 97;\n if (!array[res]) {\n return false;\n }\n array[res]--;\n }\n return true;\n}", "function testAnagram (s1, s2){\n // creating if statments \n if(!s1 || !s2 || s1.length !== s2.length){return false;}\n var lS1 = s1.toLowerCase();\n var lS2 = s2.toLowerCase();\n if(lS1 === lS2) {return false;}\n var rS1 = lS1.split('').sort().join('');\n var rS2 = lS2.split('').sort().join('');\n return rS1 === rS2;\n }", "isAnagram(string1, string2) {\n string1=string1+\"\";\n string2=string2+\"\";\n if (string1.length != string2.length) {\n return false;\n }\n var arr = [];\n for (let index = 0; index < 36; index++) {\n arr[index] = 0;\n\n }\n for (let index = 0; index < string1.length; index++) {\n var ch = string1.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]++;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]++;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]++;\n }\n ch = string2.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]--;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]--;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]--;\n }\n\n\n }\n for (let index = 0; index < 36; index++) {\n if (arr[index] != 0) {\n return false;\n }\n }\n return true;\n}", "function anagramStr(str, input){\n if(str.length != input.length){\n return false;\n }\n let loopData = {};\n str = str.toLowerCase().trim();\n for (let index = 0; index < str.length; index++) {\n let element = str[index];\n loopData[element] = element && loopData[element] ? loopData[element] + 1 : 1;\n }\n console.log(loopData);\n input = input.toLowerCase().trim();\n for (let index = 0; index < input.length; index++) {\n const element = input[index];\n if(!loopData[element]){\n return false;\n }\n loopData[element]--;\n }\n console.log(loopData);\n return true;\n}", "function countingAnagrams(str) {\n // Your code here\n counter = 0;\n words = str.split(' ')\n console.log(words)\n for (var i = 0; i < words.length; i++) {\n for (var j=0;j<words.length;j++){\n if (words[i]!==words[j] && isAnagram(words[i],words[j])){\n console.log(isAnagram(words[i],words[j]))\n counter++\n }\n }\n return counter\n }\n}", "function anagram(s1, s2) {\n\ts1 = s1.replace(/\\W/g,'').toLowerCase();\n\ts2 = s2.replace(/\\W/g,'').toLowerCase();\n\t//does not remove numbers\n\tconsole.log(s1);\n\tif (s1.length != s2.length) return false;\n\treturn s1.split('').sort().join('') == s2.split('').sort().join('');\n}", "function anagram(string, result = []) {\r\n if (string.length <= 1) {\r\n return string;\r\n }\r\n if ((string.length = 2)) {\r\n const first = string.charAt(0);\r\n const second = string.slice(1);\r\n const switchedLetters = second + first;\r\n return switchedLetters;\r\n }\r\n\r\n const firstLetter = string.charAt(0);\r\n // const reorder = string.slice(1);\r\n\r\n // result.push(` ${firstLetter + anagram(anagram(reorder, result), result)}`);\r\n // return result;\r\n return firstLetter + anagram(string.slice(1));\r\n}", "function printAnagram(word){\n console.log(`The word for which we will find an anagram is ${word}`);\n anagrams(' ', word);\n\n}", "function possibleAnagram(arr1 , word){\n let arrAnagram = []\n for(let i = 0 ; i < arr1.length ; i++){\n let anagram = arr1[i]\n let count = 0\n for(let j = 0 ; j < anagram.length ; j++){\n for(let n = 0 ; n < word.length ; n++){\n if(word[n] == anagram[j]){\n count++\n }\n }\n }\n if(count === arr1[i].length && arr1[i].length === word.length){\n arrAnagram.push(anagram)\n }\n }\nreturn arrAnagram;\n}", "checkAnagram2(str1, str2) {\n let unsortedStr1 = \"\" + str1;\n let unsortedStr2 = \"\" + str2;\n if (unsortedStr1.length != unsortedStr2.length) {\n return false;\n }\n sortedStr1 = this.sort1(unsortedStr1);\n sortedStr2 = this.sort1(unsortedStr2);\n let b = this.check(sortedStr1, sortedStr2);\n if (b == true) {\n return true;\n }\n else {\n return false;\n }\n }", "function anagram(string, str){\n return string.split('').sort().join('') === str.split('').sort().join('')\n}", "function fourthAnagram(str1, str2) {\n let obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (obj[`${str1[i]}1`]) {\n obj[`${str1[i]}1`]++\n } else {\n obj[`${str1[i]}1`] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (obj[`${str2[i]}2`]) {\n obj[`${str2[i]}2`]++\n } else {\n obj[`${str2[i]}2`] = 1\n }\n } \n\n for (const key in obj) {\n if (obj[key[0]+\"1\"] !== obj[key[0]+\"2\"]) {\n return false;\n }\n }\n return true;\n}", "function anagram (str1,str2){\n if(str1.length!==str2.length)\n return false;\n\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n for(let val of str1)\n freqCounter1[val] = (freqCounter1[val]||0)+1;\n\n for(let val of str2)\n freqCounter2[val] = (freqCounter2[val]||0)+1;\n \n for(let key in freqCounter2){\n \n if(!(key in freqCounter2))\n return false;\n \n if(freqCounter2[key]!==freqCounter1[key])\n return false;\n \n return true;\n }\n\n\n}", "function anagram(s, t) {\n if(s.length !== t.length) return false\n let char = {};\n \n for(let i = 0; i < s.length; i++) {\n char[s[i]] ? char[s[i]]++ : char[s[i]] = 1\n }\n \n for(let j = 0; j < t.length; j++) { // one letter might appear more that twice\n // that is why we count them \n // instead of just setting the key to true or false\n if(!char[t[j]]) {\n return false\n }\n char[t[j]]--\n }\n return true;\n }", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n // check if str1 has the same length as str2 & same characters\n if(str1.length !== str2.length){\n return false\n }\n // create an object call lookup\n let lookup = {}\n// construct the object first\n for (let i = 0; i < str1.length; i++){\n letter = str1[i]\n //if letter exits, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n for (let i = 0; i < str2.length; i++){\n let letter = second[i];\n // can't find letter of letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n return true;\n }\n}", "function anagrams(prefix, str){\n if(str.length <= 1){\n // console.log(`The anagram is ${prefix}${str}`);\n } else {\n for(let i=0; i<str.length; i++){\n let currentLetter = str.substring(i, i+1);\n let previousLetters = str.substring(0,i);\n let afterLetters = str.substring(i+1);\n anagrams(prefix+currentLetter, previousLetters+afterLetters);\n }\n }\n\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n for (var i = 0; i < str1.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str2.length; j++) {\n if (str1[i] === str2[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n for (var i = 0; i < str2.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str1.length; j++) {\n if (str2[i] === str1[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n return true;\n}", "function validAnagram(word1, word2){\n if (word1.length !== word2.length) {\n return false;\n }\n\n let counter = {};\n\n for (let i = 0; i < word1.length; i++) {\n let letter = word1[i];\n if (counter[letter]) {\n counter[letter]++;\n } else {\n counter[letter] = 1;\n }\n }\n\n for (let i = 0; i < word2.length; i++) {\n let letter = word2[i];\n if (!counter[letter]) {\n return false;\n } else {\n counter[letter] -= 1;\n }\n }\n return true;\n}", "function anagram(str1, str2) {\n\tif (str1.length !== str2.length) {\n\t\treturn false;\n\t}\n\tlet frequencyStr1 = {};\n\tfor (let i = 0; i < str1.length; i++) {\n\t\tlet letter = str1[i];\n\t\tfrequencyStr1[letter] ? (frequencyStr1[letter] += 1) : (frequencyStr1[letter] = 1);\n\t}\n\n\tfor (let i = 0; i < str2.length; i++) {\n\t\tlet letter = str2[i];\n\t\tif (!frequencyStr1[letter]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfrequencyStr1[letter] -= 1;\n\t\t}\n\t}\n\treturn true;\n}", "function anagram(str1, str2) {\n // if not equal then this string is not the same\n if (str1.length !== str2.length) return false\n let mapStr1={};\n let mapStr2={}\n let arr1 = str1.split('');\n let arr2 = str2.split('');\n let v2\n arr1.forEach((v,i)=>{\n mapStr1[v] = mapStr1[v] ? mapStr1[v] + 1 : 1\n v2 = arr2[i]\n mapStr2[v2] = mapStr2[v2] ? mapStr2[v2] + 1 : 1\n })\n\n for(let i in mapStr1) {\n if (mapStr1[i] !== mapStr2[i]) {\n return false\n }\n }\n return true\n}", "function isAnagram(s1, s2) {\n var i = 0\n //sortChars :: String -> String\n , sortChars = function (s) {\n return s.toLowerCase().split('').sort().join('');\n }\n ;\n if (s1.length !== s2.length){ return false; }\n if (sortChars(s1) !== sortChars(s2)) { return false; }\n return true;\n}", "function anagram(str1,str2){\n\n //2. Check to see if input1 & input2 are strings, if not return error/false\n if (typeof(str1, str2) !== 'string'){\n return false;\n }\n\n //3. Check to see if input1 & input2 are the same length, if not return error/false\n if (str1.length !== str2.length){\n return false;\n }\n\n //4. Create objects for both inputs\n let stringBox1 = {};\n let stringBox2 = {};\n\n //5. For each value in string1, if does not exist, create key and set value to 1 in Object1.\n //6. If value exists in Object1, increment value by 1.\n for(let val of str1){\n stringBox1[val] = stringBox1[val] + 1 || 1;\n\n }\n console.log(stringBox1);\n //7. For each value in string2, if does not exist, create key and set value to 1 in Object2.\n //8. If value exists in Object2, increment value by 1.\n for(let val of str2){\n stringBox2[val] = stringBox2[val] + 1 || 1;\n\n }\n console.log(stringBox2)\n\n //9. For each key in Object1, compare to each key in Object2.\n for(let key in stringBox1){\n // If does not exist, return false.\n if(!(key in stringBox2)){\n console.log('step 9')\n return false;\n }\n //10. Compare value of that key to each value of every key in Object2.\n if(stringBox1[key] !== stringBox2[key]){\n console.log('step 10')\n return false;\n }\n //11. Return true.\n console.log('Step 11')\n return true;\n\n }\n\n\n}", "function makeAnagram(a, b) {\n\tconst charCounts = {};\n\n\tfor (const char of a) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] += 1;\n\t\t} else {\n\t\t\tcharCounts[char] = 1;\n\t\t}\n\t}\n\tfor (const char of b) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] -= 1;\n\t\t} else {\n\t\t\tcharCounts[char] = -1;\n\t\t}\n\t}\n\n\treturn Object.values(charCounts).reduce(\n\t\t(accu, val) => accu + Math.abs(val),\n\t\t0\n\t);\n}", "function thirdAnagram(str1, str2) {\n // Complexity (n + m) - time | space - 2 ==> 1\nlet obj = {}\nlet obj2 = {}\n\nfor (let i = 0; i < str1.length || i < str2.length; i++){\n const str1Key = str1[i], str2Key = str2[i];\n if(obj[str1Key]){\n obj[str1Key]++\n }else {\n obj[str1Key] = 1\n }\n if(obj2[str2Key]){\n obj2[str2Key]++\n }else {\n obj2[str2Key] = 1\n }\n}\n// const val1Array = Object.entries(obj);\n// const val2Array = Object.entries(obj2);\n\nfor (let key1 in obj) {\n if (obj[key1] !== obj2[key1]){\n return false;\n }\n}\nfor (let key2 in obj) {\n if (obj2[key2] !== obj1[key2]){\n return false;\n }\n}\nreturn true;\n\n// if (val1Array.sort().join('') === val2Array.sort().join('')){\n// return true\n// }else return false\n// console.log(val1Array)\n// console.log(val2Array)\n}", "function anagram(str1, str2){\n if(str1.length != str2.length)return false;\n characterCount = {}\n for(let s1 of str1){\n characterCount[s1] = characterCount[s1] + 1 || 1\n }\n for(let s2 of str2){\n if(!characterCount[s2])return false;\n else characterCount[s2]--;\n }\n return true;\n}", "function isAnagram(word1,word2) {\n /* \n Check if the length of the first word is equal to the length of the second word. If not, return false\n */\n if (word1.length != word2.length) {\n return false;\n }\n\n // Convert word1 and word2 to lower case\n word1 = word1.toLowerCase();\n word2 = word2.toLowerCase();\n\n /*\n Convert each string to an array, sort in alphabetical order and convert back to a string. Check if the updated strings are the same.\n */\n return word1.split('').sort().join('') == word2.split('').sort().join('');\n}", "function generateAnagram(word, dictionary) {\n var wordGroups = splitIntoGroups(word);\n return wordGroups.reduce(function(finalAnagram, group) {\n var key = group.split(\"\").sort().join(\"\");\n var anagram = dictionary[key];\n if (anagram == undefined) { anagram = \"-- ERROR --\"}\n return finalAnagram.concat(anagram);\n }, []).join(\" \");\n}", "function findAnagram(str1, str2){ // You wrote this\r\n if(str1.length !== str2.length){\r\n return false;\r\n }\r\n let obj1 = {}\r\n let obj2 = {}\r\n for(let char of str1){\r\n obj1[char] = (obj1[char] || 0) + 1\r\n }\r\n for(let char of str2){\r\n obj2[char] = (obj2[char] || 0) + 1\r\n }\r\n for(let key in obj1){\r\n if(!(key in obj2)){\r\n return false\r\n }\r\n if(obj2[key] !== obj1[key]){\r\n return false\r\n }\r\n }\r\n return true\r\n}", "function validAnagram(str1, str2) {\n //if both strings are empty return true\n if(str1.length === 0 && str2.length === 0) return true;\n //create two empty objects\n let obj1 = {};\n let obj2 = {};\n //loop through each of the strings and put them in the objects\n for(let char of str1) {\n if(obj1[char] > 0) {\n obj1[char]++\n } else {\n obj1[char] = 1;\n }\n }\n for(let char of str2) {\n if(obj2[char] > 0) {\n obj2[char]++\n } else {\n obj2[char] = 1;\n }\n }\n //check if each key in strings match to each other \n for(let key in obj1) {\n if(!key in obj2) return false;\n //chack if the frequencies match\n if(obj1[key] !== obj2[key]) return false;\n }\n return true;\n}", "function isAnagram(str1, str2) {\n return formatStr(str1) === formatStr(str2)\n}", "function anagram(arr, size) {\n var flag;\n var x = 0;\n\n for (i = 0; i < size; i++) {\n if (arr[i] > 10) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 10);\n var b = no1 - a * 10;\n for (j = i + 1; j < size; j++) {\n var no2 = arr[j];\n var c = Math.floor(no2 / 10);\n var d = no2 - c * 10;\n if (a == d && b == c) {\n agram[x] = arr[j];\n x++;\n break;\n\n } else {\n continue;\n }\n }\n }\n if (arr[i] > 100) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 100);\n var b = no1 - a * 100;\n var c = Math.floor(b / 10);\n var d = b - c * 10;\n for (j = i + 1; j < size; j++) {\n\n var no2 = arr[j];\n var e = Math.floor(no2 / 100);\n var f = no2 - e * 100;\n var g = Math.floor(f / 10);\n var h = f - g * 10;\n arr2.push(e);\n arr2.push(g);\n arr2.push(h);\n arr2.sort();\n\n var a1 = arr2[0];\n var a2 = arr2[1];\n var a3 = arr2[2];\n arr2 = [];\n if ((a == a1) && (c == a2) && (d == a3)) {\n agram[x] = arr[j];\n x++;\n break;\n } else {\n continue;\n }\n }\n }\n }\n}", "function validAnagram(first,second){\n if(first.length!== second.length){\n return false;\n }\n \n //Create an object \n const lookup = {};\n\n //Loop through first string\n for(let i =0;i<first.length;i++){\n let letter = first[i];\n //If letter exists increment otherwise set to 1\n lookup[letter]?lookup[letter]+=1:lookup[letter]=1;\n }\n console.log(lookup)\n\n //Loop through the second string \n for (let i = 0;i<second.length;i++){\n let letter =second[i];\n //If we can't find a letter or letter is zero , then its not an anagram\n if(!lookup[letter]){\n return false;\n }\n else{\n lookup[letter]-=1;\n }\n }\n\n return true;\n\n}", "function anagramsAlt(string) {\n let arr = string.split('')\n let arr2 = []\n let n = arr.length\n let count = 0;\n\n //Populate arr2\n for (let i = 0; i < n; i++) {\n arr2.push(0)\n }\n\n count ++\n console.log(arr, count)\n\n let e = 0;\n while (e < n) {\n if (arr2[e] < e) {\n if (e % 2 === 0) {\n let placeholder = arr[0]\n arr[0] = arr[e]\n arr[e] = placeholder\n } else {\n // arr[arr2[e]], arr[e]\n let placeholder = arr[arr2[e]]\n arr[arr2[e]] = arr[e]\n arr[e] = placeholder\n }\n count ++\n console.log(arr, count)\n arr2[e]++\n e = 0\n } else {\n arr2[e] = 0\n e++\n }\n }\n}", "function isAnagram(str1, str2) {\n return formatString(str1) === formatString(str2);\n}", "function validAnagram(str1, str2) {\n if(str1.length !== str2.length) {\n return false;\n }\n \n let lookup = {};\n \n for(i = 0; i < str1.length; i++){\n let letter = str1[i]\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n \n for(let j = 0; j < str2.length; j++) {\n let letter = str2[j]\n if(!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1\n }\n }\n return true;;\n}", "function validAnagram(str1, str2) {\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n if (str1 === str2) {\n return true;\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n let anagram1 = {};\n\n for (let char of str1) {\n anagram1[char] = ++anagram1[char] || 1;\n }\n\n console.log('obj: ', anagram1);\n\n for (let char of str2) {\n if (!anagram1[char]) {\n return false;\n } else {\n anagram1[char] -= 1;\n }\n }\n return true;\n}", "function thirdAnagram(str1, str2) {\n let str1Obj = {};\n let str2Obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (str1Obj[str1[i]]) {\n str1Obj[str1[i]]++\n } else {\n str1Obj[str1[i]] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (str2Obj[str2[i]]) {\n str2Obj[str2[i]]++\n } else {\n str2Obj[str2[i]] = 1\n }\n\n }\n\n\n for (const key in str1Obj) {\n\n if (str1Obj[key] !== str2Obj[key]) {\n return false\n }\n\n }\n\n return true\n\n}", "function anagram(arr){\n let hash = new HashMap();\n for(let i=0; i < arr.length; i++){\n let key = arr[i].split('')\n .sort()\n .join('');\n try{\n let val = hash.get(key);\n val.push(arr[i]);\n }\n catch(err){\n hash.set(key, [arr[i]]) \n }\n }\n let arrayResults;\n \n arrayResults = hash._slots\n .filter(_slot => _slot !== undefined)\n .map(_slot => _slot.value);\n console.log(arrayResults);\n \n}", "function validAnagram (str1, str2) {\n let obj = {};\n if (str1.length !== str2.length) return false;\n for (let char of str1) {\n obj[char] = obj[char] ? obj[char] + 1 : 1;\n }\n for (let char of str2) {\n if (!obj[char]) {\n return false;\n } else {\n obj[char]--;\n }\n }\n return true;\n}", "function makeAnagram(a, b) {\n var mapA = setupMap(a);\n var mapB = setupMap(b);\n\n return calcDeletes(mapA, mapB);\n}", "function isAnagram(first, second) {\n let output1 = first.toLowerCase().split(\"\").sort().join(\"\");\n let output2 = second.toLowerCase().split(\"\").sort().join(\"\");\n return output1 == output2;\n}", "function anagram(word, list) {\n return list.filter(function (candidate) {\n return areAnagrams(candidate, word);\n });\n}", "function anagram(arr){\n const hash = new Map();\n let result = [];\n arr.forEach(item => {\n let sortedItem = item.split('').sort().join('');\n if(!hash.has(sortedItem)){\n hash.set(sortedItem, [item]);\n result.push(sortedItem);\n } else{\n let items = hash.get(sortedItem);\n items.push(item);\n hash.set(sortedItem, items);\n }\n });\n return result.map(item => hash.get(item.split('').sort().join('')));\n}", "function anagram(word) {\n return {\n matches: function (words) {\n words = Array.isArray(words) ? words : [].slice.call(arguments, 1);\n return words.filter(function (candidate) {\n return !isSameWord(word, candidate) && isAnagram(word, candidate);\n });\n }\n };\n}", "function makeAnagram(a, b) {\n let bigArr;\n let smallArr;\n let count = 0;\n if (a.length > b.length) {\n bigArr = a.split('');\n smallArr = b.split('');\n }\n else {\n bigArr = b.split('');\n smallArr = a.split('');\n }\n\n for(let i = 0; i < smallArr.length; i++) { \n if (bigArr.includes(smallArr[i])) {\n bigArr.splice(bigArr.indexOf(smallArr[i]), 1);\n count++;\n }\n }\n return smallArr.length - count + bigArr.length;\n}", "function validAnagram(str1, str2) {\n\n // no need to check if strings arent same length\n if(str1.length != str2.length) {\n return false\n }\n\n // storatge for counters\n let cache1 = {}\n let cache2 = {}\n\n // counter\n function counter(cache, str) {\n for(let char of str) {\n if(cache[char]) {\n cache[char] += 1\n } else {\n cache[char] = 1\n }\n }\n }\n\n counter(cache1, str1)\n counter(cache2, str2)\n\n // checking if each cache has same amount of each item\n for(const prop in cache1) {\n if(cache1[prop] !== cache2[prop]) {\n return false\n }\n }\n\n return true\n}", "function anagrams(string, arr=string.split(''), n = arr.length) {\n\n if (n === 1) {\n count ++\n console.log(arr, count)\n }\n else {\n for (let i = 0; i < n - 1; i++) {\n anagrams(string, arr, n-1, count)\n if (n % 2 === 0) {\n let placeholder = arr[i]\n arr[i] = arr[n-1]\n arr[n-1] = placeholder\n } else {\n let placeholder = arr[0]\n arr[0] = arr[n-1]\n arr[n-1] = placeholder\n }\n }\n anagrams(string, arr, n - 1, count)\n }\n}", "function checkAnagram(str1, str2){\n\n // Check if the length of the two array is the samey\n if(str1.length !== str2.length){\n return false;\n }\n\n// create two object frequencies\n let strFrequency1 = {};\n let strFrequency2 = {};\n\n // loop through each of the two string respectively and add their count to their objects\n for(let char of str1){\n strFrequency1[char] = ++strFrequency1[char] || 1;\n }\n for(let char of str2){\n strFrequency2[char] = ++strFrequency2[char] || 1;\n }\n console.log(strFrequency1);\n console.log(strFrequency2);\n // compare the two objects with occupiance of the frequencies\n for(let key in strFrequency1){\n if(strFrequency2[key] !== strFrequency1[key]){\n return false;\n }\n }\n // return either true or false\n return true;\n}", "function isAnagram(s, t) {\n let newS = s.split(\"\").sort().join(\"\");\n let newT = t.split(\"\").sort().join(\"\");\n if (newS === newT) {\n return true\n } else {\n return false\n }\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n\n for (let i = 0; i < str2.length; i++) {\n let letter = str2[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n //we subtract one to make sure both str have same frequency of letter\n lookup[letter] -= 1;\n }\n }\n\n return true;\n}", "function makeAnagram(str1, str2) {\n let counter1 = str1.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n let counter2 = str2.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n for (let ltr in counter2) {\n counter1[ltr] = (counter1[ltr] || 0) - counter2[ltr];\n }\n return Object.values(counter1).reduce((acc, val) => acc + Math.abs(val), 0);\n}", "function isAnagram (a, b) {\n\t// turn each string into arrays to check for equality\n\tlet stringAArray = a.split('');\n let stringBArray = b.split('');\n\n // have a counter variable to keep track of how many characters match\n let numberOfMatches = 0;\n\n // check which string is smaller to loop through that string in the first loop\n // so we can reduce the number of equality checks\n if (stringAArray.length > stringBArray.length) {\n \tstringAArray = b.split('');\n stringBArray = a.split('');\n }\n\n // loop through both array of strings to check if stringAArray[i] === stringBArray[j]\n // push 2 counters to numberOfMatches for each match\n // set stringBArray[j] to null so that when we do an equality check it would not check that same value again and add counters to numberOfMatches\n for (let i = 0; i < stringAArray.length; i++) {\n for (let j = 0; j < stringBArray.length; j++) {\n if (stringAArray[i] === stringBArray[j]) {\n \t// console.log('match');\n numberOfMatches += 2;\n stringBArray[j] = null;\n break;\n }\n }\n }\n\n // console.log('number of matches: ' + numberOfMatches);\n // console.log('string a array: ' + stringAArray);\n // console.log('string b array: ' + stringBArray);\n // console.log('number of cuts: ' + (stringAArray.length + stringBArray.length) - numberOfMatches);\n\n // return total amount of cuts to both strings\n return (stringAArray.length + stringBArray.length) - numberOfMatches;\n}", "function isAnagram (str1, str2) {\n if(str1.length !== str2.length) return false\n let frequencyCounter1 = getCharFrequency(str1)\n let frequencyCounter2 = getCharFrequency(str2)\n for(let key in frequencyCounter1){\n if(!frequencyCounter2.hasOwnProperty(key)) return false\n if(frequencyCounter1[key] !== frequencyCounter2[key]) return false\n }\n return true\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) return false\n\n let check = {}\n\n for (let i = 0; i < str1.length; i++) {\n const letter = str1[i]\n check[letter] ? (check[letter] += 1) : (check[letter] = 1)\n }\n\n for (let i = 0; i < str2.length; i++) {\n const letter = str2[i]\n if (!check[letter]) {\n return false\n } else {\n check[letter] -= 1\n }\n }\n\n return true\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n // console.log(lookup)\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n }\n console.log(lookup)\n return true;\n}", "function checkAnagramWithTimeComplexity(str1, str2) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1.length !== str2.length) return false\n let counting = {}\n for (let c of str1) {\n counting[c] = (counting[c] + 1) || 1;\n }\n for (let c of str2) {\n if (counting[c]) {\n --counting[c];\n }\n else {\n return false;\n }\n }\n return true;\n}", "function findAnagram(substring, word){\n //base case if the substring is empty then check to see if word has been added into\n //result array yet, if not go ahead and it to obj and push into array\n if(substring === \"\"){\n if(!obj[word]){\n obj[word] = true;\n result.push(word);\n }\n return;\n }\n //recursive case iterates through each letter in the substring and adds that letter\n //to the word and removes it from the substring, then calls itself\n for(var i = 0; i < substring.length; i++){\n findAnagram(substring.slice(0, i) + substring.slice(i+1, substring.length), word + substring[i]);\n }\n }", "function makeAnagram(a, b) {\n let counter = {};\n let total = 0;\n Array.from(a).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] += 1;\n });\n Array.from(b).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] -= 1;\n });\n Object.keys(counter).forEach((k) => {\n if (counter[k] !== 0) total += Math.abs(counter[k]);\n });\n return total;\n}", "function validAnagram(str1, str2) {\n\tif (str1.length !== str2.length) return false;\n\n\t// Does the strings have the same chars and its counts\n\t// { a: 2, b: 1, r: 3, o: 5}\n\tlet freq1 = {};\n\tlet freq2 = {};\n\n\t// Iterate trough the strings and add the chars to the freq counters\n\tfor (let i of str1) {\n\t\tfreq1[i] = freq1[i] ? freq1[i] + 1 : 1;\n\t}\n\tfor (let i of str2) {\n\t\tfreq2[i] = freq2[i] ? freq2[i] + 1 : 1;\n\t}\n\tconsole.log(freq1, freq2);\n\t// Compare the strings and return bool\n\tfor (let i in freq1) {\n\t\tif (!(i in freq2)) {\n\t\t\treturn false;\n\t\t}\n\t\t// if the value of the key is diffrent\n\t\tif (freq1[i] !== freq2[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function validAnaram2(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n //Initalize object\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n //if letter exists, incremnt, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n //Cant find letter or letter is zero then its not an anagram\n //Because zero is falsey\n if (!lookup[letter]) {\n return false;\n } else {\n //If letter exists, subtract one, one is truthy\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function isAnagram( s, t) {\n let charMap = new Map();\n let slength = s.length;\n let tlength = t.length;\n if( slength !== tlength) {\n return false;\n }\n for( let i=0 ; i < slength ; i++){\n charMap.set(s.charAt(i), (charMap.get(s[i]) || 0) +1);\n charMap.set(t.charAt(i), (charMap.get(t[i]) || 0) -1);\n }\n let isAnagram = true;\n charMap.forEach((countOfChar) => {\n if ( countOfChar !== 0 ) {\n isAnagram = false;\n return;\n }\n });\n return isAnagram;\n}", "function secondAnagram(str1, str2) {\n str1 = str1.split(\"\");\n str2 = str2.split(\"\");\n\n str1.sort();\n str2.sort();\n\n str1 = str1.join(\"\");\n str2 = str2.join(\"\");\n\n if (str1 == str2) {\n return true;\n } else {\n return false;\n }\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n if (str1.length !== str2.length ) {\n return false\n }\n\n let strObj = {};\n\n for (let val in str1 ) {\n // for strings you need to do strObj[str1[val]]\n // if key exists add to it if not create it\n strObj[str1[val]] = (strObj[str1[val]] || 0) + 1;\n }\n\n for (let val in str2) {\n strObj[str2[val]] = (strObj[str2[val]] || 0) + 1;\n }\n\n // now loop over the to see if the values are even\n for (let key in strObj) {\n if (strObj[key] % 2 !== 0) {\n return false\n }\n }\n\n return true\n\n}", "function validAnagram(str1, str2) {\n // add whatever parameters you deem necessary - good luck!\n // Run checks if string is empty or strings are not same length\n if (str1 === \"\" && str2 === \"\") {\n return true;\n }\n if (str1.length !== str2.length) {\n return false;\n }\n //Initalize objects for counters\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n //Create Objects through iteration\n for (let val of str1) {\n freqCounter1[val] = (freqCounter1[val] || 0) + 1;\n }\n for (let val of str2) {\n freqCounter2[val] = (freqCounter2[val] || 0) + 1;\n }\n\n //Iterate through one ob\n for (let key in freqCounter1) {\n if (!(key in freqCounter2)) {\n return false;\n }\n if (freqCounter2[key] !== freqCounter1[key]) {\n return false;\n }\n }\n return true;\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n lookup[char] ? (lookup[char] += 1) : (lookup[char] = 1);\n }\n\n for (let i = 0; i < str1.length; i++) {\n let char = str2[i];\n if (!lookup[char]) {\n return false;\n } else {\n lookup[char] -= 1;\n }\n }\n\n return true;\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) return false;\n\n let letterMap = {};\n\n for (let i = 0; i < str1.length; i++) {\n let current = str1[i].toLowerCase()\n if (!letterMap[current]) {\n letterMap[current] = 1\n } else {\n letterMap[current] ++\n }\n }\n \n for (let j = 0; j < str2.length; j++) {\n let current = str2[j].toLowerCase();\n if (letterMap[current]) {\n letterMap[current] --\n } else {\n return false;\n }\n }\n return Object.values(letterMap).every(el => el === 0) ? true : false;\n}", "function checkAnagram(str1,str2){\n if(str1.length !== str2.length){\n return false;\n }\n var charStr1=str1.split(\"\").sort();\n var charStr2=str2.split(\"\").sort();\n\n for(var i=0; i<charStr1.length; i++){\n if (charStr1[i]!==charStr2[i]){\n return false;\n }\n }\n\n return true;\n\n}", "function sherlockAndAnagrams(s) {\n let count = 0;\n //글자 수\n for (let i = 1; i < s.length; i++) {\n for (let j = 0; j < s.length - i; j++) {\n const target = s.substring(j, j + i, j);\n // console.log(\"-------\");\n for (let k = 1 + j; k < s.length - i + 1; k++) {\n let compared = s.substring(k, k + i);\n if (isAnagram(target, compared)) {\n count++;\n }\n }\n }\n }\n return count;\n}", "function anagram(arrs) {\n var result = [];\n arrs.forEach((arr) => {\n // char to remove space from array\n var char = arr.replace(/\\s/g, '');\n var word = char.split('').sort().join(''); // eopr\n\n //check whether the object has the specified property\n if (!result.hasOwnProperty(word)) {\n result[word] = []; //[eopr] = []\n }\n result[word].push(char);\n });\n return result;\n}", "function validAnagram2(str1, str2) {\n if(str1.length !== str2.length) return false\n return str1.split(\"\").sort().join(\"\") === str2.split(\"\").sort().join(\"\");\n}", "function isAnagram2(s1, s2) {\n if (s1.length !== s2.length) return false\n const s1Arr = s1.split(\"\")\n const s2Arr = s2.split(\"\")\n s1Arr.sort()\n s2Arr.sort()\n for (let i = 0;i < s1Arr.length; i++) {\n if (s1Arr[i] !== s2Arr[i]) {\n return false\n }\n }\n return true\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n \n let s1 = str1.split(\"\").sort().join(\"\");\n let s2 = str2.split(\"\").sort().join(\"\");\n \n return s1===s2;\n\n}", "function isAnagram(s1, s2) {\n if (s1.length !== s2.length) return false\n const map = new Map()\n for (let i = 0; i < s1.length; i++) {\n if (!map.has(s1[i])) {\n map.set(s1[i], 1)\n } else {\n map.set(s1[i], map.get(s1[i]) + 1)\n }\n }\n for (let i = 0; i < s2.length; i++) {\n if (!map.has(s2[i])) return false\n map.set(s2[i], map.get(s2[i]) - 1)\n if (map.get(s2[i]) === 0) {\n map.delete(s2[i])\n }\n }\n return map.size === 0\n}", "function anagramCounter(wordsArray) {\n return counter;\n}", "function generateAnagram(word, split, dictionary) {\n\n // prep word for processing\n\n // split the word in half\n var leftSplit = word.substring(0, split);\n var rightSplit = word.substring(split);\n\n // sort both words by letters, to be used in the dictionary\n var leftKey = leftSplit.split(\"\").sort().join(\"\");\n var rightKey = rightSplit.split(\"\").sort().join(\"\");\n\n // use the keys to see if there are words we can use\n var leftValue = dictionary[leftKey];\n var rightValue = dictionary[rightKey];\n\n // if either were undefined, we can't make an anagram with this split\n if (leftValue == undefined || rightValue == undefined) {\n return false\n }\n\n return leftValue + \" \" + rightValue;\n\n}", "function makeAnagram(inProgress, leftovers) {\n // if in-progress's length === string's length\n if (inProgress.length === string.length) {\n // push in-progress into results array\n results.push(inProgress);\n }\n\n\n\n // loop through leftover letters\n for (let i = 0; i < leftovers.length; i++) {\n // recursively call helper. Args: 1) letter from loop with in-progress prepended, 2) leftover letters minus the letter from loop.\n let inProgressWithAddedLetter = inProgress + leftovers[i];\n\n let remainingLettersAfterAdd = leftovers.slice(0,i) + leftovers.slice(i+1);\n\n makeAnagram(inProgressWithAddedLetter, remainingLettersAfterAdd);\n }\n }", "function isAnagram(str1, str2){\n \n if(str1==null || str2==null \n || str1.length==0 || str2.length==0 \n || str1.length != str2.length){\n return false;\n }\n\n for(let a of str1){\n if(!str2.contains(a)){ /// time complexity = O(n^2) :( \n return false;\n }\n }\n return true;\n\n}", "function validAnagram(s, t) {\n if (s.length !== t.length) {\n return false\n }\n let charMap = {}\n s = s.split('')\n for (let index = 0; index < s.length; index++) {\n if (charMap[s[index]]) {\n charMap[s[index]] += 1\n } else {\n charMap[s[index]] = 1\n }\n }\n for (let index = 0; index < t.length; index++) {\n if (!charMap[t[index]]) {\n return false\n } else {\n charMap[t[index]]--\n }\n }\n return true\n}", "function makingAnagrams(s1, s2) {\n let charMatched = 0;\n let s1Arr = s1.split('');\n let s2Arr = s2.split('');\n let deletionCount = s1Arr.length+s2Arr.length;\n for(let i=0;i<s1Arr.length;i++){\n for(let j=0;j<s2Arr.length;j++){\n if(s1Arr[i]===s2Arr[j]){\n charMatched+=2;\n s2Arr[j] = 0;\n break;\n }\n }\n }\n return deletionCount-charMatched;\n}", "isAnagram(str1, str2) {\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n var sortStr1 = str1.split('').sort().join('');\n var sortStr2 = str2.split('').sort().join('');\n\n return (sortStr1 === sortStr2);\n }", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n const lookup = {}; // Ospace (a)\n const firstLength = first.length;\n for (let index = 0; index < firstLength; index++) { // Otime (a)\n const element = first[index];\n lookup[element] = (lookup[element] || 0) + 1;\n }\n const secondLength = second.length;\n for (let index = 0; index < secondLength; index++) { // Otime (b)\n const element = second[index];\n if (!lookup[element]) {\n return false;\n }\n lookup[element] -= 1;\n }\n return true;\n}", "function anagrams(string1, string2){\n let obj = {};\n\n string1.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] += 1;\n }\n });\n\n string2.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] -= 1;\n }\n });\n\n return Object.values(obj).every(char => char === 0);\n}" ]
[ "0.78004897", "0.78004897", "0.78004897", "0.76877123", "0.76792103", "0.76521707", "0.75690114", "0.7520472", "0.7510093", "0.75061995", "0.74499625", "0.7364239", "0.7334213", "0.72860384", "0.727025", "0.72685146", "0.7248051", "0.72329473", "0.7218033", "0.7197962", "0.7191993", "0.71700764", "0.71629727", "0.7155458", "0.7151014", "0.7149929", "0.71492404", "0.71482986", "0.7133368", "0.7128164", "0.7122021", "0.7121166", "0.7117409", "0.7097822", "0.70962256", "0.7094292", "0.7090403", "0.70877534", "0.7071051", "0.7068074", "0.7065844", "0.7054205", "0.7036535", "0.70359457", "0.7035751", "0.7012252", "0.7011776", "0.70036805", "0.6998021", "0.6993804", "0.69927645", "0.6991891", "0.69903344", "0.69871557", "0.6977498", "0.6964617", "0.6962019", "0.6959851", "0.69484526", "0.69456756", "0.69443357", "0.6929422", "0.68955", "0.68953353", "0.6891573", "0.6888979", "0.68873894", "0.6883413", "0.68774873", "0.6874685", "0.6836631", "0.6834412", "0.68246657", "0.6821985", "0.6819326", "0.68116724", "0.6811465", "0.68099266", "0.68079585", "0.68062574", "0.6804493", "0.6802527", "0.6800195", "0.679824", "0.67968345", "0.6794607", "0.67922294", "0.6788677", "0.67875826", "0.6785752", "0.67850494", "0.6782617", "0.677803", "0.677538", "0.67700654", "0.6763432", "0.6759348", "0.67280495", "0.67275816", "0.67242825" ]
0.730545
13
Highschool mathematics warning, dist = sqrt((x1x2)^2 + (y1y2)^2)
function calculateDistance(point, station) { const x1 = _.get(point, 'x', 0); const x2 = _.get(station, 'x', 0); const y1 = _.get(point, 'y', 0); const y2 = _.get(station, 'y', 0); const distance = Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2)); return distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function dist(x, y, x2, y2) {return Math.sqrt((x2-x)*(x2-x) + (y2-y)*(y2-y));}", "function dist(x1,y1,x2,y2) {\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\n}", "function dist(x1, y1, x2, y2) {\r\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\r\n }", "function distancia(x1, y1, x2, y2) {\r\n\treturn Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));\r\n}", "function dist(x1, x2, y1, y2) {\r\n var a = x1 - x2;\r\n var b = y1 - y2;\r\n\r\n var c = Math.sqrt(a * a + b * b);\r\n return c;\r\n}", "function distance (x1, y1, x2, y2){\r\n return Math.sqrt( (x2-=x1)*x2 + (y2-=y1)*y2 );\r\n}", "function dist(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "function distance_to(x1, y1, x2, y2){\n return Math.sqrt((x2-x1)**2 + (y2-y1)**2);\n}", "function dist(x1, y1, x2, y2) {\n var a = x1 - x2;\n var b = y1 - y2;\n var c = Math.sqrt( a*a + b*b );\n return c;\n}", "function get_dist(x1,y1,x2,y2){\n return Math.sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));\n}", "function distance(x1,y1,x2,y2) {\n return sqrt(pow(x2-x1,2)+pow(y2-y1,2)) \n}", "function distS(x1, y1, x2, y2) {\n\tvar distance = Math.sqrt(distNS(x1, y1, x2, y2));\n\treturn distance;\n}", "function distance(x1, y1, x2, y2) {\r\n\t\t return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\r\n\t\t}", "_distanciaPuntos(x1, x2, y1, y2) {\n let distancia = Math.sqrt(((x2-x1)**2) + ((y2-y1)**2));\n return distancia;\n }", "function distance(x1, x2, y1, y2){\n\treturn Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));\n}", "function distance(x1, y1, x2, y2){ \n\t\treturn Math.abs(Math.sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) ));\n\t}", "function calcDistance(x1, y1, x2, y2)\n{\n\treturn Math.sqrt(Math.pow((x2 - x1),2) + Math.pow((y2 - y1),2));\n}", "function distancia_punto_punto(coord1,coord2)\n{\nreturn Math.sqrt(Math.pow(coord1[0]-coord2[0])+Math.pow(coord1[1]-coord2[1]));\n}", "function distance (x1, y1, x2, y2){\r\n\tvar a = x1 - x2;\r\n\tvar b = y1 - y2;\r\n\treturn Math.sqrt(a*a + b*b);\r\n}", "function distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n }", "function distance(x1, y1, x2, y2)\n{\n return Math.sqrt(\n Math.pow(Math.abs(x2 - x1), 2) +\n Math.pow(Math.abs(y2 - y1), 2));\n}", "function distance(x1, x2, y1, y2) {\n\treturn Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "function distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2-x1, 2) + Math.pow(y2-y1, 2))\n}", "function disPoint(x1,y1,x2,y2){\n var distanceX=Math.pow((x1-x2),2)\n var distanceY=Math.pow((y1-y2),2)\n return Math.sqrt(distanceX+distanceY);\n \n}", "function distance(x1, y1, x2, y2){\n var s = Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2));\n //console.log(\"s: \", s);\n return s;\n}", "dist (pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "Dis(x2, y2) {\n var x1 = 0;\n var y1 = 0;\n\n console.log(\"X1 is \" + x1);\n console.log(\"Y is \" + y1);\n\n var xs = (x2 - x1);\n var ys = (y2 - y1);\n xs *= xs;\n ys *= ys;\n\n var distance = Math.sqrt(xs + ys);\n console.log(\"Result is =>\" + distance);\n\n }", "function calculeDistance(x1, y1, x2, y2) {\r\n return Math.sqrt(Math.pow((y2 - y1),2) + Math.pow((x2 - x1),2));\r\n}", "function Distance(x,y,x2,y2) {\n return Math.sqrt(Math.pow(x2-x,2) + Math.pow(y2-y,2));\n}", "function distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "function calculateDistance(x1,x2,y1,y2){\n return Math.sqrt(Math.pow((x2-x1),2)+Math.pow((y2-y1),2));\n}", "function distance( x1, y1, x2, y2 ) {\n var a = x2 - x1;\n var b = y2 - y1;\n return Math.sqrt( a * a + b * b );\n }", "function getDistance(x1,y1,x2,y2){\r\n\tlet xOff = x1 - x2;\r\n\tlet yOff = y1 - y2;\r\n\treturn Math.sqrt(xOff * xOff + yOff * yOff);\r\n}", "function getDistance(x1,y1,x2,y2){\n // this is the equation: square root of (x1-y1)*(x1-y2)+(y1-y2)*(y2-y1)\n return Math.sqrt( Math.pow((x1-x2), 2) + Math.pow((y1-y2), 2) );\n}", "function get_distance(x1, y1, x2, y2)\n{\n return Math.sqrt(Math.pow(x2-x1,2) + Math.pow(y2-y1,2));\n}", "function m_distancia(px, py, dx1, dy1, dx2, dy2) {\r\n\r\n\tif (dx2 == dx1) {\r\n\t\tdx2 += 0.00001;\r\n\t}\r\n\r\n\tvar a = (dy2 - dy1) / (dx2 - dx1);\r\n\tvar b = -1;\r\n\tvar c = dy1 - a * dx1;\r\n\r\n\tvar dis = Math.abs((a * px + b * py + c) / Math.sqrt(a * a + b * b));\r\n\r\n\treturn dis;\r\n\r\n}", "dist (pos1, pos2) {\n\t return Math.sqrt(\n\t Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n\t );\n\t }", "distance(x0, y0, x1, y1) {\n return Math.sqrt(Math.pow(x1 - x0, 2) + Math.pow(y1 - y0, 2));\n }", "function getDistance(x1, y1, x2, y2)\r\n{\r\n\treturn (((x2-x1)**2)+((y2-y1)**2))**(1/2);\r\n}", "function dist(p1, p2)\n{\n return (p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y);\n}", "function distSquared(x1, y1, x2, y2) {\n return Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2);\n}", "function getDistance(x1,y1,x2,y2) {\n\treturn Math.sqrt(((x2-x1)*(x2-x1))+((y2-y1)*(y2-y1)));\n}", "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "distance(x1, y1, x2, y2) {\n\t\treturn Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n\t}", "function getDist(x1, y1, x2, y2){\n\treturn Math.sqrt(Math.pow((x2 - x1), 2) + Math.pow((y2 - y1), 2))\n}", "function dist(c1, c2){\r\n return ((c2.x - c1.x) ** 2 + (c2.y - c1.y) ** 2) ** 0.5;\r\n}", "function distance(p1, p2)\n{\n return Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function dist(p1, p2) {\n var dx = p1.x - p2.x;\n var dy = p1.y - p2.y;\n return Math.sqrt(dx*dx + dy*dy);\n}", "function getDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n }", "function distance(x1,y1, x2,y2){\n var dx = x2-x1;\n var dy = y2-y1;\n with(Math){ return sqrt(pow(dx,2)+pow(dy,2)); }\n}", "dist (x, y) {\n const dx = (this.x - x);\n const dy = (this.y - y);\n return dx ** 2 + dy ** 2 \n }", "function getDistance(x1, y1, x2, y2) {\r\n var a = 0.0;\r\n var b = 0.0;\r\n a = x1 - x2;\r\n b = y1 - y2;\r\n return Math.sqrt(a * a + b * b);\r\n}", "function getDistance(x1, y1, x2, y2) {\n\treturn Math.sqrt(Math.pow((x1 - x2), 2) + Math.pow((y1 - y2), 2));\n}", "function euclideanDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1-x2, 2) + Math.pow(y1-y2, 2));\n}", "static distance(p1, p2) {\n const dx = (p1.x - p2.x);\n const dy = (p1.y - p2.y);\n return Math.sqrt(dx * dx + dy * dy);\n }", "distance (a, b) {\n return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n }", "function getDistance(x1, y1, x2, y2) {\n return Math.sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));\n }", "function calculateDistanceBetweenTwoPoints(x1, y1, x2, y2) {\r\n let distance = Math.sqrt(Math.pow((x1-x2),2) + Math.pow((y1-y2),2));\r\n console.log(distance);\r\n}", "dist(pos1, pos2) {\n return Math.sqrt(\n Math.pow(pos1[0] - pos2[0], 2) + Math.pow(pos1[1] - pos2[1], 2)\n );\n }", "function getDistance(x1, y1, x2, y2)\n{\n var l1 = x2 - x1;\n var l2 = y2 - y1;\n \n return Math.sqrt(l1 * l1 + l2 * l2);\n}", "function distance(a, b) {\r\n return Math.sqrt((a.x - b.x)**2 + (a.y - b.y)**2);\r\n}", "static distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) ** 2 + (p1.y - p2.y) ** 2);\n }", "function find_distance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n}", "function pointDistance(x1,y1, x2,y2) {\n return Math.sqrt( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) );\n}", "function distance(coord1, coord2) {\n\treturn Math.sqrt(Math.abs(coord1[0] - coord2[0])**2 + Math.abs(coord1[1] - coord2[1])**2)\n}", "DistanceFromPoint(x,y,x2,y2) {\n return Math.abs(Math.sqrt(Math.pow((x-x2),2) + Math.pow((y-y2),2)));\n }", "function distancia(p1,p2){\n //obteniendo los parametros de el objeto\n const x= p1.x - p2.x;\n const y= p1.y - p2.y;\n //to fixed, redondear decimales\n return (Math.sqrt(Math.pow(x,2)+Math.pow(y,2))).toFixed(2)\n}", "function distance(p1, p2) {\n\treturn Math.sqrt(Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2));\n}", "function getDistance(x1, y1, x2, y2) {\n var x = x2 - x1;\n var y = y2 - y1;\n return Math.sqrt((x * x) + (y * y));\n }", "static distance(a, b){\n const deltaX = a.x - b.x;\n const deltaY = a.y - b.y;\n\n //sqrt is static method for the Math class\n return Math.sqrt(deltaX ** 2 + deltaY ** 2);\n }", "function pointDistance(x1, y1, x2, y2) {\n return Math.sqrt((y2-y1)*(y2-y1) + (x2-x1)*(x2-x1));\n}", "function getDistance(x1,y1,x2,y2)\n{\n var xD = (x2-x1);\n var yD = (y2-y1);\n var power = Math.pow(xD,2)+Math.pow(yD,2);\n return Math.sqrt(power);\n}", "function dist(p1, p2) {\n return Math.sqrt(Math.pow(p1[0] - p2[0], 2)\n + Math.pow(p1[1] - p2[1], 2));\n}", "function getDistance(x1, x2, y1, y2) {\n var a = x1 - x2;\n var b = y1 - y2;\n var c = Math.sqrt( a*a + b*b );\n return c;\n }", "function distBetweenPoints(x1, y1, x2, y2) {\n\treturn Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n}", "function distance(a,b){\r\n return Math.sqrt(Math.abs((a.x-b.x)*(a.x-b.x))+Math.abs((a.y-b.y)*(a.y-b.y)));\r\n}", "function dist(p1,p2) {\n return Math.hypot(p2.x-p1.x, p2.y-p1.y);\n}", "function calculateDistance(p1x, p1y, p2x, p2y) {\n var xDistance = p1x - p2x,\n yDistance = p1y - p2y;\n return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));\n }", "function distance(p1, p2) {\n\t return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n\t}", "getDistance(x1, y1, x2, y2){\r\n let dx = x2 - x1;\r\n let dy = y2 - y1;\r\n\r\n return Math.sqrt(Math.pow(dx,2) + Math.pow(dy,2));\r\n }", "function distance (point1, point2) {\n Math.sqrt(Math.pow(point1[0] - point1[1], 2) + Math.pow(point2[0] - point2[1], 2))\n}", "function dist(a, b){return norm(sum(a, scalar(-1, b)));}", "function distance(p1, p2) {\n\t\treturn Math.sqrt(Math.pow(p2.y - p1.y, 2) + Math.pow(p2.x - p1.x, 2));\n\t}", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n }", "function distance(p1, p2) {\n return Math.floor(Math.sqrt(Math.pow((p2.x - p1.x), 2) + Math.pow((p2.y - p1.y), 2)));\n }", "function pointDistance(x1,y1,x2,y2){\r\n\tvar dist = Math.sqrt( Math.abs((x2 - x1)*(x2-x1)) + Math.abs((y2 - y1)*(y2-y1)));\r\n\treturn dist;\r\n}", "function calculateDistance(p1x, p1y, p2x, p2y) {\n var xDistance = p1x - p2x;\n var yDistance = p1y - p2y;\n return Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));\n}", "function getTwoPointsDistance(x1, y1, x2, y2) {\n return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n }", "function calculateDistance(p1x, p1y, p2x, p2y) {\n\t\t\tvar xDistance = p1x - p2x,\n\t\t\t\tyDistance = p1y - p2y;\n\t\t\treturn Math.sqrt(Math.pow(xDistance, 2) + Math.pow(yDistance, 2));\n\t\t}", "function distance(x1, y1, x2, y2) {\n return Math.abs(x1 - x2) + Math.abs(y1 - y2)\n}", "function calculateDistance( p1x, p1y, p2x, p2y ) {\n var xDistance = p1x - p2x,\n yDistance = p1y - p2y;\n return Math.sqrt( Math.pow( xDistance, 2 ) + Math.pow( yDistance, 2 ) );\n}", "function distance(a, b) {\n\treturn Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));\n}", "function _sqDist(p1, p2) {\n \tvar dx = p2.x - p1.x,\n \t dy = p2.y - p1.y;\n \treturn dx * dx + dy * dy;\n }", "function _sqDist(p1, p2) {\n \tvar dx = p2.x - p1.x,\n \t dy = p2.y - p1.y;\n \treturn dx * dx + dy * dy;\n }", "static distance(x1, y1, x2, y2) {\n return Math.hypot(x2 - x1, y2 - y1);\n }", "function distance(p1, p2) {\n var firstPoint;\n var secondPoint;\n var theXs;\n var theYs;\n var result;\n\n firstPoint = new createjs.Point();\n secondPoint = new createjs.Point();\n\n firstPoint.x = p1.x;\n firstPoint.y = p1.y;\n\n secondPoint.x = p2.x;\n secondPoint.y = p2.y;\n\n theXs = secondPoint.x - firstPoint.x;\n theYs = secondPoint.y - firstPoint.y;\n\n theXs = theXs * theXs;\n theYs = theYs * theYs;\n\n result = Math.sqrt(theXs + theYs);\n\n return result;\n}", "function _sqDist(p1, p2) {\r\n \tvar dx = p2.x - p1.x,\r\n \t dy = p2.y - p1.y;\r\n \treturn dx * dx + dy * dy;\r\n }", "function _sqDist(p1, p2) {\r\n \tvar dx = p2.x - p1.x,\r\n \t dy = p2.y - p1.y;\r\n \treturn dx * dx + dy * dy;\r\n }", "function distance(p1, p2) {\n return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) +\n (p1.y - p2.y) * (p1.y - p2.y));\n}", "function _sqDist(p1, p2) {\r\n \tvar dx = p2.x - p1.x,\r\n \t dy = p2.y - p1.y;\r\n \treturn dx * dx + dy * dy;\r\n }", "function distance(a, b){\n return Math.sqrt(Math.pow((a.x - b.x), 2) + Math.pow((a.y - b.y), 2));\n}" ]
[ "0.81116265", "0.78565085", "0.77300876", "0.7722012", "0.76973903", "0.7692252", "0.7638338", "0.76357305", "0.76067865", "0.75878924", "0.7513586", "0.75106466", "0.7503946", "0.74710935", "0.74632305", "0.74371576", "0.74142706", "0.7413438", "0.74131316", "0.74031514", "0.7389034", "0.73874307", "0.73796666", "0.7377017", "0.7373307", "0.73705", "0.7356729", "0.7333896", "0.7312664", "0.7312098", "0.7311865", "0.72780454", "0.7273695", "0.72727644", "0.7268298", "0.72677976", "0.72609514", "0.72538036", "0.7251271", "0.7229824", "0.7228773", "0.7220299", "0.72036844", "0.7183514", "0.71569157", "0.71553", "0.7146465", "0.7141908", "0.7130583", "0.71286345", "0.71193737", "0.71066874", "0.71003824", "0.709248", "0.7083236", "0.70585775", "0.70562947", "0.70550424", "0.704936", "0.70459473", "0.70429265", "0.7039231", "0.70374393", "0.7026705", "0.7025803", "0.70250404", "0.702091", "0.7014029", "0.7009288", "0.700605", "0.7002358", "0.7000648", "0.69778204", "0.6969713", "0.6962404", "0.6959589", "0.6956947", "0.6945647", "0.6939518", "0.69376284", "0.6935013", "0.69288373", "0.6922384", "0.69166005", "0.691558", "0.6905812", "0.6902095", "0.6898182", "0.6895369", "0.6893022", "0.6885061", "0.68617755", "0.6859479", "0.6859479", "0.6845322", "0.68402004", "0.68284076", "0.68284076", "0.68251073", "0.6821497", "0.68136305" ]
0.0
-1
Set the resource route of the model
resource() { return 'clients' }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "setResource(value) {\n super.put(\"resource\", value);\n }", "set routes(data) {\n _routes = data;\n }", "constructor(path) { \n\n // Initiate the model\n super(); \n \n // Bind the route path for models\n this.path = path;\n }", "set partialRoute(route) {\n\t this._setRoute(route ? convert.objectToRoute(route) : null);\n\t }", "function setPublicRoutes() {\n}", "set resourceId(value) {\n const {\n resource\n } = this; // When assigning a new id to a resource, it will update the resourceId of the assignment. But the assignments\n // resource is still the same so we need to announce here\n\n if ((resource === null || resource === void 0 ? void 0 : resource.isModel) && resource.id === value) {\n this.set('resourceId', value);\n } else {\n this.resource = value;\n }\n }", "function Resource(model, resource_name, options) {\n this.model = model;\n this.options = {\n limit: 20,\n refs: null\n };\n this.many_path = \"/\" + resource_name;\n this.single_path = \"/\" + resource_name + \"/:_id\";\n _.merge(this.options, options);\n this.options.path = this.many_path;\n this.emitter = new EventEmitter();\n }", "resource(resource, controller) {\n const resourceInstance = new Resource_1.RouteResource(resource, controller, this.matchers);\n const openedGroup = this.getRecentGroup();\n if (openedGroup) {\n openedGroup.routes.push(resourceInstance);\n }\n else {\n this.routes.push(resourceInstance);\n }\n return resourceInstance;\n }", "set() {\n this.setPostResource('set');\n return this;\n }", "setResourceType(value) {\n super.put(\"resource_type\", value);\n }", "function SetRoute(_a) {\n var path = _a.path, component = _a.component;\n var setRoute = hooks_1.useAction('setRoute');\n hooks_1.useSetter(function () { return component && setRoute(path, component); });\n // tslint:disable-next-line:no-null-keyword\n return null;\n}", "constructor(scope, id, props) {\n super(scope, id, { type: CfnRoute.resourceTypeName, properties: props });\n cdk.requireProperty(props, 'routeTableId', this);\n this.routeName = this.ref.toString();\n }", "function Route(data) {\n var self = this;\n self.route = data;\n self.name = data.Name;\n self.selected = function () {\n return viewModel.isCurrentRoute(self.name);\n };\n}", "onRoute (info) {\n openApi.addRoute(info, {\n basePath: env.REST_API_PREFIX\n })\n }", "function setRestfulApi(options) {\n if(options.apis && options.apis.restful) {\n var apis = self.settings().apis;\n for( var api in apis ) {\n apis[api].url = options.apis.restful.url;\n }\n }\n }", "setRoutingKey(value) {\n\n }", "function updateRoute() {\n\n}", "route() {\n return `/api/staff/v1/${this._api_route}`;\n }", "constructor (route) {\n super(route);\n }", "static route() {\n return pluralize.plural(this.name).toLowerCase()\n }", "path(name) {\n this.url += ('/' + name);\n return this;\n }", "function setRoute(route) {\n\t\thasher.setHash(route);\n\t}", "put(uri, action) {\n\n this.route('PUT', uri, action);\n }", "loadResource() {\n // Load Reference Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.route_table_id, 'route_table', true)\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n this.route_table_id.property('value', this.resource.route_table_id)\n }", "get resource () {\n\t\treturn this._resource;\n\t}", "get resource () {\n\t\treturn this._resource;\n\t}", "function setPolyline() {\n $scope.curRoute = {\n path: new google.maps.Polyline({\n strokeColor: '#000000',\n strokeOpacity: 1.0,\n strokeWeight: 3\n })\n };\n\n $scope.curRoute.path.setMap(map);\n }", "setUri(value) {\n return super.put(\"uri\", value);\n }", "getRouteResourceURL(variables) {\n return client.query({ query: Query.routeResourceURL, variables })\n }", "function set(route, dataObj) {\n var path = route,\n data = [];\n if (!_objUtils.isNull(dataObj)) {\n path += \"?\";\n for (var prop in dataObj) {\n if (prop !== 'undefined' && dataObj.hasOwnProperty(prop)) {\n data.push(prop + '=' + encodeURIComponent(dataObj[prop]));\n }\n }\n path += data.join('&');\n }\n\n updateURLFragment(path);\n }", "constructor() {\n this.productsRoute = \"/products/\";\n }", "function createRouteString( modelName )\n{\n return BASE_URL + modelName;\n}", "setStreamRoute(streamRoute) {\n if (streamRoute) {\n this.streamRoute = streamRoute;\n }\n return this;\n }", "addResource(resource) {\n this._resource = this._resource.merge(resource);\n }", "setRoute(path) {\n let pathname = getPath(path);\n if (supportsHistoryAPI() && this.options.hashBang === false) {\n addressbar.value = pathname;\n } else {\n location.href = \"/#!\" + pathname;\n }\n\n let route = findMatchingRoute(this.routes, pathname);\n let self = this;\n\n if (route !== null && route !== undefined && route !== window.location.href) {\n let params = parseParams(route, pathname);\n self.routes[route](params);\n } else {\n self.routes['/ThisRouteDefinitelyIsNotFound']({});\n }\n }", "function updateRoute(route){\n if(linechart !== undefined){\n linechart.setRoute(route);\n }\n if(sparklines !== undefined){\n sparklines.setRoute(route);\n }\n}", "shallowResource(resource, controller) {\n const resourceInstance = new Resource_1.RouteResource(resource, controller, this.matchers, true);\n const openedGroup = this.getRecentGroup();\n if (openedGroup) {\n openedGroup.routes.push(resourceInstance);\n }\n else {\n this.routes.push(resourceInstance);\n }\n return resourceInstance;\n }", "setPath (callback) {\n\t\t// provide random parameter \"thisparam\", which will be rejected\n\t\tthis.path = `/posts?teamId=${this.team.id}&streamId=${this.teamStream.id}&thisparam=1`;\n\t\tcallback();\n\t}", "setRouter(router) {\r\n this.router = router;\r\n }", "setRouter(router) {\r\n this.router = router;\r\n }", "get api_route() {\n return this._api_route;\n }", "function set (router, app){\n \n console.log('\\n');\n console.log('# Route 설정');\n\n //////////////////////////////////////\n // Route 변수 설정\n //////////////////////////////////////\n\n var PATH_ROOT = app.get('PATH_ROOT');\n var PATH_USE_STATIC = app.get('PATH_USE_STATIC');\n var PATH_SERVER = app.get('PATH_SERVER');\n\n // URL Root 설정\n var URL_HOME_PREFIX = app.get('URL_HOME_PREFIX');\n\n // 경로 매핑\n // 상대 경로는 본 파일로부터의 상대 경로임\n // var _path_prefix = (PATH_USE_STATIC) ? PATH_ROOT : '.';\n\n //************************************************************************\n\n // Hi-story Application 에 대한 index까지만 지정하고,\n // 이하 route는 Application (angular-route)에서 다시 Route한다.\n\n /*\n // Root이외의 Route 설정\n var _url_map = {\n \"/\" : '/route/index',\n // \"/auth/signup\" : \n };\n for(var key in _url_map){\n _url_map[key] = PATH_SERVER + _url_map[key];\n }\n _url_map[URL_HOME_PREFIX] = _url_map['/'];\n */\n\n //************************************************************************\n\n // 경로 매핑\n console.log('\\t * 절대경로 사용 : ', PATH_USE_STATIC);\n // console.log('\\t * root : ', _url_map[URL_HOME_PREFIX]);\n\n console.log('# Route 설정 완료.');\n console.log('\\n');\n\n //////////////////////////////////////\n // Route 미들웨어\n //////////////////////////////////////\n\n // a middleware with no mount path, gets executed for every request to the router\n // 모든 요청에 대해 DB_OBJECT객체를 참조할 수 있도록 값을 추가해준다\n router.use( function (req, res, next) {\n \n console.log('\\n');\n console.log('-------------------------------------------');\n console.log('# Request URL : ', req.originalUrl);\n console.log('\\t * time:', Date.now());\n console.log('\\t * Request Type : ', req.method);\n\n if(app){\n var db = app.get('DB_OBJECT');\n req.db = db;\n console.log(\"\\t * DB_OBJECT Setting.\");\n }\n\n console.log(\"\\t * Cookies: \", req.cookies)\n \n next();\n });\n\n //-----------------------------------\n // Middleware Test : http://expressjs.com/guide/using-middleware.html\n //-----------------------------------\n\n /*\n // a middleware sub-stack which handles GET requests to /user/:id\n\n app.get('/user/:id', function (req, res, next) {\n console.log('ID:', req.params.id);\n next();\n }, function (req, res, next) {\n res.send('User Info');\n });\n // handler for /user/:id which prints the user id\n app.get('/user/:id', function (req, res, next) {\n res.end(req.params.id);\n });\n */\n\n ////////////////////////////////////////////////////////////////////////////\n // Page Routing\n ////////////////////////////////////////////////////////////////////////////\n\n //-----------------------------------\n // Home Page\n //-----------------------------------\n\n router.get(URL_HOME_PREFIX, function(req, res, next) {\n var actualPath;\n if(PATH_USE_STATIC){\n actualPath = PATH_SERVER + '/route/index';\n }else{\n // 상대 경로는 본 파일로부터의 상대 경로임\n actualPath = './index';\n }\n\n checkServerPage(URL_HOME_PREFIX, actualPath, req, res, next);\n });\n\n /*\n router.use('/404_NOT_FOUND', function(req, res, next) {\n res_404 (req, res, next);\n });\n */\n\n //////////////////////////////////////\n // route Response가 정의된 JS 파일을 검사한다.\n //////////////////////////////////////\n\n function checkServerPage(routeString, actualPath, req, res, next) {\n var requestURL = req.originalUrl;\n var pathname = url.parse(requestURL).pathname;\n var pattern = getPattern(routeString);\n var match = pattern.test(pathname);\n\n \n // console.log('\\t - actualPath : ', actualPath);\n // console.log('pattern : ', pattern);\n // console.log('match : ', match);\n\n if(match == false){\n // 파일시스템에서 파일 링크로 읽어들여 서비스 함\n next();\n return;\n }\n\n console.log('\\n');\n console.log('\\t - pathname : ', pathname);\n console.log('\\t - actualPath : ', actualPath);\n\n // 해당 경로의 JS 파일에 링크를 연결한다.\n var file = require( actualPath );\n try{\n // 해당 파일은 response 인터페이스가 정의되어 있어야 한다.\n if(!file || !file.response){\n var msg = '해당 파일이 없거나 인터페이스가 구현되어 있지 않습니다.';\n throw new Error(msg);\n }\n // 응답\n file.response(req, res);\n return;\n }\n catch(err){\n console.log('# [Route Exception] : ' + err);\n console.log(err.stack);\n next();\n }\n }\n\n //-----------------------------------\n // Pattern 체크\n //-----------------------------------\n \n function getPatternString (word){\n // var patternString = '\\/' + word + '(\\W|$)(\\/|\\#)*(\\/)*';\n var patternString = '' + word + '(\\\\W|$)(\\\\/|\\\\#)*(\\\\/)*($|\\\\s)';\n return patternString;\n }\n function getPatternExpression (word){\n var expression = '/' + getPatternString(word) + '/gm';\n return expression;\n }\n function getPattern (word){\n var patternString = getPatternString(word);\n var pattern = new RegExp(patternString, 'gm');\n return pattern;\n }\n\n //-----------------------------------\n // 404 Page\n //-----------------------------------\n\n function res_404 (req, res) {\n console.log(\"# 404 Not found\");\n var content = \"<h1>404 Not found</h1>READ FILE ERROR: Internal Server Error!\";\n\n res.writeHead(404, 'text/html');\n res.write(content);\n res.end();\n }\n\n ////////////////////////////////////////////////////////////////////////////\n // Auth Request Routing 정의\n ////////////////////////////////////////////////////////////////////////////\n\n\n\n\n\n\n\n\n\n\n\n \n \n authRoute.set (router);\n\n dbRoute.set (router);\n\n\n\n\n\n\n\n\n\n\n ////////////////////////////////////////////////////////////////////////////\n // 마지막으로 파일시스템을 조사한다. (이미지, css등의 요청)\n ////////////////////////////////////////////////////////////////////////////\n\n\n router.use(function(req, res, next){\n\n var requestURL = req.originalUrl;\n var pathname = url.parse(requestURL).pathname;\n\n // 파일 읽기 (가상 prefix 제거)\n var prefix = URL_HOME_PREFIX + '/';\n var filePath = pathname.replace(prefix, '');\n if(filePath.indexOf('/') == 0){\n filePath = filePath.replace('/', '');\n }\n\n // var ext = path.extname(filePath);\n var mimeType = mime.lookup(pathname);\n\n console.log('\\n');\n console.log('\\t * Anonymous Request : ', pathname);\n console.log('\\t - filePath : ', filePath);\n console.log('\\t - mimeType : ', mimeType);\n console.log('\\n');\n\n var options = {\n root: PATH_ROOT,\n dotfiles: 'deny',\n // headers: {\n // 'x-timestamp': Date.now(),\n // 'x-sent': true\n // }\n };\n res.sendFile(filePath, options, function (err) {\n if (err) {\n console.log('\\n//////////////////////////////////////////////////////////////////\\n');\n console.log('-> [File Route Error] : ');\n console.log(err, err.stack);\n console.log('\\n//////////////////////////////////////////////////////////////////\\n');\n \n // res.status(err.status).end();\n res_404 (req, res);\n\n }else {\n console.log('-> Response Result success : ', filePath);\n }\n });\n });\n\n /*\n // 파일 직접 읽어 보내기\n router.use(function(req, res, next){\n\n var requestURL = req.originalUrl;\n var pathname = url.parse(requestURL).pathname;\n\n // 파일 읽기 (가상 prefix 제거)\n var prefix = URL_HOME_PREFIX + '/';\n var filePath = pathname.replace(prefix, '');\n if(filePath.indexOf('/') == 0){\n filePath = filePath.replace('/', '');\n }\n\n // 경로 변환\n var actualPath;\n if(PATH_USE_STATIC){\n actualPath = PATH_ROOT + '/' + filePath;\n }else{\n // 상대 경로는 본 파일로부터의 상대 경로임\n actualPath = './' + filePath;\n }\n\n console.log('\\t * Path : [ ', pathname, ' ]');\n console.log(\"\\t * Anonymous Request : \", actualPath);\n // console.log(\"\\t - pathname : ( \", pathname, \" )\");\n\n // 서비스\n // res.sendfile(actualPath);\n\n // non-blocking 방식 - res 이용하여 컨텐츠 리턴\n var mimeType = mime.lookup(pathname);\n fs.readFile(filePath, function(error, contents){\n\n if(error){\n\n console.log(error);\n res_404 (req, res);\n\n }else{\n\n // req.setEncoding(\"utf8\");\n // console.log(\"req query : \", req.query);\n\n // res.writeHead(200, 'text/html');\n res.setHeader('Content-Type', mimeType);\n res.writeHeader(200);\n\n // res.write(contents);\n res.end(contents);\n }\n });\n });\n */\n\n /*\n router.use(function(req, res, next){\n // req.setEncoding(\"utf8\");\n res.setHeader('Content-Type', 'text/html');\n res.writeHeader(200);\n // res.write(contents);\n res.end(contents);\n });\n */\n\n //////////////////////////////////////\n // mount the router on the app\n //////////////////////////////////////\n\n app.use('/', router);\n\n}", "function editRouteAssignmentDialogController() { }", "function setData(obj, v) {\n obj.data = (0, resource_url_impl_1.unwrapResourceUrl)(v);\n}", "setPath(path) {\nthis._path = path;\n}", "function REST_ROUTER(router, dataLoader) {\n\tlet self = this;\n\tself.handleRoutes(router, dataLoader);\n}", "setVideoRoute (slot, input, cb) {\n\t\tthis._setRoute.call(this, slot, input, 'SETVIDEOROUTE', cb)\n\t}", "function path (route) {\n const model = getIn(route, ['model', 'coll'])\n const tags = route.tags || [model]\n const summary = route.summary\n return compact({\n tags,\n summary,\n 'x-model': model,\n 'x-handler': route.handler.name,\n parameters: parameters(route),\n requestBody: requestBody(route.requestSchema),\n responses: responses(route)\n })\n}", "init() {\n this.router.route('/')\n .get(this.getAll)\n .post(this.postHero);\n this.router.route('/:id')\n .get(this.getOne);\n }", "function Route(options) {\n /**\n * Internal ID.\n *\n * @type {String}\n */\n this.id = options.id;\n\n /**\n * ID of the agency that manages this line.\n *\n * @type {String}\n */\n this.agencyId = options.agencyId;\n\n /**\n * Line short name (e.g. '4').\n *\n * @type {String}\n */\n this.shortName = options.shortName;\n\n /**\n * Line long name (e.g. 'Boy Konen/LT.Mich.Lucius').\n *\n * @type {String}\n */\n this.longName = options.longName;\n\n /**\n * Hexadecimal color code (e.g. 43FA7A).\n *\n * @type {String}\n */\n this.color = options.color;\n }", "setResource(internal_name, resource) {\n if (IsString(internal_name, true) && IsObject(resource)) {\n PopLog.info(this.name, `Entity Resource set for ${internal_name}`, resource);\n this.asset.resource.set(internal_name, resource);\n }\n }", "registerRoutes() {\n this.get(`/`, `version`);\n\n // Register routes for branch resources\n this.get(`/branches`, `branch-data`);\n this.get(`/branches/:id`, `branch-find`);\n this.post(`/branches`, `branch-create`);\n\n // Register routes for sales resource\n this.get(`/sales`, `sales-data`);\n this.get(`/sales/:id`, `sale-find`);\n this.post(`/sales`, `sale-create`);\n }", "route(engine = false) {\n const endpoint = '/control/';\n return `${endpoint}${this._api_route}`;\n }", "setupRoute(route) {\n this.mapRoutes.push(new MapRoute(route));\n }", "function addResourceAction(config){\r\n var action = config.action,\r\n verb = action.verb,\r\n apiConfig = config.apiConfig,\r\n expressApp = config.expressApp,\r\n resourceFacade = config.resourceFacade;\r\n \r\n //console.log('action: ' + JSON.stringify(action));\r\n \r\n var uri = (apiConfig.prefix || '') +\r\n (apiConfig.resource || '') +\r\n action.uri;\r\n var method = action.method(resourceFacade);\r\n expressApp[verb]( uri, method);\r\n}", "loadResource() {\n // Load Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.drg_id, 'dynamic_routing_gateways', true)\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n this.drg_id.property('value', this.resource.drg_id)\n }", "function Route(root, route, region, banner, abbrev, city) {\n\n this.root = root;\n this.route = route;\n this.region = region;\n this.banner = banner;\n this.abbrev = abbrev;\n this.city = city;\n return this;\n}", "function customizeCal (req, res) {\n\tvar model = req.model || {},\n\t\trouterPath;\n\n\tif (req.route && req.params) {\n\t\t// removing special character ':' from the url\n\t\trouterPath = req.route.path.replace(/:/g, '');\t\t\n\t\t\n\t\tmodel.rootTxn = {\n\t\t\tname: 'resolutioncenter' + routerPath,\n\t\t\tdata: req.params,\n\t\t\tstatus: 0\n\t\t};\n\t}\n}", "route() {\n return pluralize.plural(this.constructor.name).toLowerCase()\n }", "updateRoute() {\n this.props.updateRoute(this.props.index,\n this.agency, this.line, this.direction, this.time);\n }", "function prepRoute() {\n transitionRoute(this.path);\n }", "function apiHandler(req, reply) {\n\n var rb = new RepresentationBuilder(settings.relsUrl);\n var resource = rb.create({}, req.url);\n\n // grab the routing table and iterate\n var routes = req.server.table();\n for (var i = 0; i < routes.length; i++) {\n var route = routes[i];\n\n // :\\\n var halConfig = route.settings.app && route.settings.app.hal;\n\n if (halConfig && halConfig.apiRel) {\n var rel = halConfig.apiRel;\n var href = routes[i].path;\n\n // grab query options\n if (halConfig.query) {\n href += halConfig.query;\n }\n\n // check if link is templated\n var link = new hal.Link(rb.resolve(rel), href);\n if (/{.*}/.test(href)) {\n link.templated = true;\n }\n\n // todo process validations for query parameters\n resource.link(link);\n }\n }\n\n // handle any curies\n rb.addCuries(resource);\n reply(resource).type('application/hal+json');\n }", "config() {\n this.router.get('/', medicosEspecialidadesController_1.medicosEspecialidadesController.list);\n this.router.get('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.getOne);\n this.router.post('/', medicosEspecialidadesController_1.medicosEspecialidadesController.create);\n this.router.delete('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.delete);\n this.router.put('/:id', medicosEspecialidadesController_1.medicosEspecialidadesController.update);\n }", "loadResource() {\n // Load Reference Selects\n this.loadSelect(this.vcn_id, 'virtual_cloud_network', false)\n this.loadSelect(this.drg_id, 'drg', true)\n this.loadSelect(this.route_table_id, 'route_table', true, this.vcn_filter)\n this.loadDrgRouteRulesSelect()\n // Assign Values\n this.vcn_id.property('value', this.resource.vcn_id)\n this.drg_id.property('value', this.resource.drg_id)\n this.route_table_id.property('value', this.resource.route_table_id)\n this.drg_route_table_id.property('value', this.resource.drg_route_table_id)\n }", "init() {\n this.router.get(this.path, this.process);\n }", "static get __resourceType() {\n\t\treturn 'Resource';\n\t}", "_updateRouter(route) {\n\n /*\n (R.intersection(getMetods(route), verbs)).forEach(routeVerb => {\n route.log(`found route handler for '${routeVerb}' method`);\n route.router[routeVerb]('/', route[routeVerb].bind(route));\n });\n */\n\n this._getMethods(route).forEach(method => {\n let verb = this._startsWithVerb(method);\n if (verb) {\n let spec = this._routeify(method);\n if (spec) {\n route.log(`found route handler for '${spec.verb}' method`);\n route.router[spec.verb](spec.route, route[method].bind(route));\n }\n }\n });\n }", "function setRestoredResource() {\n var trResources = $(\"#checkpointRestoreResource tr[resource-id]\");\n var provider = $.parseJSON($(\".provider\").val());\n var parameters = $.Karbor.getResourceDefaultParameters(provider, \"restore_schema\");\n if(trResources != null) {\n trResources.each(function() {\n var trResource = $(this);\n var resourceid = trResource.attr(\"resource-id\");\n var parameterbtn = trResource.find(\".editparameters\");\n var resourcetype =parameterbtn.attr(\"resourcetype\");\n var userdata = parameterbtn.data(\"userdata\");\n if(userdata!=null) {\n parameters[resourcetype + \"#\" + resourceid] = userdata;\n }\n });\n }\n $(\".parameters\").val(angular.toJson(parameters));\n}", "setUsbRoute (slot, input, cb) {\n\t\tthis._setRoute.call(this, slot, input, 'SETUSBROUTE', cb)\n\t}", "function put(req, res, next) {\n req.url = `/${req.params.nested}/${req.params.nestedId}`\n next()\n }", "static getFullPath() {\n return this.baseUrl() + this.apiRoute() + '/' + this.route() + '/'\n }", "onRecipeEdit() {\n this.router.navigate(['../', this.Id, 'edit'], { relativeTo: this.route });\n }", "config() {\n this.router.get('/', domiciliosController_1.domiciliosController.list);\n this.router.get('/:id', domiciliosController_1.domiciliosController.getOne);\n this.router.post('/', domiciliosController_1.domiciliosController.create);\n this.router.delete('/:id', domiciliosController_1.domiciliosController.delete);\n this.router.put('/:id', domiciliosController_1.domiciliosController.update);\n }", "function setPrivateRoutes() {\n\n // PUT routes\n _app.put('/user-admin', UserAdminCtrl.handleRequest);\n}", "function addResource(config){ \r\n var expressApp = config.expressApp,\r\n dataModel = config.dataModel,\r\n resourceName = config.resourceName,\r\n resourceConfig = config.resourceConfig;\r\n \r\n for(var action in resourceConfig.actions){\r\n addResourceAction({\r\n action: resourceConfig.actions[action],\r\n apiConfig: resourceConfig,\r\n expressApp: expressApp,\r\n resourceFacade: dataModel[resourceName]\r\n });\r\n }\r\n}", "defineRoutes() {\n super.defineRoutes();\n this._router.post(this._resourceName + '/login', (req, res, next) => this.login(req, res, next));\n }", "setupRoute(route) {\n let controller = this.controllers[route.controller];\n let action = controller[route.action] || this.defaultAction;\n let authMethod = (req, res, next) => {\n return next();\n };\n if (route.authentication && route.authentication.controller && route.authentication.action) {\n authMethod = this.controllers[route.authentication.controller][route.authentication.action]();\n }\n this.router[route.method](route.url, authMethod, (req, res) => {\n let values = route.method === 'get' ? req.query : req.body;\n const validator = new Validator_1.default(route.params, Object.assign({}, values, req.files));\n validator.addCustomTypes(this.customTypes);\n try {\n if (validator.isValid() === false) {\n const errorMessage = `This request failed validation, please check the documentation for ${route.method.toUpperCase()} ${route.url}`;\n const err = new ErrorResponse_1.ErrorResponse({ req, res, errorMessage, errors: validator.getErrors(), status: 400 });\n return err.send();\n }\n }\n catch (e) {\n const errorMessage = e.message;\n const errors = [\n `Invalid route definition for ${route.method.toUpperCase()} ${route.url}`\n ];\n const err = new ErrorResponse_1.ErrorResponse({ req, res, errorMessage, errors, status: 501 });\n return err.send();\n }\n values = Object.assign(validator.values, req.params);\n let routeHandler;\n // streaming route\n if (route.streaming === true) {\n routeHandler = new StreamingRouteHandler_1.StreamingRouteHandler(values, action, req, res);\n }\n else {\n routeHandler = new DefaultRouteHandler_1.DefaultRouteHandler(values, action, req, res);\n }\n // handle route\n routeHandler.handle();\n });\n }", "function updateResource(resource) {\n ajaxRequest(\n HTTP_METHODS.PUT,\n resource.restUpdatePath(),\n function () {\n resource.updateView();\n },\n resource.updateJson());\n}", "init() {\n this.router.post('/general', this.updateGeneralSettings);\n this.router.get('/general', this.getGeneralSettings);\n this.router.get('/version', this.getVersion);\n }", "function modifyTourUri(){\n\t\tserverUri = Parameters.getTourServerUri() + \"/path\";\n\t}", "function productResource($resource, appSettings) {\r\n return $resource(appSettings.serverPath + \"/api/products\");\r\n\r\n // This is to test URL path routing.\r\n //return $resource(appSettings.serverPath + \"/api/products/id\");\r\n //return $resource(appSettings.serverPath + \"/api/products/:search\");\r\n }", "function routeToAPI(route, modelName) {\n var returnDesc = route.returns && route.returns[0];\n var model = returnDesc\n ? ((returnDesc.type == 'object' || returnDesc.type == 'any')\n ? modelName || 'any'\n : prepareDataType(returnDesc.type))\n : 'void';\n\n return {\n path: convertPathFragments(route.path),\n operations: [{\n httpMethod: convertVerb(route.verb),\n nickname: route.method.replace(/\\./g, '_'), // [rfeng] Swagger UI doesn't escape '.' for jQuery selector\n responseClass: model,\n parameters: route.accepts ? route.accepts.map(acceptToParameter(route)) : [],\n errorResponses: [], // TODO(schoon) - We don't have descriptions for this yet.\n summary: route.description, // TODO(schoon) - Excerpt?\n notes: '', // TODO(schoon) - `description` metadata?\n authorizations: {\n oauth2: [\n {\n description: 'Allow everything',\n scope: '*'\n }\n ]\n }\n }]\n };\n}", "function setRoute(route) {\n\twindow.location.hash = route;\n\tSTORE.dispatch({ type: \"routing\", route });\n}", "function addRouter(method, curUrl, handler, requireAuth){\n let router = {\n method: method,\n url: curUrl,\n handler: handler,\n requireAuth: requireAuth\n };\n\n // url parameters\n let index = curUrl.indexOf(\":\");\n if (index > 0){\n router.parameter = curUrl.substring(index+1); //'/api/v1/configuration/:name' ==> parameter='name'\n router.url = curUrl.substring(0, index); //'/api/v1/configuration/:name' ==>'/api/v1/configuration/' , with slash\n }\n\n _routers.push(router);\n}", "set path(path) {\n this._path = path;\n this.setAttribute('path', path);\n }", "get resources() {\n return [this.resource];\n }", "doRoute() {\n let routename = 'HTTP:' + this.request.method + ':' + this.url.pathname;\n this.run(routename, this.restnio.routes, \n Parser.parseFullHttpParams, this.request, this.url);\n }", "function ResourceResolver( resourceFolder ) \r\n{\r\n\tthis.resourceFolder = resourceFolder;\r\n}", "options(uri, action) {\n\n this.route('OPTIONS', uri, action);\n }", "function setResourceHost(host) { _appHostUrl = host; }", "init(){\n this.routes();\n return router;\n }", "pathParameter(id) {\n if (typeof(id) !== \"string\") id = toString(id);\n this.url += '/' + id;\n return this;\n }", "static get __resourceType() {\n\t\treturn 'PatientLink';\n\t}", "function HCL2($resource, car // this will be a car that will allow passing between controllers.\n ) {\n this.$resource = $resource;\n this.car = car; // this will be a car that will allow passing between controllers.\n }", "url() {\n return this.get('editURL');\n }", "function route (path, templateId) {\n\t routes[path] = {templateId: templateId};\n\t}", "function productResource($resource) {\n return $resource(\"/api/products/:productId\")\n //The function then simply returns the $resource object giving it the URL for the products,\n //this sets up the communication with the web Server.\n }", "constructor(routeUrl) {\n\t\tsuper(routeUrl);\n\t}", "_changeUrl(url) {\n var self = this;\n self.endpoint = url;\n }", "all(_route, _f) {\n ['get', 'head', 'post', 'put', 'patch', 'delete'].forEach((_val) => {\n this._bindPathsToMap(_val, _route, _f);\n });\n }", "@action route() {\n this.currentPage = Home\n }" ]
[ "0.64842165", "0.5853986", "0.5804267", "0.5721706", "0.56035805", "0.558378", "0.5468923", "0.5458069", "0.54301167", "0.5414134", "0.53462934", "0.5308919", "0.52932906", "0.52715904", "0.52672327", "0.5242718", "0.5200405", "0.51904047", "0.51419765", "0.5109765", "0.51090676", "0.51072943", "0.5106616", "0.50958085", "0.5095042", "0.5095042", "0.5073525", "0.5073375", "0.50658345", "0.50601774", "0.50377893", "0.5017284", "0.50050384", "0.49780762", "0.49566466", "0.495601", "0.49530882", "0.49527058", "0.4932202", "0.4932202", "0.49306807", "0.4929135", "0.4918411", "0.49133128", "0.49017024", "0.48939022", "0.48893735", "0.48880994", "0.48720902", "0.48695302", "0.48639917", "0.48631835", "0.48486897", "0.48459658", "0.48452356", "0.48436376", "0.4842078", "0.48340762", "0.48340347", "0.48320454", "0.48244697", "0.4823081", "0.48130223", "0.48029828", "0.47946298", "0.47922257", "0.47851324", "0.47798514", "0.47772017", "0.4774791", "0.4769513", "0.47655907", "0.47573173", "0.47563812", "0.47534743", "0.4751769", "0.47481847", "0.47463778", "0.47421002", "0.4730953", "0.47205228", "0.47182077", "0.46727267", "0.46689805", "0.46609095", "0.46606362", "0.4653136", "0.46406612", "0.46399805", "0.46396336", "0.4631874", "0.46221307", "0.46210468", "0.46204704", "0.46167544", "0.46160957", "0.46135363", "0.46116415", "0.46077645", "0.46075544", "0.46074882" ]
0.0
-1
preload, loading all images and font
function preload(){ bunnyLeft = loadImage("bunny/assets/bunnyLeft.png"); bunnyRight = loadImage("bunny/assets/bunnyRight.png"); bunnyFront = loadImage("bunny/assets/bunnyFront.png"); bunnyBack = loadImage("bunny/assets/bunnyBack.png"); carrotimg = loadImage("bunny/assets/carrot.png"); floorimg = loadImage("bunny/assets/floor.png"); tomatoimg = loadImage("bunny/assets/tomato.png"); grassimg = loadImage("bunny/assets/grass.png"); bunnyEnd = loadImage("bunny/assets/bunnyEnd.png"); font = loadFont('bunny/assets/Adelle_Reg.otf'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preload() {\n customFont = loadFont(\"../assets/Suisse Bold.otf\");\n escargot = loadImage('img/Escargot.gif');\n soleil = loadImage('img/Soleil.png');\n lune = loadImage('img/Lune.png');\n Lapin = loadImage('img/Lapin.gif');\n}", "function preload(){\n\t\n\ttheFont = loadFont('data/font1.otf'); //font\n img = loadImage('data/Leo_city.png'); //image\n}", "function preload() {\n myFont = loadFont(FONT_URL);\n catsData = loadJSON(CATS_URL);\n\n mouse.img = loadImage(MOUSE_URL);\n fishImg = loadImage(FISH_URL);\n}", "function preload() {\n corgi = loadImage(\"assets/images/corgipic.jpg\");\n bone = loadImage(\"assets/images/dogbone.png\");\n grass = loadImage(\"assets/images/grass.png\");\n shiny = loadImage(\"assets/images/shiny.jpg\");\n land1 = loadImage(\"assets/images/land1.png\");\n land2 = loadImage(\"assets/images/land2.jpg\");\n land3 = loadImage(\"assets/images/land3.jpg\");\n myFont = loadFont(\"assets/spaceage.ttf\");\n\n\n}", "function preload() {\n grannyImg = loadImage('assets/images/granny.png');\n heartImg = loadImage('assets/images/heart_one.png');\n monsterImg = loadImage('assets/images/monster_one.png');\n font = loadFont('assets/PressStart2P-Regular.ttf');\n}", "function preload() {\n playerImage = loadImage(\"assets/images/player.png\");\n bulletImage = loadImage(\"assets/images/bullet.png\");\n enemyImage = loadImage(\"assets/images/Enemy.png\");\n myFont = loadFont(\"assets/fonts/VT323-Regular.ttf\");\n}", "function preload() {\n spritesheet = loadImage('images/Flakes1.png');\n font = loadFont('font/Freeride.otf');\n}", "function preload() {\n clownImage = loadImage(\"assets/images/happy_sunflower.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n fuzziRatImg =loadImage(\"assets/images/Rattiboi.png\");\n pceYo = loadImage (\"assets/images/handz.png\");\n slowTextFont = loadFont(\"assets/images/Dubiel.ttf\");\n\n}", "function preload() {\n tigerImage = loadImage(\"assets/images/tiger_emoji.png\");\n leopardImage = loadImage(\"assets/images/leopard_emoji.png\");\n bearImage = loadImage(\"assets/images/teddy_bear_emoji.png\");\n antelopeImage = loadImage(\"assets/images/antelope_toy.png\");\n zebraImage = loadImage(\"assets/images/zebra_toy.png\");\n beeImage = loadImage(\"assets/images/bee_toy.png\");\n backdrop = loadImage(\"assets/images/background_image_bedtop.jpg\");\n quicksand = loadFont(\"assets/Quicksand/Quicksand-Regular.otf\");\n}", "function preload() {\n bg = loadImage(\"addons/woodgrain.jpg\");\n myFont = loadFont(\"addons/Rye/Rye-Regular.ttf\");\n qFont = loadFont(\"addons/Indie_Flower/IndieFlower.ttf\");\n}", "function preload() {\n for(var i = 0;i<HOWMANYFONTS;i++)\n {\n var fontname = './data/font'+i+'.otf';\n console.log(fontname);\n thefont[i] = loadFont(fontname);\n }\n}", "function preload() {\n\n // headlineFont = loadFont('fonts/AstroSpace-0Wl3o.otf');\n headlineFont = loadFont('fonts/continuum/contm.ttf');\n bodyFont = loadFont('fonts/Ubuntu-Regular.ttf');\n endFont = loadFont('fonts/continuum/contb.ttf');\n\n // load all images\n angerImage = loadImage(\"assets/anger_emoji.png\");\n \n //allocateCharacters();\n\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "async preload({ images, sounds, sprites, fonts } = {}) {\n await Assets.load({ images, sounds, sprites, fonts }, this.onLoadProgress.bind(this));\n await Assets.prepareImages(images);\n }", "function preload() {\n inconsolata = loadFont('data/inconsolata.otf');\n DIN = loadFont('data/DIN.otf');\n coldera=loadFont('data/Coldera.otf');\n}", "function preload() {\n fontSrc[\"chakraPetch\"] = loadFont(\"Asset/Font/ChakraPetch-Medium.ttf\");\n fontSrc[\"fellEnglish\"] = loadFont(\"Asset/Font/Fell English.ttf\");\n}", "function preload () {\n acustic = loadImage (\"assets/acustic.png\");\n drums = loadImage (\"assets/drums.png\");\n flutes = loadImage (\"assets/flutes.png\");\n guitar = loadImage (\"assets/guitar.png\");\n keys = loadImage (\"assets/keys.png\");\n sax = loadImage (\"assets/sax.png\");\n tamb = loadImage (\"assets/tamb.png\");\n notes = loadImage (\"assets/notes.png\");\n pen = loadImage (\"assets/pen.png\");\n erase = loadImage (\"assets/erase.png\");\n wipe = loadImage (\"assets/wipe.png\");\n myfont = loadFont (\"assets/music.ttf\");\n}", "function preload() {\n font = loadFont ('data/FreightBigBlack.otf');\n font2 = loadFont('data/wildwordsitalic.ttf');\n}", "function preload() {\n\n // loading font\n headlineFont = loadFont('fonts/Poppins-Bold.ttf');\n bodyFont = loadFont('fonts/Poppins-Regular.ttf');\n\n // loading images\n stressSymbol = loadImage(\"assets/Stress.png\");\n\n // loading clickable and adventure managers\n clickablesManager = new ClickableManager('data/clickableLayout.csv');\n adventureManager = new AdventureManager('data/adventureStates.csv', 'data/interactionTable.csv', 'data/clickableLayout.csv');\n}", "function preload() {\n font = loadFont(firstLoadFont);\n gradient1 = loadImage('data/col1.jpg');\n gradient2 = loadImage('data/col2.jpg');\n gradient3 = loadImage('data/col3.jpg');\n gradient4 = loadImage('data/col4.png');\n gradient5 = loadImage('data/col5.jpg');\n gradient6 = loadImage('data/col6.jpg');\n}", "preload() {\n\n // loading assets\n this.load.image(\"wheel\", Utils.UrlRoot + \"minigame/wheel/wheel.png\");\n this.load.image(\"pin\", Utils.UrlRoot + \"minigame/wheel/pin.png\");\n }", "function preload() {\n alien = loadImage(\"pics/alien.png\");\n bucket = loadImage(\"pics/bucket.png\");\n bucketTop = loadImage(\"pics/bucketTop.png\");\n tennis = loadImage(\"pics/tennis.png\");\n nerf = loadImage(\"pics/nerfGun.png\");\n aim = loadImage(\"pics/target.png\");\n pipe = loadImage(\"pics/pipe.png\");\n right = loadImage(\"pics/rightpipe.png\");\n left = loadImage(\"pics/leftpipe.png\");\n pipet = loadImage(\"pics/pipet.png\");\n target = loadImage(\"pics/vector.png\");\n pipes = loadImage(\"pics/pipeh.png\");\n square = loadImage(\"pics/box.png\");\n font = loadFont(\"pics/font0.otf\");\n} //end preload", "function preload() {\n targetImage = loadImage(\"assets/wowtarget.png\");\n decoyImage1 = loadImage(\"assets/wowdog1.png\");\n decoyImage2 = loadImage(\"assets/wowsnail2.png\");\n decoyImage3 = loadImage(\"assets/wowsquirl3.png\");\n decoyImage4 = loadImage(\"assets/wowsquid4.png\");\n decoyImage5 = loadImage(\"assets/wowkitten5.png\");\n decoyImage6 = loadImage(\"assets/wowcorgi6.png\");\n decoyImage7 = loadImage(\"assets/wowfrog7.png\");\n decoyImage8 = loadImage(\"assets/wowmoth8.png\");\n decoyImage9 = loadImage(\"assets/wowhotdog9.png\");\n decoyImage10 = loadImage(\"assets/wowbird10.png\");\n myFont = loadFont(\"assets/spaceage.ttf\");\n}", "function preload() {\n tarotData = loadJSON(TAROT_DATA_URL);\n objectsData = loadJSON(OBJECT_DATA_URL);\n instrumentsData = loadJSON(INSTRUMENT_DATA_URL);\n colorsData = loadJSON(COLORS_DATA_URL);\n bomb = loadImage('assets/images/bomb.gif');\n // bomb_gif = createImg('assets/images/da-bomb.gif');\n}", "function preload() {\n fontFlameFetish = loadFont(\"https://firebasestorage.googleapis.com/v0/b/test-454bb.appspot.com/o/FlameFetish.ttf?alt=media&token=61d214fd-b336-4673-b4a8-d5ca09eabbee\");\n}", "preload()\n {\n // loading the taijitu and the particle images\n this.load.image('logo', 'src/assets/taijitu.png');\n this.load.image('red', 'src/assets/blue.png');\n }", "preload() {\n\t\tthis.load.spritesheet(\"avatar\", \"/assets/avatar.png\", {\n\t\t\tframeWidth: 48,\n\t\t\tframeHeight: 48,\n\t\t});\n\t\tthis.load.spritesheet(\"bird\", \"/assets/bird.png\", {\n\t\t\tframeWidth: 48,\n\t\t\tframeHeight: 48,\n\t\t});\n\t\tthis.load.spritesheet(\"explosion\", \"/assets/explosion.png\", {\n\t\t\tframeWidth: 55,\n\t\t\tframeHeight: 55,\n\t\t});\n\t\tthis.load.image(\"bg\", \"/assets/background.png\");\n\t\tthis.load.image(\"poop\", \"/assets/poop.png\");\n\t\tthis.load.image(\"bullet\", \"/assets/bullet.png\");\n\t\tthis.load.image(\"shoot\", \"/assets/buttons/shoot.png\");\n\t\tthis.load.image(\"navigate\", \"/assets/buttons/navigate.png\");\n\t}", "function preload()\n{\n\tcontent = new Content_Manager();\n\tcontent.preloadContent();\t\n\tloadFont(\"fonts/DancingScript-Regular.ttf\", function(font)\n\t{\n\t\tSTYLE.STORY_FONT = font;\n\t\t// FIXME: Pick a better font for the title.\n\t\tSTYLE.TITLE_FONT = font;\n\t});\n\t\n\tloadFont(\"fonts/OpenSans-Regular.ttf\", function(font)\n\t{\n\t\tSTYLE.NORMAL_FONT = font;\n\t});\n}", "function preload(){\r\n\r\n\tboy = loadImage(\"images/boy.png\");\r\n\r\n\ttreeObj = loadImage(\"images/tree.png\");\r\n\r\n }", "function preload(){\r\n\r\n\tboy = loadImage(\"images/boy.png\");\r\n\r\n\ttreeObj = loadImage(\"images/tree.png\");\r\n\r\n }", "function preload() {\n // preload() runs once\n img1 = loadImage('assets/Earth.gif');\n img2 = loadImage('assets/Jupiter.gif');\n img3 = loadImage('assets/Sun.gif');\n img4 = loadImage('assets/Player Ship.gif');\n}", "preload() {\n this.load.spritesheet(\"tree\", \"assets/tree.png\", { frameWidth: 60, frameHeight: 95 });\n this.load.image('platform', 'assets/platform.png');\n this.load.image('background', 'assets/background.png');\n this.load.spritesheet('dude', 'assets/mike-running.png', { frameWidth: 84, frameHeight: 93 });\n }", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n alienFace = loadImage(\"assets/images/alien.png\");\n skullFace = loadImage(\"assets/images/skull.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function preload() {\n for (var i = 0; i < assets.length; i++) {\n images[i] = loadImage('assets/' + assets[i]);\n }\n for (var i = 0; i < fish.length; i++) {\n fishimg[i] = loadImage('assets/' + fish[i] + '.png');\n }\n}", "function preload(){\n\n imgPlay = loadImage('assets/images/play.png');\n imgPlayCon = loadImage('assets/images/playContour.png');\n imgPause = loadImage('assets/images/pause.png');\n\n imgMouse = loadImage('assets/images/mouse.png');\n imgMouseCam = loadImage('assets/images/mouseCam.png');\n imgBulb = loadImage('assets/images/bulb.png');\n\n imgCamera = loadImage('assets/images/camera.png');\n\n mainFont = loadFont('assets/fonts/Pixellari.ttf');\n\n}", "function preload(){\n fontLight = loadFont(\"./assets/OpenSans-Light.ttf\");\n fontLItalic =loadFont(\"./assets/OpenSans-LightItalic.ttf\");\n fontRegular =loadFont(\"./assets/OpenSans-Regular.ttf\");\n fontBold =loadFont(\"./assets/OpenSans-Bold.ttf\");\n fontEBold =loadFont(\"./assets/OpenSans-ExtraBold.ttf\");\n // fetchdata();\n // setInterval(fetchdata(),10);\n}", "function preload() {\n imgFish = loadImage('assets/images/fish.png');\n imgShark = loadImage('assets/images/shark.png');\n}", "function preload(){\n\tjak = loadImage('Jak.png');\n\tdaxter = loadImage('Daxter.png');\n}", "function preload() {\n \n // Load font\n spaceFont = loadFont('spaceAge.otf');\n \n // Load planets' textures\n sunTexture = loadImage('surfaceImages/sunSurface.jpg');\n planetTextures[0] = loadImage('surfaceImages/mercurySurface.png');\n planetTextures[1] = loadImage('surfaceImages/venusSurface.jpg');\n planetTextures[2] = loadImage('surfaceImages/earthSurface.jpg');\n planetTextures[3] = loadImage('surfaceImages/marsSurface.png');\n planetTextures[4] = loadImage('surfaceImages/jupiterSurface.jpg');\n planetTextures[5] = loadImage('surfaceImages/saturnSurface.jpg');\n planetTextures[6] = loadImage('surfaceImages/uranusSurface.jpg');\n planetTextures[7] = loadImage('surfaceImages/neptuneSurface.jpg');\n}", "preload(){\n this.load.spritesheet(\"avatar\", \"/assets/avatar.png\", {\n frameWidth: 48,\n frameHeight: 48\n });\n this.load.spritesheet(\"bird\", \"/assets/bird.png\", {\n frameWidth: 48,\n frameHeight: 48\n })\n\n this.load.image(\"shit\", \"/assets/shit.png\")\n this.load.image(\"bg\", \"/assets/background.png\")\n }", "preload() {\n // this.load.image('kraken', './assets/kraken.png');\n // Loop through monster configuration and load each image\n for (let i = 0; i < MONSTERS.length; i++) {\n this.load.image(MONSTERS[i].name, `./assets/${MONSTERS[i].image}`);\n }\n this.load.image('bolt', './assets/bolt.png');\n this.load.image('door', './assets/door.png');\n // Load sound effects\n this.load.audio('hit', './assets/hit_001.wav');\n }", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n elephantImage = loadImage(\"assets/images/elephant.png\");\n pigeonImage = loadImage(\"assets/images/pigeon.png\");\n nudibranchImage = loadImage(\"assets/images/nudibranch.png\");\n}", "function preload() {\n turboImage = loadImage(\"TurboImage.png\");\n enzoImage = loadImage(\"EnzoImage.png\");\n gallardoImage = loadImage(\"GallardoImage.png\");\n viperImage = loadImage(\"ViperImage.png\");\n}", "function preload() {\n //font can be a ttf or otf\n miniver = loadFont('assets/Miniver-Regular.ttf');\n}", "function preload() {\n for (let i = 0; i < NUM_LOGO_IMAGES; i++) {\n let logoImage = loadImage(`assets/images/logo${i}.png`)\n logoImages.push(logoImage);\n }\n gamestopImage = loadImage(`assets/images/gamestop.png`)\n wallpaper = loadImage(`assets/images/wallstreet.jpg`)\n\n backgroundMusic = loadSound(`assets/sounds/effect.mp3`);\n aw = loadSound(`assets/sounds/aw.mp3`);\n}", "function preload() {\n managers.Assets.init();\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function preload() {\n managers.Assets.init();\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function preload() {\n managers.Assets.init();\n //after assets loaded, invoke init function\n managers.Assets.loader.addEventListener(\"complete\", init);\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n dogImage = loadImage(\"assets/images/dog-image.png\");\n ballImage = loadImage(\"assets/images/ball.png\");\n candyImage = loadImage(\"assets/images/candy.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function preload() {\n //Load drawing data\n drawingData = loadJSON(\"../data/drawing_data.json\");\n\n //Load sounds\n for (let i = 0; i<10; i++) {\n sounds.push(new Audio('../audio/sound' + str(i+1) + '.mp3'));\n }\n font = loadJSON('../data/font.json');\n boxes = loadJSON('../data/boxes.json');\n}", "function preload() {\n\n\t//Loaded an image inside the variable\n\thelicopterIMG = loadImage(\"helicopter.png\")\n\n\t//Loaded an image inside the variable\n\tpackageIMG = loadImage(\"package.png\")\n\n}", "function preload() {\n //spritesheets\n playerSS = loadImage('assets/collector.png');\n playerJSON = loadJSON('assets/collector.json');\n trashSS = loadImage('assets/bottle.png');\n trashJSON = loadJSON('assets/bottle.json');\n}", "function preload()\n {\n img = loadImage('images/invader.png');\n img2 = loadImage('images/huawei.png')\n sound = loadSound('Sounds/Theme.mp3');\n diesound = loadSound('Sounds/Die.mp3');\n shootsound = loadSound('Sounds/shoot.wav');\n }", "function preload(){\r\n\tBg = loadImage(\"BG.jpg\");\r\n\tboy = loadImage(\"boy.png\");\r\n }", "function preload() {\n this.load.image('background', window.bgImg);\n this.load.spritesheet('dude', window.playerImg, {frameWidth: 80, frameHeight: 111});\n this.load.image('ground', window.platImg);\n this.load.image('item', window.itemImg);\n this.load.image('enemy', window.enemyImg);\n }", "preload() {\n this.load.image('wideBarrier', 'SpriteFolder\\\\wideBarrier.png');\n this.load.image('wideBarrierNew', 'SpriteFolder\\\\wideBarrierNew.png');\n this.load.image('wideBarrierNewRed', 'SpriteFolder\\\\wideBarrierNewRed.png');\n this.load.image('bullet', 'SpriteFolder\\\\newBullet.png');\n this.load.image('ship', 'SpriteFolder\\\\ship.png');\n this.load.image('shipOutline', 'SpriteFolder\\\\shipOutline.png');\n this.load.image('squareBlock', 'SpriteFolder\\\\squareBlock.png');\n }", "function preload() {\n println(\"loading images\")\n img = [loadImage(\"./assets/AmericaFirst.png\"), loadImage(\"./assets/AuditTheVote.png\"), loadImage(\"./assets/Hillary.png\"), loadImage(\"./assets/MAGA.png\"), loadImage(\"./assets/TrumpTrain.png\")];\n\n}", "preload() {\n\t\tvar loadingLabel = game.add.text(80, 150, 'loading...', {font: '30px Courier', fill: '#ffffff'});\n\n\t\t// Load all assets. The first parameter is the variable that \n\t\t// will point to the image, and the second parameter is the \n\t\t// image file itself.\n\t\tgame.load.image('tiledBackground', 'assets/img/tiledBackground.gif');\n\t\tgame.load.image('A', 'assets/img/A.png');\n\t\tgame.load.image('E', 'assets/img/E.png');\n\t\tgame.load.image('I', 'assets/img/I.png');\n\t\tgame.load.image('O', 'assets/img/O.png');\n\t\tgame.load.image('U', 'assets/img/U.png');\n\t\tgame.load.image('questionMark1', 'assets/img/questionMark1.png');\n\t\tgame.load.image('questionMark2', 'assets/img/questionMark2.png');\n\t\tgame.load.image('questionMark3', 'assets/img/questionMark3.png');\n\t\tgame.load.image('questionMark4', 'assets/img/questionMark4.png');\n\t\tgame.load.image('speaker', 'assets/img/speaker.png');\n\t\tgame.load.image('escucha', 'assets/img/escucha.png');\n\t\tgame.load.image('avalancha', 'assets/img/avalancha.png');\n\t\tgame.load.image('restart', 'assets/img/restart.png');\n\t\tgame.load.image('lee', 'assets/img/lee.png');\n\t\tgame.load.image('home', 'assets/img/home.png');\n\t\tgame.load.image('background1', 'assets/img/background1.jpg');\n\t\tgame.load.audio('A', 'assets/audio/A.m4a');\n\t\tgame.load.audio('E', 'assets/audio/E.m4a');\n\t\tgame.load.audio('I', 'assets/audio/I.m4a');\n\t\tgame.load.audio('O', 'assets/audio/O.m4a');\n\t\tgame.load.audio('U', 'assets/audio/U.m4a');\n\t\tgame.load.audio('encuentra', 'assets/audio/encuentra.m4a');\n\n\t}", "function preload()\n{\n this.load.image('nebula', 'assets/nebula.jpg');\n this.load.image('bullet', 'assets/bullet.png');\n this.load.image('player', 'assets/thrust_ship.png');\n this.load.image('baddie', 'assets/baddie.png');\n this.load.image('baddie2', 'assets/space-baddie.png');\n this.load.image('bossbaddie', 'assets/baddie2.png');\n this.load.image('baddiebullet', 'assets/bbullet.png');\n}", "function preload() {\n soundFile = loadSound('assets/ChildishGambinoCalifornia_01.mp3');\n //soundFile = loadSound('assets/DREAMDIVISION.mp3');\n\n lrcStrings = loadStrings('assets/ChildishGambinoCalifornia_01.lrc');\n\t\n\tbassBlob = loadImage('assets/bassBlob.svg');\n\t\n\n\tmorakas = loadImage('assets/morakas.svg');\n\n\nfuturaBold = loadFont(\"assets/Futura_Bold.ttf\");\n\t\n}", "function preload() { //preload all images and files so that its there ready to use.\n back = loadImage('assets/map.PNG');\n p1 = loadImage('assets/p1.jpg');\n p2 = loadImage('assets/p2.PNG');\n p3 = loadImage('assets/p3.PNG');\n // pollutants = loadStrings('csv.csv');\n images[0] = loadImage('assets/p4.jpg');\n images[1] = loadImage('assets/p5.jpg');\n images[2] = loadImage('assets/p6.jpg');\n}", "function preload ()\r\n{\r\n this.load.image('bg', 'assets/bg.png');\r\n this.load.image('ball', 'assets/ball.png');\r\n this.load.image('wall', 'assets/wall.png');\r\n this.load.image('goal', 'assets/goal.png');\r\n this.load.image('cursor','assets/cursor.png');\r\n}", "function preload() {\n\t// Scenery\n\tqueue.loadFile({id:\"sceneryOutside\", src:sceneryOutsideSrc});\n\tqueue.loadFile({id:\"sceneryInside\", src:sceneryInsideSrc});\n\t// Animations\n\tqueue.loadFile({id:\"animation\", src:animationSrc});\n\tqueue.loadFile({id:\"slothAnimation\", src:slothAnimationSrc});\n\tqueue.loadFile({id:\"underwaterAnimation\", src:underwaterAniSrc});\n\t// Scripts\n\tqueue.loadFile(\"javascripts/waapisim.js\");\n\tqueue.loadFile(\"javascripts/flashcanvas.js\");\n\tqueue.loadFile(\"javascripts/throttle.min.js\");\n\tqueue.loadFile(\"javascripts/script.js\");\n\t// Sounds\n\tfor (var i in audioFilenames) {\n\t\tqueue.loadFile({ id: audioFilenames[i].name, src: audioSrc + audioFilenames[i].name, type:createjs.AbstractLoader.BINARY, audio: true, number: i });\n\t}\n\t// Success Screen\n\tqueue.loadFile({id:\"successSentence\", src:successSentenceSrc});\n\tqueue.loadFile({id:\"successSloth\", src:successSlothSrc});\n}", "function preload() {\n pet = loadImage('images/pet1.png');\n poo = loadImage('images/poo.png');\n tree = loadImage('images/tree.png');\n home = loadImage('images/home.png');\n food = loadImage('images/food.png');\n shop = loadImage('images/shop.png');\n friend1 = loadImage('images/pet2.png');\n friend2 = loadImage('images/pet3.png');\n shop2 = loadImage('images/shop2.png');\n shop3 = loadImage('images/shop3.png');\n shop4 = loadImage('images/shop4.png');\n\n }", "function preload() {\n beer = loadImage(\"./images/beers/texture1.png\");\n glass = loadImage(\"./images/beers/glass.jpg\");\n foamimg = loadImage(\"./images/beers/foam.jpg\");\n opening = loadSound(\"./sound/opening.mp3\");\n glug = loadSound(\"./sound/glug.mp3\");\n}", "function preload() {\r\n snowflake = loadImage(\"snowflake_large.png\");\r\n tree = loadImage(\"tree.gif\");\r\n pointerBall = loadImage(\"ball.png\");\r\n}", "function preload() {\n //fatcat_sprite_sheet = loadSpriteSheet('images/fatcat.png', 123, 112, 8);\n //hitcat_sprite_sheet = loadSpriteSheet('images/hitcat.png', 124, 116, 10);\n \n fatcat = loadImage(\"images/fatcat.png\");\n hitcat = loadImage(\"images/hitcat.png\");\n yarn = loadImage(\"images/yarn.png\");\n \n}", "preload() {\n\t\t// Load the sprites.\n this.load.image('player', 'assets/player.png');\n this.load.image('cell', 'assets/cell.png');\n this.load.image('spark', 'assets/spark.png');\n this.load.image('life', 'assets/life.png');\n this.load.image('bullet', 'assets/bullet.png');\n this.load.image('fragment', 'assets/fragments.png');\n this.load.image('line', 'assets/line.png')\n // Load the sound effects.\n this.load.audio('absorb', ['assets/absorb.mp3', 'assets/absorb.ogg']);\n this.load.audio('bullet', ['assets/bullet.mp3', 'assets/bullet.ogg']);\n this.load.audio('extend', ['assets/extend.mp3', 'assets/extend.ogg']);\n this.load.audio('gameover', ['assets/gameover.mp3', 'assets/gameover.ogg']);\n this.load.audio('laser', ['assets/laser.mp3', 'assets/laser.ogg']);\n this.load.audio('levelup', ['assets/levelup.mp3', 'assets/levelup.ogg']);\n this.load.audio('lose', ['assets/lose.mp3', 'assets/lose.ogg']);\n this.load.audio('move', ['assets/move.mp3', 'assets/move.ogg']);\n this.load.audio('ready', ['assets/ready.mp3', 'assets/ready.ogg']);\n\t}", "function preload() {\n boozy = loadImage('images/boozy.png');\n drben2 = loadImage('images/drben_2.png');\n table = loadImage('images/table.png');\n couch = loadImage('images/couch.png');\n radio = loadImage('images/radio.png');\n box = loadImage('images/donut_box.png');\n drben3 = loadImage('images/drben_3.png');\n drben1 = loadImage('images/drben_1.png');\n}", "function preload() {\n miFondo = loadImage('assets/fondo.jpg')\n miElefante = loadImage('assets/elef.png');\n miHipo = loadImage('assets/hipo.png');\n miJirafa = loadImage('assets/jirafa.png');\n miLeon = loadImage('assets/leon.png');\n miLeopardo = loadImage('assets/leop.png');\n miAvestruz = loadImage('assets/truz.png');\n miZebra = loadImage('assets/zebra.png');\n miOfondo = loadImage('assets/hola.jpg')\n}", "preload() {\n this.load.image('background', 'assets/images/background.png')\n this.load.image('arrow', 'assets/images/arrow.png')\n\n this.load.spritesheet('rooster', 'assets/images/rooster_spritesheet.png', 128, 128, 4)\n this.load.spritesheet('pig', 'assets/images/pig_spritesheet.png', 128, 128, 4)\n this.load.spritesheet('sheep', 'assets/images/sheep_spritesheet.png', 128, 128, 4)\n\n this.load.audio('roosterSound', ['assets/audio/rooster.ogg', 'assets/audio/rooster.mp3'])\n this.load.audio('pigSound', ['assets/audio/pig.ogg', 'assets/audio/pig.mp3'])\n this.load.audio('sheepSound', ['assets/audio/sheep.ogg', 'assets/audio/sheep.mp3'])\n }", "function preload() {\n imgMap = new Map();\n imgMap.set('springImg', loadImage(\"assets/raindrop.png\"), fallImage);\n imgMap.set('summerImg', loadImage(\"assets/summer.png\"), fallImage);\n imgMap.set('fallImg', loadImage(\"assets/leaf.png\"), fallImage);\n imgMap.set('winterImg', loadImage(\"assets/cloud.png\"), fallImage);\n imgMap.set('fine', loadStrings('text.txt'), fallText);\n imgMap.set('bFont', loadFont('assets/BlackHanSans-Regular.ttf'), fallFont);\n}", "function preload()\r\n\r\n{\r\n this.load.image('bg', 'assests/background.jpg'); //head\r\n this.load.image('head', 'assests/head2.png'); //head\r\n this.load.image('body', 'assests/body.png'); //body\r\n this.load.image('leg', 'assests/leg.png'); //leg + arms\r\n\r\n\r\n this.load.image('laser', 'assests/testlaser.png'); // lasers\r\n this.load.audio('plop', ['assests/plop.wav', 'assests/plop.ogg']);\r\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n imgAdded = loadImage(\"assets/images/bloobros2(1).png\");\n imgAdded2 = loadImage(\"assets/images/doggo.png\");\n imgSin = loadImage(\"assets/images/grumpycat.png\");\n}", "function preload(){ \n\t// all o the images/files/game files are loaded\n\t// once everything is loaded the create method is called\n\t// loading an image from a disk takes time, so thats why you preload \n\t\tthis.load.image('background', 'assets/images/background.png') // first just a name, then the path\n\t\t// this refers to the current object we are in\n\t\t// load refers to a loader object that phaser has \n\t\t// this.load.spritesheet('', 'assets//', 193, 71);\n\t\tthis.load.atlasJSONHash('bot', 'assets/sprites/running_bot.png', 'assets/sprites/sprites.json');\t\n\t}", "function preload() {\n\t\tgame.load.image('sky', 'assets/sky.png');\n\t\tgame.load.image('ground', 'assets/platform.png');\n\t\tgame.load.image('star', 'assets/star.png');\n\t\tgame.load.spritesheet('dude', 'assets/dude.png', 32, 48);\n\t\tgame.load.spritesheet('baddie', 'assets/baddie.png', 32, 32);\n\t\tgame.load.spritesheet('bird', 'assets/bird.png', 48, 48);\n\t\tgame.load.spritesheet('gamepad', 'assets/gamepad.png', 96, 96);\n\t\tgame.load.audio('sfx', 'assets/sfx.ogg');\n\t}", "function preload() { \n this.load.image('background', 'assets/images/background.png'); //loads up the background\n this.load.image('spike', 'assets/images/spike.png'); //loads up the spikes\n // At last image must be loaded with its JSON\n this.load.atlas('player', 'assets/images/kenney_player.png','assets/images/kenney_player_atlas.json');\n this.load.image('tiles', 'assets/tilesets/platformPack_tilesheet.png'); //loads up the tile sheet\n // Load the export Tiled JSON\n this.load.tilemapTiledJSON('map', 'assets/tilemaps/level1.json');\n\n}", "function preload() {\n f = loadFont(\"../fonts/Roboto-Regular.ttf\")\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n rainbowPixelImage = loadImage(\"assets/images/rainbow.png\");\n nyanCatImage = loadImage(\"assets/images/nyan-cat.png\");\n pixelArtRainbow = loadImage(\"assets/images/pixelrainbow.png\");\n}", "function preload() {\n cloud = loadImage(\"cloud.png\");\n raindrop = loadImage(\"raindrop.png\");\n dog = loadImage(\"dog.png\");\n}", "function preload() {\n font = loadFont(\"data/Montserrat-Bold.ttf\");\n}", "function preload() {\n this.load.image('background', 'assets/background.png');\n this.load.image('heroShip', 'assets/ships/shipgrey3.png');\n this.load.image('heroBullet', 'assets/bullets/BlueBlast001.png');\n this.load.image('droneBullet', 'assets/bullets/OrangeBlast__001.png');\n\n this.load.image('bluedrone', 'assets/drones/bluedrone1.png');\n this.load.image('greendone', 'assets/drones/greendrone.png');\n this.load.image('greydrone', 'assets/drones/greydrone1.png');\n this.load.image('purpledrone1.png', 'assets/drones/purpledrone1.png');\n this.load.image('reddrone1.png', 'assets/drones/reddrone1.png');\n}", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "function preload() //load all images before game\n{\n this.load.image('sky','./static/sky.png'); //sky\n this.load.image('ground','./static/platform.png'); //platforms\n this.load.image('star','./static/star.png'); //stars\n this.load.image('bomb','./static/bomb.png'); //bombs\n this.load.spritesheet('dude','./static/dude.png',{frameWidth:32,frameHeight:48});//main character\n //with many frames\n}", "function preload() {\n font = loadFont('assets/SourceSansPro-Light.otf');\n}", "function preload() {\n images[0] = loadImage('assets/allday.png');\n images[1] = loadImage('assets/sleep.png');\n images[2] = loadImage('assets/eat.png');\n images[3] = loadImage('assets/goout.png');\n images[4] = loadImage('assets/splash.png');\n \n}", "function preload(){\n tree = loadImage(\"assets/tree.png\"); \n bgImage = loadImage(\"assets/bgImage.jpg\");\n basket = loadImage(\"assets/Plate.png\");\n apple = loadImage(\"assets/apple.png\");\n reset = loadImage(\"assets/reset.png\");\n startImg = loadImage(\"assets/startimg.png\");\n mysound = loadSound(\"assets/drop.mp3\");\n}", "function preload() {\n //caricamento immagini\n game.load.image('sfondo', 'assets/sfondo.png');\n game.load.image('bullet', '/assets/img/bullet.png');\n game.load.image('player', '/assets/img/player.png');\n game.load.image('firstEnemy', '/assets/img/enemy_1.png');\n game.load.spritesheet('explosion', '/assets/img/explode.png', 128, 128);\n }", "function preload(){\n drain_img = loadImage(\"assets/drain.png\");\n bear_img = loadImage(\"assets/bear.png\");\n tiger_img = loadImage(\"assets/tiger.png\");\n mouse_img = loadImage(\"assets/mouse.png\");\n}", "function preload() {\n\n //create an animation from a sequence of numbered images\n //pass the first and the last file name and it will try to find the ones in between\n ghost = loadAnimation('assets/ghost_standing0001.png', 'assets/ghost_standing0007.png');\n\n //create an animation listing all the images files\n asterisk = loadAnimation('assets/asterisk.png', 'assets/triangle.png', 'assets/square.png', 'assets/cloud.png', 'assets/star.png', 'assets/mess.png', 'assets/monster.png');\n}", "function preload() {\n doveImg = loadImage('./assets/images/dove.png');\n clefImg = loadImage('./assets/images/clef.png');\n}", "function preload(){\n\timg = loadImage('Assets/Main_char1.png');\n\timg1 = loadImage('Assets/Building2.png');\n\timg2 = loadImage('Assets/Building.png');\n\timg3 = loadImage('Assets/Cloud.png');\n\timg31 = loadImage('Assets/Cloud.png');\n\timg32 = loadImage('Assets/Cloud.png');\n\timg4 = loadImage('Assets/Car.png');\n\timg5 = loadImage('Assets/Enemy.png');\n\timg6 = loadImage('Assets/Lamp.png');\n\timg61 = loadImage('Assets/Lamp.png');\n\timg7 = loadImage('Assets/Plane.png');\n\timg8 = loadImage('Assets/Churger_Bing.png');\n\timg9 = loadImage('Assets/Bottle.png');\n\timg91 = loadImage('Assets/Bottle.png');\n\timg92 = loadImage('Assets/Bottle.png');\n\timg93 = loadImage('Assets/Bottle.png');\n\timg94 = loadImage('Assets/Bottle.png');\n\timg95 = loadImage('Assets/Bottle.png');\n\tmyFont = loadFont('Assets/COMIC.ttf');\n\t//soundFormats('mp3');\n\t//sound1 = loadSound('Assets/Background.mp3');\n}", "function preload() {\n font = loadFont('data/MaisonNeueMono-Regular.otf');\n song = loadSound('data/gpsjammeroutput.mp3');\n}", "function preload(){\r\n bg =loadImage(\"cityImage.png\");\r\n balloonImage1=loadAnimation(\"hotairballoon1.png\");\r\n balloonImage2=loadAnimation(\"hotairballoon1.png\",\"hotairballoon1.png\",\r\n \"hotairballoon1.png\",\"hotairballoon2.png\",\"hotairballoon2.png\",\r\n \"hotairballoon2.png\",\"hotairballoon3.png\",\"hotairballoon3.png\",\"hotairballoon3.png\");\r\n }", "preload() {\n this.cargarMapa();\n this.cargarImagenes();\n this.cargarSpritesheets();\n this.cargarSpritePhysics();\n this.cargarAudio();\n\n this.conectarWebsocket();\n }", "function preload() {\n //load BG image of the main menu\n bgIntro = loadImage('assets/images/bgIntro.jpg');\n\n //load images of the tutorial\n tut[0] = loadImage('assets/images/bgTut01.jpg');\n tut[1] = loadImage('assets/images/bgTut02.jpg');\n\n //load fonts\n globalFont = 'Dancing Script';\n titleFont = 'Kaushan Script';\n\n //load sounds\n soundFormats('mp3', 'wav');\n bgSong = loadSound('assets/sounds/Ib_Puppet.mp3');\n twinkle = loadSound('assets/sounds/twinkle.mp3'); //effect when the snake eats a bait\n}", "function preload() {\n // load an image\n this.load.image(\"background\", \"Assets/back.jpg\");\n this.load.image(\"wheel\", \"Assets/wheel.png\");\n this.load.image(\"stand\", \"Assets/stand.png\");\n this.load.image(\"pin\", \"Assets/pin.png\");\n this.load.image(\"button\", \"Assets/spin-n-win-logo.png\");\n this.load.audio(\"wheelsound\", \"Assets/SpinwheelSound.mp3\");\n}", "preload() {\n // this.load.audio('start', './assets/start.wav');\n // this.load.audio('siren', './assets/siren.wav');\n this.load.path = \"./assets/\"\n this.load.image('logo', 'Title.png');\n this.load.image('htp', 'HTP.png');\n this.load.image('play', 'Play.png');\n this.load.image('credits', 'Credits.png');\n this.load.image('scroll1', 'Scroll1.png');\n this.load.image('scroll2', 'Scroll2.png');\n this.load.image('scroll3', 'Scroll3.png');\n this.load.audio('bugD', \"bugDeath.wav\");\n\n\n }", "preload()\r\n {\r\n this.load.image('ball', 'assets/images/ball.png');\r\n this.load.image('leftspike', 'assets/images/leftspike.png');\r\n this.load.image('wall', 'assets/images/wall.png');\r\n this.load.image('rightspike', 'assets/images/rightspike.png');\r\n }", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function preload() {\n hornS = loadSound('music/horn.mp3');\n growlS = loadSound('music/growl.mp3');\n waveS = loadSound('music/wave.mp3');\n woof = loadSound('music/woof.mp3');\n creak = loadSound('music/creak.wav');\n rainS = loadSound('music/rain.mp3');\n seaS = loadSound('music/sea.mp3');\n pianoS = loadSound('music/piano.mp3');\n catGif = loadImage(\"images/cat.gif\");\n mapPng = loadImage(\"images/map.png\");\n cloudPng = loadImage(\"images/cloud.png\");\n moonPng = loadImage(\"images/moon.png\");\n lightBeam = loadImage(\"images/lightbeam.png\");\n shipPng = loadImage(\"images/ship.png\");\n dogPng = loadImage(\"images/dog.gif\");\n fishCatPng = loadImage(\"images/fishingCat.gif\");\n danceCatPng = loadImage(\"images/danceCat.gif\");\n tentacles = loadImage(\"images/tentacles.gif\");\n catKren = loadImage(\"images/catken.gif\");\n miracleFont = loadFont(\"fonts/miracle.ttf\");\n}" ]
[ "0.8559665", "0.84288347", "0.8199454", "0.8149187", "0.8138191", "0.8025162", "0.798966", "0.79816324", "0.7980898", "0.79611945", "0.7941168", "0.78085035", "0.78082323", "0.7803746", "0.77996004", "0.7797169", "0.77665937", "0.77497417", "0.7735261", "0.77293783", "0.77198845", "0.77048993", "0.768314", "0.7672676", "0.7660256", "0.7655681", "0.7644699", "0.7638002", "0.7638002", "0.7635026", "0.7584068", "0.75810385", "0.7548556", "0.7547914", "0.7544314", "0.75442475", "0.75411546", "0.7526562", "0.75224733", "0.74932915", "0.74813443", "0.74800724", "0.74656224", "0.7464681", "0.7462852", "0.7462852", "0.7459855", "0.74551004", "0.74549645", "0.74382275", "0.7414536", "0.73988974", "0.7395761", "0.73942417", "0.73884803", "0.7387634", "0.73841083", "0.73827404", "0.7381816", "0.73811793", "0.7378813", "0.73688185", "0.7364935", "0.7363451", "0.73600847", "0.73585963", "0.735807", "0.73567575", "0.7346682", "0.7346583", "0.73460037", "0.734044", "0.73300207", "0.7320572", "0.7310258", "0.7308296", "0.73081464", "0.73035514", "0.7299899", "0.72929984", "0.72913855", "0.727655", "0.72761935", "0.7272458", "0.72717816", "0.72687507", "0.726579", "0.72650856", "0.7254432", "0.7252016", "0.7241939", "0.72418946", "0.723768", "0.72323835", "0.72307724", "0.7229539", "0.7214485", "0.7213112", "0.7208681", "0.72054535" ]
0.79432815
10
moves the spot from one end to another
move() { //if I'm going east & I hit the edge... if(this.direction === 0) { this.x += this.speed; if (this.x > (WIDTH)){ this.place() } //if I'm going west & I hit the edge... } else if(this.direction === 1) { this.x -= this.speed; if (this.x < 0) { this.place() } //if I'm going south & I hit the edge... } else if(this.direction === 2) { this.y += this.speed; if (this.y > (HEIGHT)) { this.place() } //if I'm going north & I hit the edge... }else if(this.direction === 3) { this.y -= this.speed; if (this.y < 0) { this.place() } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function move(from, to) {\n\n}", "move_to(x, y) {\n this.move(x - this.abs_x, y - this.abs_y)\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}", "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 movePiece(startStack, endStack) {\n var storage = stacks[startStack].pop();\n stacks[endStack].push(storage);\n}", "function move(array, from, to) {\n array.splice(to, 0, array.splice(from, 1)[0]);\n}", "function movePiece(startStack, endStack) {\n var piece = stacks[startStack].pop();\n stacks[endStack].push(piece);\n}", "function move(spot1, spot2)\n{\n\ttable.rows[spot1 + 2].cells[2].getElementsByClassName('pncButtonMove')[0].click();\n\n\ttable.rows[spot2 + 2].cells[2].getElementsByClassName('pncButtonHere')[0].click();\n\n\tvar a; // you need a swapping variable here, education validated!\n\ta = starters[spot1];\n\tstarters[spot1] = starters[spot2];\n\tstarters[spot2] = a;\n}", "moveNextPosition() {\n if (isNullOrUndefined(this.start)) {\n return;\n }\n if (this.isEmpty) {\n this.start.moveNextPosition();\n this.end.setPositionInternal(this.start);\n }\n this.updateForwardSelection();\n this.upDownSelectionLength = this.start.location.x;\n this.fireSelectionChanged(true);\n }", "move(start, end, blank = true) {\n if (start == end)\n return;\n if (blank) {\n this.goto(end);\n this.makeValue(0);\n }\n this.goto(start);\n this.code += `[-`;\n this.goto(end);\n this.code += `+`;\n this.goto(start);\n this.code += `]`;\n }", "returnToLastPos() {\n if (this.previousPos) {\n this.x = this.previousPos.x\n this.y = this.previousPos.y\n }\n }", "movePiece(other) {\n var pieceElement = document.getElementById('tile' + this.row + this.col).firstChild;\n other.acceptPiece(pieceElement, this.piece);\n this.piece = null;\n }", "moveNext() {\n this.current = this.current.next;\n }", "movePreviousPosition() {\n if (isNullOrUndefined(this.start)) {\n return;\n }\n if (this.isEmpty) {\n this.start.movePreviousPosition();\n this.end.setPositionInternal(this.start);\n }\n this.updateBackwardSelection();\n this.upDownSelectionLength = this.start.location.x;\n this.fireSelectionChanged(true);\n }", "function moveStartOrEnd(prevIndex,newIndex,startOrEnd) {\n\tvar newCellY = newIndex % totalCols;\n\tvar newCellX = Math.floor((newIndex - newCellY)/totalCols);\n\n\tif (startOrEnd == \"start\") {\n\t\tstartCell = [newCellX,newCellY];\n\t\tconsole.log(\"Moving start to [\"+newCellX+\",\"+newCellY+\"]\")\n\t} else {\n\t\tendCell = [newCellX, newCellY];\n\t\tconsole.log(\"Moving end to [\"+newCellX+\",\"+newCellY+\"]\")\n\t}\n\tclearBoard(keepWalls=true);\n\treturn;\n}", "function moveStartOrEnd(prevIndex,newIndex,startOrEnd) {\n\tvar newCellY = newIndex % totalCols;\n\tvar newCellX = Math.floor((newIndex - newCellY)/totalCols);\n\n\tif (startOrEnd == \"start\") {\n\t\tstartCell = [newCellX,newCellY];\n\t\tconsole.log(\"Moving start to [\"+newCellX+\",\"+newCellY+\"]\")\n\t} else {\n\t\tendCell = [newCellX, newCellY];\n\t\tconsole.log(\"Moving end to [\"+newCellX+\",\"+newCellY+\"]\")\n\t}\n\tclearBoard(keepWalls=true);\n\treturn;\n}", "function move(a, start, stop) {\r\n\r\n var len = a.length;\r\n if (start < 0) {\r\n start = start + len;\r\n }\r\n if (stop < 0) {\r\n stop = stop + len;\r\n }\r\n var temp = a[start];\r\n var i = 0;\r\n if (start < stop) {\r\n while (i < stop) {\r\n a[i] = a[i + 1];\r\n i++;\r\n }\r\n\r\n } else {\r\ni=len-1;\r\n while (i >= stop) {\r\n a[i] = a[i - 1];\r\n i--;\r\n }\r\n\r\n }\r\n a[stop] = temp;\r\n return a;\r\n}", "updatePosition(position, move) {\n position[move.to] = position[move.from];\n position[move.from] = null;\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 }", "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 }", "moveTo(point) {\n if (!this.fixed) {\n this.reset()\n this.dest = point\n }\n // this.pos = point\n // this.fixed = true\n }", "function shift(x,y){\n\tvar tail = snake.pop();\n\tplot(x,y, 2);\n\tplot(tail[0],tail[1], 0);\n\tsnake.unshift([x,y]);\n}", "moveToPreviousLine() {\n this.moveUp();\n }", "function move(oldID, newID) {\n tasks.splice(newID, 0, tasks.splice(oldID, 1)[0]);\n}", "undo(move = this.lastMove()) {\n // decouple from previous\n if (move.previous) {\n move.previous.next = undefined\n }\n // splice all next moves\n const index = move.variation.findIndex(element => {\n return element.ply === move.ply\n })\n move.variation = move.variation.splice(index)\n }", "move(x, y) {\n\n this.tr.x += x;\n this.tr.y += y;\n }", "function advanceSnake() {\n snake1.advance();\n if(snake2) snake2.advance();\n }", "move() {\n this.x = this.x - 7\n }", "function moveTop(origin, destination) {\r\n\tdestination.push(origin.pop().value);\r\n}", "move2_to_1() {\n this.toMovevertically = true;\n this._centpt.y -= 1;\n // console.log(\" Y : \"+this._centpt.y);\n if (this._centpt.y <= 80) {\n this.toMovevertically = false;\n }\n }", "function cow2() {\n if (pos == 915) { // making the cow2 as long to move\n clearInterval(id);\n window.location.href='end.html';\n } \n else {\n pos++;\n move.style.left = pos + 'px'; // cow2 started to come from left\n move.style.right = pos + 'px'; // towards right\n }\n }", "move() {\n this._offset = (this._offset + 1) % plainAlphabet.length\n }", "move( x, y, oppositeDay ) {\n var str = this.target;\n var newStr = [];\n var pos;\n var movee;\n\n if (oppositeDay) {\n [x,y]=[y,x];\n }\n\n for (var i = 0; i < str.length; i++) {\n if (i === x) {\n movee = str[i];\n } else {\n newStr.push( str[i] );\n }\n }\n\n str = newStr.join(\"\");\n newStr = [];\n\n // now insert movee into str at index Y\n for (var i = 0; i < this.target.length; i++) {\n if (i === y) {\n newStr.push( movee );\n if (str[i]) {\n newStr.push( str[i] );\n }\n } else {\n newStr.push( str[i] );\n }\n }\n\n this.target = newStr.join(\"\");\n }", "move(r, c, dr, dc) {\n this.remove(r+dr, c+dc); // kill middle soldier\n this.remove(r, c); // soldier hop start\n this.place(r+2*dr, c+2*dc); // soldier hop end\n }", "move() {\r\n this.x = this.x + this.v;\r\n }", "function updateSnakeMovement() {\n let newPos = {x: snake.history[0].x, y: snake.history[0].y};\n toBeClearedFields.push(snake.history.pop());\n if (command !== null) {\n switch (command) {\n case \"LEFT\":\n newPos.x--;\n break;\n case \"UP\":\n newPos.y--;\n break;\n case \"RIGHT\":\n newPos.x++;\n break;\n case \"DOWN\":\n newPos.y++;\n break;\n }\n }\n snake.history.unshift(newPos);\n }", "shift(delta) {\n this.start+=delta\n this.end+=delta\n }", "shift(delta) {\n this.start+=delta\n this.end+=delta\n }", "function move(input, from, to) {\n while (from < 0) {\n from += input.length;\n }\n while (to < 0) {\n to += input.length;\n }\n if (to >= input.length) {\n let k = to - input.length;\n while ((k--) + 1) {\n input.push(undefined);\n }\n }\n input.splice(to, 0, input.splice(from, 1)[0]);\n return input;\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(direction) {\r\n let parent = this.selection.parent;\r\n if (parent === null)\r\n return;\r\n let previous, next;\r\n if (direction < 0) {\r\n next = this.selection;\r\n previous = next.previous;\r\n if (previous === null)\r\n return;\r\n }\r\n else {\r\n previous = this.selection;\r\n next = previous.next;\r\n if (next === null)\r\n return;\r\n }\r\n parent.graphic.insertBefore(next.graphic, previous.graphic);\r\n parent.item.lastElementChild.insertBefore(next.item, previous.item);\r\n }", "function move(current, prev, next, shift) {\n current.setX(current.getX() + shift);\n current.getFormatterMetrics().freedom.left += shift;\n current.getFormatterMetrics().freedom.right -= shift;\n if (prev) prev.getFormatterMetrics().freedom.right += shift;\n if (next) next.getFormatterMetrics().freedom.left -= shift;\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "move1_to_2() {\n this.toMovevertically = true;\n this._centpt.y -= 1;\n // console.log(\" Y : \"+this._centpt.y);\n if (this._centpt.y <= 80) {\n this.toMovevertically = false;\n }\n }", "move (origin, destination)\n {\n if(this.checkValidMove(origin, destination)===true)\n {\n this.posting[destination-1].push(this.posting[origin-1][this.posting[origin-1].length-1]);\n this.posting[origin-1].pop();\n this.validity=true;\n }\n else\n {\n // alert('Move is not possible, either there are no disks at the origin stack, or the size of disk you are trying to put on top is greater than the bottom');\n this.validity=false;\n }\n }", "goForward() {\n const actualPosition = this.mower.position.clone();\n const nextPosition = this.getNextPositionForward(actualPosition);\n if(this.isNextPositionAllowed(nextPosition)) {\n this.updatePosition(nextPosition);\n }\n }", "function movePiece(piece, destination) {\n echiquier[destination][1] = piece\n}", "function jumpMoveback(queen, first, last) {\n if (first >= 0 && first <= 7 && last >= 0 && last <= 7) {\n var first = queen.postion.xcordinate - first;\n var last = queen.postion.ycordinate - last;\n if (first >= 0 && first <= 7 && last >= 0 && last <= 7) {\n document.write(first + \",\" + last);\n\n document.write(\"<br>\");\n queen.postion.xcordinate = first;\n queen.postion.ycordinate = last;\n return queen.postion;\n } else {\n document.write(\"out side of board\");\n }\n } else {\n document.write(\"out side of board\");\n }\n}", "function arrayMove(array, from, to) {\n array.splice(to, 0, array.splice(from, 1)[0]);\n}", "static MoveTowards() {}", "function swapPoints(a, b) {\n let tmp = a.style.top;\n a.style.top = b.style.top;\n b.style.top = tmp;\n}", "function moveElementToEnd(array, toMove) {\n let firstMatchingIndex = array.indexOf(toMove);\n if(firstMatchingIndex < 0) return array;\n for(let i=firstMatchingIndex + 1; i<array.length; i++) {\n if(array[i] !== toMove) {\n [array[firstMatchingIndex], array[i]] = [array[i], array[firstMatchingIndex]];\n firstMatchingIndex++;\n }\n }\n return array;\n }", "function moveTo(x, y, pen) {\n $._moveTo(x, -y, pen || true);\n}", "function moveElementToEnd(array, toMove) {\n \tlet left = 0;\n\tlet right = array.length - 1;\n\t\n\twhile(left < right) {\n\t\tif (array[left] !== toMove) {\n\t\t\tleft++;\n\t\t} else if (array[right] === toMove) {\n\t\t\tright--;\n\t\t} else {\n\t\t\t[array[left],array[right]] = [array[right],array[left]]\n\t\t} \n\t}\n\treturn array\n}", "move(){\n this.x = this.x + this.s;\n if (this.x > width){\n this.x = 0;\n }\n }", "Move (x, y) {\n this.previous_position = this.copy\n this.vel.x = x \n }", "function moveQueueItem(msg, args) {\n let arg1 = args.split(\" \")[0], arg2 = args.split(\" \")[1];\n if(isNaN(arg1) || isNaN(arg2))\n throw \"Invalid position.\";\n let pos1 = Number(arg1);\n let pos2 = Number(arg2);\n if(pos1 % 1 != 0 || pos2 % 1 != 0)\n throw \"Invalid position\";\n let queue = globals.connections[msg.guild.id].queue;\n if(pos1 < 2 || pos1 > queue.length || pos2 < 2 || pos2 > queue.length)\n throw \"Invalid position.\";\n msg.channel.send(\"**Song** `\" + queue[pos1 - 1].name + \"` **moved to**`\" + pos2 + \"`**.**\");\n let elem = queue[pos1 - 1];\n queue.splice(pos1 - 1, 1);\n // account for position after splice\n if(pos2 > pos1)\n queue.splice(pos2 - 2, 0, elem);\n else\n queue.splice(pos2 - 1, 0, elem);\n}", "function moveStartOrEnd(prevIndex, newIndex, startOrEnd) {\n var updatedY = newIndex % maxCols;\n var updatedX = Math.floor((newIndex - updatedY) / maxCols);\n if (startOrEnd == \"start\") {\n source = [updatedX, updatedY];\n console.log(\"Updated source is at [\" + updatedX + \", \" + updatedY + \"]\")\n } else if (startOrEnd == \"end\") {\n destination = [updatedX, updatedY];\n console.log(\"Updated destination is at [\" + updatedX + \", \" + updatedY + \"]\")\n } else if (startOrEnd == \"end1\") {\n destination1 = [updatedX, updatedY];\n console.log(\"Updated destination1 is at [\" + updatedX + \", \" + updatedY + \"]\")\n }\n\n\n clearBoard(keepWalls = true); //if we move the nodes after running the algos then it clears the board and move the nodes\n return;\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 move2(rect){\n\t\tvar temp = rect.id;\n\t\tvar temp2 = temp.split(\"-\");\n\t\tvar row = parseInt(temp2[0]);\n\t\tvar col = parseInt(temp2[1]);\n\t\tvar dx = parseInt(emptyrow - row);\n\t\tvar dy = parseInt(emptycol - col);\n\t\tif(dx == 0){\n\t\t\tvar oldY = parseInt(window.getComputedStyle(rect).top);\n\t\t\trect.style.top = oldY + 100 * dy + \"px\";\n\t\t\temptycol = emptycol - dy;\n\t\t}else{\n\t\t\tvar oldX = parseInt(window.getComputedStyle(rect).left);\n\t\t\trect.style.left = oldX + 100 * dx + \"px\";\n\t\t\temptyrow = emptyrow - dx;\n\t\t}\n\t\tvar newrow = row + dx;\n\t\tvar newcol = col + dy;\n\t\trect.id = newrow + \"-\" + newcol;\n\t}", "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 }", "backUp(n) { this.pos -= n; }", "moveToStartPos() {\n if (!this.isAtStart) {\n this.fadeX -= 2;\n this.x = this.fadeX;\n this.draw();\n }\n this.isAtStart = (this.x <= this.originalX);\n }", "moveTo() {\r\n this.move();\r\n if(this.position.x+this.width/2 > this.movingTo.x) {\r\n this.movement.x = -this.speed;\r\n this.side = false;\r\n } if(this.position.x+this.width/2 < this.movingTo.x) {\r\n this.movement.x = this.speed;\r\n this.side = true;\r\n }\r\n if(this.position.y+this.height/2 > this.movingTo.y) {\r\n this.movement.y = -this.speed;\r\n } if(this.position.y+this.height/2 < this.movingTo.y) {\r\n this.movement.y = this.speed;\r\n }\r\n }", "moveRight() {\n this.shinobiPos.x += 30\n }", "move() { }", "move() { }", "function oneMove() {\n for (var i = snake.length - 1; i >= 0; i--) {\n if (i === 0) {\n snake[0].position = createVector(offsetX, offsetY);\n } else {\n snake[i].position = createVector(snake[i - 1].position.x, snake[i - 1].position.y)\n }\n }\n}", "function testmove() {\n var ob = getObject(\"testobject\");\n var nextpos = posseq[i % posseq.length];\n ob.move(nextpos[0],\n nextpos[1],\n nextpos[2]);\n i++;\n}", "moveTo(pos) {\n let { cursor } = this, p = pos - this.offset;\n while (!this.done && cursor.from < p) {\n if (cursor.to >= pos && cursor.enter(p, 1, exports.IterMode.IgnoreOverlays | exports.IterMode.ExcludeBuffers)) ;\n else if (!cursor.next(false))\n this.done = true;\n }\n }", "function MoveForward(queen) {\n var first = queen.postion.xcordinate + 1;\n var last = queen.postion.ycordinate + 1;\n // Bonus 1 - Gotta keep her in the battle!\n if (first >= 0 && first <= 7 && last >= 0 && last <= 7) {\n document.write(first + \",\" + last);\n document.write(\"<br>\");\n queen.postion.xcordinate = first;\n queen.postion.ycordinate = last;\n return queen.postion;\n } else {\n document.write(\"out side of board\");\n }\n}", "swapPositions( x, y, oppositeDay ) {\n if (oppositeDay) {\n [x,y]=[y,x];\n }\n var str = this.target;\n var xChar = str[x];\n var yChar = str[y];\n var newStr = [];\n\n\n for (var i = 0; i < str.length; i++) {\n if (i === x) {\n newStr.push( yChar );\n } else if (i === y) {\n newStr.push( xChar );\n } else {\n newStr.push( str[i] );\n }\n }\n this.target = newStr.join(\"\");\n }", "function movePos (bullet, drop) {\n const tmpB = listItems[bullet]\n const tmpD = delBtns[bullet]\n\n /* delete old bullet then put it in new spot in array */\n listItems.splice(bullet, 1)\n delBtns.splice(bullet, 1)\n if (drop === 0) {\n listItems.splice(drop, 0, tmpB)\n delBtns.splice(drop, 0, tmpD)\n } else {\n listItems.splice(drop - 1, 0, tmpB)\n delBtns.splice(drop - 1, 0, tmpD)\n }\n}", "function movePiece(oldPosition, newPosition){\n currentState2D[newPosition[1]][newPosition[0]] = currentState2D[oldPosition[1]][oldPosition[0]] \n currentState2D[oldPosition[1]][oldPosition[0]] = 0 \n drawPieces() ; \n}", "moveTo(x, y) {\n\n this.tr.x = x;\n this.tr.y = y;\n }", "reverseMove(movement) {\n\t\tconst firstID = movement[1];\n\t\tconst secondID = movement[0];\n\t\tconst firstHexagon = this.hexagonList.get(IDToKey(firstID));\n\t\tconst secondHexagon = this.hexagonList.get(IDToKey(secondID));\n\t\tconst unit = firstHexagon.getUnit();\n\t\tfirstHexagon.setUnit(null);\n\t\tsecondHexagon.setUnit(unit);\n\t\tunit.setPosition(secondID);\n\t}", "insertAfterPart(ref){ref.__insert(this.startNode=createMarker());this.endNode=ref.endNode;ref.endNode=this.startNode;}", "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}", "insertAfterPart(ref){ref.__insert(this.startNode=createMarker());this.endNode=ref.endNode;ref.endNode=this.startNode}", "function cursorClearLoc(x,y) {\n if ((pointingAtX == x) && (pointingAtY == y)) {\n pointingAtX = -1;\n pointingAtY = -1; } }", "function swap(spot,space){\n\tvar oldSpace = [];\n\toldSpace[0]=space;\n\toldSpace[1]=spaceL;\n\toldSpace[2]=spaceT;\n\n\tconsole.log('spot '+puzzle[spot]);\n\t\n\t//console.log('wsfsads'+puzzle[spot].style.top);//=spaceT;\n\t\t//puzzle[spot].style.left=spaceL;\n\t\n\n\t\n\t//spaceL=piece.style.left;\n\t//spaceT=piece.style.top;\n\tconsole.log(space);\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 }", "moveRight() {\r\n this.actual.moveRight();\r\n }", "function moveTo(oEntity, fNewX, fNewY) {\r\n\r\n\t// new position same as old\r\n\tif (oEntity.x == fNewX && oEntity.y == fNewY) return;\r\n\r\n\t// we want to keep a certain distance to walls\r\n\tvar iMinDist = 32;\r\n\r\n\t// moving right/left, up/down?\r\n\tvar iDirX = (fNewX - oEntity.x) < 0 ? -1 : 1;\r\n\tvar iDirY = (fNewY - oEntity.y) < 0 ? -1 : 1;\r\n\r\n\t// map block coords of old position\r\n\tvar iOldX = Math.floor(oEntity.x / 64);\r\n\tvar iOldY = Math.floor(oEntity.y / 64);\r\n\r\n\t// and for new position, with added \"padding\"\r\n\tvar iNewX = Math.floor((fNewX + iMinDist*iDirX) / 64);\r\n\tvar iNewY = Math.floor((fNewY + iMinDist*iDirY) / 64);\r\n\r\n\t// and for new position with added padding * 0.5\r\n\tvar iNewX2 = Math.floor((fNewX + iMinDist*0.5*iDirX) / 64);\r\n\tvar iNewY2 = Math.floor((fNewY + iMinDist*0.5*iDirY) / 64);\r\n\r\n\tvar fMovePosX = oEntity.x;\r\n\tvar fMovePosY = oEntity.y;\r\n\r\n\r\n\t// check if it's clear diagonally, if not, stop.\r\n\tif (canMoveToBlock(iNewX2, iNewY2)) {\r\n\t\t// if we can move to the new X position, do that\r\n\t\tif (canMoveToBlock(iNewX, iOldY)) {\r\n\t\t\tfMovePosX = fNewX;\r\n\t\t}\r\n\t\t// if we can move to the new Y position, do that\r\n\t\tif (canMoveToBlock(iOldX, iNewY)) {\r\n\t\t\tfMovePosY = fNewY;\r\n\t\t}\r\n\t}\r\n\t// this isn't quite right, we should be doing a sphere vs. box intersection thing,\r\n\t// but this works for now. If you move directly into a corner, you'll be stopped,\r\n\t// but you can still move/glide along walls\r\n\r\n\toEntity.x = fMovePosX;\r\n\toEntity.y = fMovePosY;\r\n}", "move(x, y) {\n return this.x(x).y(y);\n }", "move() {\n var max = this.data.length - 1;\n if(this.cursor < max) {\n this.cursor++;\n } else if (this.cursor = max) {\n this.cursor = 0;\n }\n this.nextCursorTime = performance.now() + this.shottime;\n console.log('[CycleList move]:', this.cursor, this.nextCursorTime);\n this.clean();\n }", "function swap (position) \r\n{\r\n\tvar temp = gamePiece[position].style.top;\r\n\tgamePiece[position].style.top = spaceY;\r\n\tspaceY = temp;\r\n\ttemp = gamePiece[position].style.left;\r\n\tgamePiece[position].style.left = spaceX;\r\n\tspaceX = temp;\r\n\r\n}", "function jumpMoveForward(queen, first, last) {\n // Bonus 1 - Gotta keep her in the battle!\n if (first >= 0 && first <= 7 && last >= 0 && last <= 7) {\n var first = queen.postion.xcordinate + first;\n var last = queen.postion.ycordinate + last;\n if (first >= 0 && first <= 7 && last >= 0 && last <= 7) {\n document.write(first + \",\" + last);\n\n document.write(\"<br>\");\n queen.postion.xcordinate = first;\n queen.postion.ycordinate = last;\n return queen.postion;\n } else {\n document.write(\"out side of board\");\n }\n } else {\n document.write(\"out side of board\");\n }\n}", "moveNorth(){\n this.move ( 'N' );\n }", "function arrayMove(arr, from, to) {\n var element = arr.splice(from, 1);\n arr.splice(to, 0, element[0]);\n }", "moveUp() {\n if (this.y === 0) {\n this.y = this.tape.length - 1;\n } else {\n this.y--;\n }\n }", "function moveToDestination(destination : Vector3) {\n\tagent.SetDestination(point.position);\n}", "move(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n selection\n } = editor;\n var {\n distance = 1,\n unit = 'character',\n reverse = false\n } = options;\n var {\n edge = null\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 opts = {\n distance,\n unit\n };\n var props = {};\n\n if (edge == null || edge === 'anchor') {\n var point = reverse ? Editor.before(editor, anchor, opts) : Editor.after(editor, anchor, opts);\n\n if (point) {\n props.anchor = point;\n }\n }\n\n if (edge == null || edge === 'focus') {\n var _point = reverse ? Editor.before(editor, focus, opts) : Editor.after(editor, focus, opts);\n\n if (_point) {\n props.focus = _point;\n }\n }\n\n Transforms.setSelection(editor, props);\n }", "move(editor) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var {\n selection\n } = editor;\n var {\n distance = 1,\n unit = 'character',\n reverse = false\n } = options;\n var {\n edge = null\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 opts = {\n distance,\n unit\n };\n var props = {};\n\n if (edge == null || edge === 'anchor') {\n var point = reverse ? Editor.before(editor, anchor, opts) : Editor.after(editor, anchor, opts);\n\n if (point) {\n props.anchor = point;\n }\n }\n\n if (edge == null || edge === 'focus') {\n var _point = reverse ? Editor.before(editor, focus, opts) : Editor.after(editor, focus, opts);\n\n if (_point) {\n props.focus = _point;\n }\n }\n\n Transforms.setSelection(editor, props);\n }", "function move() {\n \n // Save the front node in a variable called Q1FrontNode\n let Q1FrontNode = Q1.front.data;\n \n // Add to the second queue.\n Q2.enqueue(\"Q2 \" + Q1FrontNode);\n \n return;\n }", "function moveB() {\n if(Pointer.dir == \"right\"){\n if(Pointer.x != 0) {\n Pointer.x--;\n }\n } else if(Pointer.dir == \"down\") {\n if(Pointer.y != 0) {\n Pointer.y--;\n }\n } else if(Pointer.dir == \"left\") {\n if(Pointer.x != 4) {\n Pointer.x++; \n }\n } else if(Pointer.dir == \"up\") {\n if(Pointer.y != 4) {\n Pointer.y++;\n }\n }\n}", "moveUpNext() {\r\n this.movement.y = -this.speed;\r\n this.move();\r\n }", "function swap(currentPosition,nextPosition,array){\n\t\tvar temp = array[currentPosition];\n\t\tarray[currentPosition] = array[nextPosition];\n\t\tarray[nextPosition] = temp;\n\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 }", "moveToPreviousLine() {\n this.currentLine = this.lines[--this.currentLineNb];\n }", "function setAfter (pipes, ai, bi) {\n // console.log(' move %s => %s', ai, bi);\n var ap = pipes[ai];\n pipes.splice(ai, 1);\n pipes.splice(bi, 0, ap);\n}" ]
[ "0.6616146", "0.64257634", "0.6387195", "0.6274731", "0.624743", "0.61776567", "0.6156826", "0.61314493", "0.6117566", "0.60838693", "0.607974", "0.6046687", "0.60423315", "0.60184747", "0.5991001", "0.5991001", "0.5931017", "0.59229505", "0.5914694", "0.58582544", "0.58538324", "0.58399004", "0.5818567", "0.581274", "0.5793187", "0.5788173", "0.57873404", "0.5782924", "0.57718223", "0.57688063", "0.5747171", "0.57449025", "0.57348675", "0.573414", "0.5731632", "0.57155216", "0.5701723", "0.5701723", "0.56916237", "0.5672453", "0.56701726", "0.5668774", "0.5668215", "0.5664667", "0.56495607", "0.56449044", "0.5644142", "0.56278664", "0.562698", "0.56204623", "0.56151783", "0.56149554", "0.5605642", "0.56028706", "0.56021494", "0.5599395", "0.55888337", "0.5585542", "0.55850637", "0.5574877", "0.55681485", "0.5568063", "0.5559969", "0.5557548", "0.55530405", "0.55526227", "0.55526227", "0.5549905", "0.5548638", "0.5540411", "0.5538924", "0.55337924", "0.55321944", "0.552642", "0.5526081", "0.55208725", "0.55198187", "0.5519338", "0.55189556", "0.551638", "0.5515274", "0.5512191", "0.5510593", "0.5506284", "0.5504131", "0.5500269", "0.54983443", "0.5496471", "0.54944134", "0.5490057", "0.54896677", "0.5485663", "0.5480286", "0.5480286", "0.5476448", "0.54716295", "0.5459876", "0.54555595", "0.5451371", "0.5451305", "0.5448674" ]
0.0
-1
repspawns the spot in a new place this could've been placed in the move class but also it's a bit wordy
place() { //decides the random direction of the spot var randomDirection = floor(random(0,4)); //alter this placement & direction based on the direction if(randomDirection === 0) { //east this.x = 0; this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement); this.direction = 0; } else if(randomDirection === 1) { //west this.x = WIDTH; this.y = (floor(random(0,3)) * (platformSize + 10) + HEIGHT/2 - movement); this.direction = 1; } else if(randomDirection === 2) { //south this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement); this.y = 0; this.direction = 2; } else if(randomDirection === 3) { //north this.x = (floor(random(0,3)) * (platformSize + 10) + WIDTH/2 - movement); this.y = HEIGHT; this.direction = 3; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function reposition() {\r\n\r\n\tif(play && isGameOver() === true) {\r\n\t\tif(verifyVacancy(DIR.down, xAxis.default)) {\r\n\t\t\ttry {\r\n\t\t\t\tmoveTo(block, DIR.down, xAxis.default);\r\n\t\t\t\tsetThePositions(currentRow, currentColl, nextRow - xAxis.default, nextColl + DIR.down);\r\n\t\t\t} catch(err) {\r\n\t\t\t\tconsole.log(err);\r\n\t\t\t}\r\n\t\t\tdeleteLastPosition();\r\n\t\t} else {\r\n\t\t\tblock.className = 'positioned-block';\r\n\t\t\tmatrix[currentRow][currentColl] = 1;\r\n\t\t\tresetPositions();\r\n\t\t\tclearInterval(movingBlock);\r\n\t\t\tstart();\r\n\t\t}\r\n\t} else {\r\n\t\tclearInterval(movingBlock);\r\n\t\tplay = true;\r\n\t}\r\n}", "respawn() {\n this.initRandomPosition()\n }", "movePiceToPosition(_newPosition) {\n // debugger;\n console.log(this.position.getPosX());\n //remove the img from the current Position to the new Pos\n this.removePice();\n\n //assign chess Pice to new Pos\n let s = document.getElementById(`tile${_newPosition.getPosX()},${_newPosition.getPosY()}`);\n let img = document.createElement(`img`);\n img.src = `img/${this._name}.png`;\n s.appendChild(img);\n\n // debugger;\n //assign the current Pos to new Position\n let last_piece = -1;\n for (let i = 0; i < Player.arr.length; ++i) {\n let [x, y, obj] = Player.arr[i];\n if (x == this.position.getPosX() && y == this.position.getPosY()) {\n // debugger;\n last_piece = i;\n break;\n }\n last_piece = -1;\n }\n // debugger;\n if (last_piece !== -1) {\n Player.arr[last_piece] = [_newPosition.getPosX(), _newPosition.getPosY(), Player.arr[last_piece][2]];\n // debugger;\n \n this.setPosition(_newPosition);\n // this.position = _newPosition;\n }else{\n alert(\"error in moving from chesspiece\");\n }\n\n\n }", "placePiece(x,y,piece) {\n\n }", "function assignNewPosition() {\n\tvar pos = {};\n\tdo {\n\t\tpos.x = Math.floor(Math.random() * gridW);\n\t\tpos.y = Math.floor(Math.random() * gridH);\n\t} while (filledPositions[pos.x][pos.y]);\n\t\n\tfilledPositions[pos.x][pos.y] = true;\n\t\n\tpos.x=pos.x*40+30+Math.floor(Math.random()*26-13);\n\tpos.y=pos.y*40+30+Math.floor(Math.random()*26-13);\n\t\n\treturn pos;\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 }", "placePiece() {\r\n this.createPiece();\r\n this.nextPieceF();\r\n // Add score for placing. 36 because why not\r\n this.score += 36;\r\n }", "respawn(){\n this.x = random(this.minX + this.width/2, this.maxX - this.width/2);\n this.y = random(this.minY + this.height/2, this.maxY - this.height/2);\n }", "function makeMove() {\n grid = makeAMove(grid);\n myMove = false;\n updateMove();\n}", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\n this.x = this.x + random(-10,10);\n this.y = this.y + random(-10,10);\n }", "move(){\n this.x=this.x+random(-3,3)\n this.y=this.y+random(-3,3)\n }", "function move() {\n\t\tmovePiece(this);\n\t}", "respawn(){\n this.x = this.orgX;\n this.y = this.orgY;\n let ang = random(-PI / 4, PI / 4) + (random(1) > 0.5 ? 0 : PI);\n this.xspeed = cos(ang) * this.speed;\n this.yspeed = sin(ang) * this.speed;\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function repositionGameItem(){\n //move the box to a new X position \n positionX += speedX; //update the x position \n$(\"#gameItem\").css(\"left\", positionX); //redraws according to y coordinategit push\n\n //move the box to a new Y position\n positionY += speedY; //update the y position\n $(\"#gameItem\").css(\"top\", positionY); //redraws according to y coordinate\n }", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "function onSpawn() {\n while(true) {\n pet.moveXY(48, 8);\n pet.moveXY(12, 8);\n }\n}", "placePieceAt(y , x , row , col, boardArr) {\n var piece = game.addSprite(game.startingX + x*game.squareSize*3 + col*game.squareSize, game.startingY + y * game.squareSize*3 + row*game.squareSize, 'O');\n \n game.board[y][x][row][col] = \"o\"\n game.previousPiece = \"o\";\n }", "function moveTile() {\n moveTileHelper(this);\n }", "function newMove() {\n game.currentGame.push(game.possibilities[Math.floor(Math.random()*4)]);\n showMoves();\n }", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "move() {\n\n }", "sendToStartPos() {\n this.x = this.spawnX;\n this.y = this.spawnY;\n }", "move() {\n }", "respawn(){\r\n\t\tthis.sendNick(true);\r\n this.spawn();\r\n\t}", "move() { }", "move() { }", "respawnFantasma(fantasma){\n fantasma.position.set(this.fantasmaSpawn.x, 0, this.fantasmaSpawn.z);\n this.spawnFantasma(fantasma);\n }", "function moveObject(dy, dx, objectType) {\n\n /* Set objY/objX to player's */\n var objY = gPlayerPos[0];\n var objX = gPlayerPos[1];\n\n /* If object is in fact a crate instead of player, \n * add dy/dx to get its position*/\n if (objectType == \"crate\") {\n objY += dy;\n objX += dx;\n }\n\n /* If the target tile is blocked - return */\n switch (gMap[objY + dy][objX + dx]) {\n case 1: case 2: case 3: case 4: case 5: return; break;\n }\n\n /* Remove object from old tile */\n switch(gMap[objY][objX]) {\n case 2: case 4: gMap[objY][objX] = 0; break;\n case 3: case 5: gMap[objY][objX] = 6; break;\n }\n\n /* Redraw if player \n * if it's a crate, the player will soon move there anyways */\n if (objectType == \"player\")\n redrawTile(objY, objX);\n\n /* Move the object */\n objY += dy;\n objX += dx;\n\n /* Add object to new tile */\n switch (gMap[objY][objX]) {\n case 0: gMap[objY][objX] = objectType == \"crate\" ? 2 : 4; break;\n case 6: gMap[objY][objX] = objectType == \"crate\" ? 3 : 5; break;\n }\n\n /* Redraw tile */\n redrawTile(objY, objX);\n\n /* If object is player, update gPlayerPos */\n if (objectType == \"player\")\n gPlayerPos = [objY, objX];\n\n /* If object is crate, check if we've won */\n else if (objectType == \"crate\")\n if (gMap[objY][objX] == 3) {\n for (var y = 0; y < gMap.length; y++)\n for (var x = 0; x < gMap[y].length; x++)\n if (gMap[y][x] == 2) return;\n newGame(++gLevelNumber);\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}", "move() {\n this.x += random(-5, 5);\n this.y += random(-5, 5);\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 }", "move() {\n\n this.reset();\n\n const x = Math.floor(Math.random() * SnakeGame.NUM_COLS);\n const y = Math.floor(Math.random() * SnakeGame.NUM_ROWS);\n this.position = { x, y };\n\n this.cell = this.game.boardCells[y][x];\n\n if(this.cell.classList.contains('snake')) {\n move();\n }\n\n this.cell.classList.add('food');\n\n }", "function move(pos) { //actual move\r\n if(turn == 0 && canPlace(gameBoard, pos, huPlayer, aiPlayer)) { //checks if it is humans turn and he/she can place a tile\r\n gameBoard = updateBoard(gameBoard, pos, huPlayer, aiPlayer); //updates the board\r\n\r\n round += 1; //one more spot is gone\r\n\r\n //checks if each player can make a move, starting with the opposite player, else the game is over\r\n if(canMove(gameBoard, aiPlayer, huPlayer)) {\r\n turn = 1;\r\n } else if(canMove(gameBoard, huPlayer, aiPlayer)) {\r\n turn = 0;\r\n } else {\r\n display();\r\n setTimeout(function(){ gameOver(); }, 1000);\r\n return; //exits the function\r\n }\r\n\r\n } else if(turn == 1 && canPlace(gameBoard, pos, aiPlayer, huPlayer)) { //same as above, checks if the ai can go\r\n gameBoard = updateBoard(gameBoard, pos, aiPlayer, huPlayer); //updates the board\r\n\r\n round += 1; //one more spot is gone\r\n\r\n //checks if each player can make a move, starting with the opposite player, else the game is over\r\n if(canMove(gameBoard, huPlayer, aiPlayer)) {\r\n turn = 0;\r\n } else if(canMove(gameBoard, aiPlayer, huPlayer)){\r\n turn = 1;\r\n } else {\r\n display();\r\n setTimeout(function(){ gameOver(); }, 1000);\r\n return; //exits the function\r\n }\r\n }\r\n\r\n if(round == 64) { //if all the spots are taken, the game is over\r\n display();\r\n setTimeout(function(){ gameOver(); }, 1000);\r\n }\r\n\r\n display(); //displays the board\r\n}", "moveFood(){\n\n\t\t\tlet placeFood = false;\n\t\t\twhile(!placeFood){\n\t\t\t\tlet x = Math.floor(Math.random() * (w-2)) + 1;\n\t\t\t\tlet y = Math.floor(Math.random() * (h-2)) + 1;\n\t\t\t\tthis.position = new Roles(x,y);\n\t\t\t\tplaceFood = true;\n\t\t\t\tfor(let i = 0; i < snakeObj.growth.length; ++i){\n\t\t\t\t\tif(this.position.x == snakeObj.growth[i].x && this.position.y == snakeObj.growth[i].y){\n\t\t\t\t\t\tplaceFood = false;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\t\n\t\t}", "PlaceAtPosition( NewPos ) {\n this.m_vPosition = new Vector2D( NewPos );\n\n this.m_vOldPos = new Vector2D( this.m_vPosition );\n\n this.m_vVelocity.Zero();\n }", "function newPosition() {\n $(\"#fish2Id\").stop(true);\n var height = $(window).height() - $(\"#fish2Id\").height();\n var width = $(window).width() - $(\"#fish2Id\").width();\n var newHeight = Math.floor(Math.random() * height);\n var newWidth = Math.floor(Math.random() * width);\n var newDimensions = [newHeight, newWidth];\n $(\"#fish2Id\").animate({\n top: newDimensions[0]\n , left: newDimensions[1]\n });\n window.setTimeout(movementBlue, 500);\n}", "resetPosition() {\n this.x = this.posX[Math.floor(Math.random() * this.posX.length)];\n this.y = this.posY[Math.floor(Math.random() * this.posY.length)];\n }", "newPosition(x, y)\n {\n this.x = x;\n this.y = y;\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 }", "placePiece(pos, color) {\n if( !this.validMove(pos, color) || this.isOccupied(pos) ) {\n throw new Error(\"Invalid Move\");\n }\n this.grid[pos[0]][pos[1]] = new Piece(color);\n Board.DIRS.forEach(dir => {\n let flipPositions = [];\n flipPositions = _positionsToFlip(this, pos, color, dir, flipPositions);\n if(flipPositions instanceof Array && flipPositions.length > 0) {\n flipPositions.forEach(flipPos => {\n let flipPiece = this.getPiece(flipPos);\n if( flipPiece instanceof Piece) {\n flipPiece.flip();\n }\n });\n }\n });\n }", "moveTo(row, col, piece) {\r\n this.fillAt(piece.row, piece.col, null);\r\n this.fillAt(row, col, piece);\r\n }", "moveTo(pos) {\n moving++;\n let actual_pos = {\n x: pos.x,\n y: pos.y,\n }\n let speed = {\n x: (this.x - actual_pos.x) / 12,\n y: (this.y - actual_pos.y) / 12,\n }\n\n let self = this;\n let c = 0;\n\n let operation = () => {\n drawSquares();\n self.x -= speed.x;\n self.y -= speed.y;\n if (c >= 12) {\n self.x = actual_pos.x;\n self.y = actual_pos.y;\n moving--;\n }\n else {\n \n setTimeout(operation, 15);\n c++;\n }\n \n \n \n};\n setTimeout(operation, 15);\n }", "function movePiece(oldPosition, newPosition){\n currentState2D[newPosition[1]][newPosition[0]] = currentState2D[oldPosition[1]][oldPosition[0]] \n currentState2D[oldPosition[1]][oldPosition[0]] = 0 \n drawPieces() ; \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}", "spawnearPacman(){\n this.deletePacman();\n\n this.pacman = new PacMan(this.game.getPacmanSpeed());\n this.pacman.scale.set (0.1, 0.1, 0.1);\n this.add(this.pacman);\n\n this.pacman.position.set(this.pacmanSpawn.x, 0, this.pacmanSpawn.z);\n }", "initialSpawn() {\n\n if (this.spawns) {\n _.each(this.spawns, (spawn, spawnCoord) => {\n\n spawnCoord = parseInt(spawnCoord, 10);\n if (!_.isFinite(spawnCoord)) throw Err(`spawnCoord not a number: ${spawnCoord}`);\n\n const npc = _.find(Resources.npcs, (n) => n.sheet === spawn.id);\n if (!npc) { throw Err(`Could not find spawn unit: ${spawn.id}`); }\n\n const localY = parseInt(spawnCoord / Env.pageWidth, 10),\n localX = spawnCoord % Env.pageWidth;\n\n const entity = new Movable(npc.id, this, {\n position: {\n global: {\n x: (this.x + localX) * Env.tileSize,\n y: (this.y + localY) * Env.tileSize\n }\n }\n });\n\n this.Log(`Spawning spawn[${spawn.id}] at: (${localX}, ${localY})`, LOG_DEBUG);\n this.area.watchEntity(entity);\n this.addEntity(entity);\n });\n }\n }", "move() {\n\t\tthis.x = this.x + random(-2, 2);\n\t\tthis.y = this.y + random(-2, 2);\n\t\tthis.width = this.width + random(-3, 3);\n\t\tthis.height = this.height + random(-3, 3);\n\t}", "function spawnLocation(xPos, yPos) {\n \n return { x: xPos, y: yPos };\n\n}", "move(x,y){\n this.position.x += x;\n this.position.y += y;\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 }", "placeRandomTile(tile) {\n let pos = this.floor.get(randInt(this.floor.length));\n this.tiles[pos.y][pos.x] = tile;\n this.removeRadius(pos.x, pos.y, 1);\n this.placeStatue(pos.x, pos.y);\n }", "move () {\n }", "updatePosition(position, move) {\n position[move.to] = position[move.from];\n position[move.from] = null;\n }", "function Place(x, y, piece){\r\n\tstate.board[y][x] = piece;\r\n}", "function setMove(which){\t\t\n\tmover = which;\n\t//get the last position of the thing... (NOW through the transform=translate(x,y))\n\txy=getTransform(which);\n\n\tmyX=xy[0];\n\tmyY=xy[1];\n\t//get the object then re-append it to the document so it is on top!\n\tgetPiece(which).putOnTop(which);\n}", "placePiece(row, square) {\n let piece = this.piece;\n this.board[row][square] = this.piece;\n if ( this.checkForWin(row, square, piece) ) {\n return true;\n }\n this.togglePiece();\n return;\n }", "update() {\n this.moveNinja();\n }", "setRandomSpawnPoint() {\n // leer\n }", "function makeMove(x:int,y:int) {\n\temptySpace -= 1;\n\tcheckVictory(x,y);\t//only need to check for chains made possibly at (x,y)\n\t//Switch the current player.\n\tif (currentPlayer == 1){\n\t\tcurrentPlayer = 2;\n\t} else {\n\t\tcurrentPlayer = 1;\n\t}\n}", "function teleport(AIMap)\n {\n var i, j;\n do\n {\n i = randomintAtoB(1,GRIDSIZE-2);\n j = randomintAtoB(1,GRIDSIZE-2);\n }\n while ( occupied(i,j) && GRID[i][j] != GRID_BLANK); \t // search for empty square\n\n //set old i and j to null\n AIMap['oldI'] = null;\n AIMap['oldJ'] = null;\n\n //set new position\n AIMap['i'] = i;\n AIMap['j'] = j;\n\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 var dirx = Math.random() > 0.5 ? 1 : -1;\n var diry = Math.random() > 0.5 ? 1 : -1;\n var L = int((Math.random() * 20));\n var L2 = int((Math.random() * 20));\n this.endx = this.posx + (L * dirx);\n this.endy = this.posy + (L2 * diry);\n }", "function repositionAndRedrawSnakeHead(){\n snakeHead.x += snakeHead.speedX;\n snakeHead.y += snakeHead.speedY;\n drawObject(snakeHead);\n }", "function movePiece(piece, moveBy) {\n currentSpace = 2;\n targetSpace = currentSpace + moveBy;\n piece = document.getElementById(piece);\n piece.remove()\n targetSpace = document.querySelector(`#space${targetSpace} .container`);\n targetSpace.appendChild(piece);\n} //figure out how to get your current piece location and modify thos function so it moves.", "function newFrame() {\n //update position of game item for animation \nrepositionGameItem();\n//check for collision \n \n }", "function moveSprite() {\n\tconst position = getPosition();\n\tposition.appendChild(spriteImg);\n}", "move(foodLocation) {\n this._setNewSpeed();\n\n let temp = Object.assign({}, this.positions[0]);\n\n temp.x += this.speed.xspeed;\n temp.y += this.speed.yspeed;\n\n if (this.positions\n .filter(pos => pos.x === temp.x && pos.y === temp.y).length > 0 ||\n temp.x < 0 || this.boardWidth <= temp.x ||\n temp.y < 0 || this.boardHeight <= temp.y\n ) {\n this.gameOver = true;\n }\n if (this.gameOver) return;\n\n\n this.positions.unshift(temp)\n\n let distToFood = Math.sqrt(\n Math.pow(this.positions[0].x - foodLocation.x, 2) +\n Math.pow(this.positions[0].y - foodLocation.y, 2)\n );\n if (distToFood === 0) {\n return true;\n } else {\n this.positions.pop();\n return false;\n }\n }", "placeNewTile(board) {\n const emptyTiles = this.getEmptyTiles(board)\n const indices = emptyTiles[Math.floor(Math.random() * emptyTiles.length)]\n\n board[indices[0]][indices[1]] = Math.random() < 0.5 ? 2 : 4\n\n return board\n }", "function placePawns(event) {\n const tile = event.target;\n if (!tile.classList.contains(\"tile\")) return;\n if (!checkIfMoveIsAllowed(tile)) {\n displayGameInstruction(currentPlayerId, \"tileOccupated\");\n } else {\n const { x, y } = tile.dataset;\n const pawn = {\n pawnId: pawnPlacementCounter,\n position: { x, y },\n player: currentPlayerId,\n };\n pawns.push(pawn);\n board[x][y].pawn = pawn;\n updateBoard();\n placedPawnHighlit();\n if (pawns.length == 4) {\n gameContainer.removeEventListener(\"click\", placePawns);\n gameContainer.removeEventListener(\"mousemove\", highlitTile);\n changePlayerId();\n displayGameInstruction(currentPlayerId, \"movePawn\");\n choosePawn();\n gamePhase = \"pawnMove\";\n } else {\n changePlayerId();\n displayGameInstruction(currentPlayerId, \"placePawn\");\n }\n }\n}", "place_piece(index) {\n this.board_spaces[index].place_piece(this.selected_piece.get_top(), this.selected_piece.remove_top());\n //clear the selected piece\n for (let i = 0; i < this.board_spaces.length; i++) {\n this.board_spaces[i].selected = false;\n }\n for (let i = 0; i < this.reserve_spaces.length; i++) {\n this.reserve_spaces[i].selected = false;\n }\n this.selected_piece = null;\n //todo use modules or something smarter here\n if (this.current_player === 1) {\n this.current_player = 2;\n } else {\n this.current_player = 1;\n }\n this.check_winner()\n }", "function spawnLocation() {\n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = (height - 40) / tileSize;\n let xPos, yPos;\n let overlap = false;\n // To prevent an overlap of the food/barrier and the snake's body.\n do {\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n overlap = elementsOverlap({ x: xPos, y: yPos });\n } while (overlap);\n return { x: xPos, y: yPos };\n}", "function movePiece() {\n var userClick = b.cell(this).where();\n\n if (bindMoveLocs.indexOf(userClick)) {\n b.cell(userClick).place(bindMovePiece);\n\n console.log(b.cell(this).get());\n var piecename = b.cell(this).get();\n socket.emit('piece move', {\n loc: userClick,\n piece: piecename\n });\n resetBoard();\n }\n}", "function changeLoc() {\n swap(locs, 0, floor(random(1, numlocs)));\n}", "function moveByPawn(sel,targ) {\n var moveCount = 0;\n var location = parseInt(targ.id)\n var originalLoc = parseInt(sel.parentElement.id)\n // check if the piece is white so the logic works for both ends of the board since we are not working with a 2d Array\n if (sel.classList.contains('w_piece')) {\n if(sel.classList.contains('original')){\n if(targ.innerHTML == ''){\n moveCount++\n if ((location + 16)/moveCount == originalLoc || (location + 8)/moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n sel.classList.remove('original')\n }else {\n console.log('I cannot move here!')\n }\n }else{\n console.log('handle capturing')\n }\n \n }else{\n if(targ.innerHTML == ''){\n moveCount++\n if ((location + 8)/moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n }else {\n console.log('I cannot move here!')\n }\n }\n }\n }else {\n if(sel.classList.contains('original')){\n if(targ.innerHTML == ''){\n moveCount++\n if ((location - 16)*moveCount == originalLoc || (location - 8)*moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n sel.classList.remove('original')\n }else {\n console.log('I cannot move here!')\n }\n }else{\n console.log('handle capturing')\n }\n \n }else{\n if(targ.innerHTML == ''){\n moveCount++\n if ((location - 8)*moveCount == originalLoc) {\n console.log('This can move here!')\n targ.appendChild(sel)\n }else {\n console.log('I cannot move here!')\n }\n }\n }\n } \n}", "function move()\n{\n\n}", "function makeRandomMove() {\n log(\"stockfish made a random move\", \"stockfish\");\n var moves = board.moves({ verbose: true });\n var move = moves[Math.floor(Math.random() * moves.length)];\n board.move(move);\n highlightLastOpponentMove({ from: move.from, to: move.to });\n updateBoardUI();\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 makeMove(){\n miniMax(boardState, 'computer');\n boardState[computerMove] = 2;\n $('#p' + computerMove).html(computer);\n $('#' + computerMove).css('pointer-events', 'none');\n if(checkWin(boardState) === 2){\n showWin();\n } else if(checkWin(boardState) === 3){\n $('.square').css({'background' : '#BDBDBD', 'border-color' : '#BDBDBD'});\n wait = window.setTimeout(function(){\n $('#message').html('Tie! <br>Play Again?');\n $('.board').css('opacity', 0.2);\n $('.pop-up').css({'opacity' : '1', 'pointer-events' : 'auto'});\n }, 1000);\n }\n }", "run() {\n this.spawns();\n this.move();\n this.draw();\n }", "teleportSpawn() {\n\n //Use the moveTank function to adjust also the position of the bounding boxes (collision and hit bounding boxes).\n this.moveTank(new BABYLON.Vector3(this.spawnPoint.x, this.spawnPoint.y, this.spawnPoint.z));\n return;\n }", "function move() {\r\n\t\r\n}", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "newPos() {\n this.x += this.speedX;\n this.y += this.speedY + this.gravity;\n this.hitBottom();\n this.update();\n }", "move(r, c, dr, dc) {\n this.remove(r+dr, c+dc); // kill middle soldier\n this.remove(r, c); // soldier hop start\n this.place(r+2*dr, c+2*dc); // soldier hop end\n }", "function spawnPiece() {\n\n var rand = Math.floor(Math.random() * (pieces.length));\n var type = pieces[rand];\n var o = Math.floor(Math.random() * type.length);\n var p = type[o];\n var location = [];\n var ranLoc = Math.floor(Math.random() * 7);\n startCol = 3+ranLoc;\n for (var i = 0; i < p.length; i++) {\n location[i] = new Array(2);\n location[i][0] = p[i][0] + startRow;\n location[i][1] = p[i][1] +startCol ;\n }\n var end = false;\n\nactive = new Piece(type,o,location,rand);\nactive = new Piece(type,o,location,rand);\n piece2Grid();\n\n\n\n}", "moveNorth(){\n this.move ( 'N' );\n }", "function processMove(){\n\t\tmyTile.pop();\n\t\ttryTile.push(obj);\n\t\tobj.move(x, y);\n\t\tmapGroup.addChild(obj);\n\t\treturn true;\n\t}", "function spawnApple() {\n var x = Math.floor(Math.random() * 10);\n var y = Math.floor(Math.random() * 10);\n var apple = new Position(x, y);\n\n //Make sure the apple is not within the body or head, and respawn if it is.\n var respawn = false;\n if (apple.xPos == headPos.xPos && apple.yPos == headPos.yPos) respawn = true;\n for (var i = 0; i < bodyPos.length; i++) {\n if (apple.xPos == bodyPos[i].xPos && apple.yPos == bodyPos[i].yPos) respawn = true;\n }\n if (respawn) {\n apple = spawnApple();\n }\n\n //Make the apple appear in the correct position.\n $(\"#apple\").css({\"top\":apple.yPos * 40 + topStart + 'px',\"left\":apple.xPos * 40 + leftStart + 'px'});\n\n return apple;\n}", "function drawPlayerPositions() {\r\n for(var i = 0; i < players.length; i++){\r\n var player = players[i];\r\n var x = Math.floor(Math.random() * 5);\r\n var y = Math.floor(Math.random() * 5);\r\n var tile = gameBoard[x][y];\r\n if (player.role === \"Pilot\"){\r\n x = helipadX;\r\n y = helipadY;\r\n tile = gameBoard[x][y];\r\n }else{\r\n while(tile.state === \"sunk\" || tile.children.length > 0 || x == helipadX || y == helipadY){\r\n x = Math.floor(Math.random() * 5);\r\n y = Math.floor(Math.random() * 5);\r\n tile = gameBoard[x][y];\r\n }\r\n }\r\n tile.addChild(player.sprite);\r\n player.x = x;\r\n player.y = y;\r\n player.initValidActionTiles();\r\n player.calculateValidMoveTiles(player.x, player.y, player.validMoveTiles);\r\n player.calculateValidNavigatorTiles();\r\n player.calculateValidShoreTiles();\r\n player.calculateValidGiveTargets();\r\n }\r\n}", "move(){\r\n if(!clydeActive){\r\n this.ttl--;\r\n if(this.ttl<=0){\r\n this.kill();\r\n }\r\n }if(this.checkPosition()&&this.vel.mag()!=0){//checks if pacman is facing a wall\r\n this.stopTimer = 0;\r\n this.pos.add(this.vel);\r\n //this.pos.add(this.vel);//repeat it for each time it has been upscaled, 2x for 1080p\r\n }else{\r\n this.stopTimer++;\r\n if(this.stopTimer>100){\r\n this.kill();\r\n }\r\n }this.lifespan++;\r\n }", "function placeShip(ship, board)\r\n{ \r\n var rNum = getRandomNumber();\r\n var rX = Math.floor(rNum/10) ;\r\n var rY = rNum%10 ;\r\n var dir = rNum%2 ; // If rNum is even => horizontal else vertical.\r\n /*Get the inclusive final co-ordinate .. not exclusive.*/\r\n var rX1 = (dir==0)? (rX+ship.width -1) : (rX) ;\r\n var rY1 = (dir==1)? (rY+ship.width -1) : (rY) ;\r\n var retry= false;\r\n var i, j ;\r\n /* If ships new positions cross boudaries */\r\n if((dir == 0 && (ship.width + rX) > 9)||(dir == 1 && (ship.width + rY) > 9))\r\n {\r\n // alert(\"peice goes out of arena \");\r\n retry = true ;\r\n }\r\n /* If ship overlaps with a present ship.*/\r\n else\r\n {\r\n for(i = rX ; i <= rX1 ; i++)\r\n {\r\n for(j = rY ; j <= rY1 ; j++)\r\n {\r\n // alert(\"peice overlaps with another \");\r\n retry = (board[i][j]==1)? true : false ;\r\n }\r\n }\r\n }\r\n if(retry)\r\n {\r\n // alert(\"going recursion \");\r\n /* Go recursively until you find a right place */\r\n placeShip(ship, board);\r\n }\r\n else\r\n {\r\n // alert(\"peicing the board\");\r\n for(i = rX ; i <= rX1 ; i++)\r\n {\r\n for(j = rY ; j <= rY1 ; j++)\r\n {\r\n board[i][j] = 1 ;\r\n }\r\n }\r\n ship.x1 = rX ; ship.y1 = rY ; ship.x2 = rX1 ; ship.y2 = rY1 ;\r\n // alert(\"placed \"+ship.name+\" at x1 = \"+rX+\" ; y1 = \"+rY+\" ; x2 = \"+\r\n // rX1+\" ; y2 = \"+rY1+\" ; width = \"+ship.width );\r\n }\r\n return ship ;\r\n}", "function make_move() {\n\n // get state of board this turn\n var board = get_board(),\n\n // get my position\n myX = get_my_x(),\n myY = get_my_y(),\n\n // get opponents position\n hisX = get_opponent_x(),\n hisY = get_opponent_y();\n\n get_current_counts();\n\n // if we found an item and it isn't dead\n if (board[myX][myY] > 0 && !deadFruits[board[myX][myY]]) {\n return TAKE;\n }\n\n var rand = Math.random() * 10;\n\n if (rand < 1) return NORTH;\n if (rand < 2) return SOUTH;\n if (rand < 3) return EAST;\n if (rand < 4) return WEST;\n\n return move_toward(hisX, hisY);\n}", "resetPos(){\n this.addX(this.getX());\n this.addY(this.getY());\n }", "function move() {\n\tvar radius = 50;\n\tvar x = Math.floor(Math.random() * radius - radius/2);\n\tvar y = Math.floor(Math.random() * radius - radius/2);\n\n\tsendMove (\"move\",x,y)\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}", "function randomlyPlace( obj ) {\n var i = Math.floor( Math.random() * gridSize );\n var j = Math.floor( Math.random() * gridSize );\n\n //if we picked an unwalkable/occupied cell, reroll\n while( grid[i][j].walkable == false || grid[i][j].occupiedBy != null ) {\n var i = Math.floor( Math.random() * gridSize );\n var j = Math.floor( Math.random() * gridSize );\n }\n\n grid[i][j].occupiedBy = obj;\n obj.x = grid[i][j].x;\n obj.y = grid[i][j].y;\n obj.i = i;\n obj.j = j;\n}", "explode() {\n\t\tthis.remv = true;\n\t\tif( this.expl ) {\n\t\t\tgame.addPar( this.expl, this.x, this.y );\n\t\t}\n\t}" ]
[ "0.6826974", "0.6782445", "0.663343", "0.6616821", "0.6594524", "0.6468872", "0.6451867", "0.64217126", "0.6408598", "0.64078283", "0.64078283", "0.64005095", "0.6324242", "0.62991923", "0.6237701", "0.62346786", "0.6230376", "0.6226434", "0.62239015", "0.621295", "0.6204273", "0.61694986", "0.6167431", "0.6164619", "0.61577964", "0.6146957", "0.6142201", "0.6139131", "0.6139131", "0.6110073", "0.61035794", "0.6089473", "0.6079268", "0.6070314", "0.6053529", "0.6045049", "0.60437965", "0.6019933", "0.6013201", "0.6009031", "0.60030586", "0.5998", "0.5996365", "0.59931105", "0.59888214", "0.59707844", "0.59691787", "0.596335", "0.5963007", "0.5961948", "0.5958035", "0.5955763", "0.5950675", "0.59473455", "0.59383667", "0.59213066", "0.591472", "0.59024346", "0.5901683", "0.5897705", "0.58906376", "0.5889817", "0.58851486", "0.5879933", "0.5878545", "0.5875661", "0.5875552", "0.5866704", "0.58652276", "0.5862378", "0.5862235", "0.58610654", "0.58605886", "0.585893", "0.58487076", "0.5848454", "0.58354115", "0.5828859", "0.58227265", "0.5821895", "0.58077025", "0.580767", "0.5806622", "0.58055675", "0.58018225", "0.58018225", "0.57902735", "0.57861376", "0.57852954", "0.5783008", "0.57671314", "0.57638323", "0.57628286", "0.57595116", "0.5756634", "0.5753372", "0.5753062", "0.57499856", "0.5749958", "0.5748706" ]
0.6084515
32
Fetch Images From Web
function fetch_images(evt){ var $btn=$(evt),$step=$btn.closest('.post_product'),$pg,$ind,url; // if($btn.hasClass('fetching')) return; url = $step.find('input.url_').val().trim().replace(/^https?:\/\//i,''); if(!url.length) return alert('Please enter a website address.'); $btn.addClass('fetching').val('Wait...'); if(/\.(jpe?g|png|gif)$/i.test(url)) return check(['http://'+url]); function check(images){ var fn=[], list=[], cur=80, step=30/images.length; for(var i=0,c=images.length; i < c; i++) fn[i] = load(images[i],i,c); function load(src,i,c){ var def = $.Deferred(), img = new Image(); img.onload = function(){ cur += step; if(cur > 100) cur = 100; // $ind.stop().animate({'width':cur+'%'},100); if(this.width > 99 || this.height > 99) list.push(this); def.resolve(this); // set_images(list); // $('#add_link').val('http://'+url); // $btn.removeClass('fetching').val('Submit'); // $('.example22').trigger('click'); }; img.onerror = function(){ def.reject(this); if(i==c) alert("Oops! Couldn't find any good images for the page."); }; img.src = src; return def; }; $.when.apply($,fn).always(function(){ if(list.length){ set_images(list); $('#add_link').val('http://'+url); $btn.removeClass('fetching').val('Submit'); $('.example22').trigger('click'); }else{ alert("Oops! Couldn't find any good images for the page."); } }); }; $.ajax({ type : 'get', url : baseURL+'site/product/extract_image_urls?url='+url, dataType : 'json', success : function(json){ if(!json) return; if(json.response){ check(json.response); } else if(json.error && json.error.message){ alert(json.error.message); } }, complete : function(){ $btn.removeClass('fetching').val('Submit'); } }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function fetchImages(){\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(response => response.json())\n .then(json => displayImages(json.message));\n}", "function getImages( url )\n {\n // attempt to create XMLHttpRequest object and make the request\n try\n {\n asyncRequest = new XMLHttpRequest(); // create request object\n\n // register event handler\n asyncRequest.addEventListener(\"readystatechange\", processResponse, false); \n asyncRequest.open( \"GET\", url, true ); // asyncRequest\n asyncRequest.send( null ); // send data\n } // end try\n catch ( exception )\n {\n alert( \"Request Failed\" );\n } // end catch\n } // end function getImages", "function fetchImage() {\n // TODO\n fetch('examples/fetching.jpg')\n\t.then(validateResponse)\n\t.then(readResponseAsBlob)\n\t.then(showImage)\n\t.catch(logError);\n}", "function fetchImg(){\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(json => json.message.forEach(element => \n addImgToDom(element)\n ));\n}", "function fetchImages(){\n fetch(\"https://dog.ceo/api/breeds/image/random/4\")\n .then(res => res.json())\n .then(result => {\n result.message.map( img => Addimage(img))\n });\n}", "function fetchImgs() {\n const imgUrl = \"https://dog.ceo/api/breeds/image/random/4\";\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(results => insertImgs(results)) \n}", "function FetchImages(){\n\t\n\tvar fiveHundred = \"https://api.500px.com/v1/photos?feature=fresh_day&sdk_key=7131207245727241ad25174950e82fc41cb572f3\";\n\t\n\t$.ajax({\n\t\ttype:\"GET\",\n\t\turl: fiveHundred,\n\t})\n\t.done(function(result){\n\t\tfor(var i = 0; i <result.photos.length; i++) {\t\t\n\t\t\timageArray.push(result.photos[i].image_url);\t\n\t\t}\n\t\t\n\t\t\n\t\t//console.log(imageArray.length);PASS\n\t\tConvertToColor(0);\n\t});\t\n}", "function fetchImages(){\n const dogImageContainer = document.querySelector(\"#dog-image-container\")\n fetch(imgUrl, { method: 'GET' })\n .then((response) => {\n console.log(response)\n if (response.ok) {\n return response.json() \n \n }\n })\n .then((dogJsonData) => {\n dogJsonData.message.forEach(function(imgUrl) {\n console.log(dogImageContainer)\n dogImageContainer.innerHTML += `<img src=\"${imgUrl}\">`\n })\n const imageString = dogJsonData.message.map((imgUrl) => {\n return `<img src=\"${imgUrl}\">`\n })\n })\n}", "async function getImage(url){\n const link = new URL(url)\n\n // local filesystem\n if (link.protocol === 'file:'){\n const filepath = path.resolve(path.normalize(url.replace('file://','')))\n return new Promise(function(resolve, reject){\n fs.readFile(filepath, (err, localImage)=>{\n if (err) reject(err)\n resolve(localImage)\n })\n })\n }\n\n // download from web\n const response = await fetch(link.href)\n const type = response.headers.get('Content-Type')\n if (type.includes('image/') || !type.includes('text/html'))\n return Buffer.from(await response.arrayBuffer())\n\n // parse html\n const { image } = scraper( link.href, await response.text() )\n if (!image)\n return null\n\n return Buffer.from( await (await fetch(image)).arrayBuffer() )\n}", "function fetchImages() {\n const numPhotos = 18;\n const graphicPromises = [];\n const baseUrl =\n \"https://arcgis.github.io/arcgis-samples-javascript/sample-data/featurelayer-collection/photo-\";\n\n for (let i = 1; i <= numPhotos; i++) {\n const url = baseUrl + i.toString() + \".jpg\";\n const graphicPromise = exifToGraphic(url, i);\n graphicPromises.push(graphicPromise);\n }\n\n return promiseUtils.eachAlways(graphicPromises);\n}", "function loadImages() {\n\t\t const button = document.querySelector('#loadImages');\n\t\t const container = document.querySelector('#image-container');\n\n\t\t button.addEventListener(\"click\", (event) => {\n\n\t\t const images = imageNames();\n\t\t images.forEach((image) => {\n\t\t requestFor(image, container).then(imageData => {\n\t\t const imageElement = imageData.imageElement;\n\t\t const imageSrc = imageData.objectURL;\n\t\t imageElement.src = imageSrc;\n\t\t });\n\t\t });\n\t\t });\n\t\t}", "async WebGetImage(url) {\n var img = new Image();\n var p = new Promise((resolve, reject) => {\n img.onload = () => {\n resolve(img);\n };\n img.onerror = () => {\n reject();\n }\n });\n img.src = url;\n return p;\n }", "function scrapeimg(name,element){\n var globalurl;\n var scraperes = [];\n element.forEach(function(img){\n scraperes.push($(document).find(img));\n });\n var search=name.split(\"-\")[0].split(\"&\")[0].trim().split(\",\")[0].trim().split(\"ft.\")[0].trim().split(\"vs\")[0].trim().split(\"Ft.\")[0].trim().split(\"feat.\")[0].trim().split(\"Feat.\")[0].trim().split(' ').join('-');\n search = deUmlaut(search);\n var url = encodeURIComponent('https://genius.com/artists/' + search);\n ////console.log(search);\n ////console.log(url);\n ////////console.log(name);\n ////////console.log(search);\n ////////console.log(url);\n fetch(`https://api.allorigins.win/get?url=${url}`)\n .then(response => {\n if (response.ok) return response.json()\n throw new Error('Network response was not ok.')\n })\n .then(function(data){\n //var res = data.find();\n var base64;\n var quick = data.contents;\n ////////console.log(quick);\n var index = quick.search(\"user_avatar\");\n var quick = quick.substring(index,quick.lenght);\n index = quick.search(\"url\\\\('\");\n quick = quick.substring(index+5,quick.lenght);\n var imgurl = quick.split(\"'\")[0];\n //imgurl='https://api.allorigins.win/get?url=${url' + imgurl + '}';\n ////////console.log(imgurl);\n globalurl = imgurl;\n /*\n try{\n toDataURL(\n imgurl,\n function(dataUrl) {\n base64 = dataUrl;\n scraperes.forEach(image => {\n if(dataUrl){\n image.attr(\"src\",dataUrl);\n //console.log(\"base64\");\n }\n else{\n image.attr(\"src\",imgurl);\n //console.log(\"img source\");\n }\n\n }); \n });\n }\n catch(e){\n //console.log(\"getting dominant color failed\");\n }\n */\n scraperes.forEach( image => image.attr(\"src\",imgurl) ); \n //////console.log(scraperes);\n\n ////console.log(imgurl);\n //scraperes.each(function() {\n // $(this).prop(\"src\",imgurl))\n // $(this).children('.time').after($('.inner'));\n //});\n //$(scraperes).prop(\"src\",imgurl);\n });\n $(element[0])\n .on('load', function() { \n\n })\n .on('error', function(){\n setTimeout(function(){\n $(this).prop(\"src\",\"https://cdn.discordapp.com/attachments/331151226756530176/725817255484719124/AURFavicon.webp\");\n },5000);\n });\n}", "async function getUrlList(url) {\n try {\n const res = await fetch(url);\n const page = await res.text();\n\n const re = RegExp('<img.*?src=\"([^\"]*)\".*?\\\\/?>', 'gmis');\n\n const urls = [];\n let match;\n while (match = re.exec(page)) {\n if (match[1]) urls.push(match[1]);\n }\n return urls;\n } catch (e) {\n return new Error(e.message);\n }\n}", "async getRedditPic(url) {\n let downloadedImg = document.createElement('img')\n downloadedImg.src = url\n return console.log(downloadedImg)\n }", "function fetchImageData() {\n // fetch request to the url\n // collect the image url info (if not copyright)\n // return that image url\n \n // Thank you, \n // https://stackoverflow.com/questions/55469230/set-header-in-http-geturl \n // https://www.w3schools.com/js/js_json_parse.asp\n let responseJSON = JSON.parse(\n http.getUrl(API_URL, null)\n );\n\n // Please disregard code style smh\n let date = responseJSON['date'];\n let explanation = responseJSON['explanation'];\n let hdurl = responseJSON['hdurl'];\n let media_type = responseJSON['media_type'];\n let service_version = responseJSON['service_version'];\n let title = responseJSON['title'];\n let url = responseJSON['url'];\n \n // If copyright === true, do not display image and instead display \n // copyright message\n // Additionally, prompt the user to visit the webpage\n let copyright = responseJSON['copyright'];\n \n // TODO Clicking on the image should just open the site u feel me\n if (copyright) {\n // Show a placeholder image\n hdurl = 'https://www.jpl.nasa.gov/spaceimages/images/largesize/PIA12567_hires.jpg';\n \n // Prompt the user to visit the webpage\n title = 'Please visit apod.nasa.gov to view today\\'s (copyrighted) content'\n }\n \n // TODO Add video media type handling\n // For now, prompt the user to visit the website to view the video\n // TODO Bixby has a native video player? YouTube URLs most likely...\n if (media_type === 'video') {\n // Show a placeholder image\n hdurl = 'https://www.jpl.nasa.gov/spaceimages/images/largesize/PIA12567_hires.jpg';\n \n // Prompt the user to visit the webpage\n title = 'Please visit apod.nasa.gov to view today\\'s video!'\n }\n\n // Thank you,\n // https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch\n// fetch(API_URL)\n// .then(function(response) {\n// return response.json();\n// })\n// .then(function(myJson) {\n// title = myJson['title'];\n// \n// return {\n// ImageTitle: title\n// };\n// });\n \n // ImageResult\n return {\n ImageDate: date,\n ImageExplanation: explanation,\n ImageHDUrl: hdurl,\n ImageMedia_Type: media_type,\n ImageService_Version: service_version,\n ImageTitle: title,\n ImageUrl: url\n }\n}", "function autoGetImage(image)\n{\n\tvar xhr = new XMLHttpRequest();\n\tvar img = image\n\turl = img.data('imagesrc');\n\t//console.log(\"get >> \" +url);\n\txhr.open('GET', url.trim(), true);\n\txhr.responseType = 'blob';\n\txhr.onload = function(e) \n\t{\n\t\timg.attr('src',window.URL.createObjectURL(this.response));\n\t};\n\txhr.send();\n\treturn true;\n}", "function loadImageUrls() {\n fetch(\"https://api.imgflip.com/get_memes\")\n .then((result) => result.json())\n .then(({ data: { memes: loadedMemes } = {} }) => {\n memes = loadedMemes;\n showImage(0);\n });\n }", "function getImages() {\n alert(\"Page will reload once images are finished loading\");\n // runs 1540photo.py, which collects images from Gmail\n exec(\"python 1540photo.py\");\n loaded_images_from_tba = 0;\n // for each team, loads media\n for (let team_id in teams) {\n loadMediaFromTBA(teams[team_id]);\n }\n // gets local files\n let local_dir = fs.readdirSync(\"./data/images/\");\n for (let team_id in local_dir) {\n try {\n let file = local_dir[team_id];\n if (manifest_images.indexOf(file) < 0) {\n manifest_images.push(file);\n }\n } catch (_) {}\n }\n // checks to see if all images are loaded, and saves a manifest if true\n window.setInterval(saveImageManifest, 3000);\n}", "function downloadImage(url) {}", "async function getCattts() {\n const response = await fetch('https://api.giphy.com/v1/gifs/translate?api_key=MA7ohxIYwTdEkW4gq9ieDD4NzeQmKE9k&s=cat', { mode: 'cors' })\n const parseData = await response.json()\n img3.src = parseData.data.images.original.url\n}", "function fetchImg() {\n fetch(\"https://xkcd.now.sh/?comic=latest\")\n .then((response) => response.json())\n .then((data) => {\n console.log(data);\n img.src = data.img;\n })\n //logs if an error occurs\n .catch((err) => console.log(err));\n}", "function getData() {\n\t\t\tconst http = new XMLHttpRequest();\n\t\t\thttp.onreadystatechange = function() {\n\t\t\t\tif (http.readyState === 4 && http.status === 200) {\n\t\t\t\t\tconst searchResultData = JSON.parse(http.response);\n\t\t\t\t\tconst resultImages = searchResultData.images;\n\t\t\t\t\tfor (let i = 0; i < 10; i++) {\n\t\t\t\t\t\tdisplayResult(resultImages[i].url, resultImages[i].large_url);\n\t\t\t\t\t}\n\t\t\t\t\tlightBox();\n\t\t\t\t}\n\t\t\t};\n\t\t\t// search: \"http://www.splashbase.co/api/v1/images/search\", \"query\" => \"laptop\" // from site\n\t\t\thttp.open('GET', `http://www.splashbase.co/api/v1/images/search?query=\"${searchTerm}`, true);\n\t\t\thttp.send();\n\t\t}", "getUrllist() {\n fetch('https://api.giphy.com/v1/gifs/search?q='+this.gifurl+'&rating=g&limit=25&api_key=rGrMJ7KXMNsi7y1I94GmPa2LzmHTnYEG')\n .then(this._onResponse)\n .then(this._onJsonReady);\n }", "function getPic() {\n fetch(baseUrl)\n .then(function (response) {\n if (!response.ok) {\n console.log(response);\n return new Error(response);\n }\n console.log(\"Response:\", response);\n\n console.log(\"Meep:\", response.url);\n\n //GRAB PHOTOGRAPHER\n\n var deepest = new URL(response.url).pathname.split('/')\n var id = deepest[2]\n console.log(\"Deepest:\", id);\n var idUrl = 'https://picsum.photos/id/0/info';\n var rep = idUrl.replace(\"0\", id);\n console.log(\"Replaced:\", rep);\n var grayscaleUrl = 'https://picsum.photos/id/0/450/350.jpg?grayscale';\n var repGrayscale = grayscaleUrl.replace(\"0\", id);\n console.log(\"repGrayscale:\", repGrayscale);\n var blurURL = 'https://picsum.photos/id/0/450/350.jpg?blur';\n var repBlur = blurURL.replace(\"0\", id);\n console.log(\"repBlur:\", repBlur);\n\n document.getElementById(\"photographer\").innerHTML = \"\"\n const section = document.querySelector('#photographer');\n fetch(rep)\n .then(function (result) {\n console.log(\"photographer:\", result)\n return result.json()\n })\n .then(function (json) {\n console.log(\"photographer:\", json.author);\n displayResults(json.author);\n })\n\n //GRAYSCALE FETCH\n\n document.getElementById('button2').addEventListener(\"click\", function () {\n fetch(repGrayscale)\n .then(function (response2) {\n if (!response2.ok) {\n console.log(response2);\n return new Error(response2);\n }\n console.log(\"Response2:\", response2);\n\n console.log(\"Meep2:\", response2.url);\n return response2.blob();\n })\n\n .then(function (photoBlob) {\n console.log(\"My Blob2:\", photoBlob)\n var objectURL = URL.createObjectURL(photoBlob);\n console.log(\"Object URL2:\", objectURL);\n randomImage.src = objectURL;\n\n console.log(\"randomImage2.src:\", randomImage.src);\n\n\n })\n })\n\n //BLUR FETCH\n document.getElementById('button3').addEventListener(\"click\", function () {\n fetch(repBlur)\n .then(function (response2) {\n if (!response2.ok) {\n console.log(response2);\n return new Error(response2);\n }\n console.log(\"Response2:\", response2);\n\n console.log(\"Meep2:\", response2.url);\n return response2.blob();\n })\n\n .then(function (photoBlob) {\n console.log(\"My Blob3:\", photoBlob)\n var objectURL = URL.createObjectURL(photoBlob);\n console.log(\"Object URL3:\", objectURL);\n randomImage.src = objectURL;\n\n console.log(\"randomImage3.src:\", randomImage.src);\n\n })\n })\n\n //END GRAYSCALE FETCH, BACK TO GRAB PHOTOGRAPHER\n\n\n function displayResults(json) {\n let photographer = json;\n let heading = document.createElement('h1');\n section.appendChild(heading);\n heading.textContent = photographer;\n }\n\n //END GRAB PHOTOGRAPHER \n\n return response.blob();\n })\n\n .then(function (photoBlob) {\n console.log(\"My Blob:\", photoBlob)\n var objectURL = URL.createObjectURL(photoBlob);\n console.log(\"Object URL:\", objectURL);\n randomImage.src = objectURL;\n\n console.log(\"randomImage.src:\", randomImage.src);\n\n })\n\n .catch(function (err) {\n console.log(err);\n })\n}", "function getImage(imagename, imagesizetype) {\n return fetch(fetchMovieUrl)\n .then(\n function (response) {\n if (response.status !== 200) {\n alert('Looks like there was a problem. Status Code: ' +\n response.status);\n }\n return response.json().then(function (data) {\n baseUrl = data.images.base_url\n imagesize = data.images[imagesizetype][2];\n finalurl = baseUrl + imagesize + imagename;\n return finalurl;\n });\n }\n )\n .catch(function (err) {\n alert('Fetch Error :-S', err);\n });\n}", "function loadImageUrls() {\n let XMLHTTP = new XMLHttpRequest();\n XMLHTTP.open(\"GET\",\"https://mymultimediamememaker.herokuapp.com/get_backgrounds\");\n XMLHTTP.addEventListener(\"readystatechange\",function() {\n // Bei Erfolg:\n if (XMLHTTP.readyState == 4) {\n // wandle in JSON um\n const j = JSON.parse(XMLHTTP.response)\n memes = j;\n var length = memes.length;\n // wähle Bild aus wenn Bildliste nicht \"0\" ist.\n if(length != 0)\n document.getElementById(\"backImage\").src = memes[length-1].Url;\n }\n }, false);\n\n XMLHTTP.send(null);\n\n}", "fetchBackgroundPage() {\n const no_cors = 'https://cors-anywhere.herokuapp.com/';\n const url = \"https://www.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1&mkt=pt-BR\";\n fetch(`${no_cors}${url}`)\n .then(response => response.json())\n .then(response => {\n const image = `https://www.bing.com${response.images[0].url}`;\n this.setState({\n image: image\n })\n });\n }", "function getImages(){\n hideContents();\n showLoading();\n clearContent();\n //Check we have tags available before making an API request\n if (getTagsUri().length > 0) {\n $.getJSON(\"flickr.php\", { tagUri: getTagsUri()}, function(response) {\n console.log(response);\n // Response status of 1 means the api request was successful\n if (response.status == 1) {\n $.each(response.data, function(i, item){\n constructCard(item);\n });\n hideContents();\n showContent();\n } else {\n // if my php script detects an error the response status will be set to 0, meaning we show no results\n hideContents();\n showNoResults();\n }\n\n });\n } else {\n hideContents();\n showNoResults();\n }\n}", "function getAllImages() {\n printLog('Requiring all images the user solved from the server.');\n IMAGES = [];\n // IMAGES_ON_CLIENT = 0;\n send(json_get_all_images_message());\n}", "function displayImages(anchor){\n fetch(url + anchor.innerHTML.toLowerCase())\n .then(response => response.json())\n .then(json => {\n console.log(json);\n document.querySelector(\".randomFoodImage\").src = json.image;\n })\n .catch(err => console.log(\"something went wrong!\", err))\n \n}", "function retrievePictures(coords) {\n console.log(\"Lat: \" + coords.latitude)\n console.log(\"Lon: \" + coords.longitude)\n imageArray = []\n const url = \"https://shrouded-mountain-15003.herokuapp.com/https://flickr.com/services/rest/?api_key=d3bfc1adf01a36079d0c6711030a97e8&format=json&nojsoncallback=1&method=flickr.photos.search&safe_search=1&per_page=5&lat=\" + coords.latitude + \"&lon=\" + coords.longitude + \"&text=outdoors\"\n\n fetch(url)\n\n .then(function(responseObject) {\n return responseObject.json()\n })\n .then(function(data) {\n createURL(data)\n return data\n })\n}", "function load_image(){\n\tvar url_string = window.location.href\n\tvar url = new URL(url_string);\n\tvar nasa_id = url.searchParams.get(\"nasa_id\");\n\t\n\tvar query = \"https://images-api.nasa.gov/asset/\" + nasa_id;\n\tvar result = httpGetAsync(query, large_image);\n}", "function loadImagesFromUrlAsync(url) {\n\treturn fetch(url)\n\t\t.then(response => {\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error(`Failed to read ${url}`);\n\t\t\t}\n\t\t\treturn response.blob();\n\t\t})\n\t\t.then(blob => {\n\t\t\treturn readFileStreamAsync(blob);\n\t\t})\n\t\t.then(arrayBuf => {\n\t\t\treturn parseData(arrayBuf);\n\t\t})\n\t\t.catch(error => {\n\t\t\tconsole.error(error);\n\t\t});\n}", "function getImageFromAPI() {\n var queryURL = \"https://api.giphy.com/v1/gifs/search?q=new&limit=1&api_key=dc6zaTOxFJmzC\";\n $.ajax({\n url: queryURL,\n method: 'GET'\n }).done(function(response) {\n console.log(response);\n var imageURL = response.data[0].images.original.url;\n $(\".img-circle\").attr(\"src\", imageURL);\n });\n }", "function parseUrl () {\n /** @param {object} ph - creating phantom object ph */\n phantom.create().then(function (ph) {\n /** @param {object} page - creating page to proxy all functions sent to phantom object */\n ph.createPage().then(function (page) {\n // pass random url to page\n page.open(generateRandomURL()).then(function (status) {\n // loads all content of the page via 'content' property\n page.property('content').then(function (content) {\n // cheerio parsing html once page is loaded\n var $ = cheerio.load(content);\n var img = $('#screenshot-image').attr('src'); // looks for 'screenshot-image'\n // filtering image\n if (filterURL(img)) {\n io.emit('update-image', img);\n } else {\n console.log('Image not found. Please wait while next url is parsed.. \\n');\n }\n ph.exit(); // Exiting webkit process\n parseUrl();\n });\n });\n });\n });\n}", "async function fetchPhotos(doc, category = 'animals') {\r\n\t\t\t\tlet arr = [];\r\n\t\t\t\tlet options = {\r\n\t\t\t\t\turl: `https://wallpaperscraft.com/catalog/${category}/${doc}`,\r\n\t\t\t\t\tgzip: true,\r\n\t\t\t\t\ttransform: function (body) {\r\n\t\t\t\t\t\treturn cheerio.load(body);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tlet $ = await rp(options);\r\n\t\t\t\tlet imgLinks = $('.wallpapers__canvas .wallpapers__image');\r\n\t\t\t\tfor (let i = 0; i < 15; i++) {\r\n\t\t\t\t\tlet url = imgLinks[i].attribs.src.replace('300x168', '1280x720');\r\n\t\t\t\t\tarr.push(url);\r\n\t\t\t\t}\r\n\t\t\t\tconsole.log('info : new links fetched');\r\n\t\t\t\treturn arr;\r\n\t\t\t}", "load_from_url() {\n this.download_btn.prop(\"disabled\", 1);\n\n const url = this.url_input.val();\n\n let xhr = new XMLHttpRequest();\n\n console.info(\"Loading remote image from\", url)\n\n xhr.open(\"GET\", url, true);\n xhr.responseType = \"blob\";\n\n xhr.onload = (e) => {\n this.fname = e.target.responseURL.replace(/\\\\/g,'/').replace(/.*\\//, '').split('.')[0];\n\n let file_reader = new FileReader();\n file_reader.onload = (e) => { this.load_image(e, this); };\n file_reader.readAsArrayBuffer(e.target.response);\n };\n\n xhr.send();\n }", "function getImage() {\n fetch(\"https://unsplash.it/900/600\").then(response => {\n // Fetching the Unsplash link\n imageDiv.innerHTML = `<img src=\"${response.url}\">`; // Embedding the photo url inside the div\n imageLink = `${response.url}`; // Setting the url as a variable so it can be stored\n });\n}", "function getGifs(){\n //searchInput.value is my search bar value\n // console.log(searchInput.value);\n fetch(`${giphy_endpoint}?api_key=${API_KEY}&q=${searchInput.value}`)\n .then(function(response){\n return response.json();\n })\n .then(function(data){\n //data.data[\"\"0\"\"].images.preview_gif.url got this from web development tools on chrome\n console.log(data);\n for(var i=0; i<data.data.length; i++){\n results.innerHTML += `\n <img class=\"image\" src=\"${data.data[i].images.preview_gif.url}\">\n \n `\n }\n })\n .catch(function(error){\n console.log(\"There was an error!\")\n })\n \n \n}", "async function getCats() {\n fetch('https://api.giphy.com/v1/gifs/translate?api_key=MA7ohxIYwTdEkW4gq9ieDD4NzeQmKE9k&s=cat', { mode: 'cors' })\n .then(response => {\n return response.json()\n })\n .then(response => {\n img1.src = response.data.images.original.url\n })\n}", "function fetchImages() {\n $.getJSON(\"/images.php\", function(data) {\n preloadImages(data);\n }); \n }", "function query_random_image_from_unsplash(){\n read_dom();\n\n fetch('https://api.unsplash.com/photos/random/?client_id=632c1d73955fbf286b85e73d858e8f82a583655b90426b2d914810912474a180&w=1920&h=1080')\n .then((response) => response.json())\n .then(function(response_json){\n inject_image_into_background(response_json.urls.custom)\n inject_unsplash_info_links(\n response_json.user.name, \n response_json.user.links.html\n );\n })\n .catch(function(error){\n console.log(error);\n });\n}", "function getGiphy(searchFor){\n fetch(\"http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=\"+searchFor)\n .then(response => response.json())\n .then(object => {\n document.getElementById(searchFor).src=object.data.image_url;\n });\n}", "async function getCatts() {\n const response = await fetch('https://api.giphy.com/v1/gifs/translate?api_key=MA7ohxIYwTdEkW4gq9ieDD4NzeQmKE9k&s=cat', { mode: 'cors' })\n response.json().then(response => {\n img2.src = response.data.images.original.url\n })\n}", "function getImage() {\n send(json_get_image_message());\n}", "function getDogImages(dogNumber) {\n let dogURL= url + '/' + dogNumber; // add \"/dogNumber\" to url\n return fetch(dogURL) // fetch returns promise\n // convert response to json for readable format\n // (promise method. response is a parameter (url). doesn't have to be called \"response\". just an argument of a function (this is a function =>))\n .then(response => response.json())\n .then(responseJson => displayResults(responseJson))\n // if error happens, give alert message\n .catch(error => alert('Something went wrong. Try again later.'));\n}", "function getBreedImg() {\n let currentBreed = window.location.hash.substring(1);\n let req = new XMLHttpRequest ();\n req.open(\"GET\", \"https://dog.ceo/api/breed/\"+currentBreed+\"/images/random\");\n req.addEventListener(\"load\", parseBreedImg);\n req.send();\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 getImage(url, callback) {\n https.get(url, res => {\n // Initialise an array\n const bufs = [];\n\n // Add the data to the buffer collection\n res.on('data', function (chunk) {\n bufs.push(chunk)\n });\n\n // This signifies the end of a request\n res.on('end', function () {\n // We can join all of the 'chunks' of the image together\n const data = Buffer.concat(bufs);\n\n // Then we can call our callback.\n callback(null, data);\n });\n })\n // Inform the callback of the error.\n .on('error', callback);\n}", "function webScrapper (tab){\n axios(tab)\n .then((response) => {\n const $ = cheerio.load(response.data);\n const firstUrl = $('body').find('img').attr('src')\n console.log(firstUrl)\n }).catch(() => console.log('something went wrong!'))\n}", "function getDogImage(dogImg) {\n fetch(`https://dog.ceo/api/breeds/image/random/${dogImg}`)\n .then(response => response.json())\n .then(responseJson => displayResults(responseJson))\n .catch(error => {\n alert('Something went wrong. Try again later.')\n console.log(error);\n });\n}", "function fetchDogs() {\n fetch(imgUrl)\n .then(resp => resp.json())\n .then(data => renderDogs(data));\n}", "function crawlCardImages(bot, msg, xhr, type, url, attempts, verbose) {\n\tif (xhr.readyState == 4 && xhr.status == 200) {\n\t\ttry {\n\t\t\t// get response body, and set up dom for xpath\n\t\t\tvar body = xhr.responseText;\n\t\t\tvar doc = new dom().parseFromString(body);\n\n\t\t\t// get all card images\n\t\t\tvar cards_preprocessing = xpath.select(\"//div[contains(@class, 'relative')]/img[@width=320 and @height=400]/@src\", doc);\n\t\t\tif (cards_preprocessing.length >= 1) { // successfully found URL, now send requests to download the images\n\n\t\t\t\t// do some preprocessing to the card images loop - get rid of certain card names because they, for some reason, always seem to appear\n\t\t\t\tvar cards = [];\n\t\t\t\tfor (var i = 0; i < cards_preprocessing.length; i++) {\n\t\t\t\t\tcard_image_name = cards_preprocessing[i].value;\n\t\t\t\t\tif (card_image_name.indexOf('4def240876ade0979827de23be7f1c84') == -1 && card_image_name.indexOf('b7d7b72883b5dffbdaae5051aaab607d.jpg') == -1 && card_image_name.indexOf('9a83bb090149c8237fefee916c4e681d.jpg') == -1) {\n\t\t\t\t\t\tcards.push(card_image_name);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvar images = 0;\n\t\t\t\tvar updated = false;\n\t\t\t\t// send request to card images to download them\n\t\t\t\tfor (var i = 0; i < cards.length; i++) {\n\t\t\t\t\t// do a check to see if this card has been seen before - if not, then the set needs to be updated\n\t\t\t\t\tif (type === 'event' && event_cards.indexOf(cards[i]) == -1 || type === 'gacha' && gacha_cards.indexOf(cards[i]) == -1) {\n\t\t\t\t\t\tupdated = true;\n\t\t\t\t\t}\n\t\t\t\t\t// get current time in millis for card image name storing\n\t\t\t\t\tvar d = new Date();\n\t\t\t\t\tvar time = d.getTime();\n\n\t\t\t\t\t// save card images to local directory\n\t\t\t\t\tvar name = i.toString() + type + cards[i].substring(cards[i].length - 4, cards[i].length);\n\t\t\t\t\tvar options = {\n\t\t\t\t\t\turl: cards[i],\n\t\t\t\t\t\tdest: 'cards/' + name\n\t\t\t\t\t}\n\n\t\t\t\t\tdownloader.image(options).then(({filename, image}) => {\n\t\t\t\t\t\t// upon download finish, call a helper function\n\t\t\t\t console.log('File saved to', filename)\n\n\t\t\t\t // update number of images that have been saved so far\n\t\t\t\t images = images + 1;\n\n\t\t\t\t // if we've finished downloading all the images to do, we need to combine them using imagemagick\n\t\t\t\t if (images >= cards.length) {\n\t\t\t\t \tif (updated) { // become verbose if new information is seen, and update last seen cards\n\t\t\t\t \t\tverbose = 1;\n\t\t\t\t \t\tif (type === 'event') {\n\t\t\t\t \t\t\tevent_cards = []\n\t\t\t\t \t\t\tfor (var z = 0; z < cards.length; z++) {\n\t\t\t\t \t\t\t\tevent_cards.push(cards[z])\t\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t} else {\n\t\t\t\t \t\t\tgacha_cards = []\n\t\t\t\t \t\t\tfor (var z = 0; z < cards.length; z++) {\n\t\t\t\t \t\t\t\tgacha_cards.push(cards[z])\t\n\t\t\t \t\t\t\t}\n\t\t\t\t \t\t}\n\t\t\t\t \t\tconsole.log(\"NEW UPDATE\");\n\t\t\t\t \t}\n\t\t\t\t \t// combine images using imagemagick\n\t\t\t\t\t\t\tvar im_array = [];\n\t\t\t\t\t\t\tfor (var i = 0; i < cards.length; i++) {\n\t\t\t\t\t\t\t\tim_array.push('cards/' + i.toString() + type + cards[i].substring(cards[i].length - 4, cards[i].length));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tim_array.push(\"+append\");\n\t\t\t\t\t\t\tim_array.push(time.toString() + \".jpg\")\n\t\t\t\t\t\t\tim.convert(im_array, function(err, stdout) {\n\t\t\t\t\t\t\t\tif (err) {\n\t\t\t\t\t\t\t\t\tmsg.channel.sendMessage(\"Whoops, an error occurred! It's not my fault... I think?\");\n\t\t\t\t\t\t\t\t\tconsole.log(err);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t// sends the newly created image as well as a description after successful conversion\n\t\t\t\t\t\t\t\tif (verbose) {\n\t\t\t\t\t\t\t\t\tif (type === 'event') {\n\t\t\t\t\t\t\t\t\t\tif (updated) {\n\t\t\t\t\t\t\t\t\t\t\tmsg.channel.sendMessage(\"Event information has been updated!\")\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tmsg.channel.sendMessage(\"Here are the current event cards:\")\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tif (updated) {\n\t\t\t\t\t\t\t\t\t\t\tmsg.channel.sendMessage(\"Gacha information has been updated!\")\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\tmsg.channel.sendMessage(\"Here are the current gacha cards:\")\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tmsg.channel.sendFile(time.toString() + \".jpg\");\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t});\n\t\t\t\t }\n\t\t\t\t\t}).catch((err) => {\n\t\t\t\t\t\tthrow err\n\t\t\t\t\t})\n\t\t\t\t}\n\t\t\t} else { // otherwise, we're likely not authenticated\n\t\t\t\tretryAmebaRequest(bot, msg, type, url, attempts, verbose, 'ERROR: xpaths for crawlCardImages failed, likely due to invalid credentials.', crawlCardImages);\n\t\t\t}\n\n\t\t} catch (e) {\n\t\t\tretryAmebaRequest(bot, msg, type, url, attempts, verbose, e, crawlCardImages);\n\t\t}\n\n\t} else if (xhr.status != 200 && xhr.readyState == 4) {\n\t\tretryAmebaRequest(bot, msg, type, url, attempts, verbose, 'ERROR: XMLHttpRequest for crawlCardImages failed.', crawlCardImages);\n\t}\n}", "async function getPicture(condition) {\n const response = await $.ajax(`https://api.unsplash.com/search/photos?page=1&query=${condition}&client_id=Qll_xnk7d3ktu5Ek9TgLO_6A8nm3ucuWCCIUVjFaq3E`)\n .catch(e => console.log(e));\n let random = Math.floor(Math.random() * Math.floor(10)); //get one of 10 random images\n return(response.results[random].urls.regular);\n}", "function loadPhotos() {\n\n for(let i = 0; i < 10; i++) {\n fetch(`https://picsum.photos/500/500?random=${i}`)\n .then(x => {\n \n gallery.innerHTML += `\n <img src=\"${x.url}\" alt=\"\">\n `\n });\n }\n}", "function getImages(web, useMyOwn) {\n\t//how to generate /where to list\n\tvar person_list = ['Angelina_Jolie','Bill_Gates','Einstein','Michelle_Obama','Morgan_Freeman','Mozart', 'Adolf_Hitler', 'Barack_Obama', \"Bart_Simpson\", \n\t\t\t\t\t\t\"Ben_Affleck\", \"Beyonce\", \"Bill_Clinton\", \"Brad_Pitt\",\"Darth_Vader\", \"Frodo\", \"George_W_Bush\", \"Hillary_Clinton\", \"Homer_Simpson\",\n\t\t\t\t\t\t\"Indiana_Jones\", \"Marilyn_Monroe\", \"Superman\", \"Steve_Jobs\", \"Michael_Jordan\"];\n\n\tvar action_list = ['balancing', 'bending', 'biting', 'bouncing', 'building', 'burning' , 'chasing', 'clapping', 'climbing' ,'cooking', 'digging',\n\t\t\t\t\t\t'drinking', 'enlarging', 'exploding', 'feeding', 'fighting', 'flipping', 'hanging', 'hiding', 'hugging', 'juggling', 'kissing',\n\t\t\t\t\t\t'licking', 'painting', 'piloting', 'pushing', 'repairing', 'rubbing', 'scratching', 'shooting', 'smelling', 'swinging','throwing',\n\t\t\t\t\t\t'tickling', 'tying', 'washing', 'wrapping', 'zooming'];\n\n\tvar object_list = ['dome','hammer','heel','hen','igloo','leaf', 'lock', 'moose', 'seal', 'smore', 'snowflake','suit','daisy','dice','safe','toilet',\n\t\t\t\t\t\t'moon', 'map','lollipop','peach', 'bus'];\n\n\tvar action_num = 3;\n\tvar object_num = 3;\n\n\n\tvar person = person_list[Math.floor(Math.random() * person_list.length)];\n\n\twhile (personList.indexOf(person) != -1) {\n\t\tvar person = person_list[Math.floor(Math.random() * person_list.length)];\n\t}\n\tpersonList.push(person);\n\tvar action = action_list[Math.floor(Math.random() * action_list.length)];\n\tvar object = object_list[Math.floor(Math.random() * object_list.length)];\n\n\t//html = \"<p>{0}</p><img class=clue src=images/person/{1}.jpg><p>is</p><p>{2}</p><p>a/an</p><p>{3}.</p>\"\n\t\n\n\t//action button\n\tvar webPageIdDOM = '#' + web + 'Page';\n\tvar actionPageIdDOM = '#' + web + action;\n\tvar objectPageIdDOM = '#' + web + object;\n\tif (useMyOwn) {\n\t\tvar canvas = '<img style=\"display:none;width:80px;height:80px; margin:0px auto\" class=\"ownPhotos\" id=photoCanvas' + web + ' src=\"\" />'\n\t//<img style=\"display:none;\" id=\"largeImage\" src=\"\" />\n\t\tvar html = \"<div class=rehearseButton1></div>\" + canvas + \"<div class='private'><p>is</p>{2} a/an {3} <a href=# id='fix' data-role='button' data-rel='popup' onclick='checkPassword(\\\"\" + web + \"\\\")' > Type in your Password</a> </div><div class=rehearseButton2></div>\";\n\t} else {\n\t\t//var popupPage = $(\"<div data-role='popup' data-title='generate a password for\"+web + \"' id=\"+web+\"Password > PASSWORD </div>\");\n\t\t//popupPage.appendTo( $.mobile.pageContainer );\n\n\t\t//var html = \"<p>{0}</p><img class=clue src=images/person/{1}.jpg /><p>is</p>{2} a/an {3} <div data-role='popup' data-title='generate a password for\"+web + \"' id=\"+web+\"Password > PASSWORD </div> <a data-role='button' data-rel='popup' href=#amazonPassword\"+ \" data-transition='pop' data-position-to='window'>Type in your Password</a>\";//\" onclick='checkPassword(\\\"\" + action + \"\\\", \\\"\" + web + \"\\\", \\\"\" + object + \"\\\")' data-rel='dialog'>Type in your Password</a>\";\n\t\tvar html = \"<div class=rehearseButton1></div><p id=\"+ web + \"Name >{0}</p><div class=personDiv><img class=clue id=\" + web + \"Person src=images/person/{1}.jpg /></div><div class='private'><a data-role='button' onclick='changePerson(\\\"\" + person + '\",\"' + web + \"\\\")'>Change Person</a><p>is</p>{2} a/an {3} <a href=# id='fix' data-role='button' data-rel='popup' onclick='checkPassword(\\\"\" + web + \"\\\")' > Type in your Password</a></div><div class=rehearseButton2></div>\";\n\n\t}\n\n\tvar buttonActionId = 'buttonAction' + buttonCounter.toString();\n\tvar buttonObjectId = 'buttonObject' + buttonCounter.toString();\n\tbuttonCounter += 1;\n\n\t//var buttonAction = \"<input type='button' id='\" + buttonActionId + \"' value='\" + action + \"' href='\" + actionPageIdDOM + \"' />\";\n\t//var buttonObject = \"<input type='button' id='\" + buttonObjectId + \"' value='\" + object + \"' href='\" + objectPageIdDOM + \"' />\";\n\tvar buttonObject = \"<div class=objectButton><a data-role='button' href=\" + objectPageIdDOM + \">\" + object + \"</a></div>\";\n\tvar buttonAction = \"<div class=actionButton><a data-role='button' href=\" + actionPageIdDOM + \">\" + action + \"</a></div>\";\n\n\n\t//var actionLambda = function (event) { };\n\t//var objectLambda = function (event) { objectHandler(event, web, object); };\n\n\tvar buttonActionIdDOM = '#' + buttonActionId;\n\tvar buttonObjectIdDOM = '#' + buttonObjectId;\n\n\t//create two pages and then bind the buttons\n\tvar actionPage = createActionImagePage(web, action, action_num);\n\tvar objectPage = createObjectImagePage(web, object, object_num);\n\n\t\n\tactionPage.appendTo( $.mobile.pageContainer );\n\tobjectPage.appendTo( $.mobile.pageContainer );\n\n\t//var objectLambda = function (event) {alert('hi');$.mobile.changePage($(objectPageIdDOM));} ;\n\t//var actionLambda = function (event) {$.mobile.changePage($(actionPageIdDOM))} ;\n\n\t$(buttonObjectId).live('click', function(event){});\n\t//$(buttonObjectId).live('click', objectLambda);\n\t//$(buttonActionId).live('click', actionLambda);\n\treturn String.format(html, person, person, buttonAction, buttonObject);//person, action, object);\n\t//return \"<p><img class=clue src=images/pic\"+pic1+\".jpg></p><p><img class=clue src=pictures/pic\"+pic2+\".jpg></p><p><img class=clue src=pictures/pic\"+pic3+\".jpg></p>\"\n}", "function getImages() {\n\t$.get(\"resources/get_images.php\", {\"page\": globalPage}).success(function(data) {\n\t\tglobalPage++;\n\t\t\n\t\tvar imgz = JSON.parse(data).images;\n\t\tgenerateThumbnails(imgz);\n\t\tgenerateShowMoreButton(imgz);\n\t}).fail(function() {\n\t\twindow.location.replace(\"index.php\");\n\t});\n}", "function fetchDog() {\n const dogImg = document.getElementById('dogImage')\n return fetch(\"https://dog.ceo/api/breeds/image/random\").then(response =>\n response\n .json()\n .then(json =>\n response.ok ? Promise.resolve(json) : Promise.reject(json)\n ) \n );\n }", "LoadImage(){\n var images=[]\n // hard coded for convenienceproxy to a static serving end point\n if(this.state.images!=undefined){\n this.state.images.map(i =>{\n images.push(\n this.request.getStamp()+'-' + i\n )\n })\n return images; \n }\n else{\n \n return null\n }\n }", "function fetchGif(searchTerm) {\n // This sets up our Giphy search with the given searchTerm.\n let query = `${url}?api_key=${apiKey}&q=${searchTerm}&limit=1`;\n\n // Fetch the data from the Giphy API...\n window.fetch(query).then(data => {\n return data.json();\n\n // Then try to turn the response into valid JSON...\n }).then(json => {\n // Then get the correct URL from the JSON and pass it to createImage.\n let results = json.data;\n let result = results[0];\n let imageUrl = result.images.downsized.url;\n createImage(imageUrl);\n });\n}", "function getPhotos() {\n const url = 'http://localhost:3000/gallery?_sort=id&_order=desc';\n const fetchparameters = {\n method: 'GET',\n headers: { 'Content-Type': 'application/json; charset=UTF-8' },\n mode: 'cors',\n cache: 'no-cache'\n };\n fetch(url, fetchparameters)\n .then(data => data.json())\n .then(response => {\n photos = response;\n loadGallery();\n })\n .catch(error => console.error(error))\n}", "getImages(images){\n if(!images || images.length == 0){\n return([{imageUrl:'http://placehold.it/600x400&text=No Images'}]);\n }else{\n let ret = [];\n images.forEach(function(imName){\n ret.push({imageUrl:\"https://s3.amazonaws.com/campyapp1/images/\" + imName});\n });\n return ret;\n }\n //if no image exists, use http://placehold.it/600x400&text=No-Images\n //return([{imageUrl:'http://eurotravel360.com/wp-content/uploads/2013/05/What-to-Consider-When-Choosing-a-Campsite.jpg'},{imageUrl:'http://placehold.it/600x400&text=c2'},{imageUrl:'http://placehold.it/600x400&text=c3'}])\n }", "function getPic(url) {\n $.ajax({\n url: url,\n method: \"GET\",\n dataType: \"json\"\n })\n .done(function(response) {\n $(\"#gifs\").css(\"background-image\", 'url(\"' + response.data.image_url + '\")');\n });\n }", "function fetchBreeds() {\n fetch(breedUrl)\n .then(res => res.json())\n .then(breeds => {\n {debugger}\n dogoUrls.message.map(dogPicUrl => {\n let frame = document.querySelector(\"#dog-image-container\")\n let dogElement = document.createElement(\"img\")\n\n dogElement.src = dogPicUrl\n dogElement.style.width = \"25%\"\n frame.appendChild(dogElement)\n })\n })\n }", "function getImage(url, path) {\n var requestConfig = {\n url: url,\n method: 'GET',\n headers: {\n 'User-Agent': 'request'\n },\n json: true,\n }\n var stream = request(requestConfig, function(err, response, body) {\n if (err) {\n throw err;\n };\n });\n // Pipes the request to a stream and writes to the given path.\n stream.pipe(fs.createWriteStream(path));\n}", "function userpic_supplicant(user, src) {\n\tGM_xmlhttpRequest({ method: 'GET', url: src, \n\t\t\theaders: { 'User-Agent':'lj memento' },\n\t\t\tonerror: function(res) {\n\t\t\t\tGM_log('userpic error: ' + res) ;\n\t\t\t},\n\t\t\tonload: function(res) {\n\t\t\t\tvar parser ;\n\t\t\t\tvar dw = new XPCNativeWrapper(\n\t\t\t\t\t\twindow,\"DOMParser()\") ;\n\t\t\t\tparser = new dw.DOMParser() ;\n\n\t\t\t\tvar dom = parser.parseFromString(\n\t\t\t\t\t\tres.responseText,\n\t\t\t\t\t\t\"text/xml\") ;\n\t\t\t\tvar d_img = xpath('//image', dom) ;\n\t\t\t\tif(d_img.length == 0) {\n\t\t\t\t\tset_userpic_cached(user, NO_USERPIC) ;\n\t\t\t\t\tfill_userpic(user, NO_USERPIC) ;\n\t\t\t\t\treturn ;\n\t\t\t\t}\n\n\t\t\t\tvar nodes = xpath('//image/url/text()', dom) ;\n\t\t\t\tvar img_url = nodes[0].nodeValue ;\n//\t\t\t\timg_url.match(/userpic\\/(.*)$/) ;\n//\t\t\t\tvar userpic = RegExp.$1 ;\n\t\t\t\tset_userpic_cached(user, img_url) ;\n\n\t\t\t\tinstantiate_userpic(img_url, user) ;\n\t\t\t}\n\t\t}) ;\n\t}", "function ParsedURL(parsedInput){\n parsedInput.forEach(function (item) {\n filePath = \"avatars/\" + item.login + \".png\";\n url = item.avatar_url;\n downloadImageByURL(url, filePath);\n })\n\n// this function extracts the filepath and url of the js objects gained from the get request\n// particularly the filepath needs to have a .jpg appended on the end of it or it won't\n// a picture\n}", "async function getWeatherGif(weatherDescription) {\n const img = document.querySelector('img');\n let giphyAPIKey = 'y1iU3pDPR9daxVTIEt7YyIyGFYkNFhBR';\n let gifSearch = weatherDescription;\n let response = await fetch('https://api.giphy.com/v1/gifs/translate?api_key=' + giphyAPIKey + '&s=' + gifSearch, { mode: 'cors' })\n let gifData = await response.json()\n\n img.src = gifData.data.images.original.url;\n}", "function getPhoto(url) {\n $.ajax({\n url: url,\n data: {\n client_id: CLIENT_ID,\n client_secret: CLIENT_SECRET,\n v: 20181005\n },\n success: function(data) {\n console.log(data);\n var imgUrl = data.response.photos.items[0].prefix+'100x100'+data.response.photos.items[0].suffix;\n contentString = \"<div class='image'><img src='\"+imgUrl+\"'></div>\"+contentString;\n },\n error: function(err) {\n contentString = \"<div class='error'>Venue photos are not available. Reason: \"+err.responseJSON.meta.errorDetail+\"</div>\"+contentString;\n }\n });\n }", "function imgLoad(imgJSON) {\n // return a promise for an image loading\n return new Promise(function(resolve, reject) {\n var request = new XMLHttpRequest();\n request.open('GET', imgJSON.url);\n request.responseType = 'blob';\n\n request.onload = function() {\n if (request.status == 200) {\n var arrayResponse = [];\n arrayResponse[0] = request.response;\n arrayResponse[1] = imgJSON;\n resolve(arrayResponse);\n } else {\n reject(Error('Image didn\\'t load successfully; error code:' + request.statusText));\n }\n };\n\n request.onerror = function() {\n reject(Error('There was a network error.'));\n };\n\n // Send the request\n request.send();\n });\n}", "downloadPNGs()\n {\n\t\t\n var directory = this.dir;\n\t\t\n\t\t//Get HTML from URL provided\n https.get(this.url, function(response)\n {\n parseResponse(response);\n })\n\n var parseResponse = function(response)\n {\n\t\t\t//Concatenate site HTML\n var data = \"\";\n response.on('data', function(chunk)\n {\n data += chunk;\n });\n var count = 0;\n var imgPaths = [];\n response.on('end', function(chunk)\n {\n\t\t\t\t//Initialize HTMLParser\n var parsedData = new htmlparser.Parser(\n {\n onattribute: function(name, value)\n {\n\t\t\t\t\t\t//Check src tags to check if the source image is a .png file\n if (name === \"src\" && value.substr(value.length - 3) === \"png\")\n {\n imgPaths.push(value);\n count++;\n }\n },\n onend: function()\n {\n console.log('Downloading...');\n }\n },\n {\n decodeEntities: true\n });\n parsedData.write(data);\n parsedData.end();\n\n var file;\n var fileName;\n var download;\n\n\t\t\t\t//Create function to download image\n\t\t\t\tdownload = function(uri, filename, callback)\n {\n request(uri).pipe(fs.createWriteStream(filename)).on('close', callback);\n };\n\t\t\t\t\n\t\t\t\t//Loop to download all images in url to local directory\n for (var i = 0; i < imgPaths.length ; i++)\n {\n\t\t\t\t\t//Split to get the last part of the image path(fileName)\n fileName = imgPaths[i].split('/');\n file = fs.createWriteStream(directory + \"/\" + fileName[fileName.length - 1]);\n\t\t\t\t\t\n download(imgPaths[i], directory + \"/\" + fileName[fileName.length - 1], function(){});\n }\n\t\t\t\t//Display amount of images as well as the directory downloaded to\n\t\t\t\tconsole.log( count + ' png images saved to : ' + directory);\n });\n }\n }", "function imgLoad(imgJSON) {\n // return a promise for an image loading\n return new Promise(function (resolve, reject) {\n var request = new XMLHttpRequest();\n request.open('GET', imgJSON.url);\n request.responseType = 'blob';\n\n request.onload = function () {\n if (request.status == 200) {\n var arrayResponse = [];\n arrayResponse[0] = request.response;\n arrayResponse[1] = imgJSON;\n resolve(arrayResponse);\n } else {\n reject(Error('Image didn\\'t load successfully; error code:' + request.statusText));\n }\n };\n\n request.onerror = function () {\n reject(Error('There was a network error.'));\n };\n\n // Send the request\n request.send();\n });\n}", "function getImage(number)\n{\n\t//request the pokedex data for a particular pokedex entry number\n\tvar xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", \"http://pokeapi.co/api/v1/pokemon/\" + number + \"/\", false);\n\txhr.send();\t\n\t\n\t//extract the url for the array of urls for a pokemon's sprites\n\t//select first entry in array and request for the sprite data\n\tvar imguri = \"http://pokeapi.co\" + JSON.parse(xhr.response).sprites[0].resource_uri;\n\txhr.open(\"GET\", imguri, false);\t\n\txhr.send();\n\t\n\t//extract the url of the sprite image file\n\timg = \"http://pokeapi.co\" + JSON.parse(xhr.response).image\n\treturn img;\n}", "async function getPhotos () {\n try {\n const response = await fetch(apiUrl);\n fotosArray = await response.json();\n displayFotos();\n } catch (error) {\n //recogemos el error\n }\n}", "async getAllImages() {\n // if (!enable()) return null;\n\n try {\n console.log(\"[imgur] GET All Images\");\n\n // get img count\n let count = await this.imagesCount();\n if (count == null) throw (\"[imgur] Can not get images count!\");\n\n // loop for pages\n let pArray = [];\n let pages = parseInt(count / 50);\n for (let page = 0; page <= pages; page++) {\n pArray.push(this.images({ page }));\n }\n\n // get result\n let result = [];\n await Promise.all(pArray).then(values => {\n for (let arr of values) {\n result = result.concat(arr);\n }\n });\n\n console.log(\"[imgur] Imgur account images load complete (\" + result.length + \" images)!\");\n return result;\n\n } catch (error) {\n console.log(`[imgur] imgur.api.account.getAllImages`);\n console.log(error);\n return null;\n }\n }", "pollImages() {\r\n\t\tthis.request.get('http://' + this.config.IP + ':4430/titan/handles', (error, response, body) => {\r\n\t\t\tif (!error && response.statusCode == 200) {\r\n\t\t\t\tvar jsonobj = JSON.parse(Buffer.from(body).toString());\r\n\t\t\t\tfor (var i = 0; i < jsonobj.length; i++) {\r\n\t\t\t\t\tif(jsonobj[i][\"icon\"] != null) {\r\n\t\t\t\t\t\tthis.getImage(jsonobj[i][\"userNumber\"][\"hashCode\"], jsonobj[i][\"icon\"])\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tthis.checkFeedbacks('image');\r\n\t\t});\r\n\t}", "function randomDog(){\n let dogPic = document.getElementById(\"dogPic\")\n\n fetch(\"https://dog.ceo/api/breeds/image/random\")\n .then((response) => {return response.json()})\n .then((json) => {\n console.log(`Status Dag API fetch: ${json.status}`);\n let imageUrl = json.message\n dogPic.src = imageUrl\n })\n .catch((error) => console.log(`ERROR: ${error}`))\n}", "function getDogImage(dogNum) {\n fetch(`https://dog.ceo/api/breeds/image/random/${dogNum}`)\n .then(response => response.json())\n .then(responseJson => console.log(responseJson))\n .catch(error => alert('Something went wrong. Try again later.'));\n}", "function getsImages(){\n\tvar src = [];\n\tvar alt = [];\n\tvar tit = [];\n\tvar lde = [];\n\tvar idd = [];\n\tvar cls = [];\n\t\n\t$(\"img\").each(function(){\n\t\t\n\t\tsrc[src.length] = $(this).attr(\"src\");\n\t\talt[alt.length] = $(this).attr(\"alt\");\n\t\ttit[tit.length] = $(this).attr(\"title\");\n\t\tlde[lde.length] = $(this).attr(\"longdesc\");\n\t\tidd[idd.length] = $(this).attr(\"id\");\n\t\tcls[cls.length] = $(this).attr(\"class\");\n\t});\n\t\n\talt[alt.length] = \"Image for the news result\";\n\t//console.log({Sources: src, Alternate_Text: alt, Title: tit, Long_Destination: lde, ID: idd, Class: cls});\n\t\n\treturn {Sources: src, Alternate_Text: alt, Title: tit, Long_Destination: lde, ID: idd, Class: cls};\n}", "loadRemoteImage(url) {\n return new Promise((res, rej) => {\n const img = new Image();\n img.onload = () => {\n this.loadImage(img);\n res();\n };\n img.onerror = err => rej(err);\n img.src = url;\n });\n }", "async function getImages() {\n var gallery = await getGallery();\n var featured = [];\n for (var i = 0; i < 5; i++) {\n featured.push(gallery.results[i].thumbs[1].src);\n }\n return featured;\n }", "function getLatestImages() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif(galleryUrl == ''){\r\n\t\t\t\t\t\t\trestClient.findRestricted('sociallinks?socialCommunity=facebook&category=fadderuka', function(data) { \r\n\r\n\t\t\t\t\t\t\tif(data.length >= 1){\r\n\t\t\t\t\t\t\t\tgalleryUrl = data[0].address;\r\n\t\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\t\tgalleryUrl = standardURL;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tgetImgFace(galleryUrl);\r\n\r\n\t\t\t\t\t\t\t}, function(req, status, ex) {\r\n\t\t\t\t\t\t\t\tgetImgFace(standardURL);\r\n\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\t\tgetImgFace(galleryUrl);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n//\t\t\t\t\t\t$\r\n//\t\t\t\t\t\t\t\t.ajax({\r\n//\t\t\t\t\t\t\t\t\turl : 'https://graph.facebook.com/10150304760787369/photos',\r\n//\t\t\t\t\t\t\t\t\tdataType : 'json',\r\n//\t\t\t\t\t\t\t\t\ttype : 'GET',\r\n//\t\t\t\t\t\t\t\t\ttimeout : 5000,\r\n//\t\t\t\t\t\t\t\t\tsuccess : function(album) {\r\n//\t\t\t\t\t\t\t\t\t\thandleImgsData(album.data);\r\n//\t\t\t\t\t\t\t\t\t},\r\n//\t\t\t\t\t\t\t\t\terror : function() {\r\n//\t\t\t\t\t\t\t\t\t\tshowErr('Ikke kontakt med facebook',\r\n//\t\t\t\t\t\t\t\t\t\t\t\tnull);\r\n//\t\t\t\t\t\t\t\t\t}\r\n//\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t}", "_fetchIt(pictureUrl, errCb) {\n let url;\n try {\n url = new URL(pictureUrl);\n } catch(err) {\n errCb(err);\n return null;\n }\n return fetch(url).then(response => {\n return response.arrayBuffer()\n }, err => {\n toast.mostrar(\"Seems like I can't fetch that 😕\", {color: '#fff', fondo: '#fe4440'});\n })\n }", "function getDogImage(chosenBreed) {\n let dogURL=`https://dog.ceo/api/breed/${chosenBreed}/images/random`;\n fetch(dogURL)\n .then(response => response.json())\n .then(responseJson => displayImage(responseJson, chosenBreed))\n .catch(error=>alert('Something is not working, please try again in a bit.'));\n }", "function i(e,i,h){const s=e.thumbnail&&e.thumbnail.url;return s?(0,_request_js__WEBPACK_IMPORTED_MODULE_0__.default)(s,{responseType:\"image\"}).then((t=>{const e=n(t.data,h);return h&&h.node?(h.node.appendChild(e),h.node):e})):e.fetchSymbol().then((t=>i(t,h)))}", "function fetchDog() {\n fetch(\"https://dog.ceo/api/breeds/image/random\")\n .then((response) => {\n return response.json();\n })\n .then((greeting) => {\n console.log(greeting);\n let li = document.createElement(\"li\");\n let img = document.createElement(\"img\");\n ul.appendChild(li);\n li.append(img);\n img.src = greeting.message;\n img.width = 200;\n })\n //logs if an error occurs\n .catch((err) => console.log(err));\n}", "async function getNasaPictures() {\n try {\n const response = await fetch(apiUrl)\n resultsArray = await response.json()\n console.log(resultsArray)\n updateDOM()\n } catch (error) {\n // Catch Error Here\n }\n}", "function getAllImages() {\n var imagesInfo = []\n try {\n // Get all images in the web page\n \tvar images = document.getElementsByTagName('img'); \n var image_id = 0;\n // Loop all images in the web page\n \tfor(var i = 0; i < images.length; i++) {\n \t\tvar currentImage = {}\n \t\tvar height = images[i].height;\n \t\tvar width = images[i].width;\n \t\tvar load_complete = images[i].complete;\n var url = images[i].src;\n \t\tif(load_complete == true){\n // Check the size of the image\n if(filterImageBySize(height, width) == true){\n currentImage['id'] = \"udss_image\"+image_id;\n currentImage['height'] = height;\n currentImage['width'] = width;\n currentImage['url'] = url;\n imagesInfo.push(currentImage); \n // color the selected image\n \n images[i].id = currentImage['id'];\n images[i].style.border = \"5px solid orangered\";\n images[i].title = \"Checking this image in progress\";\n //images[i].onmouseover = function(){console.log(\"just hove\")};\n \n ++image_id;\n }\n \t\t}\n \t}\n } catch(err) {\n //console.log(err.message);\n }\n\n return imagesInfo;\n}", "function fetchWithOne() {\n\tconst url1 = 'http://127.0.0.1:5000/process/togrey';\n\tconst url2 = 'http://127.0.0.1:5000/process/detectface';\n\tlet url = '';\n\tif (mode == 'GS') {\n\t\turl = url1;\n\t} else if (mode == 'FD') {\n\t\turl = url2;\n\t}\n\n\tconst formData = new FormData();\n\tformData.append('image1', image1.files[0]);\n\n\tconst request = new Request(url, {\n\t\tmethod: 'post',\n\t\tbody: formData\n\t});\n\tfetch(request)\n\t\t.then((res) => {\n\t\t\tconsole.log('2312312');\n\t\t\treturn res.blob();\n\t\t})\n\t\t.then((blob) => {\n\t\t\tconsole.log('blob');\n\t\t\tvar output = document.getElementById('output');\n\t\t\tvar objectURL = URL.createObjectURL(blob);\n\t\t\toutput.src = objectURL;\n\t\t})\n\t\t.catch((error) => {\n\t\t\t// if an error occured it will be logged to the JavaScript console here.\n\t\t\tconsole.log('An error occured with fetch:', error);\n\t\t});\n}", "function getImages() {\n let searchTerm = document.getElementById('title').value;\n let url = \"\".concat(baseURL, 'configuration?api_key=', APIKEY); \n fetch(url)\n .then((result)=>{\n return result.json();\n })\n .then((data)=>{\n baseImageURL = data.images.secure_base_url;\n configData = data.images;\n console.log('config:', data);\n getMovies(searchTerm);\n})}", "function loadImage(theUrl)\n {\n //var theUrl = 'http://presspassimages.s3-us-west-1.amazonaws.com/upload/20161020231520904/img8060.JPG';\n var xmlhttp;\n\n if (window.XMLHttpRequest)\n {// code for IE7+, Firefox, Chrome, Opera, Safari\n xmlhttp = new XMLHttpRequest();\n }\n else\n {// code for IE6, IE5\n xmlhttp = new ActiveXObject(\"Microsoft.XMLHTTP\");\n }\n xmlhttp.onreadystatechange=function()\n {\n if (xmlhttp.readyState==4 && xmlhttp.status==200)\n {\n //console.log(xmlhttp.responseText);\n return xmlhttp.responseText;\n }\n }\n xmlhttp.open(\"GET\", theUrl, true );\n\n xmlhttp.send(); \n }", "function ScrapeFirstImgFromPage(pageUri) {\n return fetch(pageUri, {\n gzip: true,\n headers: {\n 'User-Agent': 'Sc2 Info SlackBot/v1.0 (https://github.com/seanbud/sc2-info-slackapp/; [email protected])',\n },\n }).then(res => res.text())\n .then((responseHtml) => {\n // Use cheerio to scrape the img url of the first image contained in a link.\n const $ = cheerio.load(responseHtml);\n return `https://liquipedia.net${$('a > img')[0].attribs.src}`;\n });\n}", "function interpret_get_image(content) {\n var imageName = content['name'];\n printLog('image name: ' + imageName);\n\n // If its a GET ALL request\n if (content['all']) {\n var total_images = content['total_images'];\n addImageToImageList(imageName, content['img']);\n\n // Check whether all images are received\n if (IMAGES.length === total_images) {\n printLog(\"All images received from the server.\");\n // Get all tags to all images\n getAllTagsFromMeAndOthers();\n }\n\n } else {\n printLog('New image arrived: ' + imageName);\n CURRENT_IMAGE = imageName;\n B_IMGS_LEFT = content['b_images_left'];\n setCookie('imgLeft', B_IMGS_LEFT);\n if (!ADD_TASKS) {\n printLog('Images left (including this one): ' + content['b_images_left']);\n } else {\n printLog('ADDITIONAL images left (including this one): ' + ADD_IMGS);\n }\n if (content['img'] === 'ERROR') {\n printLog('Error while getting the image from the server');\n viewErrorOverlay(\"Interner Fehler beim Holen des Bildes! Bitte später noch einmal versuchen.\");\n } else if (content['img'] === 'NO_IMAGES_LEFT') {\n printLog('No more images left');\n NO_MORE_IMAGES = true;\n setEnd();\n // setEnd_NoImagesLeft();\n } else if (content['img'] === 'RESEND') {\n flipImage(false);\n // In bonus round, decrease the images left\n if (ADD_TASKS && ADD_IMGS > 0) {\n --ADD_IMGS;\n }\n } else {\n var b64 = content['img'];\n // addImageToImageList(imageName, b64);\n setImage('data:image/jpg;base64,' + b64);\n flipIn(5);\n // In bonus round, decrease the images left\n if (ADD_TASKS && ADD_IMGS > 0) {\n --ADD_IMGS;\n }\n }\n UDGE.afterGetImage();\n }\n}", "function portfolioLoad() {\n let articulos = document.querySelectorAll(\"article\")\n if (articulos.length) {\n articulos.forEach(function(articulo) {\n ajax(\"https://dog.ceo/api/breeds/image/random\", \"get\", function(data) {\n let data_parseada = JSON.parse(data)\n let url = data_parseada.message\n let img = document.createElement(\"img\")\n img.src = url\n articulo.children[0].appendChild(img)\n }, false)\n })\n }\n}", "async function getNewImage() {\n let randomNumber = Math.floor(Math.random() * 10);\n return fetch(unsplashURL)\n .then((response) => response.json())\n .then((data) => {\n let allImages = data.results[randomNumber];\n return allImages.urls.regular;\n });\n}", "function getImages()\n\t{\n\t\tconsole.log('getImages')\n\t\tarr = []\n\t\tvar ajaxCall = $.get(targetUrl)\n\n\t\tajaxCall\n\t\t.done(function(response)\n\t\t{\t\n\t\t\t$.each(response.images, function(j)\n\t\t\t{\n\t\t\t\t$.each(response.images[j].array, (i)=>\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tlet tagArr = response.images[j].array[i].tag\n\t\t\t\t\tlet found = $.inArray(arrayKey, tagArr)\n\t\t\t\t\t//console.log(arrayKey, tagArr, found)\n\t\t\t\t\tif(found != -1)\n\t\t\t\t\t{\n\t\t \t\t\t\tarr.push(response.images[j].array[i])\n\t\t \t\t\t\tslide = \"<img id='slide' src='\" + arr[index].url + \"' alt=''>\" +\n\t\t \t\t\t\t\"<div class='img-title'><h3>\"+ arr[index].title + \"</h3></div>\"\n\t\t \t\t\t}\n\t\t \t\t\t\n\t\t\t\t})\n\t\t\t\t\n\t \t\t}) \n\t\t\tdisplaySlide($('#img-container'), slide)\n\t \t\tarrayLength = arr.length;\n\t\t\t\t\t\n\t\t})\n\t\t.fail(function(err)\n\t\t{\t\t\t\t\n\t\t\tthrow err\n\t\t})\n\n\t}", "function newDog(){\n fetch('https://dog.ceo/api/breeds/image/random')\n .then(response => {\n return response.json(); \n }) \n .then(data => {\n dogImg.src = data.message;\n })\n .catch(error => { console.log('Something went wrong', error);\n });\n}", "function getPhoto(){\n $.ajax({\n url: photoAPI+'?key='+photoKey+'&q=nature+landscape&image_type=photo&per_page=50',\n type: 'GET',\n data: {},\n dataType: 'json',\n success: function(data){\n\n /* RNG, max = 50 because that's the parameter set in the url of this request */\n var randNum = Math.floor(Math.random()*(50 - 0 + 1));\n\n /* setting the img element to the randomized photo URL */\n var photoURL = data.hits[randNum].webformatURL;\n\n $('.photo-bg img').attr('src', photoURL);\n\n },\n error: function(err){\n alert(err);\n }\n });\n }", "function getDogImage(dogNum) {\n fetch(`https://dog.ceo/api/breeds/image/random/${dogNum}`)\n .then(response => response.json())\n .then(responseJson => displayImages(responseJson))\n .catch(error => alert('Something went wrong. Try again later.'));\n}" ]
[ "0.73724777", "0.7289278", "0.72325224", "0.7149243", "0.7029612", "0.70182437", "0.699242", "0.68646646", "0.6835498", "0.6821814", "0.68143815", "0.67789155", "0.6755397", "0.67434156", "0.67392784", "0.673632", "0.6671058", "0.66604644", "0.66179496", "0.661623", "0.65941584", "0.65789026", "0.656392", "0.6562422", "0.6514937", "0.6454883", "0.6436616", "0.64085364", "0.6406658", "0.6397183", "0.6375884", "0.6374816", "0.6372684", "0.63629645", "0.6352938", "0.6351716", "0.6348828", "0.63437426", "0.63337", "0.63270605", "0.63165545", "0.6312098", "0.63083214", "0.6304491", "0.62644684", "0.6258375", "0.6240316", "0.62349623", "0.62196535", "0.6210996", "0.62058914", "0.62050295", "0.62007785", "0.6196578", "0.61945856", "0.61877", "0.61839753", "0.614886", "0.6147709", "0.61230224", "0.61226434", "0.61186117", "0.6115927", "0.61032575", "0.6089814", "0.60837567", "0.6076163", "0.60741454", "0.60688794", "0.6068693", "0.60601836", "0.60560364", "0.60539144", "0.6040069", "0.6038096", "0.60209805", "0.6018997", "0.601801", "0.6016436", "0.6009289", "0.6001836", "0.6000263", "0.59999996", "0.5992293", "0.59917", "0.5989306", "0.5984887", "0.5983278", "0.59812886", "0.59747726", "0.5955739", "0.5954251", "0.5952861", "0.59526455", "0.5951277", "0.5938229", "0.59353435", "0.5935331", "0.5931398", "0.59285045" ]
0.598933
85
Output logging information to console
function log(text) { var time = new Date(); console.log("[" + time.toLocaleTimeString() + "] " + text); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _log() {\n if (typeof (console) !== \"undefined\") {\n console.log('==START==');\n for (var i = 0; i < arguments.length; i++) {\n console.log(arguments[i]);\n }\n console.log('==END==');\n }\n }", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n }", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "function logOutput(logText) {\n log.isInfo(logText);\n console.log(logText);\n}", "function logOutput(logText) {\n log.info(logText);\n console.log(logText);\n}", "function log() {\n\t console.log('%s - %s', timestamp(), format.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function log() {\n\t console.log('%s - %s', timestamp(), format$1.apply(null, arguments));\n\t}", "function _log() {\n // nodejs\n if (typeof module !== 'undefined' && module.exports) {\n for (var i in arguments) {\n process.stdout.write(arguments[i]);\n }\n } else {\n console.log(arguments);\n }\n}", "function logOutput(logText) {\n log.info(logText);\n console.log(logText);\n}", "function _log() {\n if (verbose && console) {\n console.log.apply(console, arguments);\n }\n }", "function log() {\n if (logging) {\n for (let i = 0; i < logBody.length; i++)\n console.log(logBody[i])\n }\n }", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "function log() {\n console.log('%s - %s', timestamp(), format.apply(null, arguments));\n}", "log (message) {\n // eslint-disable-next-line no-console\n if (this.verbose) console.log(message)\n }", "function consoleLog(msg) {\n if (verbose) {\n var now = new Date();\n Ext.log({}, Ext.Date.format(now, 'U') + ' | ' + msg);\n }\n }", "function logOutput(logText) {\n\n\tlog.info(logText);\n\n\tconsole.log(logText);\n\n}", "function log() {\n console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));\n}", "function log () {\n if (shouldLog) {\n console.log.apply(this, arguments)\n }\n}", "function showLog(msg, arg) {\n console.log(msg, arg)\n}", "function cLog() {\n if ( allowLog ) {\n var text = '';\n for ( var i = 0; i < arguments.length; i++ ) {\n text += arguments[ i ] + ' ';\n }\n console.log( text );\n }\n}", "function output() {\n if (debugEnabled) {\n return console.log.apply(this, arguments);\n }\n}", "function consoleLog() {\n if (typeof(console) == 'object' && typeof(console[\"log\"]) != \"undefined\") {\n console.log.apply(console, arguments);\n }\n}", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "log(message) {\n if (this.verbose) {\n // tslint:disable-next-line no-console\n console.log(message);\n }\n }", "function h$log() {\n console.log.apply(console, arguments);\n}", "function log() {\n var messages = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n messages[_i] = arguments[_i];\n }\n if (_Options__WEBPACK_IMPORTED_MODULE_1__[\"options\"].verbose) {\n if (console) {\n console.log.apply(console, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spread\"])(messages));\n }\n }\n}", "function log() {\n if (programArgs.verbose) {\n console.log(Array.prototype.slice.apply(arguments).join(' '));\n }\n}", "function log() {\n dump(Array.slice(arguments).join(' ') + '\\n');\n }", "function logger() {\r\n console.log(`Zahin`);\r\n}", "function writeLog(msg) {\n if (logEnabled) {\n console.log(msg);\n }\n}", "log(...args) {\n if (this.options && this.options.debug) {\n console.log.apply(this, arguments);\n }\n }", "function logToConsole(info) {\n return console.log(info + \" is something important to keep in mind\");\n }", "static log() {\n var str;\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "function log() { console.log.apply(console, arguments); }", "function log() { console.log.apply(console, arguments); }", "function log()\n {\n var l = arguments.length;\n var thing;\n var obs_l;\n var ob;\n var output = \"\";\n\n for (var i = 0; i < l; i++)\n {\n obs = [];\n\n thing = arguments[i];\n if (typeof thing == \"string\")\n output += thing + \"\\t\";\n else\n output += stringify(thing) + \" \";\n\n obs_l = obs.length;\n while (obs_l--)\n {\n ob = obs[obs_l];\n delete ob.__CONSOLE_VISITED__;\n }\n }\n\n print(output);\n }", "log(message) {\n console.log(message);\n }", "log (message) {\n this.getConsole().showMessage(message);\n }", "function log(){\r\n var msg = '[gandalf] ' + Array.prototype.join.call(arguments, '');\r\n if (window.console && window.console.log) {\r\n window.console.log(msg);\r\n }\r\n }", "static log() {\n console.log(\n\t\t\t`\\n\\n${CustomLog.top_banner}\\\n\t\t\t\\n\\n${CustomLog.Use.SPACE}${arguments[0]}\\\n\t\t\t\\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\n\\n`\n\t\t)\n let Args = Array.from(arguments).splice(1)\n Args.forEach( w => { console.log( CustomLog.Use.SPACE + (\n\t\t typeof w.get_custom_log_format === 'undefined' ?\n w : w.get_custom_log_format()\n ))\n })\n console.log(\n `\\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\\n \\n${CustomLog.Use.INDENT}${CustomLog.Use.SOLID_LINE}\\n\\n\\n` )\n }", "log(...args) {\n if (this.options && this.options.debug) {\n console.log(...args);\n }\n }", "function log() {\n if (debug) {\n console.log.apply(console, Array.prototype.slice.call(arguments))\n }\n}", "function log() {\n console.log(arguments);\n }", "log() {\n if (!this.options.debug) {\n return;\n }\n\n // try to use 'debug' instead of 'log'\n // @todo Check IE9+\n (console.debug || console.info || console.log).apply(window.console, arguments);\n }", "function log() {\n if (console && typeof console.log === 'function') {\n for (var i = 0, ii = arguments.length; i < ii; i++) {\n console.log(arguments[i]);\n }\n }\n }", "function logInfo(text) {\n console.log(chalk_1.default.blue(text));\n}", "function log(message){\n console.log(message);\n }", "function logger(param) {\n\t\tif (DEBUG)\n\t\t\tconsole.log(param);\n\t}", "consoleDevLog(...args) {\n if (this.logging) {\n console.log(...args);\n }\n }", "function log(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift('(app)');\n console.log.apply(console, args);\n}", "function print() {\n STDOUT = true; // tell logArgs() to print to stdout, not stderr\n // calling message() adds the \"[command name]\" prefix\n _message(utils.toArray(arguments));\n STDOUT = false;\n }", "function log(err, stdout, stderr, cb) {\n console.log(stdout);\n cb();\n }", "function writeToLog(data) {\n\tconsole.log(data);\n}", "static info(...args) {\n if (this.toLog('INFO')) {\n // noinspection TsLint\n console.info.apply(console, arguments); // eslint-disable-line\n }\n }", "function log(message) {\n if (logToConsole) {\n console.log(message);\n }\n }", "function log(message) {\n if (logToConsole) {\n console.log(message);\n }\n }", "function logger(textToPrint) {\n if (printLogs) {\n console.log(textToPrint);\n }\n}", "function printToLog (consolePrint) {\n fs.appendFile('log.txt', consolePrint, (err) => {\n if (err) throw err;\n console.log('Query results can also be found on log.txt' + divider);\n });\n}", "function log(msg) {\n $('#console').append('<p>' + msg + '</p>');\n}", "function log(msg) {\n if(debug)\n console.log(msg);\n}", "function console_log(msg){\n\tif(menu_config.development_mode){\n\t\tconsole.log(msg);\n\t}\n}", "function msg() {\n if (!check.assigned(message.get('log'))) {\n console.log(arguments[0]);\n return;\n }\n message.get('log').put(arguments[0], arguments[1], __filename.split('/').pop(), arguments.callee.caller.name.toString());\n }", "function publicLog(message) {\n if (consoleCheckbox.checked) {\n var logMessage = document.createElement('p');\n logMessage.className = 'logMessage';\n logMessage.innerHTML = message;\n publicConsoleLabel.appendChild(logMessage);\n }\n console.log(message);\n}", "info(...parameters)\n\t{\n\t\tconsole.log(this.preamble, generate_log_message(parameters))\n\t}", "function log(msg) {\n\t\t\tif (debug) {\n\t\t\t\tconsole.log(msg);\n\t\t\t}\n\t\t}", "function logMessage() {\n if (debugTurnedOn() && consoleLogExists) {\n console.log.apply(console, decorateLog(arguments, 'MESSAGE:'));\n }\n}", "sendLogs() {\n this.log.info('logging from tests');\n }", "function log(txt){ console.log(txt); }", "function logHelper(){\n\tconsole.log(\"-------------------------------------------------------------------------------\");\n\n\tfor(let i=0; i<arguments.length; ++i){\n\t\tconsole.log(arguments[i]);\n\t}\n}", "function info(msg){\r\n rootLogger.info(msg)\r\n}", "function showLog(txt)\n{\n\tif(showLog==true){\n\t\tconsole.log(txt);\n\t}\n}", "function PrintLog(a)\n{\nlogger.info(a);\n}", "function loggerCallback(logLevel, message, piiLoggingEnabled) {\n console.log(message);\n}", "logInfo(message) {\n if (this.logLevel < 10 /* INFO */)\n return;\n console.log(message);\n }", "printInfo(text) {\n const targetName = this.context.isTestTarget ? 'test' : 'build';\n this.logger.info(`- ${this.context.projectName}@${targetName}: ${text}`);\n }", "function log(msg) {\n console.log(msg);\n}", "static log(...args) {\n if (this.toLog('LOG')) {\n console.log.apply(console, arguments);\n }\n }", "function l(input) {\n\n\tif(writeLogs === true) {\n\t\tconsole.log(input);\n\t}\n}", "function log(msg) {\n console.log(msg);\n}", "function log(msg) {\n console.log(msg);\n}", "static log(level, message) {\n\t\tconst prefix = this._stringOf(level) || \"\"\n\t\tconst separator = prefix.length > 0 ? \" \" : \"\"\n\t\tconsole.log(prefix + separator + message)\n\t}", "logInfo(text) {\n if (this.availableLogLevels.indexOf(this.logLevel) <= this.availableLogLevels.indexOf('info')) {\n console.log(`Info : ${text}`);\n }\n }", "function outConsole(msg, data) {\n console.log(msg + \"----------\");\n console.log(data);\n}", "function log() {\n if (window.console) console.log.apply(console,arguments);\n}", "function log() {\n if (!debug) return ;\n var args = Array.prototype.slice.call(arguments);\n if (window.console && window.console.log) {\n console.log.apply(console, args);\n } else {\n alert(args.join(\"\\n\"));\n }\n}", "function log() {\n return stream.write(util.format.apply(this, arguments) + '\\n');\n }", "function log(msg) {\n\tif (log.enabled) {\n\t\tconsole.log('QUOOR: ' + msg);\n\t}\n}", "function console_log(stringa){\n if (global_verbosity_argo > 0){\n console.log(stringa);\n }\n}", "function log(){\r\n\r\n var message = '\\n';\r\n\r\n for ( let i = 0; i < arguments.length; i++ )\r\n message += '\\t' + arguments[i] + '\\n';\r\n\r\n console.log( message );\r\n}", "function log(text) {\n\ttext = (new Date()) + \": \" + text;\n\tconsole.log(text);\n\tlogst.write(text);\n\tlogst.write('\\n');\n}", "function logger() {\n //arguments object (an array-like structure) is available and\n //contains all the arguments passed to this function\n for (var i = 0; i < arguments.length; i++) {\n console.log(arguments[i]);\n }\n}", "function log(txt) {\n if(state.gameConfig.debug)\n console.log(txt)\n }", "function _showLogConsole() {\n\t\tif(_logging) {\n\t\t $('body').append( \"<ol id='console-box' reversed='reversed' />\");\n\t\t}\n\t}", "function log(){\n console.log('logging');\n}", "function log(msg){\n if(debug==true)\n console.log(msg);\n}", "function LOG(text) {\n\n\t// For debug purposes\n\n\tLOGGER.innerHTML = text + ' at ' + Time.getTime();\n}", "function console_log(msg) {\n\t\tconsole.log(msg);\n\t\tvar c = document.getElementById('console_log');\n\t\tc.innerHTML = msg + \"<br>\" + c.innerHTML;\n\t}", "function logSomething(log) { log.info('something'); }", "function log() {\n var _console;\n\n if (undefined) (_console = console).log.apply(_console, arguments);\n}" ]
[ "0.7208231", "0.7204922", "0.72031695", "0.71529204", "0.7122645", "0.71209806", "0.70932496", "0.70932496", "0.70932496", "0.7080266", "0.70704865", "0.70522773", "0.7045506", "0.70416737", "0.70416737", "0.7011705", "0.69807196", "0.69690263", "0.69628686", "0.69543636", "0.69478405", "0.69467133", "0.69329554", "0.6932642", "0.69261503", "0.69245356", "0.6912868", "0.690767", "0.68563026", "0.6842827", "0.6832707", "0.6827497", "0.68257636", "0.68226224", "0.6820013", "0.680736", "0.680736", "0.6791717", "0.67871684", "0.67841685", "0.67613494", "0.6760968", "0.6758867", "0.6754076", "0.6733837", "0.6727766", "0.6717462", "0.670815", "0.66993797", "0.66925657", "0.66895723", "0.6678825", "0.66784555", "0.66765594", "0.66700715", "0.66620135", "0.66617733", "0.66617733", "0.66609436", "0.66387504", "0.66251963", "0.66195476", "0.6616156", "0.661339", "0.66132313", "0.6611928", "0.66110057", "0.66079986", "0.65987086", "0.6598612", "0.659517", "0.65877825", "0.65843034", "0.6578549", "0.6571678", "0.6568121", "0.6561328", "0.65528", "0.65475494", "0.65454197", "0.6537872", "0.6537872", "0.65373915", "0.65361714", "0.65341765", "0.65326864", "0.6528092", "0.6525795", "0.6524882", "0.6519296", "0.65185034", "0.6516653", "0.65162355", "0.6505893", "0.650393", "0.65006", "0.6500193", "0.6495134", "0.64919895", "0.6491675", "0.6483875" ]
0.0
-1
TODO: make it work
chooseLocation() { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private public function m246() {}", "private internal function m248() {}", "protected internal function m252() {}", "obtain(){}", "transient private protected internal function m182() {}", "transient private internal function m185() {}", "transient protected internal function m189() {}", "static private internal function m121() {}", "static final private internal function m106() {}", "transient final protected internal function m174() {}", "static transient final private internal function m43() {}", "__previnit(){}", "static transient final protected internal function m47() {}", "transient private protected public internal function m181() {}", "static private protected internal function m118() {}", "static transient private protected internal function m55() {}", "function _____SHARED_functions_____(){}", "transient final private internal function m170() {}", "apply () {}", "getResult() {}", "static transient final protected public internal function m46() {}", "transient final private protected internal function m167() {}", "static transient final private protected internal function m40() {}", "constructor () {\r\n\t\t\r\n\t}", "constructor (){}", "function DWRUtil() { }", "lastUsed() { }", "prepare() {}", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "constructor() {\n \n\n \n \n\n \n\n \n }", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "initialize() {}", "added() {}", "_firstRendered() { }", "transient private public function m183() {}", "updated() {}", "static transient private internal function m58() {}", "static transient private protected public internal function m54() {}", "function ea(){}", "init () {\n\t\treturn null;\n\t}", "function fm(){}", "function AeUtil() {}", "constructor () { super() }", "static protected internal function m125() {}", "static transient private public function m56() {}", "constructor() {\n\n\t}", "function Scdr() {\r\n}", "init () {}", "init () {}", "function Rebelizer() {\n\n}", "function comportement (){\n\t }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}" ]
[ "0.63650036", "0.63054776", "0.5999615", "0.57544494", "0.57074064", "0.5617733", "0.55843526", "0.556996", "0.5441519", "0.5354898", "0.529819", "0.52406967", "0.5184848", "0.51588523", "0.5154342", "0.5151452", "0.5150462", "0.51276034", "0.5116967", "0.5092899", "0.5089644", "0.50685436", "0.5055514", "0.50394994", "0.4980951", "0.49720156", "0.49678588", "0.4967459", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49600264", "0.49445614", "0.49445614", "0.49445614", "0.49445614", "0.49445614", "0.49445614", "0.4942137", "0.49084845", "0.49060696", "0.48993367", "0.48985302", "0.48557344", "0.48532408", "0.48360437", "0.48276263", "0.481392", "0.4805868", "0.48057538", "0.47959733", "0.47907245", "0.4775949", "0.4775765", "0.4775765", "0.476854", "0.476789", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473", "0.47669473" ]
0.0
-1
============================== | Picker state functions | ============================== For coach
setPickerValue(newValue) { this.setState({ pickerSelection: newValue }); this.togglePicker(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Picker( ){}", "checkPickingState() {\n return false;\n }", "settingPickerTypeSelChange(params){\n this.setState({\n pickerType: params.target.value\n })\n }", "dropDownCompnent() {\n return (\n <Picker\n selectedValue={this.state.selectedValueFromPicker}\n style={{height: 100, width: '100%'}}\n onValueChange={(itemValue, itemIndex) => {\n let gridData = [];\n for (let index = 1; index <= itemValue * itemValue; index++) {\n const gridValue = {\n key: index,\n value: `${index}`,\n isSelected: false,\n isMemorized: false,\n };\n gridData.push(gridValue);\n }\n\n this.setState({\n gridData,\n selectedValueFromPicker: itemValue,\n isButtonVisible: true,\n });\n }}>\n {this.pickerList(this.state.pickerData)}\n </Picker>\n );\n }", "setPickerValue(newValue) {\n this.setState({\n pickerSelectionCourse: newValue\n })\n }", "setPickUp(value) {\n this.setState({ pickup: value });\n }", "_setOptions(){this.set(\"options\",this._getPickerOptions(data,this.allowNull,this.icon))}", "selectColor(e) {\n e.preventDefault();\n if (!this.state.pickerOpen) {\n document.querySelector(\".picker\").style.display = \"block\";\n this.setState({\n pickerOpen: true,\n selectColorTxt: \"Confirm Color\"\n });\n } else {\n document.querySelector(\".picker\").style.display = \"none\";\n this.setState({\n pickerOpen: false,\n selectColorTxt: \"Select Color\"\n });\n }\n \n }", "changePicker(picker, oldPicker) {\n var _picker2;\n\n const me = this,\n pickerWidth = me.pickerWidth || ((_picker2 = picker) === null || _picker2 === void 0 ? void 0 : _picker2.width);\n picker = Combo.reconfigure(oldPicker, picker ? Objects.merge({\n owner: me,\n store: me.store,\n selected: me.valueCollection,\n multiSelect: me.multiSelect,\n cls: me.listCls,\n itemTpl: me.listItemTpl || (item => item[me.displayField]),\n forElement: me[me.pickerAlignElement],\n align: {\n matchSize: pickerWidth == null,\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n width: pickerWidth,\n navigator: {\n keyEventTarget: me.input\n }\n }, picker) : null, me);\n picker && (picker.element.dataset.emptyText = me.emptyText || me.L('L{noResults}'));\n return picker;\n }", "handlePick(pickedPeopleReturnedFromPicker) {\n\t\tthis.setState({\n\t\t\tpickedPeople: pickedPeopleReturnedFromPicker,\n\t\t});\n\t\tthis.props.setSelectedPersonasFromPeoplePickerData(pickedPeopleReturnedFromPicker);\n\t}", "onCountryPick(code) {\n this.setState({ country_code: code})\n }", "setFaction(event) {\n this.setState({pickedFaction: event.target.value})\n }", "hofHandleShowPicker(value){\n\tconst TS = this;\n\treturn function(){\n\t TS.setState({\n\t\tpickerActive: value\n\t });\n\t};\n }", "_showDateTimePickerFrom() { this.setState({...this.state, isDateTimePickerFromVisible: true }) }", "get picker() {\n if (!this._picker) {\n this.picker = true;\n }\n return this._picker;\n }", "showPicker(focusPicker) {\n this.picker.value = this.picker.activeDate = this.value;\n super.showPicker(focusPicker);\n }", "showPicker(focusPicker) {\n this.picker.value = this.picker.activeDate = this.value;\n super.showPicker(focusPicker);\n }", "showPicker(focusPicker) {\n const me = this,\n picker = me.picker;\n picker.initialValue = me.value;\n picker.format = me.format;\n picker.maxTime = me.max;\n picker.minTime = me.min; // Show valid time from picker while editor has undefined value\n\n me.value = picker.value;\n super.showPicker(focusPicker);\n }", "function initPicker() {\n //so not selected when started\n $(\"select\").prop(\"selectedIndex\", -1);\n\n $(\"select\").imagepicker({\n hide_select : true,\n show_label : true\n })\n }", "function selectPickers()\n\t{\n\t\tselectPicker.locations('.location-0', \"\", \"\", 0, 'location_text');\n\t\tselectPicker.industries('.industry-0', \"\", \"\", 0, 'industry_text');\n\t\tselectPicker.currencies('.currency-0', \"\", \"\", 0, 'currency_text');\n\t}", "gpSelected(info, e, doctor, date, time) {\r\n this.setState({gp: info})\r\n this.setState({bookingStep: e})\r\n this.setState({doctor: doctor})\r\n this.setState({date: date})\r\n this.setState({time: time})\r\n }", "_onChangeState() {\n\n\n }", "selectComic(value) {\n this.setState({ selectedComic: value });\n }", "onChangeaAvailability(e){\n this.setState({\n availability: e.target.value\n }\n )\n }", "changePicker(picker, oldPicker) {\n const me = this;\n return TimeField.reconfigure(oldPicker, picker ? Objects.merge({\n owner: me,\n forElement: me[me.pickerAlignElement],\n align: {\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n value: me.value,\n format: me.format,\n\n onTimeChange({\n time\n }) {\n me._isUserAction = true;\n me.value = time;\n me._isUserAction = false;\n }\n\n }, picker) : null, me);\n }", "selectCard2(e) {\n if (this.state.time.s > 0 && this.state.isIdle === false) {\n this.setState({\n prevCard: e,\n p1Select: e})\n }\n }", "selectCard(e) {\n if (this.state.time.s > 0 && this.state.isIdle === false) {\n this.setState({\n prevCard: '',\n p1Select: e})\n }\n }", "handleDriverStartSeasonChange(e) {\n this.setState({\n driverStartSeason: e.target.value\n });\n }", "showPicker(focusPicker) {\n const me = this,\n picker = me.picker;\n\n picker.initialValue = me.value;\n picker.format = me.format;\n picker.maxTime = me.max;\n picker.minTime = me.min;\n\n // Show valid time from picker while editor has undefined value\n me.value = picker.value;\n\n super.showPicker(focusPicker);\n }", "function setChoosingStateOn() {\n\t\tplayerIsChoosing = true;\n\t}", "_handleSelected(plan) {\n this.setState({ selected: plan })\n }", "changePicker(picker, oldPicker) {\n const me = this;\n picker = DateField.reconfigure(oldPicker, picker ? Objects.merge({\n owner: me,\n forElement: me[me.pickerAlignElement],\n align: {\n anchor: me.overlayAnchor,\n target: me[me.pickerAlignElement]\n },\n value: me.value,\n minDate: me.min,\n maxDate: me.max,\n onSelectionChange: ({\n selection,\n source: picker\n }) => {\n // We only care about what DatePicker does if it has been opened\n if (picker.isVisible) {\n me._isUserAction = true;\n me.value = selection[0];\n me._isUserAction = false;\n picker.hide();\n }\n }\n }, picker) : null, me); // May have been set to null (destroyed)\n\n if (picker && me.calendarContainerCls) {\n picker.element.classList.add(me.calendarContainerCls);\n }\n\n return picker;\n }", "renderTaiKhoan(){\n return(\n <Picker\n selectedValue={this.state.TaiKhoan}\n onValueChange={(itemValue, itemIndex) => this.setState({TaiKhoan: itemValue})}>\n <Picker.Item label = {'Chọn loại tài khoản muốn tạo'} value = ''/>\n <Picker.Item label = {'Ban quản lí tòa nhà'} value ={'key1'}/>\n <Picker.Item label = {'Dân cư'} value ={'key2'}/>\n <Picker.Item label = {'Nhà cung cấp dịch vụ hàng hóa'} value ={'key3'}/>\n </Picker>\n )\n }", "updateChoice(choice) {\n this.setState(function () {\n return {\n selectedDisplay: choice\n }\n });\n }", "constructor (props) {\n super(props);\n this.state = {\n selectedState: 'all',\n };\n\n this.handleChooseStateChange = this.handleChooseStateChange.bind(this);\n }", "function loadPicker() {\r\n gapi.load('auth', {'callback': GPicker.onAuthApiLoad});\r\n gapi.load('picker', {'callback': GPicker.onPickerApiLoad});\r\n }", "setSelected(options) {\n console.log(options, this.props)\n this.setState({selected: this.props.weather[options.value]});\n }", "togglePicker(focusPicker) {\n if (this.pickerVisible) {\n this.hidePicker();\n } else {\n this.showPicker(focusPicker);\n }\n }", "togglePicker(focusPicker) {\n if (this.pickerVisible) {\n this.hidePicker();\n } else {\n this.showPicker(focusPicker);\n }\n }", "selectListFromUi(name) {\n this.setState({\n uiSelected: name,\n });\n }", "isPickable() {\n return this.props.pickable && this.props.visible;\n }", "selectHandler(event) {\n // if (event.target.name === \"from\") {\n this.setState({ isWaiting: true, fromCurrency: event.target.value })\n Api.getExchangeRate(event.target.value, (err, res) => {\n if (err == null) {\n this.setState({ isWaiting: false, rates: res.rates })\n }\n })\n // }\n\n }", "onPickerSelectLowerDiv (index) {\n\t\tthis.setState({\n\t\t\tselectedLowerDiv: index,\n\t\t})\n\t}", "submit() {\n //if one of the fields is missing, creates error message\n //notifies user and returns without submitting\n if (!this.state.type || !this.state.startDate || !this.state.endDate) {\n var error = 'Please fill out all Required Fields.\\n'\n if (!this.state.startDate){\n error += 'Missing Field: Start Date\\n';\n }\n if (!this.state.endDate){\n error += 'Missing Field: End Date\\n';\n }\n if (!this.state.type){\n error += 'Missing Field: Type\\n';\n }\n this.dropdown.alertWithType('error', '\\nError', error);\n return;\n }\n //if 0 hours have been requested, notifies user and returns without submitting\n if(this.state.hours === 0) {\n this.dropdown.alertWithType(\n 'error',\n '\\nError',\n 'No hours have been requested.\\n');\n return;\n }\n\n //picker returns value differently than how it is stored\n //in the jSON file so this value is parsed\n //and different information needed about it is returned\n\n //first letter of picker is returned to get information about it\n var type = this.state.type[0].toLowerCase();\n //info returned from this\n //ie. Sick Day, sickDay and sickDay: {available: 60, pending: 20, used: 50}\n var {typeName, objectName, typeObject} = this.getTypeInfo(type);\n\n //if there are enough available hours for this request\n\n if (typeObject.available >= this.state.hours) {\n\n //get the request info from the component level state\n var request = {\n status: this.state.status,\n note: this.state.note,\n requestedOn: moment().format('MM-DD-YYYY'),\n startDate: moment(this.state.startDate, 'MM-DD-YYYY').format('MM-DD-YYYY'),\n endDate: moment(this.state.endDate, 'MM-DD-YYYY').format('MM-DD-YYYY'),\n type: typeName,\n hours: this.state.hours,\n };\n\n //subtracts the requested hours from balances and adds to pending\n var newBalances = {\n available: typeObject.available - this.state.hours,\n pending: typeObject.pending + this.state.hours,\n approved:typeObject.approved,\n used: typeObject.used,\n }\n\n //calls action creator to update requests(adds request to request Array)in redux\n this.props.requestUpdate(request);\n //calls hours action creator to update balances object with new hours\n this.props.hoursUpdate({prop: objectName, value: newBalances});\n //notifies the user of a successful request\n this.dropdown.alertWithType('success', '\\nSuccess', 'Your request has been sent!\\n');\n } else{\n //notifies the user if they did not have enough hours to complete the request\n this.dropdown.alertWithType('error', '\\nError', 'You do not have enough ' + typeName + ' hours for this request!\\n');\n }\n }", "setPstate () {\r\n const O = this;\r\n if (O.is_multi && (O.is_floating || settings.okCancelInMulti)) {\r\n O.Pstate = [];\r\n // assuming that find returns elements in tree order\r\n O.E.find('option').each((i, e) => { if (e.selected) O.Pstate.push(i); });\r\n }\r\n }", "selectCountry(val) {\n\t\tconst form = Object.assign({}, this.state.form);\n\t\tform[\"qrCountry\"] = val;\n\t\tform[\"qrState\"] = \"\";\n\t\tform[\"qrStateOther\"] = \"\";\n\t\tif (val === \"Canada\") {\n\t\t\tthis.setState({ stateList: states_canada, showStateOther: false, form });\n\t\t} else if (val === \"Australia\") {\n\t\t\tthis.setState({\n\t\t\t\tstateList: states_australia,\n\t\t\t\tshowStateOther: false,\n\t\t\t\tform\n\t\t\t});\n\t\t} else if (val === \"Brazil\") {\n\t\t\tthis.setState({ stateList: states_brazil, showStateOther: false, form });\n\t\t} else if (val === \"China\") {\n\t\t\tthis.setState({ stateList: states_china, showStateOther: false, form });\n\t\t} else if (val === \"Germany\") {\n\t\t\tthis.setState({ stateList: states_germany, showStateOther: false, form });\n\t\t} else if (val === \"Hong Kong\") {\n\t\t\tthis.setState({\n\t\t\t\tstateList: states_hongkong,\n\t\t\t\tshowStateOther: false,\n\t\t\t\tform\n\t\t\t});\n\t\t} else if (val === \"India\") {\n\t\t\tthis.setState({ stateList: states_india, showStateOther: false, form });\n\t\t} else if (val === \"United States\") {\n\t\t\tthis.setState({ stateList: states_us, showStateOther: false, form });\n\t\t} else {\n\t\t\tthis.setState({ showStateOther: true, form });\n\t\t}\n\t}", "enablePick() {\n this.pickEnabeled = true;\n }", "handleOptionCheck(event, item) {\n this.setState({ endpointValue: event.target.value, selectedItem: item });\n }", "onClickBookmark() {\n this.setState({ displayPicker: !this.state.displayPicker });\n }", "function initShipToSelectedStateContinue()\n {\n\n var state = $('.view-display-id-ship_to_states #edit-field-shipping-states-tid-selective option:selected').val();\n \n updatesShipToWrapperofSelState(state);\n\n // inits on select change by the user\n $('body').on('change', 'select#edit-field-shipping-states-tid-selective', function() {\n\n updatesShipToWrapperofSelState($(this).val());\n\n });\n\n }", "handleMinPrice(newState) {\n\t\t//console.log(\"Cor selecionada: \" + newState.selected);\n\n\t\t// save selected genre\n\t\tthis.setState({ selectedMinPrice: newState.selected });\n\n\t\t// give options for next step\n\t\tthis.setState({ optionsPriceMax: prices });\n\t}", "function changeIsFigureChosen(state) {\r\n CanvasManager.isFigureChosen = state;\r\n}", "constructor () {\n super();\n\n this.state = {\n selectedOption: undefined\n }\n }", "render() {\n\n let plantypeitems = this.state.planttypeMasterList.map((s, i) => {\n return <Picker.Item key={i} value={s} label={s} />\n });\n return (\n <ImageBackground\n source={require('../assets/images/backgroundset1.png')} style={{ flex:1}}>\n <HeaderComponent text=\"Picker\" back={this.props.navigation} back={this.props.navigation} />\n <StatusBar backgroundColor=\"#75ebb6\" barStyle=\"light-content\" />\n <View style={styles.container}>\n <Text style={styles.titleText}>Post Code</Text>\n <Input\n placeholder='Postcode'\n value={this.state.postalCode}\n errorStyle={{ color: 'red' }}\n onChangeText={postalCode => this.setState({ postalCode })}\n errorMessage={this.state.errorMessage}\n inputContainerStyle={{ width: '18%' }}\n />\n <Text style={styles.titleText}>Plant Type</Text>\n <Picker selectedValue={this.state.planttype} onValueChange={this.updateplanttype}>\n {plantypeitems}\n </Picker>\n \n <TouchableOpacity style={styles.button}\n onPress={this.readFromDatabase}>\n <Text style={styles.searchText}>GO!</Text>\n </TouchableOpacity>\n \n </View>\n\n </ImageBackground>\n );\n }", "updateSelectsOnComponentLoad(selectValue) {\n console.log(\"TCL: updateSelectsOnComponentLoad -> selectValue\", selectValue)\n // ?Get Selec Inputs\n \n // if(selectValue) {\n // let selElement = document.getElementById('ROI_Category');\n // console.log(\"TCL: updateSelectsOnComponentLoad -> selElement\", selElement)\n\n // let reactSelectInput = selElement.querySelector('.react-select-wide__placeholder');\n // if(reactSelectInput === null)\n // reactSelectInput = selElement.querySelector('.react-select-wide__single-value')\n\n // reactSelectInput.innerText = selectValue\n\n // }\n \n \n\n if(this.props.loadedPMOEvaluation) {\n \n \n console.log(\"TCL: updateSelectsOnComponentLoad -> this.state\", this.state)\n try {\n this.formFields.forEach(formItem => {\n if(formItem.Type === \"Combo\") {\n\n\n // console.log(\"TCL: updateSelectsOnComponentLoad -> this.props.loadedBusinessInformation.businessInformation[formItem.Field_State_Name]\", this.props.loadedBusinessInformation.businessInformation[formItem.Field_State_Name])\n\n // ? Get element By Id\n let selElement = document.getElementById(formItem.Field_State_Name);\n console.log(\"TCL: updateSelectsOnComponentLoad -> selElement\", selElement)\n\n let reactSelectInput = null;\n\n if(formItem.extraWideControl) {\n reactSelectInput = selElement.querySelector('.react-select-extra-wide__placeholder');\n if(reactSelectInput === null)\n reactSelectInput = selElement.querySelector('.react-select-extra-wide__single-value')\n }\n \n else if(formItem.wideControl) {\n reactSelectInput = selElement.querySelector('.react-select-wide__placeholder');\n if(reactSelectInput === null)\n reactSelectInput = selElement.querySelector('.react-select-wide__single-value')\n }\n \n else {\n\n reactSelectInput = selElement.querySelector('.react-select__placeholder');\n if(reactSelectInput === null)\n reactSelectInput = selElement.querySelector('.react-select__single-value')\n }\n \n \n\n // let propsName = formItem.Field_State_Name.toLocaleLowerCase()\n \n console.log(\"TCL: updateSelectsOnComponentLoad -> reactSelectInput\", reactSelectInput)\n\n if(reactSelectInput) {\n \n // let value = this.props.loadedPMOEvaluation.pmoEvaluation[formItem.Field_State_Name] || this.props.loadedPMOEvaluation[formItem.Field_State_Name]\n // console.log(\"TCL: updateSelectsOnComponentLoad -> this.props.loadedPMOEvaluation\", this.props.loadedPMOEvaluation[formItem.Field_State_Name])\n // console.log(\"TCL: updateSelectsOnComponentLoad -> this.props.loadedPMOEvaluation.pmoEvaluation\", this.props.loadedPMOEvaluation.pmoEvaluation[formItem.Field_State_Name])\n // console.log(\"TCL: updateSelectsOnComponentLoad -> value\", value)\n\n // if(selectValue)\n\n // reactSelectInput.innerText = this.props.loadedPMOEvaluation.pmoEvaluation[formItem.Field_State_Name]\n\n if(selectValue.label)\n reactSelectInput.innerText = selectValue.label\n else\n reactSelectInput.innerText = selectValue\n \n \n }\n }\n\n \n });\n }\n catch (error) {\n console.log(\"TCL: updateSelectsOnComponentLoad -> error\", error)\n \n }\n }\n\n }", "function setSavedState() {\n const state = JSON.parse(localStorage.getItem('collecting_together_form'));\n if (state) {\n cfSelect.value = state.cf ? state.cf : '';\n gfSelect.value = state.gf ? state.gf : '';\n mfSelect.value = state.mf ? state.mf : '';\n amSelect.value = state.am ? state.am : '';\n }\n }", "handlePick() {\n const randomNumber = Math.floor(Math.random() * this.state.options.length);\n const option = this.state.options[randomNumber];\n }", "connectedCallback() {\n getPicklistvalues()\n .then(result => {\n let options = [];\n options.push({label: 'All', value: ''})\n result.forEach(element => {\n let option = {};\n option.label = element;\n option.value = element;\n options.push(option);\n });\n this.options = options;\n })\n .catch(error => {\n this.error = error;\n });\n }", "function TargetPicker(){}", "_initializeSelection() {\n setTimeout(() => {\n // Defer setting the value in order to avoid the \"Expression\n // has changed after it was checked\" errors from Angular.\n this._chips.forEach(chip => {\n if (chip.selected) {\n this._chipSetFoundation.select(chip.id);\n }\n });\n });\n }", "_initializeSelection() {\n setTimeout(() => {\n // Defer setting the value in order to avoid the \"Expression\n // has changed after it was checked\" errors from Angular.\n this._chips.forEach(chip => {\n if (chip.selected) {\n this._chipSetFoundation.select(chip.id);\n }\n });\n });\n }", "handleConstructorStartSeasonChange(e) {\n this.setState({\n constructorStartSeason: e.target.value\n });\n }", "function getStateForVendorUpdate() {\n\t$(\"#state_id\").empty();\n\tgetState();\n\tvar selectfirst = \"<option value='0'>Please Select State</option>\";\n\t$('#state_id').append(selectfirst);\n\t$.each(state, function(i, resData) {\n\t\tvar stateData = \"<option value=\" + resData.stateId + \">\"\n\t\t\t\t+ resData.stateName + \"</option>\";\n\t\t$(stateData).appendTo('#state_id');\n\t});\n\t$('#state_id').trigger(\"chosen:updated\");\n\t$('#state_id').chosen();\n}", "checkAttempted(type, counter) {\r\n if (type == \"radiogroup\") {\r\n for (let i = 0; i < this.state.length; i++) {\r\n if (this.state[counter].attempted != false) {\r\n document.getElementById(this.state[counter].attempted).checked = true;\r\n }\r\n }\r\n } else if (type == \"dropdown\") {\r\n if (this.state[counter].attempted != false) {\r\n var getIndex = this.state[counter].attempted.split(\"_\");\r\n document.getElementById(\"dropDown\").selectedIndex = getIndex[1];\r\n }\r\n }\r\n }", "updateCountry() {\n if (this.state.country !== this.state.selectedCountry) {\n this.setState({country: this.state.selectedCountry})\n }\n }", "handleSelectPlaceChange(val) {\n // Update the selected image object with the changed value for the right\n // form element\n const selectedImage = this.state.selectedImage;\n\n // Tie this specifically to the place item\n selectedImage.place = val.label;\n\n // Update state\n this.setState({\n selectedImage,\n selectValue: val,\n });\n }", "async onUploadImage(){\n const {selected_images} = this.state.choosed;\n await ImagePicker.openPicker({\n path: 'Photos',\n maxFiles: 5,\n includeBase64: true,\n mediaType: 'photo',\n multiple: true\n }).then(images => {\n this._visibleLoading(true);\n const selectedImages = (images&&images.length)&&images.filter(image=>!selected_images.includes(`${image.data}`)).map(image=> `${image.data}`);\n selectedImages&&this.setState({\n ...this.state,\n choosed:{\n ...this.state.choosed,\n selected_images: [...selectedImages,...selected_images]\n }\n });\n setTimeout(()=>{ this._visibleLoading(false); },500)\n });\n }", "acceptChange(){\n this.setState({\n distance: this.state.tempDistance,\n time: this.state.tempTime\n }, () => {\n this.updateTimeFilter();\n this.props.onPress();\n });\n }", "function initDatePicker() {\n var date = document.querySelector(\"input[type='date']\");\n\n function todayClickBack(){\n date.value = getCurrentJsonDate().split('T')[0];\n update();\n }\n\n getComponent('pick-date-bn').addEventListener('click',function () {\n if(!date.classList.contains('cur')){\n date.classList.add('cur');\n this.classList.add('selected');\n date.disabled = false;\n getComponent('today').addEventListener('click',todayClickBack);\n getComponent('today').classList.add('cur');\n }else{\n date.classList.remove('cur');\n getComponent('today').classList.remove('cur');\n getComponent('today').removeEventListener('click',todayClickBack);\n date.value = null;\n date.disabled = true;\n this.classList.remove('selected');\n update();\n }\n })\n date.addEventListener('change',function (e) {\n console.log(date.value);\n update();\n })\n}", "dateSelected(){\n //when date is selected need to set state to current date\n //make api call to db to see if user has info for that date yet\n //conditional to change state for conditional render if infoexist/info doesnt exist\n console.log(\"hello\");\n }", "handleTeam(e) {\n this.setState({ team: e.target.value });\n }", "setStartTime(value) {\n this.setState({ startTime: value });\n // if start date & return date are the same ...\n if (this.state.startDateLabel === this.state.endDateLabel) {\n this.state.endThis.handleTimerPicker(this.state.pickup, value);\n }\n }", "handleSelectOptionChange(selected) {\n this.setState({ selectedOption: selected });\n if (selected > -1) {\n let isFound = false; let xF = -1;\n for (let x = 0; x < this.props.company.offers.items.length; x++) {\n if (this.props.company.offers.items[x].productID === this.state.products[selected].details.id) {\n isFound = true; xF = x;\n }\n }\n\n if (isFound) {\n this.setState(prevState => ({\n offer: this.props.company.offers.items[xF],\n isSubmitValid: true,\n isUpdate: true\n }))\n } else {\n const offerNew = this.newOffer();\n this.setState(prevState => ({\n offer: {\n ...offerNew,\n productID: prevState.products[selected].details.id,\n modelNo: prevState.products[selected].details.modelNo\n },\n isSubmitValid: true,\n isUpdate: false\n }))\n }\n } else {\n this.setState({\n offer: this.newOffer(),\n isSubmitValid: false,\n isUpdate: false\n })\n }\n }", "handleChange(selection) {\n this.setState({ selectedOption: selection });\n }", "function getStateForUpdate() {\n\t$(\"#stateid\").empty();\n\tgetState();\n\tvar selectfirst = \"<option value='0'>Please Select State</option>\";\n\t$('#stateid').append(selectfirst);\n\t$.each(state, function(i, resData) {\n\t\tvar stateData = \"<option value=\" + resData.stateId + \">\"\n\t\t\t\t+ resData.stateName + \"</option>\";\n\t\t$(stateData).appendTo('#state_id');\n\t});\n\t$('#stateid').trigger(\"chosen:updated\");\n\t$('#stateid').chosen();\n}", "function loadPicker() {\n gapi.load('auth', {'callback': onAuthApiLoad});\n gapi.load('picker', {'callback': onPickerApiLoad});\n }", "function channelPickerFunctions(){\n\t\t\n\t\t// FADE THE PICKER IN\n\t\t$('.station').mousedown(function(){\n\t\t\t$('.channelPicker').fadeIn(\"fast\");\n\t\t});\n\t\t\n\t\t// FADE THE STATION PICKER OUT\t\n\t\t$('.overlay').mousedown(function(){\n\t\t\t$('.channelPicker').fadeOut(\"fast\");\n\t\t});\n\t\t\n\t\t// STATION PICKER SELECT FUNCTION\n\t\t$('.channels').click(function(){\n\t\t\t\n\t\t\t// GET THE VALUE OF THE SELECTED STATION\n\t\t\tvar channel = $(this).text();\n\t\t\t\n\t\t\t// SET THE VALUE OF THE STATION\n\t\t\t$('.stationName').text(channel);\n\n\t\t});\n\t\t\n\t\t// ACTIONS THAT HAPPEN ONCE A CHANNEL HAS BEEN SELECTED\n\t\t$('.channelPicker').mousedown(function(){\n\t\t\t$('.channelPicker').fadeOut(\"fast\");\n\t\t\t\n\t\t\t// CHANGE THE BACKGROUND TO A RANDOM ALBUM\n\t\t\tchangeBackground();\n\t\t\t\n\t\t\t// CHANGE THE ARTIST TO A RANDOM ARTIST\n\t\t\tchangeArtist();\n\t\t\t\n\t\t\t// MOVE THE NEEDLE\t\t\t\n\t\t\tmoveNeedle(getRandomInt(44,900));\n\t\t});\n\t}", "_pickerDownHandler(event) {\n const that = this;\n\n if (that.disabled || that.readonly || !JQX.Utilities.Core.isMobile && event.which !== 1) {\n return;\n }\n\n that._changeSelection(event);\n }", "setDefaultTimePickerState() {\n this.withTime = this.thyMustShowTime;\n }", "function initDatePickers(){\n $('.datepickerhotelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhotelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+1)), to: (hotel.maxNights - 1) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR HOSTEL\n $('.datepickerhostelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhostelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+1)), to: (hostel.maxNights - 1) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR MOTEL\n $('.datepickermotelIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n\n $('.datepickermotelOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+3)), to: (motel.maxNights - 3) }\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n\n // DATE PICKER FOR HOUSE\n $('.datepickerhouseIn').pickadate({\n format: 'd/m/yyyy',\n min: 1,\n onSet: function(context) {\n var selectedDate = context.select;\n var date = new Date(selectedDate);\n if (date != 'Invalid Date'){\n var dayCheckIn = date.getDate();\n var monthCheckIn = date.getMonth();\n var yearCheckIn = date.getFullYear();\n bookingDates.checkInDate = selectedDate;\n $('.datepickerhouseOut').pickadate({\n format: 'd/m/yyyy',\n disable: [\n true,\n ['inverted'],\n { from: new Date(yearCheckIn,monthCheckIn,(dayCheckIn+2)), to: (house.maxNights - 2)}\n ],\n onSet: function(context){\n bookingDates.checkOutDate = context.select;\n }\n });\n }\n }\n });\n } // Invoked at line 186", "constructor (props) {\n super(props)\n this.state = {\n isLoading : true,\n locationData: [],\n selectedValue: ''\n }\n }", "componentDidUpdate() {\n if (this.state.players[1].aI === true) {\n this.computerPick();\n }\n }", "handleOfficialChange(event) {\n this.setState({\n officialOption: event.target.value,\n officialComp: this.state.officialComp\n }, () => {\n this.loadOfficial();\n });\n }", "onChangeUsername() {\n this.setState({ isUsernameChosen: false });\n }", "render() {\n\n return (\n\t\t<View style={styles.container}>\n\n <View style={{height: 50}}></View>\n\n\t\t\t<Text style={styles.textS}>Time you want to wake up</Text>\n\n\t\t\t<TouchableWithoutFeedback\n\t\t\t\tonPress={this.showPicker.bind(this, 'isoFormat', {\n\t\t\t\thour: this.state.WakeUpTimeHours,\n\t\t\t\tminute: this.state.WakeUpTimeMinutes,\n\t\t\t\tis24Hour: true,\n\t\t\t})}>\n\t\t\t\t<View>\n\t\t\t\t\t<Text style={styles.textL}>{this.formatTime(this.state.WakeUpTimeHours, this.state.WakeUpTimeMinutes)}</Text>\n\t\t\t\t</View>\n\t\t\t</TouchableWithoutFeedback>\n\n <View style={{height: 150}}></View>\n\n <Text style={styles.textS}>Sunrise</Text>\n\n <View style={{height: 5}}></View>\n\n <Switch\n onValueChange={(value) => this.setState({scheduleIsOn: value})}\n value={this.state.scheduleIsOn} />\n\n <View style={{height: 20}}></View>\n\n <Text style={styles.textS}>Minutes sunrise starts before you want to wake up</Text>\n\n <Picker\n style={styles.picker}\n selectedValue={this.state.sunriseDurationBeforeWakeUp.toString()}\n onValueChange={(value) => this.setState({sunriseDurationBeforeWakeUp: parseInt(value)})}\n >\n <Picker.Item label=\"0\" value=\"0\" />\n <Picker.Item label=\"5\" value=\"5\" />\n <Picker.Item label=\"10\" value=\"10\" />\n <Picker.Item label=\"15\" value=\"15\" />\n <Picker.Item label=\"20\" value=\"20\" />\n <Picker.Item label=\"25\" value=\"25\" />\n <Picker.Item label=\"30\" value=\"30\" />\n </Picker>\n\n\t\t</View>\n );\n }", "function flip(){\n const temp = counOnePicker.value;\n counOnePicker.value = counTwoPicker.value;\n counTwoPicker.value = temp;\n\n \n calculate();\n \n}", "onTripTypeChange(evt)\n {\n this.setState({tripType: evt.target.value});\n }", "constructor() {\n super();\n this.state = {\n selected: null,\n };\n }", "stateChanged(state) {\n this._items = selectedRoomListSelector(state);\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "chooseData() {\n // ******* TODO: PART I *******\n //Changed the selected data when a user selects a different\n // menu item from the drop down.\n\n }", "function loadPicker() {\r\n gapi.load('auth', {'callback': onAuthApiLoad});\r\n gapi.load('picker', {'callback': onPickerApiLoad});\r\n}", "constructor(props) {\n super(props);\n this.state = {\n //TODO: Remove this hideousness\n presets: JSON.parse(localStorage.getItem('selectedPresets') || '[]'),\n options: {waveform: 'sine', loop: true}\n };\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 }", "onValueChange(value: string) {\n this.setState({\n selected1: value\n });\n }", "function setUpdatingState() {\n status.innerText = 'Updating arrangements...';\n status.style.color = 'black';\n playButton.disabled = true;\n alphaSlider.disabled = true;\n sampleButton1.disabled = true;\n sampleButton2.disabled = true;\n saveButton.disabled = true;\n changeChordsButton.disabled = true;\n chordInputs.forEach(c => c.disabled = true);\n chordInputs.forEach(c => c.style.color = 'gray');\n}", "_setDefEditors() {\n var last = LocalStore.getLast(), all = LocalStore.getAll(), ln = all.length, selected = {};\n for (let i = 0; i < ln; i++) {\n let item = all[i];\n if (item.checked) {\n selected[item.timestamp] = item;\n }\n }\n this.setState({mainBlock: last, selected: selected});\n }", "function setInputValues() {\n var stateFilter = settings['state-date'] || settings['state-record'];\n if (stateFilter) {\n if ('date' === stateFilter['type']) {\n if (stateFilter['operands'].hasOwnProperty('value')) {\n if ('>' === stateFilter['operator'] || '=' === stateFilter['operator']) {\n lower.formatToUtc(stateFilter['operands']['value'], true);\n upper.setData('');\n } else if ('<' === stateFilter['operator']) {\n upper.formatToUtc(stateFilter['operands']['value'], true);\n lower.setData('');\n }\n } else {\n lower.formatToUtc(stateFilter['operands']['lower'], true);\n upper.formatToUtc(stateFilter['operands']['upper'], true);\n }\n dateSelector.selectOption('title');\n dateSelector.enableOptions();\n }\n else if ('number' === stateFilter['type']) {\n if (stateFilter['operands'].hasOwnProperty('value')) {\n if ('>' === stateFilter['operator'] || '=' === stateFilter['operator']) {\n lower.setData(stateFilter['operands']['value']);\n upper.setData('');\n } else if ('<' === stateFilter['operator']) {\n upper.setData(stateFilter['operands']['value']);\n lower.setData('');\n }\n } else {\n lower.setData(stateFilter['operands']['lower']);\n upper.setData(stateFilter['operands']['upper']);\n }\n }\n $filterLink.addClass('filtered');\n clearBtn.getElement().prop('disabled', false);\n }\n }", "function peoplePickerActive(event) {\n /** Scroll the view so that the people picker is at the top. */\n $('html, body').animate({\n scrollTop: $peoplePicker.offset().top\n }, 367);\n\n /** Start by closing any open people pickers. */\n if ( $peoplePicker.hasClass('is-active') ) {\n $peoplePicker.removeClass(\"is-active\");\n }\n\n /** Display a maxiumum of 5 people in Facepile variant */\n if ($peoplePicker.hasClass('ms-PeoplePicker--Facepile') && $searchField.val() === \"\") {\n $peopleList.children(\":gt(4)\").hide();\n }\n\n /** Animate results and members in Facepile variant. */\n if ($peoplePicker.hasClass('ms-PeoplePicker--Facepile')) {\n // $results.addClass('ms-u-slideDownIn20');\n $selectedPeople.addClass('ms-u-slideDownIn20');\n setTimeout(function() { $results.removeClass('ms-u-slideDownIn20'); $selectedPeople.removeClass('ms-u-slideDownIn20');}, 1000);\n }\n\n isActive = true;\n\n /** Stop the click event from propagating, which would just close the dropdown immediately. */\n event.stopPropagation();\n\n /** Before opening, size the results panel to match the people picker. */\n if (!$peoplePicker.hasClass('ms-PeoplePicker--Facepile')) {\n $results.width($peoplePicker.width() - 2);\n }\n\n /** Show the $results by setting the people picker to active. */\n $peoplePicker.addClass(\"is-active\");\n\n /** Temporarily bind an event to the document that will close the people picker when clicking anywhere. */\n $(document).bind(\"click.peoplepicker\", function() {\n $peoplePicker.removeClass('is-active');\n if ($peoplePicker.hasClass('ms-PeoplePicker--Facepile')) {\n $peoplePicker.removeClass('is-searching');\n $('.ms-PeoplePicker-selected').show();\n $('.ms-PeoplePicker-searchMore').removeClass('is-active');\n $searchField.val(\"\");\n }\n $(document).unbind('click.peoplepicker');\n isActive = false;\n });\n }", "onValueChange(value: string) {\n this.setState({\n selected: value\n });\n }" ]
[ "0.7216407", "0.68951535", "0.6845155", "0.66380024", "0.6548477", "0.65253407", "0.6477068", "0.63730913", "0.62361926", "0.6196419", "0.60491556", "0.6031117", "0.60304826", "0.6018748", "0.5975368", "0.5966839", "0.5966839", "0.5962316", "0.595822", "0.59511197", "0.5935624", "0.5915504", "0.5891306", "0.5881383", "0.5874282", "0.5866629", "0.5862027", "0.5838457", "0.5816255", "0.58158886", "0.580007", "0.5793819", "0.57828444", "0.5782252", "0.57809836", "0.5779799", "0.5778907", "0.5774166", "0.5774166", "0.5773879", "0.5773231", "0.57728136", "0.5771656", "0.5770899", "0.5768108", "0.5754229", "0.5747391", "0.5742233", "0.57316184", "0.57298714", "0.57264566", "0.572293", "0.5716163", "0.5714467", "0.5704525", "0.57004064", "0.5700115", "0.5696931", "0.5696187", "0.56771374", "0.56771374", "0.5675399", "0.56733185", "0.56520504", "0.5646942", "0.56315815", "0.56303394", "0.5630099", "0.560649", "0.55990344", "0.5597326", "0.5597175", "0.55945176", "0.5588099", "0.5584127", "0.5584102", "0.55825335", "0.5578493", "0.55771065", "0.55726796", "0.5564759", "0.55507296", "0.55463374", "0.5541138", "0.55394655", "0.5537888", "0.5534394", "0.553415", "0.55312306", "0.5527212", "0.5527212", "0.55265653", "0.55217236", "0.55118364", "0.55109733", "0.54948163", "0.5494309", "0.5487472", "0.54865366", "0.548419" ]
0.6951598
1
POLYFILL for not supporting properties document; codeMirror;
constructor() { super(); this._document= this.attachShadow( { mode: 'open', }, ); styleLoader.apply( this._document, ); const tags= document.createElement( 'div', ); tags.classList.add( 'tags', ); this._document.appendChild( tags, ); const filename= this.getAttribute( 'filename', ); const filenameTag= document.createElement( 'span', ); filenameTag.classList.add( 'filename-tag', ); filenameTag.appendChild( document.createTextNode( filename|| '', ), ) tags.appendChild( filenameTag, ); const langage= this.getAttribute( 'language', )|| 'text'; const languageTag= document.createElement( 'span', ); languageTag.classList.add( 'language-tag', ); languageTag.appendChild( document.createTextNode( langage, ), ) tags.appendChild( languageTag, ); const content= unifyCode( this.childNodes.mapAndFilter( node=> node instanceof Text&& node.data, ).implode(), ); this._codeMirror= new CodeMirror( this._document, { value: content, mode: langage, indentUnit: 4, indentWithTabs: true, readOnly: this.hasAttribute( 'readonly', ), }, ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "astProperties() {\r\n\t\t\t\t\treturn {};\r\n\t\t\t\t}", "function PropertyDetection() {}", "skipProperties() {\n return [];\n }", "parseProps(element, astElement, code, options) {\n // assign a unique `oid` to the element\n const { fragment } = options;\n if (fragment) {\n element.oid = fragment.getUniqueOid();\n fragment.oids[element.oid] = element;\n }\n return super.parseProps(element, astElement, code, options) || {};\n }", "function loose(node, body, objId) {\n var _arr = node.properties;\n\n for (var _i = 0; _i < _arr.length; _i++) {\n var prop = _arr[_i];\n body.push(t.expressionStatement(t.assignmentExpression(\"=\", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), prop.value)));\n }\n}", "function loose(node, body, objId) {\n\t var _arr = node.properties;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var prop = _arr[_i];\n\t body.push(t.expressionStatement(t.assignmentExpression(\"=\", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), prop.value)));\n\t }\n\t}", "function loose(node, body, objId) {\n\t var _arr = node.properties;\n\n\t for (var _i = 0; _i < _arr.length; _i++) {\n\t var prop = _arr[_i];\n\t body.push(t.expressionStatement(t.assignmentExpression(\"=\", t.memberExpression(objId, prop.key, prop.computed || t.isLiteral(prop.key)), prop.value)));\n\t }\n\t}", "unknownProperty() {\n return false;\n }", "_initializeProperties() {}", "function descriminatingProperty() { }", "static renderProperties(properties, tags, modulePathMapper) {\n loop: for (const descriptor of properties) {\n const node = descriptor.node;\n const existingJsDoc = JsDocRenderer.getComment(node);\n const parsed = existingJsDoc == null ? null : doctrine_1.parse(existingJsDoc, { unwrap: true });\n let defaultValue = descriptor.defaultValue;\n let isOptional = descriptor.isOptional;\n let description = parsed == null ? \"\" : parsed.description;\n if (parsed != null) {\n for (const tag of parsed.tags) {\n switch (tag.title) {\n case \"default\":\n defaultValue = tag.description;\n break;\n case \"private\":\n continue loop;\n case \"required\":\n isOptional = false;\n break;\n case \"see\":\n description += `\\nSee: ${tag.description}`;\n break;\n case \"deprecated\":\n description += `\\nDeprecated: {tag.description}`;\n break;\n default: {\n const sourceFile = node.getSourceFile();\n const leadingCommentRanges = ts.getLeadingCommentRanges(sourceFile.text, node.pos);\n const position = sourceFile.getLineAndCharacterOfPosition(leadingCommentRanges[0].pos);\n console.warn(`${path.basename(sourceFile.fileName)} ${position.line + 1}:${position.character} property level tag \"${tag.title}\" are not supported, please file issue`);\n }\n }\n }\n }\n let result = `@property ${renderTypes(descriptor.types, modulePathMapper)} `;\n if (isOptional) {\n result += \"[\";\n }\n result += descriptor.name;\n if (defaultValue != null) {\n result += `=${defaultValue}`;\n }\n if (isOptional) {\n result += \"]\";\n }\n if (description != null) {\n description = description.trim();\n if (description.length > 0) {\n // one \\n is not translated to break as markdown does (because in the code newline means that we don't want to use long line and have to break)\n description = description\n .replace(/\\n\\n/g, \"<br><br>\")\n .replace(/\\n/g, \" \");\n // http://stackoverflow.com/questions/28733282/jsdoc-multiline-description-property\n result += ` ${description}`;\n }\n }\n tags.push(result);\n }\n }", "loadOwnProperties(){\r\n \t\t\r\n\t}", "function De(){return!1===B.allowannotations&&L(\"InitError\",'The \"allowannotations\" property in the WebDocumentViewer config is set to false.'),B.allowannotations}", "function undeletablePropertiesStrict() {\n 'use strict';\n delete Object.prototype; // throws type error in strict\n}", "function stripMetadata(data) {\n return data.Properties;\n }", "static get properties() {\n return {\n id: {\n attribute: \"mapid\",\n },\n derivation: {\n attribute: \"derivation\",\n type: String,\n },\n };\n }", "astProperties(o) {\r\n\t\t\t\t\tvar computed, property, ref1, ref2;\r\n\t\t\t\t\tref1 = this.properties, [property] = slice1.call(ref1, -1);\r\n\t\t\t\t\tif (this.isJSXTag()) {\r\n\t\t\t\t\t\tproperty.name.jsx = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcomputed = property instanceof Index || !(((ref2 = property.name) != null ? ref2.unwrap() : void 0) instanceof PropertyName);\r\n\t\t\t\t\treturn {\r\n\t\t\t\t\t\tobject: this.object().ast(o, LEVEL_ACCESS),\r\n\t\t\t\t\t\tproperty: property.ast(o, (computed ? LEVEL_PAREN : void 0)),\r\n\t\t\t\t\t\tcomputed,\r\n\t\t\t\t\t\toptional: !!property.soak,\r\n\t\t\t\t\t\tshorthand: !!property.shorthand\r\n\t\t\t\t\t};\r\n\t\t\t\t}", "static getNewProperties() {\n return {};\n }", "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}}", "function apply_autodetected(m, ast, inheritable) {\n docset = find_docset(ast);\n var inheritable = inheritable || true;\n \n if (!docset || docset[\"type\"] != \"doc_comment\") {\n if (inheritable)\n m[\"inheritdoc\"] = {};\n else\n m[\"private\"] = true;\n \n m[\"autodetected\"] = true;\n }\n\n if (docset) {\n docset[\"code\"] = m;\n return false;\n }\n else {\n // Get line number from third place at range array.\n // This third item exists in forked EsprimaJS at\n // https://github.com/nene/esprima/tree/linenr-in-range\n m[\"linenr\"] = ast[\"range\"][2];\n return true;\n }\n}", "static get properties() {\n return {\n \"cityProp\": {\n \"name\": \"cityProp\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflect\": true,\n \"attribute\": true,\n \"observer\": false\n },\n \"inputId\": {\n \"name\": \"inputId\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n },\n \"width\": {\n \"name\": \"width\",\n \"type\": \"String\",\n \"value\": \" \",\n \"reflectToAttribute\": false,\n \"observer\": false\n }\n}\n;\n }", "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();}", "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValueEc8e588e.Node.endOfIndent(src, offset) : PlainValueEc8e588e.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValueEc8e588e.Char.ANCHOR || ch === PlainValueEc8e588e.Char.COMMENT || ch === PlainValueEc8e588e.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n const lineStart = offset + 1;\n const inEnd = PlainValueEc8e588e.Node.endOfIndent(src, lineStart);\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValueEc8e588e.Type.SEQ_ITEM && parent.context.atLineStart;\n if (!PlainValueEc8e588e.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValueEc8e588e.Char.COMMENT) {\n const end = PlainValueEc8e588e.Node.endOfLine(src, offset + 1);\n props.push(new PlainValueEc8e588e.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValueEc8e588e.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValueEc8e588e.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValueEc8e588e.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValueEc8e588e.Range(offset, end));\n lineHasProps = true;\n offset = PlainValueEc8e588e.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValueEc8e588e.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "function module$contents$google3$third_party$javascript$security$polymer_resin$allowed$2ddom$2dproperties_getDomPropertyContract(a,b){var c,d;switch(b){case \"innerHTML\":return a=module$contents$google3$third_party$javascript$security$polymer_resin$allowed$2ddom$2dproperties_getContentType(a),a===module$exports$google3$third_party$javascript$security$html$contracts$contracts.ElementContentType.SAFE_HTML?module$exports$google3$third_party$javascript$security$html$contracts$contracts.AttrType.SAFE_HTML:\nnull;case \"textContent\":return a=module$contents$google3$third_party$javascript$security$polymer_resin$allowed$2ddom$2dproperties_getContentType(a),a===module$exports$google3$third_party$javascript$security$html$contracts$contracts.ElementContentType.SAFE_HTML||a===module$exports$google3$third_party$javascript$security$html$contracts$contracts.ElementContentType.STRING_RCDATA?module$exports$google3$third_party$javascript$security$html$contracts$contracts.AttrType.NONE:null;default:return null!==(d=\nnull===(c=module$contents$google3$third_party$javascript$security$polymer_resin$allowed$2ddom$2dproperties_propertyAllowlist[a.localName])||void 0===c?void 0:c[b])&&void 0!==d?d:null}}", "static get properties(){return{source:{name:\"source\",type:\"String\"},hasSource:{name:\"hasSource\",type:\"Boolean\",computed:\"_calculateHasSource(source)\"},markdown:{name:\"markdown\",type:\"String\"}}}", "function testConstructComplex() {\r\n\tvar prop1 = new ORYX.Core.StencilSet.Property(jsonPropComplex, \"testNS\", stencil);\r\n\tassertEquals(false, prop1.readonly());\r\n\tassertEquals(true, prop1.optional());\r\n\t\r\n\tassertEquals(\"v1\", prop1.complexItem(\"id1\").value());\r\n\tassertEquals(\"n1\", prop1.complexItem(\"id1\").name());\r\n\tassertEquals(\"string\", prop1.complexItem(\"id1\").type());\r\n\tassertEquals(100, prop1.complexItem(\"id1\").width());\r\n\tassertEquals(false, prop1.complexItem(\"id1\").optional());\r\n\t\r\n\tassertEquals(\"v2\", prop1.complexItem(\"id2\").value());\r\n\tassertEquals(\"n2\", prop1.complexItem(\"id2\").name());\r\n\tassertEquals(\"choice\", prop1.complexItem(\"id2\").type());\r\n\tassertEquals(\"vc1\", prop1.complexItem(\"id2\").items()[0].value());\r\n\tassertEquals(\"vc2\", prop1.complexItem(\"id2\").items()[1].value());\r\n}", "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValueEc8e588e.Node.endOfIndent(src, offset) : PlainValueEc8e588e.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValueEc8e588e.Char.ANCHOR || ch === PlainValueEc8e588e.Char.COMMENT || ch === PlainValueEc8e588e.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n let inEnd = offset;\n let lineStart;\n\n do {\n lineStart = inEnd + 1;\n inEnd = PlainValueEc8e588e.Node.endOfIndent(src, lineStart);\n } while (src[inEnd] === '\\n');\n\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValueEc8e588e.Type.SEQ_ITEM && parent.context.atLineStart;\n if (src[inEnd] !== '#' && !PlainValueEc8e588e.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValueEc8e588e.Char.COMMENT) {\n const end = PlainValueEc8e588e.Node.endOfLine(src, offset + 1);\n props.push(new PlainValueEc8e588e.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValueEc8e588e.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValueEc8e588e.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValueEc8e588e.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValueEc8e588e.Range(offset, end));\n lineHasProps = true;\n offset = PlainValueEc8e588e.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValueEc8e588e.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "loadOwnProperties(){\r\n//\t\tdebugger;\r\n\t\tvar self=this;\r\n//\t\tself.autoAddPostHtml=false;\r\n\t\tself.name=self.getAttrVal(\"name\");\r\n\t\tself.nameRest=self.getAttrVal(\"nameRest\");\r\n\t\tself.type=self.getAttrVal(\"type\");\r\n//\t\tself.where=self.getAttrVal(\"where\",undefined,false);\r\n\t\tself.innerVarName=self.getAttrVal(\"as\",undefined,false);\r\n\t\tself.resultVarName=self.getAttrVal(\"resultvarname\");\r\n\t\tself.restVarName=self.getAttrVal(\"restvarname\");\r\n\t\t\r\n\t\tself.bWithRest=false;\r\n\t\tself.hsResult;\r\n\t\tself.hsRest;\r\n\t\t\r\n\t\tself.recursiveField=self.getAttrVal(\"recursivefield\",undefined,false);\r\n\t\t\r\n\t\tself.source=self.getAttrVal(\"source\");\r\n\t\tself.sourceJson=self.getAttrVal(\"sourcejson\");\r\n\t\tself.sourceJS=self.getAttrVal(\"sourcejs\",undefined,false);\r\n\t\tself.sourceFormula=self.getAttrVal(\"sourceformula\",undefined,false);\r\n\t\t\r\n\t\tself.whereCondition=self.getAttrVal(\"where\",undefined,false);\r\n\t\tself.orderFormula=self.getAttrVal(\"order\",undefined,false);\r\n\t\tself.boundStartAt=self.getAttrVal(\"start\",undefined,false);\r\n\t\tself.boundLimit=self.getAttrVal(\"limit\",undefined,false);\r\n\t}", "static get properties(){return{}}", "static get properties(){return{}}", "replaceProperties(replacedNode, newNode) {}", "getPropertiesWithComments() {\r\n const members = utils_2.ExtendedParser.getContainerArray(this.compilerNode, this.getSourceFile().compilerNode);\r\n return members.map(p => this._getNodeFromCompilerNode(p));\r\n }", "function removeUnknownProps(doc){\n\tdelete doc.created;\n\tdelete doc.modified;\n\tdelete doc.id;\n\tdelete doc._id\n\treturn doc\n}", "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValue.Node.endOfIndent(src, offset) : PlainValue.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValue.Char.ANCHOR || ch === PlainValue.Char.COMMENT || ch === PlainValue.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n let inEnd = offset;\n let lineStart;\n\n do {\n lineStart = inEnd + 1;\n inEnd = PlainValue.Node.endOfIndent(src, lineStart);\n } while (src[inEnd] === '\\n');\n\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValue.Type.SEQ_ITEM && parent.context.atLineStart;\n if (src[inEnd] !== '#' && !PlainValue.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValue.Char.COMMENT) {\n const end = PlainValue.Node.endOfLine(src, offset + 1);\n props.push(new PlainValue.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValue.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValue.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValue.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValue.Range(offset, end));\n lineHasProps = true;\n offset = PlainValue.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValue.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "function pushProperty(p) {\n // push and init and patch up to resume\n if (attrib && attrib.attribName === \"style\") {\n attrib.attribValue.push(_objectSpread__default['default']({}, p));\n } else if (token && Array.isArray(token.properties)) {\n token.properties.push(_objectSpread__default['default']({}, p));\n }\n } // Initial resets:", "function cfnDocumentDocumentRequiresPropertyToCloudFormation(properties) {\n if (!cdk.canInspect(properties)) {\n return properties;\n }\n CfnDocument_DocumentRequiresPropertyValidator(properties).assertSuccess();\n return {\n Name: cdk.stringToCloudFormation(properties.name),\n Version: cdk.stringToCloudFormation(properties.version),\n };\n}", "function property(e){// tslint:disable-next-line:no-any decorator\nreturn(t,n)=>n===void 0?standardProperty(e,t):legacyProperty(e,t,n)}", "function repairDataProperties(realmRec) {\n const { eagerFreezeIntrinsics: i } = realmRec;\n\n fastArrayForEach(\n [\n i.ObjectPrototype,\n i.ArrayPrototype,\n i.BooleanPrototype,\n i.DatePrototype,\n i.NumberPrototype,\n i.StringPrototype,\n\n i.FunctionPrototype,\n i.GeneratorPrototype,\n i.AsyncFunctionPrototype,\n i.AsyncGeneratorPrototype,\n\n i.IteratorPrototype,\n i.ArrayIteratorPrototype,\n\n i.PromisePrototype,\n i.DataViewPrototype,\n\n i.TypedArray,\n i.Int8ArrayPrototype,\n i.Int16ArrayPrototype,\n i.Int32ArrayPrototype,\n i.Uint8Array,\n i.Uint16Array,\n i.Uint32Array\n ],\n beMutableProperties\n );\n\n fastArrayForEach(\n [\n i.ErrorPrototype,\n i.EvalErrorPrototype,\n i.RangeErrorPrototype,\n i.ReferenceErrorPrototype,\n i.SyntaxErrorPrototype,\n i.TypeErrorPrototype,\n i.URIErrorPrototype\n ],\n proto => beMutableProperty(proto, 'message')\n );\n}", "function p(e,t,p,h,f,d){a=a||n(24);const m=(h?h+\".\":\"\")+e;h=h||\"\",t?Object.defineProperty(p,e,{enumerable:!0,configurable:!0,get:function(){const e=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[m]){const n=Object.create(a.prototype,function(e){const t={};return Object.getOwnPropertyNames(e).forEach((function(n){t[n]=Object.getOwnPropertyDescriptor(e,n),t[n].get?delete t[n]:t[n].enumerable=-1===[\"isNew\",\"$__\",\"errors\",\"_doc\",\"$locals\",\"$op\",\"__parentArray\",\"__index\",\"$isDocumentArrayElement\"].indexOf(n)})),t}(this));h||(n.$__[l]=this),n.$__.nestedPath=m,Object.defineProperty(n,\"schema\",{enumerable:!1,configurable:!0,writable:!1,value:p.schema}),Object.defineProperty(n,\"$__schema\",{enumerable:!1,configurable:!0,writable:!1,value:p.schema}),Object.defineProperty(n,o,{enumerable:!1,configurable:!0,writable:!1,value:p.schema}),Object.defineProperty(n,\"toObject\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return i.clone(e.get(m,null,{virtuals:r(this,\"schema.options.toObject.virtuals\",null)}))}}),Object.defineProperty(n,\"$__get\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return e.get(m,null,{virtuals:r(this,\"schema.options.toObject.virtuals\",null)})}}),Object.defineProperty(n,\"toJSON\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return e.get(m,null,{virtuals:r(e,\"schema.options.toJSON.virtuals\",null)})}}),Object.defineProperty(n,\"$__isNested\",{enumerable:!1,configurable:!0,writable:!1,value:!0});const s=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(n,\"$isEmpty\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(m,null,s)||{}).length}}),Object.defineProperty(n,\"$__parent\",{enumerable:!1,configurable:!0,writable:!1,value:this}),u(t,n,m,d),this.$__.getters[m]=n}return this.$__.getters[m]},set:function(e){null!=e&&e.$__isNested?e=e.$__get():e instanceof a&&!e.$__isNested&&(e=e.toObject(s));(this.$__[l]||this).$set(m,e)}}):Object.defineProperty(p,e,{enumerable:!0,configurable:!0,get:function(){return this[c].call(this.$__[l]||this,m)},set:function(e){this.$set.call(this.$__[l]||this,m,e)}})}", "function isPOJS(prop) {\n return !(\n prop instanceof Date ||\n prop instanceof RegExp ||\n prop instanceof String ||\n prop instanceof Number) &&\n typeof prop === 'object' &&\n prop !== null;\n }", "function isPOJS(prop) {\n return !(\n prop instanceof Date ||\n prop instanceof RegExp ||\n prop instanceof String ||\n prop instanceof Number) &&\n typeof prop === 'object' &&\n prop !== null;\n }", "jsdocPeldaPrivate() {}", "function HandlePropfind() {\n // Default features.\n this.features = [\n '1', '2', '3'// , 'extended-mkcol'\n ];\n}", "function f(t,e,f,p,h,y){n=n||r(6);var d=(p?p+\".\":\"\")+t;p=p||\"\",e?Object.defineProperty(f,t,{enumerable:!0,configurable:!0,get:function(){var t,r,s=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[d]){var u=Object.create(n.prototype,(t=this,r={},Object.getOwnPropertyNames(t).forEach((function(e){r[e]=Object.getOwnPropertyDescriptor(t,e),r[e].get?delete r[e]:r[e].enumerable=-1===[\"isNew\",\"$__\",\"errors\",\"_doc\",\"$locals\",\"$op\",\"__parentArray\",\"__index\",\"$isDocumentArrayElement\"].indexOf(e)})),r));p||(u.$__[c]=this),u.$__.nestedPath=d,Object.defineProperty(u,\"schema\",{enumerable:!1,configurable:!0,writable:!1,value:f.schema}),Object.defineProperty(u,\"$__schema\",{enumerable:!1,configurable:!0,writable:!1,value:f.schema}),Object.defineProperty(u,o,{enumerable:!1,configurable:!0,writable:!1,value:f.schema}),Object.defineProperty(u,\"toObject\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return a.clone(s.get(d,null,{virtuals:i(this,\"schema.options.toObject.virtuals\",null)}))}}),Object.defineProperty(u,\"$__get\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return s.get(d,null,{virtuals:i(this,\"schema.options.toObject.virtuals\",null)})}}),Object.defineProperty(u,\"toJSON\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return s.get(d,null,{virtuals:i(s,\"schema.options.toJSON.virtuals\",null)})}}),Object.defineProperty(u,\"$__isNested\",{enumerable:!1,configurable:!0,writable:!1,value:!0});var h=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(u,\"$isEmpty\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(d,null,h)||{}).length}}),Object.defineProperty(u,\"$__parent\",{enumerable:!1,configurable:!0,writable:!1,value:this}),l(e,u,d,y),this.$__.getters[d]=u}return this.$__.getters[d]},set:function(t){null!=t&&t.$__isNested?t=t.$__get():t instanceof n&&!t.$__isNested&&(t=t.toObject(s)),(this.$__[c]||this).$set(d,t)}}):Object.defineProperty(f,t,{enumerable:!0,configurable:!0,get:function(){return this[u].call(this.$__[c]||this,d)},set:function(t){this.$set.call(this.$__[c]||this,d,t)}})}", "recomputeDecorations() {\r\n this.uglyDecorationRanges = new DisjointRangeSet_1.DisjointRangeSet();\r\n this.grammarState = [];\r\n for (const subst of this.prettyDecorations.unscoped)\r\n subst.ranges = new DisjointRangeSet_1.DisjointRangeSet();\r\n for (const subst of this.prettyDecorations.scoped)\r\n subst.ranges = new DisjointRangeSet_1.DisjointRangeSet();\r\n this.debugDecorations.forEach((val) => val.ranges = []);\r\n const docRange = new vscode.Range(0, 0, this.document.getLineCount(), 0);\r\n this.reparsePretties(docRange);\r\n }", "function convertPatternProperties(schema) {\n\tschema['x-patternProperties'] = schema['patternProperties'];\n\tdelete schema['patternProperties'];\n\treturn schema;\n}", "function property(options){// tslint:disable-next-line:no-any decorator\nreturn(protoOrDescriptor,name)=>name!==void 0?legacyProperty(options,protoOrDescriptor,name):standardProperty(options,protoOrDescriptor)}", "allowComments() {this.commentsAllowed = true}", "static get properties() {\n return {\n derivation: {\n attribute: 'derivation',\n type: String\n }\n }\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach(function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)})}", "_upgradeProperty(prop) {\n // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n // https://developers.google.com/web/fundamentals/web-components/examples/howto-checkbox\n /* eslint no-prototype-builtins: 0 */\n if (this.hasOwnProperty(prop)) {\n const value = this[prop];\n // get rid of the property that might shadow a setter/getter\n delete this[prop];\n // this time if a setter was defined it will be properly called\n this[prop] = value;\n // if a getter was defined, it will be called from now on\n }\n }", "function jsDAV_Property() {}", "_initializeProperties(){}// prevent user code in connected from running", "constructor() {\n // initialize properties as undefined here for clarity, could be done in a public field once these are more widely implemented\n this.x = undefined;\n this.y = undefined;\n this.representation = undefined;\n }", "parseProps(offset) {\n const {\n inFlow,\n parent,\n src\n } = this;\n const props = [];\n let lineHasProps = false;\n offset = this.atLineStart ? PlainValue.Node.endOfIndent(src, offset) : PlainValue.Node.endOfWhiteSpace(src, offset);\n let ch = src[offset];\n\n while (ch === PlainValue.Char.ANCHOR || ch === PlainValue.Char.COMMENT || ch === PlainValue.Char.TAG || ch === '\\n') {\n if (ch === '\\n') {\n const lineStart = offset + 1;\n const inEnd = PlainValue.Node.endOfIndent(src, lineStart);\n const indentDiff = inEnd - (lineStart + this.indent);\n const noIndicatorAsIndent = parent.type === PlainValue.Type.SEQ_ITEM && parent.context.atLineStart;\n if (!PlainValue.Node.nextNodeIsIndented(src[inEnd], indentDiff, !noIndicatorAsIndent)) break;\n this.atLineStart = true;\n this.lineStart = lineStart;\n lineHasProps = false;\n offset = inEnd;\n } else if (ch === PlainValue.Char.COMMENT) {\n const end = PlainValue.Node.endOfLine(src, offset + 1);\n props.push(new PlainValue.Range(offset, end));\n offset = end;\n } else {\n let end = PlainValue.Node.endOfIdentifier(src, offset + 1);\n\n if (ch === PlainValue.Char.TAG && src[end] === ',' && /^[a-zA-Z0-9-]+\\.[a-zA-Z0-9-]+,\\d\\d\\d\\d(-\\d\\d){0,2}\\/\\S/.test(src.slice(offset + 1, end + 13))) {\n // Let's presume we're dealing with a YAML 1.0 domain tag here, rather\n // than an empty but 'foo.bar' private-tagged node in a flow collection\n // followed without whitespace by a plain string starting with a year\n // or date divided by something.\n end = PlainValue.Node.endOfIdentifier(src, end + 5);\n }\n\n props.push(new PlainValue.Range(offset, end));\n lineHasProps = true;\n offset = PlainValue.Node.endOfWhiteSpace(src, end);\n }\n\n ch = src[offset];\n } // '- &a : b' has an anchor on an empty node\n\n\n if (lineHasProps && ch === ':' && PlainValue.Node.atBlank(src, offset + 1, true)) offset -= 1;\n const type = ParseContext.parseType(src, offset, inFlow);\n return {\n props,\n type,\n valueStart: offset\n };\n }", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key]}}}", "function canDefineNonEnumerableProperties() {\n var testObj = {};\n var testPropName = \"t\";\n\n try {\n Object.defineProperty(testObj, testPropName, {\n enumerable: false,\n value: testObj\n });\n\n for (var k in testObj) {\n if (k === testPropName) {\n return false;\n }\n }\n } catch (e) {\n return false;\n }\n\n return testObj[testPropName] === testObj;\n }", "static get properties() {\n return {\n value: {\n type: String,\n },\n fontSize: {\n type: Number,\n attribute: \"font-size\",\n },\n wordWrap: {\n type: Boolean,\n attribute: \"word-wrap\",\n },\n readOnly: {\n type: Boolean,\n attribute: \"read-only\",\n },\n /**\n * THIS MAKES MULTIPLES EDITORS WORK BECAUSE OF EVENTS\n * DO NOT MESS WITH THIS AND IT HAS TO BE SET\n */\n uniqueKey: {\n type: String,\n attribute: \"unique-key\",\n },\n eventTypes: {\n type: Object,\n },\n language: {\n type: String,\n },\n theme: {\n type: String,\n },\n libPath: {\n type: String,\n attribute: \"lib-path\",\n },\n editorReference: {\n type: String,\n reflect: true,\n attribute: \"editor-reference\",\n },\n /**\n * automatically set focus on the iframe\n */\n autofocus: {\n type: Boolean,\n reflect: true,\n },\n /**\n * hide line numbers\n */\n hideLineNumbers: {\n type: Boolean,\n attribute: \"hide-line-numbers\",\n },\n tabSize: {\n type: Number,\n attribute: \"tab-size\",\n },\n };\n }", "function decodify (featureCollection, code, properties) {\n var feature = find(featureCollection.features, {'id': code});\n\n if (feature) {\n feature.properties = properties;\n }\n\n return feature;\n}", "_enableProperties() {\n if (!this.hasAttribute(DISABLED_ATTR)) {\n if (!this.__dataEnabled) {\n super._initializeProperties();\n }\n\n super._enableProperties();\n }\n }", "Partial(schema, options = {}) {\r\n const next = { ...clone(schema), ...options };\r\n delete next.required;\r\n for (const key of Object.keys(next.properties)) {\r\n const property = next.properties[key];\r\n switch (property.modifier) {\r\n case exports.ReadonlyOptionalModifier:\r\n property.modifier = exports.ReadonlyOptionalModifier;\r\n break;\r\n case exports.ReadonlyModifier:\r\n property.modifier = exports.ReadonlyOptionalModifier;\r\n break;\r\n case exports.OptionalModifier:\r\n property.modifier = exports.OptionalModifier;\r\n break;\r\n default:\r\n property.modifier = exports.OptionalModifier;\r\n break;\r\n }\r\n }\r\n return next;\r\n }", "function fillProperties(target,source){for(var key in source){if(source.hasOwnProperty(key)&&!target.hasOwnProperty(key)){target[key]=source[key];}}}", "properties() {\n return [];\n }", "static get properties() {\n return {\n ...super.properties,\n\n disableResponsive: {\n type: Boolean,\n attribute: \"disable-responsive\",\n },\n /**\n * Fields to convert to JSON Schema.\n */\n fields: {\n type: Array,\n },\n /**\n * Conversion from fields array with inputMethods to JSON schema types and formats.\n * _See [Configuring fieldsConversion Property](configuring-the-fieldsconversion-property) above._\n */\n schematizer: {\n type: Object,\n attribute: \"schematizer\",\n },\n /**\n * Schema label\n */\n label: {\n type: String,\n },\n /**\n * tracks all activeTabs as an object\n */\n __activeTabs: {\n type: Object,\n attribute: \"active-path\",\n },\n /**\n * default theme for code editor\n */\n codeTheme: {\n type: String,\n attribute: \"code-theme\",\n },\n };\n }", "censor_props(obj, props = ['apikey', 'secret']) {\n if (!this.is_object(obj)) return false;\n for (var key in obj) {\n if (!obj.hasOwnProperty(key))\n continue;\n if (props.includes(key)) \n obj[key] = '**********'\n else \n if (typeof obj[key] === 'object' && obj[key] !== null)\n obj[key] = this.censor_props(obj[key], props);\n }\n return obj;\n }", "_invalidateProperties() {\n this.__isInvalid = true;\n super._invalidateProperties();\n }", "function a(e,t,n){(n?Reflect.getOwnMetadataKeys(t,n):Reflect.getOwnMetadataKeys(t)).forEach((function(r){var i=n?Reflect.getOwnMetadata(r,t,n):Reflect.getOwnMetadata(r,t);n?Reflect.defineMetadata(r,i,e,n):Reflect.defineMetadata(r,i,e)}))}", "function copyNonHalProperties(unparsed, resource) {\n Object.keys(unparsed).forEach(function(key) {\n if (key !== '_links' && key !== '_embedded') {\n resource[key] = unparsed[key]\n }\n })\n}", "static get properties() {\n return {};\n }", "static get properties() {\n return {};\n }", "static get properties() {\n return {};\n }", "function start_prop_block(line) {\n return !!line.match(/(@prop)/);\n }", "getProps() {\n let result = super.getProps();\n result.mulitline = result.mulitline ? result.multiline: false;\n result.password = result.password ? result.password : false;\n result.placeholder = result.placeholder ? result.placeholder : '';\n result.codeMirror = result.codeMirror ? result.codeMirror: null\n return result;\n }", "function def(obj, props) {\n // This helper function calls Object methods directly because it is only\n // called during polyfill initialization, and then never again. In all\n // other places where standard library features are used, we make an effort\n // to be robust against mutation of the built-in objects.\n var names = Object.getOwnPropertyNames(props);\n for (var i = 0; i < names.length; i++) {\n var name = names[i];\n var desc = Object.getOwnPropertyDescriptor(props, name);\n desc.enumerable = false;\n Object.defineProperty(obj, name, desc);\n }\n}", "function testConstructString() {\r\n\tvar prop1 = new ORYX.Core.StencilSet.Property(jsonPropString, \"testNS\", stencil);\r\n\tassertEquals(\"testid\", prop1.id());\r\n\tassertEquals(\"string\", prop1.type());\r\n\tassertEquals(\"oryx\", prop1.prefix());\r\n\tassertEquals(\"testTitle\", prop1.title());\r\n\tassertEquals(\"testValue\", prop1.value());\r\n\tassertEquals(\"testDescription\", prop1.description());\r\n\tassertEquals(false, prop1.readonly());\r\n\tassertEquals(true, prop1.optional());\r\n\tassertEquals(\"testRef\", prop1.refToView()[0]);\r\n\tassertEquals(100, prop1.length());\r\n\tassertEquals(true, prop1.wrapLines());\r\n}", "computedProp() {\n\t\treturn null\n\t}", "function testRemovePropertiesOverExtension() {\r\n\tvar testStencilSet = new ORYX.Core.StencilSet.StencilSet(\"TestStencilSet\")\r\n\t\r\n\t// removes the properties value and description from stencil \"Service1\"\r\n\t\r\n\ttestStencilSet.addExtension(\"StencilSetExtensionRemoveProperties\")\r\n\t\r\n\tassertUndefined(\"Service1 should not have the property value\",testStencilSet.stencil(\"http://b3mn.org/stencilset/testB#Service1\").property(\"value\"))\r\n\tassertUndefined(\"Service1 should not have the property description\",testStencilSet.stencil(\"http://b3mn.org/stencilset/testB#Service1\").property(\"description\"))\r\n}", "function asy_postcompact(geogebra){\r\n return geogebra\r\n .replace(/\\/\\*(.*?)\\*\\//g, \"\")\r\n .replace(/;( *)?\\n([a-z])/g, \"; $2\")\r\n .replace(/labelscalefactor/g, \"lsf\")\r\n .replace(/dotstyle/g, \"ds\")\r\n .replace(/\\n( *)?(\\n( *)?)*/g, \"\\n\");\r\n}", "static finalize(){// finalize any superclasses\nconst superCtor=Object.getPrototypeOf(this);if(!superCtor.hasOwnProperty(finalized)){superCtor.finalize();}this[finalized]=true;this._ensureClassProperties();// initialize Map populated in observedAttributes\nthis._attributeToPropertyMap=new Map();// make any properties\n// Note, only process \"own\" properties since this element will inherit\n// any properties defined on the superClass, and finalization ensures\n// the entire prototype chain is finalized.\nif(this.hasOwnProperty(JSCompiler_renameProperty('properties',this))){const props=this.properties;// support symbols in properties (IE11 does not support this)\nconst propKeys=[...Object.getOwnPropertyNames(props),...(typeof Object.getOwnPropertySymbols==='function'?Object.getOwnPropertySymbols(props):[])];// This for/of is ok because propKeys is an array\nfor(const p of propKeys){// note, use of `any` is due to TypeSript lack of support for symbol in\n// index types\n// tslint:disable-next-line:no-any no symbol in index\nthis.createProperty(p,props[p]);}}}", "function l(t,e,l,f,h,p){s=s||r(6);var y=(f?f+\".\":\"\")+t;f=f||\"\",e?Object.defineProperty(l,t,{enumerable:!0,configurable:!0,get:function(){var t=this;if(this.$__.getters||(this.$__.getters={}),!this.$__.getters[y]){var r=Object.create(s.prototype,function(t){var e={};return Object.getOwnPropertyNames(t).forEach(function(r){e[r]=Object.getOwnPropertyDescriptor(t,r),e[r].get?delete e[r]:e[r].enumerable=-1===[\"isNew\",\"$__\",\"errors\",\"_doc\",\"$locals\",\"$op\",\"__parentArray\",\"__index\",\"$isDocumentArrayElement\"].indexOf(r)}),e}(this));f||(r.$__[u]=this),r.$__.nestedPath=y,Object.defineProperty(r,\"schema\",{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(r,n,{enumerable:!1,configurable:!0,writable:!1,value:l.schema}),Object.defineProperty(r,\"toObject\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return o.clone(t.get(y,null,{virtuals:i(this,\"schema.options.toObject.virtuals\",null)}))}}),Object.defineProperty(r,\"toJSON\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return t.get(y,null,{virtuals:i(t,\"schema.options.toJSON.virtuals\",null)})}}),Object.defineProperty(r,\"$__isNested\",{enumerable:!1,configurable:!0,writable:!1,value:!0});var a=Object.freeze({minimize:!0,virtuals:!1,getters:!1,transform:!1});Object.defineProperty(r,\"$isEmpty\",{enumerable:!1,configurable:!0,writable:!1,value:function(){return 0===Object.keys(this.get(y,null,a)||{}).length}}),c(e,r,y,p),this.$__.getters[y]=r}return this.$__.getters[y]},set:function(t){t instanceof s&&(t=t.toObject({transform:!1})),(this.$__[u]||this).$set(y,t)}}):Object.defineProperty(l,t,{enumerable:!0,configurable:!0,get:function(){return this[a].call(this.$__[u]||this,y)},set:function(t){this.$set.call(this.$__[u]||this,y,t)}})}", "function install_components_as_object_properties(parentObj) {\r\n\r\n if (!parentObj) {\r\n return;\r\n }\r\n\r\n const addressSpace = parentObj.addressSpace;\r\n const hierarchicalRefs = parentObj.findHierarchicalReferences();\r\n\r\n const children = hierarchicalRefs.map(function(r){\r\n return _resolveReferenceNode(addressSpace,r);\r\n });\r\n\r\n for (const child of children) {\r\n\r\n if (!child) {\r\n continue;\r\n }\r\n // assumption: we ignore namespace here .\r\n const name = lowerFirstLetter(child.browseName.name.toString());\r\n\r\n\r\n if (reservedNames.hasOwnProperty(name)) {\r\n if (doDebug) {console.log((\"Ignoring reserved keyword \"+ name).bgWhite.red);}\r\n continue;\r\n }\r\n /* istanbul ignore next */\r\n if (parentObj.hasOwnProperty(name)) {\r\n continue;\r\n }\r\n\r\n Object.defineProperty(parentObj, name, {\r\n enumerable: true,\r\n configurable: true, // set to true, so we can undefine later\r\n //xx writable: false,\r\n get: function () {\r\n return child;\r\n }\r\n //value: child\r\n });\r\n }\r\n}", "function Initialize()\r\n {\r\n FrameworkElement.DefaultStyleKeyProperty.OverrideMetadata(Paragraph.Type, \r\n \t\t/*new FrameworkPropertyMetadata(Paragraph.Type)*/\r\n \t\tFrameworkPropertyMetadata.BuildWithDV(Paragraph.Type));\r\n }", "function sanitizeWrapperProps(properties) {\n return omit(properties, Object.keys(ratingPropTypes));\n}", "function PureExpressionData() {}", "function PureExpressionData() {}", "function PureExpressionData() {}", "constructor() {\n\t this.properties = [];\n\t }", "function spec(node, body, objId, initProps, file) {\n\t // add a simple assignment for all Symbol member expressions due to symbol polyfill limitations\n\t // otherwise use Object.defineProperty\n\n\t var _arr2 = node.properties;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var prop = _arr2[_i2];\n\t // this wont work with Object.defineProperty\n\t if (t.isLiteral(t.toComputedKey(prop), { value: \"__proto__\" })) {\n\t initProps.push(prop);\n\t continue;\n\t }\n\n\t var key = prop.key;\n\t if (t.isIdentifier(key) && !prop.computed) {\n\t key = t.literal(key.name);\n\t }\n\n\t var bodyNode = t.callExpression(file.addHelper(\"define-property\"), [objId, key, prop.value]);\n\n\t body.push(t.expressionStatement(bodyNode));\n\t }\n\n\t // only one node and it's a Object.defineProperty that returns the object\n\n\t if (body.length === 1) {\n\t var first = body[0].expression;\n\n\t if (t.isCallExpression(first)) {\n\t first.arguments[0] = t.objectExpression(initProps);\n\t return first;\n\t }\n\t }\n\t}", "function spec(node, body, objId, initProps, file) {\n\t // add a simple assignment for all Symbol member expressions due to symbol polyfill limitations\n\t // otherwise use Object.defineProperty\n\n\t var _arr2 = node.properties;\n\t for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n\t var prop = _arr2[_i2];\n\t // this wont work with Object.defineProperty\n\t if (t.isLiteral(t.toComputedKey(prop), { value: \"__proto__\" })) {\n\t initProps.push(prop);\n\t continue;\n\t }\n\n\t var key = prop.key;\n\t if (t.isIdentifier(key) && !prop.computed) {\n\t key = t.literal(key.name);\n\t }\n\n\t var bodyNode = t.callExpression(file.addHelper(\"define-property\"), [objId, key, prop.value]);\n\n\t body.push(t.expressionStatement(bodyNode));\n\t }\n\n\t // only one node and it's a Object.defineProperty that returns the object\n\n\t if (body.length === 1) {\n\t var first = body[0].expression;\n\n\t if (t.isCallExpression(first)) {\n\t first.arguments[0] = t.objectExpression(initProps);\n\t return first;\n\t }\n\t }\n\t}", "function Fv(){var t=this;ci()(this,{$style:{enumerable:!0,get:function(){return t.$olObject}},$map:{enumerable:!0,get:function(){return t.$services&&uu()(t.$services)}},$view:{enumerable:!0,get:function(){return t.$services&&t.$services.view}},$stylesContainer:{enumerable:!0,get:function(){return t.$services&&t.$services.stylesContainer}}})}", "function spec(node, body, objId, initProps, file) {\n // add a simple assignment for all Symbol member expressions due to symbol polyfill limitations\n // otherwise use Object.defineProperty\n\n var _arr2 = node.properties;\n for (var _i2 = 0; _i2 < _arr2.length; _i2++) {\n var prop = _arr2[_i2];\n // this wont work with Object.defineProperty\n if (t.isLiteral(t.toComputedKey(prop), { value: \"__proto__\" })) {\n initProps.push(prop);\n continue;\n }\n\n var key = prop.key;\n if (t.isIdentifier(key) && !prop.computed) {\n key = t.literal(key.name);\n }\n\n var bodyNode = t.callExpression(file.addHelper(\"define-property\"), [objId, key, prop.value]);\n\n body.push(t.expressionStatement(bodyNode));\n }\n\n // only one node and it's a Object.defineProperty that returns the object\n\n if (body.length === 1) {\n var first = body[0].expression;\n\n if (t.isCallExpression(first)) {\n first.arguments[0] = t.objectExpression(initProps);\n return first;\n }\n }\n}", "function specWithStrippedDebug(spec) {\n var copiedSpec = $.extend(true, {}, spec),\n objects = copiedSpec.objects;\n\n for (var key in objects) {\n if (objects.hasOwnProperty(key)) {\n objects[key].debug = undefined;\n }\n }\n return copiedSpec;\n }", "function patchSchema(data) {\n data.properties.upload_type.enum = data.properties.upload_type.type.enum;\n data.properties.upload_type.type = \"string\";\n data.properties.publication_type.enum =\n data.properties.publication_type.type.enum;\n data.properties.publication_type.type = \"string\";\n data.properties.image_type.enum = data.properties.image_type.type.enum;\n data.properties.image_type.type = \"string\";\n return data;\n}", "function normalizeToObject(doc, ret) {\n delete ret.__v;\n}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function i(t,e,n){(n?Reflect.getOwnMetadataKeys(e,n):Reflect.getOwnMetadataKeys(e)).forEach(function(r){var o=n?Reflect.getOwnMetadata(r,e,n):Reflect.getOwnMetadata(r,e);n?Reflect.defineMetadata(r,o,t,n):Reflect.defineMetadata(r,o,t)})}", "function p(doc) {\n return doc.map((i) => {\n return {\n label: i.label,\n detail: (i.detail ? i.detail : null),\n insertText: (i.insertText ? i.insertText : i.label),\n documentation: (i.documentation ? i.documentation : null),\n kind: (i.kind ? i.kind : 17), // 17 = Keyword, 18 = Text, 25 = Snippet\n insertTextRules: (i.insertTextRules ? i.insertTextRules : null),\n };\n });\n}", "function CfnDocument_DocumentRequiresPropertyValidator(properties) {\n if (!cdk.canInspect(properties)) {\n return cdk.VALIDATION_SUCCESS;\n }\n const errors = new cdk.ValidationResults();\n if (typeof properties !== 'object') {\n errors.collect(new cdk.ValidationResult('Expected an object, but received: ' + JSON.stringify(properties)));\n }\n errors.collect(cdk.propertyValidator('name', cdk.validateString)(properties.name));\n errors.collect(cdk.propertyValidator('version', cdk.validateString)(properties.version));\n return errors.wrap('supplied properties not correct for \"DocumentRequiresProperty\"');\n}", "function PureExpressionData() { }", "function PureExpressionData() { }", "_patchPrependApply(patchInfo) {\n let oldText = this.cssText;\n this.cssText = patchInfo.value + oldText;\n this.endOffset = this.endOffset + this.cssText.length - oldText.length;\n /*istanbul ignore else*/\n if (patchInfo.reparse) this._parseInvoke();\n }" ]
[ "0.63012373", "0.5837011", "0.5776584", "0.56595856", "0.5427953", "0.53260076", "0.53260076", "0.5316607", "0.53124356", "0.52805024", "0.5271093", "0.5231861", "0.5216707", "0.5198099", "0.5123764", "0.51090115", "0.5108372", "0.5098512", "0.5093449", "0.5088203", "0.50803274", "0.5059454", "0.5056572", "0.5049063", "0.50438124", "0.50303525", "0.50277686", "0.50083834", "0.5006288", "0.5006288", "0.50050026", "0.498606", "0.49776092", "0.49567932", "0.4956275", "0.4955946", "0.49430832", "0.49376416", "0.4924005", "0.4923568", "0.4923568", "0.49229312", "0.491702", "0.49081144", "0.49073508", "0.49042004", "0.49031296", "0.48976502", "0.489756", "0.4892488", "0.488656", "0.48857483", "0.48793888", "0.4878797", "0.48775032", "0.48734728", "0.4872706", "0.4872168", "0.48683643", "0.48621616", "0.48606506", "0.48521835", "0.48422873", "0.4831016", "0.48275837", "0.482742", "0.4825522", "0.48189247", "0.4818298", "0.4818298", "0.4818298", "0.48129818", "0.48058325", "0.48029235", "0.48025855", "0.47931662", "0.47920775", "0.4776174", "0.47618833", "0.47614384", "0.47578782", "0.47518376", "0.47491702", "0.4743263", "0.4743263", "0.4743263", "0.474202", "0.47398776", "0.47398776", "0.47332346", "0.47322622", "0.4731896", "0.47312832", "0.4731065", "0.47178543", "0.47178543", "0.4711409", "0.471017", "0.47100022", "0.47100022", "0.47099656" ]
0.0
-1
Public Task, as it is exported
function build(cb) { cb(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function task(task) {\n\treturn task;\n}", "function createTask(v,t){\r\n \r\n }", "static async method(){}", "function TaskRepository () {\n\n }", "updateTask() { \r\n\r\n }", "constructor() {\n super(new Task());\n }", "function TaskParser() {\n}", "async prepareTask() {\n this.options.task && (this.task = await this.addService('task', new this.TaskTransport(this.options.task)));\n \n if(!this.task) {\n return;\n }\n\n if(this.options.task.calculateCpuUsageInterval) {\n await this.task.add('calculateCpuUsage', this.options.task.calculateCpuUsageInterval, () => this.calculateCpuUsage());\n }\n }", "function task(){\n var self = this;\n this.test_mode = false; \n //Mode for user testing. Changes input from node IO input to keyDown.\n //False by default\n this.draw = function(){\n //Call this function to start the task\n //Redefined in the task's dedicated .js file\n console.log('Function to draw task does not exist');\n }\n this.stop = function(){\n //Call this function to stop the task\n //Redefine for any task setup that can't be stopped with this function\n //Such as tasks not using phase/loop system or other special setups\n clearTimeout(self.loop);\n console.log('Task stopped');\n }\n this.input_Handler = function(params){\n //Function called after io change from node daemon\n console.log('Handler function not set for this task');\n }\n }", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "_taskComplete() {\n //\n }", "task( taskName, fn ) {\n\n if ( typeof taskName === \"function\" ) {\n\n fn = taskName;\n taskName = fn.displayName || fn.name;\n\n }\n\n if ( ! fn ) return this._getTask( taskName );\n\n this._setTask( taskName, done => {\n\n const job = fn( done );\n return Array.isArray( job ) ? pump( job ) : job;\n\n } );\n\n }", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "async method(){}", "function RawTask() {\n\t\t this.task = null;\n\t\t}", "function defaultTask(cb) {\n // place code for your default task here\n cb()\n}", "async prepareTask() {\n this.options.task && (this.task = await this.addService('task', new this.TaskTransport(this.options.task)));\n\n if(!this.task) {\n return; \n }\n\n if(this.options.task.workerChangeInterval) {\n await this.task.add('workerChange', this.options.task.workerChangeInterval, () => this.changeWorker());\n }\n }", "async prepareTask() {\n await super.prepareTask.apply(this, arguments);\n\n if(!this.task) {\n return;\n }\n\n if(this.options.task.cleanUpStorageInterval) {\n await this.task.add('cleanUpStorage', this.options.task.cleanUpStorageInterval, () => this.cleanUpStorage());\n }\n\n if(this.options.task.cleanUpTempDirInterval) {\n await this.task.add('cleanUpTempDir', this.options.task.cleanUpTempDirInterval, () => this.cleanUpTempDir());\n }\n\n if(this.options.task.calculateStorageInfoInterval) {\n await this.task.add('calculateStorageInfo', this.options.task.calculateStorageInfoInterval, () => this.calculateStorageInfo());\n }\n }", "function TaskMock () {\n\tthis._progress = 0;\n\tthis._stepTime = 1000;\n\tthis._isRunning = false;\n\tthis._pubSub = new PubSub();\n}", "function Task() {\n if (!(this instanceof Task)) {\n return new Task();\n }\n this.message = 'Learning JS';\n}", "function Task(taskname, taskfun)\n{\n this.taskname = taskname;\n this.taskfun = taskfun;\n}", "static setTmpTask(tmp_task){\n this.tmp_task = tmp_task;\n }", "function subTask(taskName, fn) {\n var customTask = new CustomTask(taskName, fn);\n return customTask;\n}", "constructor(task/*:Task<Never, a>*/) {\n this.task = task\n }", "_onTasksDone() {\n // meant to be implemented by subclass if needed\n }", "start() {\n this.taskFunction_.apply(null, Array.prototype.slice.call(arguments));\n this.onTaskDone();\n }", "async doTask(task) {\n task.status = 'success'\n task.result = 'done'\n }", "work() {}", "function TaskLoop() {\n\t\n}", "function run() {\n\n }", "constructor(task/*:TaskType<Never,a>*/) {\n this.task = task\n }", "Run() {\n\n }", "function run() {}", "async function startUnstable(){\n\n}", "async run() {\n }", "getTask(_parameters) {\n\t\t// TODO: compare parameters with empty\n\t\treturn new Task(_parameters);\n\t}", "function Task(){\n this.taskName = \"task1\";\n\tthis.description = \"\";\n\tthis.duedate = \"\";\n\t\n\tthis.blocking = \"false\";\n\tthis.signalling = \"true\";\n\tthis.priority = \"normal\";\n\t\n\tthis.swimlane = \"\";\n\t\n\tthis.controller = new Controller();\n\tthis.assignment = new Assignment();\n\tthis.event = new TaskEvent();\n}", "function SyncPrivateApi() {}", "getTaskAndSendToDisplay() {\n // const taskName = document.querySelector(\"taskNameInput\").value\n // randomTaskData.getTaskAndSendToDisplay(taskName)\n const name = document.querySelector(\"#taskNameInput\").value\n const date = document.querySelector(\"#taskDateInput\").value\n const userId = sessionStorage.getItem(\"activeUser\")\n const completed = false\n\n return randomTaskData.storeNewTask({name, date, userId, completed})\n}", "init() {\n moduleUtils.patchModule(\n 'cos-nodejs-sdk-v5/sdk/task.js',\n 'init',\n tencentCOSWrapper\n );\n }", "function Task(name)\n {\n this.Init(name);\n }", "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}", "start() {\n this.currentTaskType = \"teil-mathe\";\n this.v.setup();\n this.loadTask();\n }", "callback(task) {\r\n timerlogin.reset();\r\n console.log(`${task.id} task has run ${task.currentRuns} times.`);\r\n document.getElementById(\"btn-controller\").innerHTML = \"Good lucks\";\r\n document.getElementsByTagName('title')[0].text = `AwLight - Good lucks`\r\n async function loginNow() {\r\n await bott.start()\r\n }\r\n loginNow()\r\n }", "function ttask(input) {\n\treturn input;\n}", "task(e) {\n const event = 'task';\n if (!e || !e.ctx) {\n throw new TypeError(errors.redirectParams(event));\n }\n let msg = cct.tx('task');\n const sTag = getTagName(e);\n if (sTag) {\n msg += cct.tx('(') + cct.value(sTag) + cct.tx(')');\n }\n if (e.ctx.finish) {\n msg += cct.tx('/end');\n } else {\n msg += cct.tx('/start');\n }\n if (e.ctx.finish) {\n const duration = formatDuration(e.ctx.finish - e.ctx.start);\n msg += cct.tx('; duration: ') + cct.value(duration) + cct.tx(', success: ') + cct.value(!!e.ctx.success);\n }\n print(e, event, msg);\n }", "function _____SHARED_functions_____(){}", "function internal_download_task(center, taskId) {\n\t// taskDef is obj, decoded and distributed\n\tfunction cached_as_promise(taskDef) {\n\t\treturn GLOBAL_CACHED_TASKS[this] = Promise.resolve(taskDef);\n\t}\n\treturn GLOBAL_CACHED_TASKS[taskId] || Promise.resolve(center.download_task(taskId))\n\t\t.then(distributed_task.bind([this, taskId]))\n\t\t.then(cached_as_promise.bind(taskId));\n}", "function run() {\n\n}", "function createAndRequestTaskID(){\r\n \r\n //request the smart contract to create a task id\r\n myContract.methods.createCurrentTaskID().send({from: userAccount,gas:3000000},function(error, result){\r\n if(!error)\r\n { \r\n alert(\"Time to work on the task\");\r\n //if succesuffly created task id then get the current task id\r\n getTaskID();\r\n }\r\n else\r\n console.error(error);\r\n });\r\n\r\n }", "work() {\n\n }", "function exec(task){try{suspend();task();}finally{release();}}", "function RequestScheduler() {}", "function demoTask(cb)\n{\n console.log('hello');\n cb();\n}", "function runAndScheduleTask () {\n\t\ttask( scheduleNextExecution );\n\t}", "run () {\n }", "function Task(task) {\n this.task = task;\n this.id = 'new';\n }", "async publish () {}", "get tasks() {\r\n return new Tasks(this);\r\n }", "async function execute() {\n /**\n * Create a new instance of the TaskAppExample (Made for this example help create and load\n * the table with Task/Employee/Office data).\n **/\n const loader = new Loader(taskr);\n \n /**\n * Uncomment the relevant lines to create a table, then load it, optionally delete, and finally query.\n * For more examples checkout the README.\n **/\n // Make table:\n // await loader.makeTable();\n\n // Load table:\n // await loader.loadTable({employees: 800, tasks: 800});\n\n // Drop table:\n // await loader.dropTable()\n\n // Query table:\n await query();\n}", "static async createTask(info,res) {\n return Utils.RunFunctionWithError(\n async () => {\n const initialState = {\n ...info,\n status: StatusEnum.pending\n }\n // let randomToken = Utils.RandomToken()\n let task = new Task(initialState)\n // TODO: what if the db creates the job but the queue failed to execue?\n\n let result = await task.save()\n WorkerMessanger.queueJob(initialState,socket)\n return res.status(201).json(result)\n }\n ,res)\n }", "function doIt() {\n read(task, callback);\n }", "constructor(taskId, task, done = false) {\n this.taskId = taskId;\n this.task = task;\n this.done = done;\n // this.taskId=taskId;\n // this.task=task;\n // this.done=done;\n // no need\n }", "function doTask (task) {\n return new Promise((resolve, reject) => {\n Q.push(task, (err, taskResult) => {\n if (err) {\n console.log(`task ${task} erred:`, err)\n return reject(err)\n }\n\n return resolve(taskResult)\n })\n })\n }", "function createTask (task) {\n\t return $http.post(url, task)\n\t .then(function successCallback(res){\n\t return res.data;\n\t }, function errorCallback (error) {\n console.log('ERRRRR');\n \tconsole.log(error);\n });\n\t}", "task(id, task_name, form_data = {}, method = 'post', query_params = {}) {\n const query = Object(_api__WEBPACK_IMPORTED_MODULE_5__[\"toQueryString\"])(form_data);\n const _query = Object(_api__WEBPACK_IMPORTED_MODULE_5__[\"toQueryString\"])(query_params);\n const key = `task|${id}|${task_name}|${query}`;\n /* istanbul ignore else */\n if (!this._promises[key]) {\n this._promises[key] = new Promise((resolve, reject) => {\n const post_data = Object.assign(Object.assign({}, form_data), { id, _task: task_name });\n const url = `${this.route()}/${id}/${task_name}${_query ? '?' + _query : ''}`;\n let result;\n const request = method === 'post'\n ? Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\"post\"])(url, post_data)\n : Object(_placeos_ts_client__WEBPACK_IMPORTED_MODULE_2__[\"get\"])(`${url}${query ? '?' + query : ''}`);\n request.subscribe((d) => (result = d), (e) => {\n reject(e);\n delete this._promises[key];\n }, () => {\n resolve(result);\n this.timeout(key, () => delete this._promises[key], 1000);\n });\n });\n }\n return this._promises[key];\n }", "async started() {\n\n\t}", "async started() {\n\n\t}", "async started() {\n\n\t}" ]
[ "0.6851279", "0.6821912", "0.6793472", "0.6753004", "0.6723646", "0.6612676", "0.6486797", "0.64152706", "0.64140767", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6365507", "0.6359689", "0.6313284", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.6307982", "0.63078845", "0.62960273", "0.616822", "0.61634785", "0.61084855", "0.61040807", "0.6087989", "0.60834754", "0.60268277", "0.5986654", "0.59665567", "0.59598047", "0.5950174", "0.5942191", "0.59149474", "0.5902739", "0.5902383", "0.5899824", "0.5898132", "0.58703816", "0.5862263", "0.58600664", "0.58562845", "0.585105", "0.58508", "0.5849547", "0.5835934", "0.58321875", "0.5816831", "0.58010256", "0.5790341", "0.57768464", "0.5769202", "0.57674706", "0.5762431", "0.57582396", "0.57423824", "0.57367945", "0.5736375", "0.57170624", "0.57113385", "0.5705845", "0.5704714", "0.5701486", "0.57006645", "0.569989", "0.5695499", "0.5695102", "0.56948835", "0.56830114", "0.56811607", "0.5679694", "0.56773305", "0.5675398", "0.5675398", "0.5675398" ]
0.0
-1
3 Example of 'Returning a promise'
function promiseTask() { return Promise.resolve("the value is ignored"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tProm() {\n\n\tvar res = null;\n\tvar ref = null;\n\n\treturn new Promise(function(resolve, reject) {\n\t\tconsole.log('created promise');\n\n\t});\n/*\n\treturn {\n\t\tp: prom,\n\t\tres: \n\t\trej\n\t}\n*/\n}", "function promiseMaker() {\n //promise is a object which takes 2 callbacks, resolve and reject\n return new Promise(function(resolve, reject) {\n setTimeout(() => {\n var error = true;\n if (!error) {\n console.log('Promise has been resolved');\n //if the promise is kept then resolve will be called\n resolve();\n } else {\n console.log('Sorry i could not fulfill the promise');\n //if promise not kept then reject will be called;\n reject('Sorry not fulfilled');\n }\n }, 2000);\n });\n}", "function myFn() {\n return Promise.resolve(\"Hello\");\n}", "function myFunction2 () {\n return Promise.resolve('Hello')\n}", "function test2() {\n\t// returns a promise \n return job1().then(function(data) {\n // console.log(data + ' play with me ');\n return data + ' play with me '\n });\n}", "function Promise() {\n}", "function query_promise_then(result) {\n }", "function query_promise_then(result) {\n }", "function sc_makePromise(proc) {\n var isResultReady = false;\n var result = undefined;\n return function() {\n\tif (!isResultReady) {\n\t var tmp = proc();\n\t if (!isResultReady) {\n\t\tisResultReady = true;\n\t\tresult = tmp;\n\t }\n\t}\n\treturn result;\n };\n}", "function query_promise_then(result) {\n\n\n }", "function query_promise_then(result) {\n\n\n }", "function fulfilled(value) {\n return new aplus.Promise(value)\n}", "function g(){\n return Promise.resolve(3);\n}", "function nativePromiseVersion() {\n // we use two functions which return promises: returnsFirstPromise() and returnsSecondPromise().\n returnsFirstPromise() // returnsFirstPromise() and ensure that the first promise resolved by using .then().\n .then((firstValue) => {\n // we log the resolved value of the first promise, firstValue, and then return returnsSecondPromise(firstValue).\n console.log(firstValue);\n return returnsSecondPromise(firstValue);\n })\n // We use another .then() to print the second promise’s resolved value to the console.\n .then((secondValue) => {\n console.log(secondValue);\n });\n }", "function nativePromiseVersion() {\n returnsFirstPromise()\n .then((firstValue) => {\n console.log(firstValue);\n return returnsSecondPromise(firstValue);\n })\n .then((secondValue) => {\n console.log(secondValue);\n });\n}", "returnPromise(value) {\n if (this._isPromise(value)) {\n return value;\n }\n else {\n var deferred = Q.defer();\n deferred.resolve(value);\n return deferred.promise;\n }\n }", "function fullPromise(param) {\n\t//PLACE YOUR CODE HERE:\n}", "static promiseURI(theURI, form) {\nreturn new Promise((resolve, reject) => {\nvar theCB;\ntheCB = (val, errC, errT, part) => {\nif (errC > 0) {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`promiseURI ${theURI} rejecting ${errT}`);\n}\nreturn reject(new Error(JSON.stringify([errC, errT, part])));\n} else {\nif (typeof lggr.trace === \"function\") {\nlggr.trace(`promiseURI ${theURI} resolving`);\n}\nreturn resolve(val);\n}\n};\nreturn Data.fetchURI(theURI, theCB, form);\n});\n}", "function r(){var e=this;this.promise=new a.default(function(t,n){e.resolve=t,e.reject=n})}", "function promise(fn) {\n return new Promise(fn);\n }", "function myFunc (num){\r\n\r\n if(num>10){\r\n return Promise.resolve(num)\r\n }\r\n else{\r\n return Promise.reject(num)\r\n }\r\n\r\n}", "function getResponse() {\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n resolve(\"Executed after 3 seconds\");\n }, 3000);\n });\n}", "async function myPromise (){\n return \"This is my promise\"\n}", "function new_promise() {\n var resolve, promise = new Promise((res, rej)=>{resolve = res;});\n return [promise, resolve];\n }", "function doStuffSync() {\n return Promise.resolve('foo')\n // return Promise.reject('nok')\n}", "function fetchThisUrlThenReturnAPromise(url) {\n\n\t// Each time get is called, it will return a new promise - (like a \"didISucceedOrFail()\")\n\treturn new Promise(\n\n\t\t// When I call this, the new promise is expecting a callback with two arguments\n\t\t//A method for success, and a method for failure\n\t\t(AMethodToCallOnSuccess, AMethodToCallOnFailure) => {\n\n\t\t\t// each get call is going to do stuff like a normal get(url) function\n\n\t\t\tvar req = new XMLHttpRequest();\n\t\t\treq.open('GET', url);\n\t\t\treq.onload = function() {\n\t\t\t\tif (req.status == 200) {\n\n\t\t\t\t\t//Look! Here the method fulfilled successfully\n\t\t\t\t\t//so call the resolve function passed in when I used get\n\t\t\t\t\tAMethodToCallOnSuccess(req.response);\n\t\t\t\t}\n\t\t\t\telse {\n\n\t\t\t\t\t//Look! here the method encountered an error\n\t\t\t\t\t//so call the reject function passed into the Promise\n\t\t\t\t\tAMethodToCallOnFailure(Error(req.statusText));\n\t\t\t\t}\n\t\t\t};\n\n\t\t\t// Look! Here is another way the req could go wrong, so I'm rejecting it with another error\n\t\t\treq.onerror = function() {\n\t\t\t\tAMethodToCallOnFailure(Error(\"Network Error\"));\n\t\t\t};\n\n\t\t\t// Now that everything is set up for the httpRequest, enact it\n\t\t\treq.send();\n\t\t});\n}", "async function simpleReturn() {\n return 1;\n}", "function fetchUser() {\n return new Promise((resolve, reject) => {\n resolve('yuna');\n // reject\n // return 'yuna'; // it Promise doesn't have resolve or reject, this return <pending> (PromiseState: \"pending\", PromiseResult: undefined)\n })\n}", "function make_promise(guarantee) {\n var status = UNRESOLVED,\n outcome,\n waiting = [],\n dreading = [],\n passable,\n result;\n\n function vouch(deed, func) {\n switch (status) {\n case UNRESOLVED:\n (deed === FULFILLED ? waiting : dreading).push(func);\n break;\n case deed:\n func(outcome);\n break;\n }\n };\n\n function resolve(deed, value) {\n status = deed;\n outcome = value;\n (deed == FULFILLED ? waiting : dreading).forEach(function (func) {\n func.apply(func, outcome);\n });\n waiting = null;\n dreading = null;\n };\n\n passable = {\n when: function (f) {\n result.when(f);\n return this;\n },\n fail: function (f) {\n result.fail(f);\n return this;\n }\n };\n\n result = {\n when: function (func) {\n vouch(FULFILLED, func);\n return this;\n },\n fail: function (func) {\n vouch(SMASHED, func);\n return this;\n },\n fulfill: function () {\n var args = Array.prototype.slice.call(arguments);\n resolve(FULFILLED, args);\n return passable;\n },\n smash: function () {\n var args = Array.prototype.slice.call(arguments);\n resolve(SMASHED, args);\n return passable;\n },\n status: function () {\n return status;\n },\n passable: function () {\n return passable;\n }\n };\n\n if (undefined !== guarantee) {\n return result.fulfill(guarantee);\n }\n return result;\n}", "function r(t){try{return Promise.resolve(t())}catch(t){return Promise.reject(t)}}", "function makePromise(tgt) {\n return new Ember.RSVP.Promise(function (resolve) {\n resolve(tgt);\n });\n }", "function register()\n{\n return new Promise((pRes, pRej) => {\n\n })\n}", "function foo() {\n prepare().then( result => console.log(result))\n console.log(\"Then the milk!!!\")\n}", "function primjer4() {\n var p2 = new Promise(function (resolve, reject) {\n resolve(1);\n });\n\n p2.then(function (value) {\n console.log(value); // 1\n return value + 1;\n }).then(function (value) {\n console.log(value + '- This synchronous usage is virtually pointless'); // 2- This synchronous usage is virtually pointless\n });\n\n p2.then(function (value) {\n console.log(value); // 1\n });\n}", "static resolve(p) {\n return (p instanceof promise) ? p : new promise((r,j)=>{\n r(p)\n })\n }", "function foo(x) {\n // start doing something that could take a while..\n\n // construct and return a promise\n return new Promise( function(resolve,reject){\n // eventually, call `resolve(..)` or `reject(..)`, which are resolution callbacks,\n // for fulfillment and rejection respectively, for the promise.\n } );\n}", "runPromise(self) {\n const context = this.fiberContext(self);\n return new Promise((res, rej) => {\n context.runAsync(exit => {\n switch (exit._tag) {\n case \"Success\":\n {\n res(exit.value);\n break;\n }\n\n case \"Failure\":\n {\n rej(Cause.squash(identity)(exit.cause));\n break;\n }\n }\n });\n });\n }", "function sum(a,b)\r\n{\r\n return new Promise((resolve,reject)=>{\r\n const result = a+b;\r\n resolve(result);\r\n })\r\n}", "set p(promise) {\n promise.then(function (r) {\n return console.log(r);\n });\n }", "function helpMe() {\n return new Promise(resolve => { setTimeout(() => { \n console.log('promise');\n resolve('ok')\n }, 3000)})\n \n}", "function promiseFunctionWithFailure(a,b){\n let c = a * b;\n let success = Math.random() > 0.5;\n return new Promise(\n function(resolve,reject){\n success ? resolve(c) : reject(\"ERROR!\")\n }\n )\n}", "function testPromiseFunction(a,b){\n return new Promise((resolve,reject)=>{\n if(a<10||b<10){\n reject(\"numbers must be greater then 10\");\n }\n else{\n resolve(a*b);\n }\n });\n }", "function handle() {\n var args = _.toArray(arguments);\n var fn = args.shift();\n var result = fn.apply(this, args);\n if (result instanceof Promise) {\n return result;\n } else {\n return Promise.resolve(result);\n }\n}", "function step1() {\n return new Promise((resolve, reject) => {\n console.log(1);\n console.log(2);\n console.log(3);\n resolve();\n });\n}", "function wrapInPromise(func){\r\n var promise = new Promise((resolve, reject) => {\r\n resolve(func);\r\n });\r\n return promise;\r\n}", "function myAsyncOperation() {\n return new Promise((resolve, reject) => {\n doSomethingAsynchronous((err, value) => {\n if (err) reject(err);\n else resolve(value);\n });\n });\n}", "_asyncWrapper(result) {\r\n if (typeof result === 'object' && 'then' in result) {\r\n return result;\r\n } else {\r\n return new Promise(function(resolve) {\r\n resolve(result);\r\n });\r\n }\r\n }", "function SPromise(func){\n\t\t// simple/super/speedy/synchronous promise\n\t\tvar retVal, stage=0, thenFuncs = null, catchFuncs = null, finallies = null, retObj = new SPromise_construct(\n\t\t\tfunction(tFunc, cFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (tFunc != undefined && typeof tFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(tFunc) + \" is not a valid function to be called after a successful promise\");\n\t\t\t\t\t}\n\t\t\t\t\tif (cFunc != undefined && typeof cFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(cFunc) + \" is not a valid function to be called after a rejected promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0){\n\t\t\t\t\t// promise has not yet completed...\n\t\t\t\t\treturn _NOCHECK_SPromise(function(accept, reject){\n\t\t\t\t\t\tvar finalAcceptor = typeof tFunc === \"function\" ? function(){accept(tFunc(retVal));} : accept;\n\t\t\t\t\t\tvar finalRejector = typeof cFunc === \"function\" ? function(){reject(cFunc(retVal));} : reject;\n\n\t\t\t\t\t\tif (thenFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\t\tthenFuncs = [ thenFuncs, finalAcceptor ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthenFuncs.push(finalAcceptor);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else thenFuncs = finalAcceptor;\n\n\t\t\t\t\t\tif (catchFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\t\t\tcatchFuncs = [ catchFuncs, finalRejector ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcatchFuncs.push(finalRejector);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else catchFuncs = finalRejector;\n\t\t\t\t\t});\n\t\t\t\t} else try {\n\t\t\t\t\treturn stage === 2 ? (\n\t\t\t\t\t\ttypeof tFunc === \"function\" ? _NOCHECK_resolve( tFunc(retVal) ) : undefinedResolve\n\t\t\t\t\t) : (\n\t\t\t\t\t\ttypeof cFunc === \"function\" ? _NOCHECK_reject( cFunc(retVal) ) : undefinedResolve\n\t\t\t\t\t);\n\t\t\t\t} catch(e) {return _NOCHECK_reject(e);}\n\t\t\t},\n\t\t\tfunction(cFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (cFunc != undefined && typeof cFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(cFunc) + \" is not a valid function to be called after a rejected promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0){\n\t\t\t\t\t// promise has not yet completed...\n\t\t\t\t\treturn _NOCHECK_SPromise(function(accept){\n\t\t\t\t\t\tif (catchFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\t\t\tcatchFuncs = [ catchFuncs, function(){accept(cFunc(retVal));} ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tcatchFuncs.push(function(){accept(cFunc(retVal));});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else catchFuncs = function(){accept(cFunc(retVal));};\n\t\t\t\t\t\tif (thenFuncs !== null) {\n\t\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\t\tthenFuncs = [ thenFuncs, accept ];\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tthenFuncs.push(accept);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else thenFuncs = accept;\n\t\t\t\t\t});\n\t\t\t\t} else if (stage === 2) { // if success, then merely propagate the response transparently\n\t\t\t\t\treturn _NOCHECK_resolve(retVal);\n\t\t\t\t} else {\n\t\t\t\t\ttry {\n\t\t\t\t\t\treturn typeof cFunc === \"function\" ? _NOCHECK_resolve( cFunc(retVal) ) : undefinedResolve;\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\treturn _NOCHECK_reject(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tfunction(fFunc){\n\t\t\t\tif (DEBUGMODE){\n\t\t\t\t\tif (fFunc != undefined && typeof fFunc !== \"function\"){\n\t\t\t\t\t\tconsole.warn(Object.prototype.toString.call(fFunc) + \" is not a valid function to be called 'finally' after promise\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (stage === 0) {\n\t\t\t\t\tif (finallies !== null) {\n\t\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\t\tfinallies = [ finallies, fFunc ];\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfinallies.push(fFunc);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else finallies = fFunc;\n\t\t\t\t} else try {\n\t\t\t\t\tfFunc();\n\t\t\t\t} catch(e) {\n\t\t\t\t\treturn _NOCHECK_reject(e);\n\t\t\t\t}\n\t\t\t\treturn retObj;\n\t\t\t}\n\t\t);\n\t\t// stage undefined = unfulfilled\n\t\t// stage true = accepted\n\t\t// stage false = rejected\n\n\t\tfunction acceptP(x){\n\t\t\t// This specific order should allow for max GZip compression\n\t\t\tif (stage === 0) {\n\t\t\t\tif (isPromise(x)) {\n\t\t\t\t\tx.then(acceptP, rejectP); // wait for further commitment before resolving. [FYI: this takes a non-compliant shortcut]\n\t\t\t\t} else {\n\t\t\t\t\tretVal = x;\n\t\t\t\t\tstage = 2;\n\t\t\t\t\tif (thenFuncs !== null)\t{\n\t\t\t\t\t\tif (typeof thenFuncs === \"function\") {\n\t\t\t\t\t\t\tthenFuncs(x);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tthenFuncs.forEach(proxy, x);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tthenFuncs = null;\n\t\t\t\t\t}\n\t\t\t\t\tcatchFuncs = null;\n\t\t\t\t\tif (finallies !== null)\t{\n\t\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\t\tfinallies();\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tfinallies.forEach(exec);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfinallies = null;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfunction rejectP(x){\n\t\t\tif (stage === 0) {\n\t\t\t\tretVal = x;\n\t\t\t\tstage = 1;\n\t\t\t\tif (catchFuncs !== null)\t{\n\t\t\t\t\tif (typeof catchFuncs === \"function\") {\n\t\t\t\t\t\tcatchFuncs(x);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcatchFuncs.forEach(proxy, x);\n\t\t\t\t\t}\n\t\t\t\t\tcatchFuncs = null;\n\t\t\t\t}\n\t\t\t\tthenFuncs = null;\n\t\t\t\tif (finallies !== null)\t{\n\t\t\t\t\tif (typeof finallies === \"function\") {\n\t\t\t\t\t\tfinallies();\n\t\t\t\t\t} else {\n\t\t\t\t\t\tfinallies.forEach(exec);\n\t\t\t\t\t}\n\t\t\t\t\tfinallies = null;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// synchonously defered stacking allows for super performance\n\t\tif (isInsidePromise === true) {\n\t\t\tpersuadoStack.push(\n\t\t\t\tfunction(){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t\t} catch(e) {\n\t\t\t\t\t\trejectP(e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t);\n\t\t\tpStackLength = pStackLength + 1|0;//+= 3;\n\t\t} else {\n\t\t\tpromiseLevel = promiseLevel + 1|0;\n\t\t\tif (isInsidePromise = promiseLevel === promiseBufferLvl){\n\t\t\t\ttry {\n\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t} catch(e) {\n\t\t\t\t\trejectP(e);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\ttry {\n\t\t\t\t\tfunc(acceptP, rejectP);\n\t\t\t\t} catch(e) {\n\t\t\t\t\trejectP(e);\n\t\t\t\t}\n\t\t\t\tif (isInsidePromise === true && promiseLevel === 1) { // if this is the outermost promise\n\t\t\t\t\tresolvePends();\n\t\t\t\t}\n\t\t\t}\n\t\t\tpromiseLevel = promiseLevel - 1|0;\n\t\t}\n\t\treturn retObj;\n\t}", "function testasPromise(){\n\t\n\treturn new Promise(function(resolve,reject){\n\t\t\n\t\tfs.readFile('test4.txt', (err, data) => {\n\t\t\t if (err) throw reject(err);\n\t\t\t resolve(data);\n\t\t});\n\t\t\n\t});\n\t\n\t\n}", "function test () {\n return new Promise(() => {})\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 wrapPromise(promise) {\n let status = \"pending\";\n let result;\n let suspender = promise.then(\n r => {\n status = \"success\";\n result = r;\n },\n e => {\n status = \"error\";\n result = e;\n }\n );\n console.log('fetch')\n return {\n read() {\n if (status === \"pending\") {\n throw suspender;\n } else if (status === \"error\") {\n throw result;\n } else if (status === \"success\") {\n return result;\n }\n }\n };\n }", "function defer() {\n\t let resolve = null;\n\t let reject = null;\n\t const p = new Promise((res, rej) => [resolve, reject] = [res, rej]);\n\t return Object.assign(p, { resolve, reject });\n\t}", "function defer() {\n\t let resolve = null;\n\t let reject = null;\n\t const p = new Promise((res, rej) => [resolve, reject] = [res, rej]);\n\t return Object.assign(p, { resolve, reject });\n\t}", "function hipcamp_promise_then(result) {\n my_query.hipcamp_url=result;\n var promise=MTP.create_promise(result,parse_hipcamp,parse_hipcamp_then,function() { GM_setValue(\"returnHit\",true); });\n }", "function liar() {\n\treturn new Promise(() => 0);\n}", "function get(arg) {\n return {\n then: function(ful, rej) {\n ful(arg)\n }\n }\n}", "async function myfunc() {\n let promise = new Promise((resolve, reject) => {\n setTimeout(() => resolve(\"okk\"), 2000);\n });\n\n const result = await promise;\n // await makes it wait till the promise resolves and after the promise is resolved\n // after that it assigns the data returned from the promise to result\n return result;\n}", "function getPromise(){\n// assign our deferment a variable\n var deferred = Q.defer();\n// set our timeout function and delay\n// resolve the deferred promise:\n setTimeout(function() {\n\n deferred.resolve('final value');\n }, 1000);\n// return the deferred promise:\n return deferred.promise;\n}", "function r(e,t,a,i){return new(a||(a=Promise))(function(n,r){function s(e){try{l(i.next(e))}catch(t){r(t)}}function o(e){try{l(i[\"throw\"](e))}catch(t){r(t)}}function l(e){e.done?n(e.value):new a(function(t){t(e.value)}).then(s,o)}l((i=i.apply(e,t||[])).next())})}", "static defer() {\n\t\tlet resolve = null;\n\t\tlet reject = null;\n\n\t\tconst promise = new P((res, rej) => {\n\t\t\tresolve = res;\n\t\t\treject = rej;\n\t\t});\n\n\t\treturn { resolve, reject, promise };\n\t}", "_promiseTry(fn) {\n try {\n return this.Promise.resolve(fn());\n } catch (e) {\n return this.Promise.reject(e);\n }\n }", "function c(e,t,n,r){return new(n||(n=Promise))(function(o,i){function s(e){try{a(r.next(e))}catch(e){i(e)}}function l(e){try{a(r.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(s,l)}a((r=r.apply(e,t||[])).next())})}", "function nativePromiseDinner() {\n brainstormDinner().then((meal) => {\n console.log(`I'm going to make ${meal} for dinner.`);\n })\n}", "function promiseGenerator(value) {\n return new Promise((resolve) => {\n console.log(value)\n resolve(value)\n })\n}", "async function getInfo() {\n const creatingAPromise = await getWithNewPromise();\n console.log(creatingAPromise);\n}", "async function doSomething() {\n // resolve is callback function\n //reject is a callback\n\n logger.log('2: function is called');\n return new Promise((resolve, reject) => {\n\n\n // read from the database.. example\n // the following timeout function is asynchronus block of code\n setTimeout(function () {\n // anonymous function that simulates reading from the database\n resolve(\"3:reading from the database\")\n\n\n // error scenarios\n // var error= new Error(\" connection failed with the database\")\n // reject(error);\n }, 3000);\n });\n\n\n\n}", "function c(t,e,n,r){return new(n||(n=Promise))((function(o,i){function a(t){try{u(r.next(t))}catch(e){i(e)}}function s(t){try{u(r[\"throw\"](t))}catch(e){i(e)}}function u(t){t.done?o(t.value):new n((function(e){e(t.value)})).then(a,s)}u((r=r.apply(t,e||[])).next())}))}", "function getTodo(){\n return new Promise((resolve,reject)=>{\n \tlet error = false;\n \tif(!error){\n \t\tresolve({text:\"you should work on this\"})\n \t}\n \telse{\n \t\treject()\n \t}\n },1000);\n}", "async get_message(msgid) { \n var return_value = false;\n return new Promise((resolve, reject) => {\n this.db().get(\"SELECT * FROM messages WHERE msgid = ?\", [msgid], (error, row) => {\n if(!error) {\n resolve(row);\n } else {\n // Provide feedback for the error\n console.log(error);\n resolve(false);\n }\n });\n }); \n }", "function reusable_fun (mtd, url, asyn) {\n let myPromise = new Promise( (resolve,reject) => {\n let xhttp = new XMLHttpRequest();\n xhttp.open(mtd, url, asyn);\n xhttp.onreadystatechange = () => {\n if(xhttp.readyState == 4 && xhttp.status == 200){\n resolve(xhttp.responseText); \n } else if (xhttp.status > 399){\n reject(xhttp.status); \n }\n };\n xhttp.send();\n });\n return myPromise;\n}", "function $qBluebird(resolve, reject) {\n\t return new Promise(resolve, reject);\n\t}", "then(resolve, reject) {\n return this._deferred.promise.then(resolve, reject);\n }", "result(data) {\n return new Promise((resolve, reject) => {\n console.log('Result: ', data);\n resolve();\n });\n }", "function defer () {\n return new Promise(function (fulfill) {\n fulfill(\"SECOND\");\n });\n}", "function query_promise_then(result) {\n\n my_query.url=result;\n var promise=MTP.create_promise(my_query.url,find_logo,submit_if_done,function() {\n if(!my_query.failed_once&&my_query.old_url) {\n my_query.failed_once=true;\n const queryPromise = new Promise((resolve, reject) => {\n console.log(\"Beginning URL search\");\n query_search(my_query.name+\" real estate agent\" , resolve, reject, query_response,\"query\");\n });\n queryPromise.then(query_promise_then)\n .catch(function(val) {\n console.log(\"Failed at this queryPromise \" + val); GM_setValue(\"returnHit\",true); });\n return;\n }\n\n\n\n\n GM_setValue(\"returnHit\",true); });\n\n }", "then(opt_resolve, opt_reject) {\n if (!opt_resolve && !opt_reject) {\n return this.promise_;\n }\n return this.promise_.then(opt_resolve, opt_reject);\n }", "function g(t,e,o,r){return new(o||(o=Promise))((function(n,a){function i(t){try{s(r.next(t))}catch(t){a(t)}}function l(t){try{s(r.throw(t))}catch(t){a(t)}}function s(t){var e;t.done?n(t.value):(e=t.value,e instanceof o?e:new o((function(t){t(e)}))).then(i,l)}s((r=r.apply(t,e||[])).next())}))}", "function asyncWorkSimple(param) {\n console.log('doing work...', param);\n return new Promise((resolve, reject) => work(100) ? resolve('Succ') : reject('Err'));\n}", "function primjer2() {\n // using a resolved promise, the 'then' block will be triggered instantly, \n // but its handlers will be triggered asynchronously as demonstrated by the console.logs\n const resolvedProm = Promise.resolve(33);\n\n let thenProm = resolvedProm.then((value) => {\n console.log(\"this gets called after the end of the main stack. the value received and returned is: \" + value);\n return value;\n });\n // instantly logging the value of thenProm\n console.log(thenProm);\n\n // using setTimeout we can postpone the execution of a function to the moment the stack is empty\n setTimeout(() => {\n console.log(thenProm);\n });\n\n\n // logs, in order:\n // Promise {[[PromiseStatus]]: \"pending\", [[PromiseValue]]: undefined}\n // \"this gets called after the end of the main stack. the value received and returned is: 33\"\n // Promise {[[PromiseStatus]]: \"resolved\", [[PromiseValue]]: 33}\n}", "function makePromise(val) {\r\n return new Promise((resolve, reject) => {\r\n setTimeout(function () {\r\n resolve(val);\r\n }, Math.random() * 1000);\r\n setTimeout(function () {\r\n reject('rejected!');\r\n }, Math.random() * 2000);\r\n });\r\n}", "function tryMe(config) {\n\n\n const myPromise = new Promise((resolve, reject) => {\n console.log(\"Promise initialized\")\n if (config.simError) {\n // Below two ways are equivalent, difference being the messaging: `throw` prepends \"Error: \"\n //reject(\"Simulating an error\")\n throw new Error(\"Simulating an error\")\n }\n\n if (config.resolveCorrectly) {\n console.log(\"Resolving by returning the output of the resolve() function\")\n /*\n * Initially I was doing `return resolve(\"...\")`. Having `return` does not cause errors, but\n * I guess it does not make sense either. Also I **must** call resolve() (or reject() if\n * the operation fails), else the callbacks passed to any subsequent `then()` will\n * have `undefined` argument passed to them.\n */\n resolve(\"crap\")\n } else if (config.semiCorrect) {\n /*\n * This does not work to resolve the promise. Inside Promise constructor, must invoke `resolve()`\n * function argument that the JavaScript engine passes to this executor (or `reject()` if the \n * operation failed), see comment above.\n */\n console.log(\"Resolving by returning a string\")\n return \"half-ass\"\n }\n })//.catch(reason => console.log(\"Failure reason is \" + reason))\n\n // \n const whatIsThis = myPromise.then()\n\n // Racy read of Promise returned by myPromise defined above, most likely will give\n // Promise { <pending> } (impossible to deterministically get its state when invoked this way)\n console.log(\"whatIsThis (racy read) is: \")\n console.log(whatIsThis)\n //console.log(Promise.prototype)\n\n /*\n * This `then()` will always get executed. Why? Because above we caught one of the two only\n * possible outcomes of the Promise, namely \"resolved\" or \"rejected\".\n */\n let andWtfIsThis = whatIsThis.then(function (x) {\n console.log(\"Was promise properly resolved? \" + config.resolveCorrectly)\n /*\n * This read on the other hand is not racy because the \"whatIsThis\" promise\n * has already ben \"resolved\". We know that because this function, as per the Promise.then()\n * contract, is executed as a callback once the Promise has successfully resolved\n */\n console.log(\"First `then()`, Inside a callback that gets invoked after the Promise has been succcessfull\"\n + \" resolved. Resolved value is \" + x + \", and the promise object itself is:\")\n console.log(whatIsThis)\n return \"first `then()` success value\"\n }, (err) => console.log(\"Inside first `then()`, something bad happened: \" + err)).then(function (y) {\n /*\n * Because the previous `then()` ommitted the arguments, as per the MDN docs [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/then), \n * this then() received the Promise in the same settled state as before that then().\n */\n console.log(\"Really? Called `then()` a second time, here's returned value of previous promise \" \n + \"(if any): \" + y\n + \", and the promise object itself is:\")\n //console.log(this)\n return y\n }, (err) => console.log(\"Second `then()` reject handler says: \" + err)).then((z) => {\n console.log(\"Really, again? Called `then()` a third time, value passed to success handler is \" + z)\n console.log(whatIsThis)\n })\n\n // This call goes into JavaScript's main event loop, meaning that it's executed synchronously\n console.log(\"andWtfIsThis is \" + andWtfIsThis)\n\n andWtfIsThis.then((w) => {\n console.log(\"Inside the andWtfIsThis.then()\")\n console.log(\"andWtfIsThis done right is \" + andWtfIsThis)\n console.log(\"andWtfIsThis' resolved value is \" + w)\n })\n\n //Promise.resolve.\n}", "function job() {\n return new Promise(function(resolve, reject) {\n setTimeout(reject, 500, 'Error happened');\n });\n}", "function createApplyPromise(result){\n var promise;\n if (typeof result === 'boolean'){\n var deferred = $q.defer();\n if (result){\n deferred.resolve();\n } else {\n deferred.reject();\n }\n promise = deferred.promise;\n } else {\n promise = $q.when(result);\n }\n return promise;\n }", "get(url) {\n return new Promise((resolve, reject) => { // will return an instance that is either \"resolved\" or \"rejected\"\n fetch(url) //Promise<Response> // Promise(OK,err) \n .then(res => res.json()) //Promise<Response> // // returns \"data\"\n .then(data => resolve(data))//Promise(OK,err) \n .catch(err => reject(err)) // then() , catch() for resolved \"depending States\"\n })\n }", "then(onResovled, onRejected) {\n\n // each 'then' method return new promise object\n return new MyPromise((nextResolve, nextReject) => {\n\n // confirm has 'onResolved' callback\n if(this._isFunction(onResovled)) {\n // confirm the current status is fullfilled\n if(FULLFILLED === this.status) {\n\n // 后一个then可以捕获前一个then的异常\n try {\n\n // 拿到上一个promise成功回调执行结果 trigger the previous promise resolve callback and get the result\n let result = onResovled(this.value);\n\n // 判断执行的结果是否是一个promise对象 confirm return the promise object or not\n if(result instanceof MyPromise) {\n result.then(nextResolve, nextReject);\n } else {\n // return the primary data value\n console.log('result', result);\n // 将上一个promise成功回调执行结果传递给下一个promise成功的回调。\n // transfer the previouse promise resolve callback result to the next promise resolve callback\n nextResolve(result);\n }\n\n\n } catch (e) {\n nextReject(e);\n }\n\n \n\n \n }\n }\n // confirm has 'onRejected' callback\n if(this._isFunction(onRejected)) {\n\n try {\n\n // confirm the current status is rejected\n if(REJECTED === this.status) {\n // similar as resolved one.\n let result = onRejected(this.reason);\n\n // 判断执行的结果是否是一个promise对象 confirm return the promise object or not\n if(result instanceof MyPromise) {\n result.then(nextResolve, nextReject);\n } else if(result !== undefined ) {\n // result is the data\n // 上一个promise reject 结果传递给下一个resolve结果\n nextResolve(result);\n }\n else {\n nextReject();\n }\n \n }\n\n\n } catch (e) {\n nextReject(e);\n\n }\n \n }\n // 如果添加监听时候状态未改变,那么状态改变时候再执行监听回调\n // 判断当前的状态是否是默认状态 confirm the current status is the default status\n if(PENDING === this.status) {\n if(this._isFunction(onResovled)) {\n // this.onResovledCallback = onResovled;\n // this.onResovledCallback.push(onResovled);\n\n this.onResovledCallback.push(() => {\n\n try {\n\n let result = onResovled(this.value);\n\n // 判断执行的结果是否是一个promise对象 confirm return the promise object or not\n if(result instanceof MyPromise) {\n result.then(nextResolve, nextReject);\n } else {\n nextResolve(result);\n }\n\n } catch (e) {\n nextReject(e);\n }\n \n \n })\n } \n if(this._isFunction(onRejected)) {\n // this.onRejectedCallback = onRejected;\n // this.onRejectedCallback.push(onRejected);\n\n // deal with this by arrow function\n this.onRejectedCallback.push(() => {\n\n try {\n\n let result = onRejected(this.reason);\n // 判断执行的结果是否是一个promise对象 confirm return the promise object or not\n if(result instanceof MyPromise) {\n result.then(nextResolve, nextReject);\n } else if(result !== undefined) {\n nextResolve(result);\n } else {\n nextReject();\n }\n\n } catch (e) {\n nextReject(e);\n }\n \n \n })\n }\n }\n\n });\n\n \n }", "resolvePromise(a) {\n return delay(100).then( ()=> a + ' dog');\n }", "function primjer3() {\n Promise.resolve('foo')\n // 1. Receive \"foo\", concatenate \"bar\" to it, and resolve that to the next then\n .then(function (string) {\n return new Promise(function (resolve, reject) {\n setTimeout(function () {\n string += 'bar';\n resolve(string);\n }, 1);\n });\n })\n // 2. receive \"foobar\", register a callback function to work on that string\n // and print it to the console, but not before returning the unworked on\n // string to the next then\n .then(function (string) {\n setTimeout(function () {\n string += 'baz';\n console.log(string);\n }, 1)\n return string;\n })\n // 3. print helpful messages about how the code in this section will be run\n // before the string is actually processed by the mocked asynchronous code in the\n // previous then block. \n .then(function (string) {\n console.log(\"Last Then: oops... didn't bother to instantiate and return \" +\n \"a promise in the prior then so the sequence may be a bit \" +\n \"surprising\");\n\n // Note that `string` will not have the 'baz' bit of it at this point. This \n // is because we mocked that to happen asynchronously with a setTimeout function\n console.log(string);\n });\n\n // logs, in order:\n // Last Then: oops... didn't bother to instantiate and return a promise in the \n // prior then so the sequence may be a bit surprising\n\n // foobar\n // foobarbaz\n}", "function Fay$$then(a){\n return function(b){\n return Fay$$bind(a)(function(_){\n return b;\n });\n };\n}", "function CreatePromise()\n\t\t{\n\t\t\tlet Callbacks = {};\n\t\t\tlet PromiseHandler = function (Resolve,Reject)\n\t\t\t{\n\t\t\t\tCallbacks.Resolve = Resolve;\n\t\t\t\tCallbacks.Reject = Reject;\n\t\t\t}\n\t\t\tlet Prom = new Promise(PromiseHandler);\n\t\t\tProm.Resolve = Callbacks.Resolve;\n\t\t\tProm.Reject = Callbacks.Reject;\n\t\t\treturn Prom;\n\t\t}", "function asyncThing(num, txHash, context) {\n // something async returning a promise\n\n if (!Web3) {\n console.error(\"no Web3\");\n return null;\n }\n // const network = context.$config.network;\n const infuraUrl = context.$config.infuraUrl;\n // console.log(\"asyncThing: infuraUrl\", infuraUrl);\n const newWeb3 = new Web3(new Web3.providers.HttpProvider(infuraUrl));\n // console.log('asyncThing num txHash context: ', num, txHash, context)\n // console.log('newWeb3: ', newWeb3)\n return new Promise((resolve, reject) => {\n console.log(\" in promise num, txHash: \", num, txHash);\n const timeOut = () => {\n newWeb3.eth\n .getTransactionReceipt(txHash)\n .then((hash) => {\n // console.log(\"hash is: \", hash);\n if (hash === null) {\n console.log(\"no hash, number is: \", num);\n resolve(num);\n } else {\n // console.log(\"hash exists!: \", hash);\n // resolve(-1, hash)\n resolve(hash);\n }\n })\n .catch((error) => {\n console.log(error);\n reject(error);\n });\n };\n setTimeout(timeOut, 1700);\n });\n}", "function primjer8() {\n function resolveLater(resolve, reject) {\n setTimeout(function () {\n resolve(10);\n }, 1000);\n }\n function rejectLater(resolve, reject) {\n setTimeout(function () {\n reject(20);\n }, 1000);\n }\n\n var p1 = Promise.resolve('foo');\n var p2 = p1.then(function () {\n // Return promise here, that will be resolved to 10 after 1 second\n return new Promise(resolveLater);\n });\n p2.then(function (v) {\n console.log('resolved', v); // \"resolved\", 10\n }, function (e) {\n // not called\n console.log('rejected', e);\n });\n\n var p3 = p1.then(function () {\n // Return promise here, that will be rejected with 20 after 1 second\n return new Promise(rejectLater);\n });\n p3.then(function (v) {\n // not called\n console.log('resolved', v);\n }, function (e) {\n console.log('rejected', e); // \"rejected\", 20\n });\n}", "function promiseResolvedWith(value) {\n var promise = new Promise(function (resolve, reject) {\n resolve(value);\n });\n return promise;\n }", "function test() {\n return new Promise((resolve, reject) => {\n promise1()\n .then((ret1) => {\n console.log(ret1);\n promise2()\n .then((ret2) => {\n console.log(ret2)\n promise3()\n .then((ret3) => {\n console.log(ret3);\n })\n .catch((err) => {\n console.error(`Error in promise3`);\n reject(err);\n });\n promise4()\n .then((ret4) => {\n console.log(ret4);\n })\n .catch((err) => {\n console.error(`Error in promise4`);\n reject(err);\n });\n resolve('success!');\n })\n .catch((err) => {\n console.error(`Error in promise2`);\n reject(err);\n });\n })\n .catch((err) => {\n console.error(`Error in promise1`);\n reject(err);\n });\n });\n}", "thenWithState(onResolve = function(r) { return r }, onReject = function(e) { throw e }) { return new StatefulPromise(this.then(onResolve, onReject)); }", "function sum_promises(num1, num2){\n return new Promise((resolve, reject)=>{\n if (num1 > num2){\n resolve(num1 + num2)\n }else{\n reject(num2-num1)\n }\n })\n}", "async function f2() {\n\treturn Promise.resolve(1);\n}", "function func3() {\n return new Promise((resolve, reject) => {\n setTimeout(() => {\n resolve(\"3\");\n }, 3000);\n });\n}", "function forkingPromises(promise, resolutionHandler, rejectionHandler) {}", "function getUser(userID){\n\n return new Promise((resolve,reject)=>{\n console.log('Get User from the DB.')\n\n setTimeout(()=> {\n resolve({\n userID:userID,\n username: 'John'\n })\n },1000)\n })\n \n}" ]
[ "0.69060785", "0.68793094", "0.6738662", "0.66707516", "0.6631428", "0.6629244", "0.6622063", "0.6622063", "0.6619598", "0.6610736", "0.6610736", "0.65989494", "0.6543901", "0.6527348", "0.65162736", "0.64883214", "0.64841634", "0.6478801", "0.64771414", "0.6470374", "0.6463577", "0.6432616", "0.64205056", "0.6409601", "0.63870144", "0.63743216", "0.63691807", "0.6347995", "0.63446045", "0.6337848", "0.6335981", "0.6331787", "0.63200986", "0.62994975", "0.62933165", "0.6266788", "0.62569034", "0.6254519", "0.6234545", "0.6223769", "0.6208767", "0.62062466", "0.619356", "0.6131553", "0.6116974", "0.6107993", "0.61032945", "0.60875094", "0.60777354", "0.6064482", "0.6052399", "0.60505956", "0.6035406", "0.6035406", "0.6004419", "0.60040313", "0.6002521", "0.5997023", "0.5983531", "0.59359246", "0.59326833", "0.59310704", "0.59292877", "0.5926504", "0.5923622", "0.59224653", "0.59194446", "0.5914659", "0.5911268", "0.59100163", "0.5908721", "0.59015834", "0.5900742", "0.59001833", "0.5892258", "0.588648", "0.58855844", "0.5883992", "0.5882385", "0.58815527", "0.58762956", "0.5873785", "0.5871057", "0.58709824", "0.5865437", "0.585829", "0.58580637", "0.5856426", "0.58520275", "0.58499855", "0.5840808", "0.5840092", "0.5837519", "0.58358276", "0.58292246", "0.58233213", "0.5823042", "0.5821318", "0.5821134", "0.58205926" ]
0.6226449
39
helper function to display the first board
function displayBoard(board) { for (let i = 0; i < 4; i++) { const xVal = (i + 1) * 50; for (let j = 0; j < 4; j++) { const yVal = j * 50 + 50; if (board[4 * j + i] === "blank") { gameState.tiles.create(xVal, yVal, board[4 * j + i]).setScale(0.6); } else { gameState.tiles.create(xVal, yVal, board[4 * j + i]); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function DisplayBoard() {\n\tconsole.log(\"Turn \"+(TotalEmptyPegs-1))\n\tlet spacer = \" \"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tlet text = \"\"\n\t\tfor (var y = 0; y < board[i].length; y++) {\n\t\t\tif(board[i][y].isFilled) { text+=\" X\" }\n\t\t\telse text+=\" O\"\n\t\t\t\n\t\t\tspacer = spacer.substring(0, spacer.length - 1);\n\t\t}\n\t\tconsole.log(spacer+text)\n\t}\n\t\n}", "function printBoard() {\n console.log(' 0 1 2');\n console.log('0 ' + board[0].join(' | '));\n console.log(' ---------');\n console.log('1 ' + board[1].join(' | '));\n console.log(' ---------');\n console.log('2 ' + board[2].join(' | '));\n}", "function printBoard() {\n console.log(' 0 1 2');\n console.log('0 ' + board[0].join(' | '));\n console.log(' ---------');\n console.log('1 ' + board[1].join(' | '));\n console.log(' ---------');\n console.log('2 ' + board[2].join(' | '));\n}", "function display(board) {\n var element = document.createElement('pre');\n document.body.appendChild(element);\n\n setInterval(function () {\n element.innerText = board + '';\n board.next();\n }, 1000);\n }", "function printBoard(board) {\n console.log(\" \")\n console.log(\" \" + board[0] + \" | \" + board[1] + \" | \" + board[2] + \" \")\n console.log(\"---|---|---\")\n console.log(\" \" + board[3] + \" | \" + board[4] + \" | \" + board[5] + \" \")\n console.log(\"---|---|---\")\n console.log(\" \" + board[6] + \" | \" + board[7] + \" | \" + board[8] + \" \")\n console.log(\" \")\n }", "function showBoard(theBoard) {\n\tprocess.stdout.write('\\033c');\n\tfor (var i = 0; i < theBoard._size[0]; i++) {\n\t\tif (i > 2 && i < 25) {\n\t\t\tconsole.log(\n\t\t\t\ttheBoard._data[i]\n\t\t\t\t\t.toString()\n\t\t\t\t\t.replace(/,/g, ' ')\n\t\t\t\t\t.replace(/0/g, ' ')\n\t\t\t\t\t.replace(/2\\s/g, '██')\n\t\t\t\t\t.replace(/1\\s?/g, '██')\n\t\t\t\t\t.replace(/3\\s/g, '\\x1b[33m██\\x1b[0m')\n\t\t\t\t\t.replace(/4\\s/g, '\\x1b[34m██\\x1b[0m')\n\t\t\t\t\t.replace(/5\\s/g, '\\x1b[35m██\\x1b[0m')\n\t\t\t\t\t.replace(/6\\s/g, '\\x1b[36m██\\x1b[0m')\n\t\t\t\t\t.replace(/7\\s/g, '\\x1b[32m██\\x1b[0m')\n\t\t\t\t\t.replace(/8\\s/g, '\\x1b[31m██\\x1b[0m')\n\t\t\t);\n\t\t}\n\t}\n}", "printBoard() {\n for (let x = 0; x < this.board.length; x++) {\n console.log(this.board[x].join(' '));\n }\n }", "function printBoard()\n{\n var rowString = '';\n\n for (var row = 0; row < this._numRows; row++)\n {\n rowString = '';\n for(var column = 0; column < this._numColumns; column++)\n {\n rowString += this._tiles[row][column].toString();\n }\n console.log(rowString);\n }\n}", "printBoard() {\r\n let print = \"\";\r\n for (let x = 0; x < 13; ++x) {\r\n for (let y = 0; y < 13; ++y) {\r\n print += this.board[y][x] + \" \";\r\n }\r\n console.log(print);\r\n print = \"\";\r\n }\r\n }", "printBoard() {\n console.log(\"<========== Board: Actual ==========>\")\n for (let i = 0; i < this.size; i++) {\n let row = '';\n for (let j = 0; j < this.size; j++) {\n let cell;\n if (this.isMine(i, j)) {\n cell = 'X';\n }\n else {\n cell = '.';\n }\n row += cell;\n }\n console.log(row)\n }\n\n console.log(\"<========== Board: What user sees ==========>\");\n for (let i = 0; i < this.size; i++) {\n let row = '';\n for (let j = 0; j < this.size; j++) {\n let cell;\n if (this.isMarked(i, j)) {\n cell = 'M';\n }\n else if (this.isNumbered(i, j)) {\n const num = this.getNumNeightborMines(i, j);\n cell = num === 0 ? '*' : num;\n }\n else {\n cell = '.';\n }\n row += cell;\n }\n console.log(row)\n }\n }", "function displayBoard(board,width){\n let arr = board.join('').match(new RegExp(`.{${width}}`,'g')).map(a =>[...a].map(b =>` ${b} `).join('|')),\n sep = '\\n'+'-'.repeat(arr[0].length)+'\\n';\n return arr.join(sep);\n}", "function printBoardSimple(){\n for (var i = 0; i < height; i++){\n for (var j = 0; j < width; j++){\n if (block2D[i][j] == 0){\n process.stdout.write(\"-\\t\\t\");\n }\n else {\n process.stdout.write(block2D[i][j] + \"\\t\\t\");\n }\n if (j == (width - 1)){ //Print next line\n console.log();\n }\n }\n }\n console.log();\n}", "boardToString(board){\r\n var str = \"\";\r\n\r\n for(let i=0;i<board.length;i++){\r\n if(board[i] === null) str += \". \"\r\n else str += board[i][0] + \"\" + board[i][1]\r\n\r\n if((i+1)%8 === 0) str+= \"\\n\"\r\n else str += \" \"\r\n }\r\n return str;\r\n }", "print(){\n const formatter = (acc,row) => acc.concat(`${row[1]} ${row[2]} ${row[0]}\\n`);\n return this.board.reduce( formatter,\"\");\n }", "function blankBoard() {\n var display = [];\n var evenRow = [\" \",\"___\",\" \",\"___\",\" \",\"___\",\" \",\"___\"];\n var oddRow = [\"___\",\" \",\"___\",\" \",\"___\",\" \",\"___\",\" \"];\n for (var row=0; row<8; row++) {\n if (row % 2 == 0) {display[row] = evenRow.slice(0);}\n else {display[row] = oddRow.slice(0);}\n };\n return display;\n}", "displayBoard() {\n this.translateBoard();\n // if (this.states == STATES.DISPLAYED)\n this.updateScore();\n //}\n }", "function printBoard(board) {\n console.log('---+---+---');\n\n for (let row of board) {\n console.log(' | | ');\n console.log(` ${row.join(' | ')} `);\n console.log(' | | ');\n console.log('---+---+---');\n }\n}", "print() {\n for (var i = 0; i < board.length; i++) {\n console.log(board[i].join(''));\n }\n }", "function printBoard() {\n if ($(\".mdl-spinner\").hasClass(\"is-active\")) $(\".mdl-spinner\").removeClass(\"is-active\");\n $(\"#chessBoard\").show();\n size(pixelSize*1000,pixelSize*1000);\n scale(pixelSize,pixelSize); \n stroke(0);\n fill(#0000FF);\n textFont(loadFont(\"Meta-Bold.ttf\"));\n for(var y = 0, ypos=100; y < 8; y++, ypos+=100) {\n for(var x = 0, xpos=100; x < 8; x++, xpos+=100) {\n if((x+y)%2) fill(100); else fill(255); // select white or black squares\n rect(xpos,ypos,100,100); // print an empty square\n if (reverse) {\n if (gData.board[7-y][7-x]> -1)\n image(images[gData.board[7-y][7-x]], xpos, ypos ,100,100); // print the image of the piece based on the value\n } else {\n if (gData.board[y][x]> -1)\n image(images[gData.board[y][x]], xpos, ypos ,100,100); // print the image of the piece based on the value\n }\n }\n }\n $(\"#chessCanvas\").show();\n}", "function printNimBoard() {\n console.log(nimBoard);\n console.log('_________________________________________________________________________________________');\n}", "function printBoard (board) {\n for (var r = 0; r < 3; r++) {\n console.log(getPlayer(board[r][0]) + '|' + getPlayer(board[r][1]) + '|' + getPlayer(board[r][2]));\n }\n}", "printBoard(){\n for (var i=0; i < game.n; i++) {\n console.log(game.board[i])\n }\n console.log(\"\");\n }", "function blankBoard() {\n var display = new Array(8)\n var evenRow = [\" \",\"___\",\" \",\"___\",\" \",\"___\",\" \",\"___\"];\n var oddRow = [\"___\",\" \",\"___\",\" \",\"___\",\" \",\"___\",\" \"];\n for (var row=0; row<8; row++) {\n if (row % 2 == 0) {display[row] = evenRow.slice(0);}\n else {display[row] = oddRow.slice(0);}\n };\n return display;\n}", "function displayBoards() {\n displayGameBoard();\n displayPlayerBoard();\n displayExpeditions();\n}", "function getBoard() {\n var boardString = \"\";\n\n if (currentColor == \"black\") {\n boardString += \"b:\";\n }\n else {\n boardString += \"r:\";\n }\n\n for(var i = 0; i < 64; i++) {\n var floorRow = Math.floor(i/8);\n if (((floorRow % 2 == 0) && (i % 2 == 1)) || ((floorRow % 2 == 1) && (i % 2 == 0))) {\n if (occupiedArray[floorRow][i % 8] == null) {\n boardString += \"-\";\n }\n else if (occupiedArray[floorRow][i % 8].classList.contains(\"red\")) {\n if (occupiedArray[floorRow][i % 8].classList.contains(\"king\")) {\n boardString += \"R\";\n }\n else {\n boardString += \"r\";\n }\n }\n else {\n if (occupiedArray[floorRow][i % 8].classList.contains(\"king\")) {\n boardString += \"B\";\n }\n else {\n boardString += \"b\";\n }\n }\n }\n }\n console.log(boardString);\n return boardString;\n}", "function printBoard(){\n\tfor (var i=0; i<4; i++){\n\t\tconsole.log(board[i]);\n\t}\n}", "function getStartBoard(){\n var StartBoard = [0,1,0,1,0,1,0,1,\n 1,0,1,0,1,0,1,0,\n 0,1,0,1,0,1,0,1,\n 0,0,0,0,0,0,0,0,\n 0,0,0,0,0,0,0,0,\n 2,0,2,0,2,0,2,0,\n 0,2,0,2,0,2,0,2,\n 2,0,2,0,2,0,2,0];\n return StartBoard;\n}", "prvarBoard() {\n\n process.stdout.write('\\t');\n for (var i = 0; i < this.width; i++) {\n process.stdout.write(i+1 + '\\t');\n }\n console.log();\n\n for (let i = 0; i < this.height; ++i) {\n\n process.stdout.write(i+1 + '\\t');\n\n for (let j = 0; j < this.width; ++j) {\n if (this.board[i][j] == -1) {\n process.stdout.write('.\\t')\n } else {\n process.stdout.write(this.board[i][j] + \"\\t\")\n }\n }\n console.log();\n }\n }", "display() {\n for (let i = 0; i < this.pieces.length; i++) {\n let x_cord = this.pieces[i][0];\n let y_cord = this.pieces[i][1];\n let curr_piece = this.gameboard[x_cord][y_cord];\n imageMode(CORNER);\n if (!(curr_piece === null)) {\n image(curr_piece.srcImg, curr_piece.x, curr_piece.y)\n }\n }\n }", "function printBoards(boards) {\n console.log('printing boards ===========', boards.length);\n if (boards.length !== 0) {\n for (var i = 0; i < boards.length; i++) {\n console.log('board ', i, ' : ', boards[i]._id, boards[i].name);\n }\n }\n}", "function drawNext(){\n prepareNextPiece();\n\n if(matrixNext.type === 'L' || matrixNext.type === 'I'){\n var copy = rotateLeft(matrixNext.matrix);\n drawNextPiece(copy, {x:2.5, y: 0.5});\n }\n else{\n //show the current piece\n drawNextPiece(matrixNext.matrix, {x: 3, y: 0.9});\n }\n}", "function printBoard(){\n for (i=0; i<5; i++){\n console.log(board[i].join(' '));\n }\n}", "toString(){\r\n let boardString = \"\";\r\n let print = \"\";\r\n for (let x = 0; x < 13; ++x) {\r\n for (let y = 0; y < 13; ++y) {\r\n print += this.board[y][x] + \" \";\r\n }\r\n boardString = boardString + print + \"\\r\\n\";\r\n print = \"\";\r\n }\r\n return boardString;\r\n }", "board() {\n for(let i = 0; i < this.canvas.length; i++){\n console.log(this.canvas[i].join('|'))\n }\n return ''\n }", "function drawBoard(board) {\n clearBoard();\n for (let i = 0; i < 3; i++) {\n for (let j = 0; j < 3; j++) {\n if (!board[i][j]) {\n continue;\n }\n document.getElementById(\"row-\"+i+\"-column-\"+j).innerText = board[i][j] === \"nought\" ? \"⭕\" : \"❌\";\n }\n }\n}", "function displayChessboard() {\n var rows = [];\n for (var i = 0; i < 5; i++) {\n var row = [];\n for (var j = 0; j < 5; j++) {\n if ((j + i) % 2 == 0) row.push(new TextCell('##'));\n else row.push(new TextCell(' '));\n }\n rows.push(row);\n }\n console.log(drawTable(rows));\n}", "function renderBoard(board, boardStatus) {\n for (var i = 0; i < 9; i++) {\n if (boardStatus[i] == \"X\" || boardStatus[i] == \"O\") {\n $(board[i]).html('<p>' + boardStatus[i] + '</p>');\n }\n else {\n $(board[i]).html('<p></p>');\n }\n }\n}", "firstMove() {\n const size = this.board.size;\n const corners = [[0, 0],[0, size - 1], [size - 1, 0], [size - 1, size - 1]];\n const selection = corners[this.getRandom(4)];\n const row = selection[0];\n const col = selection[1];\n return this.board.content[row][col];\n }", "show() {\n let colorIdx = (this.x + this.y) % 2 // checkerboard pattern for board tiles\n fill(this.color[colorIdx]);\n noStroke();\n rectMode(CORNER);\n rect(this.x * TILE_SIZE, this.y * TILE_SIZE, TILE_SIZE, TILE_SIZE);\n }", "function chessBoard(num){\n var cb = \"\";\n if (num === 1){\n cb = \" \";\n }\n else {\n var lastStarting = \" \"; // total length = (num*num-1) + (num-1)\n console.log(\"Last Starting is:\"+lastStarting);\n cb += lastStarting;\n for (var j = 1; j <= num; j++){\n for (var i = 1; i < num; i++){\n if (cb[cb.length-1] ===\" \"){cb += \"#\";}\n else if (cb[cb.length-1]===\"#\"){cb+= \" \";}\n }\n if (j!=num){\n cb+=\"\\n\";\n if (lastStarting == \" \") {\n cb+=\"#\";\n lastStarting = \"#\";\n }\n else {\n cb+=\" \";\n lastStarting = \" \";\n }\n }\n\n }\n\n }\n console.log(cb);\n}", "print() {\n // create a string, containing origin of this Game's grid\n let str = `origin: [ ${this.origin.x}, ${this.origin.y} ]\\n\\n`;\n\n // for edge case of no live cells\n if (Object.keys(this.cells).length === 0) {\n return console.log(str + ' [ [ 0 ] ]');\n }\n\n // format and add game to string, cells represented as '#' if live, '.' if dead\n let offset = ' '.repeat(str.length + 2);\n for (let row = 0; row < this.grid.length; row++) {\n str += row === 0 ? ` [ [ ` : ` [ `;\n this.grid[row].forEach((cell) => (str += cell ? '# ' : '. '));\n str += row === this.grid.length - 1 ? '] ] \\n\\n' : '] \\n';\n }\n console.log(str);\n }", "function renderBoard(board) {\n var strHTML = ''\n for (var i = 0; i < board.length; i++) {\n strHTML += '<tr>';\n for (var j = 0; j < board[i].length; j++) {\n strHTML += `<td class=\"cell-${i}-${j}\" onmouseup=\"(gFirstClickIndicator)? firstClick(event, this) : cellClicked(event, this)\">`; // onmousedown=\"firstClick(this)\"\n strHTML += (board[i][j].isMine) ? MINE :\n (board[i][j].isMarked) ? FLAG :\n (board[i][j].isShown) ? (board[i][j].minesAroundCount === 0) ? '' :\n board[i][j].minesAroundCount : '';\n strHTML += '</td>';\n }\n strHTML += '</tr>';\n }\n\n var elBoard = document.querySelector('.board-container');\n elBoard.innerHTML = strHTML;\n console.log(elBoard);\n}", "showBoard() \n { \n document.getElementById(\"board\").style.display = \"inline-block\";\n }", "toString() {\n let boardString = ``;\n for (let index = 0; index < this.gameState.board.length; index++) {\n if (index % this.size === 0) {\n boardString += `\\n`;\n }\n if (this.gameState.board[index] === 0) {\n boardString += ` [ ] `;\n } else {\n boardString += ` [ ${this.gameState.board[index]} ] `;\n }\n }\n\n return `${boardString} \\nscore: ${this.gameState.score} \\nwon: ${this.gameState.won} \\nover: ${this.gameState.over}\\n`\n }", "printGrid() {\n let str = \"\";\n let i;\n for (i = 0; i < this.rows*this.cols; ++i) {\n if (i % this.cols === 0) {\n str += \"\\n\";\n }\n if (this.getCellStateFromIndex(i) === 1)\n str += \"1\";\n else\n str += \"0\";\n }\n console.log(str);\n }", "function displayBoard(){\n\t$(\"#container\").html(\"\");\n\tdisplayTimer();\n\tdisplaySkor();\n\tdisplaySoal();\n\tdisplayOpsi();\n\treturn null;\n}", "getBoardString() {\n let s = \"\";\n for (let i = 0; i < this.num_rows; i++) {\n for (let j = 0; j < this.num_cols; j++) {\n s +=\n this.board[i][j] + \" \".repeat(this.calculateSpace(this.board[i][j]));\n }\n s += \"\\n\";\n }\n return s;\n }", "toString() {\n var numRows = this.dimension;\n var tileNum = 0;\n var toPrint = [];\n for (var i = 0; i < numRows; i++) {\n for (var j = 0; j < numRows; j++) {\n if (this.gameState.board[tileNum] == 0) {\n toPrint.push(\"[ ]\");\n } else {\n toPrint.push(\"[\" + this.gameState.board[tileNum] + \"]\");\n }\n tileNum++;\n }\n console.log(toPrint.join(\" \"));\n toPrint = [];\n }\n }", "function PrintBoard(board, location){\n var tilenum = 1;\n location.innerHTML = \"\"\n for(var i = 0; i < board.length ; i++){\n for(var j = 0; j < board[i].length; j++){\n var each = \"<button class = 'tile-default' id='tile\" + (tilenum).toString()+ \"'> \" + board[i][j] + \"</button>\"\n location.innerHTML += each;\n tilenum += 1;\n }\n location.innerHTML += \"<br />\"\n }\n}", "function showSudokuPuzzleCompact() {\n\tvar r, c;\n\tvar x;\n\tvar row = \"\";\n\tvar emptyFields = getNumberEmptyFields();\n\tconsole.log(\"Sudoku %s\\n\", getSudokuDescription());\n\n\tconsole.log(\"Set fields %d, empty fields %d\\n\", 81-emptyFields, emptyFields);\n\t\n\tfor (r=0; r<9; r++) {\n\t\trow = \"\";\n\t\t// console.log(\"\\n\");\n\t\tfor (c=0; c<9; c++) {\n\t\t x = getPuzzleValue(r, c);\n\t\t if (x===0) {\n\t\t x = \" \";\n\t\t }\n\t\t row = row + x + \" \";\n\t\t\t// console.log(\"%2d \", getPuzzleValue(r, c));\n\t\t}\n\t\tconsole.log(row);\n\t\t\n\t}\n\t// console.log(\"\\n\");\n\treturn(\"Done\");\n}", "function render() {\n board.forEach(function(move, index) {\n if (move === 1) {\n move = 'x';\n } if (move === -1) {\n move = 'o';\n }\n cells[index].textContent = move;\n cells[index].style.background = colors[cells];\n });\n}", "function printboard(board, x=-1, y=-1, change=\".\") {\n\tvar boardstr = \"\"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tfor (var j = 0; j < board[i].length; j++){\n\t\t\tif (x == j && y == i) {\n\t\t\t\tboardstr += change+\" \";\n\t\t\t} else {\n\t\t\t\tboardstr += board[i][j]+\" \";\n\t\t\t}\n\t\t}\n\t\tboardstr += \"\\n\";\n\t}\n\tconsole.log(boardstr)\n}", "function renderBoard() {\n model.checkGameStatus();\n model.toString();\n model.checkGameStatus();\n }", "render() {\n for (let i = 0; i < 6; i++) {\n let elem = document.getElementById('h'+i); \n elem.innerText = this.masterBoardArray[i];\n }\n for (let i = 7; i < 13; i++) {\n let elem = document.getElementById('h'+i);\n elem.innerText = this.masterBoardArray[i];\n }\n stores[1].innerText = this.masterBoardArray[6];\n stores[0].innerText = this.masterBoardArray[13];\n if (this.playerOne.isTurn) {\n activePlayer = this.playerOne.name;\n }\n else if (this.playerTwo.isTurn) {\n activePlayer = this.playerTwo.name;\n }\n info.innerText = `It is ${activePlayer}'s turn.`;\n this.renderSeeds();\n }", "function drawNextPiece() {\n clearPieceBoard();\n var block = nextPiece.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 drawPixelNext( 1+j, i, nextPiece.colour);\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 checkerboard(width,height){\n\n\tconsole.log(\"# # # #\");\n\tconsole.log(\"# # # #\");\n\tconsole.log(\"# # # #\");\n}", "function printChessboard(chess) {\n console.log();\n console.log(\"##########################################\");\n console.log();\n console.log(chess.ascii());\n\n var turn = \"\"\n if(chess.turn() == \"w\") {\n turn = \"white\";\n } else {\n turn = \"black\";\n }\n\n console.log(\"Turn: \" + turn );\n}", "function consoleGridPrinter(){\n var header = \"\\\\\"\n for (let i = 0; i < GRID_COL_SIZE; i++) {\n header += \" \" + i\n }\n console.log(header)\n for (let i = 0; i < GRID_ROW_SIZE; i++) { \n var thisline = i + \" \" \n for (let j = 0; j < GRID_COL_SIZE; j++) {\n thisline += Grid[i][j].State[0] + \" \"\n }\n console.log(thisline)\n }\n}", "function render() {\n //render board\n board.forEach(function (cell, cellIdx) {\n const div = document.getElementById(`cell${cellIdx}`);\n div.innerText = playerLookup[cell];\n // })\n });\n // render turn or winner message\n if (winner) {\n } else {\n //render whos turn\n msgEl.innerHTML = `${playerLookup[turn]}'s Turn`;\n }\n}", "display() {\n if (this.cards.length) {\n // show the top card and make all cards move towards the position\n // of the deck\n this.cards[0].display(this.pos.x, this.pos.y, true);\n this.cards.forEach(c => c.approach(this.pos));\n } else {\n //show the empty slot\n stroke(0);\n strokeWeight(3);\n fill(255, 255, 255, 100);\n rect(this.pos.x, this.pos.y, CARDWIDTH, CARDHEIGHT);\n }\n }", "function showBoard() {\n let id = $(this).data('id');\n $.get('/games/' + id, function (game) {\n let state = game.data.attributes.state\n let $tds = $('td');\n for (let index = 0; index < state.length; index++) {\n $tds[index].innerHTML = state[index];\n };\n current_game = id;\n turn = turn_count();\n });\n}", "show(hideFirstCard = false)\n\t{\n\t\tif (this.numCards == 0)\n\t\t\treturn;\n\n\t\tif (hideFirstCard == true)\n\t\t\tcout(\"** \");\n\t\telse\n\t\t{\n\t\t\tthis.cards[0].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\n\t\tfor (let x = 1; x < this.numCards; x++)\n\t\t{\n\t\t\tthis.cards[x].print(true);\n\t\t\tcout(\" \");\n\t\t}\n\t}", "function drawChessboard(size) {\n var left = \"\";\n var right = \"\";\n var final = [];\n if (size % 2 === 0) {\n for (let r = 0; r < (size / 2); r++) {\n right += \" #\";\n \n }\n for (let l = 0; l < (size / 2); l++) {\n left += \"# \";\n }\n for (let f = 0; f < (size / 2); f++) {\n final.push(right);\n final.push(left);\n }\n } else if (size % 2 === 1) {\n for (let r = 0; r < ((size - 1) / 2); r++) {\n right += \" #\";\n }\n right += \" \";\n for (let l = 0; l < ((size - 1) / 2); l++) {\n left += \"# \";\n }\n left += \"#\";\n for (let f = 0; f < ((size - 1) / 2); f++) {\n final.push(right);\n final.push(left);\n }\n\n final.push(right);\n }\n final.push(\"\");\n console.log(final.join(\"\\n\"));\n}", "function board_string(board, x, y) {\n\tvar boardstr = \"\"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tfor (var j = 0; j < board[i].length; j++){\n\t\t\tboardstr += board[i][j];\n\t\t}\n\t\tboardstr += \"\\n\";\n\t}\n\treturn boardstr;\n}", "function displayboard() {\n //recall board is 7x6\n for (var row = 0; row < 6; row++) {\n for (var col = 0; col < 7; col ++) {\n if (board[row][col] != 0) {\n //https://www.w3schools.com/tags/tag_tr.asp\n //https://www.w3schools.com/tags/tag_td.asp\n var cell = $(\"tr:eq(\" + row + \")\").find('td').eq(col);\n cell.children('button').addClass(board[row][col]);\n }\n }\n }\n}", "function render() {\n board.forEach(function(colArr, colIdx) {\n colArr.forEach(function(cell, rowIdx) {\n const td = document.getElementById(`c${colIdx}r${rowIdx}`);\n td.style.backgroundColor = playerColors[cell];\n });\n });\n // hide/show colMarkers\n colMarkers.forEach(function(div, idx) {\n const colArr = board[idx];\n div.style.display = colArr.includes(0) ? 'block' : 'none';\n });\n if (winner === 'T') {\n msgEl.textContent = \"It's a Tie\";\n } else if (winner) {\n const player = playerColors[winner].toUpperCase();\n msgEl.textContent = `${player} Wins!`;\n } else {\n const player = playerColors[turn].toUpperCase();\n msgEl.textContent = `${player}'s Turn`;\n }\n replayBtn.style.visibility = winner ? 'visible' : 'hidden';\n}", "function GenerateBoardView()\r\n{\r\n\tvar board=\"\";\r\n\tfor(i=0;i<boardLength;i++)\r\n\t{\r\n\t\tif(boardItemCosts[i]==KOEF_WORD2)\r\n\t\t board+='<img class=\"cell\" src=\"board/word2.png\" id=\"cell'+(i+1)+'\">';\t\r\n\t else\r\n\t\t if(boardItemCosts[i]==KOEF_WORD3)\r\n\t\t board+='<img class=\"cell\" src=\"board/word3.png\" id=\"cell'+(i+1)+'\">';\t\t\r\n\t\t else\r\n\t\t if(boardItemCosts[i]==KOEF_LETTER2)\r\n\t\t board+='<img class=\"cell\" src=\"board/letter2.png\" id=\"cell'+(i+1)+'\">';\t\t\r\n\t\t else\r\n\t\t if(boardItemCosts[i]==KOEF_LETTER3)\r\n\t\t board+='<img class=\"cell\" src=\"board/letter3.png\" id=\"cell'+(i+1)+'\">';\t\t\r\n else\t\t\t \r\n\t\t board+='<img class=\"cell\" src=\"board/empty.png\" id=\"cell'+(i+1)+'\">';\t\t\t\t\t\t \r\n\t}\r\n\treturn board;\t\r\n}", "print() {\n // Changed: Typo--missing \".\" in \"this._board\".\n // console.log(this_board.map(row => row.join(' | ')).join('\\n'));\n console.log(this._playerBoard.map(row => row.join(' | ')).join('\\n'));\n }", "function boardToString(board) {\n let stringBoard = \" \";\n const size = Math.sqrt(board.length);\n // adds row label\n for(let i = 0; i < size; i++) {\n stringBoard += \" \" + String.fromCodePoint(65+i) + \" \";\n }\n stringBoard += \"\\n\";\n // adds border\n stringBoard += \" +\";\n for(let i = 0; i < size; i++) {\n stringBoard += \"---+\";\n }\n stringBoard += \"\\n\";\n\n for(let i = 0; i < size; i++) {\n // adds values\n if (i < 9) {\n stringBoard += \" \" + (i+1) + \" |\";\n }\n else {\n stringBoard += (i+1) + \" |\";\n }\n for(let j = 0; j < size; j++) {\n stringBoard += \" \" + board[rowColToIndex(board, i, j)] + \" |\";\n }\n stringBoard += \"\\n\";\n // adds border\n stringBoard += \" +\";\n for(let j = 0; j < size; j++) {\n stringBoard += \"---+\";\n }\n stringBoard += \"\\n\";\n }\n return stringBoard;\n}", "print() {\r\n console.log(this._playerBoard.map(row => row.join(' | ')).join('\\n'));\r\n }", "print() {\n console.log(this._playerBoard.map(row => row.join(' | ')).join('\\n'));\n }", "function printLayout(player) {\n var marker, coord;\n\n // print board header\n process.stdout.write(\" \");\n\n for (var y = 0; y < game.HEIGHT; y++) {\n process.stdout.write(y + \" \"); \n }\n process.stdout.write(\"\\n\");\n\n //print board body\n for (var x = 0; x < game.WIDTH; x++) {\n process.stdout.write(indexToChar(x) + \": \"); \n\n for (var y = 0; y < game.HEIGHT; y++) {\n coord = x.toString() + \",\" + y.toString();\n if (typeof layout[player][coord] == 'undefined') {\n marker = \"~\";\n } else {\n marker = layout[player][coord];\n }\n process.stdout.write(marker + \" \"); \n }\n process.stdout.write(\"\\n\"); \n }\n }", "function firstTurn() {\n return (board.numEmpty() == 16);\n}", "function printBoard2D(){\n for (var i = 0; i < height; i++){\n for (var j = 0; j < width; j++){\n process.stdout.write(\"[\" + i + \"]\" + \"[\" + j + \"]\" + block2D[i][j] + \"\\t\\t\");\n if (j == (width - 1)){\n console.log();\n }\n }\n }\n}", "function drawBoard() {\n $(\"#board\").html('');\n for (var i = 0; i < board.length; i++) {\n var rowDiv;\n if (i % DIM == 0) {\n rowDiv = $(\"<div>\").attr(\"id\", getRowId(i)).addClass(\"row\").appendTo(\"#board\");\n }\n\n $('<div/>')\n .attr(\"id\", getCellId(board[i]))\n .addClass(\"btn btn-primary\")\n .text(board[i])\n .appendTo(rowDiv)\n .css(\"width\", WIDTH).css(\"height\", HEIGHT)\n .on(\"click\", notifyClick);\n }\n\n // Hide the empty cell.\n $(\"#cell-0\").invisible();\n }", "function boardWin() {\r\n}", "render() {\n const status = \"Next player: X\";\n\n return (\n <div>\n <div className=\"status\">{status}</div>\n <div className=\"board-row\">\n {this.renderSquare(0)}\n {this.renderSquare(1)}\n {this.renderSquare(2)}\n </div>\n <div className=\"board-row\">\n {this.renderSquare(3)}\n {this.renderSquare(4)}\n {this.renderSquare(5)}\n </div>\n <div className=\"board-row\">\n {this.renderSquare(6)}\n {this.renderSquare(7)}\n {this.renderSquare(8)}\n </div>\n </div>\n );\n }", "function run() {\n if (firstRun) {\n setup()\n firstRun = false\n }\n board.initialize(function() {\n display.initialize(function(){\n cursor = {\n x: 0,\n y: 0,\n selected: false\n }\n display.redraw(board.getBoard(), function() {})\n })\n // display.redraw(board.getBoard(), function() {})\n })\n }", "toString() {\n let result = \"\";\n for (let r = 0; r < this.boardSize; ++r) {\n for (let c = 0; c < this.boardSize; ++c) {\n let candy = this.square[r][c];\n if (candy) {\n result += candy.toString().charAt(0) + \" \";\n } else {\n result += \"_ \";\n }\n }\n result += \"<br/>\";\n }\n return result.toString();\n }", "function nextBoards(board){\r\n var res = []\r\n //finds the first empty square\r\n const firstEmpty = findEmptySquare(board) //<--(y, x)\r\n if(firstEmpty != undefined){\r\n const y = firstEmpty[0] \r\n const x = firstEmpty[1]\r\n for(var i = 1; i<=9; i++){\r\n var newBoard = [...board] //to tell javaScript we don't want to have a bunch of boards that point to the exact same board\r\n var row = [...newBoard[y]]\r\n row[x] = i\r\n newBoard[y] = row\r\n res.push(newBoard)\r\n }\r\n }\r\n return res\r\n}", "render() {\n const status = 'Next player: X';\n\n return (\n <div>\n <div className=\"status\">{status}</div>\n <div className=\"board-row\">\n {this.renderSquare(0)}\n {this.renderSquare(1)}\n {this.renderSquare(2)}\n </div>\n <div className=\"board-row\">\n {this.renderSquare(3)}\n {this.renderSquare(4)}\n {this.renderSquare(5)}\n </div>\n <div className=\"board-row\">\n {this.renderSquare(6)}\n {this.renderSquare(7)}\n {this.renderSquare(8)}\n </div>\n </div>\n );\n }", "function initiateBoard(){\n\tblankx=wid-1;\n\tblanky=height-1;\n\tfor(i=0;i<=numTiles;i++) position[i]=i;\n}", "renderBoard() {\n let board = Array(6).fill(null).map(ele => ele = Array(7).fill(null));\n return( //***** fix key to reflect unique val\n <div>\n <div id=\"0\">{board[0].map((col, j) => this.renderSquare(0, j, j))}</div>\n <div id=\"1\">{board[1].map((col, j) => this.renderSquare(1, j, j))}</div>\n <div id=\"2\">{board[2].map((col, j) => this.renderSquare(2, j, j))}</div>\n <div id=\"3\">{board[3].map((col, j) => this.renderSquare(3, j, j))}</div>\n <div id=\"4\">{board[4].map((col, j) => this.renderSquare(4, j, j))}</div>\n <div id=\"5\">{board[5].map((col, j) => this.renderSquare(5, j, j))}</div>\n </div>\n // board.map((row, i) => row.map((col, j) => this.renderSquare(i, j, j))) \n )\n }", "function createBoard() {\n let html = ``,\n color = \"black\";\n for (i = 1; i < 9; i++) {\n if (i % 2) {\n color = \"white\";\n } else {\n color = \"black\";\n }\n for (j = 1; j < 9; j++) {\n html += `<div id=${i},${j} class='board ${color}' ></div>`;\n if (color == \"black\") {\n color = \"white\";\n } else {\n color = \"black\";\n }\n }\n }\n document.getElementById(\"root\").innerHTML = html;\n}", "showGame(){\n for(var i=0;i<3;i++){\n for(var j=0;j<3;j++) {\n console.log(arr[i][j]+\" \");\n }\n console.log();\n }\n }", "function displayGrid() {\r\n for (i = 0; i < cols; i++) {\r\n for (j = 0; j < rows; j++) {\r\n grid[i][j].display(w, h, 255);\r\n }\r\n }\r\n}", "function startPrintingToScreen()\n {\n var col = pickColor().hex;\n\n for(var i=0; i <= col.length; i++)\n {\n var letter = i >= col.length ? \";\" : col[i]; //last char printed should be ';'\n printDigit(letter, 200 * i, col);\n } \n }", "function print_board(){\n for(var i=0;i<9;i++){\n for(var j=0;j<9;j++){\n update_grid_element(i, j, board[i][j]);\n }\n }\n}", "function printBoard(board,cols,rows) {\n var game = [];\n for (i = rows -1; i >= 0; i--) {\n var line = \"\";\n for (j = 0;j < rows; j++) {\n line += board[i][j];\n }\n line = parseInt(line,2);\n game.push(line);\n game.push(0x00);\n \n }\n \n wire.writeByte(0x21, function(err) { // Start oscillator (p10)\n wire.writeByte(0x81, function(err) { // Disp on, blink off (p11)\n wire.writeByte(0xe7, function(err) { // Full brightness (page 15)\n\n });\n });\n });\n \n wire.writeBytes(0x00, game, function(err) {\n \n });\n checkBoard(board,cols,rows);\n}", "function colOne(){\n\t\trandText();\n\t\tfor(var j = 0; j<5; j ++){\n\t\t\tnewCardOne(ren[j]);\n\t\t}\n\t}", "function print(maze) {\n\tfor(var y=0;y<maze.length;y++) {\n\t\tvar str = \" \";\n\t\tfor(var x=0;x<maze.length;x++) {\n\t\t\tstr += maze[x][y] == true ? \"#\" : \" \";\n\t\t}\n\t\tconsole.log(str);\n\t}\n}", "displayBoard(message) {\n $('.menu').css('display', 'none');\n $('.gameBoard').css('display', 'block');\n $('#userHello').html(message);\n this.createGameBoard();\n }", "function printBoardToConsole(board) {\n board.forEach(function (row) {\n var rowStr = '';\n row.forEach(function (cell) {\n var cellValue = (cell.val === '') ? '0' : cell.val;\n rowStr += cellValue + '\\t';\n });\n console.log(rowStr);\n });\n}", "function Format(board){\n for(var a=0;a<3;a++){\n var string=\"| \";\n for(var i=0;i<3;i++){\n string+=board[a][i]+\" | \";\n }\n console.log(string);\n console.log(\"------------\");\n string=\"\";\n }\n\n}", "function drawBoard () {\n for (var i = 0; i < 9; i++) {\n squares[i].innerHTML = board[i];\n }\n}", "boardToString() {\n let currentPositionString = ''\n // add piece id\n state.board.forEach(element => {\n if (element.display === null) {\n currentPositionString += '0'\n }\n else {\n currentPositionString += element.display.id\n }\n }); \n // add side to move info\n if (state.whiteToMove) {\n currentPositionString += 'T'\n }\n else {\n currentPositionString += 'F'\n }\n // add castling rights info\n if (state.whiteShortCastling) {\n currentPositionString += 'S'\n }\n else {\n currentPositionString += 's'\n }\n\n if (state.whiteLongCatling) {\n currentPositionString += 'L'\n }\n else {\n currentPositionString += 'l'\n }\n\n if (state.blackShortCastling) {\n currentPositionString += 'X'\n }\n else {\n currentPositionString += 'x'\n }\n\n if (state.blackLongCastling) {\n currentPositionString += 'Y'\n }\n else {\n currentPositionString += 'y'\n }\n\n // add move count\n currentPositionString += '/' + state.moveCount.toString()\n \n return currentPositionString\n }", "function firstClickInit(firstCell) {\n\n // Generate random mines\n generateMines(firstCell);\n\n // Generate peripherial numbers to mines\n generatePeriphery(gBoard);\n\n // Board started empty - now game begins.\n renderBoard(gBoard);\n}", "function renderBoard(board) {\r\n var elBoard = document.querySelector('.board-container')\r\n var strHTML = '<table>'\r\n for (var i = 0; i < board.length; i++) {\r\n strHTML += '<tr>\\n';\r\n for (var j = 0; j < board.length; j++) {\r\n // var currCell = board[i][j];\r\n var cellClass = ` cell-${i}-${j}`\r\n strHTML += `\\t<td class=\"cell ${cellClass}\" onclick=\"cellClicked(this, ${i}, ${j})\" oncontextmenu=\"setFlag(this)\"></td>`;\r\n }\r\n strHTML += '</tr>\\n';\r\n }\r\n strHTML += '</table>'\r\n elBoard.innerHTML = strHTML;\r\n}", "function default_board_number() {\n return 123;\n}" ]
[ "0.7205085", "0.6928284", "0.6928284", "0.6895529", "0.6873766", "0.67997605", "0.6541394", "0.6444811", "0.6421637", "0.638864", "0.63535106", "0.6336691", "0.63349026", "0.62837195", "0.6278436", "0.62674", "0.62509006", "0.6249126", "0.62272125", "0.6226193", "0.6210919", "0.62092054", "0.6141632", "0.6123059", "0.611244", "0.6091623", "0.609048", "0.6090349", "0.60820127", "0.6080043", "0.6071787", "0.60702026", "0.6063338", "0.60503316", "0.60474247", "0.60433936", "0.60361886", "0.60217994", "0.6017615", "0.6007947", "0.6001586", "0.5999024", "0.59918314", "0.59893495", "0.5979715", "0.59657604", "0.5963064", "0.5949425", "0.5943027", "0.5918122", "0.59139377", "0.5889336", "0.5884092", "0.58828044", "0.5879695", "0.58692414", "0.58637846", "0.5863736", "0.58602846", "0.5847199", "0.58393455", "0.5830736", "0.58289534", "0.5806088", "0.5804767", "0.5801005", "0.5787674", "0.5785452", "0.5783034", "0.5782828", "0.5780096", "0.5775446", "0.5752929", "0.57474", "0.5744534", "0.57408744", "0.572667", "0.5721484", "0.57172036", "0.5714129", "0.570494", "0.5695261", "0.56947315", "0.5693092", "0.56922454", "0.56916106", "0.5690189", "0.5689524", "0.5684165", "0.5671012", "0.5669389", "0.5665003", "0.566276", "0.5662741", "0.56618077", "0.56505406", "0.564668", "0.5645591", "0.56361336", "0.5625218" ]
0.6497639
7
standalone helper functions to do stuff
function getTiles() { return gameState.tiles.getChildren(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _____SHARED_functions_____(){}", "function Helper() {}", "static private internal function m121() {}", "function Utils() {}", "function Utils() {}", "private internal function m248() {}", "private public function m246() {}", "function doStuff() {}", "function Utils(){}", "function Util() {}", "function AeUtil() {}", "function DWRUtil() { }", "function dummy(){}", "function dummy(){}", "function dummy(){}", "function customHandling() { }", "function doOtherStuff() {}", "static private protected internal function m118() {}", "function doCoolStuff(){\n // do cool stuff\n }", "function __it() {}", "function dummy() {}", "function dummy() {}", "function dummy() {}", "protected internal function m252() {}", "static protected internal function m125() {}", "transient private protected internal function m182() {}", "function run() {}", "function FunctionUtils() {}", "transient protected internal function m189() {}", "function doStuff(){\n\n}", "static final private internal function m106() {}", "function __func(){}", "function miFuncion (){}", "function check() {}", "work() {}", "function wa(){}", "function setup() {}", "function doThings(){\n//things\n}", "obtain(){}", "transient private internal function m185() {}", "prepare() {}", "function fm(){}", "function miFuncion(){}", "function miFuncion(){}", "function miFuncion(){}", "function normal() {}", "static transient private protected internal function m55() {}", "function AppUtils() {}", "static private protected public internal function m117() {}", "function userinfo_requester_routines() {\n\n}", "function Utils() {\n}", "static addStuff(a, b) {\n return a + b;\n }", "function doTheThing() {\n return \"yasssss\";\n}", "function userinfo_dispatcher_routines() {\n\n\n}", "function da(){}", "function da(){}", "function da(){}", "function ourReusableFunction() {\n\tconsole.log(\"Heyya, world\");\n}", "function main(err2, results) {\n // Code goes here...\n}", "function TMP(){return;}", "function TMP(){return;}", "function exampleFunctionToRun(){\n\n }", "function Common() {}", "function ea(){}", "function gather() {\n base();\n hootsuite();\n socialpilot();\n socialoomph();\n agorapulse();\n communit();\n crowdfire();\n loomly();\n planable();\n missinglettr();\n viraltag();\n}", "apply () {}", "function main(){\n\n\n}", "function StupidBug() {}", "process() {}", "process() {}", "expected( _utils ) {\n\t\t\treturn 'nothing';\n\t\t}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "function ourReusableFunction() {\n console.log(\"Heyya, World\");\n}", "transient final protected internal function m174() {}", "function doThis(){\n\tcommand.readFile(\"random.txt\", \"utf8\", function(error, data) {\n\t\tif(error){\n\t\t\tconsole.log(error);\n\t\t}\n\t\telse {\n\t\t\targList = data.split(',');\n\t\t\tfunctionCalled = argList[0];\n\t\t\tparameter = argList[1];\n\t\t\t\n\t\t\tif (functionCalled == \"my-tweets\"){\n \t\tretrieveTweets();\n\t\t\t}\n\t\t\t\n\t\t\tif (functionCalled == \"spotify-this-song\"){\n\t\t\t\tsongName = parameter;\n\t\t\t\tspotifyThis(songName);\n\t\t\t}\n\n\t\t\tif (functionCalled == \"movie-this\"){ \n\t\t\t\tmovie = parameter;\n\t\t\t\tmovieThis(movie);\n \t\t}\n\t\t}\n\t});\n}", "static transient private protected public internal function m54() {}", "function doSomething() {}", "function helper() {\n console.log(\"helper in helper-slcsp.js\");\n}", "function oi(){}", "function doSomething(){\n console.log( 'in doSomething' );\n return 'thingy';\n} // end basic function", "function Common(){}", "function FAADataHelper() {\n}", "function TMP(){}", "function TMP(){}", "function helper() {\n debug(\"helper in helper-slcsp.js\");\n}", "function exercise4(getData) {}", "function ba(){}", "function ba(){}", "function ba(){}", "function ba(){}", "function run() {\n\n }", "function _noop(){}", "work() {\n\n }", "function fn() {\n\t\t }", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}", "function r(){}" ]
[ "0.6283045", "0.6150022", "0.60282177", "0.5986544", "0.5986544", "0.5873337", "0.5871494", "0.58672345", "0.58496845", "0.5817674", "0.5748905", "0.5722761", "0.57020885", "0.57020885", "0.57020885", "0.56997657", "0.5622381", "0.56147665", "0.55852026", "0.5560686", "0.553038", "0.553038", "0.553038", "0.5467165", "0.54554653", "0.544749", "0.5432358", "0.5424015", "0.5422716", "0.54116064", "0.5372841", "0.53314644", "0.5326183", "0.5321931", "0.5315334", "0.5290502", "0.52786106", "0.5271504", "0.526619", "0.525623", "0.5253998", "0.52529055", "0.5252486", "0.5252486", "0.5252486", "0.5244794", "0.5225924", "0.5221157", "0.5207342", "0.51947373", "0.51786405", "0.51754767", "0.5171212", "0.5163637", "0.5153071", "0.5153071", "0.5153071", "0.5148654", "0.5126081", "0.51259995", "0.51259995", "0.5110942", "0.5103843", "0.50852835", "0.50818807", "0.50810975", "0.50648624", "0.5061745", "0.5055633", "0.5055633", "0.5054672", "0.50510997", "0.50510997", "0.504633", "0.5043831", "0.5036767", "0.50348705", "0.5034573", "0.50248826", "0.5020009", "0.50098974", "0.500631", "0.49980614", "0.49980614", "0.49945533", "0.4989145", "0.49878573", "0.49878573", "0.49878573", "0.49878573", "0.4986444", "0.4980548", "0.49776834", "0.49766105", "0.4975655", "0.4975655", "0.4975655", "0.4975655", "0.4975655", "0.4975655", "0.4975655" ]
0.0
-1
standalone helper functions to move tiles
function handleRight(board) { const emptySquareIndex = board.findIndex((item) => item === "blank"); if (emptySquareIndex % 4 === 0) { return; } else { board[emptySquareIndex] = board[emptySquareIndex - 1]; board[emptySquareIndex - 1] = "blank"; game.sound.play("click"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveTile() {\n moveTileHelper(this);\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 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 //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 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 }", "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 } 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($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 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}", "moveTiles(a, b) {\n this.gameState.board[b] = this.gameState.board[a];\n this.gameState.board[a] = 0;\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\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 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 (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 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}", "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 }", "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 }", "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 }", "moveToNextTile(){\n // if there is a new destination in the path\n if(Array.isArray(this.path) && typeof this.path[0]!==\"undefined\"){\n const tile = this.path.shift(); // the tile coordinates in the grid\n const destination = { // the tile coordinates in pixels\n x: (tile.x + 0.5) * this.scene.map.tileWidth,\n y: (tile.y + 0.5) * this.scene.map.tileHeight,\n }\n this.moveTo.moveTo(destination.x, destination.y);\n this.player.lookAt(destination);\n this.player.walk();\n // this.player.lookAhead();\n // Use Tweens instead of rexMoveTo plugin\n // const varX = destination.x - this.player.x;\n // const varY = destination.y - this.player.y;\n // const distance = Math.sqrt(Math.pow(varX, 2) + Math.pow(varY, 2));\n // const duration = distance * speed / this.scene.map.tileWidth;\n // this.scene.tweens.killTweensOf(this.player); // we remove all previous tween on the player\n // this.scene.tweens.add({\n // targets: this.player,\n // x: destination.x,\n // y: destination.y,\n // duration: duration,\n // onComplete: () => { this.moveToNextTile() },\n // });\n // if there is no more step in the path\n } else {\n // if the player was aiming at a target\n if(this.target){\n this.player.lookAt(this.target);\n this.target.lookAt(this.player);\n this.target.stop();\n // if this target is a npc, start a conversation\n if(this.target.constructor.name == 'Object_Character_NPC'){\n this.target.talk();\n this.scene.input.setDefaultCursor('url(assets/cursors/16x16/pointer.png), pointer');\n }\n }\n this.player.stop();\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 changePosition(from, to) {\n\t\t\n\t\tvar $tiles = $(\".box\");\n\n\t\tvar fromOrder = $tiles.eq(from)[0].tile.order;\n\t\tvar toOrder = $tiles.eq(to)[0].tile.order;\n\t\t\n\t\tvar toX = $tiles.eq(to)[0].tile.x;\n\t\tvar toY = $tiles.eq(to)[0].tile.y;\n\t\t\n\t\t//FROM TILE: make its toX the X pos of the TO tile\n\t\t$tiles.eq(from)[0].tile.toX = toX;\n\t\t$tiles.eq(from)[0].tile.toY = toY;\n\t\t\n\t\tvar swapTime = globalVars.swapTime;\n\t\t\n\t\t//TO TILE: make its toX the fromX of the FROM tile\n\t\t$tiles.eq(to)[0].tile.toX = $tiles.eq(from)[0].tile.fromX;\n\t\t$tiles.eq(to)[0].tile.toY = $tiles.eq(from)[0].tile.fromY;\n\t\t\n\t\t//TO TILE: make its fromX the toX of the TO tile\n\t\t$tiles.eq(to)[0].tile.fromX = toX;\n\t\t$tiles.eq(to)[0].tile.fromY = toY;\n\t\t\t\t\n\t\t$tiles[from].tile.x = getXPositionFromIndex(toOrder);\n\t\t$tiles[from].tile.y = getYPositionFromIndex(toOrder);\n\t\t\n\t\t//Move the elements\n\t\t//the first of the 2 moves (the \"from\" tile)\n\t\tvar tween1 = TweenLite.to($tiles[from], swapTime, {\n\t\t\t//Set the floor value to minimize gaps between the elements\n\t\t\tx : Math.floor(toX),\n\t\t\ty : Math.floor(toY),\n\t\t\tease:Strong.easeInOut,\n\t\t\tonComplete : function() { \n\t\t\t\t$tiles[from].tile.positioned = true;\n\t\t\t\t$tiles[from].tile.order = toOrder;\n\t\t\t\t$tiles.eq(from).attr(\"data-order\",toOrder);\n\t\t\t\tglobalVars.hitting = null;\n\t\t\t},\n\t\t\tonStart : function() { \n\t\t\t\t$tiles[from].tile.positioned = false;\n\t\t\t}\n\t\t });\n\t\t\n\t\t//the second tile (to)\n\t\tvar tween2 = TweenLite.to($tiles[to], swapTime, {\n\t\t\t//Set the floor value to minimize gaps between the elements\n\t\t\tx : Math.floor($tiles[from].tile.fromX),\n\t\t\ty : Math.floor($tiles[from].tile.fromY),\n\t\t\tease:Strong.easeInOut,\n\t\t\tonComplete : function() { \n\t\t\t\t$tiles[to].tile.positioned = true;\n\t\t\t\t$tiles[to].tile.order = fromOrder;\n\t\t\t\t$tiles[to].tile.x = getXPositionFromIndex(fromOrder);\n\t\t\t\t$tiles[to].tile.y = getYPositionFromIndex(fromOrder);\n\t\t\t\t$tiles.eq(to).attr(\"data-order\",fromOrder);\n\t\t\t\t\n\t\t\t\t//These are things that should be checked after BOTH the pieces move, but the code is here for now, since the duration of tween1 and tween2 is the same. needs optimization.\n\t\t\t\t//check the orders\n\t\t\t\tvar currentOrder = [];\n\t\t\t\t$(\".box\").each(function(index, element) {\t\n\t\t\t\t\tvar tile = this.tile;\n\t\t\t\t\tcurrentOrder.push(tile.order);\n\t\t\t\t});\n\t\t\t\tglobalVars.numMoves++;\n\t\t\t\tif (globalVars.numMoves == 1) {\n\t\t\t\t\tvar moves = \"move\"\n\t\t\t\t} else {\n\t\t\t\t\tvar moves = \"moves\"\n\t\t\t\t}\n\t\t\t\t$('.moves').html(globalVars.numMoves+\" \"+moves);\n\t\t\t\tif (arraysEqual(globalVars.correctOrder, currentOrder)){\t\t\t\t\t\n\t\t\t\t\tsetTimeout(function(){ \n\t\t\t\t\t\tvar finalTime = $('.stopwatch').html();\n\t\t\t\t\t\talert(\"Success! You finished the puzzle in \"+finalTime+\" seconds in \"+globalVars.numMoves+\" \"+moves);\n\t\t\t\t\t}, 200);\n\t\t\t\t\t//stop timer\n\t\t\t\t\tclearTimeout(t);\n\t\t\t\t}\t\t\t\t\n\t\t\t},\n\t\t\tonStart : function() { \n\t\t\t\t$tiles[to].tile.positioned = false;\n\t\t\t}\n\t\t });\n\t}", "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 changePosition(from, to) {\n\n\t\t\t//var $tiles = $(\".box\");\n\t\t\tvar $tiles = $(\"#slide-\"+G.currentSlide+\" .box\");\n\n\t\t\t//make the fromX the X pos of the from tile\n\t\t\t//$tiles.eq(from)[0].tile.fromX = $tiles.eq(from)[0].tile.x;\n\t\t\t//$tiles.eq(from)[0].tile.fromY = $tiles.eq(from)[0].tile.y;\n\t\t\t//alert(\"from x and y is \"+$tiles.eq(from)[0].tile.fromX+\" and \"+$tiles.eq(from)[0].tile.fromY);\n\n\t\t\tvar fromOrder = $tiles.eq(from)[0].tile.order;\n\t\t\tvar toOrder = $tiles.eq(to)[0].tile.order;\n\n\t\t\tvar toX = $tiles.eq(to)[0].tile.x;\n\t\t\tvar toY = $tiles.eq(to)[0].tile.y;\n\n\t\t\t//FROM TILE: make its toX the X pos of the TO tile\n\t\t\t$tiles.eq(from)[0].tile.toX = toX;\n\t\t\t$tiles.eq(from)[0].tile.toY = toY;\n\n\t\t\tvar swapTime = G.swapTime;\n\n\t\t\t//TO TILE: make its toX the fromX of the FROM tile\n\t\t\t$tiles.eq(to)[0].tile.toX = $tiles.eq(from)[0].tile.fromX;\n\t\t\t$tiles.eq(to)[0].tile.toY = $tiles.eq(from)[0].tile.fromY;\n\n\t\t\t//TO TILE: make its fromX the toX of the TO tile\n\t\t\t$tiles.eq(to)[0].tile.fromX = toX;\n\t\t\t$tiles.eq(to)[0].tile.fromY = toY;\n\n\t\t\t//console.log(toX);\n\t\t\t//alert(\"from \"+fromOrder+\" to \"+toOrder);\n\n\t\t\t$tiles[from].tile.x = getXPositionFromIndex(toOrder);\n\t\t\t$tiles[from].tile.y = getYPositionFromIndex(toOrder);\n\n\t\t\t//debugger;\n\n\t\t\t//Move the elements\n\t\t\t//console.log(e);\n\t\t\tvar tween1 = TweenLite.to($tiles[from], swapTime, {\n\t\t\t\tx : Math.floor(toX),\n\t\t\t\ty : Math.floor(toY),\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() {\n\n\t\t\t\t\t$tiles[from].tile.positioned = true;\n\t\t\t\t\t$tiles[from].tile.swapPartner = null;\n\n\t\t\t\t\t$tiles.eq(from).attr(\"data-order\",toOrder);\n\t\t\t\t\tG.hitting = null;\n\n\t\t\t\t},\n\t\t\t\tonStart : function() {\n\t\t\t\t\t$tiles[from].tile.positioned = false;\n\t\t\t\t\t$tiles[from].tile.order = toOrder;\n\t\t\t\t}\n\t\t\t });\n\t\t\t//the second tile (to)\n\t\t\tvar tween2 = TweenLite.to($tiles[to], swapTime, {\n\t\t\t\tx : Math.floor($tiles[from].tile.fromX),\n\t\t\t\ty : Math.floor($tiles[from].tile.fromY),\n\t\t\t\tease:Strong.easeInOut,\n\t\t\t\tonComplete : function() {\n\t\t\t\t\t$tiles[to].tile.positioned = true;\n\n\t\t\t\t\t$tiles[to].tile.x = getXPositionFromIndex(fromOrder);\n\t\t\t\t\t$tiles[to].tile.y = getYPositionFromIndex(fromOrder);\n\t\t\t\t\t$tiles.eq(to).attr(\"data-order\",fromOrder);\n\n\t\t\t\t\t//check the orders\n\t\t\t\t\tvar currentOrder = [];\n\t\t\t\t\t$(\"#slide-\"+G.currentSlide+\" .box\").each(function(index, element) {\n\t\t\t\t\t\tvar tile = this.tile;\n\t\t\t\t\t\tcurrentOrder.push(tile.order);\n\t\t\t\t\t\t//console.log(tile.order);\n\n\t\t\t\t\t});\n\t\t\t\t\t//console.log(\"correct order is \"+G.correctOrder);\n\t\t\t\t\t//console.log(\"current order is \"+currentOrder);\n\t\t\t\t\tG.numMoves++;\n\t\t\t\t\tif (G.numMoves == 1) {\n\t\t\t\t\t\tvar moves = \"move\"\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvar moves = \"moves\"\n\t\t\t\t\t}\n\t\t\t\t\t$('.moves').html(G.numMoves+\" \"+moves);\n\t\t\t\t\tif (arraysEqual(G.correctOrder, currentOrder)){\n\n\t\t\t\t\t\t$(\".blocker\").show();\n\t\t\t\t\t\tsetTimeout(function(){\n\t\t\t\t\t\t\t//alert(\"Success! You finished the puzzle in in \"+G.numMoves+\" \"+moves);\n\n\t\t\t\t\t\t\tshowFeedback();\n\t\t\t\t\t\t\t//console.log(\"custom_event: slide finished\");\n\t\t\t\t\t\t\t//console.log(\"custom_event: slide finished time: \"+G[\"slide\"+G.currentSlide+\"SecondsElapsed\"]);\n\t\t\t\t\t\t}, 0);\n\n\t\t\t\t\t\t//stop timer\n\t\t\t\t\t\t//console.log(\"stopping the timer\")\n\t\t\t\t\t\tclearTimeout(G.t);\n\t\t\t\t\t}\n\t\t\t\t\tG.swapHappening = false; //only allow 1 swap to happen at a time\n\t\t\t\t\t$tiles[to].tile.swapPartner = null;\n\n\n\t\t\t\t},\n\t\t\t\tonStart : function() {\n\t\t\t\t\t$tiles[to].tile.positioned = false;\n\t\t\t\t\t$tiles[to].tile.order = fromOrder;\n\t\t\t\t\tG.swapHappening = true; //only allow 1 swap to happen at a time\n\t\t\t\t}\n\t\t\t });\n\n\n\n\t\t //layoutInvalidated();\n\t\t}", "function tileClick() {\n\tmoveOneTile(this);\n}", "function moveTilesToContainer(sourceContainer, targetContainer, tiles) {\n angular.forEach(tiles, function (tileId) {\n var tile = sourceContainer.find('[data-tile-id=\"' + tileId + '\"]');\n targetContainer.append(tile);\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 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}", "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 processMove(){\n\t\tmyTile.pop();\n\t\ttryTile.push(obj);\n\t\tobj.move(x, y);\n\t\tmapGroup.addChild(obj);\n\t\treturn true;\n\t}", "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 move2(){\n // only run if there isnt a tile being placed\n if(immobile) {\n return;\n }\n console.log(\"move2 was called\");\n var currentSurroundingTiles = getSurroundingTiles();\n var i;\n var keyCode = event.keyCode;\n console.log(\"the key code is \" + keyCode);\n // todo\n // there is a problem with stage tiles if you move using the buttons\n\n switch (keyCode) {\n // down 's'\n case(83):\n case(40):\n // down ^\n if (currentGameBoard[currentPlayer.rowLocation + 1][currentPlayer.colLocation].staged) {\n flipTile2(currentPlayer.rowLocation + 1, currentPlayer.colLocation);\n }\n else if (currentGameBoard[currentPlayer.rowLocation + 1][currentPlayer.colLocation].connected) {\n\n //resets move options now that the player has moved\n for (i = 0; i < currentSurroundingTiles.length; i++) {\n currentSurroundingTiles[i].connected = false;\n }\n //if there isnt a chest then just move player, otherwise draw the chest again once the player leaves the square\n if(currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem === \"\") document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"\";\n else{\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src =\"+items.chest.image +\">\";\n }\n currentPlayer.rowLocation++;\n //win condition\n if (currentPlayer.rowLocation === startingTileRow && currentPlayer.colLocation === startingTileCol && currentPlayer.gold >= 25) {\n document.getElementById(\"win\").play();\n document.getElementById(\"message\").innerHTML = \"You win!\";\n document.getElementById(\"message\").style.display = \"inline\";\n }\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src=\" + currentPlayer.image + \">\";\n clearClickableSettings();\n setOnclickSettings();\n document.getElementById(\"deck\").onclick = stageTiles;\n }\n break;\n // right 'D'\n case(68):\n case(39):\n // right >\n if (currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation + 1].staged) {\n flipTile2(currentPlayer.rowLocation, currentPlayer.colLocation + 1);\n }\n else if (currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation + 1].connected) {\n for (i = 0; i < currentSurroundingTiles.length; i++) {\n currentSurroundingTiles[i].connected = false;\n }\n //if there isnt a chest then just move player, otherwise draw the chest again once the player leaves the square\n if(currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem === \"\") document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"\";\n else{\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src =\"+items.chest.image +\">\";\n }\n currentPlayer.colLocation++;\n //win condition\n if (currentPlayer.rowLocation === startingTileRow && currentPlayer.colLocation === startingTileCol && currentPlayer.gold >= 25) {\n document.getElementById(\"win\").play();\n document.getElementById(\"message\").innerHTML = \"You win!\";\n document.getElementById(\"message\").style.display = \"inline\";\n }\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src=\" + currentPlayer.image + \">\";\n clearClickableSettings();\n setOnclickSettings();\n document.getElementById(\"deck\").onclick = stageTiles;\n }\n break;\n // up ^\n case(38):\n case(87):\n // up 'W'\n if (currentGameBoard[currentPlayer.rowLocation - 1][currentPlayer.colLocation].staged) {\n flipTile2(currentPlayer.rowLocation - 1, currentPlayer.colLocation);\n }\n else if (currentGameBoard[currentPlayer.rowLocation - 1][currentPlayer.colLocation].connected) {\n for (i = 0; i < currentSurroundingTiles.length; i++) {\n currentSurroundingTiles[i].connected = false;\n }\n //if there isnt a chest then just move player, otherwise draw the chest again once the player leaves the square\n if(currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem === \"\") document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"\";\n else{\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src =\"+items.chest.image +\">\";\n }\n currentPlayer.rowLocation--;\n //win condition\n if (currentPlayer.rowLocation === startingTileRow && currentPlayer.colLocation === startingTileCol && currentPlayer.gold >= 25) {\n document.getElementById(\"win\").play();\n document.getElementById(\"message\").innerHTML = \"You win!\";\n document.getElementById(\"message\").style.display = \"inline\";\n }\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src=\" + currentPlayer.image + \">\";\n clearClickableSettings();\n setOnclickSettings();\n document.getElementById(\"deck\").onclick = stageTiles;\n }\n break;\n // left <\n case(37):\n case(65):\n // left 'A'\n if (currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation - 1].staged) {\n flipTile2(currentPlayer.rowLocation, currentPlayer.colLocation - 1);\n }\n else if (currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation - 1].connected) {\n for (i = 0; i < currentSurroundingTiles.length; i++) {\n currentSurroundingTiles[i].connected = false;\n }\n //if there isnt a chest then just move player, otherwise draw the chest again once the player leaves the square\n if(currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem === \"\") document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"\";\n else if(currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem === \"chest\"){\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src =\"+items.chest.image +\">\";\n }\n currentPlayer.colLocation--;\n //win condition\n if (currentPlayer.rowLocation === startingTileRow && currentPlayer.colLocation === startingTileCol && currentPlayer.gold >= 25) {\n document.getElementById(\"win\").play();\n document.getElementById(\"message\").innerHTML = \"You win!\";\n document.getElementById(\"message\").style.display = \"inline\";\n }\n document.getElementById(currentPlayer.rowLocation + \",\" + currentPlayer.colLocation).innerHTML = \"<img src=\" + currentPlayer.image + \">\";\n clearClickableSettings();\n setOnclickSettings();\n document.getElementById(\"deck\").onclick = stageTiles;\n }\n break;\n }\n var chest = false;\n switch (currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem) {\n case(\"bread\"):\n //recover health\n currentPlayer.hp += 1;\n break;\n case(\"key\"):\n //add a key to player inventory\n currentPlayer.keys += 1;\n break;\n case(\"chest\"):\n //if player has a key, open chest, if not.... dont\n if(currentPlayer.keys > 0){\n currentPlayer.keys -= 1;\n currentPlayer.gold += 5;\n }else{\n chest = true;\n }\n\n break;\n case(\"sword\"):\n //add sword to player inventory and add 1 to attack\n currentPlayer.attack += 1;\n currentPlayer.hasSword = true;\n //\n break;\n default:\n //there is no droppedItem, so do nothing\n break;\n }\n updateStats();\n if(!chest) currentGameBoard[currentPlayer.rowLocation][currentPlayer.colLocation].droppedItem = \"\";\n // update currentConnected[]\n currentConnectedTiles = [];\n getSurroundingTiles();\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}", "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 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}", "moveBack(tile, num, wario, goomba) {\n tile.viewportDiff += num;\n wario.viewportDiff += num;\n goomba.viewportDiff += num;\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}", "setTile(position, tile)\n {\n this.tiles[position.y * this.width + position.x] = tile;\n }", "function tileClick() {\n\tvar position = parseInt(this.dataset.position);\n\tif (board.isValidMove(position)) {\n\t\tboard.placeTile(current, position);\n\t\tthis.getElementsByClassName('tile-image')[0].src = current.img;\n\t\tif (board.isWinningState(current, position)) {\n\t\t\tend(current);\n\t\t} else if (board.isTie()) {\n\t\t\tend(current, true);\n\t\t} else {\n\t\t\tswitchCurrentPlayer();\n\t\t\tif (current.constructor.name === 'ComputerPlayer') {\n\t\t\t\tcomputerMove();\n\t\t\t}\n\t\t}\n\t}\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 }", "translate(newPosX, newPosY) {\n this.posX = newPosX\n this.imgProperties.posX = newPosX - (this.tileSize - this.width) / 2\n this.posY = newPosY\n this.imgProperties.posY = newPosY - this.tileSize * 0.65\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 move(from, to) {\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 }", "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.79237026", "0.76913923", "0.76522744", "0.7423677", "0.72792345", "0.72318584", "0.72235596", "0.7195952", "0.7185259", "0.7059824", "0.70462745", "0.69098467", "0.68338776", "0.6824372", "0.6817852", "0.67927927", "0.67829585", "0.6737448", "0.667811", "0.6669762", "0.6664385", "0.66276014", "0.6611813", "0.6608817", "0.65864813", "0.65228254", "0.65019345", "0.6469168", "0.64623964", "0.64605635", "0.64512885", "0.6415932", "0.64136183", "0.6400295", "0.6398645", "0.63843733", "0.63832515", "0.6363955", "0.63580793", "0.6337364", "0.63359594", "0.63300806", "0.62676954", "0.6236472", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437", "0.62150437" ]
0.0
-1
push "current" into "data" for the number oh hours that separate "from" to "to"
function pushData(from, to) { let curr = new Date(from.getTime()); const color = current > rooms[roomNumber].peopleLimitNumber ? stdColor['alert'] : current >= rooms[roomNumber].peopleLimitNumber * 0.7 ? stdColor['warning'] : stdColor['normal']; do { data.push(current); labels.push(curr.toLocaleString()); colors.push(color); curr = curr.add("1h"); } while(curr.getTime() < to.getTime()); return to; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function appendTimeData(data) {\n let startTime = moment(new Date().setHours(9, 30, 0, 0))\n let endTime = moment(new Date().setHours(15, 0, 0, 0))\n let middleClose = moment(new Date().setHours(11, 30, 0, 0))\n let middleOpen = moment(new Date().setHours(13, 0, 0, 0))\n let dataLastTime = moment(data[data.length - 1].x)\n\n while (dataLastTime < endTime) {\n dataLastTime.add(1, 'm')\n\n if (dataLastTime >= middleClose && dataLastTime < middleOpen) {\n dataLastTime = middleOpen\n data.push({\n x: dataLastTime.valueOf(),\n })\n } else {\n data.push({\n x: dataLastTime.valueOf(),\n })\n }\n }\n}", "function StoreTimeHoursinArray() {\n //Store time business hours past from current time ()\n for (let i = 1; i <= 24; i++) { // iterator i will iterate until i gets to 24 Hours past from current time\n currentT = moment().subtract(i, \"hours\");\n pastHoursFromCurrentMoment.unshift(currentT);\n }\n //Store current time in the future business hours array position[0]\n futureHoursFromCurrentMoment.push(moment());\n\n //Store future bussiness hours from current time in the array\n for (let j = 1; j <= 24; j++) { //iterator j will iterate 24 times which a representation of the hours from current time to future of hours remaining\n currentT = moment().add(j, \"hours\");\n futureHoursFromCurrentMoment.push(currentT);\n }\n\n }", "numbersToEvents() {\n for (let [key, value] of this.unoccupied) {\n let z = {summary: 'Zzzzz', start: {}, end: {}}\n z.start.dateTime = moment().set('hour', key).format()\n z.end.dateTime = moment()\n .set('hour', key + value)\n .format()\n this.sleepOptions.push(z)\n }\n\n return this.sleepOptions.slice(0, 3)\n }", "formatHourData(state, startDateStringWeek, endDateStringWeek) {\n //replace hyphens in date string with slashes b/c javascript Date object requires this (weird)\n var startDateString = startDateStringWeek;\n var endDateString = endDateStringWeek;\n //Convert time range to JS Date objects\n var startDate = new Date(startDateString.replace(/-/g, '/'));\n var endDate = new Date(endDateString.replace(/-/g, '/'));\n var dateToCompare = startDate;\n var currEntryDate;\n var currHour;\n var currIdx = 0;\n var byHourJson = state;\n //!!!Set the Key's range of operating hours here!!!!\n var hourArray = [\"14:00:00\", \"15:00:00\", \"16:00:00\", \"17:00:00\",\"18:00:00\",\"19:00:00\",\"20:00:00\",\"21:00:00\",\"22:00:00\"];\n //first filter out any entries that have timestamps outside of key operating hours\n byHourJson = byHourJson.filter(function(entry) {\n var inValidTimeRange = hourArray.includes(entry.time);\n return inValidTimeRange === true;\n });\n var hourToCompareIdx= 0;\n var hourToCompare = hourArray[0];\n //If JSON is empty, add in dummy entry to initialize formatting\n if(byHourJson.length === 0){\n var firstEntry = {\"date\": startDateString, \"time\": hourArray[0], \"count\": 0};\n byHourJson.push(firstEntry);\n }\n //Add dummy date entries for missing date-hour combos (no engagements) to json btwn start and end date\n while (this.compareTime(dateToCompare, endDate) === false) {\n //if reached the end of json but there's still dates to fill in up to the end date, stay on end entry\n if (currIdx > byHourJson.length - 1) {\n currIdx = byHourJson.length - 1;\n }\n currEntryDate = new Date(byHourJson[currIdx][\"date\"].replace(/-/g, '/'));\n currHour = byHourJson[currIdx][\"time\"];\n //identified missing date, so add dummy date entry for missing date\n if (this.sameDay(dateToCompare, currEntryDate) === false) {\n var dateEntryZeroEngagements = { \"date\": dateToCompare.toISOString().slice(0, 10), \"time\": hourToCompare, \"count\": 0 };\n //add entry in place if not at end of json OR final date entry has not been added yet/surpassed\n //else add to very end of json\n if (currIdx !== byHourJson.length - 1 || (this.compareTime(currEntryDate, dateToCompare))){\n byHourJson.splice(currIdx, 0, dateEntryZeroEngagements);\n } else {\n byHourJson.splice(currIdx+1,0, dateEntryZeroEngagements);\n }\n }\n //the two date-hour combos are on SAME DAY, but different hours so add the missing hour as a dummy entry\n else if(hourToCompare !== currHour){\n var dateEntryZeroEngagements = { \"date\": dateToCompare.toISOString().slice(0, 10), \"time\": hourToCompare, \"count\": 0 };\n //add entry in place if not at end of json OR final date entry has not been added yet/surpassed\n //else add to very end of json\n if (currIdx !== byHourJson.length - 1 || currHour > hourToCompare){\n byHourJson.splice(currIdx, 0, dateEntryZeroEngagements);\n } else {\n byHourJson.splice(currIdx+1,0, dateEntryZeroEngagements);\n }\n }\n //the two date-hour combos match exactly\n currIdx++;\n if(hourToCompare === hourArray[hourArray.length-1]){\n hourToCompare = \"next day\";\n }\n //on last hour of the current day, increment date and set hour to first hour\n if(hourToCompare === \"next day\"){\n dateToCompare.setDate(dateToCompare.getDate() + 1);\n hourToCompare = hourArray[0];\n hourToCompareIdx = 0;\n }\n //otherwise just increment the hour\n else{\n hourToCompareIdx++;\n hourToCompare = hourArray[hourToCompareIdx];\n }\n }\n //process json into list of lists and store into state for downloading as csv\n var byHourJsonForDownload = [];\n var entryAsList;\n for(var i=0; i<byHourJson.length; i++){\n entryAsList = Object.values(byHourJson[i]);\n byHourJsonForDownload.push(entryAsList);\n }\n\n //Time to convert updated JSON with missing date-hour combos added in into\n //a list called processedData of {\"x\": string hour of day, \"y\": string day of week, \"color\": int num engagements per day} objs\n var processedData = [];\n var dayOfWeek, hourEntry, hourOfDay;\n var currDateObj;\n var strDays = [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"];\n for (var i = 0; i < byHourJson.length; i++) {\n currDateObj = new Date(byHourJson[i]['date'].replace(/-/g, '/'));\n dayOfWeek = strDays[currDateObj.getDay()];\n hourOfDay = byHourJson[i]['time'].slice(0,5);\n hourEntry = {\"x\": hourOfDay, \"y\": dayOfWeek, \"color\": byHourJson[i]['count']};\n processedData.push(hourEntry);\n }\n //Set state so these vars can be used elsewhere!\n this.setState(function (previousState, currentProps) {\n return {\n startDateStringWeek: startDateStringWeek,\n endDateStringWeek: endDateStringWeek,\n byHourJson: processedData,\n byHourJsonForDownload: byHourJsonForDownload\n };\n });\n return processedData;\n }", "function getAnotherHour() {\n\n\t// Add up the timer with 1 hour\n\ttoday.setHours(today.getHours() + 1);\n\n\tfor (var index = 0; index < goodData.length; index++) {\n\t\tif (goodData[index].date <= today) {\n\t\t\tdata.data.push(goodData[index]);\n\t\t}\n\t}\n\n\t//console.log(today);\n\tdocument.getElementById('timer').innerHTML = today;\n\n}", "function fillData(data, minTimestamp, maxTimestamp) {\n\t\tvar minTimestamp = minTimestamp * 1000;\n\t\tvar maxTimestamp = maxTimestamp * 1000;\n\t\tvar secondsInAnHour = 60 * 60 * 1000;\n\n\t\tvar remainder = minTimestamp % secondsInAnHour;\n\t\tvar minRoundedTimestamp = minTimestamp - remainder;\n\n\t\tvar remainder = maxTimestamp % secondsInAnHour;\n\t\tvar maxRoundedTimestamp = maxTimestamp - remainder;\n\n\t\tvar hoursToCreate = (maxRoundedTimestamp - minRoundedTimestamp) / secondsInAnHour;\n\n\t\tfor(i = 0; i < hoursToCreate; i++) {\n\t\t\tvar incrementTimestamp = minRoundedTimestamp + i * secondsInAnHour;\n\n\t\t\tdata.push({\n\t\t\t\tpcuihId: -1,\n\t\t\t\tpcuId: -1,\n\t\t\t\tunix_timestamp: incrementTimestamp,\n\t\t\t\tfilled_data: true\n\t\t\t});\n\t\t}\n\t}", "function reducer(total, current) {\n return total + current.hour;\n }", "function reducer(total, current) {\n return total + current.hour;\n }", "function cobaCollect() {\n var now = new Date();\n var anHourAgo = new Date(now.getTime() - (1 * 1000 * 60 * 60));\n var from = anHourAgo.getFullYear() + '-' + (anHourAgo.getMonth() + 1) + '-' + anHourAgo.getDate();\n from += ' ' + anHourAgo.getHours() + ':' + anHourAgo.getMinutes() + ':' + anHourAgo.getSeconds();\n var to = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();\n to += ' ' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds();\n console.log('1 hour ago :', from, to);\n collectDataByDate(from, to);\n}", "function parseOpenWeather1Hour()\n{\n // anviser data til vejret nu\n {\n data.now.time[1] = importJson.openWeather1Hour.current.dt;\n data.now.symbol_code[1] = convertSymbolCode(importJson.openWeather1Hour.current.weather[0].description, data.now.isDay);\n data.now.temperature[1] = round((importJson.openWeather1Hour.current.temp - 273.15) * 10) / 10; // temperatur omdannes til celcius og afrundes til et decimal\n data.now.pressure[1] = importJson.openWeather1Hour.current.pressure;\n data.now.cloudCover[1] = importJson.openWeather1Hour.current.clouds;\n data.now.humidity[1] = importJson.openWeather1Hour.current.humidity;\n\n if (typeof importJson.openWeather1Hour.current.rain !== \"undefined\")\n {\n data.now.precipitation[1] = importJson.openWeather1Hour.current.rain[\"1h\"];\n }\n else\n {\n data.now.precipitation[1] = 0;\n }\n data.now.windSpeed[1] = importJson.openWeather1Hour.current.wind_speed;\n data.now.windDirection[1] = importJson.openWeather1Hour.current.wind_deg;\n }\n // anviser data til vejret 48 timer frem\n {\n for (let i = 0; i < 46; i++)\n {\n data.next48Hours[i].time[1] = importJson.openWeather1Hour.hourly[i].dt;\n data.next48Hours[i].symbol_code[1] = convertSymbolCode(importJson.openWeather1Hour.hourly[i].weather[0].description, data.next48Hours[i].isDay);\n data.next48Hours[i].temperature[1] = round((importJson.openWeather1Hour.hourly[i].temp - 273.15) * 10) / 10\n data.next48Hours[i].pressure[1] = importJson.openWeather1Hour.hourly[i].pressure;\n data.next48Hours[i].cloudCover[1] = importJson.openWeather1Hour.hourly[i].clouds;\n data.next48Hours[i].humidity[1] = importJson.openWeather1Hour.hourly[i].humidity;\n try\n {\n data.next48Hours[i].precipitation[1] = importJson.openWeather1Hour.hourly[i].rain[\"1h\"];\n }\n catch\n {\n data.next48Hours[i].precipitation[1] = 0;\n }\n data.next48Hours[i].windSpeed[1] = importJson.openWeather1Hour.hourly[i].wind_speed;\n data.next48Hours[i].windDirection[1] = importJson.openWeather1Hour.hourly[i].wind_deg;\n }\n }\n calculateAverages();\n}", "function getSliceBetweenTimes(data, from, to) {\n \n var fromIdx = _.sortedIndex(data, {t: from}, function(d) { return d.t; });\n var toIdx = _.sortedIndex(data, {t: to}, function(d) { return d.t; }); \n\n return data.slice(fromIdx, toIdx+1);\n }", "function getData(data, hours) {\n var days = Array.apply(null, Array(7)).map(function () {return 1;});\n // var hours = Array.apply(null, Array(24)).map(function () {return 1});\n var title = data[0];\n var filtered = data.slice(1, data.length).filter(function(row) {\n var d = parseInt(row[\"pickup_day\"]);\n var h = parseInt(row[\"pickup_hour\"]);\n return days[d] && hours[h];\n });\n\n var res = {};\n for (var i = 0; i < filtered.length; i++) {\n var row = filtered[i];\n var pickup_zone = row[\"pickup_zone\"];\n\n // this pickup zone already in res\n if (res[pickup_zone]) {\n // add dest count objects\n for (var prop in row) {\n if (row.hasOwnProperty(prop) && res[pickup_zone][prop] != undefined) {\n res[pickup_zone][prop] += parseInt(row[prop]);\n }\n else if (row.hasOwnProperty(prop) && res[pickup_zone][prop] == undefined) {\n console.log(prop);\n console.log(res[pickup_zone][prop]);\n console.log(\"ERROR should never get here\");\n }\n }\n }\n else {\n // add dest count objects\n res[pickup_zone] = {}\n for (var prop in row) {\n if (row.hasOwnProperty(prop)) {\n res[pickup_zone][prop] = parseInt(row[prop]);\n }\n }\n }\n }\n\n return res;\n}", "between(start, end){\n\n //Initialize our usage variable\n let total = 0;\n\n //Go through every hour between the times specified\n for(let i=start+1; i<=end; i++) {\n\n //If we have a record for this hour\n if(this.hours[i] !== undefined) {\n\n //Add the usage to our running total\n total += this.hours[i];\n }\n\n }\n\n //Return the total amount of power used during the specified time frame\n return total;\n }", "hourlyData(data) {\r\n const scope = this;\r\n let averageMean, hrData = [];\r\n\r\n data.forEach(v => {\r\n if(v.interval_start.includes(\":30:00\")){\r\n if(data.find(x => x.interval_start == v.interval_start.replace(\":30:00\", \":00:00\"))){\r\n averageMean =(v.mean + (data.find(x => x.interval_start == v.interval_start.replace(\":30:00\", \":00:00\"))).mean)/2;\r\n }else{\r\n averageMean = v.mean;\r\n }\r\n hrData.push({Time: v.interval_start.replace(\":30:00\", \":00:00\"), mean: averageMean});\r\n }else{\r\n if(!(data.find(x => x.interval_start == v.interval_start.replace(\":00:00\", \":30:00\")))){\r\n hrData.push({Time: v.interval_start, mean: v.mean});\r\n }\r\n }\r\n });\r\n\r\n return scope.finalData(hrData)\r\n }", "filterData(filter) {\r\n const scope = this,\r\n startDate = new Date(filter.dates.start),\r\n endDate = new Date(filter.dates.end),\r\n sTime = filter.time.start,\r\n eTime = filter.time.end;\r\n let filteredData = [], date, startTime, endTime;\r\n\r\n scope.tempData = [];\r\n startDate.setHours(0, 0, 0);\r\n endDate.setHours(23, 59, 59);\r\n\r\n sTime.meridian === \"AM\" ?\r\n (startTime = sTime.h * 60 + sTime.m) : (startTime = sTime.h * 60 + sTime.m + 720);\r\n eTime.meridian === \"AM\" ?\r\n (endTime = eTime.h * 60 + eTime.m) : (endTime = eTime.h * 60 + eTime.m + 720);\r\n\r\n scope.totalData.forEach(v => {\r\n date = new Date(v.interval_start);\r\n\r\n if(date.getTime() >= startDate.getTime() && endDate.getTime() >= date.getTime()){\r\n let selTime = date.getHours() * 60 + date.getMinutes();\r\n if(selTime >= startTime && endTime > selTime){\r\n filteredData.push(v)\r\n }\r\n }\r\n });\r\n\r\n for(let key = sTime.h; key <= (eTime.meridian === \"AM\" ? eTime.h : eTime.h + 12); key++){\r\n if(!(key === (eTime.meridian === \"AM\" ? eTime.h : eTime.h + 12) && eTime.m === 0))\r\n scope.tempData.push({time: key, occupancy: []})\r\n }\r\n\r\n return scope.hourlyData(filteredData)\r\n }", "function outdata() {\n var exp = [];\n var e11 = e - 11\n\n exp.push(globaldata[e11]['date'])\n exp.push(globaldata[e11]['hour'])\n exp.push(globaldata[e11]['minute'])\n\n return exp;\n}", "function vectorTimerHour(time, hourOn, hourOff, minOn, minOff){\n print('[vectorTimerHour] Build Hour vector timer ...');\n\n let hourOn = JSON.parse(hourOn);\n let hourOff = JSON.parse(hourOff);\n let minOn = JSON.parse(minOn);\n let minOff = JSON.parse(minOff);\n\n if (hourOff > hourOn){\n for(let i = 0; i < 24; i++){\n yHour[i] = 0;\n if (time[i] >= hourOn && time[i] < hourOff){\n yHour[i] = 1;\n }\n }\n }\n\n if (hourOn > hourOff){\n for(let i = 0; i < 24; i++){\n yHour[i] = 1;\n if (time[i] >= hourOff && time[i] < hourOn){\n yHour[i] = 0;\n }\n }\n }\n\n if (hourOn === hourOff){\n if (minOn > minOff){\n for(let i = 0; i < 24; i++){\n yHour[i] = 1;\n }\n yHour[hourOn] = 0;\n }\n\n if (minOff > minOn){\n for(let i = 0; i < 24; i++){\n yHour[i] = 0;\n }\n yHour[hourOn] = 1;\n }\n \n }\n\n return yHour\n}", "convertSchedulePref() {\n for (var key in this.state.dayTimePref) {\n /* reset all to empty */\n this.state.postReqTime[key] = [];\n // check if it's empty, empty -> 00:00 to 23:59\n if (this.state.dayTimePref[key].length == 0)\n {\n this.state.postReqTime[key].push({\n \"time_earliest\": \"00:00\",\n \"time_latest\": \"23:59\"\n });\n }\n else if (this.state.dayTimePref[key].length == 1)\n {\n var begin = this.state.dayTimePref[key][0];\n var end = this.state.dayTimePref[key][0] + 30;\n \n this.state.postReqTime[key].push({\n \"time_earliest\": this.convertTimeIntToString(begin),\n \"time_latest\": this.convertTimeIntToString(end)\n });\n }\n else {\n var begin = this.state.dayTimePref[key][0];\n for (var i = 1; i < this.state.dayTimePref[key].length; i++)\n {\n // if the time is not consecutive from previous\n console.log(\"prev: \", this.state.dayTimePref[key][i-1], \" current: \", this.state.dayTimePref[key][i]);\n if ((this.state.dayTimePref[key][i - 1] + 30) != (this.state.dayTimePref[key][i]))\n {\n this.state.postReqTime[key].push({\n \"time_earliest\": this.convertTimeIntToString(begin),\n \"time_latest\": this.convertTimeIntToString(this.state.dayTimePref[key][i - 1] + 30)\n });\n begin = this.state.dayTimePref[key][i];\n // if time is the end, and not consecutive from previous\n if (i == (this.state.dayTimePref[key].length - 1))\n {\n this.state.postReqTime[key].push({\n \"time_earliest\": this.convertTimeIntToString(begin),\n \"time_latest\": this.convertTimeIntToString(begin + 30)\n });\n }\n }\n // if time is consecutive, but last\n else if (i == (this.state.dayTimePref[key].length - 1))\n {\n this.state.postReqTime[key].push({\n \"time_earliest\": this.convertTimeIntToString(begin),\n \"time_latest\": this.convertTimeIntToString(this.state.dayTimePref[key][i] + 30)\n });\n }\n \n }\n }\n \n\n \n \n }\n }", "function putdata(json)\n{ \n // removes the previous contest entries.\n $(\"#upcoming > li\").remove();\n $(\"#ongoing > li\").remove();\n $(\"hr\").remove();\n\n // the conditional statements that compare the start and end time with curTime\n // verifies that each contest gets added to right section regardless of the \n // section it was present in the \"json\" variable.\n \n curTime = new Date();\n\n $.each(json.result.ongoing , function(i,post){ \n \n flag=0;\n if(post.Platform==\"HACKEREARTH\"){\n if(localStorage.getItem(post.Platform+post.challenge_type)==\"false\")flag=1;\n }\n \n if(localStorage.getItem(post.Platform)==\"true\" && flag==0){\n endTime = Date.parse(post.EndTime);\n timezonePerfectEndTime = changeTimezone(endTime).toString().slice(0,21);\n e = new Date(endTime);\n humanReadableEndTime = moment(timezonePerfectEndTime).fromNow();\n\n if(e>curTime){\n \n var node = document.createElement(\"li\");\n node.data = post.url;\n\n linebreak = document.createElement(\"br\");\n var nameText = document.createTextNode(post.Name);\n var nameNode = document.createElement(\"h4\");\n nameNode.appendChild(nameText);\n \n var imageNode = document.createElement(\"img\");\n imageNode.src = icon(post.Platform);\n \n var endTimeText = document.createTextNode('End: '+timezonePerfectEndTime+ ' ( '+humanReadableEndTime+' )');\n var endTimeNode = document.createElement(\"h5\");\n endTimeNode.appendChild(endTimeText);\n\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(nameNode);\n node.appendChild(imageNode);\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(endTimeNode);\n node.appendChild(document.createElement(\"br\"));\n\n document.getElementById(\"ongoing\").appendChild(node);\n document.getElementById(\"ongoing\").appendChild(document.createElement(\"hr\"));\n\n }\n }\n });\n \n $.each(json.result.upcoming , function(i,post){ \n \n flag=0;\n if(post.Platform==\"HACKEREARTH\"){\n if(localStorage.getItem(post.Platform+post.challenge_type)==\"false\")flag=1;\n }\n\n if(localStorage.getItem(post.Platform)==\"true\" && flag==0){\n // converts the startTime and Endtime revieved\n // to the format required for the Google Calendar link to work\n startTime = Date.parse(post.StartTime)\n timezonePerfectStartTime = changeTimezone(startTime).toString().slice(0,21);\n humanReadableStartTime = moment(timezonePerfectStartTime).fromNow();\n\n endTime = Date.parse(post.EndTime)\n timezonePerfectEndTime = changeTimezone(endTime).toString().slice(0,21);\n humanReadableEndTime = moment(timezonePerfectEndTime).fromNow();\n s = new Date(changeTimezone(startTime).getTime() - ((curTime).getTimezoneOffset()*60000 )).toISOString().slice(0,19).replace(/-/g,\"\").replace(/:/g,\"\");\n e = new Date(changeTimezone(endTime).getTime() - ((curTime).getTimezoneOffset()*60000 )).toISOString().slice(0,19).replace(/-/g,\"\").replace(/:/g,\"\");\n \n calendarTime = s+'/'+e\n calendarLink = \"https://www.google.com/calendar/render?action=TEMPLATE&text=\"+encodeURIComponent(post.Name)+\"&dates=\"+calendarTime+\"&location=\"+post.url+\"&pli=1&uid=&sf=true&output=xml#eventpage_6\"\n \n sT = new Date(startTime);\n eT = new Date(endTime);\n\n if(sT<curTime && eT>curTime){\n var node = document.createElement(\"li\");\n node.data = post.url;\n\n linebreak = document.createElement(\"br\");\n var nameText = document.createTextNode(post.Name);\n var nameNode = document.createElement(\"h4\");\n nameNode.appendChild(nameText);\n \n var imageNode = document.createElement(\"img\");\n imageNode.src = icon(post.Platform);\n \n var endTimeText = document.createTextNode('End: '+timezonePerfectEndTime+ ' ( '+humanReadableEndTime+' )');\n var endTimeNode = document.createElement(\"h5\");\n endTimeNode.appendChild(endTimeText);\n\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(nameNode);\n node.appendChild(imageNode);\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(endTimeNode);\n node.appendChild(document.createElement(\"br\"));\n\n document.getElementById(\"ongoing\").appendChild(node);\n document.getElementById(\"ongoing\").appendChild(document.createElement(\"hr\"));\n\n }\n else if(sT>curTime && eT>curTime){\n\n var node = document.createElement(\"li\");\n node.data = post.url;\n\n linebreak = document.createElement(\"br\");\n var nameText = document.createTextNode(post.Name);\n var nameNode = document.createElement(\"h4\");\n nameNode.appendChild(nameText);\n \n var imageNode = document.createElement(\"img\");\n imageNode.src = icon(post.Platform);\n \n var startTimeText = document.createTextNode('Start: '+timezonePerfectStartTime+ ' ( '+humanReadableStartTime+' )');\n var startTimeNode = document.createElement(\"h5\");\n startTimeNode.appendChild(startTimeText);\n\n var durationText = document.createTextNode('Duration: '+post.Duration);\n var durationNode = document.createElement(\"h5\");\n durationNode.appendChild(durationText);\n \n var calendarText = document.createTextNode('Add to Calendar');\n var calendarNode = document.createElement(\"h5\");\n calendarNode.className = \"calendar\";\n calendarNode.appendChild(calendarText);\n calendarNode.data = calendarLink;\n \n node.appendChild(document.createElement(\"br\"));\n node.appendChild(nameNode);\n node.appendChild(imageNode);\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(startTimeNode);\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(durationNode);\n node.appendChild(document.createElement(\"br\"));\n node.appendChild(calendarNode);\n\n document.getElementById(\"upcoming\").appendChild(node);\n document.getElementById(\"upcoming\").appendChild(document.createElement(\"hr\"));\n\n }\n }\n });\n\n}", "function turnHoursToMinutes(data){\n\n return data.slice(0).map(function(el){\n console.log\n let timeString = el.duration\n let splitString = timeString.split(' ')\n let timeHours = 0;\n let timeMinutes = 0;\n\n if(splitString.length==1){\n if(splitString[0].includes('h')){\n timeHours = splitString[0].replace('h', '') * 60\n }else if (splitString[0].includes('min')){\n timeMinutes = splitString[0].replace('min', '') * 1\n }\n }else{\n timeHours = splitString[0].replace('h', '') * 60\n timeMinutes = splitString[1].replace('min', '') * 1\n }\n \n let totalTimeMinutes = timeHours + timeMinutes\n return { duration: totalTimeMinutes }\n })\n}", "function OpenTimeSection(props) {\n // const { data: records } = props;\n if (props.data.length) {\n // const weekdays = records.reduce(\n // (days, record) => [...days, ...record.weekdays],\n // [],\n // );\n // const maxRange = records.reduce((range, record) => {\n // const recordRange = {\n // start: moment.utc(record.start).local(),\n // until: moment.utc(record.until).local(),\n // };\n // if (!range) {\n // return recordRange;\n // }\n // return {\n // start: early(range.start, recordRange.start),\n // until: late(range.until, recordRange.until),\n // };\n // }, undefined);\n const opentimes = props.data.reduce((init, current) => {\n if (\n init.length === 0 ||\n init[init.length - 1].weekdays.toString() !==\n current.weekdays.toString()\n ) {\n init.push({\n weekdays: current.weekdays,\n rangeTime: [{ start: current.start, until: current.until }],\n });\n } else if (\n init[init.length - 1].weekdays.toString() ===\n current.weekdays.toString()\n ) {\n init[init.length - 1].rangeTime.push({\n start: current.start,\n until: current.until,\n });\n }\n return init;\n }, []);\n\n // const renturnRange = (start, until) => {\n // const Range = {\n // start: moment.utc(start).local(),\n // until: moment.utc(until).local(),\n // };\n // return Range;\n // };\n\n // 合并星期数\n const weeks = opentimes\n .map((item) => item.weekdays)\n .reduce((acc, cur) => acc.concat(cur), []);\n // // 设置初始的星期数\n // const [timeIndex, setTimeIndex] = useState(Math.min(...weeks));\n // // 设置初始的大时间段\n // const [weekday, setWeekday] = useState(\n // opentimes.find((d) => d.weekdays.includes(timeIndex)).weekdays,\n // );\n\n const returnMinMaxRange = () => {\n const allStart = [];\n const allUntil = [];\n opentimes.forEach((opentime) => {\n opentime.rangeTime.forEach((range) => {\n allStart.push(moment(range.start));\n allUntil.push(moment(range.until));\n });\n });\n\n return {\n start: moment.min(allStart).local(),\n until: moment.max(allUntil).local(),\n };\n };\n\n const minMaxRange = returnMinMaxRange();\n return (\n <FtBlock\n title={\n <span className=\"padding_x_5\">\n <TranslatableMessage message={intlMessages.sectionTitle} />\n </span>\n }\n className=\"ViewOpenTime\"\n noPadding\n >\n <div className=\"padding_t_5\">\n <WeekdayWidget selected={weeks} />\n <div className=\"ViewOpenTime__rangeLabel\">\n {`${minMaxRange.start.format(\n 'HH:mm',\n )} -- ${minMaxRange.until.format('HH:mm')}`}\n </div>\n </div>\n\n {/* 多时段显示 */}\n {/* {opentimes.map((time, i) => (\n <div key={i} className=\"padding_t_5 ViewOpenTime__range\">\n <WeekdayWidget selected={time.weekdays} />\n {time.rangeTime.map((range, index) => (\n <div key={index} className=\"ViewOpenTime__rangeLabel\">\n {`${renturnRange(range.start, range.until).start.format(\n 'HH:mm',\n )} -- ${renturnRange(range.start, range.until).until.format(\n 'HH:mm',\n )}`}\n </div>\n ))}\n </div>\n ))} */}\n\n {/* 整合多时段显示 */}\n {/* <div className=\"ViewOpenTime__block\">\n {[...new Array(7)].map((_, i) => (\n <SvgIcon\n key={i}\n icon={`weekday-${i}`}\n className={classNames('ViewOpenTime__item', {\n 'is-selected': weeks && weeks.indexOf(i) > -1,\n 'is-show': weekday.includes(i),\n })}\n disabled={weeks && weeks.indexOf(i) === -1}\n onClick={() => {\n setTimeIndex(i);\n setWeekday(\n opentimes.find((d) => d.weekdays.includes(i)).weekdays,\n );\n }}\n />\n ))}\n </div>\n <div className=\"ViewOpenTime__range\">\n {opentimes.map(\n (item) =>\n item.weekdays.includes(timeIndex) && (\n <>\n {item.rangeTime.map((range, index) => (\n <div key={index} className=\"ViewOpenTime__rangeLabel\">\n {`${renturnRange(range.start, range.until).start.format(\n 'HH:mm',\n )} -- ${renturnRange(\n range.start,\n range.until,\n ).until.format('HH:mm')}`}\n </div>\n ))}\n </>\n ),\n )}\n </div> */}\n </FtBlock>\n );\n }\n return null;\n}", "buildObject() {\n // build array of objects (based on input arguments [start,end, interval])\n for (var i = 0; i < this.totalTimeSlots; i++) {\n // add blank object\n this.data.push({})\n // populate object\n this.data[i] = {\n description: '',\n slotStart: this.timeCalc(0,i),\n slotEnd: this.timeCalc(1,i),\n slotDuration: this.timeSlotDuration,\n get viewState() {\n let timeDiff = (() => moment().diff(this.slotStart, 'm'))()\n if (timeDiff < 0) return 'future';\n else if (timeDiff >= 0 && timeDiff < 60) return 'present';\n else return 'past';\n }\n }\n }\n }", "hydrateAvailableHours (start, end, workHours = {}) {\n const numHours = this.countHours(start, end);\n let availability = [];\n for (let i = 0; i < numHours; i++) {\n const availHour = moment(start).utcOffset('+0000').add(i, 'hours').format('YYYY-MM-DD HH:00:00');\n if (!_.isEmpty(workHours)) {\n const startHour = parseInt(moment(availHour).format('H'));\n if (startHour > workHours.start && startHour < workHours.stop) {\n availability.push(availHour); \n }\n } else {\n availability.push(availHour);\n }\n }\n\n return availability;\n }", "function pushDataChart3n4(une_station, id){\r\n// nettoyage des anciennes données s'il y en a\r\n data3.splice(0, data3.length);\r\n data4.splice(0, data4.length);\r\n _labels2.splice(0, _labels2.length);\r\n data3.length = 0;\r\n data4.length = 0;\r\n _labels2.length = 0; // par sécurité\r\n\r\nfor(let hour of une_station[id].hours){\r\n // les données ne maj pas en fonction du jour, il faut aller piocher à partir de datach\r\n data3.push(Math.round(hour.p)); // push des données graphiques, pluie\r\n data4.push(Math.round(hour.t/100)); // temp°\r\n _labels2.push(hour.h);\r\n}\r\n /*d.hours.forEach(hour => {\r\n \r\n });*/\r\n\r\n}", "function buildHourlyData(nextHour,hourlyTemps) {\n // Data comes from a JavaScript object of hourly temp name - value pairs\n // Next hour should have a value between 0-23\n // The hourlyTemps variable holds an array of temperatures\n // Line 8 builds a list item showing the time for the next hour \n // and then the first element (value in index 0) from the hourly temps array\n let hourlyListItems = '<li>' + format_time(nextHour) + ': ' + hourlyTemps[0] + '&deg;F | </li>';\n // Build the remaining list items using a for loop\n for (let i = 1, x = 12; i < x; i++) {\n hourlyListItems += '<li>' + format_time(nextHour+i) + ': ' + hourlyTemps[i] + '&deg;F | </li>';\n }\n console.log('HourlyList is: ' + hourlyListItems);\n return hourlyListItems;\n }", "function getHourly(locData) {\n const API_KEY = '2sw5vR3a2FasN7xaGtCVaKAG7adjboWt';\n const CITY_CODE = locData['key'];\n const URL = \"https://dataservice.accuweather.com/forecasts/v1/hourly/12hour/\" + CITY_CODE + \"?apikey=\" + API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getHourly function:');\n console.log(data); // See what we got back\n // Get the first hour in the returned data\n let date_obj = new Date(data[0].DateTime);\n let nextHour = date_obj.getHours(); // returns 0 to 23\n // Store into the object\n locData[\"nextHour\"] = nextHour;\n // Counter for the forecast hourly temps\n var i = 1;\n // Get the temps for the next 12 hours\n data.forEach(function (element) {\n let temp = element.Temperature.Value;\n let hour = 'hourTemp' + i;\n locData[hour] = temp; // Store hour and temp to object\n // New hiTemp variable, assign value from previous 12 hours\n let hiTemp = locData.pastHigh;\n // New lowTemp variable, assign value from previous 12 hours\n let lowTemp = locData.pastLow;\n // Check current forecast temp to see if it is \n // higher or lower than previous hi or low\n if (temp > hiTemp) {\n hiTemp = temp;\n } else if (temp < lowTemp) {\n lowTemp = temp;\n }\n // Replace stored low hi and low temps if they changed\n if (hiTemp != locData.pastHigh) {\n locData[\"pastHigh\"] = hiTemp; // When done, this is today's high temp\n }\n if (lowTemp != locData.pastLow) {\n locData[\"pastLow\"] = lowTemp; // When done, this is today's low temp\n }\n i++; // Increase the counter by 1\n }); // ends the foreach method\n console.log('Finished locData object and data:');\n console.log(locData);\n\n // Send data to buildPage function\n })\n .catch(error => console.log('There was an error: ', error))\n} // end getHourly function", "function newdata() {\n\n var date, hour\n\n date = globaldata[e]['date']\n hour = globaldata[e]['hour']\n\n // console.log(date, hour)\n\n return [date, hour];\n}", "function fetchIntervalData(from, to, fn){\r\n var obj = cloneObj(currentInterval);\r\n obj.format = 'interval';\r\n obj.from = from;\r\n obj.to = to;\r\n getDataFromServer(obj, function(err, data){\r\n if(err){\r\n return fn(null, null);\r\n }else{\r\n return fn(null, data);\r\n }\r\n })\r\n}", "ensureRightPoint(data) {\n const now = Moment().unix();\n const newest = _.last(data, \"t\");\n if (now - newest.t > 2) {\n data.push(Object.assign({}, newest, {t: now}));\n }\n }", "newSchedule() {\n const\n startHour = 9,\n endHour = 17;\n \n let\n currentHour = startHour,\n schedule = {\n date: moment().format(\"YYYY-MM-DD\"),\n events: []\n };\n \n while (currentHour <= endHour) {\n let currentMoment = moment({hour: currentHour});\n\n schedule.events.push({\n hourBlock: parseInt(currentMoment.format(\"H\")),\n hourBlockDisplay: currentMoment.format(\"ha\"),\n event: null\n });\n\n currentHour++;\n }\n\n return schedule;\n }", "incrementHour() {\n //Shift the array down one, then push a new slot to the end\n\t\tthis.reservedTimes.shift();\n\t\tthis.reservedTimes.push(0);\n //Increment the current time by an hour\n //3.6E6 is miliseconds in hour\n\t\tthis.currentTime = new Date(this.currentTime.getTime() + 3.6E6);\n\t}", "function applyOffset(data)\n{\n var startingTimes = [];\n computeOffset(data, startingTimes);\n for (var i = 0; i < data.length/6; i++) { // timeline num\n for (var j = i*6; j < i*6+5; j++) { // each row for the corresponding timeline\n for (var k = 0; k < data[j][\"times\"].length; k++) { // each event in the row\n data[j][\"times\"][k][\"starting_time\"] -= startingTimes[i];\n data[j][\"times\"][k][\"ending_time\"] -= startingTimes[i];\n }\n }\n }\n return data;\n}", "function fillCurrent() {\n for (let i = startDay; i < endDate + startDay; i++) {\n dateArray.push(i - startDay + 1)\n }\n }", "function filterByNow(){\n //This piece of code handles the stringiness of the JSON data and allows us to\n //compare real time to the meeting times\n const myTime = Number(`${start.getHours()}${start.getMinutes()}`)\n let nextMeetingIndex = meetings.findIndex(meeting => (Number(meeting.day)===today) && (Number(meeting.time.split(':').join('')))>myTime)\n // returns -1 if there are no more meetings that day\n // This conditional handles the turnaround from Saturday to Sunday (6 to 0)\n if(nextMeetingIndex===-1){\n if(today===6){\n nextMeetingIndex = 0;\n } else {\n nextMeetingIndex = meetings.findIndex(meeting => Number(meeting.day)===today+1)\n }\n }\n //Here we filter/pull the amount of meetings requested by user input value and return those\n let upcomingMeetings = meetings.slice(nextMeetingIndex, nextMeetingIndex+numOfMeetings);\n if(upcomingMeetings.length<numOfMeetings){\n upcomingMeetings=[...upcomingMeetings.concat(meetings.slice(0, numOfMeetings-upcomingMeetings.length))]\n }\n return upcomingMeetings;\n}", "function OntheHour() {\n\n function ClockStrikes(y) {\n return y['hour'] == hour_in;\n }\n\n var ind = filtered.findIndex(ClockStrikes)\n var new_data = filtered.slice(ind);\n\n globaldata = new_data;\n // console.log(new_data)\n makedata();\n}", "getValues(data) {\n // Declaration of variables\n let highsArray = [];\n let lowsArray = [];\n let allTemps = [];\n let allData = data;\n let firstRecord = data[0];\n let lastRecord = data[data.length - 1];\n if (firstRecord.date.getDate() != lastRecord.date.getDate()) {\n for (let i = new Date(firstRecord.date); i <= lastRecord.date; i.setDate(i.getDate() + 1)) {\n // console.log(i.getDate());\n\n let recordsThisDay = allData.filter(record => {\n return record.date.getDate() == i.getDate();\n })\n // console.log(recordsThisDay);\n\n if (data[0].displayName == \"GT-UTE\") {\n let low = 100;\n let high = -100;\n\n recordsThisDay.forEach(record => {\n\n let temp = record.value.replace(\"−\", \"-\");\n // console.log(parseFloat(temp));\n temp = parseFloat(temp);\n\n if (temp < low) {\n // console.log(\"New low\")\n low = temp;\n }\n if (temp > high) {\n // console.log(\"New high\")\n high = temp;\n }\n });\n highsArray.push(high);\n lowsArray.push(low);\n }\n }\n return {\n highsArray,\n lowsArray\n };\n } else {\n allData.forEach(record => {\n allTemps.push(record.value);\n });\n return {\n allTemps\n };\n }\n\n }", "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}", "function timeRange(from, to) {\r\n const times = [];\r\n\r\n let hour = from;\r\n while (hour !== to) {\r\n times.push(hour);\r\n hour = (hour + 1) % 24;\r\n if (times.length >= 24) break;\r\n }\r\n return times;\r\n}", "function buildHourlyData(nextHour, hourlyTemps) {\n // Data comes from a JavaScript object of hourly temp name - value pairs\n // Next hour should have a value between 0-23\n // The hourlyTemps variable holds an array of temperatures\n // Line 8 builds a list item showing the time for the next hour \n // and then the first element (value in index 0) from the hourly temps array\n let hourlyListItems = '<li>' + format_time(nextHour) + ':' + hourlyTemps[0] + '&deg;F</li>';\n // Build the rest in a loop\n for (let i = 1, x = hourlyTemps.length; i < x; i++) {\n hourlyListItems += '<li>' + format_time(nextHour + i) + ': ' + hourlyTemps[i] + '&deg;F</li>';\n }\n console.log('HourlyList is: ' + hourlyListItems);\n return hourlyListItems;\n}", "function getTimeVals(cell, index) {\r\n //Zapamatuju si, kdy je treba preskocit na dalsi bunku\r\n t1 = casy2[index][0].split(\":\");\r\n t2 = casy2[index+getSpan(cell)][1].split(\":\");\r\n \r\n\r\n //Ulozim si rozmezi pro procenta\r\n range = [t1[0]*60+1*t1[1], t2[0]*60+1*t2[1]];\r\n console.log(range);\r\n }", "function buildHourlyData(nextHour, hourlyTemps) {\n // Data comes from a JavaScript object of hourly temp name - value pairs\n // Next hour should have a value between 0-23\n // The hourlyTemps variable holds an array of temperatures\n // Line 175 builds a list item showing the time for the next hour \n // and then the first element (value in index 0) from the hourly temps array\n let hourlyListItems = '<li>' + format_time(nextHour) + ': ' + hourlyTemps[0] + '&deg;F | </li>';\n // Build the remaining list items using a for loop\n for (let i = 1, x = hourlyTemps.length; i < x; i++) {\n hourlyListItems += '<li>' + format_time(nextHour + i) + ': ' + hourlyTemps[i] + '&deg;F | </li>';\n }\n console.log('HourlyList is: ' + hourlyListItems);\n return hourlyListItems;\n}", "function initialChartData() {\n var datetimeHash = {};\n for (var date = getStartDate(); date <= getEndDate(); date.setDate(date.getDate() + 1)) {\n for (var hour = 0; hour <= 23; hour += 1) {\n datetimeHash[dateToString(date) + '--' + hour] = 0;\n }\n }\n return datetimeHash;\n }", "function getData(arr, data, data_id){\r\n for (var i = 0; i < data.length; i++){\r\n arr[i][0] = Date.parse(data[i][13].value) + (2*60*60*1000);\r\n arr[i][1] = data[i][data_id].value;\r\n }\r\n\r\n}", "_extractMostActiveHours(messages, dayFilter = null){\n var mostActiveHours = []\n\n // mapping if needed\n if(dayFilter){\n\n var weekDay = new Array(7);\n weekDay[0] = \"Sunday\";\n weekDay[1] = \"Monday\";\n weekDay[2] = \"Tuesday\";\n weekDay[3] = \"Wednesday\";\n weekDay[4] = \"Thursday\";\n weekDay[5] = \"Friday\";\n weekDay[6] = \"Saturday\";\n\n }\n\n // all users object\n mostActiveHours.push({all_users: true, total: 0})\n\n messages.map(m => { \n\n if(m.isUserMessage){\n\n // Date object if needed\n if(dayFilter){\n\n var parts = m.date.split('/')\n var year = parseInt(parts[2], 10) + 2000\n var month = parseInt(parts[0], 10) - 1 // month is zero-based\n var day = parseInt(parts[1], 10)\n var messageDate = new Date(year, month, day);\n\n }\n\n // if there's no day filter or the filter matches the message's day\n if(!dayFilter || [weekDay[messageDate.getDay()]] == dayFilter){\n\n var hour = m.time.substr(0, m.time.indexOf(':'));\n\n // checks for the hour attribute in the specified index, creates it if it doesn't exist, adds to the count if it does\n function countHours(index){\n if(mostActiveHours[index].hasOwnProperty([hour])){\n mostActiveHours[index][hour]++\n } else {\n mostActiveHours[index][hour] = 1\n }\n mostActiveHours[index].total++\n }\n\n countHours(0)\n\n // tries to find the user through the index, if it doesn't it returns -1\n var user_index = mostActiveHours.findIndex(u => u.user == m.user)\n\n // creates a new user object with the initial count if it doesn't exist already in the array, otherwise just adds to the count\n if(user_index == -1){\n const userDays = {user: m.user, total: 1, [hour]: 1}\n mostActiveHours.push(userDays)\n } else {\n countHours(user_index)\n }\n\n }\n\n }\n\n });\n\n mostActiveHours = mostActiveHours.sort((a, b) => {\n return b.total - a.total;\n })\n\n return mostActiveHours;\n }", "function fixGaps(data) {\n var fixed_data = new Array();\n $.each(data, function(index, sensor_data) {\n var next_timestamp;\n if (index+1 < data.length) next_timestamp = data[index+1][0];\n fixed_data.push(sensor_data);\n // push a zero point 1ms before and after the gap\n if (next_timestamp - sensor_data[0] > 60000) {\n fixed_data.push([sensor_data[0]+1,0]);\n fixed_data.push([next_timestamp-1, 0]);\n }\n });\n return fixed_data;\n}", "function removeTimeSpacesAndAlign(chart_data){\n\n //alinha os eventos de acordo com data atual\n let alignStartTime = new Date();\n\n chart_data.forEach((student) =>{\n let currentTime = alignStartTime;\n student.data.forEach((item, index) =>{\n if (item !== undefined){\n if (item.type == TimelineChart.TYPE.POINT){ //apenas desloca o 'at' do evento\n item.at = currentTime;\n } else { //altera o 'to' e 'from'\n let eventIntervalSizeInMs = item.to.getTime() - item.from.getTime();\n \n item.from = currentTime;\n item.to = new Date(currentTime.getTime() + eventIntervalSizeInMs);\n } \n \n //atualiza currentTime, adicionando 0,5s de espaço entre os eventos\n currentTime = (item.type == TimelineChart.TYPE.POINT) ? new Date(item.at.getTime() + 500) : new Date(item.to.getTime() + 500); \n }\n }); \n }); \n}", "function formatTimeTrackingData(storeData, data, lookups) {\n // TODO: validate input data object\n var weeksData = (storeData && Object.keys(storeData).includes('weeksData')) ? storeData['weeksData'] : []\n var chaptersData = (storeData && Object.keys(storeData).includes('chaptersData')) ? storeData['chaptersData'] : []\n var chaptersTotalData = (storeData && Object.keys(storeData).includes('chaptersTotalData')) ? storeData['chaptersTotalData'] : []\n var modulesData = (storeData && Object.keys(storeData).includes('modulesData')) ? storeData['modulesData'] : {}\n var modulesTotalData = (storeData && Object.keys(storeData).includes('modulesTotalData')) ? storeData['modulesTotalData'] : {}\n var modulesSectionsHash = lookups['modulesSectionsHash']\n var sectionsLookup = (storeData && Object.keys(storeData).includes('sectionsLookup')) ? storeData['sectionsLookup'] : JSON.parse(JSON.stringify(modulesSectionsHash))\n var sectionsData = (storeData && Object.keys(storeData).includes('sectionsData')) ? storeData['sectionsData'] : JSON.parse(JSON.stringify(modulesSectionsHash))\n var sectionsTotalData = (storeData && Object.keys(storeData).includes('sectionsTotalData')) ? storeData['sectionsTotalData'] : JSON.parse(JSON.stringify(modulesSectionsHash))\n var weeksDates = lookups['weeksDates']\n var daysHash = lookups['daysHash']\n var daysIds = lookups['daysIds']\n var chaptersHash = lookups['chaptersHash']\n var chaptersIds = lookups['chaptersIds']\n var chaptersModulesHash = lookups['chaptersModulesHash']\n var modulesIds = lookups['modulesIds']\n var modulesHash = lookups['modulesHash']\n var usersHash = lookups['usersHash']\n var usersIds = lookups['usersIds']\n var usersIdsDiff = lookups['usersIdsDiff']\n var users = lookups['users']\n\n function addRow(matrix, length) {\n var clone = JSON.parse(JSON.stringify(matrix))\n var length = length || clone[0].length\n var zeroRow = new Array(length); for (let i = 0; i < length; ++i) zeroRow[i] = 0;\n clone.push(zeroRow)\n return clone\n }\n\n function addCol(matrix) {\n if (matrix) {\n for (var i = 0; i < matrix.length; i++) {\n if (matrix[i]) {\n matrix[i].push(0)\n }\n }\n }\n return matrix\n }\n\n // init weeksData matrix\n if (weeksData.length == 0) {\n for (var i = 0; i < weeksDates.length; i++) {\n weeksData = addRow(weeksData, users.length)\n }\n }\n\n // init chaptersData matrix\n if (chaptersData.length == 0) {\n for (var i = 0; i < chaptersIds.length; i++) {\n chaptersData = addRow(chaptersData, users.length)\n }\n }\n\n // init chaptersTotalData array\n if (chaptersTotalData.length == 0) {\n for (var i = 0; i < chaptersIds.length; i++) {\n chaptersTotalData.push(0)\n }\n }\n\n // init modulesData object\n if ($.isEmptyObject(modulesData)) {\n for (var i = 0; i < chaptersIds.length; i++) {\n var chapterId = chaptersIds[i]\n modulesData[chapterId] = []\n for (var j = 0; j < chaptersModulesHash[chapterId]; j++) {\n modulesData[chapterId] = addRow(modulesData[chapterId], users.length)\n }\n }\n }\n\n // init modulesTotalData object\n if ($.isEmptyObject(modulesTotalData)) {\n for (var i = 0; i < chaptersIds.length; i++) {\n var chapterId = chaptersIds[i]\n modulesTotalData[chapterId] = []\n for (var j = 0; j < chaptersModulesHash[chapterId]; j++) {\n modulesTotalData[chapterId].push(0)\n }\n }\n }\n\n // TODO: add columns to modulesData and modulesTotalData\n for (var i = 0; i < usersIdsDiff.length; i++) {\n weeksData = addCol(weeksData)\n chaptersData = addCol(chaptersData)\n }\n\n // add data to weeks and chapters matrices\n for (var i = 0; i < data.length; i++) {\n var dt = data[i]['dt']\n var usr_id = data[i]['usr_id']\n var ch_id = data[i]['ch_id']\n var mod_id = data[i]['mod_id']\n var st = data[i]['st']\n var tt = Math.round(data[i]['tt'] * 100.0 / 60) / 100\n\n if (usersIds.includes(usr_id)) {\n // Aggregate weeksData\n if (daysIds.includes(dt)) {\n weeksData[daysHash[dt]][usersHash[usr_id]] += tt\n }\n\n // Aggregate chaptersData/chaptersTotalData\n if (chaptersIds.includes(ch_id)) {\n chaptersData[chaptersHash[ch_id]][usersHash[usr_id]] += tt\n chaptersTotalData[chaptersHash[ch_id]] += tt\n\n // Aggregate modulesData/modulesTotalData\n if (modulesIds.includes(mod_id)) {\n modulesData[String(ch_id)][modulesHash[mod_id]][usersHash[usr_id]] += tt\n modulesTotalData[String(ch_id)][modulesHash[mod_id]] += tt\n\n try {\n st = JSON.parse(st)\n if (Array.isArray(st)) {\n\n // init sectionsLookup hash\n if (sectionsLookup[ch_id][mod_id].length == 0) {\n for (var j = 0; j < st.length; j++) {\n var sectionName = Object.keys(st[j])[0]\n if (!sectionsLookup[ch_id][mod_id].includes(sectionName)) {\n sectionsLookup[ch_id][mod_id].push(sectionName)\n }\n }\n }\n\n // init sectionsData matrices\n if (sectionsData[ch_id][mod_id].length == 0) {\n var sectionsArr = sectionsLookup[ch_id][mod_id]\n for (var l = 0; l < sectionsArr.length; l++) {\n sectionsData[ch_id][mod_id] = addRow(sectionsData[ch_id][mod_id], users.length)\n }\n }\n\n // init sectionsTotalData matrices\n if (sectionsTotalData[ch_id][mod_id].length == 0) {\n var sectionsArr = sectionsLookup[ch_id][mod_id]\n for (var l = 0; l < sectionsArr.length; l++) {\n sectionsTotalData[ch_id][mod_id].push(0)\n }\n }\n\n // Aggregate sectionsData and sectionsTotalData\n for (var k = 0; k < st.length; k++) {\n var sectionName = Object.keys(st[k])[0]\n var sectionTime = Math.round(Object.values(st[k])[0] * 100.0 / 60) / 100\n var index = sectionsLookup[ch_id][mod_id].indexOf(sectionName)\n\n sectionsData[ch_id][mod_id][index][usersHash[usr_id]] += sectionTime\n sectionsTotalData[ch_id][mod_id][index] += sectionTime\n }\n }\n } catch (e) {\n // console.log(e)\n }\n }\n }\n }\n }\n\n return {\n 'weeksData': weeksData,\n 'chaptersData': chaptersData,\n 'chaptersTotalData': chaptersTotalData,\n 'modulesData': modulesData,\n 'modulesTotalData': modulesTotalData,\n 'sectionsLookup': sectionsLookup,\n 'sectionsData': sectionsData,\n 'sectionsTotalData': sectionsTotalData\n }\n }", "function processCurrentSessionsData() {\n var _data = state.data[0].data[processor.types[0].name].points,\n _points = [];\n\n state.processedData.sessions.currentTotal = 0;\n\n for (var si = 0, sl = _data.length; si < sl; si ++ ) {\n _points.push({\n lat: _data[si].lat,\n lng: _data[si].lng,\n count: _data[si].count\n });\n\n state.processedData.sessions.current = _points;\n state.processedData.sessions.currentTotal += _data[si].count;\n }\n\n \n}", "function clock() {\n clockdata = globaldata.slice(s, xrange)\n\n clockdata.forEach(zz => {\n\n if (zz['minute'] < 10) {\n minute.push(`:0${zz['minute']}`)\n }\n else {\n minute.push(`:${zz['minute']}`)\n }\n \n });\n\n drawline()\n}", "function findTenFree(eventTimes, currentEventObj) {\n var tenFreeTimes = []\n var eventCounter = 0\n var dayCounter = 0\n var aDay = 86400000;\n var now = new Date().getTime();\n var time = now - now%aDay + aDay;\n var halfHour = aDay/48;\n var startTime = currentEventObj.end + 1800000\n while (dayCounter < 3) {\n eventTimes.map((eventObj) => {\n var eventTimeObject = convertMilli(eventObj)\n if(!checkConflict(eventTimeObject, {'start': startTime, 'end': startTime + halfHour})) {\n console.log('THIS IS THE event counter: ', eventCounter);\n tenFreeTimes.push(startTime)\n console.log('This is the array of shit', tenFreeTimes);\n if (eventCounter === 10) {\n console.log('THIS SHOULD BE 10: ', eventCounter);\n dayCounter = 4\n }\n eventCounter ++\n if (dayCounter === 2) {\n dayCounter = 0\n startTime = startTime - startTime%aDay + aDay + aDay/3\n }\n else {\n dayCounter++\n }\n }\n })\n }\n return tenFreeTimes\n}", "function generateIncrements(start_time, end_time, peak_start, peak_end) {\n // convert selected booking times to decimal\n var newStartTime = start_time.replace(':3', ':5').replace(':', '.');\n var newEndTime = end_time.replace(':3', ':5').replace(':', '.');\n var decimalStart = parseFloat(newStartTime);\n var decimalEnd = parseFloat(newEndTime);\n //console.log(decimalStart, decimalEnd)\n // convert peak hour times to decimal\n var peakStartTime = peak_start.replace(':3', ':5').replace(':', '.');\n var peakEndTime = peak_end.replace(':3', ':5').replace(':', '.');\n var decimalPeakStart = parseFloat(peakStartTime);\n var decimalPeakEnd = parseFloat(peakEndTime);\n //var real_prices = $('.real-price-holder').text()\n var real_prices = document.querySelector('.real-price-holder').innerText\n var prices_json = JSON.parse(real_prices);\n //console.log(prices_json);\n //var prices = $(\".priceHolder\")[];\n var rate;\n var totalCost = 0;\n //var booking_type;\n var time_period_peak = [];\n var time_period_off_peak = [];\n var productListing = [];\n //console.log(decimalStart, decimalEnd);\n while (decimalStart != decimalEnd) {\n //console.log(totalCost)\n // if the booked time lies between the designated peak hours\n if (decimalStart >= peakStartTime && decimalStart < peakEndTime) {\n // then then startTime of interval is within the peak hours\n rate = parseFloat(prices_json[\"casual\"][\"half_court\"][\"peak_hour\"])/2.0 // peak_hour_rate\n //booking_type = \"Booking (peak hour)\";\n time_period_peak.push(decimalStart);\n //console.log(rate);\n } else {\n rate = parseFloat(prices_json[\"casual\"][\"half_court\"][\"off_peak\"])/2.0 //non-peak_hour rate\n time_period_off_peak.push(decimalStart);\n //console.log(rate);\n }\n totalCost += rate;\n\n decimalStart += 0.5;\n // increment by thirty minutes\n }\n console.log(time_period_peak);\n console.log(time_period_off_peak);\n // iterate through the resulting peak and off peak array to check for non 0.5 intervals\n // if exists separate into a separate array within.\n time_period_off_peak = checkArray(time_period_off_peak);\n time_period_peak = checkArray(time_period_peak);\n var costAndTimes = {\"Total\": totalCost, \"off_peak\":time_period_off_peak, \"peak_hour\":time_period_peak}\n //console.log(time_period_peak, time_period_off_peak);\n return costAndTimes;\n }", "getMoreCurrent(){\n this._numExpired = 1;\n let output = _formatEventsIntoHTML(this._schedule[0].slice(this._numCurrent - 1, this._numCurrent + 9));\n this._numCurrent += 10;\n\n return output;\n }", "function pushHoursOpen(store){\n for(var i = 1; i < storeObjects.length; i++){\n store.hoursOpen = ['6am', '7am', '8am', '9am', '10am', '11am', '12pm', '1pm', '2pm', '3pm', '4pm', '5pm', '6pm', '7pm', '8pm'];\n }\n}", "function timeModel(data) {\r\n\t// create map to store incidents and their times of occurence\r\n\tvar incidentMap = new Map();\r\n\tfor (var incIn = 1; incIn < data.length; incIn++) {\r\n\t\tvar parsedDate = Date.parse(data[incIn][6]);\r\n\t\tvar currentDate = new Date(parsedDate);\r\n\t\tif (incidentMap.get(data[incIn][3]) != null) {\r\n\t\t\tvar numIncidents = incidentMap.get(data[incIn][3]).get(\r\n\t\t\t\t\tcurrentDate.getUTCHours()) + 1;\r\n\t\t\tincidentMap.get(data[incIn][3]).set(currentDate.getUTCHours(),\r\n\t\t\t\t\tnumIncidents);\r\n\t\t} else {\r\n\t\t\t// create map to store time data\r\n\t\t\tvar timeList = new Map();\r\n\t\t\tfor (var i = 0; i < 24; i++) {\r\n\t\t\t\ttimeList.set(i, 0);\r\n\t\t\t}\r\n\t\t\ttimeList.set(currentDate.getUTCHours(), 1);\r\n\t\t\tincidentMap.set(data[incIn][3], timeList);\r\n\t\t}\r\n\t}\r\n\tgoogle.charts.setOnLoadCallback(drawChart3(incidentMap));\r\n}", "function trabalho(entrada, saida) {\n var horaInicio = entrada.split(\":\"); //Split starting hours\n var horaSaida = saida.split(\":\"); //Split finishing hours\n\n //Create 2 variables to set as the starting hour and ending\n hora1 = new Date();\n hora2 = new Date();\n\n //Filling the variables with data from the splited string\n hora1.setHours(horaInicio[0], horaInicio[1], horaInicio[2]); //Starting hour\n hora2.setHours(horaSaida[0], horaSaida[1], horaSaida[2]); //Ending hour\n\n ///Still working on this condition -------------- working hours only between 8:00:00 and 18:00:00\n if (hora1.getHours() < 8 || hora1.getHours() > 18 || hora2.getHours() > 18 || hora1.getHours() < 8 || hora1.getHours() > hora2.getHours()) {\n console.log(\"Erro\");\n } else {\n var difference = new Date(); //New variable this will be the hours difference or the hours worked\n\n //difference equals to ending hours - starting hours at the end we get the amout of time worked\n difference.setHours(hora2.getHours() - hora1.getHours(), hora2.getMinutes() - hora1.getMinutes(), hora2.getSeconds() - hora1.getSeconds());\n console.log(difference.getHours(), ':', difference.getMinutes(), ':', difference.getSeconds());\n }\n}", "function producedPastHour() {\n let currentTime = new Date();\n let hourago = new Date(currentTime.getTime() - (60 * 60 * 1000));\n let producedKWH = 0;\n //Get the production readings from the past hour on phase 1\n request('http://raspberrypi.local:1080/api/chart/1/energy_pos/from/' + hourago.toISOString() + '/to/' + currentTime.toISOString(), (error, response, body) => {\n let resultJson = JSON.parse(body);\n let values = resultJson[0].values;\n //Accumulate the total amount fed during the past hour\n values.forEach((measurment) => {\n producedKWH += measurment.value;\n });\n\n //Unlock the account for 15000 milliseconds\n Web3Service.unlockAccount(meterAccount, \"1234\", 15000);\n //Execute the produce smart contract\n SmartGridContract.produce(producedKWH, meterAccount);\n });\n}", "function buildShiftinfo(schichtId, when) {\n for (var k in shiftinfo) {\n if (schichtId == k\n && shiftinfo[k].from.setHours(0, 0, 0, 0) <= when\n && shiftinfo[k].thru.setHours(23, 59, 59, 0) >= when) {\n return shiftinfo[k];\n }\n }\n}", "function getHourly(locData) {\n const API_KEY = 'QBznyDeat32Fh3pyLdDcz3KUEyrxDKjA';\n const CITY_CODE = locData['key'];\n const URL = \"https://dataservice.accuweather.com/forecasts/v1/hourly/12hour/\"+CITY_CODE+\"?apikey=\"+API_KEY;\n fetch(URL)\n .then(response => response.json())\n .then(function (data) {\n console.log('Json object from getHourly function:');\n console.log(data); // See what we got back\n // Get the first hour in the returned data\n let date_obj = new Date(data[0].DateTime);\n let nextHour = date_obj.getHours(); // returns 0 to 23\n // Store into the object\n locData[\"nextHour\"] = nextHour;\n // Counter for the forecast hourly temps\n var i = 1;\n // Get the temps for the next 12 hours\n data.forEach(function (element) {\n let temp = element.Temperature.Value;\n let hour = 'hourTemp' + i;\n locData[hour] = temp; // Store hour and temp to object\n // New hiTemp variable, assign value from previous 12 hours\n let hiTemp = locData.pastHigh;\n // New lowTemp variable, assign value from previous 12 hours\n let lowTemp = locData.pastLow;\n // Check current forecast temp to see if it is \n // higher or lower than previous hi or low\n if(temp > hiTemp){\n hiTemp = temp;\n } else if (temp < lowTemp){\n lowTemp = temp;\n }\n // Replace stored low hi and low temps if they changed\n if(hiTemp != locData.pastHigh){\n locData[\"pastHigh\"] = hiTemp; // When done, this is today's high temp\n }\n if(lowTemp != locData.pastLow){\n locData[\"pastLow\"] = lowTemp; // When done, this is today's low temp\n }\n i++; // Increase the counter by 1\n }); // ends the foreach method\n console.log('Finished locData object and data:');\n console.log(locData);\n buildPage(locData); // Send data to buildPage function\n })\n .catch(error => console.log('There was an error: ', error))\n } // end getHourly function", "finalData(hrData) {\r\n const scope = this;\r\n let totalOccupancy, counter;\r\n scope.tempData.occupancy = [];\r\n\r\n scope.tempData.forEach(v => {\r\n totalOccupancy = 0;\r\n counter = 0;\r\n hrData.forEach(d => {\r\n if((new Date(d.Time)).getHours() === v.time){\r\n v.occupancy.push(d.mean);\r\n totalOccupancy = totalOccupancy + d.mean;\r\n counter++;\r\n }\r\n });\r\n\r\n if(counter > 0)\r\n v.average = totalOccupancy / counter;\r\n else\r\n v.average = 0;\r\n });\r\n\r\n return scope.tempData;\r\n }", "function getUpcomingTimes() {\n var now = moment().utc();\n var upcomingTimes = [];\n var count = 0;\n return new Promise(function(resolve, reject) {\n for (var i = 0; i < 5; i++) {\n aux(i, 'global', function() {\n if (count === 5)\n resolve(upcomingTimes);\n });\n }\n\n\n });\n\n function aux(digit, version, cb) {\n var options = {\n url: 'http://localhost:3000/api/turtle',\n qs: {\n digit: digit,\n version: 'global',\n },\n json: true,\n };\n\n return rp(options).then(function(dates) {\n var i = 0;\n upcomingTimes[digit] = moment.utc(dates[i]);\n while (now.isAfter(upcomingTimes[digit])) {\n upcomingTimes[digit] = moment.utc(dates[++i]);\n }\n count++;\n cb();\n }).catch(function(err) {\n console.log('Error retrieving date');\n count++;\n cb();\n });\n }\n}", "function updateRectData(hour) {\n _.each(tweetData, function(t,idx) {\n var tweetHour = diffTopOfHour(moment(t.created_at), earliestTweetDate);\n if (tweetHour > hour) {\n //nothing to do\n return;\n }\n\n var count = t.hourlyRetweetCount[hour - tweetHour] || 0;\n if (tweetHour < hour) {\n // Tweet has happened.\n if (count > 0) {\n cumulativeRetweetCount[t.id] += count;\n rectData.push({ \"tweet\" : t, \"startHour\" : hour, \"tweetIndex\": idx, \"retweetCount\": cumulativeRetweetCount[t.id] });\n }\n }\n\n if (tweetHour == hour) {\n cumulativeRetweetCount[t.id] = count;\n // Tweet happened this hour.\n rectData.push({ \"tweet\" : t, \"startHour\" : hour, \"tweetIndex\": idx , \"retweetCount\": count });\n }\n });\n }", "accumulateJoinState(roomId, data, fromDatabase = false) {\n // We expect this function to be called a lot (every /sync) so we want\n // this to be fast. /sync stores events in an array but we often want\n // to clobber based on type/state_key. Rather than convert arrays to\n // maps all the time, just keep private maps which contain\n // the actual current accumulated sync state, and array-ify it when\n // getJSON() is called.\n // State resolution:\n // The 'state' key is the delta from the previous sync (or start of time\n // if no token was supplied), to the START of the timeline. To obtain\n // the current state, we need to \"roll forward\" state by reading the\n // timeline. We want to store the current state so we can drop events\n // out the end of the timeline based on opts.maxTimelineEntries.\n //\n // 'state' 'timeline' current state\n // |-------x<======================>x\n // T I M E\n //\n // When getJSON() is called, we 'roll back' the current state by the\n // number of entries in the timeline to work out what 'state' should be.\n // Back-pagination:\n // On an initial /sync, the server provides a back-pagination token for\n // the start of the timeline. When /sync deltas come down, they also\n // include back-pagination tokens for the start of the timeline. This\n // means not all events in the timeline have back-pagination tokens, as\n // it is only the ones at the START of the timeline which have them.\n // In order for us to have a valid timeline (and back-pagination token\n // to match), we need to make sure that when we remove old timeline\n // events, that we roll forward to an event which has a back-pagination\n // token. This means we can't keep a strict sliding-window based on\n // opts.maxTimelineEntries, and we may have a few less. We should never\n // have more though, provided that the /sync limit is less than or equal\n // to opts.maxTimelineEntries.\n if (!this.joinRooms[roomId]) {\n // Create truly empty objects so event types of 'hasOwnProperty' and co\n // don't cause this code to break.\n this.joinRooms[roomId] = {\n _currentState: Object.create(null),\n _timeline: [],\n _accountData: Object.create(null),\n _unreadNotifications: {},\n _summary: {},\n _readReceipts: {}\n };\n }\n\n const currentData = this.joinRooms[roomId];\n\n if (data.account_data && data.account_data.events) {\n // clobber based on type\n data.account_data.events.forEach(e => {\n currentData._accountData[e.type] = e;\n });\n } // these probably clobber, spec is unclear.\n\n\n if (data.unread_notifications) {\n currentData._unreadNotifications = data.unread_notifications;\n }\n\n if (data.summary) {\n const HEROES_KEY = \"m.heroes\";\n const INVITED_COUNT_KEY = \"m.invited_member_count\";\n const JOINED_COUNT_KEY = \"m.joined_member_count\";\n const acc = currentData._summary;\n const sum = data.summary;\n acc[HEROES_KEY] = sum[HEROES_KEY] || acc[HEROES_KEY];\n acc[JOINED_COUNT_KEY] = sum[JOINED_COUNT_KEY] || acc[JOINED_COUNT_KEY];\n acc[INVITED_COUNT_KEY] = sum[INVITED_COUNT_KEY] || acc[INVITED_COUNT_KEY];\n }\n\n if (data.ephemeral && data.ephemeral.events) {\n data.ephemeral.events.forEach(e => {\n // We purposefully do not persist m.typing events.\n // Technically you could refresh a browser before the timer on a\n // typing event is up, so it'll look like you aren't typing when\n // you really still are. However, the alternative is worse. If\n // we do persist typing events, it will look like people are\n // typing forever until someone really does start typing (which\n // will prompt Synapse to send down an actual m.typing event to\n // clobber the one we persisted).\n if (e.type !== \"m.receipt\" || !e.content) {\n // This means we'll drop unknown ephemeral events but that\n // seems okay.\n return;\n } // Handle m.receipt events. They clobber based on:\n // (user_id, receipt_type)\n // but they are keyed in the event as:\n // content:{ $event_id: { $receipt_type: { $user_id: {json} }}}\n // so store them in the former so we can accumulate receipt deltas\n // quickly and efficiently (we expect a lot of them). Fold the\n // receipt type into the key name since we only have 1 at the\n // moment (m.read) and nested JSON objects are slower and more\n // of a hassle to work with. We'll inflate this back out when\n // getJSON() is called.\n\n\n Object.keys(e.content).forEach(eventId => {\n if (!e.content[eventId][\"m.read\"]) {\n return;\n }\n\n Object.keys(e.content[eventId][\"m.read\"]).forEach(userId => {\n // clobber on user ID\n currentData._readReceipts[userId] = {\n data: e.content[eventId][\"m.read\"][userId],\n eventId: eventId\n };\n });\n });\n });\n } // if we got a limited sync, we need to remove all timeline entries or else\n // we will have gaps in the timeline.\n\n\n if (data.timeline && data.timeline.limited) {\n currentData._timeline = [];\n } // Work out the current state. The deltas need to be applied in the order:\n // - existing state which didn't come down /sync.\n // - State events under the 'state' key.\n // - State events in the 'timeline'.\n\n\n if (data.state && data.state.events) {\n data.state.events.forEach(e => {\n setState(currentData._currentState, e);\n });\n }\n\n if (data.timeline && data.timeline.events) {\n data.timeline.events.forEach((e, index) => {\n // this nops if 'e' isn't a state event\n setState(currentData._currentState, e); // append the event to the timeline. The back-pagination token\n // corresponds to the first event in the timeline\n\n let transformedEvent;\n\n if (!fromDatabase) {\n transformedEvent = Object.assign({}, e);\n\n if (transformedEvent.unsigned !== undefined) {\n transformedEvent.unsigned = Object.assign({}, transformedEvent.unsigned);\n }\n\n const age = e.unsigned ? e.unsigned.age : e.age;\n if (age !== undefined) transformedEvent._localTs = Date.now() - age;\n } else {\n transformedEvent = e;\n }\n\n currentData._timeline.push({\n event: transformedEvent,\n token: index === 0 ? data.timeline.prev_batch : null\n });\n });\n } // attempt to prune the timeline by jumping between events which have\n // pagination tokens.\n\n\n if (currentData._timeline.length > this.opts.maxTimelineEntries) {\n const startIndex = currentData._timeline.length - this.opts.maxTimelineEntries;\n\n for (let i = startIndex; i < currentData._timeline.length; i++) {\n if (currentData._timeline[i].token) {\n // keep all events after this, including this one\n currentData._timeline = currentData._timeline.slice(i, currentData._timeline.length);\n break;\n }\n }\n }\n }", "getAllFlights(from, to) {\n /* 1hr = 3600s 1day = 86400s */\n // Math.floor(new Date().getTime()/1000.0) getTime()\n const currentTimeInEpoch = Math.floor(Date.now()/1000);\n const begin = currentTimeInEpoch - (3600*24),\n end = begin + 3600;\n\n return fetch(this.getAllFlightsURL(begin,end))\n .then(response => response.json())\n .then(resp => {\n this.flights = resp;\n return resp;\n })\n .catch(error => console.error(error));\n }", "function getTimes() {\n\t\tvar ttimes = $(\"#ranging-time-wrap\").intervalWialon('get');\n\n\t\t// remove <br>\n\t\tvar tf = en_format_time.replace('<br>', ' ');\n\n\t\t// use timeZone:\n\t\tvar deltaTime = wialon.util.DateTime.getTimezoneOffset() + (new Date()).getTimezoneOffset() * 60;\n\t\tvar tfrom = ttimes[0] - deltaTime - wialon.util.DateTime.getDSTOffset(ttimes[0]);\n\t\tvar tto = ttimes[1] - deltaTime - wialon.util.DateTime.getDSTOffset(ttimes[1]);\n\t\tvar tnow = wialon.core.Session.getInstance().getServerTime() - deltaTime;\n\n\t\tvar df = $('#ranging-time-wrap').intervalWialon('__getData');\n\t\tdf = df.dateFormat || 'dd MMM yyyy';\n\n\t\tif (tto - tfrom < 86.4e3) {\n\t\t\ttto = tfrom;\n\t\t}\n\n\t\treturn [getTimeStr(tfrom, df), getTimeStr(tto, df), tnow, df];\n\t}", "function fixHours (roughHours) {\n var from = roughHours.indexOf(roughHours.match(\"From\"));\n \n var hr = roughHours.substr(from + 4, 3);\n hr = hr.replace(/:/g, '');\n hr = parseInt(hr);\n // console.log(hr);\n \n var startHour;\n \n var startTime = roughHours.substr(from + 4, 9);\n startTime = startTime.trim();\n // console.log(startTime);\n \n var m = startTime.substr(startTime.indexOf('M') - 1, 1);\n // console.log(m);\n \n // Convert start hour to military time\n if (m == 'A' && hr == 12) {\n startHour = 0;\n } else if (m == \"A\" && hr < 12) {\n startHour = parseInt(hr);\n } else if (m == \"P\" && hr == '12') {\n startHour = 12;\n } else if (m == \"P\" && hr < 12) {\n startHour = hr + 12;\n }\n // console.log(startHour);\n\n\n // Find meeting Type\n if (roughHours.indexOf('Type') != -1) {\n meetingType = roughHours.substr(roughHours.indexOf(roughHours.match(\"Type\")) + 5, 2).trim();\n } else {\n meetingType = '';\n }\n \n // Find meeting Special Interest\n if (roughHours.indexOf('Interest') != -1) {\n specialInterest = roughHours.substr(roughHours.indexOf(roughHours.match(\"Interest\")) + 9);\n } else {\n specialInterest = '';\n }\n \n // Find meeting Day\n day = roughHours.substr(0, from - 1);\n if (day == 'Sundays') {\n day = 'Sundays';\n dayNum = 0;\n } else if (day == 'Mondays') {\n day = 'Mondays';\n dayNum = 1;\n } else if (day == 'Tuesdays') {\n day = 'Tuesdays';\n dayNum = 2;\n } else if (day == 'Wednesdays') {\n day = 'Wednesdays';\n dayNum = 3;\n } else if (day == 'Thursdays') {\n day = 'Thursdays';\n dayNum = 4;\n } else if (day == 'Fridays') {\n day = 'Fridays';\n dayNum = 5;\n } else if (day == 'Saturdays') {\n day = 'Saturdays';\n dayNum = 6;\n }\n // console.log(dayNum);\n \n return {\n \"meetingDay\": day,\n \"meetingDayNum\": dayNum,\n \"meetingStartHour\": startHour,\n \"meetingStartTime\": startTime,\n \"meetingType\": meetingType,\n \"specialInterest\": specialInterest\n };\n}", "function processCurrentForecast (raw_current_data) {\r\n\r\n\tvar date = new Date();\r\n\r\n\tvar processed_data = concatenateObjects(raw_current_data.main, raw_current_data.weather[0]);\r\n\tprocessed_data.hour = date.getHours();\r\n\tprocessed_data.day_num = date.getDay();\r\n\tprocessed_data.temp = Math.round(processed_data.temp);\r\n\tprocessed_data.temp_max = Math.round(processed_data.temp_max);\r\n\tprocessed_data.temp_min = Math.round(processed_data.temp_min);\r\n\tprocessed_data.condition = getIDCondition(processed_data.id);\r\n\r\n\treturn processed_data;\r\n}", "function assignButler(data) {\n let maxHours = 8;\n let currentHours = 0;\n let requests = [];\n let newData = Object.assign([], data);\n for (let i = 0;\n (currentHours <= maxHours) && i < newData.length; i++) {\n const item = _.maxBy(data, \"hours\")\n if (item.hours <= maxHours) {\n currentHours += item.hours;\n requests.push(item.requestId);\n }\n\n // Removing the Allocated Resource Request\n var index = data.findIndex(function(element) {\n return element.hours === item.hours;\n })\n if (index !== -1) {\n data.splice(index, 1)\n }\n }\n return { data, requests };\n }", "getForecast(min, max){\n\t\tvar now = this.getTime() + 1;\n\t\tvar suffix =\"\";\n\t\tvar time = now;\n\t\tfor (var i=now; i<=now+12; i++){\n\t\t\ttime = i;\n\t\t\tif (i>=24){\n\t\t\t\ttime =i-24;\n\t\t\t}\n\t\t\tif (time<12){\n\t\t\t\tsuffix = \"AM\";\n\t\t\t} else {\n\t\t\t\tsuffix = \"PM\";\n\t\t\t}\n\t\t\tif (time===(this.getTime()+13)){\n\t\t\t\tthis.fetchData(time, suffix, \"\", min, max);\n\t\t\t} else {\n\t\t\t\tthis.fetchData(time, suffix, \"bottomBorder\", min, max);\n\t\t\t}\n\t\t}\n\t}", "function handlequery(data) {\n // send message that data load it started...\n io.sockets.emit(\"info\", \"<center>Loading...</center>\");\n // get time interval to query\n var fromTimestamp = data.fromTimestamp;\n var toTimestamp = data.toTimestamp;\n // log the query request\n console.log(\"Handling query from \" + fromTimestamp + \" to \" + toTimestamp);\n // check delivered interval\n if (toTimestamp < fromTimestamp) {\n var temp = fromTimestamp;\n fromTimestamp = toTimestamp;\n toTimestamp = temp;\n }\n var timeLen = toTimestamp - fromTimestamp;\n // check if interval is small enough to query\n if (timeLen > 12 * 60 * 60) {\n io.sockets.emit(\"info\", \"<center><strong>Time interval too large to query...</strong></center>\");\n return;\n }\n // fetch flm data from database\n var queryStr = \"SELECT * FROM flmdata WHERE timestamp >= '\" + fromTimestamp + \"' AND timestamp <= '\" + toTimestamp + \"';\";\n var query = db.all(queryStr, function(err, rows) {\n if (err) {\n db.close();\n throw err;\n }\n var series = {};\n for (var i in rows) {\n var sensorId = rows[i].sensor;\n if (sensors[sensorId] !== undefined) sensorId = sensors[sensorId].name;\n if (series[sensorId] === undefined) series[sensorId] = new Array();\n series[sensorId].push([ rows[i].timestamp * 1e3, rows[i].value ]);\n }\n // reduce the time series length through averages\n if (timeLen > 2 * 60 * 60) {\n for (var s in series) {\n var n = 0, avg = 0;\n var ser = new Array();\n for (var v in series[s]) {\n // series[s][v] delivers the single series [timestamp,value]\n n++;\n avg += parseInt(series[s][v][1]);\n tim = new Date(series[s][v][0]);\n if (tim.getSeconds() == 0) {\n avg = Math.round(avg / n);\n ser.push([ series[s][v][0], avg ]);\n avg = 0;\n n = 0;\n }\n }\n series[s] = ser;\n }\n }\n // send data to requester\n io.sockets.emit(\"series\", series);\n console.log(\"Queried series transmitted...\");\n });\n}", "function extrapolateTravelData(ticketsData, accountsData, homeAddress, resourceID, callback)\n{\n\tvar travelData = [] // An 2D array where each index has the travel data for a single day (travelData[0] is Monday's travel data, etc)\n\t\t \t\t\t\t\t\t\t\t\t\t //travelData[0][0] is the first trip on Monday\n\n\t// Variables that keep track of the information for a given day\n\t// In the case where we log 2 or more tickets in a row at a specific location, we want to make sure we know that there was no travel time between those tickets\n\t// Only log travel time when two successive tickets are logged at different schools\n\t// All the information we need to verify these things is stored in the travelData object, which generated as we iterate over each time entries\n\tvar lastToAddress = homeAddress\n\tvar lastArriveTime = -1\n\tvar lastTicketEndTime = -1\n\tvar lastFromName = \"Home\"\n\tvar lastAccountID = -1\n\tvar currentDay = undefined\n\n\tif (ticketsData.length > 0) // Initialize the day. We want to seperate travel time by which day it occurred\n\t{\n\t\tcurrentDay = new Date(ticketsData[0].StartDateTime).getDate()\n\t}\n\telse\n\t{\n\t\taddReturnLog(STATUS_ERR, \"No recent tickets have been found for you!\")\n\t\tcallback(undefined)\n\t\treturn\n\t}\n\n\t//log(\"Map\", j(contractIDToAccountIDMap)) // Currently cached data\n\tvar travelForDay = [] // Stores the information for a single day of travelling\n\tvar trip = {}\n\n\t// Iterate over every time entry (note: these are technically the TimeEntry Entity, as defined by the API, not tickets)\n\tfor (var i = 0; i < ticketsData.length; i++)\n\t{\n\t\tvar ticket = ticketsData[i]\n\t\tvar trip = {}\n\t\ttrip.resourceID = resourceID\n\t\t//log(\"Ticket\", j(ticket))\n\n\t\t// The ticketsData only has the ContractID associated with it in the API, so grab that conversion from the cache\n\t\t// The trip object will have to contain the accountID from both the school it left from and is heading to\n\t\tvar ticketAccountID = contractIDToAccountIDMap[ticket.ContractID]\n\n\t\tif (ticketAccountID == undefined) // If this happens, the error message may not be clearly reflecting the cause of the issue\n\t\t{\t\t\t\t // This value was just cached in the previous function so it should always be set\n\t\t\tconsole.log(\"Unknown ticket contract: \" + ticket.ContractID)\n\t\t\tcontinue\n\t\t}\n\n\t\tvar accountData = accountsData[ticketAccountID]\n\n\t\tvar accountAddress = getAccountAddress(accountData)\n\t\tvar accountName = accountData.AccountName\n\n\t\tif (accountAddress == lastToAddress)\n\t\t{\n\t\t\tlastTicketEndTime = ticket.EndDateTime\n\t\t\tcontinue // We entered multiple tickets in a row here. No driving needs to be logged\n\t\t}\n\n\t\tvar ticketDay = new Date(ticket.StartDateTime).getDate()\n\n\t\t// Log data for the new day\n\t\tif (ticketDay != currentDay)\n\t\t{\n\t\t\t//console.log(\"New day\")\n\n\t\t\t// Now that we have seen time entries from two different schools, update the \"to\" and \"from\" fully in the trip object\n\t\t\t// Then add it to the trips array\n\t\t\ttrip.fromAddress = lastToAddress\n\t\t\ttrip.toAddress = homeAddress\n\t\t\ttrip.leaveTime = lastTicketEndTime //new Date(ticket.EndDateTime) // convert to ms timestamp\n\t\t\ttrip.arriveTime = -1\n\t\t\ttrip.totalTimeHours = roundToNearest15(trip.leaveTime, trip.arriveTime)\n\t\t\ttrip.fromName = lastFromName\n\t\t\ttrip.toName = \"Home\"\n\t\t\ttrip.fromAccountID = lastAccountID\n\t\t\ttrip.toAccountID = -1\n\t\t\ttravelForDay.push(trip)\n\t\t\t//log(\"Trip1\", j(trip))\n\t\t\t//console.log(\"Tickets leaving: \" + j(trip))\n\n\t\t\t\n\t\t\t// Update our tracking data to reflect the start of the new day and go to the next time entry\n\t\t\tlastArriveTime = -1\n\t\t\tlastToAddress = homeAddress\n\t\t\tlastTicketEndTime = -1\n\t\t\tlastAccountID = -1\n\t\t\tlastFromName = \"Home\"\n\n\t\t\ttravelData.push(travelForDay)\n\t\t\ttravelForDay = []\n\n\t\t\tcurrentDay = ticketDay\n\n\t\t\ti--\n\t\t\n\t\t\tcontinue\n\t\t}\n\n\t\t// Log data when we are arriving at a new school\n\t\ttrip.fromAddress = lastToAddress\n\t\ttrip.toAddress = accountAddress\n\t\ttrip.leaveTime = lastTicketEndTime\n\t\ttrip.arriveTime = ticket.StartDateTime\n\t\ttrip.fromName = lastFromName\n\t\ttrip.toName = accountName\n\t\ttrip.totalTimeHours = roundToNearest15(trip.leaveTime, trip.arriveTime)\n\t\ttrip.fromAccountID = lastAccountID\n\t\ttrip.toAccountID = ticketAccountID\n\t\n\t\t// Update tracking data to reflect that we are at a new school\n\t\tlastToAddress = accountAddress\n\t\tlastTicketEndTime = ticket.EndDateTime\n\t\tlastAccountID = ticketAccountID\n\t\tlastFromName = accountName\n\n\t\t//log(\"Trip2\", j(trip))\n\n\t\ttravelForDay.push(trip)\n\t}\n\n\t// There will be no ticket to reflect time at home, so we have to manually add that trip, setting the toAddress to \"Home\" (along with other things)\n\tif (travelForDay.length > 0)\n\t{\n\t\ttripHome = {}\n\t\ttripHome.fromAddress = lastToAddress\n\t\ttripHome.toAddress = homeAddress\n\t\ttripHome.fromName = lastFromName\n\t\ttripHome.toName = \"Home\"\n\t\ttripHome.fromAccountID = lastAccountID\n\t\ttripHome.toAccountID = -1\n\t\ttripHome.leaveTime = lastTicketEndTime\n\t\ttripHome.arriveTime = -1\n\t\ttripHome.totalTimeHours = -1\n\n\t\ttravelForDay.push(tripHome)\n\t\ttravelData.push(travelForDay)\n\t}\n\n\t//return\n\tcallback(travelData)\n}", "function getTimes(data) {\n let results = [];\n\n for (let i = 0; i < data.hourly.length; i++) {\n\n results.push(convertTime(data.hourly[i].dt));\n }\n\n return results;\n}", "function processData(data, fromYear, toYear, fromMin, toMin) {\n return _.chain(data)\n .dataInYearRange(fromYear, toYear)\n .dataInMinuteRange(fromMin, toMin)\n .minutelyData().value();\n }", "function updateTimePast() {\n if(!serverObj){\n return;\n }\n var currentTime = new Date().getTime();\n\n for(var i = 0; i < serverObj.length;i++){\n var timePast = currentTime - serverObj[i].date;\n $(\".message_footer span\")[i].innerHTML = convertTime(timePast);\n }\n }", "function formatData(data) {\n\n\t\tvar trackable = [],\n\t\t\tformat = d3.time.format(\"%m/%d/%y\");\n\n\t\tdata.forEach(function(day) {\n\t\t\tif (parseFloat(day[\"#temporalFocus\"], 10) != 0) {\n\t\t\t\tm_row = {\n\t\t\t\t\t\"value\" : parseFloat(day[\"#temporalFocus\"], 10), \n\t\t\t\t\t\"key\" : \"trackable\", \n\t\t\t\t\t\"date\" : format.parse(day[\"date\"])\n\t\t\t\t}\n\t\t\t\ttrackable.push(m_row)\n\t\t\t}\n\t\t\t\t \n\t\t})\n\n\t\treturn trackable\n\n\t}", "function busTimeFilter(busData, nowObj){\n var busDataF = {}; // filtered result\n //console.log(nowObj.getHours() + \":\" + nowObj.getMinutes());\n\n if (DEBUG_SEND_DUMMY_DATA){\n return busTimeFilterDummyData();\n }\n\n Object.keys(busData).forEach(function(key) {\n var busTimes = busData[key];\n\n // for each bus time for this bus route\n var valF = [];\n for(let val of busTimes) {\n\n if (val.toLowerCase().includes('over') === false){ // if not 'service over'\n if (val.includes('min') === true){\n if (utilTime.getMinsFromString(val) >= 3){\n valF.push(val);\n }else{\n // pass\n }\n }else{\n //console.log(val);\n if (utilTime.isTimeWithinRange(val, nowObj, TIME_FILTER_MAX_DELAY) === true){\n valF.push(val);\n }else{\n // pass\n }\n }\n }else{\n // pass\n }\n }\n\n // get rid of duplicates\n if (valF.length > 0){\n var uniqueValF = [... new Set(valF)];\n // sort and convert to uniform units\n busDataF[key] = utilTime.sortTimeListAscending(nowObj, uniqueValF);\n }\n });\n\n return busDataF;\n}", "function processPayload(data) {\n var date = new Date(data.provider.timestamp * 1000),\n output = '';\n\n output += detectRoundAndMapEnd(data);\n\n if (output.length > 0) {\n output = '[' + date.getFullYear() + '-' +\n (date.getMonth() + 1) + '-' +\n date.getDate() + ' ' +\n date.getHours() + ':' +\n ('00' + date.getMinutes()).substr(-2) + '] ' +\n output;\n }\n\n return output;\n}", "function history(data){\n var close = []\n var tradingDay = []\n if(data.results == null){\n stock_symbol =\"Wrong Symbol\";\n stock_data = [];\n stock_labels = [];\n return;\n }\n var bound = data.results.length; \n\t//Want only a few values from the set of 253\n bound = bound / 23; \t\n var i = 0;\n for(j = 0; j < bound; j++){ \n close.push(data.results[j].close)\n tradingDay.push(data.results[j].tradingDay)\n i += 23;\n if(i > data.results.length)\n break;\n //quoteChart.data.datasets.data.push(data.results[j].high);\n //quoteChart.data.labels.push(data.results[j].tradingDay);\n }\n console.log(close);\n console.log(tradingDay);\n stock_data = close;\n stock_labels = tradingDay; \n}", "function updatehour() {\r\n var currenthour = moment().hours()\r\n $(\".time-block\").each(function () {\r\n //splitting the hour-11 id with the \"-\"\r\n //as the delimiter, and focusing on the\r\n //number (hour) based on its position \r\n //after transforming it into an array\r\n var blockhour = parseInt($(this).attr(\"id\").split(\"-\")[1]);\r\n if (blockhour < currenthour) {\r\n //turn it grey\r\n $(this).addClass(\"past\")\r\n } else if (blockhour === currenthour) {\r\n //remove the grey and apply red\r\n $(this).removeClass(\"past\")\r\n $(this).addClass(\"present\")\r\n } else {\r\n //remove the grey and red, apply the green\r\n $(this).removeClass(\"past\")\r\n $(this).removeClass(\"present\")\r\n $(this).addClass(\"future\")\r\n }\r\n })\r\n\r\n }", "function catturaData() {\n var d = new Date();\n var ora = d.getHours();\n var minuti = d.getMinutes();\n return addZero(ora) + ':' + addZero(minuti);\n }", "function addInTimes(rts){\n let endRoutes = rts.map((rt,i)=>{\n let newStops = rt.stops.map((stop,j)=>{\n stop.bus_times_week = getTimes(i,j,'bus_times_week');\n stop.bus_times_sat = getTimes(i,j,'bus_times_sat');\n stop.bus_times_sun = getTimes(i,j,'bus_times_sun');\n return stop;\n })\n return newStops;\n })\n rts.stops = endRoutes\n return rts\n}", "function getTimeTable(orari){\n var tab = orari.split(\"/\");\n //var m = 0;\n var result = \"\";\n var time = 8;\n var timeup= 9;\n for(var i = 0; i < 15; i++){\n result = result + \"<tr><td class='hours'>\" + time + \".00-\" + timeup + \".00</td>\";\n time = (time + 1)%12;\n timeup = (timeup + 1) %12;\n if(time==0){\n time = 12;\n }\n if(timeup == 0){\n timeup = 12;\n }\n for(var j = 0; j < 7; j++){\n if(isIn(i,j,tab)/*j == parseInt(tab[m]/100) && i == tab[m]%100*/){\n result = result + \"<td class='selectedtimeslot'</td>\";\n //console.log(\"normal \" + (j*100 + i ));\n //m++;\n }else{\n result = result + \"<td></td>\";\n //console.log(\"normal \" + (j*100 + i ));\n }\n \n }\n result = result + \"</tr>\";\n }\n return (result);\n}", "function updateWeatherInfo(data) {\n\n $(\".today-grid, .tomorrow, .later\").empty();\n\n currently(data.currently);\n hourly(data.hourly);\n later(data.daily);\n\n skycons(App.icons);\n\n }", "function past(h, m, s){\n/*return h times 3600000 plus m times 60000 plus s times\n1000*/\n\treturn h * 3600000 + m * 60000 + s * 1000;\n}", "function processData() {\n var stations = dataHolder['noaa-mi3-station-data-mn-trimmed'];\n var data = dataHolder['broken_temperature_record_from_pbs-2012-mn'];\n \n // Function to get coordinates\n function getStation(name, stations) {\n var j;\n for (j in stations) {\n if (stations[j].station_name == name) {\n return stations[j];\n }\n }\n return {};\n }\n \n // Sort by date\n data.sort(function(m1, p1) {\n var m = ('' + m1.record_date).toLowerCase();\n var p = ('' + p1.record_date).toLowerCase();\n\n if (m > p) {\n return 1;\n }\n else if (m < p) {\n return -1;\n }\n else {\n return 0;\n }\n });\n\n // Group by date\n var grouping = {};\n var maxIncrease = 0;\n var maxIncreaseData = {};\n for (var i in data) {\n if (data[i].record_date) {\n var thisDate = Date.parse(data[i].record_date);\n var previousDate = Date.parse(data[i].previous_record_date);\n if (typeof grouping[data[i].record_date] == 'undefined') {\n grouping[data[i].record_date] = {};\n }\n grouping[data[i].record_date].date = thisDate;\n grouping[data[i].record_date].date_formatted = thisDate.toString(\"MMM d\");\n grouping[data[i].record_date].date_object = thisDate;\n \n // Add places\n var station = getStation(data[i].station_name, stations);\n var diff = ((data[i].record - data[i].previous_record) / data[i].previous_record) + 0.01;\n grouping[data[i].record_date].places = grouping[data[i].record_date].places || [];\n var place = {\n name: data[i].station_name.toLowerCase().capitalize().replace('Ap', 'Airport'),\n lat: station.lat,\n lon: station.lon,\n record: data[i].record,\n previous_record: data[i].previous_record,\n previous_record_date: previousDate,\n difference: diff,\n date: thisDate\n };\n grouping[data[i].record_date].places.push(place);\n \n // Check max increase\n if (diff > maxIncrease) {\n maxIncrease = diff;\n maxIncreaseData = place;\n }\n }\n }\n \n // Make map // \"https://{s}.tiles.mapbox.com/v3/mapbox.mapbox-light/{z}/{x}/{y}.png\"\n var tiles = new L.TileLayer(\"https://{s}.tiles.mapbox.com/v3/minnpost.map-wi88b700/{z}/{x}/{y}.png\", {\n attribution: \"Map imagery from <a href=https://mapbox.com'>Mapbox</a>\", \n subdomains: [\"a\", \"b\", \"c\", \"d\"],\n maxZoom: 8,\n minZoom: 4\n });\n \n var map = new L.Map('temperature-map', {\n center: new L.LatLng(46.479553, -93.98589980000002),\n zoom: 7,\n layers: [tiles]\n });\n \n // Create marker layers\n var circleOptions = {\n color: '#801019',\n fillColor: '#801019',\n fillOpacity: 0.7,\n stroke: false\n };\n \n // Template for popup\n var makeLayerData = function(group) {\n var output = '';\n output += '<h3>' + group.date_object.toString('MMM d, yyyy') + '</h3>';\n output += '<ul>';\n \n _.each(group.places, function(p, t) {\n output += '<li>' + group.places[t].name + ': <br> <strong>' + group.places[t].record + ' &deg;F</strong> &nbsp;&nbsp;(' + group.places[t].previous_record + ' &deg;F in ' + group.places[t].previous_record_date.toString('yyyy') + ')</li>';\n });\n output += '</ul>';\n return output;\n };\n \n // Template for group\n var makePopup = function(place, date) {\n var output = '';\n output += '<div class=\"popup-heading\">' + place.name + '</div>';\n output += '<div class=\"popup-date\">Date: <strong>' + date.toString('MMM d, yyyy') + '</strong></div>';\n output += '<div class=\"popup-new-record\">New record: <strong>' + place.record + ' &deg;F</strong></div>';\n output += '<div class=\"popup-previous-record\">Previous record: <strong>' + place.previous_record + ' &deg;F</strong> on <strong>' + place.previous_record_date.toString('yyyy') + '</strong></div>';\n return output;\n };\n\n // Create layer sets\n var overlayMaps = {};\n var groupIndex = [];\n \n _.each(grouping, function(group, g) {\n var layerGroup = new L.LayerGroup();\n groupIndex.push(g);\n \n // Make points\n _.each(grouping[g].places, function(place, p) {\n var ratio = grouping[g].places[p].difference / maxIncrease;\n var radius = 10000 + (ratio * 30000);\n var circle = new L.Circle(new L.LatLng(grouping[g].places[p].lat, grouping[g].places[p].lon), radius, circleOptions);\n circle.bindPopup(makePopup(grouping[g].places[p], grouping[g].date_object));\n layerGroup.addLayer(circle);\n });\n \n map.addLayer(layerGroup);\n overlayMaps[grouping[g].date_formatted + ' (' + grouping[g].places.length + ')'] = layerGroup;\n });\n\n // Add switcher. \n var dateIndex = groupIndex.length - 1;\n var layersControl = new L.Control.Layers(overlayMaps, {});\n map.addControl(layersControl);\n \n // DOM magic.\n $('.js-dependent').show();\n \n // Take over the layer control\n $('#temperature-map-layers').append(layersControl._form);\n $('#temperature-map .leaflet-control-layers').hide();\n $('.leaflet-control-layers-list label input').css('visibility', 'hidden');\n \n // Index layer with groups\n $('.leaflet-control-layers-list label').each(function(index, value) {\n $(this).data('tMapGroup', groupIndex[index]);\n $(this).find('input').prop('checked', false);\n });\n \n // Handle layer clicking\n $('.leaflet-control-layers-list label').click(function(e) {\n map.closePopup();\n $('.leaflet-control-layers-list label').removeClass('layer-selector-selected')\n .not(this).find('input').prop('checked', false);\n \n $(this).addClass('layer-selector-selected');\n $(this).find('input').prop('checked', true);\n \n // Update layer data\n $('.temperature-map-layer-data-container').html(makeLayerData(grouping[$(this).data('tMapGroup')]));\n dateIndex = $(this).index();\n });\n \n // Show latest entry\n $('.leaflet-control-layers-list label:last, .leaflet-control-layers-list label:last input').click();\n \n // Player (we start on the newest entry)\n var datePlayerNext = function() {\n dateIndex = (dateIndex >= groupIndex.length - 1) ? 0 : dateIndex + 1;\n if (dateIndex == groupIndex.length - 1) {\n timer.stop();\n }\n $('.leaflet-control-layers-list label:eq(' + (dateIndex) + ') input').click();\n };\n var datePlayerPrev = function() {\n dateIndex = (dateIndex <= 0) ? groupIndex.length -1 : dateIndex - 1;\n $('.leaflet-control-layers-list label:eq(' + (dateIndex) + ') input').click();\n };\n \n var timer = $.timer(datePlayerNext);\n timer.set({ time : 1500 });\n \n $('.player-pause').hide();\n $('.player-prev').click(function(e) {\n e.preventDefault();\n datePlayerPrev();\n });\n $('.player-play').click(function(e) {\n e.preventDefault();\n dateIndex = -1;\n timer.play(true);\n datePlayerNext();\n $('.player-pause').show();\n $(this).hide();\n });\n $('.player-pause').click(function(e) {\n e.preventDefault();\n timer.pause();\n $('.player-play').show();\n $(this).hide();\n });\n $('.player-stop').click(function(e) {\n e.preventDefault();\n timer.stop();\n $('.player-play').show();\n $('.player-pause').hide();\n });\n $('.player-next').click(function(e) {\n e.preventDefault();\n datePlayerNext();\n });\n \n // Aggregate stats\n $('#temperature-map-stats').html('So far, <strong>' + data.length + '</strong> temperature records at Minnesota\\'s major airports have been broken in 2012.');\n //$('#temperature-map-stats').html('So far, <strong>' + data.length + '</strong> temperature records at Minnesota\\'s major airports have been broken in 2012. The largest record change happened at ' + maxIncreaseData.name + ' on ' + maxIncreaseData.date.toString('MMM d, yyyy') + ', when the old record of ' + maxIncreaseData.previous_record + ' &deg;F in ' + maxIncreaseData.previous_record_date.toString('yyyy') + ' increased by <strong>' + (maxIncreaseData.difference * 100 + 100).toFixed() + '%</strong> to ' + maxIncreaseData.record + ' &deg;F.');\n }", "function timeIncrements() {\n const quantity = 10;\n const granularity = 5;\n let data = [];\n var i = 0;\n for (i; i <= quantity; i++) {\n let minutes = i * granularity;\n data.push({ id: `${i}`, value: minutes + ' minutes' })\n }\n return data;\n }", "function pullStorage() {\n // for each hour block\n for (var i=9; i<18; i++) {\n // slight adjustment for 1pm-5pm cases\n if (i > 12) {\n j = i-12;\n $(`#hour-${j}`).val(dailyTasks[`hour-${j}`]);\n }\n // regular 12 hour time\n else {\n $(`#hour-${i}`).val(dailyTasks[`hour-${i}`]);\n }\n }\n}", "function hourly(hour) {\n\n for (let i = 1; i < (48 - convertTimeStamp(App.weatherForecast.currently.time).time.slice(0, 2)); i++) {\n\n let hourlyData = {\n temperature: \"Temperature: \" + convertTemperature(hour.data[i].temperature),\n description: hour.data[i].summary,\n wind: \"Wind: \" + hour.data[i].windSpeed + \" m/s\",\n pressure: \"Pressure: \" + hour.data[i].pressure + \" hPa\",\n humidity: \"Humidity: \" + (hour.data[i].humidity * 100).toFixed(0) + \"%\",\n date: convertTimeStamp(hour.data[i].time).fullDate,\n time: convertTimeStamp(hour.data[i].time).time,\n currentDay: convertTimeStamp(hour.data[i].time).currentDay,\n icon: hour.data[i].icon\n };\n\n App.icons.push(hourlyData.icon);\n\n let currentDay = convertTimeStamp(App.weatherForecast.currently.time).fullDate.slice(0, 2);\n\n let tab = (parseInt(currentDay) == hourlyData.date.slice(0, 2)) ? \".today-grid\" : \".tomorrow\";\n\n updateDom(hourlyData, tab);\n }\n }", "function sortByTime() {\n for (let i = 0; i < sortedData.length; i++) {\n var x = sortedData[i].time;\n \n if (x < 12) {\n sortedByTime.push(sortedData[i]);\n \n } \n }\n }", "function setdata(data) {\n const date = ['SUN', 'MON', 'TUE', 'WED', 'THU', 'FRI', 'SAT'];\n document.getElementById('about').innerHTML = data.currently.summary;\n myicon.set(document.querySelector('.img'), data.currently.icon);\n document.getElementById('location').innerHTML = data.timezone;\n document.getElementById('temperature').innerHTML = data.currently.temperature + \"˚\";\n document.getElementById('humidity').innerHTML = data.currently.humidity + \"%\";\n document.getElementById('wind').innerHTML = data.currently.windSpeed + \"mph\";\n document.getElementById('uvindex').innerHTML = data.currently.uvIndex;\n for (let i = 0, j = new Date().getDay(); i < 5; i++) {\n j = (j + 1) % 7;\n let arr = [];\n let d = '';\n document.querySelectorAll('#day')[i].innerHTML = date[j];\n icon.set(document.querySelectorAll('#skyconicon')[i], data.daily.data[i].icon);\n document.querySelectorAll('#dailytemp')[i].innerHTML = round((data.daily.data[i].temperatureHigh + data.daily.data[i].temperatureLow) / 2, 1) + \"˚\";\n arr = data.daily.data[i].icon.split('-');\n for (let k = 0; k < arr.length; k++) { if (arr[k] != 'partly') d = d + \" \" + arr[k]; }\n document.querySelectorAll('#status')[i].innerHTML = d.slice(1);\n \n }\n icon.play();\n}", "function StoreToBuffer(currentBuff,Buff,Timestamp){\r\n for(var i=0;i<seriesCount;i++){\r\n if((Buff[i].length)>dataLimit){\r\n Buff[i].shift();\r\n Buff[i][dataLimit] = currentBuff[i][0];\r\n Timestamp[i].shift();\r\n Timestamp[i][dataLimit] = String(moment().format('hh:mm:ss'));\r\n }\r\n else{\r\n Buff[i][Buff[i].length] = currentBuff[i][0];\r\n Timestamp[i][Timestamp[i].length] = String(moment().format('hh:mm:ss'));\r\n }\r\n }\r\n return [Buff,Timestamp];\r\n}", "function formatTime(start_time, end_time) {\n var startH = Number(start_time.hour);\n var startM = Number(start_time.minute);\n var endH = Number(end_time.hour);\n var endM = Number(end_time.minute);\n var index = (endH * 60 + endM - startH * 60 - startM) / 30;\n //invalid input\n if (index <= 0) {\n //alert(\"Invalid time interval\");\n return {\n query_time: [],\n errorValue: \"Invalid time interval\"\n };\n }\n\n var query_time = [];\n //get the query time from the time interval\n for (var i = 0; i <= index; i++) {\n var newH = startH + parseInt((startM + i * 30) / 60);\n var newM = (startM + i * 30) % 60;\n var sM = \"\";\n if (newM == 0) {\n sM = \"00\";\n } else {\n sM = newM.toString();\n }\n query_time[i] = \"T\" + newH + \"_\" + sM;\n }\n return {\n query_time: query_time\n };\n}", "function populateCommuteTimes(googleCommuteData, inputData){\n\n _.each(inputData.categoryListings, function(categoryListing, listIndex){\n\n // this is value in seconds.. divide by 60 to get minutes\n var commuteTime1 = googleCommuteData.rows[0].elements[listIndex].duration.value;\n var commuteTime2 = googleCommuteData.rows[1].elements[listIndex].duration.value;\n\n categoryListing.timeFromAddress1 = Math.round(commuteTime1/60);\n categoryListing.timeFromAddress2 = Math.round(commuteTime2/60);\n\n });\n}", "buildFromLocal() {\n //grab data\n const localParsed = JSON.parse(window.localStorage.getItem('myDay'));\n // turn props back into functions/objects.\n this.dateCreated = moment(localParsed.dateCreated);\n this.startTime = moment(localParsed.startTime);\n this.endTime = moment(localParsed.endTime)\n this.timeSlotDuration = localParsed.timeSlotDuration;\n this.totalTimeSlots = localParsed.totalTimeSlots;\n\n for (var i = 0; i < this.totalTimeSlots; i++) {\n // add blank object\n this.data.push({})\n // populate object\n this.data[i] = {\n description: localParsed.data[i].description,\n slotStart: moment(localParsed.data[i].slotStart),\n slotEnd: moment(localParsed.data[i].slotStart),\n slotDuration: this.timeSlotDuration,\n get viewState() {\n let timeDiff = (() => moment().diff(this.slotStart, 'm'))()\n if (timeDiff < 0) return 'future';\n else if (timeDiff >= 0 && timeDiff < 60) return 'present';\n else return 'past';\n }\n }\n }\n }", "get to() { return this.from + this.length; }", "renderHours(currentDate, blocks, buffer) {\n var hours = [];\n var hourHeight = 95 / (this.state.end - this.state.start) + \"%\";\n \n\n for(let i = this.state.start; i < this.state.end; i++) {\n let toDisplay = (i > 11 ? (i === 12 ? 12 : i % 12) + \"PM\" : i + \"AM\");\n let toPass = i;\n\n //here we do the logic to figure out if it is busy or not\n let hourStyle = {\n 'height':hourHeight\n }\n let hourClass = \"calendar-hour\";\n /*\n * If the hour falls in a block we make it blue\n * IF it is an overnight event we currently will not deal with it, it will just go to the end of the current day\n */\n\n for(let j = 0; j < blocks.length; j++) {\n let overnight = false;\n //console.log(blocks[j]);\n if(blocks[j].finish.format(\"D\") > currentDate.format(\"D\")) {\n var newBlock = {\n start: moment().set({'day':currentDate.get('day') + 1,\n 'hour':1}),\n finish: blocks[j].finish\n }\n buffer.push(newBlock);\n overnight = true;\n } \n \n if(i >= blocks[j].start.format(\"H\") &&\n (i <= blocks[j].finish.format(\"H\") || overnight)) {\n hourClass = \"calendar-busy\";\n }\n }\n let toSend = currentDate.clone();\n toSend = toSend.set({'hour':toPass, 'minute':0, 'seconds':0});\n hours.push(\n <div key={currentDate.format('dddd') + i} style={hourStyle} className={hourClass} onClick={((e) => this.handleClick(e, toSend))}>\n { toDisplay }\n\n </div>\n );\n }\n return hours;\n }", "function currentTime(){\n var currentTime = moment().hours();\n\n // time loop \n $(\".stack\").each(function() {\n var pastHr = parseInt($(this).data(\"time\"));\n\n if (pastHr < currentTime) {\n $(this).addClass(\"past\");\n } else if (pastHr === currentTime) {\n $(this).removeClass(\"past\");\n $(this).addClass(\"present\");\n }else {\n $(this).removeClass(\"past\");\n $(this).removeClass(\"present\");\n $(this).addClass(\"future\");\n }\n });\n }", "function ConvertToRangesOfHours()\n{\n\tfor(var i= 0;i<43;i++)\n\t{\n\t\tvar string = String.format(colOfTime[i]+\"-\"+colOfTime[i+1]);\n\t\trangeOfTime.push(string);\n\t}\n}", "async function formatTodayEvent() {\n // let now = new Date();\n // let year = now.getFullYear();\n // let month = now.getMonth() + 1;\n // let day = now.getDate();\n\n // let hour = now.getHours();\n // let minute = now.getMinutes();\n\n // let mon = month < 10 ? `0${month}` : month;\n // let d = day < 10 ? `0${day}` : day;\n // let h = hour < 10 ? `0${hour}` : hour;\n // let min = minute < 10 ? `0${minute}` : minute;\n\n // $('#fromDateTime').val(`${year}-${mon}-${d} 00:00`);\n // $('#toDateTime').val(`${year}-${mon}-${d} ${h}:${min}`);\n\n let GuardID = 0;\n let fromDate = null;\n let toDate = null;\n let sentData = { GuardID, fromDate, toDate };\n let data = await Service.getEventHistoryData(sentData);\n if (data) renderEventHistoryTable(data);\n}", "function checkschedule(x, y) {\n\n if(workerid > 0) {\n for(var u=0;u<waiterschedulelength;u++) {\n\n if(x.getDate() < 10) {\n onlDay = '0' + x.getDate();\n } else {\n onlDay = x.getDate();\n }\n if(x.getMonth() < 9) {\n onlMonth = '0' + (x.getMonth() + 1);\n } else {\n onlMonth = x.getMonth() + 1;\n }\n var pushday1 = days[x.getDay()];\n\n if(waiterschedule[u].schedule_employee == workerid && Math.round(x.getTime()/1000) <= timezoneAdd(waiterschedule[u].schedule_start) && Math.round(y.getTime()/1000) > timezoneAdd(waiterschedule[u].schedule_stop) && waiterschedule[u].schedule_when > 1) {\n\n // console.log(waiterschedule[u].schedule_id + ' | ' + waiterschedule[u].schedule_employee + ' = ' + workerid + ' | ' + x + ' <= ' + new Date(timezoneAdd(waiterschedule[u].schedule_start)) + ' | ' + y + ' > ' + new Date(timezoneAdd(waiterschedule[u].schedule_stop)) + ' | ' + new Date(waiterschedule[u].schedule_when*1000))\n\n var pushitem = {'workdayname': pushday1, 'workday': onlDay, 'workmonth': onlMonth, 'workyear': x.getFullYear(), 'items': []};\n\n // console.log(JSON.stringify(pushitem))\n \n between.push(pushitem);\n \n }\n\n }\n }\n else if(workerid == 0) {\n\n var currentworker = 0;\n for(var u=0;u<waiterschedulelength;u++) {\n\n if(x.getDate() < 10) {\n onlDay = '0' + x.getDate();\n } else {\n onlDay = x.getDate();\n }\n if(x.getMonth() < 9) {\n onlMonth = '0' + (x.getMonth() + 1);\n } else {\n onlMonth = x.getMonth() + 1;\n }\n var pushday1 = days[x.getDay()];\n\n if(currentworker == 0 && Math.round(x.getTime()/1000) <= timezoneAdd(waiterschedule[u].schedule_start) && Math.round(y.getTime()/1000) >= timezoneAdd(waiterschedule[u].schedule_stop) && waiterschedule[u].schedule_when > 1) {\n\n currentworker = waiterschedule[u].schedule_employee;\n\n var pushitem = {'workdayname': pushday1, 'workday': onlDay, 'workmonth': onlMonth, 'workyear': x.getFullYear(), 'items': []};\n \n between.push(pushitem);\n\n }\n\n }\n\n }\n\n }", "function currentTime() {\n // console.log(currentHour, calendarHour.indexOf(currentHour),calendarHour.indexOf(\"09\"))\n\n if (currentHour === \"09\") {\n $(\"#09\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"09\") < calendarHour.indexOf(currentHour)) {\n $(\"#09\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#09\").addClass(\"future\");\n\n }\n\n if (currentHour === \"10\") {\n $(\"#10\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"10\") < calendarHour.indexOf(currentHour)) {\n $(\"#10\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#10\").addClass(\"future\");\n\n }\n \n if (currentHour === \"11\") {\n $(\"#11\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"11\") < calendarHour.indexOf(currentHour)) {\n $(\"#11\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#11\").addClass(\"future\");\n\n }\n\n if (currentHour === \"12\") {\n $(\"#12\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"12\") < calendarHour.indexOf(currentHour)) {\n $(\"#12\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#12\").addClass(\"future\");\n\n }\n\n if (currentHour === \"01\") {\n $(\"#01\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"01\") < calendarHour.indexOf(currentHour)) {\n $(\"#01\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#01\").addClass(\"future\");\n\n }\n\n if (currentHour === \"02\") {\n $(\"#02\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"02\") < calendarHour.indexOf(currentHour)) {\n $(\"#02\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#02\").addClass(\"future\");\n\n }\n\n if (currentHour === \"03\") {\n $(\"#03\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"03\") < calendarHour.indexOf(currentHour)) {\n $(\"#03\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#03\").addClass(\"future\");\n\n }\n\n if (currentHour === \"04\") {\n $(\"#04\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"04\") < calendarHour.indexOf(currentHour)) {\n $(\"#04\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#04\").addClass(\"future\");\n\n }\n\n if (currentHour === \"05\") {\n $(\"#05\").removeClass(\"future\").addClass(\"present\");\n } \n \n else if (calendarHour.indexOf(\"05\") < calendarHour.indexOf(currentHour)) {\n $(\"#05\").removeClass(\"present\").addClass(\"past\");\n }\n\n else {\n $(\"#05\").addClass(\"future\");\n\n }\n\n \n }" ]
[ "0.645218", "0.6056108", "0.5870095", "0.58694327", "0.5809828", "0.56978", "0.5636531", "0.5636531", "0.5540302", "0.5517433", "0.55127144", "0.5452314", "0.544941", "0.5445816", "0.54395735", "0.5438016", "0.53598696", "0.53370005", "0.5328558", "0.5306034", "0.5274006", "0.5266664", "0.526481", "0.5259784", "0.52560306", "0.52285504", "0.5208728", "0.5189577", "0.51694727", "0.51676875", "0.5162003", "0.51597905", "0.5154151", "0.51437104", "0.5137816", "0.5133187", "0.513307", "0.5124556", "0.51214135", "0.5116168", "0.51085925", "0.5108015", "0.50977725", "0.508798", "0.5082341", "0.5078598", "0.5076372", "0.5072866", "0.50716347", "0.5068397", "0.5059583", "0.50579214", "0.5057095", "0.5056301", "0.5055988", "0.5053575", "0.5044864", "0.50447714", "0.5037493", "0.5031205", "0.50184166", "0.5013526", "0.5011051", "0.50088614", "0.50057167", "0.50037307", "0.50028676", "0.49899825", "0.49881676", "0.49862427", "0.49813348", "0.49764323", "0.49708664", "0.49649793", "0.49633592", "0.4959501", "0.49549246", "0.4951561", "0.49434263", "0.49433517", "0.4942264", "0.49416578", "0.49412724", "0.49389082", "0.4934104", "0.49303672", "0.49257758", "0.49179524", "0.49166474", "0.4911474", "0.4907203", "0.49047834", "0.49036258", "0.4903041", "0.49019223", "0.48992926", "0.48985672", "0.48982975", "0.48960343", "0.4895019" ]
0.72138286
0
Display phrase on game board
addPhraseToDisplay() { const ul = document.querySelector('#phrase ul'); const letter = this.phrase.split(""); console.log(letter); for (let i = 0; i < letter.length; i += 1) { if (letter[i] !== " ") { const li = document.createElement('li'); li.textContent = letter[i]; li.classList.add('letter'); ul.appendChild(li); } else { const li = document.createElement('li'); li.classList.add('space'); ul.appendChild(li); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addPhraseToDisplay(){\r\n this.setupLetterToBeDisplayed()\r\n }", "function drawboard(location, word) {\n for (var i = 0; i < word.length; i++) {\n context.fillText('_ ', (location[0] + i * 20), location[1]);\n }\n }", "function updateDisplay(wordArray, midGame) {\n // let wordJoin = wordArray.join(\" \");\n document.getElementById(\"guess-word\").innerHTML = wordArray.join(\" \");\n if (midGame !== undefined) {\n document.getElementById(\"letters-guessed\").innerHTML = \"Letters guessed: \" + midGame.join(\", \");\n document.getElementById(\"guess-remain\").innerHTML = \"Guesses left: \" + parseInt(numGuesses - midGame.length);\n document.getElementById(\"hangman-graphic\").innerHTML = hangdood[midGame.length];\n }\n else {\n document.getElementById(\"letters-guessed\").innerHTML = \"Letters guessed: \";\n document.getElementById(\"guess-remain\").innerHTML = \"Guesses left: \" + numGuesses;\n }\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 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 }", "addTexts(){\n var startingMessage = (game.singleplayer || game.vsAi) ? \"Current Turn: X\" : \"Searching for Opponent\"\n\n game.turnStatusText = game.add.text(\n game.world.centerX, 50, startingMessage,\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.turnStatusText.anchor.setTo(0.5, 0.5)\n game.turnStatusText.key = 'text'\n\n game.playerPieceText = game.add.text(\n game.world.centerX, 600-50, '',\n { font: '50px Arial', fill: '#ffffff' }\n )\n //setting anchor centers the text on its x, y coordinates\n game.playerPieceText .anchor.setTo(0.5, 0.5)\n game.playerPieceText.key = 'text'\n\n\n\n }", "drawSecretWord() {\n ctx.clearRect(0,canvas.height-40,canvas.width,40)\n GAME.secretWord.includes(PLAYER.guess) ? PLAYER.guessStatus = true : PLAYER.guessStatus = false\n for (let i = 0; i < GAME.secretWord.length; i++) {\n const element = GAME.secretWord[i];\n if(str_replace(from,to,element) === PLAYER.guess) {\n PLAYER.guessStatus = true\n GAME.answerArray[i] = element\n }\n let x = (canvas.width - ((GAME.secretWord.length * 24) + ((GAME.secretWord.length - 1) * 4))) + (i * (24 + 4))\n ctx.beginPath()\n ctx.font = \"32px calibri\"\n ctx.fillText(GAME.answerArray[i], x, canvas.height - 6)\n ctx.closePath()\n }\n }", "function Display(){\n document.getElementById(\"wins\").textContent = countWins;\n document.getElementById(\"dispWord\").textContent = dispWord;\n document.getElementById(\"guessesLeft\").textContent = 12 - countGuesses;\n document.getElementById(\"lettersGuessed\").textContent = lettersGuessed;\n console.log(\"Random word is: \" + guessWord);\n}", "displayText(combatStage, index) {\n let paragraph = this.state.paragraph; \n let lines = this.state.lines;\n lines++;\n this.howManylines++;\n let key = \"line\"+this.howManylines;\n let string = \"\";\n let verbAgreement = \"\";\n\n if (lines > 5) {\n // scrollText() or\n paragraph.shift();\n lines--;\n }\n paragraph.push(<p></p>)\n \n switch(combatStage) {\n case \"start\": \n let subject = this.state.playerPhase ? \"You\" : \"The bandit\";\n verbAgreement = this.state.playerPhase ? \"\" : \"s\";\n string = `${subject} attack${verbAgreement}!`;\n break;\n case \"damage\":\n let verb = this.state.playerPhase ? \"inflicted\" : \"received\";\n let damage = this.state.playerPhase ? \n (this.state.player.attack - map[this.state.bandits[index].map[0]-1][this.state.bandits[index].map[1]-1].defense) : \n (this.state.bandits[index].attack - map[this.state.playerMap[0]-1][this.state.playerMap[1]-1].defense);\n string = `You ${verb} ${damage} damage!`;\n if (this.targetVillager) { string = `She receives ${damage} damage!`}\n break;\n case \"dead\":\n let target = this.state.playerPhase ? \"The bandit\" : \"You\";\n verbAgreement = this.state.playerPhase ? \"has\" : \"have\";\n let gameOver = this.state.playerPhase ? \"\" : \" Game over.\"\n string = `${target} ${verbAgreement} been defeated.${gameOver}`;\n if (this.targetVillager) { string = \"The villager has been killed.\" }\n break;\n case \"exp\":\n string = \"You have gained 10 experience.\";\n break;\n case \"next\":\n let toNext = this.expForLevel.find((element) => element >= this.state.player.exp) - this.state.player.exp;\n if (toNext === 0) {\n string = \"You have advanced to the next level.\"\n } else {\n string = `You need ${toNext} experience to advance.`;\n }\n break;\n case \"heal\":\n string = \"Your HP are restored to maximum.\"\n break;\n default:\n string = \"Something went wrong.\"\n break;\n };\n\n let t = 0;\n let framesPerTick = 2;\n const letterRoll = (timestamp) => {\n if (t <= string.length * framesPerTick) {\n if (t % framesPerTick === 0) {\n paragraph[lines-1] = <p key={key}>{string.substring(0, t/framesPerTick)}</p>;\n this.setState({ lines: lines, paragraph: paragraph });\n }\n t++;\n requestAnimationFrame(letterRoll);\n } else {\n if (combatStage === \"start\") {\n this.displayText(\"damage\", index);\n } else if (combatStage === \"dead\" && this.state.playerPhase) {\n this.displayText(\"exp\", index);\n } else if (combatStage === \"exp\") {\n this.displayText(\"next\");\n }\n }\n };\n\n requestAnimationFrame(letterRoll);\n }", "function handleText() {\n if (index < text.length) {\n id(\"output\").innerText = \"\";\n let curWord = text[index];\n id(\"output\").innerText = curWord;\n index++;\n } else {\n endGame();\n }\n }", "function displayLetters(guess){\n\t\tfor (var i=0;i<randomWord.length;i++){\n\t\t\tif (guess == randomWord[i]){\n\t\t\t\t$(\"#\"+randomWord[i]).html(guess);\n\t\t\t\tcounter += 1;\n\t\t\tif (counter == randomWord.length){\n\t\t\t\tdisplayImage();\n\t\t\t\tdisplayWins();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "function currentWordDisplay() {\n var activeCharacterDisplay = document.querySelector(\"#activeCharacterDisplay\");\n activeCharacterDisplay.textContent = answerArray.join(\" \");\n}", "function DisplayWord() {\n\tvar wordToPrint : String;\n\tvar hWord : GameObject;\n\t//var offset : float;\n\tswitch(this.kana) {\n\t\tcase \"a\":\n\t\t\twordToPrint = \"あ り\";\n\t\tbreak;\n\t\t\n\t\tcase \"i\":\n\t\t\twordToPrint = \"い な ず ま\";\n\t\tbreak;\n\t\t\n\t\tcase \"u\":\n\t\t\twordToPrint = \"う さ ぎ\";\n\t\tbreak;\n\t\t\t\t\t\n\t\tcase \"e\":\n\t\t\twordToPrint = \"え ん\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"o\":\n\t\t\twordToPrint = \"お す\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ka\":\n\t\t\twordToPrint = \"か た な\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ki\":\n\t\t\twordToPrint = \"き り か ぶ\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ku\":\n\t\t\twordToPrint = \"く さ り\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ke\":\n\t\t\twordToPrint = \"け る\";\n\t\tbreak;\n\t\t\t\n\t\tcase \"ko\":\n\t\t\twordToPrint = \"こ ぶ し\";\n\t\tbreak;\n\t\t\n\t\tdefault:\n\t\t\t;\n\t\t\t\t\n\t}\n\t//hWord = Instantiate(this.word, this.player.transform.position, Quaternion.identity);\n\t//offset = .005 * wordToPrint.Length;\n\thWord = Instantiate(this.word, new Vector3(0.45, 0.6, -8), Quaternion.identity);\n\thWord.guiText.text = wordToPrint;\n}", "function displayLetter(myword, letter, word){ // by jaguar\r\n let display = \"\";\r\n let mywordarr = myword.split(\"\")\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length){\r\n if(letter === word.charAt(i)){\r\n display = display + letter + \" \";\r\n mywordarr[i] = letter\r\n } else {\r\n display += myword.charAt(i) + \" \";\r\n }\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n displayed = mywordarr.join(\"\")\r\n document.getElementById(\"display\").innerHTML = display;\r\n checkWincondition(display, word)\r\n}", "startGame(){\n console.log(this.phrase_num);\n document.getElementById('overlay').style.display = 'none';\n \n this.activePhrase = this.getRandomPhrase();\n document.getElementById(\"hint\").textContent = \"Hint: \" + this.activePhrase.hint;\n \n console.log(this.activePhrase);\n this.activePhrase.addPhraseToDisplay();\n\n \n \n }", "playAnotherRound() {\n this.displayGuess();\n console.log(this.displayedWord);\n console.log(\"\");\n\n this.playRound();\n }", "function right() {\r\n //if guess is correct\r\n //keep checking if to see if there is another space for the same letter\r\n for (var j = 0; j < underScore.length; j++) {\r\n if (word[j] === guess) {\r\n underScore[j] = guess;\r\n var blank = \"<p>\" + underScore.join(\" \") + \"</p>\";\r\n document.getElementById(\"blank\").innerHTML = blank;\r\n }\r\n //hide and show you win div\r\n if (underScore.join(\"\") === word) {\r\n winMessage.show();\r\n direct.hide();\r\n }\r\n }\r\n}", "function reveal(guess) {\n for (var z = 0; z < word.length; z++) {\n if (word[z] == guess) {\n context.fillText(word[z], (100 + (z * 20)), 490);\n lettersRemaining--;\n console.log(\"reveal: \" + lettersRemaining);\n }\n }\n }", "function display1()\n\t{\n\t\tdocument.getElementById(\"score\").innerHTML = Underscores.join(' ');\n\t\tdocument.getElementById(\"left\").innerHTML =(\"you have \" + guessesleft + \" guesses left\");\n\t\tdocument.getElementById(\"lettersguessed\").innerHTML = wrongguess;\n\t}", "function updateGameboard() {\n // uses preDisplayString to assemble nameArray (array of each word in artist);\n // places a ThickSpace after every word\n // updates gameboard display\n\n let displayString = \"\";\n let nameArray = [];\n // split preDisplay string into array of words using space as seperating character\n nameArray = preDisplayString.split(\" \");\n // assembles displayString from nameArray\n for (let i = 0; i < nameArray.length; i++) {\n displayString = displayString + \"<span> \" + nameArray[i] + \"</span>&ThickSpace;\";\n }\n // add extra ThickSpace after '&'\n displayString = displayString.replace(/& /g, \"&</span>&ThickSpace;<span> \");\n // load updated answer template into gameboard\n document.getElementById(\"answer\").innerHTML = displayString;\n document.getElementById(\"soFar\").innerHTML = \"Your Guesses so Far: \" + guessesSoFar;\n document.getElementById(\"guessessLeft\").innerHTML = \"Guessess Left: \" + remainingGuesses;\n document.getElementById(\"wins\").innerHTML = \"Guesses Correct / Guesses Total: \" + correctGuesses + \"<span>&ThickSpace;/</span>&ThickSpace;\" + charsGuessed;\n}", "addPhraseToDisplay() {\r\n\r\n /* add letter placeholders to the display when the game starts */\r\n let phraseArray = this.phrase.split(\"\");\r\n const phraseBody = document.getElementById(\"phrase\")\r\n\r\n let arrayNew = phraseArray.map(letter => {\r\n /* hide the phrase if it is a letter and not empty space */\r\n if (letter !== \" \") {\r\n return `<li class=\"hide letter ${letter}\">${letter}</li>`\r\n }\r\n else {\r\n return `<li class=\"space\"> </li>`\r\n }\r\n })\r\n\r\n phraseBody.innerHTML = '<ul>' + arrayNew.join(\"\") + '</ul>';\r\n }", "function drawScore(){\n document.getElementById('score').innerText = `Human vs Computer: ${score[0]} to ${score[1]}!`\n}", "function printToPage(randomWord) {\n myWord = randomWord.word;\n // concatenate array to Str for printing on one line\n var myStr = '';\n console.log(myWord);\n for (var i = 0; i < myWord.length; i++){\n if (correctGuesses.includes(myWord[i])) {\n myStr += (\" \" + myWord[i] + \" \");\n }\n else {\n myStr += (\" _ \");\n }\n };\n console.log('\\n' + myStr + '\\n');\n if (correctGuesses.length == myWord.length) {\n console.log(\"GG bro\");\n }\n else {\n promptUser();\n };\n \n}", "function renderMessage() {\n document.getElementById(\"msg\").textContent = `Play ${\n turn % 2 ? \"O\" : \"X\"\n } Wins!`;\n}", "function showGameOver() {\n textSize(32);\n textAlign(CENTER, CENTER);\n var gameOverText = \"GAME OVER\\n\";\n gameOverText += \"you ded.\"\n text(gameOverText, width / 2, 50);\n}", "function showWord(word) {\n var i;\n for (i = 0; i < word.length; i ++) {\n process.stdout.write(word[i]);\n }\n playAgain();\n}", "function printStored(){\n document.getElementById(\"characters\").innerHTML = (winningPhrase.join(\" \"));\n}", "function dashes(){\r\n document.getElementById('word').innerHTML = '';\r\n for (var i = 0; i < guesses.length; i++)\r\n document.getElementById('word').innerHTML += guesses[i] + ' ';\r\n document.getElementById('start').style.visibility = \"hidden\";\r\n}", "function displayCatchPhrase() {\n // display catchphrase depending on the score\n if (rightScore >= 5) {\n document.querySelector(\n \".score-number\"\n ).innerHTML += `<p class=\"win\">You survived</p><audio autoplay src=\"./MP3/frankenstein.mp3\"></audio>`;\n } else if (rightScore < 5) {\n document.querySelector(\n \".score-number\"\n ).innerHTML += `<p class=\"lose\">You're dead...</p><audio autoplay src=\"./MP3/sixth-sense.mp3\"></audio>`;\n } else if (rightScore === 5) {\n document.querySelector(\n \".score-number\"\n ).innerHTML += `<p class=\"even\">You were almost dead...but you survived!</p>`;\n }\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 underline(){\r\n\r\n underscore = [];\r\n for(let i=0;i<theWord.length;i++){\r\n underscore.push('_');\r\n }\r\n document.getElementById('wordToGuess').textContent= underscore.join(\" \");\r\n\r\n document.getElementById('lives').textContent=guesslift;\r\n}", "startGame() {\n overlay.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function updateDisplay() {\n document.getElementById(\"counterWins\").innerText = wins;\n var guessingWordText = \"\";\n for (var i = 0; i < guessingWord.length; i++) {\n guessingWordText += guessingWord[i];\n }\n document.getElementById(\"currentWord\").innerText = guessingWordText;\n document.getElementById(\"counterLives\").innerText = remainingGuesses;\n document.getElementById(\"counterGuessed\").innerText = guessedLetters;\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 displayGame() {\n getAnimal();\n animalType.innerHTML = gameAnimalType;\n animalToGuess.innerHTML = handleGameWord(gameAnimalExample);\n document.getElementById(\"guess\").focus();\n document.getElementById(\"guess\").select();\n wordWrapper.classList.remove(\"vis-hidden\");\n }", "function drawScreen() {\n if (currentLetter === ' ') {\n gameArray[currentLocation] = '<span class=\"highlightSpace\">' + currentLetter + '</span>';\n } \n else {\n gameArray[currentLocation] = '<span class=\"highlight\">' + currentLetter + '</span>';\n }\n gameCopy.innerHTML = gameArray.join('');\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}", "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 }", "displayLetters() {\r\n let wordHidden = \"\\n\";\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (this.lettersToGuess.includes(this.text.charAt(i))) {\r\n wordHidden += HangmanUtils.symbol;\r\n }\r\n else {\r\n wordHidden += this.text.charAt(i);\r\n }\r\n wordHidden += \" \";\r\n }\r\n console.log(wordHidden);\r\n }", "function print(){\n\tdocument.getElementById(\"game-count\").innerHTML = gameCount;\n\tdocument.getElementById(\"win-count\").innerHTML = winCount;\n\tdocument.getElementById(\"loss-count\").innerHTML = lossCount;\n\tdocument.getElementById(\"guess-remaining\").innerHTML = guessesRemaining;\n\tdocument.getElementById(\"word\").innerHTML = currentWord.join(\" \");\n\tdocument.getElementById(\"letter-guessed\").innerHTML = lettersGuessed.join(\" \");\n}", "startGame() {\n document.getElementById(\"overlay\").style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function messageWin(message) {\n $messageBoard.text(message)\n //could add a display-block here\n}", "displayWordInfo() {\r\n this.displayHangman();\r\n this.displayLives();\r\n this.displayLetters();\r\n this.displayLettersToGuess();\r\n }", "startGame() {\n this.phrase = new Phrase(this.getRandomPhrase());\n this.addClueToDisplay();\n this.phrase.addPhraseToDisplay();\n }", "function displayText(string){\n push();\n textFont(`Blenny`);\n textAlign(CENTER,CENTER);\n textSize(60);\n text(string, width/2, height/2);\n pop();\n}", "startGame() {\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n }", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function updateDisplay(message) {\n var message = message;\n var userInput = document.getElementById(\"taGame\");\n userInput.value = message + \"\\n\\n\" + userInput.value;\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}", "startGame() {\n let hideScreen = document.getElementById('overlay')\n hideScreen.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "function drawGame(word, letters) {\n document.querySelector('#display-status').innerHTML = displayStatus(word, letters);\n document.querySelector('#letter-slots').innerHTML = letterSlots(word, letters);\n document.querySelector('#keyboard').innerHTML = keyboard(letters);\n}", "addPhraseToDisplay() {\n let phraseDisplay = document.querySelector(\"#phrase\");\n let output = `<div id=\"phrase\" class=\"section\"><ul>`;\n\n //loop through each phrase letter\n for (let i = 0; i < this.phrase.length; i++){\n if (this.phrase[i] === \" \") {\n output += `<li class=\"space\"> </li>`;\n } else {\n output += `<li class=\"hide letter ${this.phrase[i]}\">${this.phrase[i]}</li>`;\n }\n }\n output += `</ul></div>`\n\n //should override any <li> elements from the previous game\n phraseDisplay.innerHTML = output;\n }", "function updateGuesses() {\n document.querySelector(\"#guessed\").innerHTML = \"Word to be guessed: \" + chosenWord.join(' ');\n}", "function updateDisplay() {\n\n document.getElementById(\"totalWins\").innerText = wins;\n\n // Display how much of the word we've already guessed on screen.\n // Printing the array would add commas (,) - so we concatenate a string from each value in the array.\n var guessingWordText = \"\";\n for (var i = 0; i < guessingWord.length; i++) {\n guessingWordText += guessingWord[i];\n }\n\n //\n document.getElementById(\"currentWord\").innerText = guessingWordText;\n document.getElementById(\"remainingGuesses\").innerText = remainingGuesses;\n document.getElementById(\"guessedLetters\").innerText = guessedLetters;\n}", "function updateDisplay() {\n\n document.getElementById(\"totalWins\").innerText = wins;\n document.getElementById(\"totalLosses\").innerText = losses;\n\n // Display how much of the word we've already guessed on screen.\n var guessWordText = \"\";\n for (var i = 0; i < guessWord.length; i++) {\n guessWordText += guessWord[i];\n }\n\n //\n document.getElementById(\"currentWord\").innerText = guessWordText;\n document.getElementById(\"lifePoints\").innerText = lifePoints;\n document.getElementById(\"guessedLetters\").innerText = guessedLetters;\n}", "function displayGameText() {\n $(\".obi-wan-kenobi.character-name\").text(characterList[0].name);\n $(\".obi-wan-kenobi.character-hp\").text(characterList[0].healthPoints);\n $(\".luke-skywalker.character-name\").text(characterList[1].name);\n $(\".luke-skywalker.character-hp\").text(characterList[1].healthPoints);\n $(\".darth-vader.character-name\").text(characterList[2].name);\n $(\".darth-vader.character-hp\").text(characterList[2].healthPoints);\n $(\".darth-maul.character-name\").text(characterList[3].name);\n $(\".darth-maul.character-hp\").text(characterList[3].healthPoints);\n }", "function displayScore() {\n displayText(36, score, width / 2, height - 50);\n}", "function explainHowToMove()\r\n{\r\n\tmessage += \"Red\";\r\n\tmessage += \"\\nBlue\";\r\n\tmessage += \"\\nGreen\";\r\n\tmessage += \"\\nPurple\";\r\n\tmessage += \"\\nCyan\";\r\n\tmessage += \"\\nYellow\";\r\n\taddMessage(message, \"howto\");\r\n}", "function displayMessage(text) {\n $(\"gameOutputField\").innerHTML = $(\"gameOutputField\").innerHTML + text + \"<br>\";\n $(\"gameOutputField\").scrollTop = $(\"gameOutputField\").scrollHeight;\n }", "addPhraseToDisplay(){\n //this adds letter placeholders to the display when the game starts.\n const divPhrase = document.querySelector('div#phrase');\n const ulElemPhrase = document.createElement('ul');\n for (let i = 0; i < this.phrase.length; i++){\n let liElem = document.createElement('li');\n if(/\\s/.test(this.phrase[i])){\n liElem.setAttribute('class', 'space');\n }else {\n liElem.classList += 'hide letter js-letter';\n liElem.textContent = this.phrase[i];\n }\n\n ulElemPhrase.appendChild(liElem);\n }\n\n divPhrase.appendChild(ulElemPhrase);\n }", "startGame() {\r\n $(\"#overlay\").hide();\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "function DisplayBoard() {\n\tconsole.log(\"Turn \"+(TotalEmptyPegs-1))\n\tlet spacer = \" \"\n\tfor (var i = 0; i < board.length; i++) {\n\t\tlet text = \"\"\n\t\tfor (var y = 0; y < board[i].length; y++) {\n\t\t\tif(board[i][y].isFilled) { text+=\" X\" }\n\t\t\telse text+=\" O\"\n\t\t\t\n\t\t\tspacer = spacer.substring(0, spacer.length - 1);\n\t\t}\n\t\tconsole.log(spacer+text)\n\t}\n\t\n}", "function drawLabel() {\n p.text(`Trials: ${p.props.playedGames}/${p.props.countOfGames}`, 20, p.wrapper.offsetHeight-20);\n }", "function drawText() {\n if (!gameOver) {\n return;\n }\n\n //setup text parameters\n let size = grid[0][0].h;\n ctx.fillStyle = gameTied ? COLOR_TIE : playersTurn ? COLOR_PLAYER : COLOR_COMPUTER;\n ctx.font = size + \"px dejavu sans mono\";\n ctx.lineJoin = \"round\";\n ctx.lineWidth = size / 10;\n ctx.strokeStyle = gameTied ? COLOR_TIE_DRK : playersTurn ? COLOR_PLAYER_DARK : COLOR_COMPUTER_DARK;\n ctx.textAlign = \"center\";\n ctx.textBaseline = \"middle\";\n\n //draw the text\n let offset = size * 0.55;\n let text = gameTied ? TEXT_TIE : playersTurn ? TEXT_PLAYER : TEXT_COMPUTER;\n if (gameTied) {\n ctx.strokeText(text, width / 2, height / 2);\n ctx.fillText(text, width / 2, height / 2);\n } else {\n ctx.strokeText(text, width / 2, height / 2 - offset);\n ctx.fillText(text, width / 2, height / 2 - offset);\n ctx.strokeText(TEXT_WIN, width / 2, height / 2 + offset);\n ctx.fillText(TEXT_WIN, width / 2, height / 2 + offset);\n\n }\n}", "startGame() {\r\n const overlay = document.querySelector('#overlay');\r\n overlay.style.display = 'none';\r\n\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n\r\n }", "function newGame() {\n randomSelection();\n createArrays();\n\n phraseArray.forEach( letter => letter === \" \"? ( blankArray.indexOf(letter) = \"&nbsp;\",\n spanSecretRandom.innerHTML = blankArray.join(\" \") ) : \"\");\n\n numGuesses = 10;\n lettersGuessed = [];\n spanLettersGuessed.innerHTML = lettersGuessed;\n spanWins.innerHTML = wins;\n spanLosses.innerHTML = losses;\n spanNumGuesses.innerHTML = numGuesses;\n changeGameStatus.innerHTML = \"PRESS ANY KEY TO PLAY\";\n}", "function displayTitle() {\n // Create elements for display\n push();\n textAlign(CENTER,CENTER);\n textSize(100);\n fill(0,0,0);\n textFont(fontGame);\n // Display the text\n text(\"CLKRT MSTRPC!\",width/2,height/4);\n textSize(30);\n stroke(255,0,0);\n // Display the instructions for the experience\n text(\"Collage without the glue and scissors. Yaaasssss! \\n LEFT ARROW = rotate-L \\n RIGHT ARROW = rotate-R \\n UP ARROW = expand \\n DOWN ARROW = shrink \\n SHIFT = a little magic \\n CLICK on your mouse to stamp \\n and don't stop, EVER ! \\n \\n Start by recording your voice... speak loud or use mic for best result \\n Press any button to record - Say something silly or poetic - press any button to stop \\n Now, press spacebar to begin a chef-d'oeuvre\",width/2,height/2+50);\n pop();\n\n // Check whether the spacebar was pressed to start the game...\n if (keyIsPressed && key === ' ') {\n // ... if it was, change the state to \"GAME\" so the switch statement in draw()\n // will display the game instead\n masterpiece = \"GAME\";\n //Call ambiance music for collage experience\n ambianceSFX.play();\n }\n}", "function updateScreen() {\n document.querySelector(\"#wins\").innerHTML = wins;\n document.querySelector(\"#remainingGuesses\").innerHTML = remainingGuesses;\n document.querySelector(\"#hint\").innerHTML = pcRandomPick.hint;\n document.querySelector(\"#lettersGuessed\").innerHTML = lettersGuessed.join(\" \");\n document.querySelector(\"#word\").innerHTML = gameArray.join(\" \");\n}", "startGame() {\r\n document.getElementById('overlay').style.display = 'none';\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n }", "startGame() {\r\n document.getElementById('overlay').style.display = \"none\"\r\n this.activePhrase = this.getRandomPhrase();\r\n this.activePhrase.addPhraseToDisplay();\r\n splitPhraseArray = this.activePhrase.phrase.split('');\r\n }", "function answerCheck() {\n\tgameWordDisplay = \"\"; \n\n//loops through the game word \nfor (var i = 0; i < gameWord.length; i++) {\n\n\t//check the letters guessed by the user agains each position of the game word\n\tif (guessedLetters.includes(gameWord.charAt(i))) {\n\n\t\t//if the letter is there, displays it at the position\n\t\tgameWordDisplay += gameWord.charAt(i);\n\t\t//if not, replaces the display with _ _ _\n\t} else {\n\t\tgameWordDisplay += \"_\";\n\n\t}\n}\n}", "startGame() {\n const overlay = document.getElementById('overlay');\n\n overlay.style.display = 'none'\n this.activePhrase = this.getRandomPhrase()\n this.activePhrase.addPhraseToDisplay()\n }", "addPhraseToDisplay(){\r\n\r\n const phraseSection = document.getElementById('phrase');\r\n const phraseArr = this.phrase.split(' ');\r\n\r\n // Creates letters placeholders with spaces between each word\r\n let html = `<ul>`;\r\n phraseArr.forEach( word => {\r\n for (let i = 0; i < word.length; i += 1){\r\n html += \r\n `<li class=\"hide letter ${word.charAt(i)}\">${word.charAt(i)}</li>`;\r\n }\r\n if (phraseArr.indexOf(word) != phraseArr.length-1){\r\n html +=`<li class=\"space\"> </li>`;\r\n }\r\n });\r\n html+= `</ul>`;\r\n phraseSection.innerHTML = html;\r\n }", "addPhraseToDisplay() {\n let displayHTML = ``;\n for (let i = 0; i < this.phrase.length; i++) {\n if (this.phrase[i] === \" \") {\n displayHTML += `<li class=\"hide show\"></li>`;\n } else {\n displayHTML += `<li class=\"hide letter ${this.phrase[i]}\">${this.phrase[i]}</li>`;\n }\n }\n $(\"#phrase ul\").append(displayHTML);\n }", "function speechToText(){\n push();\n textSize(20);\n fill(255);\n textFont(speechFont);\n //appears randomly on the screen\n text(theWords,random(0,width/3),random(0,height));\n pop();\n}", "function displayScores() {\n fill(\"black\");\n textSize(25);\n text(`lives = ${lives}`, 575, 30);\n text(`score = ${score}`, 565, 60);\n text(\"press backspace to return to menu\", 230, 490);\n}", "startGame() {\n let overlayElement = document.getElementById('overlay');\n overlayElement.style.display = \"none\";\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "startGame() {\n const divOverlay = document.querySelector('#overlay');\n divOverlay.style.display = 'none';\n const randomPhrase = this.getRandomPhrase();\n randomPhrase.addPhraseToDisplay();\n this.activePhrase = randomPhrase;\n\n }", "startGame(){\r\n overlay.style.display = \"none\";\r\n this.activePhrase = this.getRandomPhrase(); \r\n activePhrase = this.activePhrase\r\n console.log(activePhrase);\r\n activePhrase.addPhraseToDisplay();\r\n }", "function showText() {\n $(\"#textDisplay\").empty();\n $(\"#instructions\").empty();\n randomWords = [];\n for (var i = 0; i < wordCount; i++) {\n var ranWord = wordList[Math.floor(Math.random() * wordList.length)];\n if (wordList[wordList.length - 1] !== ranWord || wordList[wordList.length - 1] === undefined) {\n randomWords.push(ranWord);\n }\n }\n randomWords.forEach(function(word){\n $(\"#textDisplay\").append($(\"<span>\",{\"text\": word + \" \",\"class\":\"word\"}));\n });\n textDisplay.firstChild.classList.add(\"highlightedWord\")\n }", "function renderGame() {\n // Set a random word\n randomNumber = Math.floor(Math.random() * 21); \n currentWord = wordArray[randomNumber][0];\n console.log(\"currentWord\", currentWord);\n\n if (currentWord.length < 8) {\n guessesLeft = currentWord.length + 3;\n // console.log(\"guessesLeft\", guessesLeft);\n } else {\n guessesLeft = 8;\n }\n\n lettersGuessed = [];\n // console.log(\"lettersGuessed\", lettersGuessed);\n dashArr = [];\n\n\n\n\n splitArr = currentWord.toLowerCase().split('');\n // console.log(\"splitArr\", splitArr);\n\n // Check the length of word and render dashes\n // Check for spaces\n splitArr.map(index => {\n if (index === \" \") {\n dashArr.push(' ');\n }\n\n else {\n dashArr.push('-');\n }\n })\n\n // console.log(\"dashArr\", dashArr);\n\n displayWord = dashArr.join('');\n\n // console.log(\"displayWord\", displayWord);\n\n document.querySelector(\"#display-word\").innerHTML = displayWord.toUpperCase();\n document.querySelector(\"#display-wins\").innerHTML = wins;\n document.querySelector(\"#display-losses\").innerHTML = losses;\n document.querySelector(\"#display-guesses-left\").innerHTML = guessesLeft;\n document.querySelector(\"#display-image\").src = \"./assets/images/finnandjake.png\";\n document.querySelector(\"#display-letters-guessed\").innerHTML = lettersGuessed;\n document.querySelector(\"#instructions\").innerHTML = \"Guess A Letter To Get Started!\" ;\n\n\n\n}", "function showGame(){\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n ctx.fillStyle = '#d9d9d9';\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n ctx.textAlign = 'center';\n ctx.textBaseline = 'middle';\n ctx.font = gameFont;\n for(var i=0; i<HEIGHT; i++){\n for(var j=0; j<WIDTH; j++){\n var x = j * (COL_WIDTH+SPACE) + COL_WIDTH/2 + SPACE; \n var y = i * (ROW_WIDTH+SPACE) + ROW_WIDTH/2 + SPACE;\n ctx.fillStyle = COLOURS.get(GAME[i][j]);\n ctx.fillRect(x-COL_WIDTH/2, y-ROW_WIDTH/2, COL_WIDTH, ROW_WIDTH);\n ctx.fillStyle = 'white';\n ctx.fillText(GAME[i][j].toString(), x, y);\n }\n }\n}", "function showGameOver() {\n gameSound.pause();\n textSize(60);\n textAlign(CENTER,CENTER);\n fill(243,231,45);\n var gameOverText = \"GAME OVER\\n\";\n gameOverText += \"You caught \" + snitchEaten + \" snitch\\n\";\n gameOverText += \"before you died.\"\n text(gameOverText,width/2,height/2);\n}", "function showUp() {\n var letter = \"\";\n var i;\n for (i = 0; i <= splitWords.length; i++) {\n letter += \"\" + i++ + \"h2\";\n }\n document.getElementById(\"rowString\");\n\n}", "startGame() {\n overlay.style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function updateScreen(){\n\t\tsolveWord.innerHTML = answerMask.join(\" \");\n\t\tguessedLetters.sort();\n\t\tshowGuessed.innerHTML = guessedLetters;\n\t\tremLives.innerHTML = heartbeat;\n\t}", "function displayScene() {\n var para = document.querySelector (\"#descrip\");\n para.textContent = \"You are in the \" + player.currLoc.name + \"-\" + \"\\n\" + \n player.currLoc.description + \".\" + \"\\n\" +\n \"The items you can take are: \" + player.currLoc.items \n}", "startGame(){\n document.querySelector('#overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function show(){\n\tconsole.log(\"Wins \" + wins);\n\tconsole.log(\"Losses \" + losses);\n\tconsole.log(\"Guesses left \" + guessLeft);\n\tconsole.log(newWord.displayValue());\n\tconsole.log(letterArray);\n}", "addPhraseToDisplay() {\r\n let phraseToLetters = [...this.phrase];\r\n let htmlPhrase = ``;\r\n phraseToLetters.forEach((i) => {\r\n htmlPhrase += `<li class=\"hide ${i !== \" \" ? \"letter\": \"space\"} ${i}\">${i}</li>`\r\n })\r\n document.getElementById('phrase').children[0].innerHTML = htmlPhrase;\r\n }", "function showGameOver() {\n push();\n textSize(32);\n textAlign(CENTER, CENTER);\n fill(255);\n\n let gameOverText = \"GAME OVER\\n\";\n gameOverText = gameOverText + \"Your lust gave way \" + otherGenderEaten + \" times for Eve\\n\";\n gameOverText = gameOverText + \"before you died.\"\n\n text(gameOverText, width / 2, height / 2);\n pop();\n}", "function updateDisplay() {\n document.getElementById(\"winTotal\").innerText = wins;\n\n // Display how much of the word we've already guessed on screen.\n // Printing the array would add commas (,) - so we concatenate a string from each value in the array.\n var wordGuessString = \"\";\n for (var i = 0; i < wordGuess.length; i++) {\n wordGuessString += wordGuess[i];\n }\n document.getElementById(\"wordGuess\").innerText = wordGuessString;\n document.getElementById(\"guessesLeft\").innerText = guessesLeft;\n document.getElementById(\"guessedLetters\").innerText = guessedLetters;\n}", "showMatchedLetter(letter){\r\n $(letter).addClass('show');\r\n // display the char of the corresponding letters check if game is won\r\n }", "function addPhraseToDisplay() {\n let array = movieTitleToArray();\n\n for (let letters of array) {\n if (letters == \" \") {\n phrase.innerHTML += `<li class=\"space\">${letters}</li>`\n } else {\n phrase.innerHTML += `<li class=\"letter\">${letters}</li>`\n }\n }\n}", "startGame(){\n document.getElementById('overlay').style.display = 'none';\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "addPhraseToDisplay() {\n const ul = document.querySelector('#phrase ul');\n let phraseTemplate = '';\n for(let i = 0; i < this.phrase.length; i++) {\n if(this.phrase[i] == ' ') {\n phraseTemplate += `<li class=\"space\"> </li>`;\n } else {\n phraseTemplate += `<li class=\"hide letter ${this.phrase[i]}\">${this.phrase[i]}</li>`\n }\n }\n ul.innerHTML = phraseTemplate;\n }", "function displayWord() {\n wordElement.innerHTML = \n `${selectedWord\n .split('')\n .map(letter =>\n `<span class='letter'>\n ${correctLetters.includes(letter) ? letter : ''}\n </span>`\n ).join('')}`;\n \n //console.log(wordElement.innerText);\n \n //Remove New Line Character \n const innerWord = wordElement.innerText.replace(/\\n/g, '')\n //console.log(innerWord); \n\n if (innerWord === selectedWord) {\n finalMessage.innerText = 'You Won!';\n popUp.style.display = 'flex';\n }\n}", "startGame() {\n document.getElementById('overlay').style.display = 'none';\n\n this.activePhrase = this.getRandomPhrase();\n this.activePhrase.addPhraseToDisplay();\n }", "function displayCheck() {\r\n id(\"msg\").innerText = \"Nice try but the correct answer is \" + answer;\r\n toggleMsg(\"game\");\r\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 }" ]
[ "0.6981534", "0.6814094", "0.6756181", "0.6754139", "0.6753017", "0.6712933", "0.66977984", "0.6695621", "0.66941845", "0.6662241", "0.6661621", "0.6653677", "0.6653079", "0.6649592", "0.66045856", "0.66037905", "0.6597609", "0.65925455", "0.6570283", "0.65651876", "0.65634215", "0.6556604", "0.6549466", "0.6535949", "0.65282947", "0.6505754", "0.6501437", "0.6497479", "0.6480563", "0.64804596", "0.64774597", "0.645458", "0.6449565", "0.64298135", "0.64237875", "0.6419318", "0.64193046", "0.6417997", "0.64155096", "0.6415163", "0.64122987", "0.64117587", "0.64089006", "0.6407496", "0.64051884", "0.64038134", "0.6401705", "0.6397972", "0.63880944", "0.63838446", "0.63722", "0.63710046", "0.63684344", "0.63680893", "0.63643587", "0.6363504", "0.63625884", "0.63554347", "0.63546306", "0.63540286", "0.6350349", "0.6345961", "0.6345732", "0.6341573", "0.6339446", "0.63343513", "0.6327334", "0.6323824", "0.63231546", "0.63212633", "0.632074", "0.63173574", "0.6316387", "0.6311717", "0.63093936", "0.6304562", "0.6302695", "0.6300321", "0.62991047", "0.6298828", "0.62987536", "0.62975186", "0.629238", "0.6287701", "0.6287509", "0.62848294", "0.62845576", "0.6281893", "0.6281408", "0.6281141", "0.62792516", "0.6278452", "0.6274079", "0.62738216", "0.6271991", "0.62566304", "0.62546146", "0.6249338", "0.6246184", "0.62447596", "0.62429947" ]
0.0
-1
Checks if passed letter in phrase
checkLetter(letter) { if ([...this.phrase].indexOf(letter) !== -1) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "checkLetter(letter) {\n return this.phrase.includes(letter.textContent);\n }", "checkLetter(letter) {\r\n // return true/false if passed letter, matches letter in phrase\r\n return this.phrase.includes(letter) ? true : false;\r\n }", "checkLetter(letter) {\r\n const phrase = this.phrase;\r\n if (phrase.includes(letter)) {\r\n return true;\r\n } else {\r\n return false;\r\n }\r\n }", "checkLetter(letter) {\n if ( this.phrase.includes(letter) ) {\n return true;\n }\n else {\n return false;\n }\n }", "checkLetter(letter) {\n if (this.phrase.includes(letter)) {\n return true;\n }\n return false;\n }", "checkLetter(letter){\r\n if(this.phrase.includes(letter)){\r\n return true;\r\n }else {\r\n return false;\r\n }\r\n\r\n }", "checkLetter(letter) { \n const phrase = this.phrase.toLowerCase();\n return phrase.includes(letter) ? true : false;\n }", "checkLetter(e){\n const phraseJoin = this.phrase.join('');\n return phraseJoin.includes(e.toLowerCase()) ? true : false;\n }", "checkLetter(letter) { \n if (this.phrase.includes(letter)) {\n return true; \n }\n }", "checkLetter(letter) {\n if (this.phrase.includes(letter)) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(letter) {\r\n return this.phrase.toLowerCase().includes(letter);\r\n }", "checkLetter(letter) {\n if(this.phrase.includes(letter)) {\n return true\n } else {\n return false;\n }\n }", "checkLetter(letter) {\n let phrase = this.phrase\n if (phrase.includes(letter)) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(letter) {\r\n return this.phrase.includes(letter)\r\n }", "checkLetter(letter) {\r\n return this.phrase.includes(letter);\r\n }", "checkLetter(letter) {\n return this.phrase.includes(letter);\n }", "checkLetter(letter) {\n if ( this.phrase.includes(letter.toLowerCase()) ) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(letter){\r\n if( this.phrase.indexOf(letter) > -1 ){\r\n this.showMatchedLetter(letter);\r\n return true; \r\n }\r\n }", "checkLetter(letter) {\r\n return !(this.phrase.indexOf(letter) == -1);\r\n }", "checkLetter(letter) {\r\r // Loop through the phrase text and if the letter matches\r // the phrase text at index j, return true\r for (let j = 0; j < this.phrase.length; j++){\r\r\n if (this.phrase[j] == letter)\r\n return true;\r\n }\r\r // No match, return false\r return false;\r }", "checkLetter(target){\n if (this.phrase.includes(target)) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(letter) {\n return this.phrase.includes(letter);\n }", "checkLetter(letterToCheck) {\n if(this.phrase.split(\"\").includes(letterToCheck)) {\n return true;\n }\n else {\n return false;\n }\n }", "checkLetter(letter) {\n return this.phrase.includes(letter);\n }", "checkLetter(letter) {\n return this.phrase.includes(letter);\n }", "checkLetter(letter) {\n\t\tfor (let i = 0; i < this.phrase.length; i += 1) {\n\t\t\tif (this.phrase[i] === letter) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "checkLetter(letter) {\n return this.phrase.includes(letter);\n }", "checkLetter(letter) {\n let status = false;\n for (let i = 0; i < this.phrase.length; i++) {\n if (letter === this.phrase[i].toLowerCase()) {\n status = true;\n }\n }\n return status;\n }", "checkLetter(letter) {\n return this.phrase.match(letter);\n }", "checkLetter(letter){\n return this.phrase.includes(letter);\n }", "checkLetter(letter) {\n console.log(this.phrase);\n if (this.phrase.includes(letter)) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(guess) {\n if (this.phrase.includes(guess.toLowerCase())) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(letter, phrase){\r\n let letterMatchFilter = new RegExp(letter)\r\n let matched = letterMatchFilter.test(phrase)\r\n return matched\r\n }", "checkIfWordHasLetter(letter) {\r\n return this.text.includes(letter);\r\n }", "checkLetter(guess) {\n for (let i = 0; i < this.phrase.length; i++) {\n if (this.phrase.charAt(i) === guess) {\n return true;\n }\n }\n }", "checkLetter(letter)\r\n {\r\n // get the index of the letter in the phrase (-1 if not found)\r\n\r\n let foundIndex = this.phrase.indexOf(letter);\r\n\r\n // if not found\r\n\r\n if (foundIndex === -1) \r\n {\r\n // return false\r\n\r\n return false;\r\n } \r\n else \r\n {\r\n // if found show the letters on the phrase area and return true\r\n //this.showMatchedLetter(letter);\r\n return true;\r\n }\r\n\r\n }", "checkLetter(letter) {\n\n let letterContained = false;\n\n for (let i = 0; i < this.phrase.length; i++) {\n if (this.phrase[i] === letter) {\n letterContained = true;\n }\n }\n\n return letterContained;\n }", "function letterCheck(str, letter) { return str.includes(letter) }", "checkLetter(letter) {\n if (this.phrase.includes(letter)) { //the includes() method was used from https://www.w3schools.com/Jsref/jsref_includes.asp\n return true;\n } else {\n return false;\n }\n}", "checkLetter(letter) {\r\n //return matching letters\r\n return this.phrase.includes(letter);\r\n}", "checkLetter(letterToCheck) {\n\n let checkForMatch = 0;\n\n for (let i = 0; i < this.phrase.length; i++) {\n if (letterToCheck === this.phrase[i].toLowerCase()) {\n checkForMatch++\n }\n }\n if (checkForMatch > 0) {\n return true;\n } else {\n return false;\n }\n }", "checkLetter(phrase, guess) {\r\n\t\tlet correctGuess = false;\r\n\t\tfor (var i = 0; i < phrase.length; i++) {\r\n\t\t\tif (guess === phrase.charAt(i)) {\r\n\t\t\t\tcorrectGuess = true;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn correctGuess;\r\n\t}", "checkLetter(char) {\r\n if (this.phrase.includes(char)) {\r\n return char;\r\n }\r\n return null;\r\n }", "checkLetter(guessedletter) {\r\n let activePhr = game.activePhrase.toLowerCase();\r\n const phraseLetterArray = activePhr.split(\"\").filter(i => i != \" \");\r\n let letterWasCheacked = phraseLetterArray.includes(guessedletter);\r\n return letterWasCheacked;\r\n }", "checkLetter(letter) {\n const arr = this.phrase.split('');\n const phrase = this.phrase;\n //console.log(phrase);\n const guessedLetter = letter;\n const regex = new RegExp(guessedLetter);\n return regex.test(phrase);\n\n }", "function checkLetter (letter)\r\n{\r\n\tif (letter.match(/[a-z]/i) || letter.match(/[A-Z]/i) || letter.match(/[0-9]/i))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "checkLetter(keyClicked) {\r\n if (this.phrase.includes(keyClicked)) {\r\n console.log('Yeah bitch');\r\n return true;\r\n } else {\r\n console.log('No Bitch');\r\n return false;\r\n }\r\n }", "function isLetterInWord(word,letter){\r\n \r\n for (var i=0; i<word.length; i++){\r\n if (word[i] == letter) return true;\r\n }\r\n \r\n return false;\r\n}", "function checkWords(letter) {\n let regex = /^[a-z]{1}$/;\n let bon = regex.test(letter);\n if (!bon) {\n return false;\n } else if (bon) {\n return true;\n }\n}", "checkLetter(e) {\n\t\tthis.letterGuess = e.toLowerCase();\n\t\tthis.regexText = /[A-Za-z]/.test(this.letterGuess);\n\t\tif (this.regexText) {\n\t \t\tlet thisPhrase = this.phrase.toString();\n\n\t\t\t//Append letters to Letter CheckArray\n\t\t\tif (this.letterGuesses.includes(this.letterGuess)) {\n\t\t\t\talert(\"You've already used that letter!\")\n\t\t\t} else {\n\t\t\tthis.letterGuesses.push(this.letterGuess);\n\t\t\t}\n\n\t\t\tif (this.phrase.includes(this.letterGuess)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\talert(\"Please only use letters!\");\n\n\t\t}\n\t}", "checkLetter(letter) {\n let hasMatch = false;\n //loop through each phrase letter\n for (let i = 0; i < this.phrase.length; i++){\n if (this.phrase[i] === letter) {\n this.showMatchedLetter(letter);\n hasMatch = true;\n }\n }\n return hasMatch;\n }", "checkLetter(letter) {\r\n // console.log(`in checkLetter()`);\r\n // console.log(`letter clicked: ${letter.textContent}`);\r\n // console.log(`phrase is: ${this.phrase}`);\r\n const selectedPhrase = this.phrase;\r\n // console.log(`selected phrase is: ${selectedPhrase}`);\r\n let selectedLetter = letter.textContent;\r\n // console.log(`letteris: ${selectedLetter}`);\r\n\r\n //check to see if letter is included in the phrase\r\n // console.log(`checkLetter: ${selectedPhrase.includes(selectedLetter)}`);\r\n return selectedPhrase.includes(selectedLetter);\r\n }", "checkLetter(letter) {\r\n let keyboard = document.getElementById('qwerty');\r\n //check if button is clicked\r\n if (this.phrase.includes(letter)) {\r\n return true;\r\n // console.log(true)\r\n // this.showMatchedLetter(letter)\r\n } else {\r\n return false;\r\n }\r\n }", "function correctLetterCheck(letter) {\n if (character.indexOf(letter.key) > -1) {\n correctLetter(letter);\n } else {\n incorrectLetter(letter);\n }\n}", "checkLetter(letter) { //Checks to see if the letter selected by the player matches a letter in the phrase.\r\n console.log('in checkLetter method'); \r\n console.log(letter);\r\n console.log(\"in the phrase.checkLetter method\");\r\n let phraseCharactersArray = this.phrase.split(''); //converts phrase to array\r\n console.log(phraseCharactersArray);\r\n return phraseCharactersArray.includes(letter);\r\n \r\n // phraseCharactersArray.forEach(character => {\r\n // if (character === letter) {\r\n // return true;\r\n // } else {\r\n // return false;\r\n // }\r\n // });\r\n }", "function guessLetter() {\n //gets value of the letter guess\n\n guess = document.getElementById(\"playerGuess\").value;\n guess = guess.toLowerCase();\n //Check to see if input is valid or blank\n if (!guess || guess.length > 1 || !(guess.match(/[a-z]/i))){\n alert('Please enter a letter.');\n document.getElementById(\"playerGuess\").value = \"\";\n \n } else {\n //check to see if letter has been guessed\n letterGuessCheck();\n \n //check to see if the letter is in the word\n //isInWord();\n\n }; \n}", "function validate(phrase)\n{\n\tvar re = new RegExp(\"^[a-z ,'’-]{6,}$\"); // only lowercase, space, comma, etc, 6+ characters\n\tif (!re.test(phrase) || phrase.indexOf('undefined') !== -1)\n\t{\n\t\tconsole.log(\"INVALD \" + phrase);\n\t\treturn false;\n\t}\n\telse\n\t{\n\t\tconsole.log(\"VALID \" + phrase);\n\t}\n\n\treturn true;\n}", "function isLetter(c) {\n return (c.toUpperCase() != c.toLowerCase());\n}", "function checkLetter(letter){\n\tvar match = false;\n\tfor (var i=0; i<secretWord.length; i++) {\n\t\tif(letter === secretWord[i]){\n\t\t\tif (blank[i] === blankSpace) {\n\t\t\t\tblank[i] = letter;\n\t\t\t\tmatch = true;\n\t\t\t\twordSize--;\n\t\t\t}\t\n\t\t}\n\t}\n\tif(match === false) {\n\t\tguesses--;\n\t\tcheckNumGuess();\n\t}\n\treturn match;\n}", "function isLetter(ch) {\n if (ch.match(/[a-zA-Z]/i)) {\n return true;\n } else {\n return false;\n }\n}", "function isLetter( character ) {\n\treturn character.toLowerCase() != character.toUpperCase();\n}", "function checkOutsideLetters( word ){\n\tvar last = word.length-1\n\tif(word[0] === word[last]){\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter (c)\r\n{ return ( ((c >= \"a\") && (c <= \"z\")) || ((c >= \"A\") && (c <= \"Z\")) )\r\n}", "function isLetter(char) {\n return char.toLowerCase() != char.toUpperCase();\n}", "function isLetter(str) {\r\n\tif (str.length === 1 && str.match(/[a-z]/i)) {\r\n\t\treturn true;\r\n\t} else {\r\n\t\treturn false;\r\n\t}\r\n}", "function checkLetter(letter) {\n if (movieTitleToArray().includes(letter)) {\n return true;\n } else {\n return false;\n }\n}", "function isAlphabetCharacter(letter) {\n return (letter.length === 1) && /[a-z]/i.test(letter);\n}", "function verifyWord(word) {\n return (word.length > 1 && word.length < 26)\n}", "function isLetter(char){\n\treturn char.match(/[a-z]/i);\n}", "function checkForLetter(str) {\r\n\tfor (char of str) {\r\n\t\tif (isLetter(char)) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function isLetter(char) {\r\n return char.match(/[a-z]/i);\r\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function isLetter(str) {\n return str.length === 1 && str.match(/[a-z]/i);\n}", "function checkInvalid (paragr, position, wordLength){\r\n\r\n\t//kiem tra ki tu truoc va sau cua tu co phai la chu cai hay chu so hay khong\r\n\tif (checkLetter(paragr.charAt(position - 1)) \r\n\t\t\t|| checkLetter(paragr.charAt(position + wordLength))) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\r\n\treturn true;\r\n}", "function isLetter (c)\n{\nvar lowercaseLetters = \"abcdefghijklmnopqrstuvwxyzáéíóúñü.,\"\nvar uppercaseLetters = \"ABCDEFGHIJKLMNOPQRSTUVWXYZÁÉÍÓÚÑ\"\n return( ( uppercaseLetters.indexOf( c ) != -1 ) ||\n ( lowercaseLetters.indexOf( c ) != -1 ) )\n}", "function letterTest () {\n\t\t\n var userLetter = String.fromCharCode(event.keyCode).toLowerCase();\n console.log(userLetter);\n\n for (var i = 0; i < lettersOfWord.length; i++);\n\n if (userLetter === lettersOfWord[i]){\n \tconsole.log(userLetter + \" is present in this word\")\n }\n\n\n /* for( var i = 0; i< lettersOfWord.length; i++){\n \t\n \tif(userLetter.indexOf(lettersOfWord [i]))\n \tconsole.log(userLetter + \"is present in this word\");\n \t\t}*/\n }", "function BOT_wordIsPss(word) {\r\n\tif(word == \"of\") return(true) \r\n}", "function isLetter(input) {\n if (input === 'Y' || input === 'y' || input === 'n' || input === 'N') {\n return true;\n } else {\n return false;\n }\n}", "function Check_char(ct){\n\tf=document.forms[0];\n\tel=f.elements;\n\n\tif (el[ct].value.length > 1){\n\t\tel[ct].value = trim(el[ct].value);\n\t\t\n\t\treg_ex = /^([a-zàèéìòù]+['\\s]?){1,}[a-zàèéìòù]$/ig\n\t\t\n\t\tstringa = el[ct].value;\n\t\t\n\t\tif( stringa.match(reg_ex))\n\t\t\treturn true;\n\t\telse {\n\t\t\talert(\"Attenzione!\\nCarattere non ammesso nel campo \"+ct+\"\\n\\nSono consentiti solo lettere, spazi e apostrofi. Non sono ammessi:\\n - numeri\\n - caratteri speciali (es ?,@,_,*,+,-,/)\\n - spazi prima e dopo gli apostrofi\\n - doppio spazio o doppio apostrofo\\n - apostrofo finale\\n - spazi iniziali e finali\");\n\t\t\tel[ct].focus();\n\t\t\treturn false;\n\t\t}\n\t}\n\n}", "function isLetter(character) {\n if (character.length > 1) {\n return false;\n }\n var regex = /[A-Za-z]/;\n //character.search returns -1 if not found\n return character.search(regex) > -1;\n}", "function isLetter(char) {\n const alphabet = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n return alphabet.includes(char);\n }", "function isLetter(key) {\n if (key.toLowerCase() != key.toUpperCase() && key.length === 1) {\n return true;\n } else {\n return false;\n }\n}", "function lettersNumberAndSpace(parameter){ \n\tvar letters = /^[A-Za-z0-9 ]+$/.test(parameter);\n\tif(letters == true){ \n\t\treturn true; \n\t}else{ \n\t\treturn false; \n\t} \n}", "function allLetter(input) {\n let inputNoSpace = input.replace(\" \", \"\");\n var letters = /^[A-Za-z]+$/;\n if (inputNoSpace.match(letters)) {\n return true;\n }\n else {\n return false;\n }\n}", "function isAlpha(text) {\n\t\tif (text.length === 1) {\n\t\t\tif (alphabet.indexOf(text) !== false)\n\t\t\t\treturn true;\n\t\t} return false;\n\t}", "function allLetter(inputTxt) {\n var letters = /^[a-zA-Z\\s]+$/;\n if (inputTxt.match(letters)) {\n return true;\n }\n else {\n alert(\"Inserisci un cognome valido (senza numeri e caratteri speciali)\");\n return false;\n }\n}", "function allLetter(parameter){ \n\tvar letters = /^[A-Za-z]+$/.test(parameter);\n\tif(letters == true){ \n\t\treturn true; \n\t}else{ \n\t\treturn false; \n\t} \n}", "function letterCheck(letter) {\n if (lettersArray.indexOf(letter.key) > -1) {\n correctLetterCheck(letter);\n }\n}", "function matchChar() {\n\t\tvar pattern = /^[a-z]/;\n\t\tvar x = lexString.match(pattern);\n\t\tif(x !== null) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "function marcoPolo(heardWord){\n if(heardWord.toLowerCase() == \"marco\")\n {\n console.log(\"Polo!\");\n }\n else\n {\n console.log(\"Try again!\");\n }\n}", "function marcoPolo(heardWord){\n if(heardWord.toLowerCase() == \"marco\")\n {\n console.log(\"Polo!\");\n }\n else\n {\n console.log(\"Try again!\");\n }\n}", "function allLetterAndSpace(parameter){ \n\tvar letters = /^[A-Za-z ]+$/.test(parameter);\n\tif(letters == true){ \n\t\treturn true; \n\t}else{ \n\t\treturn false; \n\t} \n}", "function existInWord(letter){\n var result = false;\n if(toGuess.indexOf(letter)> -1){\n result = true;\n for (var i = 0; i < toGuess.length; i++) {\n if (toGuess.charAt(i) === letter) {\n answer[i]=letter.toUpperCase();\n alreadyGuessed++;\n }\n }\n }\n return result;\n}", "onlyletter(input) {\n let re = /^[A-Za-z]+$/\n let inputValue = input.value\n\n let errorMessage = `Este campo não aceita numeros nem caracteres especiais`\n\n if(!re.test(inputValue)) {\n this.printMessage(input, errorMessage)\n }\n }", "function stringContainsChar(text, charac) {\r\n\tfor(var i = 0; i < text.length; i++) {\r\n\t\tif(text[i] == charac) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}", "function containsUppercaseLetter(word) {\n\tfor (var i = 0; i < word.length; i++) {\n\t\tvar char = word[i];\n\t\t\tif (char.toUpperCase() === char && char.toLowerCase() !== char) {\n\t\t\t\treturn true;\n\t\t\t}\n\t}\n\treturn false;\n}", "function textCheck(inputText)\n{\n\tvar letters = /^[A-Za-z0-9]+$/;\n\tif(inputText.match(letters))\n\t{\n\t\treturn true;\n\t}\n\telse\n\t{\n\t\treturn false;\n\t}\n}", "function isLetter(c) {\r\n return isUppercase(c) || isLowercase(c);\r\n}" ]
[ "0.8600367", "0.8563086", "0.856123", "0.85476077", "0.85334545", "0.8487538", "0.84864914", "0.84775525", "0.8461022", "0.8459542", "0.84491867", "0.8447511", "0.84447736", "0.8422459", "0.8378973", "0.83779925", "0.8377272", "0.83207", "0.8319432", "0.8298126", "0.829569", "0.8271832", "0.82534224", "0.8249761", "0.8249761", "0.8246894", "0.82443583", "0.8211483", "0.8191649", "0.8178426", "0.8175285", "0.80946684", "0.80894095", "0.804238", "0.79966587", "0.79821795", "0.7972494", "0.79310715", "0.7892527", "0.78014463", "0.78010917", "0.7783343", "0.76341176", "0.75431013", "0.7511379", "0.75091887", "0.74978256", "0.74772847", "0.74732697", "0.7449635", "0.74377143", "0.73776084", "0.71977335", "0.7196076", "0.7163765", "0.7100474", "0.706086", "0.7038687", "0.70190734", "0.70182073", "0.701494", "0.70139676", "0.7012882", "0.7012882", "0.70052445", "0.69953465", "0.6991124", "0.6983932", "0.6967606", "0.69505155", "0.6936646", "0.691638", "0.69089806", "0.69089806", "0.68896675", "0.6886711", "0.68816286", "0.6877176", "0.6875984", "0.6874539", "0.68629926", "0.68340945", "0.6820037", "0.6805566", "0.6803257", "0.67988855", "0.6795549", "0.6783904", "0.6775018", "0.6765752", "0.67575824", "0.6757503", "0.6757503", "0.6753349", "0.6742788", "0.67264736", "0.67197865", "0.6713104", "0.671298", "0.66834176" ]
0.84711576
8
Displays passed letter on screen after a match is found
showMatchedLetter(letter) { const list = document.querySelectorAll('li'); for (let i = 0; i < list.length; i+=1) { if (letter === list[i].textContent){ list[i].classList.add('show'); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "showMatchedLetter(letter){\r\n $(letter).addClass('show');\r\n // display the char of the corresponding letters check if game is won\r\n }", "function match(a,b) {\n\t//if the letter input matches the current string\n\tif(a==b){\n\t\t\n\t\tfinalDisplay(i,guess);\n\t\tmatched++;\t\n\t}\n\n\n\t\n}", "showMatchedLetter(letter) {\n const letterCollection = document.getElementById('phrase').firstElementChild.children;\n for (let i = 0; i < letterCollection.length; i++) {\n if (letterCollection[i].textContent.toLowerCase() === letter) {\n letterCollection[i].className = 'show letter ' + letter;\n }\n }\n }", "showMatchedLetter(letter) {\r\n const phraseDivUl = document.getElementById('phrase').firstElementChild.children;\r\n for (let i = 0; i < phraseDivUl.length; i++) {\r\n if (letter === phraseDivUl[i].textContent) {\r\n phraseDivUl[i].className = `show letter ${phraseDivUl[i].textContent}`;\r\n }\r\n }\r\n }", "function LetterShow(letter, found) {\n\tthis.letter = letter;\n\tthis.found = false;\n}", "showMatchedLetter(letter) {\n const phraseLis = document.getElementById('phrase').children[0].children;\n\n for(let i = 0; i < phraseLis.length; i++) {\n if(phraseLis[i].textContent.includes(letter)) {\n phraseLis[i].className = 'show';\n }\n }\n }", "checkLetter(letter){\r\n if( this.phrase.indexOf(letter) > -1 ){\r\n this.showMatchedLetter(letter);\r\n return true; \r\n }\r\n }", "showMatchedLetter(char) {\r\n const letters = document.getElementsByClassName('letter');\r\n for (let i = 0; i < letters.length; i++) {\r\n if (char === letters[i].textContent) {\r\n letters[i].classList.add(\"show\");\r\n }\r\n }\r\n }", "showMatchedLetter(e) {\n \t\t$('li').parent().children(`.${this.letterGuess}`).removeClass('hide').addClass('show');\n\n\t}", "function displayLetter(myword, letter, word){ // by jaguar\r\n let display = \"\";\r\n let mywordarr = myword.split(\"\")\r\n for(let i = 0; i < myword.length; i++){\r\n if(i != myword.length){\r\n if(letter === word.charAt(i)){\r\n display = display + letter + \" \";\r\n mywordarr[i] = letter\r\n } else {\r\n display += myword.charAt(i) + \" \";\r\n }\r\n } else {\r\n display += myword.charAt(i);\r\n }\r\n }\r\n displayed = mywordarr.join(\"\")\r\n document.getElementById(\"display\").innerHTML = display;\r\n checkWincondition(display, word)\r\n}", "showMatchedLetter(letter) {\n const displayedLetters = document.querySelectorAll('.letter')\n\n displayedLetters.forEach(item => {\n if (item.classList.contains('letter') && item.innerHTML === letter) {\n item.classList.add('show');\n item.classList.remove('hide');\n item.innerHTML = `${letter}`;\n }\n })\n }", "showMatchedLetter(letter) {\n \n const letterLiCollection = document.getElementById('phrase').firstElementChild;\n \n for ( let i = 0; i < letterLiCollection.childElementCount; i++) {\n \n const currentLi = letterLiCollection.children[i];\n\n if (currentLi.innerHTML === letter ) {\n currentLi.className = `show letter ${letter}`;\n }\n }\n }", "showMatchedLetter(letter) {\r\n const phrase = document.querySelectorAll(\".letter\");\r\n phrase.forEach((char) => {\r\n if (char.textContent === letter) {\r\n char.classList.add(\"show\");\r\n char.classList.remove(\"hide\");\r\n }\r\n });\r\n }", "showMatchedLetter(letter) {\n for (let i = 0; i < ul.children.length; i++) {\n let letterVisible = document.querySelector(`#phrase > ul > li.hide.letter.${letter}`);\n // if letter matches set class to show letter\n if (letterVisible !== null) {\n letterVisible.className = `show letter ${letter}`;\n }\n }\n }", "showMatchedLetter(letter) {\n\t\tlet liMatches = document.querySelectorAll('LI.letter');\n\t\tfor (let i = 0; i < liMatches.length; i += 1) {\n\t\t\tif (liMatches[i].className[12] === letter) {\n\t\t\t\tliMatches[i].className = 'show';\n\t\t\t}\n\t\t}\n\n\t}", "showMatchedLetter(l) {\r\n\r\n let letterToBeShown = game.activePhrase.toLowerCase().split(\"\").find(i => i === l);\r\n let listOfDOMElementLetters = document.getElementsByClassName(letterToBeShown);\r\n for (let i = 0; i < listOfDOMElementLetters.length; i++) {\r\n listOfDOMElementLetters[i].className = \"show letter \" + letterToBeShown;\r\n }\r\n }", "showMatchedLetter(inputLetter) {\r\n const gameLetterElements = document.querySelectorAll('#phrase li');\r\n console.log(gameLetterElements)\r\n gameLetterElements.forEach(current => {\r\n console.log(`Current phrase letter: ${current.innerText}`);\r\n console.log(`keyed letter: ${inputLetter}`);\r\n if (current.innerText.toLowerCase() == inputLetter) {\r\n current.classList.remove(\"hide\");\r\n current.classList.add(\"show\");\r\n }\r\n })\r\n }", "checkLetter(letter)\r\n {\r\n // get the index of the letter in the phrase (-1 if not found)\r\n\r\n let foundIndex = this.phrase.indexOf(letter);\r\n\r\n // if not found\r\n\r\n if (foundIndex === -1) \r\n {\r\n // return false\r\n\r\n return false;\r\n } \r\n else \r\n {\r\n // if found show the letters on the phrase area and return true\r\n //this.showMatchedLetter(letter);\r\n return true;\r\n }\r\n\r\n }", "function displayLetter(){\n\n var letter = msg[msgIndex]\n console.log(letter)\n setChar(msg[msgIndex])\n msgIndex ++\n if(msgIndex < msg.length){\n displayHandler = setTimeout(displayLetter,timeout)\n }else{\n displayHandler = null\n }\n }", "showMatchedLetter(letter) {\n $(\".letter\").each(function(index) {\n if (this.innerText === letter) {\n $(this).removeClass('hide');\n $(this).addClass('show');\n }\n });\n }", "showMatchedLetter(letter) {\r\n const letters = document.querySelectorAll(`.hide.${letter}`);\r\n for (let i=0; i<letters.length; i+=1) {\r\n if (letter === letters[i].textContent.toLowerCase()) {\r\n letters[i].className = `show letter ${letter}`;\r\n }\r\n }\r\n }", "showMatchedLetter(letter) {\n\n const lis = document.getElementById('phrase').firstElementChild.children;\n for (let i = 0; i < lis.length; i++) {\n if (lis[i].textContent.toLowerCase() === letter) {\n lis[i].classList.add('show');\n lis[i].classList.remove('hide');\n }\n }\n }", "function getLetter(word,letter,display){\r\n var newdisp = '';\r\n \r\n for (var i=0; i<word.length; i++){\r\n if (word[i] == letter) {\r\n newdisp += letter;\r\n } \r\n else {\r\n newdisp += display[i];\r\n }\r\n }\r\n \r\n return newdisp;\r\n}", "function checkLetter (guess){\n\t\tconst letter = document.getElementsByClassName(\"letter\");\n\t\tlet foundMatch = null;\n\t\tfor (let i = 0; i < letter.length; i++) {\n\t\t\tif (guess === letter[i].textContent.toLowerCase()) {\n letter[i].classList.add('show');\n foundMatch = letter[i].textContent;\n } \n }\n return foundMatch\n }", "showMatchedLetter(letter) {\n const liElement = document.getElementsByClassName('letter');\n for (let i = 0; i < liElement.length; i++) {\n if (liElement[i].innerHTML === letter) {\n liElement[i].className = 'letter show';\n console.log('Success'); //track if letter is matched in the console\n\n } else {\n console.log('Fail'); //track if letter is not matched in the console\n }\n }\n }", "showMatchedLetter(letter) {\n const list = document.getElementsByClassName('hide letter');\n for (const li of list) {\n if (li.textContent === letter.textContent) {\n li.className = 'show';\n letter.classList.add(\"chosen\");\n letter.disabled = true;\n }\n }\n // called twice to fix bug: the same consecutive letter was not being revealed, i.e., in the word `call` guessing l would only display the first l.\n for (const li of list) {\n if (li.textContent === letter.textContent) {\n li.className = 'show';\n letter.classList.add(\"chosen\");\n letter.disabled = true;\n }\n }\n }", "showMatchedLetter(){\n $('.correct').css('color', 'black');\n $('.correct').css('background-color', 'green');\n $('.correct').css('text-shadow', '4px black');\n }", "showMatchedLetter(letter){\n const correctPhrase = document.querySelectorAll('#phrase ul li ');\n for(let i = 0; i<correctPhrase.length;i++){\n if(correctPhrase[i].innerHTML === letter) {\n correctPhrase[i].className = 'show'; \n }\n }\n }", "function displayLetter(letter) {\n\t// for each char in wordAsDashes, if matches currentWord --> display\n\tfor (i = 0; i < currentWord.length; i++) {\n\t\tif (letter == wordAsArr[i]) {\n\t\t\tdashesArray[i * 2] = letter;\n\t\t\tconsole.log(dashesArray);\n\t\t}\n\t}\n\tdocument.getElementById(\"currentWord\").innerHTML = dashesArray.join(\"\");\n\tcheckForWin();\n}", "showMatchedLetter(letter) {\n const selectedLetter = document.querySelectorAll(\".letter\");\n selectedLetter.forEach(element => {\n if (element.innerHTML === letter) {\n element.className = \"show\";\n }\n });\n }", "showMatchedLetter(letter) {\r\n const letters = Array.from(document.getElementsByClassName(letter));\r\n letters.forEach(match => {\r\n match.classList.remove('hide');\r\n match.classList.add('show');\r\n });\r\n }", "checkLetter(letter) {\n let hasMatch = false;\n //loop through each phrase letter\n for (let i = 0; i < this.phrase.length; i++){\n if (this.phrase[i] === letter) {\n this.showMatchedLetter(letter);\n hasMatch = true;\n }\n }\n return hasMatch;\n }", "showMatchedLetter(letter) {\n const appendedLI = document.querySelectorAll('#phrase ul li');\n\n appendedLI.forEach((element) => {\n if (element.textContent === letter) {\n element.className = 'letter show';\n }\n });\n }", "addPhraseToDisplay(){\r\n this.setupLetterToBeDisplayed()\r\n }", "showMatchedLetter(letter) {\r\n\r\n // Get the matchedLetters that have a class name letter\r\n const matchedLetters = document.getElementsByClassName(letter);\r\n\r\n // Loop through the matchedLetters and replace the hide class with show\r\n for (let k = 0; k < matchedLetters.length; k++) {\r\n matchedLetters[k].className = matchedLetters[k].className.replace(/\\bhide\\b/g, \"show\");\r\n } \r\n }", "showMatchedLetter(letter) {\r\n const listItem = document.querySelectorAll('.letter');\r\n // Add 'show' class if passed letter mathces\r\n for (let li of listItem) {\r\n if (li.innerText === letter) {\r\n li.classList.remove('hide');\r\n li.classList.add('show');\r\n }\r\n }\r\n }", "function displayLetters(guess){\n\t\tfor (var i=0;i<randomWord.length;i++){\n\t\t\tif (guess == randomWord[i]){\n\t\t\t\t$(\"#\"+randomWord[i]).html(guess);\n\t\t\t\tcounter += 1;\n\t\t\tif (counter == randomWord.length){\n\t\t\t\tdisplayImage();\n\t\t\t\tdisplayWins();\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t}", "showMatchedLetter(letter) {\n const hiddenLetters = document.querySelectorAll('li.hide.letter');\n hiddenLetters.forEach(hiddenLetter => {\n if (letter.toLowerCase() === hiddenLetter.textContent) {\n hiddenLetter.classList.remove('hide');\n hiddenLetter.classList.add('show');\n }\n })\n }", "showMatchedLetter(letter) { //method receives the letter the user selected as a parameter and if the letter is in the phrase it will reveal the letter on the game board\r\n console.log('in showMatchedLetter method'); \r\n let matchedLettersLi = document.querySelectorAll('#phrase ul li');// selects LI's that represent each character in the phrase\r\n matchedLettersLi.forEach(li => { //iterates through each LI element\r\n if (li.innerHTML === letter) { //if LI element's innerHTML is the same as the letter the user selected\r\n li.classList.add('show'); //show the LI on the page(by changing it's css class)\r\n }\r\n });\r\n }", "showMatchedLetter(correctLetter){\n correctLetter.classList.remove('hide');\n correctLetter.classList.add('show');\n }", "showMatchedLetter(letter) {\r\n const matchingLetterNodes = document.querySelectorAll(`li.hide.letter.${letter}`)\r\n for (let node of matchingLetterNodes) {\r\n node.className = node.className.replace(\"hide\", \"show\");\r\n }\r\n }", "function displaySelectedWord() {\n word.innerHTML = `\n ${selectedWord\n .split('')\n .map(\n letter => `\n <span class=\"letter\">\n ${correctLetters.includes(letter) ? letter : '' }\n </span>\n `\n )\n .join('')\n }\n `;\n // TO check -> console.log(word.innerText);\n // To chack -> console.log(wordText);\n const wordText = word.innerText.replace(/\\n/g, '');\n if(wordText === selectedWord) {\n message.innerText = 'You Won!';\n popup.style.display = 'flex';\n }\n}", "function answerCheck() {\n\tgameWordDisplay = \"\"; \n\n//loops through the game word \nfor (var i = 0; i < gameWord.length; i++) {\n\n\t//check the letters guessed by the user agains each position of the game word\n\tif (guessedLetters.includes(gameWord.charAt(i))) {\n\n\t\t//if the letter is there, displays it at the position\n\t\tgameWordDisplay += gameWord.charAt(i);\n\t\t//if not, replaces the display with _ _ _\n\t} else {\n\t\tgameWordDisplay += \"_\";\n\n\t}\n}\n}", "showMatchedLetter(letter) {\n let letterToShow = document.querySelector(`.hide.letter.${letter}`);\n letterToShow.className = `show letter ${letter}`\n }", "showMatchedLetter(letter) {\n const letterElements = document.getElementsByClassName(letter);\n for (let i = 0; i < letterElements.length; i ++) {\n letterElements[i].classList.add('show');\n }\n }", "showMatchedLetter(guess) {\r\n\t\t// selects all the elements with the class matching the letter guessed\r\n\t\tlet classSelector = `.${guess}`;\r\n\t\t// removes the hide class and adds the show class\r\n\t\t$(classSelector).removeClass(\"hide\").addClass(\"show\");\r\n\t}", "function matchLetter(letter) {\n\tvar matched = false;\n\n\tfor (var i = 0; i < letterCounter; i++) {\n\t\tif(answerWord[i] === letter ) {\n\t\t\t//Changes matched to true if the answerWord contains letter\n\t\t\tmatched = true;\n\t\t}\n\t}\n\t//Once matched is true, it loops through to the occurance of the letter and replaces \n\tif (matched) {\n\t\tfor (var j = 0; j < letterCounter; j++) {\n\t\t\tif (answerWord[j] === letter) {\n\t\t\t\tupdatedWordWithGuesses[j] = letter\n\t\t\t}\n\t\t}\n\t\tconsole.log(\"\\n\\x1b[32m%s\\x1b[0m\", \"CORRECT!!!\");\n\t\tconsole.log(\"\\n\" + updatedWordWithGuesses.join(\"\") + \"\\n\");\n\t\tendGame();\n\t\taskquestions();\n\t}\n\telse{\n\t\twrongLetters.push(letter);\n\t\t//Subtracts every time user gets the letter incorrectly\n\t\tnumberGuesses--;\n\t\tconsole.log(\"\\n\\x1b[31m%s\\x1b[0m\", \"INCORRECT!!!\");\n\t\tconsole.log(\"\\n\" + numberGuesses + \" guesses remaining!\");\n\t\tconsole.log(\"\\nLetters guessed: \" + wrongLetters);\n\t\tconsole.log(\"\\n\" + updatedWordWithGuesses.join(\"\") + \"\\n\");\n\t\tendGame();\n\t\taskquestions();\n\n\t}\n}", "function checkLetter(guess) {\n\tmatch = null;\n\tlet letters = document.querySelectorAll('.letter'); //unrevealed letters collection\n\tfor (i = 0; i < letters.length; i++) {\n\t\tif (guess.textContent == letters[i].textContent) {\n\t\t\tletters[i].classList.add('show');\n\t\t\tmatch = true;\n\t\t}\n\t}\n\treturn match;\n}", "showMatchedLetter(keyPressed){\n let letters = document.getElementsByClassName('js-letter');\n for (let j = 0; j < letters.length; j++){\n if(letters[j].textContent === keyPressed){\n letters[j].classList.remove('hide');\n letters[j].classList.add('show');\n }\n }\n }", "function findLetter(letter) {\n for (var i = 0; i < currentWord.length; i++) {\n if (currentWord[i] === letter) {\n updateWord[i] = letter;\n }\n else {\n updateWord[i] = updateWord[i];\n }\n }\n turnsRemain(letter);\n score();\n return updateWord.join('');\n}", "function letterMatched() {\n for (var i = 0; i < randomWords.length; i++) {\n if (letterClicked === randomWords[i]) {\n emptySpacesForDashes[i] = letterClicked;\n }\n $('#underscore').text(emptySpacesForDashes.join(' '));\n } \n}", "function displayCorrectLetter() {\n\tvar parentH1 = document.getElementById('letter-display-text');\n\t//Remove all child spans of parentH1\n\twhile (parentH1.firstChild) {\n \tparentH1.removeChild(parentH1.firstChild);\n\t}\n\tfor ( var i = 0; i < selectedWordArray.length; i++ ) {\n\t\tvar childSpan = document.createElement('span');\n\t\tfor(var j=0; j< guessedLetters.length; j++){\n\t\t\t//Populate the letter-display div if letters match.\n\t\t\tif(selectedWordArray[i] == guessedLetters[j]) {\n\t\t\t\tchildSpan.innerHTML = guessedLetters[j];\n\t\t\t}\n\t\t}\n\t\t//Populate the letter-display div with a space if letters don't match.\n\t\tif(childSpan.innerHTML == \"\"){\n\t\t\tchildSpan.innerHTML = '&nbsp;';\n\t\t}\n\t\tparentH1.appendChild(childSpan);\n\t\t//Add a spacing class in the letter has no value.\n\t\tif(selectedWordArray[i] == \" \"){\n\t\t\tchildSpan = parentH1.lastChild;\n\t\t\tchildSpan.className = \"space\";\n\t\t}\n\t}\n}", "showLetter() {\n if(this.isGuessed) {\n return this.character;\n } else {\n return \"_\"\n }\n }", "function reveal(guess) {\n for (var z = 0; z < word.length; z++) {\n if (word[z] == guess) {\n context.fillText(word[z], (100 + (z * 20)), 490);\n lettersRemaining--;\n console.log(\"reveal: \" + lettersRemaining);\n }\n }\n }", "showMatchedLetter(letter){\r\n const phraseLi = document.querySelectorAll('#phrase > ul > li');\r\n \r\n if(this.checkLetter(letter) === true){\r\n for(let i =0; i < phraseLi.length; i++){\r\n if(phraseLi[i].textContent === letter ){\r\n phraseLi[i].classList.remove('hide');\r\n phraseLi[i].classList.add('show');\r\n \r\n }\r\n }\r\n \r\n\r\n }\r\n \r\n \r\n }", "showMatchedLetter(letter) {\n let letters = document.getElementsByClassName(letter);\n for (let i = 0; i < letters.length; i++) {\n if (letters[i].innerHTML === letter) {\n letters[i].classList.remove('hide');\n letters[i].classList.add('show');\n }\n }\n }", "showMatchedLetter(letter) {\n let matchedLetterLIs = $(`.${letter}`);\n matchedLetterLIs.removeClass('hide').addClass('show');\n\n }", "function showLetter(letter) {\n for (var i = 0; i < randomName.length; i++) {\n if (letter === lettersCurrentWord[i]) {\n dashesCurrentWord[i] = letter;\n console.log(dashesCurrentWord);\n }\n }\n document.getElementById(\"current-word\").innerHTML = dashesCurrentWord.join(\"\");\n}", "function revealWord(letter, answer_word, masked_word, incorrect_letter_guesses){\n var new_word = '';\n\n if (! isLetter(letter)){\n $(\".letter_alert\").text(letter + \" Invalid Letter\");\n return masked_word;\n }\n\n if (incorrect_letter_guesses.has(letter) || masked_word.indexOf(letter) != -1){\n $(\".letter_alert\").text(letter + \" Already Guessed\");\n return masked_word;\n }\n\n if (answer_word.indexOf(letter) === -1){\n guess_count -= 1;\n incorrect_letter_guesses.add(letter);\n $(\".your_letters\").append(letter);\n $(\".panel-title\").text(\"You have \" + guess_count + \" guesses left\");\n return masked_word;\n }\n\n for (var i = 0; i < answer_word.length; i++){\n if (letter == answer_word[i]){\n new_word += letter;\n }\n else {\n new_word += masked_word[i];\n }\n }\n return new_word;\n}", "function checkLetter(letter) {\n let match = false;\n const letters = ul.getElementsByClassName('letter');\n for (let i = 0; i < letters.length; i += 1) {\n if (letters[i].textContent == letter) {\n letters[i].classList.add('show', 'fade');\n match = true;\n };\n };\n if (match) {\n return letter;\n } else {\n return null;\n };\n}", "function checkLetter(clickedButton) {\n const letterMatch = document.querySelectorAll(\".letter\");\n let match = null;\n for (let i = 0; i < letterMatch.length; i++) {\n if (letterMatch[i].innerHTML.toLowerCase() === clickedButton) {\n find = clickedButton;\n letterMatch[i].classList.add(\"show\");\n match = true;\n }\n }\n return match;\n}", "function checkLetter(guess) {\n const letterAnswers = document.querySelectorAll('.letter');\n const li = document.querySelectorAll('.letter');\n let match;\n for (let i = 0; i < letterAnswers.length; i +=1) {\n let show = letterAnswers[i].textContent;\n if (show === guess) {\n li[i].classList.add('spin');\n li[i].className += ' show';\n match = show;\n }\n }\n return match;\n }", "showMatchedLetter(letter) {\n let li = document.querySelectorAll('li')\n for (let i = 0; i < li.length; i++) {\n if (li[i].className === `hide letter ${letter}`) {\n li[i].className = `show letter ${letter}`;\n } else {\n }\n }\n }", "showMatchedLetter(letter) {\r\n const matchLetterElement = document.querySelectorAll('.letter');\r\n matchLetterElement.forEach(letterElement =>{\r\n // console.log(letterElement);\r\n // console.log(letterElement.textContent);\r\n if(letterElement.innerHTML === letter.textContent){\r\n letterElement.classList.remove('hide');\r\n console.log(letterElement);\r\n letterElement.classList.add('show');\r\n }\r\n });\r\n }", "showMatchedLetter(letter) {\n const listOfLetters = document.getElementsByClassName(`hide letter ${letter}`);\n this.listOfLettersLenght = listOfLetters.length;\n \n while (listOfLetters.length) {\n listOfLetters[0].className = \"show\";\n }\n }", "showMatchedLetter(letter) {\n let matches = document\n .getElementById(\"phrase\")\n .getElementsByClassName(letter);\n //must make collection into an array to use array methods\n //learned from https://stackoverflow.com/questions/3871547/js-iterating-over-result-of-getelementsbyclassname-using-array-foreach\n Array.from(matches).forEach((match) => {\n match.classList.replace(\"hide\", \"show\");\n });\n }", "function displayWord() {\n wordElement.innerHTML = \n `${selectedWord\n .split('')\n .map(letter =>\n `<span class='letter'>\n ${correctLetters.includes(letter) ? letter : ''}\n </span>`\n ).join('')}`;\n \n //console.log(wordElement.innerText);\n \n //Remove New Line Character \n const innerWord = wordElement.innerText.replace(/\\n/g, '')\n //console.log(innerWord); \n\n if (innerWord === selectedWord) {\n finalMessage.innerText = 'You Won!';\n popUp.style.display = 'flex';\n }\n}", "function checkLetter(clickedButton) {\n let match = null;\n document.querySelectorAll('.letter').forEach( (letter) => {\n if (clickedButton === letter.textContent.toLowerCase() ) {\n letter.classList.add('show');\n match = clickedButton;\n }\n });\n return match;\n}", "showMatchedLetter(guess){\n //phrase colors \n let phraseLetter = document.querySelectorAll('li.hide.letter');\n phraseLetter.forEach(letter =>{\n if(guess == letter.textContent.toLowerCase()){\n letter.classList.add('show');\n letter.classList.remove('hide');\n }\n })\n }", "checkLetter(){\n /** will correctly match if letter is on the current phrase**/\n let matched = this;\n let phraseLi = document.getElementById(\"phrase\").getElementsByTagName(\"li\");\n $('.keyrow button').bind('click', function(){\n for (var i = 0; i < phraseLi.length; i++) {\n if ($(this).text() === phraseLi[i].innerHTML) {\n $(this).addClass(\"phraseLetters\");\n phraseLi[i].classList.add(\"correct\");\n matched.showMatchedLetter();\n }\n }\n })\n }", "function displayText(match) {\n hide(matchesList);\n infoElement.textContent = '';\n queryInfoElement.textContent = '';\n const query = queryInput.value;\n // add history entry for the query when the user has tapped/clicked a match\n history.pushState({isSearchResults: true, query: query}, null,\n `${window.location.origin}#${query}`);\n // match.l is a citation for a play or poem, e.g. Ham.3.3.2, Son.4.11, Ven.140\n // scene title matches only have act and scene number, e.g. Ham.3.3\n history.pushState({isSearchResults: false}, null,\n `${window.location.origin}#${match.l}`);\n document.title = `Search Shakespeare: ${match.l}`;\n const location = match.l.split('.');\n const text = location[0];\n fetch(`${HTML_DIR}${text}.html`).then(response => {\n return response.text();\n }).then(html => {\n textDiv.innerHTML = html;\n textDiv.onmouseover = addWordSearch;\n show(textDiv);\n highlightMatch(match, location);\n });\n}", "function enterLetters(){\n while (pos !== -1) { \n var selector = '#x' + pos;\n document.querySelector(selector).innerHTML = ('<h4 id=\"' + pos +'\">'+guess+'</h4>'); \n wordCheck [pos] = \"1\";\n //checks for the next instance\n pos = word.indexOf(guess, pos + 1);\n };\n writeLetterboxCorrect(); \n}", "function checkLetter(target) {\n const letter = document.querySelectorAll(\".letter\");\n const clickedLetter = target.textContent;\n let letterFound = null;\n\n for (let i = 0; i < letter.length; i++) {\n if (letter[i].textContent.toLocaleLowerCase() === clickedLetter) {\n letter[i].classList.add(\"show\");\n letterFound = letter[i].textContent;\n }\n }\n return letterFound;\n }", "showMatchedLetter(letter){\n\n const phrases = document.querySelector('#phrase ul').children;\n\n\n\n for (let i = 0; i < phrases.length; i++) {\n if (phrases[i].textContent === letter) {\n phrases[i].setAttribute('class', `show letter ${letter}`);\n\n }\n }\n }", "function incorrectLetter(letter) {\n\n if (incorrectInputEntered.indexOf(letter.key.toUpperCase()) < 0) {\n inputRemaining--;\n addIncorrectLetter(letter);\n guessesDisplay.textContent = inputRemaining;\n }\n}", "guessLetter(letterGuessed){\n if(letterGuessed === this.character){\n this.isGuessed = true;\n }\n\n this.showLetter()\n }", "function letterGuess(){\r\n var c = document.getElementById('Gletter').value.toUpperCase();\r\n // If the guesses letter is Present !!\r\n if (key.includes(c)){\r\n // All the chars having same value as c must be shown ie if a letter is guessed, all places having it it shown\r\n for (var w = 0; w < guesses.length; w++){\r\n // Equals the word\r\n if (c == key[w]){\r\n // the space is still blank-Fill it in\r\n if (guesses[w] == '_')\r\n guesses[w] = c;\r\n // If not\r\n else{\r\n // Check if other blanks contain the same letter\r\n var count = 0;\r\n for (var v = w+1; v < key.length; v++){\r\n if (key[v] == c)\r\n count += 1;\r\n }\r\n // If they do not then for 5 seconds show that the letter exists\r\n if (count == 0){\r\n document.getElementById('last').innerHTML = 'Letter Already Present';\r\n setTimeout(function(){document.getElementById('last').innerHTML = 'Current Position: ';}, 5000);\r\n }\r\n }\r\n }\r\n }\r\n }\r\n // If the letter is not in the word at all => Punishment extra part to the hanging...\r\n else{\r\n errors += 1;\r\n changeImage();\r\n }\r\n // Checking for decisive result\r\n if (errors == 10)\r\n resultingText(false);\r\n if (guesses.toString().replaceAll(',', '') == key)\r\n resultingText(true);\r\n \r\n // Setting the input back to null and printing the new dashes again\r\n document.getElementById('Gletter').value = '';\r\n dashes();\r\n}", "checkLetter(letter) {\r\n let keyboard = document.getElementById('qwerty');\r\n //check if button is clicked\r\n if (this.phrase.includes(letter)) {\r\n return true;\r\n // console.log(true)\r\n // this.showMatchedLetter(letter)\r\n } else {\r\n return false;\r\n }\r\n }", "function checkForMatch(){\n var userWord = $(\"#wordBox\").val();\n console.log(userWord);\n if (userWord == words[index][1].toLowerCase()) {\n\n showAnimation();\n if (index == words.length - 1) {\n endGame();\n // $(\"#wordBox\").fadeOut();\n return false;\n }\n index++;\n\n document.getElementById(\"wordBox\").innerHTML = \"\";\n showNewWord();\n }\n else{\n $(\"#wordbox\").text(\"\");\n // document.getElementById(\"wordBox\").innerHTML = \"\";\n $(\"#wordBox\").focus();\n $(\"#info\").text(\"wrong!\");\n\n }\n }", "function showWord(letter) {\n\n console.log(chosenWord);\n // Check if current letter exists\n for (var i = 0; i < chosenWord.length; i++) {\n // If the letter exists, display it on screen\n if (chosenWord[i].toLowerCase() === letter) {\n hideWord[i] = letter;\n hidden.innerHTML = hideWord.join(\"\");\n }\n }\n\n // If the letter doesn't exist, decrement the guess counter\n if (!chosenWord.includes(letter)) {\n startingGuesses--;\n guesses.innerHTML = startingGuesses;\n\n // If there are no remaining guesses, show the word on screen\n if (startingGuesses === 0) {\n losses++;\n alert(\"game over\");\n hidden.innerHTML = chosenWord;\n //gameInitalLoad();\n }\n // If all of the letters have been guessed, increment wins by 1\n else if (!hideWord.includes(\"-\") && guesses > 0) {\n wins++;\n var showWins = document.getElementById(\"wins\");\n showWins.innerHTML = wins;\n }\n }\n}", "showMatchedLetter(letter) {\n document.querySelectorAll(`.${letter}`).forEach((element) => {\n element.classList.remove('hide');\n element.classList.add('show', 'animated', 'flipInY');\n });\n }", "displayLetters() {\r\n let wordHidden = \"\\n\";\r\n for (let i = 0; i < this.text.length; i++) {\r\n if (this.lettersToGuess.includes(this.text.charAt(i))) {\r\n wordHidden += HangmanUtils.symbol;\r\n }\r\n else {\r\n wordHidden += this.text.charAt(i);\r\n }\r\n wordHidden += \" \";\r\n }\r\n console.log(wordHidden);\r\n }", "function nextLetter() {\n let currentLetter = sentences[sentenceIndex].charAt(letterIndex);\n $(\"#target-letter\").text(currentLetter);\n}", "function letter(thing) {\n //console.log(\"Lettering start\");\n $(thing).html( fillWhitespace($(thing)) );\n $(thing).lettering().children(\"span\").addClass(\"changableText\");\n //console.log(\"Lettering done\");\n return;\n}", "function checkLetter(letter) {\n // Get all li elements with class: letter\n const liLetters = document.getElementsByClassName('letter');\n // Other variables used in function \n let letterFound = null;\n \n // Loop through all li letters and check if match with pressed letter\n for (let i = 0; i < liLetters.length; i++) {\n if (liLetters[i].textContent === letter) {\n liLetters[i].className += ' ' + 'show';\n letterFound = liLetters[i].textContent;\n }\n } \n // If the letter is guessed return the letter or otherwise null\n return letterFound;\n}", "function displayGuesses(letter) {\n\tvar newguess = document.getElementById(letter.toLowerCase());\n\tconsole.log(\"newguess: \" + newguess);\n\tnewguess.style.opacity = 1;\n}", "showMatchedLetter(letter) {\n const letterSpace = document.getElementsByClassName(`hide letter ${letter}`);\n\n // keeps the length of letterSpace array value constant\n const letterLength = letterSpace.length;\n \n /* loops through all classes with the 'hide letter (letter parameter)' \n and changes the class name to 'show letter (letter parameter)'*/\n for (let i = 0; i < letterLength; i++) {\n letterSpace[0].className = `show letter ${letter}`;\n }\n }", "function checkforMatch(f) {\n if (inputWord.length === 0) {\n let modalText = document.querySelector(\".modal__text\");\n modalBox.style.display = \"flex\";\n modalText.innerText = `Pick a word first!`;\n }\n if (inputWord.indexOf(f) === -1) {\n console.log(\"incorrect\");\n gunshot.play();\n wrongLetters.push(f);\n counter++;\n guessesLeft--;\n guessCounter.innerText = `Guesses Left: ${guessesLeft}`;\n imageLoop.setAttribute(\"src\", imagesArr[counter]);\n document\n .querySelector(\"[data-letter=\" + f + \"]\")\n .classList.add(\"letter_no\");\n if (counter === 8) {\n let modalText = document.querySelector(\".modal__text\");\n let fullWord = inputWord.join(\"\");\n modalBox.style.display = \"flex\";\n modalText.innerText = `You Lost! The correct word was ${fullWord}`;\n }\n return;\n }\n console.log(\"correct letter\");\n document.querySelector(\"[data-letter=\" + f + \"]\").classList.add(\"letter_yes\");\n addLetters(f);\n}", "function characterSearch(text, letter) {\n\n for (var i = 0; i < text.length; i++) {\n\n if (text.charAt(i) == letter) {\n console.log(\"We found an \" + letter + \"at index \" + i);\n } \n }\n}", "showMatchedLetter(letterToCheck) {\n if (this.checkLetter(letterToCheck)) {\n //count to select the correct li\n let count = 0;\n this.phrase.split(\"\").forEach((letter) => {\n if (letter === letterToCheck) {\n //select the corresponding li\n $('ul li:eq('+count+')').removeClass().addClass('show letter ' + letter).attr('value', 'guessed');\n }\n count += 1;\n });\n }\n }", "function guessLetter( letter, shown, solution ) {\n var checkIndex = 0;\n \n checkIndex = solution.indexOf(letter);\n while ( checkIndex >= 0 ) {\n shown = alterAt( checkIndex, letter, shown );\n checkIndex = solution.indexOf(letter, checkIndex + 1);\n }\n return shown;\n}", "function displayTarget(){\n findTarget();\n if(isPlaying===true){\n $('#target-letter').text(\"'\" + targetLet + \"'\");\n }\n}", "function checkChosen(letter) {\n console.log(\"Looking for \\\"\" + letter + \"\\\" in \" + solution)\n if (solution.indexOf(letter) > -1) {\n console.log(\"Found!\")\n for (let i = 0; i < solution.length; i++) {\n if (solution.charAt(i) == letter) {\n hiddenWord = replaceChar(hiddenWord, i, letter)\n } \n } if (hiddenWord == solution) {\n gamesWon++\n $(\".row.chatter\").empty()\n $(\".row.chatter\").append(`<p>You Won! The answer was: ${solution}. Try again!</p>`)\n $(\".row.game-count\").empty()\n $(\".row.game-count\").append(`<p>Wins: ${gamesWon} Losses: ${gamesLost}</p>`)\n setTimeout(function() { resetGame(); }, 2000);\n } \n } else {\n wrongAnswer();\n }\n $(\".row.solution\").empty()\n $(\".row.solution\").append(hiddenWord)\n}", "function checkLetter(clickedButton) {\n var letters = document.getElementsByClassName(\"letter\");\n for ( i = 0; i < letters.length; i++) {\n var letter = letters[i].innerText;\n if (clickedButton == letter) {\n letters[i].classList.add(\"show\");\n var letterFound = letter;\n }\n }\n\n if (letterFound) {\n return letterFound;\n\n } else {\n missed += 1;\n return null;\n }\n\n}", "function checkLetter(button) {\n const letters = document.querySelectorAll('.letter');\n let match = null;\n let chosenLetter = button.textContent.toUpperCase();\n\n for (let i = 0; i < letters.length; i++) {\n if (chosenLetter === letters[i].textContent) {\n letters[i].className += ' show';\n match = letters[i].textContent;\n }\n }\n return match;\n}", "function letterMatch(selected){\n\n var letterSuccess = false;\n\n for(var j=0; j < numberOfBlanks; j++){\n if(wordSelected[j] === selected){\n letterSuccess = true;\n }\n \n }\n\n if(letterSuccess){\n for(k=0; k < numberOfBlanks; k++){\n if(wordSelected[k] === wordSelected[wordSelected.indexOf(selected)]){\n blankLines[k] = selected;\n }\n }\n \n }\n\n else{\n guessesCounter --;\n wrongLetters.push(selected);\n document.getElementById(\"incorrect-guess\").innerText= wrongLetters.join(\", \");\n\n }\n}", "showMatchedLetter(letter) {\r\n const reference = `.hide.letter.${letter}`;\r\n const correctLetters = document.querySelectorAll(reference);\r\n for (let each of correctLetters) {\r\n each.classList.remove('hide');\r\n each.classList.add('show');\r\n }\r\n}", "function letter (letra ){\n letra = letra.toLowerCase ();\n if (letra === 'a' || letra === 'e' || letra === 'i' || letra === 'o' || letra ==='u')\n return \"Vocal\"\n}", "displayLettersToGuess() {\r\n let lettersNotGuessed = \"\\n\";\r\n for (let letter of Utilities.alphabet) {\r\n if (!this.guessedLetters.includes(letter.toLowerCase())) {\r\n lettersNotGuessed += letter.toUpperCase() + \" \";\r\n }\r\n else {\r\n lettersNotGuessed += \" \";\r\n }\r\n }\r\n lettersNotGuessed += \"\\n\";\r\n console.log(Utilities.strReplaceByIndex(lettersNotGuessed, \"\\n\", 39));\r\n }", "displayWord(word,letters){\n\tlet dWord = '';\n\tfor(let i=0; i< word.length; i++){\n\t\tif (letters.indexOf(word[i]) === -1) {\n\t\t\tdWord = dWord + '_';\n\t\t} else {\n\t\t\tdWord = dWord + '' + word[i];\n\t\t}\n\t}\n\treturn dWord;\n}" ]
[ "0.7764646", "0.74672186", "0.7379272", "0.7344734", "0.72903204", "0.72504205", "0.7221005", "0.7158286", "0.71428436", "0.71275896", "0.7125284", "0.71249104", "0.70639473", "0.70473737", "0.70316774", "0.6985066", "0.69456464", "0.69390154", "0.69269377", "0.69063437", "0.6882198", "0.68690914", "0.6837069", "0.68271166", "0.6768194", "0.6768005", "0.67274016", "0.6726162", "0.6709962", "0.66630954", "0.66630614", "0.66571593", "0.6649799", "0.66460377", "0.6619433", "0.66168916", "0.6616331", "0.6614009", "0.6610583", "0.6597909", "0.6573235", "0.65441394", "0.6522779", "0.65172935", "0.6516743", "0.64927983", "0.6481686", "0.64800715", "0.64796066", "0.64738566", "0.64705616", "0.6466887", "0.6464882", "0.64593846", "0.6454873", "0.64447594", "0.6436302", "0.6421737", "0.64217013", "0.64169526", "0.6414947", "0.6411799", "0.6410594", "0.6407584", "0.6405945", "0.6398005", "0.6397925", "0.6376738", "0.63713646", "0.6363503", "0.6347952", "0.6333371", "0.6328347", "0.62944794", "0.62920904", "0.6274295", "0.62524027", "0.624683", "0.62438077", "0.6241193", "0.6227615", "0.62271065", "0.6222533", "0.62206286", "0.6214882", "0.6189997", "0.6184673", "0.6170625", "0.61657697", "0.6158773", "0.61444926", "0.61191094", "0.6111194", "0.6103806", "0.61022913", "0.610139", "0.609959", "0.60964334", "0.6088527", "0.60881007" ]
0.63411117
71
The CenterControl adds a control to the map that recenters the map on Chicago. This constructor takes the control DIV as an argument.
function CenterControl(controlDiv, map) { // Set CSS for the control border. var controlUI = document.createElement('div'); controlUI.className = "ControlContainer"; controlUI.title = 'Click to recenter the map'; controlDiv.appendChild(controlUI); // Set CSS for the control interior. var controlText = document.createElement('div'); controlText.className = "MyControl"; controlText.innerHTML = 'Center Map'; controlUI.appendChild(controlText); // Setup the click event listeners: simply set the map to Chicago. controlUI.addEventListener('click', function() { map.setCenter(myLatLng); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function CenterControl(controlDiv, map) {\r\n\r\n // Set CSS for the control border.\r\n var controlUI = document.createElement('div');\r\n controlUI.style.backgroundColor = '#fff';\r\n controlUI.style.border = '2px solid #fff';\r\n controlUI.style.borderRadius = '3px';\r\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\r\n controlUI.style.cursor = 'pointer';\r\n controlUI.style.marginBottom = '22px';\r\n controlUI.style.textAlign = 'center';\r\n controlUI.title = 'Click to recenter the map';\r\n controlDiv.appendChild(controlUI);\r\n\r\n // Set CSS for the control interior.\r\n var controlText = document.createElement('div');\r\n controlText.style.color = 'rgb(25,25,25)';\r\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\r\n controlText.style.fontSize = '16px';\r\n controlText.style.lineHeight = '38px';\r\n controlText.style.paddingLeft = '5px';\r\n controlText.style.paddingRight = '5px';\r\n controlText.innerHTML = 'Center Haiti Map';\r\n controlUI.appendChild(controlText);\r\n\r\n // Setup the click event listeners: simply set the map to Chicago.\r\n controlUI.addEventListener('click', function() {\r\n map.setCenter(centerHaiti);\r\n map.setZoom(8);\r\n });\r\n\r\n}", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Find Harvard';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'Find Harvard';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n map.setCenter(Harvard);\n });\n\n }", "function CenterControl(controlDiv, map) {\n // Set CSS for the control border.\n const controlUI = document.createElement(\"div\");\n controlUI.style.marginRight = \"25px\";\n controlUI.style.backgroundColor = \"#fff\";\n controlUI.style.border = \"2px solid #fff\";\n controlUI.style.borderRadius = \"3px\";\n controlUI.style.boxShadow = \"0 2px 6px rgba(0,0,0,.3)\";\n controlUI.style.cursor = \"pointer\";\n controlUI.style.marginBottom = \"22px\";\n controlUI.style.textAlign = \"center\";\n controlUI.title = \"Click to recenter the map\";\n controlDiv.appendChild(controlUI);\n // Set CSS for the control interior.\n var reload = '<i style=\"font-size:20px\" class=\"fa\">&#xf021;</i>';\n const controlText = document.createElement(\"div\");\n controlText.style.color = \"rgb(25,25,25)\";\n controlText.style.fontFamily = \"Roboto,Arial,sans-serif\";\n controlText.style.fontSize = \"20px\";\n controlText.style.lineHeight = \"38px\";\n controlText.style.paddingLeft = \"5px\";\n controlText.style.paddingRight = \"5px\";\n controlText.innerHTML = \"現在地 \" + reload;\n controlUI.appendChild(controlText);\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener(\"click\", () => {\n map.setCenter(new google.maps.LatLng(35.08969903728947, 139.06380775082175));\n });\n }", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = 'rgb(256,256,256)';\n controlUI.style.border = '6px solid rgb(256,256,256)';\n controlUI.style.borderRadius = '6px';\n //controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(255,81,90)';\n controlText.style.fontFamily = 'Roboto';\n controlText.style.fontSize = '26px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '30px';\n controlText.style.fontWeight = \"500\";\n controlText.style.fontStyle = 'normal';\n controlText.style.paddingRight = '30px';\n controlText.innerHTML = '+ Party';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n map.setCenter(pos);\n if(posted === false){\n var ref = new Firebase('https://party-1473630564088.firebaseio.com');\n firebase.push({lat: pos.lat, lng: pos.lng, timestamp: Firebase.ServerValue.TIMESTAMP });\n posted = true;\n }\n // ref.update({ timestamp: Firebase.ServerValue.TIMESTAMP });\n\t//ref.on('timestamp', function(snapshot){ console.log(snapshot.val()) })\n // });\n});\n }", "function CenterControl(controlDiv, map) {\r\n\r\n // Set CSS for the control border.\r\n var controlUI = document.createElement('div');\r\n controlUI.style.backgroundColor = '#fff';\r\n controlUI.style.border = '2px solid #fff';\r\n controlUI.style.borderRadius = '3px';\r\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\r\n controlUI.style.cursor = 'pointer';\r\n controlUI.style.marginBottom = '22px';\r\n controlUI.style.textAlign = 'center';\r\n controlUI.title = 'Click to Hide Markers';\r\n controlDiv.appendChild(controlUI);\r\n\r\n // Set CSS for the control interior.\r\n var controlText = document.createElement('div');\r\n controlText.style.color = 'rgb(25,25,25)';\r\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\r\n controlText.style.fontSize = '16px';\r\n controlText.style.lineHeight = '38px';\r\n controlText.style.paddingLeft = '5px';\r\n controlText.style.paddingRight = '5px';\r\n controlText.innerHTML = 'Hide Markers';\r\n controlUI.appendChild(controlText);\r\n\r\n // Setup the click event listeners: simply set the map to Chicago.\r\n controlUI.addEventListener('click', function () {\r\n clearMarkers();\r\n });\r\n\r\n}", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = 'transparent';\n controlUI.style.border = '2px solid transparent';\n controlUI.style.borderRadius = '3px';\n controlUI.style.marginTop = '10px';\n controlUI.style.marginRight = '10px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlIcon = document.createElement('div');\n controlIcon.style.backgroundImage = \"url('images/\" + \"rsz_ic_my_location_black_48dp.png')\"; \n controlIcon.style.height = '36px';\n controlIcon.style.width = '36px';\n controlUI.appendChild(controlIcon);\n\n // Setup the click event listeners: simply set the map to user initialLocation.\n controlUI.addEventListener('click', function() {\n map.setCenter(initialLocation);\n map.setZoom(13); \n });\n}// End of Geo Control", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.float = 'left';\n controlUI.style.marginBottom = '22px';\n controlUI.style.marginLeft = '12px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior\n var goCenterText = document.createElement('div');\n controlUI.style.color = 'rgb(25,25,25)';\n controlUI.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlUI.style.fontSize = '16px';\n controlUI.style.lineHeight = '38px';\n controlUI.style.paddingLeft = '5px';\n controlUI.style.paddingRight = '5px';\n controlUI.innerHTML = 'Center Map';\n controlUI.appendChild(goCenterText);\n\n // Set CSS for the goToToday control border\n var todayUI = document.createElement('div');\n todayUI.style.backgroundColor = '#fff';\n todayUI.style.border = '2px solid #fff';\n todayUI.style.borderRadius = '3px';\n todayUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n todayUI.style.cursor = 'pointer';\n todayUI.style.float = 'left';\n todayUI.style.marginBottom = '22px';\n todayUI.style.marginLeft = '12px';\n todayUI.style.textAlign = 'center';\n todayUI.title = 'Click to set the current day to today';\n controlDiv.appendChild(todayUI);\n\n // Set CSS for the control interior\n var todayText = document.createElement('div');\n todayUI.style.color = 'rgb(25,25,25)';\n todayUI.style.fontFamily = 'Roboto,Arial,sans-serif';\n todayUI.style.fontSize = '16px';\n todayUI.style.lineHeight = '38px';\n todayUI.style.paddingLeft = '5px';\n todayUI.style.paddingRight = '5px';\n todayUI.innerHTML = 'Go To Today';\n todayUI.appendChild(todayText);\n\n google.maps.event.addDomListener(controlUI, 'click', function() {\n map.setCenter(mapCenter);\n map.setZoom(initialZoomLevel);\n moveSlider(getSliderValue());\n });\n\n \n google.maps.event.addDomListener(todayUI, 'click', function() {\n moveSliderToToday();\n });\n \n }", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#0a96d4';\n // controlUI.style.border = '1px solid #fff';\n // controlUI.style.borderRadius = '0x';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = '#fff';\n controlText.style.fontFamily = 'Arial,sans-serif';\n controlText.style.fontSize = '14px';\n controlText.style.lineHeight = '25px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'Reset Map';\n controlUI.appendChild(controlText);\n\n // Runs initMap when reset button is clicked.\n controlUI.addEventListener('click', function() {\n initMap();\n });\n}", "function HomeControl(controlDiv, map, center) {\n\n // Set CSS styles for the DIV containing the control\n // Setting padding to 5 px will offset the control\n // from the edge of the map\n controlDiv.style.padding = '5px';\n\n // Set CSS for the control border\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = 'white';\n controlUI.style.borderStyle = 'solid';\n controlUI.style.borderWidth = '1px';\n controlUI.style.margin = '1px';\n controlUI.style.cursor = 'pointer';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to set the map to Home';\n controlDiv.appendChild(controlUI);\n controlUI.style.setProperty(\"border-radius\",\"2px\");\n controlUI.style.setProperty(\"border-color\",\"#c2c2c2\")\n\n // Set CSS for the control interior\n var controlText = document.createElement('div');\n controlText.style.fontFamily = 'Arial,sans-serif';\n controlText.style.fontSize = '12px';\n controlText.style.paddingLeft = '4px';\n controlText.style.paddingRight = '4px';\n controlText.innerHTML = '<b>Home</b>';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to\n // the marker\n google.maps.event.addDomListener(controlUI, 'click', function() {\n map.setCenter(center);\n });\n\n}", "function CenterControl(controlDiv, map,html) {\n\n // CSS For Button 'Filter By Cluster'\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.style.marginTop = '8px';\n controlUI.style.marginRight = '16px';\n controlDiv.appendChild(controlUI); // appends the button on maps\n\n // CSS for interior text of button.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '38px';\n // sets the cluster names in the dropdown menu\n controlText.innerHTML = '<div class=\"dropdown\"><button class=\"dropdown-toggle\" type=\"button\" data-toggle=\"dropdown\" style=\"background:none;border:none\">Filter by Cluster<span class=\"caret\"></span></button><ul class=\"dropdown-menu\">'+html+'</ul></div>';\n controlUI.appendChild(controlText);\n $('.dropdown-menu show').css({\"display\":\"contents\"})\n}", "function CenterControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginTop = '8px';\n controlUI.style.marginRight = '8px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'My Position';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '16px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = \"<img src='/images/locate.png' alt='locate-me' style='margin-top: 5px; margin-bottom: 3px;'>\";\n controlUI.appendChild(controlText);\n\n\n // Setup the click event listeners: simply set the map to user location\n controlUI.addEventListener('click', function() {\n\n // HTML5 geolocation\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function (position) {\n\n var positionNow = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n infoWindow.setPosition(positionNow);\n infoWindow.setContent(\n '<div class=\"container\">' +\n '<ul class=\"collapsible z-depth-0 guides logged-in\" style=\"border: none;\">' +\n '<h6 class=\"center-align\">' + \"You are here\" + '</h6>' +\n '</ul>' +\n '</div>'\n );\n infoWindow.open(map);\n map.setCenter(positionNow);\n\n }, error => {\n addEventWarning.querySelector('.warning').innerHTML =\n \"An error has occurred while trying to get your location\";\n }, {\n enableHighAccuracy: true,\n });\n } else { addEventWarning.querySelector('.warning').innerHTML =\n \"You need to turn on geolocation on your device or web browser in order for us to help you \" +\n \"find events around you\"\n }\n });\n\n}", "function CenterControlBtnLocate(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '10px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '12px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'Where am I?';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(\"HEY\");\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n map.setCenter(pos);\n if (loc_marker != null) {\n loc_marker.setMap(null);\n }\n var marker = new google.maps.Marker({\n position: pos,\n map: map,\n icon: \"http://maps.google.com/mapfiles/ms/icons/blue-dot.png\",\n clickable: false\n });\n loc_marker = marker;\n }, function() {\n // handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n // DO NOTHING LMFAO\n }\n\n });\n}", "function CenterControlBtnGreen(controlDiv, map, placeMarker) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '10px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'black';\n controlText.style.backgroundColor = 'green';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '12px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'green';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n drawColor = \"Green\";\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(\"HEY\");\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n placeMarker(pos);\n }, function() {\n // handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n // DO NOTHING LMFAO\n }\n\n });\n}", "function LogControl(controlDiv, map) {\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'Log It!';\n controlUI.appendChild(controlText);\n\n controlUI.addEventListener('click', function () {\n $state.go('sighting');\n });\n }", "function CenterControlBtnRed(controlDiv, map, placeMarker) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '10px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'black';\n controlText.style.backgroundColor = 'red';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '12px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'red';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n drawColor = \"Red\";\n\n\n // Try HTML5 geolocation.\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(function(position) {\n console.log(\"HEY\");\n var pos = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n placeMarker(pos);\n }, function() {\n // handleLocationError(true, infoWindow, map.getCenter());\n });\n } else {\n // Browser doesn't support Geolocation\n // DO NOTHING LMFAO\n }\n\n\n });\n}", "function CenterControlBtnUndo(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '10px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to recenter the map';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '12px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = 'Undo';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n if (allMarkers.length > 0) {\n var lastMarker = allMarkers.pop();\n var lastCircle = allCircles.pop();\n lastMarker.setMap(null);\n lastCircle.setMap(null);\n } else {\n // Do nothing\n }\n });\n}", "function setMapCenter() {\n\t$(\"#leftDivInfo\").css({\n\t\t'width': '25%',\n\t\t'margin-top': '0px'\n\t});\n\t$(\"#map-canvas\").css({\n\t\t'height': '700px',\n\t\t'margin-top': '-740px',\n\t\t'margin-left': '25%',\n\t\t'width': '40%'\n\t});\n}", "function initialMapSelector(div_id, mapcenter_lng, mapcenter_lat) {\n\tvar map = new BMap.Map(div_id, {enableAutoResize: true}); \n\tvar point = new BMap.Point(mapcenter_lng, mapcenter_lat);\n\tmap.centerAndZoom(point, 15);\n\tmap.enableScrollWheelZoom();\n\tmap.addControl(new BMap.NavigationControl());\n\n\t//addMarker(map, point, 0);\n\treturn map; \n}", "function initMapControl()\n{\n //Set mode to point mode.\n drawMode = pointMode;\n var pointButton = $('<div id=\"pointButton\">Marker</div>')\n .addClass('mapButton mapButtonActive').click(pointButtonClick);\n var boundButton = $('<div id=\"boundButton\" style=\"padding-left:6px;padding-right:6px\">Bounds</div>')\n .addClass('mapButton').click(boundButtonClick);\n clearBoundButton = $('<div id=\"clearBoundButton\" style=\"padding-left:6px;padding-right:6px\">Clear</div>')\n .addClass('mapButton').click(clearBoundButtonClick);\n\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(pointButton[0]);\n map.controls[google.maps.ControlPosition.TOP_CENTER].push(boundButton[0]);\n}", "function ZoomIn(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginBottom = '22px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Click to zoom!';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '16px';\n controlText.style.lineHeight = '38px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = '+';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners: simply set the map to Chicago.\n controlUI.addEventListener('click', function() {\n zoomRate = map.getZoom() + 1;\n initMap(map);\n });\n\n }", "function CustomControl(controlDiv, map) {\r\n\r\n\t// Set CSS for the control border.\r\n\tvar controlUI = document.createElement('div');\r\n\tcontrolUI.style.backgroundColor = '#fff';\r\n\tcontrolUI.style.border = 'solid #fff';\r\n\tcontrolUI.style.borderRadius = '30px';\r\n\tcontrolUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\r\n\tcontrolUI.style.cursor = 'pointer';\r\n\tcontrolUI.style.marginBottom = '22px';\r\n\tcontrolUI.style.textAlign = 'center';\r\n\tcontrolUI.title = 'Click to open menu';\r\n\tcontrolDiv.appendChild(controlUI);\r\n\r\n\t/* // Set CSS for the control interior.\r\n\tvar controlText = document.createElement('div');\r\n\tcontrolText.style.color = 'rgb(25,25,25)';\r\n\tcontrolText.style.fontFamily = 'Roboto,Arial,sans-serif';\r\n\tcontrolText.style.fontSize = '16px';\r\n\tcontrolText.style.lineHeight = '38px';\r\n\tcontrolText.style.paddingLeft = '5px';\r\n\tcontrolText.style.paddingRight = '5px';\r\n\tcontrolText.innerHTML = 'Menu';\r\n\tcontrolUI.appendChild(controlText); */\r\n\t\r\n\tvar imgLogo = document.createElement(\"img\");\r\n\timgLogo.setAttribute(\"src\", \"http://image.flaticon.com/icons/png/512/52/52152.png\");\r\n\timgLogo.setAttribute(\"height\", \"40\");\r\n\timgLogo.setAttribute(\"width\", \"40\");\r\n\timgLogo.setAttribute(\"alt\", \"Menu\");\r\n\t\r\n\tcontrolUI.appendChild(imgLogo);\r\n\r\n // Setup the click event listeners: simply set the map to Chicago.\r\n\t/* controlUI.addEventListener('click', function(e) {\r\n\t\te.preventDefault();\r\n $(\"#wrapper\").toggleClass(\"toggled\");\r\n\t});*/\r\n }", "function CenterControl(controlDiv, map) {\n\n /*ControlUI to control all content of menu*/\n var controlUI = document.createElement('div');\n controlUI.className = 'anidar';\n controlDiv.style.width=\"100%\";\n controlDiv.id = \"controlDiv\";\n controlDiv.style.left = '0px';\n controlDiv.appendChild(controlUI);\n controlDiv.style.backgroundColor = '#039BE5';\n \n /*BTN to control menu over the map*/\n var anidarMenu = document.createElement('SPAN');\n anidarMenu.id = 'anidarMenu';\n anidarMenu.innerHTML = \"<a>&#9776;</a>\";\n //anidarMenu.className = \"btn\";\n anidarMenu.addEventListener('click', function() {\n $( \".filters\" ).toggle( \"slow\", function() {\n if(isFilterToggle){\n $(\"#controlDiv\").css('width','100%');\n $(\"#controlDiv\").css('border-radius','0px');\n $(\"#controlDiv\").css('margin-top','0px');\n $(\"#controlDiv\").css('margin-left','0px');\n isFilterToggle=!isFilterToggle; \n }else{\n $(\"#controlDiv\").css('width','4%');\n $(\"#controlDiv\").css('border-radius','5px');\n $(\"#controlDiv\").css('margin-top','15px');\n $(\"#controlDiv\").css('margin-left','15px');\n isFilterToggle=!isFilterToggle; \n }\n });\n });\n \n //<button class=\"btn\" id=\"btnMitigacion\" onclick=\"nuevoPuntoMitigacion(this);\"><img class=\"iconMiMu\" src=\"/data/Templatic-map-icons/MitigacionAdd.png\"></img></button>\n var btnMitigacion = document.createElement('button');\n btnMitigacion.className = 'btn filters';\n btnMitigacion.id ='btnMitigacion';\n btnMitigacion.innerHTML = '<img class=\"iconMiMu\" src=\"/data/Templatic-map-icons/MitigacionAdd.png\"></img>';\n btnMitigacion.addEventListener(\"click\", function() {\n nuevoPuntoMitigacion(this);\n });\n \n //<button class=\"btn\" id=\"btnToggleMitigacion\" onclick=\"toggleMitigacion();\"><img class=\"iconMiMu\" id=toggleMitigacion src=\"/data/Templatic-map-icons/mi.png\"></img></button>\n var btnToggleMitigacion = document.createElement('button');\n btnToggleMitigacion.className = 'btn filters';\n btnToggleMitigacion.id ='btnToggleMitigacion';\n btnToggleMitigacion.innerHTML = '<img class=\"iconMiMu\" id=toggleMitigacion src=\"/data/Templatic-map-icons/mi.png\"></img>';\n btnToggleMitigacion.addEventListener('click',function () {\n toggleMitigacion();\n });\n //<button class=\"btn\" id=\"btnToggleMuestreo\" onclick=\"toggleMuestreo();\"><img class=\"iconMiMu\" id=toggleMuestreo src=\"/data/Templatic-map-icons/mu.png\"></img></button>\n var btnToggleMuestreo = document.createElement('button');\n btnToggleMuestreo.className = 'btn filters';\n btnToggleMuestreo.id ='btnToggleMuestreo';\n btnToggleMuestreo.innerHTML = '<img class=\"iconMiMu\" id=toggleMuestreo src=\"/data/Templatic-map-icons/mu.png\"></img>';\n btnToggleMuestreo.addEventListener('click',function () {\n toggleMuestreo();\n }); \n //<button class=\"btn\" id=\"btnCentrarRectangulo\" onclick=\"centrarRectangulo();\"><i style=\"font-size: 12px\">Centrar</i></button>\n var btnCentrarRectangulo = document.createElement('button');\n btnCentrarRectangulo.className = 'btn filters';\n btnCentrarRectangulo.id ='btnCentrarRectangulo';\n btnCentrarRectangulo.innerHTML = '<i style=\"font-size: 12px\">Centrar</i>';\n btnCentrarRectangulo.addEventListener('click',function () {\n centrarRectangulo();\n }); \n\n //<button class=\"btn\" id=\"btnChart\" onclick=\"graficar();\" disabled=\"true\"><i class=\"fa fa-area-chart\"></i></button>\n var btnChart = document.createElement('button');\n btnChart.className = 'btn filters';\n btnChart.id ='btnChart';\n btnChart.innerHTML = '<i class=\"fa fa-area-chart\"></i>';\n btnChart.addEventListener('click',function () {\n graficar();\n }); \n \n //River checkbox\n var riversCheck = document.createElement('dl');\n riversCheck.className = 'dropdown filters';\n riversCheck.innerHTML=\"<dt onclick='riverDropDownClicked();'><a><span class='hida'>Rios:</span></a></dt><dd><div class='mutliSelect'><ul id='checkBoxRiverNames'></ul></div></dd>\";\n \n //<input type='number' min='1' id='inputFilterRadio' placeholder='Radio' value=1 onchange='changeCircleRadius(this.value);'>\n var riverInput=document.createElement('input');\n riverInput.className='filters';\n riverInput.style.height = '30px';\n riverInput.style.width = '4%';\n riverInput.type='number';\n riverInput.min = '1';\n riverInput.id='inputFilterRadio';\n riverInput.placeholder='Radio';\n riverInput.value='1';\n riverInput.addEventListener('change',function() {\n changeCircleRadius(this.value);\n });\n \n //<button class='btn botonFiltroR' onclick='aplicarFiltro(document.getElementById('inputFilterRadio').value,1)'><i class='fa fa-filter'></i></button>\n var riverBtnAplicar = document.createElement('button');\n riverBtnAplicar.className='btn botonFiltroR filters';\n riverBtnAplicar.addEventListener('click', function() {\n aplicarFiltro(document.getElementById('inputFilterRadio').value,1);\n });\n riverBtnAplicar.innerHTML = \"<i class='fa fa-filter'></i>\";\n \n \n //<button class='btn reset' id='reset'><i class='fa fa-eraser'></i></button>\n var riverBtnReset = document.createElement('button');\n riverBtnReset.className='btn reset filters';\n riverBtnReset.id='reset';\n riverBtnReset.addEventListener('click',function() {\n reset_radio_filter();\n });\n riverBtnReset.innerHTML = \"<i class='fa fa-eraser'></i>\";\n \n controlUI.appendChild(anidarMenu);\n controlUI.appendChild(btnMitigacion);\n controlUI.appendChild(btnToggleMitigacion);\n controlUI.appendChild(btnToggleMuestreo);\n controlUI.appendChild(btnCentrarRectangulo);\n controlUI.appendChild(btnChart);\n controlUI.appendChild(riversCheck);\n controlUI.appendChild(riverInput);\n controlUI.appendChild(riverBtnAplicar);\n controlUI.appendChild(riverBtnReset);\n // Setup the click event listeners: simply set the map to Chicago.\n\n }", "function makeInfoBox(controlDiv, map) {\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.boxShadow = 'rgba(0, 0, 0, 0.298039) 0px 1px 4px -1px';\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '2px';\n controlUI.style.marginBottom = '22px';\n controlUI.style.marginTop = '10px';\n controlUI.style.textAlign = 'center';\n controlDiv.appendChild(controlUI);\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '100%';\n controlText.style.padding = '6px';\n controlText.textContent = 'The map shows all clicks made in the last week.';\n controlUI.appendChild(controlText);\n }", "function CustomZoomControl( controlDiv, map ) {\n //grap the zoom elements from the DOM and insert them in the map \n var controlUIzoomIn = document.getElementById( 'cd-zoom-in' ),\n controlUIzoomOut = document.getElementById( 'cd-zoom-out' );\n controlDiv.appendChild( controlUIzoomIn );\n controlDiv.appendChild( controlUIzoomOut );\n\n // Setup the click event listeners and zoom-in or out according to the clicked element\n google.maps.event.addDomListener( controlUIzoomIn, 'click', function () {\n map.setZoom( map.getZoom() + 1 )\n } );\n google.maps.event.addDomListener( controlUIzoomOut, 'click', function () {\n map.setZoom( map.getZoom() - 1 )\n } );\n }", "function AddControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginTop = '10px';\n controlUI.style.marginRight = '13px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Create new point on map (for authenticated users)';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '14px';\n controlText.style.lineHeight = '35px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = '<img src=\"static/icons/plus.svg\" alt=\"Add new point\"></img>';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners.\n controlUI.addEventListener('click', function () {\n if (document.getElementById('logoutElem')) {\n map.setOptions({ draggableCursor: 'copy' });\n google.maps.event.addListenerOnce(map, \"click\", function (event) {\n history.pushState(null, null, \"/places/new\");\n google.maps.event.addListenerOnce(infowindow, 'closeclick', (function () {\n return function () {\n history.pushState(null, null, \"/\");\n }\n })());\n map.setOptions({ draggableCursor: 'auto' });\n var latitude = event.latLng.lat();\n var longitude = event.latLng.lng();\n var latLng = event.latLng;\n var infoNewPlaceContentElem = document.getElementById('newPlaceForm');\n infoNewPlaceContentHTML = infoNewPlaceContentElem.innerHTML;\n infoNewPlaceContentHTML.className = 'new-place-visible';\n infoNewPlaceContent = infoNewPlaceContentHTML;\n console.log(infoNewPlaceContent);\n infowindow.setContent(infoNewPlaceContent);\n infowindow.setPosition(latLng);\n infowindow.open(map);\n document.getElementById(\"newPlaceLat\").value = latitude;\n document.getElementById(\"newPlaceLng\").value = longitude;\n\n });\n } else {\n var loginButton = document.getElementById('loginElem');\n loginButton.click();\n }\n\n });\n}", "function CustomZoomControl(controlDiv, map) {\n\t\t//grap the zoom elements from the DOM and insert them in the map \n\t \tvar controlUIzoomIn= document.getElementById('cd-zoom-in'),\n\t \t\tcontrolUIzoomOut= document.getElementById('cd-zoom-out');\n\t \tcontrolDiv.appendChild(controlUIzoomIn);\n\t \tcontrolDiv.appendChild(controlUIzoomOut);\n\n\t\t// Setup the click event listeners and zoom-in or out according to the clicked element\n\t\tgoogle.maps.event.addDomListener(controlUIzoomIn, 'click', function() {\n\t\t map.setZoom(map.getZoom()+1)\n\t\t});\n\t\tgoogle.maps.event.addDomListener(controlUIzoomOut, 'click', function() {\n\t\t map.setZoom(map.getZoom()-1)\n\t\t});\n\t}", "function CustomZoomControl(controlDiv, map) {\n\t\t//grap the zoom elements from the DOM and insert them in the map \n\t \tvar controlUIzoomIn= document.getElementById('cd-zoom-in'),\n\t \t\tcontrolUIzoomOut= document.getElementById('cd-zoom-out');\n\t \tcontrolDiv.appendChild(controlUIzoomIn);\n\t \tcontrolDiv.appendChild(controlUIzoomOut);\n\n\t\t// Setup the click event listeners and zoom-in or out according to the clicked element\n\t\tgoogle.maps.event.addDomListener(controlUIzoomIn, 'click', function() {\n\t\t map.setZoom(map.getZoom()+1)\n\t\t});\n\t\tgoogle.maps.event.addDomListener(controlUIzoomOut, 'click', function() {\n\t\t map.setZoom(map.getZoom()-1)\n\t\t});\n\t}", "function CustomZoomControl(controlDiv, map) {\n\t\t//grap the zoom elements from the DOM and insert them in the map \n\t \tvar controlUIzoomIn= document.getElementById('cd-zoom-in'),\n\t \t\tcontrolUIzoomOut= document.getElementById('cd-zoom-out');\n\t \tcontrolDiv.appendChild(controlUIzoomIn);\n\t \tcontrolDiv.appendChild(controlUIzoomOut);\n\n\t\t// Setup the click event listeners and zoom-in or out according to the clicked element\n\t\tgoogle.maps.event.addDomListener(controlUIzoomIn, 'click', function() {\n\t\t map.setZoom(map.getZoom()+1)\n\t\t});\n\t\tgoogle.maps.event.addDomListener(controlUIzoomOut, 'click', function() {\n\t\t map.setZoom(map.getZoom()-1)\n\t\t});\n\t}", "function centerMap(){\n map.fitBounds(b);\n map.setZoom(z);\n }", "function HomeControl(controlDiv, map) {\n\tcontrolDiv.style.padding = '5px';\n\tvar controlUI = document.createElement('div');\n\tcontrolUI.className = \"toggle_mapsearch\"; \n\tcontrolDiv.appendChild(controlUI);\n\tvar controlLabel = document.createElement('label');\n\tcontrolLabel.innerHTML = 'Search as I move the Map';\n\t\n\tvar input = document.createElement(\"input\");\n\tinput.type = \"checkbox\";\n\tinput.className = \"mapsearch_checkbox\"; \n\tinput.id = \"search_with_map\"; // set the CSS class\n\tcontrolLabel.appendChild(input); // put it into the DOM\n\tcontrolUI.appendChild(controlLabel);\n\n}", "function center_tile_mapcanvas(ptile)\n{\n var r = map_to_gui_pos(ptile['x'], ptile['y']);\n var gui_x = r['gui_dx'];\n var gui_y = r['gui_dy'];\n \n gui_x -= (mapview['width'] - tileset_tile_width) >> 1 ;\n gui_y -= (mapview['height'] - tileset_tile_height) >> 1;\n \n set_mapview_origin(gui_x, gui_y);\n \n}", "function centerMap() {\r\n\t\tvar sets = $['mapsettings'];\r\n\t\tvar $this = sets.element;\r\n\t\tvar location = new Point(($this.innerWidth()/2)-(sets.resolutions[sets.zoom-1].width/2),($this.innerHeight()/2)-(sets.resolutions[sets.zoom-1].height/2));\r\n\t\tsetInnerDimentions(location);\r\n\t}", "function CustomZoomControl(controlDiv, map) {\n\t\t//grap the zoom elements from the DOM and insert them in the map\n\t\tvar controlUIzoomIn = document.getElementById('zoom-in'),\n\t\t\tcontrolUIzoomOut = document.getElementById('zoom-out');\n\t\tcontrolDiv.appendChild(controlUIzoomIn);\n\t\tcontrolDiv.appendChild(controlUIzoomOut);\n\n\t\t// Setup the click event listeners and zoom-in or out according to the clicked element\n\t\tgoogle.maps.event.addDomListener(controlUIzoomIn, 'click', function () {\n\t\t\tmap.setZoom(map.getZoom() + 1)\n\t\t});\n\t\tgoogle.maps.event.addDomListener(controlUIzoomOut, 'click', function () {\n\t\t\tmap.setZoom(map.getZoom() - 1)\n\t\t});\n\t}", "set Center(value) {}", "onAdd() {\n this.div_ = document.createElement('DIV');\n if (this.visible_) {\n const pos = this.getPosFromLatLng_(this.center_);\n this.div_.style.cssText = this.createCss(pos);\n this.div_.className = this.cluster_.cssClass\n this.div_.innerHTML = `<span class=\"_cluster_inner\">${this.sums_.text}</span>`;\n }\n\n const panes = this.getPanes();\n panes.overlayMouseTarget.appendChild(this.div_);\n\n const that = this;\n google.maps.event.addDomListener(this.div_, 'click', () => {\n that.triggerClusterClick();\n });\n }", "function SetMapControls() {\n // Add standard map controls\n my.Map.addControl(new ZoomSlider());\n my.Map.addControl(new Zoom());\n my.Map.addControl(new FullScreen());\n my.Map.addControl(new Rotate({ autoHide: false, class: 'ol-rotate' }));\n const ctrl = new MousePosition({\n projection: App4Sea.prefProj,\n coordinateFormat(coord) {\n const xy = olproj.transform(coord, App4Sea.prefProj, App4Sea.prefViewProj);\n let str = olcoordinate.toStringHDMS(coord);\n str = `${str}<br>${olcoordinate.toStringXY(coord, 6)}`;\n str = `${str}<br>${olcoordinate.toStringXY(xy, 0)}`;\n return str;\n },\n undefinedHTML: '',\n });\n my.Map.addControl(ctrl);\n my.Map.addControl(new OverviewMap({\n layers: [currentLayerMini],\n collapsed: true,\n }));\n my.Map.addControl(new ScaleLine());\n }", "function centerMap() {\n getLocation()\n }", "function ButtonControl(buttonControlDiv, map) {\n\t\n\tvar buttonUI = document.createElement('div'); // button UI\n\tbuttonUI.title = 'Click to recenter the map';\n\tbuttonUI.id = 'myButton';\n\tbuttonControlDiv.appendChild(buttonUI);\n\n\t\n\tvar buttonText = document.createElement('div'); // button text\n\tbuttonText.id = 'myButtonText';\n\tbuttonText.innerHTML = 'Add Event';\n\tbuttonUI.appendChild(buttonText);\n\n}", "function BuildMap(centerLat, centerLng, dataSorces) {\n $(\"#map\").kendoMap({\n center: [parseFloat(centerLat), parseFloat(centerLng)],\n zoom: 14,\n controls: {\n navigator: {\n position: \"topRight\"\n },\n zoom: {\n position: \"topRight\"\n }\n },\n layers: [{\n type: 'tile',\n urlTemplate: 'http://#= subdomain #.tile2.opencyclemap.org/transport/#= zoom #/#= x #/#= y #.png',\n subdomains: ['a', 'b', 'c']\n },\n MakeMarkers(dataSorces)\n ],\n\n click: OnClickMap,\n markerClick: OnClickMarker\n });\n} // BuildMap", "function initialize() {\n var center = new google.maps.LatLng(document.getElementsByTagName('p')[2].innerHTML,document.getElementsByTagName('p')[1].innerHTML);\n var mapOptions = {\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: center,\n };\n this.map = new google.maps.Map(document.getElementById('map_canvas'),\n mapOptions);\n}", "function centerMap(error, data) {\n var centre = {lat: -34.397, lng: 150.644}; //default map center\n \n //if getGeocode returns a valid location, center the map using that location\n if (!error && data.status === 'OK' ) { \n centre = data.results[0].geometry.location;\n }\n map.setCenter(centre);\n }", "function centreMap() {\n if (Object.keys(people).length == 0) { // Can't possibly be POIs if < 2 people\n map.setCenter(new google.maps.LatLng(54.152141, -3.032227));\n map.setZoom(7);\n } else if (Object.keys(people).length == 1) {\n map.setCenter(people[Object.keys(people)[0]].marker.getPosition());\n map.setZoom(10);\n } else {\n map.fitBounds(bounds, {left: $overlay.width()});\n }\n }", "function initialize(id, lat, lng, campus) {\n infoWindowDetails.infoWindow = new google.maps.InfoWindow({});\n google.maps.event.addListener(infoWindowDetails.infoWindow, 'closeclick', closeinfoWindow);\n curCampus = campus;\n var latlng = new google.maps.LatLng(lat, lng);\n var myOptions = {\n zoom: 15,\n center: latlng,\n mapTypeId: google.maps.MapTypeId.ROADMAP\n };\n newmap = new google.maps.Map(document.getElementById(id), myOptions);\n\n google.maps.event.addListener(newmap, 'zoom_changed', function () {\n // zoom changed\n /*\n if (infoWindowDetails.opened) {\n infoWindowDetails.infoWindow.close();\n infoWindowDetails.infoWindow.open(newmap);\n }\n */\n });\n\n google.maps.event.addListener(newmap, 'click', function () {\n infoWindowDetails.infoWindow.close();\n closeinfoWindow();\n });\n\n // create the DIV to hold the control and call the TargetControl()\n // constructor passing in this DIV.\n alertControlDiv = document.createElement('DIV');\n var alertControl = new AlertControl(newmap, alertControlDiv);\n newmap.controls[google.maps.ControlPosition.BOTTOM_LEFT].push(alertControlDiv);\n alertControlDiv.style.display = 'none';\n\n // create the DIV to hold the control and call the TargetControl()\n // constructor passing in this DIV.\n targetControlDiv = document.createElement('DIV');\n var targetControl = new TargetControl(newmap, targetControlDiv);\n targetControlDiv.index = 1;\n newmap.controls[google.maps.ControlPosition.RIGHT_BOTTOM].push(targetControlDiv);\n targetControlDiv.style.display = 'none';\n\n // Create the DIV to hold the control and call the TrackerControl()\n // constructor passing in this DIV.\n var trackerControlDiv = document.createElement('DIV');\n var trackerControl = new TrackerControl(newmap, trackerControlDiv);\n trackerControlDiv.index = 1;\n newmap.controls[google.maps.ControlPosition.TOP_LEFT].push(trackerControlDiv);\n\n google.maps.event.trigger(newmap, 'resize');\n\n directionsDisplay = new google.maps.DirectionsRenderer();\n directionsDisplay.setMap(newmap);\n google.maps.event.trigger($(trackerControlDiv).children()[0], \"click\");\n return newmap;\n}", "function CustomZoomControl(controlDiv, map) {\n //grap the zoom elements from the DOM and insert them in the map\n var controlUIzoomIn = document.getElementById('wa-zoom-in'),\n controlUIzoomOut = document.getElementById('wa-zoom-out');\n controlDiv.appendChild(controlUIzoomIn);\n controlDiv.appendChild(controlUIzoomOut);\n // Setup the click event listeners and zoom-in or out according to the clicked element\n google.maps.event.addDomListener(controlUIzoomIn, 'click', function () {\n map.setZoom(map.getZoom() + 1)\n });\n google.maps.event.addDomListener(controlUIzoomOut, 'click', function () {\n map.setZoom(map.getZoom() - 1)\n });\n }", "function initialize() {\n\t\tdirectionsDisplay = new google.maps.DirectionsRenderer();\n\t\tgeocoder = new google.maps.Geocoder();\n\t\t\n\t\tvar mapOptions = {\n\t\t\tzoom : 8,\n\t\t\tcenter : latlng,\n\t\t\tmapTypeId : google.maps.MapTypeId.ROADMAP\n\t\t};\n\n\t\tmap = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);\n\t\tdirectionsDisplay.setMap(map);\t\t\n\n\t\t// Create the DIV to hold the control and\n\t\t// call the HomeControl() constructor passing\n\t\t// in this DIV.\n\n\t\tvar homeControlDiv = document.createElement('div');\n\t\tvar homeControl = new HomeControl(homeControlDiv, map);\n\n\t\thomeControlDiv.index = 1000;\n\t\tmap.controls[google.maps.ControlPosition.CENTER].push(homeControlDiv);\n\n\t\tgoogle.maps.event.addListener(map, 'dragend', function() {\n\t\t\tgoogle.maps.event.trigger(map, 'resize');\n\t\t\tcodeLatLng();\n\t\t});\n\t\t\n\t\t google.maps.event.addListenerOnce(map, 'idle', function() {\n \t\t\t google.maps.event.trigger(map, 'resize');\n\t\t });\n\t\t\n\n\n\t}", "function calculateCenter() {\r\n center = map.getCenter();\r\n}", "function obtainGpsControl(controlDiv, map) {\n\n var obtainGpsControl = document.createElement('div');\n obtainGpsControl.title = 'Pincha el boton para centrar tu ubicacion';\n obtainGpsControl.id = 'obtainGpsControl';\n controlDiv.appendChild(obtainGpsControl);\n\n var obtainGpsText = document.createElement('div');\n obtainGpsText.id = 'obtainGpsText';\n obtainGpsText.innerHTML = '<img id=\"iconGps\" src=\"static/img/gps.png\" alt=\"GPS img\">';\n obtainGpsControl.appendChild(obtainGpsText);\n obtainGpsControl.addEventListener('click', function() {\n\n if(miubicacion !== undefined){\n map.setCenter(miubicacion);\n map.setZoom(14);\n }else\n alert(\"Por favor activa el gps o acepta el permiso para acceder a esta funcionalidad\")\n });\n}", "set center(value) {}", "function calculateCenter(){\n center = map.getCenter();\n }", "function initMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 8,\n center: centerCords\n \n \n });\n addMarkerInfo();\n}", "function calculateCenter() {\n center = map.getCenter();\n}", "function centerMap() {\n map.setCenter(latlngBounds.getCenter());\n map.fitBounds(latlngBounds);\n }", "function centerOnClientLocation(zoom) {\n var clientLocation = google && google.loader ? google.loader.ClientLocation : null;\n if (clientLocation) {\n this.map.setCenter(new GLatLng(clientLocation.latitude, clientLocation.longitude), zoom || 8);\n }\n }", "function CB_AreaControl(params) {\r\n\tthis.TYPE = \"AREA_CONTROL\";\r\n\tthis.setting(params);\r\n\r\n}", "function PGISTMapTitleControl(html) {\n\tthis.titleHTML = html;\n}", "function geofield_gmap_center(mapid) {\n google.maps.event.trigger(geofield_gmap_data[mapid].map, 'resize');\n geofield_gmap_data[mapid].map.setCenter(geofield_gmap_data[mapid].marker.getPosition());\n}", "function placeCenterAndPin(){\n setCenterAndMarker();\n initMap();\n }", "function initMap() {\n // The area where the map would center on\n const cary_NC = {lat: 35.7881812, lng: -78.7951261};\n\n // Constructor creates a new map - only center and zoom are required.\n return new google.maps.Map(document.getElementById('map'), {\n center: cary_NC,\n zoom: 12,\n style: myMapStyles\n });\n }", "updateCenter(value) {\n this.set('selec',value);\n this.set('lat',value.lat);\n this.set('lng',value.lon);\n this.set('zoom','16');\n }", "function CenterMap() {\n if(props.centerOnMarker && props.centerOnMarker[0] && props.centerOnMarker[1]) {\n const map = useMap();\n try { \n map.invalidateSize(true);\n map.flyTo(props.centerOnMarker, map.getMaxZoom());\n } catch (e) {\n // center map - when marker coords are not set (on new search request)\n map.flyTo(centerCoords, map.getZoom());\n } \n }\n return null;\n }", "function centreMap(e) {\n if (this.textContent === \"Hotel\") {\n markerLocation = [centralMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Bar\") {\n markerLocation = [northMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Cafe\") {\n markerLocation = [southMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"ART-shop\") {\n markerLocation = [westMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Restaurant\") {\n markerLocation = [eastMarker.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Gallery\") {\n markerLocation = [gallery.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n if (this.textContent === \"Museum\") {\n markerLocation = [markerMuseum.getLatLng()];\n markerBounds = L.latLngBounds(markerLocation);\n map.fitBounds(markerBounds);\n }\n }", "function addGeoFenceControl(map) {\n var control = document.createElement('DIV');\n control.innerHTML = '<button> GeoFence </button>';\n control.className = 'btn';\n control.index = 1;\n\n // Add the control to the map\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(control);\n\n // When the button is clicked pan to sydney\n google.maps.event.addDomListener(control, 'click', function() {\n map.panTo(new google.maps.LatLng(-33.9, 151.2));\n });\n\n // Change the style when the user mousedowns\n google.maps.event.addDomListener(control, 'mousedown', function() {\n control.className = 'btn-selected';\n });\n\n // Change the style back when the user mouseups\n google.maps.event.addDomListener(control, 'mouseup', function() {\n control.className = 'btn';\n });\n}", "centerMap(latitute, longitude) {\r\n this.googleMap.panTo({ lat: latitute, lng: longitude });\r\n this.googleMap.setZoom(this.config.googleMaps.selectedMarkerScale);\r\n }", "function centerMap(){\n\tvar point = map.getCenter();\n\n\t$('#aside__detail').hide();\n\teasingAnimator.easeProp({\n\t\tlat: point.lat(),\n\t\tlng: point.lng()\n\t}, center);\n\tmap.setZoom(NORMAL_ZOOM_DISTANCE);\n}", "function _map_setCenterAndZoom(map,center,nZoom){\r\n\tif (map){\r\n\t\tmap.setCenter(center,nZoom);\r\n\t}\r\n}", "function initializeMap() {\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: { lat: 47.62, lng: -122.27 },\n styles: mapStyle,\n fullscreenControl: false,\n mapTypeControl: true,\n mapTypeControlOptions: {\n style: google.maps.MapTypeControlStyle.DEFAULT,\n position: google.maps.ControlPosition.LEFT_BOTTOM\n }\n });\n infowindow = new google.maps.InfoWindow({\n content: '',\n maxWidth: 250\n });\n // Create the DIV to hold the control and call the addControl()\n // constructor passing in this DIV.\n var addControlDiv = document.createElement('div');\n var editControlDiv = document.createElement('div');\n\n var addControl = new AddControl(addControlDiv, map);\n var editControl = new EditControl(editControlDiv, map);\n\n addControlDiv.index = 1;\n editControlDiv.index = 1;\n\n map.controls[google.maps.ControlPosition.RIGHT_TOP].push(addControlDiv);\n map.controls[google.maps.ControlPosition.RIGHT_TOP].push(editControlDiv);\n\n setTimeout(function () {\n mapPlaces = _viewModel.places();\n for (i = 0; i < mapPlaces.length; i++) {\n addMarker(mapPlaces[i]);\n }\n }, 1000);\n\n}", "function initializeMap(center){\n\t\tvar mapOptions = {\n\t\t\tcenter: center,\n\t\t\tzoom: 16,\n\t\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t\t}\n\t\tmap = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);\n}", "function CB_ContainerControl(params) {\r\n\tthis.TYPE = \"CONTAINER_CONTROL\";\r\n\tthis.components = null;\r\n\tthis.setting(params);\r\n\r\n\tthis.setComponent = function(component) {\r\n\t\tif ((typeof component==='undefined')||(component===null)) return;\r\n\t\tif (this.components===null) this.components = new Array();\t// inherit issue\r\n\t\tvar len = this.components.push(component);\r\n\t\tcomponent.setContainer(this);\r\n\t\tcomponent.setting({index:len-1});\r\n\t\treturn len-1;\r\n\t};\r\n\r\n\tthis.setTheme = function (params) {\r\n\t\tthis.viewObj.loadTheme(params);\r\n\t\t// reload every component's theme\r\n\t\tfor (var i=0; i<this.components.length; i++) {\r\n\t\t\tthis.components[i].viewObj.loadTheme();\r\n\t\t}\r\n\t};\r\n}", "function mapper_center_marker() {\t \n var center = map.getCenter();\n //mapper_set_marker(center);\n}", "function init(){\n\n\n\t\t\t\t \t$scope.map = new OpenLayers.Map({\n\t\t\t\t \t\t\tdiv: $scope.divref,\n\t\t\t\t \t\t\tprojection:mercator,\n\t\t\t\t \t\t\tlayers: $scope.mapAllLayers,\n\t\t\t\t \t\t\tcontrols: [\n\t\t\t\t \t\t\t\tnew OpenLayers.Control.Navigation(),\n\t \t\t\t\t\tnew OpenLayers.Control.ArgParser(),\n\t \t\t\t\t\tnew OpenLayers.Control.Attribution()\n\t\t\t\t \t\t\t]\n\t\t\t\t \t\t});\n\t\t \t\t\n\n\t\t\t \t$scope.map.setCenter($scope.mapLocalisation.lonlat, $scope.mapLocalisation.zoom);\n \t\n\n\t\t \t}", "function centrer() {\n\tmap.setView(new L.LatLng(46.4328, 6.9136), 15);\n}", "setCenter() {\n this.cx = this.x + this.width / 2;\n this.cy = this.y + this.height / 2;\n }", "function initMap(){\n \n var icon = {\n url: \"marker2.gif\", // url\n scaledSize: new google.maps.Size(50, 50), // scaled size\n };\n var icon2 = {\n url: \"map-marker.png\", // url\n scaledSize: new google.maps.Size(30, 30), // scaled size\n };\n \n //var pos={lat: 40.417181, lng: -3.700823};\n var pos={lat: parseFloat(getCookie('lat')), lng: parseFloat(getCookie('lng'))};\n \n map = new google.maps.Map(document.getElementById('map'), {\n center: pos,\n zoom: 12\n });\n \n marker = new google.maps.Marker({\n position: pos,\n map: map,\n icon: icon,\n optimized: false\n });\n \n // Create the DIV to hold the control and call the CenterControl()\n // constructor passing in this DIV.\n var centerControlDiv = document.createElement('div');\n var centerControl = new CenterControl(centerControlDiv, map);\n\n centerControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(centerControlDiv);\n\n //marker.setAnimation(google.maps.Animation.BOUNCE);\n \n //get people near by\n\n $.ajax({\n type: \"GET\",\n url: host+'/api/people-near-by/'+getCookie('user'),\n success: function(data){\n //alert(data); // show response from the php script.\n\n console.log(data);\n\n // The location of Uluru\n var uluru = {lat: parseFloat(getCookie('lat')), lng: parseFloat(getCookie('lng'))};\n // The map, centered at Uluru\n var map = new google.maps.Map(\n document.getElementById('view2'), {\n zoom: 8, \n center: uluru,\n });\n // The marker, positioned at Uluru\n\n var locations = JSON.parse(data);\n console.log(locations);\n\n var infowindow = new google.maps.InfoWindow();\n\n var marker, i;\n\n for (i = 0; i < locations.length; i++) { \n marker = new google.maps.Marker({\n position: new google.maps.LatLng(locations[i][1], locations[i][2]),\n map: map,\n icon: icon2\n });\n\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent(locations[i][0]);\n infowindow.open(map, marker);\n }\n })(marker, i));\n }\n\n marker = new google.maps.Marker({\n position: new google.maps.LatLng(parseFloat(getCookie('lat')), parseFloat(getCookie('lng'))),\n map: map,\n icon: icon,\n optimized: false\n });\n \n // Create the DIV to hold the control and call the CenterControl()\n // constructor passing in this DIV.\n var centerControlDiv = document.createElement('div');\n var centerControl = new CenterControl(centerControlDiv, map);\n\n centerControlDiv.index = 1;\n map.controls[google.maps.ControlPosition.TOP_LEFT].push(centerControlDiv);\n\n //marker.setAnimation(google.maps.Animation.BOUNCE);\n\n google.maps.event.addListener(marker, 'click', (function(marker, i) {\n return function() {\n infowindow.setContent('Your Location');\n infowindow.open(map, marker);\n }\n })(marker, i));\n \n }\n });\n}", "function setCenter(latlng) {\n var z = Math.pow(2, map.getZoom());\n var pnt = map.getProjection().fromLatLngToPoint(latlng);\n map.setCenter(map.getProjection().fromPointToLatLng(\n new google.maps.Point(pnt.x + 150 / z, pnt.y)));\n}", "function panAcaServ(){\n map.setView(new ol.View({\n center: acaService,\n zoom: 19\n }));\n}", "function initMap() {\n map = new google.maps.Map( document.getElementById( 'map' ),\n { center: { lat: 41.3326, lng: -72.9475 },\n zoom: origZoom,\n styles: [ { \"featureType\": \"poi\", \"stylers\": [ { \"visibility\": \"off\" } ] } ]\n }\n );\n // origMapCenter = new google.maps.LatLng( 41.3326, -72.9475 );\n origMapCenter = map.getCenter();\n}", "function ChangeCenter({ center }) {\n const map = useMap();\n map.setView(center);\n\n return null;\n}", "function setComponents() {\n if (_options.mapDivId) {\n var map = _config.getMap();\n if (map) {\n // Register listener for maximum and minimum zoom levels.\n map.events.on({\n zoomend : zoomEndListener\n });\n // Render map to its position.\n map.render(_options.mapDivId);\n var layers = _config.getLayers();\n if (layers) {\n setLayers(map, layers);\n // Create legend and controller asynchronously to make sure\n // proper information is used immediately after layers are\n // included into map above.\n setTimeout(function() {\n // Set legend synchronously before creating controller below.\n // Then, controller can be created with proper width.\n setLegend();\n // Notice, slider controller needs to be created before\n // animation layers trigger events. Then, layer event callbacks\n // have always target elements in controller. Controller is\n // created asynchronously here with zero timeout. Layers are\n // included into the map below synchronously but animation\n // triggers events asynchronously. Therefore, asynchronously\n // started synchronous operations for legend and controller\n // are finished before layer events are triggered.\n createController();\n // Set listeners to update legend according to animation layer events.\n setAnimationLegendEventListener(layers);\n setupSwitcher(map, _options.layerSwitcherDivId, _options.maximizeSwitcher);\n }, 0);\n }\n // Zoom the map after layers have been inserted.\n // Map center refresh value is used if it is available.\n var mapCenter = _refreshDefaultCenter || map.getCenter();\n if (!mapCenter) {\n // Map may not have center available even if it has been defined in config.\n // Then, calculate center from the maximum extent to make sure map can be shown.\n mapCenter = map.getMaxExtent().getCenterLonLat();\n }\n map.setCenter(mapCenter, undefined === _refreshDefaultZoomLevel ? _config.getDefaultZoomLevel() : _refreshDefaultZoomLevel);\n }\n }\n }", "function initialize(){\r\n mapOptions = {\r\n center: new google.maps.LatLng(39.8106, -97.0569),\r\n zoom: 4,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP,\r\n panControl: true\r\n };\r\n}", "function initialize() {\n var center = new google.maps.LatLng(22.3511148,78.6677428);\n var mapOptions = {\n zoom: 5,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n center: center,\n };\n this.map = new google.maps.Map(document.getElementById('map_canvas'),\n mapOptions);\n}", "function setZoomControl() {\n var zoomControl = L.control.zoom({position:'bottomright'});\n map.addControl(zoomControl);\n}", "function NationalMapController(mapId, $layerControls, $zoomControls) {\n this.mapId = mapId;\n this.$layerControls = $layerControls;\n this.$zoomControls = $zoomControls;\n}", "function centerMap() {\n var latlngbounds = new google.maps.LatLngBounds();\n vm.currentHike.path.forEach(function (waypoint) {\n latlngbounds.extend(waypoint)\n })\n vm.map.fitBounds(latlngbounds);\n }", "function EditControl(controlDiv, map) {\n\n // Set CSS for the control border.\n var controlUI = document.createElement('div');\n controlUI.style.backgroundColor = '#fff';\n controlUI.style.border = '2px solid #fff';\n controlUI.style.borderRadius = '3px';\n controlUI.style.boxShadow = '0 2px 6px rgba(0,0,0,.3)';\n controlUI.style.cursor = 'pointer';\n controlUI.style.marginTop = '10px';\n controlUI.style.marginRight = '13px';\n controlUI.style.textAlign = 'center';\n controlUI.title = 'Edit points on map (for authenticated users)';\n controlDiv.appendChild(controlUI);\n\n // Set CSS for the control interior.\n var controlText = document.createElement('div');\n controlText.style.color = 'rgb(25,25,25)';\n controlText.style.fontFamily = 'Roboto,Arial,sans-serif';\n controlText.style.fontSize = '14px';\n controlText.style.lineHeight = '35px';\n controlText.style.paddingLeft = '5px';\n controlText.style.paddingRight = '5px';\n controlText.innerHTML = '<img src=\"static/icons/trash-2.svg\" alt=\"Remove points\"></img>';\n controlUI.appendChild(controlText);\n\n // Setup the click event listeners:.\n controlUI.addEventListener('click', function () {\n if (document.getElementById('logoutElem')) {\n map.setOptions({ draggableCursor: 'not-allowed' });\n mapMarkers.forEach(function (marker) {\n google.maps.event.addListenerOnce(marker, 'click', function () {\n var infoDeletePlaceContentElem = document.getElementById('deletePlaceForm');\n infoDeletePlaceContentHTML = infoDeletePlaceContentElem.innerHTML;\n infoDeletePlaceContentHTML.className = 'delete-place-visible';\n infoDeletePlaceContent = infoDeletePlaceContentHTML;\n console.log(infoDeletePlaceContent);\n infowindow.setContent(infoDeletePlaceContent);\n infowindow.open(map, marker);\n\n document.getElementById(\"deletePlaceName\").value = marker.name;\n document.getElementById(\"deletePlaceCategory\").value = marker.category_description;\n })\n })\n } else {\n var loginButton = document.getElementById('loginElem');\n loginButton.click();\n }\n });\n}", "function setMapCenter(latitude, longitude){\n map.panTo(new google.maps.LatLng(\n latitude,\n longitude\n ));\n}", "function CloudController(divId) {\n\tthis.container = document.getElementById(divId); \n}", "function mapper_center() {\n var markers = map_markers;\n if (markers == null || markers.length < 1 ) return;\n var bounds = new GLatLngBounds();\n for (var i=0; i<markers.length; i++) {\n bounds.extend(markers[i].getPoint());\n }\n var thezoom = map.getBoundsZoomLevel(bounds);\n if(thezoom > 15 ) thezoom = 15;\n map.setCenter( bounds.getCenter( ), thezoom );\n}", "function CameraControl () {\n this.cameraId = 1;\n this.minZoom = 4000;\n this.maxZoom = 8000; //max is 11800, this is the max value for P60\n}", "centre(){\n this.map.fitBounds(this.bounds)\n }", "function setCenter(map, center) {\n if (center) {\n map.instance.setCenter(new google.maps.LatLng(center.latitude, center.longitude));\n }\n else {\n navigator.geolocation.getCurrentPosition(function (position) {\n var center = position;\n map.instance.setCenter(new google.maps.LatLng(center.coords.latitude, center.coords.longitude));\n });\n }\n}", "function initChart() {\n if (!showChart) {\n return\n }\n\n addTimelineChart(ee.Geometry(Map.getCenter(true)).centroid(10));\n\n Map.onClick(function (coords) {\n coords = ee.Dictionary(coords);\n print('Map clicked: ', coords);\n let newCenter = ee.Geometry.Point([coords.get('lon'), coords.get('lat')]);\n addTimelineChart(newCenter)\n })\n }", "function addCanberraCentreMarker(map) {\n // Canberra Centre\n var canberraCentre = new google.maps.LatLng(-35.2792284, 149.1321033);\n var markerCanberraCentre = new google.maps.Marker({\n position: canberraCentre,\n });\n\n markerCanberraCentre.setMap(map);\n\n var infoCanberraCentre = new google.maps.InfoWindow({\n content: \"Canberra Centre\"\n });\n\n google.maps.event.addListener(markerCanberraCentre, 'click', function () {\n infoCanberraCentre.open(map, markerCanberraCentre);\n });\n}", "setCenter() {\n this.center = createVector(this.x, this.y);\n }", "function initMap() {\n var centerTarget = {lat: Number(item.mapY) ,lng: Number(item.mapX)};\n map = new google.maps.Map(document.getElementById('map'), {\n zoom: 12,\n center: centerTarget\n });\n\n new google.maps.Marker({\n position: centerTarget,\n map: map,\n icon: '/APIcamp/img/marker.png'\n });\n }", "function mapInitialize() {\n city = new google.maps.LatLng(37.70, -122.10);\n map = new google.maps.Map(document.getElementById('map-canvas'), {\n center: city,\n zoom: 10,\n zoomControlOptions: {\n position: google.maps.ControlPosition.LEFT_CENTER,\n style: google.maps.ZoomControlStyle.SMALL\n },\n streetViewControlOptions: {\n position: google.maps.ControlPosition.LEFT_BOTTOM\n },\n mapTypeControl: false,\n panControl: false\n });\n clearTimeout(self.mapRequestTimeout);\n\n google.maps.event.addDomListener(window, \"resize\", function() {\n var center = map.getCenter();\n google.maps.event.trigger(map, \"resize\");\n map.setCenter(center); \n });\n\n infowindow = new google.maps.InfoWindow({maxWidth: 300});\n }", "constructor( container ) {\n\t\tthis.container = container;\n\t\tthis.map = new google.maps.Map( container, {\n\t\t\tstyles: locsearch.map_attributes.styles,\n\t\t});\n\t\tthis.markers = [];\n\t\tif( typeof MarkerClusterer === 'function' && locsearch.map_attributes.clusters_image ) {\n\t\t\tthis.markerClusterer = new MarkerClusterer( this.map, [], locsearch.map_attributes.clusters_image );\n\t\t} else {\n\t\t\tthis.markerClusterer = null;\n\t\t}\n\t\tthis.resetMapLocation();\n\t}", "function initMap() {\r\n\r\n\t//Map start init - location New York\r\n var mapOptions = {\r\n scaleControl: true,\r\n center: new google.maps.LatLng(40.705002, -73.983450),\r\n zoom: 9,\r\n disableDefaultUI: true,\r\n mapTypeId: google.maps.MapTypeId.ROADMAP\r\n };\r\n \r\n var map = new google.maps.Map(document.getElementById('map'),mapOptions);\r\n var marker = new google.maps.Marker({\r\n map: map,\r\n position: map.getCenter() \r\n });\r\n}", "function initRecenterButton() {\n // Create a div that holds the cow-dropping button.\n var recenterBtnContainer = document.createElement('div');\n recenterBtnContainer.style.padding = \"10px 10px 0px 0px\";\n\n // Set the CSS for the button's border.\n var recenterBtnBorder = document.createElement('div');\n //cowBtnBorder.style.backgroundColor = 'rgba(43, 132, 237, 1.0)';\n recenterBtnBorder.style.cursor = 'pointer';\n recenterBtnBorder.style.textAlign = 'center';\n recenterBtnContainer.appendChild(recenterBtnBorder);\n\n // Set the CSS for the button's interior content.\n recenterBtnText = document.createElement('div');\n //cowBtnText.style.color = '#fff';\n recenterBtnText.className = \"recenterBtn\";\n recenterBtnText.style.fontFamily = 'Arial,sans-serif';\n recenterBtnText.style.fontSize = '16px';\n recenterBtnText.style.lineHeight = '38px';\n recenterBtnText.style.paddingLeft = '10px';\n recenterBtnText.style.paddingRight = '10px';\n recenterBtnText.style.borderRadius = '10px';\n recenterBtnText.style.boxShadow = '0 2px 6px rgba(0, 0, 0, 0.3)';\n recenterBtnText.innerHTML = 'Recenter';\n recenterBtnBorder.append(recenterBtnText);\n\n // Inserts the finished button to the right-center area of the map.\n googleMapObject.controls[google.maps.ControlPosition.TOP_RIGHT].push(recenterBtnContainer);\n\n // Setup the map listener for the button.\n google.maps.event.addDomListener(recenterBtnContainer, 'click', recenterListener);\n}", "function initialize() {\n\tvar newlng = userlng*jump;\n\tvar mapOptions = {\n \t\tcenter: new google.maps.LatLng(77.3539357714852, newlng, true),\n \t\tzoom: 3,\n \t\tstreetViewControl: false,\n \t\tmapTypeControlOptions: {\n \t\tmapTypeIds: [\"canvas\"]\n \t},\n \tbackgroundColor: \"#fff\",\n \tdisableDefaultUI: true,\n\t};\n\tcanvasMap = new google.maps.Map(document.getElementById(\"map\"), mapOptions);\n\tcanvasMap.mapTypes.set('canvas', canvasMapType);\n\tcanvasMap.setMapTypeId('canvas');\n\t/*canvasMap.panBy(size,0);\n\tjump = canvasMap.getCenter().lng();\n\tconsole.log(\"jump:\",jump);\n\t//target position on wall\n\tvar newlng = userlng*jump;\n\tcanvasMap.setCenter(new google.maps.LatLng(77.3539357714852, newlng, true));*/\n\t//hide loading screen when ready\n\tgoogle.maps.event.addListener(canvasMap, 'tilesloaded', function() {\n \t$(\"#loadShade\").fadeOut(1000);\n \t});\n}", "get center ( ) { return this._center; }" ]
[ "0.8013828", "0.7968754", "0.77727115", "0.76235056", "0.75115454", "0.75090045", "0.7507734", "0.7456348", "0.6888448", "0.688808", "0.6839767", "0.6628802", "0.6518375", "0.629978", "0.62581444", "0.61835754", "0.61082137", "0.60353446", "0.5949223", "0.59388125", "0.5936199", "0.58834934", "0.5840812", "0.58249134", "0.57876027", "0.5741325", "0.5741325", "0.5741325", "0.5701077", "0.5698842", "0.56553876", "0.56258684", "0.56085116", "0.55951923", "0.55893373", "0.5563348", "0.55560917", "0.55397284", "0.5535731", "0.55312693", "0.5505664", "0.5504634", "0.5498842", "0.54942524", "0.5488115", "0.54819626", "0.5481523", "0.5441014", "0.5423335", "0.54178363", "0.54171336", "0.5407337", "0.53946966", "0.53633", "0.536025", "0.5352111", "0.5349236", "0.5345886", "0.5343535", "0.5342427", "0.5339353", "0.533488", "0.53277427", "0.53261137", "0.5313919", "0.52615976", "0.5245209", "0.52400297", "0.5239799", "0.5208172", "0.5197755", "0.5193825", "0.5186172", "0.51789284", "0.5172411", "0.51693785", "0.5162086", "0.51503015", "0.51448244", "0.51415783", "0.51299787", "0.5122299", "0.5116", "0.51137125", "0.5113603", "0.51134515", "0.5099609", "0.50970256", "0.50888747", "0.5086643", "0.50861496", "0.5082845", "0.5073356", "0.5065769", "0.50647515", "0.5062012", "0.50589657", "0.50566673", "0.505511", "0.50505054" ]
0.8255781
0
Clear WebGL (depth) after 1min of run
function clearDepth() { renderer.clearDepth(1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "cleanupWebGL() {}", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl2\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function setupWebGL() {\r\n\r\n // Get the canvas and context\r\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\r\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\r\n \r\n try {\r\n if (gl == null) {\r\n throw \"unable to create gl context -- is your browser gl ready?\";\r\n } else {\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\r\n gl.clearDepth(1.0); // use max when we clear the depth buffer\r\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\r\n }\r\n } // end try\r\n \r\n catch(e) {\r\n console.log(e);\r\n } // end catch\r\n \r\n} // end setupWebGL", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function setupWebGL() {\n\n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "destroyWebGL() {\n // if you want to totally remove the WebGL context uncomment next line\n // and remove what's after\n //this.curtains.dispose();\n\n // if you want to only remove planes and shader pass and keep the context available\n // that way you could re init the WebGL later to display the slider again\n if(this.shaderPass) {\n this.curtains.removeShaderPass(this.shaderPass);\n }\n\n for(var i = 0; i < this.planes.length; i++) {\n this.curtains.removePlane(this.planes[i]);\n }\n }", "clearBuffers()\n {\n this.gl.clear(this.gl.COLOR_BUFFER_BIT | this.gl.DEPTH_BUFFER_BIT);\n }", "reset() {\n this._renderer.reset();\n this._config = new WebGLConfiguration(this._renderer.state);\n }", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders();\r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "async function initGL() {\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n setUpBuffers();\n await setUpTextures();\n\n // set the clear color here\n gl.clearColor(0.5, 0.5, 0.5, 1);\n}", "function startup() {\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick();\n}", "reset() {\n // WebGL context\n this.gl = this.renderer.gl;\n\n // clear the vertex data buffer\n this.vertexData.clear();\n }", "function main() {\n const canvas = document.getElementById('main');\n\n const windowHeight = window.innerHeight;\n const windowWidth = window.innerWidth;\n\n canvas.height = windowHeight;\n canvas.width = windowWidth;\n\n const gl = canvas.getContext('webgl');\n\n gl.clear(gl.COLOR_BUFFER_BIT);\n gl.clearColor(0, 0, 0, 1);\n }", "function webGLStart() {\n var canvas = document.getElementById(\"webglcanvas\");\n initGL(canvas);\n initShaders();\n initBuffers();\n \n // Prior to drawing the scene , clear color\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n \n drawScene();\n }", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n \n // Get the canvas and context\n var canvas = document.getElementById(\"myWebGLCanvas\"); // create a js canvas\n gl = canvas.getContext(\"webgl\"); // get a webgl object from it\n \n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders();\n setupBuffers_aff();\n gl.clearColor(1.0, 1.0, 1.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n tick()\n}", "function clear_screen(){\r\n if (tracing) return;\r\n ctx.clearRect(0, 0, cnvs.width, cnvs.height);\r\n}", "function initWebGL() {\r\n c = document.getElementById(\"c\");\r\n gl = c.getContext(\"webgl2\") || c.getContext(\"experimental-webgl2\");\r\n gl.enable(gl.DEPTH_TEST);\r\n //spector.displayUI();\r\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n //setupShaders(\"shader-vs\",\"shader-fs\");\n //setPhongShader();\n setGouraudShader();\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT);\n gl.enable(gl.DEPTH_TEST);\n gl.enable(gl.CULL_FACE);\n gl.frontFace(gl.CCW);\n gl.cullFace(gl.BACK);\n\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function initWebGL() {\n try { \n gl = canvas.getContext('webgl') || canvas.getContext('experimental-webgl'); \n } catch(e) {\n }\n \n if (gl) {\n WIDTH = canvas.clientWidth.toFixed(1);\n HEIGHT = canvas.clientHeight.toFixed(1);\n ui = new UI();\n ui.setObjects(generateScene());\n\t\tresult.ui = ui;\n var start = new Date();\n setInterval(function(){ tick((new Date() - start) * 0.001); }, 1000 / 60);\n } else {\n alert('Your browser does not support WebGL.');\n }\n}", "function startup() {\n canvas = document.getElementById(\"glCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.viewport(0, 0, gl.viewportWidth, gl.viewportHeight);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(\"shader-blinn-phong-vs\",\"shader-blinn-phong-fs\");\n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n previousT = Date.now();\n tick();\n}", "function cleanScene() {\n gl.clearColor(0.3, 0.3, 0.3, 1.0); // Clear to black, fully opaque\n gl.clearDepth(1.0); // Clear everything\n gl.enable(gl.DEPTH_TEST); // Enable depth testing\n gl.depthFunc(gl.LEQUAL); // Near things obscure far things\n\n // Clear the canvas before we start drawing on it.\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n clearBuffers();\n}", "function main() {\n webgl.checkAspectRatio();\n webgl.lightingToggle(config.modes.lightingMode.currstate);\n webgl.viewModeToggle(config.modes.viewMode.currstate);\n webgl.zooming(config.core.positions.zoomRatio);\n webgl.rotation(config.core.positions.angleX, config.core.positions.angleY, config.modes.rotateMode.currstate);\n let currentTime = new Date().getTime();\n document.getElementsByClassName(\"FPS\")[0].innerText = parseInt(fpsCount / (currentTime - startTime) * 1000);\n fpsCount++;\n requestAnimationFrame(main);\n }", "function initGL() {\r\n \"use strict\";\r\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\r\n setUpAttributesAndUniforms();\r\n setUpBuffers();\r\n gl.clearColor(1,0,0,0.5);\r\n}", "function startup() {\r\n \tcanvas = document.getElementById(\"myGLCanvas\");\r\n \tgl = createGLContext(canvas);\r\n \tsetupShaders(); \r\n \tsetupBuffers();\r\n \tgl.clearColor(1.0, 1.0, 1.0, 1.0);\t//white background\r\n \tgl.enable(gl.DEPTH_TEST);\r\n \ttick();\r\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0.1, 0.1, 0.1, 1);\n}", "initGL() {\n \"use strict\";\n this.ctx.shaderProgram = loadAndCompileShaders(\n this.gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n this.setUpAttributesAndUniforms();\n this.setUpShapes();\n\n // set the clear color here\n this.gl.clearColor(0.2, 0.2, 0.2, 1); //-> damit wird alles übermalen (erst wenn clear)\n\n // add more necessary commands here\n }", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupShaders(); \n setupBuffers();\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST); //check the draw is right\n // gl.enable(gl.CULL_FACE); //check the draw is right\n //gl.cullFace(gl.BACK); \n tick();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n \n gl.clearColor(0, 0, 0, 1);\n}", "function startup() {\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n gl.enable(gl.DEPTH_TEST);\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n light = vec4.fromValues(0.,0,10.,1.);\n setupShadersPot();\n setupShaders();\n setupReflectiveShader();\n setupBuffers();\n setupTextures();\n tick();\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n loadTexture();\n\n // set the clear color here\n // NOTE(TF) Aufgabe 1 / Frage:\n // clearColor() only sets the color for the buffer, but doesn't actually do anything else.\n // clear() has to be called in order for the color to be painted.\n gl.clearColor(0.8, 0.8, 0.8, 1.0);\n\n // add more necessary commands here\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(\n gl,\n \"VertexShader.glsl\",\n \"FragmentShader.glsl\"\n );\n setUpAttributesAndUniforms();\n setUpBuffers();\n\n gl.clearColor(0.8, 0.8, 0.8, 1);\n}", "function clearCanvas(){\r\n g_colors = [];\r\n g_points = [];\r\n // Specify the color for clearing <canvas> ===================\r\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\r\n // Clear <canvas>\r\n gl.clear(gl.COLOR_BUFFER_BIT);\r\n}", "function main() {\n let gl;\n let view;\n let controller;\n window.onload = ev => {\n //retrieve <canvas> element\n var canvas = document.querySelector(\"#glCanvas\");\n if (!canvas) {\n console.log(\"Failed to retrieve the <canvas> element\");\n return;\n }\n //get the rendering context for webgl\n gl = WebGLUtils.setupWebGL(canvas, { 'antialias': false, 'alpha': false, 'depth': true, 'stencil': false });\n // Only continue if WebGL is available and working\n if (gl == null) {\n alert(\"Unable to initialize WebGL. Your browser or machine may not support it.\");\n return;\n }\n console.log(\"Window loaded\");\n view = new View_1.View(gl);\n controller = new Controller_1.Controller(view);\n controller.go();\n var tick = function () {\n if (lastTime == -1) {\n lastTime = new Date().getTime();\n }\n numFrames = numFrames + 1;\n if (numFrames >= 100) {\n let currentTime = new Date().getTime();\n let frameRate = 1000 * numFrames / (currentTime - lastTime);\n lastTime = currentTime;\n document.getElementById('frameratedisplay').innerHTML = \"Frame rate: \" + frameRate.toFixed(1);\n numFrames = 0;\n }\n view.animate();\n view.draw();\n //this line sets up the animation\n requestAnimationFrame(tick);\n };\n //call tick the first time\n tick();\n };\n window.onbeforeunload = ev => view.freeMeshes();\n }", "handleWebGLContextLost() {\n ol.obj.clear(this.bufferCache_);\n ol.obj.clear(this.shaderCache_);\n ol.obj.clear(this.programCache_);\n this.currentProgram_ = null;\n }", "function initGL() {\r\n var canvas = document.getElementById(\"webGLcanvas\");\r\n canvas.width = window.innerWidth - 30;\r\n canvas.height = Math.floor(window.innerHeight - 0.25 * window.innerHeight);\r\n try {\r\n gl = canvas.getContext(\"experimental-webgl\");\r\n gl.viewportWidth = canvas.width;\r\n gl.viewportHeight = canvas.height;\r\n } catch (e) {\r\n }\r\n if (!gl) {\r\n alert(\"cannot initialize webGL\");\r\n }\r\n\r\n document.onkeydown = handleKeyDown;\r\n document.onkeyup = handleKeyUp;\r\n canvas.onmousedown = handleMouseDown;\r\n document.onmouseup = handleMouseUp;\r\n document.onmousemove = handleMouseMove;\r\n\r\n // fragprogram = initShaders(\"perfrag-shader-fs\", \"perfrag-shader-vs\");\r\n vertprogram = initShaders(\"shader-fs\", \"shader-vs\");\r\n currentProgram = vertprogram;\r\n gl.clearColor(0.13, 0.13, 0.13, 1);\r\n gl.enable(gl.DEPTH_TEST);\r\n\r\n fpsInterval = 1000 / 15;\r\n then = Date.now();\r\n startTime = then;\r\n // initBuffer();\r\n cornerVertexPosBuffer = gl.createBuffer();\r\n pointLightPos = [\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n rand(-3, 7),rand(-3, 7),rand(-3, 7),\r\n ];\r\n pointLightColor = [\r\n rand(0, 0.5),rand(0.4, 1),rand(0.4, 1),\r\n rand(0.4, 1),rand(0.4, 1),rand(0, 0.5),\r\n rand(0.4, 1),rand(0.4, 1),rand(0.4, 1),\r\n rand(0, 0.5),rand(0, 0.5),rand(0, 0.5),\r\n rand(0.4, 1),rand(0, 0.5),rand(0.4, 1),\r\n ];\r\n \r\n numPtLights = 5;\r\n\r\n animate();\r\n}", "function initGL() {\n \"use strict\";\n ctx.shaderProgram = loadAndCompileShaders(gl, 'VertexShader.glsl', 'FragmentShader.glsl');\n setUpAttributesAndUniforms();\n setUpBuffers();\n setupWorldCoordinates();\n gl.clearColor(0.1, 0.1, 0.1, 1);\n startLoop();\n}", "destroy() {\n this.buffers.forEach((buffer) => {\n gl.deleteBuffer(buffer);\n });\n this.buffers = new Map();\n }", "function reset(){\n // I had to add the following two lines to fix a random bug\n // where bufferSubData returned two errors... There didn't appear to be any rhyme or rythme to \n // the errors :?\n // [.WebGLRenderContext-0x19dd9bb4300]\n // GL ERROR :GL_INVALID_VALUE : glBufferSubData: out of range\n // [.WebGLRenderingContext-0x19dd9bb4300]\n // GL ERROR :GL_INVALID_OPERATION : glDrawArrays: attempt to access out of range vertices in attribute 0\n gl.bindBuffer(gl.ARRAY_BUFFER, vBuffer);\n gl.bufferData( gl.ARRAY_BUFFER, sizeof['vec3'] * maxVertices, gl.STATIC_DRAW );\n\n // reset the polygon data\n vertices = [];\n edges = [];\n index = 0;\n // reset the transformation data\n trans = [0.0, 0.0, 0.0];\n theta = 0;\n mv = mat4();\n transList = [];\n // reset the vertex counter\n setHtmlUi();\n setHtmlDetails(\"\");\n}", "function startup() {\n console.log(\"Startup Function Called\");\n\n // get canvas to render model on\n canvas = document.getElementById(\"myGLCanvas\");\n\n // create context\n gl = createGLContext(canvas);\n\n // Setup the shaders and buffers\n setupShaders();\n setupBuffers();\n\n // Set the clear color to white\n gl.clearColor(1, 1, 1, 1);\n\n gl.enable(gl.DEPTH_TEST);\n\n // Call tick function, which will then be called every subsequent animation frame\n tick();\n}", "function clear() {\n GAME.context.clear();\n }", "postrender() {\n this.gl.flush();\n }", "function clearCanvas() {\nscene.clearGeometry();\n}", "reset() {\n\t\tvar objects = this._vptGData.vptBundle.objects;\n\t\twhile (objects.length !== 0) {\n\t\t\tvar object = objects.pop();\n\t\t\tobject.switchRenderModes(false);\n\t\t\tvar tex = object.material.maps[0];\n\t\t\tthis._glManager._textureManager.clearTexture(tex);\n\t\t\tif (object._volumeTexture)\n\t\t\t\tthis._gl.deleteTexture(object._volumeTexture);\n\t\t\tif (object._environmentTexture)\n\t\t\t\tthis._gl.deleteTexture(object._environmentTexture);\n\t\t}\n\t\tthis._vptGData.vptBundle.mccStatus = false;\n\t\tthis._vptGData.vptBundle.resetBuffers = true;\n\t\t//this._vptGData._updateUIsidebar();\n\t}", "function startup(){\n canvas = document.getElementById(\"myGLCanvas\");\n gl = createGLContext(canvas);\n setupSkyboxShaders()\n setupSkyboxBuffers()\n setupTeapotShaders()\n setupMesh(\"teapot.obj\")\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n mat4.scale(mvMatrix,mvMatrix,[.02,.02,.02])\n gl.enable(gl.DEPTH_TEST)\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n tick();\n}", "function clearScene() {\n\tcontext.save();\n\tcontext.setTransform(h, 0.0, 0.0, -h, 0.0, h);\n\tcontext.clearRect(0, 0, w, h);\n\tcontext.restore();\n}", "setClearDepth (depth) {\n\t\t\t\tif (this._clearDepth !== depth) {\n\t\t\t\t\t\tthis._gl.clearDepth(depth);\n\t\t\t\t\t\tthis._clearDepth = depth;\n\t\t\t\t}\n\t\t}", "function draw(time){\r\n\tif(!use2D){\r\n\t\tctx.setBuffer(null);\r\n\t\tctx.viewport(0, 0, ctx.viewportWidth, ctx.viewportHeight);\r\n\t\tvar alpha = clearColor[3];\r\n\t\tctx.clearColor(clearColor[0]*alpha, clearColor[1]*alpha, clearColor[2]*alpha, alpha);\r\n\t\tctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);\r\n\t\t\r\n\t\tctx.setBuffer(colorBuffer);\r\n\t\tctx.viewport(0, 0, ctx.viewportWidth, ctx.viewportHeight);\r\n\t\t//ctx.clearColor(clearColor[0]*alpha, clearColor[1]*alpha, clearColor[2]*alpha, alpha);\r\n\t\tctx.clearColor(0,0,0,0);\r\n\t\tctx.clear(ctx.COLOR_BUFFER_BIT | ctx.DEPTH_BUFFER_BIT);\r\n\t}else{\r\n\t\tctx.clearRect(0,0,canvas.width,canvas.height);\r\n\t\tctx.fillStyle = rgb(clearColor);\r\n\t\tctx.globalAlpha = clearColor[3];\r\n\t\tctx.fillRect(0,0,canvas.width,canvas.height);\r\n\t}\r\n\t\r\n\tmat4.ortho(pMatrix, -0, 1*aspectRatio, -1, 0, -1, 1);\r\n\tmat4.identity(mvMatrix);\r\n\t\r\n\tif(useStates){\r\n\t\tStates.draw(ctx);\r\n\t}\r\n\t\r\n\t//Draw the stateless world\r\n\tworld.transform(ctx);\r\n\tworld.draw(ctx);\r\n\tworld.unTransform(ctx);\r\n\t\r\n\tif(!use2D){\r\n\t\tctx.clearColor(0, 0, 0, 0);\r\n\t\teffects.apply(ctx, colorBuffer);\r\n\t\t\r\n\t\tctx.useProgram(shaderProgram);\r\n\t\t\r\n\t\tctx.bindTexTo(colorBuffer.texture, shaderProgram.samplerUniform);\r\n\t\t\r\n\t\tctx.uniform1f(shaderProgram.alpha, 1.0);\r\n\t\t\r\n\t\tctx.setBuffer(null);\r\n\t\t\r\n\t\tctx.drawScreenBuffer(shaderProgram);\r\n\t}\r\n\t\r\n\tif(showConsole){\r\n\t\tif(!use2D){\r\n\t\t\tbrineConsole = document.getElementById(\"console\");\r\n\t\t\tif(brineConsole != null && brineConsole != undefined){\r\n\t\t\t\tvar text = \"\";\r\n\t\t\t\tfor(var node = log.head; node !== null; node = node.link){\r\n\t\t\t\t\ttext = node.item+\"<br/>\"+text;\r\n\t\t\t\t}\r\n\t\t\t\tbrineConsole.innerHTML = text;\r\n\t\t\t}\r\n\t\t\tbrineConsole.style.visibility = \"visible\";\r\n\t\t}else{\r\n\t\t\tctx.fillStyle = \"#ffffff\";\r\n\t\t\tctx.globalAlpha = 0.25;\r\n\t\t\tctx.fillRect(0,0,canvas.width,canvas.height);\r\n\t\t\tctx.globalAlpha = 1.0;\r\n\t\t\tctx.fillStyle = \"#000000\";\r\n\t\t\t//ctx.shadowBlur = 3;\r\n\t\t\tctx.shadowColor = \"#ffffff\";\r\n\t\t\tvar lineHeight = 18;\r\n\t\t\tvar lineNumber = 0;\r\n\t\t\tfor(var node = log.head; node !== null; node = node.link){\r\n\t\t\t\tvar line = node.item;\r\n\t\t\t\t//ctx.font=\"16px Arial\";\r\n\t\t\t\t//ctx.strokeText(line, 5, canvas.height-(log.length-lineNumber)*12);\r\n\t\t\t\tctx.font = lineHeight+\"px Arial\";\r\n\t\t\t\tctx.fillText(line, 5, canvas.height-(log.length-lineNumber)*lineHeight);\r\n\t\t\t\tlineNumber++;\r\n\t\t\t}\r\n\t\t\tctx.shadowBlur = 0;\r\n\t\t}\r\n\t}else{\r\n\t\tif(brineConsole != null && brineConsole != undefined && !use2D){\r\n\t\t\tbrineConsole.innerHTML = \"\";\r\n\t\t\tbrineConsole.style.visibility = \"hidden\";\r\n\t\t}\r\n\t}\r\n\t\r\n\tvar timeDiff = time-oldDrawTime;\r\n\tbrineFPS = Math.round((1000/timeDiff)*10)/10;\r\n\tfpsCounter.html = \"FPS: \"+brineFPS;\r\n\toldDrawTime = time;\r\n}", "function main() {\n // Retrieve <canvas> element\n canvas = document.getElementById('webgl');\n\n // Get the rendering context for WebGL\n gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context \\'gl\\' for WebGL');\n return;\n }\n\n // Initialize shaders\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n var n_vcount = initVertexBuffers(gl); // vertex count.\n if (n_vcount < 0) {\n console.log('Failed to set the vertex information: n_vcount false');\n return;\n }\n\n // Set texture\n if (!initTextures()) {\n console.log('Failed to intialize the texture.');\n return;\n }\n\n // Set the clear color and enable the depth test\n gl.clearColor(0.4, 0.4, 0.4, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n uLoc_eyePosWorld = gl.getUniformLocation(gl.program, 'u_eyePosWorld');\n uLoc_ModelMatrix = gl.getUniformLocation(gl.program, 'u_ModelMatrix');\n uLoc_ProjView = gl.getUniformLocation(gl.program, 'u_ProjView');\n uLoc_NormalMatrix = gl.getUniformLocation(gl.program, 'u_NormalMatrix');\n if (!uLoc_eyePosWorld ||\n !uLoc_ModelMatrix || !uLoc_ProjView || !uLoc_NormalMatrix) {\n console.log('Failed to get GPUs matrix storage locations');\n return;\n }\n\n for (var i = 0; i < 2; i++) {\n lamps.push(new LightsT()); \n lamps[i].u_pos = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].pos'); \n lamps[i].u_ambi = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].ambi');\n lamps[i].u_diff = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].diff');\n lamps[i].u_spec = gl.getUniformLocation(gl.program, 'u_LampSet['+i+'].spec');\n if( !lamps[i].u_pos || !lamps[i].u_ambi || !lamps[i].u_diff || !lamps[i].u_spec ) {\n console.log('Failed to get GPUs Lamps['+i+'] storage locations');\n return;\n }\n }\n\n u_isLit = gl.getUniformLocation(gl.program, 'u_isLit');\n if(!u_isLit) {\n console.log('Failed to get GPUs u_isLit storage locations');\n return;\n }\n\n u_isHeadLit = gl.getUniformLocation(gl.program, 'u_isHeadLit');\n if(!u_isLit) {\n console.log('Failed to get GPUs u_isHeadLit storage locations');\n return;\n }\n\n u_ShadingMode = gl.getUniformLocation(gl.program, 'u_ShadingMode');\n if(!u_ShadingMode) {\n console.log('Failed to get GPUs u_ShadingMode storage locations');\n return;\n }\n\n u_isPhong = gl.getUniformLocation(gl.program, 'u_isPhong');\n if(!u_isPhong) {\n console.log('Failed to get GPUs u_isPhong storage locations');\n return;\n }\n\n u_TexMode = gl.getUniformLocation(gl.program, 'u_TexMode');\n if(!u_TexMode) {\n console.log('Failed to get GPUs u_TexMode storage locations');\n return;\n }\n\n u_AttMode = gl.getUniformLocation(gl.program, 'u_AttMode');\n if(!u_AttMode) {\n console.log('Failed to get GPUs u_AttMode storage locations');\n return;\n }\n\n u_isDistort = gl.getUniformLocation(gl.program, 'u_isDistort');\n if(!u_isDistort) {\n console.log('Failed to get GPUs u_isDistort storage locations');\n return;\n }\n\n // ... for Phong material/reflectance:\n matl0.uLoc_Ke = gl.getUniformLocation(gl.program, 'u_MatlSet[0].emit');\n matl0.uLoc_Ka = gl.getUniformLocation(gl.program, 'u_MatlSet[0].ambi');\n matl0.uLoc_Kd = gl.getUniformLocation(gl.program, 'u_MatlSet[0].diff');\n matl0.uLoc_Ks = gl.getUniformLocation(gl.program, 'u_MatlSet[0].spec');\n matl0.uLoc_Kshiny = gl.getUniformLocation(gl.program, 'u_MatlSet[0].shiny');\n if(!matl0.uLoc_Ke || !matl0.uLoc_Ka || !matl0.uLoc_Kd \n || !matl0.uLoc_Ks || !matl0.uLoc_Kshiny\n ) {\n console.log('Failed to get GPUs Reflectance storage locations');\n return;\n }\n\n // Init World-coord. position & colors of first light source in global vars;\n // world light\n lamps[0].I_pos.elements.set([settings.lightX, settings.lightY, settings.lightZ]);\n var ambient = settings.ambient;\n lamps[0].I_ambi.elements.set([ambient[0]/255, ambient[1]/255, ambient[2]/255]);\n var diffuse = settings.diffuse;\n lamps[0].I_diff.elements.set([diffuse[0]/255, diffuse[1]/255, diffuse[2]/255]);\n var specular = settings.specular;\n lamps[0].I_spec.elements.set([specular[0]/255, specular[1]/255, specular[2]/255]);\n\n // head light\n lamps[1].I_pos.elements = eyePosWorld;\n lamps[1].I_ambi.elements.set([1.0, 1.0, 1.0]);\n lamps[1].I_diff.elements.set([1.0, 1.0, 1.0]);\n lamps[1].I_spec.elements.set([1.0, 1.0, 1.0]);\n\n // ( MOVED: set the GPU's uniforms for lights and materials in draw()\n // function, not main(), so they ALWAYS get updated before each\n // on-screen re-drawing)\n \n winResize();\n setupDatgui();\n\n window.onkeydown = function(ev){keydown(ev, gl)};\n window.onkeyup = function(ev){keyup(ev, gl)};\n\n var tick = function() {\n animate();\n draw();\n requestAnimationFrame(tick, canvas);\n };\n tick();\n}", "function startup() {\r\n \r\n //create the translation matrix\r\n canvas = document.getElementById(\"myGLCanvas\");\r\n gl = createGLContext(canvas);\r\n setupShaders(); \r\n setupBuffers();\r\n gl.clearColor(0.0, 0.0, 0.0, 0.0);\r\n gl.enable(gl.DEPTH_TEST);\r\n tick();\r\n}", "function main() {\n const canvas = document.getElementById(\"canvas\");\n \n // Initialize WebGL rendering context\n const gl = canvas.getContext(\"webgl\");\n if (!gl) {\n alert(\"WebGL initialization failed. Please check if your browser supports it.\");\n return;\n }\n \n // Initialize shader program and position buffer\n const shaderProgram = initShaderProgram(gl);\n const posBuffer = initBuffer(gl);\n \n // Initialize textures\n initTexture(gl);\n \n // Setup shader program with uniforms and vertices\n const uniforms = initUniforms(gl, shaderProgram, myUniforms);\n const program = {\n program: shaderProgram,\n vertices: gl.getAttribLocation(shaderProgram, \"vPosition\"),\n posBuffer: posBuffer\n }; \n prepareScene(gl, program, uniforms);\n \n \n // Setup uniform values\n setupUniforms(gl, uniforms, vars);\n \n // Resize canvas to proper size\n resize();\n \n // Render loop\n function render(elapsed) {\n // Calculate time values\n vars.dt = elapsed / 1000 - vars.time;\n vars.time = elapsed / 1000;\n \n // Update uniform values\n updateUniforms(gl, uniforms, vars);\n \n // Render to screen\n gl.drawArrays(gl.TRIANGLE_STRIP, 0, 4);\n requestAnimationFrame(render);\n }\n // Loop\n requestAnimationFrame(render);\n \n // Add fullscreen\n fullScreen();\n}", "function init() {\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n setupGeometry();\n render();\n}", "function WebGLStart(){\n\n//initialize everything\n\tinit();\n\n//define the tweens\n\tdefineTweens();\n\n//draw everything\n\tdrawScene();\n\n//begin the animation\n\tanimate();\n}", "function start() {\n let canvas = document.getElementById(\"myCanvas\");\n gl = prepareWebGL(canvas);\n context.shaderProgram = gl.createProgram();\n\n loadShader(gl, context.shaderProgram)\n .finally(() => {\n prepareGlVariables();\n prepareClearColor();\n texture.object = loadTexture(gl, texture.imgSource);\n prepareScene();\n window.requestAnimationFrame(drawAnimated);\n })\n}", "function init() {\n canvas = document.createElement('canvas');\n gl = canvas.getContext('webgl');\n ratio = window.devicePixelRatio || 1;\n gl.enable(gl.BLEND);\n gl.blendFunc(gl.SRC_ALPHA, gl.ONE);\n\n update();\n createProgram();\n blankTexture = getBlankTexture();\n initQuad();\n\n document.body.appendChild(canvas);\n window.addEventListener('resize', update, false);\n initialized = true;\n }", "function clearCanvas() {\n layers = [{}, {}, {}];\n draw();\n}", "function initGL(){\n canvas=document.getElementById(\"webglCanvas\") ;\n gl=canvas.getContext(\"experimental-webgl\"); \n if(!gl){\n alert(\"cant initialize webgl context\");\n } else {\n console.log(gl.getParameter(gl.VERSION) + \" | \" + gl.getParameter(gl.VENDOR) + \" | \" + gl.getParameter(gl.RENDERER) + \" | \" + gl.getParameter(gl.SHADING_LANGUAGE_VERSION ));\n gl.clearColor(0,0,0,1);\n gl.clearDepth(1.0);\n gl.enable(gl.DEPTH_TEST);\n gl.clear(gl.DEPTH_BUFFER_BIT | gl.COLOR_BUFFER_BIT); \n }\n \n projection = new Mat4();\n modelView = new Mat4();\n modelView.setIdentity();\n\n modelView.translate(0,0,-4) ;\n projection.setFrustum(-0.1, 0.1, -0.1, 0.1, 0.1, 1000);\n\n \n}", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n\n // Get the image canvas, render an image in it\n var imageCanvas = document.getElementById(\"myImageCanvas\"); // create a 2d canvas\n var cw = imageCanvas.width, ch = imageCanvas.height; \n imageContext = imageCanvas.getContext(\"2d\"); \n var bkgdImage = new Image(); \n bkgdImage.crossOrigin = \"Anonymous\";\n bkgdImage.src = TEXTURES_URL + \"Game_Start.jpg\";\n bkgdImage.onload = function(){\n var iw = bkgdImage.width, ih = bkgdImage.height;\n imageContext.drawImage(bkgdImage,0,0,iw,ih,0,0,cw,ch); \n } // end onload callback\n \n // create a webgl canvas and set it up\n var webGLCanvas = document.getElementById(\"myWebGLCanvas\"); // create a webgl canvas\n gl = webGLCanvas.getContext(\"webgl\"); // get a webgl object from it\n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n //gl.clearColor(0.0, 0.0, 0.0, 1.0); // set bg to black\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n} // end setupWebGL", "function clearCanvas() {\n canvasContext.clearRect(0, 0, width, height);\n cancelAnimationFrame(id);\n console.log(\"Canvas Cleared\");\n }", "function renderWebGL() {\n\trenderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );\n\trenderer.setPixelRatio( window.devicePixelRatio );\n\trenderer.setSize( window.innerWidth, window.innerHeight );\n\trenderer.gammaInput = true;\n\trenderer.gammaOutput = true;\n\trenderer.powerPreference = \"high-performance\";\n}", "function main() {\n // Retrieve <canvas> element\n var canvas = document.getElementById('webgl');\n\n // Get the rendering context for WebGL\n var gl = getWebGLContext(canvas);\n if (!gl) {\n console.log('Failed to get the rendering context for WebGL');\n return;\n }\n\n // Initialize shaders\n if (!initShaders(gl, VSHADER_SOURCE, FSHADER_SOURCE)) {\n console.log('Failed to intialize shaders.');\n return;\n }\n\n Rect.colors.push(Rect.boxColors);\n // Set the vertex information\n var n = initVertexBuffers(gl);\n if (n < 0) {\n console.log('Failed to set the vertex information');\n return;\n }\n\n // Set the clear color and enable the depth test\n gl.clearColor(0.0, 0.0, 0.1, 1.0);\n gl.enable(gl.DEPTH_TEST);\n\n // Get the storage location of u_MvpMatrix\n var u_MvpMatrix = gl.getUniformLocation(gl.program, 'u_MvpMatrix');\n if (!u_MvpMatrix) {\n console.log('Failed to get the storage location of u_MvpMatrix');\n return;\n }\n var u_mode = gl.getUniformLocation(gl.program, 'u_mode');\n var vn = initTextureBuffer(gl, textCoords, u_mode, u_MvpMatrix);\n if (vn < 0) {\n console.log('Failed to set texture information');\n }\n\n document.onkeydown = function(ev){ handleKeyDown(ev);};\n document.onkeyup = function(ev){ handleKeyUp(ev); };\n var tick = function() {\n requestAnimationFrame(tick);\n handleKeys();\n draw(gl, n, u_MvpMatrix, mvpMatrix, canvas, u_mode);\n animate();\n\n };\n tick();\n}", "reset() {\n this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL, false);\n this.forceState(0);\n this._blendEq = true;\n this.blendMode = -1;\n this.setBlendMode(0);\n }", "destroy() {\n if (this.frameBuffer.stencil) {\n this.gl.deleteRenderbuffer(this.frameBuffer.stencil);\n }\n this.frameBuffer.destroy();\n\n this.frameBuffer = null;\n this.texture = null;\n }", "run() {\n var tm = this.renderer.texture;\n var managedTextures = tm.managedTextures;\n var wasRemoved = false;\n for (var i = 0; i < managedTextures.length; i++) {\n var texture = managedTextures[i];\n // only supports non generated textures at the moment!\n if (!texture.framebuffer && this.count - texture.touched > this.maxIdle) {\n tm.destroyTexture(texture, true);\n managedTextures[i] = null;\n wasRemoved = true;\n }\n }\n if (wasRemoved) {\n var j = 0;\n for (var i$1 = 0; i$1 < managedTextures.length; i$1++) {\n if (managedTextures[i$1] !== null) {\n managedTextures[j++] = managedTextures[i$1];\n }\n }\n managedTextures.length = j;\n }\n }", "function prepareClearColor() {\n let color = scene.clearColor;\n gl.clearColor(color.r, color.g, color.b, color.a);\n}", "clear() {\n this.stop();\n this.scene.remove.apply(this.scene, this.scene.children);\n this.scene.background = null;\n this.mixers.splice(0, this.mixers.length);\n this.sceneMeshes.splice(0, this.sceneMeshes.length);\n $(\"#picker\").spectrum(\"hide\");\n }", "function destroyTextures () {\n\t for (var i = 0; i < numTexUnits; ++i) {\n\t gl.activeTexture(GL_TEXTURE0 + i);\n\t gl.bindTexture(GL_TEXTURE_2D, null);\n\t textureUnits[i] = null;\n\t }\n\t values(textureSet).forEach(destroy);\n\t\n\t stats.cubeCount = 0;\n\t stats.textureCount = 0;\n\t }", "function initGL(canvas) {\n\n\tgl = canvas.getContext(\"webgl\");\n\tif (!gl) { \n\t\talert(\"Could not initialise WebGL, sorry :-(\");\n\t\treturn gl;\n\t\t}\n\tgl.viewportWidth = canvas.width;\n\tgl.viewportHeight = canvas.height;\n\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\n\tgl.enable(gl.DEPTH_TEST);\n\t\n\treturn gl;\n}", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i)\n gl.bindTexture(GL_TEXTURE_2D, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i)\n gl.bindTexture(GL_TEXTURE_2D$1, null)\n textureUnits[i] = null\n }\n values(textureSet).forEach(destroy)\n\n stats.cubeCount = 0\n stats.textureCount = 0\n }", "function clearCanvas() {\n ctx.clearRect(0, 0, 2000, 2000);\n}", "function setupWebGL() {\n \n // Set up keys\n document.onkeydown = handleKeyDown; // call this when key pressed\n\n // Get the image canvas, render an image in it\n var imageCanvas = document.getElementById(\"myImageCanvas\"); // create a 2d canvas\n var cw = imageCanvas.width, ch = imageCanvas.height; \n imageContext = imageCanvas.getContext(\"2d\"); \n var bkgdImage = new Image(); \n bkgdImage.src = \"https://ncsucgclass.github.io/prog3/stars.jpg\";\n bkgdImage.onload = function(){\n var iw = bkgdImage.width, ih = bkgdImage.height;\n imageContext.drawImage(bkgdImage,0,0,iw,ih,0,0,cw,ch); \n } // end onload callback\n \n // create a webgl canvas and set it up\n var webGLCanvas = document.getElementById(\"myWebGLCanvas\"); // create a webgl canvas\n gl = webGLCanvas.getContext(\"webgl\"); // get a webgl object from it\n try {\n if (gl == null) {\n throw \"unable to create gl context -- is your browser gl ready?\";\n } else {\n gl.clearColor(0.0, 0.0, 0.0, 1.0); // use black when we clear the frame buffer\n gl.clearDepth(1.0); // use max when we clear the depth buffer\n gl.enable(gl.DEPTH_TEST); // use hidden surface removal (with zbuffering)\n }\n } // end try\n \n catch(e) {\n console.log(e);\n } // end catch\n \n} // end setupWebGL", "function initWebGL() {\n /* Add default pointer */\n var pointers = [];\n pointers.push(new Pointer());\n /* Get webGL context */\n\n var webGL = canvas.getContext('webgl2', defualts.DRAWING_PARAMS);\n var isWebGL2 = !!webGL;\n if (!isWebGL2) webGL = canvas.getContext('webgl', defualts.DRAWING_PARAMS) || canvas.getContext('experimental-webgl', defualts.DRAWING_PARAMS);\n /* Get color formats */\n\n var colorFormats = getFormats();\n /* Case support adjustments */\n\n if (isMobile()) defualts.behavior.render_shaders = false;\n\n if (!colorFormats.supportLinearFiltering) {\n defualts.behavior.render_shaders = false;\n defualts.behavior.render_bloom = false;\n }\n /* Make our shaders and shader programs */\n\n\n var SHADER = {\n baseVertex: compileShader(webGL.VERTEX_SHADER, defualts.SHADER_SOURCE.vertex),\n clear: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.clear),\n color: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.color),\n background: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.background),\n display: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.display),\n displayBloom: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloom),\n displayShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayShading),\n displayBloomShading: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.displayBloomShading),\n bloomPreFilter: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomPreFilter),\n bloomBlur: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomBlur),\n bloomFinal: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.bloomFinal),\n splat: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.splat),\n advectionManualFiltering: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advectionManualFiltering),\n advection: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.advection),\n divergence: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.divergence),\n curl: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.curl),\n vorticity: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.vorticity),\n pressure: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.pressure),\n gradientSubtract: compileShader(webGL.FRAGMENT_SHADER, defualts.SHADER_SOURCE.gradientSubtract)\n };\n var programs = formShaderPrograms(colorFormats.supportLinearFiltering);\n /* Worker Classes and Functions */\n\n /**\n * Is It Mobile?:\n * Detects whether or not a device is mobile by checking the user agent string\n *\n * @returns {boolean}\n */\n\n function isMobile() {\n return /Mobi|Android/i.test(navigator.userAgent);\n }\n /**\n * Get Formats:\n * Enable color extensions, linear filtering extensions, and return usable color formats RGBA,\n * RG (Red-Green), and R (Red).\n *\n * @returns {{formatRGBA: {internalFormat, format}, supportLinearFiltering: OES_texture_half_float_linear,\n * formatR: {internalFormat, format}, halfFloatTexType: *, formatRG: {internalFormat, format}}}\n */\n\n\n function getFormats() {\n /* Color Formats */\n var formatRGBA;\n var formatRG;\n var formatR;\n var halfFloat;\n var supportLinearFiltering;\n /* Enables webGL color extensions and get linear filtering extension*/\n\n if (isWebGL2) {\n webGL.getExtension('EXT_color_buffer_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_float_linear');\n } else {\n halfFloat = webGL.getExtension('OES_texture_half_float');\n supportLinearFiltering = webGL.getExtension('OES_texture_half_float_linear');\n }\n\n var HALF_FLOAT_TEXTURE_TYPE = isWebGL2 ? webGL.HALF_FLOAT : halfFloat.HALF_FLOAT_OES;\n /* Set color to black for when color buffers are cleared */\n\n webGL.clearColor(0.0, 0.0, 0.0, 1.0);\n /* Retrieve color formats */\n\n if (isWebGL2) {\n formatRGBA = getSupportedFormat(webGL.RGBA16F, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RG16F, webGL.RG, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.R16F, webGL.RED, HALF_FLOAT_TEXTURE_TYPE);\n } else {\n formatRGBA = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatRG = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n formatR = getSupportedFormat(webGL.RGBA, webGL.RGBA, HALF_FLOAT_TEXTURE_TYPE);\n }\n /** Get Supported Format\n * Using the specified internal format, we retrieve and return the desired color format to be\n * rendered with\n *\n * @param internalFormat: A GLenum that specifies the color components within the texture\n * @param format: Another GLenum that specifies the format of the texel data.\n * @returns {{internalFormat: *, format: *}|null|({internalFormat, format}|null)}\n */\n\n\n function getSupportedFormat(internalFormat, format, type) {\n var isSupportRenderTextureFormat;\n var texture = webGL.createTexture();\n /* Set texture parameters */\n\n webGL.bindTexture(webGL.TEXTURE_2D, texture);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MIN_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_MAG_FILTER, webGL.NEAREST);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_S, webGL.CLAMP_TO_EDGE);\n webGL.texParameteri(webGL.TEXTURE_2D, webGL.TEXTURE_WRAP_T, webGL.CLAMP_TO_EDGE);\n /* Specify a 2D texture image */\n\n webGL.texImage2D(webGL.TEXTURE_2D, 0, internalFormat, 4, 4, 0, format, type, null);\n /* Attach texture to frame buffer */\n\n var fbo = webGL.createFramebuffer();\n webGL.bindFramebuffer(webGL.FRAMEBUFFER, fbo);\n webGL.framebufferTexture2D(webGL.FRAMEBUFFER, webGL.COLOR_ATTACHMENT0, webGL.TEXTURE_2D, texture, 0);\n /* Check if current format is supported */\n\n var status = webGL.checkFramebufferStatus(webGL.FRAMEBUFFER);\n isSupportRenderTextureFormat = status === webGL.FRAMEBUFFER_COMPLETE;\n /* If not supported use fallback format, until we have no fallback */\n\n if (!isSupportRenderTextureFormat) {\n switch (internalFormat) {\n case webGL.R16F:\n return getSupportedFormat(webGL.RG16F, webGL.RG, type);\n\n case webGL.RG16F:\n return getSupportedFormat(webGL.RGBA16F, webGL.RGBA, type);\n\n default:\n return null;\n }\n }\n\n return {\n internalFormat: internalFormat,\n format: format\n };\n }\n\n return {\n formatRGBA: formatRGBA,\n formatRG: formatRG,\n formatR: formatR,\n halfFloatTexType: HALF_FLOAT_TEXTURE_TYPE,\n supportLinearFiltering: supportLinearFiltering\n };\n }\n /**\n * Compile Shader:\n * Makes a new webGL shader of type `type` using the provided GLSL source. The `type` is either of\n * `VERTEX_SHADER` or `FRAGMENT_SHADER`\n *\n * @param type: Passed to `createShader` to define the shader type\n * @param source: A GLSL source script, used to define the shader properties\n * @returns {WebGLShader}: A webGL shader of the parameterized type and source\n */\n\n\n function compileShader(type, source) {\n /* Create shader, link the source, and compile the GLSL*/\n var shader = webGL.createShader(type);\n webGL.shaderSource(shader, source);\n webGL.compileShader(shader);\n /* TODO: Finish error checking */\n\n if (!webGL.getShaderParameter(shader, webGL.COMPILE_STATUS)) throw webGL.getShaderInfoLog(shader);\n return shader;\n }\n /**\n * Form Shader Programs:\n * Assembles shaders into a webGl program we can use to write to our context\n *\n * @param supportLinearFiltering: A bool letting us know if we support linear filtering\n * @returns {{displayBloomProgram: GLProgram, vorticityProgram: GLProgram, displayShadingProgram: GLProgram,\n * displayBloomShadingProgram: GLProgram, gradientSubtractProgram: GLProgram, advectionProgram: GLProgram,\n * bloomBlurProgram: GLProgram, colorProgram: GLProgram, divergenceProgram: GLProgram, clearProgram: GLProgram,\n * splatProgram: GLProgram, displayProgram: GLProgram, bloomPreFilterProgram: GLProgram, curlProgram: GLProgram,\n * bloomFinalProgram: GLProgram, pressureProgram: GLProgram, backgroundProgram: GLProgram}}: Programs used to\n * render shaders\n *\n */\n\n\n function formShaderPrograms(supportLinearFiltering) {\n return {\n clearProgram: new GLProgram(SHADER.baseVertex, SHADER.clear, webGL),\n colorProgram: new GLProgram(SHADER.baseVertex, SHADER.color, webGL),\n backgroundProgram: new GLProgram(SHADER.baseVertex, SHADER.background, webGL),\n displayProgram: new GLProgram(SHADER.baseVertex, SHADER.display, webGL),\n displayBloomProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloom, webGL),\n displayShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayShading, webGL),\n displayBloomShadingProgram: new GLProgram(SHADER.baseVertex, SHADER.displayBloomShading, webGL),\n bloomPreFilterProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomPreFilter, webGL),\n bloomBlurProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomBlur, webGL),\n bloomFinalProgram: new GLProgram(SHADER.baseVertex, SHADER.bloomFinal, webGL),\n splatProgram: new GLProgram(SHADER.baseVertex, SHADER.splat, webGL),\n advectionProgram: new GLProgram(SHADER.baseVertex, supportLinearFiltering ? SHADER.advection : SHADER.advectionManualFiltering, webGL),\n divergenceProgram: new GLProgram(SHADER.baseVertex, SHADER.divergence, webGL),\n curlProgram: new GLProgram(SHADER.baseVertex, SHADER.curl, webGL),\n vorticityProgram: new GLProgram(SHADER.baseVertex, SHADER.vorticity, webGL),\n pressureProgram: new GLProgram(SHADER.baseVertex, SHADER.pressure, webGL),\n gradientSubtractProgram: new GLProgram(SHADER.baseVertex, SHADER.gradientSubtract, webGL)\n };\n }\n\n return {\n programs: programs,\n webGL: webGL,\n colorFormats: colorFormats,\n pointers: pointers\n };\n}", "function clear(gl) {\n var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n _ref$framebuffer = _ref.framebuffer,\n framebuffer = _ref$framebuffer === undefined ? null : _ref$framebuffer,\n _ref$color = _ref.color,\n color = _ref$color === undefined ? null : _ref$color,\n _ref$depth = _ref.depth,\n depth = _ref$depth === undefined ? null : _ref$depth,\n _ref$stencil = _ref.stencil,\n stencil = _ref$stencil === undefined ? null : _ref$stencil;\n\n var parameters = {\n nocatch: false,\n framebuffer: framebuffer\n };\n var clearFlags = 0;\n\n if (color) {\n clearFlags |= GL_COLOR_BUFFER_BIT;\n if (color !== true) {\n parameters.clearColor = color;\n }\n }\n\n if (depth) {\n clearFlags |= GL_DEPTH_BUFFER_BIT;\n if (depth !== true) {\n parameters.clearDepth = depth;\n }\n }\n\n if (stencil) {\n clearFlags |= GL_STENCIL_BUFFER_BIT;\n if (depth !== true) {\n parameters.clearStencil = depth;\n }\n }\n\n __WEBPACK_IMPORTED_MODULE_2_assert___default()(clearFlags !== 0, ERR_ARGUMENTS);\n\n // Temporarily set any clear \"colors\" and call clear\n Object(__WEBPACK_IMPORTED_MODULE_1__context_state__[\"c\" /* withParameters */])(gl, parameters, function () {\n gl.clear(clearFlags);\n });\n}", "reset() {\n this.world.reset();\n }", "function main(){\n\n\t// setup everything else\n\tvar canvas = document.getElementById(\"my-canvas\");\n\tcanvas.addEventListener(\"mousedown\", doMouseDown, false);\n\tcanvas.addEventListener(\"mouseup\", doMouseUp, false);\n\tcanvas.addEventListener(\"mousemove\", doMouseMove, false);\n\tcanvas.addEventListener(\"mousewheel\", doMouseWheel, false);\n\twindow.onresize = doResize;\n\tcanvas.width = window.innerWidth-16;\n\tcanvas.height = window.innerHeight-180;\n\n\ttry{\n\t\tgl= canvas.getContext(\"webgl2\");\n\t} catch(e){\n\t\tconsole.log(e);\n\t}\n\t\n\tif(gl){\n\t\t// Compile and link shaders\n\t\tprogram = gl.createProgram();\n\t\tvar v1 = gl.createShader(gl.VERTEX_SHADER);\n\t\tgl.shaderSource(v1, vs);\n\t\tgl.compileShader(v1);\n\t\tif (!gl.getShaderParameter(v1, gl.COMPILE_STATUS)) {\r\n\t\t\talert(\"ERROR IN VS SHADER : \" + gl.getShaderInfoLog(v1));\r\n\t\t}\r\n\t\tvar v2 = gl.createShader(gl.FRAGMENT_SHADER);\n\t\tgl.shaderSource(v2, fs)\n\t\tgl.compileShader(v2);\t\t\n\t\tif (!gl.getShaderParameter(v2, gl.COMPILE_STATUS)) {\r\n\t\t\talert(\"ERROR IN FS SHADER : \" + gl.getShaderInfoLog(v2));\r\n\t\t}\t\t\t\r\n\t\tgl.attachShader(program, v1);\n\t\tgl.attachShader(program, v2);\n\t\tgl.linkProgram(program);\t\t\t\t\n\t\t\n\t\tgl.useProgram(program);\n\n\t\t// Creates geometry\n\t\tbuildGeometry();\n\n\t\tdocument.getElementById(\"myRange\").value = BVH_FPS;\n//console.log(totMesh);\n//console.log(startVertex);\n//console.log(startIndex);\n//console.log(vertices);\n//console.log(indices);\n//console.log(colors);\n\t\tvertexBuffer = gl.createBuffer();\n\t\tvertices = new Float32Array(vertices);\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n//console.log(vertices.byteLength);\n\t\tgl.bufferData(gl.ARRAY_BUFFER, vertices.byteLength, gl.STATIC_DRAW);\n\t\tgl.bufferSubData(gl.ARRAY_BUFFER, 0, vertices);\n\n\t\tindexBuffer = gl.createBuffer();\n\t\tindices = new Uint16Array(indices);\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\n//console.log(indices.byteLength);\n\t\tgl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indices.byteLength, gl.STATIC_DRAW);\n\t\tgl.bufferSubData(gl.ELEMENT_ARRAY_BUFFER, 0, indices);\t\n//\t\t\n//\t\tmesh = new OBJ.Mesh(objStr);\n//\t\tOBJ.initMeshBuffers(gl, mesh);\n\t\t\n\t\t// links mesh attributes to shader attributes\n\t\tprogram.vertexPositionAttribute = gl.getAttribLocation(program, \"in_pos\");\n\t\tgl.enableVertexAttribArray(program.vertexPositionAttribute);\n\t\t \n\t\tprogram.WVPmatrixUniform = gl.getUniformLocation(program, \"pMatrix\");\n\t\tprogram.lightDir1 = gl.getUniformLocation(program, \"lightDir1\");\n\t\tprogram.lightDir2 = gl.getUniformLocation(program, \"lightDir2\");\n\t\tprogram.lightDir3 = gl.getUniformLocation(program, \"lightDir3\");\n\t\tprogram.matcol = gl.getUniformLocation(program, \"matcol\");\n\t\t\n\t\t// prepares the world, view and projection matrices.\n\t\tvar w=canvas.clientWidth;\r\n\t\tvar h=canvas.clientHeight;\r\n\t\t\r\n\t\tgl.clearColor(0.0, 0.0, 0.0, 1.0);\r\n\t\tgl.viewport(0.0, 0.0, w, h);\r\n\n\t\t// selects the mesh\n\t\tgl.bindBuffer(gl.ARRAY_BUFFER, vertexBuffer);\n\t\tgl.vertexAttribPointer(program.vertexPositionAttribute, 3, gl.FLOAT, false, 0, 0);\n\n\t\tgl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, indexBuffer);\t\t\n\t\t\n\t // turn on depth testing and back-face culling\n\t gl.enable(gl.DEPTH_TEST);\n\t\tgl.enable(gl.CULL_FACE);\n\t\tgl.cullFace(gl.BACK);\n\n\t\ts45 = 0.707106781186548;\n\t\ts30 = 0.5;\n\t\ts60 = 0.866025403784439;\n\n\t\tgLightDir1 = [ 0.0, s45, s45, 1.0];\n\t\tgLightDir2 = [ s60, s45,-s45*s30, 0.7];\n\t\tgLightDir3 = [-s60,-s45,-s45*s30, 0.5];\n\n\t\tdrawScene();\n\t}else{\n\t\talert(\"Error: WebGL not supported by your browser!\");\n\t}\n}", "RemoveOldPointsAndReDraw() {\n if (glb == null || glb == undefined) {\n return;\n }\n\n glb.removePoints();\n setTimeout(() => {\n glb.createPoints();\n }, 1000);\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0 + i);\n gl.bindTexture(GL_TEXTURE_2D, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "function refreshFrame(){\n ctx.clearRect(0,0,480,360);\n}", "function initGL() {\n \n \"use strict\";\n\n // -- 1. Add shaders (load / compile)\n ctx.shaderProgram = loadAndCompileShaders(gl, \"VertexShader.glsl\", \"FragmentShader.glsl\");\n\n // -- 2. Assign attribute-index to context\n setUpAttributesAndUniforms();\n\n // -- 3. Setup buffers\n setUpBuffers();\n\n // -- 4. Set color ??\n gl.clearColor(0.4688,0.1512,0.0000,0.2725);\n\n}", "function destroyTextures () {\n for (var i = 0; i < numTexUnits; ++i) {\n gl.activeTexture(GL_TEXTURE0$1 + i);\n gl.bindTexture(GL_TEXTURE_2D$1, null);\n textureUnits[i] = null;\n }\n values(textureSet).forEach(destroy);\n\n stats.cubeCount = 0;\n stats.textureCount = 0;\n }", "componentWillUnmount() {\n this.threeRootElement.remove();\n glb.removePoints();\n }", "clearBrowserMemory() {\n if (this.state.visualizer) {\n this.state.visualizer.stopFrameLoop();\n this.state.visualizer.clearCaches();\n }\n }", "function render() {\r\n\tgl.clear(gl.COLOR_BUFFER_BIT);\r\n\tgl.drawArrays(gl.TRIANGLES, 0, 9);\r\n}", "function initGL(canvas, flags) {\n var gl = canvas.getContext(\"webgl\", flags);\n if (!gl) {\n gl = canvas.getContext(\"experimental-webgl\", flags);\n if (!gl) {\n alert(\"Your browser or device does not seem to support WebGL.\");\n return null;\n }\n alert(\"Your browser or device only supports experimental WebGL.\\n\" + \"The simulation may not run as expected.\");\n }\n gl.disable(gl.CULL_FACE);\n gl.disable(gl.DEPTH_TEST);\n gl.disable(gl.BLEND);\n gl.clearColor(0.0, 0.0, 0.0, 1.0);\n __WEBPACK_IMPORTED_MODULE_0__gl_utils_utils__[\"a\" /* resizeCanvas */](gl, false);\n return gl;\n}", "handleWebGLContextRestored() {\n }", "function clearScreen () {\n let ctx = getContext ()\n ctx.clearRect(0,0, WIDTH, HEIGHT)\n}", "function clear() {\n consoleClear();\n buttonChecked = button_options.NONE;\n clearGlobals();\n while(scene.children.length > 0){ //removes all children from the scene\n scene.remove(scene.children[0]); \n }\n}", "function reset() {\n step = 0;\n ctx.clearRect(0, 0, 645, 60);\n fewDeferred.reject();\n fewDeferred = null;\n }", "function webGLStart() {\n var canvas = document.getElementById(\"canvas\");\t//Lade Canvas Element von HTML ins javascript\n \n if (!canvas) {\n \tconsole.log('Failed to retrieve the <canvas> element ');\n \treturn false;\n }\n \n initGL(canvas);\n initShaders();\n initT();\n \n //gl.vertexAttrib1f(shaderProgram.pointSize, 20.0);\t//Setzte die default Punktgroesse auf 20px \n gl.clearColor(0.0, 0.0, 0.0, 0.0);\n gl.enable(gl.DEPTH_TEST);\n\n document.onkeydown = handleKeyDown;\n document.onkeyup = handleKeyUp;\n \n tick();\n \n }", "loseWebGLContext() {\n if (this.canvas.loseContext) {\n this.canvas.loseContext();\n }\n }" ]
[ "0.75271577", "0.71244013", "0.71184266", "0.70930094", "0.70930094", "0.7053501", "0.70499206", "0.6935659", "0.6922435", "0.69011056", "0.68858784", "0.67867905", "0.6778077", "0.6760073", "0.67220414", "0.6694737", "0.6636735", "0.6630691", "0.6625205", "0.6611403", "0.65857583", "0.6549794", "0.6531165", "0.6523242", "0.6520585", "0.651656", "0.65094763", "0.65029615", "0.6502684", "0.647906", "0.6465633", "0.6454204", "0.6451094", "0.6408284", "0.6381069", "0.6380507", "0.63630044", "0.6356767", "0.6321676", "0.6316848", "0.62829787", "0.62661445", "0.6258479", "0.6247513", "0.6222468", "0.62180316", "0.618435", "0.6176645", "0.61745405", "0.61558527", "0.6149196", "0.61464256", "0.614339", "0.6140176", "0.6135958", "0.6112512", "0.6109872", "0.6089701", "0.60865873", "0.6072972", "0.6059953", "0.6056974", "0.60529053", "0.6033203", "0.6028962", "0.60270756", "0.60129696", "0.60098106", "0.6004553", "0.59993404", "0.59968346", "0.59951985", "0.59885603", "0.5985301", "0.59711504", "0.59685665", "0.59644824", "0.59490967", "0.5945932", "0.59441555", "0.5943165", "0.5943165", "0.5943165", "0.5943165", "0.5943165", "0.5943165", "0.5943165", "0.59398526", "0.5939049", "0.59294575", "0.5928034", "0.59257907", "0.5922883", "0.59214777", "0.59174085", "0.5912022", "0.5905359", "0.589423", "0.5890776", "0.5886194" ]
0.7261925
1
From autobinddecorator ( Return a descriptor removing the value and returning a getter The getter will return a .bind version of the function and memoize the result against a symbol on the instance
function boundMethod(objPrototype, method, descriptor) { var fn = descriptor.value; return { configurable: true, get: function get() { if (this === objPrototype || this.hasOwnProperty(method)) { return fn; } var boundFn = fn.bind(this); Object.defineProperty(this, method, { value: boundFn, configurable: true, writable: true }); return boundFn; } }; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Autobind(_, _2, descriptor) {\n return {\n enumerable: false,\n configurable: true,\n get() {\n return descriptor.value.bind(this);\n }\n };\n}", "function autobind(target, key, descriptor) {\n var fn = descriptor.value;\n var defining = false;\n return {\n configurable: true,\n get: function () {\n if (defining || this === fn.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n // Bind method only once, and update the property to return the bound value from now on\n var fnBound = fn.bind(this);\n defining = true;\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: fnBound\n });\n defining = false;\n return fnBound;\n },\n set: function (newValue) {\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: newValue\n });\n }\n };\n}", "get _getter() {\n return descriptorForDecorator(this)._getter;\n }", "function DecoAutobind(_target, _propName, descriptor) {\n var originalMethod = descriptor.value;\n var newDescriptor = {\n configurable: true,\n enumerable: true,\n get: function () {\n var boundFn = originalMethod.bind(this);\n return boundFn;\n }\n };\n return newDescriptor;\n}", "function autobind(\n// tslint:disable-next-line:no-any\ntarget, key, descriptor) {\n var fn = descriptor.value;\n var defining = false;\n return {\n configurable: true,\n get: function () {\n if (defining || (fn && this === fn.prototype) || this.hasOwnProperty(key)) {\n return fn;\n }\n // Bind method only once, and update the property to return the bound value from now on\n var fnBound = fn && fn.bind(this);\n defining = true;\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: fnBound\n });\n defining = false;\n return fnBound;\n },\n // tslint:disable-next-line:no-any\n set: function (newValue) {\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: newValue\n });\n }\n };\n}", "function autobind(\n// tslint:disable-next-line:no-any\ntarget, key, descriptor) {\n var fn = descriptor.value;\n var defining = false;\n return {\n configurable: true,\n get: function () {\n if (defining || (fn && this === fn.prototype) || this.hasOwnProperty(key)) {\n return fn;\n }\n // Bind method only once, and update the property to return the bound value from now on\n var fnBound = fn && fn.bind(this);\n defining = true;\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: fnBound\n });\n defining = false;\n return fnBound;\n },\n // tslint:disable-next-line:no-any\n set: function (newValue) {\n Object.defineProperty(this, key, {\n configurable: true,\n writable: true,\n enumerable: true,\n value: newValue\n });\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + (typeof fn === 'undefined' ? 'undefined' : _typeof(fn)));\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + (typeof fn === 'undefined' ? 'undefined' : _typeof(fn)));\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n }\n\n // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n var definingProperty = false;\n\n return {\n configurable: true,\n get: function get() {\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n definingProperty = false;\n return boundFn;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n\t var fn = descriptor.value;\n\n\t if (typeof fn !== 'function') {\n\t throw new Error('@autobind decorator can only be applied to methods not: ' + typeof fn);\n\t }\n\n\t // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n\t // getter for the property which is being replaced. This causes infinite\n\t // recursion and an \"Out of stack space\" error.\n\t var definingProperty = false;\n\n\t return {\n\t configurable: true,\n\t get: function get() {\n\t if (definingProperty || this === target.prototype || this.hasOwnProperty(key)) {\n\t return fn;\n\t }\n\n\t var boundFn = fn.bind(this);\n\t definingProperty = true;\n\t Object.defineProperty(this, key, {\n\t value: boundFn,\n\t configurable: true,\n\t writable: true\n\t });\n\t definingProperty = false;\n\t return boundFn;\n\t }\n\t };\n\t}", "function memoize(target, key, descriptor) {\r\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\r\n // rather than passing them in as input values which can be memoized.\r\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\r\n return {\r\n configurable: true,\r\n get: function () {\r\n return fn;\r\n }\r\n };\r\n}", "function memoize(target, key, descriptor) {\r\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\r\n // rather than passing them in as input values which can be memoized.\r\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\r\n return {\r\n configurable: true,\r\n get: function () {\r\n return fn;\r\n }\r\n };\r\n}", "function memoize(target, key, descriptor) {\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\n // rather than passing them in as input values which can be memoized.\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\n return {\n configurable: true,\n get: function () {\n return fn;\n }\n };\n}", "function memoize(target, key, descriptor) {\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\n // rather than passing them in as input values which can be memoized.\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\n return {\n configurable: true,\n get: function () {\n return fn;\n }\n };\n}", "function memoize(_target, _key, descriptor) {\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\n // rather than passing them in as input values which can be memoized.\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\n return {\n configurable: true,\n get: function () {\n return fn;\n },\n };\n}", "function memoize(_target, _key, descriptor) {\n // We bind to \"null\" to prevent people from inadvertently pulling values from \"this\",\n // rather than passing them in as input values which can be memoized.\n var fn = memoizeFunction(descriptor.value && descriptor.value.bind(null));\n return {\n configurable: true,\n get: function () {\n return fn;\n },\n };\n}", "function memoize() {\n function cacheValue(propName, getterOrMethod) {\n return function () {\n let cache = InstanceCache.getCache(this);\n if (!cache.has(propName)) {\n cache.set(propName, getterOrMethod.apply(this));\n }\n return cache.get(propName);\n };\n }\n function decorate(target, propName) {\n let descriptor = Object.getOwnPropertyDescriptor(target, propName);\n let getterOrMethod;\n if (!lang_1.isDefined(descriptor))\n throw new DecoratorError(`@memoize: Can only be applied to methods or properties`);\n if (lang_1.isDefined(descriptor.get)) {\n descriptor.get = cacheValue(propName, descriptor.get);\n }\n else {\n let method = descriptor.value;\n if (!lang_1.isDefined(method.length))\n throw new DecoratorError(`@memoize: \\'${propName} is not a method`);\n if (method.length > 0)\n throw new DecoratorError(`@memoize: Method \\'${propName} should not take arguments`);\n descriptor.value = cacheValue(propName, method);\n }\n return descriptor;\n }\n return decorate;\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new TypeError(\"@boundMethod decorator can only be applied to methods not: \".concat(_typeof(fn)));\n } // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n\n\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new TypeError(\"@boundMethod decorator can only be applied to methods not: \".concat(_typeof(fn)));\n } // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n\n\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(target, key, descriptor) {\n var fn = descriptor.value;\n\n if (typeof fn !== 'function') {\n throw new TypeError(\"@boundMethod decorator can only be applied to methods not: \".concat(_typeof(fn)));\n } // In IE11 calling Object.defineProperty has a side-effect of evaluating the\n // getter for the property which is being replaced. This causes infinite\n // recursion and an \"Out of stack space\" error.\n\n\n var definingProperty = false;\n return {\n configurable: true,\n get: function get() {\n // eslint-disable-next-line no-prototype-builtins\n if (definingProperty || this === target.prototype || this.hasOwnProperty(key) || typeof fn !== 'function') {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n definingProperty = true;\n Object.defineProperty(this, key, {\n configurable: true,\n get: function get() {\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n delete this[key];\n }\n });\n definingProperty = false;\n return boundFn;\n },\n set: function set(value) {\n fn = value;\n }\n };\n}", "function boundMethod(objPrototype, method, descriptor) {\n\t var fn = descriptor.value;\n\t\n\t return {\n\t configurable: true,\n\t get: function get() {\n\t if (this === objPrototype || this.hasOwnProperty(method)) {\n\t return fn;\n\t }\n\t\n\t var boundFn = fn.bind(this);\n\t Object.defineProperty(this, method, {\n\t value: boundFn,\n\t configurable: true,\n\t writable: true\n\t });\n\t return boundFn;\n\t }\n\t };\n\t}", "function property(name, value) {\n // if functioning as a setter, set property in cache\n if (arguments.length > 1) {\n _propertyCache[name] = functor(value);\n return this;\n }\n\n // functioning as a getter, return property accessor\n return functor(_propertyCache[name]);\n }", "function boundMethod(objPrototype, method, descriptor) {\n var fn = descriptor.value;\n\n return {\n configurable: true,\n get: function get() {\n if (this === objPrototype || this.hasOwnProperty(method)) {\n return fn;\n }\n\n var boundFn = fn.bind(this);\n Object.defineProperty(this, method, {\n value: boundFn,\n configurable: true,\n writable: true\n });\n return boundFn;\n }\n };\n}", "function get(){return proxy;}", "function get(){return proxy;}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty (obj, prop, getter) {\n function get () {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function createAccessor(value) {\n return function () { return value; };\n }", "function lazyProperty(obj, prop, getter) {\n function get() {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty(obj, prop, getter) {\n function get() {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function lazyProperty(obj, prop, getter) {\n function get() {\n var val = getter()\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n })\n\n return val\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n })\n}", "function getter(obj, prop, fn) {\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: fn\n });\n}", "function cache(target, key, descriptor) {\n if (descriptor.get) {\n var get = descriptor.get;\n descriptor.get = function () {\n var value = get.call(this);\n _Object$defineProperty(this, key, { value: value });\n return value;\n };\n } else if (typeof descriptor.value === 'function') {\n var fn = descriptor.value;\n\n return {\n get: function get() {\n var cache = new _Map();\n function memoized() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var key = args.length > 0 ? args[0] : 'value';\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = fn.apply(this, args);\n cache.set(key, result);\n return result;\n };\n\n _Object$defineProperty(this, key, { value: memoized });\n return memoized;\n }\n };\n }\n}", "function cache(target, key, descriptor) {\n if (descriptor.get) {\n var get = descriptor.get;\n descriptor.get = function () {\n var value = get.call(this);\n _Object$defineProperty(this, key, { value: value });\n return value;\n };\n } else if (typeof descriptor.value === 'function') {\n var fn = descriptor.value;\n\n return {\n get: function get() {\n var cache = new _Map();\n function memoized() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var key = args.length > 0 ? args[0] : 'value';\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = fn.apply(this, args);\n cache.set(key, result);\n return result;\n };\n\n _Object$defineProperty(this, key, { value: memoized });\n return memoized;\n }\n };\n }\n}", "function cache(target, key, descriptor) {\n if (descriptor.get) {\n var get = descriptor.get;\n descriptor.get = function () {\n var value = get.call(this);\n _Object$defineProperty(this, key, { value: value });\n return value;\n };\n } else if (typeof descriptor.value === 'function') {\n var fn = descriptor.value;\n\n return {\n get: function get() {\n var cache = new _Map();\n function memoized() {\n for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var key = args.length > 0 ? args[0] : 'value';\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = fn.apply(this, args);\n cache.set(key, result);\n return result;\n };\n\n _Object$defineProperty(this, key, { value: memoized });\n return memoized;\n }\n };\n }\n}", "defineGetterPropertyValue(prop, instance, getterHandler) {\n if (prop && getterHandler) {\n if (prop.propertyName) {\n Object.defineProperty(instance, prop.propertyName, {\n get: () => { var _a; return getterHandler(prop.propertyName, (_a = prop.metadata) !== null && _a !== void 0 ? _a : {}, instance); },\n configurable: true,\n enumerable: true,\n });\n }\n }\n }", "function lazyProperty(obj, prop, getter) {\n function get() {\n var val = getter();\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n value: val\n });\n return val;\n }\n\n Object.defineProperty(obj, prop, {\n configurable: true,\n enumerable: true,\n get: get\n });\n}", "function makeReflect(propName, descriptor) {\n if (!descriptor.reflectAttribute) {\n return noop;\n }\n\n var attrName = descriptor.attribute || propName;\n\n return function doReflect(value, silent) {\n // Reflect the property\n if (value === false || value === null) {\n // Non-truthy attributes should be destroyed\n this.removeAttribute(attrName);\n }\n else {\n // Boolean true for a value just means the property should exist\n if (value === true) {\n value = '';\n }\n\n // Only perform the set if the attribute is of a different value\n // This avoids triggering mutation observers unnecessarily\n if (this.getAttribute(attrName) !== value) {\n this.setAttribute(attrName, value);\n }\n }\n };\n }", "function makeAccessor2(valueOrAccessor) {\n if (_lodash2.default.isFunction(valueOrAccessor)) return valueOrAccessor;\n return function () {\n return valueOrAccessor;\n };\n}", "function getterFactory(cache) {\n return getter\n\n // Get a node from the bound definition-cache.\n function getter(identifier) {\n var id = identifier && normalise(identifier)\n return id && own.call(cache, id) ? cache[id] : null\n }\n}", "function getterFactory(cache) {\n return getter;\n\n /* Get a node from the bound definition-cache. */\n function getter(identifier) {\n var id = identifier && normalise(identifier);\n return id && own.call(cache, id) ? cache[id] : null;\n }\n}", "function proxyable_factory(prop = 'value', event = 'change') {\n return external_commonjs_vue_commonjs2_vue_root_Vue_default.a.extend({\n name: 'proxyable',\n model: {\n prop,\n event\n },\n props: {\n [prop]: {\n required: false\n }\n },\n\n data() {\n return {\n internalLazyValue: this[prop]\n };\n },\n\n computed: {\n internalValue: {\n get() {\n return this.internalLazyValue;\n },\n\n set(val) {\n if (val === this.internalLazyValue) return;\n this.internalLazyValue = val;\n this.$emit(event, val);\n }\n\n }\n },\n watch: {\n [prop](val) {\n this.internalLazyValue = val;\n }\n\n }\n });\n}", "function overwritable(value) {\n return function (target, propertyName) {\n var newDescriptor = {\n //this prevents every writing access, even the constructor\n writable: value\n };\n return newDescriptor;\n };\n}", "function InstallGetter(object, name, getter, attributes) {\n %CheckIsBootstrapping();\n if (typeof attributes == \"undefined\") {\n attributes = DONT_ENUM;\n }\n SetFunctionName(getter, name, \"get\");\n %FunctionRemovePrototype(getter);\n %DefineAccessorPropertyUnchecked(object, name, getter, null, attributes);\n %SetNativeFlag(getter);\n}", "function BindingCallManager(scope, path, setterFn, getterFn, defaultValue) {\n _super.call(this, (function () {\n // Create an object with getter and setter.\n var target = {};\n Object.defineProperty(target, 'result', {\n set: function (result) {\n setterFn(result);\n },\n get: function () {\n if (getterFn) {\n return getterFn();\n }\n return void 0;\n }\n });\n return target;\n })(), 'result', scope, path, defaultValue);\n }", "function getOverrideDescriptor(cmp, prop, callback) {\n const descriptor = findDescriptor(cmp, prop);\n let enumerable;\n let get;\n let set; // This does not cover the override of existing descriptors at the instance level\n // and that's ok because eventually we will not need to do any of these :)\n\n if (descriptor === null || descriptor.get === undefined && descriptor.set === undefined) {\n let value = cmp[prop];\n enumerable = true;\n\n get = function () {\n return value;\n };\n\n set = function (newValue) {\n value = newValue;\n callback();\n };\n } else {\n const {\n set: originalSet,\n get: originalGet\n } = descriptor;\n enumerable = descriptor.enumerable;\n\n set = function (newValue) {\n if (originalSet) {\n originalSet.call(cmp, newValue);\n }\n\n callback();\n };\n\n get = function () {\n return originalGet ? originalGet.call(cmp) : undefined;\n };\n }\n\n return {\n set,\n get,\n enumerable,\n configurable: true\n };\n }", "function outerDecorator(duration) {\n return function innerDecorator(target, key, descriptor) {\n return {\n configurable: true,\n enumerable: descriptor.enumerable,\n get: function getter() {\n // Attach this function to the instance (not the class)\n Object.defineProperty(this, key, {\n configurable: true,\n enumerable: descriptor.enumerable,\n value: debounce(descriptor.value, duration)\n });\n return this[key];\n }\n };\n };\n }", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function HostBindingDecorator() {} // WARNING: interface has both a type and a value, skipping emit", "function MyMethodDecorator(value) {\r\n return function (target, propertyKey, descriptor) {\r\n console.log(\"This is taget: \" + target.constructor);\r\n console.log(\" This is propertyKey: \" + propertyKey);\r\n console.log(\"This is descriptor: \" + JSON.stringify(descriptor));\r\n descriptor.MyMethodDecorator = value;\r\n };\r\n}", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function get() {\n return proxy;\n }", "function makeGetter(index) {\n return function() { return this[index]; }\n }", "static define(trg,key,val,src,bind) { \n let valDesc = val && isDescriptor(val) ? val : src && isDescriptor(src[key]) && src[key]; let srcDesc = src && isDescriptor(src[key]) ? src[key] : src && Object.getOwnPropertyDescriptor(src,key); let trgDesc = Object.getOwnPropertyDescriptor(trg,key); \n let defaultDesc = (val && typeof val === 'object' && !('get' in val) && !('set' in val)) ? { value:val,writable:true,enumerable:true,configurable:true } : { ...val }\n let desc = valDesc || srcDesc || trgDesc || defaultDesc\n if (!defined(desc.get)) {\n if (trgDesc && trgDesc.writable === false && trgDesc.configurable === false) return false\n \n if (defined(val) && !isDescriptor(val) && isDescriptor(src)) {\n if (defined(valDesc.value)) valDesc.value = val; \n else if ((defined(valDesc.get)) && typeof val.desc.get === 'function') valDesc.get = val\n }\n val = (!val || desc === valDesc) ? desc.value : val \n if (bind && typeof desc.value === 'function') { \n let func = desc.value; desc.value = { [key]: function(...arg) { return func.call(bind,...arg) }}[key]\n }\n }\n if ((typeof desc.get === 'function' || typeof desc.set === 'function')) {\n if (typeof desc.get !== 'function')\n return this.define.set(trg,key,desc.set,src,bind)\n if (typeof desc.set !== 'function')\n return this.define.get(trg,key,desc.get,src,bind)\n this.define.get(trg,key,desc.get,src,bind)\n this.define.set(trg,key,desc.set,src,bind)\n return trg\n } \n if (trgDesc && defined(trgDesc.configurable) && trgDesc.configurable === false) {\n if (trgDesc.writable) trg[key] = desc.value || desc.get()\n return\n }\n Object.defineProperty(trg,key,desc);\n }", "function accessor(property) {\n\t\tvar fn = function() {\n\t\t\treturn this[arguments.length ? \"set\" : \"get\"](property, arguments[0]);\n\t\t};\n\n\t\t// Set a flag to later prevent set() to call fn() indefinitely\n\t\tfn.accessor = true;\n\t\treturn fn;\n\t}", "function makeConflictAccessor(name) {\n var accessor = function(var_args) {\n throw new Error(\"Conflicting property: \"+name);\n };\n freeze(accessor.prototype);\n return freeze(accessor);\n }", "get( target, prop, receiver ){\n //console.log( \"GET\", \"target\", target, \"prop\", prop, \"rec\", receiver ); \n if( prop == \"$\" ) return this;\n \n return Reflect.get( target, prop, receiver ); //target[ prop ];\n }", "function _get(e,t,n){return(_get=\"undefined\"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,n){var r=_superPropBase(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(n):i.value}})(e,t,n||e)}", "function ComputedProxyFactory(target) {\n return new Proxy(target, {\n get: function get(target, prop, receiver) {\n return _typeof(target[prop]) === 'object' ? ComputedProxyFactory(target[prop]) : (0,vue_demi__WEBPACK_IMPORTED_MODULE_0__.computed)(function () {\n return target[prop];\n });\n }\n });\n }", "computed(obj) {\n\n var name, desc, i;\n\n for (i = 1; i < arguments.length; ++i) {\n\n name = \"__$\" + (i - 1);\n desc = Object.getOwnPropertyDescriptor(obj, name);\n\n if (!desc)\n continue;\n\n Object.defineProperty(obj, arguments[i], desc);\n delete obj[name];\n }\n\n return obj;\n }", "function attrGetter(type, name) {\nreturn Object.getOwnPropertyDescriptor(type.$$.prototype, name).get;\n}", "function $__jsx_lazy_init(obj, prop, func) {\n\tfunction reset(obj, prop, value) {\n\t\tdelete obj[prop];\n\t\tobj[prop] = value;\n\t\treturn value;\n\t}\n\n\tObject.defineProperty(obj, prop, {\n\t\tget: function () {\n\t\t\treturn reset(obj, prop, func());\n\t\t},\n\t\tset: function (v) {\n\t\t\treset(obj, prop, v);\n\t\t},\n\t\tenumerable: true,\n\t\tconfigurable: true\n\t});\n}", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "function getBindingsAndMakeAccessors(node, context) {\n\t return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n\t }", "get x() {}", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this['getBindings'].bind(this, node, context));\n }", "function makeValueAccessor(value) {\n return function () {\n return value;\n };\n }", "get(name) {\n return getters[name]();\n }", "function _prop(val) { return { value: val, enumerable: true }; }", "function _prop(val) { return { value: val, enumerable: true }; }", "get foo () {\n return \"foo\";\n }", "function useGetHandler(obj, name, getHandler) {\n obj[name + '_getter___'] = getHandler;\n }", "makeValueAccessor (value) {\n return () => value\n }", "function HostBindingDecorator() { }", "function HostBindingDecorator() { }", "function getBindingsAndMakeAccessors(node, context) {\n return makeAccessorsFromFunction(this.getBindings.bind(this, node, context));\n }" ]
[ "0.7106008", "0.7070857", "0.7055944", "0.70397377", "0.677762", "0.677762", "0.67497545", "0.67497545", "0.6745944", "0.6716756", "0.6619548", "0.6619548", "0.6573981", "0.6573981", "0.6380238", "0.6380238", "0.6362993", "0.61829334", "0.61829334", "0.61829334", "0.61329913", "0.61205244", "0.6053132", "0.601695", "0.601695", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5986305", "0.5968091", "0.5960703", "0.5960703", "0.5960703", "0.5959484", "0.59308237", "0.59308237", "0.59308237", "0.5869892", "0.58651227", "0.58484584", "0.58205336", "0.5820433", "0.5805828", "0.57849246", "0.5784372", "0.5774555", "0.57673055", "0.5767104", "0.5766681", "0.5721835", "0.5721835", "0.5721835", "0.56937695", "0.5650612", "0.5650612", "0.5650612", "0.5650612", "0.5650612", "0.5650612", "0.5650612", "0.5650612", "0.5649503", "0.5642198", "0.5626719", "0.56081223", "0.56030345", "0.5596271", "0.55940276", "0.5576483", "0.55743474", "0.5571517", "0.5560224", "0.5560224", "0.5560224", "0.55461323", "0.55379796", "0.553062", "0.55078244", "0.5496576", "0.5496576", "0.5487777", "0.54849195", "0.54705375", "0.54688144", "0.54688144", "0.5466186" ]
0.60606515
22
The function managing the console commands
async function consoleCommands() { console.log("c to clear temp files"); console.log("r to start server"); var rl = readline.createInterface(process.stdin, process.stdout); var prefix = '>'; rl.on('line', async function (line) { switch (line.trim()) { case 'c': //command to clean the temp file(serverRepos and other temp files of server) shell.exec("rm -r -f " + exports.serverDirectory + "/*"); shell.exec("rm -r -f ./server_0.9/.metadata"); shell.exec("rm -r -f ./server_0.9/jdt.ls-java-project"); exports.ReposInServer = []; console.log("done"); break; case 'r': //command to run the server t = await clientTest.startServer(exports.serverDirectory); fs.readdirSync(exports.serverDirectory).forEach(file => { exports.ReposInServer.push(file); //reading the repos already in the serverRepos directory }); //this.close();//closing the prompt after starting the server break; default: console.log("wrong input"); } this.setPrompt(prefix); this.prompt(); }).on('close', function () { }); rl.setPrompt(prefix); rl.prompt(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function handleCommand() {}", "function registerCommands()\n{\n addCMD([\"cmd\", listCmds, \"Prints list of available commands\"]);\n addSynonimOf(\"cmd\", \"cmds\");\n addSynonimOf(\"cmd\", \"commands\");\n\n addCMD([\"test\", test, \"Just a test\"]);\n addCMD([\"invite\", inviteMeLink, \"I'll give you invite link to me!\", [], true]);\n\n addCMD([\"say\", say, \"I'll say some instead you! (attachments also supported!)\\n__*Syntax:*__ say <any your text>\"]);\n addCMD([\"saytts\", sayTTS, \"I'll help to pronuncate you some!\\n__*Syntax:*__ saytts <any your text>\"]);\n addCMD([\"whosaid\", sayLog, \":spy: Shsh! I'll leak you secret - who asked me to say (5 last messages)\\n\"]);\n addCMD([\"setgame\", setPlayingGame, \"I'll play any game you suggesting me!\\n\" +\n \"__*Syntax:*__ setgame <any your text>\\n\\n**NOTE:** Only permited users can use this command!\"]);\n addCMD([\"setmusic\", setListeningMusic,\"I'll listen any music you suggesting me!\\n\" +\n \"__*Syntax:*__ setmusic <any your text>\\n\\n**NOTE:** Only permited users can use this command!\"]);\n addCMD([\"setvideo\", setWatchingVideo, \"I'll watch any video suggesting me!\\n\" +\n \"__*Syntax:*__ setvideo <any your text>\\n\\n**NOTE:** Only permited users can use this command!\"]);\n addCMD([\"setstream\",setStreaming, \"I'll stream anything you ask me!\\n\" +\n \"__*Syntax:*__ setstream <any your text>\\n\\n**NOTE:** Only permited users can use this command!\"]);\n\n addCMD([\"remind\", sayDelayd, \":information_desk_person: I'll remeber a thing you request me!\\n__*Syntax:*__ remind <any your text> after <time> <seconds, minutes, hours>\\n\", [], true]);\n addCMD([\"remindme\", sayDelaydME, \":information_desk_person: I'll remeber you personally a thing you request me!\\n__*Syntax:*__ remindMe <any your text> after <time> <seconds, minutes, hours>\\n\", [], true]);\n\n addCMD([\"err\", wrongFunction, \"It hurts me...\"]);\n\n addCMD([\"isbeepboop\",isBeepBoop, \"Check is this server has a beep-boop channel\"]);\n addSynonimOf(\"isbeepboop\",\"isfun\", \"Check is this server has a beep-boop/fun channel\");\n\n addCMD([\"mytime\", myTime, \"Let's check our watches? :clock: :watch: :stopwatch: :clock1: \"]);\n addCMD([\"stats\", aboutBot, \"Just my health state\"]);\n addSynonimOf(\"stats\", \"about\", \"Wanna meet me?\");\n addCMD([\"uptime\", upTimeBot, \"How long I still be here\"]);\n\n addCMD([\"help\", cmdHelp, \"Prints help of command\"]);\n\n addCMD([\"mailwohlstand\", sendEmail, \"Send email to my creator while he is offline. (Attachments are supported!) \\n\" +\n \"__*Syntax:*__ mailwohlstand <any your text>\", [], true]);\n\n addCMD([\"check-in-list\", cachedFiles_Check, \"Check the existing of something in one of built-in lists\", [], true]);\n addCMD([\"reload-lists\", cachedFiles_ReLeload, \"<Owner-Only> Reload built-in lists\", [], true]);\n\n\n foxyLogInfo( Cmds.length + \" command has been registered!\");\n}", "init_console() { \n var ascendant = this\n /* Do the keypress magic like a real console, but later\n keypress(process.stdin);\n // listen for the \"keypress\" event\n process.stdin.on('keypress', function (ch, key) {\n console.log('got \"keypress\"', key);\n if (key && key.ctrl && key.name == 'd') {\n process.stdout.write(\"Exiting FXCM Console...\")\n process.stdin.pause()\n process.exit();\n }\n });\n\n //process.stdin.setRawMode(true);\n //process.stdin.resume();\n */\n process.stdin.on('data', function (data) {\n \n var input = data.toString().trim();\n var split = input.search('{');\n if (split === -1) {\n split = input.length;\n }\n const command = input.substr(0, split).trim();\n var params = input.substr(split).trim();\n const _fxcmClient = ascendant._client;\n ascendant.commands.set(ascendant.commands.size + 1, input)\n \n // if the line was empty we don't want to do anything\n switch (command) {\n case 'help':\n process.stdout.write('Help is on the way!\\r\\n')\n break;\n case 'history': \n var history = \"Command History:\\r\\n\" \n ascendant.commands.forEach((value, key) => { history += value + \"\\r\\n\" }) \n process.stdout.write(history + \"\\r\\n\" + \"Press return to continue..\")\n break;\n case 'exit': \n process.stdout.write(\"I'm out, bye!\")\n process.exit() \n break;\n case 'live':\n console.log(`Live rates for currency pair(${params}):` )\n fxcmClient.subscribeLiveRates(params)\n break;\n case 'accounts':\n fxcmClient.getAccounts()\n break;\n case 'products':\n fxcmClient.getProducts()\n break;\n case 'orderbook':\n fxcmClient.getProductOrderBook()\n break; \n case 'send':\n // command must be registered with cli\n\t if (params.length > 0) {\n params = JSON.parse(params)\n try {\n \n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n \n } catch (e) {\n console.log('could not parse JSON parameters: ', e);\n }\n } else {\n _fxcmClient.emit(command, {});\n }\n _fxcmClient.emit('prompt');\n break;\n default: \n if (_fxcmClient.eventNames().indexOf(command) < 0) {\n console.log(\"Command not recognized. Available commands: \", _fxcmClient.eventNames())\n _fxcmClient.emit('prompt');\n }\n return;\n }\n\n });\n \n this._client.on('prompt', (arg = '') => {\n readline.clearLine(process.stdout, 0)\n readline.cursorTo(process.stdout, 0, null);\n process.stdout.write('fxcm:> ' + arg);\n })\n\n this._client.on('exit', () => {\n process.exit();\n });\n\n // loading of extra modules\n this._client.on('load', (params) => {\n if (typeof(params.filename) === 'undefined') {\n console.log('command error: \"filename\" parameter is missing.')\n } else {\n var test = require(`./${params.filename}`);\n test.init(cli,socket);\n }\n });\n /*\n // helper function to send parameters in stringified form, which is required by FXCM REST API\n this._client.on('send', (params) => {\n if (typeof(params.params) !== 'undefined') {\n params.params = querystring.stringify(params.params);\n }\n ascendant._client.emit('send_raw', params);\n });\n */\n // will send a request to the server\n this._client.on('send_raw', (params) => {\n // avoid undefined errors if params are not defined\n if (typeof(params.params) === 'undefined') {\n params.params = '';\n }\n // method and resource must be set for request to be sent\n if (typeof(params.method) === 'undefined') { \n console.log('command error: \"method\" parameter is missing.');\n } else if (typeof(params.resource) === 'undefined') {\n console.log('command error: \"resource\" parameter is missing.');\n } else {\n ascendant.makeRequest(params.method, params.resource, params.params, params.callback);\n }\n });\n\n /**\n * \n */\n this._client.on('price_subscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n subscribe(params.pairs);\n }\n });\n /**\n * \n */\n this._client.on('price_unsubscribe', (params) => {\n if(typeof(params.pairs) === 'undefined') {\n console.log('command error: \"pairs\" parameter is missing.');\n } else {\n unsubscribe(params.pairs);\n }\n });\n \n }", "function Command () {}", "_emitCommandsd() {\n const commands = [];\n\n for (const [cmd, { description }] of this.commands) {\n commands.push({ cmd, description });\n }\n\n process.send({ type: 'commands', commands });\n }", "addBasicCommands() {\n this.addCommand(new commands.HelpCommand());\n }", "async function runCommand(cmd) {\r\n switch (cmd.toLowerCase()) {\r\n \r\n case \"restart\": \r\n case \"reboot\": \r\n t_println(\"Rebooting. Please wait\");\r\n await t_write(\".....\", 0.5);\r\n t_terminal.innerHTML = terminalDefaultContent;\r\n boot();\r\n break;\r\n\r\n case \"shutdown\": \r\n t_println(\"Shutting down internal services\");\r\n await t_write(\"...\", 1);\r\n t_println(\"Goodbye!\");\r\n await sleep(1);\r\n t_terminal.innerHTML = \"\";\r\n break;\r\n\r\n case \"clear\": \r\n t_terminal.innerHTML = terminalDefaultContent;\r\n init();\r\n runCommand(await t_getln());\r\n break;\r\n\r\n case \"ls\": \r\n t_println(\"This is the return value of the ls command!\");\r\n runCommand(await t_getln());\r\n break;\r\n\r\n\r\n default: // Über JSON File falls kein 'Aktiver' Command (also wenn nur text zurück)\r\n t_println(\"Command not found: \" + cmd);\r\n runCommand(await t_getln()); //Ready for the next input\r\n break;\r\n }\r\n}", "function readCommands() {\n stdin.resume();\n\n stdin.on('data', function (data) {\n let message = data.toString().trim();\n\n // check for command \"--chat UserName\" to start new chat with that user\n if (message.toLowerCase().indexOf('--chat') > -1) {\n let new_user = message.split(\" \").slice(1).join(\" \");\n\n if (new_user) {\n startChat(new_user);\n user = new_user;\n } else {\n console.log(logSymbols.error, chalk.red('user name not specified!'));\n }\n }\n // clear chat screen\n else if (message.toLowerCase().indexOf('--clear') > -1) {\n process.stdout.write(ansiEscapes.clearScreen);\n } else {\n typeMessage(message);\n }\n\n stdin.resume();\n });\n }", "function switchCommand(){\n\tswitch(command){\n\t\tcase \"my-tweets\":\n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tspotifyThisSong(userChoice);\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tmovieThis(userChoice);\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tdoWhatItSays();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tconsole.log(\"Please enter a valid command.\");\n\t\t\tconsole.log('\"my-tweets\", \"spotify-this-song\", \"movie-this\", \"do-what-it-says\"');\n\t\t\tbreak;\n\t}\n}", "displayCmd() {\r\n var cmdText = \"Commands \\n\";\r\n for (let i = 0; i < this.cmdOrder.length; ++i) {\r\n cmdText += this.cmdOrder[i] + \": \";\r\n cmdText += keyboardMap[this.cmdKeyCode[this.cmdIdx[this.cmdOrder[i]]]];\r\n cmdText += \"\\n\";\r\n }\r\n this.document.getElementById('commands').innerText = cmdText;\r\n }", "function commands(command) {\n switch (command) {\n case \"concert-this\":\n concertSearch();\n break;\n case \"movie-this\":\n movieSearch();\n break;\n case \"spotify-this-song\":\n songSearch();\n break;\n case \"do-what-it-says\":\n doThis();\n break;\n default:\n console.log('Liri needs to be told what to do...');\n };\n}", "_onCommand(e) {\n e.preventDefault();\n const command = this.commandInput.value;\n this.commandInput.value = \"\";\n // begin shout command\n if(command.startsWith(\"/shout \")) { \n const shout = command.substring(7);\n this._addMessage(`You shout \"${shout}\"`);\n } // end shout command\n\n // begin shout command\n else if(command.startsWith(\"/whisper \")) { \n const shout = command.substring(9);\n this._addMessage(`You whisper \"${shout}\"`);\n } // end shout command \n\n // begin logoff command \n else if (command.startsWith(\"/logoff\")) { \n this._onLogOut(); \n } // end logoff command\n\n // begin search command\n else if (command.startsWith(\"/search\")) {\n this._search();\n } // end search command \n\n // begin attack command\n else if (command.startsWith(\"/attack\")) {\n this._attack();\n } // end attack command\n\n // begin help command\n else if (command.startsWith(\"/help\")) {\n this._helpMessage();\n } // end help command\n\n // begin escape command\n else if (command.startsWith(\"/escape\"))\n {\n this._escape();\n } // end escape command\n\n // begin dam command\n else if(command.startsWith(\"/dam\")) {\n console.log(this._calculatePlayerDamage());\n } // end dam command\n\n // basic speech\n else {\n this._addMessage(`You say \"${command}\"`);\n }\n }", "function listCommands() {\n console.log(`${mainDivider}\\n${\"WELCOME TO LIRI-BOT! HERE'S WHAT I CAN DO!\"}\\n${mainDivider}`)\n console.log(`${\"Use the following commands to run Liri-Bot:\"}\\n${minorDivider}\\n${\"'my-tweets' : To list the last 20 tweets\"}\\n${minorDivider}\\n${\"'spotify-this-song' + 'song name': To lists the Artist, Song Name, Preview Link, and Album\"}\\n${minorDivider}\\n${\"'movie-this' + 'movie title': To lists the Movie Title, Release Year, IMDB Rating, Rotten Tomatoes Rating, Country, Language, Plot, Cast\"}\\n${mainDivider}`);\n}", "function listCommands() {\n console.log(\n 'List of commands available:\\n' +\n '[-help] - Lists all the available commands.\\n' +\n '[Github URL] - Lists the commits for the provided GitHub URL.\\n' +\n '[Github URL] [nocache] - Lists the commits for the provided GitHub URL, ignoring cached values.\\n' +\n '[exit] - Ends Application\\n'\n )\n}", "loadCommands(){\n let Artyom = this._artyom;\n\n // Here you can load all the commands that you want to Artyom\n return Artyom.addCommands([\n {\n indexes: [\"Hello\", \"Hi\"],\n action: () => {\n Artyom.say(\"Hello, how are you?\");\n }\n },\n {\n indexes: [/How are you/, /Regular expressions supported/],\n smart: true,\n action: () => {\n Artyom.say(\"I'm fine, thanks for asking !\");\n }\n },\n {\n indexes: [\"Generate reports of * of this year\"],\n smart: true,\n action: (i, month) => {\n let year = new Date().getFullYear();\n \n Artyom.say(`Generating reports of ${month} ${year} `);\n\n Artyom.say(\"Ready ! What were you expecting? write some code you lazy bear !\");\n }\n },\n ]);\n }", "function commands(input){\n\tswitch(input){\n\t\tcase \"my-tweets\" : \n\t\t\tmyTweets();\n\t\t\tbreak;\n\t\tcase \"spotify-this-song\":\n\t\t\tsearchSpotify(userSearch);\n\t\t\tbreak;\n\t\tcase \"movie-this\":\n\t\t\tsearchMovie(userSearch);\n\t\t\tbreak;\n\t\tcase \"do-what-it-says\":\n\t\t\tdoWhatItSays();\n\t\t\tbreak;\n\t}\n}", "function doWhatItSays() {\n let commands = [];\n let command = '';\n let arg = '';\n let key = true;\n\n for (let i = 0; i < randomText.length; i++) {\n if (randomText[i] !== '\\n' && randomText[i] !== ' ' && key) {\n command += randomText[i];\n } else {\n arg += randomText[i];\n }\n\n if (randomText[i] === ' ') {\n key = false;\n }\n\n if (randomText[i] === '\\n') {\n commands.push({\n command,\n arg: arg.slice(1, -1)\n })\n command = '';\n arg = '';\n key = true;\n }\n\n }\n let randomTask = commands[randomizer(0, commands.length)];\n terminalArg = randomTask.command;\n let words = randomTask.arg.split(' ');\n\n words.forEach((word) => {\n process.argv.push(word);\n })\n\n}", "function initCommands () {\n const newCmds = [];\n commands.forEach(function (el) {\n if (el.verb) {\n el.regex = el.regex + ' #object#';\n }\n if (!(el.regex instanceof RegExp)) {\n alert('No regex for ' + el.name);\n }\n if (el.npcCmd) {\n // console.log(\"creating NPC command for \" + el.name)\n const regexAsStr = el.regex.source.substr(1); // lose the ^ at the start, as we will prepend to it\n const objects = el.objects.slice();\n objects.unshift({ scope: parser.isHere, attName: 'npc' });\n\n const data = {\n objects: objects,\n attName: el.attName,\n default: el.default,\n defmsg: el.defmsg,\n rules: el.rules,\n score: el.score,\n cmdCategory: el.cmdCategory ? el.cmdCategory : el.name,\n forNpc: true\n };\n\n for (const key in lang.tell_to_prefixes) {\n const cmd = new NpcCmd('Npc' + el.name + key, data);\n cmd.regex = new RegExp('^' + lang.tell_to_prefixes[key] + regexAsStr);\n if (el.useThisScriptForNpcs) cmd.script = el.script;\n newCmds.push(cmd);\n }\n }\n });\n\n commands.push.apply(commands, newCmds);\n\n lang.exit_list.forEach(function (el) {\n if (!el.nocmd) {\n let regex = '^(' + lang.go_pre_regex + ')(' + el.name + '|' + el.abbrev.toLowerCase();\n if (el.alt) { regex += '|' + el.alt; }\n regex += ')$';\n let cmd = new ExitCmd('Go' + sentenceCase(el.name), el.name, {\n regex: new RegExp(regex)\n });\n commands.push(cmd);\n\n regex = '^(.+), ?(' + lang.go_pre_regex + ')(' + el.name + '|' + el.abbrev.toLowerCase();\n if (el.alt) { regex += '|' + el.alt; }\n regex += ')$';\n cmd = new NpcExitCmd('NpcGo' + sentenceCase(el.name) + '1', el.name, {\n regex: new RegExp(regex)\n });\n commands.push(cmd);\n\n regex = '^tell (.+) to (' + lang.go_pre_regex + ')(' + el.name + '|' + el.abbrev.toLowerCase();\n if (el.alt) { regex += '|' + el.alt; }\n regex += ')$';\n cmd = new NpcExitCmd('NpcGo' + sentenceCase(el.name) + '2', el.name, {\n regex: new RegExp(regex)\n });\n commands.push(cmd);\n }\n });\n }", "addSampleCommands() {\n this.addCommand(new sampleCommands.MagicEightBallCommand());\n this.addCommand(new sampleCommands.RollCommand());\n }", "function doCli() {\n rl.prompt();\n rl.on('line', function (line) {\n var words = line.trim().split(' '),\n cmd = words.shift(),\n str = words.join(' ');\n\n if (!cmd) {\n // repeat last command\n cmd = lastcmd;\n str = lastargs;\n }\n\n switch(cmd) {\n case 'c': connStatus(); break;\n case 'm': customMessage(str); break;\n case 's': setScenario(str); break;\n case 'n': nextEvent(); break;\n case 'r': restartScenario(); break;\n case 'q': quit(); break;\n case '?': showHelp(); break;\n default: console.log('Say what?! (? for help)'); break;\n }\n lastcmd = cmd;\n lastargs = str;\n rl.prompt();\n\n }).on('close', function () {\n quit();\n });\n}", "start(){\r\n process.stdin.resume();\r\n process.stdin.setEncoding('utf8');\r\n prompt();\r\n \r\n process.stdin.on('data', function(chunk) {\r\n let [success, res, more] = parseCommand(chunk.replace('\\n', '').replace('\\r', ''));\r\n if (!success){\r\n switch(res){\r\n case errcodes.NOCOMMAND :\r\n console.error(`CommandLine Error : nonexistant command (${more})`);\r\n break;\r\n case errcodes.NONAMESPACE :\r\n console.error(`CommandLine Error : nonexistant namespace (${more})`);\r\n break;\r\n } \r\n }\r\n logging = false;\r\n prompt();\r\n });\r\n logging = false;\r\n }", "constructor() {\n this.command = \"\";\n }", "function doRegisterCommands() {\r\n GM_registerMenuCommand('Configurar ' + appName + ' ' + appVersion + '...', preferences);\r\n GM_registerMenuCommand('Ver información de depurado', showLog);\r\n }", "command() {\n return '';\n }", "function commandFinder(cmd) {\n\tvar activeCommands = JSON.parse(fs.readFileSync('./cmds.json', 'utf8'));\n\tvar splitInput = cmd.trim().split(\" \")\n\tfor (var i = 0; i < activeCommands.commands.length; i++) {\n\t\tif (activeCommands.commands[i].name.toLowerCase() == splitInput[0].toLowerCase()) {\n\t\t\tif (activeCommands.commands[i].name.toLowerCase() != \"exit\") {\n\t\t\t\tclearScreen();\n\t\t\t\trunScript(activeCommands.commands[i].file, function (err) {\n \t\t\t\tif (err) throw err;\n \t\t\t\t//clearScreen();\n \t\t\t\tconsole.log(`\\n-----------\\nThe ${activeCommands.commands[i].name} command has finished running.`);\n \t\t\t\taskForPrompt();\n\t\t\t\t});\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log(\"\\nThe script has been terminated.\")\n\t\t\t\tprocess.exit()\n\t\t\t}\n\t\t}\n\t\tif (i + 1 == activeCommands.commands.length) {\n\t\t\tclearScreen()\n\t\t\tconsole.log(\"You didn't enter a valid command.\\nNeed help? Type in 'help' as your input.\\n\")\n\t\t\taskForPrompt()\n\t\t}\n\t}\n}", "function registerCommands() {\n // $ bot service <cmd>\n serviceCommands();\n // $ bot logs <cmd>\n logsCommands();\n // $ bot queue <cmd>\n queueCommands();\n // $ bot repos <cmd>\n repoCommands();\n // $ bot run reponame/botname{.js?}\n runCommands();\n // $ bots console\n consoleCommands();\n // Parse the argv list for registered commands\n app.parse(process.argv);\n}", "readCLI() {\n\n }", "function os_func() {\n this.execCommand = function (cmd, callback) {\n exec(cmd, (error, stdout, stderr) => {\n if (error) {\n console.error(`exec error: ${error}`);\n return;\n }\n\n callback(stdout);\n });\n };\n }", "enterCommand(ctx) {\n\t}", "function addMenuCommands() {\n var navigateMenu = Menus.getMenu(Menus.AppMenuBar.NAVIGATE_MENU);\n var viewMenu = Menus.getMenu(Menus.AppMenuBar.VIEW_MENU);\n var registerCommandHandler = function (commandId, menuName, handler, shortcut, menu) {\n CommandManager.register(menuName, commandId, handler);\n menu.addMenuItem(commandId);\n KeyBindingManager.addBinding(commandId, shortcut);\n };\n\n navigateMenu.addMenuDivider();\n\n registerCommandHandler('georapbox.notes.viewNotes', Strings.COMMAND_NAME, togglePanel, 'Ctrl-Alt-Shift-N', viewMenu);\n }", "function selectCommand(command){\n switch(command){\n case \"spotify-this-song\":\n spotifyCommand();\n break;\n case \"movie-this\":\n omdbCommand();\n break;\n case \"concert-this\":\n bandsInTownCommand();\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n case \"Never Mind\":\n console.log(\"\\nBye!\")\n break;\n }\n}", "function processCommands(arr) {\r\n let process = (function () {\r\n let text = '';\r\n return {\r\n append: (newText) => text += newText,\r\n removeStart: (count) => text = text.slice(count),\r\n removeEnd: (count) => text =\r\n text.slice(0, text.length - count),\r\n print: () => console.log(text)\r\n\r\n }\r\n })();\r\n for(let cmd of arr){\r\n let [command, count] = cmd.split(' ');\r\n process[command](count);\r\n }\r\n}", "function commands(command) {\n try {\n var interpreter = interpreters.top();\n \n if (command == 'exit' && settings.exit) {\n if (interpreters.size() == 1) {\n if (settings.login) {\n logout();\n } else {\n var msg = 'You can exit from main interpeter';\n self.echo(msg);\n }\n } else {\n self.pop('exit');\n }\n } else {\n echo_command(command);\n if (command == 'clear' && settings.clear) {\n self.clear();\n } else {\n interpreter['eval'](command, self);\n }\n }\n \n } catch (e) {\n display_exception(e, 'USER');\n self.resume();\n throw e;\n }\n }", "function run() {\n\nswitch (command) {\n\ncase 'my-tweets':\n\tgetTweets();\n break;\ncase 'spotify-this-song':\n\tgetSong(search);\n break;\ncase 'movie-this':\n\tgetFilm(search);\n break;\ncase 'do-what-it-says':\n\tgetRandom();\n break;\ncase 'HELP':\n\tconsole.log(\"Options: \\n my-tweets \\n spotify-this-song SONGNAME \\n movie-this MOVIENAME \\n do-what-it-says\")\ndefault:\n\tconsole.log(\"Enter a command, type 'node liri.js HELP' if need be\")\n break;\n}\n}", "constructor()\n {\n super();\n\n this.name = \"dev\";\n this.description = \"Commands for only my developer\";\n this.usage = \"<subcommand>\";\n this.permissions = [\"dev\"];\n\n this.addCommand(\"./dev/PermCommand.js\");\n this.addCommand(\"./dev/PermsCommand.js\");\n this.addCommand(\"./dev/AvatarCommand.js\");\n this.addCommand(\"./dev/SayCommand.js\");\n this.addCommand(\"./dev/TestCommand.js\");\n }", "function addCommand(command)\n {\n if(command.name !== undefined && command.man !== undefined && command.run !== undefined)\n {\n _consoleCommands.push(command);\n }\n }", "function AWCommands(value) {\n\tif(value === \"/aw stop\") {\n\t\tkillAutoWoot();\n\t} else if(value === \"/aw start\") {\n\t\tloadAutoWoot();\n\t} else if(value === \"/aw woot start\") {\n\t\tdoCMD(\"on\",\"autoWoot\", \"HISTORY_UPDATE\", \"AutoWoot Turned On.\");\n\t} else if(value === \"/aw woot stop\") {\n\t\tdoCMD(\"off\",\"autoWoot\", \"HISTORY_UPDATE\", \"AutoWoot Turned Off.\");\n\t} else if(value === \"/aw join start\") {\n\t\tdoCMD(\"on\",\"autoJoin\", \"DJ_UPDATE\", \"AutoJoin Turned On.\");\n\t} else if(value === \"/aw join stop\") {\n\t\tdoCMD(\"off\",\"autoJoin\", \"DJ_UPDATE\", \"AutoJoin Turned Off.\");\n\t} else if(value === \"/aw\") {\n\t\tmessage(welcome);\n\t}\n\t\n}", "loadCommands(){\n let Artyom = this._artyom;\n\n // Here you can load all the commands that you want to Artyom\n return Artyom.addCommands([\n {\n indexes: [\"hello\", \"hi\"],\n action: () => {\n Artyom.say(\"Hello, how are you?\");\n }\n },\n {\n indexes: [/How are you/, /Regular expressions supported/],\n smart: true,\n action: () => {\n Artyom.say(\"I'm fine, thanks for asking !\");\n }\n },\n {\n indexes: [\"Generate reports of * of this year\"],\n smart: true,\n action: (i, month) => {\n let year = new Date().getFullYear();\n\n Artyom.say(`Generating reports of ${month} ${year} `);\n\n Artyom.say(\"Ready ! What were you expecting? write some code you lazy bear !\");\n }\n },\n {\n indexes: [\"What is the weather like\"],\n action: () => {\n axios.get(\"http://api.openweathermap.org/data/2.5/forecast?id=1880252&APPID=6feeacb3997e0e4f4a7f9e9c4b193934\")\n .then(result=>{\n let data = Math.floor(result.data.list[0].main.temp) - 273\n Artyom.say(`Temperature is ${data} degrees celcius`);\n })\n\n }\n }\n ]);\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 help() {\n printLine('The following commands work. Hover them for more information.');\n printLine('' +\n ' <span class=\"yellow\" title=\"Explain the list of commands\">help</span>,' +\n ' <span class=\"yellow\" title=\"Clear the screen for freshness\">clear</span>,' +\n ' <span class=\"yellow\" title=\"List all the files in this directory\">ls</span>,' +\n ' <span class=\"yellow\" title=\"List all links on the website\">tree</span>,' +\n ' <span class=\"yellow\" title=\"Change directory to `dirname`\">cd </span>' +\n '<span class=\"blue\" title=\"Change directory to `dirname`\"><em>dirname</em></span>,' +\n ' <span class=\"yellow\" title=\"Show the contents of `filename`\">cat </span>' +\n '<span class=\"green\" title=\"Show the contents of `filename`\"><em>filename</em></span>'\n );\n printLine('<br>');\n printLine('You can also use the' +\n ' <kbd class=\"cyan\">Up</kbd> and' +\n ' <kbd class=\"cyan\">Down</kbd>' +\n ' keys to navigate through your command history.'\n );\n printLine('You can click on tree nodes if CLI is not your thing.' +\n ' You\\'ll still need to hit <kbd class=\"cyan\">Enter</kbd>.'\n );\n}", "function validCommand() {\n console.log(\"\\n\" + \"Please enter a valid command from the following list:\");\n console.log(\"concert-this\");\n console.log(\"spotify-this-song\");\n console.log(\"movie-this\");\n console.log(\"do-what-it-says\" + \"\\n\");\n}", "function start(){\n switch(lCmd){\n case 'my-tweets':\n Tweets();\n break;\n case 'spotify-this-song':\n SpotifyCall(inputs);\n break;\n case 'movie-this':\n Movie(inputs);\n break;\n case 'do-what-it-says':\n Do();\n break;\n default:\n console.log(\"my-tweets, spotify-this-song, movie-this and do-what-it-says are the only commands accepted. Check your input.\");\n break;\n \n }\n}", "defaultVoiceCommands() {\n this.addVoiceCommand(`(hey) ${this.voiceRespondsTo}`, this, \"promptMerlin\");\n this.addVoiceCommand(`(hey) marilyn`, this, \"promptMerlin\"); // common mispronunciation\n this.addVoiceCommand(`stop listening`, this, \"stopMerlin\");\n this.addVoiceCommand(`close merlin`, this, \"closeMerlin\");\n this.addVoiceCommand(`cancel merlin`, this, \"closeMerlin\");\n this.addVoiceCommand(`disable santa (mode)`, this, \"belsnickel\");\n this.addVoiceCommand(`belsnickel`, this, \"belsnickel\");\n this.addVoiceCommand(`scroll`, this, \"scroll\");\n\n this.voiceCommands[`scroll up`] = (response) => {\n window.scrollBy({\n top: -(window.innerHeight * 0.5),\n left: 0,\n behavior: \"smooth\",\n });\n };\n this.voiceCommands[`scroll (down)`] = (response) => {\n window.scrollBy({\n top: window.innerHeight * 0.5,\n left: 0,\n behavior: \"smooth\",\n });\n };\n this.voiceCommands[`scroll (to) bottom`] = (response) => {\n window.scrollTo(0, document.body.scrollHeight);\n };\n this.voiceCommands[`scroll (to) top`] = (response) => {\n window.scrollTo(0, 0);\n };\n this.voiceCommands[`back to top`] = (response) => {\n window.scrollTo(0, 0);\n };\n\n this.voiceCommands[\"(run) program\"] = (response) => {\n this.commandContextChanged({ detail: { value: \"/\", label: \"program\" } });\n };\n this.voiceCommands[\"(I need) help\"] = (response) => {\n this.commandContextChanged({ detail: { value: \"?\", label: \"help\" } });\n };\n this.voiceCommands[\"developer (mode)\"] = (response) => {\n this.commandContextChanged({\n detail: { value: \">\", label: \"developer\" },\n });\n };\n // LAST priority bc it matches ANYTHING, no idea why I need to wait this tho..\n this.addVoiceCommand(\"*anything\", this, \"updateSearchInputViaVoice\");\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 }", "runCmd() {\n switch(this.command) {\n case \"concert-this\":\n this.concertThis();\n break;\n case \"spotify-this-song\":\n this.spotifyThisSong();\n break;\n case \"movie-this\":\n this.movieThis();\n break;\n case \"do-what-it-says\":\n this.doWhatItSays();\n break;\n case undefined:\n this.usage();\n return false;\n default:\n console.log(`Unable to understand the command \"${this.command}\"\\n`);\n this.usage();\n return false;\n }\n\n return true;\n }", "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.funct = \"\";\n}", "get commands() {\n let commands = this._commands.reduce((commands, command) => ({\n ...commands,\n [command.name]: new EditorCommandAdaptor(command, this)\n }), {});\n return commands;\n }", "function initializeCommands() {\n CommandManager.register(Strings.CMD_TOGGLE_PURE_CODE, CMD_TOGGLE_PURE_CODE, _togglePureCode);\n CommandManager.register(Strings.CMD_TOGGLE_PANELS, CMD_TOGGLE_PANELS, _togglePanels);\n\n Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_TOGGLE_PANELS, \"\", Menus.AFTER, Commands.VIEW_HIDE_SIDEBAR);\n Menus.getMenu(Menus.AppMenuBar.VIEW_MENU).addMenuItem(CMD_TOGGLE_PURE_CODE, \"\", Menus.AFTER, CMD_TOGGLE_PANELS);\n\n KeyBindingManager.addBinding(CMD_TOGGLE_PURE_CODE, [ {key: togglePureCodeKey}, {key: togglePureCodeKeyMac, platform: \"mac\"} ]);\n\n //default toggle panel shortcut was ctrl+shift+` as it is present in one vertical line in the keyboard. However, we later learnt\n //from IQE team than non-English keyboards does not have the ` char. So added one more shortcut ctrl+shift+1 which will be preferred\n KeyBindingManager.addBinding(CMD_TOGGLE_PANELS, [ {key: togglePanelsKey}, {key: togglePanelsKeyMac, platform: \"mac\"} ]);\n KeyBindingManager.addBinding(CMD_TOGGLE_PANELS, [ {key: togglePanelsKey_EN}, {key: togglePanelsKeyMac_EN, platform: \"mac\"} ]);\n }", "function processCommands(command, commandParam){\n\n\t//console.log(commandParam);\n\n\tswitch(command){\n\n\tcase 'spotify-this-song':\n\t\t//If user has not specified a song , use default\n\t\tif(commandParam === undefined){\n\t\t\tcommandParam = defaultSong;\n\t\t} \n\t\tspotifyThis(commandParam); break;\n\tcase 'movie-this':\n\t\t//If user has not specified a movie Name , use default\n\t\tif(commandParam === undefined){\n\t\t\tcommandParam = defaultMovie;\n\t\t} \n\t\tmovieThis(commandParam); break;\n\tcase 'do-what-it-says':\n\t\tdoWhatItSays(); break;\n\tdefault: \n\t\tconsole.log(\"Invalid command. Please type any of the following commands: spotify-this-song movie-this or do-what-it-says\");\n}\n\n\n}", "function Terminal () {}", "init() {\n\n // Store required containers for faster access.\n this._userContainer = document.querySelector(\"#statusbar-user-position\");\n this._pointerContainer = document.querySelector(\"#statusbar-pointer-position\");\n this._speedContainer = document.querySelector(\"#statusbar-speed\");\n this._inputField = document.querySelector(\"#console-input-area input\");\n this._suggestionField = document.querySelector(\"#console-suggestion-area\");\n this._outputField = document.querySelector(\"#console-output-area\");\n this._outputWrapper = document.querySelector(\"#console-output-wrapper\");\n\n // The 'console-has-input-focus' class on the _outputWrapper forces the console messages to not\n // fade when the text input field has input focus.\n this._inputField.onfocus = (e) => {\n this._outputWrapper.classList.add('console-has-input-focus');\n };\n\n this._inputField.onblur = (e) => {\n this._outputWrapper.classList.remove('console-has-input-focus');\n };\n\n this._inputField.onkeydown = (e) => {\n // Up pressed - history up.\n if (e.keyCode == 38) {\n if (this.history.length > 0) {\n if (this.historyIndex == this.history.length) {\n this._currentCmd = this._inputField.value;\n }\n this.historyIndex = Math.max(0, this.historyIndex - 1);\n this._inputField.value = this.history[this.historyIndex];\n }\n e.preventDefault();\n }\n\n // Down pressed - history down.\n if (e.keyCode == 40) {\n if (this.history.length > 0) {\n this.historyIndex = Math.min(this.history.length, this.historyIndex + 1);\n if (this.historyIndex == this.history.length) {\n this._inputField.value = this._currentCmd;\n } else {\n this._inputField.value = this.history[this.historyIndex];\n }\n }\n e.preventDefault();\n }\n };\n\n this._inputField.onkeypress = (e) => {\n this._enableSuggestionArea(false);\n\n // Return pressed - try to execute the command!\n if (e.keyCode == 13) {\n try {\n let result = window.eval(this._inputField.value);\n if (result != undefined) {\n console.log(result);\n } else {\n console.log(this._inputField.value);\n }\n } catch (error) { console.warn(error); }\n\n // Push command to history.\n if (this.history.length == 0 ||\n this.history[this.history.length - 1] != this._inputField.value) {\n this.history.push(this._inputField.value);\n CosmoScout.callbacks.statusbar.addCommandToHistory(this._inputField.value);\n }\n\n this.historyIndex = this.history.length;\n this._inputField.value = \"\"\n }\n\n // Tab pressed - auto complete.\n if (e.keyCode == 9) {\n e.preventDefault();\n\n // Store position of cursor for better readability.\n let cursorPos = this._inputField.selectionStart;\n\n // Get current command until position of cursor.\n let text = this._inputField.value.substring(0, cursorPos);\n\n // We will suggest properties of object directly preceding the cursor. The name of the\n // object has to end with a '.', the start of the object can be any of the characters in\n // the regex below.\n let objectEnd = text.lastIndexOf(\".\");\n let objectBegin = 0;\n\n // find last occurrence of \" \" , ; + - * / ( ) { } | & !\n let regex = new RegExp(\"\\\\s|,|;|\\\\+|-|\\\\*|/|\\\\(|\\\\)|{|}|\\\\||&|\\\\!\", \"g\");\n let match;\n while ((match = regex.exec(text)) != null) {\n objectBegin = match.index + 1;\n }\n\n // Now we have to get the object's name and the prefix of the property which is to\n // completed. If there is no '.' preceding the cursor, there is no object and we have to\n // look for global variable (object name = 'window'). The prefix is everything between\n // the '.' and the cursor position (or the entire command if there is no '.').\n let prefixBegin = 0;\n let objectName = \"window\";\n\n if (objectEnd < objectBegin) {\n prefixBegin = objectBegin;\n } else if (objectEnd > 0 && objectBegin < cursorPos - 1) {\n objectName = text.substring(Math.max(0, objectBegin), objectEnd);\n prefixBegin = objectEnd + 1;\n }\n\n let prefix = text.substring(prefixBegin);\n\n // Now that we have the object's name, we can get the object by evaluating it.\n let object = eval(objectName);\n\n // Now we can loop through all properties of the object and find suitable\n // completion candidates.\n if (object != undefined) {\n\n // We suggest all properties of the object and it's __proto__ part.\n let properties = Object.getOwnPropertyNames(object);\n let proto = Object.getPrototypeOf(object);\n\n if (proto && proto != Object.prototype && typeof proto !== \"function\") {\n properties = properties.concat(Object.getOwnPropertyNames(proto))\n }\n\n // Now we filter the list to contain only those with our prefix and sort it\n // alphabetically.\n properties =\n properties.filter(element => prefix === \"\" || element.startsWith(prefix)).sort();\n\n // If the cursor is somewhere in the middle of a property name, we want to replace the\n // entire property with our completion. We use another regex to find the end of the text\n // we want to replace.\n let prefixEnd = cursorPos;\n\n // Find next occurrence of \" \" , ; + - * / ( ) { } | & ! [ ]\n let regex = new RegExp(\"\\\\s|,|;|\\\\+|-|\\\\*|/|\\\\(|\\\\)|{|}|\\\\||&|\\\\!|\\\\[|\\\\]\", \"g\");\n regex.lastIndex = cursorPos;\n match = regex.exec(this._inputField.value);\n\n if (match != null) {\n prefixEnd = match.index;\n }\n\n // If the thing we suggest for completion is an object, we append a '.', if it's a\n // function we add '()' and place the cursor between the brackets.\n let getCompletion = (element) => {\n let completion = element;\n let finalCursorPos = prefixBegin + completion.length;\n if (typeof object[completion] === \"function\") {\n completion += \"()\";\n finalCursorPos += 1;\n }\n\n if (typeof object[completion] === \"object\") {\n completion += \".\";\n finalCursorPos += 1;\n }\n\n return [completion, finalCursorPos];\n };\n\n if (properties.length == 1) {\n // If there is only one possible completion, we directly apply it.\n let [completion, finalCursorPos] = getCompletion(properties[0]);\n this._setCompletion(prefixBegin, prefixEnd, finalCursorPos, completion);\n\n } else if (properties.length > 1) {\n // If there are multiple completion possibilities, we show a list and complete as much\n // as possible (the longest prefix shared by all suggestions).\n this._suggestionField.innerHTML = \"\";\n\n // This will be truncated to the longest shared prefix.\n let maximumCompletion = properties[0];\n\n properties.forEach(element => {\n let [completion, finalCursorPos] = getCompletion(element);\n let classNames = `suggestion type-${typeof object[element]}`;\n\n // Compare this completion candidate with our current longest shared prefix. Truncate\n // this if needed.\n let i = 0;\n while (i < completion.length && i < maximumCompletion.length &&\n completion.charAt(i) === maximumCompletion.charAt(i)) {\n i++;\n }\n maximumCompletion = maximumCompletion.substring(0, i);\n\n // If it's a \"private\" property, add a class name. These items will be drawn less\n // opaque.\n if (completion.startsWith(\"_\")) {\n classNames += \" private\";\n }\n\n // Finally add the item to the list of completions. Clicking it will apply the\n // completion.\n this._suggestionField.insertAdjacentHTML(\"beforeend\", `<span class='${classNames}'\n onclick='CosmoScout.statusbar._setCompletion(${prefixBegin}, ${prefixEnd}, \n ${finalCursorPos}, \"${completion}\");'>\n ${element}\n </span>`);\n });\n\n // Set the longest shared prefix as completion and place the cursor to the end.\n this._setCompletion(\n prefixBegin, prefixEnd, prefixBegin + maximumCompletion.length, maximumCompletion);\n\n // Finally show the completion area.\n this._enableSuggestionArea(true);\n }\n }\n }\n };\n }", "function handleCommands(ce) {\n if (ce.content === '!!time') {\n send(new Date().toString());\n }\n if (ce.content === '!!stop') {\n send('...');\n silent = true;\n }\n if (ce.content === '!!go') {\n silent = false;\n }\n }", "beforeCommand (commandName, args) {\n }", "runCmdsPerWhatItSays(lines) {\n for (let i = 0; i < lines.length; i++) {\n let items = lines[i].split(',');\n\n if (/-/.test(items[0])) {\n console.log(`\\nIt says, ${items.join(' ')}, on line ${i+1}`);\n\n this.command = items[0];\n this.cmdArgs = items.slice(1);\n this.runCmd();\n }\n }\n }", "function commands (selection, value) {\n switch (selection) {\n case \"concert-this\":\n concertAPI(value);\n break;\n case \"spotify-this-song\":\n spotifyAPI(value);\n break;\n case \"movie-this\":\n movieAPI(value);\n break;\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default: \n console.log(\"LIRI BOT does not recognize this command\");\n };\n}", "updateCommandsBox() {\n this.bottom.setContent(\n this.commands.reduce(\n (a, { key, label }) =>\n `${a}{black-fg}{white-bg}{bold}${key}{/}: ${label}\\t`,\n ' '\n )\n );\n this.screen.render();\n }", "addCommand(command) {\n this.buffer.push(command)\n }", "function GetCommands() {\n\treturn Commands;\n}", "get commands() {\n return this.commandManager.commands;\n }", "function switchBoard() {\n // console.log(\"The value of command is: \" + command);\n\n switch (command) {\n case \"concert-this\": \n // console.log(\"option1\");\n concertThis(queryTerm);\n break;\n case \"spotify-this-song\":\n // console.log(\"option2\");\n spotifyThisSong(queryTerm);\n break;\n case \"movie-this\": \n // console.log(\"option3\");\n movieThis(queryTerm);\n break;\n default:\n console.log(\"That command is not recognized\") \n };\n}", "function 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 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 getCommands(){\r\n return coscripter.components.commands(); \r\n}", "constructor() {\n this.commands = {}\n this.listeners = {}\n }", "function executeCommand(str){\n console.log(str)\n\n var cmdMap = {\n 'about': showAbout,\n 'commands': showCommands,\n \"voice\": toggleVoice\n };\n\n // remove '/'; to lowercase; make into array\n var commandArray = str.slice(1)\n .toLowerCase()\n .split(' ');\n var cmd = commandArray[0];\n var args = commandArray.slice(1);\n\n // run the command w/ args OR error.\n (cmdMap[cmd] || showCommandError)(args);\n\n $('#content').scrollTop(document.getElementById('content').scrollHeight)\n $('#message').val('').focus();\n}", "function commandsSelect(comm, para) {\n\n switch (comm) {\n case \"concert-this\":\n concert(para);\n break;\n\n case \"spotify-this-song\":\n spotify(para);\n break;\n\n case \"movie-this\":\n movie(para);\n break;\n\n case \"do-what-it-says\":\n doWhatItSays();\n break;\n default:\n console.log(\"Check out the commands.\");\n }\n\n}", "callCommand() {\n this.isCommand = true\n }", "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.function = \"\";\n}", "function ShellCommand() \n{\n // Properties\n this.command = \"\";\n this.description = \"\";\n this.function = \"\";\n}", "function newCommand() {\r\n\t// Get the code for the character that was pressed\r\n\tvar x;\r\n\tif(window.event) // IE8 and earlier\r\n\t{\r\n\t\tx=event.keyCode;\r\n\t} \r\n\telse if(event.which) // IE9/Firefox/Chrome/Opera/Safari\r\n\t{\r\n\t\tx=event.which;\r\n\t}\r\n\t\t// Check if \"enter\" was pressed\r\n\t\tif (x==13) {\r\n\t\t\t// Calls the inputCheck function\r\n\t\t\tinputCheck();\r\n\t\t\t\r\n\t\t\t// Stop event propagation\r\n\t\t\tif(!e) var e = window.event;\r\n\t\t\te.cancelBubble = true;\r\n\t\t\te.returnValue = false;\r\n\t\t\tif (e.stopPropagation) {\r\n\t\t\t\te.stopPropagation();\r\n\t\t\t\te.preventDefault();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function setCommandInput(command)\n {\n var newValue = $(_consoleSelector).val().slice(0, _eraseLimit) + command;\n $(_consoleSelector).val(newValue);\n }", "function showCommands(){\n $('#content').append('<div class=\"info-message\">/about - shows information about this application<br>/voice - activates text to speech<br>/commands - lists all available commands<br></div>');\n}", "blankCommand(command, message) {\n }", "get validCommands() {\n return [\"backColor\", \"bold\", \"createLink\", \"copy\", \"cut\", \"defaultParagraphSeparator\", \"delete\", \"fontName\", \"fontSize\", \"foreColor\", \"formatBlock\", \"forwardDelete\", \"insertHorizontalRule\", \"insertHTML\", \"insertImage\", \"insertLineBreak\", \"insertOrderedList\", \"insertParagraph\", \"insertText\", \"insertUnorderedList\", \"justifyCenter\", \"justifyFull\", \"justifyLeft\", \"justifyRight\", \"outdent\", \"paste\", \"redo\", \"selectAll\", \"strikethrough\", \"styleWithCss\", \"superscript\", \"undo\", \"unlink\", \"useCSS\"];\n }", "addCommands(commands){if(this.annyang){this.annyang.addCommands(commands)}}", "function IExposeCommandsEx() {}", "function addInput() {\n //reset the commandIndex\n commandIndex = -1;\n $(\"#terminalOutput\").append(user + ' <input id=\"terminalInput\" spellcheck=\"false\"></input>');\n //Delaying for IE\n //stupid IE\n //Debug is because codepen will take you out of editing code\n //whenever it autosaves\n if (debug) {\n setTimeout(function () {\n $(\"#terminalInput\").focus();\n }, 10);\n }\n\n //Add click handlers for terminal input\n $(\"#terminalInput\").keydown(function (e) {\n var command = $(\"#terminalInput\").val();\n if (e.keyCode == 13) {\n sendCommand(command);\n if (commandHistory.indexOf(command) === -1) {\n commandHistory.unshift(command);\n commandIndex = -1;\n }\n } else if (e.keyCode == 9) {\n e.preventDefault();\n\n } else if (e.keyCode == 38 && commandIndex != commandHistory.length - 1) {\n e.preventDefault();\n commandIndex++;\n $(\"#terminalInput\").val(commandHistory[commandIndex]);\n } else if (e.keyCode == 40 && commandIndex > -1) {\n e.preventDefault();\n commandIndex--;\n $(\"#terminalInput\").val(commandHistory[commandIndex]);\n } else if (e.keyCode == 40 && commandIndex <= 0) {\n e.preventDefault();\n $(\"#terminalInput\").val('');\n } else if (e.keyCode == 67 && e.ctrlKey) {\n $(\"#terminalInput\").val(command + '^C');\n replaceInput();\n addInput();\n }\n });\n}", "function processCommand(c) {\n var cmd = c[\"cmd\"]\n var key = c[\"key\"]\n\n switch (cmd) {\n case \"add\": add(key, c[\"title\"], c[\"x\"], c[\"y\"]); break;\n case \"move\": move_to(key, c[\"x\"], c[\"y\"]); break;\n //case \"set_pos_to\": set_pos_to(key, c[\"x\"], c[\"y\"]); break;\n case \"remove\": remove(key); break;\n case \"link\": add_link(c[\"from\"], c[\"to\"]); break;\n case \"change\": change(c[\"key\"], c[\"title\"])\n }\n}", "function parseConsoleCommands(raw) {\n var blocked = ['i', 'include', 'require', 'external'];\n var str = standardizeConsoleCommands(raw);\n var parsed;\n parsed = parseCommands(str);\n parsed.forEach(function(cmd) {\n var i = blocked.indexOf(cmd.name);\n if (i > -1) {\n stop(\"The -\" + blocked[i] + \" command cannot be run in the browser\");\n }\n });\n return parsed;\n }", "function handleCommands (command) {\n let gettingOptions = browser.storage.local.get(OPTIONS_ARRAY)\n gettingOptions.then((options) => {\n if (command === 'quick-bookmark') {\n if (pageIsSupported === true && isOptionEnabled(options, ICON, SHORTCUT)) toggleBookmark()\n }\n }, onError)\n}", "enableConsole() { \n console.log(\"Initializing fxcm command console.. (Press return to continue)\")\n this.showConsole = true\n process.stdin.pause()\n this.init_console();\n process.stdin.resume();\n }", "function IEnumerateExposedCommands() {}", "function help() {\n\tvar commandsArray = ['Help: List of available commands',\n\t\t'<span class=\"green\">>about</span>',\n\t\t'<span class=\"yellow\">>contact</span>',\n\t\t'<span class=\"purple\">>projects</span>',\n\t\t'<span class=\"orange\">>skills</span>',\n\t\t'<span class=\"blue\">>experiences</span>',\n\t\t'>help',\n\t\t'>ping',\n\t\t'>time',\n\t\t'>clear',\n\t\t'>say',\n\t\t'>info',\n\t\t'>exit'];\n\tseperator();\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "hasMoreCommands() {\n return true;\n }", "function runCommands() {\n app\n .command('run <path>')\n .description('Run a bot manually')\n .option('-f --fork', 'Don\\'t re-queue bot after running.')\n .action(runActions);\n}", "function help() {\n\tvar commandsArray = ['Help: List of available commands', '>help', '>about', '>contact', '>ping', '>time', '>clear', '>say'];\n\tfor (var i = 0; i < commandsArray.length; i++) {\n\t\tvar out = '<span>' + commandsArray[i] + '</span><br/>'\n\t\tOutput(out);\n\t}\n}", "function waitForCommandInput() {\n /**\n * Print menu & request input.\n */\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 }\n\n /**\n * Process command.\n *\n * @param {string} command Command string\n */\n function processCmd(command) {\n var cmd = command.split(' ');\n\n switch (cmd[0]) {\n case 'check':\n var result = 'date : ' + currDate.getDate() + '/' + currDate.getMonth() + '/' + currDate.getFullYear() + '\\n';\n result += 'file path : ' + docFile + '\\n';\n result += 'index : ' + index;\n\n console.log(result);\n break;\n\n case 'clear':\n helper.clearScreen();\n break;\n\n case 'date':\n currDate.setFullYear(cmd[3], cmd[2], cmd[1])\n kompas.setDesiredDate(currDate.getDate(), currDate.getMonth(), currDate.getFullYear());\n console.log('date set.');\n break;\n\n case 'file':\n docFile = cmd[1];\n console.log('file set.');\n break;\n\n case 'index':\n index = cmd[1];\n console.log('article index set.');\n break;\n\n case 'h':\n printMenu();\n break;\n\n case 'page':\n kompas.setDesiredPage(cmd[1]);\n console.log('page set.');\n break;\n\n case 'scrap':\n console.log('start Scraping ..');\n startScrapper(cmd[1], function (data) {\n console.log('Scraping finished.');\n\n jsfile.writeFile(docFile, data, {spaces: 4}, function (err) {\n assert.equal(err, null);\n });\n });\n break;\n\n case 'exit':\n process.exit(0);\n }\n\n console.log();\n getCommandInput();\n }\n\n console.log('Type \\'h\\' to show full command list.');\n getCommandInput();\n}", "function EmptyCommand(){\n console.log(chalk.red(\"\\n\\n\\t ██████╗ ██████╗ ███╗ ███╗███╗ ███╗ █████╗ ███╗ ██╗██████╗ ██╗ ██╗ ██████╗ ██╗ ██╗\"));\n console.log(chalk.red(\"\\t██╔════╝██╔═══██╗████╗ ████║████╗ ████║██╔══██╗████╗ ██║██╔══██╗ ██║ ██║██╔═████╗██║ ██║\"));\n console.log(chalk.red(\"\\t██║ ██║ ██║██╔████╔██║██╔████╔██║███████║██╔██╗ ██║██║ ██║ ███████║██║██╔██║███████║\"));\n console.log(chalk.red(\"\\t██║ ██║ ██║██║╚██╔╝██║██║╚██╔╝██║██╔══██║██║╚██╗██║██║ ██║ ╚════██║████╔╝██║╚════██║\"));\n console.log(chalk.red(\"\\t╚██████╗╚██████╔╝██║ ╚═╝ ██║██║ ╚═╝ ██║██║ ██║██║ ╚████║██████╔╝ ██║╚██████╔╝ ██║\"));\n console.log(chalk.red(\"\\t ╚═════╝ ╚═════╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝╚═════╝ ╚═╝ ╚═════╝ ╚═╝\"));\n console.log(\" \");\n console.log(\"\\t\\t\\t\\t _____________________________\");\n console.log(\"\\t\\t\\t\\t| |\")\n console.log(\"\\t\\t\\t\\t| It looks like you submitted |\");\n console.log(\"\\t\\t\\t\\t| an empty command! |\");\n console.log(\"\\t\\t\\t\\t|_____________________________|\");\n console.log(\"\\t\\t\\t\\t \\\\ ^__^\");\n console.log(\"\\t\\t\\t\\t \\\\ (oo)\\\\_______\");\n console.log(\"\\t\\t\\t\\t (__)\\\\ )\\\\/\\\\\");\n console.log(\"\\t\\t\\t\\t ||----w |\");\n console.log(\"\\t\\t\\t\\t || ||\");\n}", "_commandsChanged(newValue){this.addCommands(newValue)}", "function listOfCommands(rover){\nvar commands = prompt(\"Move the Rover: (f)orward, (r)ight, (l)eft (b)ack .\"); //entrada de los movimientos.\n\n if (commands.indexOf('f') >=0 || commands.indexOf('r') >=0 || commands.indexOf('l') >=0 || commands.indexOf('b') >=0){\n var newCommands = commands.split(\"\"); //.indexOf para que se haga el codigo solo con los comandos validos. Si no es un comando valido daria -1.\n console.log(\"La ruta del Rover es: \" + commands); //split para cojer cada caracter por separado de la array.\n for(var i = 0; i < newCommands.length; i++){ //for para hace todos los movimientos que hemos introducido.\n \n switch(commands[i]){ //switch para enviar a la funcion correspondiente a cada movimiento.\n case 'l' :\n turnLeft(rover);\n break;\n case 'r' :\n turnRight(rover);\n break;\n case 'f' :\n moveForward(rover);\n break ;\n case 'b' :\n moveBack(rover)\n break;\n }\n \n var position = [rover1.positionX, rover1.positionY]; //guardar los datos de la posicion del rover en cada movimiento.\n rover1.travelLog.push(position); \n console.log(\"El Rover se encuentra en \" + position);\n }\n \n \n }else{\n alert(\"Enter a valid command\"); //si el movimiento intrducido no es valido, vuelve a llamar a la funcion.\n listOfCommands(rover1);\n }\n}", "function handleMotors() {\n switch (command.id) {\n case 1:\n commandName = \"Forward\";\n commandArgs.push([ \"velocity\", command.args[0] ]);\n commandArgs.push([ \"duration\", command.args[1] ]);\n break;\n case 2:\n commandName = \"Reverse\";\n commandArgs.push([ \"velocity\", command.args[0] ]);\n commandArgs.push([ \"duration\", command.args[1] ]);\n break;\n case 3:\n commandName = \"Left\";\n commandArgs.push([ \"angle\", command.args[0] ]);\n break;\n case 4:\n commandName = \"Right\";\n commandArgs.push([ \"angle\", command.args[0] ]);\n break;\n }\n }", "function echo_command(command) {\n var prompt = command_line.prompt();\n if (command_line.mask()) {\n command = command.replace(/./g, '*');\n }\n if (typeof prompt == 'function') {\n prompt(function(string) {\n self.echo(string + ' ' + command);\n });\n } else {\n self.echo(prompt + ' ' +command);\n }\n }", "function adminCommands(msg){\n\tif(!('text' in msg)) return;\n\t// if(gameChatID == 0 && msg.text == '/newGame') {\n\t// \t//game hasn't been initialized\n\t// \tlet sender = await bot.getChatMember(msg.chat.id, msg.from.id);\n\t// \tif(sender.status == 'creator' || sender.status == 'administrator') {\n\n\t// \t}\n\t// }\n\tif(msg.from.username != ADMIN_USERNAME) return;\n\tif(!msg.text.startsWith(\"@wordCentBot\") && msg.chat.id != msg.from.id) return;\n\tlet command = msg.text;\n\tif(msg.text.startsWith(\"@wordCentBot\")){\n\t\tcommand = msg.text.substring(\"@wordCentBot \".length);\n\t}\n\tswitch(command){\n\t\tcase '/newGame':\n\t\t\tsetupNewGame(msg);\n\t\t\treturn;\n\t\tcase '/show': // log data for debugging. (don't call this in the chat or you will reveal answers)\n\t\t\tlet message = \"\\nplayers:\\n\" +JSON.stringify(players)+\"\\nwords:\\n\"+JSON.stringify(words)+\"\\nopen words:\\n\"+JSON.stringify(openWords);\n\t\t\tbot.sendMessage(msg.chat.id,message);\n\t\t\treturn;\n\t\tcase '/giveNewClue':\n\t\t\tgiveNewClue();\n\t\t\treturn;\n\t\tcase '/giveWarning':\n\t\t\tgiveWarning();\n\t\t\treturn;\n\t\tcase '/giveLeaderboard':\n\t\t\tgiveLeaderboard();\n\t\t\treturn;\n\t\tcase '/automaticHints':\n\t\t\tstartAutomaticHints();\n\t\t\treturn;\n\t\tcase '/saveData':\n\t\t\tsaveData();\n\t\t\treturn;\n\t\tcase '/restartGame':\n\t\t\trestartGame();\n\t\t\treturn;\n\t\tdefault:\n\t\t\treturn;\n\t}\n}", "get validCommands() {\n return [\n \"backColor\",\n \"bold\",\n \"createLink\",\n \"copy\",\n \"cut\",\n \"defaultParagraphSeparator\",\n \"delete\",\n \"fontName\",\n \"fontSize\",\n \"foreColor\",\n \"formatBlock\",\n \"forwardDelete\",\n \"insertHorizontalRule\",\n \"insertHTML\",\n \"insertImage\",\n \"insertLineBreak\",\n \"insertOrderedList\",\n \"insertParagraph\",\n \"insertText\",\n \"insertUnorderedList\",\n \"justifyCenter\",\n \"justifyFull\",\n \"justifyLeft\",\n \"justifyRight\",\n \"outdent\",\n \"paste\",\n \"redo\",\n \"selectAll\",\n \"strikethrough\",\n \"styleWithCss\",\n \"superscript\",\n \"undo\",\n \"unlink\",\n \"useCSS\",\n ];\n }", "_updateCommands() {\n goUpdateCommand(\"cmd_popQuickFilterBarStack\");\n goUpdateCommand(\"cmd_showQuickFilterBar\");\n goUpdateCommand(\"cmd_toggleQuickFilterBar\");\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 evaluateCmd(userInput) {\n //parses the user input to understand which command was typed\n const userInputArray = userInput.split(\" \");\n const command = userInputArray[0];\n\n switch (command) {\n case \"echo\":\n commandLibrary.echo(userInputArray.slice(1).join(\" \"));\n break;\n case \"cat\":\n commandLibrary.cat(userInputArray.slice(1));\n break;\n case \"head\":\n commandLibrary.head(userInputArray.slice(1));\n break;\n case \"tail\":\n commandLibrary.tail(userInputArray.slice(1));\n break;\n default:\n console.log('No such command found');\n }\n}", "function scene::OnCommand(cmdid, system)\r\n{\r\n switch(cmdid)\r\n {\r\n case -1: // created default by the uiman system engine\r\n // is the id of X close button \r\n Destroy(system);\r\n return 1;\r\n case -2: // is the id of Mm button \r\n system.ToggleFullScreen();\r\n return 1;\r\n case 101:\r\n scene.BuildMenu(\"bspmaps/\");\r\n return 1;\r\n case 102:\r\n //scene.ConnToMaster();\r\n break;\r\n case 100: //download levels from www.zalsoft.com/levels200/\r\n scene.CheckRemoteLevels(\"http://www.zalsoft.com/levels200/getic_index.ml\");\r\n return 1;\r\n default:\r\n if(cmdid >=0 && cmdid < maps.len())\r\n {\r\n if(scene.Load(null, maps[cmdid]) == true)\r\n {\r\n system.SetMode(sys_states.PLAY_MODE);\r\n }\r\n else\r\n {\r\n system.SetMode(sys_states.SET_MODE);\r\n }\r\n return 1;\r\n }\r\n break;\r\n }\r\n return 0;\r\n}", "setCommandsEnabled() {\n this.commandsFeatureEnabled_ = true;\n for (const key in Command.Action) {\n const actionId = Command.Action[key];\n let messageId;\n switch (actionId) {\n case Command.Action.DELETE_ONCE:\n messageId = 'dictation_command_delete_once';\n break;\n case Command.Action.MOVE_LEFT_ONCE:\n messageId = 'dictation_command_move_left_once';\n break;\n case Command.Action.MOVE_RIGHT_ONCE:\n messageId = 'dictation_command_move_right_once';\n break;\n case Command.Action.MOVE_UP_ONCE:\n messageId = 'dictation_command_move_up_once';\n break;\n case Command.Action.MOVE_DOWN_ONCE:\n messageId = 'dictation_command_move_down_once';\n break;\n case Command.Action.COPY:\n // TODO(1247299): This command requires text to be selected but\n // composition text changes during speech, clearing the selection.\n // This will work better when we use a different UI than composition\n // text to display interim results.\n messageId = 'dictation_command_copy';\n break;\n case Command.Action.PASTE:\n messageId = 'dictation_command_paste';\n break;\n case Command.Action.CUT:\n messageId = 'dictation_command_cut';\n break;\n case Command.Action.UNDO:\n messageId = 'dictation_command_undo';\n break;\n case Command.Action.REDO:\n messageId = 'dictation_command_redo';\n break;\n case Command.Action.SELECT_ALL:\n messageId = 'dictation_command_select_all';\n break;\n case Command.Action.UNSELECT_ALL:\n messageId = 'dictation_command_unselect_all';\n break;\n case Command.Action.NEW_LINE:\n messageId = 'dictation_command_new_line';\n break;\n default:\n continue;\n }\n const commandString = chrome.i18n.getMessage(messageId);\n this.commandMap_.set(actionId, {\n commandString,\n matchesCommand: this.commandMatcher_(commandString),\n matchesTypeCommand: this.typeCommandMatcher_(commandString)\n });\n }\n }", "addCLICommand(command) {\n this._cli.addCommand(command);\n }" ]
[ "0.7310625", "0.6996635", "0.69690686", "0.67440826", "0.670041", "0.66577625", "0.665758", "0.6646859", "0.6625957", "0.6619377", "0.66154593", "0.6614959", "0.6604315", "0.6603117", "0.64919156", "0.6487909", "0.64818466", "0.6470616", "0.64671856", "0.6457172", "0.64492464", "0.64464885", "0.6442662", "0.6437846", "0.6432302", "0.63942677", "0.63937724", "0.6377639", "0.6338262", "0.6318586", "0.6317295", "0.63171774", "0.63144577", "0.6306644", "0.6301141", "0.62910247", "0.6290815", "0.62656635", "0.6253098", "0.6251037", "0.6248862", "0.62165946", "0.6198787", "0.6191484", "0.6190368", "0.61857766", "0.6184788", "0.61814773", "0.616958", "0.6166922", "0.616595", "0.6154523", "0.6132792", "0.61277807", "0.6119815", "0.60855347", "0.60811573", "0.60810214", "0.60766315", "0.60739917", "0.60722226", "0.6056012", "0.6048807", "0.6048555", "0.6041468", "0.60393137", "0.60355866", "0.603511", "0.603511", "0.60322124", "0.60277903", "0.6027767", "0.60251933", "0.6022056", "0.6008201", "0.60067457", "0.59954953", "0.5990647", "0.5988745", "0.59789115", "0.59787625", "0.5971895", "0.5970572", "0.5953422", "0.5951938", "0.5951901", "0.5950054", "0.5938272", "0.59332454", "0.59316", "0.59229314", "0.59188485", "0.5918366", "0.59183574", "0.59125715", "0.590897", "0.5905344", "0.5901854", "0.5901228", "0.59005547" ]
0.6514209
14